add code for debugging sizers/window sizes; it may be very useful for other purposes as well
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58680 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -38,6 +38,7 @@
|
||||
#include "wx/settings.h"
|
||||
#include "wx/dialog.h"
|
||||
#include "wx/msgdlg.h"
|
||||
#include "wx/msgout.h"
|
||||
#include "wx/statusbr.h"
|
||||
#include "wx/toolbar.h"
|
||||
#include "wx/dcclient.h"
|
||||
@@ -2570,6 +2571,8 @@ static void DrawSizer(wxWindowBase *win, wxSizer *sizer)
|
||||
{
|
||||
DrawSizers(item->GetWindow());
|
||||
}
|
||||
else
|
||||
wxFAIL_MSG("inconsistent wxSizerItem status!");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2592,6 +2595,26 @@ static void DrawSizers(wxWindowBase *win)
|
||||
{
|
||||
DrawSizers(*i);
|
||||
}
|
||||
|
||||
// show all kind of sizes of this window; see the "window sizing" topic
|
||||
// overview for more info about the various differences:
|
||||
wxSize fullSz = win->GetSize();
|
||||
wxSize clientSz = win->GetClientSize();
|
||||
wxSize bestSz = win->GetBestSize();
|
||||
wxSize minSz = win->GetMinSize();
|
||||
wxSize maxSz = win->GetMaxSize();
|
||||
wxSize virtualSz = win->GetVirtualSize();
|
||||
|
||||
wxMessageOutputDebug dbgout;
|
||||
dbgout.Printf(
|
||||
"%-10s => fullsz=%4d;%-4d clientsz=%4d;%-4d bestsz=%4d;%-4d minsz=%4d;%-4d maxsz=%4d;%-4d virtualsz=%4d;%-4d\n",
|
||||
(const char*)win->GetName(),
|
||||
fullSz.x, fullSz.y,
|
||||
clientSz.x, clientSz.y,
|
||||
bestSz.x, bestSz.y,
|
||||
minSz.x, minSz.y,
|
||||
maxSz.x, maxSz.y,
|
||||
virtualSz.x, virtualSz.y);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user