summaryrefslogtreecommitdiff
path: root/simplegui
diff options
context:
space:
mode:
Diffstat (limited to 'simplegui')
-rw-r--r--simplegui/.cvsignore2
-rw-r--r--simplegui/font.bmfbin0 -> 24420 bytes
-rw-r--r--simplegui/test.bmx52
3 files changed, 54 insertions, 0 deletions
diff --git a/simplegui/.cvsignore b/simplegui/.cvsignore
new file mode 100644
index 0000000..8f686ea
--- /dev/null
+++ b/simplegui/.cvsignore
@@ -0,0 +1,2 @@
+test.debug.exe
+.bmx \ No newline at end of file
diff --git a/simplegui/font.bmf b/simplegui/font.bmf
new file mode 100644
index 0000000..38378e6
--- /dev/null
+++ b/simplegui/font.bmf
Binary files differ
diff --git a/simplegui/test.bmx b/simplegui/test.bmx
new file mode 100644
index 0000000..aaf94c2
--- /dev/null
+++ b/simplegui/test.bmx
@@ -0,0 +1,52 @@
+' $Id$
+
+Import noddybox.simplegui
+Import noddybox.bitmapfont
+
+Incbin "font.bmf"
+
+Const SCRW=800
+Const SCRH=600
+
+SetGraphicsDriver GLMax2DDriver()
+Graphics SCRW,SCRH,32,60' Or HARDSYNC
+
+font:TBitmapFont=TBitmapFont.Load("incbin::font.bmf",0)
+
+gui:TGUIHandler=TGUIHandler.Create()
+
+label1:TLabel=TLabel.Create(font,0,0,"Text 1: ")
+label2:TLabel=TLabel.Create(font,0,20,"Text 2: ")
+text1:TText=TText.Create(font,label1.w,0,"Text entry 1",20)
+text2:TText=TText.Create(font,label2.w,20,"Text entry 2",30)
+
+gui.Register(label1)
+gui.Register(label2)
+gui.Register(text1)
+gui.Register(text2)
+
+SetBlend(ALPHABLEND)
+
+While Not KeyHit(KEY_ESCAPE)
+ Cls
+
+ If KeyHit(KEY_F1)
+ gui.SetFocus(Null)
+ EndIf
+
+ If KeyHit(KEY_F2)
+ gui.SetFocus(text1)
+ EndIf
+
+ If KeyHit(KEY_F3)
+ gui.SetFocus(text2)
+ EndIf
+
+ gui.EventLoop()
+
+ Flip
+ FlushMem
+Wend
+
+EndGraphics
+End