Library | File

Class pfcUICommand

# include <pfcCommand.h>

class pfcUICommand
 : public virtual pfcObject,
 : public virtual pfcActionSource
{
    xaideclare(pfcUICommand)
    ...
};



Description

An action-listener object for menu commands.

The method UICreateCommand creates a UICommand object that contains a UICommandActionListener. You should override the OnCommand method in the ActionListener with the code you want to have execute when the user clicks on that button.
See Also:
pfcSession::UICreateCommand(xrstring, pfcUICommandActionListener_ptr)
Manual References:
Menus, Commands, and Pop-up Menus: Menu Buttons and Menus



Method Summary

voidDesignate (xrstring MessageFile, xrstring Label, optional xrstring Help, optional xrstring Description)
Designates the command to appear as placeable in the Screen Customization dialog. This may not be used for existing Creo Parametric commands.
voidSetIcon (xrstring IconFile)
Designates the icon to be used with a user-created command. Adds the icon to the command of Creo Parametric.


Methods Inherited from Class pfcActionSource:

AddActionListener, RemoveActionListener, AddActionListenerWithType



Method Detail

voidSetIcon (xrstring IconFile)

Designates the icon to be used with a user-created command. Adds the icon to the command of Creo Parametric.

Exceptions thrown (but not limited to):

pfcXToolkitNotFound - The icon file was not found.

pfcXToolkitInvalidFile - The file specified was not a Creo Parametric .BIF file or a custom .GIF file.

pfcXToolkitInvalidFile - The file specified was not of required format.


Manual References:
Menus, Commands, and Pop-up Menus: Command Icons
Parameters:
IconFile
The name of the icon file including the extension. It can be either a Creo Parametric .BIF file, or a custom .GIF file. In order to fit with standard Creo Parametric button sizes, the size of the icon should be at most 20 x 20 pixels. The default search paths for finding the icons are:
  • Creo Parametric loadpoint/text/resource
  • Application text dir/resource
  • Application text dir/(language)/resource
The location of the application text dir is specifed in the registry file.
Returns:



voidDesignate (xrstring MessageFile, xrstring Label, optional xrstring Help, optional xrstring Description)

Designates the command to appear as placeable in the Screen Customization dialog. This may not be used for existing Creo Parametric commands.

Exceptions thrown (but not limited to):

pfcXToolkitNotFound - The message file was not found.

pfcXToolkitMsgNotFound - One or more messages was not found in the message file.


Manual References:
Menus, Commands, and Pop-up Menus: Menu Buttons and Menus, Menus, Commands, and Pop-up Menus: Designating Commands, Menus, Commands, and Pop-up Menus: Designating the Command, Ribbon Tabs, Groups, and Menu Items: Workflow to Add Menu Items to the Ribbon User Interface
Parameters:
MessageFile
Message file name for the two keystrings.
Label
Message keystring referring to the button label . If the command was not assigned an icon, the button name will appear on the toolbar button by default.
Help
Message keystring referring to the button help. This could be null.
Description
The message shown in the customization dialog when you click on Description. This could be null .
Returns: