Please enable JavaScript to view this site.

R:BASE 11 Help

Navigation: Command Index > C

CREATEOBJECT

Scroll Prev Top Next More

Use the CREATEOBJECT command to create dynamic form objects on demand.

 

CREATEOBJECT

 

 

Options

 

ComponentID

The unique identifier that you assign to the component when you insert the object.

 

Height

The Height coordinate for the control

 

Left

The Left coordinate for the control, in relation to the left side of its parent

 

ControlType

The form control, or object type. The actual name of the Control Type that must be used in the CREATEOBJECT syntax are available from the Data Dictionary, and are listed as follows by Form Control category:

 

Standard Controls

StaticText

Button

EnhancedPanel

EnhancedGroupBox

 

Database Controls

DBText

DBEdit

DBMemo

DBWebBrowser

DBMailLabel

DBImage

DBCheckBox

DBRadioButton

DBRadioGroup

DBLookUpComboBox

DBLookUpListBox

DBSpinEdit

DBUserComboBox

DBUserListBox

DBTreeView

DBLookUpListView

ScrollingRegion

EnhancedDBNavigator

EnhancedDBGrid

DBSlider

AdvancedDBRichText

DBTimePicker

EnhancedDBCalendar

DBSpinner

DBTreeGrid

DBTaskTracker

DBDateAndTimeEdit

DBOrgChart

DBGauge

DBTreeList

DBCardView

DBVerticalGrid

DBPivotGrid

 

Variable Controls

VarLabel

VarEdit

VarMemo

VarWebBrowser

VarEMailLabel

VarImage

VarCheckBox

VarRadioButton

VarRadioButtonGroup

VarLookUpComboBox

VarLookUpListBox

VarSpinEdit

VarUserComboBox

VarUserListBox

VarLookUpListView

SystemVariable

VarTimePicker

EnhancedVarCalendar

VarSpinner

VarAdvancedRichEdit

VarGauge

VarDateTimePicker

 

Additional Controls

BitBtn

SpeedButton

DropDownButton

Image

Bevel

LedDisplay

TimeLedLabel

TreeView

ListView

GroupBar

Group

EnhancedTabControl

EnhancedTabSheet

EnhancedSpeedButton

StatusBar

ClockStatus

KeyStatus

StatusPane

GlyphStatus

MarqueeStatus

DBStateStatus

DBStatus

CurrentTablePane

CurrentFieldPane

PDFViewer

TabSet

LinkLabel

TimePicker

EnhancedCalendar

CollapsePanel

CountDownTimer

LayoutManager

SplitView

TileMenu

 

Internet Controls

WebBrowser

MailLabel

 

File System Controls

DirTree

FileBox

 

Legacy Controls

VerticalLine

HorizontalLine

3DBox

Panel

GroupBox

Wallpaper

EnhancedWallpaper

UnicodeLabel

OfficeButton

GIFImage

Shape

Animate

Splitter

TabControl

TabSheet

Clock

ShapeButton

Meter

Separator

Line

DBGrid

DBNavigator

DBRichEdit

DBDateTimePicker

DBCalendar

DB Unicode Memo

VarDateTimePicker

VarCalendar

VarUnicodeMemo

VarRichEdit

 

ParentControl

The form object in which other controls are contained within. A parent control can be an actual form or any of the following form controls: Panel, Enhanced Panel, Group Box, Enhanced Group Box, Tab Control, Enhanced Tab Control, Status Bar, DB Radio Button Group, Variable Radio Button Group, Scrolling Region, etc.

 

Top

The Top coordinate for the control, in relation to the top of its parent

 

Width

The Width coordinate for the control

 

About the CREATEOBJECT Command

 

Any form object can be created at runtime, simply by knowing the exact Control Type, Component ID, parent (form or any control having the option of a container, and coordinates (Left, Top, Width, Height).

 

To place Database Control objects, you'll need to provide additional parameters, such as, Table Name, Field Name. For Variable Objects, you'll need to provide associated variable name. And, once the object is defined, it is required to initialize the object in order for the object to be placed on the form. All of the definitions for the newly created object are performed using the PROPERTY Command.

 

Use the Data Dictionary to browse the list of form Control Type and to easily insert the values into your command files/applications.

 

Order of Processing To Create an Object

 

The order of processing for the CREATEOBJECT command is as follows:

 

1.Use the CREATEOBJECT command to create the object.

2.For Database or Variable controls, use the PROPERTY command to assign the database field or Variable name.

3.When inserting Custom EEPs, use the PROPERTY command to assign the Custom EEP command syntax.

4.Use the PROPERTY ComponentID INIT 'TRUE' command to initialize the object.

5.Use the PROPERTY command to set any additional characteristics, like color, font, background, etc., that would be specific to the type of object you are creating.

 

Notes:

 

A form must include the associated Master table, unless a variable form is being created.

Any additional form related tables MUST be defined using the form designer.

To delete an object on the fly, use the DELETEOBJECT command.

 

Examples

 

-- Place a text caption for the field (ObjectType: StaticText)

CREATEOBJECT StaticText 'StaticText1' 'RBASE_FORM' 10 10 400 20

PROPERTY StaticText1 INIT TRUE

PROPERTY StaticText1 CAPTION 'Dynamically Created DB Controls'

 

-- Place a Panel on the Form (ObjectType: Panel)

CREATEOBJECT Panel 'Panel' 'RBASE_FORM' 10 40 400 120

PROPERTY Panel INIT TRUE

 

-- DB Edit Control Based on Table: Customer, Column: CustAddress

CREATEOBJECT DBEdit 'DBEdit2' 'Panel' 100 35 220 20

PROPERTY DBEdit2 TblName 'Customer'

PROPERTY DBEdit2 FldName 'CustAddress'

PROPERTY DBEdit2 INIT TRUE

PROPERTY DBEdit2 FRAMEVISIBLE TRUE

 

-- Place a DB Navigator Control Based on Table: Customer

CREATEOBJECT DBNavigator 'Navigator' 'Panel' 100 90 200 20

PROPERTY Navigator TblName 'Customer'

PROPERTY Navigator INIT TRUE

PROPERTY Navigator IMAGESTYLE 'Razzmatazz'

PROPERTY Navigator FLAT TRUE

 

-- To insert Custom EEP command syntax into the "DBEdit2" Control defined above

-- PROPERTY ComponentID 'Custom_EEP->YourCustomEEP' 'YourCustomEEPText'

CLEAR VAR vCommand1

SET VAR vQuote = (CVAL('QUOTES'))

SET VAR vCommand1 TEXT = ('PAUSE 2 USING'&vQuote&'This is the Address'&vQuote&';RETURN')

PROPERTY DBEdit2 'Custom_EEP->OnClickEEP' .vCommand1

RETURN