Page 1 of 2

### wxRibbonPage removing and inserting.

Posted: Thu Apr 22, 2010 8:42 am
Hi all.

Is any way to remove existing wxRibbonPage on a wxRibbonBar ? I have not found any function for this.

Generally, is a way to insert or remove wxRibbonCtrls to their parents in homogeneous API like wxBookCtrlBase ?

If not at present time, is it expected ?

Thanks. Regards.
Emilien

### Re: wxRibbonPage removing and inserting.

Posted: Thu Jul 05, 2012 11:47 pm
I shall need this soon as well, I do see in bar.cpp:

page->Hide();

And in the header file page.h:

virtual bool Show(bool show = true);

### Re: wxRibbonPage removing and inserting.

Posted: Fri Jul 06, 2012 5:10 am
Hi,

I was also looking for the same. But the latest snapshot of the nightly build does has function DeletePage(). I haven't tested it yet, as I am not sure whether the function is fully functional or not. I guess it is fully functional because, the function call is done in sample/ribbon code too.

http://trac.wxwidgets.org/changeset/71888

Good luck.

Regards

### Re: wxRibbonPage removing and inserting.

Posted: Fri Jul 06, 2012 7:05 am
This is functional but not deeply tested on a wide range of platform.
I will work soon on two other patches : show/hide pages and inserting pages at a dedicated index (rather than adding them at end).

I dont know if the inserting functionnality is really usefull if the API allow to hide pages. Comments about that are welcome.

### Re: wxRibbonPage removing and inserting.

Posted: Fri Jul 06, 2012 8:18 am
Hi Cursor,

I had tried with hiding page. May be I haven't understood the proper functionality. When I call this function,

Code: Select all

page->Hide();
Only the page (all the panels and controls on that panel) gets hidden. But the tab on top remains as it is. Hopefully some work may be still going on over it. Actually a similar test must be done on tabbed note book and see how the Hide() behaves there.

Regards

### Re: wxRibbonPage removing and inserting.

Posted: Fri Jul 06, 2012 9:37 pm
What I would like is to be able to add pages, and then dynamics show or hide their tabs in the view (while still keeping the pages as is). This is very commonly done in many ribbon bar type applications.

I have been looking at the code and I think the changes are relatively easy to make. I updated my own code from the main trunk via svn just now and will make the additions. Within a couple of days a patch will be available.

I need this functionality for a software project, it is a must have, so I shall add it myself then and make available to anyone else.

### Re: wxRibbonPage removing and inserting.

Posted: Fri Jul 06, 2012 10:46 pm
I have added the changes I needed to the latest trunk version. Once I have tested it a little more, I shall send in a patch for consideration. The changes are:

bar.h, bar.cpp added these methods to wxRibbonBar:

int GetPageNumber(wxRibbonPage* page);
bool GetShowTab(size_t page);
void SetShowTab(size_t page, bool show_tab);

After showing or hiding a tab, you need to call wxRibbonBar::Realize().

In my application the changes I made work fine. I can initially build all the pages and then hide or show the tabs at runtime as things change. Anyone is welcome to test this code and send me feedback before I send the patch in. The files are:

wxWidgets\include\wx\ribbon\bar.h
wxWidgets\src\ribbon\bar.cpp

### Re: wxRibbonPage removing and inserting.

Posted: Sat Jul 07, 2012 8:09 am
I understahnd your needs, I need such "show/hide pages" functionnalities too. I have coded a patch about that but a bug in MSW art provider persists. I will look at your code too.
BR

### Re: wxRibbonPage removing and inserting.

Posted: Mon Jul 09, 2012 5:03 pm
I have submitted a patch with the functionality described in my earlier post:

http://trac.wxwidgets.org/ticket/14471

### Re: wxRibbonPage removing and inserting.

Posted: Mon Jul 09, 2012 5:08 pm
It looks like some proposed patches sit there for months and months... lets hope this one is considered safe and can just go in smoothly.

### Re: wxRibbonPage removing and inserting.

Posted: Mon Jul 09, 2012 5:14 pm
Vadim just went on vacation and as he's pretty much the only one doing this kind of work, delays are to be expected.

### Re: wxRibbonPage removing and inserting.

Posted: Thu Jul 12, 2012 8:57 pm
I have uploaded a new patch to ticket 14471, implementing some suggestions from vadz (renamed the methods, added sample code, fixed documentation glitch).

### Re: wxRibbonPage removing and inserting.

Posted: Mon Jul 16, 2012 6:01 am
Cool. Good job. Thanks

### Re: wxRibbonPage removing and inserting.

Posted: Mon Jul 16, 2012 3:23 pm
Awesome, thank you. Vadz has integrated the patch on main.

### Re: wxRibbonPage removing and inserting.

Posted: Thu Jul 26, 2012 6:32 pm
On the topic of the ribbon bar (and so I can find it more easily to trac it), I also submitted a patch which adds a disabled label color to the ribbon bar. See here:

http://trac.wxwidgets.org/ticket/14522