X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3571e1add4e6ceb45ad88c224c432609f837a8dd..fa5d9d2006cf19bedac704dce79a0ea40c1e060c:/samples/widgets/button.cpp diff --git a/samples/widgets/button.cpp b/samples/widgets/button.cpp index 2c685e42ca..8bebe83b7f 100644 --- a/samples/widgets/button.cpp +++ b/samples/widgets/button.cpp @@ -128,7 +128,12 @@ protected: *m_chkTextAndBitmap, *m_chkFit, *m_chkAuthNeeded, +#if wxUSE_COMMANDLINKBUTTON *m_chkCommandLink, +#endif // wxUSE_COMMANDLINKBUTTON +#if wxUSE_MARKUP + *m_chkUseMarkup, +#endif // wxUSE_MARKUP *m_chkDefault; // more checkboxes for wxBitmapButton only @@ -204,7 +209,12 @@ ButtonWidgetsPage::ButtonWidgetsPage(WidgetsBookCtrl *book, m_chkTextAndBitmap = m_chkFit = m_chkAuthNeeded = +#if wxUSE_COMMANDLINKBUTTON m_chkCommandLink = +#endif // wxUSE_COMMANDLINKBUTTON +#if wxUSE_MARKUP + m_chkUseMarkup = +#endif // wxUSE_MARKUP m_chkDefault = m_chkUsePressed = m_chkUseFocused = @@ -237,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); @@ -347,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); @@ -481,17 +497,17 @@ void ButtonWidgetsPage::CreateButton() wxLEFT, wxRIGHT, wxTOP, wxBOTTOM }; - m_button->SetBitmap(wxArtProvider::GetIcon(wxART_INFORMATION), + m_button->SetBitmap(wxArtProvider::GetIcon(wxART_INFORMATION, wxART_BUTTON), positions[m_radioImagePos->GetSelection()]); if ( m_chkUsePressed->GetValue() ) - m_button->SetBitmapPressed(wxArtProvider::GetIcon(wxART_HELP)); + m_button->SetBitmapPressed(wxArtProvider::GetIcon(wxART_HELP, wxART_BUTTON)); if ( m_chkUseFocused->GetValue() ) - m_button->SetBitmapFocus(wxArtProvider::GetIcon(wxART_ERROR)); + m_button->SetBitmapFocus(wxArtProvider::GetIcon(wxART_ERROR, wxART_BUTTON)); if ( m_chkUseCurrent->GetValue() ) - m_button->SetBitmapCurrent(wxArtProvider::GetIcon(wxART_WARNING)); + m_button->SetBitmapCurrent(wxArtProvider::GetIcon(wxART_WARNING, wxART_BUTTON)); if ( m_chkUseDisabled->GetValue() ) - m_button->SetBitmapDisabled(wxArtProvider::GetIcon(wxART_MISSING_IMAGE)); + m_button->SetBitmapDisabled(wxArtProvider::GetIcon(wxART_MISSING_IMAGE, wxART_BUTTON)); } m_chkUsePressed->Enable(showsBitmap); @@ -543,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(); }