From 9948d31f4e327d555cc92a6570047b8ca4db467d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 6 Aug 2001 22:50:28 +0000 Subject: [PATCH] changed wxControlContainer to avoid triggering tons of warnings from VC++ at warning level 4 ("'this' : used in base member initializer list" is really the stupidiest warning I've ever seen) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11315 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/containr.h | 10 +++++++--- include/wx/generic/panelg.h | 4 +--- include/wx/generic/splitter.h | 3 +-- src/generic/panelg.cpp | 1 + src/generic/splitter.cpp | 2 ++ 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/include/wx/containr.h b/include/wx/containr.h index 3e84da9384..7139ef4242 100644 --- a/include/wx/containr.h +++ b/include/wx/containr.h @@ -39,14 +39,14 @@ class WXDLLEXPORT wxControlContainer { public: // ctors and such - wxControlContainer(wxWindow *winParent); + wxControlContainer(wxWindow *winParent = NULL); + void SetContainerWindow(wxWindow *winParent) { m_winParent = winParent; } + // default item access wxWindow *GetDefaultItem() const { return m_winDefault; } wxWindow *SetDefaultItem(wxWindow *win) { wxWindow *winOld = m_winDefault; m_winDefault = win; return winOld; } - void SetLastFocus(wxWindow *win); - // the methods to be called from the window event handlers void HandleOnNavigationKey(wxNavigationKeyEvent& event); void HandleOnFocus(wxFocusEvent& event); @@ -56,6 +56,10 @@ public: // the focus and the default processing should take place bool DoSetFocus(); + // called from OnChildFocus() handler, i.e. when one of our (grand) + // children gets the focus + void SetLastFocus(wxWindow *win); + protected: // set the focus to the child which had it the last time bool SetFocusToChild(); diff --git a/include/wx/generic/panelg.h b/include/wx/generic/panelg.h index 85f91ee81a..cf5685d948 100644 --- a/include/wx/generic/panelg.h +++ b/include/wx/generic/panelg.h @@ -34,7 +34,7 @@ WXDLLEXPORT_DATA(extern const wxChar*) wxPanelNameStr; class WXDLLEXPORT wxPanel : public wxWindow { public: - wxPanel() : m_container(this) { Init(); } + wxPanel() { Init(); } // Old-style constructor (no default values for coordinates to avoid // ambiguity with the new one) @@ -42,7 +42,6 @@ public: int x, int y, int width, int height, long style = wxTAB_TRAVERSAL | wxNO_BORDER, const wxString& name = wxPanelNameStr) - : m_container(this) { Init(); @@ -56,7 +55,6 @@ public: const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL | wxNO_BORDER, const wxString& name = wxPanelNameStr) - : m_container(this) { Init(); diff --git a/include/wx/generic/splitter.h b/include/wx/generic/splitter.h index 640d2bea57..8528e2265b 100644 --- a/include/wx/generic/splitter.h +++ b/include/wx/generic/splitter.h @@ -61,7 +61,7 @@ public: // Public API // Default constructor - wxSplitterWindow() : m_container(this) + wxSplitterWindow() { Init(); } @@ -72,7 +72,6 @@ public: const wxSize& size = wxDefaultSize, long style = wxSP_3D, const wxString& name = "splitter") - : m_container(this) { Init(); Create(parent, id, pos, size, style, name); diff --git a/src/generic/panelg.cpp b/src/generic/panelg.cpp index c36c49c46d..aa5e3ec426 100644 --- a/src/generic/panelg.cpp +++ b/src/generic/panelg.cpp @@ -65,6 +65,7 @@ WX_DELEGATE_TO_CONTROL_CONTAINER(wxPanel) void wxPanel::Init() { + m_container.SetContainerWindow(this); } bool wxPanel::Create(wxWindow *parent, wxWindowID id, diff --git a/src/generic/splitter.cpp b/src/generic/splitter.cpp index 7b0a84b401..dc50eb3590 100644 --- a/src/generic/splitter.cpp +++ b/src/generic/splitter.cpp @@ -93,6 +93,8 @@ bool wxSplitterWindow::Create(wxWindow *parent, wxWindowID id, void wxSplitterWindow::Init() { + m_container.SetContainerWindow(this); + m_splitMode = wxSPLIT_VERTICAL; m_permitUnsplitAlways = TRUE; m_windowOne = (wxWindow *) NULL; -- 2.45.2