From 2b741a391c72ae679239b4341413f0bcc31942c3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?W=C5=82odzimierz=20Skiba?= Date: Mon, 9 Oct 2006 14:37:53 +0000 Subject: [PATCH] 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 --- include/wx/richtext/richtextformatdlg.h | 5 +++-- src/richtext/richtextformatdlg.cpp | 9 +++++---- 2 files changed, 8 insertions(+), 6 deletions(-) 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 - -- 2.45.2