Пример #1
0
void MyFrame::OnPageChanged( wxBookCtrlEvent& WXUNUSED(event) )
{
    unsigned int nPanel = m_notebook->GetSelection();

    GetMenuBar()->FindItem(ID_STYLE_MENU)->SetItemLabel(
                wxString::Format("Style of panel #%d", nPanel+1));

    for (unsigned int id = ID_MULTIPLE; id <= ID_VERT_RULES; id++)
    {
        unsigned long style = 0;
        switch (id)
        {
        /*case ID_SINGLE:
            style = wxDV_SINGLE;
            break;*/
        case ID_MULTIPLE:
            style = wxDV_MULTIPLE;
            break;
        case ID_ROW_LINES:
            style = wxDV_ROW_LINES;
            break;
        case ID_HORIZ_RULES:
            style = wxDV_HORIZ_RULES;
            break;
        case ID_VERT_RULES:
            style = wxDV_VERT_RULES;
            break;
        default:
            wxFAIL;
        }

        GetMenuBar()->FindItem(id)->Check( m_ctrl[nPanel]->HasFlag(style) );
    }
}
Пример #2
0
void NotebookTestCase::RowCount()
{
    CPPUNIT_ASSERT_EQUAL(1, m_notebook->GetRowCount());

#ifdef __WXMSW__
    wxDELETE(m_notebook);
    m_notebook = new wxNotebook(wxTheApp->GetTopWindow(), wxID_ANY,
                                wxDefaultPosition, wxSize(400, 200),
                                wxNB_MULTILINE);

    for( unsigned int i = 0; i < 10; i++ )
    {
        m_notebook->AddPage(new wxPanel(m_notebook), "Panel", false, 0);
    }

    CPPUNIT_ASSERT( m_notebook->GetRowCount() != 1 );
#endif
}
Пример #3
0
void MyFrame::OnSetBackgroundColour(wxCommandEvent& WXUNUSED(event))
{
    wxDataViewCtrl * const dvc = m_ctrl[m_notebook->GetSelection()];
    wxColour col = wxGetColourFromUser(this, dvc->GetBackgroundColour());
    if ( col.IsOk() )
    {
        dvc->SetBackgroundColour(col);
        Refresh();
    }
}
Пример #4
0
void wxMacControl::SetupTabs( const wxNotebook& notebook)
{
    const size_t countPages = notebook.GetPageCount();
    SetMaximum( countPages ) ;

    wxNotebookPage *page;
    ControlTabInfoRecV1 info;

    for (size_t ii = 0; ii < countPages; ii++)
    {
        page = (wxNotebookPage*) notebook.GetPage(ii);
        info.version = kControlTabInfoVersionOne;
        info.iconSuiteID = 0;
        wxCFStringRef cflabel( page->GetLabel(), page->GetFont().GetEncoding() ) ;
        info.name = cflabel ;
        SetData<ControlTabInfoRecV1>( ii + 1, kControlTabInfoTag, &info ) ;

        if ( notebook.GetImageList() && notebook.GetPageImage(ii) >= 0 )
        {
            const wxBitmap bmap = notebook.GetImageList()->GetBitmap( notebook.GetPageImage( ii ) ) ;
            if ( bmap.IsOk() )
            {
                ControlButtonContentInfo info ;

                wxMacCreateBitmapButton( &info, bmap ) ;

                OSStatus err = SetData<ControlButtonContentInfo>( ii + 1, kControlTabImageContentTag, &info );
                if ( err != noErr )
                {
                    wxFAIL_MSG("Error when setting icon on tab");
                }

                wxMacReleaseBitmapButton( &info ) ;
            }
        }
        SetTabEnabled( ii + 1, true ) ;
    }
}
Пример #5
0
void MyFrame::ClearNotebooks() {
    directStepsBook->DeleteAllPages();
    invertStepsBook->DeleteAllPages();
    
    stepsGrids.clear();
}