CommandData Class Reference

#include <c4d_commanddata.h>

Inheritance diagram for CommandData:

详细描述

A data class for creating command plugins. (Previously known as menu plugins.)
使用 RegisterCommandPlugin() to register a command plugin.

公共成员函数

virtual Bool   Execute ( BaseDocument *doc, GeDialog *parentManager)
virtual Bool   ExecuteSubID ( BaseDocument *doc, Int32 subid, GeDialog *parentManager)
virtual Bool   ExecuteOptionID ( BaseDocument *doc, Int32 plugid, Int32 subid, GeDialog *parentManager)
virtual Int32   GetState ( BaseDocument *doc, GeDialog *parentManager)
virtual Bool   GetSubContainer ( BaseDocument *doc, BaseContainer &submenu, GeDialog *parentManager)
virtual Bool   RestoreLayout (void *secret)
virtual String   GetScriptName (void)
virtual Bool   消息 ( Int32 type, void *data)
-  Public Member Functions inherited from BaseData
  BaseData ()
virtual  ~BaseData (void)
void  Destructor (void)

成员函数文档编制

◆  Execute()

virtual Bool Execute ( BaseDocument doc ,
GeDialog parentManager  
)
virtual

Executes the command.

参数
[in] doc The active document. Cinema 4D owns the pointed document.
返回
true if the command was executed successfully, otherwise false .

◆  ExecuteSubID()

virtual Bool ExecuteSubID ( BaseDocument doc ,
Int32   subid ,
GeDialog parentManager  
)
virtual

Executes the command with the sub-command ID that was given by GetSubContainer() .

参数
[in] doc The active document. Cinema 4D owns the pointed document.
[in] subid The sub-command ID.
返回
true if the command was executed successfully, otherwise false .

◆  ExecuteOptionID()

virtual Bool ExecuteOptionID ( BaseDocument doc ,
Int32   plugid ,
Int32   subid ,
GeDialog parentManager  
)
virtual

Executes the command when the user calls it through its options dialog.

参数
[in] doc The active document. Cinema 4D owns the pointed document.
[in] plugid The command plugin ID.
[in] subid The sub-command ID. Only available for plugins that have sub-IDs (which normally are called using ExecuteSubID).
返回
true if the command was executed successfully, otherwise false .

◆  GetState()

virtual Int32 GetState ( BaseDocument doc ,
GeDialog parentManager  
)
virtual

Called to get the state of the command.

注意
Affects how it is displayed in menus and toolbars.
参数
[in] doc The active document. Cinema 4D owns the pointed document.
返回
A combination of the 2 command flags: CMD_ENABLED CMD_VALUE .

◆  GetSubContainer()

virtual Bool GetSubContainer ( BaseDocument doc ,
BaseContainer submenu ,
GeDialog parentManager  
)
virtual

Called to get the command sub-menu.
Container submenu is passed to create dynamic sub-container entries.

注意
The menu entries on the top level will all be placed at the point where the command plugin was placed.
To create a sub-menu, place the entries as sub-containers in the returned container with ID 0 . In the sub-container, place a string with ID 1 to name it: BaseContainer bc; bc. SetString (1, "Submenu Test" ); bc. SetString (1000, "First Entry" ); submenu. InsData (0, bc); 使用 &d& and &c& to disable and check items.
参数
[in] doc The active document. Cinema 4D owns the pointed document.
[in] submenu Fill with the sub-menu structure.
返回
true if the sub-menu container was filled, otherwise false .

◆  RestoreLayout()

virtual Bool RestoreLayout ( void *  secret )
virtual

Called when loading a layout and restoring async dialogs.

警告
If implemented then it must create the dialog and call dialog->RestoreLayout .
If the command has more than one dialog, RestoreLayoutSecret::subid gives the ID of the sub-dialog to restore.
注意
If not implemented Cinema 4D will create an empty "???" dialog.
参数
[in] secret Points to a RestoreLayoutSecret structure.
返回
true if the dialog was restored, otherwise false .

◆  GetScriptName()

virtual String GetScriptName ( void  )
virtual

Called to get the script name of the command.

注意
If implemented the command is stored by name rather than by ID in layouts, shortcuts and menus.
返回
The script name for the command.

◆  Message()

virtual Bool 消息 ( Int32   type ,
void *  data  
)
virtual

Called to respond to command messages.

参数
[in] type The message type: MSG_COMMAND
[in] data The message data. Depends on the command message type .
返回
true if the message was processed, otherwise false .
BaseContainer::SetString
void SetString(Int32 id, const maxon::String &s)
定义: c4d_basecontainer.h:569
BaseContainer::InsData
GeData * InsData(Int32 id, const GeData &n)
定义: c4d_basecontainer.h:238
BaseContainer
定义: c4d_basecontainer.h:46