Category Creo Parametric user interface, Object ProCmd

Function ProCmdIconSet


Description
Designates the icon to be used with a user-created command. Adds the icon to the command of Creo Parametric.
Replacement in Object TOOLKIT: pfcUICommand::SetIcon
Synopsis
#include <ProUICmd.h>
ProErrorProCmdIconSet(
uiCmdCmdId cmd_id
/* (In)
The command identifier.
*/
ProCmdItemIcon cmd_icon
/* (In)
The name of the icon file including the extension. It can be either a .PNG, .GIF, .JPG, .PCX, .BMP, .ICO, .CUR file or a Creo Parametric .BIF file. Make sure to provide the filename including a valid file extension, denoting the type of the image as one of the standard formats listed above. PTC recommends using .PNG file. All icons in Creo Parametric Ribbon are either 16x16 (small) or 32x32 (large) size. As a standard naming convention icon name should not have 32x32 or 20x20 or 16x16 postfix. When Creo Parametric wants to display small icon it looks for iconname.ext and when it looks for large icon it looks for iconname_large.ext file. In order to support legacy applications if iconname.ext is not of 16x16 or 20x20 then Creo Parametric looks iconname16x16.ext or iconname20x20.ext. This support will go away in future releases. PTC recommends using standard icon naming conventions i.e. iconname.ext or iconname_large.ext. For example in order to designate both small and large icon to a command, place both my_icon.png and my_icon_large.png in the resource directory and use my_icon.png as icon file name.

Note: 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 directory is specified in the registry file.

*/
)
Returns
PRO_TK_NO_ERRORThe icon was assigned.
PRO_TK_BAD_INPUTSThe input arguments were invalid.
PRO_TK_E_NOT_FOUNDThe icon file was not found.
PRO_TK_INVALID_FILEThe file specified was not a Creo Parametric .BIF file or a custom .GIF file.
PRO_TK_INVALID_FILEThe file specified was not of required format.

Manual References:

  1. User Interface: Menus, Commands, and Popupmenus: Providing the Icon

Sample Code References:

  1. pt_af_examples ( PTAFExampleMain.c )
  2. pt_af_examples ( PTAFExampleMain.c )
  3. pt_af_examples ( PTAFExampleMain.c )
  4. pt_userguide ( UgMain.c )
  5. pt_userguide ( UgMain.c )
  6. pt_userguide ( UgMain.c )
  7. pt_userguide ( UgMain.c )