Detecting Quick Access command state
Asked Answered
A

0

9

We have an application that is using Windows Ribbon Framework for an UI. The app itself is written in Delphi and uses Windows Ribbon Framework for Delphi to interface with the ribbon API.

Our ribbon XML places few commands into the Quick Access toolbar. Use can then remove/add commands either by using the built-in ribbon mechanism (selecting the drop/down button and clicking on a command name) or by selecting More commands command which opens the configuration dialog.

Quick Access snapshot

The problem I've encountered is that I cannot find a way to get the current state of commands in the QA collection (whether they are visible or not).

In the example above (picture) I would like to detect that first five commands are checked and that the last is not so I can prepare the configuration dialog accordingly.

I have no problems enumerating the IUICollection and accessing the items stored inside. I can also get the UI_PKEY_CommandId for each item. I cannot, however, find a way to read the checked/unchecked state. I tried reading UI_PKEY_BooleanValue and UI_PKEY_Enabled for all items in the collection, but they do not return that state.

I have also tried to monitor IUICommandHandler.UpdateProperty but it doesn't get called when such item is checked/unchecked (except that it is called with the UI_PKEY_Label key).

Does ribbon API even support this functionality?

Absher answered 5/11, 2015 at 14:32 Comment(4)
Just a wild guess: From the Ribbon Delphi tutorials. You can associate each command to a TAction. Then you can (hopfully) read the TAction.Checked property. check out (FMain.pas TFormMain.CommandCreated): github.com/TurboPack/RibbonFramework/tree/master/Samples/…Centra
No, because that again uses UI_PKEY_BooleanValue query which doesn't work for QAT items.Absher
Just to be on the same, which version of the Ribbon framework are you using? bilsen.com/windowsribbon/index.shtml , v. 1.2? or 2.x?Pyrazole
Currently version 2.x.Absher

© 2022 - 2024 — McMap. All rights reserved.