ITextControl

The ITextControl class is an abstract base class for all text control window classes. It provides functions that manipulate text strings.

AIX Considerations

ITextControl is not the class corresponding to a text widget. If you are looking for a class for a text widget, see IEntryField and IMultiLineEdit.


ITextControl - Member Functions and Data by Group

Constructors & Destructor

Because this class is an abstract base class, you cannot directly construct objects of this class. The only way to construct objects of this class is from a derived class. To enforce this, the only constructor we provide for this class is protected. You can destruct objects of this class.


[view class]
~ITextControl
public:
virtual ~ITextControl()

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
ITextControl
protected:
ITextControl()

Derived classes use this protected constructor to create objects of this class.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Clipboard Operations

Use these members to interface with the clipboard.


[view class]
clipboardHasTextFormat
public:
static bool clipboardHasTextFormat()

Returns true if the clipboard is in text format.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes

AIX Considerations

If one of the registered formats for the clipboard data is of type "STRING," this function returns true.


Layout Support

Layout-support members are overrides that supply information used by the canvas classes to provide dialog-like behavior.


[view class]
setLayoutDistorted
public:
virtual ITextControl& setLayoutDistorted( unsigned long layoutAttributeOn, unsigned long layoutAttributeOff )

Processes a font change like a minimum size change. This is a virtual override of setLayoutDistorted.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Notification Members

Use these members to identify and enable notifications sent to observer objects.


[view class]
textId
public:
static INotificationId const textId

Notification identifier provided to observers when the text of a text control window changes.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Text Processing

Use these members to manage the text. You can query and set the text as well as query the length of the text for objects of this class.


[view class]
setText

Sets the control window's text.

If the setText member function is used to set the text in an IComboBox constructed with the readOnlyDropDown style, non-null text specified must already exist in the combo box list. The item matching the new text will be selected. If the new text specified is the null string, all items in the list will be deselected.


Overload 1
public:
virtual ITextControl& setText(const IResourceId& text)

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 2
public:
virtual ITextControl& setText(const char* text)

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
text
public:
virtual IString text() const

Returns the control window's text.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
textLength
public:
virtual unsigned long textLength() const

Returns the current length of the control window's text in bytes.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Window Painting

Use these members to update the window.


[view class]
displaySize
public:
virtual ISize displaySize(const char* text = 0) const

Returns the width and height of the rectangle enclosing the string. If you do not specify a string, the size needed to contain the current text is returned.

text
String to be enclosed.

Exception

IAccessError The operating system's request to query the size of the text box failed.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes

AIX Considerations

This member uses the underlying widget's current font list. It supports multiple-byte character sets but not sheared or rotated strings.

OS/2 Considerations

This function uses the font attribute of the presentation space, including a sheared or rotated string. This function also supports double-byte character set (DBCS) characters.


ITextControl - Inherited Member Functions and Data

Inherited Public Functions

IControl
INotifier
IWindow

Inherited Public Data

IWindow
INotifier

Inherited Protected Functions

IWindow
INotifier
IControl

Inherited Protected Data