| Home | Index classes | Index static functions | Index enumerations | Index structure types |
CLASS {Form|_containing_controls} , UNTESTED, DESTRUCTORS :
A form class. It is intended to create your own descendants where a form components configuration is defined and methods are overridden to handle events from form components and from the form itself. In the visual components libray of the AL-IV, all the visual controls are placed on columns which are placed on a form. More complex nesting is not allowed, to exclude too complex configurations which can not fit into small displays.
IMPORT : {Configuration} , {String_functions} .
STR Alias|_form
Form's alias (can be useful o distinct forms while switching in code via a CASE statement).
{Control} Child|ren|_controls[] , READ
The list of all the child controls (not columns, but all the controls on all the columns).
INT Handle|_native , READ
The form handle which is a descriptor to connect the AL-IV object of the form with its native implementation object.
{Screen} Screen_|object_ , INIT
The refernce to the {Screen} object which actually should be the single in an application instance.
|
|
Returns TRUE for a {Dialog} descendant object, which is designed to be modal. |
BOOL in_construct|_LOCAL
|
|
Closing the form. If the form is main form, the entire application is terminating (correct way). |
INT local_window_handle
|
|
Form's window handle. This is not the same as the descriptior of the native form's object but a platform-specific reference onto a window handle (in the Microsoft [TM] Windows system). |
|
|
STR local_caption|_set_last
|
|
Form caption string. |
|
|
Changing the form caption string. |
BOOL No_frame|_was_set , READ
Setting (or resetting) form "no frame" mode. This option is platform dependent and can be ignored.
|
|
BOOL No_borders , READ
Setting (or resetting) form "no borders" mode. This option is platform dependent and can be ignored.
|
| |
|
|
Starting operation "moving" the form with the mouse. This option is very platform dependent (and used only in the Windows OS). Call this method only in response to mouse down event. |
|
|
Setting the form "alpha" value making it semi-transparent with a specified depth value. |
BOOL Custom_colors , READ
Setting colors of form.
INT Custom_foreground|_color , READ
INT Custom_background|_color , READ
|
| |
|
|
{rect} local_form_bounds
REAL want_width|_to_set
REAL want_height|_to_set
{rect} local_monitors[]
|
|
Form client area width. |
|
|
Form client area height. |
|
|
Form client area top-left position relative to entire form rectangle. |
|
|
Setting form size on base of desired client area size. |
|
|
The event to override in main form of an application to handle either command line parameters at the application start or when another application instance is sending a command line to the first (this) instance rather then handling its itself. And also in response of file drop operation (applicable in case when the method accept is redefined and returned TRUE in response of a file drop). |
|
|
The event to override it in a custom form to accept a drop file(s) operation. Before realize a decision if to return TRUE, check command line parameters which are set to a list of files dropped (each parameter is corresponding to a single file). |
Override the 'command' method to handle events launching of
another instance of you application by users.
To provide it firing, use {Single_instance} instead of the {Screen} class.
When the 'command' method is called, it is possible to get the secondary application parameters via usual Count_param and Parameter functions from the {System_functions} class.
Override the 'accept' method to handle drop files event and to return TRUE in case when the drop for a given set of files is acceptable. The files list is available via Count_param and Parameter functions from the {System_functions} class, both in the 'accept' and the 'command' method. Teh 0th parameter is not used as a part of the file list. The 'command' is called to handle the drop files event after the 'accept' was returning TRUE before (when the mouse button is released to perform the allowed drop files operation).
{Control} sender_|for_event_or_NONE_if_sender_is_a_column_or_a_form_
|
|
The event sender. Usually this is a control. If NONE, the sender is the form itself (or the event was fired by a menu item). |
|
|
The event sender alias. If the sender is a control, this is its Alias. If the sender is the form itself, then the empty string is returned. In case of a nmenu item, its alias is returened. |
|
|
The event of activation of the form. Override it to respond onto the form activation. |
|
|
The event of deactivation of the form. Override it to respond onto the form deactivation (activation of another form of the same or another application). |
BOOL local_form_visible
{reason_closing} reason_closing|_LOCAL
BOOL Do_not_close|_even_on_shutdown|_preventing_system_to_restart_or_shutdown
|
|
Closing the form event. Theoretically it is possible to refuse from close the form returning {action}.'DECLINE'. Certainly not in all cases this will have effect, e.g. in case of forced OS shutdown. |
BOOL is_closed
Closed the form event.
|
|
BOOL Closed|_do_not_try_show_it_again , READ
TRUE if closed. It is not possible to operate further with a closed form.
|
|
The method to show some text message, usually in a separate dialog window.. |
|
|
The method to ask some question with 2 possible answers (Yes / No) and waiting for the answer from a user. |
{Form} current_modal_dialog_|child_to_this_form_
|
|
Returns current modal form of class {Dialog} shown. Only one modal dialog can be active at once. |
To create and pop up a menu the method Popup_menu is used. Its single parameter is a string containing item definitions separated by new line characters (#NL). It is convenient to use a multi-line string constant started with the symbol @. In such case for all the lines ending with a string literal a new line sequence is added. To organyze nested menu items add following the item which is then parent for a nesting menu, the string constant "(" (and to end the nesting level, the string ")"). Each string contains a menu item definition and for real menu items it should start from the item alias in a form "IDENTIFIER:", where a colon separates a menu item alias from the menu item text definition. It is also possible to specify togethewr with an alias some additional properties such as "disabled" or "checked", placing correspondent string constants comma separated. E.g.:
A separate string "-" creates a visual group separator. A single symbol "&" in a menu item text creates a shortcut symbol which can be used to select the item by a key combination ALT+ the next character. (But in someenvironments like Java such shortcut has not effect). To use the symbol '&' itself as a part of a menu item text, double it. To handle menu items, it is necessary to redefine menu item event handler:
OVERRIDE menu(STR Alias) : ...
Popup_menu(@
"COPY,disabled: &Copy [Ctrl-C]"
"CUT,disabled: C&ut [Ctrl-X]"
"PASTE: &Paste [Ctrl-V]"
"-"
"Mode..."
"("
"AUTO,checked: &Auto"
"Manual: &Manual"
")"
"EXIT: &Exit")
STR menu_alias|_or_column_alias_returned_as_sender_alias
An alias of a menu item which was activated (in the method menu_item). When the menu is defined, the alias is specified by a string located before the colon character in a line representing a menu item (or, if there is no a colon there, the entire menu text is used as an alias).
|
|
The event which occur when a menu item was clicked by a user. Use menu_alias to switch between branches handling different menu items. Or, use the function sender_alias which in case of the even menu_item returns a value of the variable menu_item. |
|
|
The method to popup a menu. The string parameter Menu is defining a menu as
a sequence of strings separated with #NL characters, each of which is
specifying a single menu item and should be passed in form
|
BOOL tracking_menu_sel|ection
|
|
INT columns|_handles[]
STR aliases|_columns[]
BOOL aligns|_labels_in_columns[]
STR Current_column|_alias , READ
Current column (used as an implicit parameter in some methods to operate with columns).
|
|
Selecting a column (by alias) which will be used as the current. While a form is creating, the last column created becomes current. |
|
|
Returns the active (focused) control of the form. |
|
|
Setting the active (focused) control of the form. |
|
|
The method to override in a programmed class of form. Allows to handle an event of clicking a control (with a mouse, or a finger, or by a keyboard ENTER/SPACE key or by a human voice or with another pointing device/method). Like in most events, use sender or sender_alias to distinct which control was a sender of the event. |
|
|
The method to override for handling mouse move events (or other pointing devices move events not handled yet - like in panning or scrolling operations supported on more deep levels). |
|
|
The method to override for handling mouse down events (or other pointing devices down events). To get coordinates of the mouse point, use the method "mouse". To get know which "mouse" button was down, use the mouse_button method. |
|
|
Similar above, but to handle mouse up events. |
|
|
Similar above, but to handle mouse double-click events. The double click is detected after two sequentional the same mouse button down events fired during on an sufficiently short period (the period usually is defined by the user settings in the OS). Certainly, not only mouse can be used to make double clicks but any other pointing devices like pens, fingers etc. |
|
|
Similar above, but to handle mouse wheel events. To get know values of wheel rotation, use vertical_wheel and horizontal_wheel methods. On senser screens, mouse wheel event can be generated by two-finger panning up/down gestures. |
|
|
Similar above, but to handle the event of a control focusing (by the user). |
|
|
Similar above, but to handle the event of a control unfocusing (in result of focusing another control on the same form or switching to another application). |
|
|
Similar above, but to handle the event of painting a control. Applicable only in case when there are {Paintbox} or its descendants on the form. Use the sender control Canvas to get painting surface while handling the event. |
|
|
{Button} Default_button , READ
Current default button on the form (of the class {Button}). Only one button can be defined as the default at a time on a form. It can be clicked by the keyboard key ENTER if such key is not handled by a current active control on a form. E.g. the ENTER key can be used in a {Memo} control to insert symbols #NL to its text.
|
|
Setting current default button in the form. |
{Button} Cancel_button , READ
Like for the default button, but uset to store current cancel button. It can be clicked by the keyboard key ESCAPE (if such key is not handled, too).
|
|
Setting current cancel button in the form. |
{key_info} Key|_information_LOCAL
Information about key pressed (or released) actual while handling keyboard events.
|
|
The method to override for handling keyboard key down events. |
|
|
The method to override for handling keyboard key up events. |
|
|
The method to override for handling letter or digit or other typed character keyboard key press events. |
|
|
The method to override for handling timer tick events. As usual for events, use sender or sender_alias to get know which timer was ticked. Timer eveents are handled in the main thread. |
|
|
The method to override for handling form move (by the user or by another reason) events. |
|
|
The method to override for handling form resize (by the user or by another reason) events. |
|
|
The method to override for handling changing some data (text, check state etc.) events. |
|
|
The method to be called internally to handle value_change event (and to force calling the Any_change method at the end). |
INT count_sel_change|_times_called
BOOL any_change_handling|_LOCAL
|
|
Returns TRUE, if the Any_change method is already running. |
INT level_event|_handling_LOCAL
{event} level_inc_on_event_kind , DEBUG
BOOL need_any_change
|
|
The method for handling some changes made in controls of the form. This is the method where the hidden and the disabled methods are called for controls (specified in can_hide[] / grayable[]) and the column_hidden is called for each column to decide which of them to show / hide or disable / enable. |
INT suspended_count
BOOL any_change_while_suspended
BOOL adjust_horizontal_controls|_sizes
|
| |
|
|
Suspending any controls or columns re-arranging. Should be used in PUSH blocks at the header part. The method resume_layout alternative to the Suspend_layout is called automatically (and instantly) at the end of a PUSH block. |
|
|
Resuming form layout. This method is called automatically at the end of a PUSH block in which the Suspend_layout was called in the header. |
|
|
{Control} grayable|_controls_add_here_to_make_it_disabled_in_event_below[]
The array to store a list of controls which can be disabled (grayed). For such controls the event disabled is called after some changes on a form to define should or not the control become grayable. It is enough to override the method disabled and define for interesting controls conditions on which the control become disabled.
|
|
The method to override it for defining conditions on which some grayable controls become disabled (grayed). There is no sense to write such conditions for controls which are not present in the grayable[] list. |
{Control} can_hide|_controls_add_here_to_make_hidden_in_event_below[]
The array to store a list of controls which can be hidden. For such controls the event hidden is called after some changes on a form to define should or not the control become grayable. It is enough to override the method hidden and define for interesting controls conditions on which the control become invisible.
|
|
The method to override it for defining conditions on which some controls (present in the can_hide[] array) become hidden. |
|
|
The method to override for handling control scroll events. |
BOOL Can_stop_long_operation|_set_to_FALSE_to_prevent_dialog_show_and_stop_operation
INT In_long_operation|_level
{event} Current_event|_kind_to_use_in_long_operation_dialog_in_default_description
Current (the last) event handling.
STR Alias_current_event
Text alias of a sender control initialted the last event, used while long operations handling (to show a reason of a long operation).
|
|
The method to access or create an instance of the class {Long_operation}. This is a special form shown when a long operation is detected. |
{Control} stack_senders[]
The internal method to organize working with events of the form.
{event} stack_kinds[]
|
| |
|
|
One more internal method to organize working with events of the form. |
|
| |
|
|
The method to make the form enabled / disabled. It is not recommended to use it in most cases. |
BOOL loaded_bounds|_LOCAL
{state} local_form_state
|
|
Returns current state of the form. |
|
|
INT in_process_count|er
Processing all the events pending.
|
|
{Form} parent_form_|local_used_with_modal_form_only_
A parent form for the dialog form.
BOOL Ready|_answered , READ
TRUE, if the dialog was already answered.
STR Answer|_set_in_result , READ
A text value which is representing an answer form the user. When the dialog method ready is called this answer is passed and stored here. After returning to a point where the dialog results are handling, your code can analyze this value to decide what to do further.
|
|
The method to be called in the dialog code to specify an answer and finish the dialog. |
|
|
The method to show a dialog form modally. (The form should be descending from the class {Dialog}). |
|
| |
|
|
|
| |
|
|