Exemple #1
0
void wxFoldPanelBar::OnPressCaption(wxCaptionBarEvent &event)
{
    // act upon the folding or expanding status of the bar

    if(event.GetFoldStatus())
        Collapse(wxFoldPanel((wxFoldPanelItem *)event.GetTag()));
    else
        Expand(wxFoldPanel((wxFoldPanelItem *)event.GetTag()));
}
Exemple #2
0
wxFoldPanel wxFoldPanelBar::AddFoldPanel(const wxString &caption, int proportion,
	bool collapsedInitially, const wxCaptionBarStyle &style)
{
    wxASSERT(m_controlCreated);

    // create a fold panel item, which is first only the caption.
    // the user can now add a panel area which will be folded in
    // when pressed.

    wxFoldPanelItem *item = new wxFoldPanelItem(this, caption, m_images, collapsedInitially, style);

	//item->SetWindowStyle(wxBORDER_STATIC);

	m_panelSizer->Add(item, wxSizerFlags().Expand().Proportion(proportion));
    m_panels.Add(item);

    return wxFoldPanel(item);
}
wxFoldPanel wxFoldPanelBar::AddFoldPanel(const wxString &caption, bool collapsedInitially, const wxCaptionBarStyle &style)
{
    wxASSERT(m_controlCreated);

    // create a fold panel item, which is first only the caption.
    // the user can now add a panel area which will be folded in
    // when pressed.

    wxFoldPanelItem *item = new wxFoldPanelItem(m_foldPanel, caption, m_images, collapsedInitially, style);

    // look at the last added one and reposition this one
    int pos = 0;
    if(m_panels.GetCount() > 0)
        pos = m_panels.Last()->GetItemPos() + m_panels.Last()->GetPanelLength();

    item->Reposition(pos);
    m_panels.Add(item);

    //return wxFoldPanel(item);
    return wxFoldPanel(item);
}