TAction のリストを含む TActionClientItem のドロップダウン メニューを作成します。メニューまたは内部の各 TAction の描画イベントをフックして、これらの TAction のキャプションを別の方法で表示する方法を知りたいです!? TAction.OnDrawItem や TActionClientItem.OnDrawItem のようなもの...
procedure xxxxx.BuildActionMenu;
var
iLoop : Integer;
oItem : TAction;
oClientItem : TActionClientItem;
begin
if Assigned(oClientItem) then
for iLoop := oClientItem.Items.Count - 1 downto 0 do
oClientItem.Items.Delete(iLoop);
for iLoop := 0 to List.Count - 1 do
begin
oItem := TAction.Create(actionList);
oItem.Caption := List[iLoop].Name;
oItem.Tag := iLoop;
oItem.OnExecute := HandleOnExecuteMenuItem;
**oItem.OnDraw = WhateverFunction**
oClientItem .Items.Add.Action := oItem;
end;
if Assigned(oClientItem) then
begin
if oClientItem.CommandProperties is TButtonProperties then
TButtonProperties(oClientItem.CommandProperties).ButtonType := btSplit;
TAction(oClientItem.Action).OnExecute := HandleOnExecuteParentItem;
**oClientItem.OnDraw = WhateverFunction**
end;
end;
乾杯。