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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
> 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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
> 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.