From 28fcfbfe09c79c06502d2929d5c11ab35996c19f Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 10 Jul 2007 23:59:42 +0000 Subject: [PATCH] added missing wxUSE_XXX checks git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47322 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/btncmn.cpp | 3 +++ src/gtk/frame.cpp | 22 ++++++++++++++++++++-- src/gtk/menu.cpp | 6 +++++- src/gtk/textctrl.cpp | 4 ++++ 4 files changed, 32 insertions(+), 3 deletions(-) diff --git a/src/common/btncmn.cpp b/src/common/btncmn.cpp index 92e8103586..2207057082 100644 --- a/src/common/btncmn.cpp +++ b/src/common/btncmn.cpp @@ -23,6 +23,8 @@ #pragma hdrstop #endif +#if wxUSE_BUTTON + #ifndef WX_PRECOMP #include "wx/button.h" #include "wx/toplevel.h" @@ -42,3 +44,4 @@ wxWindow *wxButtonBase::SetDefault() return tlw->SetDefaultItem(this); } +#endif // wxUSE_BUTTON diff --git a/src/gtk/frame.cpp b/src/gtk/frame.cpp index e79ff78ec2..c89c664ade 100644 --- a/src/gtk/frame.cpp +++ b/src/gtk/frame.cpp @@ -119,6 +119,8 @@ static void gtk_toolbar_detached_callback( GtkWidget *WXUNUSED(widget), GtkWidge // InsertChild for wxFrame //----------------------------------------------------------------------------- +#if wxUSE_TOOLBAR + /* Callback for wxFrame. This very strange beast has to be used because * C++ has no virtual methods in a constructor. We have to emulate a * virtual function here as wxWidgets requires different ways to insert @@ -152,9 +154,11 @@ static void wxInsertChildInFrame(wxWindow* parent, wxWindow* child) parent); } } -#endif // wxUSE_TOOLBAR +#endif // wxUSE_TOOLBAR_NATIVE } +#endif // wxUSE_TOOLBAR + // ---------------------------------------------------------------------------- // wxFrame creation // ---------------------------------------------------------------------------- @@ -242,7 +246,21 @@ bool wxFrame::ShowFullScreen(bool show, long style) return false; wxWindow* const bar[] = { - m_frameMenuBar, m_frameToolBar, m_frameStatusBar +#if wxUSE_MENUS + m_frameMenuBar, +#else + NULL, +#endif +#if wxUSE_TOOLBAR + m_frameToolBar, +#else + NULL, +#endif +#if wxUSE_STATUSBAR + m_frameStatusBar, +#else + NULL, +#endif }; const long fsNoBar[] = { wxFULLSCREEN_NOMENUBAR, wxFULLSCREEN_NOTOOLBAR, wxFULLSCREEN_NOSTATUSBAR diff --git a/src/gtk/menu.cpp b/src/gtk/menu.cpp index cdac20572c..97d926f92f 100644 --- a/src/gtk/menu.cpp +++ b/src/gtk/menu.cpp @@ -1,6 +1,6 @@ ///////////////////////////////////////////////////////////////////////////// // Name: src/gtk/menu.cpp -// Purpose: +// Purpose: implementation of wxMenuBar and wxMenu classes for wxGTK // Author: Robert Roebling // Id: $Id$ // Copyright: (c) 1998 Robert Roebling @@ -10,6 +10,8 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" +#if wxUSE_MENUS + #include "wx/menu.h" #ifndef WX_PRECOMP @@ -1792,3 +1794,5 @@ bool wxGetStockGtkAccelerator(const char *id, GdkModifierType *mod, guint *key) } #endif // __WXGTK20__ + +#endif // wxUSE_MENUS diff --git a/src/gtk/textctrl.cpp b/src/gtk/textctrl.cpp index f83398df44..1b08ecc0a8 100644 --- a/src/gtk/textctrl.cpp +++ b/src/gtk/textctrl.cpp @@ -10,6 +10,8 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" +#if wxUSE_TEXTCTRL + #include "wx/textctrl.h" #ifndef WX_PRECOMP @@ -1989,3 +1991,5 @@ wxTextCtrl::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant)) { return GetDefaultAttributesFromGTKWidget(gtk_entry_new, true); } + +#endif // wxUSE_TEXTCTRL