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

RE: [eiffel_software] Question about makiing non-resizeable controls using EiffelBuild

Expand Messages
  • Chris Saunders
    Thanks to Peter and Jocelyn (although I didn t understand yours until after I read the response from Peter). I m attempting to convert a WEL application I
    Message 1 of 17 , Feb 1 2:03 AM
    • 0 Attachment
      Thanks to Peter and Jocelyn (although I didn't understand yours until after
      I read the response from Peter).



      I'm attempting to convert a WEL application I wrote using EiffelBuild to
      create the user interface. The original has some radio buttons that are
      contained in a group box as well as a couple that aren't. I don't see a
      control that appears to correspond to a group box in the available widgets.
      Is there one?



      Regards,

      Chris Saunders



      _____

      From: eiffel_software@yahoogroups.com
      [mailto:eiffel_software@yahoogroups.com] On Behalf Of Peter Gummer
      Sent: Thursday, February 01, 2007 2:24 AM
      To: eiffel_software@yahoogroups.com
      Subject: Re: [eiffel_software] Question about makiing non-resizeable
      controls using EiffelBuild



      Jocelyn wrote:
      > since at least one all the childs of a container will be expanded, the
      > trick is to insert an EV_CELL which will be expandable.

      Actually, don't you need to insert a CELL only on the left? Many of my
      containers have "Is_item_expanded?" switched off for all children. It seems
      to leave a vacant space at the right (if the container is a HORIZONTAL_BOX)
      or at the bottom (if it's a VERTICAL_BOX).

      - Peter Gummer





      [Non-text portions of this message have been removed]
    • Peter Gummer
      ... Yes, been there, done that. I was looking for something called GROUP_BOX (due to my familiarity with TGroupBox in Delphi VCL and with GroupBox in .NET
      Message 2 of 17 , Feb 1 3:23 AM
      • 0 Attachment
        Chris Saunders wrote:
        > I'm attempting to convert a WEL application I wrote using EiffelBuild to
        > create the user interface. The original has some radio buttons that are
        > contained in a group box as well as a couple that aren't. I don't see a
        > control that appears to correspond to a group box in the available
        > widgets.
        > Is there one?

        Yes, been there, done that. I was looking for something called GROUP_BOX
        (due to my familiarity with TGroupBox in Delphi VCL and with GroupBox in
        .NET WinForms); but there ain't no such class. What you need goes by the
        name of FRAME: it's one of the containers.

        FRAME gives the desired visual effect of (not surprisingly) drawing a frame
        around the enclosed widgets. Very logical really. You don't have to put the
        radio buttons in a FRAME, however, for the radio buttons to behave as a
        group. It seems that any container will do, as long as you don't need the
        visual effect of a frame; you can simply drop the radio buttons into a
        HORIZONTAL_BOX if you want.

        One thing to beware of with FRAME is that, unlike other containers such as
        HORIZONTAL_BOX, FRAME can contain only one widget. This frustrated me until
        I understood it, because I kept trying to drop multiple widgets into a FRAME
        and nothing would happen. Some sort of pop-up tooltip telling me what I was
        doing wrong would have been helpful. Eventually I figured out that it would
        only accept one widget, so I dropped a horizontal or vertical box into the
        FRAME, and then I dropped the radio buttons, etc. into the box. It's all
        very logical, if not intuitive.

        Placing a horizontal or vertical box insde the FRAME is useful for another
        reason: by default, the enclosed widgets jam up against the edges of the
        FRAME. It looks really ugly. (Parts of EiffelStudio and EiffelBuild often
        have a cramped appearance; I imagine that this default
        jam-'em-up-against-the-border behaviour is to blame.) To get a
        better-looking user interface, set the box's "Border Width" attribute to
        some non-zero value. I have defined a constant (via EiffelBuild's
        "Constants" toolbar button), which I call "border_width", with a value of 2
        pixels. I set the outermost box inside the FRAME to have this border width.
        This gives the contents of the FRAME a bit of room to breathe. FRAME does
        not have "Border Width", so it's usually worth dropping a box into the FRAME
        for this reason alone, even if it will contain only one widget.

        Boxes also have a "Padding Width" attribute: this is another useful cosmetic
        thing, supplied by the box classes, but not by FRAME.

        - Peter Gummer
      • Jocelyn
        As a side note, Usually the radio buttons group is define by being contained by the same container. However you can Merge radio groups , this is useful if
        Message 3 of 17 , Feb 1 4:31 AM
        • 0 Attachment
          As a side note,
          Usually the radio buttons' group is define by being contained by the
          same container.
          However you can "Merge radio groups", this is useful if you want to have
          2 different Frames with radio buttons behaving as if they were in the
          same group.

          I am not sure my explanation is better than my previous.
          However, in EiffelBuild, if you open the properties of a VERTICAL_BOX
          (I think this is the "object editor" on the right side bar), you will
          see at the bottom the "Merged radio groups".

          I hope this gives a useful addition to Peter's message.

          Jocelyn
        • Jocelyn
          I am glad Peter sent his answer too :)
          Message 4 of 17 , Feb 1 4:32 AM
          • 0 Attachment
            I am glad Peter sent his answer too :)

            On 2/1/2007 11:03 AM, Chris Saunders wrote:
            > Thanks to Peter and Jocelyn (although I didn't understand yours until after
            > I read the response from Peter).
            >
            > ...
          • Jocelyn
            ... I should double check , but I think by default is there is no expandable widget, the last widget of a container (such as Vertical or Horizontal box) is
            Message 5 of 17 , Feb 1 4:40 AM
            • 0 Attachment
              > Actually, don't you need to insert a CELL only on the left? Many of my
              > containers have "Is_item_expanded?" switched off for all children. It seems
              > to leave a vacant space at the right (if the container is a HORIZONTAL_BOX)
              > or at the bottom (if it's a VERTICAL_BOX).
              >
              I should double check , but I think by default is there is no
              "expandable" widget, the last widget of a container (such as Vertical or
              Horizontal box) is expandable by default. Otherwise we would have a
              weird empty space.

              But if you want to have for instance a resizable dialog with a label,
              and 2 buttons on the center of the bottom part.
              You may have something like

              DIALOG
              - VERTICAL_BOX (with border and padding size for nicer display)
              - LABEL (with the wanted alignment) : noy expanded
              - CELL
              - HORIZONTAL_BOX
              - CELL
              - BUTTON : fixed width (not expanded)
              - BUTTON : fixed width (not expanded)
              - CELL

              If you don't put the last cell for instance, you'll get the button on
              the right

              In this case, if you resize the dialog, the space between the label and
              the button will grow (or reduce)
              and same for the other cells.

              But the best thing to do to understand it is to try, EiffelBuild is a
              great tool for that, since you can see the effective behavior while you
              build your interface.

              Hope this helps,
              Jocelyn
            • Chris Saunders
              Thanks Peter Your responses have been very helpful and saved me a lot of time. I don t find the documentation of EiffelBuild very helpful. Just before
              Message 6 of 17 , Feb 1 4:44 AM
              • 0 Attachment
                Thanks Peter



                Your responses have been very helpful and saved me a lot of time. I don't
                find the documentation of EiffelBuild very helpful. Just before reading
                your email I discovered that radio buttons are attached to the container
                they are in. I have two on my window that are not in any group box so I
                lined them up in the same HORIZONTAL_BOX with the controls they were
                supposed to affect - now they a both checked all the time - I have figured
                out how to correct this. So far I'm finding EiffelBuild pretty frustrating.



                Regards,

                Chris Saunders



                _____

                From: eiffel_software@yahoogroups.com
                [mailto:eiffel_software@yahoogroups.com] On Behalf Of Peter Gummer
                Sent: Thursday, February 01, 2007 6:23 AM
                To: eiffel_software@yahoogroups.com
                Subject: Re: [eiffel_software] Question about makiing non-resizeable
                controls using EiffelBuild



                Chris Saunders wrote:
                > I'm attempting to convert a WEL application I wrote using EiffelBuild to
                > create the user interface. The original has some radio buttons that are
                > contained in a group box as well as a couple that aren't. I don't see a
                > control that appears to correspond to a group box in the available
                > widgets.
                > Is there one?

                Yes, been there, done that. I was looking for something called GROUP_BOX
                (due to my familiarity with TGroupBox in Delphi VCL and with GroupBox in
                .NET WinForms); but there ain't no such class. What you need goes by the
                name of FRAME: it's one of the containers.

                FRAME gives the desired visual effect of (not surprisingly) drawing a frame
                around the enclosed widgets. Very logical really. You don't have to put the
                radio buttons in a FRAME, however, for the radio buttons to behave as a
                group. It seems that any container will do, as long as you don't need the
                visual effect of a frame; you can simply drop the radio buttons into a
                HORIZONTAL_BOX if you want.

                One thing to beware of with FRAME is that, unlike other containers such as
                HORIZONTAL_BOX, FRAME can contain only one widget. This frustrated me until
                I understood it, because I kept trying to drop multiple widgets into a FRAME

                and nothing would happen. Some sort of pop-up tooltip telling me what I was
                doing wrong would have been helpful. Eventually I figured out that it would
                only accept one widget, so I dropped a horizontal or vertical box into the
                FRAME, and then I dropped the radio buttons, etc. into the box. It's all
                very logical, if not intuitive.

                Placing a horizontal or vertical box insde the FRAME is useful for another
                reason: by default, the enclosed widgets jam up against the edges of the
                FRAME. It looks really ugly. (Parts of EiffelStudio and EiffelBuild often
                have a cramped appearance; I imagine that this default
                jam-'em-up-against-the-border behaviour is to blame.) To get a
                better-looking user interface, set the box's "Border Width" attribute to
                some non-zero value. I have defined a constant (via EiffelBuild's
                "Constants" toolbar button), which I call "border_width", with a value of 2
                pixels. I set the outermost box inside the FRAME to have this border width.
                This gives the contents of the FRAME a bit of room to breathe. FRAME does
                not have "Border Width", so it's usually worth dropping a box into the FRAME

                for this reason alone, even if it will contain only one widget.

                Boxes also have a "Padding Width" attribute: this is another useful cosmetic

                thing, supplied by the box classes, but not by FRAME.

                - Peter Gummer





                [Non-text portions of this message have been removed]
              • Peter Gummer
                ... In my experience you get a weird empty space . I ve just tested it again: the widget does not expand to fill the empty space. It s not so weird, to my
                Message 7 of 17 , Feb 1 4:58 AM
                • 0 Attachment
                  Jocelyn wrote:
                  > I should double check , but I think by default is there is no
                  > "expandable" widget, the last widget of a container (such as Vertical or
                  > Horizontal box) is expandable by default. Otherwise we would have a
                  > weird empty space.

                  In my experience you get "a weird empty space". I've just tested it again:
                  the widget does not expand to fill the empty space.

                  It's not so weird, to my mind, because it's exactly what I want. I would
                  consider it weird for it to have expanded when I have told it not to expand!

                  - Peter Gummer
                • Chris Saunders
                  Thanks for the response Jocelyn. I have a VERTICAL_BOX that contains two HORIZONTAL_BOXes and each HORIZONTAL_BOX contains a radio button whose state I wish to
                  Message 8 of 17 , Feb 1 4:58 AM
                  • 0 Attachment
                    Thanks for the response Jocelyn.



                    I have a VERTICAL_BOX that contains two HORIZONTAL_BOXes and each
                    HORIZONTAL_BOX contains a radio button whose state I wish to be attached to
                    the other. If I click on the VERTICAL_BOX or either of the HORIZONTAL_BOXes
                    I can see "Merged radio groups" which has what looks like an edit box below
                    it but I don't know what to do with it. I tried "pick and drop" of the
                    radio button controls but that didn't work and if I click on the edit box
                    nothing happens. Could you perhaps be a little more detailed in your
                    explanation of this?



                    Regards,

                    Chris Saunders



                    _____

                    From: eiffel_software@yahoogroups.com
                    [mailto:eiffel_software@yahoogroups.com] On Behalf Of Jocelyn
                    Sent: Thursday, February 01, 2007 7:32 AM
                    To: eiffel_software@yahoogroups.com
                    Subject: Re: [eiffel_software] Question about makiing non-resizeable
                    controls using EiffelBuild



                    As a side note,
                    Usually the radio buttons' group is define by being contained by the
                    same container.
                    However you can "Merge radio groups", this is useful if you want to have
                    2 different Frames with radio buttons behaving as if they were in the
                    same group.

                    I am not sure my explanation is better than my previous.
                    However, in EiffelBuild, if you open the properties of a VERTICAL_BOX
                    (I think this is the "object editor" on the right side bar), you will
                    see at the bottom the "Merged radio groups".

                    I hope this gives a useful addition to Peter's message.

                    Jocelyn





                    [Non-text portions of this message have been removed]
                  • Peter Gummer
                    ... That s right. Because the CELL on the left expands, without the CELL on the right to counter it, it would push the two buttons to the right edge of the
                    Message 9 of 17 , Feb 1 5:14 AM
                    • 0 Attachment
                      Jocelyn wrote:
                      > - HORIZONTAL_BOX
                      > - CELL
                      > - BUTTON : fixed width (not expanded)
                      > - BUTTON : fixed width (not expanded)
                      > - CELL
                      >
                      > If you don't put the last cell for instance, you'll get the
                      > button on the right
                      >
                      > In this case, if you resize the dialog, the space between
                      > the label and the button will grow (or reduce)
                      > and same for the other cells.

                      That's right. Because the CELL on the left expands, without the CELL on the
                      right to counter it, it would push the two buttons to the right edge of the
                      horizontal box; I actually have a dialog box that looks like that, because
                      this is the usual placement for dialog box buttons in Microsoft Windows.
                      EiffelBuild makes it easy to do this, although tweaking it get a nice
                      spacing between the buttons and the edges takes a bit of practice.

                      And your example of how to centre the buttons (if that 's the effect you
                      want) is great, because this demonstrates the biggest advantage of
                      EiffelVision's approach, in my experience, compared with other frameworks
                      I've used. In EiffelBuild and EiffelVision, keeping widgets centred is easy.
                      In other frameworks that I've used, by contrast, it cannot be done except by
                      manually writing code in event handlers to calculate the correct positions.

                      - Peter Gummer
                    • Jocelyn
                      ... I must say you are fully right, I guess a while ago when I first used vision2, this was not the default behavior, and it got fixed since then. But until
                      Message 10 of 17 , Feb 1 5:23 AM
                      • 0 Attachment
                        >> I should double check , but I think by default is there is no
                        >> "expandable" widget, the last widget of a container (such as Vertical or
                        >> Horizontal box) is expandable by default. Otherwise we would have a
                        >> weird empty space.
                        >>
                        >
                        > In my experience you get "a weird empty space". I've just tested it again:
                        > the widget does not expand to fill the empty space.
                        >
                        > It's not so weird, to my mind, because it's exactly what I want. I would
                        > consider it weird for it to have expanded when I have told it not to expand!
                        >
                        I must say you are fully right, I guess a while ago when I first used
                        vision2, this was not the default behavior, and it got fixed since then.
                        But until now, I was used to add this extra EV_CELL.
                        So either I was wrong since the beginning about that, or maybe I always
                        have at least one child expandable.

                        In any case, you are right and thanks to you I know it :)

                        -- Jocelyn.
                      • Jocelyn
                        For instance you have DIALOG - VERTICAL_BOX - radio_1: RADIO_BUTTON - radio_2: RADIO_BUTTON - FRAME - HORIZONTAL_BOX - radio_3: RADIO_BUTTON - radio_4:
                        Message 11 of 17 , Feb 1 5:29 AM
                        • 0 Attachment
                          For instance you have

                          DIALOG
                          - VERTICAL_BOX
                          - radio_1: RADIO_BUTTON
                          - radio_2: RADIO_BUTTON
                          - FRAME
                          - HORIZONTAL_BOX
                          - radio_3: RADIO_BUTTON
                          - radio_4: RADIO_BUTTON

                          by default there are 2 groups: (radio_1, radio_2) and (radio_3, radio_4)
                          but you can merge them.
                          for that
                          click on the VERTICAL_BOX for instance
                          and Pick&Drop the HORIZONTAL_BOX inside the "Merged radio groups" of
                          VERTICAL_BOX

                          this should add it to the merged radio groups of VERTICAL_BOX, and
                          that's it.

                          In fact when you know a little bit the Vision2 library, you can find
                          easily how to do thing in EiffelBuild
                          the merged radio groups are handle for instance
                          EV_CONTAINER.merge_radio_button_groups
                          Even if you don't have to know vision2 to use EiffelBuild, this helps.

                          I hope this help a little bit,
                          Jocelyn



                          On 2/1/2007 13:58 PM, Chris Saunders wrote:
                          > Thanks for the response Jocelyn.
                          >
                          >
                          >
                          > I have a VERTICAL_BOX that contains two HORIZONTAL_BOXes and each
                          > HORIZONTAL_BOX contains a radio button whose state I wish to be attached to
                          > the other. If I click on the VERTICAL_BOX or either of the HORIZONTAL_BOXes
                          > I can see "Merged radio groups" which has what looks like an edit box below
                          > it but I don't know what to do with it. I tried "pick and drop" of the
                          > radio button controls but that didn't work and if I click on the edit box
                          > nothing happens. Could you perhaps be a little more detailed in your
                          > explanation of this?
                          >
                          >
                          >
                          > Regards,
                          >
                          > Chris Saunders
                          >
                          >
                          >
                          > _____
                          >
                          > From: eiffel_software@yahoogroups.com
                          > [mailto:eiffel_software@yahoogroups.com] On Behalf Of Jocelyn
                          > Sent: Thursday, February 01, 2007 7:32 AM
                          > To: eiffel_software@yahoogroups.com
                          > Subject: Re: [eiffel_software] Question about makiing non-resizeable
                          > controls using EiffelBuild
                          >
                          >
                          >
                          > As a side note,
                          > Usually the radio buttons' group is define by being contained by the
                          > same container.
                          > However you can "Merge radio groups", this is useful if you want to have
                          > 2 different Frames with radio buttons behaving as if they were in the
                          > same group.
                          >
                          > I am not sure my explanation is better than my previous.
                          > However, in EiffelBuild, if you open the properties of a VERTICAL_BOX
                          > (I think this is the "object editor" on the right side bar), you will
                          > see at the bottom the "Merged radio groups".
                          >
                          > I hope this gives a useful addition to Peter's message.
                          >
                          > Jocelyn
                          >
                          >
                          >
                          >
                          >
                          > [Non-text portions of this message have been removed]
                          >
                          >
                          >
                          >
                          > Yahoo! Groups Links
                          >
                          >
                          >
                          >
                          >
                          >
                        • Peter Gummer
                          ... There s a lovely tooltip when I hover the mouse over the Merged radio groups box. Unfortunately, it s completely uninformative; it just states the
                          Message 12 of 17 , Feb 1 5:36 AM
                          • 0 Attachment
                            Chris Saunders wrote:
                            > I can see "Merged radio groups" which has what looks like an edit box
                            > below
                            > it but I don't know what to do with it. I tried "pick and drop" of the
                            > radio button controls but that didn't work and if I click on the edit box
                            > nothing happens.

                            There's a lovely tooltip when I hover the mouse over the "Merged radio
                            groups" box. Unfortunately, it's completely uninformative; it just states
                            the feature name that it represents, but it would be better if it explained
                            how to use it.

                            I've never used this, but I think I've figured out what to do. Select the
                            outer VERTICAL_BOX. Then right-click on the first HORIZONTAL_BOX and drop it
                            into the "Merged radio groups". Then do likewise with the other
                            HORIZONTAL_BOX. I haven't tested to see whether this really works but it
                            looks right.

                            - Peter Gummer
                          • Chris Saunders
                            Thanks Jocelyn The example made it perfectly clear. Regards, Chris Saunders _____ From: eiffel_software@yahoogroups.com
                            Message 13 of 17 , Feb 1 12:11 PM
                            • 0 Attachment
                              Thanks Jocelyn



                              The example made it perfectly clear.



                              Regards,

                              Chris Saunders



                              _____

                              From: eiffel_software@yahoogroups.com
                              [mailto:eiffel_software@yahoogroups.com] On Behalf Of Jocelyn
                              Sent: Thursday, February 01, 2007 8:29 AM
                              To: eiffel_software@yahoogroups.com
                              Subject: Re: [eiffel_software] Question about makiing non-resizeable
                              controls using EiffelBuild



                              For instance you have

                              DIALOG
                              - VERTICAL_BOX
                              - radio_1: RADIO_BUTTON
                              - radio_2: RADIO_BUTTON
                              - FRAME
                              - HORIZONTAL_BOX
                              - radio_3: RADIO_BUTTON
                              - radio_4: RADIO_BUTTON

                              by default there are 2 groups: (radio_1, radio_2) and (radio_3, radio_4)
                              but you can merge them.
                              for that
                              click on the VERTICAL_BOX for instance
                              and Pick&Drop the HORIZONTAL_BOX inside the "Merged radio groups" of
                              VERTICAL_BOX

                              this should add it to the merged radio groups of VERTICAL_BOX, and
                              that's it.

                              In fact when you know a little bit the Vision2 library, you can find
                              easily how to do thing in EiffelBuild
                              the merged radio groups are handle for instance
                              EV_CONTAINER.merge_radio_button_groups
                              Even if you don't have to know vision2 to use EiffelBuild, this helps.

                              I hope this help a little bit,
                              Jocelyn

                              On 2/1/2007 13:58 PM, Chris Saunders wrote:
                              > Thanks for the response Jocelyn.
                              >
                              >
                              >
                              > I have a VERTICAL_BOX that contains two HORIZONTAL_BOXes and each
                              > HORIZONTAL_BOX contains a radio button whose state I wish to be attached
                              to
                              > the other. If I click on the VERTICAL_BOX or either of the
                              HORIZONTAL_BOXes
                              > I can see "Merged radio groups" which has what looks like an edit box
                              below
                              > it but I don't know what to do with it. I tried "pick and drop" of the
                              > radio button controls but that didn't work and if I click on the edit box
                              > nothing happens. Could you perhaps be a little more detailed in your
                              > explanation of this?
                              >
                              >
                              >
                              > Regards,
                              >
                              > Chris Saunders
                              >
                              >
                              >
                              > _____
                              >
                              > From: eiffel_software@ <mailto:eiffel_software%40yahoogroups.com>
                              yahoogroups.com
                              > [mailto:eiffel_software@ <mailto:eiffel_software%40yahoogroups.com>
                              yahoogroups.com] On Behalf Of Jocelyn
                              > Sent: Thursday, February 01, 2007 7:32 AM
                              > To: eiffel_software@ <mailto:eiffel_software%40yahoogroups.com>
                              yahoogroups.com
                              > Subject: Re: [eiffel_software] Question about makiing non-resizeable
                              > controls using EiffelBuild
                              >
                              >
                              >
                              > As a side note,
                              > Usually the radio buttons' group is define by being contained by the
                              > same container.
                              > However you can "Merge radio groups", this is useful if you want to have
                              > 2 different Frames with radio buttons behaving as if they were in the
                              > same group.
                              >
                              > I am not sure my explanation is better than my previous.
                              > However, in EiffelBuild, if you open the properties of a VERTICAL_BOX
                              > (I think this is the "object editor" on the right side bar), you will
                              > see at the bottom the "Merged radio groups".
                              >
                              > I hope this gives a useful addition to Peter's message.
                              >
                              > Jocelyn
                              >
                              >
                              >
                              >
                              >
                              > [Non-text portions of this message have been removed]
                              >
                              >
                              >
                              >
                              > Yahoo! Groups Links
                              >
                              >
                              >
                              >
                              >
                              >





                              [Non-text portions of this message have been removed]
                            Your message has been successfully submitted and would be delivered to recipients shortly.