PrefsDialogObject Class Reference

#include <lib_prefs.h>

Inheritance diagram for PrefsDialogObject:

Detailed Description

Allows to register a new preference category in the Cinema 4D preference dialog.
Just derive a class and override the virtual functions as necessary. Then create an instance of the class and call Register().

Public Member Functions

 PrefsDialogObject ()
 
virtual GeListNodeGetMappedObject ()
 
- Public Member Functions inherited from NodeData
 NodeData ()
 
GeListNodeGet ()
 
const GeListNodeGet () const
 
virtual Bool Message (GeListNode *node, Int32 type, void *data)
 
virtual void GetBubbleHelp (GeListNode *node, maxon::String &str)
 
virtual const BaseDocumentGetDocument (const GeListNode *node) const
 
virtual maxon::Result< BoolGetBranchInfo (const GeListNode *node, const maxon::ValueReceiver< const BranchInfo & > &info, GETBRANCHINFO flags) const
 
virtual Bool IsInstanceOf (const GeListNode *node, Int32 type) const
 
virtual Bool IsDocumentRelated (const GeListNode *node, Bool &docrelated) const
 
virtual maxon::Result< BoolGetAccessedObjects (const BaseList2D *node, METHOD_ID method, AccessedObjectsCallback &access) const
 
virtual maxon::Result< maxon::GenericDataGroupChanges (BaseList2D *node)
 
virtual Bool Init (GeListNode *node, Bool isCloneInit)
 
virtual void Free (GeListNode *node)
 
virtual Bool Read (GeListNode *node, HyperFile *hf, Int32 level)
 
virtual Bool Write (const GeListNode *node, HyperFile *hf) const
 
virtual Bool CopyTo (NodeData *dest, const GeListNode *snode, GeListNode *dnode, COPYFLAGS flags, AliasTrans *trn) const
 
virtual Bool GetDDescription (const GeListNode *node, Description *description, DESCFLAGS_DESC &flags) const
 
virtual Bool GetDParameter (const GeListNode *node, const DescID &id, GeData &t_data, DESCFLAGS_GET &flags) const
 
virtual Bool SetDParameter (GeListNode *node, const DescID &id, const GeData &t_data, DESCFLAGS_SET &flags)
 
virtual Bool GetDEnabling (const GeListNode *node, const DescID &id, const GeData &t_data, DESCFLAGS_ENABLE flags, const BaseContainer *itemdesc) const
 
virtual Bool TranslateDescID (GeListNode *node, const DescID &id, DescID &res_id, C4DAtom *&res_at)
 
- Public Member Functions inherited from BaseData
virtual ~BaseData ()
 
void Destructor ()
 

Static Public Member Functions

static BasePluginRegister (Int32 id, DataAllocator *allocfunc, const String &name, const String &description, Int32 parentid, Int32 sortid)
 

Protected Member Functions

void SetPrefsValue (Int32 id, const GeData &data, DESCFLAGS_SET &flags, Bool refresh=false)
 
void SetPrefsValue (Int32 id, Int32 data, DESCFLAGS_SET &flags, const PrefsMapTable *table)
 
void GetPrefsValue (Int32 id, GeData &data, DESCFLAGS_GET &flags) const
 
void GetPrefsValue (Int32 id, GeData &data, DESCFLAGS_GET &flags, const PrefsMapTable *table) const
 
void InitPrefsValue (Int32 id, const GeData &data, Description *desc, const DescID &descid, BaseContainer *pBC=nullptr)
 
virtual Bool InitValues (const DescID &id, Description *description=nullptr)
 

IDPREFS

enum  {
  IDPREFS_SORTID ,
  IDPREFS_PARENTID
}
 

Additional Inherited Members

- Protected Attributes inherited from NodeData
GeListNodeprivate_link
 

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
IDPREFS_SORTID 
IDPREFS_PARENTID 

Constructor & Destructor Documentation

◆ PrefsDialogObject()

Constructor.

Member Function Documentation

◆ SetPrefsValue() [1/2]

void SetPrefsValue ( Int32  id,
const GeData data,
DESCFLAGS_SET flags,
Bool  refresh = false 
)
protected

Private.

◆ SetPrefsValue() [2/2]

void SetPrefsValue ( Int32  id,
Int32  data,
DESCFLAGS_SET flags,
const PrefsMapTable table 
)
protected

Private.

◆ GetPrefsValue() [1/2]

void GetPrefsValue ( Int32  id,
GeData data,
DESCFLAGS_GET flags 
) const
protected

Private.

◆ GetPrefsValue() [2/2]

void GetPrefsValue ( Int32  id,
GeData data,
DESCFLAGS_GET flags,
const PrefsMapTable table 
) const
protected

Private.

◆ InitPrefsValue()

void InitPrefsValue ( Int32  id,
const GeData data,
Description desc,
const DescID descid,
BaseContainer pBC = nullptr 
)
protected

Initializes preference values in pBC.

Parameters
[in]idThe world container ID of the preference parameter.
[in]dataThe value used for the initialization.
[in]descThe description of the preference hook. If nullptr id is used instead of descid.
[in]descidThe description ID of the preference parameter.
[in,out]pBCThe preference world container.
Plugins should always store their parameter in a sub-container in the world-container.

◆ InitValues()

virtual Bool InitValues ( const DescID id,
Description description = nullptr 
)
protectedvirtual

Called to initialize preference parameters.

Parameters
[in]idThe description ID of the preference parameter.
[in,out]descriptionThe description of the preference hook. Can be nullptr.
Returns
true if successful, otherwise false.

◆ Register()

static BasePlugin* Register ( Int32  id,
DataAllocator allocfunc,
const String name,
const String description,
Int32  parentid,
Int32  sortid 
)
static

Registers a hook in the Cinema 4D preference dialog.

Parameters
[in]idA unique plugin ID. Must be obtained from http://www.plugincafe.com
[in]allocfuncThe allocator for the preference hook plugin. This is a pointer to a function that creates a new instance of PrefsDialogObject with NewObj().
[in]nameThe name of the preference hook.
[in]descriptionThe name of the description resource file to use for your plugin without .res extension, for example "Prefsnavigation".
The name has to be unique, i.e. "Prefsnavigation" cannot be used for two different descriptions. See Description Resource for more information.
[in]parentidThe hook ID of the parent category in the preferences tree or 0 to create a top-level category. The internal categories are: PREFS
[in]sortidA priority value to sort the category in the preferences tree. The higher the value, the higher the entry will be displayed in the preferences tree. The internal priority values are: PREFS_PRI
Returns
The registered plugin.

◆ GetMappedObject()

virtual GeListNode* GetMappedObject ( )
virtual

Private.