diff --git a/docs/xml/lcl/controls.xml b/docs/xml/lcl/controls.xml index 0f5e75238c..c3b9d7a195 100644 --- a/docs/xml/lcl/controls.xml +++ b/docs/xml/lcl/controls.xml @@ -6867,46 +6867,55 @@ Without a DockManager both extents are required, because no (valid) alignment in - Returns True if the control is visible in its form. + Returns True if the control is visible, including all of its Parents. + True only if all Parents also are visible. - - + + True if the control is Visible, or is in design mode. +

Does not check for invisible parents

- - - - + + +
+ + + + + + Returns True if the control is Enabled, including all of its Parents. + + + True only if all Parents also are enabled. + + + + True while painting the control[?] - - Hide this control + Hides this control, by setting Visible to False. - - - Refresh the data on this control - + - - Repaint the control, ie refill its canvas + Immediate redraw of the control, bypassing the message queue. - Render this control non-valid + Force a delayed Repaint of the control, by marking its visible area of the control as invalid. @@ -6917,23 +6926,23 @@ Without a DockManager both extents are required, because no (valid) alignment in - Function checks whether a particular child class is allowed + Returns True if the class is allowed for child controls. - Function returns True if child class has been checked and is allowed + True if the class is allowed for child controls. - The child class which is being checked to see whether it is allowed + The class of the intended child control. - Boolean set to True if a non-valid class is found and an exception has been raised + When True, raise an exception when the class is not allowed. - Checks a new parent for this control + Checks a new parent for this control[?] - The new parent associated with this control + The new Parent for this control. @@ -6950,7 +6959,7 @@ Without a DockManager both extents are required, because no (valid) alignment in - UpdateMouseCursor - ensure coordinates + UpdateMouseCursor - ensure[???] coordinates X, Y for the cursor are correctly stored @@ -7745,18 +7754,6 @@ Without a DockManager both extents are required, because no (valid) alignment in - - Is the control visible on the current desktop? - -

Does not check for invisible parents

-
- - -
- - - - True if the form is being updated diff --git a/docs/xml/lcl/stdctrls.xml b/docs/xml/lcl/stdctrls.xml index 6b534b6ba2..89fc54c35a 100644 --- a/docs/xml/lcl/stdctrls.xml +++ b/docs/xml/lcl/stdctrls.xml @@ -118,18 +118,18 @@ - How strings in the edit box are displayed. + How text in the edit box is displayed. - [?] + Characters are shown unmodified. - Nothing displayed[?] + All characters shown as spaces [or nothing displayed at all?]. - Replaced by PasswordChar[?] + All characters shown as PasswordChar. @@ -147,36 +147,36 @@ A vertical scrollbar is shown. - Both horizontal and vertical scrollbar is shown. + Both horizontal and vertical scrollbars are shown. - [?] + A horizontal scrollbar is shown when needed[?]. - [?] + A vertical scrollbar is shown when needed[?]. - [?] + Both scrollbars are shown as needed[?]. - The scroll action type. + The scroll action type, as reported by the widget.

These values must correspond to the SB_xxx values in LCLType.

- Scroll one line up. + Scroll one line up (column left). - Scroll one line down. + Scroll one line down (column right). - Scroll one page up. + Scroll one page up (left). - Scroll one page down. + Scroll one page down (right). Scroll to the specified position. @@ -185,10 +185,10 @@ Scroll tracking to the specified position. - Scroll to the top. + Scroll to the top (left) end. - Scroll to the bottom. + Scroll to the bottom (right) end. Scrolling finished. @@ -401,7 +401,7 @@ - The scrollbar orientation, Horizontal or Vertical. + The scrollbar orientation, horizontal or vertical. @@ -500,17 +500,6 @@ - - - - - - - - - - - @@ -524,6 +513,17 @@ + + + + + + + + + + + The base class for TGroupBox, TRadioGroup and TCheckGroup. @@ -578,16 +578,6 @@ - - - - - - - - - - @@ -614,6 +604,17 @@ + + + + + + + + + + + Defines the behavior of the AutoComplete feature in a combobox control. @@ -684,48 +685,59 @@ - [?] + The handler type for painting a single item of owner-draw list and combo boxes. - [?] + The control to draw. - [?] + Index of the item to draw. - [?] + The item rectangle in the Canvas. - [?] + Flags describing the item state to draw (selected...). - [?] + The handler type for the determination of the Height of a single item in owner-draw list and combo boxes. - [?] + The list or combo box. - [?] + Index of the item to measure. - [?] + Here the handler returns the Height of the item (in pixels). - The base class from which TComboBox is derived. + The base class for ComboBox components. -

Despite similarities in appearance to TCustomEdit and TCustomList, - the class inherits no properties from these classes, but only from TWinControl +

+ A ComboBox combines an edit box with an item list. + The list can be either static (always visible), or drops down when needed. + [Should read combines an edit box, but fpdoc errors?] +

+ Depending on the ComboBox Style the user can type text into the edit box, + or he can select items from the Items list. +

+

Despite similarities in appearance to TCustomEdit and TCustomList, + the class inherits no properties from these classes (Delphi compatible). +

+

It has some interesting properties including AutoComplete and AutoCompleteText, AutoDropDown + and the ability to create and add a History display. + [how to use all that?]

-

It has some interesting properties including AutoComplete and AutoCompleteText, AutoDropDown and the ability to create and add a History display

@@ -757,7 +769,7 @@ - used to return the state of arrow keys from temporary change + Used internally, to return the state of arrow keys from temporary change. @@ -835,8 +847,8 @@ - - + + Handles changes of the Sorted property. @@ -848,12 +860,11 @@ - + Prevents ordinary chars from triggering accelerators. - @@ -873,9 +884,8 @@ - - - DoEnter - calls inherited method then autoselects text in dropdown list if required + + Selects the entire text when AutoSelect is True. @@ -895,8 +905,7 @@ - - Draws the specified indexed item at the specified position. + Draws an item, using the OnDrawItem handler if one is installed.

Software emulation of OnDrawItem event, in OwnerDraw mode.

Calls the OnDrawItem handler, if installed. @@ -928,7 +937,7 @@ The index of the item whose height is required. - The height of the indicated item, in pixels, adjustable by the OnMeasureItem handler. + The height of the item, in pixels, adjustable by the OnMeasureItem handler. @@ -937,8 +946,7 @@ - - LMChanged - LCL Message to signify that the control[?] has changed + Notification of a change in the edit box. @@ -948,7 +956,7 @@ - Invokes the OnChange handler. + Invokes the OnChange handler, signaling an change in the edit box. @@ -964,15 +972,15 @@ - + Invokes the OnDropDown handler. - Called whenever the list pops up. + Called whenever the list drops down. - + Invokes the OnGetItems handler. @@ -984,16 +992,14 @@ - - Adjusts the extent of the DropDown list. + Adjusts the extent of the DropDown list. - - Returns the number of list items. + Returns the number of list items. @@ -1088,12 +1094,8 @@ - - RealSetText - sets the ComboBox text to the caption value specified + Adjusts ItemIndex according to the new edit box content. -

- -

If the text AValue occurs in the list of strings, then sets the Itemindex, otherwise does the default action which is to store text as a string rather than performing read-write to a PChar buffer

@@ -1102,13 +1104,11 @@
- + The new content of the edit box. - - KeyDown - performs code for traversing the dropdown list to the correct location before calling inherited KeyDown - + Filters TAB and RETURN key when used to traverse the list.

The inherited method provides software emulation of the event handler OnKeyDown which acts if a key has been pressed and is still down

@@ -1118,13 +1118,15 @@
- + The pressed key. - + The state of the modifier keys and mouse buttons. - + + Handles AutoSelect and AutoComplete. + @@ -1133,8 +1135,7 @@ - - Adjusts character case before calling the inherited method. + Adjusts character case before further processing.

The inherited method invokes the OnKeyPress handler, allowing for further input processing.

@@ -1162,12 +1163,12 @@
- - Invokes the OnMouseUp handler, then sets AutoSelect if left mouse button is clicked for the first time after receiving focus + AutoSelect when left mouse is clicked for the 1st time after having focus. + AutoSelect TControl.MouseUp @@ -1189,7 +1190,10 @@ When a matching item was found, invokes the OnClick and OnSelect handlers. - + + OnClick + OnSelect +
True when a matching item was found and selected. @@ -1239,13 +1243,13 @@ The string to be added to the list. - The maximum number of items that can be added to the history + The maximum number of items that can be added to the history. When True the string also is copied into the edit box. - True means that only an exactly matching item is removed from the list. + True means that the list can contain multiple items with the same text, differing in case. The object associated with the item; can be Nil. @@ -1258,10 +1262,11 @@ Unselect a possibly selected item (ItemIndex becomes -1). The text selection is not affected. Set SelLength to zero to remove a selection from the text box. + - Select all items in the list + Select the entire text in the edit box. @@ -1269,22 +1274,26 @@ - Enables the operator to use the keyboard Arrow keys to move through the list as an alternative to using the mouse + Allows the operator to use also the keyboard Arrow keys to move through the list. - Enables the facility to offer suggestions for completing text-strings + Allows to select items from partial input, of the begin of the item text. + The first matching item is selected. + The user can continue entering characters, until the desired (or no) matching item is selected. + + - Options for behavior of the Auto-Complete feature + Options for the behavior of the Auto-Complete feature.
  • Enabled: Enable Auto-Completion feature.
  • EndOfLineComplete: Perform Auto-Complete only when cursor is at the end of the string.
  • RetainPrefixCase: Retains the case of characters user has typed. (This option has no effect if cbactEndOfLineComplete is False)
  • SearchCaseSensitive: Search completion string with case sensitivity.
  • -
  • cbactSearchAscending: Search completion string in accending order. (False will search in descending order)
  • +
  • SearchAscending: Search completion string in accending order. (False will search in descending order)

This property exists as a Set of Options, so zero or more options may be operational

@@ -1294,14 +1303,14 @@
- If True, the drop-down list appears as soon as the cursor moves over the text box + Makes the drop-down list appear as soon as the user starts entering text. -

If False, the drop-down box only appears when the down button at the end of the box is selected

+

If False, the drop-down list only appears when the down button to the right of the edit box is clicked.

- If True, all contents of Text box are selected when control receives focus + Selects the entire content of the edit box when the control receives the focus.

When True, the edit control will select all its text when:

    @@ -1310,24 +1319,24 @@
  • A new item is selected.
+
- True indicates that the combobox control has just performed an AutoSelect operation + True indicates that the selection was marked automatically by the control.

True indicates that the combobox control has just performed an AutoSelect operation so that subsequent mouse-clicks and keystrokes proceed normally without selecting the text.

False is set when the combobox control loses focus.

+
+ - - - Indicates whether text is to be displayed as Upper, Lower or Normal case (as entered). + Indicates how text is converted during input (upper, lower, or as entered). -

Indicates how text is displayed in a text editing control

@@ -1351,7 +1360,7 @@ The index of the currently selected item, -1 if none is selected.

Setting the ItemIndex selects the item in the list.

-

The first item has number 0, the second has number 1, the third number 2, etc.

+

The first list item has index 0, up to ListCount-1.

If no item is selected, ItemIndex is -1.

@@ -1371,7 +1380,10 @@ Assign another string list to replace the items.

- + + + +
@@ -1379,7 +1391,9 @@ - The maximum length for user input. + The maximum length of user input. + Set MaxLength to e.g. the fixed length of a string field, where the input is stored later. + @@ -1395,21 +1409,22 @@ - Handler for - the drop-down box closes - event. + Handler invoked when + the drop-down list closes. + - Event handler for painting an item. + Handler for special painting of an item (in owner-draw mode). + - Event handler for list has dropped down. + Handler invoked when the list has dropped down. - Event handler when widgetset[?] items list can [must?] be populated + Handler invoked when widgetset[?] items list can [must?] be populated

Some widgetsets like gtk call this just before the list drops down, while others do it on handle creation. This event allows to handle both cases with one event. @@ -1421,13 +1436,13 @@ - Event handler when the size of an item is required. + Handler invoked when the height of an item is required. - + - Event handler when an item or some text is selected + Handler invoked when an item is selected. @@ -1435,7 +1450,10 @@ - Whether text can be entered in the edit box. + Disallows entry of free text. + When True, only items from the list are accepted, + by direct selection from the list or AutoComplete. + @@ -1479,7 +1497,7 @@ Determines whether the list entries are sorted. - Setting this property to True enforces sorting of the list. + Setting this property to True enforces ascending alphanumeric case-insensitive sorting of the list. When True, new entries are added in sort order, not to the end of the list. @@ -1531,11 +1549,15 @@ A combination of an edit box and a (drop-down) list allowing one of several options to be chosen. -

The default text-string (if any, entered in the Form Designer) and the value of the text string that is ultimately selected from the drop-down list, is held in Text +

The Text property reflects the text entered into the edit box, or selected from the list.

-

The values that can be selected from the drop-down list are held in the string-array Items. Clicking on the ellipsis (...) next to Items in the Object Inspector opens a pop-up string-list editor which allows the designer to enter and edit a number of lines of text to represent the selections

-

At run-time, the entry selected from the drop-down list in Items is used to replace any information previously found in Text, and ItemIndex holds the (zero-origin) index number of the selected item

-

If no value is selected from the drop-down list, the default text (if any) remains, or any information typed directly into Text will be returned, and ItemIndex takes the value of -1

+

The selectable values are kept in the Items list. + Clicking on the ellipsis (...), next to Items in the Object Inspector, + opens an editor which allows the designer to populate the Items list.

+

At run-time, the entry selected from the list replaces the text in the edit box, + and ItemIndex holds the (zero-based) index number of the selected item.

+

If no value is selected from the drop-down list, the default text (if any) remains, or any information typed directly into Text will be returned, + and ItemIndex takes the value of -1

@@ -1633,10 +1655,10 @@
- [?] + The ListBox control. - [?] + True if the user changed the selection, False if changed by code[?]. @@ -1779,8 +1801,7 @@ - - AssignItemDataToCache - assigns data for the item, specified by a pointer AData, to a cache + Copy selection state into the cache. @@ -1793,9 +1814,7 @@ - - AssignCacheToItemData - assigns the cache to the item data specified by the pointer AData - + Sends the cached selection state to the widget. @@ -1815,8 +1834,7 @@ - - Loaded calls inherited method then sends the item index value to the handle + Sends the predefined ItemIndex to the widget. @@ -1831,8 +1849,7 @@ - - InitializeWnd calls inherited method then sets up the list of strings + Copies the Items into the widget. @@ -1841,8 +1858,7 @@ - - FinalizeWnd frees the list of strings then calls inherited method + Caches the Items stored in the widget. @@ -1856,66 +1872,42 @@ - - CheckIndex - check that the supplied index refers to valid data + Assures that the index is inside the Items list bounds. - + + Raises an IndexOutOfBounds exception when the index is out of bounds. + - - - GetItemHeight - returns a value for the height of an item - - - - + - - - GetItemIndex - returns an index value for the current list item - - - - + - - - GetSelCount - returns the number of selected items - - - - + - - - GetSelected - returns True if the specified indexed item has been selected - - - - + - + The selection state of the item. - - GetCachedDataSize - returns the amount of data needed per item + Returns the size of a cached item. @@ -1925,10 +1917,11 @@ - - GetCachedData - returns a pointer to the data corresponding to the supplied index + Returns an pointer to the cached item data. - + + Raises an InvalidOperation exception when the cache is invalid, i.e. when the widget has been created. + @@ -1938,13 +1931,7 @@ - - - SetExtendedSelect - specifies a boolean indicator to show whether Extended Selection is permitted - - - - + @@ -1982,23 +1969,16 @@ - - - SetStyle - specifies the style of the listbox - - - - + - - DrawItem - method to draw the nominated indexed item in the specified rectangle + Paints an item in owner-draw mode. - + @@ -2010,9 +1990,8 @@ - - - DoSelectionChange - perform a change in the selection + + Invokes the OnSelectionChange handler. @@ -2022,8 +2001,7 @@ - - SendItemIndex - transmit the item index to the system + Sends the ItemIndex to the widget. @@ -2037,19 +2015,18 @@ - + Adds an item to the list. - - + - + The item text. - + The associated object, can be Nil. @@ -2058,14 +2035,14 @@ Removes all items from the list. - + Unselects all items. - + @@ -2081,12 +2058,7 @@ The Y client coordinate. - - Find the item at the given Y coordinate. - - - - + The item index, -1 if no item could be found. @@ -2095,50 +2067,51 @@ - Get the selected items' text in one string. + Get the text of all selected items in one string. - - The item texts, one per line. + The item strings, one per line. - Returns the index value of the item at the specified position. - [...] + Get the item index for the given client coordinates. + - + - [?] + The calculated item index, can be out of the Items bounds. - [?] + The item position. - [?] + True when the index is requested for insertion of a new item. - Returns the client coordinates of the item.[...] - + Returns the client area of an item (including scrolling). + Only an index from 0 to ItemCount is considered valid, + i.e. the result is valid also for the next item, that will be added subsequently. + - + The item area; all zeroes for an invalid item index. - + The tentative item index. - Is the item visible? + Returns True if the item is at least partially visible in the scrolled list. - + @@ -2148,10 +2121,10 @@ - Is the item fully visible (or is part of it outside the bounds of the client area)? + Returns True if the item is fully visible in the scrolled list. - + @@ -2161,39 +2134,38 @@ - Lock ( make permanent) the change in the selection + Blocks selection changes during update of the widget. - - MakeCurrentVisible - makes the current item visible + Makes the item at ItemIndex visible, possibly scrolling the list. - Specifies the height of a list item, using [...]. + Request the Height of a list item, using the OnMeasureItem handler. - + - The index value of the item to be measured + The item index. - The height of the item in pixels. + The height of the item in pixels, can be changed by the handler. - - SelectAll - select all items in list + Selects all items in the list (in ExtendedSelect mode). + - Unlock the previously locked change in selection + Unlocks previously locked selection changes. @@ -2205,13 +2177,25 @@ - Performs Click procedure when the selection is changed (which usually puts the selected item into the edit box) - + Allows selection changes to generate a Click event. + + Delphi generates an OnClick event when the selection changes. + The LCL adds a more specific OnSelectionChange event. + Set ClickOnSelChange to False, when selection changes should be handled only in OnSelectionChange, and should not generate an OnClick event (Delphi compatible). + - The number of vertical columns in the list.[...] + The number of visible vertical columns. + +

+ A ListBox can have multiple columns, not only multiple rows. +

+ When Columns is greater than zero, it specifies the number of columns that are visible without horizontal scrolling. + I.e. the width of a single column becomes Width/Columns. +

+
@@ -2223,13 +2207,22 @@ - True when a contiguous range of items can be selected. Default True. + True when a contiguous range of items can be selected by a SHIFT-click. Default True. + +

+ Normally a click into the list selects one item, and deselects all other items. +

+ When MultiSelect is True, the user can select/deselect further items with CTRL-click. +

+ When ExtendedSelect also is True, the user can SHIFT-click on an item, to select all items between this and the last selected item. +

+
- not implemented + Not implemented: shrink the Height of the widget, so that it only shows fully visible rows. @@ -2240,28 +2233,37 @@ The currently selected item, -1 if none. - Indicates the currently selected item. The first item has number 0, -the second has number 1, the third number 2, etc. In case no item is selected, ItemIndex -has value -1. If MultiSelect is True, ItemIndex represents the item which has focus, which -typically has a different color from the other items. + If MultiSelect is True, ItemIndex represents the selected item which also has the focus. + + - A string list containing all items.[...] + The list of all items in the control. + +

+ Reading allows to access the contents of the list (TStrings compatible). +

+ Assign another string list to replace the items. +

+
+ + + +
- [...] - MultiSelect - - - - - allows more than one Item from the list to be selected at a time, by pressing the CTRL or SHIFT key while selecting + Allows to select more than one Item from the list, using CTRL-click. + + + + @@ -2269,9 +2271,10 @@ typically has a different color from the other items.
- Event handler for drawing an item. + Handler for special painting of an item (in owner-draw mode). + @@ -2281,9 +2284,9 @@ typically has a different color from the other items.
- Event handler when an item requires to be measured + Handler invoked when the height of an item is required. - + @@ -2297,12 +2300,7 @@ typically has a different color from the other items.
- - OnSelectionChange - - - - - event handler for changing the Item selected + Handler invoked when an item is selected. @@ -2311,26 +2309,25 @@ typically has a different color from the other items.
- + The virtual width of the ListBox, in pixels. + + This property determines, how far the listbox can be scrolled horizontally. + In a multi-column ListBox it also determines the total number of vertical columns, together with Columns. - - + The number of selected iems in the list. - + + + - - Selected - - - -- whether the Item with given Index has been selected + Get or set the Selected state of an item. @@ -2339,49 +2336,41 @@ typically has a different color from the other items. - - Sorted - - - - - whether the selected Items in the list have been arranged in alphabetical order + Determines whether the list entries are sorted. + Setting this property to True enforces ascending alphanumeric case-insensitive sorting of the list. + When True, new entries are added in sort order, not to the end of the list. + - - Style - - - -of List Box - normal, owner-draw fixed, or owner-draw variable - - - - Reads or writes information in flag; default is -1 - - + Appearance of the ListBox - normal, owner-draw fixed, or owner-draw variable. + - - Topindex - the highest value of Index in this list + Index of the first visible (topmost) item. - + + + - : a simple string list from which a choice is made + A scrollable list of strings. -

The array of strings is held in Items +

The strings are stored in the Items list.

-

Clicking on the ellipsis (...) next to the Items entry in the Object Inspector at design-time opens a string-list editor in which the individual text-strings for the list can be entered or edited. The editor also allows the entries to be sorted alphabetically in normal or reverse order.

+

At design time a click on the ellipsis (...) next to the Items entry in the Object Inspector + opens an string-list editor, in which the individual text-strings for the list items can be entered or edited. + The editor also allows the entries to be sorted alphabetically in normal or reverse order.

+
@@ -2447,59 +2436,21 @@ of List Box - normal, owner-draw fixed, or owner-draw variable
- The base class for TEdit. + The base class for controls presenting editable text. -

This control deals, for example, with issues such as selection of text sub-strings within the whole text string which are to be edited (cut, pasted, deleted, highlighted etc)

+

This class implements various visual attributes of the control and its contained text, + as well as simple editing and clipboard operations. +

+

Text attributes (bold, italic...) are not supported. + [see TSynEdit...?] +

- - FAutoSelect: Boolean - -

Private variable for property AutoSelect.

-

When True, the edit control will select all its text when:

-
    -
  • It receives focus
  • -
  • The Enter key is pressed.
  • -
  • A new item is selected.
  • -
-
- -
- - - FAutoSelected: Boolean - Private variable for property AutoSelected. - -True indicate that the edit or combobox control has just performed -an AutoSelect opertation so that subsequent mouse-clicks and keystrokes -proceds normally without selecting the text. - -False is set when the edit or combobox control loses focus. - - - - - FCharCase: TEditCharCase - -

Private variable for property CharCase. - -Indicates how text is displayed in a text editing control.

-
    -
  • Normal case letters
  • -
  • Upper case letters
  • -
  • Lower case letters
  • -
-
- - - - - - -
- + + + @@ -2576,12 +2527,9 @@ Indicates how text is displayed in a text editing control.

- - Sets AutoSelect if appropriate, after calling the inherited method. - - Nothing special happens in csDropDownList (read only) style. - Else if the control was entered by a keystroke, the whole edit text is selected; - if the whole text is selected, AutoSelected becomes True. + Invokes the OnEnter handler, then selects the entire text when AutoSelect is True. + + This special handling is required when the control is entered by keystrokes, not by a mouse click. @@ -2589,15 +2537,7 @@ Indicates how text is displayed in a text editing control.

- - - DoExit - disables AutoSelect then calls inherited method - - - - TWinControl.DoExit - - + @@ -2672,25 +2612,8 @@ Indicates how text is displayed in a text editing control.

- - - KeyUp calls inherited method then processes according to the identity of Key - - - - - TWinControl.KeyUp - - - - - - - - - - + Prevents keystrokes from acting as accelerators. @@ -2700,7 +2623,7 @@ Indicates how text is displayed in a text editing control.

- + Selects the entire text when AutoSelect is True. @@ -2728,16 +2651,11 @@ Indicates how text is displayed in a text editing control.

- - SelectAll - - - - text, for example in order to copy or delete it + Selects the entire text in the control. - Removes the selected text. + Deletes (removes) the selected text. @@ -2749,158 +2667,144 @@ Indicates how text is displayed in a text editing control.

- - put a copy of the clipboard contents at the current writing position + Inserts text from the clipboard at the current position, possibly replacing the selected text. - - Undo the last edit action + Reverts the last edit action. - whether text is left- or right-justified, or centered + The horizontal adjustment of the text - left, right, or centered. - : if True, the edit control will select all its text when it receives focus or when the Enter key is pressed. + If True, the edit control will select all its text when it receives focus or when the Enter key is pressed. - - AutoSelected - - - -: if True, indicates that the edit control has just performed an AutoSelect operation + True when the text selection was established automatically. -

If True, indicates that the edit control has just performed an AutoSelect operation so that subsequent mouse-clicks and keystrokes proceed normally without selecting the text.

-

False is set when the edit control loses focus.

+
- - + Allows to adjust the control to the extent of the contained text.[?] - - - - + - - CanUndo - if True, the Undo action is permitted + Indicates whether recent changes can be reverted. - - CaretPos - the position of the Caret indicator in the text + The position of the text cursor. + +

+ Character positions are relative to the string, independent of LTR/RTL display.[?] + The position reflects logical (UTF-8) characters.[?] +

+ Position zero is right before the first character. +

+ If there is a selection, the caret is considered to be right after + the last selected character. +

+
- - CharCase - rules for what case to use (upper or lower) to display text + Allows to force the text into all upper or lower case. -

Indicates how text is displayed in a text editing control in the following ways:

+

The following conversions can be specified:

    -
  • Normal case letters
  • -
  • Upper case letters
  • -
  • Lower case letters
  • +
  • Unchanged
  • +
  • All upper case letters
  • +
  • All lower case letters
-

The rules can, of course, be overridden by use of the shift key.

+ According conversions apply to the entire text, and can not be reverted.
- - EchoMode - - - -- how to echo keypresses on screen: normal (returning the actual character for that key), all upper or lower case, or a masking character as used in entering passwords + Allows to modify the text display, useful for entering passwords. + +

The following conversions can be specified:

+
    +
  • emNormal: Unchanged
  • +
  • emNone: All spaces
  • +
  • emPassword: All PasswordChars
  • +
+ According conversions apply to the entire text, and can not be reverted. +
- - HideSelection: hide the selection when control has no focus - Allows to turn on the persistent selection. Therefore when control loses focus it still highlights the selected text. + Allows to hide the selection, when the control doesn't have the focus. + - - MaxLength: maximum length allowed for text string - MaxLength determines the maximum number of characters allowed in a TCustomEdit. When its value is 0, the user is allowed to enter any number of characters. - -Unlike VCL, if a text set through the Text property has more characters then MaxLength it will be truncated. It's not possible to implement the VCL behavior due to characteristics of non win32 widgetsets. + The maximum length of the text; zero for unlimited. + + In Delphi MaxLength only limits user input. The LCL instead restricts the maximum length of the contained text; + this simplifies the implementation for non-Win32 widgetsets. + - Whether the text has been modified - Modified: has the text been modified since creation? - + True when the text has changed [how?]. + Reset whenever the changed text was stored (saved) by code. - - OnChange - event handler for any change in text + Event handler for any change in text. - - PasswordChar - - - -: the character which appears in the Edit box replacing and masking the actual character typed + Allows to obfuscate the displayed text, showing all characters as PasswordChar. -

- PasswordChar - - - -: the character which appears in the Edit box replacing and masking the actual character typed.

-

Typically used in password input, to prevent the typed characters from being seen by passers-by or casual observers (or even malicious observers!)

+

Typically used in password input, to hide the input from other viewers. +

+ Malware still can read the Text property (WM_GETTEXT), to get the real text.
+
- - ReadOnly - - - -- the contents of the edit box may only be read, not written or erased + Prevents the user from changing the text. - - SelLength - - - -: the length (in characters) of the text that has been selected for editing + The number of currently selected characters. + + + + + - - Sel Start: - - - - the index of the character from which selection (for editing) begins + The zero-based index of the first character in the selection. + + + + - - Sel Text - - - -: the string within the edit control that has been selected for editing + The selected text in the edit box. + Assign an new string to replace the selected text. + + + + + + @@ -2944,7 +2848,28 @@ Unlike VCL, if a text set through the Text property has more characters then Max - The base class for TMemo, based on TCustomEdit. + The base class for multi-line text controls. + +

+ The text in a multi-line control can be accessed in two ways: +

+
    +
  • Lines allows access to every single line.
  • +
  • Lines.Text represents the entire text as one string.
  • +
+

The overhead involved with every property depends on the internal representation representation of the text, in the widget. + In either case multiple changes to the Text property should be done in a local copy, + written back after all changes have been applied. +

+

+ The logical lines (paragraphs) in Lines do not always match the displayed lines. + When WordWrap is True, every paragraph can wrap into multiple display lines. + [really?] +

+
+ + +
@@ -2974,27 +2899,20 @@ Unlike VCL, if a text set through the Text property has more characters then Max - - RealGetText - returns the contents of Lines.Text (overriding inherited method) + Returns the contents of Lines.Text, separated by [NewLine?]. TControl.RealGetText + - Returns the value found in Lines.Text, the area allocated for storage of the textual data of the Memo. - -

- -

-

The result is of type TCaption, a string type for the caption of a control: may be translated

-
+ The entire text in one string.
- - RealSetText - copies Value into Lines.Text (overriding inherited method) + Replaces Lines.Text. @@ -3002,17 +2920,17 @@ Unlike VCL, if a text set through the Text property has more characters then Max - + The entire text in one string. Lines are separated by LineFeed (LF) and/or CarriageReturn (CR) characters.[?] - + - Returns a False result + Always False, a cache is not implemented. The CachedText of type TCaption that is being fetched @@ -3026,14 +2944,7 @@ Unlike VCL, if a text set through the Text property has more characters then Max - - - SetLines - specify the text strings to occupy Lines - - - - - + @@ -3043,48 +2954,22 @@ Unlike VCL, if a text set through the Text property has more characters then Max - - - SetWantReturns - sets a boolean flag showing that Return characters are to be included in the edit strings - - - - + - - - SetWantTabs - sets a boolean flag to show that the use of tabs in the edit string is required - - - - - + - - - SetWordWrap - speifies the value of the WordWrap property - - - - - + - - - SetScrollBars - specifies the style of the scroll bars - - - - + @@ -3117,55 +3002,82 @@ Unlike VCL, if a text set through the Text property has more characters then Max - - procedure for adding a text string to the Memo + Appends a line to the text. - + The text in the line. - : an array of strings (single lines of characters) which contains the text held or being entered in the Memo + An array with one string for every line (paragraph) in the control. - The horizontal scroll bar for this memo + The horizontal scroll bar for this control. - The Vertical scroll bar for this memo + The vertical scroll bar for this control. - Whether the Memo has ScrollBars - none, horizontal or vertical or both, or automatically placed if needed + Adds vertical and/or horizontal scrollbars to the control. - Whether Return characters are required to be included in the memo - - + Allows the user to insert Return characters (line breaks) into the text. + +

+ The Enter key typically is used to press the default button in a form, + so that it cannot be used to add line breaks into the text. +

+ Setting WantReturns to True allows to enter line breaks, when the control has the focus. +

+ Even if WantReturns is False, CTRL-Enter inserts an line break. +

+
+ + +
- Whether Tab characters are required to be retained in the Memo - - + Allows to enter Tab characters into the text. + +

+ The Tab key is normally used to move the focus to the next control, + so that it cannot be used to add Tabs to the text. +

+ When WantTabs is True, the Tab key inserts a Tab character into the text, + instead of moving the focus to then next control. +

+ Even if WantTabs is True, the user can Tab into the control, but not out again. +

+
+ + +
- Is WordWrap enabled, allowing long words to be carried on to the next line? - Word Wrap: a logical flag to show whether or not word-wrap is enabled, ie if a word is close to the end of a line and is going to be too long for the line, it is wrapped down to the next line + Allows long logical lines (paragraphs) to wrap into multiple display lines. + + When False, long lines are truncated at the right margin of the control, + unless the text can be scrolled horizontally. + - Control with a single line of editable text. + A control with a single line of editable text. + @@ -3232,6 +3144,7 @@ Unlike VCL, if a text set through the Text property has more characters then Max +
@@ -3306,8 +3219,7 @@ Unlike VCL, if a text set through the Text property has more characters then Max
- The base class for TStaticText - + The base class for TStaticText. @@ -3336,7 +3248,7 @@ Unlike VCL, if a text set through the Text property has more characters then Max - + Defers the focus to FocusControl. @@ -3347,14 +3259,13 @@ Unlike VCL, if a text set through the Text property has more characters then Max - - GetLabelText - returns text string for label + Returns the Caption of the control. - + The Caption text. @@ -3370,25 +3281,12 @@ Unlike VCL, if a text set through the Text property has more characters then Max - - - SetFocusControl - specifies which control has focus - - - - - + - - - SetShowAccelChar - sets boolean flag to determine whether accelerator characters are to be shown - - - - + @@ -3412,29 +3310,29 @@ Unlike VCL, if a text set through the Text property has more characters then Max - - whether text is centered, left- or right-justified + The horizontal adjustment of the text - centered, left- or right-justified. - [?] + The border shown around the control. - [?] + The control that shall receive the focus instead of this control. - - underline the character in the static text that acts as an accelerator with a shortcut key + Makes the accelerator character stand out (underlined) of the displayed text. - + Makes the control either opaque or transparent. @@ -3444,7 +3342,8 @@ Unlike VCL, if a text set through the Text property has more characters then Max Control to display an constant text. -

Use this control to display a statement or comment that is not likely to change very often, or is not usually responsive to user actions

+

This control can be used instead of TLabel, when a TWinControl is required. +

@@ -3459,7 +3358,7 @@ Unlike VCL, if a text set through the Text property has more characters then Max - [?] + The text to show. @@ -3493,7 +3392,7 @@ Unlike VCL, if a text set through the Text property has more characters then Max - : ancestor class for several Button (including Radio Button) and Check Box classes + The base class for various button controls. @@ -3529,8 +3428,7 @@ Unlike VCL, if a text set through the Text property has more characters then Max - - DoOnChange - perform the code of the OnChange event + Invokes the OnChange handler. @@ -3548,25 +3446,22 @@ Unlike VCL, if a text set through the Text property has more characters then Max - - whether this button has been checked, which signifies selection + The state of the check mark. Here always False, can be implemented in derived classes. - Allows to disable clicks on this button. + Allows to disable clicks, without showing the button as disabled. - - event handler for any change in properties of the control + Handler for any [which?] change in properties of the control. - - provides a link between a button and its corresponding action - -

This class provides very few properties of its own, but inherits a lot from its ancestors, TWinControlActionLink, TControlActionLink, TActionLink and TBasicActionLink -

-
+ Links an button to an action. +
@@ -3576,8 +3471,7 @@ Unlike VCL, if a text set through the Text property has more characters then Max - - AssignClient calls inherited method then sets up client as a ButtonControl + Installs the client button. @@ -3589,8 +3483,7 @@ Unlike VCL, if a text set through the Text property has more characters then Max - - SetChecked - writes Checked status of button to local variable + Sets the Checked property of the linked button. @@ -3601,12 +3494,7 @@ Unlike VCL, if a text set through the Text property has more characters then Max - - - - - - + @@ -3616,10 +3504,9 @@ Unlike VCL, if a text set through the Text property has more characters then Max - + - - TCustomButton - the base class for TButton and TBitBtn + The base class for clickable buttons (TButton and TBitBtn). @@ -3679,7 +3566,7 @@ Unlike VCL, if a text set through the Text property has more characters then Max
- + Notifies Parent of focus changes. @@ -3693,29 +3580,19 @@ Unlike VCL, if a text set through the Text property has more characters then Max + Propagates ModalResult to the parent form, before further processing. + -

- the procedure which allows programmatic simulation of a mouse click, and thus activation of the Action associated with the OnClick event -

TControl.Click - - Click - checks if the parent form has a Modal Result, then calls inherited method
- - - - - - - - - + @@ -3758,16 +3635,14 @@ Unlike VCL, if a text set through the Text property has more characters then Max - - WSSetDefault - writes the default widget set to local variable + Notify the widget of dynamic changes of the Default property. - - WSSetText - writes the text name of the widget set to a local variable + Notify the widgetset of changes in the Caption and/or accelerator. @@ -3776,22 +3651,11 @@ Unlike VCL, if a text set through the Text property has more characters then Max - - - - - - - - - Loaded calls inherited method, checks to see whether it is a default or cancel control, sets the default widget set - - TWinControl.Loaded - - + + - + Update the parent form's Default and Cancel properties. @@ -3806,18 +3670,16 @@ Unlike VCL, if a text set through the Text property has more characters then Max + Invoke Click if the control is Active or Default. TControl.ExecuteDefaultAction - - ExecuteDefaultAction if the control is active or default, executes the Click action - - ExecuteCancelAction if this is a Cancel button, executes the Click action + Invoke Click if the control is the Cancel button. @@ -3825,64 +3687,48 @@ Unlike VCL, if a text set through the Text property has more characters then Max - - - - - + - - - - - + - - - - - - + - Is this control Active - has it got Focus; is the mouse over it? + True if this control is the Cancel or Default button.[?] - Is this the Cancel button? (default setting is False) + True if this is the modal Cancel button. -

Setting this property to true, will have the effect that when the user hits ESC this button is Clicked, even if the button does not have focus. Usually the Button which reacts to ESC sets the ModalResult of the form to mrCancel.

+

Pressing ESC in a modal form is equivalent to pressing the Cancel button.

- - - - + - Is this the Default button? (default setting is False) + True if this is the modal Default button. -

Defines if a button is the Default on a form. That is, pressing ENTER will execute its onClick method, whether the control has focus or not!

+

Pressing ENTER in a modal form is equivalent to pressing the Default button.

- Determines whether the button closes its modal parent form. - The default value is mrNone. + When clicked, the button will close the form and return its ModalResult. (unless mrNone) + - + [?] @@ -3890,7 +3736,7 @@ Unlike VCL, if a text set through the Text property has more characters then Max - + [?] @@ -3900,17 +3746,11 @@ Unlike VCL, if a text set through the Text property has more characters then Max - [?] + A push button control. [?] - - [?] - If you want to programmatically Click on a button you can call its Click method. This will have the same effect as a user clicking on the button. - - - - + @@ -3958,20 +3798,20 @@ Unlike VCL, if a text set through the Text property has more characters then Max - The states of a checkbox. - The possible states of a Check Box are: Unchecked, Checked or Greyed + The states of a checkbox - Unchecked, Checked or Greyed. + - The check box has no check mark, indicating that the user has not selected the option. + The check box has no check mark, indicating that the item is not selected. - The check box has a check mark in it, indicating that the user has selected the option. + The check box has a check mark in it, indicating that the item is selected. @@ -3980,7 +3820,7 @@ Unlike VCL, if a text set through the Text property has more characters then Max - The ancestor class for of all check-box components. + The base class for checkbox components.

Check boxes present the user with options that can be selected (checked) or deselected (unchecked).

@@ -3994,28 +3834,18 @@ Unlike VCL, if a text set through the Text property has more characters then Max - - - - - - + - - - - - - + - + Invokes either the OnClick or OnChange handler. @@ -4026,16 +3856,14 @@ Unlike VCL, if a text set through the Text property has more characters then Max - -

- the procedure which allows programmatic simulation of a mouse click, and thus activation of the Action associated with the OnClick event -

+ Overridden to do nothing.
- + Invokes either the OnClick or OnChange handler. @@ -4045,8 +3873,7 @@ Unlike VCL, if a text set through the Text property has more characters then Max - - RetrieveState - returns the value for check box state + Retrieves the checkbox state from the widget. @@ -4058,9 +3885,8 @@ Unlike VCL, if a text set through the Text property has more characters then Max - - Toggle - method to alternate between checked and unchecked states on successive activations - + Alternate between checked and unchecked state. + [What about disabled state?] @@ -4078,12 +3904,7 @@ Unlike VCL, if a text set through the Text property has more characters then Max - - - - - - + @@ -4094,8 +3915,7 @@ Unlike VCL, if a text set through the Text property has more characters then Max - - ApplyChanges - method for applying specified changes + Asks the widget to update the visual appearance of the object. @@ -4106,28 +3926,14 @@ Unlike VCL, if a text set through the Text property has more characters then Max - - - Loaded - sends the State of the box to the interface before calling inherited method - - - - TComponent.Loaded - TWinControl.Loaded - - + - - - - - - + @@ -4140,7 +3946,7 @@ Unlike VCL, if a text set through the Text property has more characters then Max - Determines whether the check box can be in a "grayed" state. + Allows the check box to be in a "grayed" state.

If AllowGrayed is set to True, the check box has three possible states: checked, unchecked and grayed. If AllowGrayed is set to False, the check box has only two possible states: checked and unchecked.

@@ -4148,7 +3954,7 @@ Unlike VCL, if a text set through the Text property has more characters then Max
- Indicates whether the check box is checked (selected), unchecked (deselected) or grayed. + Indicates whether the check box is checked (selected), unchecked (deselected) or grayed (disabled).

See TCheckBoxState for possible values of State.

@@ -4156,7 +3962,7 @@ Unlike VCL, if a text set through the Text property has more characters then Max
- + [?] @@ -4164,7 +3970,7 @@ Unlike VCL, if a text set through the Text property has more characters then Max - + [?] @@ -4175,7 +3981,7 @@ Unlike VCL, if a text set through the Text property has more characters then Max - - a small box which can contain a check mark to indicate that it has been selected + A label with a box which can contain a check mark. @@ -4238,9 +4044,10 @@ Unlike VCL, if a text set through the Text property has more characters then Max - : a labelled box capable of being checked or unchecked + A labelled box capable of being checked or unchecked[???] -

The Application Programmer is responsible for ensuring that the OnClick event handler recognises the State of the box, takes the appropriate Action and places the State into the next appropriate value

+

The Application Programmer is responsible for ensuring that the OnClick event handler recognises the State of the box, + takes the appropriate Action and places the State into the next appropriate value

@@ -4248,15 +4055,7 @@ Unlike VCL, if a text set through the Text property has more characters then Max
- - - - - - - - - + @@ -4305,14 +4104,19 @@ Unlike VCL, if a text set through the Text property has more characters then Max - : a button that works with other Radio Buttons in a mutually exclusive way - if one button is selected, none of the others in the group can be selected + A selection button that works with other Radio Buttons in a mutually exclusive way - if one button is selected, none of the others in the group can be selected. -

The Application Programmer is responsible for ensuring that the OnClick event handler for each button has a unique Action, and that the Actions of the other (deselected and therefore inactive) buttons are turned off.

+

The Application Programmer is responsible for ensuring that the OnClick event handler for each button has a unique Action, + and that the Actions of the other (deselected and therefore inactive) buttons are turned off.

TRadioGroup behaves differently from a group of TRadioButton controls placed arbitrarily around a form.

-

In the case of TRadioButton, the mutual exclusivity is a feature that applies to any RadioButton anywhere in the Form, and the RadioButtons can be rearranged in any order or placed anywhere within the containing Form, while in TRadioGroup the exclusivity applies only to buttons within the Group, which are ordered strictly according to their ItemIndex within the Items stringlist.

+

In the case of TRadioButton, the mutual exclusivity is a feature that applies to any RadioButton anywhere in the Form, + and the RadioButtons can be rearranged in any order or placed anywhere within the containing Form, + while in TRadioGroup the exclusivity applies only to buttons within the Group, + which are ordered strictly according to their ItemIndex within the Items stringlist.

- TRadioButton is an entity in itself, with a number of additional properties, whereas the buttons within TRadioGroup are not separate entities, but rather are simply entries in a list of strings, each of which is associated with the on-screen image of a RadioButton.

+ TRadioButton is an entity in itself, with a number of additional properties, whereas the buttons within TRadioGroup are not separate entities, + but rather are simply entries in a list of strings, each of which is associated with the on-screen image of a RadioButton.

The example shows the difference between the use of TRadioButton and TRadioGroup

@@ -4325,12 +4129,7 @@ Unlike VCL, if a text set through the Text property has more characters then Max - - - - - - + @@ -4344,25 +4143,9 @@ Unlike VCL, if a text set through the Text property has more characters then Max - - - - - - - - - + - - - - - - - - - + @@ -4417,7 +4200,7 @@ Unlike VCL, if a text set through the Text property has more characters then Max - : the base type from which TLabel is derived. + The base class for TLabel. @@ -4447,8 +4230,7 @@ Unlike VCL, if a text set through the Text property has more characters then Max - - CanTab - always set to False, as you can't tab to a label + Always False, as you can't tab to a label. @@ -4460,8 +4242,7 @@ Unlike VCL, if a text set through the Text property has more characters then Max - - DoMeasureTextPosition - method for measuring position of text; shows position of top and left edges + Determines the origin of the text, within the control. @@ -4474,8 +4255,7 @@ Unlike VCL, if a text set through the Text property has more characters then Max - - HasMultiLine - returns True if label has multiple lines + Searches for newline characters in the text. @@ -4484,12 +4264,7 @@ Unlike VCL, if a text set through the Text property has more characters then Max - - - - - - + @@ -4501,7 +4276,7 @@ Unlike VCL, if a text set through the Text property has more characters then Max - + Determines the text extent, base on a maximum field width. @@ -4510,7 +4285,7 @@ Unlike VCL, if a text set through the Text property has more characters then Max
- + Where wordwrap may start. @@ -4529,12 +4304,7 @@ Unlike VCL, if a text set through the Text property has more characters then Max - - - - - - + @@ -4550,12 +4320,7 @@ Unlike VCL, if a text set through the Text property has more characters then Max - - - - - - + @@ -4566,7 +4331,7 @@ Unlike VCL, if a text set through the Text property has more characters then Max - [what's special?] + Defers the focus to the FocusControl. @@ -4575,15 +4340,7 @@ Unlike VCL, if a text set through the Text property has more characters then Max - - - Notification calls inherited method and adjusts focus, if required - - - - TControl.Notification - - + @@ -4592,8 +4349,7 @@ Unlike VCL, if a text set through the Text property has more characters then Max - - GetLabelText - returns the string for text of the label + Returns the Caption string. @@ -4640,7 +4396,7 @@ Unlike VCL, if a text set through the Text property has more characters then Max - + Handles OptimalFill. @@ -4655,7 +4411,8 @@ Unlike VCL, if a text set through the Text property has more characters then Max - Calculate the height of the font needed to fit the available space, given the MaxWidth and MaxHeight constraints + Calculate the maximum height of the font needed to fit the available space, + given the MaxWidth and MaxHeight constraints @@ -4688,7 +4445,7 @@ Unlike VCL, if a text set through the Text property has more characters then Max - If True, attempts to adjust font for an optimal fill of the space available + If True, attempts to adjust font for an optimal fill of the space available. @@ -4699,15 +4456,7 @@ Unlike VCL, if a text set through the Text property has more characters then Max - - - - - - - - - + @@ -4722,7 +4471,7 @@ Unlike VCL, if a text set through the Text property has more characters then Max - Horizontal text justification (centered, left- or right-justified) + Horizontal text justification (centered, left- or right-justified). @@ -4748,7 +4497,7 @@ Unlike VCL, if a text set through the Text property has more characters then Max

E.g. when you have a NameEdit1 control on a form, preceded by a label NameLabel1, you can set NameLabel1.FocusControl to NameEdit1, and NameLabel1.Caption to '&Name'. - This makes the NameLabel1 displayed as Name. + This makes the NameLabel1 displayed as 'Name' [should be underlined, but fpdoc errors on 'Name' ?].

@@ -4762,11 +4511,11 @@ Unlike VCL, if a text set through the Text property has more characters then Max
- If True, font size is adjusted for optimal fill of available space. + If True, the font size is adjusted for optimal fill of the available space. - Vertical adjust - underline the character in the label that acts as an accelerator with a shortcut key + Underlines the character in the label that acts as an accelerator with a shortcut key.

When False, ampersands '&' in the label's caption are displayed as ordinary characters (as in the Object Inspector). @@ -4780,10 +4529,10 @@ Unlike VCL, if a text set through the Text property has more characters then Max - - whether the viewer can see through the control. Default True [Delphi: False?] + Whether the viewer can see through the control. Default True [Delphi: False?]

- Opaque Labels have their enclosing (client) rectangle filled with the background color of the label. + Opaque Labels have their enclosing rectangle filled with the background color of the label. This can be the color of the Parent control, when ParentColor is True.

Setting Transparent to True makes the label transparent, not hiding any background details. @@ -4792,7 +4541,7 @@ Unlike VCL, if a text set through the Text property has more characters then Max while Transparent=True doesn't obscure so much of the graphic.

- +
@@ -4808,9 +4557,10 @@ Unlike VCL, if a text set through the Text property has more characters then Max - : a brief text label to be placed in the Form near any object that needs to be identified. + Control to show static text, possibly in multiple lines. + @@ -4866,36 +4616,55 @@ Unlike VCL, if a text set through the Text property has more characters then Max How to use StdCtrls, ComCtrls or ExtCtrls -

The Units StdCtrls, ComCtrls and ExtCtrls contain definitions and descriptions of many of the most commonly used controls for constructing Forms and other Objects in Lazarus Applications.

-

Many of the final target controls that the application developer wants to use, such as TButton, TMemo, TScrollBar etc, have a corresponding ancestor class such as TCustomButton, TCustomMemo or TCustomScrollBar. Several of the properties and methods relevant to the final target control are defined (and explained) more fully in the TCustomXXX class, and are inherited by the final target control.

-

If you drop a component on the form editor you don't need to add code explicitly to create it. The component is automatically created by the IDE together with the form, and destroyed when the form is destroyed.

-

However, if you create the component yourself by code don't forget to free it when it is no longer needed.

-

If you place a component on the Form Designer and look at the Object Inspector, you can observe the properties change as you move the component around.

-

For example, if you place a button (TButton) on the form, click on it to select it, then move it around the form with the mouse, you can watch the values of Top and Left change in the Object Inspector to reflect the new position. If you use the object's re-sizing bars to adjust its size, you can watch the Height and Width properties change as well.

-

On the other hand, by using the Object Inspector, you can select the value associated with a property such as height, and type in a new value; you can watch the size of the object on the form change to reflect the new value.

-

You can also explicitly change the properties of the object in code by typing (in the appropriate Implementation section of the Source editor), for example

+

+ The Units StdCtrls, ComCtrls and ExtCtrls contain definitions and descriptions + of many of the most commonly used controls for constructing Forms and other objects in Lazarus GUI applications. +

+ Most controls are split into a final class, such as TButton, TMemo, TScrollBar etc., + and a corresponding ancestor class such as TCustomButton, TCustomMemo or TCustomScrollBar. + The final class is designed for immediate use, it almost only publishes the properties of the control. + The corresponding custom ancestor class (TCustomXXX) can be used to derive controls with special (customized) appearance or behaviour. +

+ If you drop a component from the component palette on the form editor you don't need to add code explicitly to create it. + The component is automatically created by the IDE together with the form, and destroyed when the form is destroyed. +

+ However, if you create the component yourself by code, and don't specify an Owner for it (Create(Nil)), + you are responsible for freeing the component when it is no longer needed. + You better construct it with Create(Self), where Self means the containing Form or Parent control. +

+ A control also must have a Parent control, maybe the Form, so that it can become visible within the client area of its Parent. + The Top and Left properties specify the placement of the control within its Parent. + The Object Tree reflects the Parent-Client relationships of all controls on the form. +

+ Unlike controls, mere components are invisible at runtime (Open Dialogs...). + Controls can be made invisible at runtime as well, by setting their Visible property to False. +

+ If you place a component on the Form Designer and look at the Object Inspector, + you can observe the Top and Left properties change as you move the component around. + The same for the Width and Height properties, when you resize a control by dragging it's size grips. +

+ When you modify the properties in the Object Inspector, the control on the form will reflect the changes as well. +

+ You can also explicitly change the properties of the object in code by typing (in the appropriate Implementation section of the Source editor), for example +

Form1.Button1.Height := 48; -

If you type this new value into the Source Editor and then look back at the Form Designer, you will see that the button on the Form has taken the new size. The new value will also be shown in the Object Inspector.

-

In summary, there are usually about three different ways to determine each property of an object:

+

In summary, there are usually about three different ways to determine each property of a component:

  • by using the mouse,
  • by setting the values in the Object Inspector,
  • or explicitly by writing code.
-

The components defined in these Units have several properties that are common to most of them, and other properties that are specific to the individual components. We shall describe the most common ones here. Unusual or control-specific properties will be described for the individual controls.

-

Additional Help can always be obtained by selecting a property or keyword, in either the Object Inspector or the Source Editor, and pressing F1. You will be taken by your Help browser to the appropriate page in the documentation.

-

If the description of a property on that page is insufficient, you can navigate to the corresponding description in the ancestor classes, by selecting the links in the Inheritance listing or by selecting the ancestor Type in the declaration of the object.

- Constructors such as Create allocate memory and system resources needed by the object. They also call the constructor of any sub-objects present in the class.

-

- Destructors: remove the object and de-allocate memory and other resources. If you call Destroy for an object which hasn't being initialized yet it will generate an error. Always use the Free method to deallocate objects, because it checks whether an object's value is nil before invoking Destroy.

-

Take the following precautions when creating your own Destroy method:

-
    -
  • Declare Destroy with the override directive, because it is a virtual method.
  • -
  • Always call 'inherited Destroy;' as the last thing on the destructor code.
  • -
  • Be aware that an exception may be raised on the constructor in case there is not enought memory to create an object, or something else goes wrong. If the exception is not handled inside the constructor, the object will be only partially built. In this case Destroy will be called when you weren't expecting it, so your destructor must check if the resources were really allocated before disposing of them.
  • -
  • Remember to call Free for all objects created on the constructor.
  • -
+ The components defined in these Units have several properties that are common to most of them, + and other properties that are specific to the individual components. + We shall describe the most common ones here. + Unusual or control-specific properties will be described for the individual controls. +

+ Additional Help can always be obtained by selecting a property or keyword, in either the Object Inspector or the Source Editor, and pressing F1. + You will be taken by your Help browser to the appropriate page in the documentation. +

+ If the description of a property on that page is insufficient, you can navigate to the corresponding description in the ancestor classes, + by selecting the links in the Inheritance listing or by selecting the ancestor Type in the declaration of the object.

- + - + - + - + - + - + - + - + - + - + - + - + - + @@ -4960,27 +4749,32 @@ Unlike VCL, if a text set through the Text property has more characters then Max - + - + - + - + - + - + @@ -4988,92 +4782,154 @@ Unlike VCL, if a text set through the Text property has more characters then Max - + - + - + - + - + - +
Some commonly listed properties
@@ -4904,55 +4673,75 @@ Unlike VCL, if a text set through the Text property has more characters then Max
ActionThe main action or event associated with the object. For example selecting an 'Exit' Button might cause the 'Close' actionUse Action when e.g. a button and a menu entry shall perform the same task, e.g. the Close action. +
AlignDefines the way in which an object is to be lined up with the parent object. Possible values are alTop (placed at the top and using the full available width), alBottom, alLeft (placed at the left and using the full available height), alRight. alNone (place anywhere on parent control) or alClient (takes all available space next to controls aligned to top, bottom, left or right)Defines how a control is lined up within its parent control. Possible values are + alTop, alBottom (stacked at the top or bottom, using the full available width), + alLeft, alRight (placed at the left or right, using the full available height), + alNone (place anywhere on parent control) or + alClient (takes all available space left over by other controls). +
AnchorUsed to keep a control a certain distance from the defined edges of a parent control, when the parent is resized. For example [akBottom, akRight] will keep the control a fixed distance from the bottom right corner.Used to keep a control at a fixed distance from the edges of its Parent control, when the Parent is resized. + For example [akBottom, akRight] will keep the control a fixed distance from the bottom right corner. + Anchoring both [akLeft, akRight] will make the control extend or shrink in Width, together with its Parent. +
AutoSelectWhen True, an editing control will select all its text when it receives focus or when the Enter key is pressed.When True, a text control will select all its text when it receives focus or when the Enter key is pressed.
AutoSelectedTrue indicate that the edit or combobox control has just performed an AutoSelect operation so that subsequent mouse-clicks and keystrokes proceed normally without selecting the text.True indicate that the edit or combobox control has performed an AutoSelect operation, + so that subsequent mouse-clicks and keystrokes proceed normally without selecting the text.[~remove this?] +
BorderSpacingThe space around the edge between an Anchored control and its parent.The space around the edge between an [Anchored???] control and its siblings [parent?].
CaptionThe text that is displayed on or near the control; it should preferably give some clue as to the function of the control, or an instruction such as 'Close' or 'Execute'. By default Caption is set to be the same as the 'Name' property, and the application programmer should substitute meaningful text instead of the default values.The text that is displayed on the control; it should preferably give some clue as to the function of the control, + or an instruction such as 'Close' or 'Execute'. + By default Caption is set to be the same as the 'Name' property, and the application designer should substitute meaningful text instead of the default values.
CharCaseIndicates how text is displayed in a text editing control: Normal (retaining the case of the letters typed by the user), converted to uppercase, or converted to lowercaseIndicates how text is displayed in a text editing control: + Normal (retaining the case of the letters typed by the user), + converted to uppercase, or converted to lowercase
ConstraintsSets the minimum and maximum sizes for a control. If a control is resized the new dimensions are always within the ranges given here. You should take care when setting these options that they do not conflict with the Anchors and Align settings.Sets the minimum and maximum sizes for a control. + If a control is resized the new dimensions are always within the ranges given here. + You should take care when setting these options that they do not conflict with the Anchors and Align settings.
ColorThe Colour to be used to draw the control or to write the text it contains.The Color to be used to draw the control's background [or to write the text it contains -> Font.Color!???]. +
EnabledA Boolean property to determine whether or not a control is capable of being selected and performing an action. If it is not Enabled, it is often Grayed out on the Form.Determines whether a control can be selected or perform an action. + If it is not Enabled, it is often Grayed out on the Form.
FontThe Font to be used for writing the text associated with the control - either the caption or label, or the text-strings contained within the control. The entry on the Object Inspector usually has a (+) box on the left, and selecting this box reveals further options such as character set, colour and size.The Font to be used for writing the text associated with the control - either the caption or label, or the text-strings contained within the control. + The entry on the Object Inspector usually has a (+) box on the left, and selecting this box reveals further options such as character set, color and size.
HintA short piece of informative pop-up text that appears if the mouse-cursor hovers over the control.A short informative pop-up text that appears when the mouse-cursor moves over the control.
Items
LinesAn array of strings, containing the textual data in controls with more than a single line of data, such as an Edit-Box or a Combo-Box. The array is zero-indexed, ie the lines are numbered [0..numLines-1]An array of strings, containing the paragraph texts in Memo controls. + The array index is zero-based, ie the lines are numbered [0..numLines-1]
NameThe identifier by which the control is known in the program. The IDE gives it a default name based on the underlying type, for example successive instances of TBitButton would be named Form1.BitBitton1 and Form1.BitButton2; it is up to the application programmer to give them more meaningful names such as ExitButton or OKButton. By default the Name of the control is applied to the Caption for the control, but the text of the Caption may be changed separately.The identifier by which the control is known in the program. + The IDE gives it a default name based on the underlying type, for example successive instances of TBitButton would be named Form1.BitBitton1 and Form1.BitButton2; + it is up to the application programmer to give them more meaningful names such as ExitButton or OKButton. + By default the Name of the control is applied to the Caption for the control, but the text of the Caption may be changed separately.
PopUpMenuA window containing context-sensitive menu information that pops up when the right mouse button is clicked on the object.A window containing context-sensitive menu entries, that pops up when the right mouse button is clicked on the object.
Position (or Top, Left)Determines where the control is located on the parent form or windowDetermines where the control is located on the parent form or control.
ReadOnlyBoolean property which, if True, signifies that the contents of the control can be read by the user or the calling routine, but cannot be written or changed.If True, the user cannot change the text in the control.
ShowHintAllows a small window containing a context-sensitive Help or other description to be displayed when the mouse cursor 'hovers' over the control.Allows to enable or suppress Hints. +
Size (or Height and Width)
StyleThe options available for Style depend upon the sort of Control being considered: for instance the Style may be defined by TFormStyle, TBorderStyle, TButtonStyle etc.The options available for Style depend upon the sort of Control being considered: + for instance the Style may be defined by TFormStyle, TBorderStyle, TButtonStyle etc.
TabOrderInteger defining where in the sequence of tabs on the Form this control is to lieSpecifies the sequence of controls, that are entered when the user presses the Tab key. +
TabStopBoolean property which if True places this control in the sequence of objects that the user can reach by successively pressing the Tab keySpecifies whether the control can be reached (or is skipped) by pressing the Tab key.
TextThe String of Text that represents the actual data that this control contains. Applies particularly to Text, Memo and StringList types of object. Most of the editing operations (such as Select, Clear, Cut, Copy) are performed in this part of the object, which holds the actual string being edited. If the control contains more than a single line of text, for example TMemo or TComboBox, then the textual elements are arranged as an array of strings (zero-indexed, ie numbered from [0..numLines-1]) in Lines.Like Caption, the user editable text that appears in the control. + Applies particularly to Edit, Memo and ComboBox types of controls. + Most of the editing operations (such as Select, Clear, Cut, Copy) are performed in this property. + If the control contains more than a single line of text, + then the textual elements are arranged as a zero-based array of strings in Lines (TMemo) + or Items (TListBox, TComboBox). +
VisibleIf true, the object can be seen on the Form; if False, object is hiddenIf true, the control can be seen on the Form; if False, it is hidden.
WordWrapLogical flag to show whether or not word-wrap is enabled, ie if a word comes close to the end of a line and is going to be too long for the line, it is wrapped down to the next line.Allows to wrap the Text into multiple lines. + When False, the text is clipped at the right margin of the control, but it still can be inspected by moving the caret within the text. +
-

Many actions are commonly listed in the 'Events' tab of the Object Inspector. If you select an entry in the list, a ComboBox appears with a DropDown list showing any actions that have aleady been defined, and allowing you to choose one to be associated with this event. Alternatively you can select the ellipsis (three dots ...) and you will be taken to an area of the Source Editor where you can begin typing your own action instructions for the selected event.

-

While a large number of events is available for any given control, in practice it is only necessary to populate a few of them. For most controls, it is sufficient to provide coding for 'OnClick'; for more complex controls it may be necessary also to provide for 'OnEntry' (when the mouse cursor enters the Control and gives it focus) and 'OnExit' (when the mouse cursor leaves the Control; or you may need to write an event handler for 'OnChange' or 'OnScroll', depending on the nature of the particular control with which you are dealing.

-

The pop-up menu that appears when you right-click an object in the Form Designer has, as its first item: 'Create default event' and selecting this option will have the same effect as selecting the ellipsis in the Object Inspector for the default event, usually OnClick: you are taken to the Implementation area of the Source Editor where you can type the code for the event handler.

-

A common strategy in Object-Oriented programming is to provide an ActionList with the facility for entering, removing or editing a number of pre-defined actions from which the most appropriate can be selected to use in any particular instance.

+

The 'Events' tab in the Object Inspector contains a list with events, which can occur for this control. + If you select an entry in the list, a ComboBox appears with a DropDown list showing any event handlers that have aleady been defined, + and allowing you to choose one for this event. + Alternatively you can select the ellipsis (three dots ...) and you will be taken to the Source Editor, + where the Object Inspector created an new event handler method for you. + You also can type the name of your handler in the Object Inspector and press Enter, to create a new handler method. +

+

While a large number of events is available for any given control, in practice it is only necessary to populate a few of them. + For most controls, it is sufficient to provide coding for 'OnClick'; for more complex controls it may be necessary also to provide for + 'OnEntry' (when the control receives the focus) and + 'OnExit' (when the control looses the focus); + or you may need to write an event handler for 'OnChange' or 'OnScroll', depending on the nature of the particular control with which you are dealing. +

+

+ Many controls have a default event, usually OnClick, for which an handler is created with a double click on the control. + Or right click on the control, and select the first entry: 'Create default event'. +

+

A common strategy in Object-Oriented programming is to provide an ActionList + with the facility for entering, removing or editing a number of pre-defined actions, + from which the most appropriate can be selected to use in any particular instance [of?]. +

- + + - + - + - + - + - + - + - + - + - - + + - + - + - + - +
Some commonly listed ActionsSome commonly listed Actions[???]
- ActionEvent Meaning
OnChangeAction to be taken if any change is detected (eg mouse move, mouse click, key press, edit text, alter picture, etc)Action to be taken if any change is detected (e.g. by mouse click, key press, edit text, etc)
OnClickAction to be taken when the (left) mouse button is clicked. This is usually the main or default action of the control; for example clicking on a button or checkbox initiates the action associated with the checkbox. It may alternatively initate a process of selection, for instance in a TextBox or Memo, or signal the beginning of painting with a Pen or Brush.Action to be taken when the (left) mouse button is clicked. + This is usually the main or default action of the control; for example clicking on a button or checkbox initiates the action associated with the checkbox. + It may alternatively initate a process of selection, for instance in a TextBox or Memo.
ClickClick[here???] A method to emulate in code the effect of clicking on a control. This method is most often found in Button-type controls (TButton, TBitBtn, TSpeedButton etc). A procedure can be written that calls the same code as the OnClick action. This facility can be particularly useful if the activation of one control by clicking causes a cascade of other controls to be activated, and the Click method can be used to initiate the action rather than having the user explicitly click on a lot of controls.
OnDragDropAction to be taken during Drag-Drop manoeuvres, ie when the mouse is used to 'capture' an item or some text etc and move it around the screen to a new location.Action to be taken when a dragged control has been dropped onto this control. + [OnDragOver?] +
OnEntryAction to be taken when the mouse cursor enters the area occupied by the object, usually transfering focus to that object. This might include changes in the appearance of the object such as highlighting or raising the border.Action to be taken when the control receives the focus. + This might include changes in the appearance of the object such as highlighting or raising the border.
OnExitAction to be taken when the mouse moves out of the area of the object, usually transferring focus out of the object.Action to be taken when control is about to loose the focus. + This is the right place for validity checks of user input, with a chance to disallow moving to a different control when the input is invalid. +
OnKeyPressAction to be taken for any key-press. Subtly different from OnKeyDown, which simply responds to a key being down, whether or not it was already down when focus was given to this control. OnKeyPress requires that a key becomes pressed while focus is in this control.Action to be taken on an entered character. Checks... +
OnKeyDownAction to be taken if a key is down while focus is in this control. Subtly different from OnKeyPress - for example the key might already have been down when focus entered this control, whereas OnKeyPress requires the key to become pressed while focus is in the control.Action to be taken if a key is down while focus is in this control. + This allows to filter or process control characters in a special way. +
On Key UpAction to be taken if a key is up (ie not pressed) while focus is in this control.OnKeyUpAction to be taken if a key goes up. This event occurs only once, while auto-repeated keystrokes trigger multiple OnKeyDown or OnKeyPress events. +
OnMouseMoveOn Mouse Down - Action to be taken if the mouse cursor moves while focus is in this control.Action to be taken if the mouse cursor moves over the control. + This event fires with every small move, while OnMouseEnter and OnMouseLeave occur only when the mouse enters or leaves the control. +
OnMouseDownAction to be taken if the mouse button is down while focus is in this control.Action to be taken when a mouse button is pressed over the control.
OnMouseUpAction to be taken if the mouse button is up while the cursor is over this control. Implies that the mouse button was previously down and has been released. The case where the cursor enters the control but the mouse button has not yet been pressed is covered by OnEntry or OnMouseEnter.Action to be taken if a mouse button goes up over the control. +
OnResizeAction to be taken when the control is resized. Might include re-alignment of text or selection of a different font size etc.Action to be taken when the control is resized. Might include re-alignment of text or selection of a different font size etc. + Do not mix up with AutoSize, or you ask for trouble! +
+

+ Constructors such as Create allocate memory and system resources needed by the object. + They also call the constructor of any sub-objects present in the class. +

+

+ Destructors: remove the object and de-allocate memory and other resources. + If you call Destroy for an object which hasn't being initialized yet it will generate an error. + Always use the Free method to deallocate objects, because it checks whether an object's value is nil before invoking Destroy. +

+

Take the following precautions when creating your own Destroy method:

+
    +
  • Declare Destroy with the override directive, because it is a virtual method.
  • +
  • Always call 'inherited Destroy;' as the last thing on the destructor code.
  • +
  • Be aware that an exception may be raised on the constructor in case there is not enough memory to create an object, + or something else goes wrong. If the exception is not handled inside the constructor, the object will destroyed immediately. + In this case Destroy will be called with a partially initialized object, + so your destructor must check if the resources were really allocated before disposing of them.
  • +
  • Remember to call Free for all objects created on the constructor.
  • +