user741875
user741875

Reputation:

TPopupActionBar has no ColorMap property?

Ok, so I almost have a good looking UI, using TActionManager, TActionMainMenuBars and TToolBar with DrawingStyle as gradient to create a OfficeXP style interface.

I am using a couple of TPopupActionBar popup menus too, but I dont see a ColorMap property. I am using a ColorMap property to change the color of the default XP style color, and also changing the Hot Color of the TToolBar to match the menu.

I now need the TPopupActionBar popup menu to match the menu and toolbar, but how can I do this when I see no way of assigning a ColorMap to it?

Excuse me if this is non trivial, I have looked and cannot see. I also tried at runtime to assign a ColorMap but there doesnt seem to be the property for it?? I can change the Style of the TPopupActionBar, but cannot assign a ColorMap.

Upvotes: 5

Views: 593

Answers (1)

RRUZ
RRUZ

Reputation: 136391

To assign a ColorMap you can use the OnGetControlClass event of the TPopupActionBar component , then check if the PopupMenu is not nil and finally assign the nested property ColorMap of this property.

check this sample.

procedure TFormMain.PopupActionBar1GetControlClass(Sender: TCustomActionBar;
  AnItem: TActionClient; var ControlClass: TCustomActionControlClass);
begin
  if Assigned(PopupActionBar1.PopupMenu) then
    PopupActionBar1.PopupMenu.ColorMap:= TwilightColorMap1;
end;

check this image which contains a TPopupActionBar with the TwilightColorMap applied

enter image description here

Upvotes: 3

Related Questions