Main Index : Reference :

GeUserDialog


Description

A user dialog class.

Definition

class GeUserDialog : GeBaseDialog
{
public:
  GeUserDialog();

  // Gadget functions
  [bool] AddArrowButton([int] id, [int] flags, [int] initw, [int] inith, 
                        [int] arrowtype);
  [bool] AddButton([int] id, [int] flags, [int] initw, [int] inith, [string] name);
  [bool] AddStaticText([int] id, [int] flags, [int] initw, [int] inith, 
                       [string] name, [int] borderstyle);

  [bool] AddCheckbox([int] id, [int] flags, [int] initw, [int] inith, 
                     [string] name);
  [bool] AddEditText([int] id, [int] flags, [int] initw, [int] inith);
  [bool] AddMultiLineEditText([int] id, [int] flags, [int] initw, 
                              [int] inith, [int] style);

  [bool] AddEditNumber([int] id, [int] flags, [int] initw, [int] inith);
  [bool] AddEditNumberArrows([int] id, [int] flags, [int] initw, [int] inith);
  [bool] AddSlider([int] id, [int] flags, [int] initw, [int] inith);
  [bool] AddEditSlider([int] id, [int] flags, [int] initw, [int] inith);

  [bool] AddColorField([int] id, [int] flags, [int] initw, [int] inith);
  [bool] AddColorChooser([int] id, [int] flags, [int] initw, [int] inith);

  [bool] AddRadioGroupV([int] id, [int] flags, [int] columns);
  [bool] AddRadioGroupH([int] id, [int] flags, [int] rows);
  [bool] AddComboBox([int] id, [int] flags, [int] initw, [int] inith);
  [bool] AddPopupButton([int] id, [int] flags, [int] initw, [int] inith);

  [bool] AddGroupBeginV([int] id, [int] flags, [int] columns, 
                        [string] title, [int] groupflags);
  [bool] AddGroupBeginH([int] id, [int] flags, [int] rows, 
                        [string] title, [int] groupflags);
  [bool] AddGroupEnd();
  [bool] AddGroupSpace([int] spacex, [int] spacey);
  [bool] AddGroupBorder([int] borderstyle);
  [bool] AddGroupBorderSpace([int] left, [int] top, [int] right, [int] bottom);

  [bool] AddTabGroupBegin([int] id, [int] flags, [int] tabtype);
  [bool] AddTabGroupEnd();
  
  [bool] AddScrollGroupBegin([int] id, [int] flags, [int] scrollflags);
  [bool] AddScrollGroupEnd();
  
  [bool] AddSeparatorH([int] initw);
  [bool] AddSeparatorV([int] inith);	

  [bool] AddUserArea([int] id, [int] flags, [int] initw, [int] inith);

  [bool] AddDlgGroup([int] type);
  
  // Menu functions
  [bool] MenuFlushAll();
  
  [bool] MenuSubBegin([string] string);
  [bool] MenuSubEnd();
  
  [bool] MenuAddCommand([int] cmdid);
  [bool] MenuAddString([int] id, [string] string);
  [bool] MenuAddSeparator();
  
  [bool] MenuFinished();
  
  [bool] MenuInitString([int] id, [bool] enabled, [bool] checked);
}

Explanation

The functions in this class can be used to add dialog elements and menus manually, if one does not wish to use dialog resources. (Currently there's no resource equivalent for menus.) For the most part there's a direct correspondence between these functions and the resource keywords. For this reason, this page will link to the Dialog Resource Syntax page whenever possible, instead of duplicating the descriptions there.

Most of the functions has a parameter flags that corresponds to the layout flags of the resource syntax. The following is a conversion table between the enums:

Resource flag C.O.F.F.E.E. flag
FIT_V BFV_FIT
FIT_H BFH_FIT
CENTER_V BFV_CENTER
CENTER_H BFH_CENTER
ALIGN_LEFT BFH_LEFT
ALIGN_RIGHT BFH_RIGHT
ALIGN_TOP BFV_TOP
ALIGN_BOTTOM BFV_BOTTOM
SCALE_H BFH_SCALE
SCALE_V BFV_SCALE

Likewise, the parameters initw and inith correspond to the SIZE keyword. The name parameter is a direct string, instead of a string id like the NAME keyword, but is otherwise just the same as its resource counterpart.

Members

AddArrowButton( id, flags, initw, inith, arrowtype )

[bool] AddArrowButton([int] id, [int] flags, [int] initw, [int] inith, 
                      [int] arrowtype);

Adds an arrow button to the layout. Returns TRUE if successful. For a description and an explanation of the options, please see ARROWBUTTON.

AddButton( id, flags, initw, inith, name )

[bool] AddButton([int] id, [int] flags, [int] initw, [int] inith, [string] name);

Adds a button to the layout. Returns TRUE if successful. For a description and an explanation of the options, please see BUTTON.

AddStaticText( id, flags, initw, inith, name, borderstyle )

[bool] AddStaticText([int] id, [int] flags, [int] initw, [int] inith, 
                     [string] name, [int] borderstyle);

Adds a static text field to the layout. Returns TRUE if successful. For a description and an explanation of the options, please see STATICTEXT.


AddCheckbox( id, flags, initw, inith, name )

[bool] AddCheckbox([int] id, [int] flags, [int] initw, [int] inith, 
                   [string] name);

Adds a check box to the layout. Returns TRUE if successful. For a description and an explanation of the options, please see CHECKBOX.

AddEditText( id, flags, initw, inith )

[bool] AddEditText([int] id, [int] flags, [int] initw, [int] inith);

Adds an editable text field to the layout. Returns TRUE if successful. For a description and an explanation of the options, please see EDITTEXT.

AddMultiLineEditText( id, flags, initw, inith, style )

[bool] AddMultiLineEditText([int] id, [int] flags, [int] initw, 
                            [int] inith, [int] style);

Adds an editable text field with several lines to the layout. Returns TRUE if successful. For a description and an explanation of the options, please see MULTILINEEDIT.

Note: Add DR_MULTILINE_ in front of the keywords in the resource description to get the correct style parameter enums, for example DR_MULTILINE_MONOSPACED.


AddEditNumber( id, flags, initw, inith )

[bool] AddEditNumber([int] id, [int] flags, [int] initw, [int] inith);

Adds an editable number field to the layout. Returns TRUE if successful. For a description and an explanation of the options, please see EDITNUMBER.

AddEditNumberArrows( id, flags, initw, inith )

[bool] AddEditNumberArrows([int] id, [int] flags, [int] initw, [int] inith);

Adds an editable number field with up/down arrows to the layout. Returns TRUE if successful. For a description and an explanation of the options, please see EDITNUMBERARROWS.

AddSlider( id, flags, initw, inith )

[bool] AddSlider([int] id, [int] flags, [int] initw, [int] inith);

Adds a slider to the layout. Returns TRUE if successful. For a description and an explanation of the options, please see SLIDER.

AddEditSlider( id, flags, initw, inith )

[bool] AddEditSlider([int] id, [int] flags, [int] initw, [int] inith);

Adds a slider with an editable number field to the layout. Returns TRUE if successful. For a description and an explanation of the options, please see EDITSLIDER.


AddColorField( id, flags, initw, inith )

[bool] AddColorField([int] id, [int] flags, [int] initw, [int] inith);

Adds a simple color field without sliders to the layout. Returns TRUE if successful. For a description and an explanation of the options, please see COLORFIELD (NOBRIGHTNESS and NOCOLOR are always on).

AddColorChooser( id, flags, initw, inith )

[bool] AddColorChooser([int] id, [int] flags, [int] initw, [int] inith);

Adds a color field with sliders to the layout. Returns TRUE if successful. For a description and an explanation of the options, please see COLORFIELD. The NOBRIGHTNESS and NOCOLOR flags are set with SetColorChooser().


AddRadioGroupV( id, flags, columns )

[bool] AddRadioGroupV([int] id, [int] flags, [int] columns);

Adds a vertically oriented radio group to the layout. Returns TRUE if successful. For a description and an explanation of the options, please see RADIOGROUP and GROUP. To add RADIOGADGETS to the radio group, use the AddItem() function.

AddRadioGroupH( id, flags, rows )

[bool] AddRadioGroupH([int] id, [int] flags, [int] rows);

Adds a horizontally oriented radio group to the layout. Returns TRUE if successful. For a description and an explanation of the options, please see RADIOGROUP and GROUP. To add RADIOGADGETS to the radio group, use the AddItem() function.

AddComboBox( id, flags, initw, inith )

[bool] AddComboBox([int] id, [int] flags, [int] initw, [int] inith);

Adds a combo box to the layout. Returns TRUE if successful. For a description and an explanation of the options, please see COMBOBOX. To add items to the combo box menu, use the AddItem() function.

AddPopupButton( id, flags, initw, inith )

[bool] AddPopupButton([int] id, [int] flags, [int] initw, [int] inith);

Adds a popup button to the layout. Returns TRUE if successful. For a description and an explanation of the options, please see POPUPBUTTON. To add menu items to the popup menu, use the AddItem() function.


AddGroupBeginV( id, flags, columns, title, groupflags )

[bool] AddGroupBeginV([int] id, [int] flags, [int] columns, 
                      [string] title, [int] groupflags);

Adds a vertically oriented group to the layout. Returns TRUE if successful. For a description and an explanation of the options, please see GROUP. The BORDERSTYLE, BORDERSIZE and SPACE flags are set with AddGroupBorder(), AddGroupBorderSpace() and AddGroupSpace(). After all group items have been added, the group must be closed with AddGroupEnd().

AddGroupBeginV(groupid, BFH_SCALEFIT, 2, "My Group", EQUAL_COLS);
{
  AddGroupBorder(BORDER_GROUP_IN);
  AddGroupBorderSpace(4, 4, 4, 4);
  AddGroupSpace(4, 4);
  
  Add*(); // Group items
  ...
}
AddGroupEnd();

AddGroupBeginH( id, flags, rows, title, groupflags )

[bool] AddGroupBeginH([int] id, [int] flags, [int] rows, 
                      [string] title, [int] groupflags);

Adds a horizontally oriented group to the layout. Returns TRUE if successful. For a description and an explanation of the options, please see GROUP. See also AddGroupBeginV()

AddGroupEnd()

[bool] AddGroupEnd();

Used to close groups added with AddGroupBeginH() or AddGroupBeginV(). Returns TRUE if successful.

AddGroupSpace( spacex, spacey )

[bool] AddGroupSpace([int] spacex, [int] spacey);

Sets the space in pixels between two elements in the current group. Returns TRUE if successful.

AddGroupBorder( borderstyle )

[bool] AddGroupBorder([int] borderstyle);

Sets the border type of the current group. Returns TRUE if successful. See GROUP for the possible types.

AddGroupBorderSpace( left, top, right, bottom )

[bool] AddGroupBorderSpace([int] left, [int] top, [int] right, [int] bottom);

Sets the border size around the current group in pixels. Returns TRUE if successful.


AddTabGroupBegin( id, flags, tabtype )

[bool] AddTabGroupBegin([int] id, [int] flags, [int] tabtype);

Adds a tab group to the layout. Returns TRUE if successful. For a description and an explanation of the options, please see TAB. After all internal groups have been added, the tab group must be closed with AddTabGroupEnd().

Please use the following enums for the tabtype parameter:

Type Explanation
TAB_NOSELECT No tabs
TAB_TABS Normal tabs
TAB_CYCLE Popup button instead of tabs
TAB_RADIO Radio buttons instead of tabs

AddTabGroupEnd()

[bool] AddTadgroupEnd();

Used to close tab groups added with AddTabGroupBegin(). Returns TRUE if successful.


AddScrollGroupBegin( id, flags, scrollflags )

[bool] AddScrollGroupBegin([int] id, [int] flags, [int] scrollflags);

Adds a scroll group to the layout. Returns TRUE if successful. For a description and an explanation of the options, please see SCROLLGROUP. After the internal group and all its elements have been added, the scroll group must be closed with AddScrollGroupEnd().

AddScrollGroupEnd()

[bool] AddScrollGroupEnd();

Used to close scroll groups added with AddScrollGroupBegin(). Returns TRUE if successful.


AddSeparatorH( initw )

[bool] AddSeparatorH([int] initw);

Adds a horizontal separator to the layout. Returns TRUE if successful. For a description, please see SEPARATOR.

AddSeparatorV( inith )

[bool] AddSeparatorV([int] inith);

Adds a vertical separator to the layout. Returns TRUE if successful. For a description, please see SEPARATOR.


AddUserArea( id, flags, initw, inith )

[bool] AddUserArea([int] id, [int] flags, [int] initw, [int] inith);

Adds a user area to the layout. Returns TRUE if successful. For a description and an explanation of the options, please see USERAREA.


AddDlgGroup( type )

[bool] AddDlgGroup([int] type);

Adds a dialog button group to the layout. Returns TRUE if successful. For a description and an explanation of the options, please see DLGGROUP.

Note: Add DR_DLGGROUP_ in front of the keywords in the resource description to get the correct type parameter enums, for example DR_DLGGROUP_OK.


MenuFlushAll()

[bool] MenuFlushAll();

Clears the menu bar. Call this before adding menus. Returns TRUE if successful.


MenuSubBegin( string )

[bool] MenuSubBegin([string] string);

Starts a new menu group with the name string. At the top level this will be a menu, otherwise it's a sub-menu. Returns TRUE if successful.

MenuSubEnd()

[bool] MenuSubEnd();

Ends the current menu group. Returns TRUE if successful.


MenuAddCommand( cmdid )

[bool] MenuAddCommand([int] cmdid);

Adds an existing command to the current menu group. The cmdid parameter should be a registered id, either one from c4d_commands.res or a registered plugin id. Returns TRUE if successful.

MenuAddString( id, string )

[bool] MenuAddString([int] id, [string] string);

Adds an entry to the current menu group with the name string and the id id. Returns TRUE if successful.

MenuAddSeparator()

[bool] MenuAddSeparator();

Adds a separator to the current menu group. Returns TRUE if successful.


MenuFinished()

[bool] MenuFinished();

Call this function after all menus have been added. Returns TRUE if successful.


MenuInitString( id, enabled, checked )

[bool] MenuInitString([int] id, [bool] enabled, [bool] checked);

Sets the enabled/disabled and checkmark state of a menu entry. Returns TRUE if successful.