Visually show the cells boundaries in layout sample grid sizer test.

Closes #11456.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62822 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-12-08 15:56:26 +00:00
parent f26c1c3e4a
commit 6087ca88c1

View File

@@ -31,6 +31,7 @@
#include "wx/notebook.h" #include "wx/notebook.h"
#include "wx/spinctrl.h" #include "wx/spinctrl.h"
#include "wx/wrapsizer.h" #include "wx/wrapsizer.h"
#include "wx/generic/stattextg.h"
#include "layout.h" #include "layout.h"
@@ -77,9 +78,7 @@ END_EVENT_TABLE()
// Define my frame constructor // Define my frame constructor
MyFrame::MyFrame() MyFrame::MyFrame()
: wxFrame(NULL, wxID_ANY, wxT("wxWidgets Layout Demo"), : wxFrame(NULL, wxID_ANY, wxT("wxWidgets Layout Demo"))
wxPoint(30,30), wxDefaultSize,
wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE)
{ {
SetIcon(wxICON(sample)); SetIcon(wxICON(sample));
@@ -314,16 +313,16 @@ void MyFlexSizerFrame::InitFlexSizer(wxFlexGridSizer *sizer, wxWindow* parent)
{ {
for ( int j = 0; j < 3; j++ ) for ( int j = 0; j < 3; j++ )
{ {
sizer->Add(new wxStaticText wxWindow * const cell = new wxGenericStaticText
( (
parent, parent,
wxID_ANY, wxID_ANY,
wxString::Format(wxT("(%d, %d)"), i + 1, j + 1), wxString::Format("(%d, %d)",
wxDefaultPosition, i + 1, j + 1)
wxDefaultSize, );
wxALIGN_CENTER if ( (i + j) % 2 )
), cell->SetBackgroundColour( *wxLIGHT_GREY );
0, wxEXPAND | wxALIGN_CENTER_VERTICAL | wxALL, 3); sizer->Add(cell, 0, wxEXPAND | wxALIGN_CENTER_VERTICAL | wxALL, 3);
} }
} }
} }