From 9c9f80223b79ec6b4eb29783e96a22560b321617 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Sun, 31 May 2015 19:18:36 +0200 Subject: [PATCH] Exclude header demonstration in propgrid sample when wxUSE_HEADERCTRL == 0. Code responsible for header demonstration should be excluded in this case because header management functions in wxPropertyGridManager depend on wxHeaderCtrl (via wxPGHeaderCtrl) and if it is not present then respective methods in wxPG are not exposed. --- samples/propgrid/propgrid.cpp | 8 ++++++++ samples/propgrid/propgrid.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/samples/propgrid/propgrid.cpp b/samples/propgrid/propgrid.cpp index 56254c1e3d..5a962f5a2a 100644 --- a/samples/propgrid/propgrid.cpp +++ b/samples/propgrid/propgrid.cpp @@ -430,7 +430,9 @@ enum ID_RUNMINIMAL, ID_ENABLELABELEDITING, ID_VETOCOLDRAG, +#if wxUSE_HEADERCTRL ID_SHOWHEADER, +#endif ID_ONEXTENDEDKEYNAV, ID_SHOWPOPUP, ID_POPUPGRID @@ -505,7 +507,9 @@ wxBEGIN_EVENT_TABLE(FormMain, wxFrame) EVT_MENU( ID_CLEARMODIF, FormMain::OnClearModifyStatusClick ) EVT_MENU( ID_FREEZE, FormMain::OnFreezeClick ) EVT_MENU( ID_ENABLELABELEDITING, FormMain::OnEnableLabelEditing ) +#if wxUSE_HEADERCTRL EVT_MENU( ID_SHOWHEADER, FormMain::OnShowHeader ) +#endif EVT_MENU( ID_DUMPLIST, FormMain::OnDumpList ) EVT_MENU( ID_COLOURSCHEME1, FormMain::OnColourScheme ) @@ -2093,9 +2097,11 @@ FormMain::FormMain(const wxString& title, const wxPoint& pos, const wxSize& size wxT("Select window style flags used by the grid.")); menuTry->Append(ID_ENABLELABELEDITING, wxT("Enable label editing"), wxT("This calls wxPropertyGrid::MakeColumnEditable(0)")); +#if wxUSE_HEADERCTRL menuTry->AppendCheckItem(ID_SHOWHEADER, wxT("Enable header"), wxT("This calls wxPropertyGridManager::ShowHeader()")); +#endif // wxUSE_HEADERCTRL menuTry->AppendSeparator(); menuTry->AppendRadioItem( ID_COLOURSCHEME1, wxT("Standard Colour Scheme") ); menuTry->AppendRadioItem( ID_COLOURSCHEME2, wxT("White Colour Scheme") ); @@ -2685,11 +2691,13 @@ void FormMain::OnEnableLabelEditing( wxCommandEvent& WXUNUSED(event) ) // ----------------------------------------------------------------------- +#if wxUSE_HEADERCTRL void FormMain::OnShowHeader( wxCommandEvent& event ) { m_pPropGridManager->ShowHeader(event.IsChecked()); m_pPropGridManager->SetColumnTitle(2, wxT("Units")); } +#endif // wxUSE_HEADERCTRL // ----------------------------------------------------------------------- diff --git a/samples/propgrid/propgrid.h b/samples/propgrid/propgrid.h index 473c8ed4bc..15d9bf4ddb 100644 --- a/samples/propgrid/propgrid.h +++ b/samples/propgrid/propgrid.h @@ -191,7 +191,9 @@ public: void OnClearModifyStatusClick( wxCommandEvent& event ); void OnFreezeClick( wxCommandEvent& event ); void OnEnableLabelEditing( wxCommandEvent& event ); +#if wxUSE_HEADERCTRL void OnShowHeader( wxCommandEvent& event ); +#endif void OnDumpList( wxCommandEvent& event ); void OnCatColours( wxCommandEvent& event ); void OnSetColumns( wxCommandEvent& event );