hi,
i would like to know how its possible to update the contents of a wxauinotebook page.
i have a notebook page inside a pane managed by wxauimanager and i would like to change the contents of that page when user clicks on a toolbar menu.any idea guys ?
thanks
Kirix Support Forums
updating tabbed pages's content
4 posts
• Page 1 of 1
Re: updating tabbed pages's content
Hello,
You can simply access the notebook page through the selected notebook tab number with the function GetPage(), modify what you want on the page then call Update() on the notebook page and the AuiManager.
If you want to modify all the page content, the various contents of the notebook page could be defined in some child windows (eg. wxPanel), each one managed by a wxAuiPaneInfo. Overload your notebook page class to add it a wxAuiManager. In that overloaded class, connect a function on the expected menu item selection event. In that function you can manage the notebook page content through the children's PanInfo (CentrePane(), Show(), etc.) then finally Update() the notebook page's AuiManager.
Take a look on the documentation of wxAuiNotebook, wxAuiManager and wxAuiPaneInfo.
Regards
You can simply access the notebook page through the selected notebook tab number with the function GetPage(), modify what you want on the page then call Update() on the notebook page and the AuiManager.
If you want to modify all the page content, the various contents of the notebook page could be defined in some child windows (eg. wxPanel), each one managed by a wxAuiPaneInfo. Overload your notebook page class to add it a wxAuiManager. In that overloaded class, connect a function on the expected menu item selection event. In that function you can manage the notebook page content through the children's PanInfo (CentrePane(), Show(), etc.) then finally Update() the notebook page's AuiManager.
Take a look on the documentation of wxAuiNotebook, wxAuiManager and wxAuiPaneInfo.
Regards
- R.U.10
- Registered User
- Posts: 30
- Joined: Mon May 21, 2007 9:26 am
Re: updating tabbed pages's content
hi,
thanks for the reply.
i am a beginner in wx.it would help me alot if you can produce some code samples.
i had tried GetPage() but couldn't make it work.
could you complete the code below:
thanks for the reply.
i am a beginner in wx.it would help me alot if you can produce some code samples.
i had tried GetPage() but couldn't make it work.
could you complete the code below:
- Code: Select all
//get selected page ID
//myTabs is the wxAuiNoteBook object
int selPageId=myTabs->GetSelection();
wxWindow* thisPage=myTabs->GetPage(selPageId);
.......
// now what ??
// how do i access and modify a control (lets suppose modifying wxTextCtrl's value placed in this page)
.......
myManager->Update();
- bajra
- Registered User
- Posts: 2
- Joined: Thu Jun 05, 2008 11:26 am
Re: updating tabbed pages's content
Hello,
Here is a simple sample:
You should use the wxWidgets forum and the wxWiki where you will find a lot of info for beginners. Consult also the documentation (the Windows chm format is also really nice) and of course the sources directly
Regards
Here is a simple sample:
- Code: Select all
//get selected page ID
//myTabs is the wxAuiNoteBook object
int selPageId=myTabs->GetSelection();
wxWindow* thisPage=myTabs->GetPage(selPageId);
if (thisPage != NULL)
{
wxWindow* theCtrl = thisPage->FindWindow(wxT("the ctrl name")/or the ctrl ID);
if (theCtrl != NULL)
{
wxTextCtrl *theTextCtrl = wxDynamicCast(theCtrl, wxTextCtrl);
//Do something on the text control
}
}
//do not update the manager in this case because you work only on the window
//myManager->Update();
//try thisPage->Update(); instead but probably not necessary
You should use the wxWidgets forum and the wxWiki where you will find a lot of info for beginners. Consult also the documentation (the Windows chm format is also really nice) and of course the sources directly
Regards
- R.U.10
- Registered User
- Posts: 30
- Joined: Mon May 21, 2007 9:26 am
4 posts
· Page 1 of 1
Return to wxAUI Questions, Thoughts & Feedback