Auto String Controls Library 1.0.1

Delphi 6 to 2009 and Kylix 3 Implementationn

by Dieter Köhler


LICENSE

The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at "http://www.mozilla.org/MPL/"

Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.

The Original Code is "AutoStrCtrls.pas".

The Initial Developer of the Original Code is Dieter Köhler (Heidelberg, Germany, "http://www.philo.de/"). Portions created by the Initial Developer are Copyright (C) 2003-2007 Dieter Köhler. All Rights Reserved.

Alternatively, the contents of this file may be used under the terms of the GNU General Public License Version 2 or later (the "GPL"), in which case the provisions of the GPL are applicable instead of those above. If you wish to allow use of your version of this file only under the terms of the GPL, and not to allow others to use your version of this file under the terms of the MPL, indicate your decision by deleting the provisions above and replace them with the notice and other provisions required by the GPL. If you do not delete the provisions above, a recipient may use your version of this file under the terms of any one of the MPL or the GPL.


Introduction

The Auto String Controls Library contains various auto-updating components to navigate and display the contents of automated list components specified in the AutoListUtils unit. The latest version of this software is available at <http://www.philo.de/xml/>.


General Classes

Typed Constants
TAutoStrNavAction = (naOK, naCancel, naRetry);
TAutoStrNavBtnType = (nbtFirst, nbtPrior, nbtNext, nbtLast, nbtAdd, nbtDelete, nbtEdit);
TAutoStrNavBtnTypes = set of TAutoStrNavBtnType;
Auxiliary Components
TAutoStrNavBtn = class(TSpeedButton)
Event Prototypes
TAutoStrUserTextEvent = procedure(Sender: TObject; Iterator: TUtilsStringIterator; var S: string) of object;
TAutoStrUserTextFilterEvent = procedure(Sender: TObject; Iterator: TUtilsStringIterator; var S: string; var Accept: Boolean) of object;
TAutoStrNavClickEvent = procedure(Sender: TObject; BtnType: TAutoStrNavBtnType) of object;
TAutoStrNavModifyEvent = procedure( Sender: TObject; var S: string; var Action: TAutoStrNavAction) of object;

TAutoStrGroupBox = class(TCustomGroupBox)

TAutoStrGroupBox represents an auto-updating group box control that can display the string data corresponding to current position of a TUtilsStringIterator component.

Published Properties
CaptionDefault: string

The default caption if no string data is available.

CaptionPrefix: string

A string that is automatically put out before any available string data.

CaptionSuffix: string

A string that is automatically put out after any available string data.

Iterator: TUtilsStringIterator

Links the control to the TUtilsStringIterator component through which the automated string list is being accessed.

Published Events
OnGetUserText: TAutoStrUserTextEvent
TAutoStrUserTextEvent = procedure(Sender: TObject; Iterator: TUtilsStringIterator; var S: string) of object;

This event allows the application to change the text to be printed out.

Parameters:

Public Methods
procedure ForceUpdate; virtual;

Forces the control to immediately update its caption.


TAutoStrLabel = class(TCustomLabel)

TAutoStrLabel represents an auto-updating label control that can display the string data corresponding to current position of a TUtilsStringIterator component.

Published Properties
CaptionDefault: string

The default caption if no string data is available.

CaptionPrefix: string

A string that is automatically put out before any available string data.

CaptionSuffix: string

A string that is automatically put out after any available string data.

Iterator: TUtilsStringIterator

Links the control to the TUtilsStringIterator component through which the automated string list is being accessed.

Published Events
OnGetUserText: TAutoStrUserTextEvent
TAutoStrUserTextEvent = procedure(Sender: TObject; Iterator: TUtilsStringIterator; var S: string) of object;

This event allows the application to change the text to be printed out.

Parameters:

Public Methods
procedure ForceUpdate; virtual;

Forces the control to immediately update its caption.

TAutoStrButton = class(TButton)

TAutoStrButton represents an auto-updating button control that can display the string data corresponding to current position of a TUtilsStringIterator component.

Published Properties
CaptionDefault: string

The default caption if no string data is available.

CaptionPrefix: string

A string that is automatically put out before any available string data.

CaptionSuffix: string

A string that is automatically put out after any available string data.

Iterator: TUtilsStringIterator

Links the control to the TUtilsStringIterator component through which the automated string list is being accessed.

Published Events
OnGetUserText: TAutoStrUserTextEvent
TAutoStrUserTextEvent = procedure(Sender: TObject; Iterator: TUtilsStringIterator; var S: string) of object;

This event allows the application to change the text to be printed out.

Parameters:

Public Methods
procedure ForceUpdate; virtual;

Forces the control to immediately update its caption.

TAutoStrMemo = class(TCustomMemo)

TAutoStrMemo represents an auto-updating memo control that can display the string data corresponding to current position of a TUtilsStringIterator component.

Published Properties
Iterator: TUtilsStringIterator

Links the control to the TUtilsStringIterator component through which the automated string list is being accessed.

TextDefault: string

The default text if no string data is available.

Published Events
OnGetUserText: TAutoStrUserTextEvent
TAutoStrUserTextEvent = procedure(Sender: TObject; Iterator: TUtilsStringIterator; var S: string) of object;

This event allows the application to change the text to be printed out.

Parameters:

Public Methods
procedure ForceUpdate; virtual;

Forces the control to immediately update its caption.

TAutoStrListBox = class(TCustomListBox)

TAutoStrListBox represents an auto-updating list box control that can display the string data corresponding to a TUtilsStringIterator component. If the CanNavigate property of the control is 'True' the focused item of the control is synchronized with the iterator by automatically updating the iterator's position when another item is selected.

Published Properties
CanNavigate: Boolean

If 'True' the focused item of the control is synchronized with the iterator by automatically updating the iterator's position when another item is selected.

Iterator: TUtilsStringIterator

Links the control to the TUtilsStringIterator component through which the automated string list is being accessed.

Published Events
OnGetUserText: TAutoStrUserTextEvent
TAutoStrUserTextEvent = procedure(Sender: TObject; Iterator: TUtilsStringIterator; var S: string) of object;

This event allows the application to change the text to be printed out. This event is called separately for each item to print.

Parameters:

Public Methods
procedure ForceUpdate; virtual;

Forces the control to immediately update its contents.

TAutoStrComboBox = class(TCustomComboBox)

TAutoStrComboBox represents an auto-updating combo box control that can display the string data corresponding to a TUtilsStringIterator component. If the CanNavigate property of the control is 'True' the focused item of the control is synchronized with the iterator by automatically updating the iterator's position when another item is selected.

Published Properties
CanNavigate: Boolean

If 'True' the focused item of the control is synchronized with the iterator by automatically updating the iterator's position when another item is selected.

Iterator: TUtilsStringIterator

Links the control to the TUtilsStringIterator component through which the automated string list is being accessed.

Published Events
OnGetUserText: TAutoStrUserTextEvent
TAutoStrUserTextEvent = procedure(Sender: TObject; Iterator: TUtilsStringIterator; var S: string) of object;

This event allows the application to change the text to be printed out. This event is called separately for each item to print.

Parameters:

Public Methods
procedure ForceUpdate; virtual;

Forces the control to immediately update its contents.

TAutoStrTabControl = class(TCustomTabControl)

TAutoStrTabControl is not available for Delphi 6.

TAutoStrTabControl represents an auto-updating tab control that can display the string data corresponding to a TUtilsStringIterator component. If the CanNavigate property of the control is 'True' the focused item of the control is synchronized with the iterator by automatically updating the iterator's position when another item is selected.

Published Properties
CanNavigate: Boolean

If 'True' the focused item of the control is synchronized with the iterator by automatically updating the iterator's position when another item is selected.

Iterator: TUtilsStringIterator

Links the control to the TUtilsStringIterator component through which the automated string list is being accessed.

Published Events
OnGetUserText: TAutoStrUserTextEvent
TAutoStrUserTextEvent = procedure(Sender: TObject; Iterator: TUtilsStringIterator; var S: string) of object;

This event allows the application to change the text to be printed out. This event is called separately for each item to print.

Parameters:

Public Methods
procedure ForceUpdate; virtual;

Forces the control to immediately update its contents.

TAutoStrTrackBar = class(TTrackBar)

TAutoStrTrackBar represents an auto-updating track bar control that can display the position of a TUtilsStringIterator component. If the CanNavigate property of the control is 'True' the slider of the track bar can be moved during program execution which automatically updates the position of the associated iterator.

Published Properties
CanNavigate: Boolean

If 'True' the slider of the track bar can be moved during program execution which automatically updates the position of the associated iterator.

Iterator: TUtilsCustomIterator

The associated TUtilsCustomIterator component.

TAutoStrNavigator = class (TCustomPanel)

TAutoStrNavigator represents an auto-updating navigation control that is used during program execution to navigate the position of an associated iterator. This control imitates the look and feel of Delphi's native DBNavigator control.

The edit functionality for this control has not yet been completely implemented. The Add, Delete and Edit buttons are placeholders for future extensions. Users are discouraged to use them. Also the OnAdd and OnEdit events do not work properly.

Published Properties
Iterator: TUtilsCustomIterator

The associated TUtilsCustomIterator component.