#include <c4d_customguidata.h>
A data class for creating custom GUIs for data types. These can be used in descriptions for the Attribute Manager.
Use RegisterCustomGuiPlugin() to register the custom GUI plugin.
- Note
- Even if a library is not created it is needed to call InstallLibrary() for a dummy library during registration:
Bool RegisterExampleDataTypeGui()
{
static BaseCustomGuiLib mylib;
return false;
}
Bool RegisterCustomGuiPlugin(const maxon::String &str, Int32 info, CustomGuiData *dat)
Bool InstallLibrary(Int32 id, C4DLibrary *lib, Int32 version, Int32 size)
void ClearMem(void *d, Int size, Int32 value=0)
Definition: c4d_memory.h:53
void FillBaseCustomGui(BaseCustomGuiLib &lib)
maxon::Bool Bool
Definition: ge_sys_math.h:51
#define NewObj(T,...)
Definition: newobj.h:108
◆ GetId()
◆ Alloc()
Called to allocate a sub-dialog for the custom GUI.
Normally this method override should look like this:
{
if (!dlg)
return nullptr;
CDialog *cdlg = dlg->Get();
if (!cdlg)
return nullptr;
return cdlg;
}
Definition: c4d_basecontainer.h:48
CUSTOMGUIPLUGIN * GetPlugin()
virtual CDialog * Alloc(const BaseContainer &settings)=0
In the above code T
stands for a type derived from iCustomGui.
- Parameters
-
[in] | settings | The settings for the GUI. (Using the IDs defined by GetProperties().) |
- Returns
- The allocated sub-dialog.
◆ Free()
virtual void Free |
( |
CDialog * |
dlg, |
|
|
void * |
userdata |
|
) |
| |
|
pure virtual |
Called to free sub-dialogs allocated by Alloc().
Normally this method override should look like this:
virtual void Free(CDialog *dlg,
void *userdata)
{
if (!dlg || !userdata)
return;
T* sub = static_cast<T*>(userdata);
}
virtual void Free(CDialog *dlg, void *userdata)=0
#define DeleteObj(obj)
Definition: newobj.h:159
In the above code T
stands for a type derived from iCustomGui.
- Parameters
-
[in,out] | dlg | The sub-dialog to free. |
[in] | userdata | The user data. |
◆ GetResourceSym()
virtual const Char* GetResourceSym |
( |
| ) |
|
|
pure virtual |
Called to get the symbol to use in resource files, for example "GRADIENT".
- Note
- Only 7-bit ASCII characters are allowed, hence the Char type.
- Returns
- A pointer to a global
const Char*
string with the resource symbol.
◆ GetProperties()
Called to get the properties that the custom GUI accepts in resource files.
- See also
- CustomProperty.
- Returns
- A pointer to a global array of CustomProperty elements, ended with a CUSTOMTYPE::END property:
{
};
#define BITMAPBUTTON_BUTTON
Definition: customgui_bitmapbutton.h:35
#define BITMAPBUTTON_BORDER
Definition: customgui_bitmapbutton.h:33
@ FLAG
Bool data. (Either the property is there or not.)
Definition: c4d_customguidata.h:114
◆ GetResourceDataType()
virtual Int32 GetResourceDataType |
( |
Int32 *& |
table | ) |
|
|
virtual |
Called to return the IDs of compatible data types for the custom GUI.
- See also
- CustomDataTypeClass::GetConversionsFrom.
- Parameters
-
[out] | table | Set this to point to a global array with the IDs of compatible data types for the custom GUI. |
- Returns
- The length of the array pointed by table, or 0 if table has not been set.
◆ GetPlugin()
CUSTOMGUIPLUGIN* GetPlugin |
( |
| ) |
|
Gets the plugin structure for the custom GUI.
- Returns
- The custom GUI plugin structure. Cinema 4D owns the pointed plugin structure.