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
 
virtual Bool Message (GeListNode *node, Int32 type, void *data)
 
virtual void GetBubbleHelp (GeListNode *node, maxon::String &str)
 
virtual BaseDocumentGetDocument (GeListNode *node)
 
virtual Int32 GetBranchInfo (GeListNode *node, BranchInfo *info, Int32 max, GETBRANCHINFO flags)
 
virtual Bool IsInstanceOf (const GeListNode *node, Int32 type) const
 
virtual Bool IsDocumentRelated (const GeListNode *node, Bool &docrelated) const
 
virtual Bool Init (GeListNode *node)
 
virtual void Free (GeListNode *node)
 
virtual Bool Read (GeListNode *node, HyperFile *hf, Int32 level)
 
virtual Bool Write (GeListNode *node, HyperFile *hf)
 
virtual Bool CopyTo (NodeData *dest, GeListNode *snode, GeListNode *dnode, COPYFLAGS flags, AliasTrans *trn)
 
virtual Bool GetDDescription (GeListNode *node, Description *description, DESCFLAGS_DESC &flags)
 
virtual Bool GetDParameter (GeListNode *node, const DescID &id, GeData &t_data, DESCFLAGS_GET &flags)
 
virtual Bool SetDParameter (GeListNode *node, const DescID &id, const GeData &t_data, DESCFLAGS_SET &flags)
 
virtual Bool GetDEnabling (GeListNode *node, const DescID &id, const GeData &t_data, DESCFLAGS_ENABLE flags, const BaseContainer *itemdesc)
 
virtual Bool TranslateDescID (GeListNode *node, const DescID &id, DescID &res_id, C4DAtom *&res_at)
 
- Public Member Functions inherited from BaseData
 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)
 
void GetPrefsValue (Int32 id, GeData &data, DESCFLAGS_GET &flags, const PrefsMapTable *table)
 
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 
)
protected

Private.

◆ GetPrefsValue() [2/2]

void GetPrefsValue ( Int32  id,
GeData data,
DESCFLAGS_GET flags,
const PrefsMapTable table 
)
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.