« - »

ExpressBars and Visual Form Inheritance

Posted on 2 March 2005

I found a problem when using Visual Form Inheritance with ExpressBars. The inherited forms do not show the MainMenu and Toolbar at all, it simply show empty Docking place. To my surprise, when I searched the Knowledge Base, I found out that ExpressBars does not fully support Delphi‘s visual form inheritance !! In ExpressBars, the toolbars and Item Links are collection items; and unfortunately Delphi‘s form inheritance does not support collection. Collections are simply copied and thus creates many difficulties and impact ExpressBars for a proper implementation in visual form inheritance. The developers would have to completely redesign its class model. Wow, what a surprise !!

I was pointless, confused how to solve this problem. However, in the Knowledge Base, there was a good article on how to perform full creation at runtime. This article gave me an idea how to accomplish it programmatically.

To create the Item Links for menus, we can simply use:

dxBarManager.MainMenuBar.LockUpdate := True;
dxBarManager.MainMenuBar.ItemLinks.Add.Item := mnuFile;
with TdxBarSubItem( mnuFile ).ItemLinks.Add do
Item := mnuFilePrint;
BeginGroup := True;
dxBarManager.MainMenuBar.LockUpdate := False;

For for the Toolbar, we can use:

dxBarManager.Bars[1].LockUpdate := True;
dxBarManager.Bars[1].ItemLinks.Add.Item := mnuRecNew;
dxBarManager.Bars[1].ItemLinks.Add.Item := mnuRecEdit;
dxBarManager.Bars[1].ItemLinks.Add.Item := mnuRecDelete;
with dxBarManager.Bars[1].ItemLinks.Add do
Item := mnuRecSave;
BeginGroup := True;
dxBarManager.Bars[1].LockUpdate := False;

Hopefully it helps 🙂

Popularity: 3% [?]

Komentar dan masukan tentang artikel ini akan sangat bermanfaat bagi semua orang. Silakan isi form komentar di bawah ini. Terimakasih sebelumnya!

2 Responses to 'ExpressBars and Visual Form Inheritance'

Subscribe to comments with RSS or TrackBack to ' ExpressBars and Visual Form Inheritance '.

  1. orsini said,

    on September 21st, 2007 at 11:19 pm

    Pak Hian, salam kenal, saya orsini osman di depok 1, bogor. Saya butuh component utk Delphi 6 yang berisi TdxBar, TdxBarManager, TdxPageControl, TdxBarPopupMenu, dsb. Saya minta tolong sama bpk, kiranya bapak mau mengirim file component package tsb via email saya “orsin_o@yahoo.com”.

    Atas bantuan bpk Hian, saya ucapkan terimakasih.

  2. hian said,

    on October 5th, 2007 at 3:18 pm

    #1: Salam kenal Pak Orsini, mohon maaf karena saya tidak bisa memberikan file2 yang bapak minta. Kiranya bapak bisa mendapatkannya dari tempat lain. Sukses untuk Anda.

Leave a reply