Class: cCJAction

Module location: cCJCommandBarSystem.pkg line 2449 (view source)

This creates an action object. It will normally not be directly instanciated but will be used as the superclass of the cCJMenuItem class.

Class Hierarchy:

DFCOMAUTOMATIONOBJECTcComAutomationObjectcCJCommandBarActioncCJAction

Direct Known Subclasses:

cCJMenuItem,

Class Definition

Properties

BooleanpbPrivateActiveUpdate
determins if this action should be updated by the timer. You only set this true if the checked state, enabled state or visible state will be changed by other actions within the program.
BooleanpbPrivateChecked
BooleanpbPrivateEnabled
BooleanpbPrivateVisible
IntegerpiId
normally auto assigned. It can be manually assigned.
IntegerpiPrivateIconId
IntegerpiPrivateShortCutKey
StringpsImage
These are just initial values, if the developer needs to dynamically change images they should use the ComIconId to select the item they need from the image list normally only psImage needs to be set
StringpsImageChecked
StringpsImageDisabled
StringpsImageHot
StringpsImagePressed
StringpsPrivateCaption
StringpsPrivateCategory
StringpsPrivateDescriptionText
StringpsPrivateShortcutText
StringpsPrivateTooltipText

Functions and Procedures

BindKey(Integer iExtra Integer iKey)
IntegerClassForControlType(Integer eType)
Return the class for the passed control type. Good for augmentation
Construct_Object()
Inherited from cCJCommandBarAction
CreateComAction()
CreateComInstance()
called during initial activation to set all default actions.
HandleCreateFirstProxyControl()
use this to find the COM control and return a DF object. You must call this if you don't already have the control pointer. You should only call this if you know that there will only be one control attached to the action. Make no assumption about what "First" means. It's the first one the COM control finds.
HandleCreateProxyControl(Variant vControl)
Creates a DF object of the proper type and binds it to the COM object.
DeleteAllControlsForAction()
delete all com controls for this action
Destroy()
when a manual destroy is sent we need to do some cleanup. If an active action, it must be removed from the active action array All menu controls for this action will be removed, wherever they are within the system The Action Id will be added back to the pool for reuse. This is needed because the com action is not destroyed (there is no interface for this).
End_Construct_Object()
Execute(Variant vCommandBarControl)
called when this action is selected. Only send OnExecute if the action is enabled.
Variant[]FindAllControls()
find all controls owned by this action anywhere in the commandbar system returns a variant array. This is only needed if you expect that there will be multiple hits such as could happen if you allow end user editing. This was created because there is no COM message to do this. This is pretty low level (like ComFindControl) and will not be used much.
VariantFindFirstControl()
find the first control that matches this action's ID. This searches the entire commandbar system and "first" is just the first one it happens to find.
BooleanIsChecked()
For augmentation. Return true if the item should be checked
BooleanIsEnabled()
For augmentation. Return true if the item should be enabled
BooleanIsVisible()
For augmentation. Return true if the item should be visible
OnCreateAction()
creation of action.
OnExecute(Variant vCommandBarControl)
before this is called IsEnabled is called
OnPopupInit(Variant vCommandBarControl Handle hoCommandBarControls)
before called, self and all items IsEnabled, IsChecked and IsVisible are called
OnSelected(Variant vCommandBarControl)
when hover over
OnUpdate()
Event called to update the action
IntegerpbActiveUpdate()
BooleanpbChecked()
BooleanpbEnabled()
BooleanpbVisible()
IntegerpiIconId()
IntegerpiShortCutKey()
StringpsCaption()
StringpsCategory()
StringpsDescription()
StringpsShortcut()
StringpsToolTip()
ReleaseComObject()
if the action is being released we must remove it from the action pool. This is needed for context menus which whose actions get created and released with each invocation. This will also happen when an object is destroyed. If the com object is created, destroy will send ReleaseComObject
Set(Boolean bValue)
Inherited from cCJICommandBarAction
Set(Boolean bValue)
Inherited from cCJICommandBarAction
Set(Boolean bValue)
Inherited from cCJICommandBarAction
Set(String sValue)
Inherited from cCJICommandBarAction
Set(String sValue)
Inherited from cCJICommandBarAction
Set(String sValue)
Inherited from cCJICommandBarAction
Set(String sValue)
Inherited from cCJICommandBarAction
Set(String sValue)
Inherited from cCJICommandBarAction
Set(Integer iExtra Integer iKey)
Inherited from cCJICommandBarAction
Set(Boolean bValue)
Inherited from cCJICommandBarAction
Set(Integer iValue)
Inherited from cCJICommandBarAction
normally this is zero and not changed. When zero the imageId used will be the statusbarId and this is the ID that is used when the psImage method is used. Using psImage is preferred as it adds the icon and assigns it to the object. This can be used to change icons. Note 0=use StatusbarId
Update()
Updates the action. Can be called by timer when active update or called when a menu pops up

References (1):

ModuleContaining SymbolLine
cCJCommandBarSystem.pkgcCJMenuItem3095