Home Index classes Index static functions Index enumerations Index structure types

{Control|_on_form}


(including protected members)

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


 

METHOD visual|_component_dummy_override_to_in_non_visual_like_timer ==> BOOL , CALLBACK



----------------------------- 'stored locally (in certain implementations)'

STR local_caption


BOOL local_hidden


BOOL local_disabled


{rect} local_bounds



----------------------------------------------------- 'local stored colors'

INT local_foreground


INT local_background



------------------------------------------------------- 'local stored font'

STR local_font_face


REAL local_font_size


STR local_font_styles



------------------------------ '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.

REAL last_set_w|idth


REAL last_set_h|eight



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).


------------------------------------------------------- 'for {Paint_table}'

 

METHOD call_paint_item , CALLBACK



---------------------------------------------------- '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 set_hidden ( BOOL Hidden_state )



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 set_disabled ( BOOL D|isabled_state )



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 mouse_move|d , CALLBACK


Control mouse move event. This is the method to override it in a control implementation. When a mouse move event is handled, first this method is called for the sender control. And if the flag stop_handling is set, then further event handling is stopped.


METHOD mouse_down , CALLBACK


Control mouse down event. This is the method to override it in a control implementation.


METHOD mouse_up|pered , CALLBACK


Control mouse up event. This is the method to override it in a control implementation.


METHOD mouse_double_click|ed , CALLBACK


Control mouse double click event. This is the method to override it in a control implementation.


METHOD mouse_wheel|_rotated , CALLBACK


Control mouse wheel event. This is the method to override it in a control implementation.

BOOL stop_handling|_event_do_not_pass_to_form_mouse_handling_methods_LOCAL

Setting this flag while processing any mouse event above prevents any further handling the event.


 

METHOD mouse_button|_clicked ==> {Form}.{button} , CALLBACK


Mouse button value, actual while any mouse event is handling.


METHOD mouse|_coords_in_points_relative_to_control_top_left_corner ==> {point} , CALLBACK


Mouse coordinates value, actual while any mouse event is handling.


METHOD vertical_wheel|_pages ==> REAL , CALLBACK


Mouse wheel vertical rotation value, actual while mouse wheel event is handling. The rotation is measured in "lines" (where 1 line is approximately equal to 120 in Windows for mouse wheel events).


METHOD horizontal_wheel|_shift ==> REAL , CALLBACK


Mouse wheel horizontal rotation value, actual while mouse wheel event is handling.


METHOD Click|_on_control_programmatically



------------------------------------------------------- 'animation effects'


METHOD animate|_begin (
     
INT Count|_times ,
     
INT Interval|_milleseconds ) , CALLBACK , IF Count IS CONST , THEN Count > 0, IF Interval IS CONST , THEN Interval > 0 :


Start a timer providing periodic call of the event animation (which can be used for animation or any other periodic tasks).


METHOD animation|_tick , CALLBACK


The handler to work periodically certain amount of times specified by the method animate.


--------------------------------------------------------------- 'scrolling'


METHOD scrolled|_window_content , CALLBACK


The handler of the scroll event, used in some controls having content larger then the view area and allowing to scroll it some ways (e.g. with scrollbars, mouse wheels or by gestures).


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

  

METHOD set_form_sender ( {Control} Who|_is_sender ) , CALLBACK



METHOD activated


INT debug_suspend


    

METHOD Suspend|_redrawing , PUSH



METHOD resume|_redrawing , POP



METHOD do_suspend , CALLBACK



METHOD do_resume , CALLBACK


END