TIWCustomControl

TIWCustomControl

TIWCustomControl

The TIWCustomControl class defines it’s own properties, methods and events and also inherits from other base classes, but for simplicity we will describe all relevant properties, method and events on this class only.

Note: some of these properties, methods and events may not be available in the inherited controls.

Properties

property Align: TAlign;

Use this property to define the control’s alignment relative to its parent control.

property Anchors: TAnchors;

Same as in the VCL. Specifies how the control is anchored to its parent.

property Caption: string;

Use this property to specify the Control’s caption value, when applicable

property Color: TIWColor;

Use this property to define the foreground color of the control

property Css: string;

Use this property to inform the CSS style to be used when rendering the control in the browser. See more details in Working with Templates and CSS.

property Cursor: TIWCursor

Use this property to specify the mouse cursor for this control when the mouse passes over it.

property DoSubmitValidation: Boolean;

Use this property to indicate the Control is a required field (TIWEdit, for example) when there is a full submit event, like an OnClick event of a TIWButton.

property Editable: boolean;

Use this property to indicate if the control will be Editable or read-only.

property Enabled: Boolean;

Use this property to indicate the Control will be rendered as enabled or disabled.

property ExtraTagParams: TStringList;

Use this property to add any extra tag parameters to the control when it is rendered.

property Font: TIWFont;

Use this property to change the IWForm properties of the control.

TIWFont properties:

  • Color: TIWColor; Use this property to set the font color;
  • Enabled: Boolean: Set it as false when you use the CSS property to define the control’s font, otherwise set it as True;
  • FontName: string: Use this property to set the font used to render the text parts of the control;
  • FontFamily: string: Use this property to set the font family used to render the text parts of the control. Overrides FontName is both properties are filled;
  • FontVariant: string: specifies whether the lowercase letters should be displayed in small uppercase. Click here for more info.
  • Size: Integer: Use this property to set Font size in px
  • Style: sets the Font style (fsBold, fsItalic, fsUnderline, fsStrikeOut

property FriendlyName: string;

This property will be used by IntraWeb to name the control when showing an error message relative to it. Use a descriptive name for your control.

property HTMLName: string;

The HTMLName value is the Control’s name, but it is used by IntraWeb to generate several Control’s identifiers when rendering the Control.

property ParentShowHint: Boolean;

Use this property to speficy if the hint visibility will respect parent’s ShowHint value.

property RenderSize: Boolean;

Use this property to indicate if the control’s Height and Width will be used when rendering the Control. Same as StyleRenderOptions.RenderSize

property ScriptEvents: TIWScriptEvents;

Use this property to add custom Javascript to the control’s events. See more details in Custom JavaScript with ScriptEvents.

property ShowHint: Boolean;

Use this property to indicate if the control will have its Hint shown

property StyleRenderOptions: TIWStyleRenderOptions;

Use this property to specify which properties will be included in the CSS style IntraWeb generates for the control.

When IntraWeb renders a control, it needs to generate a style for it, so the browser knows the control’s color, position, font, etc. and the component can be rendered properly on the browser. Using StyleRenderOptions you can define which properties are not part of the style rendered by IntraWeb.

TIWStyleRenderOptions properties

  • property RenderSize: Boolean; Indicates if the Control’s Height and Width properties will be rendered
  • property RenderPosition: Boolean; Indicates if the Control’s Top and Left properties will be rendered
  • property RenderFont: Boolean; Indicates if the Control’s Font property will be rendered
  • property RenderZIndex: Boolean; Indicates if the Control’s ZIndex property will be rendered
  • property RenderVisibility: Boolean; Indicates if the Control’s Visible property will be rendered
  • property RenderStatus: Boolean; Indicates if the Control’s Enabled property will be rendered
  • property RenderAbsolute: Boolean; Indicates if the Control’s position will be rendered as absolute (True) or relative (False)

property SubmitOnAsyncEvent: Boolean

Use this property to indicate any change on the control will be submitted in an Async event.

property TabOrder: TIWTabOrder;

Use this property to set the controls tab order.

property Text: string;

Use this property to specify the Control’s Text value, when applicable

property Visible: Boolean;

Use this property to set the control’s visibility. If you change the control’s visibility in a AJAX event, make sure the container (a TIWAppForm or TIWRegion, for example) has the RenderInvisibleControls property as true;

property ZIndex: Integer;

Use this property to define the stack order of the control. A control with greater stack order is always in front of an control with a lower stack order.

Methods

procedure SetFocus;

Use this method to set the focus to the Control.

Events

Read more about AJAX support in IntraWeb.

OnAsyncClick: TIWAsyncEvent;

This async event is triggered when the user clicks the Control.

OnAsyncDoubleClick: TIWAsyncEvent;

This async event is triggered when the user double-clicks the Control.

OnAsyncChange: TIWAsyncEvent;

If the user changes the content of the Control (like an text box), this event is triggered when the user changes the focus to another control on the page.

OnAsyncEnter: TIWAsyncEvent;

This async event is triggered when the user changes focus to the Control.

OnAsyncExit: TIWAsyncEvent;

This async event is triggered when the user changes focus to another Control.

OnAsyncKeyDown: TIWAsyncEvent;

This async event is triggered when the user presses and holds a key, if the Controls has the focus.

OnAsyncKeyUp: TIWAsyncEvent;

This async event is triggered when the user releases a key that was pressed, if the Controls has the focus.

OnAsyncKeyPress: TIWAsyncEvent;

This async event is triggered when the user presses a key, if the Controls has the focus.

OnAsyncMouseDown: TIWAsyncEvent;

This async event is triggered when the user presses and holds the mouse button, if the Controls has the focus.

OnAsyncMouseUp: TIWAsyncEvent;

This async event is triggered when the user releases the mouse button that was pressed, if the Controls has the focus.

OnAsyncMouseMove: TIWAsyncEvent;

This async event is triggered when the the mouse enters the Control’s area.

OnAsyncMouseOver: TIWAsyncEvent;

This async event is triggered when the user is moving the mouse over the Control’s area.

OnAsyncMouseOut: TIWAsyncEvent;

This async event is triggered when the mouse leaves the Control’s area.

OnAsyncSelect: TIWAsyncEvent;

This async event is triggered after some text has been selected in a Control.

OnHTMLTag: TIWOnHTMLTag;

This event is triggered when the component is to be rendered and you can add custom HTML tag to affect rendering. You need to add the unit IWHTMLTag to the uses clause of the interface section of your unit.

  1. procedure TformMain.IWButton1HTMLTag(ASender: TObject; ATag: TIWHTMLTag);
  2. begin
  3.   ATag.AddStringParam(’style’,’color:lightblue’);
  4. end;