ListBox
BlitzMax Forums/BlitzMax Beginners Area/ListBox
| ||
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 |
| ||
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. |
| ||
Hi, Jim Thanks for the Help, tell me how do you get your code example in that neat box? |
| ||
forum codes here |
| ||
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): |