This is my first attempt at a blog, forgive me for any newbie blog errors.
I'm developing a non-smart Progress window using the Codejock ShortcutBar and CommandBarsFrame controls.
I use Codejock 11.1 and Progress 10.1B01
I cannot share the actual code I developed, but I will try to share some of solutions for issues I encountered.
The items added using AddItem must be windows, passing the hWnd of a frame won't work.
Progress windows aren't really suited for this job, but with the extra undocumented
IDE-WINDOW-TYPE = 1 /* embedded mode */ IDE-PARENT-HWND = iViewHwnd /* chCtrlFrameShortcutBar:hwnd */
it seems to work.
When clicking the close button on the main window the event fires on one of the Shortcut item windows.
apply window-close to the main window did not work so I now apply close to the procedure of the main window.
I could not click in any of the item windows except the last, after clicking the last I could select the previous item, and so on.
As a work-around I select all items in the program starting from the last. Seems ugly but it works.
for each itemwindow by win-id desc: itemWindow.comHnd:selected = yes. end.
Although I use LockWindowupdate you can see the items being selected one by one, still have to look further into this.
CommandBar buttons don't have an accelerator property. You have to use the CommandBar keybindings control.
When the execute event fires because of a keybinding, the control you get as input is a temporary button.
You can detect the difference between clicking a button and pressing a key with the p-control:parent property. It is 0 for a keybinding event. You have to use the id of the p-control. The self handle points to the Control frame so you can use that to find the button with the matching id if needed.
More information to follow if I find other issues and work-arounds which seem useful.
Carl
Comments
Lockwindowupdate Although
Lockwindowupdate
Although the lockwindowupdate call seems successful (result = 1) you can see the items being selected.
I now set the control frame invisible before building the Shortcutbar and make invisible afterwards.