ListBox

BlitzMax Forums/BlitzMax Beginners Area/ListBox

dalaware(Posted 2006) [#1]
Hi
Could somebody help with this Blitz Max program below, I’m no expert, but I can make this type of program work using Blitz3D. What I wanted to do is enter a number preferable a float
Variable limited to .00 in the next box enter a percentage Variable, then out put the result to the next box. I hope some one can show me how to do this. Code would be helpful but please, please make it simple that even a beginner at Blitz Max like me can understand.


SuperStrict


Local MyWindow:TGadget=CreateWindow(" My Tool Box V1.0", 350,120,400,400) 'the position of the toolbox in the mainwindow
Local ListBox:TGadget=CreateListBox(50,50,290,20,MyWindow) 'the size of the listbox inside the toolbox window

Local Label0:TGadget=CreateLabel("Working out Percentages",135,5,300,20,MyWindow) ' write text to te Main ToolBox window

AddGadgetItem ListBox, " Formular : Value / by 100 x the percent your looking for" ' create a listbox and put text in to it

Global Label1:TGadget=CreateLabel("Enter Value :",50,113,70,25,MyWindow) ' write text to te Main ToolBox window


Local MyInput_1:TGadget=CreateTextField(135,110,85,20,MyWindow) ' a sort of Input




Global Label_2:TGadget=CreateLabel("Enter Percent %:",50,173,85,20,MyWindow) ' write text to te Main ToolBox window


Local MyInput_2:TGadget=CreateTextField(135,170,85,20,MyWindow) ' a sort of Input




Global Label_3:TGadget=CreateLabel("The result is :",50,233,85,20,MyWindow) ' write text to te Main ToolBox window


Local MyInput_3:TGadget=CreateTextField(135,230,85,20,MyWindow) ' a sort of Input




'Global Label1:TGadget=CreateLabel("Enter Value :",50,113,70,25,MyWindow)



Repeat
WaitEvent()
Select EventID()
Case EVENT_WINDOWCLOSE
End
End Select


Forever


EOF(Posted 2006) [#2]
Here's a simple version to get you going:

You can use SetGadgetFilter for controlling the data being entered into the textfields. I'll try and knock something up to show you how.


dalaware(Posted 2006) [#3]
Hi, Jim

Thanks for the Help, tell me how do you get your code example in that neat box?


assari(Posted 2006) [#4]
forum codes here


EOF(Posted 2006) [#5]
Use codebox /codebox tags wrapped in []
Also, refer to Forum Codes

Here is an example using filters to prevent the user entering unwanted data (such as letters/characters):