Add markup support to wxMSW wxButton and show it in the sample.
Use recently added wxMarkupText to implement support for markup in wxMSW wxButton. Update the button page of the widgets sample to show markup support. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67065 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -131,6 +131,9 @@ protected:
|
||||
#if wxUSE_COMMANDLINKBUTTON
|
||||
*m_chkCommandLink,
|
||||
#endif // wxUSE_COMMANDLINKBUTTON
|
||||
#if wxUSE_MARKUP
|
||||
*m_chkUseMarkup,
|
||||
#endif // wxUSE_MARKUP
|
||||
*m_chkDefault;
|
||||
|
||||
// more checkboxes for wxBitmapButton only
|
||||
@@ -209,6 +212,9 @@ ButtonWidgetsPage::ButtonWidgetsPage(WidgetsBookCtrl *book,
|
||||
#if wxUSE_COMMANDLINKBUTTON
|
||||
m_chkCommandLink =
|
||||
#endif // wxUSE_COMMANDLINKBUTTON
|
||||
#if wxUSE_MARKUP
|
||||
m_chkUseMarkup =
|
||||
#endif // wxUSE_MARKUP
|
||||
m_chkDefault =
|
||||
m_chkUsePressed =
|
||||
m_chkUseFocused =
|
||||
@@ -241,6 +247,9 @@ void ButtonWidgetsPage::CreateContent()
|
||||
#if wxUSE_COMMANDLINKBUTTON
|
||||
m_chkCommandLink = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("Use command &link button"));
|
||||
#endif
|
||||
#if wxUSE_MARKUP
|
||||
m_chkUseMarkup = CreateCheckBoxAndAddToSizer(sizerLeft, "Interpret &markup");
|
||||
#endif // wxUSE_MARKUP
|
||||
m_chkDefault = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Default"));
|
||||
|
||||
sizerLeft->AddSpacer(5);
|
||||
@@ -351,6 +360,9 @@ void ButtonWidgetsPage::Reset()
|
||||
#if wxUSE_COMMANDLINKBUTTON
|
||||
m_chkCommandLink->SetValue(false);
|
||||
#endif
|
||||
#if wxUSE_MARKUP
|
||||
m_chkUseMarkup->SetValue(false);
|
||||
#endif // wxUSE_MARKUP
|
||||
|
||||
m_chkUsePressed->SetValue(true);
|
||||
m_chkUseFocused->SetValue(true);
|
||||
@@ -547,12 +559,21 @@ void ButtonWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& WXUNUSED(event))
|
||||
|
||||
void ButtonWidgetsPage::OnButtonChangeLabel(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
const wxString labelText = m_textLabel->GetValue();
|
||||
|
||||
#if wxUSE_COMMANDLINKBUTTON
|
||||
if ( m_cmdLnkButton )
|
||||
m_cmdLnkButton->SetMainLabel(m_textLabel->GetValue());
|
||||
m_cmdLnkButton->SetMainLabel(labelText);
|
||||
else
|
||||
#endif // wxUSE_COMMANDLINKBUTTON
|
||||
m_button->SetLabel(m_textLabel->GetValue());
|
||||
{
|
||||
#if wxUSE_MARKUP
|
||||
if ( m_chkUseMarkup->GetValue() )
|
||||
m_button->SetLabelMarkup(labelText);
|
||||
else
|
||||
#endif // wxUSE_MARKUP
|
||||
m_button->SetLabel(labelText);
|
||||
}
|
||||
|
||||
m_sizerButton->Layout();
|
||||
}
|
||||
|
Reference in New Issue
Block a user