From 2fce6547622ff5f9e4ec31372b0f6172e87edefa Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Wed, 14 Nov 2007 14:42:31 +0000 Subject: [PATCH] Border corrections, and more compact dialog sizes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49947 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/richtext/richtextfontpage.h | 4 +- include/wx/richtext/richtextformatdlg.h | 7 +- include/wx/richtext/richtextsymboldlg.h | 9 +- src/richtext/richtextbulletspage.cpp | 12 +-- src/richtext/richtextdialogs.pjd | 119 +++++++++++------------- src/richtext/richtextfontpage.cpp | 44 ++++----- src/richtext/richtextformatdlg.cpp | 24 ++++- src/richtext/richtextindentspage.cpp | 6 +- src/richtext/richtextstyledlg.cpp | 4 +- src/richtext/richtextstyles.cpp | 11 ++- src/richtext/richtextsymboldlg.cpp | 51 +++++----- 11 files changed, 159 insertions(+), 132 deletions(-) diff --git a/include/wx/richtext/richtextfontpage.h b/include/wx/richtext/richtextfontpage.h index 74a4652c87..48e7e4839e 100644 --- a/include/wx/richtext/richtextfontpage.h +++ b/include/wx/richtext/richtextfontpage.h @@ -34,10 +34,10 @@ class wxRichTextFontPreviewCtrl; */ ////@begin control identifiers -#define SYMBOL_WXRICHTEXTFONTPAGE_STYLE wxRESIZE_BORDER|wxTAB_TRAVERSAL +#define SYMBOL_WXRICHTEXTFONTPAGE_STYLE wxTAB_TRAVERSAL #define SYMBOL_WXRICHTEXTFONTPAGE_TITLE _("wxRichTextFontPage") #define SYMBOL_WXRICHTEXTFONTPAGE_IDNAME ID_RICHTEXTFONTPAGE -#define SYMBOL_WXRICHTEXTFONTPAGE_SIZE wxSize(400, 300) +#define SYMBOL_WXRICHTEXTFONTPAGE_SIZE wxSize(200, 100) #define SYMBOL_WXRICHTEXTFONTPAGE_POSITION wxDefaultPosition ////@end control identifiers diff --git a/include/wx/richtext/richtextformatdlg.h b/include/wx/richtext/richtextformatdlg.h index b3a81acdbe..5a69bf5683 100644 --- a/include/wx/richtext/richtextformatdlg.h +++ b/include/wx/richtext/richtextformatdlg.h @@ -218,12 +218,7 @@ DECLARE_EVENT_TABLE() class WXDLLIMPEXP_RICHTEXT wxRichTextFontPreviewCtrl : public wxWindow { public: - wxRichTextFontPreviewCtrl(wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& sz = wxDefaultSize, long style = 0) : - wxWindow(parent, id, pos, sz, style) - { - SetBackgroundColour(*wxWHITE); - m_textEffects = 0; - } + wxRichTextFontPreviewCtrl(wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& sz = wxDefaultSize, long style = 0); void SetTextEffects(int effects) { m_textEffects = effects; } int GetTextEffects() const { return m_textEffects; } diff --git a/include/wx/richtext/richtextsymboldlg.h b/include/wx/richtext/richtextsymboldlg.h index 9f8facaf69..9b2c1efca8 100644 --- a/include/wx/richtext/richtextsymboldlg.h +++ b/include/wx/richtext/richtextsymboldlg.h @@ -27,9 +27,6 @@ ////@begin forward declarations class wxSymbolListCtrl; - -class WXDLLIMPEXP_FWD_CORE wxTextCtrl; - ////@end forward declarations // __UNICODE__ is a symbol used by DialogBlocks-generated code. @@ -119,10 +116,16 @@ public: void OnFromUnicodeSelected( wxCommandEvent& event ); #endif +#if defined(__WXMSW__) || defined(__WXGTK__) || defined(__WXOS2__) || defined(__WXMGL__) || defined(__WXMOTIF__) || defined(__WXCOCOA__) || defined(__WXX11__) || defined(__WXPALMOS__) + /// wxEVT_UPDATE_UI event handler for wxID_OK + void OnOkUpdate( wxUpdateUIEvent& event ); +#endif +#if defined(__WXMAC__) /// wxEVT_UPDATE_UI event handler for wxID_OK void OnOkUpdate( wxUpdateUIEvent& event ); +#endif ////@end wxSymbolPickerDialog event handler declarations ////@begin wxSymbolPickerDialog member function declarations diff --git a/src/richtext/richtextbulletspage.cpp b/src/richtext/richtextbulletspage.cpp index d7ba6a0ddf..58cb7f52dd 100644 --- a/src/richtext/richtextbulletspage.cpp +++ b/src/richtext/richtextbulletspage.cpp @@ -156,7 +156,7 @@ void wxRichTextBulletsPage::CreateControls() itemBoxSizer5->Add(itemStaticText6, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5); wxArrayString m_styleListBoxStrings; - m_styleListBox = new wxListBox( itemPanel1, ID_RICHTEXTBULLETSPAGE_STYLELISTBOX, wxDefaultPosition, wxSize(-1, 140), m_styleListBoxStrings, wxLB_SINGLE ); + m_styleListBox = new wxListBox( itemPanel1, ID_RICHTEXTBULLETSPAGE_STYLELISTBOX, wxDefaultPosition, wxSize(-1, 90), m_styleListBoxStrings, wxLB_SINGLE ); m_styleListBox->SetHelpText(_("The available bullet styles.")); if (wxRichTextBulletsPage::ShowToolTips()) m_styleListBox->SetToolTip(_("The available bullet styles.")); @@ -243,7 +243,7 @@ void wxRichTextBulletsPage::CreateControls() m_symbolFontCtrl->SetToolTip(_("Available fonts.")); itemBoxSizer18->Add(m_symbolFontCtrl, 0, wxGROW|wxALL, 5); - itemBoxSizer18->Add(5, 5, 1, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); + itemBoxSizer18->Add(5, 5, 1, wxALIGN_CENTER_HORIZONTAL, 5); wxStaticText* itemStaticText27 = new wxStaticText( itemPanel1, ID_RICHTEXTBULLETSPAGE_NAMESTATIC, _("S&tandard bullet name:"), wxDefaultPosition, wxDefaultSize, 0 ); itemBoxSizer18->Add(itemStaticText27, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5); @@ -255,7 +255,7 @@ void wxRichTextBulletsPage::CreateControls() m_bulletNameCtrl->SetToolTip(_("A standard bullet name.")); itemBoxSizer18->Add(m_bulletNameCtrl, 0, wxGROW|wxALL, 5); - itemBoxSizer18->Add(5, 5, 1, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); + itemBoxSizer18->Add(5, 5, 1, wxALIGN_CENTER_HORIZONTAL, 5); wxStaticText* itemStaticText30 = new wxStaticText( itemPanel1, ID_RICHTEXTBULLETSPAGE_NUMBERSTATIC, _("&Number:"), wxDefaultPosition, wxDefaultSize, 0 ); itemBoxSizer18->Add(itemStaticText30, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5); @@ -266,13 +266,13 @@ void wxRichTextBulletsPage::CreateControls() m_numberCtrl->SetToolTip(_("The list item number.")); itemBoxSizer18->Add(m_numberCtrl, 0, wxGROW|wxALL, 5); - itemBoxSizer3->Add(5, 5, 1, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); + itemBoxSizer3->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL, 5); - m_previewCtrl = new wxRichTextCtrl( itemPanel1, ID_RICHTEXTBULLETSPAGE_PREVIEW_CTRL, wxEmptyString, wxDefaultPosition, wxSize(350, 180), wxSUNKEN_BORDER|wxVSCROLL|wxTE_READONLY ); + m_previewCtrl = new wxRichTextCtrl( itemPanel1, ID_RICHTEXTBULLETSPAGE_PREVIEW_CTRL, wxEmptyString, wxDefaultPosition, wxSize(350, 100), wxVSCROLL|wxTE_READONLY ); m_previewCtrl->SetHelpText(_("Shows a preview of the bullet settings.")); if (wxRichTextBulletsPage::ShowToolTips()) m_previewCtrl->SetToolTip(_("Shows a preview of the bullet settings.")); - itemBoxSizer3->Add(m_previewCtrl, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); + itemBoxSizer3->Add(m_previewCtrl, 1, wxGROW|wxALL, 5); ////@end wxRichTextBulletsPage content construction diff --git a/src/richtext/richtextdialogs.pjd b/src/richtext/richtextdialogs.pjd index 878ad2c6c4..0f611c016b 100644 --- a/src/richtext/richtextdialogs.pjd +++ b/src/richtext/richtextdialogs.pjd @@ -108,6 +108,7 @@ 0 0 1 + 0 1 1 0 @@ -246,7 +247,7 @@ "Tiled" 0 0 - 1 + 0 0 0 0 @@ -274,8 +275,8 @@ 1 -1 -1 - 400 - 300 + 200 + 100 0 "" @@ -290,14 +291,6 @@ "wbBoxSizerProxy" "Vertical" "" - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 0 0 0 @@ -569,7 +562,7 @@ "" "" 0 - 1 + 0 0 0 0 @@ -585,7 +578,7 @@ -1 -1 200 - 140 + 100 "Expand" "Centre" 1 @@ -1705,10 +1698,10 @@ "Centre" 0 5 - 1 - 1 - 1 - 1 + 0 + 0 + 0 + 0 0 0 0 @@ -1752,7 +1745,7 @@ "" "" 0 - 1 + 0 0 0 0 @@ -1768,7 +1761,7 @@ -1 -1 100 - 80 + 60 "Expand" "Centre" 0 @@ -4206,12 +4199,12 @@ 5 "Centre" "Centre" - 1 + 0 5 - 1 - 1 - 1 - 1 + 0 + 0 + 0 + 0 0 0 0 @@ -4257,7 +4250,7 @@ 0 0 0 - 1 + 0 0 0 0 @@ -4271,10 +4264,10 @@ -1 -1 350 - 180 + 100 "Centre" "Centre" - 0 + 1 5 1 1 @@ -5319,7 +5312,7 @@ -1 -1 -1 - 140 + 90 "Expand" "Centre" 1 @@ -6265,10 +6258,10 @@ "Centre" 1 5 - 1 - 1 - 1 - 1 + 0 + 0 + 0 + 0 0 0 0 @@ -6429,10 +6422,10 @@ "Centre" 1 5 - 1 - 1 - 1 - 1 + 0 + 0 + 0 + 0 0 0 0 @@ -6600,12 +6593,12 @@ 5 "Centre" "Centre" - 1 + 0 5 - 1 - 1 - 1 - 1 + 0 + 0 + 0 + 0 0 0 0 @@ -6651,7 +6644,7 @@ 0 0 0 - 1 + 0 0 0 0 @@ -6665,10 +6658,10 @@ -1 -1 350 - 180 - "Centre" + 100 + "Expand" "Centre" - 0 + 1 5 1 1 @@ -7404,14 +7397,6 @@ "wbBoxSizerProxy" "Vertical" "" - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 0 0 0 @@ -7827,7 +7812,7 @@ "" "" 0 - 1 + 0 0 0 0 @@ -7843,7 +7828,7 @@ -1 -1 500 - 240 + 200 "Expand" "Centre" 1 @@ -8946,7 +8931,7 @@ "" "" 0 - 1 + 0 0 0 0 @@ -8962,7 +8947,7 @@ -1 -1 280 - 350 + 260 "Expand" "Centre" 1 @@ -9112,7 +9097,7 @@ "" "" 0 - 1 + 0 0 0 0 @@ -9127,7 +9112,7 @@ "wxTE_READONLY" -1 -1 - 310 + 250 200 "Expand" "Centre" @@ -10179,6 +10164,14 @@ "wbBoxSizerProxy" "Vertical" "" + "Centre" + "Centre" + 0 + 5 + 1 + 1 + 1 + 1 0 0 0 @@ -10567,8 +10560,6 @@ "" "" "" - "Bullet style" - "" "" "" "" @@ -10621,6 +10612,8 @@ "" "" 0 + "Bullet style" + "" "wxBoxSizer V" "dialog-control-document" @@ -11943,8 +11936,6 @@ "" "" "" - "Spacing" - "" "" "" "" @@ -11997,6 +11988,8 @@ "" "" 0 + "Spacing" + "" "wxBoxSizer V" "dialog-control-document" diff --git a/src/richtext/richtextfontpage.cpp b/src/richtext/richtextfontpage.cpp index b47f370468..3409e66a8e 100644 --- a/src/richtext/richtextfontpage.cpp +++ b/src/richtext/richtextfontpage.cpp @@ -130,13 +130,13 @@ void wxRichTextFontPage::CreateControls() m_faceTextCtrl = new wxTextCtrl( itemPanel1, ID_RICHTEXTFONTPAGE_FACETEXTCTRL, _T(""), wxDefaultPosition, wxDefaultSize, 0 ); m_faceTextCtrl->SetHelpText(_("Type a font name.")); - if (ShowToolTips()) + if (wxRichTextFontPage::ShowToolTips()) m_faceTextCtrl->SetToolTip(_("Type a font name.")); itemBoxSizer5->Add(m_faceTextCtrl, 0, wxGROW|wxLEFT|wxRIGHT|wxTOP, 5); - m_faceListBox = new wxRichTextFontListBox( itemPanel1, ID_RICHTEXTFONTPAGE_FACELISTBOX, wxDefaultPosition, wxSize(200, 140), wxSIMPLE_BORDER ); + m_faceListBox = new wxRichTextFontListBox( itemPanel1, ID_RICHTEXTFONTPAGE_FACELISTBOX, wxDefaultPosition, wxSize(200, 100), 0 ); m_faceListBox->SetHelpText(_("Lists the available fonts.")); - if (ShowToolTips()) + if (wxRichTextFontPage::ShowToolTips()) m_faceListBox->SetToolTip(_("Lists the available fonts.")); itemBoxSizer5->Add(m_faceListBox, 1, wxGROW|wxALL|wxFIXED_MINSIZE, 5); @@ -148,14 +148,14 @@ void wxRichTextFontPage::CreateControls() m_sizeTextCtrl = new wxTextCtrl( itemPanel1, ID_RICHTEXTFONTPAGE_SIZETEXTCTRL, _T(""), wxDefaultPosition, wxSize(50, -1), 0 ); m_sizeTextCtrl->SetHelpText(_("Type a size in points.")); - if (ShowToolTips()) + if (wxRichTextFontPage::ShowToolTips()) m_sizeTextCtrl->SetToolTip(_("Type a size in points.")); itemBoxSizer9->Add(m_sizeTextCtrl, 0, wxGROW|wxLEFT|wxRIGHT|wxTOP, 5); - wxString* m_sizeListBoxStrings = NULL; - m_sizeListBox = new wxListBox( itemPanel1, ID_RICHTEXTFONTPAGE_SIZELISTBOX, wxDefaultPosition, wxSize(50, -1), 0, m_sizeListBoxStrings, wxLB_SINGLE ); + wxArrayString m_sizeListBoxStrings; + m_sizeListBox = new wxListBox( itemPanel1, ID_RICHTEXTFONTPAGE_SIZELISTBOX, wxDefaultPosition, wxSize(50, -1), m_sizeListBoxStrings, wxLB_SINGLE ); m_sizeListBox->SetHelpText(_("Lists font sizes in points.")); - if (ShowToolTips()) + if (wxRichTextFontPage::ShowToolTips()) m_sizeListBox->SetToolTip(_("Lists font sizes in points.")); itemBoxSizer9->Add(m_sizeListBox, 1, wxALIGN_CENTER_HORIZONTAL|wxALL|wxFIXED_MINSIZE, 5); @@ -168,10 +168,10 @@ void wxRichTextFontPage::CreateControls() wxStaticText* itemStaticText15 = new wxStaticText( itemPanel1, wxID_STATIC, _("Font st&yle:"), wxDefaultPosition, wxDefaultSize, 0 ); itemBoxSizer14->Add(itemStaticText15, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5); - wxString* m_styleCtrlStrings = NULL; - m_styleCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTFONTPAGE_STYLECTRL, _T(""), wxDefaultPosition, wxDefaultSize, 0, m_styleCtrlStrings, wxCB_READONLY ); + wxArrayString m_styleCtrlStrings; + m_styleCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTFONTPAGE_STYLECTRL, _T(""), wxDefaultPosition, wxDefaultSize, m_styleCtrlStrings, wxCB_READONLY ); m_styleCtrl->SetHelpText(_("Select regular or italic style.")); - if (ShowToolTips()) + if (wxRichTextFontPage::ShowToolTips()) m_styleCtrl->SetToolTip(_("Select regular or italic style.")); itemBoxSizer14->Add(m_styleCtrl, 0, wxGROW|wxALL, 5); @@ -181,10 +181,10 @@ void wxRichTextFontPage::CreateControls() wxStaticText* itemStaticText18 = new wxStaticText( itemPanel1, wxID_STATIC, _("Font &weight:"), wxDefaultPosition, wxDefaultSize, 0 ); itemBoxSizer17->Add(itemStaticText18, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5); - wxString* m_weightCtrlStrings = NULL; - m_weightCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTFONTPAGE_WEIGHTCTRL, _T(""), wxDefaultPosition, wxDefaultSize, 0, m_weightCtrlStrings, wxCB_READONLY ); + wxArrayString m_weightCtrlStrings; + m_weightCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTFONTPAGE_WEIGHTCTRL, _T(""), wxDefaultPosition, wxDefaultSize, m_weightCtrlStrings, wxCB_READONLY ); m_weightCtrl->SetHelpText(_("Select regular or bold.")); - if (ShowToolTips()) + if (wxRichTextFontPage::ShowToolTips()) m_weightCtrl->SetToolTip(_("Select regular or bold.")); itemBoxSizer17->Add(m_weightCtrl, 0, wxGROW|wxALL, 5); @@ -194,10 +194,10 @@ void wxRichTextFontPage::CreateControls() wxStaticText* itemStaticText21 = new wxStaticText( itemPanel1, wxID_STATIC, _("&Underlining:"), wxDefaultPosition, wxDefaultSize, 0 ); itemBoxSizer20->Add(itemStaticText21, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5); - wxString* m_underliningCtrlStrings = NULL; - m_underliningCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTFONTPAGE_UNDERLINING_CTRL, _T(""), wxDefaultPosition, wxDefaultSize, 0, m_underliningCtrlStrings, wxCB_READONLY ); + wxArrayString m_underliningCtrlStrings; + m_underliningCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTFONTPAGE_UNDERLINING_CTRL, _T(""), wxDefaultPosition, wxDefaultSize, m_underliningCtrlStrings, wxCB_READONLY ); m_underliningCtrl->SetHelpText(_("Select underlining or no underlining.")); - if (ShowToolTips()) + if (wxRichTextFontPage::ShowToolTips()) m_underliningCtrl->SetToolTip(_("Select underlining or no underlining.")); itemBoxSizer20->Add(m_underliningCtrl, 0, wxGROW|wxALL, 5); @@ -209,7 +209,7 @@ void wxRichTextFontPage::CreateControls() m_colourCtrl = new wxRichTextColourSwatchCtrl( itemPanel1, ID_RICHTEXTFONTPAGE_COLOURCTRL, wxDefaultPosition, wxSize(40, 20), wxSIMPLE_BORDER ); m_colourCtrl->SetHelpText(_("Click to change the text colour.")); - if (ShowToolTips()) + if (wxRichTextFontPage::ShowToolTips()) m_colourCtrl->SetToolTip(_("Click to change the text colour.")); itemBoxSizer23->Add(m_colourCtrl, 0, wxALIGN_LEFT|wxALL, 5); @@ -219,22 +219,22 @@ void wxRichTextFontPage::CreateControls() m_strikethroughCtrl = new wxCheckBox( itemPanel1, ID_RICHTEXTFONTPAGE_STRIKETHROUGHCTRL, _("&Strikethrough"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE ); m_strikethroughCtrl->SetValue(false); m_strikethroughCtrl->SetHelpText(_("Check to show a line through the text.")); - if (ShowToolTips()) + if (wxRichTextFontPage::ShowToolTips()) m_strikethroughCtrl->SetToolTip(_("Check to show a line through the text.")); itemBoxSizer26->Add(m_strikethroughCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); m_capitalsCtrl = new wxCheckBox( itemPanel1, ID_RICHTEXTFONTPAGE_CAPSCTRL, _("Ca&pitals"), wxDefaultPosition, wxDefaultSize, wxCHK_3STATE ); m_capitalsCtrl->SetValue(false); m_capitalsCtrl->SetHelpText(_("Check to show the text in capitals.")); - if (ShowToolTips()) + if (wxRichTextFontPage::ShowToolTips()) m_capitalsCtrl->SetToolTip(_("Check to show the text in capitals.")); itemBoxSizer26->Add(m_capitalsCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - itemBoxSizer3->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); + itemBoxSizer3->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL, 5); - m_previewCtrl = new wxRichTextFontPreviewCtrl( itemPanel1, ID_RICHTEXTFONTPAGE_PREVIEWCTRL, wxDefaultPosition, wxSize(100, 80), wxSIMPLE_BORDER ); + m_previewCtrl = new wxRichTextFontPreviewCtrl( itemPanel1, ID_RICHTEXTFONTPAGE_PREVIEWCTRL, wxDefaultPosition, wxSize(100, 60), 0 ); m_previewCtrl->SetHelpText(_("Shows a preview of the font settings.")); - if (ShowToolTips()) + if (wxRichTextFontPage::ShowToolTips()) m_previewCtrl->SetToolTip(_("Shows a preview of the font settings.")); itemBoxSizer3->Add(m_previewCtrl, 0, wxGROW|wxALL, 5); diff --git a/src/richtext/richtextformatdlg.cpp b/src/richtext/richtextformatdlg.cpp index d4c6081391..3a7d7ee6c5 100644 --- a/src/richtext/richtextformatdlg.cpp +++ b/src/richtext/richtextformatdlg.cpp @@ -393,6 +393,17 @@ BEGIN_EVENT_TABLE(wxRichTextFontPreviewCtrl, wxWindow) EVT_PAINT(wxRichTextFontPreviewCtrl::OnPaint) END_EVENT_TABLE() +wxRichTextFontPreviewCtrl::wxRichTextFontPreviewCtrl(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& sz, long style) +{ + if ((style & wxBORDER_MASK) == wxBORDER_DEFAULT) + style |= wxBORDER_THEME; + + wxWindow::Create(parent, id, pos, sz, style); + + SetBackgroundColour(*wxWHITE); + m_textEffects = 0; +} + void wxRichTextFontPreviewCtrl::OnPaint(wxPaintEvent& WXUNUSED(event)) { wxPaintDC dc(this); @@ -469,9 +480,13 @@ END_EVENT_TABLE() IMPLEMENT_CLASS(wxRichTextColourSwatchCtrl, wxControl) -wxRichTextColourSwatchCtrl::wxRichTextColourSwatchCtrl(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style): - wxControl(parent, id, pos, size, style) +wxRichTextColourSwatchCtrl::wxRichTextColourSwatchCtrl(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style) { + if ((style & wxBORDER_MASK) == wxBORDER_DEFAULT) + style |= wxBORDER_THEME; + + wxControl::Create(parent, id, pos, size, style); + SetColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)); SetBackgroundStyle(wxBG_STYLE_COLOUR); } @@ -495,7 +510,7 @@ void wxRichTextColourSwatchCtrl::OnMouseEvent(wxMouseEvent& event) wxColourDialog *dialog = new wxColourDialog(parent, &data); // Crashes on wxMac (no m_peer) #ifndef __WXMAC__ - dialog->SetTitle(_("Background colour")); + dialog->SetTitle(_("Colour")); #endif if (dialog->ShowModal() == wxID_OK) { @@ -534,6 +549,9 @@ wxRichTextFontListBox::wxRichTextFontListBox(wxWindow* parent, wxWindowID id, co bool wxRichTextFontListBox::Create(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style) { + if ((style & wxBORDER_MASK) == wxBORDER_DEFAULT) + style |= wxBORDER_THEME; + return wxHtmlListBox::Create(parent, id, pos, size, style); } diff --git a/src/richtext/richtextindentspage.cpp b/src/richtext/richtextindentspage.cpp index 19bf9511c9..57f31b7a4b 100644 --- a/src/richtext/richtextindentspage.cpp +++ b/src/richtext/richtextindentspage.cpp @@ -321,13 +321,13 @@ void wxRichTextIndentsSpacingPage::CreateControls() m_spacingLine->SetToolTip(_("The line spacing.")); itemBoxSizer49->Add(m_spacingLine, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - itemBoxSizer3->Add(5, 5, 1, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); + itemBoxSizer3->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL, 5); - m_previewCtrl = new wxRichTextCtrl( itemPanel1, ID_RICHTEXTINDENTSSPACINGPAGE_PREVIEW_CTRL, wxEmptyString, wxDefaultPosition, wxSize(350, 180), wxSUNKEN_BORDER|wxVSCROLL|wxTE_READONLY ); + m_previewCtrl = new wxRichTextCtrl( itemPanel1, ID_RICHTEXTINDENTSSPACINGPAGE_PREVIEW_CTRL, wxEmptyString, wxDefaultPosition, wxSize(350, 100), wxVSCROLL|wxTE_READONLY ); m_previewCtrl->SetHelpText(_("Shows a preview of the paragraph settings.")); if (wxRichTextIndentsSpacingPage::ShowToolTips()) m_previewCtrl->SetToolTip(_("Shows a preview of the paragraph settings.")); - itemBoxSizer3->Add(m_previewCtrl, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); + itemBoxSizer3->Add(m_previewCtrl, 1, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); ////@end wxRichTextIndentsSpacingPage content construction } diff --git a/src/richtext/richtextstyledlg.cpp b/src/richtext/richtextstyledlg.cpp index c45e5e66f1..9f76c237eb 100644 --- a/src/richtext/richtextstyledlg.cpp +++ b/src/richtext/richtextstyledlg.cpp @@ -190,7 +190,7 @@ void wxRichTextStyleOrganiserDialog::CreateControls() wxStaticText* itemStaticText6 = new wxStaticText( itemDialog1, wxID_STATIC, _("&Styles:"), wxDefaultPosition, wxDefaultSize, 0 ); itemBoxSizer5->Add(itemStaticText6, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5); - m_stylesListBox = new wxRichTextStyleListCtrl( itemDialog1, ID_RICHTEXTSTYLEORGANISERDIALOG_STYLES, wxDefaultPosition, wxSize(280, 350), wxSIMPLE_BORDER|listCtrlStyle ); + m_stylesListBox = new wxRichTextStyleListCtrl( itemDialog1, ID_RICHTEXTSTYLEORGANISERDIALOG_STYLES, wxDefaultPosition, wxSize(280, 260), listCtrlStyle ); m_stylesListBox->SetHelpText(_("The available styles.")); if (wxRichTextStyleOrganiserDialog::ShowToolTips()) m_stylesListBox->SetToolTip(_("The available styles.")); @@ -202,7 +202,7 @@ void wxRichTextStyleOrganiserDialog::CreateControls() wxStaticText* itemStaticText9 = new wxStaticText( itemDialog1, ID_RICHTEXTSTYLEORGANISERDIALOG_CURRENT_STYLE, _(" "), wxDefaultPosition, wxDefaultSize, 0 ); itemBoxSizer8->Add(itemStaticText9, 0, wxGROW|wxLEFT|wxRIGHT|wxTOP, 5); - m_previewCtrl = new wxRichTextCtrl( itemDialog1, ID_RICHTEXTSTYLEORGANISERDIALOG_PREVIEW, wxEmptyString, wxDefaultPosition, wxSize(310, 200), wxSIMPLE_BORDER|wxVSCROLL|wxTE_READONLY ); + m_previewCtrl = new wxRichTextCtrl( itemDialog1, ID_RICHTEXTSTYLEORGANISERDIALOG_PREVIEW, wxEmptyString, wxDefaultPosition, wxSize(250, 200), wxVSCROLL|wxTE_READONLY ); m_previewCtrl->SetHelpText(_("The style preview.")); if (wxRichTextStyleOrganiserDialog::ShowToolTips()) m_previewCtrl->SetToolTip(_("The style preview.")); diff --git a/src/richtext/richtextstyles.cpp b/src/richtext/richtextstyles.cpp index ca97d596de..e530832977 100644 --- a/src/richtext/richtextstyles.cpp +++ b/src/richtext/richtextstyles.cpp @@ -814,6 +814,9 @@ wxRichTextStyleListCtrl::wxRichTextStyleListCtrl(wxWindow* parent, wxWindowID id bool wxRichTextStyleListCtrl::Create(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style) { + if ((style & wxBORDER_MASK) == wxBORDER_DEFAULT) + style |= wxBORDER_THEME; + wxControl::Create(parent, id, pos, size, style); SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)); @@ -822,7 +825,13 @@ bool wxRichTextStyleListCtrl::Create(wxWindow* parent, wxWindowID id, const wxPo bool showSelector = ((style & wxRICHTEXTSTYLELIST_HIDE_TYPE_SELECTOR) == 0); - m_styleListBox = new wxRichTextStyleListBox(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, showSelector ? wxBORDER_DEFAULT : wxBORDER_NONE); + wxBorder listBoxStyle; + if (showSelector) + listBoxStyle = wxBORDER_THEME; + else + listBoxStyle = wxBORDER_NONE; + + m_styleListBox = new wxRichTextStyleListBox(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, listBoxStyle); wxBoxSizer* boxSizer = new wxBoxSizer(wxVERTICAL); diff --git a/src/richtext/richtextsymboldlg.cpp b/src/richtext/richtextsymboldlg.cpp index 13d7834e59..12b3c0000e 100644 --- a/src/richtext/richtextsymboldlg.cpp +++ b/src/richtext/richtextsymboldlg.cpp @@ -302,7 +302,13 @@ BEGIN_EVENT_TABLE( wxSymbolPickerDialog, wxDialog ) EVT_COMBOBOX( ID_SYMBOLPICKERDIALOG_FROM, wxSymbolPickerDialog::OnFromUnicodeSelected ) #endif +#if defined(__WXMSW__) || defined(__WXGTK__) || defined(__WXOS2__) || defined(__WXMGL__) || defined(__WXMOTIF__) || defined(__WXCOCOA__) || defined(__WXX11__) || defined(__WXPALMOS__) EVT_UPDATE_UI( wxID_OK, wxSymbolPickerDialog::OnOkUpdate ) +#endif + +#if defined(__WXMAC__) + EVT_UPDATE_UI( wxID_OK, wxSymbolPickerDialog::OnOkUpdate ) +#endif ////@end wxSymbolPickerDialog event table entries @@ -334,7 +340,7 @@ bool wxSymbolPickerDialog::Create( const wxString& symbol, const wxString& fontN m_symbol = symbol; ////@begin wxSymbolPickerDialog creation - SetExtraStyle(GetExtraStyle()|wxWS_EX_BLOCK_EVENTS|wxDIALOG_EX_CONTEXTHELP); + SetExtraStyle(wxWS_EX_BLOCK_EVENTS|wxDIALOG_EX_CONTEXTHELP); wxDialog::Create( parent, id, caption, pos, size, style ); CreateControls(); @@ -393,10 +399,10 @@ void wxSymbolPickerDialog::CreateControls() wxStaticText* itemStaticText6 = new wxStaticText( itemDialog1, wxID_STATIC, _("&Font:"), wxDefaultPosition, wxDefaultSize, 0 ); itemBoxSizer5->Add(itemStaticText6, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - wxString* m_fontCtrlStrings = NULL; - m_fontCtrl = new wxComboBox( itemDialog1, ID_SYMBOLPICKERDIALOG_FONT, wxEmptyString, wxDefaultPosition, wxSize(240, -1), 0, m_fontCtrlStrings, wxCB_READONLY ); + wxArrayString m_fontCtrlStrings; + m_fontCtrl = new wxComboBox( itemDialog1, ID_SYMBOLPICKERDIALOG_FONT, _T(""), wxDefaultPosition, wxSize(240, -1), m_fontCtrlStrings, wxCB_READONLY ); m_fontCtrl->SetHelpText(_("The font from which to take the symbol.")); - if (ShowToolTips()) + if (wxSymbolPickerDialog::ShowToolTips()) m_fontCtrl->SetToolTip(_("The font from which to take the symbol.")); itemBoxSizer5->Add(m_fontCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); @@ -409,16 +415,16 @@ void wxSymbolPickerDialog::CreateControls() #endif #if defined(__UNICODE__) - wxString* m_subsetCtrlStrings = NULL; - m_subsetCtrl = new wxComboBox( itemDialog1, ID_SYMBOLPICKERDIALOG_SUBSET, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, m_subsetCtrlStrings, wxCB_READONLY ); + wxArrayString m_subsetCtrlStrings; + m_subsetCtrl = new wxComboBox( itemDialog1, ID_SYMBOLPICKERDIALOG_SUBSET, _T(""), wxDefaultPosition, wxDefaultSize, m_subsetCtrlStrings, wxCB_READONLY ); m_subsetCtrl->SetHelpText(_("Shows a Unicode subset.")); - if (ShowToolTips()) + if (wxSymbolPickerDialog::ShowToolTips()) m_subsetCtrl->SetToolTip(_("Shows a Unicode subset.")); itemBoxSizer5->Add(m_subsetCtrl, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5); #endif - m_symbolsCtrl = new wxSymbolListCtrl( itemDialog1, ID_SYMBOLPICKERDIALOG_LISTCTRL, wxDefaultPosition, wxSize(500, 240), wxSIMPLE_BORDER ); + m_symbolsCtrl = new wxSymbolListCtrl( itemDialog1, ID_SYMBOLPICKERDIALOG_LISTCTRL, wxDefaultPosition, wxSize(500, 200), 0 ); itemBoxSizer3->Add(m_symbolsCtrl, 1, wxGROW|wxALL, 5); wxBoxSizer* itemBoxSizer12 = new wxBoxSizer(wxHORIZONTAL); @@ -432,9 +438,9 @@ void wxSymbolPickerDialog::CreateControls() wxStaticText* itemStaticText15 = new wxStaticText( itemDialog1, wxID_STATIC, _("&Character code:"), wxDefaultPosition, wxDefaultSize, 0 ); itemBoxSizer12->Add(itemStaticText15, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - m_characterCodeCtrl = new wxTextCtrl( itemDialog1, ID_SYMBOLPICKERDIALOG_CHARACTERCODE, wxEmptyString, wxDefaultPosition, wxSize(140, -1), wxTE_READONLY|wxTE_CENTRE ); + m_characterCodeCtrl = new wxTextCtrl( itemDialog1, ID_SYMBOLPICKERDIALOG_CHARACTERCODE, _T(""), wxDefaultPosition, wxSize(140, -1), wxTE_READONLY|wxTE_CENTRE ); m_characterCodeCtrl->SetHelpText(_("The character code.")); - if (ShowToolTips()) + if (wxSymbolPickerDialog::ShowToolTips()) m_characterCodeCtrl->SetToolTip(_("The character code.")); itemBoxSizer12->Add(m_characterCodeCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); @@ -447,20 +453,19 @@ void wxSymbolPickerDialog::CreateControls() #endif #if defined(__UNICODE__) - wxString m_fromUnicodeCtrlStrings[] = { - _("ASCII"), - _("Unicode") - }; - m_fromUnicodeCtrl = new wxComboBox( itemDialog1, ID_SYMBOLPICKERDIALOG_FROM, _("ASCII"), wxDefaultPosition, wxDefaultSize, 2, m_fromUnicodeCtrlStrings, wxCB_READONLY ); + wxArrayString m_fromUnicodeCtrlStrings; + m_fromUnicodeCtrlStrings.Add(_("ASCII")); + m_fromUnicodeCtrlStrings.Add(_("Unicode")); + m_fromUnicodeCtrl = new wxComboBox( itemDialog1, ID_SYMBOLPICKERDIALOG_FROM, _("ASCII"), wxDefaultPosition, wxDefaultSize, m_fromUnicodeCtrlStrings, wxCB_READONLY ); m_fromUnicodeCtrl->SetStringSelection(_("ASCII")); m_fromUnicodeCtrl->SetHelpText(_("The range to show.")); - if (ShowToolTips()) + if (wxSymbolPickerDialog::ShowToolTips()) m_fromUnicodeCtrl->SetToolTip(_("The range to show.")); itemBoxSizer12->Add(m_fromUnicodeCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); #endif -#if defined(__WXMSW__) || defined(__WXGTK__) || defined(__WXPM__) || defined(__WXMGL__) || defined(__WXMOTIF__) || defined(__WXCOCOA__) || defined(__WXX11__) || defined(__WXPALMOS__) +#if defined(__WXMSW__) || defined(__WXGTK__) || defined(__WXOS2__) || defined(__WXMGL__) || defined(__WXMOTIF__) || defined(__WXCOCOA__) || defined(__WXX11__) || defined(__WXPALMOS__) wxBoxSizer* itemBoxSizer20 = new wxBoxSizer(wxHORIZONTAL); itemBoxSizer3->Add(itemBoxSizer20, 0, wxGROW, 5); @@ -469,13 +474,13 @@ void wxSymbolPickerDialog::CreateControls() wxButton* itemButton22 = new wxButton( itemDialog1, wxID_OK, _("Insert"), wxDefaultPosition, wxDefaultSize, 0 ); itemButton22->SetDefault(); itemButton22->SetHelpText(_("Inserts the chosen symbol.")); - if (ShowToolTips()) + if (wxSymbolPickerDialog::ShowToolTips()) itemButton22->SetToolTip(_("Inserts the chosen symbol.")); itemBoxSizer20->Add(itemButton22, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); wxButton* itemButton23 = new wxButton( itemDialog1, wxID_CANCEL, _("Close"), wxDefaultPosition, wxDefaultSize, 0 ); itemButton23->SetHelpText(_("Closes the dialog without inserting a symbol.")); - if (ShowToolTips()) + if (wxSymbolPickerDialog::ShowToolTips()) itemButton23->SetToolTip(_("Closes the dialog without inserting a symbol.")); itemBoxSizer20->Add(itemButton23, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); @@ -489,14 +494,14 @@ void wxSymbolPickerDialog::CreateControls() wxButton* itemButton26 = new wxButton( itemDialog1, wxID_CANCEL, _("Close"), wxDefaultPosition, wxDefaultSize, 0 ); itemButton26->SetHelpText(_("Closes the dialog without inserting a symbol.")); - if (ShowToolTips()) + if (wxSymbolPickerDialog::ShowToolTips()) itemButton26->SetToolTip(_("Closes the dialog without inserting a symbol.")); itemBoxSizer24->Add(itemButton26, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); wxButton* itemButton27 = new wxButton( itemDialog1, wxID_OK, _("Insert"), wxDefaultPosition, wxDefaultSize, 0 ); itemButton27->SetDefault(); itemButton27->SetHelpText(_("Inserts the chosen symbol.")); - if (ShowToolTips()) + if (wxSymbolPickerDialog::ShowToolTips()) itemButton27->SetToolTip(_("Inserts the chosen symbol.")); itemBoxSizer24->Add(itemButton27, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); @@ -787,6 +792,10 @@ bool wxSymbolListCtrl::Create(wxWindow *parent, const wxString& name) { style |= wxWANTS_CHARS | wxFULL_REPAINT_ON_RESIZE; + + if ((style & wxBORDER_MASK) == wxBORDER_DEFAULT) + style |= wxBORDER_THEME; + if ( !wxVScrolledWindow::Create(parent, id, pos, size, style, name) ) return false; -- 2.45.2