Menu

GroupBox implementation and Boders

2002-11-14
2002-11-14
  • Peter Kullmann

    Peter Kullmann - 2002-11-14

    I'm working on GroupBox right now. The base class GroupBox comes with its own border which includes the (title) text also.

    My first approach was to implement GroupBox exactly like LayoutPanel with a fixed LayoutBorder (you cannot set LayoutBorder, it throws a not supported exception). This fixed (transparent) border is used by the layout managers to offset the controls inside the group box.

    Now, there are two questions:
    1. I need to have a transparent border object that can have different sizes in the four border sides. This will also change all the layout managers and make them slightly more complicated.

    2. As fas as I can see the current implementation sees IBordered controls as having the borders _inside_ the control (which is fine for the GroupBox). But I'm not at all sure whether this was the original intention and whether it conforms to the design ideas in awt.

    Peter

     
    • Olaf Krumnow

      Olaf Krumnow - 2002-11-14

      > 1. I need to have a transparent border object that can have different sizes in the four border sides.

      It can right now. Use border.Space.Top to set the Top part of the border. All layout managers respect these settings.

      > 2. As fas as I can see the current implementation sees IBordered controls as having the borders _inside_ the control (which is fine for the GroupBox). But I'm not at all sure whether this was the original intention and whether it conforms to the design ideas in awt.

      I don't have a chance to paint the border outside of the control.
      You're right, awt uses them afaik around the original control. But awt paint all controls by itself. In .NET for example the TextBox is mainly painted by Windows, not by the framework. So you can't follow the awt intention at all. In my eyes it makes no sense to have borders around not-container-controls. And with container controls it is no problem to paint the border inside.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.