Home › Forums › Problems and solutions in GDL › Graphical UI and parameters list › Use buttons to select variable from a parameter
- This topic has 6 replies, 3 voices, and was last updated 4 years, 10 months ago by Joachim Sühlo.
-
AuthorPosts
-
-
March 25, 2020 at 17:12 #18647James GoodeParticipant
How can I have 3 separate buttons that can select a different option from the same parameter?
This is code that I’ve adapted from another object I have. Any help is appreciated.
ui_infield{3} "existing", 0, 100, 100, 20, 5, "", 1, 1, 100, 100, 100, 100, 1, e1,e1 ui_infield{3} "existing", 0, 130, 100, 20, 5, "", 1, 1, 100, 100, 100, 100, 1, e2,e2 ui_infield{3} "existing", 0, 160, 100, 20, 5, "", 1, 1, 100, 100, 100, 100, 1, e3,e3
-
March 25, 2020 at 18:42 #18648Joachim SühloParticipant
Do you mean something like UI_Radiobutton?
GDL Object Developer
b-prisma
MAC OSx 10.14-
March 26, 2020 at 11:45 #18651James GoodeParticipant
Yeah kind of, I know that I can use those circular radio buttons but what I really want is a button similar to the ui_button where it’s a solid rectangle so I can have 3 of them and each button will activate a different option.
-
-
March 26, 2020 at 14:12 #18652Péter BaksaKeymaster
Method 5 is a simple pushbutton, it only has on/off states.
With method 4 or 6 more states are available, but you have to draw the pictures on the buttons, just giving a string is not possible.
All options go in the same statement:ui_infield{3} "existing", 0, 100, 100, 20, 4, "", 0, 0, 0, 0, 0, 0, 0, "one", 1, 0, "two", 2, 0, "three", 3
And setting the options in parameter script is also necessary:
values "existing" 1,2,3
To use strings code many boolean buttons, which are conected in the parameter script and only one of them can be selected.
Péter Baksa
Library Platform, Software Engineer
GRAPHISOFT SE-
March 27, 2020 at 18:35 #18656James GoodeParticipant
Hi,
Thanks for your reply. This doesn’t really do what I need, I need separate buttons that are apart from each other that activate a different option.Is there a way to create a boolean button that looks the same as a UI_button?
Thanks
-
-
March 27, 2020 at 20:06 #18657Joachim SühloParticipant
This is a boolean exampe with 1 button:
UI_INFIELD{3} “b_MVO_endgroesse”, 0, 0, 25 ,25,
6, Tree_MVO_3, 2, 1, 25, 25, 25, 25,
1, “”, 0,
2, “”, 1But I am not shure if this looks the same as a UI_Button.
The grafic file Tree_MVO_3 is embedded, if you use an external it must be “Tree_MVO_3” or similar.
This file has 2 grafics beside each other, one for the Value zero, the other for the value 1.GDL Object Developer
b-prisma
MAC OSx 10.14 -
March 28, 2020 at 20:45 #18659Joachim SühloParticipant
And yes, there are special boolen buttons as well, which look a bit different than the example before:
UI_PICT_PUSHCHECKBUTTON “myBool”, “myText”, “myPict”, 1, 0, 110, 100, 30GDL Object Developer
b-prisma
MAC OSx 10.14
-
-
AuthorPosts
- The forum ‘Graphical UI and parameters list’ is closed to new topics and replies.