FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

BorderLayout problem

 
Post new topic   Reply to topic     Forum Index -> MinWin
View previous topic :: View next topic  
Author Message
Carlos



Joined: 19 Mar 2004
Posts: 396
Location: Canyon, TX

PostPosted: Wed Mar 23, 2005 8:34 pm    Post subject: BorderLayout problem Reply with quote

BorderLayout is a bit flawed. Only the Component in Loc.Center is drawn well. The others overlap at the corners.
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
BenHinkle



Joined: 27 Mar 2004
Posts: 76

PostPosted: Thu Mar 24, 2005 10:00 am    Post subject: Reply with quote

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
View user's profile Send private message
Carlos



Joined: 19 Mar 2004
Posts: 396
Location: Canyon, TX

PostPosted: Thu Mar 24, 2005 10:13 am    Post subject: Reply with quote

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
View user's profile Send private message Yahoo Messenger MSN Messenger
BenHinkle



Joined: 27 Mar 2004
Posts: 76

PostPosted: Thu Mar 24, 2005 6:24 pm    Post subject: Reply with quote

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
View user's profile Send private message
BenHinkle



Joined: 27 Mar 2004
Posts: 76

PostPosted: Thu Mar 24, 2005 8:08 pm    Post subject: Reply with quote

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
View user's profile Send private message
Carlos



Joined: 19 Mar 2004
Posts: 396
Location: Canyon, TX

PostPosted: Thu Mar 24, 2005 8:40 pm    Post subject: Reply with quote

Thanks.
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Carlos



Joined: 19 Mar 2004
Posts: 396
Location: Canyon, TX

PostPosted: Thu Apr 07, 2005 5:23 pm    Post subject: Reply with quote

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
View user's profile Send private message Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> MinWin All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group