Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Delphi 修改";箭头“;使用TActionToolBar中的拆分按钮_Delphi_C++builder - Fatal编程技术网

Delphi 修改";箭头“;使用TActionToolBar中的拆分按钮

Delphi 修改";箭头“;使用TActionToolBar中的拆分按钮,delphi,c++builder,Delphi,C++builder,我有一个使用TActionToolBar和TActionManager的工具栏。按钮具有子按钮,单击按钮右侧的小向下箭头可以使用这些子按钮 “向下箭头”按钮的宽度非常窄,需要精确的鼠标控制。我如何定制它 谢谢一个解决方案是使用TActionToolBar的OnGetControlClass事件 在此之前,需要从TThemedDropDownButton派生类并重写GetDropDownButtonWidth函数: function TThemedDropDownButtonEx.GetDropD

我有一个使用TActionToolBar和TActionManager的工具栏。按钮具有子按钮,单击按钮右侧的小向下箭头可以使用这些子按钮

“向下箭头”按钮的宽度非常窄,需要精确的鼠标控制。我如何定制它


谢谢

一个解决方案是使用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事件中,工具栏允许您定义要使用的按钮类。我们使用一个默认宽度已更改的自定义类