My GUI for Blitz3D SDK + BlitzMax

Archives Forums/Blitz3D SDK Programming/My GUI for Blitz3D SDK + BlitzMax

Luke111(Posted 2011) [#1]
So I was working on a project, and realized that a GUI was a necessity.
I looked but could not find one that fit my needs: A BlitzMax GUI for use with the BlitzMax Blitz3D SDK Wrapper.

I know, there is MaxGUI (which I believe someone on the forums managed to get working together, with a canvass or something), but it has extremely crappy controls altogether, and is a pain in the butt to code with.

I wrote my own. It has support for pseudo-events, multiple windows, and a few controls. It is not hard to add more, but I don't need any other ones at the moment.

I know my programming is crap (I hope it's good enough for a 14 yr old). Please don't be rude about it.
Constructive criticism would be nice, however.

Current Controls:
Window (TWindow, it is movable!!!)
Button (TButton, also hackable as a label. Just change the event to blank, and make the background the same as the parent window's)
Textbox (TTextbox)
DropList (TDropList)

Downloads are at the following page
http://experimental.thegamerboard.com/index.html

A small program that writes the contents of the textbox
to C:\Test.txt (not tested):
Import blitz3d.blitz3dsdk
bbBeginBlitz3d()
bbGraphics 800,600,32,2
Include "LukeGUI.bmx"
LGUIRenderer:TLukeGUIRenderer = LukeGUIRenderer.Create()
'Window
TWindow.Create("FrmTest1",300,250,200,100,"Write Text", ..
    LGUIRenderer,TRGB_WHITE,TRGB_BLACK)

'Textbox
TTextbox.Create("TheTextbox",50,25,GetIntWidth(10), ..
    bbFontHeight() + 2, "Textbox 1",0,LGUIRenderer,TRGB_WHITE, ..
    TRGB_BLACK)

'Buttons
TButton.Create("TheSaveButton",75,75,GetTextWidth("Save"), ..
    bbFontHeight() + 2,"Save",0,LGUIRenderer,TRGB_BLUE,TRGB_WHITE)

'event system stuff
Type FrmTest1
    Method OnShow()

    End Method
    Method OnHide(OSender:OARY_SENDER)
        End
    End Method
End Type
Type TheSaveButton
    Method OnClick()
        Local f:TStream = WriteFile("C:\Test.txt")
        WriteLine f,LGUIRenderer.Windows[0].Textboxes[0].Value
        CloseFile f
    End Method
End Type

'actual loop
Repeat
    LGUIRenderer.Update()
    bbCls()
    LGUIRenderer.Render()
    bbFlip()
Forever