IInfoArea

The IInfoArea class provides a frame extension at the bottom of the client area. The frame extension shows information about the frame menu item at which the selection cursor is currently positioned.

The information area displays the contents of an entry in a resource string table. The string resource is obtained by using the same ID as the menu item plus some optional offset value that is added to the menu item ID to locate the corresponding string of information about it.

AIX Considerations

The Open Class Library loads the strings from the user default library.

Unlike OS/2 Presentation Manager, Motif does not update the information area for menu bar items when the cursor is positioned there via the keyboard (F10). If the mouse button is pressed on a menu bar item, the information area is updated. Also the info area is not updated for disabled menu items in AIX.

OS/2 Considerations

The Open Class Library loads the strings from a dynamic link library (.DLL). You can specify a library name, or you can use 0 to indicate that the default user application resource library supplies the resources.


IInfoArea - Member Functions and Data by Group

Constructors & Destructor

You can construct and destruct objects of this class. You cannot copy or assign IInfoArea objects because both the copy constructor and assignment operator are private functions.


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

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
IInfoArea


Overload 1
public:
IInfoArea( IFrameWindow* frame, const char* resDLLName, unsigned long id = 0 )

Use this constructor to create IInfoArea objects from a pointer to a frame window, the name of the resource DLL, and the ID for the information area control,

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 2
public:
IInfoArea( IFrameWindow* frame, unsigned long id, const char* resDLLName )

Use this constructor to create IInfoArea objects from a pointer to a frame window, an ID for the information area control, and the name of the resource DLL.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 3
public:
IInfoArea( IFrameWindow* frame, const IModuleHandle& resMod, unsigned long id = 0 )

Use this constructor to create IInfoArea objects from a pointer to a frame window, a module handle of the resource DLL, and an ID for the information area control. If the module handle is 0, the information strings are loaded from the current .EXE.

Supported Platforms

Windows OS/2 AIX
Yes Yes No


Overload 4
public:
IInfoArea(IFrameWindow* frame, unsigned long id = 0)

Use this constructor to construct an IInfoArea object from a frame window pointer and an ID for the information area control. By default, the information strings will be loaded from the user default resource library obtained from userResourceLibrary.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Display Size

Use these members to control the height of the information area's minimum size, in terms of lines of text. By default, the frame uses this to size the height of this frame extension.


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

Returns the number of text lines that the information area uses.

Supported Platforms

Windows OS/2 AIX
Yes Yes Ignored


[view class]
setLineCount
public:
virtual IInfoArea& setLineCount(unsigned long lines = 1)

Sets the number of text lines that the information area uses to display text. The default is one line.

Exception

IInvalidParameter The number of lines specified must be greater than 0.

Supported Platforms

Windows OS/2 AIX
Yes Yes Ignored


Event Dispatching

Use these members to attach the handler of the information area to and detach it from a frame window. These members are used when adding the information area extension to the frame window, so you should not have to call them.


[view class]
stopShowingMenuInfoFor
public:
virtual IInfoArea& stopShowingMenuInfoFor( IFrameWindow* frame )

Deactivates the information area for the specified frame.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Information String Processing

These members implement this class. Derived classes can override them to tailor the behavior.


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

Returns the default text to be shown when no menu item is selected.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
setDefaultText

Sets the default text to be shown when no menu item is selected.


Overload 1
public:
virtual IInfoArea& setDefaultText( const IString& defaultText )

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 2
public:
virtual IInfoArea& setDefaultText( unsigned long defaultText )

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
informationFor
protected:
virtual IString informationFor(unsigned long itemId) const

Returns the information string for the specified menu ID.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Layout Support

Layout is information used by the canvas classes to provide dialog-like behavior.


[view class]
calcMinimumSize
protected:
virtual ISize calcMinimumSize() const

Returns the minimum size of the information area, based on the number of text lines that the information area displays and the text limit. The default text limit is 80.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Menu Event Processing

These members are overridden from class IMenuHandler to handle the menu events appropriately.


[view class]
startShowingMenuInfoFor
public:
virtual IInfoArea& startShowingMenuInfoFor( IFrameWindow* frame )

Activates the information area for the specified frame.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
showMenuInfo
protected:
virtual IInfoArea& showMenuInfo( bool itemState, unsigned long itemId, ETextType status, const IString& text )

Showns the specified string in the information area.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Notification Members

These INotificationId strings are used for all notifications that IInfoArea provides to its observers.


[view class]
defaultTextId
public:
static INotificationId const defaultTextId

Indicates that the default text string has been changed.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
disabledTextId
public:
static INotificationId const disabledTextId

Notification identifier provided to observers when the disabled text of the information area control changes. IInfoArea provides a pointer to the new text string in the INotificationEvent::eventData field of the INotificationEvent.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
missingTextId
public:
static INotificationId const missingTextId

Notification identifier provided to observers when the missing text of the information area control changes. IInfoArea provides a pointer to the new text string in the INotificationEvent::eventData field of the INotificationEvent.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
resourceLibraryId
public:
static INotificationId const resourceLibraryId

Notification identifier provided to observers when the resource library of the information area control changes. IInfoArea provides a pointer to the new resource library in the INotificationEvent::eventData field of the INotificationEvent.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Resource Library

Use these members to query and set the resource library from which the information strings are to be loaded.


[view class]
resourceLibrary
public:
virtual IResourceLibrary& resourceLibrary() const

Returns a reference to the library being used.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
setResourceLibrary
public:
virtual IInfoArea& setResourceLibrary( const IModuleHandle& resMod )

Sets the specified resource library, with an optional search location.

Use this function to set the resource library using a module handle.

Supported Platforms

Windows OS/2 AIX
Yes Yes No


Special Information Strings

Use these members to set and query the value of the information strings displayed in special circumstances. Special circumstances include when the menu is inactive, when a disabled menu item is the current menu item, or when the text for the selected menu item is missing. Each special string can be specified as either an IString or the identifier for a string from the resource library.


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

Returns the text displayed when the menu item at the selection cursor is disabled.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


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

Returns the text that displays when the Open Class Library cannot obtain the required information string from the resource library.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
setDisabledText

Sets the text that is displayed whenever a disabled menu item becomes the current menu item. To display the text, you must call this function before the disabled menu item is made the current menu item. Otherwise, the normal information area text is displayed.


Overload 1
public:
virtual IInfoArea& setDisabledText( unsigned long disabledText )

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes

AIX Considerations
In AIX, the disabled text is not shown, since the cursor can never really be placed on a disabled menu item.


Overload 2
public:
virtual IInfoArea& setDisabledText( const IString& disabledText )

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes

AIX Considerations
In AIX, the disabled text is not shown, since the cursor can never really be placed on a disabled menu item.

[view class]
setMissingText

Sets the text that displays when the Open Class Library cannot find the information string.


Overload 1
public:
virtual IInfoArea& setMissingText( unsigned long missingText )

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 2
public:
virtual IInfoArea& setMissingText( const IString& missingText )

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


String Table Offset

Use these members to set and query the string table offset. The string table offset is added to the menu identifier to obtain the identifier for the string providing the information about the menu item. The default is zero.


[view class]
setStringTableOffset
public:
virtual IInfoArea& setStringTableOffset(long newOffset = 0)

Sets the offset to be used to calculate the information string ID.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
stringTableOffset
public:
virtual long stringTableOffset() const

Returns the offset currently in use.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Miscellaneous Members

AIX Considerations

The Open Class Library loads the strings from the user default library.

Unlike OS/2 Presentation Manager, Motif does not update the information area for menu bar items when the cursor is positioned there via the keyboard (F10). If the mouse button is pressed on a menu bar item, the information area is updated. Also the info area is not updated for disabled menu items in AIX.

OS/2 Considerations

The Open Class Library loads the strings from a dynamic link library (.DLL). You can specify a library name, or you can use 0 to indicate that the default user application resource library supplies the resources.


[view class]
setResourceLibrary
public:
virtual IInfoArea& setResourceLibrary( const char* resDLLName, IDynamicLinkLibrary::ESearchLocation searchLocation = IDynamicLinkLibrary::kOSDefaultSearch )

Sets the specified resource library, with an optional search location.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


IInfoArea - Enumerations


[view class]
ETextType
enum ETextType { kDefaultText, 
                 kMissingText, 
                 kSelectedText, 
                 kDisabledText }

Indicates the type of text to be displayed. Either the default text, the text associated with the currently selected menu item, or the text for a disabled menu item.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


IInfoArea - Inherited Member Functions and Data

Inherited Public Functions

IControl
INotifier
IStaticText
ITextControl
IWindow

Inherited Public Data

IWindow
INotifier
IStaticText
ITextControl

Inherited Protected Functions

IStaticText
IWindow
INotifier
IControl
ITextControl

Inherited Protected Data