Category Creo Parametric user interface, Object ProCmd

Function ProCmdOptionAdd


Description
Adds a new option to Creo Parametric. This option can be later associated with a checkbutton or radio button group in the Creo Parametric Ribbon UI.

This function is executed only once during a Creo Parametric session for each option. Subsequent calls to this function for previously loaded options are ignored.

Synopsis
#include <ProUICmd.h>
ProErrorProCmdOptionAdd(
char* option_name
/* (In)
The name of the option (must be unique)
*/
uiCmdCmdActFn option_cb
/* (In)
The callback function activated when the button is clicked (Radio type) or checked (Check type).
*/
ProBoolean boolean_operation
/* (In)
When PRO_B_TRUE, button is Check type. When PRO_B_FALSE, button is Radio type.
*/
uiCmdCmdValFn set_value_cb
/* (In)
The callback function that defines the value of the option.
*/
uiCmdAccessFn access_func
/* (In)
The function that defines the accessibility of the option
*/
ProBoolean allow_in_non_active_window
/* (In)
Defines whether this option can be changed in a nonactive Creo Parametric window
*/
ProBoolean allow_in_accessory_window
/* (In)
Defines whether this option can be changed in an accessory Creo Parametric window
*/
uiCmdCmdId* option_id
/* (Out)
The identifier of the option
*/
)
Returns
PRO_TK_NO_ERRORThe function successfully added the option.
PRO_TK_GENERAL_ERRORThe function failed to add the option.
PRO_TK_E_FOUNDAn option already exists under option_name.

Manual References:

  1. User Interface: Menus, Commands, and Popupmenus: Adding a Check Button to the Ribbon User Interface
  2. User Interface: Menus, Commands, and Popupmenus: Adding a Check Button to the Ribbon User Interface
  3. User Interface: Menus, Commands, and Popupmenus: Adding a Radio Button Group to the Ribbon
  4. User Interface: Menus, Commands, and Popupmenus: Adding a Radio Button Group to the Ribbon
  5. User Interface: Menus, Commands, and Popupmenus: Adding the Command
  6. User Interface: Menus, Commands, and Popupmenus: Creating Commands for the New Popup Menu Buttons
  7. User Interface: Menus, Commands, and Popupmenus: Creating Commands for the New Popup Menu Buttons

Sample Code References:

  1. pt_examples ( TestMenubar.c )
  2. pt_examples ( TestMenubar.c )
  3. pt_examples ( TestMenubar.c )