Taxonomy Categories:
Member Functions:
Interface Category:
API.
Inherits From:
TView, MControl
Inherited By:
None.
Purpose:
TDropDownTextControl provides management control for the Drop Down text entry screen. This screen is composed of a toggle button, a text entry field, and a scrolling list. Text information can be entered by either selecting from the items in the predefined entry list, or by typing text into the entry field. TDropDownTextControl provides the API to control the text field, the drop-down list, and the toggle button. This API allows the developer to change the behavior and the look of the control screen. It also provides functions for handling specific actions generated by individual controls.
Instantiation:
Allocate on the heap or the stack.
Deriving Classes:
You should not derive from this class since it is composed of three specific controls.
Concurrency:
Multithread safe.
Resource Use:
No special requirements.
Other Considerations:
None.
- TDropDownTextControl ()
- TDropDownTextControl (MDropDownListControlState * stateToAdopt)
- TDropDownTextControl (TSequenceOf < TText > * listToAdopt, unsigned long selectedIndex =TDropDownTextControl :: kInvalidIndex)
- TDropDownTextControl (const TDropDownTextControl & copy)
Interface Category:
API.
Purpose:
- Default constructor.
- Creates a new TDropDownTextControl object using the pointer to the abstract control state for the drop-down list entries.
- Creates a new TDropDownTextControl object using the specified list of drop-down list entries.
- Copy constructor.
Calling Context:
- Called by the stream-in operators and derived classes.
- Called to create a new drop-down text control screen from a given list control state.
- Called to create a new drop-down text control screen using the list of text entries.
- Called to copy an object.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual ~ TDropDownTextControl ()
Interface Category:
API.
Purpose:
Destructor.
Calling Context:
Called to destroy an object.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
TDropDownTextControl & operator =(const TDropDownTextControl &)
Interface Category:
API.
Purpose:
Assignment operator.
Calling Context:
Called when an object is assigned to another compatible object.
Parameters:
Return Value:
A non-const reference to the left-hand side object.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual TStream & operator >>=(TStream &) const
Interface Category:
API.
Purpose:
Stream-out operator.
Calling Context:
Called to stream out data.
Parameters:
- TStream & -The stream the object streams itself out to.
Return Value:
Returns a reference to the stream the object streams itself out to.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual TStream & operator <<= (TStream &)
Interface Category:
API.
Purpose:
Stream-in operator.
Calling Context:
Called to stream in data.
Parameters:
- TStream & -The stream the object streams itself in from.
Return Value:
Returns a reference to the stream the object streams itself in from.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual void AdoptState (MDropDownListControlState * stateToAdopt)
Interface Category:
API.
Purpose:
Adopts the referenced list control state and incorporates its items into the drop-down list display.
Calling Context:
Call this function directly.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual MDropDownListControlState * OrphanState ()
Interface Category:
API.
Purpose:
Releases and frees a previously adopted list control state.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns a pointer to the orphaned MDropDownListControlState object.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual const MDropDownListControlState * GetState () const
Interface Category:
API.
Purpose:
Gets a reference pointer to the MDropDownListControlState object currently associated with the drop-down text control object.
Calling Context:
Call this function directly to get a reference of list control state object.
Parameters:
Return Value:
Returns a pointer to the current MDropDownListControlState object.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual void AdoptTextState (MTextControlState * stateToAdopt)
Interface Category:
API.
Purpose:
This is a convenience function for changing the state of the TTextControl object. This function sets TTextControl to the new MTextControlState object. This function calls the appropriate TTextControl function for the developer.
Calling Context:
Call this function directly to change the TTextControl state to a new object.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual MTextControlState * OrphanTextState ()
Interface Category:
API.
Purpose:
This is a convenience function for changing the state of the TTextControl object. This function releases the MTextControlState object from TTextControl and calls the appropriate TTextControl function for the developer.
Calling Context:
Call this function directly to release the TTextControl state from the MTextControlState object.
Parameters:
Return Value:
Returns a pointer to the released MTextControlState object.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual const MTextControlState * GetTextState () const
Interface Category:
API.
Purpose:
This is a convenience function for getting information on the state of the TTextControl object. This function gets the MTextControlState object associated with TTextControl and calls the appropriate TTextControl function for the developer.
Calling Context:
Call this function directly to get a reference of TTextControl state.
Parameters:
Return Value:
Returns a pointer to the released MTextControlState object.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual bool CanChangeList () const
Interface Category:
API.
Purpose:
Returns a Boolean value that indicates whether the predefined text list can be changed.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns the Boolean value that indicates if the predefined list can be changed.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual void AdoptList (TSequenceOf < TText > * listToAdopt)
Interface Category:
API.
Purpose:
Adds a new predefined list to the drop-down text control object. This list becomes the selection list that is displayed to the user.
Calling Context:
Call this function directly to customize the predefined drop-down list.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual TSequenceOf < TText > * OrphanList ()
Interface Category:
API.
Purpose:
Releases a previously adopted list of text entries for the drop-down text control.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns a pointer to the just released list of text entries.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual TDropDownTextControlIterator * CreateIterator (const TAllocationHeap & whichHeap) const
Interface Category:
API.
Purpose:
Creates an iterator for accessing the text entries in the drop-down list.
Calling Context:
Call this function directly.
Parameters:
- const TAllocationHeap & whichHeap -A reference to the memory heap containing the list of text entries.
Return Value:
Returns a pointer to the TDropDownTextControlIterator iterator.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual TGPoint GetPreferredSize (GCoordinate maximumMainDimension =kInfinity) const
Interface Category:
API.
Purpose:
This function allows the developer to find out the minimum/preferred size to fit the drop-down text control. If the control has an empty list, the default size is 100 x 25. If control has a predefined list, it returns the largest item in the list, plus the preferred size of the button.
Developer can override this functions to change the preferred size.
Calling Context:
Call this function directly to get the preferred screen size.
Parameters:
- GCoordinate maximumMainDimension =kInfinity -The maximum coordinates for the view screen.
Return Value:
Returns the TGPoint coordinates for the screen.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual bool NeedsClipping ()
Interface Category:
API.
Purpose:
Returns a Boolean value that indicates whether the drop-down text control screen needs clipping.
Calling Context:
Call by the View system to check if the drop-down text control will need clipping.
Parameters:
Return Value:
Returns a Boolean value that is set to true if clipping is needed.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual void SetVisibility (bool visible =true)
Interface Category:
API.
Purpose:
Changes the semantic visibility of this drop-down text control view. If the view becomes visible, it is repaired (refreshed). If the view becomes invisible, its previously visible area is refreshed to make the newly exposed areas appear on the display. This function overrides the View system settings.
Calling Context:
Call this function directly.
Parameters:
- bool visible =true -The flag indicating whether to mark this view as visible or invisible. True marks the view as visible and false marks the view as invisible.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual bool GetVisibility () const
Interface Category:
API.
Purpose:
Returns the semantic visibility of this view. This value only indicates whether this view would be visible if it was not completely occluded by siblings and if all of its parent views are also semantically visible. Use this function to override the View system function.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns true if this view is not marked as semantically invisible.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual void GetBounds (TGArea &) const
Interface Category:
API.
Purpose:
Gets the current bounds of the display area.
Calling Context:
Call this function directly.
Parameters:
- TGArea & -A reference to the TGArea object that is filled with the current display bounds.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual void SetControlLayout (MControl :: ELayout layout)
Interface Category:
API.
Purpose:
Sets the drop-down text control layout. It allows the developer to override the default layout, which is from LeftToRight.
Calling Context:
Call this function directly to change the default layout.
Parameters:
- MControl :: ELayout layout -The new layout orientation. Layout can be LeftToRight or RightToLeft.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
Currently only LeftToRight is supported.
virtual MControl :: ELayout GetControlLayout () const
Interface Category:
API.
Purpose:
Returns the layout orientation that is currently set.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns the enum value that indicates the currently set layout for the drop-down text control display--either right-to-left or left-to-right.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual void SetEnabled (bool flag)
Interface Category:
API.
Purpose:
Sets the Boolean value that indicates that the control is enabled.
Calling Context:
Call this function directly.
Parameters:
- bool flag -A Boolean value; true enables the control.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual bool IsEnabled () const
Interface Category:
API.
Purpose:
Returns the Boolean value that indicates whether the control is enabled.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns the Boolean value that indicates if the control is enabled; if set to true, the control is enabled.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual bool Activate ()
Interface Category:
API.
Purpose:
Activates the text entry field so that text can be input into it.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns a Boolean value that indicates that the field is activated.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual void Deactivate ()
Interface Category:
API.
Purpose:
Sets the text entry field to inactive and puts the control back to the default state (if drop-down list is down, it will roll up and the button will unpress).
Calling Context:
Call this function directly.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual bool IsActive () const
Interface Category:
API.
Purpose:
Returns the Boolean value that indicates whether the text entry field is currently active. If the value is true, the text entry has been activated.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns true if the text entry field is active; otherwise, returns false if it has not been activated.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
void SetValue (const TText &)
Interface Category:
API.
Purpose:
Sets the text entry field to the text constant so that it is displayed.
Calling Context:
Call this function directly.
Parameters:
- const TText & -A reference to the text constant to be displayed in the text entry field.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
void GetValue (TText & text) const
Interface Category:
API.
Purpose:
Retrieves the text value that has been entered into the text entry field.
Calling Context:
Call this function directly.
Parameters:
- TText & text -A reference to the text value that was entered into the text entry field.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
void SetSelectedField (bool selected =true) const
Interface Category:
API.
Purpose:
Highlights or unhighlights the text entry field.
Calling Context:
Call this function directly.
Parameters:
- bool selected =true -A Boolean value that indicates whether the text entry field should be highlighted or not.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
void SetReadOnly (bool flag)
Interface Category:
API.
Purpose:
Sets the text entry field to either read-only or editable.
Calling Context:
Call this function directly.
Parameters:
- bool flag -A Boolean value that indicates whether the text entry field is read-only or if it can be edited. If the value is true, then the text entry field is read-only.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
bool IsReadOnly () const
Interface Category:
API.
Purpose:
Gets the Boolean value that determines whether the text entry field is editable or is read-only. If the value is true, then the field is read-only.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns true if the text entry field is read-only; otherwise, returns false if the field is editable.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
void SetListSelection (unsigned long index, bool flag)
Interface Category:
API.
Purpose:
Sets or unsets the selected item (by its position in the list) from the list of predefined choices. The selected item is highlighted.
Calling Context:
Call this function directly.
Parameters:
- unsigned long index -The index value that references the list item that has been selected.
- bool flag -A Boolean value that, when set to true, indicates that this is the selected item in the list.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
unsigned long GetSelectedIndex () const
Interface Category:
API.
Purpose:
Gets the index value for the item that has been selected from the list. The index value is the item's position within the list.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns the index value of the selected list item. If no item has been selected, returns kInvalidIndex.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
void ClearListSelection () const
Interface Category:
API.
Purpose:
Clears the selected indicator for the list item and unhighlights that item.
Calling Context:
Call this function directly.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual unsigned long GetItemCount () const
Interface Category:
API.
Purpose:
Gets the number of items that are currently in the scrolling list.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns the value that indicates the number of items in the list. Returns 0 if empty.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual bool GetItemFromIndex (unsigned long index, TText & textToFill) const
Interface Category:
API.
Purpose:
Retrieves the text value from an item in the scroll list, according to the index position of that item.
Calling Context:
Call this function directly.
Parameters:
- unsigned long index -The index position of the item in the list that is to be retrieved.
- TText & textToFill -The TText object that is filled with the text value of the selected item.
Return Value:
Returns true if the item was successfully found and its text retrieved; otherwise, returns false.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual unsigned long GetIndexFromItem (const TText & item) const
Interface Category:
API.
Purpose:
Returns the index position in the scroll list of the specified item.
Calling Context:
Call this function directly.
Parameters:
- const TText & item -A reference to the TText object that contains the list item.
Return Value:
Returns the index value that indicates the position of the item in the scroll list.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
void SetListMaxDisplayItem (unsigned long size =kDefaultListMaxDisplayItem)
Interface Category:
API.
Purpose:
Sets the maximum number of items that can be displayed in the scroll list before a scrollbar shows up.
Calling Context:
Call this function directly.
Parameters:
- unsigned long size =kDefaultListMaxDisplayItem -A value that indicates the maximum number of items in the scroll list that can be displayed before a scrollbar shows up.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
unsigned long GetListMaxDisplayItem () const
Interface Category:
API.
Purpose:
Returns the maximum number of scroll list items that can be displayed when the TScrollingList object is dropped down.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns a value that indicates the maximum number of items that the scroll list has been set to display.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual bool HandleReturnKeyEvent ()
Interface Category:
API.
Purpose:
Processes the user keyboard input of the Return key. Currently, this function highlights the text field.
Calling Context:
Called when a Return key was input in the text field.
Parameters:
Return Value:
Returns true if the Return key input is handled successfully; otherwise, returns false.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
Member Function: TDropDownTextControl::HandleAfterConnectionToViewRoot
virtual void HandleAfterConnectionToViewRoot ()
Interface Category:
API.
Purpose:
Overrides the associated TView function. It is used for notification of when the drop-down view is connected to the view root hierarchy, so that display of the drop-down view will occur.
Calling Context:
This function is called internally by the View system.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
Member Function: TDropDownTextControl::HandleBeforeDisconnectionFromViewRoot
virtual void HandleBeforeDisconnectionFromViewRoot ()
Interface Category:
API.
Purpose:
Overrides the associated TView function. It is used for notification of when the drop-down view is disconnected from the view root hierarchy.
Calling Context:
This function is called internally by the View system.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual void DrawContents (TGrafPort & port) const
Interface Category:
API.
Purpose:
Draws the contents of the drop-down view to the specified TGrafPort.
Calling Context:
This function is called internally when the drop-down view is to be redrawn.
Parameters:
- TGrafPort & port -A reference to the graf port for drawing the display.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
Member Function: TDropDownTextControl::HandleAllocatedAreaChanged
virtual void HandleAllocatedAreaChanged (const TGArea & newArea)
Interface Category:
API.
Purpose:
Handles notification of a change to the drop-down view's allocated area, so that appropriate changes can be made to its layout.
Calling Context:
This function is called internally when allocated area is changed.
Parameters:
- const TGArea & newArea -A reference to the TGArea object that describes the new allocated area.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual void HandleStateChanged (const TNotification &)
Interface Category:
API.
Purpose:
Updates the control display to reflect any changes that have occurred to the control state.
Calling Context:
This function is called internally when its state is changed.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual void Layout ()
Interface Category:
API.
Purpose:
Handles any changes made to the drop-down view layout. These are changes to the border, the text entry field, and the toggle button.
Calling Context:
This function is called internally.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
Member Function: TDropDownTextControl::HandleParentWindowChanged
virtual void HandleParentWindowChanged (const TNotification &)
Interface Category:
API.
Purpose:
Handles moving the scroll list display position when the parent window has been moved.
Calling Context:
This function is called internally when its parent has been moved or changed size.
Parameters:
- const TNotification & -A reference to the notification object that indicates the change in position of the parent window.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.