
__________________________________________________________________________
Table 10. 31
Member function Description
TComboBox member
____________________________________________________________________
functions for querying
GetT xtLen
Get length of text in edit area.
e
combo boxes
GetT xt
Retrieve all text in edit area.
e
GetEditSel
Get indexes of selected text in edit area.
GetDroppedControlRect
Get rectangle of dropped-down list.
GetDroppedState
Determine if list area is visible.
GetExtendedUI
Determine if combo box has extended UI.
____________________________________________________________________
Setting and reading control values
T manage complex dialog boxes or windows with many child-windowo
controls, you might create a derived class to store and retrieve the state of
the dialog box or window controls. The state of a control includes the text
of an edit control, the position of a scroll bar and whether a radio button is,
checked.
As an alternative to creating a derived class, you can use a structure to
Using transfer
represent the state of the dialog box’ or window’ controls. This structure iss s
buffers
called a transfer buffer because control states are transferred to the buffer
from the controls and to the controls from the buffer.
For example, your application can bring up a modal dialog box and, after
the user closes it, extract information from the transfer buffer about the
state of each control. Then, if the user brings up the dialog box again, you
can transfer the control states from the transfer buffer In addition, you can.
set the initial state of each control based on the transfer buffer Y u can also. o
explicitly transfer data in either direction at any time, such as to reset the
states of the controls to their previous values. A window or modeless
dialog box with controls can also use the transfer mechanism to set or
retrieve state information at any time.
Associating control
The transfer mechanism requires the use of ObjectWindows objects to
objects with control
represent the controls for which you’d like to transfer data. T use theo
interface elements is
transfer mechanism, you have to do three things:
described in
Chapter 8.
■ Define the transfer buffer with an instance variable for each control for,
which you want to transfer data.
■ Define the corresponding window or dialog box.
■ Transfer the data.
246
OWL P ogrammer’ Guider s