more cosmetic changes: type-safe Connect()s, removed unnecessary ifdefs

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33041 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2005-03-25 11:04:54 +00:00
parent 8019e60483
commit a7daa76eed

View File

@@ -207,13 +207,15 @@ public:
wxDynamicSashWindowImpl *m_impl; wxDynamicSashWindowImpl *m_impl;
wxScrollBar *m_vscroll, *m_hscroll; wxScrollBar *m_vscroll,
*m_hscroll;
/* m_child is the window provided to us by the application developer. /* m_child is the window provided to us by the application developer.
m_viewport is a window we've created, and it is the immediately m_viewport is a window we've created, and it is the immediately
parent of m_child. We scroll m_child by moving it around within parent of m_child. We scroll m_child by moving it around within
m_viewport. */ m_viewport. */
wxWindow *m_viewport, *m_child; wxWindow *m_viewport,
*m_child;
}; };
@@ -1042,49 +1044,39 @@ bool wxDynamicSashWindowLeaf::Create()
m_viewport->SetCursor(cursor); m_viewport->SetCursor(cursor);
m_viewport->SetEventHandler(this); m_viewport->SetEventHandler(this);
Connect(wxID_ANY, wxEVT_DYNAMIC_SASH_REPARENT, (wxObjectEventFunction)&wxDynamicSashWindowLeaf::OnReparent); Connect(wxEVT_DYNAMIC_SASH_REPARENT,
wxEventHandler(wxDynamicSashWindowLeaf::OnReparent));
if (m_impl->m_window->GetWindowStyle() & wxDS_MANAGE_SCROLLBARS) if (m_impl->m_window->GetWindowStyle() & wxDS_MANAGE_SCROLLBARS)
{ {
m_hscroll->SetEventHandler(this); m_hscroll->SetEventHandler(this);
m_vscroll->SetEventHandler(this); m_vscroll->SetEventHandler(this);
Connect(wxID_ANY, wxEVT_SET_FOCUS, (wxObjectEventFunction) Connect(wxEVT_SET_FOCUS,
(wxEventFunction) wxFocusEventHandler(wxDynamicSashWindowLeaf::OnFocus));
(wxFocusEventFunction)&wxDynamicSashWindowLeaf::OnFocus); Connect(wxEVT_SCROLL_TOP,
Connect(wxID_ANY, wxEVT_SCROLL_TOP, (wxObjectEventFunction) wxScrollEventHandler(wxDynamicSashWindowLeaf::OnScroll));
(wxEventFunction) Connect(wxEVT_SCROLL_BOTTOM,
(wxScrollEventFunction)&wxDynamicSashWindowLeaf::OnScroll); wxScrollEventHandler(wxDynamicSashWindowLeaf::OnScroll));
Connect(wxID_ANY, wxEVT_SCROLL_BOTTOM, (wxObjectEventFunction) Connect(wxEVT_SCROLL_LINEUP,
(wxEventFunction) wxScrollEventHandler(wxDynamicSashWindowLeaf::OnScroll));
(wxScrollEventFunction)&wxDynamicSashWindowLeaf::OnScroll); Connect(wxEVT_SCROLL_LINEDOWN,
Connect(wxID_ANY, wxEVT_SCROLL_LINEUP, (wxObjectEventFunction) wxScrollEventHandler(wxDynamicSashWindowLeaf::OnScroll));
(wxEventFunction) Connect(wxEVT_SCROLL_PAGEUP,
(wxScrollEventFunction)&wxDynamicSashWindowLeaf::OnScroll); wxScrollEventHandler(wxDynamicSashWindowLeaf::OnScroll));
Connect(wxID_ANY, wxEVT_SCROLL_LINEDOWN, (wxObjectEventFunction) Connect(wxEVT_SCROLL_PAGEDOWN,
(wxEventFunction) wxScrollEventHandler(wxDynamicSashWindowLeaf::OnScroll));
(wxScrollEventFunction)&wxDynamicSashWindowLeaf::OnScroll); Connect(wxEVT_SCROLL_THUMBTRACK,
Connect(wxID_ANY, wxEVT_SCROLL_PAGEUP, (wxObjectEventFunction) wxScrollEventHandler(wxDynamicSashWindowLeaf::OnScroll));
(wxEventFunction) Connect(wxEVT_SCROLL_THUMBRELEASE,
(wxScrollEventFunction)&wxDynamicSashWindowLeaf::OnScroll); wxScrollEventHandler(wxDynamicSashWindowLeaf::OnScroll));
Connect(wxID_ANY, wxEVT_SCROLL_PAGEDOWN, (wxObjectEventFunction)
(wxEventFunction)
(wxScrollEventFunction)&wxDynamicSashWindowLeaf::OnScroll);
Connect(wxID_ANY, wxEVT_SCROLL_THUMBTRACK, (wxObjectEventFunction)
(wxEventFunction)
(wxScrollEventFunction)&wxDynamicSashWindowLeaf::OnScroll);
Connect(wxID_ANY, wxEVT_SCROLL_THUMBRELEASE, (wxObjectEventFunction)
(wxEventFunction)
(wxScrollEventFunction)&wxDynamicSashWindowLeaf::OnScroll);
} }
wxLayoutConstraints *layout = new wxLayoutConstraints(); wxLayoutConstraints *layout = new wxLayoutConstraints();
if (!layout) if (!layout)
return false; return false;
wxSize size = m_hscroll->GetBestSize(); wxSize size = m_hscroll->GetBestSize();
#ifdef __WXMSW__
size = m_hscroll->GetSize();
#endif
layout->left.SameAs(m_impl->m_container, wxLeft, 10); layout->left.SameAs(m_impl->m_container, wxLeft, 10);
layout->right.LeftOf(m_vscroll); layout->right.LeftOf(m_vscroll);
@@ -1095,10 +1087,8 @@ bool wxDynamicSashWindowLeaf::Create()
layout = new wxLayoutConstraints(); layout = new wxLayoutConstraints();
if (!layout) if (!layout)
return false; return false;
size = size = m_vscroll->GetBestSize();
#ifdef __WXMSW__ size = m_vscroll->GetBestSize();
size = m_vscroll->GetSize();
#endif
layout->top.SameAs(m_impl->m_container, wxTop, 10); layout->top.SameAs(m_impl->m_container, wxTop, 10);
layout->bottom.Above(m_hscroll); layout->bottom.Above(m_hscroll);