ActionでToolButtonのDownを機能させたい

解決


印刷屋  2008-03-05 01:56:01  No: 30056  IP: 192.*.*.*

いつもお世話になります。

ToolButtonをアクションで管理し、Downを機能させたいのですが、上手くうごいてくれません。
ちなみにこのToolButtonのEnableをリアルタイムに管理したいためにActionのUpdateを使っています。
どうやったら、ToolButtonを凹ませることができるんでしょうか?

procedure TfrmMain.actDownExecute(Sender: TObject);
begin
  if Action.Checked then
  begin
    Action.Checked  := False;
    ToolButton.Down := True;
  end
  else
  begin
    Action.Checked  := True;
    ToolButton.Down := False;
  end;
end;

//常時監視
procedure TfrmMain.actDownUpdate(Sender: TObject);
begin
  if 条件 then
    (Sender as TAction).Enabled := True
  else
    (Sender as TAction).Enabled := False;
end;


Delphi7 + win2000

編集 削除
印刷屋  2008-03-05 01:56:58  No: 30057  IP: 192.*.*.*

間違いました。
SpeedButtonです。

編集 削除
KHE00221  2008-03-05 16:57:50  No: 30058  IP: 192.*.*.*

TSpeedButton = class(Buttons.TSpeedButton);

とした上で

SpeedButton1.FState := bsDown;
SpeedButton1.Invalidate;
 
SpeedButton1.FState := bsUp;
SpeedButton1.Invalidate;    

SpeedButton1.FState := bsExclusive;
SpeedButton1.Invalidate;

で表示を変化させる事が可能です

編集 削除
凹凸  2008-03-24 17:51:23  No: 30059  IP: 192.*.*.*

SpeedButtonはプロパティの
AllowAllUpをtrue
GroupIndexを1以上
にしておくと、「凹凸操作」できます。

ActionのAutoCheckをtrueにしておけば、
上記のOnExecuteの処理は不要です。

編集 削除
印刷屋  2008-04-02 23:06:56  No: 30060  IP: 192.*.*.*

せっかく教えて頂いたんですが、結局できませんでした。
力不足ですいません。
各イベントに監視の一文を加えていくローテクで事を済ましました。

編集 削除