How to make a shortcut key do different things depending on the active bookmark?

Everyone TTabSheeton mine TPageControlhas on it TToolBar. Each toolbar has TToolButtonone that should respond to the same shortcut. How to provide hotkeys so that the right button is displayed on the current page?

Something should happen on the first tab Ctrl+ T, but after going to the second tab Ctrl+ Tsomething else should happen.

Is it time to switch TActionList.Statebetween asNormaland asSuspendedwhen showing or hiding tab tables?

+3
source share
2 answers

, Ctrl + T TabSheets PageControl, Ctrl + T, :

procedure TForm1.actNextPageExecute(Sender: TObject)
var
   nextPageIndex: Integer;
begin
   nextPageIndex := PageControl1.ActivePageIndex+1;

   if (nextPageIndex > PageControl1.Pages.Count-1) then
       nextPageIndex := 0;

   PageControl1.ActivePageIndex := nextPageIndex;
end;
+1

, TAction , , ActionComponent. .

, .

0

All Articles