Ejemplo n.º 1
0
//----------------------------------------
void CXYPlotPanel::EvtCheckBox(wxWindow& window, const wxCommandEventFunction& method, wxObject* userData, wxEvtHandler* eventSink)
{
  window.Connect(wxEVT_COMMAND_CHECKBOX_CLICKED,
                 (wxObjectEventFunction)
                 (wxEventFunction)
                 method,
                 userData,
                 eventSink);

}
Ejemplo n.º 2
0
//----------------------------------------
void CXYPlotPanel::EvtRadioButton(wxWindow& window, const wxCommandEventFunction& method, wxObject* userData, wxEvtHandler* eventSink)
{
  window.Connect(wxEVT_COMMAND_RADIOBUTTON_SELECTED,
                 (wxObjectEventFunction)
                 (wxEventFunction)
                 method,
                 userData,
                 eventSink);

}
Ejemplo n.º 3
0
//----------------------------------------
void CXYPlotPanel::EvtSize(wxWindow& window, const wxSizeEventFunction& method, wxObject* userData, wxEvtHandler* eventSink)
{
  window.Connect(wxEVT_SIZE,
                 (wxObjectEventFunction)
                 (wxEventFunction)
                 method,
                 userData,
                 eventSink);

}
Ejemplo n.º 4
0
//----------------------------------------
void CZFXYPlotFrame::EvtUpdateMinSize(wxWindow& window, int32_t winId, const CZFXYUpdateMinSizeEventFunction& method,
                                wxObject* userData, wxEvtHandler* eventSink)
{
  window.Connect(winId,
                 wxEVT_ZFXY_UPDATE_MINSIZE,
                 (wxObjectEventFunction)
                 (wxEventFunction)
                 method,
                 userData,
                 eventSink);
}
Ejemplo n.º 5
0
//----------------------------------------
void CContourPropPanel::EvtContourPropFrameClose(wxWindow& window, int32_t winId, const CContourPropFrameCloseEventFunction& method,
                                wxObject* userData, wxEvtHandler* eventSink)
{
  window.Connect(winId,
                 wxEVT_CONTOUR_PROP_CLOSE,
                 (wxObjectEventFunction)
                 (wxEventFunction)
                 method,
                 userData,
                 eventSink);
}
Ejemplo n.º 6
0
bool wxDynamicSashWindowLeaf::Create()
{
    m_hscroll = new wxScrollBar();
    m_vscroll = new wxScrollBar();
    m_viewport = new wxWindow();

    wxDynamicSashWindowImpl *add_child_target = m_impl->m_add_child_target;
    m_impl->m_add_child_target = NULL;

    bool success = m_hscroll->Create(m_impl->m_container, wxID_ANY,
                                     wxDefaultPosition, wxDefaultSize,
                                     wxSB_HORIZONTAL);
    if ( success )
        success = m_vscroll->Create(m_impl->m_container, wxID_ANY,
                                    wxDefaultPosition, wxDefaultSize,
                                    wxSB_VERTICAL);
    if ( success )
        success = m_viewport->Create(m_impl->m_container, wxID_ANY);
    if ( !success )
        return false;

    m_impl->m_add_child_target = add_child_target;

    wxCursor cursor(wxCURSOR_ARROW);
    m_hscroll->SetCursor(cursor);
    m_vscroll->SetCursor(cursor);
    m_viewport->SetCursor(cursor);

    // the viewport must resize its child when it is itself resized, but it's
    // more convenient to do it in our own method instead of deriving a new
    // class just for this: this is why we pass this as last Connect() argument
    m_viewport->Connect(wxEVT_SIZE,
                        wxSizeEventHandler(wxDynamicSashWindowLeaf::OnViewSize),
                        NULL, this);

    Connect(wxEVT_DYNAMIC_SASH_REPARENT,
            wxEventHandler(wxDynamicSashWindowLeaf::OnReparent));

    if (m_impl->m_window->GetWindowStyle() & wxDS_MANAGE_SCROLLBARS)
    {
        m_hscroll->SetEventHandler(this);
        m_vscroll->SetEventHandler(this);

        Connect(wxEVT_SET_FOCUS,
                wxFocusEventHandler(wxDynamicSashWindowLeaf::OnFocus));
        Connect(wxEVT_SCROLL_TOP,
                wxScrollEventHandler(wxDynamicSashWindowLeaf::OnScroll));
        Connect(wxEVT_SCROLL_BOTTOM,
                wxScrollEventHandler(wxDynamicSashWindowLeaf::OnScroll));
        Connect(wxEVT_SCROLL_LINEUP,
                wxScrollEventHandler(wxDynamicSashWindowLeaf::OnScroll));
        Connect(wxEVT_SCROLL_LINEDOWN,
                wxScrollEventHandler(wxDynamicSashWindowLeaf::OnScroll));
        Connect(wxEVT_SCROLL_PAGEUP,
                wxScrollEventHandler(wxDynamicSashWindowLeaf::OnScroll));
        Connect(wxEVT_SCROLL_PAGEDOWN,
                wxScrollEventHandler(wxDynamicSashWindowLeaf::OnScroll));
        Connect(wxEVT_SCROLL_THUMBTRACK,
                wxScrollEventHandler(wxDynamicSashWindowLeaf::OnScroll));
        Connect(wxEVT_SCROLL_THUMBRELEASE,
                wxScrollEventHandler(wxDynamicSashWindowLeaf::OnScroll));
    }

    wxLayoutConstraints *layout = new wxLayoutConstraints();
    if (!layout)
        return false;

    wxSize size = m_hscroll->GetBestSize();

    layout->left.SameAs(m_impl->m_container, wxLeft, 10);
    layout->right.LeftOf(m_vscroll);
    layout->bottom.SameAs(m_impl->m_container, wxBottom, 3);
    layout->height.Absolute(size.GetHeight());
    m_hscroll->SetConstraints(layout);

    layout = new wxLayoutConstraints();
    if (!layout)
        return false;

    size = m_vscroll->GetBestSize();

    layout->top.SameAs(m_impl->m_container, wxTop, 10);
    layout->bottom.Above(m_hscroll);
    layout->right.SameAs(m_impl->m_container, wxRight, 3);
    layout->width.Absolute(size.GetWidth());
    m_vscroll->SetConstraints(layout);

    layout = new wxLayoutConstraints();
    if (!layout)
        return false;
    layout->left.SameAs(m_impl->m_container, wxLeft, 3);
    layout->right.LeftOf(m_vscroll);
    layout->top.SameAs(m_impl->m_container, wxTop, 3);
    layout->bottom.Above(m_hscroll);
    m_viewport->SetConstraints(layout);

    m_impl->m_container->Layout();

    return true;
}