News:

PlayBASIC2DLL V0.99 Revision I Commercial Edition released! - Convert PlayBASIC programs to super fast Machine Code. 

Main Menu

Dragon GUI

Started by Draco9898, September 01, 2007, 08:35:56 AM

Previous topic - Next topic

Draco9898

download demo-v0.01a-

Just wanted to make this it's own topic as this is another pet project of mine. I've always wanted to make a nice gooey (GUI). :)

I haven't found any kinks so far, other than the current active window and attached gadgets not changing rendering depth as I haven't gotten to that.

Just got done putting the finishing touches on detecting mouse Z-depth. You shouldn't be able to fiddle with objects behind a window from inside a window...etc.
DualCore Intel Core 2 processor @ 2.3 ghz, Geforce 8600 GT (latest forceware drivers), 2 gigs of ram, WIN XP home edition sp2, FireFox 2.

"You'll no doubt be horrified to discover that PlayBasic is a Programming Language." -Kevin

kevin


   Look & runs  good.   Wack a screen up for the lazy punters :)

Draco9898

#2
new "demo"

We have:
Window, scrollbar (vert,hori), slider (vert,hori), label (text), button, tray, hook
text entry feild (what a pain in the butt!)

Need to make:
Drop-menu, drop-menu-item (expandable and non), text entry box, value changer box, file-explorer, color-pallete, tree-menu, tree-menu-item
DualCore Intel Core 2 processor @ 2.3 ghz, Geforce 8600 GT (latest forceware drivers), 2 gigs of ram, WIN XP home edition sp2, FireFox 2.

"You'll no doubt be horrified to discover that PlayBasic is a Programming Language." -Kevin

Draco9898

Windows now come to top on focus, added check box gadget.
DualCore Intel Core 2 processor @ 2.3 ghz, Geforce 8600 GT (latest forceware drivers), 2 gigs of ram, WIN XP home edition sp2, FireFox 2.

"You'll no doubt be horrified to discover that PlayBasic is a Programming Language." -Kevin

Draco9898

#4
DRAGON GUI v0.02 SOURCE.

Need people to fiddle around with this and make some apps. Need feedback.

Commands:
Create_GuiTray - create a tray that you can put buttons into. The Xposition, Ypos, and YLength of the buttons will automatically be handled for you (I.e: you may leave X,Y,Ylen totally blank).
Create_GuiButton - create a button, can be 'attached' on windows and trays
Create_GUIScrollBar - create a scrollbar, can be attached to windows
Create_GUISlider - create a slider, can be attached to windows
   GetSliderPos - gets the sliders bars current position
   SetSliderPosition - sets the sliders position
Create_GUIWindow - creates an empty window with a title bar
   Lock_GUIWindow - will lock a window in place, so it cannot be moved
Create_GuiHook - creates a 'hook', this is like a placeholder you can attach to windows that you can use to position things inside the window, like text or images
Create_GuiLabel - create a text label inside a window or not
Create_GuiTextFeild - creates a text entry box to allow the user to enter a string of text the size of the box
Create_GuiCheckBox - creates a checkbox, attaches to windows or nothing.


HOW to- Make a gadget:
All gadget creation commands return the index of the created gadget for handling, I.E:
MyTray = Create_GuiTray(0,0,AScreenW#,18)

How to- attach a button to a window-

`windows
DIM Mywindows(1)
Dim Mybuttons(1)
Mywindows(1)=Create_GUIWindow("holding a button",100,200,260,120)
Mybuttons(1)=Create_GuiButton(30,60,40,20,"Button",Mywindows(1))
DualCore Intel Core 2 processor @ 2.3 ghz, Geforce 8600 GT (latest forceware drivers), 2 gigs of ram, WIN XP home edition sp2, FireFox 2.

"You'll no doubt be horrified to discover that PlayBasic is a Programming Language." -Kevin

kevin

   Runs good,  but there's a few things you'll have to cover so that punters can build stuff with it.

   How do users detects clicks/events from the gui.  Ie. How do they react to changes like a button state, scroll bar moved, window closed  etc.

   How do I get the position of an object ?

   Can I reposition an object ?
   

QuoteCreate_GuiTray - create a tray that you can put buttons into. The Xposition, Ypos, and YLength of the buttons will automatically be handled for you (I.e: you may leave X,Y,Ylen totally blank).
What's a tray  ?
     
QuoteCreate_GuiButton - create a button, can be 'attached' on windows and trays
Can i retrieve or change the button text ?
    How do i know what button was pressed ?

QuoteCreate_GUIScrollBar - create a scrollbar, can be attached to windows
So this controls the 'viewport' of the window ?   


QuoteCreate_GUISlider - create a slider, can be attached to windows
   GetSliderPos - gets the sliders bars current position
   SetSliderPosition - sets the sliders position
How do set the scale of the slider ?     
 

QuoteCreate_GUIWindow - creates an empty window with a title bar
   Lock_GUIWindow - will lock a window in place, so it cannot be moved

   How can I change the windows title  ?
   How can  I close/resize the window ?
   How do i know what window is in focus ?


QuoteCreate_GuiHook - creates a 'hook', this is like a placeholder you can attach to windows that you can use to position things inside the window, like text or images

    Do I have to Hook an object in order to get it's position/size   
    How can I get the position/size of an object ?
   

QuoteCreate_GuiLabel - create a text label inside a window or not
Can I set/get the caption after the object has been created?.

QuoteCreate_GuiTextFeild - creates a text entry box to allow the user to enter a string of text the size of the box

     How I get the text on entry ?   
     
QuoteCreate_GuiCheckBox - creates a checkbox, attaches to windows or nothing.



  What about a Picture gadget,  so the user attach the picture to the parent.  then render directly to the gadget.    Since it's GUI objectg, if it could return clicks/positions relative to the clicked image.  Then the user wouldn't have to resolve themselves.       



Draco9898

Quote
   Runs good,  but there's a few things you'll have to cover so that punters can build stuff with it.

Let's do it

Quote
   How do users detects clicks/events from the gui.  Ie. How do they react to changes like a button state, scroll bar moved, window closed  etc.
Quote
   How do I get the position of an object ?

ThisX# = GadgetCol( MyGadgetsIndex ).X#
ThisY# = GadgetCol( MyGadgetsIndex ).Y#


Quote
   Can I reposition an object ?
Need to make some commands or some gadgets with parents won't work correctly (windows).

Quote
QuoteCreate_GuiTray - create a tray that you can put buttons into. The Xposition, Ypos, and YLength of the buttons will automatically be handled for you (I.e: you may leave X,Y,Ylen totally blank).
What's a tray  ?
A tray is equal to something like the windows taskbar, which you can populate with stuff

Quote
QuoteCreate_GuiButton - create a button, can be 'attached' on windows and trays
Can i retrieve or change the button text ?
    How do i know what button was pressed ?

If DGui.ButtonActive = MyButtonsIndex
   `Do something cool here
Endif


Quote
QuoteCreate_GUIScrollBar - create a scrollbar, can be attached to windows
So this controls the 'viewport' of the window ?   
No, though a little sketchy, you could use them to scroll through various user-coded items. They are going to be used to be built hook-on to various boxes of information.
Quote
QuoteCreate_GUISlider - create a slider, can be attached to windows
   GetSliderPos - gets the sliders bars current position
   SetSliderPosition - sets the sliders position
How do set the scale of the slider ?     

Errrr, yeah need to fix that, currently it's: zero TO gadgetlength-Sliderlength
Quote
QuoteCreate_GUIWindow - creates an empty window with a title bar
   Lock_GUIWindow - will lock a window in place, so it cannot be moved

   How can I change the windows title  ?
Will make a command for this
Quote
   How can  I close/resize the window ?
Added closing/opening today. Resize needs a command as all GUI gadgets are just drawn as pre-rendered images.

Quote
  How do i know what window is in focus ?
Will add a command, but currently it's whichever gadget has a .Mydepth value of 1

Quote
QuoteCreate_GuiHook - creates a 'hook', this is like a placeholder you can attach to windows that you can use to position things inside the window, like text or images

    Do I have to Hook an object in order to get it's position/size   
    How can I get the position/size of an object ?

Might remove hooks as there are issues with closing windows that would make the user have to do some nesting stuff to get things working right. I wanted to have various gadgets be able to point to any user value, but I can't seem to get it working, which is why I created hooks, which are really just placeholders.
You can get any gadgets position and size using GadgetCol.X#,Y#,Xlen#,YLen# varibles, hooks have a placeholder size so it will adjust other gadgets in trays accordingly.

Quote
QuoteCreate_GuiLabel - create a text label inside a window or not
Can I set/get the caption after the object has been created?.
Need to roll a command for that

Quote
QuoteCreate_GuiTextFeild - creates a text entry box to allow the user to enter a string of text the size of the box

     How I get the text on entry ?   
Need to roll a command for that

Quote
  What about a Picture gadget,  so the user attach the picture to the parent.  then render directly to the gadget.    Since it's GUI objectg, if it could return clicks/positions relative to the clicked image.  Then the user wouldn't have to resolve themselves.       
created a image gadget today, will probably make a imageBOX gadget later that only shows part of an image
DualCore Intel Core 2 processor @ 2.3 ghz, Geforce 8600 GT (latest forceware drivers), 2 gigs of ram, WIN XP home edition sp2, FireFox 2.

"You'll no doubt be horrified to discover that PlayBasic is a Programming Language." -Kevin

Draco9898

#7
After scouring the internet and playbasic for a math function to find a value using a percent inside a range, I just found it the hard way. Don't laugh, I'm bad at math. As a result, Sliders now accept params for beginning range and ending range. The length of the gadget nor the gadget's bar do not matter any more. ::)
DualCore Intel Core 2 processor @ 2.3 ghz, Geforce 8600 GT (latest forceware drivers), 2 gigs of ram, WIN XP home edition sp2, FireFox 2.

"You'll no doubt be horrified to discover that PlayBasic is a Programming Language." -Kevin

kevin


Draco9898

#9
Draw it, draw it FAST....

Recoding the draw routines, currently the GUi only renders the number of windows open and nothing else (unless you interact with a gadget), resulting in a good 300-400 fps boost. Thanks to Kevin for the idea.

Everything is hooked back up and is ready to roll. Demo below.

New image gadget allows you to just burn a image to a window, rather than drawing it every single loop.

Made some procedural red bubbles on two windows. 

update: I wish windows looked like the last screenshot, haha.
DualCore Intel Core 2 processor @ 2.3 ghz, Geforce 8600 GT (latest forceware drivers), 2 gigs of ram, WIN XP home edition sp2, FireFox 2.

"You'll no doubt be horrified to discover that PlayBasic is a Programming Language." -Kevin

kevin


  Works well!     One thing the comes to mind however, is that dynamically updating windows like the 'sine wave' one.   Should still refresh when changes made between frames.  So even windows out of focus can be  redrawn.


Draco9898

#11
It can, I just made it so it doesn't-

one last screen for awhile-

DualCore Intel Core 2 processor @ 2.3 ghz, Geforce 8600 GT (latest forceware drivers), 2 gigs of ram, WIN XP home edition sp2, FireFox 2.

"You'll no doubt be horrified to discover that PlayBasic is a Programming Language." -Kevin

Draco9898

Did someone order some Bug-be-gone?

Fixed some issues with buttons and button-like gadgets and subsequently broke just about everything and the kitchen sink to boot...Hopefully everything should work obediently now.
DualCore Intel Core 2 processor @ 2.3 ghz, Geforce 8600 GT (latest forceware drivers), 2 gigs of ram, WIN XP home edition sp2, FireFox 2.

"You'll no doubt be horrified to discover that PlayBasic is a Programming Language." -Kevin