From 037c7b4c7b6c87c40f3ba966a0c3e91a402b4dfa Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Sat, 11 Nov 2006 07:32:08 +0000 Subject: [PATCH] Some wxCollapsiblePane tweaks: - Use wxCP_DEFAULT_STYLE - Share a single wxCollapsiblePaneNameStr for the native and generic versions - Use a wxPanel for the pane so tab traversal works in the pane git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43300 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/collpane.h | 2 +- include/wx/generic/collpaneg.h | 10 +++++----- include/wx/gtk/collpane.h | 6 ++---- src/generic/collpaneg.cpp | 6 +++--- src/gtk/collpane.cpp | 6 ++---- 5 files changed, 13 insertions(+), 17 deletions(-) diff --git a/include/wx/collpane.h b/include/wx/collpane.h index ba26a422bb..8ff545d3bc 100644 --- a/include/wx/collpane.h +++ b/include/wx/collpane.h @@ -24,7 +24,7 @@ // wxCollapsiblePaneBase: interface for wxCollapsiblePane // ---------------------------------------------------------------------------- -#define wxCP_DEFAULT_STYLE (wxNO_BORDER) +#define wxCP_DEFAULT_STYLE (wxTAB_TRAVERSAL | wxNO_BORDER) #define wxCP_NO_TLW_RESIZE (0x0002) class WXDLLIMPEXP_CORE wxCollapsiblePaneBase : public wxControl diff --git a/include/wx/generic/collpaneg.h b/include/wx/generic/collpaneg.h index daaea636fe..e8fd85a06e 100644 --- a/include/wx/generic/collpaneg.h +++ b/include/wx/generic/collpaneg.h @@ -19,7 +19,7 @@ class WXDLLEXPORT wxButton; class WXDLLEXPORT wxStaticLine; // class name -extern WXDLLIMPEXP_DATA_CORE(const wxChar) wxGenericCollapsiblePaneNameStr[]; +extern WXDLLIMPEXP_DATA_CORE(const wxChar) wxCollapsiblePaneNameStr[]; // ---------------------------------------------------------------------------- @@ -36,9 +36,9 @@ public: const wxString& label, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = wxTAB_TRAVERSAL | wxNO_BORDER, + long style = wxCP_DEFAULT_STYLE, const wxValidator& val = wxDefaultValidator, - const wxString& name = wxGenericCollapsiblePaneNameStr) + const wxString& name = wxCollapsiblePaneNameStr) { Init(); @@ -60,9 +60,9 @@ public: const wxString& label, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = wxTAB_TRAVERSAL | wxNO_BORDER, + long style = wxCP_DEFAULT_STYLE, const wxValidator& val = wxDefaultValidator, - const wxString& name = wxGenericCollapsiblePaneNameStr); + const wxString& name = wxCollapsiblePaneNameStr); // public wxCollapsiblePane API diff --git a/include/wx/gtk/collpane.h b/include/wx/gtk/collpane.h index 72ece131ed..76dc4bd2f4 100644 --- a/include/wx/gtk/collpane.h +++ b/include/wx/gtk/collpane.h @@ -14,8 +14,6 @@ #include "wx/generic/collpaneg.h" -extern WXDLLIMPEXP_DATA_CORE(const wxChar) wxCollapsiblePaneNameStr[]; - // ---------------------------------------------------------------------------- // wxCollapsiblePane // ---------------------------------------------------------------------------- @@ -30,7 +28,7 @@ public: const wxString& label, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = wxTAB_TRAVERSAL | wxNO_BORDER, + long style = wxCP_DEFAULT_STYLE, const wxValidator& val = wxDefaultValidator, const wxString& name = wxCollapsiblePaneNameStr) { @@ -49,7 +47,7 @@ public: const wxString& label, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = wxTAB_TRAVERSAL | wxNO_BORDER, + long style = wxCP_DEFAULT_STYLE, const wxValidator& val = wxDefaultValidator, const wxString& name = wxCollapsiblePaneNameStr); diff --git a/src/generic/collpaneg.cpp b/src/generic/collpaneg.cpp index 1e2a14880f..27f0cad8ba 100644 --- a/src/generic/collpaneg.cpp +++ b/src/generic/collpaneg.cpp @@ -38,7 +38,7 @@ // implementation // ============================================================================ -const wxChar wxGenericCollapsiblePaneNameStr[] = wxT("genericCollapsiblePane"); +const wxChar wxCollapsiblePaneNameStr[] = wxT("collapsiblePane"); //----------------------------------------------------------------------------- // wxGenericCollapsiblePane @@ -90,8 +90,8 @@ bool wxGenericCollapsiblePane::Create(wxWindow *parent, #endif // do not set sz as our sizers since we handle the pane window without using sizers - m_pPane = new wxWindow(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, - wxNO_BORDER); + m_pPane = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, + wxTAB_TRAVERSAL|wxNO_BORDER); // start as collapsed: m_pPane->Hide(); diff --git a/src/gtk/collpane.cpp b/src/gtk/collpane.cpp index 229a4759b1..bf6962fe7a 100644 --- a/src/gtk/collpane.cpp +++ b/src/gtk/collpane.cpp @@ -28,8 +28,6 @@ #include -const wxChar wxCollapsiblePaneNameStr[] = wxT("CollapsiblePane"); - // ============================================================================ // implementation // ============================================================================ @@ -224,8 +222,8 @@ bool wxCollapsiblePane::Create(wxWindow *parent, m_insertCallback = gtk_collapsiblepane_insert_callback; // this the real "pane" - m_pPane = new wxWindow(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, - wxNO_BORDER); + m_pPane = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, + wxTAB_TRAVERSAL|wxNO_BORDER); gtk_widget_show( GTK_WIDGET(m_widget) ); m_parent->DoAddChild( this ); -- 2.45.2