Home Index classes Index static functions Index enumerations Index structure types

{Control|_on_form}


CLASS {Control|_on_form} , ABSTRACT, DESTRUCTORS, UNTESTED :


{Control} is the common prototype of any visual or non-visual component placed on a form. All the components are placed in form columns. For columns its disposition is specified (left, right, top, bottom, center). Visual components are usually placed from top to bottom (or from left to right - for top / bottom aligned columns). Usually one component is occupying a row, but sometimes two components are placed together in a row (if the first is a label and the second does not require entire column width and the label size is suffitiently small to fit both components in a single row). Component events are handled in a parent form methods (like click, change, mouse_move etc.)


IMPORT : {Geometry} .

{Form} Form_|parent_ , INIT

A reference to a parent form.


STR Alias|_of_control , INIT

String Alias, which can be used to identify sender controls while handling events like mouse move, press, keyboard, or change text in an {Edit} control.


INT Handle|_control_native , READ

A control native handle used to associate an AL-IV control with the native component implementing it on a certain target.


STR Parent_column|_on_form , READ



------------------------------ 'control position relative to parent column'


METHOD Left|_position_in_parent_column ==> REAL


Left coordinate of the top-left point relative to the parent column, in points.


METHOD Set_left ( REAL L|eft_position_points ) , SETTER FOR Left


Setting left coordinate to a certain value. This has no permanent results except auto-arrange was cancelled for the column (the method {Form}.Set_column_auto_arrange with the FALSE as the parameter).


METHOD Top|_position_in_parent_column ==> REAL


Y coordinate of the top-left point relative to the parent column, in points.


METHOD Set_top|_position (
     
REAL T|op_position_points ) , SETTER FOR Top


Setting top coordinate to a certain value. This has no permanent results except auto-arrange was cancelled for the column (the method {Form}.Set_column_auto_arrange with the FALSE as the parameter).


METHOD Set_offset ( REAL X|_value_set , REAL Y|_value_set )


Setting a certain top and left coordinate for the control. This has no permanent results except auto-arrange was cancelled for the column (the method {Form}.Set_column_auto_arrange with the FALSE as the parameter).


METHOD Location|_in_parent_form ==> {Geometry}.{point}


The control top and left coordinates relatively to the parent form client area.


METHOD Width|_of_control ==> REAL


The visual control width in points


METHOD Set_width ( REAL W|idth_points ) , SETTER FOR Width


Setting a certain width for the control. This has no permanent results except the parent column is top or bottom aligned or auto-arrange was cancelled for the column.


METHOD Height|_of_control ==> REAL


The visual control height in points


METHOD Set_height ( REAL Height_p|oints ) , SETTER FOR Height


Setting a certain height for the control.


METHOD Set_size ( REAL New_w|idth , REAL New_h|eight )


Setting a certain size for the control. This has no permanent results for width except the parent column is top or bottom aligned or auto-arrange was cancelled for the column. The value -1 means that the correspondent coordinate


---------------------- 'control bounds relative to entire form client area'


METHOD Bounds|_rectangle_relative_to_parent_form ==> {Geometry}.{rect} , CALLBACK


The visual control bounds rectangle relative to the parent form client area.

BOOL Can_anchor_bottom|_right , READ

TRUE, if the control allows setting the Anchor_bottom property (such as {Memo}, {Listbox}, {Paintbox} and its descendants).


BOOL Anchor_bottom|_right_only_edit_memo_combo_paintbox , READ

TRUE, if the control is anchored (expanded) bottom. This should be the last (bottom) visual control in the parent column (aligned left, right or center).



METHOD Set_anchor_bottom (
     
BOOL Bott|om_anchor ) , SETTER FOR Anchor_bottom


Setting value of the Anchor_bottom property (applicable only to controls which Can_anchor_bottom property is TRUE).


---------------------------------------------------- 'control common state'

It is not necessary to use these low level methods directly, instead form events hidden / disabled should be used to define conditions at which certain components become invisible / grayed. Desired components also should be placed into correspondent form's arrays grayable[ ] / can_hide[ ], otherwise these always will be visible / enabled.   

METHOD Get_hidden ==> BOOL


TRUE if the control is not visible on its form. To control if the control is hidden on form, it is necessary to override the method hidden of the form.


METHOD Visible|_with_parent_column ==> BOOL , CALLBACK



METHOD Get_disabled ==> BOOL


TRUE if the control is disabled (grayed). To control the disabled property of a control it is necessary to override the nmethod hidden of the parent form.


METHOD Enabled|_control ==> BOOL , CALLBACK



------------------------ 'text parameters for all controls containing text'

BOOL Wrap|_text , READ

TRUE if the control is wrapable.



METHOD Set_wrap|able ( BOOL W|rapable_dummy ) , SETTER FOR Wrap


Setting control's wrapable property.


METHOD Get_selection|_text ==> STR


Returns a selection text. This method is applicable for all text edit controls like {Edit}, {Memo}, {Paint_lines}.


METHOD Replace_selection|_text (
     
STR T|ext_to_replace_selection_dummy ) , SETTER FOR Get_selection


Replacing a selection text with a certain value. This method is applicable for text edit controls like {Edit}, {Memo}, {Paint_lines}.


METHOD Text|_of_control ==> STR


Returns control's text. This method is applicable for all the controls having text shown like {Button}, {Label}, {Edit}, {Memo}, {Paint_lines}.


METHOD Caption|_text ==> STR


Returns control's text like the Text method.


METHOD Set_caption ( STR Value|_to_set ) , SETTER FOR Caption


Setting the control's text. This method is applicable for all the controls having a text shown like {Button}, {Label}, {Edit}, {Memo}.


METHOD Get_text|_of_control ==> STR


Returns control's text like the Text method.


METHOD Set_text|_of_control ( STR T|ext_to_set ) , SETTER FOR Get_text


Setting the control's text like in Set_caption. Additionally, the form's method Any_change is called if the text was changed in result.


STRUCTURE {from_to|_indexes_to_use_in_Memo}

      INT Line_from|_only_if_coordinates_in_form_LINE_COL

      INT From|_position

      INT Line_to|_only_if_coordinates_in_form_LINE_COL

      INT To|_position .


The structure to store coordinates in a multi-line text control.


------------------------------------------------------------------- 'items'


METHOD Get_item|_text (
     
INT Row|_of_control_dummy ,
     
INT Col|umn_of_control_dummy ) ==> STR


Getting item text. Applicable for controls having items, like {Listbox}, {Memo}.


METHOD Set_item|_text (
     
INT Row|_of_control_dummy ,
     
INT Col|umn_of_control_dummy ,
     
STR Value|_to_set_dummy ) , SETTER FOR Get_item


Setting item text. Applicable for controls having items, like {Listbox}, {Memo}.


METHOD Count|_rows_memo_listview_dummy ==> INT


Count of items. Applicable for controls having items, like {Listbox}, {Memo}.


METHOD Columns_count|_listview_dummy ==> INT


Count of columns. Applicable for controls having subitems, like {Paint_table}.


METHOD Clear|_delete_all_items


Clear items. Applicable for controls having items, like {Listbox}, {Memo}, {Paint_lines}, {Paint_table}.


------------------------------------------------------------------ 'colors'

INT Foreground|_color

Foreground color (used usually to draw text). On certain platforms this property can be ignored for some kinds of controls. E.g., for {Button} on Windows.



METHOD Set_foreground|_color (
     
INT C|olor_foreground ) , SETTER FOR Foreground


Setting foreground color for the control.

INT Background|_color

Background color (used usually to fill the background).



METHOD Set_background|_color (
     
INT C|olor_background ) , SETTER FOR Background


Setting background color for the control.

BOOL Custom_background|_when_set_at_least_one_set_to_TRUE



--------------------------------------------------------- 'font attributes'


METHOD Get_font_face|_dummy ==> STR


Getting name of the font face for the control.


METHOD Set_font_face ( STR F|ont_name ) , SETTER FOR Get_font_face


Setting name of the font face for the control.


METHOD Get_font_size|_dummy ==> REAL


Getting size of the font (in points) for the control.


METHOD Set_font_size ( REAL Value|_size ) , SETTER FOR Get_font_size


Setting the size of the font for the control.


METHOD Get_font_style|s_as_string_BIUS ==> STR


Getting the font style for the control as a string (B- Bold, I- Italic etc.).


METHOD Set_font_style|s_as_string_BIUS (
     
STR S|tyles_set_BUIS ) , SETTER FOR Get_font_style


Setting the font style for the control as a string (B- Bold, I- Italic etc.).


METHOD Setup_font|_all_attributes (
     
STR Face|_name ,
     
REAL Size|_font ,
     
STR Style|s_font )


Setting the font name, size and style for the control at once.


METHOD Is_autosize ==> BOOL


Returns TRUE for the control if it is sized automatically. This method should be overridden in a control implementation. It is used in a form auto-arrange procedure to arrange controls in its columns.


---------------------------------------------------- 'control mouse events'

 

METHOD Click|_on_control_programmatically



----------------------------------------------------- 'access Form_.sender'

 

METHOD Suspend|_redrawing , PUSH


END