--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
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
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
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
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
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)
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
@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.}
# 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."
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
{
return DoSetLabelMarkup(markup);
}
+#endif // wxUSE_MARKUP
// controls by default inherit the colours of their parents, if a
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
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,
// 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);
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().
// 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
//
// 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
//
// 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
//
// 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
//
// 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
//
// 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
//
// 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
//
// 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
//
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
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
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,
// 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
// 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()
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)
{
// 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;
#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()
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);
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()
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: < > & ' " ")
wxT(" but you can still place &mnemonics..."));
+#endif // wxUSE_MARKUP
// right pane
wxSizer *sizerRight = new wxBoxSizer(wxHORIZONTAL);
// 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
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
{
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,
#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);
m_statText->GetLabelText());
}
+#if wxUSE_MARKUP
void StaticWidgetsPage::OnButtonLabelWithMarkupText(wxCommandEvent& WXUNUSED(event))
{
m_statMarkup->SetLabelMarkup(m_textLabelWithMarkup->GetValue());
wxLogMessage(wxT("The label text is '%s'"),
m_statMarkup->GetLabelText());
}
+#endif // wxUSE_MARKUP
void StaticWidgetsPage::OnMouseEvent(wxMouseEvent& event)
{
#define wxUSE_CONTROLS 0
+#define wxUSE_MARKUP 0
+
#define wxUSE_POPUPWIN 0
#define wxUSE_TIPWINDOW 0
// wxControl markup support
// ----------------------------------------------------------------------------
+#if wxUSE_MARKUP
+
/* static */
wxString wxControlBase::RemoveMarkup(const wxString& markup)
{
return true;
}
+#endif // wxUSE_MARKUP
+
// ----------------------------------------------------------------------------
// wxControlBase - ellipsization code
// ----------------------------------------------------------------------------
#pragma hdrstop
#endif
-#ifndef WX_PRECOMP
-#endif // WX_PRECOMP
+#if wxUSE_MARKUP
#include "wx/private/markupparser.h"
return output.GetText();
}
+
+#endif // wxUSE_MARKUP
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
GTKDoSetLabel(&wxStaticText::GTKSetLabelForLabel, label);
}
+#if wxUSE_MARKUP
+
bool wxStaticText::DoSetLabelMarkup(const wxString& markup)
{
const wxString stripped = RemoveMarkup(markup);
return true;
}
+#endif // wxUSE_MARKUP
+
bool wxStaticText::SetFont( const wxFont &font )
{
const bool wasUnderlined = GetFont().GetUnderlined();