#include "wx/richtext/richtextctrl.h"
#include "wx/richtext/richtextstyles.h"
+#ifdef __WXMAC__
+#include "../../src/richtext/richtextfontpage.cpp"
+#include "../../src/richtext/richtextindentspage.cpp"
+#include "../../src/richtext/richtexttabspage.cpp"
+#include "../../src/richtext/richtextbulletspage.cpp"
+#include "../../src/richtext/richtextstylepage.cpp"
+#else
#include "richtextfontpage.cpp"
#include "richtextindentspage.cpp"
#include "richtexttabspage.cpp"
#include "richtextbulletspage.cpp"
#include "richtextstylepage.cpp"
+#endif
#if 0 // def __WXMAC__
#define wxRICHTEXT_USE_TOOLBOOK true
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;
/// 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())
{
}
}
+/// Respond to help command
+void wxRichTextFormattingDialog::OnHelp(wxCommandEvent& event)
+{
+ int selPage = GetBookCtrl()->GetSelection();
+ if (selPage != wxNOT_FOUND)
+ {
+ int pageId = m_pageIds[selPage];
+ if (!GetFormattingDialogFactory()->ShowHelp(pageId, this))
+ event.Skip();
+ }
+}
+
void wxRichTextFormattingDialog::SetFormattingDialogFactory(wxRichTextFormattingDialogFactory* factory)
{
if (ms_FormattingDialogFactory)
int imageIndex = GetPageImage(pageId);
dialog->GetBookCtrl()->AddPage(panel, title, !selected, imageIndex);
selected = true;
+
+ dialog->AddPageId(pageId);
}
}
}
-
+
return true;
}
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__
SetBackgroundColour(m_colour);
}
dialog->Destroy();
+#endif // wxUSE_COLOURDLG
Refresh();
wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, GetId());
#endif
// wxUSE_RICHTEXT
-