From 09dc1241b72e4c03d2ebd757bb063296aef7a18e Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Sun, 27 Aug 2000 20:52:36 +0000 Subject: [PATCH] added AddWindowStyles git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8200 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- contrib/include/wx/xml/xh_bttn.h | 2 +- contrib/include/wx/xml/xmlres.h | 3 +++ contrib/src/xml/xh_bttn.cpp | 7 +++++++ contrib/src/xml/xh_chckb.cpp | 1 + contrib/src/xml/xh_chckl.cpp | 1 + contrib/src/xml/xh_choic.cpp | 1 + contrib/src/xml/xh_combo.cpp | 1 + contrib/src/xml/xh_dlg.cpp | 2 ++ contrib/src/xml/xh_gauge.cpp | 1 + contrib/src/xml/xh_html.cpp | 1 + contrib/src/xml/xh_listb.cpp | 1 + contrib/src/xml/xh_notbk.cpp | 1 + contrib/src/xml/xh_panel.cpp | 2 ++ contrib/src/xml/xh_radbt.cpp | 1 + contrib/src/xml/xh_radbx.cpp | 1 + contrib/src/xml/xh_slidr.cpp | 1 + contrib/src/xml/xh_spin.cpp | 1 + contrib/src/xml/xh_stbmp.cpp | 1 + contrib/src/xml/xh_sttxt.cpp | 1 + contrib/src/xml/xh_text.cpp | 1 + contrib/src/xml/xmlres.cpp | 15 +++++++++++++++ contrib/utils/wxrcedit/df/panelbase.df | 2 +- contrib/utils/wxrcedit/df/window.df | 1 + 23 files changed, 47 insertions(+), 2 deletions(-) diff --git a/contrib/include/wx/xml/xh_bttn.h b/contrib/include/wx/xml/xh_bttn.h index c3853b8bc6..9a20c277ef 100644 --- a/contrib/include/wx/xml/xh_bttn.h +++ b/contrib/include/wx/xml/xh_bttn.h @@ -20,7 +20,7 @@ class WXDLLEXPORT wxButtonXmlHandler : public wxXmlResourceHandler { public: - wxButtonXmlHandler() : wxXmlResourceHandler() {} + wxButtonXmlHandler(); virtual wxObject *DoCreateResource(); virtual bool CanHandle(wxXmlNode *node); }; diff --git a/contrib/include/wx/xml/xmlres.h b/contrib/include/wx/xml/xmlres.h index 7a62012ccc..e3338a605b 100644 --- a/contrib/include/wx/xml/xmlres.h +++ b/contrib/include/wx/xml/xmlres.h @@ -225,6 +225,9 @@ class WXDLLEXPORT wxXmlResourceHandler : public wxObject // Add style flag (e.g. wxMB_DOCKABLE) to list of flags // understood by this handler void AddStyle(const wxString& name, int value); + + // Add styles common to all wxWindow-derived classes + void AddWindowStyles(); // Gets style flags from text in form "flag | flag2| flag3 |..." // Only understads flags added with AddStyle diff --git a/contrib/src/xml/xh_bttn.cpp b/contrib/src/xml/xh_bttn.cpp index a689d49ed3..4fc936f4ab 100644 --- a/contrib/src/xml/xh_bttn.cpp +++ b/contrib/src/xml/xh_bttn.cpp @@ -23,6 +23,13 @@ #include "wx/button.h" +wxButtonXmlHandler::wxButtonXmlHandler() +: wxXmlResourceHandler() +{ + AddWindowStyles(); +} + + wxObject *wxButtonXmlHandler::DoCreateResource() { wxButton *button = new wxButton(m_ParentAsWindow, diff --git a/contrib/src/xml/xh_chckb.cpp b/contrib/src/xml/xh_chckb.cpp index d2d3c15f1a..9cfddeb63e 100644 --- a/contrib/src/xml/xh_chckb.cpp +++ b/contrib/src/xml/xh_chckb.cpp @@ -27,6 +27,7 @@ wxCheckBoxXmlHandler::wxCheckBoxXmlHandler() : wxXmlResourceHandler() { + AddWindowStyles(); } wxObject *wxCheckBoxXmlHandler::DoCreateResource() diff --git a/contrib/src/xml/xh_chckl.cpp b/contrib/src/xml/xh_chckl.cpp index 492054006a..5e22232d4b 100644 --- a/contrib/src/xml/xh_chckl.cpp +++ b/contrib/src/xml/xh_chckl.cpp @@ -26,6 +26,7 @@ wxCheckListXmlHandler::wxCheckListXmlHandler() : wxXmlResourceHandler(), m_InsideBox(FALSE) { // no styles + AddWindowStyles(); } wxObject *wxCheckListXmlHandler::DoCreateResource() diff --git a/contrib/src/xml/xh_choic.cpp b/contrib/src/xml/xh_choic.cpp index 4ee1a0fe7b..6ffec1f04d 100644 --- a/contrib/src/xml/xh_choic.cpp +++ b/contrib/src/xml/xh_choic.cpp @@ -26,6 +26,7 @@ wxChoiceXmlHandler::wxChoiceXmlHandler() : wxXmlResourceHandler() , m_InsideBox(FALSE) { ADD_STYLE(wxCB_SORT); + AddWindowStyles(); } wxObject *wxChoiceXmlHandler::DoCreateResource() diff --git a/contrib/src/xml/xh_combo.cpp b/contrib/src/xml/xh_combo.cpp index acf344e28c..54c029431b 100644 --- a/contrib/src/xml/xh_combo.cpp +++ b/contrib/src/xml/xh_combo.cpp @@ -31,6 +31,7 @@ wxComboBoxXmlHandler::wxComboBoxXmlHandler() ADD_STYLE(wxCB_SORT); ADD_STYLE(wxCB_READONLY); ADD_STYLE(wxCB_DROPDOWN); + AddWindowStyles(); } wxObject *wxComboBoxXmlHandler::DoCreateResource() diff --git a/contrib/src/xml/xh_dlg.cpp b/contrib/src/xml/xh_dlg.cpp index 0347787f08..f95d9f41f8 100644 --- a/contrib/src/xml/xh_dlg.cpp +++ b/contrib/src/xml/xh_dlg.cpp @@ -40,6 +40,8 @@ wxDialogXmlHandler::wxDialogXmlHandler() : wxXmlResourceHandler() ADD_STYLE(wxNO_3D); ADD_STYLE(wxTAB_TRAVERSAL); ADD_STYLE(wxWS_EX_VALIDATE_RECURSIVELY); + ADD_STYLE(wxCLIP_CHILDREN); + AddWindowStyles(); } diff --git a/contrib/src/xml/xh_gauge.cpp b/contrib/src/xml/xh_gauge.cpp index 14394613ad..cefe815ac6 100644 --- a/contrib/src/xml/xh_gauge.cpp +++ b/contrib/src/xml/xh_gauge.cpp @@ -31,6 +31,7 @@ wxGaugeXmlHandler::wxGaugeXmlHandler() ADD_STYLE( wxGA_VERTICAL ); ADD_STYLE( wxGA_PROGRESSBAR ); ADD_STYLE( wxGA_SMOOTH ); // windows only + AddWindowStyles(); } wxObject *wxGaugeXmlHandler::DoCreateResource() diff --git a/contrib/src/xml/xh_html.cpp b/contrib/src/xml/xh_html.cpp index ca1b9bac2f..e94e0c8f96 100644 --- a/contrib/src/xml/xh_html.cpp +++ b/contrib/src/xml/xh_html.cpp @@ -31,6 +31,7 @@ wxHtmlWindowXmlHandler::wxHtmlWindowXmlHandler() { ADD_STYLE( wxHW_SCROLLBAR_NEVER ); ADD_STYLE( wxHW_SCROLLBAR_AUTO ); + AddWindowStyles(); } wxObject *wxHtmlWindowXmlHandler::DoCreateResource() diff --git a/contrib/src/xml/xh_listb.cpp b/contrib/src/xml/xh_listb.cpp index d9d2a54089..9d4bae282d 100644 --- a/contrib/src/xml/xh_listb.cpp +++ b/contrib/src/xml/xh_listb.cpp @@ -32,6 +32,7 @@ wxListBoxXmlHandler::wxListBoxXmlHandler() ADD_STYLE(wxLB_ALWAYS_SB); ADD_STYLE(wxLB_NEEDED_SB); ADD_STYLE(wxLB_SORT); + AddWindowStyles(); } wxObject *wxListBoxXmlHandler::DoCreateResource() diff --git a/contrib/src/xml/xh_notbk.cpp b/contrib/src/xml/xh_notbk.cpp index deaf745f1a..3c7bed28f8 100644 --- a/contrib/src/xml/xh_notbk.cpp +++ b/contrib/src/xml/xh_notbk.cpp @@ -34,6 +34,7 @@ wxNotebookXmlHandler::wxNotebookXmlHandler() ADD_STYLE(wxNB_LEFT); ADD_STYLE(wxNB_RIGHT); ADD_STYLE(wxNB_BOTTOM); + AddWindowStyles(); } diff --git a/contrib/src/xml/xh_panel.cpp b/contrib/src/xml/xh_panel.cpp index 5ed9c2a9f4..4e327e7b34 100644 --- a/contrib/src/xml/xh_panel.cpp +++ b/contrib/src/xml/xh_panel.cpp @@ -28,6 +28,8 @@ wxPanelXmlHandler::wxPanelXmlHandler() : wxXmlResourceHandler() ADD_STYLE(wxNO_3D); ADD_STYLE(wxTAB_TRAVERSAL); ADD_STYLE(wxWS_EX_VALIDATE_RECURSIVELY); + ADD_STYLE(wxCLIP_CHILDREN); + AddWindowStyles(); } diff --git a/contrib/src/xml/xh_radbt.cpp b/contrib/src/xml/xh_radbt.cpp index bdcbfe5925..f68de95518 100644 --- a/contrib/src/xml/xh_radbt.cpp +++ b/contrib/src/xml/xh_radbt.cpp @@ -28,6 +28,7 @@ wxRadioButtonXmlHandler::wxRadioButtonXmlHandler() : wxXmlResourceHandler() { ADD_STYLE( wxRB_GROUP ); + AddWindowStyles(); } wxObject *wxRadioButtonXmlHandler::DoCreateResource() diff --git a/contrib/src/xml/xh_radbx.cpp b/contrib/src/xml/xh_radbx.cpp index 82f2f325ba..17679b952f 100644 --- a/contrib/src/xml/xh_radbx.cpp +++ b/contrib/src/xml/xh_radbx.cpp @@ -31,6 +31,7 @@ wxRadioBoxXmlHandler::wxRadioBoxXmlHandler() ADD_STYLE(wxRA_HORIZONTAL); ADD_STYLE(wxRA_SPECIFY_ROWS); ADD_STYLE(wxRA_VERTICAL); + AddWindowStyles(); } wxObject *wxRadioBoxXmlHandler::DoCreateResource() diff --git a/contrib/src/xml/xh_slidr.cpp b/contrib/src/xml/xh_slidr.cpp index 38847f7d21..12afa0aabb 100644 --- a/contrib/src/xml/xh_slidr.cpp +++ b/contrib/src/xml/xh_slidr.cpp @@ -37,6 +37,7 @@ wxSliderXmlHandler::wxSliderXmlHandler() ADD_STYLE( wxSL_BOTTOM ); ADD_STYLE( wxSL_BOTH ); ADD_STYLE( wxSL_SELRANGE ); + AddWindowStyles(); } wxObject *wxSliderXmlHandler::DoCreateResource() diff --git a/contrib/src/xml/xh_spin.cpp b/contrib/src/xml/xh_spin.cpp index 9ebd9471ee..0a557f2eeb 100644 --- a/contrib/src/xml/xh_spin.cpp +++ b/contrib/src/xml/xh_spin.cpp @@ -31,6 +31,7 @@ wxSpinButtonXmlHandler::wxSpinButtonXmlHandler() ADD_STYLE( wxSP_VERTICAL ); ADD_STYLE( wxSP_ARROW_KEYS ); ADD_STYLE( wxSP_WRAP ); + AddWindowStyles(); } wxObject *wxSpinButtonXmlHandler::DoCreateResource() diff --git a/contrib/src/xml/xh_stbmp.cpp b/contrib/src/xml/xh_stbmp.cpp index 8ec8d5553c..c3620d06c5 100644 --- a/contrib/src/xml/xh_stbmp.cpp +++ b/contrib/src/xml/xh_stbmp.cpp @@ -25,6 +25,7 @@ wxStaticBitmapXmlHandler::wxStaticBitmapXmlHandler() : wxXmlResourceHandler() { + AddWindowStyles(); } wxObject *wxStaticBitmapXmlHandler::DoCreateResource() diff --git a/contrib/src/xml/xh_sttxt.cpp b/contrib/src/xml/xh_sttxt.cpp index f0e59c094f..d4e4ff24f6 100644 --- a/contrib/src/xml/xh_sttxt.cpp +++ b/contrib/src/xml/xh_sttxt.cpp @@ -26,6 +26,7 @@ wxStaticTextXmlHandler::wxStaticTextXmlHandler() : wxXmlResourceHandler() { ADD_STYLE( wxST_NO_AUTORESIZE ); + AddWindowStyles(); } wxObject *wxStaticTextXmlHandler::DoCreateResource() diff --git a/contrib/src/xml/xh_text.cpp b/contrib/src/xml/xh_text.cpp index 8775d86cdf..a1203536b3 100644 --- a/contrib/src/xml/xh_text.cpp +++ b/contrib/src/xml/xh_text.cpp @@ -30,6 +30,7 @@ wxTextCtrlXmlHandler::wxTextCtrlXmlHandler() : wxXmlResourceHandler() ADD_STYLE(wxTE_PASSWORD); ADD_STYLE(wxTE_READONLY); ADD_STYLE(wxHSCROLL); + AddWindowStyles(); } wxObject *wxTextCtrlXmlHandler::DoCreateResource() diff --git a/contrib/src/xml/xmlres.cpp b/contrib/src/xml/xmlres.cpp index b8b80c6978..3245347129 100644 --- a/contrib/src/xml/xmlres.cpp +++ b/contrib/src/xml/xmlres.cpp @@ -386,6 +386,21 @@ void wxXmlResourceHandler::AddStyle(const wxString& name, int value) } + +void wxXmlResourceHandler::AddWindowStyles() +{ + ADD_STYLE(wxSIMPLE_BORDER); + ADD_STYLE(wxSUNKEN_BORDER); + ADD_STYLE(wxDOUBLE_BORDER); + ADD_STYLE(wxRAISED_BORDER); + ADD_STYLE(wxSTATIC_BORDER); + ADD_STYLE(wxTRANSPARENT_WINDOW); + ADD_STYLE(wxWANTS_CHARS); + ADD_STYLE(wxNO_FULL_REPAINT_ON_RESIZE); +} + + + bool wxXmlResourceHandler::HasParam(const wxString& param) { return (GetParamNode(param) != NULL); diff --git a/contrib/utils/wxrcedit/df/panelbase.df b/contrib/utils/wxrcedit/df/panelbase.df index 6136b048df..9eb8e1caf3 100644 --- a/contrib/utils/wxrcedit/df/panelbase.df +++ b/contrib/utils/wxrcedit/df/panelbase.df @@ -4,6 +4,6 @@ type panel icon 1 childtype panel_item abstract -var style of flags wxNO_3D,wxTAB_TRAVERSAL +var style of flags wxNO_3D,wxTAB_TRAVERSAL,wxCLIP_CHILDREN var exstyle of flags wxWS_EX_VALIDATE_RECURSIVELY derived from window diff --git a/contrib/utils/wxrcedit/df/window.df b/contrib/utils/wxrcedit/df/window.df index ec0530220f..1f045ef772 100644 --- a/contrib/utils/wxrcedit/df/window.df +++ b/contrib/utils/wxrcedit/df/window.df @@ -3,6 +3,7 @@ type normal abstract var pos of coord var size of coord +var style of flags wxSIMPLE_BORDER,wxSUNKEN_BORDER,wxDOUBLE_BORDER,wxRAISED_BORDER,wxSTATIC_BORDER,wxTRANSPARENT_WINDOW,wxWANTS_CHARS,wxNO_FULL_REPAINT_ON_RESIZE var tooltip of text var fg of color var bg of color -- 2.45.2