خانه > comp > gb.qt > action 
 en fr de es it nl pl pt pt_BR mk sq ca hu cs tr ar id vi ko ja ru zh zh_TW eo
قبلی  بعدی  ویرایش  تغییر نام  واگرد  Search  سرپرستی  
مستندات  
اخطار! این صفحه ترجمه نشده است.  مشاهده نسخه انگلیسی 
Action (gb.qt)
This class is used for managing actions.

نمادها
این کلاس ساختنی هست.
This class acts like a فقط خواندنی array.

متدهای استاتیک 
 Get  Lock  Raise  Register  UnLock 
خصوصیات 
 Enabled  Picture  Text  ToolTip  Value  Visible 

Overview

An action is a string key that links together controls that must have the same goal.

For example, a "Save" Menu entry and a Button in a ToolBar with a "Save" icon. Instead of having to make control groups and catching events, you can use actions to:

The following controls can be linked to an action: Setting the Action property of other controls has no effect.

مثال

' Gambas class file
PUBLIC save AS Action

PUBLIC SUB Form_Open()
 Menu1.Action = "save"
 button.Action = "save"
END

PUBLIC SUB Action_Activate(key AS String) AS Boolean
 SELECT CASE key
 CASE "save"
 ' call save sub at here
  PRINT "save to a file."
 END SELECT
END

Local actions

An action whose name begins with a dot is a "local" action. When raised, only the main observer of linked controls, as returned by the Object.Parent method, will catch them.

That feature is used in the Workspace child windows of the گامباس IDE: the child window tool buttons are all associated with local actions.

If they were not, raising the associated action would activate it for all child windows using it, and not for the one owning the toolbar only!