Loading ...
Sorry, an error occurred while loading the content.
 

Groupbox Question

Expand Messages
  • productdevelop
    Lets say that I do the following: groupbox main radio buttons main.rb1 - main.rb8 groupbox main.b radio buttons main.rb1 - main.rb8 open main window All of the
    Message 1 of 2 , Apr 30, 2009
      Lets say that I do the following:

      groupbox main
      radio buttons main.rb1 - main.rb8

      groupbox main.b
      radio buttons main.rb1 - main.rb8

      open main window

      All of the radio buttons run their associated code, no problem. Show/Hide of main.rb1 seems to show/hide the groupbox b button.

      I have tried naming the radio button for groupbox b as:
      radio buttons main.b.rb1 - main.b.rb8

      Same result with operation of the buttons.

      What I wanted to do was to have 2 sets of buttons that I show/hide at different times. I wanted to associate one group with the main window groupbox named "main" with no extension. I wanted to associate the other set with the groupbox main.b. This way, main.rb1 is different from main.b.rb1.

      My conclusion, please correct me where wrong:
      There is no "association" with a group box. These are simple different items in the same window. This is why hiding a box doesn't hide the controls (contents) within a box. The fact that LB accepts the #handle.ext where .b.rb1 = .ext should not confuse you, it actually ignores the .b and the .b does not make the extension unique. Generally, what I did was a bad pratice and it should be avoided. Every control in a window should have a unique handle.ext.

      what say you all?
    • Stefan Pendl
      ... You are correct in your assumptions, so I am just getting into detail with the following. 1) handles should always be unique 2) there is no sub-extension
      Message 2 of 2 , May 2, 2009
        >
        > Lets say that I do the following:
        >
        > groupbox main
        > radio buttons main.rb1 - main.rb8
        >
        > groupbox main.b
        > radio buttons main.rb1 - main.rb8
        >
        > open main window
        >
        > All of the radio buttons run their associated code, no
        > problem. Show/Hide of main.rb1 seems to show/hide the
        > groupbox b button.
        >
        > I have tried naming the radio button for groupbox b as:
        > radio buttons main.b.rb1 - main.b.rb8
        >
        > Same result with operation of the buttons.
        >
        > What I wanted to do was to have 2 sets of buttons that I
        > show/hide at different times. I wanted to associate one
        > group with the main window groupbox named "main" with no
        > extension. I wanted to associate the other set with the
        > groupbox main.b. This way, main.rb1 is different from main.b.rb1.
        >
        > My conclusion, please correct me where wrong:
        > There is no "association" with a group box. These are simple
        > different items in the same window. This is why hiding a box
        > doesn't hide the controls (contents) within a box. The fact
        > that LB accepts the #handle.ext where .b.rb1 = .ext should
        > not confuse you, it actually ignores the .b and the .b does
        > not make the extension unique. Generally, what I did was a
        > bad pratice and it should be avoided. Every control in a
        > window should have a unique handle.ext.
        >
        > what say you all?
        >

        You are correct in your assumptions, so I am just getting into detail with the following.

        1) handles should always be unique
        2) there is no sub-extension
        wrong ..... #window.control.sub-control
        correct ... #window.control
        3) a group box is just a way to group radio buttons, so they work exclusive
        this means that only one of the grouped radio buttons can be set, all
        others are reset
        4) to show and hide multiple controls in one go you will have to create a container via Windows API

        In your case, I would just reuse the radio button group and only change the captions of the radio buttons.
        You can use a variable to determine, which group is currently displayed.

        ---
        Stefan Pendl

        Liberty BASIC Assist 4.03 ........ http://www.libertybasic.com/assist.html
        Liberty BASIC 4.04 public beta ... http://www.libertybasic.com/lb404b3setup.exe

        Windows Vista Home Premium 32-bit SP1
        AMD Turion X2 RM-70 2GHz
        4GB RAM
      Your message has been successfully submitted and would be delivered to recipients shortly.