|
|
|
|
Forum
Please
Log In
to post a new message or reply to an existing one. If you are not registered, please
register.
NOTE: Some forums may be read-only if you are not currently subscribed to
our technical support services.
Subject |
Author |
Date |
|
Chun Pong Lau
|
Jun 19, 2009 - 8:42 AM
|
Dear support team, In the above ribbon bar, there are 5 "quick access buttons" (please correct me if i am wrong in the terminology). Here are the questions. 1) How to capture the onclick event of these 5 buttons. 2) How to remove the chevron button as it is unneeded in our project. 3) How can I add change the button images in the runtime (i.e. dynamically)? Thanks a lot. Regards, Chun Pong
|
|
Chun Pong Lau
|
Jun 20, 2009 - 8:26 AM
|
Dear support team, Thank you for your answers. However, would it be a quick change of the original code (maybe a few lines) that can hide the chevron button? Even if it cannot be hidden now, can we just disable the event this button trigger (i.e. opening its menu)? Regards, Chun Pong
|
|
Technical Support
|
Jun 19, 2009 - 2:13 PM
|
The buttons inside the quick access toolbar and all the other ribbon bar buttons are working exactly in the same way as buttons of the classic toolbar. The button clicks are generating the WM_COMMAND messages with the button identifier in the WPARAM parameter. So, you should add the classic ON_COMMAND() handler methods into the main frame, view or document classes. The chevron button cannot be hidden. This is limitation of the current ribbon bar implementation. So, we can assume the invisible chevron as the feature request. You should access the ribbon buttons to change the button images at run-time. The following methods of the ribbon bar control can be used for accessing quick access toolbar buttons:
virtual CExtBarButton * RibbonQuickAccessButton_GetAt(
INT nPos,
bool bVisibleOnly = false
);
const CExtBarButton * RibbonQuickAccessButton_GetAt(
INT nPos,
bool bVisibleOnly = false
) const;
virtual INT RibbonQuickAccessButton_GetCount(
bool bVisibleOnly = false
) const;
The CExtBarButton::GetIconPtr() method returns a pointer to the icon object which you can modify.
|
|
Chun Pong Lau
|
Jun 20, 2009 - 8:41 AM
|
I have just found the change to hide the chevron myself. bool CExtPaintManagerOffice2007_Impl::Ribbon_QuickAccessContentExpandButtonCalcLayout(
CDC & dc,
CExtRibbonButtonQuickAccessContentExpand * pQACEB,
LPARAM lParam // = 0L
)
{
return false; // hide the quick access toolbar - chevron
... }
|
|