};
typedef void (wxEvtHandler::*wxDynamicSashSplitEventFunction)(wxDynamicSashSplitEvent&);
-typedef void (wxEvtHandler::*wxDynamicSashUnifyEventFunction)(wxDynamicSashSplitEvent&);
+typedef void (wxEvtHandler::*wxDynamicSashUnifyEventFunction)(wxDynamicSashUnifyEvent&);
/*
wxDynamicSashWindow. See above.
m_minCellSize = size;
};
+ /* These are to hide Add() method of parents and to avoid Borland warning about hiding virtual functions */
+ void Add( wxWindow *window, int proportion = 0, int flag = 0, int border = 0, wxObject* userData = NULL )
+ { wxFlexGridSizer::Add( window, proportion, flag, border, userData); }
+ void Add( wxSizer *sizer, int proportion = 0, int flag = 0, int border = 0, wxObject* userData = NULL )
+ { wxFlexGridSizer::Add( sizer, proportion, flag, border, userData); }
+ void Add( int width, int height, int proportion = 0, int flag = 0, int border = 0, wxObject* userData = NULL )
+ { wxFlexGridSizer::Add( width, height, proportion, flag, border, userData); }
+ void Add( wxSizerItem *item )
+ { wxFlexGridSizer::Add( item); }
+
private:
wxWindow *m_parent;
unsigned int m_maxRows, m_maxCols;
IMPLEMENT_APP(Demo)
wxChar *HTML_content =
-wxT("<P><H1>wxDynamicSashWindow demo</H1>"
-"<P>Here is an example of how you can use <TT>wxDynamicSashWindow</TT> to allow your users to "
-"dynamically split and unify the views of your windows. Try dragging out a few splits "
-"and then reunifying the window."
-"<P>Also, see the <TT>dynsash_switch</TT> sample for an example of an application which "
-"manages the scrollbars provided by <TT>wxDynamicSashWindow</TT> itself.");
+wxT("<P><H1>wxDynamicSashWindow demo</H1>")
+wxT("<P>Here is an example of how you can use <TT>wxDynamicSashWindow</TT> to allow your users to ")
+wxT("dynamically split and unify the views of your windows. Try dragging out a few splits ")
+wxT("and then reunifying the window.")
+wxT("<P>Also, see the <TT>dynsash_switch</TT> sample for an example of an application which ")
+wxT("manages the scrollbars provided by <TT>wxDynamicSashWindow</TT> itself.");
bool Demo::OnInit() {
wxInitAllImageHandlers();
SashHtmlWindow::SashHtmlWindow(wxWindow *parent, wxWindowID id,
const wxPoint& pos, const wxSize& size, long style, const wxString& name) :
wxHtmlWindow(parent, id, pos, size, style, name) {
- Connect(-1, wxEVT_DYNAMIC_SASH_SPLIT,
- (wxObjectEventFunction)(wxCommandEventFunction)(wxDynamicSashSplitEventFunction) &SashHtmlWindow::OnSplit);
+ Connect(-1, wxEVT_DYNAMIC_SASH_SPLIT, (wxObjectEventFunction)
+ (wxEventFunction)
+ (wxDynamicSashSplitEventFunction)&SashHtmlWindow::OnSplit);
m_dyn_sash = parent;
}
return wxHtmlWindow::GetBestSize();
}
-void SashHtmlWindow::OnSplit(wxDynamicSashSplitEvent& event) {
+void SashHtmlWindow::OnSplit(wxDynamicSashSplitEvent& WXUNUSED(event)) {
wxHtmlWindow *html = new SashHtmlWindow(m_dyn_sash, -1);
html->SetPage(HTML_content);
}
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);
}
}
-void SwitchView::OnPaint(wxPaintEvent& event) {
+void SwitchView::OnPaint(wxPaintEvent& WXUNUSED(event)) {
wxPaintDC dc(m_view);
wxScrollBar *hscroll = m_dyn_sash->GetHScrollBar(this);
}
}
-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());
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);
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();
}
Close(TRUE);
}
-void MyFrame::OnIncrement(wxCommandEvent& event)
+void MyFrame::OnIncrement(wxCommandEvent& WXUNUSED(event))
{
m_panel->OnIncrement();
}
-void MyFrame::OnDecrement(wxCommandEvent& event)
+void MyFrame::OnDecrement(wxCommandEvent& WXUNUSED(event))
{
m_panel->OnDecrement();
}
-void MyFrame::OnSetValue(wxCommandEvent& event)
+void MyFrame::OnSetValue(wxCommandEvent& WXUNUSED(event))
{
m_panel->OnSetValue();
}
-void MyFrame::OnAlignLeft(wxCommandEvent& event)
+void MyFrame::OnAlignLeft(wxCommandEvent& WXUNUSED(event))
{
m_panel->OnAlignLeft();
}
-void MyFrame::OnAlignCenter(wxCommandEvent& event)
+void MyFrame::OnAlignCenter(wxCommandEvent& WXUNUSED(event))
{
m_panel->OnAlignCenter();
}
-void MyFrame::OnAlignRight(wxCommandEvent& event)
+void MyFrame::OnAlignRight(wxCommandEvent& WXUNUSED(event))
{
m_panel->OnAlignRight();
}
-void MyFrame::OnDrawFaded(wxCommandEvent& event)
+void MyFrame::OnDrawFaded(wxCommandEvent& WXUNUSED(event))
{
m_panel->OnDrawFaded();
}
}
}
-void MyFrame::OnCloseWindow(wxCloseEvent& event)
+void MyFrame::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
{
Destroy();
}
m_container->SetEventHandler(this);
- Connect(-1, wxEVT_SIZE, (wxObjectEventFunction)&wxDynamicSashWindowImpl::OnSize);
- Connect(-1, wxEVT_PAINT, (wxObjectEventFunction)&wxDynamicSashWindowImpl::OnPaint);
- Connect(-1, wxEVT_MOTION, (wxObjectEventFunction)&wxDynamicSashWindowImpl::OnMouseMove);
- Connect(-1, wxEVT_ENTER_WINDOW, (wxObjectEventFunction)&wxDynamicSashWindowImpl::OnMouseMove);
- Connect(-1, wxEVT_LEAVE_WINDOW, (wxObjectEventFunction)&wxDynamicSashWindowImpl::OnLeave);
- Connect(-1, wxEVT_LEFT_DOWN, (wxObjectEventFunction)&wxDynamicSashWindowImpl::OnPress);
- Connect(-1, wxEVT_LEFT_UP, (wxObjectEventFunction)&wxDynamicSashWindowImpl::OnRelease);
+ Connect(-1, wxEVT_SIZE, (wxObjectEventFunction)
+ (wxEventFunction)
+ (wxSizeEventFunction)&wxDynamicSashWindowImpl::OnSize);
+ Connect(-1, wxEVT_PAINT, (wxObjectEventFunction)
+ (wxEventFunction)
+ (wxPaintEventFunction)&wxDynamicSashWindowImpl::OnPaint);
+ Connect(-1, wxEVT_MOTION, (wxObjectEventFunction)
+ (wxEventFunction)
+ (wxMouseEventFunction)&wxDynamicSashWindowImpl::OnMouseMove);
+ Connect(-1, wxEVT_ENTER_WINDOW, (wxObjectEventFunction)
+ (wxEventFunction)
+ (wxMouseEventFunction)&wxDynamicSashWindowImpl::OnMouseMove);
+ Connect(-1, wxEVT_LEAVE_WINDOW, (wxObjectEventFunction)
+ (wxEventFunction)
+ (wxMouseEventFunction)&wxDynamicSashWindowImpl::OnLeave);
+ Connect(-1, wxEVT_LEFT_DOWN, (wxObjectEventFunction)
+ (wxEventFunction)
+ (wxMouseEventFunction)&wxDynamicSashWindowImpl::OnPress);
+ Connect(-1, wxEVT_LEFT_UP, (wxObjectEventFunction)
+ (wxEventFunction)
+ (wxMouseEventFunction)&wxDynamicSashWindowImpl::OnRelease);
return TRUE;
}
m_hscroll->SetEventHandler(this);
m_vscroll->SetEventHandler(this);
- Connect(-1, wxEVT_SET_FOCUS, (wxObjectEventFunction)&wxDynamicSashWindowLeaf::OnFocus);
- Connect(-1, wxEVT_SCROLL_TOP, (wxObjectEventFunction)&wxDynamicSashWindowLeaf::OnScroll);
- Connect(-1, wxEVT_SCROLL_BOTTOM, (wxObjectEventFunction)&wxDynamicSashWindowLeaf::OnScroll);
- Connect(-1, wxEVT_SCROLL_LINEUP, (wxObjectEventFunction)&wxDynamicSashWindowLeaf::OnScroll);
- Connect(-1, wxEVT_SCROLL_LINEDOWN, (wxObjectEventFunction)&wxDynamicSashWindowLeaf::OnScroll);
- Connect(-1, wxEVT_SCROLL_PAGEUP, (wxObjectEventFunction)&wxDynamicSashWindowLeaf::OnScroll);
- Connect(-1, wxEVT_SCROLL_PAGEDOWN, (wxObjectEventFunction)&wxDynamicSashWindowLeaf::OnScroll);
- Connect(-1, wxEVT_SCROLL_THUMBTRACK, (wxObjectEventFunction)&wxDynamicSashWindowLeaf::OnScroll);
- Connect(-1, wxEVT_SCROLL_THUMBRELEASE, (wxObjectEventFunction)&wxDynamicSashWindowLeaf::OnScroll);
+ Connect(-1, wxEVT_SET_FOCUS, (wxObjectEventFunction)
+ (wxEventFunction)
+ (wxFocusEventFunction)&wxDynamicSashWindowLeaf::OnFocus);
+ Connect(-1, wxEVT_SCROLL_TOP, (wxObjectEventFunction)
+ (wxEventFunction)
+ (wxScrollEventFunction)&wxDynamicSashWindowLeaf::OnScroll);
+ Connect(-1, wxEVT_SCROLL_BOTTOM, (wxObjectEventFunction)
+ (wxEventFunction)
+ (wxScrollEventFunction)&wxDynamicSashWindowLeaf::OnScroll);
+ Connect(-1, wxEVT_SCROLL_LINEUP, (wxObjectEventFunction)
+ (wxEventFunction)
+ (wxScrollEventFunction)&wxDynamicSashWindowLeaf::OnScroll);
+ Connect(-1, wxEVT_SCROLL_LINEDOWN, (wxObjectEventFunction)
+ (wxEventFunction)
+ (wxScrollEventFunction)&wxDynamicSashWindowLeaf::OnScroll);
+ Connect(-1, wxEVT_SCROLL_PAGEUP, (wxObjectEventFunction)
+ (wxEventFunction)
+ (wxScrollEventFunction)&wxDynamicSashWindowLeaf::OnScroll);
+ Connect(-1, wxEVT_SCROLL_PAGEDOWN, (wxObjectEventFunction)
+ (wxEventFunction)
+ (wxScrollEventFunction)&wxDynamicSashWindowLeaf::OnScroll);
+ Connect(-1, wxEVT_SCROLL_THUMBTRACK, (wxObjectEventFunction)
+ (wxEventFunction)
+ (wxScrollEventFunction)&wxDynamicSashWindowLeaf::OnScroll);
+ Connect(-1, wxEVT_SCROLL_THUMBRELEASE, (wxObjectEventFunction)
+ (wxEventFunction)
+ (wxScrollEventFunction)&wxDynamicSashWindowLeaf::OnScroll);
}
wxLayoutConstraints *layout = new wxLayoutConstraints();
if (m_children.GetCount() == 0)
return wxSize(10,10);
- int m_minWidth = 0;
- int m_minHeight = 0;
-
GetMinimums();
- m_minWidth = Sum(m_maxWidth, m_cell_count.GetWidth());
- m_minHeight = Sum(m_maxHeight, m_cell_count.GetHeight());
+ int m_minWidth = Sum(m_maxWidth, m_cell_count.GetWidth());
+ int m_minHeight = Sum(m_maxHeight, m_cell_count.GetHeight());
return wxSize( m_minWidth, m_minHeight );
}
//---------------------------------------------------------------------------
wxSize clientSize = GetClientSize();
wxRect itemRect;
- int cy=0;
wxTreeItemId h, lastH;
for(h=GetFirstVisibleItem();h;h=GetNextVisible(h))
{
if (GetBoundingRect(h, itemRect))
{
- cy = itemRect.GetTop();
+ int cy = itemRect.GetTop();
dc.DrawLine(0, cy, clientSize.x, cy);
lastH = h;
}
}
if (lastH.IsOk() && GetBoundingRect(lastH, itemRect))
{
- cy = itemRect.GetBottom();
+ int cy = itemRect.GetBottom();
dc.DrawLine(0, cy, clientSize.x, cy);
}
}
wxSize clientSize = GetClientSize();
wxRect itemRect;
- int cy=0;
wxTreeItemId h, lastH;
for(h=m_treeCtrl->GetFirstVisibleItem();h;h=m_treeCtrl->GetNextVisible(h))
{
if (m_treeCtrl->GetBoundingRect(h, itemRect))
{
- cy = itemRect.GetTop();
+ int cy = itemRect.GetTop();
wxRect drawItemRect(0, cy, clientSize.x, itemRect.GetHeight());
lastH = h;
}
if (lastH.IsOk() && m_treeCtrl->GetBoundingRect(lastH, itemRect))
{
- cy = itemRect.GetBottom();
+ int cy = itemRect.GetBottom();
dc.DrawLine(0, cy, clientSize.x, cy);
}
}