X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3700e21b9185baf99d8e1e6cb1bb4ac9fe9e1e4a..3fe39b0ce3c0f47faea34ef99c3d0260957cc4e0:/samples/widgets/widgets.cpp diff --git a/samples/widgets/widgets.cpp b/samples/widgets/widgets.cpp index 9c46759a46..3473a56c9f 100644 --- a/samples/widgets/widgets.cpp +++ b/samples/widgets/widgets.cpp @@ -448,7 +448,7 @@ void WidgetsFrame::InitBook() menuPages->AppendRadioItem ( Widgets_GoToPage + nPage, - wxString::Format("%s\tF%u", + wxString::Format(wxT("%s\tF%u"), info->GetLabel().c_str(), nPage + 1) ); } @@ -513,34 +513,26 @@ void WidgetsFrame::OnSetTooltip(wxCommandEvent& WXUNUSED(event)) { static wxString s_tip = _T("This is a tooltip"); - wxString s = wxGetTextFromUser - ( - _T("Tooltip text: "), - _T("Widgets sample"), - s_tip, - this - ); + wxTextEntryDialog dialog + ( + this, + _T("Tooltip text (may use \\n, leave empty to remove): "), + _T("Widgets sample"), + s_tip + ); - if ( s.empty() ) + if ( dialog.ShowModal() != wxID_OK ) return; - s_tip = s; - - if( wxMessageBox( _T("Test multiline tooltip text?"), - _T("Widgets sample"), - wxYES_NO, - this - ) == wxYES ) - { - s = _T("#1 ") + s_tip + _T("\n") + _T("#2 ") + s_tip; - } + s_tip = dialog.GetValue(); + s_tip.Replace(_T("\\n"), _T("\n")); WidgetsPage *page = wxStaticCast(m_book->GetCurrentPage(), WidgetsPage); - page->GetWidget()->SetToolTip(s); + page->GetWidget()->SetToolTip(s_tip); wxControl *ctrl2 = page->GetWidget2(); if ( ctrl2 ) - ctrl2->SetToolTip(s); + ctrl2->SetToolTip(s_tip); } #endif // wxUSE_TOOLTIPS