Info Power Manual
Info Power Manual
Developer’s Guide
Woll2Woll Software
3150 Reed Ave.
Livermore, CA 94550 U.S.A.
Voice:(925) 371-1663
[Link]
sales@[Link]
InfoPower VCL License Agreement
By using the software product (“InfoPower VCL”) contained in this package, you agree to
the terms and conditions of this license agreement.
Permission is given to the licensee (“you”) of this product to use the development version
of this software under Delphi or C++ Builder on one computer at a time, and to make one
backup copy. Similarly, if the InfoPower source code is purchased, permission is given to
the licensee to use the source code under Delphi or C++ Builder on one computer at a
time. You may utilize and/or modify this product for use in your compiled applications.
You may distribute and sell any product, which results from using this product in your
applications, except a product of similar nature. You may NOT redistribute any source
code that may be included with this product.
This product is sold “as is”, without warranty, implied or expressed. While every effort is
made to insure that this product and its documentation are free of defects, Woll2Woll
Software shall not be held responsible for any loss of profit or any other commercial
damage, including, but not limited to special, incidental, consequential or other damages
occasioned by the use of this product.
Additional Source Code Restrictions:
If you purchased the optional InfoPower source code...
You may use InfoPower components and the related source code to create new
components for use within your company or to create a Windows program (executable
file created by Delphi). The resulting .EXE file, and .bpl run-time packages may be
distributed via freeware, shareware or any commercial means of sale or distribution, but
you must not include any other InfoPower file with your distribution media.
You may not create new components for distribution outside of your company, via
freeware, shareware or any commercial product offering, based on any InfoPower
component, unless those using your new component also have purchased an InfoPower
license.
Woll2Woll Software reserves the right to modify or remove any function, procedure or
property, that is not documented in this InfoPower Developer’s Guide, in future releases
of the InfoPower component library. This includes modifying the number and/or type of
parameters passed to un-documented functions or procedures.
Woll2Woll Software is not responsible for, nor can we provide technical support for, your
use of any un-documented InfoPower function, procedure or property. You assume full
responsibility for supporting your resulting code and component(s) as well as the results
of your using any undocumented function, procedure or property.
Technical Support Options
Before contacting us for technical support, please take some time to carefully search the
manual and on-line help for the information, including the troubleshooting section. Make
sure that you are asking a specific question about InfoPower instead of a general Delphi
question. Also be sure to check the useful sites at [Link] and
[Link] as they contain a database of InfoPower newsgroup
threads as well as all other Delphi related newsgroups.
When you need to contact us, please post your questions into our newsgroup. Also
review the messages already asked on the forum to see if your question has been asked
before. On the Internet, you can find our newsgroup by clicking on the MessageBoard
link located at [Link]
In some cases it may be necessary to email us a simple project that shows us the problem
you are having. If you need to do this then please follow these recommendations:
1. Make your project as simple as possible so that we are not debugging your code but
instead are helping you with the proper way to use the components. In general try to
get your project down to one form, and remove all the extraneous objects and code.
2. When packaging your files for email delivery, use pkzip to compress your files into
one .ZIP file.
3. Email to techsupport@[Link]
Our newsgroups are the fastest way to obtain technical support as it allows us to
efficiently obtain all the necessary information to solve your problems.
If you need to call technical support, you will need to supply us your
InfoPower registration number.
Installing InfoPower............................................................................................7
InfoPower Requirements..........................................................................................................7
Installation Steps ......................................................................................................................8
Uninstalling InfoPower ..........................................................................................................12
Compatibility issues between InfoPower and previous versions of InfoPower .....................12
Distributing applications which use the InfoPower components. .........................................12
Building packages that use the InfoPower components. .......................................................14
i
TwwInspectorItem .................................................................................................................74
TwwDataSource......................................................................................................................81
TwwDBComboBox .................................................................................................................82
TwwDBComboDlg ..................................................................................................................93
TwwDBDateTimePicker.........................................................................................................96
TwwDBEdit ..........................................................................................................................101
TwwDBGrid .........................................................................................................................105
TwwDBLookupCombo .........................................................................................................157
TwwDBLookupComboDlg....................................................................................................168
TwwDBMonthCalendar .......................................................................................................175
TwwDBNavigator .................................................................................................................181
TwwDBRichEdit, TwwDBRichEditMSWord......................................................................187
TwwDBSpinEdit...................................................................................................................206
TwwExpandButton...............................................................................................................209
TwwFilterDialog...................................................................................................................214
TwwIncrementalSearch .......................................................................................................232
TwwIntl ................................................................................................................................235
TwwKeyCombo ....................................................................................................................239
TwwLocateDialog .................................................................................................................241
TwwLookupDialog................................................................................................................246
TwwMemoDialog..................................................................................................................253
TwwQBE ..............................................................................................................................258
TwwQuery ............................................................................................................................264
TwwRadioButton..................................................................................................................266
TwwRadioGroup ..................................................................................................................268
TwwRecordViewDialog ........................................................................................................272
TwwRecordViewPanel .........................................................................................................286
TwwSearchDialog.................................................................................................................293
TwwStoredProc ....................................................................................................................301
TwwTable .............................................................................................................................303
Troubleshooting .............................................................................................311
Index................................................................................................................316
ii
Chapter
1
Introducing InfoPower
With the assistance of this InfoPower Developer’s Guide, you will learn what InfoPower
is, how to install the InfoPower components into your Delphi/C++ Builder development
environments, how to access InfoPower’s demonstration forms, what each of the
InfoPower components is and most importantly, how to use these powerful components in
your Windows applications.
TwwCheckBox
TwwClientDataSet
TwwController
TwwDataSource
TwwDataInspector
TwwDBComboBox
TwwDBComboDlg
TwwDBDateTimePicker
TwwDBEdit
TwwDBGrid
TwwDBLookupCombo
TwwDBLookupComboDlg
TwwDBMonthCalendar
TwwDBNavigator
TwwDBRichEdit
TwwExpandButton
TwwFilterDialog
TwwIncrementalSearch
TwwIntl
TwwKeyCombo
TwwLocateDialog
TwwLookupDialog
TwwMemoDialog
TwwRadioGroup
TwwQBE
TwwQuery
TwwRecordViewDialog
TwwRecordViewPanel
TwwSearchDialog
TwwStoredProc
TwwTable
2
Installing InfoPower
We’ve automated the installation of InfoPower as much as possible, but a few manual
steps are still required to complete the process before you can access the InfoPower
components and sample applications provided with InfoPower. Complete instructions for
both installing and un-installing InfoPower are provided in this chapter.
InfoPower Requirements
To install the InfoPower component library, your system should already contain a fully
functional version of the Delphi 5.0, Delphi 6.0, Delphi 7.0, or C++ Builder 5.0 or 6.0
development environment, contain about 15 MB of free hard disk space. InfoPower does
not have any CPU or memory requirements above or beyond those necessary to run Delphi
or C++ Builder. However, if you are creating a complex form that contains many
components, you may need to increase the stack size of your project. We deem the 16K
(04000 Hex) default to be inadequate in most cases and strongly recommend that you
raise this value to 24K (6000 Hex), or up to whatever size is necessary to stop any
compiler or runtime errors you might be receiving.
Options | Project | Linker | Min Stack Size 0x00006000
When you are ready to continue, click on the Next button to start the installation
process, or click the Back button to return to the main installation dialog box. The
installation will automatically check for available space, and create all the necessary
directories and sub-directories, de-compress and copy all requested files from the
installation diskette to your hard drive, and then display some additional installation
instructions for your viewing.
Installation Tip
If desired, you can move either the IP Access, IP Controls, or IP Dialogs component
palette tabs to a different position from their default installation location via Delphi’s
Environment Options dialog box.
1. Open the Environment Options dialog box using the following:
Tools | Environment Options
2. Click the Palette tab to display the Pages and Components lists.
14 Chapter 2, Installing InfoPower , Building packages that use the InfoPower components.
Chapter
3
InfoPower Component Overview
When possible, each InfoPower component was modeled after one of Delphi’s built-in Data
Access or Data Control components by inheriting either the actual Delphi component itself or
one of it’s ancestors. The InfoPower component library was created in this manner for two
main reasons: First, to insure that each InfoPower component contains as much of the basic
functionality provided by its Delphi ancestor as possible. Second, to keep your InfoPower
learning curve as short as possible. In other words, if you are familiar with Delphi’s Data
Access and Data Control components, you already know the basics of how to add and
implement most of the InfoPower components!
4
Programming with InfoPower
Overview
This chapter of the InfoPower Developer’s Guide discusses the details on how to program with
InfoPower.
Before jumping into the InfoPower component library, please take a few minutes to familiarize
yourself with the following topics, which are presented in this chapter:
• Getting Help
• Using the optional InfoPower source code
• InfoPower Database Architecture
• Adding Custom Framing and transparency to InfoPower’s edit controls
• The Select Fields dialog box because it’s available from many InfoPower
component
• InfoPower’s Picture Masks
• Determining the object names of the controls contained in an InfoPower
dialog
Troubleshooting Section
When you run into problems implementing an InfoPower component, please browse our
newsgroups located at [Link] as well as the troubleshooting chapter at the
end of this guide, before calling our technical support department. Also be sure to check the
useful sites at [Link] and
[Link] as they contain a database of InfoPower newsgroup
threads as well as all other Delphi related newsgroups.
The information provided in our newsgroups and Troubleshooting chapter are there to save
you time, money and frustration. Please use it wisely.
Exhaustive Index
We put a lot of extra effort into creating the Index section at the back of this guide and hope
that most topics you might need to search for are listed there. Please take a moment to browse
through the Index to get an idea of it’s layout and how it can help you, before you really need
it.
ButtonEffects
Transparent
The Select Fields dialog box contains a scrollable list of Selected Fields along with the tab-
controlled Currently Selected Field section. The Selected Fields list box displays a list of
fields that are currently selected for display in the associated component.
26 Chapter 4, Programming with InfoPower , Using the Select Fields Dialog Box
Adding Fields
To select additional fields for display, click on the Add Fields button. This brings up the Add
Fields Dialog box.
The Available Fields list box displays a list of fields available from the associated table. The
contents of this list is determined by which fields were selected for retrieval from the
associated table via the Delphi Fields editor window (opened by double-clicking a table or
query component). The default display sort order for the Available Fields list is by Field Name.
To change the display sort order of the Available Fields list to that of the field’s position
within the table, check the Sort By Table Field Order check box.
To add one or more fields for display, you can use one of the following methods.
♦ To add several fields, not necessarily in sequence, click the first field name
selection within the Available fields list box that you want to add and then
use Ctrl+click (hold the Ctrl key down and click the left mouse button) to
make additional selections. Then click the OK button.
♦ To select an entire set of fields in sequence for adding, click the first
selection and then use Shift+click (hold the Shift key down and click the left
mouse button) on the last sequential field you want added. All fields in
between are automatically selected for adding. Then click the OK button.
Chapter 4 - Programming with InfoPower, Using the Select Fields Dialog Box 27
Removing Fields
To remove one or more fields for display, you can use one of the following methods:
♦ To remove several fields, not necessarily in sequence, click the first field
name selection within the list box that you want removed and then use
Ctrl+click (hold the Ctrl key down and click the left mouse button) to make
additional selections. Then click the Remove Fields button.
♦ To select an entire set of fields in sequence for removal, click the first
selection and then use Shift+click (hold the Shift key down and click the left
mouse button) on the last sequential field you want removed. All fields in
between are automatically selected for removal. Then click the Remove
Fields button.
The order in which fields are displayed as columns in an InfoPower grid or record-view is
based on their order in the Selected Fields list. The first field in the list is displayed in column
position one, the second field in the list is displayed in column position two, and so forth. To
change the column in which a field is displayed in the component, change its position in the
Selected Fields list by clicking and dragging the field name to the desired position. The field
name is inserted immediately above the field name you release the mouse button over.
The Currently Selected Field section of the Select Fields dialog box contains four tabbed
pages: Display Attributes, Edit Control, Masks and Links. The Links tab only is visible when
the currently selected field is a calculated field. However the Links tab is only retained for
backwards compatibility, as you should use Delphi’s lookupfields for new projects. To switch
between the pages, click on the appropriate tab. Each of these pages is described in the
following paragraphs.
Display Attributes
The Display Attributes page allows you to modify the number of characters to be displayed in
the field via the Width edit box and the title to be displayed as the column heading via the
Title edit box (see Figure 4.3). The default value for Width is the length of the field, as defined
in the table, or the number of characters in the Title, whichever is greater. The default value
for Title is the name of the field as defined in the table. When either the Field Width or Field
Title edit boxes has focus (the edit box value is highlighted or the I-beam cursor is located in
the edit box), you can press the up or down cursor arrow key on your keyboard to move to the
previous or next Selected Field.
28 Chapter 4, Programming with InfoPower , Using the Select Fields Dialog Box
Figure 4.3 - The Currently Selected Field section of the Select Fields
dialog box with the Display Attributes tab activated.
When you need to change field-specific attributes, such as data display alignment within a grid
cell, display format, edit mask, and others, you must use the Object Inspector. If the field is not
currently listed in the Object Inspector, it must first be added via Delphi’s Fields editor
window, which is opened by double-clicking the associated table or query component. Please
refer to your Delphi manuals or on-line help for more information about using the Fields
editor.
Read only: Set this to True if you wish for the column to be read-only
Group Name: Assign a group name property if you wish for the grid to hierarchically
represent a field title. For instance, if you have two fields “First Name” and “Last Name”, and
wish to group them together, then assign their GroupName property to “Name”. Note: You
must set UseTFields to false in order to assign the GroupName property and make certain that
your fields that you are grouping together are right next to each other.
Store display settings in TFields: When you want the field display properties to be stored into
the DataSet’s TField properties, then click on the “Store display settings in TFields” checkbox.
If you do not want this behavior, but instead want the field display properties to be stored with
the component, then uncheck this checkbox.
You might want to uncheck this when you are simultaneously displaying more than one grid
attached to the same TwwTable. This allows each grid to display different fields. This
property correlates to the UseTFields property of the TwwDBGrid.
Note: In general we recommend setting UseTFields to false, as when this property is true
certain grid functionality is disabled (i.e. ProportionalColWidths). The default is set to True to
maintain backwards compatibility.
Chapter 4 - Programming with InfoPower, Using the Select Fields Dialog Box 29
Edit Control
The Edit Control page allows you to modify the type of control, or component, used to display
the field’s data (see Figure 4.4). Your options include Field, Bitmap, CheckBox, ImageIndex,
RichEdit, or CustomEdit. The default value for Edit Control is Field, which is a normal edit
control. The CheckBox, Bitmap, ImageIndex, RichEdit, URL-Link, and CustomEdit are very
useful when used from within an InfoPower TwwDBGrid or TwwRecordViewDialog
components, as discussed in the TwwDBGrid section later in this chapter.
Figure 4.4 - The Currently Selected Field section of the Select Fields
dialog box with the Edit Control tab activated.
When you select CheckBox, you are asked to supply two additional values, defaulted to Yes
and No respectively: “Value when checked” and “Value when unchecked”. If you are
attaching a checkbox to a Logical field type, then you should put in values of “True” and
“False”. If you have enabled the grid’s [Link], then
only a single click is required to toggle the checkbox.
InfoPower defaults to checkmark style checkboxes in the grid. If you wish to use an Xmark
style checkbox, then see the TwwIntl property CheckboxInGridStyle.
When you select CustomEdit, you are asked to supply the “Control name”, which must be an
existing component selected from the drop-down list. Any TwwDBGrid or
TwwRecordViewDialog displaying this field uses your specified Control. If your custom
control does not display as plain text and you are using it in the grid, then you may want to
enable the Control Always Paints checkbox. In this way the grid asks the control to take care
of painting the grid cell instead of the grid just painting the control as plain text. Not all
controls will support use of Control Always Paints, but InfoPower’s TwwCheckbox,
TwwRadioGroup, TwwDBRichEdit do support this.
When you select URL-Link, the field is displayed as a URL-Link. The format in the database
is <URL Display String>#<URL Link Address>. Alternatively you can omit the <URL
Display String># and the grid will display the raw address.
30 Chapter 4, Programming with InfoPower , Using the Select Fields Dialog Box
When you select ImageIndex, the field is used as an index to the ImageList specified by your
grid’s ImageList property. If “Shrink To Fit” is checked, then InfoPower will shrink the
image to fit into the cell.
When you select RichEdit, you can specify the name of a TwwDBRichEdit control to associate
with the field. Any TwwDBGrid or TwwRecordViewDialog displaying this field uses your
specified TwwDBRichEdit. The grid uses the rich-edit by allowing the end-user to pop-up an
editing window simply by pressing F2 in the field.
When you select Bitmap, you are asked to supply the bitmap drawing characteristics.
Bitmap Scaling Determines how the bitmap is drawn in the cell. You are given the
following choices for this setting.
Original Size Bitmap is copied with no scaling. If necessary, the bitmap will be
clipped so it fits in the cell.
Stretch to Fit Bitmap is stretched to the size of the cell.
Fit Width Bitmap is stretched horizontally so that it fits the width of the cell.
Fit Height Bitmap is stretched vertically so that it fits the height of the cell.
Raster Operation Determines the raster operation used to copy the bitmap to the cell.
Note: Instead of using a control type of Bitmap, you instead may wish to embed a TDBImage
as a custom control (setting its Control Always Paint checkbox to true). This will provide
increased flexibility in managing the bitmap.
Masks
See the following section “Using InfoPower’s Picture Masks”, which details the InfoPower
picture mask functionality.
Links
InfoPower’s linked fields perform the equivalent of Delphi’s lookup fields. This property is
maintained for backward compatibility with earlier versions of InfoPower. See the
documentation on Delphi’s lookup fields if you wish to display information from a related
table in the grid.
Chapter 4 - Programming with InfoPower, Using the Select Fields Dialog Box 31
Using InfoPower’s Picture Masks
InfoPower gives Delphi programmers the power to define a data entry template, or mask, for
the values that can be entered into a field displayed on the screen. This functionality duplicates
the Picture function that’s been available in Borland’s Paradox relational database product for
quite some time now, so most Paradox programmers will recognize this component and it’s
functionality almost immediately.
Picture masks force end-users to enter only those characters, digits and special characters that
you allow them to, and only in those specific positions within a field that you pre-define. This
can be very important for fields such as multi-sectioned account and part numbers; various
USA and international Zip code formats; a short list of pre-defined words such as Red, Blue or
Green; or even for automatic capitalization of only the first word or all words in a field. The
uses of Picture Masks are almost limitless, and go far beyond what Delphi’s edit masks can do
Character Description
# Any digit (0-9)
? Any letter (a-z or A-Z)
& Any letter (a-z or A-Z – automatically converted to uppercase)
~ Any letter (a-z or A-Z – automatically converted to lowercase)
@ Any character
! Any character (letters automatically converted to uppercase)
; Next character is to be used literally and not used as a picture mask
character.
* Repeat the following character any number of times. For instance *&
means convert any number of characters to uppercase. To specify a
specific number of times, follow the * with a number. For instance to
specify 5 numbers in a row, you would use *5{#}
[abc] Optional sequence of characters abc that do not need to be entered by the
end-user
{a,b,c} Grouping operator. Set of a, b, or c. The end-user must choose either a,
b, or c. For instance {Red,Green,Blue} means the end-user must choose
either Red, Green, or Blue. Similarly {R,G,B} means the end-user must
choose between the characters R, G, or B.
Note: The picture mask must be carefully constructed to avoid situations
where one element completely contains another element in the group. For
instance if you have 3 valid choices of Auto, Automobile, and Car, do
NOT set the picture mask to {Auto,Automobile,Car}. Instead set the
If you enter any other character in a picture mask, InfoPower treats the character as a constant.
When the end-user is entering a value in a field with a picture mask that contains constant
values, and they come to the point where the constant value is specified, InfoPower
automatically fills-in (enters or types) the constant for the end-user. This is known as Auto-Fill
and requires the AutoFill property setting to be True, otherwise the constant characters will
not be filled-in automatically.
Simple Examples:
#####[-####] Standard U.S.A. 5-digit postal code with optional 4-digit suffix
(i.e. 12345 or 12345-6789). Optionally, this picture mask can
be specified as *5{#}[-*4#]. This “shorthand” method allows
you to specify very long picture masks in just a few characters.
#&#&#& Standard Canadian postal code (i.e. 1A2B3C).
*! Any number or any character with all letters automatically
converted to uppercase (i.e. 123abc becomes 123ABC).
{Yes,No} Either "Yes", "No", or blank (since the braces indicate that an
entry in this field is optional). If the AutoFill property is set to
True, all the user has to type is either “y” or “n” and the
respective value is automatically entered into the field. If
AutoFill is set to False, the user must enter the entire word,
either “Yes” or “No”.
&*? Letters, with first letter capitalized.
#[#][#] Numeric of 3 digits or less
Parameters
Sender: TObject Edit control or grid associated with the picture mask
validation error.
Field: TField TField that has an invalid value
var Msg Assign Msg to override the default error message.
var DoDefault Set to False if you want to completely handle the display of
the error message as well as throwing the exception.
Example: The following code changes the picture mask error message.
Tips
If your picture mask contains auto-fill capabilities, remember to set the AutoFill property to
True.
Chapter 4 - Programming with InfoPower, Determining the object names of the controls contained in
an InfoPower dialog 41
1. Open the associated .dfm file instead of the .pas file.
2. Perform Edit | Select All from the Delphi IDE menu to select all the contained
components.
3. Perform Edit | Copy from the Delphi IDE menu to copy the components to the clipboard.
4. Create a new form by select File | New Form from the Delphi IDE Menu.
5. Copy all the components to your newly created form with the menu selection Edit | Past.e
After performing the above steps you can view your newly created form to determine the object
names for every component in the InfoPower dialog.
5
InfoPower Component Reference
Description of Reference
This chapter of the InfoPower Developer’s Guide discusses the details of each InfoPower
component, the new properties and events added to it, properties and events that have been
modified or removed, along with how-to and tips sections for each component. It does not
discuss the properties or events that are available as part of the ancestor Delphi /C++
components, unless changes were made to them. If you are not familiar with Delphi’s built-in
data-aware components, their properties or events, please read through the Delphi User’s
Guide and Database Application Developer’s Guide before you begin working with the
InfoPower component library.
The InfoPower library contains native VCL components, many of which are based on Delphi’s
built-in data-aware components. Thus, when you are familiar with Delphi’s built-in
components, properties and events, you already know how to use most of the InfoPower
components—with no further training.
Several of the InfoPower components appear to use the same visual bitmap as their Delphi
counterparts, such as TwwDataSource, TwwTable and others. Upon closer inspection, you’ll
notice a + symbol in the upper right-hand corner of the InfoPower bitmaps. This is how you
can tell whether you are working with an InfoPower or Delphi/C++ Builder component.
This chapter is dedicated to describing each InfoPower component, along with their ancestry;
required supporting components; added properties, events and methods; required property
assignments; modified properties, events and methods; how-to examples; and tips.
InfoPower integrates a versatile new checkbox control into its suite. Some of its
features include the following:
♦ Support for your own custom bitmaps for the checkbox glyphs
♦ Support for 3 states including integration with the InfoPower grid, record-view
components, and data inspector.
♦ Dynamic caption support – The text of the checkbox can change to reflect the
underlying value or mapped value.
♦ Custom framing and transparency support for a consistent look with other InfoPower
edit controls
Ancestor
TCustomCheckBox
└─TwwCustomCheckBox
└─TwwDBCustomCheckBox
Added Properties
Alignment
Assign this property to change the location of the text within the control. If Alignment is set
to taRightJustify, then the text is aligned on the right-hand side of the control. If Alignment is
set to taLeftJustify, then the text is aligned on the left-hand side of the control.
AllowGrayed
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.
Caption
Assign a string to this property to assign the label that appears next to the checkbox. Note:
Assigning this property has no effect if DynamicCaption is set to true.
Checked
Use Checked to determine whether the check box is in the checked state.
Note: If the AllowGrayed property is True, you may find it more useful to use the State
property.
DisableThemes
If your project has enabled XP themes but you do not wish for this control to be theme-
enabled, then set this property to False.
DisplayValueChecked
This is the value that the checkbox displays when the checkbox is checked. Note:
DynamicCaption must be true in order for the checkbox to display this value. If this value is
unassigned, then it displays the string assigned to ValueChecked.
DisplayValueUnchecked
This is the value that the checkbox displays when the checkbox is unchecked. Note:
DynamicCaption must be true in order for the checkbox to display this value. If this value is
unassigned, then it displays the string assigned to ValueUnchecked.
DynamicCaption
Set this to true if you wish for the checkbox to display the field value as its checkbox label,
instead of the static label indicated by the Caption property.
Frame
See the topic “Key properties and events for custom framing” in chapter 4 for more
information on this property.
Data Type: TwwEditFrame
Images
Assign this property if you wish to change the icons displayed by the checkbox. The first
image in the imagelist is used as the unchecked icon, and the second image is used as the
checked icon, and the third image is used as the grayed icon.
Data Type: TImageList
When the database field that the checkbox is bound to is null, blank, or doesn’t match the
ValueChecked or ValueUnchecked properties, then the checkbox displays its state according to
the NullAndBlankState property. See the Delphi documentation under TCheckboxState for a
description of its possible values.
NullAndBlankState
When the database field that the checkbox is bound to is null, blank, or doesn’t match the
ValueChecked or ValueUnchecked properties, then the checkbox displays its state according to
the NullAndBlankState property. See the Delphi documentation under TCheckboxState for a
description of its possible values.
DataType: TCheckBoxState
ReadOnly
Set this property to true to prevent the user from toggling the checkbox.
ShowFocusRect
When true, a focus rectangle is drawn around the text. You may wish to set this property to
false when using custom framing, as this can already give the end-user a visual cue to when
the checkbox has the focus.
ShowText
Set this property to false to hide the text of the checkbox. This may be useful to you if your
checkbox is embedded in the grid.
State
Indicates whether the check box is selected, deselected, or grayed.
Valid Values:
cbUnchecked The check box has no check mark.
cbChecked The check box has a check mark in it.
cbGrayed The check box has a check mark in it, but it is grayed.
ValueUnchecked
This is the value that the checkbox stores into the database when the checkbox is unchecked.
Added Events
OnMouseEnter
Occurs when the mouse cursor passes from outside the control to inside the control.
OnMouseLeave
Occurs when the mouse cursor passes from inside the control to outside the control.
How-to
Dynamic Captions
Often the value stored in the database for a given field is a Boolean value that could be
represented as a ‘1’ or a ‘0’, ‘True’ or ‘False’, ‘Yes’ or ‘No’, etc. In these situations it is
often desirable for the checkbox caption associated with these values to be more descriptive,
or to reflect the actual value that is stored in the database.
For example: If you wished to display Male or Female instead of the value stored in the
database, then all you need is to do the following:
Ancestor
TClientDataset.
Added Properties
ControlType
This property holds information about the type of control used to display a field if the field is
contained within a grid component. The default value is Field. (See Using the Select Fields
Dialog Box at the beginning of Chapter 4.) To change this property at runtime, see the
SetControlType method of the TwwDBGrid component.
Data Type: (Internal to InfoPower)
PictureMasks
This property holds information about a field’s picture mask. See Using InfoPower’s Picture
Masks in Chapter 4 for more details.
Data Type: TStrings
Valid Values: (Internal to InfoPower)
ValidateWithMask
See the documentation for ValidateWithMask under the TwwTable component
Data Type: Boolean
Modified properties
None.
OnInvalidValue
See Using InfoPower’s Picture Masks in chapter 4.
Added Methods
wwFilterField
See the documentation for wwFilterField under the TwwTable component
How-to
The TwwClientDataset component is inherited from Delphi’s TClientDataset, so please refer
to your Delphi manual for more information about this component. Since InfoPower’s
TwwClientDataset component is inherited from Delphi’s TClientDataset component, you are
provided with 100% backward compatibility. Thus, you can safely replace your use of
TClientDataset with TwwClientDataset at any time.
Ancestor
TComponent
Added Properties
Frame
This property contains the framing properties for the controller. Each control that has its
controller property set to this component will use these framing properties instead of the
properties of its own Frame. See Chapter 4 for more information on customizing the button
effects.
Data Type: TwwEditFrame
ButtonEffects
This property contains the button effect properties for the controller. Each control that has a
button that can be clicked on has specific display attributes that can be customized. See
Chapter 4 for more information on customizing the button effects.
Data Type: TwwButtonEffects
Added Methods
ApplyFrame
If you modify the framing in the controller durin program execution, you can call the
ApplyFrame method to have the controller apply the new framing properties to each edit
control attached to the controller.
InfoPower provides a robust component that allows you to hierarchically edit one or
more records, consisting of one or more datasets. This component allows you to display
records, similar to the way you edit/view an object in the Delphi object inspector. It has
substantial advantages over more traditional ways of editing, including the ability to group
related fields together (even from different datasets), provide a hierarchical view, conserve
screen real-estate, embed custom controls, display a background image or tile, and much more.
See the demo in the \ip4000\demos\inspector directory
This component can also be used without a datasource, which significantly increases the way
this component can be used. InfoPower 4000 also adds an Enabled property for each inspector
item.
InfoPower’s versatile data inspector includes the following capabilities:
The Data Inspector component contains a hierarchical collection of one or more inspector
items. From here you can click on an item, and then by using the Delphi object inspector you
can customize any of the collection item properties of the selected TwwInspectorItem.
Customizing the custom control: If you have previously assigned the CustomControl
property, you can select this control by holding down the ALT key before you click on the
inspector item. After doing so, the object inspector will show you the properties and events of
the custom control.
New Item: Click this button to add a new item to the data inspector. The new item is inserted
as the last child of the currently selected item’s parent. If the selected item is a root node, then
an item is added to the end of the list.
New Subitem: Click this button to add a new child item to the currently selected item in the
data inspector. The new item is inserted as the last child of the currently selected item.
Delete Item: Deletes the currently selected item and its children from the data inspector.
Added properties
ActiveEdit (Runtime only)
ActiveEdit returns the current editor active in the data inspector. This value will vary
depending upon which row is active. If you have assigned a custom control to the active row,
then it returns the handle to this custom control. If you are using a picklist, then it returns the
TwwDBComboBox associated with displaying this picklist.
Data Type: TWinControl
ButtonOptions
This property defines the bitmaps used to display the expand and collapse buttons of the data
inspector.
CollapseGlyph
Assign a TBitmap to this property if you wish to override the appearance of the collapse
button. If this property is unassigned, then the button is displayed as .
ExpandGlyph
Assign a TBitmap to this property if you wish to override the appearance of the expand
button. If this property is unassigned, then the button is displayed as .
CaptionFont
Font used to display text in the caption column
Data Type: TFont
CaptionIndent
Number of pixels to indent when painting the text in the column associated with the captions.
Increase this value to move the caption text more to the right of its default placement.
Data Type: Integer
CaptionWidth
Set this property to change the width of the caption column within the data inspector. You can
also size the column by using the mouse to drag the line separating the columns.
Data Type: Integer
DataColumns
Set DataColumns to a value greater than 1 to display multiple data columns of records in the
inspector when the DataSource property is assigned.
Data Type: Integer
DataSource
Use DataSource to specify the data source component through which the data from a dataset
component is provided to the TwwDataInspector
Data Type: TDataSource
DefaultRowHeight
Set DefaultRowHeight to change the default height of the rows in the data inspector. This
property defaults to 0, which tells the control to compute the row height based on the height of
the text give the control’s font. If you assign an individual row’s height through its
[Link] property, then the DefaultRowHeight property is ignored for
that row.
Data Type: Integer
DisableThemes
DottedLineColor
The DottedLineColor property defines the color of dotted lines within the data inspector.
Dotted lines appear around each cell’s borders when the inspector’s LineStyleCaption or
LineStyleData properties are set to ovDottedLine.
Data Type: TColor
IndicatorRow
IndicatorRow defines the attributes for the indicator row at the top of the inspector. This
property is new in InfoPower, and is designed to indicate to the end-user which column is the
active record.
Data Type: TwwInspectorIndicatorRow
Items
This property contains a collection of items assigned to the data inspector. Each collection
item is of type TwwInspectorItem. Clicking on this property from the object inspector brings
up InfoPower’s data inspector collection editor. See the “Defining the Data Inspector's Items”
topic discussed earlier in this section. See the documentation under TwwInspectorCollection
and TwwInspectorItem for detailed documentation on these data types.
Data Type: TwwInspectorCollection
LineStyleCaption
The style of the borders for each cell in the caption column can be set to any one of the
following:
Data Type: TwwDataInspectorLineStyle
Valid Values: {ovNoLines,ovDottedLine,ovLight3DLine,ovDark3Dline,ovButtonLine}
ovNoLines No lines are displayed around the cells
ovDottedLine Dotted lines are drawn around the cells
ovLight3Dline A light line is drawn around each cell.
ovDark3Dline A dark line is drawn around each cell
ovButtonLine A line is drawn around the cell so that the cell appears like a button.
LineStyleData
The style of the borders for each cell in the data column can be set to any one of the values,
ovNonLines, ovDottedLine, ovLight3Dline, ovDark3Dline, ovButtonLine. See the
LineStyleCaption property for a further description of these line styles.
Data Type: TwwDataInspectorLineStyle
Options
Options allow you to customize the appearance and certain behavior of the data inspector.
Data Type: TwwDataInspectorOptions
Valid Values: {ovColumnResize, ovRowResize, ovTabExits, ovEnterToTab,
ovHighlightActiveRow, ovHideVertDataLines, ovCenterCaptionVert, ovTabToVisibleOnly,
ovShowTreeLines, ovShowCaptionHints, ovShowCellHints, ovFillNonCellArea,
ovActiveRecord3DLines, ovAllowInsert, ovHideCaptionColumn, ovHideVertFixedLines}
ovColumnResize When true, the inspector allows the end-user to resize the
columns.
ovRowResize When true, the inspector allows the end-user to resize the rows
whose resizable property is true. See also the
[Link] property.
ovTabExits When false, the inspector allows the user to cycle through the
rows by using tab and shift-tab. Focus is automatically moved
to the next inspector item whose TabStop property is true. See
also the ovTabToVisibleOnly property.
ovEnterToTab When true, the enter key is converted to a tab.
PaintOptions
Use this property to really polish the look of your grid or inspector component. Note: If you
are referencing this property with code, then add the unit wwPaintOptions to your form’s uses
clause.
Data Type: TwwPaintOptions
ActiveRecordColor Set this property to define the color that the inspector or grid use to
paint the background of the data cells for the active record. This
defaults to clNone, which means that the color of the control is used
to paint the background.
AlternatingRowColor This defines the color that the inspector or grid use to paint the
background for every other row. This property defaults to clNone,
which means that the row colors are not alternated. See also the
property AlternatingRowRegions to configure which section will
paint with the alternating color.
AlternatingRowRegions Set this property to enable/disable the alternating color support
within the grid or inspector.
arrFixedColumns Enable alternating colors in the fixed columns
arrDataColumns Enable alternating colors in the data cells
arrActiveDataColumn Enable alternating colors for the active record column.
This property only applies when using a data inspector. It
is ignored when using a grid.
BackgroundBitmap Assign this property to enable a background tile for the inspector or
grid. You should make your tiles small so that your executables do
not become large. We do not recommend non-tiled backgrounds as
this may slow the performance of your grid’s painting.
Note: When using non-tiled backgrounds, you may want to set
FastRecordScrolling to false. For more information see the
property FastRecordScrolling.
Data Type: TPicture
coBlendFixedRow When true, the fixed row is painted with a blended bitmap.
The background bitmap is blended with the TitleColor
(TwwDBGrid), or [Link]
(TwwDataInspector).
FastRecordScrolling Set this to true to force the grid or inspector to repaint its whole
contents after any scroll operations take place. This will reduce the
performance of your control’s painting during scrolling operations,
but will ensure that your grid or inspector’s background do not shift
position after the scrolling takes place.
PictureMaskFromDataSet
Set this to false if you wish for the design time settings of your picture masks to be retrieved
from the related dataset component. This property is only relevant if you are using TwwTable,
TwwQuery, TwwQBE, TwwStoredProc, or TwwClientDataSet and is ignored otherwise. It
may be convenient for you to retrieve the picture masks in the dataset if you wish to use the
dataset’s ValidateWithMask property, or wish to use masks you have previously defined in the
dataset.
Data Type: Boolean
Note: When this property is false, your picture masks assigned through the data inspector’s
designer are not used. Instead the dataset’s picturemasks are used.
SetFocusTabStyle
This property controls which row becomes the active row when the user tabs to the control. If
SetFocusTabStyle is set to itsPreserveActiveItem, then the inspector’s active row is restored to
its last value when it lost focus. If SetFocusTabStyle is set to itsResetActiveItem, then the
active row is reset to the first row when the inspector receives focus.
Data Type: TwwInspectorTabSetFocusStyle
TreeLineColor
When you enable Options | ovTreeLines, the inpector will paint tree lines to more clearly
reveal the tree-like structure of the inspector. You can set this property to change the color of
the tree lines.
Added Events
OnAfterSelectCell
The OnAfterSelectCell event occurs after focus moves to a new row.
Sender : TwwDataInspector The TwwDataInspector associated with this event
ObjItem: TwwInspectorItem TwwInspectorItem associated with row that received
focus.
OnBeforePaint
This event remains for backward compatibility, since now you can load a bitmap or tile with
the PaintOptions property at design-time.
Write an OnBeforePaint event handler to paint a background image to the inspector. The
parameters for this event are as follows:
Sender: TwwDataInspector The TwwDataInspector associated with this event
OnBeforeSelectCell
The OnBeforeSelectCell event occurs immediately before focus moves to a new row.
Sender : TwwDataInspector The TwwDataInspector associated with this event
ObjItem: TwwInspectorItem TwwInspectorItem associated with the row that received
focus.
var CanSelect: Boolean Set to False to prevent the row from receiving focus
OnCalcDataPaintText
Write an OnCalcDataPaintText handler to change the text displayed in the data column for a
row. This event is useful when you wish to calculate the displayed text based on other criteria.
Sender : TwwDataInspector The TwwDataInspector associated with this event
ObjItem: TwwInspectorItem TwwInspectorItem associated with the data cell to be
painted.
var PaintText: String Assign this property to change the text that is displayed
for the cell.
Example: The following computes the text of an item based on the captions of the enabled
child items (as defined by their checkbox). This example assumes that each child uses a
checkbox with True and False values.
OnCanCollapse
Write an OnCanCollapse handler to prevent a node from being collapsed by the user. This
event is fired immediately after the end-user has tried to collapse an item, but before a node is
actually collapsed. The end-user can collapse an item by clicking on its collapse button, or
using a keyboard shortcut to collapse the node. The keyboard shortcuts include Ctrl-LeftArrow
or LeftArrow (ReadOnly items). Set CanCollapse to false to prevent the item from being
collapsed.
Sender: TwwDataInspector The TwwDataInspector associated with this event
ObjItem: TwwInspectorItem TwwInspectorItem associated with the data cell to be
collapsed.
CanCollapse: Boolean Set CanCollapse to false to prevent the item from being
collapsed.
OnCanExpand
Write an OnCanExpand handler to prevent a node from being expanded by the user. This
event is fired immediately after the end-user has tried to expand the item, but before a node is
actually expanded. The end-user can expand an item by clicking on its expand button, or using
a keyboard shortcut to expand the node. The keyboard shortcuts include Ctrl-RightArrow or
RightArrow (ReadOnly items). Set CanExpand to false to prevent the item from being
expanded and showing its children.
Sender: TwwDataInspector The TwwDataInspector associated with this event
ObjItem: TwwInspectorItem TwwInspectorItem associated with the data cell to be
expanded.
CanExpand: Boolean Set CanExpand to false to prevent the item from being
expanded and showing its children.
OnCollapsed
Write an OnCollapsed event handler to perform your own action after an item has collapsed
so that its children are no longer visible to the end-user.
OnCreateDateTimePicker
Write an OnCreateDateTimePicker event handler to customize the properties of the default
datetimepicker used by the inspector. The default datetimepicker is automatically used by any
row bound to a TDateTimeField. To disable the default datetimepicker for a row, set the item’s
Options | iioAutoDateTimePicker to false. The parameters for this event are as follows.
Sender: TwwDataInspector The TwwDataInspector associated with this event
ADateTimePicker: TwwDBCustomDateTimePicker
The default datetimepicker. You can set its properties if
you wish to change the properties of this control.
OnCreateDefaultCombo
Write an OnCreateDefaultCombo event handler to customize the properties of the default
combobox used by the inspector when your item’s PickList properties are assigned.
Sender: TwwDataInspector The TwwDataInspector associated with this event
Combo: TwwDBComboBox The default combobox auto-created and used by the
inspector. You can set its properties if you wish to change
the properties of this control.
OnCreateHintWindow
Use this event to customize the painting of the hint window. This event is fired before the hint
window is actually displayed. The parameters are as follows:
Sender : TObject TwwDataInspector that is associated with this event.
HintWindow: TwwInspectorHintWindow
Hint window that was created. You can refer to its Canvas
property to customize how the hint window is painted.
AField: TField Field that the hint window is displaying information about.
R: TRect Rectangle coordinates of the hint window
var WordWrap: Boolean Set WordWrap to True to cause the hint window to wordwrap
var MaxWidth: integer Set MaxWidth to limit the width of the hint window
var MaxHeight: integer Set MaxHeight to limit the height of the hint window
var DoDefault: Boolean Set DoDefault to False if you wish to prevent the
datainspector from painting the hint window.
OnDrawCaptionCell
Write an OnDrawCaptionCell event handler to customize the painting of the caption cells in
the inspector. If you are just customizing the cells in the data column, you should instead use
the OnDrawDataCell event. The parameters for this event are as follows:
Sender: TwwDataInspector The TwwDataInspector associated with this event
ObjItem: TwwInspectorItem TwwInspectorItem associated with the data cell to be
painted.
ASelected: Boolean True, if the row to be painted is the active row
ACellRect: TRect ACellRect is the coordinates of the cell’s rectangle with
respect to the Inspector’s top left position.
var ACaptionRect: TRect ACaptionRect contains the rectangle coordinates of the
area that inspector is to paint the text to. This differs
from ACellRect as the text rectangle does not include the
area to the left of the text.
You may also with to set ACaptionRect if you wish for
an individual cell’s caption to be placed at a different
location. See the example described later in this event.
var DefaultDrawing: Boolean Set to False to prevent the default painting from taking
place.
Example: The following example paints an image from an imagelist to the left of caption. In
this example it paints the image for the item associated with the row whose caption is
‘RichEdit’.
Example: The following example paints with a yellow font the data cells which have their
item’s readonly property as true.
if [Link] then [Link]:= clyellow;
OnDrawIndicatorCell
Write an OnDrawIndicatorCell event handler to customize the painting of the indicator cells
in the inspector. The IndicatorRow property must be enabled and the DataColumns property
must be greater than 1.
The parameters for this event are as follows:
Sender: TwwDataInspector The TwwDataInspector associated with this event.
ACol: Integer ACol indicates which indicator column is being painted..
ACellRect: TRect ACellRect is the coordinates of the cell’s rectangle with
respect to the Inspector’s top left position.
var DefaultDrawing: Boolean Set to False to prevent the default painting from taking
place.
Example: The following example paints the indicator column cell red when it is the active
column of the TwwDataInspector control.
OnExpanded
Write an OnExpanded event handler to perform your own action after an item has expanded
to show its children.
Sender: TwwDataInspector The TwwDataInspector associated with this event
ObjItem: TwwInspectorItem TwwInspectorItem associated with the data cell that has
expanded
OnItemChanged
Write an OnItemChanged event handler to perform your own action after the user has
modified the text for a row.
Sender: TwwDataInspector The TwwDataInspector associated with this event
ObjItem: TwwInspectorItem TwwInspectorItem that has been changed.
NewValue: String The new value of the row’s data
OnTopLeftChanged
Write an OnTopLeftChanged event handler to perform any action when the inspector scrolls
resulting in the top row changing.
OnValidationErrorUsingMask
Write an OnValidationErrorUsingMask event handler to perform any custom action after the
user tries to leave the cell with a value that does not satisfy the picture mask constraints
assigned for the cell.
The default behavior is to raise an exception with the message “Invalid input value. Use escape
key to abandon changes”.
The parameters are as follows:
Sender: TwwDataInspector The TwwDataInspector associated with this event
ObjItem: TwwInspectorItem TwwInspectorItem whose edited value does not satisfy
the picture mask constraints
Var Msg: String You can set this value to change the actual message used
by the default error handler.
Added Methods
BeginUpdate
Call this method to suspend painting operations to the inspector. You may wish to call this
method if you are performing many lengthy operations on the inspector as this may improve
the performance of those operations.
procedure BeginUpdate;
EndUpdate
Call this method to resume painting operations to the inspector after a call to BeginUpdate has
suspended them. Set Repaint to true if you wish for the entire tree inspector to be repainted.
procedure EndUpdate(Repaint: boolean = false);
GetFirstChild
Call this method to get the first child of the inspector. If VisibleItems is true, this method
ignores items whose Visible property is false.
function GetFirstChild(VisibleItemsOnly: boolean = True):
TwwInspectorItem;
GetItemByFieldName
Returns the TwwInspectorItem associated with the field name specified by AFieldName
Function GetItemByFieldName(AFieldName: string): TwwInspectorItem;
GetItemByRow
Returns the TwwInspectorItem associated with the row specified by ARow
Function GetItemByRow(ARow: integer): TwwInspectorItem;
GetItemByCaption
Returns the TwwInspectorItem associated whose Caption property matches the parameter
ACaption.
Function GetItemByCaption(ACaption: string): TwwInspectorItem;
GetRowByItem
Returns the row number a TwwCollectionItem is appearing in for the inspector.
Function GetRowByItem(AItem: TwwInspectorItem): integer; virtual;
HaveVisibleItem
Returns True if the inspector has at least one visible item.
function HaveVisibleItem: boolean;
InvalidateRow
Call this method to invalidate a row in the inspector so that it is repainted.
procedure InvalidateRow(ARow: integer);
MouseToCell
This event converts the screen coordinates defined by the parameter X,Y to inspector cell
coordinates in ACol, ARow. You may wish to use this method if you want to determine which
row and column of the inspector the mouse is over.
procedure MouseToCell(X, Y: Integer; var ACol, ARow: Longint);
MouseToItem
This event returns the inspector item correlating with the screen coordinates defined by the
parameters X,Y. You may wish to use this method if you want to determine which item is
associated with the mouse position.
function MouseToItem(X, Y: Integer): TwwInspectorItem;
How To
Set the active row in the inspector
You can set the active row in the inspector based on a number of different properties. Use the
GetItemByFieldName, GetItemByRow, GetItemByCaption, and GetItemByTagString methods
to return an item based on the information you have. Then set the inspector’s ActiveItem
property.
with wwDataInspector1 do
begin
ActiveItem:= GetItemByCaption('MyCaption');
end
Ancestor
TCollection
Added Properties
None
Added Methods
Add
Call this method to add a new TwwInspectorItem to the data inspector’s collection of items.
The return value is the inspector item that was added.
function Add: TwwInspectorItem;
Example: The following example creates 50 rows in the data inspector, with each row being
displayed as a checkbox.
LoadFromFile
Call this method to load the current information contained in the inspector’s collection from a
file. This can be useful if your inspector is not tied to a datasource. By calling this method and
the SaveToFile method, you can save and load the user’s runtime changes.
procedure LoadFromFile(const FileName: string);
LoadFromStream
Call this method to load the current information contained in the inspector’s collection from a
file. This can be useful if your inspector is not tied to a datasource. This method should be
Insert
Call this method to insert a new TwwInspectorItem to the data inspector before the item
specified by index.
function Insert(index: integer): TwwInspectorItem;
SaveToFile
Call this method to save the current information contained in the inspector’s collection to a
file. This can be useful if your inspector is not tied to a datasource. By calling this method and
the LoadFromFile method, you can save and load the user’s runtime changes.
procedure SaveToFile(const FileName: string);
SaveToStream
Call this method to save the current information contained in the inspector’s collection to a
stream. This can be useful if your inspector is not tied to a datasource. By calling this method
and the LoadFromStream method, you can save and load the user’s runtime changes. See the
Delphi documentation on TStream for more information on stream manipulation.
procedure SaveToStream(s: TStream);
Added Properties
Alignment
The Alignment property sets the default alignment of the text in the data portion of the
TwwDataInspector.
Data Type: TAlignment
Caption
The CaptionColor property defines the label that appears in the first column of the data
inspector.
Data Type: String
CellHeight
Assign this property to change the height of an individual row in the grid. Defaults to 0,
which means it will use the data inspector’s DefaultRowHeight property.
Data Type: Integer
CustomControl
Assign this property to attach a custom edit control to a data cell in the inspector. This custom
control is used when the cell receives focus. The custom control also handles the painting of
the inspector’s cell when it does not have focus if CustomControlAlwaysPaints is set to True.
InfoPower allows you to select a wider variety of controls to embed in the inspector. However
not all controls will behave well. The InfoPower TwwDBEdit, TwwCheckbox,
TwwRadioGroup, TwwDBSpinEdit, TwwDBComboBox, TwwDBDateTimePicker,
TwwDBLookupCombo, 1stClass edit controls , and the Delphi TDBImage are supported.
The TwwDBGrid and TwwDataInspector are not currently supported as custom controls.
Some 3rd party controls will behave well, but you will need to experiment to determine the
ones that do. A smaller subset of 3rd party controls will work when
Customizing the custom control: If you have previously assigned the CustomControl
property, you can select this control from the inspector’s collection editor, by holding down the
ALT key before you click on the inspector item. After doing so, the object inspector will show
you the properties and events of the custom control.
Warning: You should not attach the same custom control to more than one row in the
inspector when CustomControlAlwaysPaints is set to True. Otherwise the painting of the cells
sharing the same custom control is not reliable. When CustomControlAlwaysPaints is set to
False, then you can share the same custom control with more than one row.
Data Type: TCustomEdit
CustomControlAlwaysPaints
Set this property to False if you wish for the inspector to paint the cell as simple text. When
this property is true, then the custom control paints the cell instead of the inspector. This
allows controls that display icons to appear in the inspector even when they do not have focus.
You may wish to set this property to false if you want the inspector to paint the cell instead of
the custom control. This allows you the ability to share a single custom control with more
than one row in the inspector. See also the CustomControl property.
Warning : If this value is True, then you should not share the same custom control with more
than one row. If you do, the painting of the cells sharing the same custom control may display
the wrong text.
Data Type: boolean
CustomControlHighlight
Default is False. When set to True a frame is drawn around the active customcontrol in a
multiple column TwwDataInspector control. This may be helpful when trying to indicate
which column/cell has the focus for example by drawing a frame around an embedded
TDBImage control.
DataField
Assign this property to bind the row to a field in the datasource specified by the DataSource
property.
Data Type: String
DataSource
This property specifies the datasource associated with the DataField property. This property
defaults to the inspector’s DataSource property. If you wish to attach the inspector item to
another datasource, then set this property.
Data Type: TDataSource
DisplayText (Runtime)
Returns the display text for an item that is mapped using the [Link] property. If the
item’s [Link] is false, then this property is equivalent to the EditText property.
Data Type: String
Enabled
Set this property to false to disable the inspector item from being edited or receiving the focus
when it is tabbed to. In addition, the inspector will attempt to paint the cell using the system
disabled color.
EditText
The current value for the item. After the user edits the text in the cell, this property is updated.
If you are using a mapped picklist, then this item represents the stored value, not the displayed
value. See the DisplayText to retrieve the display text.
Data Type: String
Expanded
When true, the current item is expanded to show its children. This property only applies to
inspector items, which contain children items.
Data Type: Boolean
Field (Runtime)
Returns the TField associated with this row.
Data Type: TField
Items (Runtime)
Collection, containing inspector items that are the immediate children of this item.
Data Type: TwwInspectorCollection
Level (Runtime)
Returns the hierarchical level of this row. If this is a root item, then level returns 0.
Data Type: Integer
Options
Assign this property to change selected behavior of this inspector item.
Data Type: TwwInspectorItemOptions
ParentItem (Runtime)
This property returns a handle to the parent item. ParentItem is nil if this item has no parent.
Data Type: TwwInspectorItem
PickList
Use this property to define a custom combo list or checkbox for the row.
Data Type: TwwInspectorPickList
Picture
Assign this property if you wish to use a picture mask when editing this inspector item. Please
reference chapter 4, Selecting a Picture Mask for details on this property.
Data Type: TwwDBPicture
ReadOnly
Set to True to disable editing for this row. When a row is readonly and it has children items,
the inspector will allow the right and left arrow keys to expand and collapse the item.
Data Type: Boolean
Resizeable
Set to True to allow the row to be resized at runtime
Data Type: Boolean
TabStop
Set to False to disable the row associated with this item as a tabstop
Tag
Integer field in which you can use for your own purposes.
Data Type: Integer
TagString
String field in which you can use for your own purposes.
Data Type: String
Visible
Set to False to disable the display of this item and its children.
Data Type: Boolean
WordWrap
When true, the text for the item supports wordwrapping.
Data Type: Boolean
Added Events
OnEditButtonClick
Write an OnEditButtonClick event handler to perform your own action when the end-user
clicks on a button when the PickList | ButtonStyle is set to cbsEllipsis or if it is set to
cbsCustom and the PickList | ButtonGlyph is assigned and the .
Sender: TwwDataInspector The TwwDataInspector associated with this event
Item: TwwInspectorItem TwwInspectorItem which fired this event.
OnItemChanged
Write an OnItemChanged event handler to perform your own action after the user has
modified the text for a row. This event performs the same function as the DataInspector’s
OnItemChanged, except this event is fired only when its related item is modified.
Sender: TwwDataInspector The TwwDataInspector associated with this event
ObjItem: TwwInspectorItem TwwInspectorItem which has been changed.
NewValue: string The new value of the row’s data
Added Methods
Some of the methods below refer to the parameters VisibleItemOnly and ExpandedOnly. These
parameters are defined below.
GetFirstChild
Call this method to retrieve this item’s first child item. If no child is found, then nil is
returned.
function GetFirstChild(
VisibleItemsOnly: boolean = True;
ExpandedOnly: boolean = False): TwwInspectorItem;
GetLastChild
Call this method to retrieve this item’s last child item. If no child is found, then nil is returned.
function GetLastChild(
VisibleItemsOnly: boolean = True;
ExpandedOnly: Boolean = False): TwwInspectorItem;
GetNext
Call this method to retrieve the inspector item immediately following this item. This method
will include child items as well as parent items. This method is useful for iterating through the
data inspector’s entire list of inspector items. See the GetNextSibling method to get the next
item in the same level.
function GetNext(
VisibleItemsOnly: boolean = True;
ExpandedOnly: Boolean = False): TwwInspectorItem;
Example: The following code iterates through all the inspector items and displays the caption
property for each one.
var
item: TwwInspectorItem;
begin
item:= [Link];
while item<>nil do
begin
showmessage([Link]);
item:= [Link];
end;
end
GetNextSibling
Call this method to retrieve this item’s next sibling.
function GetNextSibling(
VisibleItemsOnly: boolean = True): TwwInspectorItem;
GetPriorSibling
Call this method to retrieve this item’s prior sibling.
function GetPriorSibling(
VisibleItemsOnly: boolean = True): TwwInspectorItem;
Provided for backwards compatibility. InfoPower allows you to directly use the
TDataSource component instead, so this component is no longer necessary when using
InfoPower controls.
Ancestor
TDataSource
Added events
None.
How To
InfoPower’s TwwDataSource component functions in the same manner as Delphi’s
TDataSource component. Please refer to your Delphi manuals for more information about this
component.
Tips
Since InfoPower’s TwwDataSource component is a direct descendent of Delphi’s TDataSource
component, you are provided with 100% backward compatibility. Thus, you can safely replace
your use of TDataSource with TwwDataSource at any time.
InfoPower greatly expands the capabilities of a regular data aware combo-box. It has
the following advantages over Delphi’s TDBComboBox.
• InfoPower gives its combo-box the ability to remember the user’s
previously entered values. The next time the user’s program is executed,
these previously entered values are automatically filled into the
combobox’s dropdown list. You can also specify a separate MRU list so
that the most recently entered entries appear at the top of the list.
• Allows you to enter mapped storage and display values so that you can
display understandable text versions of stored codes in your table, instead
of displaying only the codes themselves where users have to remember
what they all mean. Alternatively you could use a TwwDBLookupCombo
to display one field from a LookupTable, and store a different field.
However the TwwDBLookupCombo approach requires greater complexity
as a LookupTable is required to fill the drop-down list. The
TwwDBComboBox’s drop-down list comes directly from a string list. Use
the TwoColumnDisplay property if you wish to display both the code and
display value in the drop-down list.
• The glyph in the combo is configurable through the control’s ButtonGlyph
and ButtonWidth properties.
• Supports the 'Quicken' style display of the matching value, by
simultaneously searching and displaying the matching text in the search
controls. Set the ShowMatchText property to True to achieve this effect.
• Use the AllowClearKey property to give your end-user’s a convenient way
of clearing the combo’s selection.
• Since InfoPower is derived from the InfoPower base editor class, you can
access the following additional properties which are not available in
Delphi’s TDBComboBox: AutoSelect, AutoSize, BorderStyle, CharCase,
MaxLength, and InfoPower’s Picture property.
Ancestor
TwwDBCustomEdit
└─ TwwDBCustomCombo
└─ TwwDBCustomComboBox
AllowClearKey
When the ComboBox style is set to csDropDownList, the user is not able to clear their
selection. The AllowClearKey property when set to True, gives the user a convenient way to
clear the combos current selection simply by entering either the <DEL> or <BACKSPACE>
character.
Data Type: Boolean
AutoDropDown
When True, the lookup list drops down automatically when a keystroke is entered. The default
value is False.
Data Type: Boolean
ButtonEffects
See the topic “Key properties for enabling custom button effects in the edit controls” in chapter
4 for information on this property.
Data Type: TwwButtonEffects
ButtonGlyph
This property defines the custom bitmap used for the icon in the control when ButtonStyle is
set to cbsCustom.
Data Type: TBitmap
ButtonStyle
This property defines the icon used for this component. If the property ShowButton is False,
then this property is ignored.
Data Type: TwwComboButtonStyle
Valid Values: cbsEllipsis, cbsDownArrow, cbsCustom
cbsDownArrow The bitmap is displayed
cbsEllipsis The bitmap is displayed
cbsCustom: The icon defined by the ButtonGlyph property.
ButtonWidth
This property defines the width of the icon for the control. You may wish to set this property if
your custom bitmap assigned to the ButtonGlyph property is larger than the default button
width This property defaults to 0, which indicates to the control to compute the button width
based on the system settings..
Data Type: Integer
DisableDropDownList
Set this property to True to disable the drop-down list from appearing. You can then use the
OnDropDown event to perform your own action, or bring up your own custom dialog.
Data Type: Integer
DisableThemes
If your project has enabled XP themes but you do not wish for this control to be theme-
enabled, then set this property to False.
DropDownCount
This property determines how many entries will appear in the drop-down list box.
Data Type: Integer
DropDownWidth
The DropDownWidth property determines how wide the drop-down list box is in pixels. The
default value is 0, which will automatically size the box based on the width of the control.
Data Type: Integer
DroppedDown
Run-time only. The DroppedDown property determines whether the drop-down list of the
combo box is open or closed. If DroppedDown is True, the drop-down list is visible. If
DroppedDown is False, the drop-down list is closed.
Data Type: Boolean
Frame
See the topic “Key properties and events for custom framing” in chapter 4 for more
information on this property.
Data Type: TwwEditFrame
HistoryList
This property contains information on managing the built-in history list. The
TwwDBComboBox control supports automatic management of a history list to reflect the end-
user’s previously entered values. This convenient feature can be managed in a number of
different ways.
To enable history lists, set the Enabled property. This will tell the combo to remember values
the user types into the control. These values are remembered until the program exits. If you
wish to have these values remembered the next time the user starts the program, then you will
You can also enable a most-recently-used list that appears at the top of the combo control. To
enable this, you will need to have both the Enabled and MRUEnabled properties set to True.
Data Type: TwwHistoryList
ItemHeight
The ItemHeight property is the height of an item in the combo box list in pixels when the
combo box's Style property is csOwnerDrawFixed. If the Style property is any other setting, the
value of ItemHeight is ignored.
Data Type: Integer
Items
The default property editor dialog box for the Items property was redefined in InfoPower to
allow you to enter either a single list of values used for both the Displayed and Stored Values,
or a two-column list of values for both Displayed and Stored Values. The dialog box is now
called Edit Combo List. The MapList property can be set via the Map Displayed Value to
Stored Value check box contained within the dialog box (see the MapList property described
above).
LimitEditRect
Set this property to true if you wish to force the combobox’s editing rectangle to not overlap
the icon in the control. The negative consequence of this being set to true is that the combobox
will no longer close the modal form on an escape, as the escape goes to the control instead.
MapList
This property defines whether or not the display values specified in the Items property are
mapped to a corresponding Stored Value assignment. When True, the Items property dialog
box will display two columns of information, a Displayed Value and a Stored Value. The
Displayed Value is always shown on the display screen and the Stored Value is always stored
to the table. When False, the single list of display values you enter is used for both display and
storage purposes. See the How To section below for details on using the MapList property.
Data Type: Boolean
ShowButton
When this property is False, the combo's bitmap button is not shown. The default value is
True.
Data Type: Boolean
ShowMatchText
When this property is True this combo will have Quicken Style incremental searching by
simultaneously searching and displaying the matching text in the search control. The default
value is False.
Data Type: Boolean
Sorted
The Sorted property indicates whether the items in a list box or combo box are arranged
alphabetically. To sort the items, set the Sorted value to True. If Sorted is False, the items are
unsorted. If you add or insert items when Sorted is True, InfoPower automatically places them
in alphabetical order. Defaults to False.
Data Type: Boolean
Style
This property determines the style of the ComboBox. The csDropDown Style creates a drop-
down list with an edit box in which the user can enter text. The csDropDownList Style creates
TwoColumnDisplay
When TwoColumnDisplay is True, both the mapped and stored values are displayed in the
drop-down list. Use the Column1Display property to set the number of pixels to occupy for
column 1.
Data Type: Boolean
Value
When MapList is True, this property represents the hidden stored value. When MapList is
False, this property is equivalent to the text property. Setting this property will also update the
controls ItemIndex property.
Added Events
This component has all the events of the TwwDBEdit, plus the following additional events.
OnAddHistoryItem
This event allows you to perform some custom action when an enduser has typed in a new
entry into the control and a new item is about to be saved to the history list when
[Link] is true. Set Accept to False to prevent the item from being added to the
history list.
Parameter Description
Value: String New string that is about to be added to the History List.
Accept: Boolean Set to False if you wish to prevent this item from being added to the
History list.
OnDrawItem
Please see the Delphi documentation for information on this event.
OnDropDown
The OnDropDown event occurs when the user opens (drops down) a combo box.
Added Methods
AddItem
Call this method to add an item from the drop-down list. If AddToHistory is true, then the
item is also added to the history list. Note: Do not use the form’s OnCreate event to add items
as the added items would be overwritten when the combo’s properties are streamed in. If you
wish to add items when your form is opened, then use the form’s OnShow event. Note: You
can also manipulate the Items property if you wish to manipulate the items as a string list.
procedure AddItem(Value: string; AddToHistory: boolean = False)
ApplyList
Call this method if you manipulate the Items property during program execution. This applies
any run-time changes made to the Items property by updating the combo’s drop-down list.
Procedure ApplyList;
ClearHistory
Call this method to clear the items in the history list. After calling this method, the user’s
history of entered items is gone.
Procedure ClearHistory;
DeleteItem
Call this method to remove an item matching the string Value from the drop-down list. If
DeleteFromHistory is true, then the item is also removed from the history list.
procedure DeleteItem(Value: string;
DeleteFromHistory: boolean = False)
DroppedDown
Returns True if the list is currently dropped down.
GetComboValue
Use this to retrieve the stored value of a mapped list that correlates with the give display value.
Function GetComboValue(DisplayText: string): string;
Both the Displayed Value and Stored Value assignments are string values, providing you with
the most flexible options possible, so you can enter any type of data (text, numbers, etc.) you
need into either column.
If you wanted to store the entire Displayed Value string in your table (i.e. “Visa” instead of
“2”), you would first set the MapList property to False and then, via the Edit Combo List
dialog box, you would enter the list of Displayed Value assignments shown above. This single
list will then be used for both display and storage purposes.
Change the Displayed and Stored Values of the Items property at runtime:
To change the Displayed and Stored Values programmatically at runtime, you must first
realize that the Items property value is merely a TStrings data type with tab character
delimiters between each Displayed Value and Stored Value entry. Thus, to define the above
example at runtime, you would use the following Object Pascal code, where the entry #9
specifies the tab character (extra white space was added simply to make the example easier to
read):
[Link];
[Link]('MasterCard' + #9 + '1');
[Link]('Visa' + #9 + '2');
[Link]('American Express' + #9 + '3');
[Link]('Check' + #9 + '4');
[Link]('Purchase Order' + #9 + '5');
[Link];
After changing the Items property, be sure to call the method ApplyList to have your changes
reflected in the component.
To do this, use the Edit Combo List dialog box (Items property editor), set MapList to True,
and then enter the Displayed Value and Stored Value assignments like the following:
Then close the dialog and set TwoColumnDisplay to True. For optimal display you may wish
to set the DropDownWidth property (i.e. 200) and the Column1Width property (i.e. 125) based
on your data.
Caution
When the Style property is set to csDropDown, this normally allows the end-user to
manually enter a value that is not listed in the drop down list box, via the edit box portion
of the component. However, when MapList is set to True and the csDropDown Style is
selected, the end-user may only select a value from the contents of the drop down list box,
which is similar to the behavior provided when the Style property is set to
csDropDownList.
Ancestor
TwwDBCustomEdit
└─ TwwDBCustomCombo
Added Properties
In addition to all the properties of the TwwDBEdit, this component also has the following
additional properties.
AutoEnableEdit
Set this property to False if you wish to prevent the control from automatic enabling the
dataset’s edit state when the icon is clicked.
Data Type: Boolean
ButtonEffects
See the topic “Key properties for enabling custom button effects in the edit controls” in chapter
4 for information on this property.
Data Type: TwwButtonEffects
ButtonGlyph
This property defines the custom bitmap used for the icon in the control when ButtonStyle is
set to cbsCustom.
Data Type: TBitmap
ButtonStyle
This property defines the icon used for this component. If the property ShowButton is False,
then this property is ignored. The following are the possible values:
ButtonWidth
This property defines the width of the icon for the control. You may wish to set this property if
your custom bitmap assigned to the ButtonGlyph property is larger than the default button
width This property defaults to 0, which indicates to the control to compute the button width
based on the system settings..
Data Type: Integer
Frame
See the topic “Key properties and events for custom framing” in chapter 4 for more
information on this property.
Data Type: TwwEditFrame
LimitEditRect
Set this property to true if you wish to force the combobox’s editing rectangle to not overlap
the icon in the control. The negative consequence of this being set to true is that the combobox
will no longer close the form on an escape, as the escape goes to the control instead.
ShowButton
When this property is False, the combo's bitmap button is not shown. The default value is
True. When the icon is clicked the OnCustomDlg event is called.
Data Type: Boolean
Style
When Style is set to csDropDown, the end-user can directly edit the control. If Style is set to
csDropDownList the user cannot edit by typing into the control.
Data Type: TwwDBLookupComboStyle
Valid Values: [Link], [Link]
OnCustomDlg
This event is a modified version of the OnDropDown event and is executed when the user
clicks the “...” button of the component.
Example: The following example demonstrates how the TwwDBComboDlg component can be
used, assuming the TwwDBComboDlg component is named UserResponse. Add the following
code to the OnCustomDlg event:
if MessageDlg('Click Yes or No', mtConfirmation, [mbYes, mbNo], 0) = mrYes
then
[Link] := 'Yes'
else
[Link] := 'No';
When the user clicks the “...” button, Delphi’s Confirm message dialog is displayed with the
message “Click Yes or No”, as shown in Figure 5.4.
Ancestor
TCustomEdit
└─ TwwCustomDateTimePicker
ButtonGlyph
This property defines the custom bitmap used for the icon in the control when ButtonStyle is
set to cbsCustom.
Data Type: TBitmap
ButtonStyle
This property defines the icon used for this component. If the property ShowButton is False,
then this property is ignored. The following are the possible values:
cbsDownArrow The bitmap is displayed
cbsEllipsis The bitmap is displayed
cbsCustom The icon defined by the ButtonGlyph property.
Data Type: TwwComboButtonStyle
Valid Values: cbsEllipsis, cbsDownArrow, cbsCustom
ButtonWidth
This property defines the width of the icon for the control. You may wish to set this property if
your custom bitmap assigned to the ButtonGlyph property is larger than the default button
width This property defaults to 0, which indicates to the control to compute the button width
based on the system settings..
Data Type: Integer
CalendarAttributes
This property defines the attributes of the pop-up month calendar. See the
TwwDBMonthCalendar for further information on the following properties.
Alignment This property determines the how the drop-down calendar is
aligned with the date time picker. This property defaults to
wwdtaLeft, which means that the drop-down calendar is aligned
with the left-hand border of the date time picker.
Valid Values: wwdtaLeft, wwdtaRight, wwdtaCenter
Colors See the TwwDBMonthCalendar’s CalColors property.
FirstDayOfWeek See the TwwDBMonthCalendar’s FirstDayOfWeek property.
Font Determines the default font used by the drop-down calendar.
Options See the TwwDBMonthCalendar’s Options property.
PopupYearOptions See the TwwDBMonthCalendar’s PopupYearOptions property.
DataSource
This property defines the name of the TDataSource you want to bind the DateTimePicker to.
The default value is blank (unbound).
Data Type: TDataSource
Date
This property defines the date the DateTimePicker initially displays. This property is ignored
if the component is bound to a database field, as the date will then originate from the value of
the database field.
Data Type: TDateTime
DateFormat
This property defines whether the data is displayed using the system short date format, or the
system long date format. If the DisplayFormat is assigned, then this property is ignored. If the
control is bound to a datafield with its [Link] property assigned, then this
property is also ignored.
Data Type: TDTDateFormat
Valid Values: dfShort, dfLong
DisableThemes
If your project has enabled XP themes but you do not wish for this control to be theme-
enabled, then set this property to False.
DisplayFormat
This property defines the format the control uses to both display and edit the date/time. See
Delphi’s TDateTimeField DisplayFormat property for details on specifying a display format.
Data Type: String
Valid Values: Blank or valid Delphi format string
Example: The following are some examples of setting this property
DisplayFormat Sample Displayed Text
mmmm dd, yyyy July 01,1998
hh:mm:ss AMPM [Link] AM
mm/dd/yyyy 07/01/1998
Epoch
This property defines the epoch date to determine how 2 digit years resolve to 4 digit years.
This property defaults to the TwwIntl DefaultEpochYear property (1950), which will translate
2 digit years less than 50 to 20xx’, and years greater than 50 to 19xx.
Date Type: Integer
Frame
See the topic “Key properties and events for custom framing” in chapter 4 for more
information on this property.
[Link]
When the user enters the up/down arrows when the cursor is placed into the minutes, the
control adds or subtracts this amount of minutes from the current minute value.
[Link]
If you wish for the minutes to round up/down to the nearest multiple of MinutesInterval, then
set RoundMinutes to true. For instance, if MinutesInterval is set to 5, and the current time is
[Link], then if you increment the minutes the resulting value will be [Link] (rounded to a
multiple of 5).
MaxDate
This property defines the maximum allowable date that the date time picker will allow the
end-user to select. The default is blank means that the upper range of the date is not restricted.
Data Type: TDateTime
MinDate
This property defines the minimum allowable date that the date time picker will allow the end-
user to select. The default is blank which means that the lower range of the date is not
restricted. Note: The date time picker does not support dates less than the year 1900.
Data Type: TDateTime
ShowButton
Set this property to False, to hide the control’s drop-down button. The button is automatically
hidden if the control is only displaying/editing the time.
Data Type: Boolean
Time
This property defines the internal time that the month calendar stores. This is never displayed
to the end-user, but is used internally when updating a database field
Data Type: TDateTime
UnboundDataType
If the control is unbound, then this property determines the control’s data type. To edit an
unbound date time picker as a time, set this property to wwDTEdtTime. Similarly set this
property to wwDTEdtDate to edit the control as a date.
If the control is bound (datasource and datafield properties assigned), then the control
determines the field type from the TField information and this property is ignored
Added Events
OnCalcBoldDay
This event allows you to calculate which dates should be displayed in bold in the drop-down
calendar. This event is only called if CalendarAttributes |Options | mdoDayState is True. See
the TwwDBMonthCalendar’s Options property for detailed documentation on this event.
Ancestor
TCustomMaskEdit
└─TwwCustomMaskEdit
└─TwwDBCustomEdit
Inherited properties
The TwwDBEdit has the following standard Delphi properties:
AutoSelect, AutoSize, BorderStyle, CharCase, Color, Ctl3D, DataField, DataSource,
DragCursor, DragMode, Enabled, Font, MaxLength, ParentColor, ParentCtl3D,
ParentFont, ParentShowHint, PasswordChar, PopupMenu, ReadOnly, ShowHint,
TabOrder, TabStop, Visible.
See the Delphi documentation and help files for more information on these properties.
DisableThemes
If your project has enabled XP themes but you do not wish for this control to be theme-
enabled, then set this property to False.
Frame
See the topic “Key properties and events for custom framing” in chapter 4 for more
information on this property.
Picture
Picture mask specification. Please reference chapter 4, Selecting a Picture Mask for details on
this property.
ShowVertScrollBar
When True, the control will display vertical scrollbars in the edit box. Use this with the
WordWrap property set to True.
When using this property, you may also wish to set the AutoSize property to False and resize
the control.
Data Type: Boolean
UnboundAlignment
When this component is used without a datasource and datafield, this property determines how
the component will align the text within the control when it does not have the focus.
Data Type: TAlignment
UnboundDataType
When this component is used without a datasource and datafield, this property determines how
the component will auto-fill when the space key is entered by the end-user. See the Delphi
documentation on date/time formatting to manipulate the format of the filled text.
AutoFillDate must be set to True in order for this property to be used.
Data Type: TwwEditDataType
Valid Values:
wwDefault No auto-filling of date or time
wwEdtDate Auto fill using current date
wwEdtTime Auto-fill using current time
wwEdtDateTime Auto-fill using current date and time
WantReturns
When True, the editor will accept carriage returns.
Data Type: Boolean
WordWrap
When True, the editor supports word wrapping. You will probably want to set AutoSize to
False when enabling this property.
Data Type: Boolean
Modified properties
None
Added Events
OnCheckValue
This event allows you to perform some custom action based on any change to the edit
component’s text. For instance, you may want to put the edit control in yellow when it does
not satisfy the picture mask requirements. Please reference chapter 4, Selecting a Picture Mask
for details and examples on this event.
Note: This event is only fired if you have a picture mask defined for the field.
OnMouseEnter
Occurs when the mouse cursor passes from outside the control to inside the control. Use this
along with the OnMouseLeave event for hot-tracking effects.
OnMouseLeave
Occurs when the mouse cursor passes from inside the control to outside the control.
Auto-sizing of column
Dbl-clicking the sizing line for a grid can automatically grow or shrink the column's width,
based on the widest displayed text in the column
Ditto Capability
Allow the user to conveniently copy the previous record’s value into the cell. See the
DittoAttributes property, and the OnDitto event.
You can also embed a drop-down inspector or TPanel with the expand button to further
increase the flexibility of the grid’s representation. See the TwwExpandButton for
information on embedding a drop-down panel within the grid.
Use expand/collapse buttons to allow the user to edit a composite field. You can display a
calculated field such as full name (composed of first name + last name), and then the user can
expand the composite calculated field to edit the individual portions.
If you wish to enable grouped headers, you must uncheck the “Store Display Settings in
TFields” checkbox in the Select Fields Dialog . Then enter the group name for the field. Be
sure to consecutively couple the fields that should be grouped.
Flicker-free display
The grid improves both its painting performance and visual effect with its new flicker-free
display. The new flicker-free display is automatically enabled without any new property
settings.
Ancestor
TCustomGrid
└─ TwwCustomDBGrid
Added properties
CalcCellCol
Runtime property used specifically by the OnCalcCellColors event. Reference this property
from the OnCalcCellColors event if you wish to have your cell painting logic be dependent
upon the column number being painted.
CalcCellRow
Runtime property used specifically by the OnCalcCellColors event. Reference this property
from the OnCalcCellColors event if you wish to have your cell painting logic be dependent
upon the row number being painted.
Example: The following code will paint the entire active row with the color, clHighlight.
Normally setting dgRowSelect to True can do this, but the side effect of dgRowSelect is that
you can no longer edit the row. The code below allows you to preserve the editing capabilities
but still paint the entire row.
procedure [Link](
Sender: TObject; Field: TField;
State: TGridDrawState; highlight: Boolean;
AFont: TFont; ABrush: TBrush);
begin
with (Sender as TwwDBGrid) do
if CalcCellRow = GetActiveRow then
[Link]:= clHighlight;
end;
ColWidthsPixels
Runtime property to allow precise pixel control of a column's width during runtime. The array
index is the column number you wish to manipulate or evaluate. Returns the width of a
column in pixels.
Data Type: Array of Integer values
ControlType
This property is equivalent to the ControlType property (See TwwTable ControlType).
InfoPower stores the control information into this property if the ControlInfoInDataSet
property is False. Otherwise this property is not used.
DataSource
Lists only TDataSource components.
DisableThemes
Set this property to False to prevent themes from being used in the painting in the data area of
the grid.
DisableThemesInTitle
Set this property to False to prevent themes from painting in the title area of the grid. Themes
will still be used within the data portion of the grid (unless DisableThemes is False).
DittoAttributes
InfoPower supports a mechanism to allow the user to conveniently copy the previous or next
record with a single keystroke sequence.
DittoDirection
Set this property to determine if the ditto functionality should copy data from the next or
previous record.
wwDittoPrior – Copy previous record’s data when ditto shortcut is pressed. If the
active record is the top displayed record in the grid, then no action is performed.
wwDittoNext - Copy next record’s data when ditto shortcut is pressed. If the active
record is the bottom displayed record in the grid, then no action is performed.
wwDittoPriorOrNext – Copy prior record’s data when ditto shortcut is pressed. If the
active record is the top displayed record in the grid, then the next record is copied.
ShortCutDittoField
Set this property to assign a shortcut key to copy a single field value of the dittoed record.
ShortCutDittoRecord
Set this property to assign a shortcut key to copy the field values of the dittoed record.
Assign the Options property if you wish to configure which fields are dittoed. Use the
OnDitto event if you wish to further customize which fields are copied.
Data Type: TShortCut
Options
This property customizes the ditto functionality. The following flags are available:
wwdoSkipBlobFields Set to true to disable the copying of blob fields
wwdoSkipReadOnlyFields Set to true to disable the copying of readonly fields
wwdoSkipHiddenFields Set to true to disable the copying of fields not visible in the
grid.
DragVertOffset
InfoPower allows the user to drag a column to another position, and animates the header
column being dragged. This property determines the number of pixels to offset the dragged
header.
Data Type: Integer
Valid Values: Any Value greater than 0
EditCalculated
When set to true it allows you to edit a calculated or lookup field. As a result you will be able
to edit calculated linked fields or lookup fields in a grid with only a single line of code.
Tabstops will automatically be created on these columns. See example on how to edit linked
and lookupfields in the Grid.
Data Type: Boolean
EditControlOptions
This property defines specific settings for controls embedded in an InfoPower grid
Data Type: TSet()
Valid Values: ecoCheckboxSingleClick, ecoSearchOwnerForm (described below)
ecoCheckboxSingleClick When True, the end-user need only single-click a
checkbox cell in the grid to toggle it. When False, a dbl-
click is required.
ecoSearchOwnerForm When True, the grid searches
for embedded controls on the grid’s owner form. When
False, the grid will search the grid’s parent form. Usually
you will want to set this to True.
ExportOptions
This property defines specific settings for exporting data from the grid to a series of different
file types or to the clipboard for other applications to use. Choose from HTML, formatted text,
tabbed delimited text, comma delimited text (this is a common spreadsheet format known as
.CSV), or the Excel SYLK (.SLK) format. Or by setting ExportOptions | Options |
esoClipboard to True, the data will be saved to the clipboard in the chosen ExportOptions |
ExportType format. If dgMultiSelect is enabled in the grid and an enduser has selected some
records, then you have the choice of exporting only the selected records or the current contents
of the filtered or nonfiltered dataset.
Data Type: TwwExportOptions, which consists of the following sub-properties.
Delimiter
Defaults to comma. Delimiter used to separate the fields from each other when the
ExportType is set to wwgetTxt. To export the data as tabbed text, set the Delimiter
property to #9 at runtime. To export in a CSV format, set the Delimiter property to ’,’. To
export records as formatted text (or spaced output), set the Delimiter property to ’’.
Data Type: String
ExportType
This property determines the actual format that the data is stored in. The default is
wwgetTxt, which means that the data will be saved in text only format with its fields
separated by the character defined by the Delimiter property.
Data Type: TwwGridExportType
Valid Values: wwgetTxt, wwgetHTML, wwgetSYLK, wwgetXML (described below)
wwgetTxt When ExportType is set to wwgetTxt, records will be saved to the
specified FileName in a Text Format, or if esoClipboard is in the
ExportOptions | Options property then the record data will be saved to
the clipboard in the CF_Text clipboard format. The delimiter settings
will determine the actual format of the exported text. See the Delimiter
property for more details.
wwgetHTML This format is one of the most flexible and powerful export formats.
Depending on the ExportOptions | Options settings, it is possible to
preserve the colors, fonts, group headings, column widths, footers, and
controls that are in the grid. Save to an HTML file and use an internet
browser to view the resulting table, or save to the clipboard and paste to
Microsoft Word or Excel.
HTMLBorderWidth
This property defaults to 1. This means that when the ExportOptions | ExportType
property is set to wwgetHTML, that the resulting table generated from the data will be
stored in an HTML table with a border width of 1.
Data Type: Integer
Options
This property defines the display of the resulting exported table.
Data Type: TSet()
Valid Values: esoShowHeader, esoShowFooter, esoDynamicColors, esoShowTitle,
esoDblQuoteFields, esoSaveSelectedOnly, esoAddControls, esoBestColFit,
esoShowRecordNo, esoEmbedURL, esoShowAlternating, esoTransparentGrid,
esoClipboard (described below)
esoShowHeader When True, the exported table will contain the grid’s titles.
esoShowFooter When True, if the grid is displaying footer cell information, then
the resulting exported table for certain export types will also display
the footer cell information.
esoDynamicColors When True, colors from the TwwDBGrid’s OnCalcCellColors
event will display in the resulting exported table. Currently only
wwgetHTML supports this.
esoShowTitle When True, the string defined by the TitleName property will be
exported as the Title of the exported file.
esoDblQuoteFields When True, fields will be quoted when exporting text using
wwgetTxt..
esoSaveSelectedOnly When True, only the multiselected records in the grid will be saved.
dgMultiSelect needs to be enabled in the grid.
TitleName
This property defines the TitleName of the resulting table/file.
Data Type: String
Example 1 (Saving to HTML File): The following example demonstrates how you would
save the grids data to an HTML File.
1. Set the Grid's Filename property to [Link]. Where xxxxx is the name of the
HTML file you wish to generate.
2. Set the ExportOptions | ExportType to wwgetHTML
3. Call the Save method and the generated file will be created. If you wish to save
this to the clipboard so that you can paste the resulting HTML into Microsoft
Example 2 (Saving selected data to Excel using the clipboard): The following example
demonstrates how you would save selected data to Excel using the clipboard.
1. Set the ExportOptions | ExportType to wwgetSYLK You could optionally also
set it to wwgetTxt for exporting just the data, or wwgetHTML (for special
formatting, coloring, and for Excel 2000).
2. Set the ExportOptions | Options | esoClipboard to True. If you wish to export to
a file set this to False and set the filename to the format [Link].
3. Call the save method.
4. Open Excel and then select Edit | Paste or Edit | Paste Special.
FixedCols
This property defines the number of columns, from the left-hand side of the grid (not including
the record indicator column), that should be non-scrollable. If you specify a number larger
than the number of columns actually visible in the grid, the value is defaulted to 0. The default
value of 0 defines the current record indicator column as non-scrolling.
Data Type: Integer
Valid Values: Zero to the positive number of columns that are displayed in the visible portion
of the grid.
FooterCellColor
This property defines the color of the cells in the footer. The default is clBtnFace.
Data Type: TColor
FooterColor
This property defines the footer background color. The default is clBtnFace.
Data Type: TColor
GroupFieldName
Assign this property so that the grid paints common data as a group. You must ensure that the
dataset is already sorted by the common data. The grid will automatically manage the
painting of the grid so that the horizontal lines between the common data are removed, as well
as the repeating data values are only shown the first time. See the [Link] file
within the maindemo program for an example.
Data Type: String
HideAllLines
Set this property to true to disable the other lines drawn in the grid that are not controlled by
Options | dgColLines and Options | dgRowLines.
ImageList
This property relates a TImageList to the grid’s data cells. This ImageList is used for any
column whose ControlType is set to ImageIndex (See Using the Select Fields Dialog Box |
Edit Control in chapter 4). See also the “How-to” section for this component under “Display
an image from an ImageList”.
Data Type: TImageList
IndicatorButton
This property creates a TSpeedButton on the upper left corner of the Grid. You can attach any
code to this button. It has all the events and properties of a normal TSpeedButton. Use this as
a convenient way for invoking the TwwRecordViewDialog.
Data Type: TSpeedButton
IndicatorIconColor
This property defines the color used to draw the record indicator graphic. The default is
clBlack.
Data Type: TColor
IniAttributes
This property defines specific settings for saving and storing the column positions, sizes,
display names and readonly properties into a system .INI file or as a registry entry. When
[Link] is True, the grid will automatically save the grid’s column information
when the grid is freed. It will also automatically load the grid’s column information from the
registry or .INI file when the grid’s window handle is created. If you would like to load and
save the grid’s settings with code, you can use the LoadFromIniFile and SaveToIniFile
methods.
Data Type: TwwIniAttributes, which consists of the following sub-properties.
Delimiter
Delimiter used to separate the column/field information that is stored in the .ini file or
registry.
Data Type: String
Enabled
Defaults to False, which means that the column information is not automatically saved.
Set to True to save the column/field information into the registry or an .ini file.
Data Type: Boolean
FileName
Defaults to blank or to the value of the TwwIntl IniFileName setting when Connected is
true. When SaveToRegistry is False, then the settings are saved into an .ini file. Of
special note, unless you specify the full pathname for the .ini file name, then the file will
be placed in the Windows directory. A blank filename will result in an .ini file in the
Windows directory named after your application name. When specifying a full path, if
the directory does not exist then no settings will be saved or loaded.
When SaveToRegistry is set to True, then this property must include the registry path
with the key name. For example: Software\Company\UserSettings\MyApp will be store
the grid settings in the registry in
HKEY_CURRENT_USER\Software\Company\UserSettings\MyApp\SectionName.
Data Type: String
SaveToRegistry
When True and IniAttributes is Enabled, then the Grid's column/field information is
stored into the system registry. FileName must be set. Defaults to False, which means
that the information is stored in an .ini file.
Data Type: Boolean
SectionName
This property will default to blank. This means that the grid's column/field information
will be stored in the registry or .ini file in a section named FormName+GridName.
Data Type: String
Example 1 (Saving to Windows .ini File): The following example demonstrates how you
would save the column information into an .ini file in the user's windows directory.
InplaceEditor
Runtime only. InplaceEditor is the default editor used by the grid to edit a field’s value. You
may wish to reference this property if you need to access the currently edited value or
dynamically manipulate the editor. For instance, if you wish to change the color of the editor
when it has an invalid value. See the TwwDBGrid event OnCheckValue for an example of
doing this.
Data Type: TwwInplaceEdit
You can use the following properties of the inplaceeditor dynamically at runtime.
WordWrap Boolean
TColor Color
TFont Font
String Text
Integer SelStart
Integer SelLength
KeyOptions
This property defines specific settings for keyboard behavior within the grid.
Data Type: TSet()
Valid Values: dgEnterToTab, dgAllowDelete, dgAllowInsert
dgEnterToTab When True, the enter-key is automatically converted to a tab in the grid.
dgAllowDelete When True, the grid will attempt to delete the current record when the
end-user enters the CTL-DELETE.
dgAllowInsert When True, the grid will attempt to insert a new record when the end-
user enters the INSERT character.
LineColors
Use the LineColors property to override the color of the lines in the grid.
DataColor Set this property to override the color of the lines in the data cells
FixedColor Set this property to override the color of the lines in the fixed columns
or borders
HighlightColor Set this property to override the color of the highlight lines
ShadowColor Set this property to override the color of the highlight lines
LineStyle
Specify whether the row and column lines are painted in 3d or as a single line. If this property
is set to glsDynamic, then the cell is painted as a single line unless the background color is not
white.
Valid Values: glsSingle, gls3D, glsDynamic
MemoAttributes
This property contains a set of Boolean values that control the display of Memo data, as
described below. The defaults are mSizable and mWordWrap.
Data Type: TSet()
Valid Values: mSizable, mWordWrap, mGridShow, mViewOnly (described below)
mSizable When True, the end-user is allowed to resize the pop-up memo editor
window. When False, the pop-up editor is displayed as a dialog box. The
default value is True.
mWordWrap When True, word wrapping is automatic. When False, the entire display
scrolls horizontally as words are added. The default value is True.
mGridShow When True, the memo data is displayed in the grid. When False, memo
data is not displayed in the grid. The default value is False. (Warning:
Enabling this option dramatically slows down the grid display since
memo data must be retrieved from a file other than the table being
accessed.)
mViewOnly When True, the user may not edit the contents of the memo and only the
OK button is displayed. When False, the user may edit the memo data
and both OK and Cancel buttons are displayed. The default value is
False. (Note: If the grid or field ReadOnly property is set to True, this
property is automatically set to True.)
mDisableDialog When True, the pop-up memo dialog for memo fields is disabled
MultiSelectOptions
This property defines specific settings for multiselection behavior within the grid.
Data Type: TSet()
Valid Values: msoAutoUnselect, msoShiftSelect
msoAutoUnselect When True this property will unselect all records when a user clicks
on a different record without the Ctrl key being pressed. In addition
it will automatically select the current record.
Note: When msoAutoUnselect is True (and an unselectall is
triggered), the OnMultiSelectRecord event will not be fired. Use
the OnMultiSelectAllRecords event to clear totals if you are
calculating totals in the OnMultiSelectRecord event.
Options
Same as the TDBGrid with the following new options
Data Type: TSet()
New Valid Values: [Link], [Link],
[Link]
dgMultiSelect When True, the grid will automatically use CTL-Click to
select/deselect a record. This provides a convenient way to
perform multi-selection. Embedded controls will not appear
in the grid when this property is enabled, so turn this
property off if you wish to edit. If you also wish to enable
shift-select, see the MultiSelectOptions property
dgWordWrap Support word wrapping when displaying and editing text in
the grid. When setting this property to True, also increase
the RowHeightPercent property so your grid can display
more than one line for each row.
dgPerfectRowFit This property is only used during design time. When True,
the grid will automatically shrink the grid height so that
there is no blank space at the bottom. This property allows
you a convenient way to set the grid’s height so that the rows
fit perfectly in the grid frame during design time.
dgShowFooter When True, the grid will display a footer section at the
bottom of the grid. In order for footer cells to appear within
the footer, you need to assign a value to each footer cell using
the ColumnByName(FieldName).FooterValue property. See
also the grid’s OnUpdateFooter event.
[Link]('Balance Due').FooterValue:= ‘100.00’;
PadColumnStyle
This property allows you to fine-tune the painting if there are not enough records or columns
to paint data in the entire client area of the grid.
pcsPadHeader The header title area is padded so that there is no whitespace on
the right-hand side of the header area.
pcsPadHeaderAndData Any whitespace on the right-hand side of the grid or at the
bottom of the grid is filled with the title color, or the title blended
bitmap.
pcsPlain Any whitespace remains visible on the grid.
Data Type: TwwPadColumnStyle
PaintOptions
See the TwwDataInspector PaintOptions property.
PictureMaskFromDataSet
This property is only relevant if your datasource is attached to a TwwTable, TwwQuery,
TwwQBE, or TwwClientDataset component, as it is always treated as false in other cases.
When customizing the picture masks through the select fields dialog (invoked by clicking on
the selected property at design time), the mask information is stored in the related dataset if
this property is True. Otherwise the mask information is stored as a property in the related
visual component. By storing the mask information in the dataset, you do not need to re-enter
the picture mask for other visual controls attached to this same database field.
Data Type: boolean
PictureMasks
The assigned picture mask information is stored in this property if PictureMaskFromDataset is
false. See the PictureMaskFromDataSet property.
Data Type: TStrings
RowHeightPercent
This property controls the size of each row in the grid. By default this property is set to 100%,
which uses the default height. You can scale the row heights proportionally by changing this
value. For instance using 200% will cause each row to be twice as large. This property will
often be used when you have enabled word-wrapping in the grid. See the Options property
(dgWordWrap). You may also want to increase your RowHeightPercent if you are displaying
a bitmap in the grid.
Selected
Clicking the “...” button or double-clicking the grid component displays the Select Fields
dialog box. This dialog box allows you to select the fields you want displayed in the grid, their
titles, widths, control types and link information. (See Using the Select Fields Dialog Box at
the beginning of Chapter 4.) The default value is all fields selected, using the field name as it’s
title, displayed as a Field control for a width equal to the number of characters in the field or
the title, whichever is longer.
Data Type: TStrings
Valid Values: List of strings, with each entry being tab-delimited and containing the field
name, the field width, and the field title.
Note: See also the grid’s ColumnByName method if you wish to set a column’s ReadOnly,
DisplayLabel, DisplayWidth, and FooterValue properties during program execution.
Example: The following will clear the grid's selected property and add two fields, each with a
display width of 10.
with wwDBGrid1 do
begin
[Link];
[Link]('Buyer' + #9 + '10' + #9 + 'Buyer');
[Link]('First Name' + #9 + '10' + #9 + 'First Name');
ApplySelected;
end;
If UseTFields is set to True, modifying the Selected property does not update the grid until the
dataset is re-opened. As a result, one should normally use the Visible, Index, DisplayLabel,
and DisplayWidth properties of the TField to change the field attributes during program
execution. Below is an example.
with wwDBGrid1,[Link] do
begin
DisableControls;
FieldByName('Field1').DisplayLabel := 'NewDisplayLabel';
FieldByName('Field1').DisplayWidth := 6;
FieldByName('Field2').Visible := False;
FieldByName('Field3').Index := 0;
EnableControls;
end;
SelectedList
This runtime only property returns a list of currently selected records.
Data Type: TList of TBookmarks
Valid Values: Use the InfoPower supported methods: IsSelected, SelectRecord,
UnselectRecord, SelectAll, UnselectAll, and SortSelectedList
Example: How to delete all selected records of a TwwDBGrid from its related table.
procedure [Link](Sender: TObject);
var i: integer;
See also the TwwDBGrid How-to section - Iterating through the list of selected records in a
multi-selection grid.
ShowHorzScrollBar
This property defines whether or not to display the horizontal scroll bar within the grid. The
default value is True, which displays the horizontal scroll bar. Set this property to False when
you do not want the horizontal scroll bar displayed.
Data Type: Boolean
ShowVertScrollBar
This property defines whether or not to display the vertical scroll bar within the grid. The
default value is True, which displays the vertical scroll bar. Set this property to False when you
do not want the vertical scroll bar displayed.
Data Type: Boolean
TitleAlignment
This property allows you to define how the text contained within each of the column headings
is to be aligned. The default value is taLeftJustify. See also the OnCalcTitleAttributes event if
you want to individually customize each column heading.
Data Type: Constant
Valid Values: taCenter, taLeftJustify or taRightJustify
TitleButtons
When this property is True, the column headings of each column in the grid will act as a
button. When the user clicks on one, it will depress and fire the OnTitleButtonClick event.
Data Type: Boolean
Example: This example uses the wwDBGrid's TitleButtonClick event to change the table's
selected index to that of the clicked on column and then set that column heading's color to
yellow. It sets the table's index with the IndexFieldName property.
procedure TForm1.wwDBGrid1TitleButtonClick(Sender: TObject;
AFieldName: String);
begin
[Link] := AFieldName;
end;
TitleColor
This property allows you to define the background color applied to both the column and row
headings of the grid. The default value is clBtnFace.
Data Type: Constant
Valid Values: Valid Delphi color constant
TitleImageList
This property relates a TImageList to the grid’s title. This ImageList is used in conjunction
with the OnCalcTitleImage event. See the OnCalcTitleImage event for more information on
how this property is used.
Data Type: TImageList
TitleLines
This property allows you to define the number of text lines to be used in the column title area.
The default value is 1, which provides for a single column title line of text. To define a multi-
line title: double-click the grid component to display the Select Fields dialog box; in the
Selected Fields list box, select the field name you want to change the title of; modify the value
displayed in the Title edit box within the Currently Selected Field group. Use the "~" character
to separate lines within the title.
For example, a Title of "Customer~Account~Number" would require the TitleLines property to
be set at 3 and would display each of the three words Customer, Account and Number on
separate title lines at the top of the grid column.
Note: If the TitleLines property is set to a value less than the number of text lines you specify
by using the "~" character, this character is displayed in the title text as though it were part of
the title.
Data Type: Integer
Valid Values: A positive integer value
UseTFields
When the UseTFields property is set to true the Selected property’s display settings are stored
and retrieved from the dataset that the grid is attached to. When it is set to False the Selected
property’s display settings are stored with the grid. Defaults to True.
Data Type: Boolean
Added Events
OnAfterDrawCell
This event is fired after the grid paints each cell. Use this event to perform any additional
painting for the cell. If you wish to disable certain aspects of the default drawing then use the
OnBeforeDrawCell event.
Sender: TObject The TwwDBGrid associated with this event
DrawCellInfo: TwwCustomDrawGridCellInfo
See the OnBeforeDrawCell event for a description of this
parameter.
OnBeforeDrawCell
This event is fired before the grid paints each individual cell. Use this event to disable certain
types of painting operations (i.e. line drawing) from taking place for the cell.
Sender: TObject The TwwDBGrid associated with this event
DrawCellInfo: TwwCustomDrawGridCellInfo
Contains information about the cell to be painted, as well
as properties which you can set to disable certain aspects of
the cell painting. TwwCustomDrawGridCellInfo is a
record structure with the following definition.
Rect: TRect Rectangle of cell that is about to be painted
Field: TField Field associated with cell
State: TGridDrawState State of the cell being drawn
DataCol, DataRow: integer Column and Row of the cell (0 based where
the first field is 0, and the first displayed
data row is 0). DataCol is -1 if the cell is in
the indicator column, and DataRow is -1 if
the cell is in the title area.
DefaultDrawBackground: Boolean Set to False to disable the background
painting of the cell
OnBeforePaint
This event fires before the grid starts painting each individual cell. Use this event to paint
your own background for the TwwDBGrid.
Write an OnBeforePaint event handler to paint a background image to the inspector. The
parameters for this event are as follows:
Sender: TObject The TwwDBGrid associated with this event
Example: The following example makes sure that the detail grid in a master/detail
relationship paints it’s background image the same color as the current active background for
the master record. This example is taken from our master/detail grid demo. The
CustomerGrid is the master Grid and the InvoiceGrid is the detail grid.
procedure [Link](Sender: TObject);
begin
if [Link] then begin
with TwwDBGrid(Sender) do
[Link](ClientRect,
[Link],
ClientRect);
end
else
with TwwDBGrid(Sender) do
[Link](ClientRect,
[Link], ClientRect);
end;
OnCalcCellColors
This event, which executes just prior to painting the field values within each grid cell, allows
you to change both the font and background colors of individual cells. Continuous color
support is available so that you can have unlimited colors in the Grid. Previously you were
restricted to just the basic Windows color palette.
The parameters for this event are as follows.
Sender : TObject TwwDBGrid that is associated with this event.
Field : TField Field that is associated with the column about to be
drawn.
State : TGridDrawState State of the cell being drawn
Highlight : Boolean True if the cell is to be highlighted
Example 2. Changing the font color of an entire grid row based on the value contained in an
individual cell within the same row. This example uses the BalanceDue field of a TwwTable
object named InvoiceTable within a TwwDBGrid. If the BalanceDue amount is greater than
zero, the font color of the entire row is changed to red...
if ([Link] > 0) then [Link] := clRed;
OnCalcTitleAttributes
This event which executes just prior to painting each title cell, allows you to change both the
font and background colors of each title header, as well as individually control the title
alignments.
The parameters for this event are as follows.
Sender : TObject TwwDBGrid that is associated with this event.
AFieldName : String Name of the field that is associated with the column title
about to be drawn.
AFont : TFont Font to draw the text in the title cell
ABrush : TBrush Brush to use for drawing the title cell background.
ATitleAlignment : TAlignment Alignment used to draw the title cell
Example: The following right justifies the column header for the field Total Invoice. All other
fields use the grid’s TitleAlignment property. The example also changes the background color
for this column header cell to clYellow.
TForm1.wwDBGrid1CalcTitleAttributes(Sender: TObject;
OnCalcTitleImage
This event allows you to define the image that appears in the title cell at runtime. The
TitleImageList property must be assigned to an ImageList for this property to have any effect.
Sender : TObject TwwDBGrid that is associated with this event.
Field : TField Field that is associated with the cell about to be drawn.
TitleImageAttributes: TwwTitleImageAttributes
Attributes of how the image should be drawn in the cell.
TwwTitleImageAttributes is a record containing the following:
ImageIndex: Integer Image index from TitleImageList to paint into the cell. Default is
–1, which indicates no image is painted into the cell.
Alignment: TAlignment How to align the image. The image alignment can be set to
taLeftJustify, taCenter, or taRightJustify. Default is
taRightJustify.
Margin: Integer Number of pixels between edge of cell and the image. Default is 3
pixels.
IsGroupHeader: boolean This value returns true if the cell being painted is the group
header, as opposed to a sub-header of the group. You may wish to
refer to this property if you wish to paint the group header cell
with a different image than its sub-headers.
Example The following example displays the 4th image (0 based) from the TitleImageList if the
cell being painted is the field that the grid is sorted by. The code below assumes that your grid
is attached to a TwwTable.
procedure TBtnGridForm.wwDBGrid1CalcTitleImage(
Sender: TObject; Field: TField;
var TitleImageAttributes: TwwTitleImageAttributes);
begin
if Field=([Link] as TTable).indexFields[0] then
[Link]:= 4
else
[Link]:= -1
end;
OnCellChanged
This event allows you to perform some custom action after the user moves to a new cell in the
grid. In many cases this event is more useful than the OnRowChanged, OnColEnter, and
OnColExit events, as it allows you to centralize all your custom code for cell movement into a
OnCheckValue
This event allows you to perform some custom action while the user is editing cells in the grid.
This event is only fired if you have a picture mask defined for the field. You can test the
parameter PassesPictureTest to see if the user’s entry passes the picture mask requirements.
Note: If you want to check fields with custom editors attached, then you will also need to
attach your code to the custom editor’s OnCheckValue event.
The parameters for this event are as follows.
Sender : TObject Editor within the TwwDBGrid that is being checked.
Sender is a TwwInplaceEdit component. See the
TwwDBGrid runtime property InplaceEditor for more
information on the TwwInplaceEdit type.
PassesPictureTest : Boolean True if edited text passes the picture mask constraints.
Example (Coloring of a TwwDBGrid cell during editing) : The following example will give
cells being edited with the default editor a yellow background whenever the edited text does
not satisfy the picture mask constraints. If you are also attaching your own custom editors
within the grid (i.e. TwwDBComboBox, TwwDBEdit), your code will be slightly different.
See the Picture Mask section for more information on this event.
procedure TForm1.wwDBGrid1CheckValue(Sender: TObject;
PassesPictureTest: Boolean);
begin
with Sender as TwwInplaceEdit do begin
if not PassesPictureTest then color:= clYellow
else color:= clWhite
end
end;
OnColumnMoved
OnColumnMoved occurs when the user moves a column using the mouse. Write an
OnColumnMoved event handler to take specific action just after a column in the grid has been
moved. To retrieve the field name given a column number, you can use the FieldName
method of the grid.
The parameters for this event are as follows.
OnColWidthChanged
This event occurs when the user resizes a column with the mouse. Write an
OnColWidthChanged event handler to take specific action just after a column in the grid has
been resized.
The parameters for this event are as follows.
Sender : TObject TwwDBGrid that is associated with this event.
Column: integer Column being resized OnDrawDataCell
OnCreateDateTimePicker
Use this event to customize the properties of the default DateTimePicker control for DateTime
fields. The parameters are as follows:
Sender : TObject TwwDBGrid that is associated with this event.
ADateTimePicker: TwwDBCustomDateTimePicker
TwwDBDateTimePicker control created for datetime
fields.
OnCreateHintWindow
Use this event to customize the painting of the hint window. This event is fired before the hint
window is actually displayed. The parameters are as follows:
Sender : TObject TwwDBGrid that is associated with this event.
HintWindow: TwwGridHintWindow
Hint window that was created. You can refer to its
Canvas property to customize how the hint window is
painted.
AField: TField Field that the hint window is displaying information
about.
R: TRect Rectangle coordinates of the hint window
var WordWrap: boolean Set WordWrap to True to cause the hint window to
wordwrap
var MaxWidth: integer Set MaxWidth to limit the width of the hint window
var MaxHeight: integer Set MaxHeight to limit the height of the hint window
OnDitto
This event is fired for each field that is being copied during a ditto operation. See also the
DittoAttributes event.
OnDrawDataCell
OnDrawDataCell occurs when the grid needs to paint a data cell.
Sender : TObject TwwDBGrid that is associated with this event.
Rect: TRect Boundaries, in pixels, of the data cell to be painted
Field: TField TField associated with the cell to be painted
State: TGridDrawState TGridDrawState defines the possible states of a cell
when drawing occurs. This property is a set containing
zero or more of the following : {gdSelected, gdFocused,
and gdFixed}.
gdSelected The cell in the grid is selected.
gdFocused The cell in the grid has input focus.
gdFixed The cell is in the fixed (nonscrolling) region of the grid.
OnDrawFooterCell
This event occurs just before a footer cell is to be painted. Write an event handler to change
the attributes of the footer cell. The parameters for this event are as follows.
Sender : TObject TwwDBGrid that is associated with this event.
OnDrawGroupHeaderCell
This event occurs just before a cell in the header is painted. Write an event handler to change
the attributes of a cell in the header.
The parameters for this event are as follows.
Sender : TObject TwwDBGrid that is associated with this event.
Canvas: TCanvas Canvas used to paint the cell. Reference this property to
change the cell’s brush or font attributes.
GroupHeaderName: String Name of GroupHeaderCell being painted.
Rect: TRect Boundaries, in pixels, of the group header cell to be
painted
Var DefaultDrawing: boolean Set this event to False to disable the default drawing of
the title cell. This property defaults to True.
OnDrawTitleCell
This event occurs just before a cell in the header is painted. Write an event handler to change
the attributes of a cell in the header.
The parameters for this event are as follows.
Sender : TObject TwwDBGrid that is associated with this event.
Canvas: TCanvas Canvas used to paint the cell. Reference this property to
change the cell’s brush or font attributes.
Field: TField TField associated with the title cell to be painted
Rect: TRect Boundaries, in pixels, of the title cell to be painted
Var DefaultDrawing: boolean Set this event to False to disable the default drawing of
the title cell. This property defaults to True.
OnFieldChanged
This event occurs after a cell is modified and its contents have been flushed to the TField
buffers. Use this to perform your own custom action after a field in the grid has been
modified.
Sender : TObject TwwDBGrid that is associated with this event.
Field: TField TField being updated
Warning: Be careful not to include any code in this event that could cause infinite recursion,
such as modifying a field value (which would trigger this event again).
OnLeftColChanged
This event occurs after the grid scrolls horizontally.
OnMemoClose
This event executes immediately after the memo dialog box is closed. The parameters for this
event are as follows.
Grid : TwwDBGrid TwwDBGrid from which the memo dialog is being opened.
Cancel : Boolean True when the user cancels the dialog without making
changes.
OnMemoOpen
This event executes just before the memo dialog box is opened. Reminder: you can access any
of the TwwMemoDialog properties to customize the dialog.
The parameters for this event are as follows.
Grid : TwwDBGrid TwwDBGrid component from which the memo dialog
is being opened.
MemoDialog : TwwMemoDialog TwwMemoDialog being opened.
Example 1: The following code changes the height and position of the memo dialog box:
Example 2: The following steps will change the wwDBGrid’s memo dialog box’s background
color to red. The grid’s embedded TwwMemoDialog component is not created until runtime,
so it is necessary to assign the OnInitDialog event during program execution.
1. Create an OnInitDialog event for a memo dialog box that is embedded in a TwwDBGrid.
a) Drop a TwwMemoDialog Component on your form, and add the following line of
code to the OnInitDialog event of the TwwMemoDialog component:
Procedure TForm1.wwMemoDialog1InitDialog(Dialog: TwwMemoDlg)
begin
[Link] := clRed;
end;
b) Delete the TwwMemoDialog Component from your form. The event and its
declaration will be left in your code.
2. Now, add code to the grid’s OnMemoOpen event that assigns the OnInitDialog event to
the code you created above.
Procedure TForm1.wwDBGrid1MemoOpen(Grid: TwwDBGrid;
MemoDialog: TwwMemoDialog)
begin
[Link] := wwMemoDialog1InitDialog;
end;
OnMouseDown
This event (TMouseEvent) executes when the user presses a mouse button. See Delphi’s
documentation for further details on using this event. The parameters for this event are as
follows.
Sender : TObject The TwwDBGrid that received the MouseDown event.
Button : TMouseButton Determines which mouse button the user pressed,
(mbRight, mbLeft, mbMiddle).
Shift : TShiftState Indicates which shift keys (Shift, Ctrl, or Alt) and mouse
buttons were down when the user pressed or released the
mouse button that generated the TMouseEvent.
TShiftState = set of (ssShift, ssAlt, ssCtrl, ssRight,
ssLeft, ssMiddle, ssDouble).
X and Y : Integer Screen pixel coordinates of the mouse pointer. You can
use InfoPower’s MouseCoord(x,y) method to further
determine which grid column (x) and row (y) were
clicked on.
Example: See the example under the FieldName property.
OnMouseUp
This event (TMouseEvent) executes when the user releases a previously pressed mouse button.
See the OnMouseDown event for details on using a TMouseEvent.
OnMultiSelectRecord
This event (TwwMultiSelectRecordEvent) executes before a single record is selected or
unselected in the TwwDBGrid. Use this event to perform some custom action based on a user
selecting a record. The parameters for this event are as follows.
Grid : TwwDBGrid The TwwDBGrid that is being used for multiselection.
Selecting : Boolean Indicates whether the user is selecting or unselecting a
record. True if the user is selecting.
Accept : Boolean Set this property to True if the Grid should accept the
selection/unselection that was made, otherwise it will
reject it. This property defaults to True.
Example: This example prevents the user from selecting more than 3 records.
TForm1.wwDBGrid1MultiSelectRecord(Grid: TwwDBGrid;
Selecting: Boolean; var Accept: Boolean);
begin
if (Selecting and ([Link]>=3)) then
Accept := False;
end;
OnRowChanged
This event occurs after the user moves to a new row in the grid.
OnTitleButtonClick
The OnTitleButtonClick event occurs when the user clicks on one of the column headings in
the TwwDBGrid. The TitleButtons property must be true in order for this event to occur. See
also the TitleButtons property
OnTopRowChanged
This event executes when the grid scrolls to a different record, causing the top record in the
grid to point to a different record.
OnUpdateFooter
The TwwDBGrid provides the convenient event, OnUpdateFooter, to assist you in updating
the footer on certain pre-defined conditions. The OnUpdateFooter event is called when you
OnURLOpen
This event executes when the end-user clicks on a URL-Link field. Use this event to override
the default behavior and provide some other default action.
Added Methods
ApplySelected
This method refreshes the grid based on the selected property. Call this method if you
manipulate the selected property with your own code. See example under the TwwDBGrid
Selected property.
ColumnByName
This method allows you to retrieve and set certain column attributes during program
execution. You can customize the following column properties with this method: (ReadOnly,
DisplayLabel, DisplayWidth, and FooterValue, DisableSizing). Use DisableSizing to allow an
embedded control to be larger than the cell size when the embedded control receives focus.
Example 1: The following code updates the FooterValue for a column.
[Link]('Balance Due').FooterValue:= ‘100.00’;
Example 2: The following code sets the ‘Balance Due’ column to ReadOnly
[Link]('Balance Due').ReadOnly:= True;
Example 3: The following code changes the size of a richedit control embedded in a grid
during editing. This allows the edit control to occupy more screen real-estate during actual
editing within the control.
procedure TLargeGridEditForm.wwDBRichEdit1Enter(Sender: TObject);
begin
with wwDBGrid1 do begin
ColumnByName('RINTERESTS').DisableSizing:=True;
[Link]:= 200;
[Link]:= 40;
end;
end;
FlushChanges
This method flushes the InplaceEditor’s contents to the TField buffers. You may wish to call
this method if you are invoking the RecordViewDialog, so that any current editing will be
recognized by the record-view.
FieldName
This method returns the name of the field associated with a column.
Function FieldName(Column: integer): string;
GetActiveCol
This method returns the currently active column index of the TwwDBGrid.
Function GetActiveCol: Integer;
GetActiveField
This method returns the currently active field in a TwwDBGrid. The function declaration is as
follows:
Function GetActiveField: TField;
GetActiveRow
This method returns the currently active column index of the TwwDBGrid.
Function GetActiveRow: Integer;
GetPriorRecordText
This method retrieves a field value from the previous record. The field retrieved is specified by
AFieldName, and the value is placed into AText. If the method is unable to retrieve a value, it
returns False.
function GetPriorRecordText(
AFieldname: string; var AText: string): boolean;
function GetNextRecordText(
AFieldname: string; var AText: string): boolean;
InvalidateCurrentRow
Redraws the grid’s currently active row by invalidating every cell in the current row. This is
not the same as calling the table’s refresh method, which would refetch the data from the
physical table.
Procedure InvalidateCurrentRow;
IsSelected
This method tests if the active grid row is selected. Before a record can be selected, you need
to configure the grid for multi-selection by following the steps in the TwwDBGrid’s How To
section. The grid row you are testing must be currently displayed in the grid for this method to
be accurate. When using this method within the OnCalcCellColors event, it returns True when
the cell’s related record is selected.
Function isSelected: boolean;
Example: This example changes all selected rows so that their background color is clBlue.
procedure TGridDemo.wwDBGrid1CalcCellColors(Sender: TObject;
Field: TField; State: TGridDrawState;
highlight: Boolean; AFont: TFont; ABrush: TBrush);
begin
if [Link] then [Link]:= clBlue;
end;
LoadFromIniFile
This method loads the grid column information from the registry or .INI file. It respects the
IniFile property settings. See also the SaveToIniFile method.
MouseCoord
This method converts the current screen coordinates of the mouse pointer to grid coordinates,
which are valuable when using the new mouse-based events described earlier. The function
declaration is as follows:
Function MouseCoord(X, Y: integer): TGridCoord;
SaveToIniFile
This method saves the grid column information to the registry or .INI file. It respects the
IniFile property settings. See also the LoadFromIniFile method.
SelectAll
This method selects all the records in the current grid for multiselection. Turn the
TwwDBGrid’s Option | dgMultiSelect property to True when using this method.
Procedure SelectAll;
SelectRecord
This method adds the record relating to the current grid row to the list of currently selected
records.
Procedure SelectRecord;
SetActiveField
This method allows you to change the currently active field, or column, in your grid. The
function declaration is as follows:
Procedure SetActiveField(AFieldName: string);
AFieldName is the name of the table field you want to make active, or move to.
SetActiveRow
This method allows you to change the currently active visible row in your grid. The function
declaration is as follows:
Procedure SetActiveRow(val: integer);
SetControlType
This method allows you to modify the control type of a grid column while your program is
executing. If you wish for the whole grid to immediately repaint after you call this method,
then call the Invalidate method of the Grid. For instance this may be desired when you set a
column to a checkbox since every row would have a visible checkbox.
The function declaration is as follows:
procedure SetControlType(AFieldName: string;
AComponentType: TwwFieldControlType; AParameters: String);
fctBitmap: This parameter is a ‘;’ delimited string that contains two values. The first
value is the type of scaling to be used when the bitmap is copied into the cell. The second
value is what kind of copy is performed when the bitmap is painted into the cell.
[Link]('MyBitmap',fctBitmap,
'Original Size;Source Copy');
[Link];
Valid values for the bitmap scaling are one of the following.
Original Size
Stretch To Fit
Fit Height
Fit Width
Valid values for the copy operation are one of the following
Source Copy
Source Paint
Source And
Source Invert
Source Erase
Not Source Copy
Not Source Erase
Merge Paint
For more information on the meaning of these values, see Chapter 4 on the Select Fields
Dialog.
fctCustom: This parameter is the name of a InfoPower supported edit control
SetPictureAutoFill
Use this method if you want to change the Picture | AutoFill property of a field in a grid at
runtime.
procedure SetPictureAutoFill(FieldName: string; AutoFill: boolean);
SetPictureMask
Use this method if you want to change the picture mask of a field in a grid at runtime.
procedure SetPictureMask(String FieldName, String Mask);
SizeLastColumn
Use this method if you wish to programmatically size the last column to stretch across the
remaining whitespace to the right of the grid. You may wish to use the Grid’s Options |
dgProportionalColResize property instead.
procedure SizeLastColumn;
SortSelectedList
This method sorts the list of selected records in the current index order using quicksort.
Usually you will want to call SortSelectedList before accessing the SelectedList property.
procedure SortSelectedList;
UnselectAll
This method unselects all the records in the current grid for multiselection. Turn the
TwwDBGrid’s Option | dgMultiSelect property to True when using this method.
procedure UnselectAll;
UnselectRecord
This method removes the record relating to the current grid row from the list of currently
selected records.
procedure UnselectRecord;
[Link]('Balance Due').FooterValue:=
[Link]('Total Invoice').FooterValue:=
FloatToStrF([Link],
ffCurrency, 10, 2);
end;
Use expand/collapse buttons to allow the user to edit a composite field. You can display a
calculated field such as full name (composed of first name + last name), and then the user can
expand the composite calculated field to edit the individual portions. The advantages are
obvious. See and edit more fields in a natural way.
1. Creating the Summary Fields.
a) Drop a TTable on your form set the DatabaseName to InfoDemo5 and the
TableName to [Link].
b) Double click on it to bring up the Field’s Editor. Then create a string calculated
fields called ShippingAddress.
c) Now in the Table’s OnCalcFields event do something like the following
procedure TGridExpandForm.Table1CalcFields(DataSet: TDataSet);
begin
with dataset do begin
{Set the Shipping Address Composite Field}
fieldbyname('ShippingAddress').asstring:=
fieldbyname('Address_1').asstring + ', ' +
2. Attach the control to the desired grid column by using the Select Fields Dialog | Edit
Control as defined in chapter 4 and then set the checkbox for Custom Control Always
Paints to True on the Edit Control tab page.
3. Set the RowHeightPercent of the Grid to be as tall as necessary. In the example above
set it to 410 if you are showing four fields. Embed other multi-line memos, richedits,
radiogroups, or dbimages for a powerful and space efficient way to edit and view your
data.
Edit a grid’s field using a lookup combo box and a lookup field.
When using a TwwDBLookupCombo or a TwwDBLookupComboDlg component within the
grid, you may desire to store a code value into the table and display a descriptive value from
the lookup table to the end-user. In order to ensure that the user does not see the code value,
you will need to do the following additional steps after creating your lookupcombo control.
1. Create a Delphi lookup field in the TDataSet associated with your grid, in order to
display the field you want from the lookup table. See the Delphi documentation for the
steps on creating a TDataSet lookup field.
2. Using the Select Fields Dialog as defined in chapter 4, perform the following.
a) Add the lookupfield to the list of the grid’s selected fields, and remove the field that
represents the hidden stored value.
b) Highlight the name of the lookup field, and then click the Edit Control tab within
the Currently Selected Field section of the dialog box.
c) Select “Custom Edit” as the Control Type and your TwwDBLookupCombo control
as the Control Name.
d) Click on the OK button of the Select Fields Dialog box.
a) Dbl-click the grid’s related TDataSet component and define a new Boolean field
named “Selected”. Your field name must be named “Selected”.
b) Dbl-click the grid and add the “Selected” field to the grid’s list of selected fields.
c) Select the “Selected” field and then click on the Edit Control tab page, and change
its Control Type to CheckBox.
d) Your grid will display the Selected column as a checkbox, and will automatically
keep track of which records the user has selected.
Unselect all other records when choosing a new record for multiselection:
Set the MultiSelectOptions | msoAutoUnselect to True. Now when you click on a new
selection for multiselect without hitting the control key, all previous multiselections will be
unselected.
See also the property SelectedList for an example of deleting selected records.
Define the grid’s column title alignment, color and font attributes:
Set the TitleAlignment, TitleColor and TitleFont properties as discussed in the Added
properties section above. If you do not wish for all your title attributes to be the same, then
use the OnCalcTitleAttributes event to individually control each title.
Example: The following example changes the “Last Name” field title in a grid so that its
alignment is centered. Other field titles in the grid will use the alignment as defined by
the TitleAlignment property.
procedure TForm1.wwDBGrid1CalcTitleAttributes(Sender: TObject;
AFieldName: String; AFont: TFont; ABrush: TBrush;
var ATitleAlignment: TAlignment);
begin
if FieldName='Last Name' then ATitleAlignment:= taCenter;
end;
Disable keyboard shortcuts for inserting and deleting into the grid:
Set the KeyOptions | dgAllowDelete and KeyOptions | dgAllowInsert properties to False.
Use multiple grids on one dataset each displaying different fields of one dataset:
This can be accomplished by setting the UseTFields property to false on each of the grids that
is attached to the same dataset. Then you can just double click on each grid and add the fields
that you want visible in each of the grids.
Detecting when you move to a new row or a new cell in the grid
Use the OnRowChanged or the OnCellChanged events of the grid.
Tips
♦ When defining groups and subgroups in the titles of the TwwDBGrid, make
certain that the subgrouped fields are right next to each other and have the
same groupname.
♦ Many of the grid’s capabilities are not supported unless UseTFields is False.
We recommend that you set this property to false unless you absolutely want
TField changes to be immediately reflected in the grid.
♦ To modify the properties of individual fields displayed in a grid, such as
value alignment, use the Object Inspector. If the field does not appear in the
Object Inspector, first make sure it’s selected via Delphi’s Fields editor
window (double-click the TwwTable component and use the Add option as
necessary). By default Delphi selects all fields in a table for retrieval, but you
are not allowed to edit the attributes of individual fields unless they are
physically listed in the Fields editor window. To manually add all fields to
the listbox in the Fields window, click the Add button of the Fields editor,
make sure all fields are highlighted and then click the OK button. You will
now be able to select an individual field in the Object Inspector and modify
its properties.
♦ When creating InfoPower components that are embedded in a TwwDBGrid
component, resize the Combo component on your form to display only a
single character (shrink the component from the left-hand side). These very
small sized components are a visual reminder that the component is used in a
grid instead of on the form.
♦ When you are manipulating many TField properties your property
assignments will execute considerably faster if you call the related dataset's
DisableControls method prior to doing the property assignments. After
completing your property changes, don't forget to re-enable the controls
bound to the dataset by calling EnableControls.
For example:
with wwtable1 do
begin
DisableControls; {Display screen updates for wwtable1}
The first field displayed in the Selected Fields list of the Select Fields dialog box is the field
displayed in the component and provides the end-user with incremental search capability. For
performance reasons, it is best that an index for this field exist in the LookupTable. (See the
How to section of this component for a description of overriding the default index.).
Set the LookupTable property to the dataset component that contains the list of lookup valus.
Set the LookupField property to the field being read-in from the lookup table .
Ancestor
TwwDBCustomLookupCombo
Added Properties
AllowClearKey
When the ComboBox style is set to csDropDownList, the user is not able to clear their
selection. The AllowClearKey property when set to True, gives the user a convenient way to
clear the combos current selection simply by entering either the <DEL> or <BACKSPACE>
character.
Data Type: Boolean
AutoDropDown
When True, the lookup list drops down automatically when a keystroke is entered. The default
value is False.
Data Type: Boolean
ButtonEffects
See the topic “Key properties for enabling custom button effects in the edit controls” in chapter
4 for information on this property.
Data Type: TwwButtonEffects
ButtonGlyph
This property defines the custom bitmap used for the icon in the control when ButtonStyle is
set to cbsCustom.
Data Type: TBitmap
ButtonWidth
This property defines the width of the icon for the control. You may wish to set this property if
your custom bitmap assigned to the ButtonGlyph property is larger than the default button
width This property defaults to 0, which indicates to the control to compute the button width
based on the system settings..
Data Type: Integer
DisableThemes
If your project has enabled XP themes but you do not wish for this control to be theme-
enabled, then set this property to False.
DropDownAlignment
This property defines which edge of the component the drop-down list should be aligned with.
taLeftJustify draws the drop-down list aligned with the left edge of the component (grows to
the right). taRightJustify draws the drop-down list aligned with the right edge of the
component (grows to the left). The default is taLeftJustify.
Data Type: Constant
Valid Values: taLeftJustify, taRightJustify
Frame
See the topic “Key properties and events for custom framing” in chapter 4 for information on
this property.
Data Type: TwwEditFrame
Example: To change the color of the drop-down list to be yellow you can place the following
code in the control's OnDropDown event.
[Link]:= clYellow;
LookupField
This property defines which fields of the lookup table are used when looking up the value in
the lookup table. It was modified to support multiple lookup fields when performing a lookup
against a multi-field index. Use semicolons to separate field names. For example, if your
lookup table index contains the two fields LastName and FirstName, the value of this property
would be “LastName;FirstName”.
InfoPower has the following limitations when specifying multiple fields with the LookupField
property:
• It supports up to 3 fields. If you require more than 3 lookup fields then
use the TwwLookupDialog component in conjunction with a
TwwDBComboDlg and execute this dialog in TwwDBComboDlg’s
OnCustomDialog event. (See TwwLookupDialog for more details.)
• Your lookup field names must exist in both the LookupTable and the
DataSource table.
LookupTable
This property defines the TDataSet component to be used for populating the grid. The default
value is blank.
Data Type: TDataSet
Valid Values: Valid TwwTable, TwwQuery, TwwQBE, TwwStoredProc, or
TwwClientDataSet component name
LookupValue
Internal stored value. This is the same as the displayed text if your LookupField and your first
selected field are the same. You may wish to explicitly set this property and the text if you are
initializing an unbound TwwDBLookupCombo.
Data Type: String
Navigator
Set the Navigator property to True to use the control as a navigator instead of a lookup and
fill control. When used as a navigator, the LookupCombo handles matches the display of the
control to reflect the current record that the lookuptable is pointing to. When the user drops
down the list and selects a record, it does not perform a lookup and fill operation, but
instead moves the lookuptable to the record that was selected. When the user moves to a new
record through another control (such a a navigator) the lookupcombo’s display automatically
reflects the active table record.
OrderByDisplay
When True, this property will automatically change the LookupTable’s IndexName so that the
displayed field is the first field of the index. By changing the index, the drop-down list can be
Picture
Picture mask specification. Please reference chapter 4, Selecting a Picture Mask for details on
this property.
SearchDelay
This property controls how many milliseconds to wait before beginning the search for the
user’s entered text. The purpose of this property is to reduce the number of searches that are
performed as the user enters characters. Setting this to a larger value may improve your
performance as fewer searches will need to be performed. Setting this to a smaller value will
cause the search to begin more quickly. This property defaults to 0, which tells the control to
determine the best delay. Currently 333 milliseconds is used by the control for the delay.
Data Type: Integer
SearchField
This is a runtime only property. When using a multi-field index or a dBASE expression index,
you can incrementally search on the 2nd or 3rd field (instead of the first) by setting this
property to the field you want to search. By default the first field will be searched. To set this
property, add code to the OnDropDown event that sets the table index, and then sets the
property SearchField for the TwwDBLookupCombo.
Note: This field is required for dBASE expression indexes, and must be set to one of the fields
that compose the expression index.
Example: The following code sets the index to the dBASE expression index, and then
specifies which field in the expression index should be searched incrementally:
Selected
Clicking the “...” button or double-clicking the TwwDBLookupCombo component displays the
Select Fields dialog box. This dialog box allows you to select the fields you want displayed in
the drop-down list, the order in which they are listed, their titles, display widths, control types
and link information. (See Using the Select Fields Dialog Box at the beginning of Chapter 4.)
The default value is no fields selected.
SeqSearchOptions
This property controls how the component incrementally searches the LookupTable when an
index is not available. When used against a TwwTable this property is ignored and the case
sensitivity of the index is instead used.
Data Type: TSet
Valid Values: ssoEnabled, ssoCaseSensitive
ssoEnabled When True, incremental searching is supported. Incremental searching
is done by a sequential search through the result set.
ShowButton
When this property is False, the combo's bitmap button is not shown. The default value is
True.
Data Type: Boolean
ShowMatchText
When this property is True this combo will have Quicken Style incremental searching by
simultaneously searching and displaying the matching text in the search control. The default
value is False.
Data Type: Boolean
Text
Currently displayed text in the control
Data Type: String
UseTFields
When the UseTFields property is set to true the Selected properties Display settings
information will be stored and retrieved from the LookupTable dataset. When it is set to False
the Selected properties Display settings information is stored with the TwwDBLookupCombo.
The default is True.
Data Type: Boolean
Modified properties
DataField
Optional. Can be left blank in conjunction with a blank DataSource in order to create an un-
bound component.
LookupDisplay
Replaced by the Select Fields dialog box (double-click the component). The first selected field
becomes the field that the combo displays when it is not dropped down. All the selected fields
are displayed when the combo is dropped down.
LookupSource
Replaced by LookupTable.
Added Events
OnCloseUp
Use this event to perform your own actions when the drop-down list closes (immediately after
the user makes a selection). This allows you to fill-in one or more related fields. For example,
if the TwwDBLookupCombo component is used to lookup a part number for an invoice, in this
event you could then acquire and fill-in other related data, such as the unit price, manufacturer
name and part description.
Parameters
Sender : TObject TwwDBLookupCombo that is being closed up
LookupTable : TDataSet DataSet being looked up
FillTable : TDataSet DataSet that is being filled with the lookup value.
Modified : Boolean True, if user has selected a value. False, if user has
entered <ESC>.
OnDropDown
Use this event to perform your own actions just before the drop-down list is displayed to the
end-user. For example, you could activate a table filter against the LookupTable to limit the
records displayed in the drop-down list.
Parameters
Sender : TObject TwwDBLookupCombo that is being dropped down.
{ Refresh combo }
with (Sender as TwwDBLookupCombo) do
begin
[Link](DataField).asString:= NewZipValue;
LookupValue:= NewZipValue
end;
end;
OnPerformCustomSearch
When using a large lookuptable from a remote server, the performance of the lookupcombo’s
incremental searching can significantly degrade. To resolve this issue, InfoPower adds a new
event where you can control the specific action that takes place after the user types a character,
or when the control needs to look up a value. In particular the custom action can update the
query to only return the records that you are interested in. When using this event, your code is
responsible for manipulating the lookuptable based on the parameter values passed in.
Parameters
Sender : TObject TwwDBLookupCombo that is being edited
LookupTable : TDataSet DataSet being looked up
SearchField : String Field to search
procedure TCustomComboForm.wwDBLookupCombo1PerformCustomSearch(
Sender: TObject;
LookupTable: TDataSet; SearchField, SearchValue: String;
PerformLookup: Boolean; var Found: Boolean);
const dbl = '"';
var q: TQuery;
begin
q:= TQuery(LookupTable);
[Link]:= false;
SearchValue:= AnsiUppercase(SearchValue);
if PerformLookup then // Find exact match
begin
[Link];
[Link]('Select * from ip4zip');
[Link]('where ip4zip."zip" = ' + Dbl + SearchValue + Dbl);
end
else begin // Find partial match
[Link];
[Link]('Select * from ip4zip');
[Link]('where ip4zip."zip" like ' + Dbl + SearchValue + '%' + Dbl);
end;
[Link]:= true;
found:= not [Link];
end;
Added Methods
DropDown
Call this method to programmatically dropdown the list.
PerformSearch
Call this method to immediately perform an incremental search on the LookupTable with the
current text value. In cases where you apply a filter in your OnDropDown event, you need to
explicitly call PerformSearch if you are using AutoDropDown. The LookupCombo may have
already completed its search prior to the filter being applied.
How To
Update other fields based on the contents of a wwDBLookupCombo component:
Attach code to the OnCloseUp event that sets the text property of other fields on the form. For
example, you have an invoice line item entry form that is bound to a table named LineItem
that contains fields named PartNo, PartDesc, UnitCost and Qty. Your LookupTable name is
Parts, contains fields named PartNo, PartDesc and UnitCost, and has a DataField property
value of PartNo. The user has already entered a Qty value and has just selected the PartNo
from the Parts table’s lookup combo drop-down list (PartNo is not set because the
LookupCombo is defined to fill that field)...
if modified then begin {only execute when PartNo is changed}
[Link]('PartDesc').text :=
[Link]('PartDesc').text;
[Link]('UnitCost').text :=
[Link]('UnitCost').text;
end;
2. Add a new TwwDBLookupCombo component to your form and set the following
properties
LookupTable = CustomerQuery
LookupField = State
Tips
♦ Remember to select the fields you want displayed in the drop-down list by
double-clicking the TwwDBLookupCombo component or by clicking the “...”
button in the Selected property.
♦ To display column titles, lines or row lines in the drop-down list, define the
sub-options within the Options property.
♦ If you have two TwwDBLookupCombo components on the same form that
access the same physical lookup table, they must use two different TwwTable
components. This is necessary in order to keep the component’s use of the
table indexes from conflicting with each other.
♦ You can press the Alt+down keyboard keys when the component has focus to
activate the drop-down display.
Added Properties
AllowClearKey
When the ComboBox style is set to csDropDownList, the user is not able to clear their
selection. The AllowClearKey property when set to True, gives the user a convenient way to
clear the combos current selection simply by entering either the <DEL> or <BACKSPACE>
character.
Data Type: Boolean
AutoDropDown
When True, the lookup list drops down automatically when a keystroke is entered. The default
value is False.
Data Type: Boolean
Caption
This property contains a text value that is displayed in the editor window’s title bar. The
default value is “Lookup”.
Data Type: String
DataField
Optional. Can be left blank in conjunction with a blank DataSource in order to create an un-
bound component.
DataSource
Optional. Can be left blank in conjunction with a blank DataField in order to create an un-
bound component.
Frame
See the topic “Key properties and events for custom framing” in chapter 4 for
information on this property.
GridColor
This property defines the background color of the grid. The default value is clWhite. (When
the first column of a grid is fixed, its colors are the same colors used for the grid’s column
titles as defined in the TitleColor property.)
GridOptions
This property contains a set of standard Delphi grid options.
Data Type: TSet()
Valid Values: Valid Delphi grid options
GridTitleAlignment
Determines the text alignment of titles in popup-dialog's grid. The default value is
taLeftJustify.
Valid Values: taCenter, taLeftJustify or taRightJustify
LookupField
See TwwDBLookupCombo LookupField property.
LookupTable
See TwwDBLookupCombo for description of LookupTable.
LookupValue
See TwwDBLookupCombo for description of LookupValue.
MaxHeight
Defines the maximum Height of the grid in the related dialog. Use this property to control the
height of the popup-dialog. The default value for a standard VGA display (640 x 480) is 209.
Data Type: Integer (Positive)
MaxWidth
This property defines how wide the dialog box is allowed to grow, in pixels. The default value
is 0, which allows the dialog box to grow to the entire width of the screen.
Data Type: Integer
Valid Values: Depends on your screen’s display resolution
Options
This property contains a set of Boolean values that control the appearance of the dialog box, as
described below. The default values are opShowOKCancel and opShowSearchBy.
Data Type: TSet()
Valid Values: opShowOKCancel, opShowSearchBy, opGroupControls, opFixFirstColumn and
opShowStatusBar (described below)
opShowOKCancel When True, the OK and Cancel buttons are displayed in the dialog
box. When False these buttons are not displayed—OK can be
simulated by double-clicking an entry or by selecting it and then
pressing the Enter key. Cancel can be simulated by pressing the Esc
key or by closing the dialog box window. The default is True.
OrderByDisplay
When True, this property will automatically change the LookupTable’s IndexName so that the
displayed field is the first field of the index. By changing the index, the drop-down list can be
viewed in the order of the displayed field instead of some hidden field which may be useless to
the end-user. This property has no effect unless you are using a TwwTable component for
your lookup. The default for this property is True.
Data Type: Boolean
SearchDelay
See the TwwDBLookupCombo SearchDelay property.
SeqSearchOption
See TwwDBLookupCombo SeqSearchOption property.
ShowButton
When False, the drop-down button is not shown when the program executes. The default value
is True.
Data Type: Boolean
ShowMatchText
When this property is True this combo will have Quicken Style incremental searching and
highlight the text that is the closest match. The default value is False.
Data Type: Boolean
UserButton1Caption
When you want to display this button on the dialog box, enter the caption text for the button
here and then add code to the OnUserButton1Click event. The default value is blank.
Data Type: String
UseTFields
When the UseTFields property is set to true the Selected properties display settings are stored
and retrieved from the TFields of the LookupTable dataset. When it is set to False the
Selected properties display settings are stored with the TwwDBLookupCombo. The default is
True. Set this property to False if you have multiple controls attached to the same dataset and
each has different settings for its fields.
Data Type: Boolean
Removed properties
The following properties were removed: DropDownAlignment, DropDownCount and
DropDownWidth.
Added Events
Some of the following events pass a handle to the form containing all of the components of the
dialog. To see what objects are contained within this editing form, open up [Link] in the
InfoPower source sub-directory. If you do not have the source code version of InfoPower, then
perform the steps in Chapter 4's topic "Determining the object names of the controls contained
in an InfoPower dialog" on the [Link] file contained in the InfoPower lib directory.
If you want to customize any of the objects contained by the form you can use the OnInitDialog
event. However if all you are trying to do is to change the labels and hints, then use the
TwwIntl | SearchDialog property.
OnCloseDialog
This event allows you to perform any custom action before the dialog is actually closed.
OnInitDialog
Allows you to customize every aspect of the dialog box or perform some action during the
initialization of the dialog box. When using this event, your code must reference wwidlg in
your source file’s Uses clause. This gives you access to all the components in the dialog. For
example, you can modify the grid's properties, define custom events, etc.
Example: The following code tells the first user-defined button to show a hint when the user
moves the mouse pointer over the button:
procedure TForm1.wwDBLookupComboDlg1InitDialog(
OnPerformCustomSearch
When using a large lookuptable from a remote server, the performance of the lookupcombo’s
incremental searching can significantly degrade. To resolve this issue, InfoPower adds a new
event where you can control the specific action that takes place after the user types a character,
or when the control needs to look up a value. In particular the custom action can update the
query to only return the records that you are interested in. When using this event, your code is
responsible for manipulating the lookuptable based on the parameter values passed in. This
event is also fired during incremental searching within the popup dialog. See the
TwwDBLookupCombo OnPerformCustomSearch event for a description of the events
parameters.
OnUserButton1Click
When you want to display developer-defined button #1 on the dialog box, enter the caption
text for the button in the UserButton1Caption property and then add code to this event that
will be executed when the end-user clicks the button.
Tip: If you wish for this dialog to immediately close after executing your code, assign the
ModalResult property of the dialog. The Sender parameter is cast to a TForm to get a handle
to the actual dialog on the screen.
procedure Tform1.wwDBLookupComboDlg1UserButton1Click(
Sender: TObject; LookupTable: TDataSet);
begin
(Sender as TForm).ModalResult := mrOK;
end;
OnUserButton2Click
When you want to display developer-defined button #2 on the dialog box, enter the caption
text for the button in the UserButton2Caption property and then add code to this event that
will be executed when the end-user clicks the button.
How-to
Change the default position of the pop-up dialog.:
The following code attached to the OnInitDialog event will change the default position of the
pop-up dialog to be (left=10, top=10).
procedure TForm1.wwDBLookupComboDlg1InitDialog(
Dialog: TwwLookupDlg);
begin
[Link]:= 10;
[Link]:= 10;
end;
Tips
To activate the drop-down portion of this component via the keyboard, press the Alt+down
cursor arrow keys when the component has focus.
Ancestor
TWinControl
└─ TwwMonthCalendar
└─ TwwDBCustomMonthCalendar
DataField
This property defines the name of the field you want to bind the MonthCalendar to. The
default value is blank (unbound).
Data Type: String
Valid Values: Valid field name
DataSource
This property defines the name of the TDataSource you want to bind the MonthCalendar to.
The default value is blank (unbound).
Data Type: TDataSource
Valid Values: Valid DataSource component name
Date
This property defines the date the month calendar initially displays as selected. This property
is ignored if the component is bound to a database field, as the date will then originate from
the value of the database field.
Data Type: TDateTime
EndDate
Run-time only. This property is used with Options | mdoMultiSelect. After the end-user has
selected a range of dates, this property is updated to contain the last date in the selected range.
See also the properties MaxSelectCount and MinDate.
Data Type: TDateTime
MaxDate
This property defines the maximum allowable date that the month calendar will allow the end-
user to select. The default is blank which means that the upper range of the calendar is not
restricted.
Data Type: TDateTime
MaxSelectCount
When Options | mdoMultiSelect is True, this property defines the maximum number of
consecutive days that can be selected.
Data Type: Integer
MinDate
This property defines the minimum allowable date that the month calendar will allow the end-
user to select. The default is blank which means that the lower range of the calendar is not
restricted. Note: The calendar does not support dates less than the year 1900.
Data Type: TDateTime
Options
This property defines a set of options for the month calendar control.
Data Type: Set of TwwMonthOption;
Valid Values: mdoDayState, mdoWeekNumbers, mdoNoToday, mdoNoTodayCircle,
mdoMultiSelect
mdoDayState When True, the OnCalcBoldDay event is fired.
mdoWeekNumbers When True, week numbers are displayed at the far left column of the
calendar
mdoNoToday When True, the month calendar control will not display the "today"
date at the bottom of the control.
mdoNoTodayCircle When True, the month calendar control will not circle the "today"
date.
mdoMultiSelect When True, the month calendar will allow the user to select a range
of dates within the control. By default, the maximum range is one
week. You can change the maximum range that can be selected by
using the MaxSelectCount property.
StartDate
Run-time only. This property is used with Options | mdoMultiSelect. After the end-user has
selected a range of dates, this property is updated to contain the first date in the selected range.
See also the properties MaxSelectCount and MinDate.
Data Type: TDateTime
Time
This property defines the internal time that the month calendar stores. This is never displayed
to the end-user, but is used internally when updating a database field
Data Type: TDateTime
Valid Values: Valid TDateTime value
OnMouseDown, OnMouseUp
Use the OnMouseDown or OnMouseUp event handlers to implement any special processing
that should occur as a result of pressing or releasing a mouse button
The parameters for this event are as follows.
Sender : TObject Calendar control where the mouse action took place.
Button : TMouseButton Indicates which mouse button was pressed or released.
Shift : TShiftState Indicates the state of the Shift keys at the time the
mouse was pressed or released.
X,Y: integer; The mouse position at the time the mouse was pressed
or released. X and Y are the pixel coordinates of the
mouse pointer in the client area of the Sender.
Month,Day,Year: integer; Indicates which date on the calendar the mouse cursor
is over when the mouse button is pressed or released.
If Day is 0, then the mouse is not over any date.
How To
Display more than one month in the calendar control
By increasing the control’s Width and the Height properties, the control will fit additional
months into the client area.
Ancestor
TwwCustomTransparentPanel
Added Properties
AutoSizeStyle
This property defines how the navigator will auto-size itself and its buttons when the size of
the navigator changes. Set this property to asSizeNavigator if you wish for the navigator to
change its size to ensure the navigator’s buttons fit. Set this property to asSizeNavButtons to
adjust the size of the buttons to accommodate the size of the Navigator. When AutoSizeStyle
is asNone, no auto sizing occurs.
Data Type: TwwNavAutoSizeStyle
Valid Values: asSizeNavigator, asSizeNavButtons, asNone
Buttons
This property contains a collection of buttons assigned to the navigator. Each collection item
is of type TwwNavButton. Clicking on this property from the object inspector brings up
InfoPower’s collection editor.
Data Type: TwwNavButtons
TwwNavButtons has the following properties you can access during program execution:
Count Returns the number of buttons in the navigator.
Navigator Returns the corresponding TwwDBNavigator for the buttons
Caption Text displayed beneath button. Requires that the ShowText property be
set to True.
Dialog This property is used in conjunction with the Style property to execute a
custom InfoPower dialog. When the style property is set to one of the
dialog styles, and this property is set, then the corresponding Dialog will
execute.
Flat Runtime only - Set this property to True so that the navigator button
appears flat, and does not have borders separating them.
Index Set this property to change the order within the TwwNavButtons
collection.
ImageIndex Setting this property will override (if any) the image settings and display
an image from the navigator’s assigned ImageList.
LineBreak Set this property to True to force a line or column break within the
navigator. The navigator’s Layout property determines if it is a column
break (nlVertical), or a line break (nlHorizontal).
Margin Margin is the number of pixels between the edge of the button and the
image or caption drawn on its surface. If set to –1, then the
image/caption are automatically centered.
NumGlyphs Set this property to change the number of glyphs in the ImageList to
associate with this button. See also the ImageIndex property, and the
navigator’s ImageList property.
ShowText Set to True to display the Caption beneath the bitmap.
Spacing Set Spacing to the number of pixels that should appear between the
image specified by the ImageIndex property and the text specified in the
Caption property.
Style This property determines the behavior and appearance of the button.
When setting this property, the image on the button will change to
reflect the new style. The action that occurs when clicking on the button
is dependent on this property. If this style is set to nbsCustom, then no
default behavior occurs.
When this property represents one of the InfoPower dialogs, then one of
two possible actions can occur. If the Dialog property is assigned, then
the Dialog is executed when the button is clicked. If the dialog is
DataSource
This property defines the name of the TDataSource you want to bind the Navigator to.
Data Type: TDataSource
Valid Values: Valid DataSource component name
Flat
Set this property to True so that the navigator buttons appear flat, and do not have borders
separating them. When False, the buttons are clearly defined.
Data Type: Boolean
ImageList
Set this property to the TImageList you wish for the buttons to reference via their ImageIndex
property.
Data Type: Boolean
Layout
This property specifies the way the buttons are positioned and sized. If this property is set to
nlHorizontal, buttons are positioned in a left to right order and begin a new row of buttons
when reaching the right side of the navigator. When this property is set to nlVertical, buttons
are positioned in a top to bottom order and begin a new column of buttons when reaching the
bottom side of the navigator.
Data Type: TwwNavLayout
Valid Values: nlHorizontal, nlVertical
MoveBy
This property determines the number of records the navigator moves forwards or backwards
when the NextPage and PriorPage buttons are pressed.
Data Type: Integer
Options
Options to control the navigator’s behavior.
Data Type: Set of TwwNavOptions
Valid Values: noConfirmDelete, noUseInternationalText
RepeatInterval
This property controls the auto-repeat timing of the navigator. When a user clicks a button
and does not release the mouse, the navigator will re-execute the last clicked button after an
initial delay. Thereafter it will continue to repeat the execution of the last clicked button until
the button is released. For instance if the user presses the Next Record button and holds the
mouse down, it will continually advance through the dataset until the mouse button is released.
InitialDelay The number of milliseconds that passes from the time that the user
presses a button to when the button’s action begins to repeat.
Interval The number of milliseconds that passes between each successive
repeat of the button’s action, after the initial delay.
Transparent
Set this property to true to paint the navigator transparently.
TransparentClearsBackground
This property is now obsolete. See the Transparent property.
Added Events
OnResize
This event is fired when the TwwDBNavigator is being resized.
TwwNavButton events
OnAfterCreateDialog
Use this event to customize the behavior and/or appearance of the dynamically generated
InfoPower dialog. This event is called immediately after the dialog has been created. The
event will only fire if the Dialog property for the Button is unassigned and the style
property is set to that of an InfoPower dialog.
OnRowChanged
This event occurs immediately after the current record position of the TDataSet has
changed.
OnUpdateState
Cause: TwwUpdateCause Reason the event was fired. Can be one of the following:
usDataChanged, usEditingChanged, usActiveChanged, or
usOther.
Added Methods
SetDataSourceFromComponent
Call this method to set the Navigator’s DataSource property to the DataSource of
Component. If AllowNil is true and the DataSource property of Component is nil, then the
Navigator’s DataSource property will be set to nil. Otherwise this method never clears the
Navigator’s DataSource property.
Procedure SetDataSourceFromComponent(
Component: TComponent; AllowNil: boolean); virtual;
TwwNavButtons methods
Add Adds a new button to the navigator. The AStyle and
AComponent parameters set the Style and Dialog properties of
the TwwNavButton.
function Add(
AStyle: TwwNavButtonStyle;
AComponent: TComponent): TwwNavButton;
TwwNavButton methods
Click This method handles the default action of the Button. Call this method to
simulate the action (clicking) of the button
IsVisible Returns True if the Button’s position is such that it is within the boundaries
of the TwwDBNavigator.
How-to
Design-time Tips
Woll2Woll has greatly enhanced the native RichEdit in Delphi, and includes both
data-aware and non data-aware versions.
TwwDBRichEditMSWord : InfoPower uses a separate richedit component for integration
with MSWord. This component allows the end-users to spell check or grammar check the
document using Microsoft Word’s native spell checker. The reason we have introduced a
separate new component is to avoid the dependence upon the COM Office automation
packages when not using MSWord’s spell checker. If you use the TwwDBRichEditMSWord
component, we recommend that you do NOT put the corresponding IP4000WORD***
package in your project’s runtime package list. By avoiding use of these packages as run-
time packages, you can omit the distribution of the related Office automation packages as
well as these packages.
InfoPower’s richedit control now additionally supports the following:
• New in InfoPower 4000 - Now supports importing from Microsoft Word or mporting
and exporting to HTML Other formats also supported based on the text filters installed
on the client computer. For instance, you can import from an Excel spreadsheet. See
the \ip4000\demos\richedit\[Link] file for an exmple of how to import and export.
In particular, see the richedit’s Import and Export methods.
• New in InfoPower 4000 - Define headers and footers when using the richedit's Print
method. See the \ip4000\demos\richedit\[Link] file for an exmple of how to
incorporate a header and footer in the richedit’s hardcopy printout. In particular see the
PrintHeader and PrintFooter properties.
• New Mail Merge Example - Use database fields to fill a richedit's contents. See the
\ip4000\demos\richedit\[Link] file for an example of performing mail-merge
with the InfoPower richedit control. The basic idea is to use a template richedit which
contains the tags you wish to replace. Then use another richedit control that is to
contain the actual contents with the replaced text.
The following lists some of the capabilities of these components.
♦ Full Text Justification Support: InfoPower now adds full text justification so that the
text is aligned to both the left and right margins. This requires the latest [Link]
(RichEdit Version 3).
♦ Enhanced OLE Support: InfoPower adds additional OLE dialogs to allow
modification of an OLE object’s properties. OLE link to file is now supported.
♦ Supports Transparency and custom framing – Since this control can be used
transparently you can now easily use this control like a RichEdit Label control for rich
formatted labels in your applications.
Bitmap and OLE support : Embed bitmaps and OLE objects directly into the
RichEdit control. You can even save these to your database.
Integrated RTF Word processor : End-users can bring up InfoPower's powerful RTF
word processor to give them a full word-processor.
Customize printer margins, orientation, and paper size : Supports end-user
customization of the page layout using the Windows PageSetup common dialog.
Database Search and Filter : After storing RTF text into database blob fields, you
can still have access to InfoPower's powerful database searching and filtering
capabilities.
Integration with Microsoft Word’s Spelling and Grammar checking: Use
Microsoft Word’s Spell check to spell check or grammar check the document. You
must use the TwwDBRichEditMSWord component.
Background highlighting of selected text: The user can highlight selected text so that
it stands out.
Extensive pop-up menu support : All of the component’s functionality is accessible to
the end-user by right-clicking the component.
Design-time support for entering rich-edit text and OLE into the control. Delphi's
version cannot store formatted text into a control during design time.
Seamless integration with InfoPower's Grid and RecordView Components
Added Properties
AutoURLDetect
When True, URL addresses in the rich-edit text are automatically underlined. The component
will also automatically open the specified URL with the Internet Browser when the user clicks
on the link. Use the OnURLOpen event to change this default behavior
Data Type: Boolean
DataField
This property defines the name of the field you want displayed in the memo editor window.
The default value is blank. If you do not wish to bind the rich-edit control to a table field, then
leave both the DataField and DataSource properties as blank.
Data Type: String
DataSource
This property contains the name of a TDataSource component that provides the RichEdit
control with data. The default value is blank.
Data Type: TDataSource
Valid Values: Valid DataSource component name
EditorCaption
This property contains a text value that is displayed in the pop-up editor window’s title bar.
The default value is ‘Edit Rich Text’.
Data Type: String
EditorOptions
This property contains a set of Boolean values that control the display of pop-up richtext
editor. The user invokes the pop-up richtext editor by right-clicking the control and selecting
Edit. Alternatively they can invoke the editor by pressing F2. Note that these options affect
the pop-up richtext editor, and not the pop-up menu.
Data Type: Set of TwwRichEditOption
Valid Values: reoShowLoad, reoShowSaveAs, reoShowSaveExit,
reoShowPrint, reoShowPageSetup, reoShowFormatBar,
reoShowToolBar, reoShowStatusBar, reoShowHints, reoShowRuler,
reoShowInsertObject, reoCloseOnEscape, reoFlatButtons, reoShowSpellCheck,
reoShowMainMenuIcons, reoShowJustifyButton
reoShowSaveExit If True, then the File | Save & Exit menu selection is displayed.
This menu selection allows the end-user to save their changes
and exit the pop-up editor. Defaults to True
reoShowLoad If True, then the File | Load menu selection is displayed. This
menu selection allows the end-user to load text from a file.
Defaults to False.
reoShowSaveAs If True, then the File | Save As menu selection is displayed.
This allows the end-user to save the richedit’s contents to a file.
Defaults to False.
reoShowPrint If True, then the File | Print menu selection is
displayed. This menu selection allows the end-user to print the
richedit’s contents. Defaults to True
reoShowPageSetup If True, then the File | Page Setup menu selection is displayed.
This menu selection allows the end-user to customize the page-
setup in preparation for printing. Defaults to True.
reoShowFormatBar If True, then the FormatBar is displayed. The FormatBar
contains icons for formatting the text. Defaults to True.
EditWidth
This property determines the wrapping boundaries of the pop-up richtext editor. If set to
rewWindowSize then text is wrapped according to the window boundaries. If set to
rewPrinterSize then text is wrapped as defined by the page layout settings. Defaults to
rewPrinterSize.
Data Type: TwwRichEditWidth
Valid Values: rewWindowSize, rewPrinterSize
Frame
See the topic “Key properties and events for custom framing” in chapter 4 for
information on this property.
Data Type: TwwEditFrame
GutterWidth
Set this property to change the number of pixels of fixed spacing between the text and the edge
of the control.
Data Type: Integer
HighlightColor
Set this property to change the color used to highlight text in the word processor. It defaults to
clYellow. The user can highlight text in the word processor by clicking on the speed
button.
Lines
This property contains the individual lines of text in the rich text edit control. Click on this
property at design time to assign rich-edit text to an unbound control.
Use Lines to manipulate the text in the rich text edit control on a line by line basis. Lines is a
TStrings object, so TStrings methods may be used for Lines to perform manipulations such as
counting the lines of text, adding lines, deleting lines, or replacing the text in lines.
To work with the text as one chunk, use the Text property. To manipulate individual lines of
text, the Lines property works better.
Data Type: TStrings
OLEOptions
reoAdjustPopupMenu When True, if an OLE is selected, the pop-up menu is adjusted to
include the menu selections relating to the selected OLE object.
User can click on the Insert Object… popup selection to bring up
a dialog to insert an OLE object.
reoDisableOLE When True, the end-user will not be able to embedding any OLE
object.
PrintFooter
Assign this property to integrate headers into the printed output produced from the Print
method. If you wish to include page numbers in your footer, then assign the footer’s text using
the OnPrintFooter event.
Example: The following code attached to the OnPrintFooter event assigns the text like “Page
1 of 5” to the right-most text in the footer, and assigns the current date to the left-most text.
procedure TPrintHeaderForm.wwDBRichEdit1PrintFooter(Sender:
TwwCustomRichEdit;
DrawRect: TRect; PageNumber: Integer; var LeftText, CenterText,
RightText: String; var DoDefault: Boolean);
begin
RightText:= 'Page ' + inttostr(PageNumber) + ' of ' +
inttostr([Link]);
LeftText:= datetostr(date);
end;
PrintPageSize
This defines the page size of the richedit control. Some of the possible values are as follows.
These values are defined by windows.
Data Type: Integer
Valid Values: See Below
DMPAPER_LETTER = 1; { Letter 8 12 x 11 in }
DMPAPER_FIRST = DMPAPER_LETTER;
DMPAPER_LETTERSMALL = 2; { Letter Small 8 12 x 11 in }
DMPAPER_TABLOID = 3; { Tabloid 11 x 17 in }
DMPAPER_LEDGER = 4; { Ledger 17 x 11 in }
DMPAPER_LEGAL = 5; { Legal 8 12 x 14 in }
DMPAPER_STATEMENT = 6; { Statement 5 12 x 8 12 in }
DMPAPER_EXECUTIVE = 7; { Executive 7 14 x 10 12 in }
DMPAPER_A3 = 8; { A3 297 x 420 mm }
DMPAPER_A4 = 9; { A4 210 x 297 mm }
DMPAPER_A4SMALL = 10; { A4 Small 210 x 297 mm }
DMPAPER_A5 = 11; { A5 148 x 210 mm }
DMPAPER_B4 = 12; { B4 (JIS) 250 x 354 }
DMPAPER_B5 = 13; { B5 (JIS) 182 x 257 mm }
DMPAPER_FOLIO = 14; { Folio 8 12 x 13 in }
DMPAPER_QUARTO = 15; { Quarto 215 x 275 mm }
DMPAPER_10X14 = 16; { 10x14 in }
DMPAPER_11X17 = 17; { 11x17 in }
DMPAPER_NOTE = 18; { Note 8 12 x 11 in }
DMPAPER_ENV_9 = 19; { Envelope #9 3 78 x 8 78 }
DMPAPER_ENV_10 = 20; { Envelope #10 4 18 x 9 12 }
DMPAPER_ENV_11 = 21; { Envelope #11 4 12 x 10 38 }
DMPAPER_ENV_12 = 22; { Envelope #12 4 \276 x 11 }
DMPAPER_ENV_14 = 23; { Envelope #14 5 x 11 12 }
DMPAPER_CSHEET = 24; { C size sheet }
DMPAPER_DSHEET = 25; { D size sheet }
DMPAPER_ESHEET = 26; { E size sheet }
DMPAPER_ENV_DL = 27; { Envelope DL 110 x 220mm }
DMPAPER_ENV_C5 = 28; { Envelope C5 162 x 229 mm }
DMPAPER_ENV_C3 = 29; { Envelope C3 324 x 458 mm }
DMPAPER_ENV_C4 = 30; { Envelope C4 229 x 324 mm }
DMPAPER_ENV_C6 = 31; { Envelope C6 114 x 162 mm }
DMPAPER_ENV_C65 = 32; { Envelope C65 114 x 229 mm }
DMPAPER_ENV_B4 = 33; { Envelope B4 250 x 353 mm }
DMPAPER_ENV_B5 = 34; { Envelope B5 176 x 250 mm }
DMPAPER_ENV_B6 = 35; { Envelope B6 176 x 125 mm }
DMPAPER_ENV_ITALY = 36; { Envelope 110 x 230 mm }
DMPAPER_ENV_MONARCH = 37; { Envelope Monarch 3.875 x 7.5 in }
DMPAPER_ENV_PERSONAL = 38; { 6 34 Envelope 3 58 x 6 12 in }
DMPAPER_FANFOLD_US = 39; { US Std Fanfold 14 78 x 11 in }
DMPAPER_FANFOLD_STD_GERMAN = 40; { German Std Fanfold 8 12 x 12 in }
PopupMenu
Pop-up menu for the rich text control There already is a built-in pop-up menu for this control,
but you can override it to use your own with this property. See also the PopupOptions property
as this allows you to customize the built-in PopupMenu.
Data Type: TPopupMenu
PopupOptions
This property allows you to select which selections are available to the end-user through the
pop-up menu.
Data Type: Set of TwwRichEditPopupOption
Valid Values: rpoPopupEdit, rpoPopupCut, rpoPopupCopy, rpoPopupPaste,
rpoPopupBold, rpoPopupItalic, rpoPopupUnderline, rpoPopupFont, rpoPopupBullet,
rpoPopupParagraph, rpoPopupTabs, rpoPopupFind, rpoPopupReplace,
rpoPopupInsertObject, rpoPopupMSWordSpellCheck
rpoPopupEdit If True, then the user can click on the Edit popup selection to bring
up a pop-up editor window. Defaults to True.
rpoPopupCut If True, then the user can click on the Cut popup selection to cut the
currently selected text. Defaults to True.
rpoPopupCopy If True, then the user can click on the Copy popup selection to copy
the currently selected text to the clipboard. Defaults to True.
rpoPopupPaste If True, then the user can click on the Paste popup selection to paste
the clipboard’s contents to the control. Defaults to True.
rpoPopupBold If True, then the user can click on the Bold popup selection to bold-
face the currently selected text. Defaults to False.
rpoPopupItalic If True, then the user can click on the Italic popup selection to
italicize the currently selected text. Defaults to False.
rpoPopupUnderline If True, then the user can click on the Underline popup selection to
underline the currently selected text. Defaults to False.
rpoPopupFont If True, then the user can click on the Font popup selection to
change the font of the currently selected text. Defaults to True.
rpoPopupBullet If True, then the user can click on the Bullet popup selection to
enable or disable bullets for the currently selected text. Defaults to
True.
rpoPopupParagraph If True, then the user can click on the Paragraph popup selection to
underline the currently selected text. Defaults to True.
rpoPopupTabs If True, then the user can click on the Tabs popup selection to
customize the tab-stops for the currently selected text. Defaults to
True.
PrintJobName
Set this property to change the print job name used by the pop-up word processor when the
user selects the File | Print menu selection.
PrintMargins
This property allows you to define printer margins for when you print the contents of the
control. The units of measurement are defined by the TwwDBRichEdit’s MeasurementUnits
property.
Bottom Blank space to leave at the bottom of the printout.
Data Type: Double
Valid Values: Valid value for the printer page layout. Value type is defined by
the MeasurementUnits property.
Note: You will need to add wwrich to your form’s uses clause to resolve the
TwwRichEditForm reference.
UserSpeedButton2
This gives you a 2nd speed button to add to the word processor. See UserSpeedButton1 for its
usage.
Added Events
Some of the following events pass a handle to the form containing the richtext editor. To see
what objects are contained within this editing form, open up [Link] in the InfoPower
source sub-directory. If you do not have the source code version of InfoPower, then perform
the steps in Chapter 4's topic "Determining the object names of the controls contained in an
InfoPower dialog" on the [Link] file contained in the InfoPower lib directory.
If you want to customize any of the objects contained by the form you can use the OnInitDialog
event. However if all you are trying to do is to change the labels and hints, then use the
TwwIntl | RichEdit property.
OnCloseDialog
This event allows you to perform any custom action before the pop-up richtext editor is closed.
The parameters for this event are as follows.
Form: TForm TForm handle to popup richtext editor
OnCreateDialog
This event allows you to perform any custom action immediately after the pop-up richtext
editor is created. You may wish to use this event instead of the OnCloseDialog event if you
need the code executed before the pop-up editor window is created.
OnInitDialog
This event allows you to perform any custom action before the pop-up richtext editor is
initially displayed.
OnMenuLoadClick
This event allows you to perform any custom action when the user selects Load from the pop-
up word processor. The parameters for this event are as follows.
Form TForm handle to popup richtext editor
RichEdit RichEdit on the pop-up word processor. Do not confuse this with the richedit
on your own form.
DoDefault Set to False to prevent the default action from occurring.
OnMenuPrintClick
This event allows you to perform any custom action when the user selects Print from the pop-
up word processor. See the OnMenuLoadClick event for a description of the parameters to this
event.
OnMenuSaveAsClick
This event allows you to perform any custom action when the user selects ‘Save As’ from the
pop-up word processor. See the OnMenuLoadClick event for a description of the parameters to
this event.
OnMenuSaveAndExitClick
This event allows you to perform any custom action when the user selects ‘Save and Exit’ from
the pop-up word processor. See the OnMenuLoadClick event for a description of the
parameters to this event.
OnPrintFooter
This event allows you to customize the footer for each page. The event is fired prior to the
formatting of each page for the printer when using the richedit’s Print method.. This event is
useful for inserting dynamic page information into the printed output, such as page numbers.
See the PrintFooter property for an example of using this event.
Sender: TwwCustomRichEdit RichEdit control associated with footer
DrawRect: TRect Printing rectangle for footer/header
var LeftText, CenterText, RightText: string
OnPrintHeader
This event allows you to customize the header for each page. The event is fired prior to the
formatting of each page for the printer when using the richedit’s Print [Link] event is
useful for inserting dynamic page information into the printed output, such as page numbers.
See the PrintFooter property for an example of using this event.
OnURLOpen
When the end-user clicks on an URL link with the document, the rich edit control will open
the default Internet Browser at the specified URL address. If you wish to change this behavior,
you can use this event to perform your own custom actions.
The parameters for this event are as follows.
Sender: TwwCustomRichEdit RichEdit control containing the URL link
URLLink: String; String containing the text of the URL link
UseDefault: boolean; Set to True to perform the default behavior of opening
the link with the default Internet Browser. Set to False
to disable the default behavior.
Added Methods
AppendRichEditFrom
Calling this method appends the contents of SourceRichEdit to the current richedit control.
Procedure AppendRichEditFrom(SourceRichEdit: TCustomRichEdit);
CanPaste
This method returns true if there is text in the clipboard that can be pasted into the control.
Function CanPaste: boolean;
CanUndo
This method returns true if the control is capable of undoing the last editing operation.
CanCut
This method returns true if the there is selected text which can be cut to the clipboard.
Function CanCut: boolean;
CanFindNext
This method returns true if the control repeat the last search operation. The return value will
be false if no search has been previously performed.
Function CanFindNext: boolean;
CanRedo
This method returns true if the control is capable of redoing the last editing operation.
Function CanRedo: boolean;
CopyRichEditFromBlob
This method allows you to copy from a Blob Field to the rich edit control.
Procedure CopyRichEditFromBlob(Field: TField);
CopyRichEditTo
This method allows you to copy the richtext from one rich edit control to another.
Procedure CopyRichEditTo(val: TCustomRichEdit);
CopyRichEditToBlob
This method allows you to copy from a rich edit control to a Blob Field.
Procedure CopyRichEditToBlob(Field: TField);
Execute
Calling this method brings up the pop-up richtext editor. A return value of True is returned if
the user saved their changes.
Function Execute: boolean;
ExecuteFindDialog
Calling this method brings up the Find Dialog, where the end-user can search for text in the
richedit control.
Procedure ExecuteFindDialog; virtual;
ExecuteReplaceDialog
Calling this method brings up the Find Dialog, where the end-user can search and replace text
in the richedit control.
Procedure ExecuteReplaceDialog; virtual;
ExecuteParagraphDialog
Calling this method brings up the paragraph dialog, where the end-user can assign paragraph
indentation properties.
function ExecuteParagraphDialog: boolean; virtual;
ExecuteTabDialog
Calling this method brings up the tab dialog, where the end-user can set tab stops.
Procedure ExecuteTabDialog; virtual;
FindNextMatch
Calling this method repeats the last search performed by the FindDialog
Procedure FindNextMatch; virtual;
FindReplace
Calling this method repeats the last replace performed by the ReplaceDialog
Procedure FindReplace; virtual;
FindReplaceText
Calling this method searches for the string defined by SearchText and replaces it with
ReplaceText. The function returns true if a match was found. SearchTypes is a set of
TSearchType = (stWholeWord, stMatchCase). The search begins from the current cursor
position. If you wish to ensure that the search starts from the beginning of the text, then set the
SelStart property to 0.
Function FindReplaceText(SearchText, ReplaceText: string;
SearchTypes: TSearchTypes): boolean; virtual;
Example: The following code replaces all occurrences of the string '$Company$' with the
string 'Woll2Woll Software'.
[Link]:= 0;
while [Link](
'$Company$', 'Woll2Woll Software', []) do;
GetRTFText
Call this method to get the raw RTF text. This differs from the text property, which returns the
unformatted text of the control.
Export
Call this method to export the richedit’s contents to a file named FileName of the format
defined by Format. File formats supported are determined by the export filters installed on the
Import
Call this method to import from a file named FileName of the format defined by Format into
the richedit contents. File formats supported are determined by the import filters installed on
the client system. See the \ip4000\demos\richedit\[Link] file for an example of how to
import and export.
Example: The following code imports from the HTML file [Link] into the richedit.
Import('HTML', '[Link]');
If you wish to integrate importing and exporting with a TOpenDialog and TSaveDialog, you
can use the TwwRTFConverterList to assist you. TwwRTFConverterList is defined in the unit
wwrtfconverter. Again see \ip4000\demos\richedit\[Link] for practical usage.
constructor Create(import: boolean) When constructing the class, pass true for import
when generating a list of the client’s installed
import filters. Use a False value for import when
constructing a list of export filters.
MSWordSpellChecker
Calling this method invokes Microsoft Word to spell check the text. This method requires
Delphi 5 or later versions. See also the properties [Link]
and [Link] to allow built-in menus to invoke the spell checker.
Function MSWordSpellChecker: boolean; virtual;
Redo
Calling this method asks the richedit control to redo the last operation undone by a Undo.
SetBullet
Calling this method enables or disables the bullet style of the current paragraph
Procedure SetBullet(val: boolean);
SetBold
Calling this method enables or disables the boldface attribute of the currently selected text.
Procedure SetBold(val: boolean);
SetItalic
Calling this method enables or disables the italic attribute of the currently selected text.
Procedure SetItalic(val: boolean);
SetUnderline
Calling this method enables or disables the underline attribute of the currently selected text.
Procedure SetUnderline(val: boolean);
Undo
Calling this method asks the richedit control to undo the last operation.
How To
Bind the control to a database field
In order to use the rich-edit control with a database field, you will need to attach the control to
a TBlobField. You can create a TBlobfield by editing your table structure with a tool such as
Database Desktop, and then adding a blob field.
Change the richedit’s main menu to call your own custom code
The pop-up richtext editor has a menu that can be partially customized through the
EditorOptions property. However your customization options are limited through this
property. For greater flexibility in manipulating the menu, use the OnInitDialog event. You
can attach code in this event to add additional menu choices to the pop-up editor.
The following example will add a new menu group called Tools, and have a menu selection
item of Greeting. When the user clicks on Tools | Greeting, the message “Hello” is displayed.
Also make sure that the menus unit is added to your form’s uses clause so that the compiler
can recognize the TMenuItem component.
procedure TForm1.wwDBRichEdit1InitDialog(Form: TForm);
var ToolMenuItem: TMenuItem;
Function AddMenuItem(Owner: TComponent;
ACaption: string; event: TNotifyEvent): TMenuItem;
var menuItem: TMenuItem;
begin
menuItem:= [Link](Owner);
[Link]:= ACaption;
[Link]:= event;
result:= menuItem;
if Owner is TMenu then (Owner as TMenu).[Link](menuItem)
else (Owner as TMenuItem).Add(menuItem)
end;
begin
ToolMenuItem:= AddMenuItem([Link], 'Tools', Nil);
AddMenuItem(ToolMenuItem, 'Greeting', GreetingClick);
end;
In addition to attaching code to the OnInitDialog event, you will also need to declare and
define the code for your menu item events. The following is the code that is executed when
the user selects Tools | Greeting. Note that you would also need to add the declaration of
GreetingClick to your own form.
procedure [Link](Sender: TObject);
begin
showmessage('Hello');
end;
Automatically append text when opening the pop-up richtext editor (i.e. add
current date/time)
The following code attached to the OnInitDialog event will add the current timestamp to the
end of the richedit’s contents. You will need to add wwrich to your uses clause if it is not
already there.
procedure TForm1.wwDBRichEdit1InitDialog(Form: TForm);
begin
with (Form as TwwRichEditForm).RichEdit1 do
begin
selStart:= length(text);
[Link](datetostr(Now));
end;
end;
Force word wrapping to adjust to the printer page size instead of the window size
Set the EditWidth property to rewPrinterSize.
TwwDBSpinEdit component gives your end-users the ability to easily and quickly
increment or decrement formatted numeric and date values by clicking the mouse button or by
pressing the up and down cursor arrow keys. You define the data source and field names,
along with minimum, maximum and increment values. This component can also be used in an
unbound manner (without specifying data source or data field values).
The end-user can modify the contents of the TwwDBSpinEdit by clicking on the up and down
icons. Alternatively they can use the UP Arrow and DOWN Arrow keys. On Date, Time, and
DateTime fields the spinedit will highlight the text that is changing while spinning, so the
user will visually see what is changing.
InfoPower adds the ability to spin formatted numeric text so that the user sees a more
meaningful representation of the value. Set the [Link] property of the field
indicated by the DataField property to spin formatted numerics.
Note: See also the TwwDBDateTimePicker component if you wish to edit dates or times.
Ancestor
TCustomMaskEdit
└─TwwDBCustomEdit
Added Properties
EditorEnabled
When False, the user is not able to type into the TwwDBSpinEdit. The user can still change
the value using the Up/Down Arrow keys or by clicking on the spinedit icons.
Data Type: Boolean
Increment
The Increment property is the value that the component increments/decrements when spinning
the value. This property is ignored when using a date field. Date fields will automatically
MinValue
The MinValue property is the minimum value allowed by the component. If you are trying to
set the MinValue of a date field, we recommend you set this property via code to simplify the
translation from a date to a double. If the properties MinValue and MaxValue are both 0, then
the component ignores these limits.
Data Type: Double
Example: The following code sets the MinValue so that you can’t spin to dates less than the
current date.
[Link] := Now;
MaxValue
The MaxValue property is the maximum value allowed by the component. If you are trying to
set the MaxValue of a date field, we recommend you set this property via code to simplify the
translation from a date to a double. If the properties MinValue and MaxValue are both 0, then
the component ignores these limits.
Data Type: Double
Example: The following code sets the MinValue so that you can’t spin to dates greater than
the current date.
[Link] := Now;
UnboundDataType
When this component is used without a datasource and datafield, you can still force it to spin
as a date or time value by setting this property. This property also determines how the
component will auto-fill when the space key is entered by the end-user.
Data Type: TwwEditDataType
Valid Values:
wwDefault Spin as a numeric
wwEdtDate Spin as a Date
wwEdtTime Spin as a Time
wwEdtDateTime Spin as a date and time
Value
Current value of component.
Data Type: Double
See the Delphi documentation under date/time formatting for more details on
controlling the format of dates and times
Ancestor
TCustomCheckBox
└─TwwCustomCheckBox
└─TwwDBCustomCheckBox
Added Properties
AutoHideExpandButton
You can automatically hide the expand/collapse icons by using Options | AutoHideExpand to
True. The icons are hidden if the value of the field is 0 or null when this property is true.
This property provides a convenient way of informing the user that there are no detail records
for the given expand button. If you also wish to also prevent the drop-down grid from
expanding via the <space> or <Ctrl><Right> keystrokes, then add the following line of code
to your OnBeforeExpand event. The default behavior of the control does not prevent this so
that there is still a way to edit/insert records in the detail grid
Data Type: Boolean
Example:
procedure TMasterDetailGridForm.wwExpandButton1BeforeExpand(Sender:TObject);
begin
with (Sender as TwwExpandButton).Field do
if IsNull or (Text='') then abort;
end;
AutoShrink
The design-time height of the detail grid is used as the grid’s size when the grid is expanded.
If AutoShrink property is True, then the expand button will shrink the grid if there are not
enough records to fill the entire grid. You may wish to only use AutoShrink for your terminal
grid (last detail grid without any contained expand buttons), as with non-terminal nodes you
may see some jumpiness as the parent grid tries to ensure that the entire detail grid can fit in
its confined grid area.
Data Type: Boolean
ButtonAlignment
Assign this property to change the location of the expand icons with respect to the text. Note:
Text only appears in the control when ShowText is True. If ButtonAlignment is set to
DataSource
Name of datasource you are filtering or querying
Data Type: TDataSource
Valid Values: Any TDataSource Component
DataField
Name of field whose value is displayed in the control if ShowText is True. Setting this
property will not have any effect, as the grid re-assigns this property to be the name of the field
that the control is attached to.
Data Type: String
Grid
Assign this property to the grid or inspector you wish to see when the user clicks on the
expand button. The grid is automatically shrunk (when AutoShink is True) if the grid
determines that it can display all the records with a smaller height. You can set this to a
TwwDBGrid, TwwDataInspector, or a TPanel Control.
Data Type: TWinControl
GridIndents
Use GridIndents to change the relative placement of the expanded grid.
X Assign this property to specify the number of pixels to move the expanded
grid to the left (positive value) or right (negative value).
Y Assign this property to specify the number of pixels to move the expanded
grid upward (negative value) or downward (negative value).
Images
Assign this property if you wish to change the expand/collapse icons displayed by the
TwwExpandButton. The first image in the imagelist is used as the expand icon, and the
second image is used as the collapse icon.
Data Type: TImageList
Indents
Use Indents to change the relative placement of expand/collapse icon and the text.
ShowAsButton
Set to True to paint the expand/collapse icons as buttons. Instead of being displayed with just
the +/- characters, there is a button frame painted around the icons so that they appear more
like buttons.
Data Type: Boolean
ShowFocusRect
Set to False to hide the focus rect that would appear around the text. Note: Text only appears
in the control when ShowText is True.
Data Type: Boolean
ShowText
Set ShowText to true if you wish to show the text of the calculated field in the column. This
value is not editable and is just a visual indicator. For instance if your calculated field
computes the number of detail records, you may wish to display this value in the grid in the
TwwExpandButton column.
Data Type: Boolean
Added Events
OnAfterCollapse
This event is fired after the end-user collapses the expand button, or the detail grid is
automatically collapsed. When the user manipulates the appearance of the master grid, the
detail grid is automatically collapsed. For instance if the user advances to the next column in
the master grid, or changes the column order, the detail grid is collapsed.
OnAfterExpand
This event is fired after the detail grid is expanded.
OnBeforeCollapse
This event is fired immediately before the detail grid is collapsed.
How To
Associate a drop-down panel to the ExpandButton
Associating a panel to an TwwExpandButton is similar to associating a grid or inspector.
However in some cases when using a panel, you will need to trap for the vk_tab character to
prevent the focus from moving out of the grid that the expandbutton is on.
Ancestor
TComponent
└─TwwCustomDialog
When you execute this dialog box, your end-users can specify a search value, or a range, for
any number of fields contained within the table or query referred to by the DataSource
property. They can also select a specific type of data match to be performed within the field,
such as “From beginning of field”, “Anywhere within the field”, and “Exact match”. The user
can also check the Case Sensitive box to have TwwFilterDialog perform a case-sensitive
match.
Added Properties
Caption
This property contains a text value that is displayed in the dialog window’s title bar. The
default value is blank.
Data Type: String
DataSource
Name of datasource you are filtering or querying
Data Type: TDataSource
Valid Values: Any TDataSource Component
DefaultField
Name of field the dialog initially will select. If the user has previously selected some search
criteria, then this property is ignored.
Data Type: String
Valid Values: Valid Field
DefaultFilterBy
The user can filter by specifying a range of values, or filter by a string value. This property
controls which search type the dialog initially defaults to.
DefaultMatchType
Use this property to change the initial selection of the Search Type radio button.
This property defaults to fdMatchStart.
Data Type: TwwDefaultMatchType
Valid Values: fdMatchStart, fdMatchAny, fdMatchExact
DlgHeight
Use this property to change the height (in pixels) of the filter dialog. By increasing the height,
the dialog can display more fields at a time.
Data Type: integer
FieldOperators
Use this property to customize the field operators that are used to specify “and”, “or”, and
“null” type operations.
Data Type: TwwFieldOperators
There are 3 operators that you can use in the FilterDialog:
AndChar Use this property to customize the “and” keyword that will be used in the
FilterDialog. Default is “and”.
Data Type: String
NullChar Use this property to customize the “null” keyword that will be used in the
FilterDialog. Default is “null”.
Data Type: String
OrChar Use this property to customize the “or” keyword that will be used in the
FilterDialog. Default is “or”.
Data Type: String
FieldsFetchMethod
Use the FieldsFetchMethod to determine the logic InfoPower uses to retrieve the field
information. This property is only applicable with FilterMethod =fdByQueryModify. By
FilterMethod
Use this property to change the filtering method used to select the records that matches the
user’s criteria. The only valid value for filtering a TwwTable or TwwQBE is the fdByFilter.
When filtering a TwwQuery, you can use either fdByFilter, or fdByQueryModify. This
property defaults to fdByFilter.
Data Type: TwwFilterMethod
Valid Values: fdByFilter, fdByQueryModify
fdByFilter When using local filtering on a Query or QBE, the query is not re-
executed, but simply re-filtered. This means that the back-end does
not need to do any additional processing. If you using this
FilterMethod on a TQuery, you should set your RequestLive property
to False. Local filtering on tables guarantees a live editable view of the
data.
fdByQueryModify Remote filtering is performed by re-executing the SQL in a developer
defined TQuery. The query’s SQL string is modified so that it's where
clause reflects the user specified criteria. See also the section
preceding the FilterDialog’s property reference for further information
on this filtering method.
FilterPropertyOptions
This property defines the filtering mechanism used when FilterMethod=fdByFilter. The sub-
properties LikeSupportsUpperKeyword, LikeWildcardChar, UseBracketsAroundFields, and
UseLikeOperator only apply if the DataSetFilterType is set to fdUseFilterProp or
fdUseBothFilterTypes.
Data Type: TwwFilterPropertyOptions
Valid Values: fdNone, fdUseAllIndexes, and fdUseActiveIndex
DataSetFilterType See the ‘Filtering mechanisms used by the
TwwFilterDialog’ section for a detailed reference of this
property. This section appears in the TwwFilterDialog
component description.
Data Type: TwwDatasetFilterType
LikeSupportsUpperKeyword Set this property to True if your back-end supports the
Upper SQL keyword, and you wish to allow the end-user
to select the case sensitivity of their filters. This property
is only applicable if UseLikeOperator is set to True. This
property defaults to False.
LikeWildcardChar Assign this property to customize the wildcard character
used in the filter. This property defaults to ‘%’. Modify this
property if your back-end uses a different wildcard
character. This property is only applicable if
UseLikeOperator is set to True
Data Type: Character
UseBracketsAroundFields Set this property to determine if the filter expression
generated by the filterdialog should put brackets around the
field names. Generally brackets are required by the back-
OnFilterPropertyOptions
This property allows you to customize certain behavior of the callback filtering. Callback
filtering is enabled when FilterMethod=fdByFilter, and FilterPropertyOptions |
DataSetFilterType is set to fdUseOnFilter or fdUseBothFilterTypes.
fdClearWhenNoCriteria Set this to false if you wish to prevent the automatic
canceling of the callback filter when the user has entered
no criteria. This can be useful if you are using the
OnAcceptFilterRecord, as when a filter is cancelled the
OnAcceptFilterRecord event will no longer fire. This
property defaults to true.
Options
Use this property to change what is displayed shown when the dialog box is executed.
Data Type: Set of TwwFilterDialogOption
Valid Values: fdCaseSensitive, fdShowCaseSensitive, fdShowOKCancel,
fdShowViewSummary, fdShowFieldOrder, fdShowValueRangeTab, fdShowNonMatching,
fdHidePartialAnywhere, fdDisableDateTimePicker, and fdSizeable.
fdCaseSensitive Initial value of dialog’s case sensitive checkbox
fdShowCaseSensitive If True, the case sensitive checkbox will be shown in the dialog.
fdShowOKCancel If True, the OK and Cancel buttons are displayed in the dialog
fdShowViewSummary If True, the Show Summary button is shown in the dialog
fdShowFieldOrder If True, then the Field Order radio button is shown in the
dialog
fdShowValueRangeTab If True, then the tab page that allows the user to select either
ByRange or ByValue is shown.
fdShowNonMatching NOT support. When fdShowNonMatching is set to True, then
a checkbox appears in the Filterdialog which will allow the
user to find the information that doesn't fit a particular
condition.
fdHidePartialAnywhere When True, the Partial Match Anywhere Radio Button is
hidden in the dialog. Defaults to False.
fdDisableDateTimePicker When True, the TwwDBDateTimePickers controls are not used
on date/time fields. Defaults to False.
fdSizeable When True, the popup filter dialog will be resizable. Defaults
to False.
QueryFormatDateMode
This property determines how DateTime values get sent to the SQL back end. For instance if
the back-end expects dates to be in the format month,day,year, then set this property to
qfdMonthDayYear. For further customization then these three values provide, use the
OnEncodeDateTime event.
DataType: TwwQueryFormatDateMode
Valid Values: qfdMonthDayYear, qfdDayMonthYear, qfdYearMonthDay
SelectedFields
This property determines which fields the user can filter on. The TwwFilterDialog uses this
property to fill in the Fields listbox. When this property is empty, then all fields are selected.
Click on the Add Fields button to add additional fields to display in the filter dialog. Click on
Remove Fields to remove the selected fields from the filter dialog.
SELECT DISTINCT
IP4CUST."Customer No",
IP4CUST."Buyer" ,
IP4CUST."Company Name"
FROM "[Link]" IP4CUST , "[Link]" IP4INV
WHERE (IP4CUST."CUSTOMER NO"=IP4INV."CUSTOMER NO")
SortBy
The list of fields can be sorted alphabetically by field name or logically by field order.
If this property is set to fdSortByFieldName, then the dialog initially displays the list of fields
alphabetically. If set to fdSortByFieldNo, then the dialog displays the fields in their logical
order.
Data Type: TwwFilterDialogSort
Valid Values: fdSortByFieldNo, fdSortByFieldName
SQLPropertyName
This property is used when FilterMethod=fdByQueryModify. In order for the filterdialog to
support datasets who define their sql with a different property name, you must set the
SQLPropertyName to the name of this property.
InfoPower extends the filterdialog to support dataset types that do not use the property name
‘SQL’ to define their sql. In addition, the data type of the sql property is no longer required to
be a TStringList. This allows the filterdialog to remotely filter dataset types such as
TADODataSet, TClientDataSet, and other 3rd party dataset types that it did not previously
support. This greatly improves the performance in these situations.
See the how-to topic on Remotely filter a TClientDataSet if you are using a TClientDataSet.
Data Type: String
SQLTables
This property is used when FilterMethod=fdByQueryModify, and FieldsFetchMethod is set to
fmUseTTable or fmUseSQL.
SQLUpperString
Assign this property to change the sql keyword used to upper case a field value. When this
property is unassigned, the 'UPPER' keyword is used. This property is only relevant if you are
performing case insensitive filtering with the FilterMethod set to fdByQueryModify. Do not
change this value unless you are certain that your back-end supports a different sql keyword
for uppercase.
UpperRangePadChar
When searching using the ByRange tab on a string field, the upper range field needs to be
padded with the highest valid Ascii character internally. So example with this property set to
it’s default of 122, then if the end-user searches from A to C it will filter on the range from A
to Czzzzzz so that all strings that start with A or C are found. You should not normally need
to modify this value.
Added Events
Some of the following events pass a handle to the form containing all of the components of the
dialog. To see what objects are contained within this editing form, open up [Link] in
the InfoPower source sub-directory. If you do not have the source code version of InfoPower,
then perform the steps in Chapter 4's topic "Determining the object names of the controls
contained in an InfoPower dialog" on the [Link] file contained in the InfoPower lib
directory.
If you want to customize any of the objects contained by the form you can use the OnInitDialog
event. However if all you are trying to do is to change the labels and hints, then use the
TwwIntl | FilterDialog property.
OnDialogSummary
This event is fired when the end-user clicks on the View Summary Button in the dialog. Use
this event to display your own summary dialog based on the information in the AFieldInfo list.
Sender: TObject TwwFilterDialog associated with this event.
AFieldInfo: TList TList of TwwFieldInfo. This list defines the current filter
criteria.
var DoDefault: boolean Set to False when displaying your own custom dialog.
OnEncodeDateTime
This event allows you to change the format of the date within the SQL. InfoPower defaults to
formatting based on the QueryFormatDateMode property. If you require further customization
of the format for your back-end, then use this event to set the FormattedDateStr parameter.
OnEncodeValue
This event allows you to change how the value is formatted when the SQL is being generated.
OnExecuteSQL
This method is maintained for backwards compatibility. Use the dataset’s BeforeOpen event
for new applications.
When using FilterMethod = fdByQueryModify, this event is fired before the query is executed.
Use this event if you wish to customize the query in some way, such as adding an OrderBy
clause. This event only applies if your filterdialog is filtering a TQuery.
OnInitDialog
Allows you to customize the filter dialog box or perform some action during the initialization
of the dialog box. For basic customization of the labels and hints, use the TwwIntl component.
For all other customization, use this event. This event is fired after the dialog box is created,
but before it’s displayed on the screen. This gives you access to all the components in the
dialog, allowing you to completely customize every aspect of the dialog during program
execution. When using this event, your code must reference wwfltdlg in your source file’s Uses
clause. For example, you can modify the control’s properties, define custom events, etc.
Example: The following code disables the hint on the user-defined button.
procedure TForm1.wwFilterDialog1InitDialog(Dialog: TwwFilterDlg);
begin
[Link] := False;
end;
OnInitTempDataSet
This event is only fired when FilterMethod=fdByQueryModify, and FieldsFetchMethod is set
to fmUseSQL. When you call the execute method of the filterdialog,, it creates a temporary
dataset and then calls the GetFieldNames method for this temporary dataset. However this
temporary dataset may need additional properties set, depending upon if you are using any 3rd
party database engines. If you are, then set the properties of the temporary dataset in this
event.
Sender: TObject TwwFilterDialog associated with this event.
OrigDataSet: TDataSet Dataset that is being filtered
TempDataSet: TDataSet Temporary dataset created to retrieve the list of fields
OnSelectField
This event allows you to define custom combo-boxes or picture masks within the end-user
filtering dialog. The combo-boxes are used when the user is doing an Exact or a Partial
Match at Beginning search.
Sender: TObject Actual dialog that is retrieving the user input. You can cast
this to a TwwFilterDlg to access all of the controls in this
dialog. If you cast it then be sure to add wwfltdlg to your
Example: The following code defines a mapped combo-box list, which allows the select from
a list of descriptive strings and the filter will automatically filter on the database field value.
For instance, consider the case where your database field allowed for 3 possible integer values
(0,1,2), and the represented the strings ‘Visa’, ‘MasterCard’, ‘American Express’. You can
use the following code to allow the user to select from the more meaningful descriptive text,
but still filter based on the integer value.
procedure TFilterDialogForm.wwFilterDialog1SelectField(Sender: TObject;
FieldName: String; var PictureMask: String; ComboList: TStrings);
var FilterCombo: TwwDBComboBox;
begin
if (FieldName = 'Buyer') then begin
FilterCombo:= TwwFilterDialog(Sender).[Link];
[Link]:= True;
[Link]('Visa' + #9 + '0');
[Link]('MasterCard' + #9 + '1');
[Link]('American Express' + #9 + '2');
end
end;
Added Methods
AddFieldInfo
Use this method if you wish to add filter conditions to the FilterDialog using code. This
method creates and returns a TwwFieldInfo data type, which is automatically added to the
internal FieldInfo list. See the example under the ApplyFilter method.
TwwFieldInfo = class
public
FieldName: string;
DisplayLabel: string;
MatchType: TwwFilterMatchType;
FilterValue: string;
ApplyFilter
Use this method to apply the filter based on changes that have been made to the FieldInfo
criteria of the TwwFilterDialog. See the form [Link] and the unit [Link] in the
main demonstration program for a complete example of applying filters at runtime without the
filter dialog appearing.
Example: This example demonstrates how to change the filter criteria of a TwwFilterDialog at
runtime with code.
procedure TFilterDialogForm.Button1Click(Sender: TObject);
begin
with wwFilterDialog1 do begin
ClearFilter;
with AddFieldInfo do begin
FieldName:= 'Last Name';
Displaylabel:= 'Last Name';
MatchType:= fdMatchStart;
FilterValue:= 'R';
MinValue:= '';
MaxValue:= '';
CaseSensitive:= False;
end;
ApplyFilter;
end;
end;
ClearFilter
Use this method to clear the filter currently used in the TwwFilterDialog. Remember to use
the ApplyFilter method to actually make the changes.
Execute
Display the Visual filtering dialog box to the end-user.
ExecuteDialog
A more flexible version of the TwwFilterDialog Execute method when using
FilterMethod=fdByQueryModify. If using FilterMethod=fdByFilter, then it the parameters are
ignored.
Function ExecuteDialog(ExecuteQuery: boolean = True;
ReturnWhereClause: TStrings = nil): boolean;
ExecuteQuery When false, the query associated with the filterdialog is not re-
executed.
How To
Remotely filter a TClientDataSet
The following are the steps required to remotely filter a clientdataset so that filter is performed
on the server and not locally.
2. Set your TClientDataSet so that the CommandText property is set to query the table,
such as…
Select * from Employee
3. Set your provider’s Options property so that poAllowCommandText to True. This
allows the TClientDataSet to modify the provider’s SQL with its CommandText
property.
[Link];
Caution
Make sure that your field display labels are unique. InfoPower’s FilterDialog uses the field
titles to fill the fields listbox. If there are duplicates, the user’s filtering specification becomes
ambiguous and may not function as expected.
Ancestor
TCustomEdit.
Added properties
DataSource
This property contains the name of a TDataSource component that the search should be
applied to. The default value is blank.
Data Type: TDataSource
Valid Values: Valid DataSource component name
Frame
See the topic “Key properties and events for custom framing” in chapter 4 for
information on this property.
Data Type: TwwEditFrame
PictureMaskAutoFill
When you enter a picture mask that consists of auto-fill characters, setting this property to
True will activate the auto-fill capabilities of the picture mask. When False, all auto-fill
capabilities of the picture masks defined for the field are deactivated.
Data Type: Boolean
PictureMaskFromField
Setting this property to True will allow the control to automatically use the picture mask
defined for the database field. The TwwIncrementalSearch’s PictureMask property must also
be set to blank for this property to have an effect, as the component’s PictureMask property
has precedence.
Data Type: Boolean
ShowMatchText
Set this property to True if you want the incremental search component to display the
matching field’s value directly in this control. By default this property is False.
Data Type: Boolean
SearchDelay
TwwIncrementalSearch supports a search delay for its incremental searching. This property
controls how many milliseconds to wait before beginning the search for the user’s entered text.
The purpose of this property is to reduce the number of searches that are performed as the user
enters characters. Setting this to a larger value may improve your performance as fewer
searches will need to be performed. Setting this to a smaller value will cause the search to
begin more quickly. This property defaults to 0, which tells the control to determine the best
delay. Currently 200 milliseconds is used by the control for the delay.
Data Type: Integer
SearchField
In some cases the search component is not able to determine the correct field that it should
search on. This can occur when using dBASE expression indexes, or if you are using a multi-
field index and you may want to search on the 2nd or 3rd field instead of the default 1st field.
Modified properties
Text
No longer published, but is now a runtime only property. You can still use this property in
your code.
Added Events
OnAfterSearch
This event is executed after the incremental search has repositioned the table according to the
user’s entered text.
Added Methods
Clear
Clear the incremental search component back to blank.
FindValue
Call this method if you wish to force the incremental search component to use the current text
value and perform the search. The component automatically performs incremental searching
when the end-users types in text, but if you explicitly set the text value the search is not
performed.
Tips
♦ This component is especially useful when combined with the TwwKeyCombo
component, which allows end-users to select the active table index.
♦ If you have a choice, use case insensitive indexes in your tables to make
incremental searching more user-friendly. If you do not have a choice use
picture masks to automatically convert the input to the proper case.
Ancestor
TComponent.
Added Properties
ADO
With ADO Datasets when locating on partial match or exact match searches the locate method
is much faster. So setting UseLocateWhenFindingValue to true will result in performance
enhancements for search type operations in InfoPower components.
BtnCancelCaption
Caption to use in Cancel buttons
BtnOKCaption
Caption to use in OK buttons
CheckBoxInGridStyle
Use this property to choose the style of the checkboxes that appear in all the grids.
Data Type: TwwCheckBoxInGridStyle
Valid Values: cbStyleAuto, cbStyleCheckmark, or cbStyleXmark
Connected
Toggle this property to True to activate this component’s properties so that they are used by
the InfoPower dialogs.
Data Type: Boolean
DialogFontStyle
Use this property to choose the style of the fonts that appear in InfoPower’s dialogs. If you
need to change any other attributes of a given dialog’s Font, then use the corresponding
dialog’s OnInitDialog event.
Data Type: TFontStyles
Valid Values: fsBold, fsItalic, fsUnderline, or fsStrikeOut
fsBold Font style of bold.
fsItalic Font style of italics.
fsUnderline Font style of underline.
fsStrikeOut Font style of strikeout.
FilterDialog
Captions and Hints for the TwwFilterDialog component
FilterMemoSize
This property defines the number of bytes to allocate for temporary data storage when
performing callback filtering. This property is only relevant if using TwwTable, TwwQuery, or
TwwStoredProc.
Data Type: Integer
IniFileName
This property defines the value use when a grid’s IniAttributes | FileName property is blank.
This property is ignored if the IniAttributes | FileName property is already assigned for the
grid control. If IniFileName is also blank, the grid will compute the FileName based on the
application’s executable name.
Data Type: String
LocateDialog
Captions and Hints for the TwwLocateDialog component
MonthCalendar
Captions and Dialog messages for the TwwDBMonthCalendar
OKCancelBitmapped
True if the OK and Cancel buttons use a bitmap
Data Type: Boolean
RegistrationNo
Displays your registration number.
RichEdit
Captions, Menu items, and Hints for the TwwDBRichEdit component.
SearchDialog
Captions and Hints for the TwwSearchDialog, TwwLookupDialog, and
TwwDBLookupComboDlg components
UseLocateMethodForSearch
Setting this property to False, will make the component use the FindNearest method instead of
the Locate method when incremental searching on tables. Because Delphi recommends using
the Locate method over the FindNearest method, we recommend leaving this property True.
UserMessages
User messages generated by InfoPower
VersionInfoPower
Displays the current version of InfoPower
Added Events
OnPerformCustomSearch
When using a large search table from a remote server, the performance of the incremental
searching can significantly degrade. To resolve this issue, InfoPower adds a new event where
you can control the specific action that takes place after the user types a character. In
particular the custom action can update the query to only return the records that you are
interested in. When using this event, your code is responsible for manipulating the
lookuptable based on the parameter values passed in. See the TwwDBLookupCombo
OnPerformCustomSearch event for a description of the events parameters.
Parameter Description
Sender:TObject The TwwDataInspector associated with this event.
Field:TField TwwInspectorItem whose edited value does not satisfy the
picture mask constraints.
Msg:String You can set this value to change the actual message used by the
default error handler.
var DoDefault:Boolean Set this to False to prevent the default handler from executing.
The default error handler raises an exception with the message
defined by Msg.
How To
Modify the labels and hints in an InfoPower dialog
Customizing the dialog labels and hints is accomplished via the following steps:
1. Drop an InfoPower TwwIntl component on your main form
2. Modify the properties you wish to change.
3. Set the component’s Connect property to True.
Ancestor
TwwDBCustomComboBox.
Added Properties
ButtonEffects
See the topic “Key properties for enabling custom button effects in the edit controls” in chapter
4 for information on this property.
Data Type: TwwButtonEffects
DataSource
This property contains the name of a TDataSource component that is to be used for the
acquisition of data. The default value is blank.
Data Type: TDataSource
Valid Values: Valid DataSource component name
PrimaryKeyName
Used only when ShowAllIndexes is True. This property contains the text that is displayed for
the primary index name. The default value is “PrimaryKey”.
Data Type: String
ShowAllIndexes
When True, all indexes are included in the list, and the index names are used instead of the
field names. The default value is False.
Data Type: Boolean
Modified properties
None.
Added Events
None.
Added methods
InitCombo
Refreshes wwKeyCombo to reflect the table’s current settings.
Tips
♦ If you have a choice use case insensitive indexes in your tables to make
incremental searching more user-friendly.
♦ To display the drop-down list via keyboard, press the Alt+down cursor
arrow keys when the component has focus.
Ancestor
TComponent
└─TwwCustomDialog
CaseSensitive
This property defines whether or not the search is to be case sensitive. If the user changes this
value, the new value is used the next time the dialog box is displayed. The default value is
False.
Data Type: Boolean
DataSource
This property contains the name of a TDataSource component that provides the table name to
be searched. The default value is blank.
Data Type: TDataSource
DefaultButton
This property controls which button is the default button when the dialog appears. The default
value is dbFindNext.
Data Type: Constant
Valid Values: dbFindFirst or dbFindNext
FieldSelection
This property determines which fields are used to fill the available field list. When set to
fsAllFields, all fields, excluding non-searchable fields such as Graphic, Blob, etc. are used.
When set to fsVisibleFields then only fields whose visible property is True are used. The
default value is fsAllFields.
Data Type: Constant
Valid Values: fsAllFields or fsVisibleFields
FieldValue
This is a run-time only property. This property allows you to set the search value that the
FindFirst and FindNext methods use. Thus, you can completely bypass the InfoPower locate
dialog when performing a locate field value. The default value is an empty string.
Example: The following example finds the next occurrence of 'Port' in the 'City' field. The
match can be contained in any part of the 'City' field's value.
procedure TForm1.Button1Click(Sender: TObject);
begin
with wwLocateDialog1 do begin
SearchField := 'City';
FieldValue := 'Port';
MatchType := mtPartialMatchAny;
FindNext;
end;
MatchType
This property contains a constant value that defines the type of match to be used. This value is
used the first time the dialog box is displayed. If the user changes this value, the new value is
used the next time the dialog box is displayed. The default value is mtPartialMatchStart.
Data Type: Constant
Valid Values: mtExactMatch, mtPartialMatchAny, mtPartialMatchStart
Options
Use this property for further customizations of appearance and behavior when the dialog box is
executed.
Data Type: Set of TwwLocateDlgOption
Valid Values: ldoCaseSensitiveBelow, ldoCloseOnMatch
ldoCaseSensitiveBelow When True the CaseSensitive checkbox will appear below the
match type radio buttons. Otherwise it will appear above.
ldoCloseOnMatch If False, the dialog will remain open when a match is found.
Default is True, in which case the dialog will close as soon as a
match is found.
SearchField
This property contains the name of the table’s field to be searched against. If the user changes
this value, the new value is used the next time the dialog box is displayed. The default value is
blank—no SearchField specified.
Data Type: String
Valid Values: Existing field name in the table being searched.
ShowMessages
When True, informational messages, such as "No more matches found", are displayed to the
user if the locate does not find a match. To disable messages, set this property to False. The
default value is True.
Data Type: Boolean
SortFields
This property determines the sort order of the field names that appear in the drop-down field
name list. The default is fsSortByFieldName.
Data Type: Constant
Valid Values: fsSortByFieldName and fsSortByFieldNo
Tag
This is the standard Delphi Tag property that you can use for your own internal processing
needs. The default value is 0.
Data Type: Long
Modified properties
None.
Added Events
Some of the following events pass a handle to the form containing all of the components of the
dialog. To see what objects are contained within this editing form, open up [Link] in
the InfoPower source sub-directory. If you do not have the source code version of InfoPower,
then perform the steps in Chapter 4's topic "Determining the object names of the controls
contained in an InfoPower dialog" on the [Link] file contained in the InfoPower lib
directory.
If you want to customize any of the objects contained by the form you can use the OnInitDialog
event. However if all you are trying to do is to change the labels and hints, then use the
TwwIntl | LocateDialog property.
OnInitDialog
Allows you to completely customize every aspect of the dialog box or perform some action
during the initialization of the dialog box. For example, you can modify the grid's properties,
define custom events, etc.
Note: See the OnInitDialog event for TwwLookupDialog or the How To section of the
TwwMemoDialog for an example on how to use this event.
Added Methods
Execute
Display the Locate Field Value dialog box to the end user. The dialog box remains displayed
until either a First or Next match is found, the user clicks the Cancel button or the user closes
the dialog box via the control menu. False is returned when the user clicks Cancel or closes the
dialog box. If a First or Next match is found, the dialog box closes and True is returned.
FindFirst
Simulates the user clicking the First button of the dialog box. Searches the selected field in the
associated table, from the top of the table, for the first occurrence of the Field Value previously
entered by the user. The dialog box is displayed only if the Field Value is blank. Returns True
if the Field Value was located, or False if it was not.
Example: If your TwwLocateDialog component’s Name is wwLocateDialog1, you could
attach the following code to a button on your form with a Caption of “First” to demonstrate
when True and False are returned after executing the FindFirst method...
if [Link] then
MessageDlg('(True) Located first match.', mtInformation, [mbOk], 0)
else
MessageDlg('(False) No match found.', mtInformation, [mbOk], 0);
FindNext
Simulates the user clicking the Next button of the dialog box. Searches the selected field in the
associated table, from the current record location, for the next occurrence of the Field Value
previously entered by the user. The dialog box is displayed only if the Field Value is blank.
Returns True if a next match was found, or False if another match was not found.
Example: If your TwwLocateDialog component’s Name is wwLocateDialog1, you could
attach the following code to a button on your form with a Caption of “Next” to demonstrate
when True and False are returned after executing the FindNext method...
if [Link] then
MessageDlg('(True) Located next match.', mtInformation, [mbOk], 0)
else
MessageDlg('(False) No more matches found.', mtInformation, [mbOk], 0);
How To
Refer to the sample application in the \ip3000\demos\locate directory to see an example of
using the TwwLocateDialog component. This sample application also shows how to make the
dialog box set the default search field based on the currently active database field.
Tips
♦ To set the SearchField to the field that currently has input focus, add code to
accomplish this just before the Execute method in your program.
Ancestor
TComponent
└─TwwCustomDialog
└─TwwCustomLookupDialog
Added Properties
Caption
This property contains a text value that is displayed in the dialog box’s title bar. The default
value is “Lookup”.
Data Type: String
CharCase
This property defines what case the characters typed in by the user are to take. ecLowerCase
converts all characters to lower case. ecNormal allows the user to type both upper and lower
case characters. ecUpperCase converts all characters to upper case. The default value is
ecNormal.
Data Type: Constant
Valid Values: ecLowerCase, ecNormal, ecUpperCase
GridColor
This property defines the background color of the grid. The default value is clWhite. (When
the first column of a grid is fixed, it’s colors are the same colors used for the grid’s column
titles as defined by the TitleColor property.)
Data Type: Constant
Valid Values: Valid Delphi color.
GridTitleAlignment
Determines the text alignment of titles in popup-dialog's grid. The default value is
taLeftJustify.
Data Type: Constant
Valid Values: taCenter, taLeftJustify or taRightJustify
LookupTable
This property defines the TDataSet component to be used for performing the lookup. The
default value is blank. This property must be assigned. In order for the dialog to display the
search-by combo, the dataset must have its IndexDefs property published. This allows the
component to use the indexes.
Data Type: TDataSet
MaxHeight
Defines the maximum Height of the grid in the related dialog. Use this property to control the
height of the popup-dialog. The default value for a standard VGA display (640 x 480) is 209.
Data Type: Integer
Valid Values: Positive integer value
MaxWidth
This property defines how wide the dialog box is allowed to grow, in pixels. The default value
is 0, which allows the dialog box to grow to the entire width of the screen.
Data Type: Integer
Valid Values: Depends on your screen’s display resolution
Options
This property contains a set of Boolean values that control the appearance of the dialog box, as
described below. The default values are opShowOK and opShowSearchBy.
Data Type: TSet()
Valid Values: opShowOK, opShowSearchBy, opGroupControls, opFixFirstColumn and
opShowStatusBar (described below)
opShowOKCancel When True, the OK and Cancel buttons are displayed in the dialog
box. When False these buttons are not displayed—OK can be
simulated by double-clicking an entry or by selecting it and then
pressing the Enter key. Cancel can be simulated by pressing the Esc
key or by closing the dialog box window. The default is True.
opGroupControls When True, the Search Characters and Search By controls are
displayed side-by-side above the grid. When False, the Search
Characters control is displayed above the grid and the Search By
control is displayed below the grid. The default value is False.
opFixFirstColumn When True, the left-most column of the grid is fixed (non-
scrollable). When False, the left-most column can be scrolled out of
view. The default value is True.
opShowStatusBar For use with Paradox tables only. When True, a status bar is added
to the dialog box that displays the table name, current record
number and total number of records in the table.
PictureMaskFromDataSet
This property is only relevant if your datasource is attached to a TwwTable, TwwQuery,
TwwQBE, or TwwClientDataset component, as it is always treated as false in other cases.
When customizing the picture masks through the select fields dialog (invoked by clicking on
the selected property at design time), the mask information is stored in the related dataset if
this property is True. Otherwise the mask information is stored as a property in the related
visual component. By storing the mask information in the dataset, you do not need to re-enter
the picture mask for other visual controls attached to this same database field.
Data Type: boolean
PictureMaskFromField
Setting this property to True will allow the dialog to automatically use the picture mask
defined for the database field when the end-user is entering the text to search for.
Data Type: Boolean
PictureMasks
The assigned picture mask information is stored in this property if PictureMaskFromDataset is
false. See the PictureMaskFromDataSet property.
Data Type: TStrings
Selected
Clicking the “...” button or double-clicking the SearchDialog component displays the Select
Fields dialog box. This dialog box allows you to select the fields you want displayed in the
grid, their titles, widths, control types and link information. (See Using the Select Fields
Dialog Box at the beginning of Chapter 4.) The default value is all fields selected, using the
field name as it’s title, displayed as a Field control for a width equal to the number of
characters in the field or the title, whichever is longer.
Tag
This is the standard Delphi Tag property that you can use for your own internal processing
needs. The default value is 0.
UserButton1Caption
When you want to display this button on the dialog box, enter the caption text for the button
here and then add code to the OnUserButton1Click event. The default value is blank.
Data Type: String
UserButton2Caption
When you want to display this button on the dialog box, enter the caption text for the button
here and then add code to the OnUserButton2Click event. The default value is blank.
Data Type: String
UseTFields
When the UseTFields property is set to true the Selected properties Display settings
information will be stored and retrieved from the LookupTable. When it is set to False the
Selected properties Display settings information is stored with the TwwLookupDialog. The
default is True.
Data Type: Boolean
Added Events
Some of the following events pass a handle to the form containing all of the components of the
dialog. To see what objects are contained within this editing form, open up [Link] in the
InfoPower source sub-directory. If you do not have the source code version of InfoPower, then
perform the steps in Chapter 4's topic "Determining the object names of the controls contained
in an InfoPower dialog" on the [Link] file contained in the InfoPower lib directory.
If you want to customize any of the objects contained by the form you can use the OnInitDialog
event. However if all you are trying to do is to change the labels and hints, then use the
TwwIntl | SearchDialog property.
OnInitDialog
Allows you to completely customize every aspect of the dialog box or perform some action
during the initialization of the dialog box. When using this event, your code must reference
wwidlg in your source file’s Uses clause. This gives you access to all the components in the
dialog. For example, you can modify the grid's properties, define custom events, etc.
OnCloseDialog
This event allows you to perform any custom action before the dialog is actually closed
OnPerformCustomSearch
When using a large lookuptable from a remote server, the performance of the dialog’s
incremental searching can significantly degrade. To resolve this issue, InfoPower adds a new
event where you can control the specific action that takes place after the user types a character.
In particular the custom action can update the query to only return the records that you are
interested in. When using this event, your code is responsible for manipulating the
lookuptable based on the parameter values passed in. See the TwwDBLookupCombo
OnPerformCustomSearch event for a description of the events parameters.
OnSortChange
If you want to perform some custom action when the end-user makes a selection from the
SortBy combo, then place your custom code here.
OnUserButton1Click
When you want to display developer-defined button #1 on the dialog box, enter the caption
text for the button in the UserButton1Caption property and then add code to this event that
will be executed when the end-user clicks the button.
Tip: If you wish for this dialog to immediately close after executing your code, assign the
ModalResult property of the dialog. The Sender parameter is cast to a TForm to get a handle
to the actual dialog on the screen.
procedure TForm1.wwLookupDialog1UserButton1Click(
Sender: TObject; LookupTable: TDataSet);
begin
(Sender as TForm).ModalResult:= mrOK;
end;
OnUserButton2Click
When you want to display developer-defined button #2 on the dialog box, enter the caption
text for the button in the UserButton2Caption property and then add code to this event that
will be executed when the end-user clicks the button.
How To
Perform a lookup and fill:
The following example performs a lookup and fill when the end-user clicks on a button. You
can easily attach this code to any event you desire (i.e. pull-down menus, keypress, etc.). In
this example, the Zip field of table CustomerTable is looked up in a separate zip code table.
After the end-user selects the zip code, the City and State fields are filled into the
corresponding CustomerTable fields:
procedure TGridDemo.Button1Click(Sender: TObject);
begin
with wwLookupDialog1 do begin
{ Reset back to primary index in case user changed }
{ the index the last time the dialog was called. }
(LookupTable as TwwTable).IndexName := '';
Tips
♦ TwwLookupDialog is great general purpose component because it can be
displayed at any time, from any source code or attached to any event of any
component.
♦ You can use this component to access lookup tables even when they use
multi-field lookup indexes. When pre-selecting the record, just remember to
specify all the fields. The following specifies two lookup values.
[Link];
[Link]('Field1').AsString := LookupValue1;
[Link]('Field2').AsString := LookupValue2;
[Link];
Ancestor
TComponent
Added properties
Caption
This property contains a text value that is displayed in the editor window’s title bar. The
default value is blank.
Data Type: String
DataSource
This property contains the name of a TDataSource component that provides the memo editor
with data. The default value is blank.
Data Type: TDataSource
Valid Values: Valid DataSource component name
DlgHeight
This property defines the height of the dialog box in pixels. The default value for a standard
VGA screen driver is 396.
Data Type: Integer
Valid Values: Depends on your screen resolution.
DlgLeft
This property defines the left-most position of the dialog box in pixels. If this value is 0, then
the dialog is automatically centered horizontally. The default value for a standard VGA screen
driver is 0.
Data Type: Integer
Valid Values: Depends on your screen resolution.
DlgTop
This property defines the top-most position of the dialog box in pixels. If this value is 0, then
the dialog is automatically centered vertically. The default value for a standard VGA screen
driver is 0.
Data Type: Integer
Valid Values: Depends on your screen resolution.
DlgWidth
This property defines the width of the dialog box in pixels. The default value for a standard
VGA screen driver is 561.
Data Type: Integer
Valid Values: Depends on your screen resolution.
Font
This is the standard Delphi Font property that allows you to define the font and its attributes
used to display the memo data in the editor window.
Data Type: TFont
MemoAttributes
This property contains a set of Boolean values that control the display of Memo data, as
described below. The default values are mSizable and mWordWrap.
Data Type: TSet()
Valid Values: mSizable, mWordWrap, mGridShow, mViewOnly (described below)
mSizable When True, the end-user is allowed to resize the pop-up memo editor
window. When False, the pop-up editor is displayed as a dialog box. The
default value is True.
mWordWrap When True, word wrapping is automated by adding wrapped words onto
additional lines in a vertical manner as necessary. When False, the
entire display scrolls horizontally, to the left and right, as words are
added. The default value is True.
mGridShow When True, the memo data is displayed in the grid. When False, memo
data is not displayed in the grid. The default value is False. (Warning:
Enabling this option dramatically slows down the grid display since
memo data must be retrieved from a file other than the table being
accessed.)
mViewOnly When True, the user may not edit the contents of the memo and only the
OK button is displayed. When False, the user may edit the memo data
and both OK and Cancel buttons are displayed. The default value is
False. (Note: If the grid or field ReadOnly property is set to True, this
property is automatically set to True.)
mDisableDialog This property does not have any effect in the stand-alone
TwwMemoDialog component. This property is only used in the
MemoAttributes property of the TwwDBGrid.
Tag
This is the standard Delphi Tag property that you can use for your own internal processing
needs. The default value is 0.
UserButton1Caption
This property serves two purposes. First, when the value is blank, no extra button is created on
the memo dialog box. Second, when the value is non-blank, a button is created on the memo
dialog box with the caption specified in this property. The default value is blank. To define an
UserButton2Caption
This property serves two purposes. First, when the value is blank, no extra button is created on
the memo dialog box. Second, when the value is non-blank, a button is created on the memo
dialog box with the caption specified in this property. The default value is blank. To define an
action that should take place when the user clicks this button, refer to the OnUserButton2Click
event described below.
Modified properties
None.
Added Events
Some of the following events pass a handle to the form containing all of the components of the
dialog. To see what objects are contained within this editing form, open up [Link] in
the InfoPower source sub-directory. If you do not have the source code version of InfoPower,
then perform the steps in Chapter 4's topic "Determining the object names of the controls
contained in an InfoPower dialog" on the [Link] file contained in the InfoPower lib
directory.
If you want to customize any of the objects contained by the form you can use the OnInitDialog
event.
OnCloseDialog
Allows you to define an action when the user closes the MemoDialog. When using this event,
your code must reference the file wwmemo in your source file’s uses clause.
OnInitDialog
Allows you to customize the memo dialog box or perform some action during the initialization
of the dialog box. This event is fired after the dialog box is created, but before it’s displayed on
the screen. When using this event, your code must reference the file wwmemo in your source
file’s Uses clause. For an example of how to use this event, see the How-to section below.
OnUserButton1Click
Allows you to define an action when the user clicks on UserButton1. (See also:
UserButton1Caption property above and How-to section below.)
When using this event, your code must reference the file wwmemo in your source file’s uses
clause.
OnUserButton2Click
Allows you to define an action when the user clicks on UserButton2. (See also:
UserButton2Caption property above and How-to section below.)
How To
Pre-define the size and position of a memo dialog box:
Set the DlgHeight, DlgLeft, DlgTop and DlgWidth properties as described in the Added
properties section above.
Change the background color of a memo dialog box to red, using the OnInitDialog
event:
First, add wwmemo to the Uses clause in your source code file. Second, add the following
line of code to the OnInitDialog event:
[Link] := clRed;
When using this event, your code must reference the file wwmemo in your source file’s uses
clause.
TwwQBE
Ancestor
TDBDataSet.
Where <DatabaseName> is an existing database alias and <TableName> is the name of the
physical result table to be created. Notice the required use of the colon “:” character before
and after the <DatabaseName> value, and also the “.db” value at the end of the
<TableName> value. This component currently supports only the Paradox style result table
(.db). When a physical result table is created, it remains on your disk until it is deleted. If the
specified AnswerTable already exists, it will be overwritten without warning.
When this property is left blank, the default value, the Borland Database Engine (BDE) creates
the query result table as a hidden work file in the directory pointed to by Delphi’s
[Link] setting, which is the directory where your program is being executed from.
If you don’t need to create a physical result table (the default hidden work table is fine), but the
default drive and directory don’t contain enough free space for all the necessary work files, you
can manually define the working directory, to any drive and directory that contains sufficient
free space, by adding the following line of code to this component’s BeforeOpen event: (the
drive and directory must be specified within double quote marks):
[Link] := 'd:\private';
AuxiliaryTables
This property tells the QBE processor whether or not to create the standard auxiliary tables
(keyviol, changed, inserted, etc.). When an auxiliary table is created, it remains on your disk
until it is deleted. If an auxiliary table already exists, it will be overwritten without warning.
The default value is True.
Caution: If you set this property to False, you may not be able to fully check the results of your
QBE since no auxiliary tables will be created for manual verification.
Data Type: Boolean
BlankAsZero
When True blanks in numeric fields in a table are treated equivalent to a zero. The default
value is False.
Data Type: Boolean
LookupFields
Maintained for backwards compatibility with earlier versions of InfoPower.
Data Type: (Internal to InfoPower)
Valid Values: (Internal to InfoPower)
LookupLinks
Maintained for backwards compatibility with earlier versions of InfoPower.
Data Type: (Internal to InfoPower)
Valid Values: (Internal to InfoPower)
OnFilterOptions
See the documentation for OnFilter under the TwwTable component
PictureMasks
This property holds information about a field’s picture mask. See Using InfoPower’s Picture
Masks in Chapter 4 for more details.
Data Type: TStrings
Valid Values: (Internal to InfoPower)
QBE
This property holds the actual QBE query statements. After creating a query via the Database
Desktop, or from within dBASE or Paradox, save the query as a .QBE file (File | Save menu
options). You can then load this previously saved file into the Delphi String list editor window
for the QBE property by clicking on the Load button and selecting the file you previously
saved. Optionally, you can specify the QBE statements interactively. The default value is blank
- no QBE defined.
Notes:
1) The contents of the “ANSWER:” QBE statement generated when you save a query to
a file are ignored by the BDE QBE processor. Use the AnswerTable property to
specify a database name (alias) and table name if you want to create a physical query
result table on your disk.
2) The contents of the Selected Fields list box of the Select Fields dialog box default to
all fields that are selected via the QBE statements contained in the QBE property.
Data Type: TStrings
Valid Values: Valid Query By Example code (see example in “How to” below).
Added Events
OnFilter
See the documentation for OnFilter under the TwwTable component
OnFilterEscape
See the documentation for OnFilterEscape under the TwwTable component.
OnInvalidValue
See Using InfoPower’s Picture Masks in chapter 4.
Added Methods
ClearParams
This method clears the current parameter definitions for the related TwwQBE component.
Refer to the SetParam method for more details on using parameters in a TwwQBE component.
Its calling syntax is as follows:
Procedure ClearParams;
SetParam
This method allows you to substitute tilde (~) variables in your QBE. ParamName specifies the
name of the tilde variable (exclude the ~), and ParamValue specifies the value it should be. Its
calling syntax is as follows:
Procedure SetParam(paramName: string; paramValue: string);
Example: Given the following QBE stored in a TwwQBE component, the following code
replaces the “~LastName” variable with the string ‘Woll’, and then re-executes the QBE:
Query
[Link] | CustomerNo | CompanyName | FirstName | LastName |
| Check | Check | Check | ~LastName |
EndQuery
wwFilterField
See the documentation for wwFilterField under the TwwTable component
How To
Define QBE statements:
If you want to query the Customer table of your CustData database, selecting only records
where the State is equal to CO and the Status is equal to P, retrieving the CustNum,
CompanyName, City, State, Zip, Status and FullName fields, create the query by using the
Database Desktop and then save it to a .QBE file via the File | Save menu options. The
resulting query definition would look like the following:
Query
ANSWER: :PRIV:[Link]
Then, open the QBE String list editor by clicking on the “...” button of the QBE property, click
the Load button, select the .QBE file you just saved, click the OK button of the String list
editor.
Next, set the DatabaseName property of the TwwQBE to the alias referenced in your QBE.
The following example references an alias named CustData.
DatabaseName := CustData
The non-visual TwwQuery component allows you to define a query with SQL
statements that supplies data to one or more of the other InfoPower visual interface
components placed on your form. InfoPower allows you to use TQuery instead of TwwQuery,
but this component is provided for backward compatibility. The TwwQuery additionally will
allow you to filter on lookupfields.
Since InfoPower’s TwwQuery component is inherited from Delphi’s TQuery component, all
standard Delphi TQuery component properties and functionality are available, such as
Delphi’s built-in Fields editor and the SQL Query Builder (if using the Client/Server version
of Delphi).
Ancestor
TQuery.
Added Properties
ControlType
This property holds information about the type of control used to display a field if the field is
contained within a grid component. The default value is Field. (See Using the Select Fields
Dialog Box at the beginning of Chapter 4.) To change this property at runtime, see the
SetControlType method of the wwDBGrid component.
Data Type: (Internal to InfoPower)
LookupFields
Maintained for backward compatibility with earlier versions of InfoPower.
Data Type: (Internal to InfoPower)
LookupLinks
Maintained for backward compatibility with earlier versions of InfoPower.
Data Type: (Internal to InfoPower)
OnFilterOptions
See the documentation for OnFilter under the TwwTable component
PictureMasks
This property holds information about a field’s picture mask. See Using InfoPower’s Picture
Masks in Chapter 4 for more details.
Data Type: TStrings
ValidateWithMask
See the documentation for ValidateWithMask under the TwwTable component
Modified properties
None.
Added Events
OnFilter
See the documentation for OnFilter under the TwwTable component
OnFilterEscape
This event is fired after the end-user has cancelled a filter in progress by pressing the <Esc>
key. You may wish to use this event to display an informational message to the user so that
they are aware they have cancelled the filter. See also the onFilter event.
OnInvalidValue
See Using InfoPower’s Picture Masks in Chapter 4.
Added Methods
SetLookupField
See the documentation for SetLookupField under the TwwTable component
wwFilterField
See the documentation for wwFilterField under the TwwTable component
How To
The TwwQuery component is inherited from Delphi’s TQuery, so please refer to your Delphi
manual for more information about this component.
Since InfoPower’s TwwQuery component is inherited from Delphi’s TQuery component, you
are provided with 100% backward compatibility. Thus, you can safely replace your use of
TQuery with TwwQuery at any time. In addition, all standard Delphi component properties
and functionality are still available, such as the Fields editor, and the SQL Query Builder if
you use the C/S version of Delphi.
Ancestor
TRadioButton
└─TwwCustomRadioButton
Added Properties
Alignment
Assign this property to change the location of the text within the control. If Alignment is set
to taRightJustify, then the text is aligned on the right-hand side of the control. If Alignment is
set to taLeftJustify, then the text is aligned on the left-hand side of the control.
AlwaysTransparent
Set this to true if you wish for the radio button to be transparent even when it has the focus.
Normally when [Link] and [Link] are both true, the control is only
transparent when it does not have the focus. Note: This property has no effect unless
[Link] and [Link] are both true.
Caption
Assign a string to this property to assign the label that appears next to the radio button. The
TwwRadioGroup sets the caption of each radio button based on its Items property.
Checked
This value indicates whether or not the radio button is selected or not.
Frame
See the topic “Key properties and events for custom framing” in chapter 4 for more
information on this property.
Data Type: TwwEditFrame
Images
Assign this property if you wish to change the icons displayed by the radio button. The first
image in the imagelist is used as the unselected icon and the second image is used as the
selected icon.
Data Type: TImageList
Indents
Use Indents to change the relative placement of the icons and the text.
ShowFocusRect
When true, a focus rectangle is drawn around the text. You may wish to set this property to
false when using custom framing, as this can already give the end-user a visual cue to when
the checkbox has the focus.
ValueChecked
This is the value that is stored into the database when the radio button is selected.
ValueUnchecked
This is the value that is stored into the database when the checkbox is not selected.
InfoPower integrates a versatile new radio group control into its suite. A radio group
contains a set of radio buttons that are grouped in such a way that only one item can be
selected. This provides you with an easy way to ensure that the enduser enters one and only
one of the options presented. This control is especially useful since it can be bound to a
database field that contains a small amount of possible values.
To add radio buttons to a TwwRadioGroup, edit the items property in the Object Inspector.
Each string in Items makes a radio button appear in the group box with the string as its
caption. Use the values to map the displayed value to a different stored value when the control
is attached to a database field.
Some additional powerful features include the following:
♦ Support for your own custom bitmaps for the radio button glyphs selected and
unselected states.
♦ Integration with the InfoPower grid, record-view components, and data inspector.
♦ Show glyphs in addition to the text or glyphs only as in the Payment Method radio
group example below.
♦ Custom framing and transparency support for a consistent look with other InfoPower
edit controls.
Ancestor
TCustomGroupBox
└─TwwCustomTransparentGroupBox
└─TwwCustomRadioGroup
Frame
To enable custom framing with this control, you must set ShowBorder to False.
See the topic “Key properties and events for custom framing” in chapter 4 for more
information on this property.
Data Type: TwwEditFrame
GlyphImages
Assign this property if you wish to display a glyph in place of or next to the radio buttons
caption text. The glyphs in the GlyphImages properties needs to be in the same order as the
items property. Set ShowText to False to show only glyphs and no text in the radio group.
Data Type: TImageList
Images
Assign this property if you wish to change the selection icons displayed by the radio group.
The first image in the imagelist is used as the unselected icon, and the second image is used as
the selected icon.
Data Type: TImageList
Indents
Use Indents to change the relative placement of the icons and the text.
ButtonX Assign this property to specify the number of pixels to move the radio button
icon to the left (positive value) or right (negative value).
ButtonY Assign this property to specify the number of pixels to move the radio button
icon upward (negative value) or downward (negative value).
TextX Assign this property to specify the number of pixels to move the text to the
left (positive value) or right (negative value).
TextY Assign this property to specify the number of pixels to move the text upward
(negative value) or downward (negative value).
ItemIndex
This runtime only property allows you to get programmatically set the selected item for an
unbound TwwRadioGroup control. When the control is bound to a database field, there is no
need to initialize it since it will display the value associated with that field automatically.
Data Type: Integer
ShowBorder
When true, a standard radiogroup engraved border will appear around the outside edge of the
TwwRadioGroup control. To enable custom framing as in other InfoPower controls you can
set this property to False and use the Frame property.
Data Type: Boolean
ShowFocusRect
When true, a focus rectangle is drawn around the text. You may wish to set this property to
false when using custom framing, as this can already give the end-user a more elegant visual
cue to when the radio button has the focus.
Data Type: Boolean
ShowGroupCaption
Set this property to false to hide the main caption of the TwwRadioGroup. This may be useful
to you if your radio group is embedded in the grid or datainspector control.
Data Type: Boolean
ShowText
Set this property to false to hide the text of the radio buttons in the TwwRadioGroup
Data Type: Boolean
Transparent
Set this property to make the TwwRadioGroup paint transparently.
Data Type: Boolean
TransparentActiveItem
Set this property to make the active item in the radio group also paint transparently.
Data Type: Boolean
Value
Holds the value of the TwwRadioGroup control based on the selected radio button.
Data Type: String
Values
By default the value of the radio buttons in the group are determined by the items property.
However, often you may want the values to differ from the captions. For example, if you use
radio buttons to represent a database field whose content can be ‘Y’ or ‘N’, you may want the
radio button’s caption to have more descriptive text like ‘Yes’ or ‘No’. So you would enter
‘Y’ and ‘N’ in the Values list, and ‘Yes’ and ‘No’ in the Items list.
Added Events
OnCreateRadioButton
Use this event to customize the dynamically generated TwwRadioButtons that are created
based on the Items property. See TwwRadioButton.
Parameters
Sender : TwwCustomRadioGroup RadioGroup that is creating the buttons.
RadioButton : TwwRadioButton DataSet being looked up
How To
Setting Items and Values at Runtime
This example uses a database radio group box connected to field in a dataset. The actual field
can contain one of the values ‘Y’, ‘N’, or ‘M’. However, you want the user to see the
following captions on the radio buttons: ‘Yes’, ‘No’, or ‘Maybe’.
When the code runs, three radio buttons appear in the group box. If the current record in the
dataset contains any of the values contained in the Values property, the appropriate radio
button is automatically checked. When the user selects a radio button with the mouse or the
keyboard, then the corresponding string in the Values property is stored into the field.
with wwRadioGroup1 do
begin
[Link];
[Link];
[Link]('Yes');
[Link]('No');
[Link]('Maybe');
[Link];
[Link];
[Link]('Y');
[Link]('N');
[Link]('M');
end
Added Properties
BorderStyle
This property defines the record-view form’s BorderStyle. The default is bsSizeable.
Data Type: TFormBorderStyle
Valid Values: Standard Delphi FormBorderStyle
Caption
This property contains a text value that is displayed in the editor window’s title bar. The
default value is ‘Record View’
Data Type: String
ControlInfoInDataset
Set this property to False if you wish for the record view dialog to store the information about
the embedded controls into its ControlType property . You may wish to set this property to
False if you want the record view dialog to have no dependency upon the embedded control
information stored in the dataset. By default this property is True, which means that
information about the embedded controls is stored in the related TDataSet.
Note: Normally you will want to leave this property as True. Set this property to False if you
have more than one IP container control such as a grid or record-view attached to the same
dataset, and do not wish for them to share the same custom control.
ControlOptions
This property contains a set of Boolean values that control the display of embedded controls.
Data Type: Set of TwwRecordViewControlOption
Valid Values: rvcTransparentLabels, rvcTransparentButtons, rvcFlatButtons
rvcTransparentButtons If True, then controls with buttons in the dialog will have their
buttons be displayed transparently.
rvcFlatButtons If True, then controls with buttons in the dialog will have their
buttons be displayed as flat.
DataSource
This property contains the name of a TDataSource component that provides the record view
form with data. The default value is blank.
Data Type: TDataSource
EditFrame
See the topic “Key properties and events for custom framing” in chapter 4 for information on
this property. Set the EditFrame property to customize how the contained edit control’s
borders and background are painted. For instance, set the [Link] and
[Link] properties to True to display the edit controls transparently. See also
the OnSetControlEffects to individually customize the borders of a control.
Data Type: TwwEditFrame
EditSpacing | HorizontalView
This property defines the spacing values for the controls in the record view form when using
Style=rvsHorizontal
BetweenEditsInRow Horizontal Space between the edit controls
Data Type: Integer
BetweenLabelEdit Vertical Space between the label and the related edit control
Data Type: Integer
BetweenRow Vertical Space between the edit control and the top of the label on
the next row
Data Type: Integer
LabelIndent Horizontal indentation of label with respect to its related edit
control
Data Type: Integer
EditSpacing | VerticalView
This property defines the spacing values for the controls in the record view form when using
Style=rvsVertical
BetweenLabelEdit Horizontal Space between the label and the related edit control
Data Type: Integer
BetweenRow Vertical Space between the edit controls
Data Type: Integer
Font
This is the standard Delphi Font property that allows you to define the font and its attributes
used to display the controls in the record-view form. See also the LabelFont property.
Data Type: TFont
FormPosition
Placement and size of the record-view form
Height Height of the record-view form. Defaults to 0 which means to grow as
needed.
Data Type: Integer
Left Left position of the record-view form. Default of 0 means to auto-center the
form
Data Type: Integer
Top Top position of the record-view form. Default of 0 means to auto-center the
form
Data Type: Integer
LabelFont
This is the standard Delphi Font property that allows you to define the font and its attributes
used to display the labels in the record-view form. See also the Font property.
Data Type: TFont
Valid Values: Standard Delphi Font options
LinesPerMemoControl
This property determines the height of memo controls in the dialog The default is 2 lines per
memo control.
Data Type: Integer
Margin
Spacing between panels and controls.
BottomOffset Space between the bottom edit control and the bottom of the record-
view panel
Data Type: Integer
LeftOffset Space between the left-most edit control and the left side of the
record-view panel
Data Type: Integer
RightOffset Space between the right-most edit control and the right side of the
record-view panel.
Data Type: Integer
Menu
This property allows you to attach your own custom menu to the record-view form. See the
How-to documentation later in this section for an example.
Data Type: TMainMenu
Navigator
Set this property to change the default navigator used by the RecordViewDialog. The object
inspector will display all TwwDBNavigator controls in your current form. When this property
is assigned the NavigatorVisibleButtons property is ignored.
NavigatorButtons
This property defines which buttons in the record-view navigator are visible. To make the
navigator invisible, set the Option | HideNavigator property to True.
Data Type: Set of TNavigatorBtn
Valid Values: Set of Delphi TNavigatorBtn values
NavigatorFlat
If True, then the navigator buttons are displayed as flat icons. Defaults to False.
Data Type: Boolean
OKCancelOptions
This property contains a set of Boolean values that control the display of the OK and Cancel
buttons in the record-view form
Data Type: Set of TwwRecordViewOKCancelOption
Valid Values: rvokShowOKCancel, rvokAutoPostRec, rvokAutoCancelRec
rvokShowOKCancel If True, then the OK and Cancel buttons are displayed in the
record-view form. This property defaults to True.
rvokAutoPostRect If True, then when the OK button is clicked the record-view
form automatically posts the record. This property defaults to
True.
Options
This property contains a set of Boolean values that control options in the record-view form.
Data Type: Set of TwwRecordViewOption
Valid Values: (rvoHideReadOnly, rvoHideCalculated, rvoHideNavigator,
rvoUseCustomControls, rvoShortenEditBox, rvoModalForm,
rvoStayOnTopForm, rvoConsistentEditWidth, rvoEnterToTab,
rvoConfirmCancel, rvoCloseIsCancel, rvoMaximizeMemoWidth,
rvoUseDateTimePicker, rvoLabelsBeneathControl)
rvoHideReadOnly If True, then readonly fields are not displayed in the record-
view form. Defaults to False.
rvoHideCalculated If True, then calculated fields are not displayed in the record-
view form. Defaults to False.
rvoHideNavigator If True, then the navigator control is not displayed Defaults
to True.
rvoUseCustomControls If True, then embedded controls are used by the record-view
form. If False, then the fields use a regular edit control for
editing. Defaults to True.
rvoShortenEditBox If True, then edit controls that exceed the width of the
record-view form are resized to fit into the form. Defaults to
True.
rvoModalForm If True, then the record-view form is displayed as a modal
dialog. If False, the form is displayed as a non-modal form.
When used non-modally, the end-user can switch to another
form while the record-view form is displayed. Defaults to
True.
rvoStayOnTopForm If True, then the record-view form stays on top of all
other forms. This is useful when rvoModalForm is set to
False as it allows the record-view form to not be hidden when
moving to other forms. Defaults to False.
rvoConsistentEditWidth If True, then edit controls are all the same size. This
property is only used when the Style=rvsVertical. Defaults to
False.
PictureMaskFromDataSet
This property is only relevant if your datasource is attached to a TwwTable, TwwQuery,
TwwQBE, or TwwClientDataset component, as it is always treated as false in other cases.
When customizing the picture masks through the select fields dialog (invoked by clicking on
the selected property at design time), the mask information is stored in the related dataset if
this property is True. Otherwise the mask information is stored as a property in the related
visual component. By storing the mask information in the dataset, you do not need to re-enter
the picture mask for other visual controls attached to this same database field.
Data Type: boolean
PictureMasks
The assigned picture mask information is stored in this property. See the
PictureMaskFromDataSet property.
Data Type: TStrings
ReadOnlyColor
This property determines the color of the read-only fields in the record-view form. Defaults to
clInactiveCaptionText.
Data Type: TColor
Selected
This property determines the field layout of the record-view form. It determines the field
order, the display labels, and the edit control width. Clicking in this property brings up a
specialized form of the Select Fields Dialog, which allows line-breaks to be inserted. You can
insert line breaks by clicking on the icon.
Using this dialog you can set picture masks, attach edit controls, select fields, etc. See Using
the Select Fields Dialog Box at the beginning of Chapter 4. The default value is all fields
selected.
Style
This property determines the style of the record-view form’s field display. If set to
rvsHorizontal, then each succeeding field is displayed on the same line until it reaches the
right edge of the form. You can force line-breaks using the Selected property. If set to
rvsVertical, then only one field is displayed per line.
Added Events
The following events pass a handle to the record-view form. The following objects are
contained within the record-view form.
Component Name Component Type Description
RecordPanel TPanel Panel containing the scrollbox
which contains the edit controls.
NavigatorPanel TPanel Panel containing the navigator
ButtonPanel TPanel Panel containing the OK and
Cancel buttons
Navigator TDBNavigator Record-view Navigator
ScrollBox TScrollBox Scrollbox containing the
edit controls
OnAfterCreateControl
This event allows you to customize the edit control after the record-view form has created the
control.
OnBeforeCreateControl
This event allows you to evaluate the control about to be created and either accept or reject its
placement into the record-view form.
The parameters for this event are as follows.
Form : TwwRecordViewForm Record-view form
CurField: TField Field that is related to the edit control
Accept: boolean Set to false to reject the component. Defaults to
True.
Example: The following example will reject the last name field from being included in the
record-view form. Note: You can also remove a field at design time by clicking in the selected
property. However if the fields that are to be included are not known until runtime, then you
can resort to this technique to remove fields.
procedure TRecordViewDemoForm.wwRecordViewDialog1BeforeCreateControl(
Form: TwwRecordViewForm; curField: TField; var Accept: Boolean);
begin
if [Link]='Last Name' then Accept:= False;
end;
OnCancelWarning
This event allows you to display your own cancel confirmation dialog. This event is fired only
when the user cancels the dialog and the Options | rvoConfirmCancel is True.
The parameters for this event are as follows.
Form : TForm Record-view form
CanClose: boolean Set to False to leave the record-view form open.
OnCloseDialog
This event allows you to perform any custom action before the record-view form is closed.
The parameters for this event are as follows.
Form : TwwRecordViewForm Record-view form
OnInitDialog
This event allows you to perform any custom action before the record-view form is initially
displayed.
The parameters for this event are as follows.
Form : TwwRecordViewForm Record-view form
OnResizeDialog
This event allows you to perform any custom action when the dialog is being resized.
The parameters for this event are as follows.
Form : TwwRecordViewForm Record-view form
OnSetControlEffects
Use the OnSetControlEffects event to override the RecordView's EditFrame settings for an
individual or selected control.
The parameters for this event are as follows.
Form : TwwRecordViewForm Record-view form
CurField: TField Field that is related to the edit control
Control: TControl Control to customize
Frame: TwwEditFrame Assign this property to change the frame
properties for a control.
ButtonEffects: TwwButtonEffects Assign this property to change the button effects
properties for a control. Warning: You should first
verify that ButtonEffects is not nil before
referencing it.
Added Methods
Execute
Display the record-view form to the end-user. If used modally, False is returned if the user
clicks the Cancel button or the user closes the dialog box via the control menu. If used non-
modally, True is always returned. See also the OnCloseDialog event to execute custom code
when the dialog is closed.
How To
Customize the selection and order of fields in the record-view form
Click on the selected property to invoke the Select Fields Dialog. From here you can select
which fields should be visible in the record view, as well as determine the order of fields. You
can also force line breaks when using style=rvsHorizontal by inserting a <New line>.
c) The call to FlushChanges ensures that the record-view form sees any changes
made to the grid. If you do not call this method, then the record-view form will
not be able to see the changes made to the currently active field in the grid.
3. Optional - Use the RecordViewDialog's OnInitDialog to set the active control to the
same field that corresponds to the grid's active field. This allows the active field to
remain consistent between the record-view and the grid.
procedure TRecordViewDemoForm.wwRecordViewDialog1InitDialog(
Form: TwwRecordViewForm);
begin
[Link];
end;
1. Add a new TMainMenu component to your form and set the following properties.
Name=RecordViewMenu
Items=Your menu design
See the demonstration program [Link] for a complete example of using a custom menu in
the record-view dialog.
Added Properties
ControlInfoInDataset
Set this property to False if you wish for the record view panel to store the information about
the embedded controls into its ControlType property . You may wish to set this property to
False if you want the record view panel to have no dependency upon the embedded control
information stored in the dataset. By default this property is True, which means that
information about the embedded controls is stored in the related TDataSet.
Notes: Normally you will want to leave this property as True. Set this property to False if you
have more than one IP container control such as a grid or record-view attached to the same
dataset, and do not wish for them to share the same custom control.
ControlOptions
This property contains a set of Boolean values that control the display of embedded controls.
Data Type: Set of TwwRecordViewControlOption
Valid Values: rvcTransparentLabels, rvcTransparentButtons, rvcFlatButtons
ControlType
This property is equivalent to the ControlType property (See TwwTable ControlType).
InfoPower stores the control information into this property if the ControlInfoInDataSet
property is False. Otherwise this property is not used.
DataSource
This property contains the name of a TDataSource component that provides the record view
form with data. The default value is blank.
Data Type: TDataSource
EditFrame
See the topic “Key properties and events for custom framing” in chapter 4 for information on
this property. Set the EditFrame property to customize how the contained edit control’s
borders and background are painted. For instance, set the [Link] and
[Link] properties to True to display the edit controls transparently. See also
the OnSetControlEffects to individually customize the borders of a control.
Data Type: TwwEditFrame
EditSpacing | HorizontalView
This property defines the spacing values for the controls in the record view form when using
Style=rvsHorizontal
BetweenEditsInRow Horizontal Space between the edit controls
Data Type: Integer
BetweenLabelEdit Vertical Space between the label and the related edit control
Data Type: Integer
BetweenRow Vertical Space between the edit control and the top of the label on
the next row.
Data Type: Integer
Font
This is the standard Delphi Font property that allows you to define the font and its attributes
used to display the controls in the record-view panel. See also the LabelFont property.
Data Type: TFont
Valid Values: Standard Delphi Font options
LabelFont
This is the standard Delphi Font property that allows you to define the font and its attributes
used to display the labels in the record-view form. See also the Font property.
Data Type: TFont
Valid Values: Standard Delphi Font options
LinesPerMemoControl
This property determines the height of memo controls in the panel. The default is 2 lines per
memo control.
Data Type: integer
Margin
Space between panel and controls.
BottomOffset Space between the bottom edit control and the bottom of the record-
view panel
Data Type: Integer
LeftOffset Space between the left-most edit control and the left side of the
record-view panel
Data Type: Integer
RightOffset Space between the right-most edit control and the right side of the
record-view panel.
Data Type: Integer
TopOffset Space between the top edit control and the top of the record-view
panel
Data Type: Integer
Options
This property contains a set of Boolean values that control options in the record-view form.
Data Type: Set of TwwRecordViewOption
PictureMaskFromDataSet
This property is only relevant if your datasource is attached to a TwwTable, TwwQuery,
TwwQBE, or TwwClientDataset component, as it is always treated as false in other cases.
When customizing the picture masks through the select fields dialog (invoked by clicking on
the selected property at design time), the mask information is stored in the related dataset if
this property is True. Otherwise the mask information is stored as a property in the related
visual component. By storing the mask information in the dataset, you do not need to re-enter
the picture mask for other visual controls attached to this same database field.
Data Type: boolean
PictureMasks
The assigned picture mask information is stored in this property if PictureMaskFromDataset is
false. See the PictureMaskFromDataSet property.
Data Type: TStrings
Selected
This property determines the field layout of the record-view panel. It determines the field
order, the display labels, and the edit control width. Clicking in this property brings up a
specialized form of the Select Fields Dialog, which allows line-breaks to be inserted. You can
insert line breaks by clicking on the icon.
Using this dialog you can set picture masks, attach edit controls, select fields, etc. See Using
the Select Fields Dialog Box at the beginning of Chapter 4.) The default value is all fields
selected.
Data Type: (Internal to InfoPower)
Valid Values: (Internal to InfoPower)
Style
This property determines the style of the record-view panel’s field display. If set to
rvpsHorizontal, then each succeeding field is displayed on the same line until it reaches the
right edge of the panel. You can force line-breaks using the Selected property. If set to
rvpsVertical, then only one field is displayed per line.
Data Type: TwwRecordViewPanelStyle
Valid Values: rvpsHorizontal, rvpsVertical
Added Events
OnAfterCreateControl
This event allows you to customize the edit control after the record-view form has created the
control.
Note : Embedded controls on the record-view form can be customized outside the scope of this
event since the control already exists before the record-view form is shown. However normal
edit controls do not exist until the record-view form is shown, and thus to customize you will
need to use this event.
The parameters for this event are as follows.
Sender : TObject Record-view Panel
CurField: TField Field that is related to the edit control
OnBeforeCreateControl
This event allows you to evaluate the control about to be created and either accept or reject its
placement into the record-view form.
The parameters for this event are as follows.
Sender: TObject Record-View Panel
CurField: TField Field that is related to the edit control
Accept: boolean Set to false to reject the component. Defaults to True.
Example: The following example will reject the last name field from being included in the
record-view panel. Note: You can also remove a field at design time by clicking in the
selected property. However if the fields that are to be included are not known until runtime,
then you can resort to this technique to remove fields.
procedure TForm1.wwRecordViewPanel1BeforeCreateControl(
Sender: TObject; curField: TField; var Accept: Boolean);
begin
if [Link]='Last Name' then Accept:= False;
end;
OnSetControlEffects
Use the OnSetControlEffects event to override the RecordView's EditFrame settings for an
individual or selected control. See the TwwRecordViewDialog OnSetControlEffects event for
further information.
How To
Customize the selection and order of fields in the record-view form
Click on the selected property to invoke the Select Fields Dialog. From here you can select
which fields should be visible in the record view, as well as determine the order of fields. You
can also force line breaks when using style=rvpsHorizontal by inserting a <New line>.
Ancestor
TComponent
└─TwwCustomDialog
└─TwwCustomLookupDialog
Added Properties
Caption
This property contains a text value that is displayed in the search dialog box’s title bar. The
default value is “Search”.
Data Type: String
CharCase
This property defines what case the characters typed in by the user are to take. ecLowerCase
converts all characters to lower case. ecNormal allows the user to type both upper and lower
case characters. ecUpperCase converts all characters to upper case. The default value is
ecNormal.
Data Type: Constant
Valid Values: ecLowerCase, ecNormal, ecUpperCase
GridColor
This property defines the background color of the grid. The default value is clWhite. (When
one or more columns of a grid are fixed, their colors are the same colors used for the grid’s
column headings defined by TitleColor.)
Data Type: TColor
GridTitleAlignment
Determines the text alignment of titles in popup-dialog's grid. The default value is
taLeftJustify.
Data Type: Constant
Valid Values: taCenter, taLeftJustify or taRightJustify
MaxHeight
Defines the maximum Height of the grid in the related dialog. Use this property to control the
height of the popup-dialog. The default value for a standard VGA display (640 x 480) is 209.
Data Type: Integer
Valid Values: Positive integer value
MaxWidth
This property defines how wide the dialog box is allowed to grow, in pixels. The default value
is 0, which allows the dialog box to grow to the entire width of the screen.
Data Type: Integer
Valid Values: Depends on your screen’s display resolution
Options
This property contains a set of Boolean values that control the appearance of the dialog box.
See the TwwLookupDialog Options property for a detailed description.
Data Type: TSet()
Valid Values: opShowOK, opShowSearchBy, opGroupControls, opFixFirstColumn and
opShowStatusBar
PictureMaskFromDataSet
This property is only relevant if your datasource is attached to a TwwTable, TwwQuery,
TwwQBE, or TwwClientDataset component, as it is always treated as false in other cases.
When customizing the picture masks through the select fields dialog (invoked by clicking on
the selected property at design time), the mask information is stored in the related dataset if
this property is True. Otherwise the mask information is stored as a property in the related
visual component. By storing the mask information in the dataset, you do not need to re-enter
the picture mask for other visual controls attached to this same database field.
Data Type: boolean
PictureMaskFromField
Setting this property to True will allow the dialog to automatically use the picture mask
defined for the database field when the end-user is entering the text to search for.
PictureMasks
The assigned picture mask information is stored in this property if PictureMaskFromDataset is
false. See the PictureMaskFromDataSet property.
Data Type: TStrings
SearchTable
This property defines the TDataSet component that the search should use for synchronization
(the table used to retrieve data displayed to the user). The ShadowSearchTable property,
described below, is the TDataSet component used internally to actually perform the search
operation.
Using a different table component internally allows you to select the fields to be displayed in
the grid along with allowing your end-users to navigate within the SearchDialog grid and even
Cancel the search operation. All without affecting the visual interface component’s record
position. The default value is blank.
Data Type: TDataSet
Selected
Clicking the “...” button or double-clicking the SearchDialog component displays the Select
Fields dialog box. This dialog box allows you to select the fields you want displayed in the
grid, their titles, widths, control types and link information. (See Using the Select Fields
Dialog Box at the beginning of Chapter 4.) The default value is all fields selected, using the
field name as it’s title, displayed as a Field control for a width equal to the number of
characters in the field or the title, whichever is longer.
Data Type: (Internal to InfoPower)
Valid Values: (Internal to InfoPower)
ShadowSearchTable
Optional This property defines the TDataSet component to be used internally by the
SearchDialog component. If not specified then all navigational operations are applied directly
to the table specified in the SearchTable property, as well as all field selections originating
from the SearchTable. This should be a different TwwTable component than the one specified
in SearchTable, but still point to the same physical table.
Using a different table component internally allows the developer to select the fields displayed
in the grid, along with allowing the user to navigate within the SearchDialog grid and even
Cancel the search operation without affecting the visual interface component’s record position.
The default value is blank.
Data Type: TDataSet
Tag
This is the standard Delphi Tag property that you can use for your own internal processing
needs. The default value is 0.
UserButton1Caption
When you want to display this button on the dialog box, enter the caption text for the button
here and then add code to the OnUserButton1Click event. The default value is blank.
Data Type: String
Valid Values: Any text value that fits within the width of the button.
UserButton2Caption
When you want to display this button on the dialog box, enter the caption text for the button
here and then add code to the OnUserButton2Click event. The default value is blank.
Data Type: String
Valid Values: Any text value that fits within the width of the button.
UseTFields
When the UseTFields property is set to true the Selected property’s display settings are stored
and retrieved from the ShadowSearchTable or the SearchTable. When it is set to False the
Selected property’s display settings are stored with the TwwSearchDialog.
The default is True.
Data Type: Boolean
Modified properties
None.
Added Events
Some of the following events pass a handle to the form containing all of the components of the
dialog. To see what objects are contained within this editing form, open up [Link] in the
InfoPower source sub-directory. If you do not have the source code version of InfoPower, then
perform the steps in Chapter 4's topic "Determining the object names of the controls contained
in an InfoPower dialog" on the [Link] file contained in the InfoPower lib directory.
If you want to customize any of the objects contained by the form you can use the OnInitDialog
event. However if all you are trying to do is to change the labels and hints, then use the
TwwIntl | SearchDialog property.
OnInitDialog
Allows you to completely customize every aspect of the dialog box or perform some action
during the initialization of the dialog box. When using this event, your code must reference
OnCloseDialog
This event allows you to perform any custom action before the dialog is actually closed.
OnPerformCustomSearch
When using a large dataset from a remote server, the performance of the dialog’s incremental
searching can significantly degrade. To resolve this issue, InfoPower adds a new event where
you can control the specific action that takes place after the user types a character, or when the
control needs to look up a value. In particular the custom action can update the query to only
return the records that you are interested in. When using this event, your code is responsible
for manipulating the lookuptable based on the parameter values passed in. See the
TwwDBLookupCombo OnPerformCustomSearch event for a description of the events
parameters.
OnSortChange
If you want to perform some custom action when the end-user makes a selection from the
SortBy combo, then place your custom code here.
OnSyncDataSets
Use this event to synchronize the search table and shadow table to point to the same record.
When using TwwTable components, synchronization is automatically performed. However
when using other TDataSet components, you must attach code to this event to perform the
synchronization. The parameters for this event are as follows.
Sender: TObject TwwSearchDialog associated with event
MoveDataSet: TDataSet DataSet that needs to be synchronized with the BaseDataSet
BaseDataSet : TDataSet DataSet that the MoveDataSet needs to move to.
Example: The following example synchronizes the datasets used by the SearchDialog when
going against an TADOTable component. In this example OrderID is a unique field in the
table.
OnUserButton1Click
When you want to display developer-defined button #1 on the dialog box, enter the caption
text for the button in the UserButton1Caption property and then add code to this event that
will be executed when the end-user clicks the button.
OnUserButton2Click
When you want to display developer-defined button #2 on the dialog box, enter the caption
text for the button in the UserButton2Caption property and then add code to this event that
will be executed when the end-user clicks the button.
Added Methods
Execute
Display the search dialog box to the end-user. False is returned if the user clicks the Cancel
button or the user closes the dialog box via the control menu
How To
Use the SearchDialog with non-TTable components
See the example under the OnSyncDataSets event.
Tips
♦ If you want to give your users some special functionality while the Search
dialog box is being displayed, define one or both of the optional developer-
defined buttons via the UserButton1Caption and UserButton2Caption
properties. Then define your actions via the OnUserButton1Click and
OnUserButton2Click events.
♦ If you are using SQL tables, refer to the TwwTable component’s
SyncSQLByRange property, and the SQL entries in the Troubleshooting
section, for some very useful information that will assist you in working with
SQL tables and InfoPower.
♦ If you have a choice use case insensitive indexes in your tables to make
incremental searching more user-friendly.
procedure TForm1.wwSearchDialog1InitDialog(
Dialog: TwwLookupDlg);
begin
[Link] :=
[Link];
end;
Ancestor
TStoredProc.
Added Properties
ControlType
This property holds information about the type of control used to display a field if the field is
contained within a grid component. The default value is Field. (See Using the Select Fields
Dialog Box at the beginning of Chapter 4.) To change this property at runtime, see the
SetControlType method of the wwDBGrid component.
Data Type: (Internal to InfoPower)
Valid Values: (Internal to InfoPower)
LookupFields
Maintained for backward compatibility with earlier versions of InfoPower.
Data Type: (Internal to InfoPower)
Valid Values: (Internal to InfoPower)
LookupLinks
Maintained for backward compatibility with earlier versions of InfoPower.
Data Type: (Internal to InfoPower)
Valid Values: (Internal to InfoPower)
OnFilterOptions
See the documentation for OnFilter under the TwwTable component
ValidateWithMask
See the documentation for ValidateWithMask under the TwwTable component
Modified properties
None.
Added Events
OnFilter
See the documentation for OnFilter under the TwwTable component.
OnFilterEscape
See the documentation for OnFilterEscape under the TwwTable component.
OnInvalidValue
See Using InfoPower’s Picture Masks in chapter 4.
Added Methods
wwFilterField
See the documentation for wwFilterField under the TwwTable component
How To
The TwwStoredProc component is inherited from Delphi’s TStoredProc, so please refer to
your Delphi manual for more information about this component. Since InfoPower’s
TwwStoredProc component is inherited from Delphi’s TStoredProc component, you are
provided with 100% backward compatibility. Thus, you can safely replace your use of
TStoredProc with TwwStoredProc at any time.
The non-visual TwwTable component allows you to define the database table that
supplies data to one or more of the other InfoPower visual interface components placed on
your form. Since InfoPower’s TwwTable component is inherited from Delphi’s TTable
component, all standard Delphi component properties and functionality are still available,
such as double-clicking the component to invoke Delphi’s built-in Fields editor. All data
access for the TwwTable is still performed by the Delphi TTable.
Several properties, events and methods were added to TwwTable. For example, the Pack
method allows you to pack any Paradox or dBASE table by adding only a single line of code to
your program! InfoPower also includes picture masks at the table field level so invalid field
values will be detected before your records are posted.
Ancestor
TTable.
Added Properties
ControlType
This property holds information about the type of control used to display a field if the field is
contained within a grid component. The default value is Field. (See Using the Select Fields
Dialog Box at the beginning of Chapter 4.) To change this property at runtime, see the
SetControlType method of the wwDBGrid component.
Data Type: (Internal to InfoPower)
Valid Values: (Internal to InfoPower)
FilterCount
This property is maintained for backwards compatibility with earlier versions of InfoPower.
This property is identical to the RecordCount property.
LookupFields
Maintained for backward compatibility with earlier versions of InfoPower.
Data Type: (Internal to InfoPower)
Valid Values: (Internal to InfoPower)
NarrowSearch
This property affects how InfoPower’s incremental searching is performed. When this property
is True, incremental searching will show only those entries that match what has been typed in
so far. For example, if the user types in the letter C, then all records starting with C are shown
and no other records. When the user enters another character, the search becomes even
narrower, or more specific.
When this property is False and using local tables, incremental searching moves to the record
that most closely matches the letters typed in. If this property is False and you are using SQL
tables, then incremental searching is dependent upon the SyncSQLByRange property setting.
The default value of this property is False. See also the NarrowSearchUpperChar property.
Note: When this property is True and you are using a TwwSearchDialog, you should use a
shadow table.
Data Type: Boolean
NarrowSearchUpperChar
This property is defines the behavior of linked field lookups on SQL tables, as well as the
behavior of the incremental searching with the NarrowSearch property set to True. You
should set this property to the highest ASCII value that your back-end recognizes.
In general you will never need to change this property unless your back-end does not
understand the ASCII value of 255 for its data values. SQL server does not recognize the
ASCII value of 255 in its SQL select statements, so you need to change this value to something
SQL server recognizes, such as 122 (ASCII value for ‘z’). The default value is 255.
Data Type: Word
Valid Values: Valid ASCII Ord value
OnFilterOptions
This property contains a set of boolean values that control the behavior of the onFilter event.
Data Type: set of TwwOnFilterOption;
Valid Values: ofoEnabled, ofoShowHourGlass, ofoCancelOnEscape
ofoEnabled When False, the onFilter callback is ignored.
ofoShowHourGlass When True, this property will enable the HourGlass cursor to
appear whenever an OnFilter is being applied on the dataset. For
example when the user is scrolling in a grid against a filtered
table, the hourglass will be displayed while the dataset is being
searched and return to an Arrow when the search is complete.
ofoCancelOnEscape When True, this property allows the end-user to cancel a filter that
is currently being applied. For instance if a filter is taking a long to
PictureMasks
This property holds information about a field’s picture mask. See Using InfoPower’s Picture
Masks in Chapter 4 for more details.
Data Type: TStrings
Valid Values: (Internal to InfoPower)
Query
This property is preserved for backward compatibility with earlier versions of InfoPower.
Previously this property was necessary if you wanted to fill a drop-down list from a query
result. Since IP 3000 supports TwwQuery for its LookupTable in its lookup components, you
should use the TwwQuery component instead of this property.
Data Type: TStrings
Valid Values: Any SQL or QBE query that produces a result set.
SyncSQLByRange
This property affects how InfoPower synchronizes two SQL tables and performs a an
incremental search when using the TwwSearchDialog, TwwLookupCombo, or
TwwIncrementalSearch. By default, SyncSQLByRange is False, which tells the search
components to use the Delphi Locate method, and the SearchDialog to use the GotoCurrent
method to synchronize two tables.
ValidateWithMask
When True, assigned picture masks are used to validate field values before they are posted.
When False, this validation is skipped. You may want to set this property to False when using
the TField's OnGetText and OnSetText events to map the stored value to a different displayed
value.
Data Type: Boolean
wwFilter
Maintained for backwards compatibility with earlier versions of InfoPower. For expression
filtering see the Delphi Filter and Filtered properties.
Added Events
OnFilter
This event is executed for records in the related table which allows you to have practically
unlimited filtering capabilities. Via this callback filter function, you simply set the parameter
Accept to False if you want the record to be excluded. In addition, this event respects other
ranges and filters that might currently be set on the related table (i.e. SetRange method and
Filter property ). You can also filter on InfoPower linked fields or Delphi’s lookupfields with
this event.
Parameters
Table : TwwTable Table being filtered
Accept: Boolean Set to False to exclude a record. Defaults to True.
Delphi has the event named OnFilterRecord, which has similar functionality. However
Delphi’s OnFilterRecord does not work with lookup fields or memo fields. We recommend
you use the OnFilter event if you need to filter on lookup or memo fields.
With the InfoPower OnFilter event, you can compare two database fields with each other (for
example: Field1 < Field2), do bitwise comparisons in fields, have filters dependent upon other
related tables, or anything else you can express in code. This event is most practical when used
against local tables (Paradox or dBASE) because when used against SQL tables, the back-end
database system is prevented from optimizing the filter, since every record is passed to this
event.
Disabling the onFilter event: You can disable a previously defined OnFilter event during
program execution by setting the table’s OnFilterOptions | ofoEnabled property to False. For
example:
[Link] := [Link] - [ofoEnabled];
Refreshing the filtered table: If you change a variable that your OnFilter event depends
upon, then you should also call the table’s refresh method. In general, call the table’s refresh
method to force the OnFilter to be re-processed.
Allowing the end-user to cancel a filter in progress: By setting the onFilterOptions |
ofoCancelOnEscape property to True, the end-user can cancel a filter in progress by entering
the <ESC> key. You can also display an informational message after the filter has been
cancelled by using the onFilterEscape event.
Example 2: The following example shows all records that have an odd number for their
Customer No.:
procedure TForm1.wwTable1Filter(table: TwwTable; var Accept: boolean)
begin
with table do
accept := odd(wwFilterField('Customer No').AsInteger);
end;
Example 3: The following example shows all employees who started a job and quit before 30
days had elapsed:
procedure TForm1.wwTable1Filter(table: TwwTable; var Accept: boolean):
begin
with table do
accept := wwFilterField('DateStartedJob').AsDate
- wwFilterField('DateQuitJob').AsDate > 30
end;
OnFilterEscape
This event is fired after the end-user has cancelled a filter in progress by pressing the <Esc>
key. You may wish to use this event to display an informational message to the user so that
they are aware they have cancelled the filter. See also the onFilter event.
OnInvalidValue
See Using InfoPower’s Picture Masks in chapter 4.
Added Methods
FilterActivate
Maintained for backward compatibility with earlier versions of InfoPower. For expression
filtering see the Delphi Filter and Filtered properties.
Pack
Allows you to pack both Paradox and dBASE tables interactively from within your program.
The function definition is:
Function Pack(var statusMsg: string): Boolean;
RefreshLinks
Maintained for backward compatibility.
SetLookupField
This method allows you to update lookup fields in the InfoPower grid.
This method should be called in the lookup [Link] event to provide an updateable 1
to 1 relationship. You will also need to set the Grid’s EditCalculated property to True so that
the grid will allow edits in the lookup field. See the example in the TwwDBGrid how-to
section, under editing a Lookup Field.
wwFilterField
This method must be used only during processing of the OnFilter event. wwFilterField returns
the contents of any field, contained in the currently filtered record, in the format you specify
via the following properties:
Rtn Value
Property Return Value Data Type
AsBoolean Field's contents as a boolean Boolean
AsFloat Field's contents as a float Double
AsInteger Field's contents as an integer LongInt
AsString Field's contents as a Pascal string String
AsDate Date portion of the field's value TDateTime
AsTime Time portion of the field's value TDateTime
AsDateTime Field's value as a TDateTime TDateTime
AsCurrency Field 's value as currency Double
IsNull True if the field is Null Boolean
Example: Please refer to the OnFilter event examples.
How To
Performing case-insensitive filters, or substring filters.
If you need this ability then you should use the TwwTableOnFilter event. Similarly, use the
onFilter event if you need your filter to search on a substring anywhere in the field
Tips
♦ To extract only specific fields from the table, double-click the TwwTable
component to invoke the Delphi Fields editor and select only those fields you
want to extract.
♦ To change the display order of records associated with this table, use the
IndexName property to select a valid secondary index. For SQL servers, use
the IndexFieldNames property. Records are now displayed in the order of the
Index you chose.
♦ To modify field-level properties that are not included in the Select Fields
dialog box, such as alignment, display format, edit mask, etc., use the Object
Inspector. If the field is not listed in the Object Inspector, select it via
Delphi’s Fields editor window (double-click the TwwTable component).
By default all fields in a table are selected for retrieval, but they are not listed
in the Object Inspector where you can modify their properties. To add all
fields to the Object Inspector, click the Add button of the Fields editor, make
sure all fields are highlighted and then click the OK button. You will now be
able to select an individual field in the Object Inspector and modify its
properties.
♦ Since InfoPower’s TwwTable component is a direct descendent of Delphi’s
TTable component, you are provided with 100% backward compatibility.
Thus, you can safely replace your use of TTable with TwwTable at any time.
6
Troubleshooting
We recommend you visit our newsgroups at [Link] as the newsgroup
contains thousands of messages discussing InfoPower, getting the most out of InfoPower,
and troubleshooting InfoPower. Also be sure to check the useful sites at
[Link] and [Link] as it
contains a database of InfoPower newsgroup threads that provide useful tips and solutions.
This chapter provides troubleshooting assistance when you are having problems working
with specific InfoPower components. Please check through this list before calling our
technical support department because it could save you some time and the cost of a long-
distance phone call. Components in this section are listed in alphabetical order.
General
♦ Problem: I am getting some consistent unexplainable GPFs or system
crashes when I run my application.
Solution: Make sure your project stack size is sufficiently high. We
deem Delphi's 16K default to be inadequate in most cases and strongly
recommend that you raise this value to 24K (6000 Hex).
Options | Project | Linker | Min Stack Size 0x00006000
Troubleshooting 311
SQL Tables - Navigating/Backward scrolling
♦ Problem: After locating a record via the TwwSearchDialog,
TwwIncrementalSearch, or TwwDBLookupCombo, I’m not allowed to
scroll back to prior records or use the TDBNavigator to move to prior
records.
Solution: If the TwwTable’s SyncSQLByRange property is True, SQL
table synchronization will move to the selected record by using the
TwwTable’s SetRange method. This allows for very fast SQL table
synchronization, but you cannot scroll backwards to a record prior to the
first one located. If you really need the ability to move to prior records,
set the SyncSQLByRange property to False. However, be aware that SQL
table synchronization will become quite slow.
TwwDBGrid
♦ Problem: I added a TwwDBLookupCombo to my grid. When the
LookupCombo is active (currently selected cell), it displays the correct
data from the lookup table, but the rest of the rows in the grid (non-
active) display the lookup value instead. How do I get the grid to display
the field from the other table in all the rows and not just for the row
where the LookupCombo is active.
Solution: Define a Delphi lookup field as described in the Delphi
documentation, and then bind your lookupcombo control to this
lookupfield column.
♦ Problem: During program execution I am assigning the DataSet
property of a TDataSource. However after I assign the datasource, the
related TwwDBGrid seems to have lost most of its fields.
Solution: Before assigning the DataSet property of the TDataSource,
first clear the grid’s selected property. The grid then will automatically
display the visible fields of the NewTable.
[Link];
[Link] := NewTable;
TwwDBLookupCombo
♦ Problem: The drop-down list does not seem to be able to scroll
backwards when going against SQL or ODBC tables.
Solution: Change your lookuptable’s SyncSQLByRange property to
False. See the documentation for SyncSQLByRange for more details.
312 Troubleshooting
♦ Problem: No data is being displayed in the drop-down list.
Solution: Select the fields to be displayed by using the Select Fields
dialog box—click the “...” button in the Selected property (refer to Using
the Select Fields Dialog Box at the beginning of Chapter 4 for details
about using this dialog box).
TwwKeyCombo
♦ Problem: I’m getting a “DataSource cannot be a child table” Warning
box.
Solution: It’s telling you that the DataSource property of this component
is trying to reference a child table of a Master/Child relationship, which
is not legal. You can assign a TwwKeyCombo’s DataSource only to a
Master table. If you get this error when using the SearchDialog or
LookupDialog you can avoid this problem by setting the property
Option | OpShowSearchBy to False.
♦ Problem: The TwwKeyCombo component appears to only display
indexes based on fields that are currently set to 'Visible = True'. I
regularly combine several fields into a single calculated field for display
in a grid and make the original fields invisible.
Solution: You can add indexes that InfoPower didn't choose by
overriding the OnEnter event and adding all other fields the user should
be able to select the index for. For example, the following code adds the
index associated with the field 'City' to wwKeyCombo1 and makes sure
that the index field is only added one time:
Procedure TIncrSearch.wwKeyCombo1Enter(Sender: TObject)
begin
if ([Link]('City') < 0) then
[Link]('City');
end;
TwwIncrementalSearch
♦ Problem: When typing characters to be located, the value is not found,
even though I know it exists.
Solution: This component’s case sensitivity is dependent upon the table
index’s case sensitivity. If the index is defined as Case Sensitive, then
the user needs to enter case-sensitive characters, both upper and lower
case characters, in the exact order in which they appear in the value of
the index. For example, if the user wants to locate a value of “San Jose”
in the City field of their Customer table, they must enter an upper case
“S” and then a lower case “a” in order to locate “Sa”, and then continue
entering each character with its proper capitalization. To assist the user,
you may wish to assign a picture mask to the field so that the first letter
is automatically converted to uppercase
Troubleshooting 313
TwwSearchDialog
♦ Problem: I’m getting an error message telling me that a DataSource or
DataSet is required or that the DataSource has no DataSet.
Solution: Make sure you have placed two separate TwwTable
components on your form and assigned them to the SearchTable and
ShadowSearchTable properties, as described in the Added properties
section of this component.
TwwDBLookupComboDlg, TwwSearchDialog,
TwwLookupDialog
♦ Problem: I am trying to have the user button terminate the dialog.
Solution: Set the ModalResult in your user button to mrOK as in the
following.
(Sender as TForm).ModalResult := mrOK;
♦ Problem: When using the TwwSearchDialog, how can I access the
search text in order to be able to automatically (or by pressing one of the
user buttons) add a record to the lookup table based on that string.
Solution: Your code must reference wwidlg in your Uses clause. This
gives you access to all the SearchDialog's components. For instance the
following code shows the current text in the incremental search
component of the TwwSearchDialog.
procedure TSearchForm.wwSearchDialog1UserButton1Click(
Sender: TObject;
LookupTable: TDataSet);
begin
with (Sender as TwwLookupDlg) do
ShowMessage([Link]);
end;
314 Troubleshooting
procedure TGridDemo.wwSearchDialog1UserButton1Click(
Sender: TObject;
LookupTable: TDataSet);
begin
with Sender as TwwLookupDlg do begin
[Link];
[Link];
end
end;
For more information on the component names within the dialog, please
refer to the OnInitDialog event.
♦ Problem: I've been looking at the OnInitDialog method of the
TwwDBLookupComboDlg, TwwLookupDialog, and TwwSearchDialog,
but can't seem to find the right code to make the memo field in the
lookup grid shows.
Solution: The following example sets the MemoAttributes property of
the grid on the dialog so that memos appear in the pop-up search dialog.
First, add wwmemo to your form’s uses clause.
procedure TForm1.wwDBLookupComboDlg1InitDialog(
Dialog: TwwLookupDlg);
var grid: TwwDBGrid;
begin
grid := Dialog.wwDBGrid1;
[Link] := [Link] + [mGridShow];
[Link] := [Link] + [mDisableDialog];
end;
TwwTable
♦ Problem: I'm trying to use the Pack method, but keep getting the
message "Pack failed. Table is busy." even with the table's Active
property set to False. What else do I need to do?
Solution: Packing requires that the table's active property be False, so it
can gain exclusive access to the table. You will need to make sure that
the table’s active property is set to False at design time so that the Delphi
IDE does not open the table. Setting active to False at run-time isn't
equivalent, as the Delphi IDE itself may already have this table open.
Troubleshooting 315
Index
TwwCheckBox, 44 AuxiliaryTables property
" AllowInvalidExit property, 35 TwwQBE, 249
AlternatingRowColor property
"Error creating cursor handle", TwwDataInspector, 59 B
252 AlternatingRowRegions
property BackgroundBitmap property
1 TwwDataInspector, 59 TwwDataInspector, 59
AlwaysTransparent property BackgroundDrawStyle
1stClass TwwCheckBox, 45 property
advantages, 61 TwwRadioButton, 255 TwwDataInspector, 59
integration, 61 AndChar property BackgroundOptions property
TwwFilterDialog, 209 TwwDataInspector, 59
A AnswerTable property BeginUpdate method
TwwQBE, 248 TwwDataInspector, 67
ActiveEdit property Appending to a rich edit, 191 BetweenEditsInRow property
TwwDataInspector, 54 AppendRichEditFrom TwwRecordViewDialog,
ActiveItem property TwwDBRichEdit, 191 263
TwwDataInspector, 54 ApplyFilter method TwwRecordViewPanel, 276
TwwInspectorItem, 69 TwwFilterDialog, 219 BetweenLabelEdit property
ActiveRecordColor property ApplyFrame TwwRecordViewDialog,
TwwDataInspector, 59 TwwController, 50 263
ActiveRows property ApplyList method TwwRecordViewDialog,
TwwDataInspector, 54 TwwDBComboBox, 86, 88 263
Add method ApplySelected method TwwRecordViewPanel, 276
TwwInspectorCollection, TwwDBGrid, 136 BetweenRow property
71 attaching icon to indicator TwwRecordViewDialog,
TwwNavButtons, 177 button, 145 263
Add property AutoDropDown property TwwRecordViewPanel,
example, 71 TwwDBComboBox, 81 276, 277
AddFieldInfo method TwwDBLookupCombo, Bitmap in grid, 30, 31
TwwFilterDialog, 219 152 Bitmaps in a TwwDBRichEdit,
AddInfoPowerDialogs TwwDBLookupComboDlg, 179
TwwNavButtons, 177 162 bitmaps in dialog buttons
AddItem method AutoEnableEdit property TwwIntl, 227
TwwDBComboBox, 86 TwwDBComboDlg, 90 bitmaps in grids, 148
ADO property AutoFill property BlankAsZero property
TwwIntl, 225 PictureMasks, 35 TwwQBE, 249
Alignment property AutoFillDate property BorderStyle property
TwwCheckBox, 44, 45 TwwDBEdit, 99 TwwRecordViewDialog,
TwwDBDateTimePicker AutoHideExpandButton 262
CalendarAttributes, 94 property Bottom margin
TwwInspectorItem, 73 TwwExpandButton, 201 TwwDBRichEdit, 188
TwwRadioButton, 255 AutoShrink property BottomOffset property
All | Searched, TwwExpandButton, 201 TwwRecordViewDialog,
TwwFilterDialog, 206 AutoSizeHeightAdjust 264
AllowClearKey property property TwwRecordViewPanel, 277
TwwDBComboBox, 81 EditFrame, 23 building custom packages in
TwwDBLookupCombo, Frame, 23 Delphi 5, 14
152 AutoSizeStyle, button effects
TwwDBLookupComboDlg, TwwDBNavigator, 173 Flat property, 25
162 Auto-sizing columns key properties, 25
[Link] TwwDBGrid, 102 supporting components, 22
, 76 AutoURLDetect property Transparent property, 25
AllowGrayed property TwwDBRichEdit, 181 ButtonAlignment property
316 Index
TwwExpandButton, 201 Setting the caption, 225 TwwDBGrid IniAttributes,
ButtonEffects property CanCut method 115
TwwController, 50 TwwDBRichEdit, 191 Clear method
TwwDBComboBox, 81 CanFindNext method TwwIncrementalSearch,
TwwDBComboDlg, 90 TwwDBRichEdit, 191 224
TwwDBDateTimePicker, CanPaste method TwwNavButtons, 177
94 TwwDBRichEdit, 191 ClearFilter method
TwwDBLookupCombo, CanRedo method TwwFilterDialog, 219
152 TwwDBRichEdit, 191 ClearHistory method
TwwKeyCombo, 229 CanUndo method TwwDBComboBox, 86
ButtonFrame property TwwDBRichEdit, 191 ClearParams method
TwwRadioGroup, 258 Canvas property TwwQBE, 251
ButtonGlyph property TwwDataInspector, 55 Click method
TwwDBComboBox, 81 Caption property TwwNavButton, 177
TwwDBComboDlg, 90 TwwCheckBox, 45 client datasets, 48
TwwDBDateTimePicker, TwwDBLookupComboDlg, CollapseGlyph,
94 162 TwwDataInspector, 54
TwwDBLookupCombo, TwwFilterDialog, 208 color alternating rows in grid,
152 TwwInspectorItem, 73 147
ButtonOptions property TwwLocateDialog, 232 Color property
TwwDataInspector, 54 TwwLookupDialog, 236 TwwDBDateTimePicker
Buttons property, TwwMemoDialog, 243 CalendarAttributes, 94
TwwDBNavigator, 173 TwwNavButton, 174 Coloring of a grid cell
ButtonStyle property TwwRadioButton, 255 during editing, 36
TwwDBComboBox, 81 TwwRecordViewDialog, Coloring of a TwwDBEdit
TwwDBComboDlg, 90 262 during editing, 36
TwwDBDateTimePicker, TwwSearchDialog, 283 Coloring the cells in a grid,
94 CaptionColor property 127
TwwDBLookupCombo, TwwDataInspector, 54 Coloring the titles in a grid,
152 CaptionFont property 127
[Link] TwwDataInspector, 55 column headings. See
, 76 CaptionIndent property TitleAlignment and
ButtonWidth property TwwDataInspector, 55 TitleColor properties
TwwDBComboBox, 81 CaptionWidth property Column1Width property
TwwDBComboDlg, 91 TwwDataInspector, 55 TwwDBComboBox, 81
TwwDBDateTimePicker, carriage return to tabs, 147 ColumnByName method
94 Case insensitive filters TwwDBGrid, 136
TwwDBLookupCombo, TwwTable, 296 ColWidthsPixels property
153 CaseSensitive property TwwDBGrid, 108
By Range, TwwFilterDialog, TwwLocateDialog, 232 Combo box
206 cbStyleAuto, TwwIntl, 225 TwwDBComboBox, 80
By Value, TwwFilterDialog, cbStyleCheckmark, TwwIntl, Combo box dialog, 90
206 225 compatibility issues with
cbStyleXmark, TwwIntl, 225 InfoPower 4, 12
C CellHeight property Component Hierarchy, 15, 16,
TwwInspectorItem, 73 17
CalcCellCol property Changing a column’s width, component overview, 15
TwwDBGrid, 108 130 Connected property
CalcCellRow property CharCase property TwwIntl, 225
TwwDBGrid, 108 TwwLookupDialog, 236 ControlInfoInDataset
CalColors property TwwSearchDialog, 283 TwwDBGrid, 109
TwwDBMonthCalendar, Checkbox in grid, 30 ControlInfoInDataset property
169 CheckBoxInGridStyle property TwwRecordViewDialog,
CalendarAttributes property TwwIntl, 225 262
TwwDBDateTimePicker, Checked property TwwRecordViewDialog,
94 TwwCheckBox, 45 262
calling recordview from the TwwInspectorItem, 73 ControlInfoInDataSet property
grid, 146 TwwRadioButton, 255 TwwRecordViewPanel, 275
Cancel buttons CheckNewFields property controller, 22, 50
Troubleshooting 317
ControlOptions property TwwDBLookupComboDlg, defining grid title attributes,
TwwRecordViewDialog, 162 147
262 TwwDBMonthCalendar, DeleteItem method
TwwRecordViewPanel, 275 169 TwwDBComboBox, 86
ControlType property TwwDBRichEdit, 181, 182 deleting InfoPower. See
TwwClientDataSet, 48 TwwInspectorItem, 74 uninstalling InfoPower
TwwDBGrid, 109 TwwMemoDialog, 243 Delimiter property
TwwQBE, 249 DataSetFilterType property, TwwDBGrid
TwwQuery, 253 TwwFilterDialog, 211 ExportOptions, 111
TwwRecordViewDialog, DataSource cannot be a child TwwDBGrid IniAttributes,
263 table, 301 115
TwwRecordViewPanel, 276 DataSource property Design Picture Mask dialog,
TwwStoredProc, 289 TwwDataInspector, 55 39
TwwTable, 291 TwwDBDateTimePicker, Detecting cell movement, grid,
CopyRichEditFromBlob 95 149
method TwwDBGrid, 109 Detecting row change, grid,
TwwDBRichEdit, 192 TwwDBLookupCombo, 149
CopyRichEditTo method 156 dgAllowDelete, TwwDBGrid,
TwwDBRichEdit, 192 TwwDBLookupComboDlg, 118
CopyRichEditToBlob method 162 dgAllowInsert, TwwDBGrid,
TwwDBRichEdit, 192 TwwDBMonthCalendar, 118
Count property 169 dgColLinesDisableFixed,
TwwNavButtons, 173 TwwDBNavigator, 175 TwwDBGrid, 121
crashes, 299 TwwExpandButton, 202 dgDblClickColSizing,
custom control TwwFilterDialog, 208 TwwDBGrid, 121
within a grid, 144 TwwIncrementalSearch, dgEnterToTab, TwwDBGrid,
Custom control in 222 118
grid or record-view, 30 TwwInspectorItem, 74 dgFixedEditable, TwwDBGrid,
custom framing TwwKeyCombo, 229 120
key properties and events, TwwLocateDialog, 232 dgFixedProportionalResize,
22 TwwMemoDialog, 244 TwwDBGrid, 121
properties, 22 TwwRecordViewDialog, dgFixedResizable,
recordviewdialog, 24 263 TwwDBGrid, 120
recordviewpanel, 24 TwwRecordViewPanel, 276 dgFooter3DCells,
supporting components, 22 Date property TwwDBGrid, 120
custom framing and TwwDBDateTimePicker, dgHideBottomDataLine,
transparency effects, 21 95 TwwDBGrid, 121
CustomControl property TwwDBMonthCalendar, dgMultiSelect, TwwDBGrid,
TwwInspectorItem, 73 169 119
CustomControlAlwaysPaints Date time picker component, dgNoLimitColSize,
property 93 TwwDBGrid, 120
TwwInspectorItem, 74 DateFormat property dgPerfectRowFit,
CustomControlHighlight TwwDBDateTimePicker, TwwDBGrid, 119
property 95 dgProportionalColResize,
TwwInspectorItem, 74 DBEdit. See TwwDBEdit TwwDBGrid, 120
DBNavigator, 173 dgRowLinesDisableFixed,
D DefaultButton property TwwDBGrid, 121
TwwLocateDialog, 232 dgRowResize, TwwDBGrid,
data inspector, 51 DefaultEpochYear property 120
collection, 71 TwwIntl, 226 dgShowCellHint,
item, 73 DefaultField property TwwDBGrid, 120
data viewing order. See TwwExpandButton, 202 dgShowFooter, TwwDBGrid,
TwwKeyCombo TwwFilterDialog, 208 120
DataField property DefaultFilterBy property dgTabExitsOnLastCol,
TwwDBDateTimePicker, TwwFilterDialog, 208 TwwDBGrid, 120
95 DefaultMatchType property dgTrailingEllipsis,
TwwDBLookupCombo, TwwFilterDialog, 209 TwwDBGrid, 120
156 DefaultRowHeight property dgWordWrap, TwwDBGrid,
TwwDataInspector, 55 119
318 Index
dialog boxes [Link] RichEdit, 30, 31
TwwDBComboDlg, 90 s, 109 edit controls
TwwDBLookupComboDlg, DittoField method custom framing, 21
161 TwwDBGrid, 137 picture masks, 32
TwwFilterDialog, 205 DlgHeight property transparency effects, 21
TwwLocateDialog, 231 TwwMemoDialog, 244 EditCalculated property
TwwLookupDialog, 236 DlgLeft property TwwDBGrid, 110, 145
TwwMemoDialog, 243 TwwMemoDialog, 244 EditControlOptions property
TwwRecordViewDialog, DlgTop property TwwDBGrid, 110
261 TwwMemoDialog, 244 EditFrame properties, 22
TwwSearchDialog, 282 DlgWidth property EditFrame property
Dialog property TwwMemoDialog, 244 TwwRecordViewDialog,
TwwNavButton, 174 DottedLineColor property 263
DialogFontStyle property TwwDataInspector, 56 TwwRecordViewPanel, 276
TwwIntl, 226 Dragging a column in a grid, editing lookupfields in the grid,
DisableDefaultEditor property 130 145
TwwInspectorItem, 74 DragVertOffset property editing memos in the grid, 149
DisableDropDownList TwwDBGrid, 110 EditorCaption property
property DrawCellInfo TwwDBRichEdit, 182
TwwDBComboBox, 82 TwwDBGrid, 125 EditorEnabled property
DisableThemes, 41 DropDown method TwwDBSpinEdit, 197
DisableThemes property TwwDBLookupCombo, EditorOptions property
TwwCheckBox, 45 159 TwwDBRichEdit, 182
TwwDataInspector, 55 Drop-down panels EditorPosition property
TwwDBComboBox, 82 TwwDBGrid, 102 TwwDBRichEdit, 183
TwwDBDateTimePicker, DropDownAlignment property EditText property
95 TwwDBLookupCombo, TwwInspectorItem, 75
TwwDBEdit, 99 153 EditWidth property
TwwDBGrid, 109 DropDownCount property TwwDBRichEdit, 184
TwwDBLookupCombo, TwwDBComboBox, 82 Enabled
153 DropDownWidth property TwwHistoryList, 82
DisableThemesInTitle property TwwDBComboBox, 82 Enabled property
TwwDBGrid, 109 DroppedDown method EditFrame, 22
Display Attributes TwwDBComboBox, 86 Frame, 22
Select Fields dialog box, 28 DroppedDown property TwwDBGrid IniAttributes,
display order. See TwwDBComboBox, 82 116
TwwKeyCombo dynamic captions TwwInspectorItem, 75
DisplayAsCheckbox property TwwCheckBox, 47 EndDate property
[Link] TwwDBMonthCalendar,
, 76 E 169
Displayed values EndUpdate method
TwwDBComboBox, 88 ecoCheckboxSingleClick, TwwDataInspector, 67
DisplayFormat property TwwDBGrid, 110 enter to tab, 147
TwwDBDateTimePicker, ecoDisableCustomControls, Enter to tab property
95 TwwDBGrid, 110 TwwRecordViewDialog,
DisplayText property ecoDisableEditorIfReadOnly, 266
TwwInspectorItem, 75 TwwDBGrid, 111 Epoch property(Year 2000)
DisplayValueChecked property ecoSearchOwnerForm, TwwDBDateTimePicker,
TwwCheckBox, 45 TwwDBGrid, 110 95
DisplayValueUnchecked ecoUseDateTimePicker, Epsilon property,
property TwwDBGrid, 111 TwwFilterDialog, 213
TwwCheckBox, 45 Edit Combo List Dlg Box esoAddControls
distribution requirements, 12 using, 87 TwwDBGrid
Ditto Capability Edit Control ExportOptions, 112
TwwDBGrid, 103 Select Fields dialog box, 30 esoBestColFit
DittoAttributes property Edit Control in grid TwwDBGrid
TwwDBGrid, 109 Checkbox, 30 ExportOptions, 112
DittoDirection property CustomEdit, 30 esoClipboard
ImageIndex, 30, 31
Troubleshooting 319
TwwDBGrid ExpandedOnly parameter fdShowValueRangeTab,
ExportOptions, 113 TwwInspectorItem, 77 TwwFilterDialog, 213
esoDblQuoteFields ExpandGlyph, fdShowViewSummary,
TwwDBGrid TwwDataInspector, 54 TwwFilterDialog, 212
ExportOptions, 112 Export method fdSizeable, TwwFilterDialog,
esoDynamicColors TwwDBRichEdit, 193 213
TwwDBGrid Export To Clipboard, 113 fdSmartFilter,
ExportOptions, 112 Exporting to Excel (SLK), 113 TwwFilterDialog, 209
esoEmbedURL Exporting to HTML File, 113 fdUseActiveIndex,
TwwDBGrid ExportOptions property TwwFilterDialog, 211
ExportOptions, 113 TwwDBGrid, 111 fdUseAllIndexes,
esoSaveSelectedOnly ExportType property TwwFilterDialog, 210
TwwDBGrid TwwDBGrid Field Order,TwwFilterDialog,
ExportOptions, 112 ExportOptions, 111 206
esoShowAlternating Field property
TwwDBGrid F TwwInspectorItem, 75
ExportOptions, 113 FieldName method
esoShowFooter FastRecordScrolling property TwwDBGrid, 137
TwwDBGrid TwwDataInspector, 60 FieldOperators property
ExportOptions, 112 fctBitmap parameter, TwwFilterDialog, 209
esoShowHeader TwwDBGrid, 140 fields
TwwDBGrid fctCheckbox parameter, Display Attributes, 28
ExportOptions, 112 TwwDBGrid, 140 InfoPower Edit Control, 30
esoShowRecordNo fctCustom parameter, Fields
TwwDBGrid TwwDBGrid, 140 TwwFilterDialog, 206
ExportOptions, 112 fctField parameter, FieldSelection property
esoShowTitle TwwDBGrid, 140 TwwLocateDialog, 232
TwwDBGrid fctImageIndex parameter, FieldsFetchMethod property
ExportOptions, 112 TwwDBGrid, 140 TwwFilterDialog, 209
esoTransparentGrid fctRichEdit parameter, FieldValue property
TwwDBGrid TwwDBGrid, 141 TwwLocateDialog, 232
ExportOptions, 113 fdByFilter, TwwFilterDialog, FileName
Execute method 210 TwwHistoryList, 83
TwwDBRichEdit, 192 fdByQueryModify, FileName property
TwwFilterDialog, 219 TwwFilterDialog, 210 TwwDBGrid
TwwLocateDialog, 234 fdCaseSensitive, ExportOptions, 112
TwwLookupDialog, 240 TwwFilterDialog, 212 TwwDBGrid IniAttributes,
TwwMemoDialog, 246 fdClearWhenCloseDataSet, 116
TwwRecordViewDialog, TwwFilterDialog, 212 FilterActivate method
271 fdClearWhenNoCriteria, TwwTable, 295
TwwSearchDialog, 288 TwwFilterDialog, 212 FilterCount property
ExecuteDialog method fdDisableDateTimePicker, TwwTable, 291
TwwFilterDialog, 220 TwwFilterDialog, 213 FilterDialog. See
ExecuteFindDialog method fdFilterByRange, TwwFilterDialog
TwwDBRichEdit, 192 TwwFilterDialog, 208 FilterDialog property
ExecuteFontDialog method fdFilterByValue, TwwIntl, 226
TwwDBRichEdit, 192 TwwFilterDialog, 208 FilterMemoSize property
ExecuteParagraphDialog fdHidePartialAnywhere, TwwIntl, 226
method TwwFilterDialog, 213 FilterMethod property
TwwDBRichEdit, 192 fdNone, TwwFilterDialog, 210 TwwFilterDialog, 210
ExecuteQuery, fdShowCaseSensitive, FilterOptimization property
TwwFilterDialog, 220 TwwFilterDialog, 212 TwwFilterDialog, 210
ExecuteReplaceDialog method fdShowFieldOrder, FilterPropertyOptions
TwwDBRichEdit, 192 TwwFilterDialog, 212 TwwFilterDialog, 211
ExecuteTabDialog method fdShowNonMatching, FilterPropertyOptions property
TwwDBRichEdit, 192 TwwFilterDialog, 213 ADO suggested settings,
Expanded property fdShowOKCancel, 212
TwwExpandButton, 202 TwwFilterDialog, 212 Interbase suggested settings,
TwwInspectorItem, 75 212
320 Index
Filters footers GetPriorSibling method
TwwTable, 296 within a grid, 120, 136, 141 TwwInspectorItem, 78
Filters with wildcards FormPosition property GetRowByItem method
TwwTable, 296 TwwRecordViewDialog, TwwDataInspector, 68
FindFirst method 264 GetRTFText method
TwwLocateDialog, 235 frame controller, 50 TwwDBRichEdit, 193
FindNext method frame effects GlyphImages property
TwwLocateDialog, 235 key properties and events, TwwRadioGroup, 258
FindNextMatch method 22 GPFs, 299
TwwDBRichEdit, 192 recordviewdialog, 24 graphics in grids, 148
FindReplace method recordviewpanel, 24 grid column headings. See
TwwDBRichEdit, 193 supporting components, 22 TitleAlignment and
FindReplaceText method Frame properties, 22, 153 TitleColor properties
TwwDBRichEdit, 193 Frame property Grid property
FindValue method TwwCheckBox, 45 TwwDBLookupCombo,
TwwIncrementalSearch, TwwController, 50 153
224 TwwDBComboBox, 82 TwwExpandButton, 202
FirstDayOfWeek property TwwDBComboDlg, 91 Grid, See TwwDBGrid, 101
TwwDBDateTimePicker TwwDBDateTimePicker, GridColor property
CalendarAttributes, 94 96 TwwDBLookupComboDlg,
TwwDBMonthCalendar, TwwDBEdit, 99 162
170 TwwDBLookupCombo, TwwLookupDialog, 236
fixed columns 153 TwwSearchDialog, 283
TwwDBGrid, 147 TwwDBLookupComboDlg, GridIndents property
FixedColor property 162 TwwExpandButton, 202
TwwDBGrid, 125 TwwRadioButton, 255 GridOptions property
FixedCols property TwwRadioGroup, 258 TwwDBLookupComboDlg,
TwwDBGrid, 114 163
Flat property, 25 G TwwLookupDialog, 237
TwwDBNavigator, 175 TwwSearchDialog, 284
TwwNavButton, 174 GetActiveField method GridTitleAlignment property
FlushChanges method TwwDBGrid, 137 TwwDBLookupComboDlg,
TwwDBGrid, 137 GetComboDisplay method 163
fmUseSQL, TwwFilterDialog, TwwDBComboBox, 86 TwwLookupDialog, 237
210 GetComboValue method TwwSearchDialog, 284
fmUseTFields, TwwDBComboBox, 86 GroupFieldName property
TwwFilterDialog, 210 GetFirstChild method TwwDBGrid, 114
fmUseTTable, TwwDataInspector, 68 Grouping
TwwFilterDialog, 210 TwwInspectorItem, 77 TwwDBGrid, 101
FocusBorders property GetItemByCaption method GutterWidth property
EditFrame, 23 TwwDataInspector, 68 TwwDBRichEdit, 184
Frame, 23 GetItemByFieldName method
FocusStyle property TwwDataInspector, 68 H
EditFrame, 23 GetItemByRow method
Frame, 23 TwwDataInspector, 68 HaveVisibleItem method
Font property GetItemByTagString method TwwDataInspector, 68
TwwDBDateTimePicker TwwDataInspector, 68 Height property
CalendarAttributes, 94 GetLastChild method EditorPosition in
TwwMemoDialog, 244 TwwInspectorItem, 78 TwwDBRichEdit, 183
TwwRecordViewDialog, GetNext method TwwRecordViewDialog,
263 TwwInspectorItem, 78 264
TwwRecordViewPanel, 277 GetNextRecordText method Help, 20
Font style in dialogs, 226 TwwDBGrid, 138 How-To & Tips Sections,
FooterCellColor property GetNextSibling method 20
TwwDBGrid, 114 TwwInspectorItem, 78 Implementation & Coding
FooterColor property GetPrior method Examples, 20
TwwDBGrid, 114 TwwInspectorItem, 78 On-line help, 20
FooterHeight property GetPriorRecordText method Troubleshooting Section, 20
TwwDBGrid, 114 TwwDBGrid, 137 HideAllLines property
Troubleshooting 321
TwwDBGrid, 114 component hierarchy, 15 Interval property
HighlightColor property component overview, 15 Interval of
TwwDBRichEdit, 184 components. See TwwDBNavigator, 176
HistoryList property components Intl. See TwwIntl
TwwDBComboBox, 82 custom framing, 21 InvalidateCurrentRow method
HorizontalView property database architecture, 21 TwwDBGrid, 138
TwwRecordViewDialog, demonstration/sample InvalidateRow method
263 project, 15 TwwDataInspector, 68
TwwRecordViewPanel, 276 description, 5 IsSelected method
hot-tracking distribution requirements, TwwDBGrid, 138
TwwDBComboBox, 47 12 IsVisible method
HTMLBorderWidth property installing, 7 TwwNavButton, 177
TwwDBGrid on-line help. See on-line ItemHeight property
ExportOptions, 112 help TwwDBComboBox, 83
picture masks. See picture ItemIndex property
I masks TwwRadioGroup, 258
Picture Masks, 32 Items property
iioAutoDateTimePicker, programming, 19 TwwDataInspector, 56
TwwInspectorItem, 75 reference description, 43 TwwDBComboBox, 83, 88
iioAutoLookupCombo, source code, 20 TwwInspectorItem, 75
TwwInspectorItem, 75 transparency, 21 [Link]
ImageIndex property uninstalling, 12 , 76
TwwNavButton, 174 whats new, 21 TwwNavButtons, 174
ImageList property InfoPower 4000 TwwRadioGroup, 259
TwwDBGrid, 115 compatibility with
TwwDBLookupCombo, InfoPower 2000, 12 K
153 introduction, 3
TwwDBNavigator, 175 license agreement, 2 KeyOptions property
Images in a grid, 128 technical support, 3 TwwDBGrid, 118
images in grids, 148 IniAttributes property
Images property TwwDBGrid, 115 L
TwwCheckBox, 45 IniFileName property
TwwExpandButton, 202 TwwIntl, 226 LabelFont property
TwwRadioButton, 255 InitCombo method TwwRecordViewDialog,
TwwRadioGroup, 258 TwwKeyCombo, 230 264
Import method InitialDelay property TwwRecordViewPanel, 277
TwwDBRichEdit, 193 RepeatInterval of LabelIndent property
Increment property TwwDBNavigator, 176 TwwRecordViewDialog,
TwwDBSpinEdit, 197 InplaceEditor property 263
incremental search. See TwwDataInspector, 56 TwwRecordViewPanel, 276
TwwIncrementalSearch TwwDBGrid, 117 Layout property
Indents property Insert method TwwDBNavigator, 175
TwwCheckBox, 46 TwwInspectorCollection, ldoCaseSensitiveBelow,
TwwExpandButton, 202 72 TwwLocateDialog, 233
TwwRadioButton, 255 Insert Object Dialog ldoCloseOnMatch,
TwwRadioGroup, 258 for a TwwDBRichEdit, 187 TwwLocateDialog, 233
Index property TwwDBRichEdit, 183 Left margin
TwwNavButton, 174 installation, 7 TwwDBRichEdit, 188
IndicatorButton property requirements, 7 Left property
TwwDBGrid, 115 step-by-step, 8 EditorPosition in
IndicatorColor property Installation TwwDBRichEdit, 183
TwwDBGrid, 115 On-line Help TwwRecordViewDialog,
IndicatorIconColor property Delphi, 10 264
TwwDBGrid, 115 Tip, 10 LeftOffset property
IndicatorRow property international language support. TwwRecordViewDialog,
TwwDataInspector, 56 See TwwIntl 264
InfoPower Internet addresses in a rich edit, TwwRecordViewPanel, 277
building packages in Delphi 181, 191 Level property
5, 14 TwwInspectorItem, 75
322 Index
License Agreement, 2 LookupLinks property mdoDayState property
LikeSupportsUpperKeyword TwwStoredProc, 289 TwwDBMonthCalendar,
property, TwwFilterDialog, LookupSource property, 156 170
211 LookupTable property mdoMultiSelect property
LikeWildcardChar property, TwwDBLookupCombo, TwwDBMonthCalendar,
TwwFilterDialog, 211 154 170
LimitEditRect property TwwDBLookupComboDlg, mdoNoToday property
TwwDBComboBox, 84 163 TwwDBMonthCalendar,
TwwDBComboDlg, 91 TwwLookupDialog, 237 170
LineBreak property LookupValue property mdoNoTodayCircle property
TwwNavButton, 174 TwwDBLookupCombo, TwwDBMonthCalendar,
LineColors property 154 170
TwwDBGrid, 118 TwwDBLookupComboDlg, mdoWeekNumbers property
Lines property 163 TwwDBMonthCalendar,
TwwDBRichEdit, 184 170
TwwMemoDialog, 244 M MeasurementUnits property
LinesPerMemoControl TwwDBRichEdit, 184
property MapList property memo dialog, 243
TwwRecordViewDialog, TwwDBComboBox, 84 memo fields
264 [Link] TwwDBGrid, 118, 147
TwwRecordViewPanel, 277 , 76 view/edit in
LineStyle property Mapped values TwwMemoDialog, 243
TwwDBGrid, 118 TwwDBComboBox, 88 view/edit options, 245
LineStyleCaption property Mapping a combo-box list MemoAttributes property
TwwDataInspector, 57 TwwDBComboBox, 84 TwwDBGrid, 118
LineStyleData property Margin property TwwMemoDialog, 245
TwwDataInspector, 57 TwwNavButton, 174 Menu property
LoadAllRTF property TwwRecordViewDialog, TwwRecordViewDialog,
TwwDBGrid, 118 264 265
LoadFromFile method TwwRecordViewPanel, 277 mGridShow property
TwwInspectorCollection, masks. See picture masks TwwDBGrid, 118
71 master/detail grids, 143, 200 TwwMemoDialog, 245
LoadFromIniFile method MatchType property MinDate property
TwwDBGrid, 138 TwwLocateDialog, 233 TwwDBDateTimePicker,
LoadFromStream method MaxDate property 96
TwwInspectorCollection, TwwDBDateTimePicker, TwwDBMonthCalendar,
71 96 170
LocateDialog property TwwDBMonthCalendar, MinValue property
TwwIntl, 226 170 TwwDBSpinEdit, 198
lookup combo MaxHeight property modify labels and hints, 228
within a grid, 145 TwwDBLookupComboDlg, MouseCoord method
lookup table 163 TwwDBGrid, 138
TwwDBLookupComboDlg, TwwLookupDialog, 237 MouseEnterSameAsFocus
161 TwwSearchDialog, 284 property
TwwLookupDialog, 236 MaxSelectCount property Frame, 23
LookupCombos in a grid, 300 TwwDBMonthCalendar, MouseToCell method
LookupDisplay property 170 TwwDataInspector, 68
TwwDBLookupCombo, MaxSize MouseToItem method
156 TwwHistoryList, 83 TwwDataInspector, 69
lookupfield MaxValue property MoveBy property
within a grid, 145 TwwDBSpinEdit, 198 TwwDBNavigator, 175
LookupField property MaxWidth property Moving to a new cell in a grid,
TwwDBLookupCombo, TwwDBLookupComboDlg, 129
153 163 MRUEnabled
TwwDBLookupComboDlg, TwwLookupDialog, 237 TwwHistoryList, 83
163 TwwSearchDialog, 284 MRUMaxSize
LookupFields property mDisableDialog property TwwHistoryList, 83
TwwQBE, 249, 250 TwwDBGrid, 119 mSizable property
TwwStoredProc, 289 TwwMemoDialog, 245 TwwDBGrid, 118
Troubleshooting 323
TwwMemoDialog, 245 EditFrame, 23 TwwDBComboBox, 85
msoAutoUnselect, Frame, 23 OnAfterCollapse event
TwwDBGrid, 119 NonFocusColor property TwwExpandButton, 203
msoShiftSelect, TwwDBGrid, EditFrame, 23 OnAfterCreateControl event
119 Frame, 23 TwwRecordViewDialog,
MSWordSpellChecker method NonFocusFontColor property 269
TwwDBRichEdit, 194 EditFrame, 23 TwwRecordViewPanel, 279
multiple row record display, Frame, 23 OnAfterCreateDialog event
144 NonFocusStyle property TwwNavButton, 176
multiselect EditFrame, 23 OnAfterDrawCell event
with a Frame, 23 TwwDBGrid, 125
TwwDBLookupdialog, NonFocusTextOffsetX OnAfterExpand event
241 property TwwExpandButton, 203
Multi-Select EditFrame, 23 OnAfterSearch event
TwwDBMonthCalendar Frame, 23 TwwIncrementalSearch,
TwwDBMonthCalendar, NonFocusTextOffsetY 224
170 property OnAfterSelectCell event
Multi-selection in a grid EditFrame, 23 TwwDataInspector, 61
enabling, 146 Frame, 23 OnBeforeCollapse event
iterating through the NonFocusTransparentFontCol TwwExpandButton, 203
selected records, 146 or property OnBeforeCreateControl event
MultiSelectOptions property EditFrame, 23 TwwRecordViewDialog,
TwwDBGrid, 119 Frame, 23 269
mViewOnly property noUseInternationalText TwwRecordViewPanel, 280
TwwDBGrid, 119 property OnBeforeDrawCell event
TwwMemoDialog, 245 TwwDBNavigator, 175 TwwDBGrid, 125
mWordWrap property NullAndBlankState property OnBeforeExpand event
TwwDBGrid, 118 TwwCheckBox, 46 TwwExpandButton, 203
TwwMemoDialog, 245 NullChar property OnBeforePaint event
TwwFilterDialog, 209 background image, 61
N NumberColumns property Example, 61
PopupYearOptions, grid background image, 126
NarrowSearch property TwwDBMonthCalendar, Grid Example, 126
TwwTable, 292 171 TwwDataInspector, 61
NarrowSearchUpperChar NumGlyphs property TwwDBGrid, 126
property TwwNavButton, 174 OnBeforeSelectCell event
TwwTable, 292 TwwDataInspector, 62
NavButtons property O OnCalcBoldDay event
TwwNavButton, 175 TwwDBDateTimePicker,
Navigator property ofoCancelOnEscape property 97
TwwDBLookupCombo, TwwTable, 292 TwwDBMonthCalendar,
154 ofoEnabled property 171
TwwIntl, 226 TwwTable, 292 OnCalcCellColors event
TwwNavButton, 175 ofoShowHourGlass property TwwDBGrid, 127
TwwNavButtons, 173 TwwTable, 292 OnCalcDataPaintText event
TwwRecordViewDialog, OK buttons Example, 62
265 Setting the caption, 225 summary text of child items,
Navigator, database, 173 OKCancelBitmapped property 62
NavigatorButtons property TwwIntl, 227 TwwDataInspector, 62
TwwRecordViewDialog, OKCancelOptions property OnCalcTitleAttributes event
265 TwwRecordViewDialog, TwwDBGrid, 127
NavigatorFlat property 265 OnCalcTitleImage event
TwwRecordViewDialog, OLE TwwDBGrid, 128
265 TwwDBRichEdit, 183, 184 OnCancelWarning event
New Search Button, OLE Dialog TwwRecordViewDialog,
TwwFilterDialog, 206 TwwDBRichEdit, 187 270
noConfirmDelete property OnAcceptFilterRecord event OnCanCollapse event
TwwDBNavigator, 175 TwwFilterDialog, 216 TwwDataInspector, 62
NonFocusBorders property OnAddHistoryItem event OnCanExpand event
324 Index
TwwDataInspector, 63 TwwDataInspector, 66 TwwQBE, 251
OnCellChanged event OnDrawItem event TwwQuery, 254
TwwDBGrid, 129 TwwDBComboBox, 85 TwwStoredProc, 290
OnCheckValue event, 36 OnDrawTitleCell event TwwTable, 295
TwwDBEdit, 100 TwwDBGrid, 132 OnItemChanged event
TwwDBGrid, 129 OnDropDown event TwwDataInspector, 66
OnCloseDialog TwwDBComboBox, 85 TwwInspectorItem, 77
TwwDBLookupComboDlg, TwwDBLookupCombo, OnLeftColChanged event
165 157 TwwDBGrid, 133
TwwMemoDialog, 246 OnEditButtonClick event On-line help, 20
OnCloseDialog event TwwInspectorItem, 77 OnMemoClose event
TwwDBRichEdit, 189 OnEncodeDateTime event TwwDBGrid, 133
TwwLookupDialog, 240 TwwFilterDialog, 217 OnMemoOpen event
TwwRecordViewDialog, OnEncodeValue event TwwDBGrid, 133
270 TwwFilterDialog, 217 OnMenuLoadClick event
TwwSearchDialog, 287 OnExecuteSQL event TwwDBRichEdit, 189
OnCloseUp event TwwFilterDialog, 217 OnMenuPrintClick event
TwwDBComboBox, 85 OnExpanded event TwwDBRichEdit, 190
TwwDBLookupCombo, TwwDataInspector, 66 OnMenuSaveAndExitClick
157 OnExportField event event
OnCollapsed event TwwDBGrid, 133 TwwDBRichEdit, 190
TwwDataInspector, 63 OnFieldChanged event OnMenuSaveAsClick event
OnColumnMoved event TwwDBGrid, 133 TwwDBRichEdit, 190
TwwDBGrid, 130 OnFilter event OnMouseDown event
OnColWidthChanged event TwwQBE, 250 TwwDBGrid, 134
TwwDBGrid, 130 TwwQuery, 254 TwwDBMonthCalendar,
OnCreateDateTimePicker TwwStoredProc, 290 172
event TwwTable, 294 OnMouseEnter event
TwwDataInspector, 63 OnFilter events TwwCheckBox, 47
TwwDBGrid, 130 TwwClientDataset, 49 TwwDBEdit, 100
OnCreateDefaultCombo event OnFilterEscape event OnMouseLeave event
TwwDataInspector, 63 TwwQBE, 251 TwwCheckBox, 47
OnCreateDialog event TwwQuery, 254 TwwDBEdit, 100
TwwDBRichEdit, 189 TwwStoredProc, 290 OnMouseMove event
OnCreateHintWindow event TwwTable, 295 TwwDBGrid, 135
TwwDataInspector, 64 OnFilterOptions event TwwDBMonthCalendar,
TwwDBGrid, 130 TwwQBE, 250 172
OnCreateRadioButton event OnFilterOptions property OnMouseUp event
TwwRadioGroup, 260 TwwQuery, 253 TwwDBGrid, 135
OnCustomDlg event TwwStoredProc, 289 TwwDBMonthCalendar,
TwwDBComboDlg, 92 TwwTable, 292 172
OnDialogSummary event OnFilterPropertyOptions OnMultiSelectRecord event
TwwFilterDialog, 216 property TwwDBGrid, 135
OnDitto event TwwFilterDialog, 212 OnNotInList event
TwwDBGrid, 131 OnInitDialog event TwwDBLookupCombo,
OnDrawCaptionCell event TwwDBLookupComboDlg, 157
Example, 65 165 OnPerformCustomSearch
TwwDataInspector, 64 TwwDBRichEdit, 189 event
OnDrawDataCell event TwwFilterDialog, 217 TwwDBLookupCombo,
Example, 65, 66 TwwLocateDialog, 234 158
TwwDataInspector, 65, 69 TwwLookupDialog, 239 TwwDBLookupComboDlg,
TwwDBGrid, 131 TwwMemoDialog, 246 165
OnDrawFooterCell event TwwRecordViewDialog, TwwIncrementalSearch,
TwwDBGrid, 132 270 227
OnDrawGroupHeaderCell TwwSearchDialog, 286 TwwLookupDialog, 240
event OnInitTempDataSet event TwwSearchDialog, 287
TwwDBGrid, 132 TwwFilterDialog, 217
OnDrawIndicatorCell event OnInvalidValue event, 37 , 190
Example, 66 TwwClientDataSet, 49 OnPrintHeader event
Troubleshooting 325
TwwDBRichEdit, 190 opGroupControls property ovAllowInsert,
OnResize Event TwwDBLookupComboDlg, TwwDataInspector, 58
TwwDBNavigator, 176 163 ovColumnResize,
OnResizeDialog event TwwLookupDialog, 238 TwwDataInspector, 57
TwwRecordViewDialog, TwwSearchDialog, 238 ovEnterToTab,
270 opShowOKCancel property TwwDataInspector, 57
OnRowChanged event TwwDBLookupComboDlg, ovFillNonCellArea,
TwwDBGrid, 135 163 TwwDataInspector, 58
TwwNavButton, 176 TwwLookupDialog, 237 ovHideCaptionColumn,
OnSelectField event TwwSearchDialog, 237 TwwDataInspector, 58
TwwFilterDialog, 218 opShowSearchBy property ovHideVertDataLines,
OnSetControlEffects event, 24 TwwDBLookupComboDlg, TwwDataInspector, 57
TwwRecordViewDialog, 163 ovHideVertFixedLines,
271 TwwLookupDialog, 237 TwwDataInspector, 58
TwwRecordViewPanel, 280 TwwSearchDialog, 237 ovHighlightActiveRow,
OnSortChange event opShowStatusBar property TwwDataInspector, 57
TwwLookupDialog, 240 TwwDBLookupComboDlg, ovRowResize,
TwwSearchDialog, 287 164 TwwDataInspector, 57
OnSyncDataSets event TwwLookupDialog, 238 ovShowCaptionHints,
TwwSearchDialog, 287 TwwSearchDialog, 238 TwwDataInspector, 58
OnTitleButtonClick event Optimization in ovShowCellHints,
TwwDBGrid, 135 TwwFilterDialog, 210 TwwDataInspector, 58
OnTopLeftChanged event Options property ovShowTreeLines,
TwwDataInspector, 67 TwwDataInspector, 57 TwwDataInspector, 58
OnTopRowChanged event TwwDBDateTimePicker ovTabExits,
TwwDBGrid, 135 CalendarAttributes, 94 TwwDataInspector, 57
OnUpdateFooter event TwwDBGrid, 119 ovTabToVisibleOnly,
TwwDBGrid, 136 TwwDBGrid TwwDataInspector, 58
OnUpdateState event ExportOptions, 112
TwwNavButton, 176 [Link] P
OnURLOpen event s, 110
TwwDBGrid, 136 TwwDBLookupComboDlg, Pack method
TwwDBRichEdit, 181 163 TwwTable, 295
OnURLOpen, TwwDBMonthCalendar, PadColumnStyle property
TwwDBRichEdit, 191 170 TwwDBGrid, 121
OnUserButton1Click TwwDBNavigator, 175 PaintOptions property
TwwDBLookupComboDlg, TwwFilterDialog, 212, 213 TwwDataInspector, 58
166 TwwInspectorItem, 75 TwwDBGrid, 121
TwwLookupDialog, 240 TwwLocateDialog, 233 paperless forms, 21
TwwMemoDialog, 246 TwwLookupDialog, 237 ParentItem property
TwwSearchDialog, 287 TwwRecordViewDialog, TwwInspectorItem, 75
OnUserButton2Click 266 PerformSearch method
TwwDBLookupComboDlg, TwwRecordViewPanel, 277 TwwDBLookupCombo,
166 TwwSearchDialog, 237, 159
TwwLookupDialog, 240 284 PickList property
TwwMemoDialog, 246 OrChar property TwwInspectorItem, 76
TwwSearchDialog, 288 TwwFilterDialog, 209 picture masks, 32
OnValidationErrorUsingMask Order of fields creating picture masks, 33
event in a grid or record-view, 28 defining a property string,
custom validation error OrderByDisplay property 33
message, 67 TwwDBLookupCombo, dialogs
Example, 67 154 Design Picture Mask
TwwDataInspector, 67 TwwDBLookupComboDlg, dialog, 39
TwwIntl, 227 164 Select Picture Mask
opFixFirstColumn property OutputWidthInTwips dialog, 38
TwwDBLookupComboDlg, TwwDBGrid editing, 35
164 ExportOptions, 113 events, 35
TwwLookupDialog, 238 ovActiveRecord3DLines, examples, 34
TwwSearchDialog, 238 TwwDataInspector, 58 properties, 35
326 Index
removing, 40 Print method TwwDBRichEdit, 183
special characters, 33 TwwDBRichEdit, 194 reoShowInsertObject property
supporting components, 22, PrintFooter property TwwDBRichEdit, 183
32 TwwDBRichEdit, 185 reoShowJustifyButton property
usage, 32 PrintHeader property TwwDBRichEdit, 183
Picture property TwwDBRichEdit, 185 reoShowLoad property
AllowInvalidExit, 35 PrintJobName, TwwDBRichEdit, 182
AutoFill, 35 TwwDBRichEdit, 188 reoShowMainMenuIcons
PictureMask, 35 PrintMargins property property
TwwDBEdit, 99 TwwDBRichEdit, 188 TwwDBRichEdit, 183
TwwDBLookupCombo, PrintPageSize property reoShowPageSetup property
154 TwwDBRichEdit, 185 TwwDBRichEdit, 182
TwwInspectorItem, 76 programming InfoPower, 19 reoShowPrint property
PictureMask property TwwDBRichEdit, 182
TwwIncrementalSearch, Q reoShowRuler property
223 TwwDBRichEdit, 183
PictureMaskAutoFill property QBE. See TwwQBE reoShowSaveAs property
TwwIncrementalSearch, QBE property TwwDBRichEdit, 182
223 TwwQBE, 250 reoShowSaveExit property
PictureMaskFromDataset queries TwwDBRichEdit, 182
property QBE, 248 reoShowSpellCheck property
TwwLookupDialog, 238 SQL, 253 TwwDBRichEdit, 183
PictureMaskFromDataSet Query By Example (QBE). See reoShowStatusBar property
property TwwQBE TwwDBRichEdit, 183
TwwDataInspector, 60 Query property reoShowToolBar property
TwwDBGrid, 122 TwwTable, 293 TwwDBRichEdit, 182
TwwRecordViewDialog, Quicken style search reoUseBackColor property
267 TwwDBLookupCombo, TwwDBRichEdit, 183
TwwRecordViewPanel, 278 156 RepeatInterval property
TwwSearchDialog, 284 TwwDBNavigator, 176
PictureMaskFromField R requirements, 7
property Resizable property
TwwIncrementalSearch, ReadOnly property TwwInspectorItem, 76
223 TwwCheckBox, 46 ReturnWhereClause,
TwwLookupDialog, 238 TwwInspectorItem, 76 TwwFilterDialog, 220
TwwSearchDialog, 284 ReadOnlyColor property Rich Edit Control, 179
PictureMasks property, 35 TwwRecordViewDialog, RichEdit property
TwwClientDataSet, 48 267 TwwIntl, 227
TwwDBGrid, 122 TwwRecordViewPanel, 278 Right margin
TwwLookupDialog, 238 Record view dialog, 261 TwwDBRichEdit, 188
TwwQBE, 250 Record view panel, 275 RightOffset property
TwwQuery, 253 RefreshLinks method TwwRecordViewDialog,
TwwRecordViewDialog, TwwTable, 295 264
267 RegistrationNo property TwwRecordViewPanel, 277
TwwRecordViewPanel, 278 TwwIntl, 227 Rounding property
TwwSearchDialog, 285 removing picture masks, 40 TwwFilterDialog, 213
TwwStoredProc, 289 reoAdjustPopupMenu property RoundingMethod property,
TwwTable, 293 TwwDBRichEdit, 184 TwwFilterDialog, 213
PopupMenu property reoCloseOnEscape property RowHeightPercent property
TwwDBRichEdit, 186 TwwDBRichEdit, 183 TwwDBGrid, 122
PopupOptions property reoDisableOLE property rpoPopopUnderline property
TwwDBRichEdit, 186 TwwDBRichEdit, 185 TwwDBRichEdit, 187
PopupYearOptions property reoFlatButtons property rpoPopupBold property
TwwDBDateTimePicker TwwDBRichEdit, 183 TwwDBRichEdit, 187
CalendarAttributes, 94 reoNoConfirmation property rpoPopupBullet property
TwwDBMonthCalendar, TwwDBRichEdit, 183 TwwDBRichEdit, 187
171 reoShowFormatBar property rpoPopupCopy property
PrimaryKeyName property TwwDBRichEdit, 182 TwwDBRichEdit, 187
TwwKeyCombo, 230 reoShowHints property rpoPopupCut property
Troubleshooting 327
TwwDBRichEdit, 187 rvokAutoPostRect property against field, 231
rpoPopupEdit property TwwRecordViewDialog, against index. See
TwwDBRichEdit, 187 265 TwwSearchDialog. See
rpoPopupFind property rvokShowOKCancel property TwwIncrementalSearch
TwwDBRichEdit, 187 TwwRecordViewDialog, SearchDelay property
rpoPopupFont property 265 TwwDBLookupCombo,
TwwDBRichEdit, 187 rvoLabelsBeneathControl 155
rpoPopupInsertObject property TwwRecordViewDialog, TwwIncrementalSearrch,
TwwDBRichEdit, 187 267 223
rpoPopupItalic property rvoLabelsBeneathControl SearchDialog property
TwwDBRichEdit, 187 property TwwIntl, 227
rpoPopupMSWordSpellCheck TwwRecordViewDialog, SearchField property
property 278 TwwDBLookupCombo,
TwwDBRichEdit, 187 rvoMaximizeMemoWidth 155
rpoPopupParagraph property property TwwIncrementalSearrch,
TwwDBRichEdit, 187 TwwRecordViewDialog, 223
rpoPopupPaste property 267 TwwLocateDialog, 233
TwwDBRichEdit, 187 TwwRecordViewPanel, 278 SearchTable property
rpoPopupReplace property rvoModalForm property TwwSearchDialog, 285
TwwDBRichEdit, 187 TwwRecordViewDialog, Section
rpoPopupTabs property 266 TwwHistoryList, 83
TwwDBRichEdit, 187 rvoShortenEditBox property SectionName property
rvcTransparentButtons TwwRecordViewDialog, TwwDBGrid IniAttributes,
property 266 116
TwwRecordViewDialog, TwwRecordViewPanel, 278 Select Fields dialog box, 25
262 rvoStayOnTopForm property Adding Fields, 26
TwwRecordViewPanel, 276 TwwRecordViewDialog, Display Attributes, 28
rvcTransparentLabels property 266 Edit Control, 30
TwwRecordViewDialog, rvoUseCustomControls Select Fields Dialog Box
262 property Removing Fields, 28
TwwRecordViewPanel, 276 TwwRecordViewDialog, Select Picture Mask dialog, 38
rvoCloseIsCancel property 266 SelectAll method
TwwRecordViewDialog, TwwRecordViewPanel, 278 TwwDBGrid, 139
266 rvoUseDateTimePicker Selected property
rvoConfirmCancel property TwwRecordViewDialog, TwwDBGrid, 122
TwwRecordViewDialog, 267 TwwDBLookupCombo,
266 rvoUseDateTimePicker 155
rvoConsistentEditWidth property TwwLookupDialog, 238
property TwwRecordViewPanel, 278 TwwRecordViewDialog,
TwwRecordViewDialog, 267
266 S TwwRecordViewPanel, 279
TwwRecordViewPanel, 278 TwwSearchDialog, 285
rvoEnterToTab property SaveToFile method SelectedFields property
TwwRecordViewDialog, TwwInspectorCollection, TwwFilterDialog, 214
266 72 SelectedList property
rvoHideCalculated property SaveToIniFile method TwwDBGrid, 123
TwwRecordViewDialog, TwwDBGrid, 139 selecting table index. See
266 SaveToRegistry property TwwKeyCombo
TwwRecordViewPanel, 278 TwwDBGrid IniAttributes, SelectRecord method
rvoHideNavigator property 116 TwwDBGrid, 139
TwwRecordViewDialog, SaveToStream method SeqSearchOption property
266 TwwInspectorCollection, TwwDBLookupComboDlg,
rvoHideReadOnly property 72 164
TwwRecordViewDialog, Saving Grid info to ini file, 116 SeqSearchOptions property
266 Saving Grid info to system TwwDBLookupCombo,
TwwRecordViewPanel, 277 registry, 116 155
rvokAutoCancelRec property scroll back to prior records, Set # fixed columns, 147
TwwRecordViewDialog, 299 SetActiveField method
265 search TwwDBGrid, 139
328 Index
SetActiveRow method PopupYearOptions, ssoEnabled property,
TwwDBGrid, 139 TwwDBMonthCalendar, TwwDBLookupCombo,
SetBold method 171 155
TwwDBRichEdit, 194 ShowFocusRect property StartDate property
SetBullet method TwwCheckBox, 46 TwwDBMonthCalendar,
TwwDBRichEdit, 194 TwwExpandButton, 203 171
SetControlType TwwRadioButton, 256 StartYear property
fctBitmap, 140 TwwRadioGroup, 259 PopupYearOptions,
fctCheckbox, 140 ShowGroupCaption property TwwDBMonthCalendar,
fctCustom, 140 TwwRadioGroup, 259 171
fctField, 140 ShowHorzScrollBar property State property
fctImageIndex, 140 TwwDBGrid, 123 TwwCheckBox, 46
fctRichEdit, 141 ShowMatchText property, 156 StorageType
SetControlType method TwwDBComboBox, 84 TwwHistoryList, 83
TwwDBGrid, 139 TwwDBLookupComboDlg, stored procedures, 289
SetDataSourceFromComponen 164 Stored values
t method TwwIncrementalSearch, TwwDBComboBox, 88
TwwDBNavigator, 177 223 Style
SetFocusTabStyle property [Link] TwwDBComboBox, 89
TwwDataInspector, 60 , 76 Style property
SetItalic method ShowMessages property TwwDBComboBox, 84
TwwDBRichEdit, 194 TwwLocateDialog, 233 TwwDBComboDlg, 91
SetLookupField method ShowText property [Link]
TwwQuery, 254 TwwCheckBox, 46 , 76
TwwTable, 296 TwwExpandButton, 203 TwwNavButton, 174
SetParam method TwwNavButton, 174 TwwRecordViewDialog,
TwwQBE, 251 TwwRadioGroup, 259 268
SetPictureAutoFill method ShowVertScrollBar property TwwRecordViewPanel, 279
TwwDBGrid, 141 TwwDBEdit, 99 SyncSQLByRange property
SetPictureMask method TwwDBGrid, 123 TwwTable, 293
TwwDBGrid, 141 SizeLastColumn method
setting line colors TwwDBGrid, 141 T
TwwDBGrid, 118 SortBy property
SetUnderline method TwwFilterDialog, 214 table lookups
TwwDBRichEdit, 194 Sorted property TwwDBLookupCombo,
ShadowSearchTable property TwwDBComboBox, 84 151
TwwSearchDialog, 285 SortFields property TwwDBLookupComboDlg,
ShortCutDittoField property TwwLocateDialog, 233 161
[Link] SortSelectedList method TwwLookupDialog, 236
s, 109 TwwDBGrid, 141 TabStop property
ShortCutDittoRecord property source code. See InfoPower TwwInspectorItem, 76
[Link] source code Tag property
s, 110 Spacing property TwwInspectorItem, 76
ShowAllIndexes property TwwNavButton, 174 TwwLocateDialog, 233
TwwKeyCombo, 230 SQL Tables, 299 TwwLookupDialog, 238
ShowAsButton property Backward scrolling, 299 TwwMemoDialog, 245
TwwExpandButton, 203 Navigating, 299 TwwSearchDialog, 285
ShowBorder property Performance, 299 TagString property
TwwRadioGroup, 259 TwwDBGrid, 300 TwwInspectorItem, 76
ShowButton property SQLPropertyName property Technical Support, 3
TwwDBComboBox, 84 TwwFilterDialog, 215 Text property
TwwDBComboDlg, 91 SQLTables property TwwDBLookupCombo,
TwwDBDateTimePicker, TwwFilterDialog, 215 156
96 SQLUpperString property TwwIncrementalSearch,
TwwDBLookupCombo, TwwFilterDialog, 215 224
156 ssoCaseSensitive property, Themes, 41
TwwDBLookupComboDlg, TwwDBLookupCombo, Time property
164 156
ShowEditYear property
Troubleshooting 329
TwwDBDateTimePicker, add a background, 69 TwwDBComboBox, 5, 80
96 added events, 61 added events, 85
TwwDBMonthCalendar, added methods, 67 added methods, 86
171 added properties, 54 added properties, 81
TitleAlignment property adding dropdown items, 69 history lists, 82
TwwDBGrid, 124 adding rows at runtime, 71 how to, 87
TitleButtons property alternate row painting persistent items, 82
TwwDBGrid, 124 sections, 59 two column display, 88
TitleColor property architecture, 52 TwwDBComboDlg, 5, 90
TwwDBGrid, 124 background image, 61 added events, 92
TitleImageList property changing expand/collapse added properties, 90
TwwDBGrid, 124 glyphs, 69 TwwDBDateTimePicker, 5, 93
TitleLines property custom drawing in caption added events, 97
TwwDBGrid, 124 cell, 65 added properties, 94
TitleName custom drawing in data cell, TwwDBEdit, 5, 98
TwwDBGrid 65, 69 added events, 100
ExportOptions, 113 custom drawing in indicator added methods, 100
Top margin cells, 66 added properties, 99
TwwDBRichEdit, 188 Customizing backgrounds TwwDBGrid, 5, 101
Top property and colors, 58 added events, 125
EditorPosition in customizing rows, 53 added methods, 136
TwwDBRichEdit, 184 customizing validation error added properties, 108
TwwRecordViewDialog, message, 67 assigning to a new dataset,
264 design-time 300
TopOffset property adding a new item, 53 Auto-resizing of column,
TwwRecordViewDialog, adding a new sub-item, 149
264 53 changing title attributes,
TwwRecordViewPanel, 277 adding fields, 54 127
transparency deleting an item, 53 coloring alternating rows,
supporting components, 22 moving an item down, 147
Transparent property, 25 54 coloring an entire row, 127
EditFrame, 24 moving an item up, 54 Coloring the data cells, 127
Frame, 24 design-time aid, 53 column order, 28
TwwDBNavigator, 176 displaying a checkbox, 70, deciding which fields to
TwwRadioGroup, 259 76 export, 133
TransparentActiveItem embedding 3rd Party deleting multiple selected
property controls, 69 records, 123
TwwRadioGroup, 259 hide caption column, 69 detect moving to different
TreeLineColor property highlighting data cell record, 135
TwwDataInspector, 61 example, 65 detecting a column drag,
TwoColumnDisplay property highlighting data font 130
TwwDBComboBox, 85, 88 example, 66 detecting a column resize,
TwwCheckBox, 5, 44 how to, 69 130
added events, 47 items, 53 detecting a modified field,
added properties, 44 iterating through items, 69, 133
description, 44 78 detecting cell movement,
how to, 47 manipulating items at 129
screenshot, 44 runtime, 71 detecting horizontal
TwwClientDataset, 48 performance issues, 60 scrolling, 133
added events, 49 row properties and methods, Detecting row change, 149
added methods, 49 73 detecting user multi-select,
added properties, 48 screenshot, 52 135
TwwClientDataSet, 5 selecting embedded detecting vertical scrolling,
TwwController, 22, 50 controls, 53, 74 135
added methods, 50 setting active row, 69 Displaying images in grids,
added properties, 50 summarizing text of child 148
TwwCustomDrawGridCellInfo items, 62 displaying images in the
TwwDBGrid, 125 , 51 title, 128
TwwDataInspector, 5, 51 TwwDataSource, 5, 79
330 Index
displaying TGraphic fields, events, 171 added events, 227
148 how to, 172 added properties, 225
edit lookupfields in the grid, selecting a range of dates, how to, 228
145 172 modify labels and hints, 228
editing memos, 149 TwwDBNavigator, 5, 173 TwwKeyCombo, 6, 229
Enter to Tab, 147 added events, 176 added methods, 230
expandable composite added methods, 177 added properties, 229
fields, 143 added properties, 173 case insensitive, 230
How To, 141 how to, 177 display indexes, 301
indicatorbutton, 145 TwwDBRichEdit, 5, 179 drop-down list
integrating the record-view, added events, 189 keyboard shortcut, 230
146 added methods, 191 properties
keyboard shortcuts added properties, 181 PrimaryKeyName, 230
disabling, 147 adding own code to main TwwLocateDialog, 6, 231
master/detail grids, 143 menu, 195 added events, 234
multiple grids on one appending text in popup added methods, 234
dataset, 149 editor, 196 added properties, 232
multirow record display, binding to a database field, how to, 235
144 195 search field, 235
painting a data cell, 131 displaying pop-up editor TwwLookupDialog, 6, 236
painting a footer cell, 132 with button, 195 access lookup tables, 242
Saving to ini file, 116 embedding richedit text in added events, 239
Saving to system registry, grid, 196 added methods, 240
116 forcing wordwrap to adjust added properties, 236
setting options at runtime, to printer, 196 how to, 240
121 how to, 195 lookup and fill, 240
Tips, 149 storing RichText at design multiselect use, 241
TwwDBLookupCombo, 5, 151 time, 195 OK or Cancel, 302
added events, 157 TwwDBSpinEdit, 5, 197 TwwMemoDialog, 6, 243
added methods, 159 added properties, 197 added events, 246
added properties, 152 TwwExpandButton, 6, 200 added methods, 246
default LookupTable index added events, 203 added properties, 243
overriding, 160 added properties, 201 adding buttons, 247
defining attributes, 160 TwwFilterDialog, 6, 205 adding timestamps to
drop-down list added events, 216, 219 memos, 247
keyboard shortcut, 160 added properties, 208 background color, 247
fill drop-down list from end-user resizing, 221 buttons, 247
QBE, 160 how to, 204, 220 how to, 247
Query, 160 loading and saving filters, OnInitDialog event, 247
how to, 159 221 position, 247
multiple unique display labels, 221 size, 247
TwwDBLookupCombos Using wwSearchDialog using buttons, 247
, 160 with wwFilterDialog, TwwNavButtons,
no data in drop-down lists, 220 TwwDBNavigator, 173
300 TwwIncrementalSearch, 6, 222 TwwQBE, 6, 248
selecting fields, 160 added events, 224 added events, 250
unable to scroll backwards, added methods, 224 added methods, 251
300 added properties, 222 added properties, 248
update other fields, 159 can't find value, 301 heterogeneous QBEs, 252
TwwDBLookupComboDlg, 5, case-insensitive, 224 how to, 251
161 TwwInspectorCollection, 71 multiple alias QBEs, 252
added events, 165 added methods, 71 parameters, 252
added properties, 162 added properties, 71 TwwQuery, 6, 253
wwidlg, 165 adding rows at runtime, 71 added events, 254
TwwDBMonthCalendar, 5, TwwInspectorItem, 73 added methods, 254
168 added events, 77 added properties, 253
added properties, 169 added methods, 77 how to, 254
displaying more than one added properties, 73 TwwRadioButton, 255
month, 172 TwwIntl, 6, 225 added properties, 255
Troubleshooting 331
TwwRadioGroup, 6, 257 search text, 302 TwwIntl, 227
added events, 260 SQL tables, 288 UseLocateWhenFindingValue
added properties, 258 SQLSyncByRange property
description, 257 property, 288 TwwIntl, 225
how to, 260 Using ADOTables, 288 UsePictureMask property, 36
make radio group Using with non-TTable, TwwDBEdit, 99
transparent, 260 287, 288 User button in dialog
screenshot, 257 TwwStoredProc, 6, 289 closing the dialog, 302
setting items at runtime, added events, 290 UserButton1Caption property
260 added methods, 290 TwwDBLookupComboDlg,
special features, 257 added properties, 289 164
TwwRecordViewDialog, 6, how to, 290 TwwLookupDialog, 239
261 TwwTable, 6, 291 TwwMemoDialog, 245
added events, 269 added events, 294 TwwSearchDialog, 286
added methods, 271 added methods, 295 UserButton2Caption property
added properties, 262 added properties, 291 TwwDBLookupComboDlg,
Attaching your own custom field properties, 297 164
menu, 273 GotoCurrent, 303 TwwLookupDialog, 239
Controlling onClose how to, 296 TwwMemoDialog, 245
behavior, 273 pack, 303 TwwSearchDialog, 286
Creating accelerators for the record display order, 297 UserMessages property
controls, 272 selecting fields, 297 TwwIntl, 227
Customize spacing between user selection of table index. UserSpeedButton1,
controls, 273 See TwwKeyCombo TwwDBRichEdit, 188
Customizing selection and UserSpeedButton2,
order of fields, 271 U TwwDBRichEdit, 189
Defining picture masks for UseTFields property
fields, 274 UnboundDataType property TwwDBGrid, 123, 125, 149
Embedding custom controls, TwwDBComboBox, 99 TwwDBLookupCombo,
272 TwwDBDateTimePicker, 156
how to, 271 96 TwwDBLookupComboDlg,
Integrating with the grid, TwwDBEdit, 99 164
272 TwwDBSpinEdit, 99, 198 TwwLookupDialog, 239
Testing layout at design underline controls, 21 TwwSearchDialog, 286
time, 272 uninstalling InfoPower, 12 using InfoPower picture masks,
TwwRecordViewPanel, 275 UnselectAll method 32
added events, 279 TwwDBGrid, 141 using multiple grids on one
added properties, 275 Unselecting all records in a dataset, 149
Creating accelerators for the grid, 146 using the Design Picture Mask
controls, 280 UnselectRecord method dialog, 39
Customize spacing between TwwDBGrid, 141 using the Select Picture Mask
controls, 281 UpdateRecord method dialog, 38
Customizing selection and TwwDBEdit, 100
order of fields, 280 Updating other fields V
Embedding custom controls, TwwDBLookupCombo,
280 147 ValidateWithMask event
field order, 28 UpperRangePadChar property TwwStoredProc, 290
how to, 280 TwwFilterDialog, 215 ValidateWithMask property
TwwRTFHeaderFooter URL Detection in rich edit, TwwClientDataSet, 48
TwwDBRichEdit, 185 181, 191 TwwQuery, 254
TwwSearchDialog, 6, 282 UseBracketsAroundFields TwwTable, 293
added events, 286 property, TwwFilterDialog, Value property
added methods, 288 211 TwwDBComboBox, 85
added properties, 283 UseLikeOperator property, TwwDBSpinEdit, 198
Adding functionality, 288 TwwFilterDialog, 211 TwwRadioGroup, 259
case-insensitive, 288 UseLocateMethod property ValueChecked property
how to, 288 TwwLocateDialog, 234 TwwCheckBox, 46
OK or Cancel, 302 UseLocateMethodForSearch TwwRadioButton, 256
require datasource, 301 property Values property
332 Index
TwwRadioGroup, 259 TwwDBEdit, 100 wwFilter property
ValueUnchecked property Whats new in InfoPower, 21 TwwTable, 293
TwwCheckBox, 47 Width property wwFilterField
TwwRadioButton, 256 EditorPosition in TwwClientDataset, 49
VersionInfoPower property TwwDBRichEdit, 184 wwFilterField method
TwwIntl, 227 TwwRecordViewDialog, TwwQBE, 251
VerticalView property 264 TwwQuery, 254
TwwRecordViewDialog, Word-wrap TwwStoredProc, 290
263 TwwDBGrid, 147 TwwTable, 296
TwwRecordViewPanel, 276 WordWrap property wwFindKey method
view order. See TwwDBEdit, 100 TwwTable, 296
TwwKeyCombo TwwInspectorItem, 77 wwidlg, 165
View Summary Button word-wrapping in grids, 147
TwwFilterDialog, 206 wwDittoNext Y
Visible property [Link]
TwwInspectorItem, 77 s, 109 Year 2000 compliance
VisibleItemsOnly parameter wwDittoPrior TwwDBDateTimePicker,
TwwInspectorItem, 77 [Link] 93, 95
s, 109 YearsPerColumn property
W wwDittoPriorOrNext PopupYearOptions,
[Link] TwwDBMonthCalendar,
WantReturns property s, 109 171
Troubleshooting 333
The TwwDBComboBox control's appearance can be modified using several properties. The ButtonStyle property defines the icon style (cbsEllipsis, cbsDownArrow, and cbsCustom), with an option to set a custom bitmap via the ButtonGlyph property . ButtonWidth controls the icon's width, defaulting to automatic sizing unless a specific value is provided . Other properties like DisableThemes and DropDownWidth manage theme appearance and dropdown dimension adjustments . These properties collectively enable a customized visual representation of the TwwDBComboBox control.
The OnInitDialog event in InfoPower is used to customize every aspect of the dialog box during its initialization. By using this event, developers can modify properties, define custom events, and perform specific actions before the dialog is displayed on the screen. To utilize the OnInitDialog event, the source file must reference the appropriate dialog unit, such as wwidlg, to access all components within the dialog. For example, the event can be used to modify the grid's properties or set initial positions of dialog elements .
The purpose of the GetFirstChild method in the TwwDataInspector class is to retrieve the first child item of the inspector. This method can be configured to only return items that are visible, by default, it excludes items whose Visible property is false . It functions by returning a TwwInspectorItem, which is the first visible child item if VisibleItemsOnly is set to true, otherwise it will include all items regardless of their visibility.
The OnPerformCustomSearch event in InfoPower plays a critical role in optimizing lookups for large datasets by enabling developers to control the specific actions executed when a search is performed. This customization allows the query to be updated to return only the desired records, thus improving performance when dealing with large datasets from a remote server. By handling this event, developers can ensure that only relevant records are fetched, reducing the load and increasing efficiency .
The OnCloseDialog event in InfoPower is used to perform custom actions right before a dialog is closed. This allows developers to implement specific behavior or cleanup operations before the dialog actually closes, facilitating more controlled and customized dialog management. By using this event, developers have the opportunity to execute necessary operations such as saving state, releasing resources, or logging actions, ensuring that all needed procedures are completed prior to dialog termination .
AutoDropDown automatically opens the drop-down list when the user starts typing in the control, allowing for a more efficient user experience by not requiring a separate action to display the list . DropDownWidth allows you to specify a custom width for the drop-down list portion of a combo box, which can be useful when you need to display more extensive data entries than what the default width allows . These properties provide flexibility in user interface design by enhancing the user interaction with dropdown components .
TwwDataInspector allows customization of painting for data and caption cells through specific event handlers. The OnDrawDataCell event is used for customizing data cells. This event involves parameters such as Sender, ObjItem, ASelected, ACellRect, and DefaultDrawing. Setting DefaultDrawing to False prevents default painting. For instance, a data cell containing 'State' with the value 'CA' can be painted with a yellow background . For caption cells, the OnDrawCaptionCell event handles customization, with parameters like Sender, ObjItem, ASelected, ACellRect, ACaptionRect, and DefaultTextDrawing. An example includes painting an image to the left of a caption when the caption is 'RichEdit' . Both events provide flexibility to modify the appearance based on various conditions.
TwwDataInspector provides methods such as BeginUpdate and EndUpdate to manage painting operations and improve performance during lengthy operations. BeginUpdate is used to suspend painting operations, whereas EndUpdate resumes painting operations, with an option to repaint the entire tree inspector by setting the Repaint parameter to true . Additionally, methods like GetFirstChild and GetItemByFieldName help in data management by retrieving first child items and items by field names . These methods allow efficient operation management and performance enhancement.
TwwRecordViewDialog allows extensive customization of its fields and controls. Developers can modify the selection and order of fields using the Select Fields Dialog, which enables visibility and order customization and supports line breaks with style=rvsHorizontal . Additionally, the OnSetControlEffects event provides control over individual field edit frames, enabling modifications specific to field types, such as adding borders for TBlobField-tied edit controls . Such flexibility in customization facilitates a tailored view for end-users, accommodating specific application requirements.
The OnCalcCellColors event enhances visual distinction between grid cells in InfoPower by allowing developers to customize both the font and background colors of individual cells. This event executes just before the grid cell is painted, enabling continuous color support for an unlimited palette beyond the basic Windows colors. For example, the font color can change to red and the background to yellow for specific cell values, such as when a field has a certain value . This capability greatly enhances readability and visual differentiation, making it easier for users to quickly identify and understand grid data .