Stojkovic's SDL Page - SDL Controls

TSDLComponent

This is the base class for all components and controls. Use this for components that can not receive focus and react on keyboard events. Properties are:

property Pushed: Boolean read FPushed write FPushed;
Shows if mouse button was pressed over this component.
property Font: TSDLFont read FFont write SetFont;
Font for the component.
property Cursor : TSDLCursor read FCursor write FCursor;
Image of the cursor when it is over this component.
property Designing: Boolean read FDesigning write FDesigning;
Shows if component is under design. Used in SDL Form Editor.
property Name: string read FName write SetName;
Name of the component. Used for saving and loading components.
property PopupMenu: TSDLComponent read FPopupMenu write FPopupMenu;
To assign a popup menu to a component use TSDLPopupMenu.Create(ThisComponent).
procedure HidePopupMenu; virtual;
Hides active popup menu or combo's drop list.
property BorderWidth: Byte read FBorderWidth write SetBorderWidth;
Width of border. Used in drawing the component.
property Enabled: Boolean read GetEnabled write SetEnabled default True;
Shows if component is enabled. If it is not it can not receive any events.
property Description: string read FDescription write FDescription;
Description property. Use as you wish.
property DragMode: TSDLDragMode read FDragMode write FDragMode;
Can be dmAutomatic and dmManual. If dmAutomatic user can drag the component during run-time.
property Hint: string read FHint write FHint;
Hint to popup when mouse is over this component.
property Tag : Integer read FTag write FTag default 0;
Numeric Tag. Use as you wish.
property OnDestroy: TSDLNotifyEvent read FOnDestroy write FOnDestroy;
This event is called before component's destruction. See TSDLNotifyEvent.
property OnMouseMove: TSDLMouseMoveEvent read FOnMouseMove write FOnMouseMove;
This event is called when mouse is moved over the component. See TSDLMouseMoveEvent.
property OnMouseUp: TSDLMouseEvent read FOnMouseUp write FOnMouseUp;
This event is called when mouse button is released over the component. See TSDLMouseEvent.
property OnMouseDown: TSDLMouseEvent read FOnMouseDown write FOnMouseDown;
This event is called when mouse button is pressed over the component. See TSDLMouseEvent.
property OnClick: TSDLMouseClickEvent read FOnClick write FOnClick;
This event is called when user clicks on the component. See TSDLMouseClickEvent.
property OnDblClick: TSDLMouseClickEvent read FOnDblClick write FOnDblClick;
This event is called when user double-clicks on the component. See TSDLMouseClickEvent.
property OnMouseWheel: TSDLMouseWheelEvent read FOnMouseWheel write FOnMouseWheel;
This event is called when user rolls mouse wheel over the component. See TSDLMouseWheelEvent.

Methods are:

procedure Popup(AX,AY: Integer); virtual;
Only used in TSDLPopupMenu in order to pop it up.
procedure LoadFromStrings(SList: TStrings;var Level: Integer);
Loads the component from text in SList. Declaration of component must start at SList[Level].
procedure LoadCompFromFile(const FileName: string);
Loads a component from a file.
procedure SaveToStrings(SList: TStrings; Level: Byte);
Saves the component to SList in text format. Level should be 0.
procedure SaveCompToFile(const FileName: string);
Saves the component to text file.

TSDLControl

This is a base class for controls that can receive focus and react to keyboard events. Properties are:

property HasFocus: Boolean read FInFocus;
Shows if control currently hyas focus.
property TabOrder: Integer read FTabOrder write SetTabOrder;
Indicates the position of the control in its parent's tab order.
property OnKeyUp: TSDLKeyEvent read FOnKeyUp write FOnKeyUp;
This event is called when a key is released. See TSDLKeyEvent.
property OnKeyDown: TSDLKeyEvent read FOnKeyDown write FOnKeyDown;
This event is called when a key is pressed. See TSDLKeyEvent.
property OnKeyPress: TSDLKeyPressEvent read FOnKeyPress write FOnKeyPress;
This event s called when character key is pressed. See TSDLKeyPressEvent.
property OnEnter: TSDLNotifyEvent read FOnEnter write FOnEnter;
This event is called when the control gets focus. See TSDLNotifyEvent.
property OnExit: TSDLNotifyEvent read FOnExit write FOnExit;
This event is called when control looses focus. See TSDLNotifyEvent.

Method is:

function SetFocus: Boolean; virtual;
Tries to set focus to the control and if it succeeds it returns True, else it returns False.

TSDLStdControl

There is one more base class for controls. This one adds some default drawing routines to it. Properties are:

property Color: Cardinal read FColor write FColor;
This is control's default color. It uses this when it has no focus.
property FocusColor: Cardinal read FFocusColor write FFocusColor;
This is the color the control will use when it has focus.
property DisabledColor: Cardinal read FDisabledColor write FDisabledColor;
This is the color the control will use when it is disabled.
property AlwaysDown: Boolean read FAlwaysDown write SetAlwaysDown;
If True control is always drawn as it is pressed and AlwaysUp is False.
property AlwaysUp: Boolean read FAlwaysUp write SetAlwaysUp;
If True control is always drawn up and AlwaysDown is False.
property StateImages : TStateImages read FStateImages write FStateImages;
If there is an image asigned this property says for what states image contains patterns. It can contain siFocused,siDown and siDisabled. Image patters should be organized in rows (horizontal) and colums (vertical). Rows should contain patterns for animation of one state of the control. There has to be Normal Row, and it can have Focused Row, Down Row and Disabled Row. Normal Row will be drawn when control is enabled and doesn't have focus. When control gets focus it will draw Focus Row, and if one isn't present it will fall back to Normal Row. When control is pressed it will draw Down Row and one isn't present it will fall back to Focused Row. If control is disabled it will draw Disabled Row and if one isn't present it will fall back to Normal Row. There are control with exceptions to this.

List of controls

Let's see a complete list of controls now:

TSDLForm
is a container for other components.
TSDLPanel
helps manage the placement of child controls embedded in the panel.
TSDLButton
is a push button control. It has Glyph, GroupIndex and Down properties.
TSDLEdit
is a single-line edit control.
TSDLCheckBox
represents a check box that can be on (checked) or off (unchecked).
TSDLRadioButton
Radio buttons present a set of mutually exclusive options to the user.
TSDLRadioGroup
represents a group of radio buttons that function together.
TSDLComboBox
combines an edit box with a scrollable list of selectable items.
TSDLMessageDlg
helper component for SDLMessageDlg function.
TSDLFileListBox
is a specialized list box that lists all the files in a specified directory.
TSDLDirectoryListBox
represents a list box control that is aware of the directory structure of the current drive.
TSDLOpenDialog
displays a file-selection dialog.
TSDLSaveDialog
displays a "Save As" dialog for saving files.
TSDLDriveCombo
implements a specialized combo box that displays all the drives available when the application runs. Only avaible on Windows.
TSDLGauge
displays a progress bar.
TSDLLabel
displays text or an image on a form.
TSDLListBox
displays a scrollable list of items that users can select.
TSDLMemo
is a multiline edit control.
TSDLScrollBar
is used to scroll the contents of a window, form, or control.
TSDLMenuItem
describes the properties of an item in a menu.
TSDLPopupMenu
encapsulates the properties, methods, and events of a pop-up menu.
TSDLMenu
encapsulates a menu bar and its accompanying drop-down menus for a form.