How can I implement highlighted toolbar icons using Delphi?

I would like to highlight my toolbar icons when their associated action has the "checked" property set to true. I would like to do it the way Microsoft Office 2003 did, for example. see the Bold and Align Left icons in this image:

Toolbar example

The image was drawn with a frame around it, and the background was changed to orange.

How can I implement this with Delphi 2009?

As a bonus, is there a way to do the same with the menu icon for the related item? for example, as shown below with lines and markup:

Menu example


Followup:

, , , . Delphi 4, Delphi 2009, VCL Delphi 5 7, TActionManager, TActionToolbar Delphi. Delphi , Microsoft O/S.

, , , , . Embarcadero re: : "" , ?, Peter Below , XP, Vista Windows 7, .

, , O/S , . Delphi . XP, / XP XP. . , - . Office 2003, hilighting, . . Vista Windows 7.

, , , ... "CheckedImages". , (, ).

-, - - , , .

+5
3

TToolBar DrawingStyle, dsGradient, .

Sample toolbar with dsGradient as DrawingStyle

+2

TActionManager (, , ). , AutoCheck true . TActionToolbar. . TXPColorMap . TImageList , ( C:\Program Files (x86)\Common Files\CodeGear Shared\Images\GlyFX\Icons\BMP\16x16). .

, , . , ActionManager Style XP Style. - , .

Toolbar sample

+13

, , , :

  • ImageList, ( ) .

  • , "checked" true false, ImageIndex , :

    if WS = 1 then begin
      ElTree.Align := alTop;
    //  TileTopBottomAction.Checked := true;  --- take this out
    //  TileLeftRightAction.Checked := false;  --- take this out
      TileTopBottomAction.ImageIndex := 47;  { hilighted image }
      TileLeftRightAction.ImageIndex := 14;  { regular image }
    end 
    else begin
      ElTree.Align := alLeft;
    //  TileTopBottomAction.Checked := false;  --- take this out
    //  TileLeftRightAction.Checked := true;  --- take this out
      TileTopBottomAction.ImageIndex := 13;  { regular image }
      TileLeftRightAction.ImageIndex := 48;  { hilighted image }
    end;
    

:

toolbar

:

menu

- , , , . , (XP, Vista, Windows 7 ..), .

, 16x16 , , , "checked" true.

0
source

All Articles