X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/019abbf2098280bdb466d5d207498c8f3cc976dc..90c108964caba82a62602c7eef1268d4bb6e4841:/contrib/samples/gizmos/dynsash_switch/dynsash_switch.cpp diff --git a/contrib/samples/gizmos/dynsash_switch/dynsash_switch.cpp b/contrib/samples/gizmos/dynsash_switch/dynsash_switch.cpp index 1ac49a9eda..50db96f4ac 100644 --- a/contrib/samples/gizmos/dynsash_switch/dynsash_switch.cpp +++ b/contrib/samples/gizmos/dynsash_switch/dynsash_switch.cpp @@ -109,30 +109,60 @@ SwitchView::SwitchView(wxDynamicSashWindow *win) { hscroll->SetEventHandler(this); vscroll->SetEventHandler(this); - Connect(GetId(), wxEVT_SIZE, (wxObjectEventFunction)&SwitchView::OnSize); - Connect(m_choice->GetId(), wxEVT_COMMAND_CHOICE_SELECTED, (wxObjectEventFunction)&SwitchView::OnChoice); - Connect(m_view->GetId(), wxEVT_PAINT, (wxObjectEventFunction)&SwitchView::OnPaint); - - Connect(-1, wxEVT_SET_FOCUS, (wxObjectEventFunction)&SwitchView::OnFocus); - Connect(-1, wxEVT_SCROLL_TOP, (wxObjectEventFunction)&SwitchView::OnScroll); - Connect(-1, wxEVT_SCROLL_BOTTOM, (wxObjectEventFunction)&SwitchView::OnScroll); - Connect(-1, wxEVT_SCROLL_LINEUP, (wxObjectEventFunction)&SwitchView::OnScroll); - Connect(-1, wxEVT_SCROLL_LINEDOWN, (wxObjectEventFunction)&SwitchView::OnScroll); - Connect(-1, wxEVT_SCROLL_PAGEUP, (wxObjectEventFunction)&SwitchView::OnScroll); - Connect(-1, wxEVT_SCROLL_PAGEDOWN, (wxObjectEventFunction)&SwitchView::OnScroll); - Connect(-1, wxEVT_SCROLL_THUMBTRACK, (wxObjectEventFunction)&SwitchView::OnScroll); - Connect(-1, wxEVT_SCROLL_THUMBRELEASE, (wxObjectEventFunction)&SwitchView::OnScroll); - Connect(-1, wxEVT_ERASE_BACKGROUND, (wxObjectEventFunction)&SwitchView::OnErase); - - Connect(-1, wxEVT_DYNAMIC_SASH_SPLIT, (wxObjectEventFunction)&SwitchView::OnSplit); - Connect(-1, wxEVT_DYNAMIC_SASH_UNIFY, (wxObjectEventFunction)&SwitchView::OnUnify); + Connect(GetId(), wxEVT_SIZE, (wxObjectEventFunction) + (wxEventFunction) + (wxSizeEventFunction)&SwitchView::OnSize); + Connect(m_choice->GetId(), wxEVT_COMMAND_CHOICE_SELECTED, (wxObjectEventFunction) + (wxEventFunction) + (wxCommandEventFunction)&SwitchView::OnChoice); + Connect(m_view->GetId(), wxEVT_PAINT, (wxObjectEventFunction) + (wxEventFunction) + (wxPaintEventFunction)&SwitchView::OnPaint); + + Connect(-1, wxEVT_SET_FOCUS, (wxObjectEventFunction) + (wxEventFunction) + (wxFocusEventFunction)&SwitchView::OnFocus); + Connect(-1, wxEVT_SCROLL_TOP, (wxObjectEventFunction) + (wxEventFunction) + (wxScrollEventFunction)&SwitchView::OnScroll); + Connect(-1, wxEVT_SCROLL_BOTTOM, (wxObjectEventFunction) + (wxEventFunction) + (wxScrollEventFunction)&SwitchView::OnScroll); + Connect(-1, wxEVT_SCROLL_LINEUP, (wxObjectEventFunction) + (wxEventFunction) + (wxScrollEventFunction)&SwitchView::OnScroll); + Connect(-1, wxEVT_SCROLL_LINEDOWN, (wxObjectEventFunction) + (wxEventFunction) + (wxScrollEventFunction)&SwitchView::OnScroll); + Connect(-1, wxEVT_SCROLL_PAGEUP, (wxObjectEventFunction) + (wxEventFunction) + (wxScrollEventFunction)&SwitchView::OnScroll); + Connect(-1, wxEVT_SCROLL_PAGEDOWN, (wxObjectEventFunction) + (wxEventFunction) + (wxScrollEventFunction)&SwitchView::OnScroll); + Connect(-1, wxEVT_SCROLL_THUMBTRACK, (wxObjectEventFunction) + (wxEventFunction) + (wxScrollEventFunction)&SwitchView::OnScroll); + Connect(-1, wxEVT_SCROLL_THUMBRELEASE, (wxObjectEventFunction) + (wxEventFunction) + (wxScrollEventFunction)&SwitchView::OnScroll); + Connect(-1, wxEVT_ERASE_BACKGROUND, (wxObjectEventFunction) + (wxEventFunction) + (wxEraseEventFunction)&SwitchView::OnErase); + + Connect(-1, wxEVT_DYNAMIC_SASH_SPLIT, (wxObjectEventFunction) + (wxEventFunction) + (wxDynamicSashSplitEventFunction)&SwitchView::OnSplit); + Connect(-1, wxEVT_DYNAMIC_SASH_UNIFY, (wxObjectEventFunction) + (wxEventFunction) + (wxDynamicSashUnifyEventFunction)&SwitchView::OnUnify); } wxSize SwitchView::DoGetBestSize() const { return wxSize(64, 64); } -void SwitchView::OnSize(wxSizeEvent& event) { +void SwitchView::OnSize(wxSizeEvent& WXUNUSED(event)) { Layout(); wxScrollBar *hscroll = m_dyn_sash->GetHScrollBar(this); @@ -153,7 +183,7 @@ void SwitchView::OnSize(wxSizeEvent& event) { } } -void SwitchView::OnPaint(wxPaintEvent& event) { +void SwitchView::OnPaint(wxPaintEvent& WXUNUSED(event)) { wxPaintDC dc(m_view); wxScrollBar *hscroll = m_dyn_sash->GetHScrollBar(this); @@ -174,11 +204,11 @@ void SwitchView::OnPaint(wxPaintEvent& event) { } } -void SwitchView::OnErase(wxEraseEvent& event) { +void SwitchView::OnErase(wxEraseEvent& WXUNUSED(event)) { // Do nothing } -void SwitchView::OnSplit(wxDynamicSashSplitEvent& event) { +void SwitchView::OnSplit(wxDynamicSashSplitEvent& WXUNUSED(event)) { SwitchView *view = new SwitchView(m_dyn_sash); view->m_choice->SetSelection(m_choice->GetSelection()); @@ -189,7 +219,7 @@ void SwitchView::OnSplit(wxDynamicSashSplitEvent& event) { vscroll->SetEventHandler(this); } -void SwitchView::OnUnify(wxDynamicSashUnifyEvent& event) { +void SwitchView::OnUnify(wxDynamicSashUnifyEvent& WXUNUSED(event)) { wxScrollBar *hscroll = m_dyn_sash->GetHScrollBar(this); wxScrollBar *vscroll = m_dyn_sash->GetVScrollBar(this); @@ -197,11 +227,11 @@ void SwitchView::OnUnify(wxDynamicSashUnifyEvent& event) { vscroll->SetEventHandler(this); } -void SwitchView::OnChoice(wxCommandEvent& event) { +void SwitchView::OnChoice(wxCommandEvent& WXUNUSED(event)) { m_view->Refresh(); } -void SwitchView::OnScroll(wxScrollEvent& event) { +void SwitchView::OnScroll(wxScrollEvent& WXUNUSED(event)) { m_view->Refresh(); }