Ignore:
Timestamp:
10/03/06 22:03:58 (18 years ago)
Author:
mattausch
Message:

fixed bug with view space box

Location:
GTP/trunk/Lib/Vis/Preprocessing/FrontEnd
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/FrontEnd/preprocessorFrontEnd.cpp

    r1558 r1563  
    3131IMPLEMENT_APP(MyApp) 
    3232 
     33 
    3334bool MyApp::OnInit() 
    3435{ 
    3536    // Create the main window 
    36     MyFrame *frame = new MyFrame( wxT("Notebook sample") ); 
     37    MyFrame *frame = new MyFrame(wxT("Preprocessor Frontend")); 
    3738 
    3839    // Problem with generic wxNotebook implementation whereby it doesn't size 
    3940    // properly unless you set the size again 
    40 #if defined(__WXMOTIF__) 
     41//#if defined(__WXMOTIF__) 
     42//      frame->SetSize(wxDefaultCoord, wxDefaultCoord, 1024, 768); 
    4143    int width, height; 
    42     frame->GetSize(& width, & height); 
     44    frame->GetSize(&width, &height); 
    4345    frame->SetSize(wxDefaultCoord, wxDefaultCoord, width, height); 
    44 #endif 
     46//#endif 
    4547 
    4648    frame->Show(); 
     
    4951} 
    5052 
    51 wxPanel *CreateUserCreatedPage(wxBookCtrlBase *parent) 
     53 
     54wxPanel *MyFrame::CreateUserCreatedPage(wxBookCtrlBase *parent) 
    5255{ 
    5356    wxPanel *panel = new wxPanel(parent); 
    5457 
    55     (void) new wxButton( panel, wxID_ANY, wxT("Button"), 
    56         wxPoint(10, 10), wxDefaultSize ); 
     58    (void) new wxButton(panel, wxID_ANY, wxT("Button"), 
     59        wxPoint(10, 10), wxDefaultSize); 
    5760 
    5861    return panel; 
    5962} 
    6063 
    61 wxPanel *CreateRadioButtonsPage(wxBookCtrlBase *parent) 
     64 
     65wxPanel *MyFrame::CreatePreprocessorPage(wxBookCtrlBase *parent) 
    6266{ 
    6367    wxPanel *panel = new wxPanel(parent); 
    6468 
    65     wxString animals[] = { wxT("Fox"), wxT("Hare"), wxT("Rabbit"), 
    66         wxT("Sabre-toothed tiger"), wxT("T Rex") }; 
    67  
    68     wxRadioBox *radiobox1 = new wxRadioBox(panel, wxID_ANY, wxT("Choose one"), 
    69         wxDefaultPosition, wxDefaultSize, 5, animals, 2, wxRA_SPECIFY_ROWS); 
    70  
    71     wxString computers[] = { wxT("Amiga"), wxT("Commodore 64"), wxT("PET"), 
    72         wxT("Another") }; 
    73  
    74     wxRadioBox *radiobox2 = new wxRadioBox(panel, wxID_ANY, 
    75         wxT("Choose your favourite"), wxDefaultPosition, wxDefaultSize, 
    76         4, computers, 0, wxRA_SPECIFY_COLS); 
     69        wxString preprocessorType[] = {wxT("Rss"), wxT("Gvs"), wxT("None")}; 
     70 
     71    wxRadioBox *radiobox1 = new wxRadioBox(panel, wxID_ANY, wxT("Choose preprocessor type"), 
     72        wxDefaultPosition, wxDefaultSize, 3, preprocessorType, 1, wxRA_SPECIFY_ROWS); 
     73 
     74        mDetectEmptyViewSpaceText = new wxTextCtrl(panel, wxID_ANY, "detect emtpy view space", 
     75                wxDefaultPosition, wxDefaultSize); 
     76 
     77        //mDetectEmptyViewSpaceCheckBox = new wxCheckBox(panel, wxID_ANY); 
    7778 
    7879    wxBoxSizer *sizerPanel = new wxBoxSizer(wxVERTICAL); 
    79     sizerPanel->Add(radiobox1, 2, wxEXPAND); 
    80     sizerPanel->Add(radiobox2, 1, wxEXPAND); 
     80    sizerPanel->Add(radiobox1, 1, wxEXPAND); 
     81        sizerPanel->Add(mDetectEmptyViewSpaceText, 1); 
     82        sizerPanel->Add(mDetectEmptyViewSpaceCheckBox, 1); 
     83 
    8184    panel->SetSizer(sizerPanel); 
    8285 
     
    8487} 
    8588 
    86 wxPanel *CreateVetoPage(wxBookCtrlBase *parent) 
     89 
     90wxPanel *MyFrame::CreateViewCellsPage(wxBookCtrlBase *parent) 
     91{ 
     92    wxPanel *panel = new wxPanel(parent); 
     93 
     94        wxString viewSpaceHierarchy[] = {wxT("vspBsp"), wxT("vspOsp"), wxT("bsp")}; 
     95 
     96    wxRadioBox *radiobox1 = new wxRadioBox(panel, wxID_ANY, wxT("Choose view space hierarchy type"), 
     97        wxDefaultPosition, wxDefaultSize, 3, viewSpaceHierarchy, 1, wxRA_SPECIFY_ROWS); 
     98 
     99    wxBoxSizer *sizerPanel = new wxBoxSizer(wxVERTICAL); 
     100    sizerPanel->Add(radiobox1, 1, wxEXPAND); 
     101    panel->SetSizer(sizerPanel); 
     102 
     103    return panel; 
     104} 
     105 
     106 
     107/*wxPanel *CreateVetoPage(wxBookCtrlBase *parent) 
    87108{ 
    88109    wxPanel *panel = new wxPanel(parent); 
     
    92113 
    93114    return panel; 
    94 } 
    95  
    96 wxPanel *CreateBigButtonPage(wxBookCtrlBase *parent) 
    97 { 
    98     wxPanel *panel = new wxPanel(parent); 
    99  
    100     wxButton *buttonBig = new wxButton(panel, wxID_ANY, wxT("Maximized button")); 
    101  
    102     wxBoxSizer *sizerPanel = new wxBoxSizer(wxVERTICAL); 
    103     sizerPanel->Add(buttonBig, 1, wxEXPAND); 
    104     panel->SetSizer(sizerPanel); 
    105  
    106     return panel; 
    107 } 
    108  
    109  
    110 wxPanel *CreateInsertPage(wxBookCtrlBase *parent) 
     115}*/ 
     116 
     117 
     118/*wxPanel *CreateInsertPage(wxBookCtrlBase *parent) 
    111119{ 
    112120    wxPanel *panel = new wxPanel(parent); 
     
    117125 
    118126    return panel; 
    119 } 
     127}*/ 
     128 
    120129 
    121130int GetIconIndex(wxBookCtrlBase* bookCtrl) 
     
    133142} 
    134143 
    135 void CreateInitialPages(wxBookCtrlBase *parent) 
     144 
     145void MyFrame::CreateInitialPages(wxBookCtrlBase *parent) 
    136146{ 
    137147    // Create and add some panels to the notebook 
    138  
    139     wxPanel *panel = CreateRadioButtonsPage(parent); 
    140     parent->AddPage( panel, RADIOBUTTONS_PAGE_NAME, false, GetIconIndex(parent) ); 
    141  
    142     panel = CreateVetoPage(parent); 
    143     parent->AddPage( panel, VETO_PAGE_NAME, false, GetIconIndex(parent) ); 
    144  
    145     panel = CreateBigButtonPage(parent); 
    146     parent->AddPage( panel, MAXIMIZED_BUTTON_PAGE_NAME, false, GetIconIndex(parent) ); 
    147  
    148     panel = CreateInsertPage(parent); 
    149     parent->InsertPage( 0, panel, I_WAS_INSERTED_PAGE_NAME, false, GetIconIndex(parent) ); 
     148    wxPanel *panel = CreatePreprocessorPage(parent); 
     149    parent->AddPage(panel, PREPROCESSOR_PAGE_NAME, false, GetIconIndex(parent)); 
     150 
     151        panel = CreateViewCellsPage(parent); 
     152    parent->AddPage(panel, VIEWCELLS_PAGE_NAME, false, GetIconIndex(parent)); 
     153 
     154    //panel = CreateVetoPage(parent); 
     155    //parent->AddPage( panel, VETO_PAGE_NAME, false, GetIconIndex(parent) ); 
     156 
     157    //panel = CreateInsertPage(parent); 
     158    //parent->InsertPage( 0, panel, I_WAS_INSERTED_PAGE_NAME, false, GetIconIndex(parent) ); 
    150159 
    151160    parent->SetSelection(1); 
    152161} 
    153162 
    154 wxPanel *CreatePage(wxBookCtrlBase *parent, const wxString&pageName) 
    155 { 
    156     if 
    157     ( 
    158         pageName.Contains(INSERTED_PAGE_NAME) 
    159         || pageName.Contains(ADDED_PAGE_NAME) 
    160     ) 
    161     { 
    162         return CreateUserCreatedPage(parent); 
    163     } 
    164  
    165     if (pageName == I_WAS_INSERTED_PAGE_NAME) 
    166     { 
    167         return CreateInsertPage(parent); 
    168     } 
    169  
    170     if (pageName == VETO_PAGE_NAME) 
    171     { 
    172         return CreateVetoPage(parent); 
    173     } 
    174  
    175     if (pageName == RADIOBUTTONS_PAGE_NAME) 
    176     { 
    177         return CreateRadioButtonsPage(parent); 
    178     } 
    179  
    180  
    181     if (pageName == MAXIMIZED_BUTTON_PAGE_NAME) 
    182     { 
    183         return CreateBigButtonPage(parent); 
     163 
     164wxPanel *MyFrame::CreatePage(wxBookCtrlBase *parent, const wxString&pageName) 
     165{ 
     166    
     167    if (pageName == VIEWCELLS_PAGE_NAME) 
     168    { 
     169        return CreateViewCellsPage(parent); 
     170    } 
     171 
     172        if (pageName == PREPROCESSOR_PAGE_NAME) 
     173    { 
     174        return CreatePreprocessorPage(parent); 
    184175    } 
    185176 
     
    189180} 
    190181 
    191 MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size, 
     182MyFrame::MyFrame(const wxString& title,  
     183                                 const wxPoint& pos,  
     184                                 const wxSize& size, 
    192185                 long style) 
    193186    : wxFrame((wxWindow *) NULL, wxID_ANY, title, pos, size, style) 
    194187{ 
    195188#if wxUSE_NOTEBOOK 
    196     m_type = ID_BOOK_NOTEBOOK; 
     189    mType = ID_BOOK_NOTEBOOK; 
    197190#elif wxUSE_CHOICEBOOK 
    198     m_type = ID_BOOK_CHOICEBOOK; 
     191    mType = ID_BOOK_CHOICEBOOK; 
    199192#elif wxUSE_LISTBOOK 
    200     m_type = ID_BOOK_LISTBOOK; 
     193    mType = ID_BOOK_LISTBOOK; 
    201194#elif 
    202195    #error "Don't use Notebook sample without any book enabled in wxWidgets build!" 
    203196#endif 
    204197 
    205     m_orient = ID_ORIENT_DEFAULT; 
    206     m_chkShowImages = true; 
    207     m_multi = false; 
     198    mOrient = ID_ORIENT_DEFAULT; 
     199    mChkShowImages = true; 
     200    mMulti = false; 
    208201 
    209202    SetIcon(wxICON(sample)); 
     
    212205    wxMenu *menuType = new wxMenu; 
    213206#if wxUSE_NOTEBOOK 
    214     menuType->AppendRadioItem(ID_BOOK_NOTEBOOK,   wxT("&Notebook\tCtrl-1")); 
     207    menuType->AppendRadioItem(ID_BOOK_NOTEBOOK, wxT("&Notebook\tCtrl-1")); 
    215208#endif 
    216209#if wxUSE_LISTBOOK 
    217     menuType->AppendRadioItem(ID_BOOK_LISTBOOK,   wxT("&Listbook\tCtrl-2")); 
     210    menuType->AppendRadioItem(ID_BOOK_LISTBOOK, wxT("&Listbook\tCtrl-2")); 
    218211#endif 
    219212#if wxUSE_CHOICEBOOK 
    220213    menuType->AppendRadioItem(ID_BOOK_CHOICEBOOK, wxT("&Choicebook\tCtrl-3")); 
    221214#endif 
    222     menuType->Check(m_type, true); 
     215 
     216    menuType->Check(mType, true); 
    223217 
    224218    wxMenu *menuOrient = new wxMenu; 
     
    243237    menuFile->AppendSeparator(); 
    244238    menuFile->Append(wxID_EXIT, wxT("E&xit"), wxT("Quits the application")); 
    245     menuFile->Check(ID_SHOW_IMAGES, m_chkShowImages); 
    246     menuFile->Check(ID_MULTI, m_multi); 
     239    menuFile->Check(ID_SHOW_IMAGES, mChkShowImages); 
     240    menuFile->Check(ID_MULTI, mMulti); 
    247241 
    248242    wxMenuBar *menuBar = new wxMenuBar; 
     
    253247    // books creation 
    254248 
    255     m_panel      = (wxPanel *)      NULL; 
     249    mPanel      = (wxPanel *) NULL; 
    256250#if wxUSE_NOTEBOOK 
    257     m_notebook   = (wxNotebook *)  NULL; 
     251    mNotebook   = (wxNotebook *) NULL; 
    258252#endif 
    259253#if wxUSE_CHOICEBOOK 
    260     m_choicebook = (wxChoicebook *) NULL; 
     254    mChoicebook = (wxChoicebook *) NULL; 
    261255#endif 
    262256#if wxUSE_LISTBOOK 
    263     m_listbook   = (wxListbook *)  NULL; 
     257    mListbook   = (wxListbook *) NULL; 
    264258#endif 
    265259 
     
    267261    wxSize imageSize(32, 32); 
    268262 
    269     m_imageList 
     263    mImageList 
    270264        = new wxImageList( imageSize.GetWidth(), imageSize.GetHeight() ); 
    271265 
    272     m_imageList->Add 
     266    mImageList->Add 
    273267        ( 
    274268            wxArtProvider::GetIcon(wxART_INFORMATION, wxART_OTHER, imageSize) 
    275269        ); 
    276270 
    277     m_imageList->Add 
     271    mImageList->Add 
    278272        ( 
    279273            wxArtProvider::GetIcon(wxART_QUESTION, wxART_OTHER, imageSize) 
    280274        ); 
    281275 
    282     m_imageList->Add 
     276    mImageList->Add 
    283277        ( 
    284278            wxArtProvider::GetIcon(wxART_WARNING, wxART_OTHER, imageSize) 
    285279        ); 
    286280 
    287     m_imageList->Add 
     281    mImageList->Add 
    288282        ( 
    289283            wxArtProvider::GetIcon(wxART_ERROR, wxART_OTHER, imageSize) 
    290284        ); 
    291285 
    292     m_panel = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 
     286    mPanel = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 
    293287        wxTAB_TRAVERSAL | wxCLIP_CHILDREN | wxNO_BORDER | wxNO_FULL_REPAINT_ON_RESIZE); 
    294288 
    295289#if USE_LOG 
    296     m_text = new wxTextCtrl(m_panel, wxID_ANY, wxEmptyString, 
     290    mText = new wxTextCtrl(mPanel, wxID_ANY, wxEmptyString, 
    297291        wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE | wxTE_READONLY); 
    298292 
    299     m_logTargetOld = wxLog::SetActiveTarget( new wxLogTextCtrl(m_text) ); 
     293    mLogTargetOld = wxLog::SetActiveTarget( new wxLogTextCtrl(mText) ); 
    300294#endif // USE_LOG 
    301295 
    302296    // Set sizers 
    303     m_sizerFrame = new wxBoxSizer(wxVERTICAL); 
     297    mSizerFrame = new wxBoxSizer(wxVERTICAL); 
    304298 
    305299#if USE_LOG 
    306     m_sizerFrame->Add(m_text, 1, wxEXPAND); 
     300    mSizerFrame->Add(mText, 1, wxEXPAND); 
    307301#endif // USE_LOG 
    308302 
     303        // create preprocessor front end 
     304        //mPreprocessorFrontEnd = new PreprocessorFrontEnd(); 
    309305    RecreateBooks(); 
    310  
    311     m_panel->SetSizer(m_sizerFrame); 
    312  
    313     m_sizerFrame->Fit(this); 
    314     m_sizerFrame->SetSizeHints(this); 
     306    mPanel->SetSizer(mSizerFrame); 
     307 
     308    mSizerFrame->Fit(this); 
     309    mSizerFrame->SetSizeHints(this); 
    315310 
    316311    Centre(wxBOTH); 
    317312} 
    318313 
     314 
    319315MyFrame::~MyFrame() 
    320316{ 
    321317#if USE_LOG 
    322     delete wxLog::SetActiveTarget(m_logTargetOld); 
     318    delete wxLog::SetActiveTarget(mLogTargetOld); 
    323319#endif // USE_LOG 
    324320 
    325     if (m_imageList) 
    326     { 
    327         delete m_imageList; 
    328         m_imageList = (wxImageList *) NULL; 
     321    if (mImageList) 
     322    { 
     323        delete mImageList; 
     324        mImageList = (wxImageList *) NULL; 
    329325    } 
    330326} 
     
    347343#endif 
    348344 
    349 #define RECREATE( wxBookType , idBook, oldBook , newBook )                         \ 
     345#define RECREATE(wxBookType , idBook, oldBook, newBook)                            \ 
    350346{                                                                                  \ 
    351347    int flags;                                                                     \ 
    352348                                                                                   \ 
    353     switch ( m_orient )                                                            \ 
     349    switch (mOrient)                                                               \ 
    354350    {                                                                              \ 
    355351        case ID_ORIENT_TOP:                                                        \ 
     
    372368            flags = SelectFlag(idBook, wxNB_DEFAULT, wxLB_DEFAULT, wxCHB_DEFAULT); \ 
    373369    }                                                                              \ 
    374                                                                                    \ 
    375     if ( m_multi && ( idBook == ID_NOTEBOOK ) )                                    \ 
     370                                                                                                                                                                   \ 
     371    if (mMulti && (idBook == ID_NOTEBOOK))                                         \ 
    376372        flags |= wxNB_MULTILINE;                                                   \ 
    377373                                                                                   \ 
    378374    wxBookType *oldBook = newBook;                                                 \ 
    379375                                                                                   \ 
    380     newBook = new wxBookType(m_panel, idBook,                                      \ 
     376    newBook = new wxBookType(mPanel, idBook,                                       \ 
    381377                             wxDefaultPosition, wxDefaultSize,                     \ 
    382378                             flags);                                               \ 
    383379                                                                                   \ 
    384     if ( m_chkShowImages )                                                         \ 
     380    if (mChkShowImages)                                                            \ 
    385381    {                                                                              \ 
    386         newBook->SetImageList(m_imageList);                                        \ 
     382        newBook->SetImageList(mImageList);                                         \ 
    387383    }                                                                              \ 
    388384                                                                                   \ 
     
    400396        }                                                                          \ 
    401397                                                                                   \ 
    402         m_sizerFrame->Detach(oldBook);                                             \ 
     398        mSizerFrame->Detach(oldBook);                                              \ 
    403399                                                                                   \ 
    404400        delete oldBook;                                                            \ 
     
    414410        CreateInitialPages(newBook);                                               \ 
    415411    }                                                                              \ 
    416                                                                                    \ 
    417     m_sizerFrame->Insert(0, newBook, 5, wxEXPAND | wxALL, MARGIN);                 \ 
    418                                                                                    \ 
    419     m_sizerFrame->Hide(newBook);                                                   \ 
    420 } 
     412                                                                                                                                                                   \ 
     413        mSizerFrame->Insert(0, newBook, 5, wxEXPAND | wxALL, MARGIN);                              \ 
     414        mSizerFrame->Hide(newBook);                                                    \ 
     415} 
     416 
    421417 
    422418void MyFrame::RecreateBooks() 
    423419{ 
    424420#if wxUSE_NOTEBOOK 
    425     RECREATE( wxNotebook   , ID_NOTEBOOK   , notebook   , m_notebook ); 
     421    RECREATE(wxNotebook, ID_NOTEBOOK, notebook, mNotebook); 
    426422#endif 
    427423#if wxUSE_LISTBOOK 
    428     RECREATE( wxListbook   , ID_LISTBOOK   , listbook   , m_listbook ); 
     424//    RECREATE(wxListbook, ID_LISTBOOK, listbook, mListbook); 
    429425#endif 
    430426#if wxUSE_CHOICEBOOK 
    431     RECREATE( wxChoicebook , ID_CHOICEBOOK , choicebook , m_choicebook ); 
     427    RECREATE(wxChoicebook, ID_CHOICEBOOK, choicebook, mChoicebook); 
    432428#endif 
    433429 
     
    435431} 
    436432 
     433 
    437434wxBookCtrlBase *MyFrame::GetCurrentBook() 
    438435{ 
    439     switch (m_type) 
     436    switch (mType) 
    440437    { 
    441438#if wxUSE_NOTEBOOK 
    442         case ID_BOOK_NOTEBOOK:   return m_notebook; 
     439        case ID_BOOK_NOTEBOOK:   return mNotebook; 
    443440#endif 
    444441#if wxUSE_LISTBOOK 
    445         case ID_BOOK_LISTBOOK:   return m_listbook; 
     442        case ID_BOOK_LISTBOOK:   return mListbook; 
    446443#endif 
    447444#if wxUSE_CHOICEBOOK 
    448         case ID_BOOK_CHOICEBOOK: return m_choicebook; 
     445        case ID_BOOK_CHOICEBOOK: return mChoicebook; 
    449446#endif 
    450447    } 
     
    454451void MyFrame::ShowCurrentBook() 
    455452{ 
    456     switch(m_type) 
     453    switch(mType) 
    457454    { 
    458455#if wxUSE_NOTEBOOK 
    459         case ID_BOOK_NOTEBOOK:   if(m_notebook)   m_sizerFrame->Show(m_notebook);   break; 
     456        case ID_BOOK_NOTEBOOK:  
     457                        if (mNotebook)    
     458                        { 
     459                                mSizerFrame->Show(mNotebook);    
     460                        } 
     461                         
     462                        break; 
    460463#endif 
    461464#if wxUSE_LISTBOOK 
    462         case ID_BOOK_LISTBOOK:   if(m_listbook)   m_sizerFrame->Show(m_listbook);   break; 
     465        case ID_BOOK_LISTBOOK:    
     466                        if (mListbook)    
     467                        { 
     468                                mSizerFrame->Show(mListbook);    
     469                                break; 
     470                        } 
    463471#endif 
    464472#if wxUSE_CHOICEBOOK 
    465         case ID_BOOK_CHOICEBOOK: if(m_choicebook) m_sizerFrame->Show(m_choicebook); break; 
    466 #endif 
    467     } 
    468  
    469     m_sizerFrame->Layout(); 
     473        case ID_BOOK_CHOICEBOOK:  
     474                        if (mChoicebook)  
     475                        { 
     476                                mSizerFrame->Show(mChoicebook);  
     477                                break; 
     478                        } 
     479#endif 
     480    } 
     481 
     482    mSizerFrame->Layout(); 
    470483} 
    471484 
     
    507520    wxBookCtrlBase *currBook = GetCurrentBook(); 
    508521 
    509     m_type = event.GetId(); 
     522    mType = event.GetId(); 
    510523 
    511524    if (currBook) 
    512         m_sizerFrame->Hide(currBook); 
     525        mSizerFrame->Hide(currBook); 
    513526 
    514527    ShowCurrentBook(); 
     
    517530void MyFrame::OnOrient(wxCommandEvent& event) 
    518531{ 
    519     m_orient = event.GetId(); 
     532    mOrient = event.GetId(); 
    520533    RecreateBooks(); 
    521     m_sizerFrame->Layout(); 
     534    mSizerFrame->Layout(); 
    522535} 
    523536 
    524537void MyFrame::OnShowImages(wxCommandEvent& event) 
    525538{ 
    526     m_chkShowImages = event.IsChecked(); 
     539    mChkShowImages = event.IsChecked(); 
    527540    RecreateBooks(); 
    528     m_sizerFrame->Layout(); 
     541    mSizerFrame->Layout(); 
    529542} 
    530543 
    531544void MyFrame::OnMulti(wxCommandEvent& event) 
    532545{ 
    533     m_multi = event.IsChecked(); 
     546    mMulti = event.IsChecked(); 
    534547    RecreateBooks(); 
    535     m_sizerFrame->Layout(); 
     548    mSizerFrame->Layout(); 
    536549    wxLogMessage(_T("Multiline setting works only in wxNotebook.")); 
    537550} 
     
    548561    wxBookCtrlBase *currBook = GetCurrentBook(); 
    549562 
    550     if ( currBook ) 
    551     { 
    552         wxPanel *panel = new wxPanel( currBook, wxID_ANY ); 
     563    if (currBook) 
     564    { 
     565        wxPanel *panel = new wxPanel(currBook, wxID_ANY); 
     566 
    553567        (void) new wxButton( panel, wxID_ANY, wxT("First button"), 
    554568            wxPoint(10, 10), wxDefaultSize ); 
     
    556570            wxPoint(50, 100), wxDefaultSize ); 
    557571 
    558         currBook->AddPage(panel, wxString::Format(ADDED_PAGE_NAME wxT("%u"), 
    559             ++s_pageAdded), true, GetIconIndex(currBook) ); 
    560     } 
    561 } 
     572        currBook->AddPage( 
     573                        panel, wxString::Format(ADDED_PAGE_NAME wxT("%u"), 
     574            ++ s_pageAdded), true, GetIconIndex(currBook) ); 
     575    } 
     576} 
     577 
    562578 
    563579void MyFrame::OnInsertPage(wxCommandEvent& WXUNUSED(event)) 
     
    567583    wxBookCtrlBase *currBook = GetCurrentBook(); 
    568584 
    569     if ( currBook ) 
    570     { 
    571         wxPanel *panel = CreateUserCreatedPage( currBook ); 
     585    if (currBook) 
     586    { 
     587        wxPanel *panel = CreateUserCreatedPage(currBook); 
    572588 
    573589        currBook->InsertPage( 0, panel, 
    574             wxString::Format(INSERTED_PAGE_NAME wxT("%u"), ++s_pageIns), false, 
     590            wxString::Format(INSERTED_PAGE_NAME wxT("%u"), ++ s_pageIns), false, 
    575591            GetIconIndex(currBook) ); 
    576592 
     
    579595} 
    580596 
     597 
    581598void MyFrame::OnDeleteCurPage(wxCommandEvent& WXUNUSED(event)) 
    582599{ 
    583600    wxBookCtrlBase *currBook = GetCurrentBook(); 
    584601 
    585     if ( currBook ) 
    586     { 
    587         int sel = currBook->GetSelection(); 
     602    if (currBook) 
     603    { 
     604        const int sel = currBook->GetSelection(); 
    588605 
    589606        if (sel != wxNOT_FOUND) 
     
    600617    if ( currBook ) 
    601618    { 
    602         int page = currBook->GetPageCount(); 
     619        const int page = currBook->GetPageCount(); 
    603620 
    604621        if ( page != 0 ) 
     
    613630    wxBookCtrlBase *currBook = GetCurrentBook(); 
    614631 
    615     if ( currBook ) 
     632    if (currBook) 
    616633    { 
    617634        currBook->AdvanceSelection(); 
     
    643660 
    644661        wxString title; 
    645         title.Printf(wxT("Notebook and friends (%d pages, selection: %s)"), nPages, selection.c_str()); 
     662        title.Printf(wxT("Preprocessor (%d pages, selection: %s)"), nPages, selection.c_str()); 
    646663 
    647664        SetTitle(title); 
     
    650667 
    651668#if USE_LOG 
    652     #define BOOKEVENT_LOG m_text->SetInsertionPointEnd(); 
     669    #define BOOKEVENT_LOG mText->SetInsertionPointEnd(); 
    653670#else 
    654671    #define BOOKEVENT_LOG 
  • GTP/trunk/Lib/Vis/Preprocessing/FrontEnd/preprocessorFrontEnd.h

    r1558 r1563  
    2929DECLARE_APP(MyApp) 
    3030 
     31 
    3132class MyFrame : public wxFrame 
    3233{ 
    3334public: 
    34     MyFrame(const wxString& title, const wxPoint& pos = wxDefaultPosition, 
    35         const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE|wxCLIP_CHILDREN|wxNO_FULL_REPAINT_ON_RESIZE); 
     35    MyFrame(const wxString& title,  
     36                        const wxPoint& pos = wxDefaultPosition, 
     37                        const wxSize& size = wxDefaultSize,  
     38                        long style = wxDEFAULT_FRAME_STYLE | wxCLIP_CHILDREN | wxNO_FULL_REPAINT_ON_RESIZE); 
    3639 
    3740    virtual ~MyFrame(); 
     
    6366    wxBookCtrlBase *GetCurrentBook(); 
    6467 
     68        wxPanel *CreateUserCreatedPage(wxBookCtrlBase *parent); 
     69        wxPanel *CreatePreprocessorPage(wxBookCtrlBase *parent); 
     70        wxPanel *CreateViewCellsPage(wxBookCtrlBase *parent); 
     71        void CreateInitialPages(wxBookCtrlBase *parent); 
     72        wxPanel *CreatePage(wxBookCtrlBase *parent, const wxString&pageName); 
     73 
    6574private: 
    66     wxLog *m_logTargetOld; 
    6775 
    6876    int SelectFlag(int id, int nb, int lb, int chb); 
     
    7179 
    7280    // Sample setup 
    73     int m_type; 
    74     int m_orient; 
    75     bool m_chkShowImages; 
    76     bool m_multi; 
     81    int mType; 
     82    int mOrient; 
     83    bool mChkShowImages; 
     84    bool mMulti; 
    7785 
     86        wxLog *mLogTargetOld; 
     87 
     88        ///////// 
    7889    // Controls 
    7990 
    80     wxPanel *m_panel; // Panel containing notebook and other controls 
     91        /// Panel containing notebook and other controls 
     92    wxPanel *mPanel; 
    8193 
    8294#if wxUSE_NOTEBOOK 
    83     wxNotebook   *m_notebook; 
     95    wxNotebook   *mNotebook; 
    8496#endif 
    8597#if wxUSE_CHOICEBOOK 
    86     wxChoicebook *m_choicebook; 
     98    wxChoicebook *mChoicebook; 
    8799#endif 
    88100#if wxUSE_LISTBOOK 
    89     wxListbook   *m_listbook; 
     101    wxListbook   *mListbook; 
    90102#endif 
    91103 
    92104#if USE_LOG 
    93105    // Log window 
    94     wxTextCtrl *m_text; 
     106    wxTextCtrl *mText; 
    95107#endif // USE_LOG 
    96108 
    97     wxBoxSizer *m_sizerFrame; 
     109        wxTextCtrl *mDetectEmptyViewSpaceText; 
     110        wxCheckBox *mDetectEmptyViewSpaceCheckBox; 
    98111 
    99     wxImageList *m_imageList; 
     112    wxBoxSizer *mSizerFrame; 
     113    wxImageList *mImageList; 
    100114 
    101115    DECLARE_EVENT_TABLE() 
     
    126140}; 
    127141 
     142 
     143/*class PreprocessorFrontEnd 
     144{ 
     145        wxPanel *CreateUserCreatedPage(wxBookCtrlBase *parent); 
     146        wxPanel *CreatePreprocessorPage(wxBookCtrlBase *parent); 
     147        wxPanel *CreateViewCellsPage(wxBookCtrlBase *parent); 
     148 
     149        MyFrame *mFrame; 
     150}*/ 
     151 
     152 
    128153/* 
    129154Name of each notebook page. 
     
    131156to decide what type of page it is. 
    132157*/ 
     158#define PREPROCESSOR_PAGE_NAME wxT("Preprocessor") 
     159#define VIEWCELLS_PAGE_NAME  wxT("ViewCells") 
    133160 
    134161#define I_WAS_INSERTED_PAGE_NAME  wxT("Inserted") 
    135 #define RADIOBUTTONS_PAGE_NAME wxT("Radiobuttons") 
    136162#define VETO_PAGE_NAME wxT("Veto") 
    137163#define MAXIMIZED_BUTTON_PAGE_NAME wxT("Maximized button") 
  • GTP/trunk/Lib/Vis/Preprocessing/FrontEnd/preprocessorFrontEnd.vcproj

    r1558 r1563  
    9292                                Optimization="2" 
    9393                                InlineFunctionExpansion="1" 
    94                                 AdditionalIncludeDirectories="$(WXWIN)\lib\vc_lib\msw,$(WXWIN)\include,.,$(WXWIN)\samples" 
     94                                AdditionalIncludeDirectories=""$(WXWIN)\lib\vc_lib\msw";"$(WXWIN)\include";.;"$(WXWIN)\samples"" 
    9595                                PreprocessorDefinitions="WIN32;__WXMSW__;_WINDOWS;NOPCH" 
    9696                                StringPooling="TRUE" 
     
    564564                                AdditionalOptions="/EHsc " 
    565565                                Optimization="0" 
    566                                 AdditionalIncludeDirectories="$(WXWIN)\lib\vc_lib\mswd,$(WXWIN)\include,.,$(WXWIN)\samples" 
     566                                AdditionalIncludeDirectories=""$(WXWIN)\lib\vc_lib\mswd";"$(WXWIN)\include";.;"$(WXWIN)\samples";"$(WXWIN)\include\msvc"" 
    567567                                PreprocessorDefinitions="WIN32;_DEBUG;__WXMSW__;__WXDEBUG__;_WINDOWS;NOPCH" 
    568568                                BasicRuntimeChecks="3" 
Note: See TracChangeset for help on using the changeset viewer.