|
Ruslan Plakhuta
Posts: 76
Joined: 2008-07-01
|
Hi!
I have 2 different add-in`s (FirstAddin.dll and SecondAddin.dll) with own tabs (FirstTab and SecondTab) and my goal is merge FirstTab and SecondTab (move all tabs groups to one separate tab (NOT standard MS Tab)), when this 2 add-in`s is loaded.
If loaded only one of this addin(FirstAddin.dll or SecondAddin.dll), it must show self controls only on own Tab.
To do this merge I shared FirstTab and set ID of SecondTab and in this case all works fine:
Namespace := 'SomeNameSpace';
MainTab.Shared := true;
MainTab.Id := 'adxRibbonTab562394933BB745B3AD906185605E1668';
But if I do the same for SecontTab (in SecondAddin) it doesn`t work.
As I understand it depends on addins load order (seems Office loads Add-ins in alphabetical order and I can`t manage this load behaviour).
My question is:
How to synchronize Tabs sharing (merge) between FirstAddin.dll and SecondAddin.dll?
or
Should I simply do tab sharing code only in first loaded addin (in my case this is FirstAddin.dll (loaded in alphabetical orded))?
If so, is it possible merge tabs from 3 or more addins into one custom tab (NOT standard MS Office Tab)?
Thanks in advance. |
|
Posted 14 Sep, 2011 09:13:02
|
|
Top
|
|
Andrei Smolin
Add-in Express team
Posts: 18793
Joined: 2006-05-11
|
Hi Ruslan,
In http://www.add-in-express.com/docs/vcl-tips.php#tips-16, we give an example of resulting XML. Look at it and make sure that in XMLs that your add-ins generate, the following parts are the same:
xmlns:shared="MyNameSpace"
tab idQ=" shared:adxRibbonTab1" visible="true" label="My Tab"
Does it help?
Andrei Smolin
Add-in Express Team Leader |
|
Posted 14 Sep, 2011 09:34:06
|
|
Top
|
|
Ruslan Plakhuta
Posts: 76
Joined: 2008-07-01
|
Andrei Smolin wrote:
Does it help?
yes, it helps me check original ribbon xml.
Thanks.
So, if I want to merge tabs from 2 different addins I must do next:
In first addin:
procedure TFirstAddInModule.adxCOMAddInModuleRibbonBeforeCreate(Sender: TObject;
const RibbonID: WideString);
begin
Namespace := 'SomeNameSpace';
FirstTab.Shared := true;
end;
In second addin:
procedure TSecondAddInModule.adxCOMAddInModuleRibbonBeforeCreate(Sender: TObject;
const RibbonID: WideString);
begin
Namespace := 'SomeNameSpace';
SecondTab.Shared := true;
SecondTab.Id := 'adxRibbonTabBC3E6340ADB148BDAEB0FE9C8EE57252'; // first addin TAB ID
SecondTab.Caption := 'BlaBla'
end;
Is it correct?
How about more than 2 addins, for example 3 addins?
How can I merge tabs from 3 different addins to one separate tab(NOT standard MS office tab), is it possible? |
|
Posted 15 Sep, 2011 06:09:53
|
|
Top
|
|
Andrei Smolin
Add-in Express team
Posts: 18793
Joined: 2006-05-11
|
Hi Ruslan,
If several add-ins use the same Id and Caption properties on their Ribbon tab components and if the Shared property of the components is true, then the controls created on the Ribbon components will be shown on the same Ribbon tab.
Hope this makes sense.
Andrei Smolin
Add-in Express Team Leader |
|
Posted 15 Sep, 2011 06:25:53
|
|
Top
|
|
Ruslan Plakhuta
Posts: 76
Joined: 2008-07-01
|
All works fine for me, when I set the same ID and Caption for all my tabs.
Thanks, Andrei. |
|
Posted 15 Sep, 2011 09:20:04
|
|
Top
|
|
Andrei Smolin
Add-in Express team
Posts: 18793
Joined: 2006-05-11
|
You are welcome!
Andrei Smolin
Add-in Express Team Leader |
|
Posted 15 Sep, 2011 09:23:44
|
|
Top
|
|