View previous topic :: View next topic |
Author |
Message |
Carlos
Joined: 19 Mar 2004 Posts: 396 Location: Canyon, TX
|
Posted: Wed Mar 23, 2005 8:34 pm Post subject: BorderLayout problem |
|
|
BorderLayout is a bit flawed. Only the Component in Loc.Center is drawn well. The others overlap at the corners. |
|
Back to top |
|
|
BenHinkle
Joined: 27 Mar 2004 Posts: 76
|
Posted: Thu Mar 24, 2005 10:00 am Post subject: |
|
|
Wierd. You're right. It looks like BorderLayout is totally broken (at least on win32 where I just tried it). All the children except the center are squished up in the upper left corner of the window. I'll look into it. |
|
Back to top |
|
|
Carlos
Joined: 19 Mar 2004 Posts: 396 Location: Canyon, TX
|
Posted: Thu Mar 24, 2005 10:13 am Post subject: |
|
|
No, that didn't happen to me.
The components are placed where they should, but the ones in Loc.North and Loc.South have width = parent.width, and the ones in Loc.East and Loc.West have height = parent.height (I don't know if that's your actual code, but that's the idea). The one in Loc.Center has width = parent.width - locations[Loc.East].width - locations[Loc.West].width. Similar for height.
The solution is to choose which ones have priority: North/South or East/West. You seem to have chosen NS, so it'd be locations[Loc.East].height = parent.height - locations[Loc.North].height - locations[Loc.South].height.
Also, it doesn't only happen on Windows (tested on XP), but also on GTK. |
|
Back to top |
|
|
BenHinkle
Joined: 27 Mar 2004 Posts: 76
|
Posted: Thu Mar 24, 2005 6:24 pm Post subject: |
|
|
oh, ok. I see what you mean now. That is a bug in the east/west placement. Those should only extend as far as the north/south components. I'll fix that. I still need to figure out why all my components were squishes in the upper left, though. hmm. |
|
Back to top |
|
|
BenHinkle
Joined: 27 Mar 2004 Posts: 76
|
Posted: Thu Mar 24, 2005 8:08 pm Post subject: |
|
|
I fixed the east/west bug. Plus I noticed the preferred size wasn't giving any space to the east/west when there wasn't a center. When I rebuilt my other problem with squished buttons went away so that must have been a fluke.
I've update the minwin.zip archive.
thanks for reporting the bug! |
|
Back to top |
|
|
Carlos
Joined: 19 Mar 2004 Posts: 396 Location: Canyon, TX
|
Posted: Thu Mar 24, 2005 8:40 pm Post subject: |
|
|
Thanks. |
|
Back to top |
|
|
Carlos
Joined: 19 Mar 2004 Posts: 396 Location: Canyon, TX
|
Posted: Thu Apr 07, 2005 5:23 pm Post subject: |
|
|
It seems to be working right now, except for one small problem: the BorderLayout sample doesn't work properly on GTK+. I mean, it's drawn like it should, but when the window is resized, the controls aren't updated accordingly. |
|
Back to top |
|
|
|