]> git.saurik.com Git - wxWidgets.git/commitdiff
Add wxUSE_MARKUP and wrap SetLabelMarkup() in it.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 27 Feb 2011 12:48:07 +0000 (12:48 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 27 Feb 2011 12:48:07 +0000 (12:48 +0000)
Make it possible to disable all the new markup-related code by setting
wxUSE_MARKUP to 0 in setup.h or using configure --disable-markup option.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67062 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

21 files changed:
configure
configure.in
docs/doxygen/mainpages/const_wxusedef.h
include/wx/chkconf.h
include/wx/control.h
include/wx/gtk/control.h
include/wx/gtk/stattext.h
include/wx/motif/setup0.h
include/wx/msw/setup0.h
include/wx/msw/wince/setup.h
include/wx/os2/setup0.h
include/wx/osx/setup0.h
include/wx/palmos/setup0.h
include/wx/setup_inc.h
include/wx/univ/setup0.h
samples/widgets/static.cpp
setup.h.in
src/common/ctrlcmn.cpp
src/common/markupparser.cpp
src/gtk/control.cpp
src/gtk/stattext.cpp

index 07d613ab1b6ca316bc8cbfda3144a9225a8d1f87..3ccf8165e48880ed477fcd18530aed4d002a38a1 100755 (executable)
--- a/configure
+++ b/configure
@@ -1804,6 +1804,7 @@ Optional Features:
   --enable-dnd            use Drag'n'Drop classes
   --enable-metafile       use win32 metafiles
   --disable-controls      disable compilation of all standard controls
+  --enable-markup         support wxControl::SetLabelMarkup
   --enable-accel          use accelerators
   --enable-animatectrl    use wxAnimationCtrl class
   --enable-artstd         use standard XPM icons in wxArtProvider
@@ -9784,6 +9785,7 @@ if test "$wxUSE_CONTROLS" = "no"; then
     DEFAULT_wxUSE_LISTBOOK=no
     DEFAULT_wxUSE_LISTBOX=no
     DEFAULT_wxUSE_LISTCTRL=no
+    DEFAULT_wxUSE_MARKUP=no
     DEFAULT_wxUSE_NOTEBOOK=no
     DEFAULT_wxUSE_POPUPWIN=no
     DEFAULT_wxUSE_RADIOBOX=no
@@ -9812,6 +9814,51 @@ if test "$wxUSE_CONTROLS" = "no"; then
 fi
 
 
+          enablestring=
+          defaultval=$wxUSE_ALL_FEATURES
+          if test -z "$defaultval"; then
+              if test x"$enablestring" = xdisable; then
+                  defaultval=yes
+              else
+                  defaultval=no
+              fi
+          fi
+
+          { echo "$as_me:$LINENO: checking for --${enablestring:-enable}-markup" >&5
+echo $ECHO_N "checking for --${enablestring:-enable}-markup... $ECHO_C" >&6; }
+          # Check whether --enable-markup was given.
+if test "${enable_markup+set}" = set; then
+  enableval=$enable_markup;
+                          if test "$enableval" = yes; then
+                            wx_cv_use_markup='wxUSE_MARKUP=yes'
+                          else
+                            wx_cv_use_markup='wxUSE_MARKUP=no'
+                          fi
+
+else
+
+                          wx_cv_use_markup='wxUSE_MARKUP=${'DEFAULT_wxUSE_MARKUP":-$defaultval}"
+
+fi
+
+
+          eval "$wx_cv_use_markup"
+
+          if test x"$enablestring" = xdisable; then
+            if test $wxUSE_MARKUP = no; then
+              result=yes
+            else
+              result=no
+            fi
+          else
+            result=$wxUSE_MARKUP
+          fi
+
+          { echo "$as_me:$LINENO: result: $result" >&5
+echo "${ECHO_T}$result" >&6; }
+
+
+
           enablestring=
           defaultval=$wxUSE_ALL_FEATURES
           if test -z "$defaultval"; then
@@ -47013,6 +47060,13 @@ if test "$wxUSE_CONTROLS" = "yes"; then
   USES_CONTROLS=1
 fi
 
+if test "$wxUSE_MARKUP" = "yes"; then
+  cat >>confdefs.h <<\_ACEOF
+#define wxUSE_MARKUP 1
+_ACEOF
+
+fi
+
 if test "$wxUSE_ACCEL" = "yes"; then
   cat >>confdefs.h <<\_ACEOF
 #define wxUSE_ACCEL 1
index 279ff1a03d586ca9ba1831cb588c9f13b9ae86cb..8fd0b7a0e19de68c26836702ba23a5d602400ccf 100644 (file)
@@ -898,6 +898,7 @@ if test "$wxUSE_CONTROLS" = "no"; then
     DEFAULT_wxUSE_LISTBOOK=no
     DEFAULT_wxUSE_LISTBOX=no
     DEFAULT_wxUSE_LISTCTRL=no
+    DEFAULT_wxUSE_MARKUP=no
     DEFAULT_wxUSE_NOTEBOOK=no
     DEFAULT_wxUSE_POPUPWIN=no
     DEFAULT_wxUSE_RADIOBOX=no
@@ -925,6 +926,9 @@ if test "$wxUSE_CONTROLS" = "no"; then
     DEFAULT_wxUSE_TREECTRL=no
 fi
 
+dnl features affecting multiple controls
+WX_ARG_FEATURE(markup,      [  --enable-markup         support wxControl::SetLabelMarkup], wxUSE_MARKUP)
+
 dnl please keep the settings below in alphabetical order
 WX_ARG_FEATURE(accel,       [  --enable-accel          use accelerators], wxUSE_ACCEL)
 WX_ARG_FEATURE(animatectrl, [  --enable-animatectrl    use wxAnimationCtrl class], wxUSE_ANIMATIONCTRL)
@@ -6751,6 +6755,10 @@ if test "$wxUSE_CONTROLS" = "yes"; then
   USES_CONTROLS=1
 fi
 
+if test "$wxUSE_MARKUP" = "yes"; then
+  AC_DEFINE(wxUSE_MARKUP)
+fi
+
 if test "$wxUSE_ACCEL" = "yes"; then
   AC_DEFINE(wxUSE_ACCEL)
   USES_CONTROLS=1
index 693bce4a139b34ed9b167ba7706231d31218ca8b..2367dfcde987819df316302b06b891d7e77b4b38 100644 (file)
@@ -170,6 +170,7 @@ library:
 @itemdef{wxUSE_LONGLONG, Use wxLongLong class.}
 @itemdef{wxUSE_LONGLONG_NATIVE, Use native <tt>long long</tt> type in wxLongLong implementation.}
 @itemdef{wxUSE_LONGLONG_WX, Use generic wxLongLong implementation.}
+@itemdef{wxUSE_MARKUP, Provide wxControl::SetLabelMarkup() method.}
 @itemdef{wxUSE_MDI, Use wxMDIParentFrame, and wxMDIChildFrame}
 @itemdef{wxUSE_MDI_ARCHITECTURE, Use MDI-based document-view classes.}
 @itemdef{wxUSE_MEDIACTRL, Use wxMediaCtrl.}
index 10c79baad6e2a006323c4beee3e36140bf8f904c..2e6a95cb38f888154225d0163261499f72651956 100644 (file)
 #   endif
 #endif /* !defined(wxUSE_LOG_DIALOG) */
 
+#ifndef wxUSE_MARKUP
+#   ifdef wxABORT_ON_CONFIG_ERROR
+#       error "wxUSE_MARKUP must be defined, please read comment near the top of this file."
+#   else
+#       define wxUSE_MARKUP 0
+#   endif
+#endif /* !defined(wxUSE_MARKUP) */
+
 #ifndef wxUSE_MDI
 #   ifdef wxABORT_ON_CONFIG_ERROR
 #       error "wxUSE_MDI must be defined, please read comment near the top of this file."
index bfb0cf5fdd5dc6c4b08bfaba4de56888cc05fbb2..b597937ef2b3cc7a911a383cbeab4021128e4de3 100644 (file)
@@ -95,6 +95,7 @@ public:
     virtual wxString GetLabelText() const { return GetLabelText(GetLabel()); }
 
 
+#if wxUSE_MARKUP
     // Set the label with markup (and mnemonics). Markup is a simple subset of
     // HTML with tags such as <b>, <i> and <span>. By default it is not
     // supported i.e. all the markup is simply stripped and SetLabel() is
@@ -113,6 +114,7 @@ public:
     {
         return DoSetLabelMarkup(markup);
     }
+#endif // wxUSE_MARKUP
 
 
     // controls by default inherit the colours of their parents, if a
@@ -183,10 +185,12 @@ protected:
                        const wxValidator& validator,
                        const wxString& name);
 
+#if wxUSE_MARKUP
     // This function may be overridden in the derived classes to implement
     // support for labels with markup. The base class version simply strips the
     // markup and calls SetLabel() with the remaining text.
     virtual bool DoSetLabelMarkup(const wxString& markup);
+#endif // wxUSE_MARKUP
 
 
     // initialize the common fields of wxCommandEvent
@@ -197,9 +201,11 @@ protected:
                                           wxEllipsizeMode mode, int maxWidth,
                                           int replacementWidth);
 
+#if wxUSE_MARKUP
     // Remove markup from the given string, returns empty string on error i.e.
     // if markup was syntactically invalid.
     static wxString RemoveMarkup(const wxString& markup);
+#endif // wxUSE_MARKUP
 
 
     // this field contains the label in wx format, i.e. with '&' mnemonics,
index 164337796cd909cb3ed49e0b6e8aedf8631715bb..fdce88e0086c6d81c0296e5ddddc778870384520 100644 (file)
@@ -52,7 +52,9 @@ protected:
 
     // sets the label to the given string and also sets it for the given widget
     void GTKSetLabelForLabel(GtkLabel *w, const wxString& label);
+#if wxUSE_MARKUP
     void GTKSetLabelWithMarkupForLabel(GtkLabel *w, const wxString& label);
+#endif // wxUSE_MARKUP
 
     // GtkFrame helpers
     GtkWidget* GTKCreateFrame(const wxString& label);
index d3a4bc15765520ee070545413aab18c3352efaf3..78241efe298173fd328878ab2f5c29e66b15b422 100644 (file)
@@ -56,7 +56,9 @@ protected:
 
     virtual wxString DoGetLabel() const;
     virtual void DoSetLabel(const wxString& str);
+#if wxUSE_MARKUP
     virtual bool DoSetLabelMarkup(const wxString& markup);
+#endif // wxUSE_MARKUP
 
 private:
     // Common part of SetLabel() and DoSetLabelMarkup().
index 4fc403229b1207b5cf6826a7a30acd4c8031c4ba..720fea7abca95dbb67d1157cd0be14e6d272e7f1 100644 (file)
 // Recommended setting: 1 (don't change except for very special programs)
 #define wxUSE_CONTROLS     1
 
+// Support markup in control labels, i.e. provide wxControl::SetLabelMarkup().
+// Currently markup is supported only by a few controls and only some ports but
+// their number will increase with time.
+//
+// Default is 1
+//
+// Recommended setting: 1 (may be set to 0 if you want to save on code size)
+#define wxUSE_MARKUP       1
+
 // wxPopupWindow class is a top level transient window. It is currently used
 // to implement wxTipWindow
 //
index 703e872ad9dbf0095697cee40272275d65fc79ff..95fb470bd81cf77e9da049b00761cdcec3ebe910 100644 (file)
 // Recommended setting: 1 (don't change except for very special programs)
 #define wxUSE_CONTROLS     1
 
+// Support markup in control labels, i.e. provide wxControl::SetLabelMarkup().
+// Currently markup is supported only by a few controls and only some ports but
+// their number will increase with time.
+//
+// Default is 1
+//
+// Recommended setting: 1 (may be set to 0 if you want to save on code size)
+#define wxUSE_MARKUP       1
+
 // wxPopupWindow class is a top level transient window. It is currently used
 // to implement wxTipWindow
 //
index d01ee026350fec62775bed3185b4127d28ffa235..649c8b845d13f08a7e8217bb43402d499b001725 100644 (file)
 // Recommended setting: 1 (don't change except for very special programs)
 #define wxUSE_CONTROLS     1
 
+// Support markup in control labels, i.e. provide wxControl::SetLabelMarkup().
+// Currently markup is supported only by a few controls and only some ports but
+// their number will increase with time.
+//
+// Default is 1
+//
+// Recommended setting: 1 (may be set to 0 if you want to save on code size)
+#define wxUSE_MARKUP       1
+
 // wxPopupWindow class is a top level transient window. It is currently used
 // to implement wxTipWindow
 //
index cf5b66fbaabe582dd0b6ce367c253a2daab1b37a..be2ce532ce4db07c97def9a106e1867aec4ddbb8 100644 (file)
 // Recommended setting: 1 (don't change except for very special programs)
 #define wxUSE_CONTROLS     1
 
+// Support markup in control labels, i.e. provide wxControl::SetLabelMarkup().
+// Currently markup is supported only by a few controls and only some ports but
+// their number will increase with time.
+//
+// Default is 1
+//
+// Recommended setting: 1 (may be set to 0 if you want to save on code size)
+#define wxUSE_MARKUP       1
+
 // wxPopupWindow class is a top level transient window. It is currently used
 // to implement wxTipWindow
 //
index 812597c67e138dd870b7e6abd76ffa48e2502ccb..5ed9112a0429e58a49513d140e2b415fd2d8606e 100644 (file)
 // Recommended setting: 1 (don't change except for very special programs)
 #define wxUSE_CONTROLS     1
 
+// Support markup in control labels, i.e. provide wxControl::SetLabelMarkup().
+// Currently markup is supported only by a few controls and only some ports but
+// their number will increase with time.
+//
+// Default is 1
+//
+// Recommended setting: 1 (may be set to 0 if you want to save on code size)
+#define wxUSE_MARKUP       1
+
 // wxPopupWindow class is a top level transient window. It is currently used
 // to implement wxTipWindow
 //
index 9b7f64783dcf7d2abe2262d3f72172d2a88d39dc..f1c772f57fc0eabaeb46cf5f4fe5144c57fe7f0d 100644 (file)
 // Recommended setting: 1 (don't change except for very special programs)
 #define wxUSE_CONTROLS     1
 
+// Support markup in control labels, i.e. provide wxControl::SetLabelMarkup().
+// Currently markup is supported only by a few controls and only some ports but
+// their number will increase with time.
+//
+// Default is 1
+//
+// Recommended setting: 1 (may be set to 0 if you want to save on code size)
+#define wxUSE_MARKUP       1
+
 // wxPopupWindow class is a top level transient window. It is currently used
 // to implement wxTipWindow
 //
index 8b917569bc98f941a4baffbe3f25f67b3a875038..59565e19a0fe0486f5c81b775e2d595092c70ef2 100644 (file)
 // Recommended setting: 1 (don't change except for very special programs)
 #define wxUSE_CONTROLS     1
 
+// Support markup in control labels, i.e. provide wxControl::SetLabelMarkup().
+// Currently markup is supported only by a few controls and only some ports but
+// their number will increase with time.
+//
+// Default is 1
+//
+// Recommended setting: 1 (may be set to 0 if you want to save on code size)
+#define wxUSE_MARKUP       1
+
 // wxPopupWindow class is a top level transient window. It is currently used
 // to implement wxTipWindow
 //
index d07c8612091e783a46e6e2582c12509f92026682..be0bc2edbe14d3e62d9491ede28d7664b22eb246 100644 (file)
 // Recommended setting: 1 (don't change except for very special programs)
 #define wxUSE_CONTROLS     1
 
+// Support markup in control labels, i.e. provide wxControl::SetLabelMarkup().
+// Currently markup is supported only by a few controls and only some ports but
+// their number will increase with time.
+//
+// Default is 1
+//
+// Recommended setting: 1 (may be set to 0 if you want to save on code size)
+#define wxUSE_MARKUP       1
+
 // wxPopupWindow class is a top level transient window. It is currently used
 // to implement wxTipWindow
 //
index faa9756e53755bf90c7b5ca00e667dbadb9febef..a2a363c6d5e60c95223eb508d2524b4358a0ca25 100644 (file)
@@ -99,7 +99,9 @@ public:
         Widgets widgets;
         widgets.push_back(m_sizerStatBox->GetStaticBox());
         widgets.push_back(m_statText);
+#if wxUSE_MARKUP
         widgets.push_back(m_statMarkup);
+#endif // wxUSE_MARKUP
 #if wxUSE_STATLINE
         widgets.push_back(m_statLine);
 #endif // wxUSE_STATLINE
@@ -118,7 +120,9 @@ protected:
     void OnButtonReset(wxCommandEvent& event);
     void OnButtonBoxText(wxCommandEvent& event);
     void OnButtonLabelText(wxCommandEvent& event);
+#if wxUSE_MARKUP
     void OnButtonLabelWithMarkupText(wxCommandEvent& event);
+#endif // wxUSE_MARKUP
     void OnMouseEvent(wxMouseEvent& event);
 
     // reset all parameters
@@ -134,9 +138,12 @@ protected:
     wxCheckBox *m_chkVert,
                *m_chkGeneric,
                *m_chkAutoResize,
-               *m_chkEllipsize,
-               *m_chkMarkup,
+               *m_chkEllipsize;
+
+#if wxUSE_MARKUP
+    wxCheckBox *m_chkMarkup,
                *m_chkGreen;
+#endif // wxUSE_MARKUP
 
     wxRadioBox *m_radioHAlign,
                *m_radioVAlign,
@@ -144,8 +151,12 @@ protected:
 
     // the controls and the sizer containing them
     wxStaticBoxSizer *m_sizerStatBox;
-    wxStaticTextBase *m_statText,
-                     *m_statMarkup;
+    wxStaticTextBase *m_statText;
+
+#if wxUSE_MARKUP
+    wxStaticTextBase *m_statMarkup;
+#endif // wxUSE_MARKUP
+
 #if wxUSE_STATLINE
     wxStaticLine *m_statLine;
 #endif // wxUSE_STATLINE
@@ -153,8 +164,11 @@ protected:
 
     // the text entries for command parameters
     wxTextCtrl *m_textBox,
-               *m_textLabel,
-               *m_textLabelWithMarkup;
+               *m_textLabel;
+
+#if wxUSE_MARKUP
+    wxTextCtrl *m_textLabelWithMarkup;
+#endif // wxUSE_MARKUP
 
 private:
     DECLARE_EVENT_TABLE()
@@ -168,7 +182,9 @@ private:
 BEGIN_EVENT_TABLE(StaticWidgetsPage, WidgetsPage)
     EVT_BUTTON(StaticPage_Reset, StaticWidgetsPage::OnButtonReset)
     EVT_BUTTON(StaticPage_LabelText, StaticWidgetsPage::OnButtonLabelText)
+#if wxUSE_MARKUP
     EVT_BUTTON(StaticPage_LabelTextWithMarkup, StaticWidgetsPage::OnButtonLabelWithMarkupText)
+#endif // wxUSE_MARKUP
     EVT_BUTTON(StaticPage_BoxText, StaticWidgetsPage::OnButtonBoxText)
 
     EVT_CHECKBOX(wxID_ANY, StaticWidgetsPage::OnCheckOrRadioBox)
@@ -189,9 +205,12 @@ StaticWidgetsPage::StaticWidgetsPage(WidgetsBookCtrl *book,
 {
     // init everything
     m_chkVert =
-    m_chkAutoResize = (wxCheckBox *)NULL;
-    m_chkGeneric = NULL;
-    m_chkGreen = NULL;
+    m_chkAutoResize =
+    m_chkGeneric =
+#if wxUSE_MARKUP
+    m_chkGreen =
+#endif // wxUSE_MARKUP
+                NULL;
 
     m_radioHAlign =
     m_radioVAlign = (wxRadioBox *)NULL;
@@ -199,12 +218,19 @@ StaticWidgetsPage::StaticWidgetsPage(WidgetsBookCtrl *book,
 #if wxUSE_STATLINE
     m_statLine = (wxStaticLine *)NULL;
 #endif // wxUSE_STATLINE
+#if wxUSE_MARKUP
     m_statText = m_statMarkup = NULL;
+#endif // wxUSE_MARKUP
 
     m_sizerStatBox = (wxStaticBoxSizer *)NULL;
     m_sizerStatic = (wxSizer *)NULL;
 
-    m_textBox = m_textLabel = m_textLabelWithMarkup = NULL;
+    m_textBox =
+    m_textLabel =
+#if wxUSE_MARKUP
+    m_textLabelWithMarkup =
+#endif // wxUSE_MARKUP
+                            NULL;
 }
 
 void StaticWidgetsPage::CreateContent()
@@ -288,6 +314,7 @@ void StaticWidgetsPage::CreateContent()
     sizerMiddle->Add(m_textLabel, 0, wxEXPAND|wxALL, 5);
     sizerMiddle->Add(b2, 0, wxLEFT|wxBOTTOM, 5);
 
+#if wxUSE_MARKUP
     m_textLabelWithMarkup = new wxTextCtrl(this, wxID_ANY, wxEmptyString,
                                            wxDefaultPosition, wxDefaultSize,
                                            wxTE_MULTILINE|wxHSCROLL);
@@ -301,7 +328,9 @@ void StaticWidgetsPage::CreateContent()
 
     m_chkGreen = CreateCheckBoxAndAddToSizer(sizerLeft,
                                              "Decorated label on g&reen");
+
     sizerMiddle->Add(m_chkGreen, 0, wxALL, 5);
+#endif // wxUSE_MARKUP
 
     // final initializations
     // NB: must be done _before_ calling CreateStatic()
@@ -310,10 +339,12 @@ void StaticWidgetsPage::CreateContent()
     m_textBox->SetValue(wxT("This is a &box"));
     m_textLabel->SetValue(wxT("And this is a\n\tlabel inside the box with a &mnemonic.\n")
                           wxT("Only this text is affected by the ellipsize settings."));
+#if wxUSE_MARKUP
     m_textLabelWithMarkup->SetValue(wxT("Another label, this time <b>decorated</b> ")
                                     wxT("with <u>markup</u>; here you need entities ")
                                     wxT("for the symbols: &lt; &gt; &amp; &apos; &quot; ")
                                     wxT(" but you can still place &mnemonics..."));
+#endif // wxUSE_MARKUP
 
     // right pane
     wxSizer *sizerRight = new wxBoxSizer(wxHORIZONTAL);
@@ -354,7 +385,9 @@ void StaticWidgetsPage::CreateStatic()
         // delete m_sizerStatBox; -- deleted by Remove()
         m_sizerStatic->Remove(m_sizerStatBox);
         delete m_statText;
+#if wxUSE_MARKUP
         delete m_statMarkup;
+#endif // wxUSE_MARKUP
 #if wxUSE_STATLINE
         delete m_statLine;
 #endif // wxUSE_STATLINE
@@ -448,10 +481,12 @@ void StaticWidgetsPage::CreateStatic()
                                              m_textLabel->GetValue(),
                                              wxDefaultPosition, wxDefaultSize,
                                              flagsDummyText);
+#if wxUSE_MARKUP
         m_statMarkup = new wxGenericStaticText(this, wxID_ANY,
                                              wxString(),
                                              wxDefaultPosition, wxDefaultSize,
                                              flagsText);
+#endif // wxUSE_MARKUP
     }
     else // use native versions
     {
@@ -459,16 +494,21 @@ void StaticWidgetsPage::CreateStatic()
                                       m_textLabel->GetValue(),
                                       wxDefaultPosition, wxDefaultSize,
                                       flagsDummyText);
+#if wxUSE_MARKUP
         m_statMarkup = new wxStaticText(this, wxID_ANY,
                                         wxString(),
                                         wxDefaultPosition, wxDefaultSize,
                                         flagsText);
+#endif // wxUSE_MARKUP
     }
 
+#if wxUSE_MARKUP
     m_statMarkup->SetLabelMarkup(m_textLabelWithMarkup->GetValue());
 
     if ( m_chkGreen->GetValue() )
         m_statMarkup->SetBackgroundColour(*wxGREEN);
+#endif // wxUSE_MARKUP
+
 #if wxUSE_STATLINE
     m_statLine = new wxStaticLine(this, wxID_ANY,
                                   wxDefaultPosition, wxDefaultSize,
@@ -479,7 +519,9 @@ void StaticWidgetsPage::CreateStatic()
 #if wxUSE_STATLINE
     m_sizerStatBox->Add(m_statLine, 0, wxGROW | wxALL, 5);
 #endif // wxUSE_STATLINE
+#if wxUSE_MARKUP
     m_sizerStatBox->Add(m_statMarkup, 1, wxGROW | wxALL, 5);
+#endif // wxUSE_MARKUP
 
     m_sizerStatic->Add(m_sizerStatBox, 1, wxGROW);
 
@@ -532,6 +574,7 @@ void StaticWidgetsPage::OnButtonLabelText(wxCommandEvent& WXUNUSED(event))
                  m_statText->GetLabelText());
 }
 
+#if wxUSE_MARKUP
 void StaticWidgetsPage::OnButtonLabelWithMarkupText(wxCommandEvent& WXUNUSED(event))
 {
     m_statMarkup->SetLabelMarkup(m_textLabelWithMarkup->GetValue());
@@ -544,6 +587,7 @@ void StaticWidgetsPage::OnButtonLabelWithMarkupText(wxCommandEvent& WXUNUSED(eve
     wxLogMessage(wxT("The label text is '%s'"),
                  m_statMarkup->GetLabelText());
 }
+#endif // wxUSE_MARKUP
 
 void StaticWidgetsPage::OnMouseEvent(wxMouseEvent& event)
 {
index b1f8916a9f43c33f6c570a597ab87f4e467e066c..6ac7576dbc9de361a76d63fa8d9a16f65808e824 100644 (file)
 
 #define wxUSE_CONTROLS     0
 
+#define wxUSE_MARKUP       0
+
 #define wxUSE_POPUPWIN     0
 
 #define wxUSE_TIPWINDOW    0
index 72e1d342b857f2399c978d1de5885525c6b9a653..82bcefd81429c2029735b402303bee911c6d6cc6 100644 (file)
@@ -236,6 +236,8 @@ wxControlBase::GetCompositeControlsDefaultAttributes(wxWindowVariant WXUNUSED(va
 // wxControl markup support
 // ----------------------------------------------------------------------------
 
+#if wxUSE_MARKUP
+
 /* static */
 wxString wxControlBase::RemoveMarkup(const wxString& markup)
 {
@@ -253,6 +255,8 @@ bool wxControlBase::DoSetLabelMarkup(const wxString& markup)
     return true;
 }
 
+#endif // wxUSE_MARKUP
+
 // ----------------------------------------------------------------------------
 // wxControlBase - ellipsization code
 // ----------------------------------------------------------------------------
index 8320e35eca8f2784dcbaf4bc710934aebd52dbf2..5701ee64fa85e305a7285a0af25757dcb447f3e2 100644 (file)
@@ -23,8 +23,7 @@
     #pragma hdrstop
 #endif
 
-#ifndef WX_PRECOMP
-#endif // WX_PRECOMP
+#if wxUSE_MARKUP
 
 #include "wx/private/markupparser.h"
 
@@ -473,3 +472,5 @@ wxString wxMarkupParser::Strip(const wxString& text)
 
     return output.GetText();
 }
+
+#endif // wxUSE_MARKUP
index 7fcdb2192e06b6e965947c971b228296c6e8dcbf..5a06a3910f43dfd0af92e470d8ffe58df00eb0ea 100644 (file)
@@ -127,12 +127,15 @@ void wxControl::GTKSetLabelForLabel(GtkLabel *w, const wxString& label)
     gtk_label_set_text_with_mnemonic(w, wxGTK_CONV(labelGTK));
 }
 
+#if wxUSE_MARKUP
+
 void wxControl::GTKSetLabelWithMarkupForLabel(GtkLabel *w, const wxString& label)
 {
     const wxString labelGTK = GTKConvertMnemonicsWithMarkup(label);
     gtk_label_set_markup_with_mnemonic(w, wxGTK_CONV(labelGTK));
 }
 
+#endif // wxUSE_MARKUP
 
 // ----------------------------------------------------------------------------
 // GtkFrame helpers
index e7139db0a32b951e722763854c4331cd6af8c6bb..7fd12e10abcf29ec243416e9bb198d1d294d8bcb 100644 (file)
@@ -133,6 +133,8 @@ void wxStaticText::SetLabel(const wxString& label)
     GTKDoSetLabel(&wxStaticText::GTKSetLabelForLabel, label);
 }
 
+#if wxUSE_MARKUP
+
 bool wxStaticText::DoSetLabelMarkup(const wxString& markup)
 {
     const wxString stripped = RemoveMarkup(markup);
@@ -146,6 +148,8 @@ bool wxStaticText::DoSetLabelMarkup(const wxString& markup)
     return true;
 }
 
+#endif // wxUSE_MARKUP
+
 bool wxStaticText::SetFont( const wxFont &font )
 {
     const bool wasUnderlined = GetFont().GetUnderlined();