X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/90666795d4093289d3ab5406947135496fec232d..65fb4b3a4f18e1d8b58ac92d50d4cc7f81f03783:/samples/layout/layout.cpp diff --git a/samples/layout/layout.cpp b/samples/layout/layout.cpp index 063262b159..41952f55bd 100644 --- a/samples/layout/layout.cpp +++ b/samples/layout/layout.cpp @@ -7,7 +7,7 @@ // RCS-ID: $Id$ // Copyright: (c) 1998 Julian Smart // 2005 Vadim Zeitlin -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// // ---------------------------------------------------------------------------- @@ -31,10 +31,11 @@ #include "wx/notebook.h" #include "wx/spinctrl.h" #include "wx/wrapsizer.h" +#include "wx/generic/stattextg.h" #include "layout.h" -#ifndef __WXMSW__ +#ifndef wxHAS_IMAGES_IN_RESOURCES #include "../sample.xpm" #endif @@ -77,9 +78,7 @@ END_EVENT_TABLE() // Define my frame constructor MyFrame::MyFrame() - : wxFrame(NULL, wxID_ANY, wxT("wxWidgets Layout Demo"), - wxPoint(30,30), wxDefaultSize, - wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE) + : wxFrame(NULL, wxID_ANY, wxT("wxWidgets Layout Demo")) { SetIcon(wxICON(sample)); @@ -314,16 +313,16 @@ void MyFlexSizerFrame::InitFlexSizer(wxFlexGridSizer *sizer, wxWindow* parent) { for ( int j = 0; j < 3; j++ ) { - sizer->Add(new wxStaticText - ( - parent, - wxID_ANY, - wxString::Format(wxT("(%d, %d)"), i + 1, j + 1), - wxDefaultPosition, - wxDefaultSize, - wxALIGN_CENTER - ), - 0, wxEXPAND | wxALIGN_CENTER_VERTICAL | wxALL, 3); + wxWindow * const cell = new wxGenericStaticText + ( + parent, + wxID_ANY, + wxString::Format("(%d, %d)", + i + 1, j + 1) + ); + if ( (i + j) % 2 ) + cell->SetBackgroundColour( *wxLIGHT_GREY ); + sizer->Add(cell, 0, wxEXPAND | wxALIGN_CENTER_VERTICAL | wxALL, 3); } } }