GUILib

BlitzMax Forums/BlitzMax Programming/GUILib

JoshK(Posted 2005) [#1]
I have a GUI DLL working. The commands are similar to BlitzPlus. The library uses gadget layouts, like BlitzPlus, gadget colors, as well as some extra gadget control commands.




JoshK(Posted 2005) [#2]
.


Haramanai(Posted 2005) [#3]
And?


JoshK(Posted 2005) [#4]
Well I assume BlitzMax can call a dll.


Haramanai(Posted 2005) [#5]
Ok. Why i still wand to see what you have done? In code not and not in screanshot.


REDi(Posted 2005) [#6]

Well I assume BlitzMax can call a dll.


Yes it can, but you still need the dll to be able to call it ;)

LINK PLEASE :)


JoshK(Posted 2005) [#7]
Soon. I need to finish up recursive resizing.


Wiebo(Posted 2005) [#8]
Looks promising. Weird colors though =]


Sarge(Posted 2005) [#9]
What did you code this in ?

yes you can call the dll in blitzmax yet i dont think you can if you created it in .net

btw it looks good and 3D World Studio was very impressive.


SillyPutty(Posted 2005) [#10]
looks good halo !


JoshK(Posted 2005) [#11]
It's C. Collaberation with a friend.


Kuron(Posted 2005) [#12]
Why i still wand to see what you have done?
When he first posted this, he posted the DLL & the commands it supports.

I downloaded it and tried it and found it to work as advertised.


Haramanai(Posted 2005) [#13]
Why I miss all the fun?:<


JoshK(Posted 2005) [#14]
The original dll only had windows. I will have more when i post a new one.

This is real windows controls, by the way, NOT DirectX drawing.


Jeroen(Posted 2005) [#15]
Halo, is this DLL going to give us certain advantages over the BRL GUI lib that is being made? Thanks!


JoshK(Posted 2005) [#16]
That I couldn't tell you, and don't really want to take business away from BR, but this will probably be available sooner.

I am primarily making this for my own use with BlitzPlus, but I will release it as a product if I can make few bucks off it.


JoshK(Posted 2005) [#17]
Okay, here you go:
http://www.leadwerks.com/post/GUILib.dll

No documentation. Commands are the same as BlitzPlus, except that I use "Control" instead of "Gadget".

Supported:
textfield
combobox
panel
button
checkbox
listbox
window
SetControlLayout
SetControlColor

Use WaitEvent()=$803 to exit the program.

Example:
window=CreateWindow("GUI",200,200,400,300,0,2+64)
setcontrolcolor(window,64,64,64,0,0,0)

x=6
y=6
control=CreateButton("Button",x,y,70,26,window,0)
setcontrolcolor(control,64,64,64,192,192,192)
setcontrollayout(control,1,1,0,0)
x=x+ControlWidth(control)+6

control=CreateLabel("Label",x,y+6,40,26,window,0)
setcontrolcolor(control,64,64,64,192,192,192)
setcontrollayout(control,1,1,0,0)
x=x+ControlWidth(control)+6

control=CreateCheckBox("CheckBox",x,y,70,26,window,0)
setcontrolcolor(control,64,64,64,192,192,192)
setcontrollayout(control,1,1,0,0)
x=x+ControlWidth(control)+6

control=CreateComboBox(x,y,ClientWidth(window)-x-6,26,window,0)
setcontrollayout(control,1,1,1,2)
x=x+ControlWidth(control)+6
setcontrolcolor(control,96,96,96,192,192,192)

x=6
y=y+26+6

control=CreateListBox(x,y,ClientWidth(window)-2*x,100,window,0)
setcontrollayout(control,1,1,1,0)
y=y+ControlHeight(control)+6
setcontrolcolor(control,96,96,96,192,192,192)

control=CreatePanel(x,y,ClientWidth(window)-2*x,80,window,1)
setcontrollayout(control,1,1,1,0)
setcontrolcolor(control,64,64,64,192,192,192)
setcontroltext(control,"Panel")
y=y+ControlHeight(control)+6
panel=control

control=CreateTextField(x,y,120,20,window,0)
setcontrollayout(control,1,1,1,0)
setcontrolcolor(control,96,96,96,192,192,192)
setcontroltext(control,"TextField")

While WaitEvent()<>$803
Wend



JoshK(Posted 2005) [#18]
And here is an example executable:
www.leadwerks.com/post/GUILib.exe


Haramanai(Posted 2005) [#19]
........................


Haramanai(Posted 2005) [#20]
Andi still HEAVY METAL. greed. money. money. money .money


JoshK(Posted 2005) [#21]
Stupid Linux hippie.


Kernle 32DLL_2(Posted 2005) [#22]
looks very nice,but unfortunatly i'm not able to use this great dll. would be nice when somebody will post a solution to import the dll. Or Halo would build a module :)

edit:
LoadLibraryA("GUILib.dll")



Dreamora(Posted 2005) [#23]
And then? If you can't use the dll (ie no windows) you can't use the module as well as it uses WinAPI.

You'll have to wait for the official GUI which is multiplatform then.


Sarge(Posted 2005) [#24]
This is how you do it in blitzmax
Next Post

but i dont know what the params are so if you could post them here for me i could do the rest ex: CreateButton( hwnd:int, x:int, y:int, width:int, height:int, flags:int )

btw a module is possible as you might have saw the gui i created in blitzmax using pure winapi.


kfprimm(Posted 2005) [#25]
how come when i load the dll with LoadLibraryA() then put nothing else and run it it still loads up the example


JoshK(Posted 2005) [#26]
All your parameters up there are correct except "hwnd" should be "parent" (they are not the same thing) and CraeteWindow also has a parent parameter.

Comments? Demos? I would like to see this in use. There are definitely still bugs, but I am getting there.


Sarge(Posted 2005) [#27]
First thing is the demo window should'nt open when the dll is called. (edit)

I will try find some other things.


Sarge(Posted 2005) [#28]
another bug, if i resize the window the button turns black with the following code
window=CreateWindow( "GUI", 200, 200, 400, 300, 0, 2+64 )
control=CreateButton( "Button", 10, 10, 70, 26, window, 0 )

and all the gadgets seems to be moving abit with the window while i resize and i am not using the layout command so maby by default you should set the Left and Top to 1.

The Panel doesnt seem to be updating because when you put another window over it for example it just draws the ugly bits in the panel


Sarge(Posted 2005) [#29]
The updated commands
Gui=LoadLibraryA("GUILib.dll")

Global CreateWindow( text$z, x:Int, y:Int, w:Int, height:Int, parent:Int, flags:Int)"win32"=getprocaddress(Gui,"CreateWindow")
Global CreateButton( text$z, x:Int, y:Int, w:Int, height:Int, parent:Int, flags:Int)"win32"=getprocaddress(Gui,"CreateButton")
Global CreateLabel( text$z, x:Int, y:Int, w:Int, height:Int, parent:Int, flags:Int)"win32"=getprocaddress(Gui,"CreateLabel")
Global CreateCheckBox( text$z, x:Int, y:Int, w:Int, height:Int, parent:Int, flags:Int)"win32"=getprocaddress(Gui,"CreateCheckBox")
Global CreateComboBox( x:Int, y:Int, w:Int, height:Int, parent:Int ,flags:Int)"win32"=getprocaddress(Gui,"CreateComboBox")
Global CreateListBox( x:Int, y:Int, w:Int, height:Int, parent:Int, flags:Int)"win32"=getprocaddress(Gui,"CreateListBox")
Global CreatePanel( x:Int ,y:Int, w:Int, height:Int, parent:Int, flags:Int)"win32"=getprocaddress(Gui,"CreatePanel")
Global CreateTextField( x:Int, y:Int, w:Int, height:Int, parent:Int, flags:Int)"win32"=getprocaddress(Gui,"CreateTextField")
Global SetControlLayout( parent:Int, Left, Top, Right, Bottom )"win32"=getprocaddress(Gui,"SetControlLayout")
Global SetControlColor( parent:Int, br, bg, bb, tr, tg, tb )"win32"=getprocaddress(Gui,"SetControlColor")
Global ControlWidth( parent:Int )"win32"=getprocaddress(Gui,"ControlWidth")
Global ControlHeight( parent:Int )"win32"=getprocaddress(Gui,"ControlHeight")
Global SetControlText( parent:Int , text$z )"win32"=getprocaddress(Gui,"SetControlText")

window=CreateWindow( "GUI", 200, 200, 400, 300, 0, 2+64 )
control=CreateButton( "BUTTON", 10, 10, 70, 26, window, 0 )
SetControlText( control, "TEST" )
SetControlLayout( control, 1, 1, 0, 0 )
SetControlColor( control, 255,255,255,50,255,100 )
Print ControlWidth( control )
Print ControlHeight( control )
'control=CreateLabel( "Label", 10, 10, 40, 26, window, 0 )
'control=CreateCheckBox( "CheckBox", 10, 10, 70, 26, window, 0 )
'control=CreateComboBox( 10, 10, 50, 26, window, 0 )
'control=CreateListBox( 10, 10, 50, 100, window, 0 )
'control=CreatePanel( 50, 50, 50, 80, window, 1 )
'control=CreateTextField( 10, 10, 120, 20, window, 0 )

Repeat
Until KeyHit( Key_Escape )


found a error if you use "SetControlColor( control, 255,255,255,50,255,100 )" then "SetControlText( control, "TEST" )" then SetControlText wont work unless you resize so just add UpdateWindow in the SetControlColor function.