If I want to disable mouse clicking response on some wxRibbonPage, how to do it?
I used rbpage->Disable(), but this function just disable all of widgets in this page, this page still can be switched. I'm desire that the tab of this ribbon page can not response the clicking.
Thanks!
How to disable wxRibbonPage mouse clicking response
Re: How to disable wxRibbonPage mouse clicking response
Catch the wxEVT_RIBBONBAR_PAGE_CHANGING event. Use wxRibbonBarEvent::GetPage() to get the page the systems wants to change to. If you want to avoid this, call event.Veto().
https://docs.wxwidgets.org/trunk/classw ... n_bar.html
https://docs.wxwidgets.org/trunk/classw ... n_bar.html
Use the source, Luke!
Re: How to disable wxRibbonPage mouse clicking response
Catching wxEVT_RIBBONBAR_PAGE_CHANGING event is more graceful. I used wxEVT_RIBBONBAR_PAGE_CHANGED before.doublemax wrote: ↑Thu Mar 28, 2019 1:11 pm Catch the wxEVT_RIBBONBAR_PAGE_CHANGING event. Use wxRibbonBarEvent::GetPage() to get the page the systems wants to change to. If you want to avoid this, call event.Veto().
https://docs.wxwidgets.org/trunk/classw ... n_bar.html
Thank you, doublemax!
Re: How to disable wxRibbonPage mouse clicking response
Hi doublemax,
do you know how to change the text color or text font of ribbon page label ? Thanks!
do you know how to change the text color or text font of ribbon page label ? Thanks!
Re: How to disable wxRibbonPage mouse clicking response
Code: Select all
// wxRibbonBar* m_ribbon;
wxRibbonArtProvider *custom_artprovider = m_ribbon->GetArtProvider()->Clone();
wxFont labelFont( 8, wxFONTFAMILY_ROMAN, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxT("Lucida Sans Unicode") );
custom_artprovider->SetFont(wxRIBBON_ART_TAB_LABEL_FONT, labelFont );
custom_artprovider->SetColor( wxRIBBON_ART_TAB_LABEL_COLOUR, *wxRED );
m_ribbon->SetArtProvider( custom_artprovider );
Use the source, Luke!
Re: How to disable wxRibbonPage mouse clicking response
Hi,
Just to clarify:
- all events that ends with "-ed" are NOT vetoable. They are fired when everything is already occurred.
- all event that ends with "-ing" ARE vetoable. They are fired before the thing occurred.
Thank you.
Just to clarify:
- all events that ends with "-ed" are NOT vetoable. They are fired when everything is already occurred.
- all event that ends with "-ing" ARE vetoable. They are fired before the thing occurred.
Thank you.
Re: How to disable wxRibbonPage mouse clicking response
Thanks doublemax!doublemax wrote: ↑Fri Mar 29, 2019 8:25 amCode: Select all
// wxRibbonBar* m_ribbon; wxRibbonArtProvider *custom_artprovider = m_ribbon->GetArtProvider()->Clone(); wxFont labelFont( 8, wxFONTFAMILY_ROMAN, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxT("Lucida Sans Unicode") ); custom_artprovider->SetFont(wxRIBBON_ART_TAB_LABEL_FONT, labelFont ); custom_artprovider->SetColor( wxRIBBON_ART_TAB_LABEL_COLOUR, *wxRED ); m_ribbon->SetArtProvider( custom_artprovider );
This way could change text font and color of all of tabs. Is there any way to change one of tab only?
Re: How to disable wxRibbonPage mouse clicking response
Not easily. You'd have to derive from wxRibbonArtProvider and re-implement wxRibbonArtProvider::DrawTab.This way could change text font and color of all of tabs. Is there any way to change one of tab only?
Use the source, Luke!