diff --git a/docs/xml/lcl/extctrls.xml b/docs/xml/lcl/extctrls.xml index 7d8d23fa74..4b827c2ee3 100644 --- a/docs/xml/lcl/extctrls.xml +++ b/docs/xml/lcl/extctrls.xml @@ -122,13 +122,15 @@ - TCustomPage: The base type for Page + TCustomPage: The base type for + Page TCustomPage: The base type for the tabbed pages found in notebooks - Multi-PageControls - + + Multi-PageControls + @@ -269,7 +271,8 @@ - AdjustClientRect - adjust the size of the client rectangle to fit the specified coordinates ARect + AdjustClientRect - adjust the size of the client rectangle to fit the specified coordinates + ARect @@ -569,20 +572,24 @@ - TCustomNotebook: The base type for TNotebook and TPageControl + TCustomNotebook: The base type for TNotebook and TPageControl

- TCustom Notebook: The base type for TNotebook and TPageControl + TCustom Notebook: The base type for + TNotebook and + TPageControl

A notebook consists of several Pages, usually of similar type and kept indexed. They may contain Images listed in a table. One page is displayed at a time, but the other pages are indicated by tabs which may have their names on them, and a different page can be selected for display by clicking its tab

+ + Multi-PageControls +
- Multi-PageControls @@ -1011,6 +1018,7 @@ ActivePageComponent - the actual contents of the currently selected + Page @@ -1018,6 +1026,7 @@ ActivePage - the name (string) of the + Page that is currently selected and is available for interaction @@ -1042,6 +1051,7 @@ TabIndexAtClientPos - the index value of the Tab at the specified position + ClientPos @@ -1101,6 +1111,7 @@ CustomPage - returns the page specified by + Index @@ -1199,9 +1210,14 @@ - The set of Options for the Notebook: Show close buttons on the tabs, multi-line tabs - - + The set of Options for the Notebook: Show close buttons on the tabs, multi-line tabs + +

The set of Options for the Notebook:

+

+ nboShowCloseButtons (display a little CloseButton on the Tab next to the label, to allow the user to close that tab),

+

+ nboMultiLine (allows multi-line captions on the Tabs)

+
@@ -1273,7 +1289,7 @@
HowToUseStdCtrls - Multi-PageControls + Multi-PageControls
@@ -1405,18 +1421,23 @@ - TNotebook: A series of tabbed pages placed together to make a notebook + TNotebook: A series of tabbed + pages placed together to make a notebook

- TNotebook: A series of tabbed pages placed together to make a notebook

+ TNotebook: A series of tabbed + + pages placed together to make a notebook

A notebook consists of several Pages, usually of similar type and kept indexed. They may contain Images listed in a table. One page is displayed at a time, but the other pages are indicated by tabs which may have their names on them, and a different page can be selected by clicking its tab

Inherits most of its properties from TCustomNoteBook

+

To use a Notebook, select its icon from the 'Additional' tab of the Component Palette and place it on the Form. Adjust its size, position, alignment and anchoring as required, by moving the object on the Form or by using the Object Inspector.

+

Tabbed Pages are added to the NoteBook by selecting the control and right-clicking with the mouse to get a pop-up menu whose first item is 'Add Page'. Pages already in the NoteBook can be edited by selecting the appropriate ActivePage in the Object Inspector and modifying its properties or adding additional components to that Page.

- HowToUseStdCtrls - TPage - Multi-PageControls + + +
@@ -1599,9 +1620,14 @@
- - - + Set of Options for this Notebook. Include nboShowCloseButtons, nboMultiLine + + +

Set of Options for this Notebook. Include nboShowCloseButtons, nboMultiLine +

+

To use the Options, select the tag in the Object Inspector, then select for inclusion any of the listed options, setting them True or False as appropriate.

+

For example, setting nboShowCloseButtons to True will cause a CloseButton (a small CheckBox with an 'x' in it) to appear on each Tab of the NoteBook, allowing the tabbed Page to be closed when the user clicks on the CloseButton.

+
@@ -1846,11 +1872,13 @@ - TShape - An arbitrary graphic geometrical shape placed on the Form. It may be one of a series of standard shapes defined by TShapeType + TShape - An arbitrary graphic geometrical shape placed on the Form. It may be one of a series of standard shapes defined by + TShapeType

- TShape: An arbitrary graphic geometrical shape placed on the Form. It may be one of a series of standard shapes defined by TShapeType (stRectangle, stSquare, stRoundRect, stRoundSquare, stEllipse, stCircle, stSquaredDiamond, stDiamond).

+ TShape: An arbitrary graphic geometrical shape placed on the Form. It may be one of a series of standard shapes defined by + TShapeType (stRectangle, stSquare, stRoundRect, stRoundSquare, stEllipse, stCircle, stSquaredDiamond, stDiamond).

It can be displayed using the Paint method and the Brush and Pen tools.

@@ -2035,7 +2063,18 @@
- Which Shape? (Rectangle, Square, RoundRect, RoundSquare, Ellipse, Circle, SquaredDiamond, Diamond) + Which Shape? (Rectangle, Square, RoundRect, RoundSquare, Ellipse, Circle, SquaredDiamond, Diamond) + +

Which Shape?

+

stRectangle,

+

stSquare,

+

stRoundRect,

+

stRoundSquare,

+

stEllipse,

+

stCircle,

+

stSquaredDiamond,

+

stDiamond

+
@@ -2093,11 +2132,13 @@ TCustomSplitter : the base type for + TSplitter

TCustomSplitter: the base type for + TSplitter

A Splitter is a vertical or horizontal bar that can be placed on a panel or form, to separate sub-panels functionally and allow re-sizing of the constituent sub-panels

@@ -2718,6 +2759,7 @@ TCustomImage - the base type for + TImage @@ -2730,8 +2772,10 @@ : The base type for + TImage . This is a control of the class + TGraphicControl , designed to be lightweight and fast @@ -3417,11 +3461,13 @@ Reads or Writes flag if control is re-sized. TCustomRadioGroup: the base type for + TRadioGroup

TCustomRadioGroup: the base type for + TRadioGroup

A group of related but mutually exclusive radio buttons, @@ -3607,12 +3653,14 @@ requiring the user to select one af a set of alternatives

Columns - the number of columns in which the + Items (radio buttons) are to be arranges ColumnLayout - + HorizontalThenVertical or vice versa @@ -3678,11 +3726,14 @@ requiring the user to select one af a set of alternatives

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.

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

@@ -3901,11 +3952,13 @@ requiring the user to select one af a set of alternatives

TCustomCheckGroup: The base type for + TCheckGroup

TCustomCheckGroup: The base type for + TCheckGroup

This class defines Items, where the captions for individual check boxes are stored, Rows and Columns for arranging the check boxes, and ColumnLayout to determine whether the data are arranged down the columns first, or across the rows first.

@@ -4193,12 +4246,14 @@ requiring the user to select one af a set of alternatives

Columns - the number of columns in which the + Items (check boxes) are to be arranges ColumnLayout - + HorizontalThenVertical or vice versa @@ -4420,10 +4475,12 @@ either right-click on the control to see the pop-up CheckGroup editor, or in the TBoundLabel: A label bound to another object, for example in + TLabeledEdit TBoundLabel: A label bound to another object, for example in + TLabeledEdit @@ -4609,6 +4666,7 @@ either right-click on the control to see the pop-up CheckGroup editor, or in the : The base type for + LabeledEdit.

Note particularly the EditLabel property (see TBoundLabel), which contains the label attached to the Edit control.

@@ -5027,11 +5085,13 @@ either right-click on the control to see the pop-up CheckGroup editor, or in the TCustomPanel: The base type for + TPanel

TCustomPanel: The base type for + TPanel

A Panel is a defined rectangular area of the form into which other components can be placed to group them functionally and geographically.

@@ -5531,6 +5591,7 @@ either right-click on the control to see the pop-up CheckGroup editor, or in the TCustomTrayIcon - the base class for + TTrayIcon, a multiplatform System Tray component. @@ -5541,9 +5602,12 @@ either right-click on the control to see the pop-up CheckGroup editor, or in the Creates a new instance of the component. Create creates a new instance of a + TCustomTrayIcon class. If + AOwner is not + Nil, the new component attempts to insert itself in the list of owned components of the owner. @@ -5552,9 +5616,11 @@ insert itself in the list of owned components of the owner. Destroys the instance of the component. Destroy sends a + opRemove notification to all components in the free-notification list. After that, all owned components are destroyed by calling + DestroyComponents (and hence removed from the list of owned components). When this is done, the component removes itself from its owner's child component list. @@ -5570,6 +5636,7 @@ After that, the parent's destroy method is called. ShowBalloonHint displays a smal balloon-like window near the tray icon. It can be used to send notifications about the status of an action, or notify of a received message or any other event which doesn't require an imediate response. The Ballon window disappears after + BallonHintTimeout milliseconds of when the user clicks it or it's close button. @@ -5670,8 +5737,10 @@ After that, the parent's destroy method is called.

Assign copies the contents of + Source to + Self, if the classes of the destination and source classes are compatible.

@@ -5739,18 +5808,38 @@ will copy the contents of the Source class to the

Multi-PageControls - controls that offer a selection of alternative pages for display

-

A number of controls, found in Units ExtCtrls and ComCtrls, offer the ability to create multi-page forms with a series of Tabs along one edge that allow the user to select one of the

Pages

for display and interaction.

+

A number of controls, found in Units ExtCtrls and ComCtrls, offer the ability to create multi-page forms with a series of Tabs along one edge that allow the user to select one of the Pages for display and interaction.

These include: TPageControl, TNoteBook, TTabControl and THeaderControl (the Header Control components have a very different structure and function). Icons for all of these exist on the Additional or Common Controls tabs of the Component Palette in the Lazarus IDE.

While the various components may look superficially similar, they differ in properties, inheritance, method of adding additional pages, behaviour at run-time, methods for referencing pages and so on.

-

We have to be very clear when using the various properties, to distinguish between the word 'Tab' as referring to a Tab indicating an identifier for a page, and 'Tab' as referring to the TAB key on the standard keyboard. In common with most Lazarus components, it is possible to enable each control to be inclused in the TabOrder of TabStops for a Form, so that the component can be reached by repeated pressing of the TAB key, and we must not confuse this use of 'Tab' with the use to denote a Page.

+

We have to be very clear when using the various properties, to distinguish between the word 'Tab' as referring to a Tab indicating an identifier for a page, and 'Tab' as referring to the TAB key on the standard keyboard. In common with most Lazarus components, it is possible to enable each control to be included in the TabOrder of TabStops for a Form, so that the component can be reached by repeated pressing of the TAB key, and we must not confuse this use of 'Tab' with the use to denote a Page.

The properties CanTab, TabStop and TabOrder refer to the use of the TAB key to navigate to the relevant control.

Properties such as Tabs, TabIndex, IndexOfTabAt(), TabIndexAtClientPos(), TabPosition, TabHeight, TabWidth, TabVisible, OnCloseTabClicked refer to the use for Page selection.

TNoteBook and + + + + TPageControl are both descended from + + + + TCustomNoteBook (which is in turn descended from + + + + TWinControl) and have many inherited properties in common. + + + + TPageControl has, in general, more advanced features and is probably intended to replace + + + + TNoteBook.

The following table summarises the main differences between the two components.

@@ -5765,8 +5854,14 @@ will copy the contents of the Source class to the - - + + @@ -5775,28 +5870,63 @@ will copy the contents of the Source class to the - - + + - - + + - + - + - + + + + + +
Pages, ActivePageString, TPageTTabSheet, a more advanced version of TPAgeString, TPage + + TTabSheet, a more advanced version of + + + TPage +
Drag/Drop/Dock
IndexingPageIndexActivePageIndex, TabIndex + PageIndex + + ActivePageIndex, + + + TabIndex +
Showing/Hiding TabsShowTabsTabVisible in TTabSheet + ShowTabs + + TabVisible in + + + TTabSheet +
Hints No Hinting methodsShowHint, ParentShowHint + ShowHint, + + + ParentShowHint +
Font No Font propertiesFont, ParentFont + Font, + + + ParentFont +
Sensing position of Tab NoneTabPosition, OnGetSiteInfo + TabPosition, + + + OnGetSiteInfo +
OptionsPublished property Options, include nboShowCloseButtons, nboMultiLine + No published Options property, but inherits Options (public property) from TCustomNoteBook, so they could be set explicitly in code

The individual Pages in both of the above controls (descended from TCustomNoteBook) are separate and can have their own specific collections of widgets which appear only when the relevant Page is selected by its Tab.

@@ -5808,8 +5938,13 @@ will copy the contents of the Source class to the

The pages inTNoteBook or TPageControl can be edited by selecting the ActivePage in the Object Inspector and then editing the properties of the individual page.

THeaderControl offers a widget that could be placed along the edge of a Panel or Form, allowing a highly customised mechanism for selection. However, there are no intrinsically associated display areas, and it is the developer's responsibility to supply an index associated with the selection from the + + + + THeaderControl and determining what action is to occur or what is to be displayed in any attached Panel or Form.

-

When the control is first placed selected from the Component Palette and placed on a Form, it consists of an unadorned rectangle. However, selecting the control and right-clicking (or selecting the 'Sections' property in the Object Inspector) gives access to a Sections editor (a StringList editor) and Sections can be added to the control. The sections are separated by vertical lines, and each section can have a string inserted as a label, associated with an Index value. The Sections can be rearranged, re-ordered, or be individually painted

+

When the control is first selected from the Component Palette and placed on a Form, it consists of an unadorned rectangle. However, selecting the control and right-clicking (or selecting the 'Sections' property in the Object Inspector) gives access to a Sections editor (a StringList editor) and Sections can be added to the control. The sections are separated by vertical lines, and each section can have a string inserted as a label, associated with an Index value. The Sections can be rearranged, re-ordered, or be individually painted.

+

In a typical application a THeaderControl and a TPanel or TForm would be docked together, and code would be written to find which Section of the Header had been selected, then use its index to control the display in the other docked control.