Use buttons to select variable from a parameter

Home Forums Problems and solutions in GDL Graphical UI and parameters list Use buttons to select variable from a parameter

Viewing 4 reply threads
  • Author
    Posts
    • #18647
      James Goode
      Participant

      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
    • #18648
      Joachim Sühlo
      Participant

      Do you mean something like UI_Radiobutton?

      GDL Object Developer
      b-prisma
      MAC OSx 10.12

      • #18651
        James Goode
        Participant

        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.

    • #18652
      Péter Baksa
      Keymaster

      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

      • #18656
        James Goode
        Participant

        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

    • #18657
      Joachim Sühlo
      Participant

      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, “”, 1

      But 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.12

    • #18659
      Joachim Sühlo
      Participant

      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, 30

      GDL Object Developer
      b-prisma
      MAC OSx 10.12

Viewing 4 reply threads
  • The forum ‘Graphical UI and parameters list’ is closed to new topics and replies.