Delphi 修改";箭头“;使用TActionToolBar中的拆分按钮
我有一个使用TActionToolBar和TActionManager的工具栏。按钮具有子按钮,单击按钮右侧的小向下箭头可以使用这些子按钮 “向下箭头”按钮的宽度非常窄,需要精确的鼠标控制。我如何定制它Delphi 修改";箭头“;使用TActionToolBar中的拆分按钮,delphi,c++builder,Delphi,C++builder,我有一个使用TActionToolBar和TActionManager的工具栏。按钮具有子按钮,单击按钮右侧的小向下箭头可以使用这些子按钮 “向下箭头”按钮的宽度非常窄,需要精确的鼠标控制。我如何定制它 谢谢一个解决方案是使用TActionToolBar的OnGetControlClass事件 在此之前,需要从TThemedDropDownButton派生类并重写GetDropDownButtonWidth函数: function TThemedDropDownButtonEx.GetDropD
谢谢一个解决方案是使用TActionToolBar的OnGetControlClass事件 在此之前,需要从TThemedDropDownButton派生类并重写GetDropDownButtonWidth函数:
function TThemedDropDownButtonEx.GetDropDownButtonWidth: Integer;
begin
Result := 14; // default drop down button width
end;
void __fastcall TWorkAreaToolBarFrame::ActionToolBarLeftGetControlClass(TCustomActionBar *Sender,
TActionClient *AnItem, TCustomActionControlClass &ControlClass)
{
if(ControlClass == __classid(TThemedDropDownButton))
ControlClass = __classid(TThemedDropDownButtonEx);
}
然后,在OnGetControlClass函数中:
function TThemedDropDownButtonEx.GetDropDownButtonWidth: Integer;
begin
Result := 14; // default drop down button width
end;
void __fastcall TWorkAreaToolBarFrame::ActionToolBarLeftGetControlClass(TCustomActionBar *Sender,
TActionClient *AnItem, TCustomActionControlClass &ControlClass)
{
if(ControlClass == __classid(TThemedDropDownButton))
ControlClass = __classid(TThemedDropDownButtonEx);
}
简而言之,在GetControlClass事件中,工具栏允许您定义要使用的按钮类。我们使用一个默认宽度已更改的自定义类