Add-In Express and ADO SQL Server databases

Add-in Express™ Support Service
That's what is more important than anything else

Add-In Express and ADO SQL Server databases
Query database with Add-In Express 
agent86




Posts: 14
Joined: 2013-11-16
Delphi 7 Enterprise
Word 2010

In the meantime because I thought there was no solution with Add-In Express I tried RibbonCreator 2010. With it I used a dynamic menu. That works fine. The benefit is I can also change a label that is located below the dynamic ribbon menu after the user selected a menu item. That way the user can continue to see what was picked after the dynamic menu closes. Even though I can accomplish this with RibbonCreator2010, I want to get this to work with Add-In Express for Delphi if possible. Can a label on the ribbon change during the dynamic menu selection process. RibbonCreator 2010 makes the ribbon controls "change" by doing a "invalidatecontrol" call. Will that work with Add-In Express?

The requirement is that the user must be able to see the selected item after they have picked from the dynamic menu. Can a label on the ribbon change during the dynamic menu selection process? See below. When the [Select a Report] dynamic menu is clicked the menu drops down like a drop down box. After clicking the dynamic menu item the dynamic menu closes and a label under the dynamic menu shows what the selection was.

After the [Select a Report] dynamic menu is clicked and during the selection process...

[Select a Report]
Report #1 Description
Report #2 Description
Report #3 Description

After dynamic menu item selection process...

[Select a Report]

Report #1 Description
Posted 30 Nov, 2013 13:08:43 Top
Andrei Smolin


Add-in Express team


Posts: 14374
Joined: 2006-05-11
agent86 writes:
Even though I can accomplish this with RibbonCreator2010, I want to get this to work with Add-In Express for Delphi if possible.


When you modify the TadxRibbonLabel.Caption property in code, Add-in Express issues InvalidateControl() behind the scene. Are you saying that this doesn't work for you?

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 02 Dec, 2013 00:42:00 Top
agent86




Posts: 14
Joined: 2013-11-16
No. I'm not saying it did not work. I did not try yet. My understanding from an earlier reply to my original post was that the only control that was dynamic was the dynamic menu. If I take the time to program the dynamic menu to list the available reports and someone clicks on an item on the dynamic menu can I immediately after the menu click change the label below the dynamic menu to display the name of the report that was selected?

Is there sample code that shows how to "load" the dynamic menu items? Is there sample code that shows how to "read" the dynamic menu item that was selected?


Maybe my confusion is caused by the fact I misunderstand what dynamic means.
Posted 02 Dec, 2013 09:40:51 Top
Andrei Smolin


Add-in Express team


Posts: 14374
Joined: 2006-05-11
agent86 writes:
If I take the time to program the dynamic menu to list the available reports and someone clicks on an item on the dynamic menu can I immediately after the menu click change the label below the dynamic menu to display the name of the report that was selected?


You intercept the Click event of that control (not item!) and modify the caption of the other Ribbon control.

Dynamic means the menu fires an event (OnCreate) in which you create, update and delete the Controls collection of the menu. The dynamic menu fires this event whenever you open the menu.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 03 Dec, 2013 04:44:34 Top
agent86




Posts: 14
Joined: 2013-11-16
Is there any sample code of the loading of the dynamic menu with items and reading a menu selection? I've searched the forum and can't find examples. Not saying there aren't any, just can't find them. I have searched on and off for a couple of days.
Posted 03 Dec, 2013 09:09:11 Top
Andrei Smolin


Add-in Express team


Posts: 14374
Joined: 2006-05-11
Please see below:

procedure TAddInModule.adxRibbonTab1Controls1Controls0Create(
  Sender: TObject);
var
  menu: TadxRibbonMenu;
  newButton: TadxRibbonbutton;
begin
menu := adxRibbonTab1.Controls.Items[1].AsRibbonGroup.Controls.Items[0].AsRibbonMenu;
menu.Controls.Clear;
newButton := menu.Controls.Add(rctButton).AsRibbonButton;
newButton.Caption := 'caption';
newButton.Id := 'uniqueString';
newButton.OnClick := NewButtonClick;
//newButton.Ribbons = menu.Ribbons;
end;

procedure TAddInModule.NewButtonClick(
  Sender: TObject; const RibbonControl: IRibbonControl);
begin
  ShowMessage('qqqqqq');
end;


Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 03 Dec, 2013 10:17:27 Top
agent86




Posts: 14
Joined: 2013-11-16
Thank you for the example...I'll give it a try.
Posted 03 Dec, 2013 11:15:29 Top