From: Włodzimierz Skiba Date: Mon, 9 Oct 2006 14:37:53 +0000 (+0000) Subject: Use wxBookCtrl wrapper rather than wxNotebook in common code for native book (Smartph... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/2b741a391c72ae679239b4341413f0bcc31942c3 Use wxBookCtrl wrapper rather than wxNotebook in common code for native book (Smartphone fix). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41802 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/richtext/richtextformatdlg.h b/include/wx/richtext/richtextformatdlg.h index 70b7cbe195..a5645b3939 100644 --- a/include/wx/richtext/richtextformatdlg.h +++ b/include/wx/richtext/richtextformatdlg.h @@ -21,6 +21,8 @@ #if wxUSE_RICHTEXT #include "wx/propdlg.h" +#include "wx/bookctrl.h" + #if wxUSE_HTML #include "wx/htmllbox.h" #endif @@ -28,7 +30,6 @@ #include "wx/richtext/richtextbuffer.h" #include "wx/richtext/richtextstyles.h" -class WXDLLEXPORT wxNotebookEvent; class WXDLLIMPEXP_RICHTEXT wxRichTextFormattingDialog; class WXDLLIMPEXP_CORE wxImageList; @@ -145,7 +146,7 @@ public: /// Apply the styles when a different tab is selected, so the previews are /// up to date - void OnTabChanged(wxNotebookEvent& event); + void OnTabChanged(wxBookCtrlEvent& event); /// Set/get image list void SetImageList(wxImageList* imageList) { m_imageList = imageList; } diff --git a/src/richtext/richtextformatdlg.cpp b/src/richtext/richtextformatdlg.cpp index aeebc51ba1..d65dedb339 100644 --- a/src/richtext/richtextformatdlg.cpp +++ b/src/richtext/richtextformatdlg.cpp @@ -61,7 +61,7 @@ IMPLEMENT_CLASS(wxRichTextFormattingDialog, wxPropertySheetDialog) BEGIN_EVENT_TABLE(wxRichTextFormattingDialog, wxPropertySheetDialog) - EVT_NOTEBOOK_PAGE_CHANGED(-1, wxRichTextFormattingDialog::OnTabChanged) + EVT_BOOKCTRL_PAGE_CHANGED(wxID_ANY, wxRichTextFormattingDialog::OnTabChanged) END_EVENT_TABLE() wxRichTextFormattingDialogFactory* wxRichTextFormattingDialog::ms_FormattingDialogFactory = NULL; @@ -167,7 +167,7 @@ bool wxRichTextFormattingDialog::UpdateDisplay() /// Apply the styles when a different tab is selected, so the previews are /// up to date -void wxRichTextFormattingDialog::OnTabChanged(wxNotebookEvent& event) +void wxRichTextFormattingDialog::OnTabChanged(wxBookCtrlEvent& event) { if (GetBookCtrl() != event.GetEventObject()) { @@ -228,7 +228,7 @@ bool wxRichTextFormattingDialogFactory::CreatePages(long pages, wxRichTextFormat } } } - + return true; } @@ -441,6 +441,7 @@ void wxRichTextColourSwatchCtrl::OnMouseEvent(wxMouseEvent& event) wxColourData data; data.SetChooseFull(true); data.SetColour(m_colour); +#if wxUSE_COLOURDLG wxColourDialog *dialog = new wxColourDialog(parent, &data); // Crashes on wxMac (no m_peer) #ifndef __WXMAC__ @@ -453,6 +454,7 @@ void wxRichTextColourSwatchCtrl::OnMouseEvent(wxMouseEvent& event) SetBackgroundColour(m_colour); } dialog->Destroy(); +#endif // wxUSE_COLOURDLG Refresh(); wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, GetId()); @@ -578,4 +580,3 @@ wxString wxRichTextFontListBox::CreateHTML(const wxString& facename) const #endif // wxUSE_RICHTEXT -