iCustomGui Class Reference

#include <c4d_gui.h>

Inheritance diagram for iCustomGui:

Detailed Description

Base class for custom GUIs.

See also
CustomGuiData.

Public Member Functions

 iCustomGui (const BaseContainer &settings, CUSTOMGUIPLUGIN *t_plugin)
 
virtual Int32 Message (const BaseContainer &msg, BaseContainer &result)
 
virtual Int32 CustomGuiWidth ()
 
virtual Int32 CustomGuiHeight ()
 
virtual void CustomGuiRedraw ()
 
virtual Bool CustomGuiLayoutChanged ()
 
virtual Bool CustomGuiActivate ()
 
virtual Bool SetDefaultForResEdit ()
 
virtual Bool SetData (const TriState< GeData > &tristate)
 
virtual TriState< GeDataGetData ()
 
virtual Bool SupportLayoutSwitch ()
 
virtual void LayoutModeChanged ()
 
virtual void SetLayoutMode (Int32 mode)
 
virtual Int32 GetLayoutMode ()
 
Int32 GetEditHeight ()
 
CUSTOMGUIPLUGIN * GetPlugin ()
 
- Public Member Functions inherited from SubDialog
 SubDialog (void)
 
virtual ~SubDialog (void)
 
- Public Member Functions inherited from GeDialog
Bool SetColorField (const GadgetPtr &id, const TriState< Vector > &tri, Float brightness, Float maxbrightness, Int32 flags)
 
 GeDialog (void)
 
virtual ~GeDialog (void)
 
CDialog * Get ()
 
virtual Bool CreateLayout (void)
 
virtual Bool InitValues (void)
 
virtual Bool CoreMessage (Int32 id, const BaseContainer &msg)
 
virtual Bool Command (Int32 id, const BaseContainer &msg)
 
virtual Bool AskClose (void)
 
virtual void Timer (const BaseContainer &msg)
 
virtual void DestroyWindow (void)
 
Bool Open (DLG_TYPE dlgtype, Int32 pluginid, Int32 xpos=-1, Int32 ypos=-1, Int32 defaultw=0, Int32 defaulth=0, Int32 subid=0)
 
Bool Close (void)
 
Bool Close (Bool dummy)
 
GeData SendMessage (const GadgetPtr &id, const BaseContainer &msg)
 
Bool SendParentMessage (const BaseContainer &msg, Bool receiveSelf=false)
 
Int32 GetId (void)
 
Bool IsOpen ()
 
Bool IsVisible ()
 
void SetTimer (Int32 timer)
 
void SetTitle (const maxon::String &title)
 
Bool Enable (const GadgetPtr &id, Bool enabled)
 
Bool IsEnabled (const GadgetPtr &id)
 
Bool GetInputState (Int32 askdevice, Int32 askchannel, BaseContainer &res)
 
Bool GetInputEvent (Int32 askdevice, BaseContainer &res)
 
void KillEvents (void)
 
Bool SetBool (const GadgetPtr &id, Int32 value, Int32 tristate=0)
 
Bool SetInt32 (const GadgetPtr &id, Int32 value, Int32 min=LIMIT< Int32 >::MIN, Int32 max=LIMIT< Int32 >::MAX, Int32 step=1, Int32 tristate=0, Int32 min2=LIMIT< Int32 >::MIN, Int32 max2=LIMIT< Int32 >::MAX)
 
Bool SetFloat (const GadgetPtr &id, Float value, Float min=(-1.0e18), Float max=(1.0e18), Float step=1.0, Int32 format=FORMAT_FLOAT, Float min2=0.0, Float max2=0.0, Bool quadscale=false, Int32 tristate=0)
 
Bool SetMeter (const GadgetPtr &id, Float value, Float min=(-1.0e18), Float max=(1.0e18), Float step=1.0, Int32 tristate=0)
 
Bool SetDegree (const GadgetPtr &id, Float radians_value, Float min=(-1.0e18), Float max=(1.0e18), Float step=1.0, Int32 tristate=0)
 
Bool SetPercent (const GadgetPtr &id, Float value, Float min=0.0, Float max=100.0, Float step=1.0, Int32 tristate=0)
 
Bool SetTime (const GadgetPtr &id, const BaseDocument *doc, const BaseTime &value, const BaseTime &min=BaseTime(- 108000, 1), const BaseTime &max=BaseTime(108000, 1), Int32 stepframes=1, Int32 tristate=0)
 
Bool SetString (const GadgetPtr &id, const maxon::String &text, Int32 tristate=0, Int32 flags=0)
 
Bool SetColorField (const GadgetPtr &id, const Vector &color, Float brightness, Float maxbrightness, Int32 flags)
 
Bool SetFilename (const GadgetPtr &id, const Filename &fn, Int32 tristate=0)
 
Bool GetBool (const GadgetPtr &id, Bool &value) const
 
Bool GetInt32 (const GadgetPtr &id, Int32 &value) const
 
Bool GetFloat (const GadgetPtr &id, Float &value) const
 
Bool GetVector (const GadgetPtr &id_x, const GadgetPtr &id_y, const GadgetPtr &id_z, Vector &value) const
 
Bool GetString (const GadgetPtr &id, maxon::String &text) const
 
Bool GetColorField (const GadgetPtr &id, Vector &color, Float &brightness) const
 
Bool GetTime (const GadgetPtr &id, const BaseDocument *doc, BaseTime &time) const
 
Bool GetFilename (const GadgetPtr &id, Filename &fn) const
 
Bool CheckTristateChange (const GadgetPtr &id)
 
Bool SetBool (const GadgetPtr &id, const BaseContainer *bc, Int32 bcid)
 
Bool SetInt32 (const GadgetPtr &id, const BaseContainer *bc, Int32 bcid, Int32 min=LIMIT< Int32 >::MIN, Int32 max=LIMIT< Int32 >::MAX, Int32 step=1, Int32 min2=LIMIT< Int32 >::MIN, Int32 max2=LIMIT< Int32 >::MAX)
 
Bool SetFloat (const GadgetPtr &id, const BaseContainer *bc, Int32 bcid, Float min=(-1.0e18), Float max=(1.0e18), Float step=1.0, Int32 format=FORMAT_FLOAT, Float min2=0.0, Float max2=0.0, Bool quadscale=false)
 
Bool SetMeter (const GadgetPtr &id, const BaseContainer *bc, Int32 bcid, Float min=(-1.0e18), Float max=(1.0e18), Float step=1.0)
 
Bool SetDegree (const GadgetPtr &id, const BaseContainer *bc, Int32 bcid, Float min=(-1.0e18), Float max=(1.0e18), Float step=1.0)
 
Bool SetPercent (const GadgetPtr &id, const BaseContainer *bc, Int32 bcid, Float min=0.0, Float max=100.0, Float step=1.0)
 
Bool SetTime (const GadgetPtr &id, const BaseDocument *doc, const BaseContainer *bc, Int32 bcid, const BaseTime &min=BaseTime(- 108000, 1), const BaseTime &max=BaseTime(108000, 1), Int32 stepframes=1)
 
Bool SetString (const GadgetPtr &id, const BaseContainer *bc, Int32 bcid, Int32 flags=0)
 
Bool SetFilename (const GadgetPtr &id, const BaseContainer *bc, Int32 bcid)
 
Bool SetColorField (const GadgetPtr &id, const BaseContainer *bc, Int32 bc_colid, Int32 bc_brightnessid, Float maxbrightness, Int32 flags)
 
Bool GetBool (const GadgetPtr &id, BaseContainer *bc, Int32 bcid) const
 
Bool GetInt32 (const GadgetPtr &id, BaseContainer *bc, Int32 bcid) const
 
Bool GetFloat (const GadgetPtr &id, BaseContainer *bc, Int32 bcid) const
 
Bool GetTime (const GadgetPtr &id, const BaseDocument *doc, BaseContainer *bc, Int32 bcid) const
 
Bool GetVector (const GadgetPtr &id_x, const GadgetPtr &id_y, const GadgetPtr &id_z, BaseContainer *bc, Int32 bcid) const
 
Bool GetString (const GadgetPtr &id, BaseContainer *bc, Int32 bcid) const
 
Bool GetFilename (const GadgetPtr &id, BaseContainer *bc, Int32 bcid) const
 
Bool GetColorField (const GadgetPtr &id, BaseContainer *bc, Int32 bc_colid, Int32 bc_brightnessid) const
 
Bool SetBool (const GadgetPtr &id, const TriState< Bool > &tri)
 
Bool SetInt32 (const GadgetPtr &id, const TriState< Int32 > &tri, Int32 min=LIMIT< Int32 >::MIN, Int32 max=LIMIT< Int32 >::MAX, Int32 step=1, Int32 min2=LIMIT< Int32 >::MIN, Int32 max2=LIMIT< Int32 >::MAX)
 
Bool SetFloat (const GadgetPtr &id, const TriState< Float > &tri, Float min=(-1.0e18), Float max=(1.0e18), Float step=1.0, Int32 format=FORMAT_FLOAT, Float min2=0.0, Float max2=0.0, Bool quadscale=false)
 
Bool SetMeter (const GadgetPtr &id, const TriState< Float > &tri, Float min=(-1.0e18), Float max=(1.0e18), Float step=1.0)
 
Bool SetDegree (const GadgetPtr &id, const TriState< Float > &tri, Float min=(-1.0e18), Float max=(1.0e18), Float step=1.0)
 
Bool SetPercent (const GadgetPtr &id, const TriState< Float > &tri, Float min=0.0, Float max=100.0, Float step=1.0)
 
Bool SetTime (const GadgetPtr &id, const BaseDocument *doc, const TriState< BaseTime > &tri, const BaseTime &min=BaseTime(- 108000, 1), const BaseTime &max=BaseTime(108000, 1), Int32 stepframes=1)
 
Bool SetString (const GadgetPtr &id, const TriState< String > &tri, Int32 flags=0)
 
Bool Local2Global (Int32 *x, Int32 *y)
 
Bool Global2Local (Int32 *x, Int32 *y)
 
Bool Screen2Local (Int32 *x, Int32 *y)
 
Bool Local2Screen (Int32 *x, Int32 *y)
 
Bool GetColorRGB (Int32 colorid, Int32 &r, Int32 &g, Int32 &b)
 
void SetDefaultColor (const GadgetPtr &id, Int32 colorid, Int32 mapid)
 
void SetDefaultColor (const GadgetPtr &id, Int32 colorid, const Vector &color)
 
Bool LoadDialogResource (Int32 id, GeResource *lr, Int32 flags)
 
C4DGadgetAddCheckbox (Int32 id, Int32 flags, Int32 initw, Int32 inith, const maxon::String &name)
 
C4DGadgetAddButton (Int32 id, Int32 flags, Int32 initw, Int32 inith, const maxon::String &name)
 
C4DGadgetAddStaticText (Int32 id, Int32 flags, Int32 initw, Int32 inith, const maxon::String &name, Int32 borderstyle)
 
C4DGadgetAddArrowButton (Int32 id, Int32 flags, Int32 initw, Int32 inith, Int32 arrowtype)
 
C4DGadgetAddEditText (Int32 id, Int32 flags, Int32 initw=0, Int32 inith=0, Int32 editflags=0)
 
C4DGadgetAddMultiLineEditText (Int32 id, Int32 flags, Int32 initw=0, Int32 inith=0, Int32 style=0)
 
C4DGadgetAddEditNumber (Int32 id, Int32 flags, Int32 initw=80, Int32 inith=0)
 
C4DGadgetAddEditNumberArrows (Int32 id, Int32 flags, Int32 initw=70, Int32 inith=0)
 
C4DGadgetAddEditSlider (Int32 id, Int32 flags, Int32 initw=80, Int32 inith=0)
 
C4DGadgetAddSlider (Int32 id, Int32 flags, Int32 initw=90, Int32 inith=0)
 
C4DGadgetAddColorField (Int32 id, Int32 flags, Int32 initw=0, Int32 inith=0, Int32 colorflags=0)
 
C4DGadgetAddColorChooser (Int32 id, Int32 flags, Int32 initw=0, Int32 inith=0, Int32 layoutflags=0, const BaseContainer &settings=BaseContainer())
 
C4DGadgetAddRadioButton (Int32 id, Int32 flags, Int32 initw, Int32 inith, const maxon::String &name)
 
C4DGadgetAddRadioText (Int32 id, Int32 flags, Int32 initw, Int32 inith, const maxon::String &name)
 
C4DGadgetAddEditShortcut (Int32 id, Int32 flags, Int32 initw=0, Int32 inith=0, Int32 shortcutflags=0)
 
C4DGadgetAddSeparatorH (Int32 initw, Int32 flags=BFH_FIT)
 
C4DGadgetAddSeparatorV (Int32 inith, Int32 flags=BFV_FIT)
 
Bool AddRadioGroup (Int32 id, Int32 flags, Int32 columns=1, Int32 rows=0)
 
C4DGadgetAddComboBox (Int32 id, Int32 flags, Int32 initw=0, Int32 inith=0, Bool specialalign=false, Bool allowFiltering=false)
 
C4DGadgetAddComboButton (Int32 id, Int32 flags, Int32 initw=0, Int32 inith=0, Bool specialalign=false, Bool allowFiltering=false)
 
C4DGadgetAddPopupButton (Int32 id, Int32 flags, Int32 initw=0, Int32 inith=0, Bool allowFiltering=false)
 
Bool AddListView (Int32 id, Int32 flags, Int32 initw=0, Int32 inith=0)
 
Bool LayoutChanged (const GadgetPtr &id)
 
Bool LayoutChangedNoRedraw (const GadgetPtr &id)
 
Bool Activate (const GadgetPtr &id)
 
Bool IsActive (const GadgetPtr &id)
 
UpdateDialogHelper BeginLayoutChange (const GadgetPtr &gadget, Bool disableRedraws)
 
Bool LayoutFlushGroup (const GadgetPtr &id)
 
Bool LayoutFlushDisableRedraw (const GadgetPtr &id, Bool disable)
 
Bool RemoveElement (const GadgetPtr &id)
 
Bool HideElement (const GadgetPtr &id, Bool hide)
 
Bool RestoreLayout (Int32 pluginid, Int32 subid, void *secret)
 
Bool AddChild (const GadgetPtr &id, Int32 subid, const maxon::String &child)
 
Bool FreeChildren (const GadgetPtr &id)
 
Bool SetPopup (const GadgetPtr &id, const BaseContainer &bc)
 
Bool AddChildren (const GadgetPtr &id, const BaseContainer &bc)
 
C4DGadgetAddUserArea (Int32 id, Int32 flags, Int32 initw=0, Int32 inith=0)
 
Bool AttachUserArea (GeUserArea &ua, const GadgetPtr &id, USERAREAFLAGS userareaflags=USERAREAFLAGS::COREMESSAGE)
 
Bool AddSubDialog (Int32 id, Int32 flags, Int32 initw=0, Int32 inith=0)
 
Bool AttachSubDialog (SubDialog *userdlg, Int32 id)
 
Bool AddDlgGroup (Int32 type)
 
Bool GroupBeginInMenuLine ()
 
Bool TabGroupBegin (Int32 id, Int32 flags, Int32 tabtype=TAB_TABS)
 
Bool GroupBegin (Int32 id, Int32 flags, Int32 cols, Int32 rows, const maxon::String &title, Int32 groupflags, Int32 initw=0, Int32 inith=0)
 
Bool GroupEnd (void)
 
Bool GroupSpace (Int32 spacex, Int32 spacey)
 
Bool GroupBorder (UInt32 borderstyle)
 
Bool GroupBorderNoTitle (UInt32 borderstyle)
 
Bool GroupBorderSpace (Int32 left, Int32 top, Int32 right, Int32 bottom)
 
Bool GroupWeightsSave (const GadgetPtr &id, BaseContainer &weights)
 
Bool GroupWeightsLoad (const GadgetPtr &id, const BaseContainer &weights)
 
Bool GetItemDim (const GadgetPtr &id, Int32 *x, Int32 *y, Int32 *w, Int32 *h) const
 
Bool GetDragPosition (const BaseContainer &msg, Int32 *x, Int32 *y)
 
Bool GetDragObject (const BaseContainer &msg, Int32 *type, void **object)
 
Bool SetDragDestination (Int32 cursor, Int32 gadgetid=0)
 
Bool CheckDropArea (const GadgetPtr &id, const BaseContainer &msg, Bool horiz, Bool vert)
 
Bool GetVisibleArea (Int32 scrollgroupid, Int32 *x1, Int32 *y1, Int32 *x2, Int32 *y2)
 
Bool SetVisibleArea (Int32 scrollgroupid, Int32 x1, Int32 y1, Int32 x2, Int32 y2)
 
Bool ScrollGroupBegin (Int32 id, Int32 flags, Int32 scrollflags, Int32 initw=0, Int32 inith=0)
 
Bool MenuFlushAll (void)
 
Bool MenuSubBegin (const maxon::String &string)
 
Bool MenuSubEnd (void)
 
Bool MenuAddCommand (Int32 cmdid)
 
Bool MenuAddString (Int32 id, const maxon::String &string)
 
Bool MenuAddSeparator (void)
 
Bool MenuFinished (void)
 
Bool MenuInitString (Int32 id, Bool enabled, Bool checked)
 
Bool MenuSetResource (Int32 id)
 
void * FindCustomGui (Int32 id, Int32 pluginid)
 
void * AddCustomGui (Int32 id, Int32 pluginid, const maxon::String &name, Int32 flags, Int32 minw, Int32 minh, const BaseContainer &customdata)
 
Bool SetMultiLineMode (const GadgetPtr &id, SCRIPTMODE mode)
 
Bool SetMultiLineLock (const GadgetPtr &id, Bool lock)
 
Bool SetMultiLinePos (const GadgetPtr &id, Int32 line, Int32 pos)
 
Bool CheckClose (void)
 
Bool CheckValueRanges (void)
 
Float GetPixelRatio () const
 
Bool ReleaseLink ()
 
Bool CheckCoreMessage (const BaseContainer &msg, Int32 *ownlastcoremsg=nullptr)
 
void * GetWindowHandle ()
 

Private Attributes

Int32 layoutmode
 
Int32 editheight
 
CUSTOMGUIPLUGIN * plugin
 

Additional Inherited Members

- Static Public Member Functions inherited from GeDialog
static void HandleHelpString (const BaseContainer &msg, BaseContainer &result, const maxon::String &sym)
 
- Protected Attributes inherited from GeDialog
Bool createlayout
 

Constructor & Destructor Documentation

◆ iCustomGui()

iCustomGui ( const BaseContainer settings,
CUSTOMGUIPLUGIN *  t_plugin 
)

Constructor.

Note
Usually only called from CustomGuiData::Alloc().
Parameters
[in]settingsThe settings container.
[in]t_pluginThe plugin structure.

Member Function Documentation

◆ Message()

virtual Int32 Message ( const BaseContainer msg,
BaseContainer result 
)
virtual

Called when a message is received.
Override this function to react to special messages. Normally this is not necessary.

Note
If overriden, include a call to the base version of this function, iCustomGui::Message().
See also
The article GUI Messages for more information.
Parameters
[in]msgThe message container.
[in]resultA container to place results in.
Returns
Depends on the message.

Reimplemented from SubDialog.

◆ CustomGuiWidth()

virtual Int32 CustomGuiWidth ( )
virtual

Retrieves the preferred width of the custom GUI.

Returns
The preferred width in pixels.

◆ CustomGuiHeight()

virtual Int32 CustomGuiHeight ( )
virtual

Retrieves the preferred height of the custom GUI.

Returns
The preferred height in pixels.

◆ CustomGuiRedraw()

virtual void CustomGuiRedraw ( )
virtual

Called when the GUI is redrawn. Use this for instance to update the user areas.

◆ CustomGuiLayoutChanged()

virtual Bool CustomGuiLayoutChanged ( )
virtual

Never called.

◆ CustomGuiActivate()

virtual Bool CustomGuiActivate ( )
virtual

Private.

◆ SetDefaultForResEdit()

virtual Bool SetDefaultForResEdit ( )
virtual

Called when the GUI is default constructed in ResEdit. Initialize the custom GUI with default values.

Returns
true if successful, otherwise false.

◆ SetData()

virtual Bool SetData ( const TriState< GeData > &  tristate)
virtual

Called to update the custom GUI to display the value in tristate.

Note
Remember to check for tri state, i.e. when more than one value is to be shown.
Parameters
[in]tristateThe new value to display.
Returns
true if successful, otherwise false.

◆ GetData()

virtual TriState<GeData> GetData ( )
virtual

Called to retrieve the value(s) currently displayed.

Returns
The currently displayed value(s).

◆ SupportLayoutSwitch()

virtual Bool SupportLayoutSwitch ( )
virtual

Called to check if the custom GUI supports the minimized/maximized switch.
Normally it is not needed to override this function.

Returns
true if the custom GUI supports layout switch, otherwise false.

◆ LayoutModeChanged()

virtual void LayoutModeChanged ( )
virtual

Called when the minimized/maximized state has changed. Use GetLayoutMode() to retrieve the current mode.

◆ SetLayoutMode()

virtual void SetLayoutMode ( Int32  mode)
virtual

Sets the current layout mode.
Normally it is not needed to override this function.

Parameters
[in]modeThe new layout mode: LAYOUTMODE

◆ GetLayoutMode()

virtual Int32 GetLayoutMode ( )
virtual

Gets the current layout mode.
Normally it is not needed to override this function.

Returns
The layout mode: LAYOUTMODE

◆ GetEditHeight()

Int32 GetEditHeight ( )

Retrieves the edit height of the custom GUI. (Set by CUSTOMGUI_DEFAULTEDITHEIGHT in the settings container passed to the constructor.)

Returns
The edit height.

◆ GetPlugin()

CUSTOMGUIPLUGIN* GetPlugin ( )

Retrieves the custom GUI plugin structure passed to the constructor.

Returns
The plugin structure.

Member Data Documentation

◆ layoutmode

Int32 layoutmode
private

◆ editheight

Int32 editheight
private

◆ plugin

CUSTOMGUIPLUGIN* plugin
private