Kirix Support Forums

floating windows open full screen (not maximized though)

Please post all general questions, comments, bug reports, and any other wxAUI feedback here.

floating windows open full screen (not maximized though)

Postby aleksey on Thu Nov 02, 2006 4:39 pm

If MinSize is set, then floating windows opens full screen (but not maximized) and the FloatingSize parameters are ignored. This happens inside wxAuiFloatingFrame::SetPaneWindow() method:

if (pane.min_size.IsFullySpecified())
{
// because SetSizeHints() calls Fit() too (which sets the window
// size to its minimum allowed), we keep the size before calling
// SetSizeHints() and reset it afterwards...
wxSize tmp = GetSize();
GetSizer()->SetSizeHints(this);
SetSize(tmp);
}

The window is not yet ready thus GetSize() returns garbage....
aleksey
Registered User
 
Posts: 9
Joined: Mon Oct 30, 2006 1:20 pm

Postby aleksey on Thu Nov 02, 2006 5:06 pm

To reproduce:

1) Add MinSize(100, 100) to the "Tree Pane" in the auidemo
2) Start auidemo
3) De-attach the "Tree Pane"

Looks like the frame does not get created when we go into wxAuiFloatingFrame::SetPaneWindow() thus we get garbage from GetSize(). But when we call SetSize(), this garbage gets remembered in the pane from wxAuiManager::OnFloatingPaneResized().

The following patch fixes the problem:

Index: src/aui/framemanager.cpp
===================================================================
RCS file: /pack/cvsroots/wxwidgets/wxWidgets/src/aui/framemanager.cpp,v
retrieving revision 1.76
diff -u -r1.76 framemanager.cpp
--- src/aui/framemanager.cpp 2006/11/02 20:50:01 1.76
+++ src/aui/framemanager.cpp 2006/11/02 22:05:40
@@ -3304,7 +3304,9 @@
wxAuiPaneInfo& pane = GetPane(wnd);
wxASSERT_MSG(pane.IsOk(), wxT("Pane window not found"));

- pane.floating_size = size;
+ if(pane.frame != NULL) {
+ pane.floating_size = size;
+ }
}
aleksey
Registered User
 
Posts: 9
Joined: Mon Oct 30, 2006 1:20 pm

Postby Ben on Mon Nov 06, 2006 1:52 am

Hi Aleksey,

Which platform is this happening on? With wxMSW, the problem doesn't happen for me.

All the best,
Ben
User avatar
Ben
Kirix Support Team
 
Posts: 522
Joined: Mon Dec 19, 2005 6:29 am

Return to wxAUI Questions, Thoughts & Feedback