Questions tagged [taction]

taction is a generic action VCL component. It implements user commands across a range of different controls. It is defined in ActnList.pas unit.

42 questions
17
votes
7 answers

How can I see who triggered an action in Delphi?

When a TAction event fires, the "Sender" is always the action itself. Usually that's the most useful, but is it somehow possible to find out who triggered the action's OnExecute event? Example Let's say you have a form with the following: 2…
Wouter van Nifterick
  • 23,603
  • 7
  • 78
  • 122
12
votes
3 answers

Does TAction.OnUpdate event degrade the performance?

In Delphi XE7, I use this trick to automatically enable or disable a toolbar button ("Edit ListView Item") according to whether an item in the ListView is selected or not, to prevent the user to click on the button if there is no ListView Item…
user1580348
  • 5,721
  • 4
  • 43
  • 105
7
votes
2 answers

Creating a Delphi app shortcut with no corresponding menu item

I want to have a shortcut key combination (like Ctrl+Alt+D) in my app to invoke a function, but I don't want the shortcut to appear on any menu. Is it possible to have a shortcut available in your app that is otherwise invisible?
rossmcm
  • 5,493
  • 10
  • 55
  • 118
6
votes
1 answer

Delphi XE - TRibbon actions always send focus to MainForm

When I place a TRibbon control on a form that is not the MainForm of the application, that TRibbon's actions (i.e. Cut, Paste) will always return focus to the MainForm after the action is executed. This occurs even if the TForm that holds the…
Aaron
  • 93
  • 7
6
votes
3 answers

How do I add support for actions in my component

What do I need to do for adding actions support to my component. It is a button component but I guess it is the same for whatever component type it is. Any information or how to will help.
Roy M Klever
  • 353
  • 5
  • 15
5
votes
3 answers

Use TAction for an "icon only" TButton

I have a TAction that is used for both a menu item and a TButton. I want the menu item to show the label, and the TButton to show only the icon. However, when an Action is assigned, Vcl automatically sets the TButton's Caption attribute, and I…
Hendrik
  • 569
  • 3
  • 12
5
votes
1 answer

Changing font of TActionMainMenuBar when using Vcl styles

Normally one could change the font of a TActionMainMenuBar or TMainMenu like this: Screen.MenuFont.Name := 'Calibri'; When using Vcl styles this isn't possible any more if a StyleHook is registered for the component. I went into the Bitmap Style…
Peter
  • 2,977
  • 1
  • 17
  • 29
4
votes
1 answer

How can I change the behavior of an event handler based on which TAction triggered it?

I have some menu items where the action is this: procedure TMISMainFrm.ActiSalesInvoiceExecute(Sender: TObject); begin if CheckMdiList('Sales Invoice') then BEGIN SalesInvFrm := tSalesInvFrm.Create(Self,0,UserIdNo,1,1); …
mra
  • 97
  • 6
4
votes
2 answers

Delphi: disable 1 Action from Action List

It is funny :) but how to do something like ActionList1.MyAction.Enable:=false? An Action List has actions for buttons, if a button is invisible I need to disable it's action (if not to do this and pres a shortcut then a procedure will be…
maxfax
  • 4,281
  • 12
  • 74
  • 120
4
votes
3 answers

How can I handle a keyboard shortcut when my program isn't active?

Is it ok if i use it like this..for multiple events? unit Unit4; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, Clipbrd; type TForm4 = class(TForm) procedure FormCreate(Sender:…
andrei
  • 41
  • 1
  • 3
4
votes
2 answers

Why are : visible, control assigned TActions affecting the CPU usage of the application?

If a TAction is linked to an Object such as TToolButton( Item of TToolBar ) or TActionClientItem( Item of TActionToolBar ) and that Object is visible on runtime, then whenever you move the mouse in the form (anywhere but the Toolbars), there seems…
Peter
  • 2,977
  • 1
  • 17
  • 29
4
votes
2 answers

Renaming TAction for another form

I have 2 forms which I'd like to share one single TActionManager and assigned TAction-s. First form is main form - it holds TActionManager, TAction with caption "Action". Main menu of Form1 has this action and menuitem caption property set to…
Coder12345
  • 3,431
  • 3
  • 33
  • 73
3
votes
3 answers

How to make subcomponent TAction-s available at design time?

In my custom component I created some TAction-s as subcomponents. They're all published, but I could not assign them at design time since they were not available through object inspector. How do you make them "iterable" by the object inspector? I…
Luthfi
  • 432
  • 2
  • 5
  • 13
3
votes
4 answers

Secondary Shortcut does not fire

I am using Delpho 2006. The Scenario: On the data module I have an ActionList. One of the actions has a shortcut Ctrl+F4 and I want to have a secondary shortcut Ctrl+W. I tried all of the following: Adding Ctrl+W to the actions SecondaryShortcut…
Ralph M. Rickenbach
  • 12,893
  • 5
  • 29
  • 49
3
votes
3 answers

Delphi idle handler only fires when I move the mouse

I have an OnIdle handler in my D2006 app. With this code: procedure TMainForm.ApplicationEvents1Idle(Sender: TObject; var Done: Boolean); begin Inc (IdleCalls) ; Sleep (10) ; Done := False ; end ; the app runs smoothly, the idle handler is called…
rossmcm
  • 5,493
  • 10
  • 55
  • 118
1
2 3