X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/97ff49b3834325cfe53813aeb53d326d7661f184..0c2a7270577c4d007d464ed28d8addb76a9a4a14:/src/richtext/richtexttabspage.cpp diff --git a/src/richtext/richtexttabspage.cpp b/src/richtext/richtexttabspage.cpp index 3d03a74a3b..2285d3fa93 100644 --- a/src/richtext/richtexttabspage.cpp +++ b/src/richtext/richtexttabspage.cpp @@ -1,21 +1,17 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: richtexttabspage.cpp +// Name: src/richtext/richtexttabspage.cpp // Purpose: // Author: Julian Smart // Modified by: // Created: 10/4/2006 8:03:20 AM -// RCS-ID: +// RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -////@begin includes -////@end includes +#if wxUSE_RICHTEXT -#include "../../include/wx/richtext/richtexttabspage.h" - -////@begin XPM images -////@end XPM images +#include "wx/richtext/richtexttabspage.h" /*! * wxRichTextTabsPage type definition @@ -63,7 +59,7 @@ wxRichTextTabsPage::wxRichTextTabsPage( wxWindow* parent, wxWindowID id, const w /*! * Initialise members */ - + void wxRichTextTabsPage::Init() { m_tabsPresent = false; @@ -115,13 +111,17 @@ void wxRichTextTabsPage::CreateControls() itemBoxSizer4->Add(itemBoxSizer5, 0, wxGROW, 5); wxStaticText* itemStaticText6 = new wxStaticText( itemPanel1, wxID_STATIC, _("&Position (tenths of a mm):"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer5->Add(itemStaticText6, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); + itemBoxSizer5->Add(itemStaticText6, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5); - m_tabEditCtrl = new wxTextCtrl( itemPanel1, ID_RICHTEXTTABSPAGE_TABEDIT, _T(""), wxDefaultPosition, wxDefaultSize, 0 ); + m_tabEditCtrl = new wxTextCtrl( itemPanel1, ID_RICHTEXTTABSPAGE_TABEDIT, wxT(""), wxDefaultPosition, wxDefaultSize, 0 ); + m_tabEditCtrl->SetHelpText(_("The tab position.")); + if (wxRichTextTabsPage::ShowToolTips()) + m_tabEditCtrl->SetToolTip(_("The tab position.")); itemBoxSizer5->Add(m_tabEditCtrl, 0, wxGROW|wxALL, 5); - wxString* m_tabListCtrlStrings = NULL; - m_tabListCtrl = new wxListBox( itemPanel1, ID_RICHTEXTTABSPAGE_TABLIST, wxDefaultPosition, wxSize(80, 200), 0, m_tabListCtrlStrings, wxLB_SINGLE ); + wxArrayString m_tabListCtrlStrings; + m_tabListCtrlStrings.Add(_("The tab positions.")); + m_tabListCtrl = new wxListBox( itemPanel1, ID_RICHTEXTTABSPAGE_TABLIST, wxDefaultPosition, wxSize(80, 200), m_tabListCtrlStrings, wxLB_SINGLE ); itemBoxSizer5->Add(m_tabListCtrl, 1, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5); itemBoxSizer4->Add(2, 1, 1, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5); @@ -129,17 +129,26 @@ void wxRichTextTabsPage::CreateControls() wxBoxSizer* itemBoxSizer10 = new wxBoxSizer(wxVERTICAL); itemBoxSizer4->Add(itemBoxSizer10, 0, wxGROW, 5); - wxStaticText* itemStaticText11 = new wxStaticText( itemPanel1, wxID_STATIC, _T(""), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer10->Add(itemStaticText11, 0, wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxADJUST_MINSIZE, 5); + wxStaticText* itemStaticText11 = new wxStaticText( itemPanel1, wxID_STATIC, wxT(""), wxDefaultPosition, wxDefaultSize, 0 ); + itemBoxSizer10->Add(itemStaticText11, 0, wxALIGN_CENTER_HORIZONTAL|wxBOTTOM, 5); wxButton* itemButton12 = new wxButton( itemPanel1, ID_RICHTEXTTABSPAGE_NEW_TAB, _("&New"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer10->Add(itemButton12, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); + itemButton12->SetHelpText(_("Click to create a new tab position.")); + if (wxRichTextTabsPage::ShowToolTips()) + itemButton12->SetToolTip(_("Click to create a new tab position.")); + itemBoxSizer10->Add(itemButton12, 0, wxGROW|wxALL, 5); wxButton* itemButton13 = new wxButton( itemPanel1, ID_RICHTEXTTABSPAGE_DELETE_TAB, _("&Delete"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer10->Add(itemButton13, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT|wxBOTTOM, 5); + itemButton13->SetHelpText(_("Click to delete the selected tab position.")); + if (wxRichTextTabsPage::ShowToolTips()) + itemButton13->SetToolTip(_("Click to delete the selected tab position.")); + itemBoxSizer10->Add(itemButton13, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5); wxButton* itemButton14 = new wxButton( itemPanel1, ID_RICHTEXTTABSPAGE_DELETE_ALL_TABS, _("Delete A&ll"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer10->Add(itemButton14, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT|wxBOTTOM, 5); + itemButton14->SetHelpText(_("Click to delete all tab positions.")); + if (wxRichTextTabsPage::ShowToolTips()) + itemButton14->SetToolTip(_("Click to delete all tab positions.")); + itemBoxSizer10->Add(itemButton14, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5); ////@end wxRichTextTabsPage content construction } @@ -149,7 +158,7 @@ bool wxRichTextTabsPage::TransferDataFromWindow() { wxPanel::TransferDataFromWindow(); - wxTextAttrEx* attr = GetAttributes(); + wxTextAttr* attr = GetAttributes(); if (m_tabsPresent) { @@ -168,7 +177,7 @@ bool wxRichTextTabsPage::TransferDataToWindow() { wxPanel::TransferDataToWindow(); - wxTextAttrEx* attr = GetAttributes(); + wxTextAttr* attr = GetAttributes(); m_tabListCtrl->Clear(); m_tabEditCtrl->SetValue(wxEmptyString); @@ -216,7 +225,7 @@ void wxRichTextTabsPage::SortTabs() } } -wxTextAttrEx* wxRichTextTabsPage::GetAttributes() +wxTextAttr* wxRichTextTabsPage::GetAttributes() { return wxRichTextFormattingDialog::GetDialogAttributes(this); } @@ -227,7 +236,7 @@ wxTextAttrEx* wxRichTextTabsPage::GetAttributes() bool wxRichTextTabsPage::ShowToolTips() { - return true; + return wxRichTextFormattingDialog::ShowToolTips(); } /*! @@ -263,7 +272,7 @@ wxIcon wxRichTextTabsPage::GetIconResource( const wxString& name ) void wxRichTextTabsPage::OnNewTabClick( wxCommandEvent& WXUNUSED(event) ) { wxString str = m_tabEditCtrl->GetValue(); - if (!str.IsEmpty() && str.IsNumber()) + if (!str.empty() && str.IsNumber()) { wxString s(wxString::Format(wxT("%d"), wxAtoi(str))); @@ -283,7 +292,7 @@ void wxRichTextTabsPage::OnNewTabUpdate( wxUpdateUIEvent& event ) // This may be a bit expensive - consider updating New button when text // changes in edit control wxString str = m_tabEditCtrl->GetValue(); - if (!str.IsEmpty() && str.IsNumber()) + if (!str.empty() && str.IsNumber()) { wxString s(wxString::Format(wxT("%d"), wxAtoi(str))); event.Enable(m_tabListCtrl->FindString(s) == wxNOT_FOUND); @@ -345,6 +354,8 @@ void wxRichTextTabsPage::OnDeleteAllTabsUpdate( wxUpdateUIEvent& event ) void wxRichTextTabsPage::OnTablistSelected( wxCommandEvent& WXUNUSED(event) ) { wxString str = m_tabListCtrl->GetStringSelection(); - if (!str.IsEmpty()) + if (!str.empty()) m_tabEditCtrl->SetValue(str); } + +#endif // wxUSE_RICHTEXT