INotebook

The INotebook class is a wrapper for the notebook control. The notebook is a control that is useful in organizing related information on individual pages so that a user can quickly find and display the information. Use an object of this class to create and manage a notebook control.

A notebook control consists of the following items, and this class provides member functions that support each of these items:

When working with objects of this class, you can also use the following nested classes:

Portability Considerations

The INotebook class supports both the CUA '91 notebook control and the Windows tab control on the Windows platform. The CUA '91 notebook control is a ported version of the OS/2 Presentation Manager notebook control. It has the same look-and-feel as the OS/2 Presentation Manager notebook control. The Windows tab control is a control that is native to the Windows environment.

Use the style, INotebook::pmCompatible, to select the CUA '91 notebook control in the Windows environment. The Windows tab control is the default selection.

Both the OS/2 and AIX environments support only a CUA '91 notebook. Use of the INotebook::pmCompatible style has no effect in these environments.

Since the Windows tab control does not provide several of the features available with the pmCompatible notebook, portable applications requiring these features should use the pmCompatible notebook in the Windows environment.

Color

There are restrictions for specifying the color of controls based on the platform and which style of control you use.

AIX Considerations

The INotebook class supports a notebook control compatible with the CUA '91 notebook control available on OS/2 and with the pmCompatible notebook on Windows.

Windows Considerations

The INotebook class will use the Windows tab control unless the INotebook::pmCompatible style is specified in the INotebook constructor.

The INotebook's implementation of the Windows tab control only supports major tab pages. However, it will convert all minor and non-tab pages in your existing application to major tab pages. The placement of the major tabs is at the top of the control and their shape is rounded. Tab orientation and shape settings are ignored. The Windows tab control only supports rounded major tabs with their orientation limited to the top of the control. Tab text alignment for the Windows tab control is center. Tab text alignment settings are ignored.

The Windows tab control automatically sizes the tabs, unless you specify a size via INotebook::setMajorTabSize.

The Windows tab control allows both a bitmap and text on the same tab. The capability to set both a bitmap and text on the same tab is supported by the INotebook class.

The Windows tab control supports multiple rows of tabs that keep all of the tabs visible to the user. Specify the notebook style, INotebook::allTabsVisible, during INotebook construction to make all of the tabs visible.

The Windows tab control supports owner drawing of the tabs. However, you must specify the notebook style, INotebook::handleDrawTabs, during INotebook construction to enable the owner draw support. The owner-drawn tabs must all be the same width.

The Windows tab control contains no binding or back pages area. The INotebook's implementation of this control ignores the binding and back pages settings.

The Windows tab control contains no status text line. The INotebook's implementation of this control ignores the status text and text alignment settings.

The Windows tab control contains no page buttons. The INotebook's implementation of this control ignores the page button settings.

The Windows tab control does not provide color support APIs. All tab control colors are based upon the default system colors. The INotebook's implementation of this control ignores the color settings.


INotebook - Member Functions and Data by Group

Constructors & Destructor

You can construct and destruct objects of this class. This class supports the same three standard constructors that all of the control classes in the Open Class Library support.
Note: Typically, you create notebooks as clients of frame windows. Use IFrameWindow::setClient to make the notebook the client of a frame window.


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

This destructor destroys the notebook control window only if the Open Class Library created it.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
INotebook


Overload 1
public:
INotebook(unsigned long windowId, IWindow* parentAndOwner)

windowId
Unsigned long value that represents the notebook control identifier (ID).
parentAndOwner
Pointer to the parent and owner window object.

Use this version of the constructor if you want to wrapper a notebook control that is loaded from a dialog resource.
Note: Loading a notebook control from a dialog resource limits the capability of the notebook because page windows cannot be specified within a dialog template.

Exception

IInvalidParameter The notebook object was not created. The creation failed because the pointer to the parent and owner window object cannot be 0.

Supported Platforms

Windows OS/2 AIX
Yes Yes No


Overload 2
public:
INotebook(const IWindowHandle& handle)

handle
Reference to a window handle of an existing notebook control.

Use this version of the constructor to wrapper an existing notebook control window.

Supported Platforms

Windows OS/2 AIX
Yes Yes No


Overload 3
public:
INotebook( unsigned long windowId, IWindow* parent, IWindow* owner, const IRectangle& initial = IRectangle ( ), const Style& style = defaultStyle ( ) )

windowId
Unsigned long value that represents the notebook control identifier (ID).
parent
Pointer to the parent window object.
owner
Pointer to the owner window object.
initial
Reference to a rectangle object. It specifies the initial position and size of the notebook. The default size and position are determined by the default constructor for IRectangle. Optional.
style
Use the styles provided by INotebook Styles to specify the control's styles. Optional.

Use this version of the constructor to create a new notebook control window and a corresponding INotebook object.

Exception

IInvalidParameter The notebook object was not created. The creation failed because the pointer to the parent window object cannot be 0.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Application Data

Use these members to set the application data associated with a notebook page.


[view class]
setUserData
public:
virtual INotebook& setUserData( const IPageHandle& referencePage, unsigned long userData )

Sets the application data into the specified page's reserved storage. Each page has a 4-byte reserved storage area. This area is available for information required by your application.

Exception

IAccessError The user data was not set for the specified page. The page identifier (ID) of the notebook page may be invalid.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Binding Support

Use these members to query and set the notebook's binding.


[view class]
binding
public:
virtual Binding binding() const

Returns the type of binding used for the notebook. The return value is a Binding enumerator.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
setBinding
public:
virtual INotebook& setBinding(Binding binding)

Sets the type of binding for the notebook.

Exception

IInvalidParameter The binding style was not set. The binding parameter is invalid.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Colors

Use these members to set and query the color of different areas of the notebook.


[view class]
backgroundColor
public:
virtual IColor backgroundColor() const

Returns the background color of the notebook or the default if you have not set it.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes

Windows Considerations

Returns the default background color of the notebook.


[view class]
hiliteBackgroundColor
public:
virtual IColor hiliteBackgroundColor() const

Returns the notebook's highlight background color or the default color value if no highlight background color for the notebook has been set.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes

Windows Considerations

Returns the notebook's default highlight background color.


[view class]
majorTabBackgroundColor
public:
virtual IColor majorTabBackgroundColor() const

Returns the major tab background color of the notebook or the default if you have not set it.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
majorTabForegroundColor
public:
virtual IColor majorTabForegroundColor() const

Returns the major tab foreground color of the notebook or the default if you have not set it.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
minorTabBackgroundColor
public:
virtual IColor minorTabBackgroundColor() const

Returns the minor tab background color of the notebook or the default if you have not set it.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
minorTabForegroundColor
public:
virtual IColor minorTabForegroundColor() const

Returns the minor tab foreground color of the notebook or the default if you have not set it.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
pageBackgroundColor
public:
virtual IColor pageBackgroundColor() const

Returns the page background color of the notebook or the default if you have not set it.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
resetMajorTabBackgroundColor
public:
virtual INotebook& resetMajorTabBackgroundColor()

Resets the major tab background color by changing to the major tab background color that was previously set.

Supported Platforms

Windows OS/2 AIX
Yes Yes Ignored


[view class]
resetMajorTabForegroundColor
public:
virtual INotebook& resetMajorTabForegroundColor()

Resets the major tab foreground color by changing to the major tab foreground color that was previously set.

Supported Platforms

Windows OS/2 AIX
Yes Yes Ignored


[view class]
resetMinorTabBackgroundColor
public:
virtual INotebook& resetMinorTabBackgroundColor()

Resets the minor tab background color by changing to the minor tab background color that was previously set.

Supported Platforms

Windows OS/2 AIX
Yes Yes Ignored


[view class]
resetMinorTabForegroundColor
public:
virtual INotebook& resetMinorTabForegroundColor()

Resets the minor tab foreground color by changing to the minor tab foreground color that was previously set.

Supported Platforms

Windows OS/2 AIX
Yes Yes Ignored


[view class]
resetPageBackgroundColor
public:
virtual INotebook& resetPageBackgroundColor()

Resets the page background color by changing to the page background color that was previously set.

Supported Platforms

Windows OS/2 AIX
Yes Yes Ignored


[view class]
setBackgroundColor
public:
virtual INotebook& setBackgroundColor(const IColor& color)

Sets the notebook's background color.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
setForegroundColor
public:
virtual INotebook& setForegroundColor(const IColor& color)

Sets the notebook's foreground color.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
setMajorTabBackgroundColor
public:
virtual INotebook& setMajorTabBackgroundColor( const IColor& color )

Sets the major tab background color.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
setMajorTabForegroundColor
public:
virtual INotebook& setMajorTabForegroundColor( const IColor& color )

Sets the major tab foreground color.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
setMinorTabBackgroundColor
public:
virtual INotebook& setMinorTabBackgroundColor( const IColor& color )

Sets the minor tab background color.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
setMinorTabForegroundColor
public:
virtual INotebook& setMinorTabForegroundColor( const IColor& color )

Sets the minor tab foreground color.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
setPageBackgroundColor
public:
virtual INotebook& setPageBackgroundColor( const IColor& color )

Sets the page background color.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Font Support

Use these members to query and set the font of the notebook.


[view class]
font
public:
virtual IFont font() const

Returns the font used by the notebook.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
setFont
public:
virtual INotebook& setFont(const IFont& font)

Sets the font of the notebook to the indicated font. Notebook pages that do not have their own assigned font will inherit this font.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Implementation

These members provide utilities used to implement this class.


[view class]
setColor
protected:
virtual INotebook& setColor( unsigned long colorArea, const IColor& color )

Sets the colorArea to the indicated color.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Layout Support

Use these members to support the layout of a notebook within a canvas.


[view class]
setLayoutDistorted
public:
virtual INotebook& setLayoutDistorted( unsigned long layoutAttributesOn, unsigned long layoutAttributesOff )

Provides notification to the notebook that its layout needs to be updated. The notebook objects responds to font change notifications. The notebook will propogate the new font to its page windows.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


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

Returns the minimum recommended size for this notebook. This size is large enough to contain the largest application page window that is currently in the notebook. This function calls notebookSize.

Exception

IAccessError The minimum size was not calculated. The coordinates of the notebook or application page window may be invalid.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Native Control Support

Use these members for native control support.


[view class]
isPMCompatible
public:
bool isPMCompatible() const

Returns true if the INotebook object represents a CUA '91 notebook control. False is returned if the INotebook object represents a Windows tab control.

Supported Platforms

Windows OS/2 AIX
Yes Yes Ignored

AIX Considerations

Always returns true.

OS/2 Considerations

Always returns true.


Notification Members

Use these INotificationId strings for all notifications that INotebook provides to its observers.


[view class]
enableNotification
public:
virtual IWindow& enableNotification(bool enable = true)

Enables the notebook to send notifications to any observer objects.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
majorTabBackgroundColorId
public:
static INotificationId const majorTabBackgroundColorId

Notification identifier provided to observers when the major tab background color of the notebook control changes.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
majorTabForegroundColorId
public:
static INotificationId const majorTabForegroundColorId

Notification identifier provided to observers when the major tab foreground color of the notebook control changes.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
minorTabBackgroundColorId
public:
static INotificationId const minorTabBackgroundColorId

Notification identifier provided to observers when the minor tab background color of the notebook control changes.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
minorTabForegroundColorId
public:
static INotificationId const minorTabForegroundColorId

Notification identifier provided to observers when the minor tab foreground color of the notebook control changes.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
orientationId
public:
static INotificationId const orientationId

Notification identifier provided to observers when the orientation style of the notebook control changes. INotebook provides the new orientation value in the INotificationEvent::eventData field of the INotificationEvent. This value is one of the predefined Orientation enumeration values defined in this class.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
pageBackgroundColorId
public:
static INotificationId const pageBackgroundColorId

Notification identifier provided to observers when the page background color of the notebook control changes.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Orientation

Use these members to query and set the orientation of the corner of the back pages of a notebook in relation to the location of the major tabs. The back pages are the recessed edges that give the notebook a three-dimensional effect.


[view class]
orientation
public:
virtual Orientation orientation() const

Returns the current orientation of the notebook, which is the location of the major tabs in relation to the back pages' corner. The return value is an Orientation enumerator.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
setOrientation
public:
virtual INotebook& setOrientation(Orientation orientation)

Sets the orientation of the back pages' corner in relation to the location of the major tabs.

Exception

IInvalidParameter The orientation style was not set. The orientation parameter is invalid.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Page Addition

Use these members to add a page to a notebook.


[view class]
addFirstPage
public:
virtual IPageHandle addFirstPage( const PageSettings& pageInfo, IWindow* pageWindow = 0 )

Adds a page as the first page in the notebook using the specified page settings. If pageWindow is 0, a page with the indicated settings, but no application page window, is added to the notebook.
Note: When adding an IFrameWindow as a notebook page, create an IFrameWindow with the notebook as its parent.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
addLastPage
public:
virtual IPageHandle addLastPage( const PageSettings& pageInfo, IWindow* pageWindow = 0 )

Adds a page as the last page in the notebook using the specified page settings. If pageWindow is 0, a page with the indicated settings, but no application page window, is added to the notebook.
Note: When adding an IFrameWindow as a notebook page, create an IFrameWindow with the notebook as its parent.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
addPageAfter

Adds a page to the notebook following the specified page using the specified page settings. If pageWindow is 0, a page with the indicated settings, but no application page window, is added to the notebook.
Note: When adding an IFrameWindow as a notebook page, create an IFrameWindow with the notebook as its parent.


Overload 1
public:
virtual IPageHandle addPageAfter( const PageSettings& pageInfo, const Cursor& cursor, IWindow* pageWindow = 0 )

pageInfo
Reference to an INotebook::PageSettings object. Use this object to specify the new page's settings.
cursor
Reference to a cursor object that points to a notebook page. The new page is added after this page.
pageWindow
Pointer to the window object to use as the application page window. The default is 0.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 2
public:
virtual IPageHandle addPageAfter( const PageSettings& pageInfo, const IPageHandle& referencePage, IWindow* pageWindow = 0 )

pageInfo
Reference to an INotebook::PageSettings object. Use this object to specify the new page's settings.
referencePage
Reference to the handle of a notebook page. The new page is added after this page.
pageWindow
Pointer to the window object to use as the application page window. The default is 0.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
addPageBefore

Adds a page to the notebook before the specified page using the specified page settings. If pageWindow is 0, a page with the indicated settings, but no application page window, is added to the notebook.
Note: When adding an IFrameWindow as a notebook page, create an IFrameWindow with the notebook as its parent.


Overload 1
public:
virtual IPageHandle addPageBefore( const PageSettings& pageInfo, const Cursor& cursor, IWindow* pageWindow = 0 )

pageInfo
Reference to an INotebook::PageSettings object. Use this object to specify the new page's settings.
cursor
Reference to a cursor object that points to a notebook page. The new page is added before this page.
pageWindow
Pointer to the window object to use as the application page window. The default is 0.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 2
public:
virtual IPageHandle addPageBefore( const PageSettings& pageInfo, const IPageHandle& referencePage, IWindow* pageWindow = 0 )

pageInfo
Reference to an INotebook::PageSettings object. Use this object to specify the new page's settings.
referencePage
Reference to the handle of a notebook page. The new page is added before this page.
pageWindow
Pointer to the window object to use as the application page window. The default is 0.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Page Button

Use these members to set the page button's size.


[view class]
setPageButtonSize
public:
virtual INotebook& setPageButtonSize( const ISize& sizePageButton )

Sets the size in pixels of the page (arrow) buttons that are used to turn the notebook's pages.

Exception

IAccessError The page button size was not set. The page button dimensions may be invalid.

Supported Platforms

Windows OS/2 AIX
Yes Yes Ignored

Windows Considerations

This function is ignored in INotebook's implementation of the Windows tab control.


Page Information

Use these members to obtain information on a notebook page.


[view class]
pageSettings

Returns information about the specified page.


Overload 1
public:
PageSettings pageSettings(const IPageHandle& page) const

page
Reference to the handle of the notebook page to obtain information for.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 2
public:
PageSettings pageSettings(const Cursor& cursor) const

cursor
Reference to a cursor object that points to the notebook page to obtain information for.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Page Manipulation

Use these members to manipulate pages within a notebook.


[view class]
firstPage
public:
virtual IPageHandle firstPage() const

Returns an IPageHandle object that references the first page in the notebook.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
lastPage
public:
virtual IPageHandle lastPage() const

Returns an IPageHandle object that references the last page in the notebook.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
nextPage
public:
virtual IPageHandle nextPage( const IPageHandle& referencePage ) const

Returns an IPageHandle object that references the page following the specified page.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
previousPage
public:
virtual IPageHandle previousPage( const IPageHandle& referencePage ) const

Returns an IPageHandle object that references the page before the specified page.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
topPage
public:
virtual IPageHandle topPage() const

Returns an IPageHandle object that references the current top page of the notebook.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
turnToPage

Moves a specified page to the top of the notebook.


Overload 1
public:
virtual INotebook& turnToPage(const Cursor& cursor)

cursor
Reference to a cursor object that points to the notebook page to move to the top of the notebook.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 2
public:
virtual INotebook& turnToPage(const IPageHandle& page)

page
Reference to the handle of the notebook page to move to the top of the notebook.

Exception

IAccessError The specified page window was not moved to the top of the notebook. The page identifier (ID) of the specified page may be invalid.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Page Removal

Use these members to remove a page or pages from a notebook.


[view class]
removeAllPages
public:
virtual INotebook& removeAllPages()

Removes all the pages in the notebook.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
removePage

Removes the specified page from the notebook.


Overload 1
public:
virtual INotebook& removePage(const Cursor& cursor)

cursor
Reference to a cursor object that points to the notebook page to remove.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 2
public:
virtual INotebook& removePage(const IPageHandle& page)

page
Reference to the handle of the notebook page to remove.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
removeTabSection

If the specified page is a major tab page, it removes the specified page and all subsequent pages up to the next major tab page. If the specified page is a minor tab page, it removes the specified page and all subsequent pages up to the next page that has a tab.


Overload 1
public:
virtual INotebook& removeTabSection( const IPageHandle& page )

page
Reference to the handle of the notebook page. This page is at the beginning of the section to remove.

Exception

IInvalidRequest The notebook tab section was not removed. The removal failed because the specified notebook page is not associated with a major or a minor tab.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes

Windows Considerations

This function is ignored in INotebook's implementation of the Windows tab control.


Overload 2
public:
virtual INotebook& removeTabSection(const Cursor& cursor)

cursor
Reference to a cursor object that points to the notebook page. This page is at the beginning of the section to remove.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes

Windows Considerations

This function is ignored in INotebook's implementation of the Windows tab control.


Page Support

Use these members to support page counting and to determine size information for the notebook.


[view class]
isEmpty
public:
virtual bool isEmpty() const

Queries whether the notebook has any pages and returns true if it is empty.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
notebookSize
public:
virtual ISize notebookSize(const IPageHandle& page) const

Returns the size that the notebook must be in order to contain the specified page. The notebook size is calculated based on the size of the page window. If the page window is not a frame dialog and the page has the autoPageSize attribute, the page window's minimum size is used instead.

Exception

IAccessError The notebook size was not returned. The coordinates of the application page window may be invalid.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
pageSize
public:
virtual ISize pageSize() const

Returns the size of the notebook's pages. All notebook pages have the same size as determined by the notebook size. Application windows associated with notebook pages can use this information to determine their size.

Exception

IAccessError The page's size was not returned. The coordinates of the notebook window may be invalid.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
pagesToEnd

Returns the number of pages in the notebook from a specified notebook page to the end of the notebook. This value includes the specified page.


Overload 1
public:
virtual unsigned long pagesToEnd( const IPageHandle& page ) const

page
Reference to the handle of the notebook page.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 2
public:
virtual unsigned long pagesToEnd( const Cursor& cursor ) const

cursor
Reference to a cursor object that points to the notebook page.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
pagesToMajorTab

Returns the number of pages in the notebook between a specified notebook page and the next page that has a major tab. This value does not include the specified page.


Overload 1
public:
virtual unsigned long pagesToMajorTab( const Cursor& cursor ) const

cursor
Reference to a cursor object that points to the notebook page.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes

Windows Considerations

Always returns 1 for INotebook's implementation of the Windows tab control because every page is a major tab page.


Overload 2
public:
virtual unsigned long pagesToMajorTab( const IPageHandle& page ) const

page
Reference to the handle of the notebook page.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes

Windows Considerations

Always returns 1 for INotebook's implementation of the Windows tab control because every page is a major tab page.


[view class]
pagesToMinorTab

Returns the number of pages in the notebook between a specified notebook page and the next page that has a minor tab. This value does not include the specified page.


Overload 1
public:
virtual unsigned long pagesToMinorTab( const IPageHandle& page ) const

page
Reference to the handle of the notebook page.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes

Windows Considerations

Always returns 0 for INotebook's implementation of the Windows tab control because minor tabs are not supported.


Overload 2
public:
virtual unsigned long pagesToMinorTab( const Cursor& cursor ) const

cursor
Reference to a cursor object that points to the notebook page.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes

Windows Considerations

Always returns 0 for INotebook's implementation of the Windows tab control because minor tabs are not supported.


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

Returns the total number of pages in the notebook.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Page Window Association

Use these members to query and set the application page window that is associated with the specified notebook page.


[view class]
setWindow

Associates the specified notebook page with the application page window.
Note: If you use a page selection handler to delay creating an application page window to associate with a notebook page, you can call this function in the selection handler routine.


Overload 1
public:
virtual INotebook& setWindow( const IPageHandle& referencePage, IWindow* pageWindow = 0 )

referencePage
Reference to the handle of the notebook page.
pageWindow
Pointer to the window object to use as the application page window. The default is 0.

Exception

IAccessError The specified page was not associated with the window. The page identifier (ID) of the notebook page may be invalid.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 2
public:
virtual INotebook& setWindow( const Cursor& cursor, IWindow* pageWindow = 0 )

cursor
Reference to a cursor object that points to the notebook page.
pageWindow
Pointer to the window object to use as the application page window. The default is 0.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
window

Returns the application page window associated with the specified notebook page.


Overload 1
public:
virtual IWindow* window(const IPageHandle& page) const

page
Reference to the handle of the notebook page.

Exception

IAccessError The window associated with the specified notebook page was not returned. The page identifier (ID) of the specified notebook page may be invalid.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 2
public:
virtual IWindow* window(const Cursor& cursor) const

cursor
Reference to a cursor object that points to the notebook page.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Status Text

Use these members to query and set the status text alignment and to set the status text.


[view class]
setStatusText

Sets the status text for the specified page of the notebook.


Overload 1
public:
virtual INotebook& setStatusText( const IPageHandle& referencePage, const char* statusText )

referencePage
Reference to the handle of the specified notebook page.
statusText
Pointer to the text to use on the status line of the specified notebook page.

Exception

IAccessError The status text was not set for the specified page. The page identifier (ID) of the notebook page may be invalid.
IInvalidRequest The page does not have a status line to display the text. You must specify the INotebook::PageSettings::statusTextOn attribute when adding the page to the notebook.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 2
public:
virtual INotebook& setStatusText( const IPageHandle& referencePage, const IResourceId& resourceId )

referencePage
Reference to the handle of the specified notebook page.
resourceId
Reference to a resource identifier object that identifies the text to use on the status line of the specified notebook page.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
setStatusTextAlignment
public:
virtual INotebook& setStatusTextAlignment( TextAlignment alignment )

Sets the alignment of the text in the notebook's status line.

Exception

IInvalidParameter The alignment style of the status text line was not set. The alignment parameter is invalid.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
statusTextAlignment
public:
virtual TextAlignment statusTextAlignment() const

Returns the alignment of the text in the notebook's status line. The return value is a TextAlignment enumerator.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Styles

Use these members to set and query the various styles that are associated with a notebook. You can use these styles with the styles defined by IWindow.

The combination of styles you specify for the back pages (the recessed edges that give the notebook a three-dimensional effect) and the major tabs determines how the pages in the notebook look and behave when the user iterates through the notebook's pages.

An object of this nested class is provided when you create a notebook. A customizable default is used if you do not specify any styles. Once the notebook object is created, you can use INotebook and IWindow member functions to set or query the object's style.

The declaration of the INotebook::Style nested class is generated by the INESTEDBITFLAGCLASSDEF2 macro.


[view class]
convertToGUIStyle
public:
virtual unsigned long convertToGUIStyle( const IBitFlag& style, bool extendedOnly = false ) const

Converts style bits into the style value that can be processed by the graphical user interface (GUI). The default action is to return the base GUI style for the platform. Extended styles, those that either the Open Class Library has defined or you have defined, can be returned by setting the extendedOnly parameter to true.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
defaultStyle
public:
static Style defaultStyle()

Returns the default style. The default style is classDefaultStyle unless you have changed the style using setDefaultStyle.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
setDefaultStyle
public:
static void setDefaultStyle(const Style& style)

Sets the default style for all subsequent notebooks.

This member function is not thread safe. In a multithreaded application, it should only be called when a conflict is not possible. A conflict can arise if you set the default style on one thread at the same time that it is being queried on another. In this situation, the query would take place while the style is in an unknown state.

When you create a window class and do not specifically specify window styles in the constructor, the Open Class Library queries the default style. Therefore, the only safe place to call this member function is when no other application threads that create windows are active.

Another way to avoid a conflict in a multithreaded application is to specifically specify window styles on window construction, rather than calling this member function.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
allTabsVisible
public:
static const Style allTabsVisible

Draws the tabs of the notebook in multiple rows, so all are visible. This style is ignored if the style INotebook::pmCompatible is specified.

Supported Platforms

Windows OS/2 AIX
Yes Ignored Ignored


[view class]
backPagesBottomLeft
public:
static const Style backPagesBottomLeft

Draws the back pages of the notebook behind the bottom left corner of the notebook.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
backPagesBottomRight
public:
static const Style backPagesBottomRight

Draws the back pages of the notebook behind the bottom right corner of the notebook. This is the default.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
backPagesTopLeft
public:
static const Style backPagesTopLeft

Draws the back pages of the notebook behind the top left corner of the notebook.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
backPagesTopRight
public:
static const Style backPagesTopRight

Draws the back pages of the notebook behind the top right corner of the notebook.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
classDefaultStyle
public:
static const Style classDefaultStyle

Specifies the original default style for this class, which is the combination of the following styles:

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
handleDrawTabs
public:
static const Style handleDrawTabs

Selects the owner draw tab style, which enables IPageHandler to dispatch the INotebookDrawItemEvent. Override IPageHandler::drawTab to process this event.

This style is ignored if the style INotebook::pmCompatible is specified.

Supported Platforms

Windows OS/2 AIX
Yes Ignored Ignored


[view class]
majorTabsBottom
public:
static const Style majorTabsBottom

Draws the major tabs of the notebook on the bottom of the notebook.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
majorTabsLeft
public:
static const Style majorTabsLeft

Draws the major tabs of the notebook on the left side of the notebook.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
majorTabsRight
public:
static const Style majorTabsRight

Draws the major tabs of the notebook on the right side of the notebook. This is the default.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
majorTabsTop
public:
static const Style majorTabsTop

Draws the major tabs of the notebook on the top of the notebook.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
pmCompatible
public:
static const Style pmCompatible

Selects the CUA '91 notebook control. If this style is not set, the Windows tab control is selected.

Supported Platforms

Windows OS/2 AIX
Yes Yes Ignored

AIX Considerations

This style has no effect in the AIX environment. Notebook in the AIX environment are always pmCompatible.

OS/2 Considerations

This style has no effect in the OS/2 environment. OS/2 notebook are always pmCompatible.


[view class]
polygonTabs
public:
static const Style polygonTabs

Draws tabs with polygon corners.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
roundedTabs
public:
static const Style roundedTabs

Draws tabs with rounded corners.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
solidBinding
public:
static const Style solidBinding

Draws a solid binding. This is the default.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
spiralBinding
public:
static const Style spiralBinding

Draws a spiral binding.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
squareTabs
public:
static const Style squareTabs

Draws tabs with square corners. This is the default.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
statusTextCenter
public:
static const Style statusTextCenter

Centers the text in the status line.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
statusTextLeft
public:
static const Style statusTextLeft

Left-justifies the text in the tabs.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
statusTextRight
public:
static const Style statusTextRight

Right-justifies the text in the status line.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
tabTextCenter
public:
static const Style tabTextCenter

Centers the text in the tabs. This is the default.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
tabTextLeft
public:
static const Style tabTextLeft

Left-justifies the text in the tabs.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
tabTextRight
public:
static const Style tabTextRight

Right-justifies the text in the tabs.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Tab Support

Use these members to provide the following tab support:


[view class]
areAllTabsVisible
public:
bool areAllTabsVisible() const

Returns true if INotebook::allTabsVisible is specified. False is always returned if the style INotebook::pmCompatible is specified.

Supported Platforms

Windows OS/2 AIX
Yes Ignored Ignored


[view class]
isDrawTabsEnabled
public:
bool isDrawTabsEnabled() const

Returns true if the owner draw tabs style, INotebook::handleDrawTabs, is specified. False is always returned if the style INotebook::pmCompatible is specified.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
refreshTabs
public:
virtual INotebook& refreshTabs()

Causes all of the notebook's visible tabs to be repainted.

Exception

IAccessError The tabs were not repainted. An error occurred within the notebook control.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
setMajorTabSize
public:
virtual INotebook& setMajorTabSize( const ISize& sizeMajorTab )

Sets the size of the notebook's major tabs in pixels.

Exception

IAccessError The major tab size was not set. The tab dimensions may be invalid.

Supported Platforms

Windows OS/2 AIX
Yes Yes Ignored


[view class]
setMinorTabSize
public:
virtual INotebook& setMinorTabSize( const ISize& sizeMinorTab )

Sets the size of the notebook's minor tabs in pixels.

Exception

IAccessError The minor tab size was not set. The tab dimensions may be invalid.

Supported Platforms

Windows OS/2 AIX
Yes Yes Ignored

Windows Considerations

This function is ignored in INotebook's implementation of the Windows tab control.


[view class]
setTabBitmap

Sets the tab bitmap for the specified page of the notebook.


Overload 1
public:
virtual INotebook& setTabBitmap( const IPageHandle& referencePage, const IResourceId& resourceId )

referencePage
Reference to the handle of the specified notebook page.
resourceId
Reference to a resource identifier object that identifies the bitmap to use on the tab of the specified notebook page.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 2
public:
virtual INotebook& setTabBitmap( const IPageHandle& referencePage, const IBitmapHandle& bitmap )

referencePage
Reference to the handle of the specified notebook page.
bitmap
Reference to the handle of the bitmap to use on the tab of the specified notebook page.

Exception

IAccessError The tab bitmap was not set for the specified page. The page identifier (ID) of the notebook page may be invalid or the page may be missing the major or minor tab attribute.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
setTabShape
public:
virtual INotebook& setTabShape(TabShape tabShape)

Sets the shape of the notebook's tabs.

Exception

IInvalidParameter The tab shape style was not set. The tabShape parameter is invalid.

Supported Platforms

Windows OS/2 AIX
Yes Yes Ignored

Windows Considerations

This function has no affect when using the native Windows version of INotebook as it does not support tab shapes.


[view class]
setTabText

Sets the tab text for the specified page of the notebook.
Note: Multiple lines of text on the tabs are not supported. You must use the tab owner draw support to implement multiline text.


Overload 1
public:
virtual INotebook& setTabText( const IPageHandle& referencePage, const char* tabText )

referencePage
Reference to the handle of the specified notebook page.
tabText
Pointer to the text to use on the tab of the specified notebook page.

Exception

IAccessError The tab text was not set for the specified page. The page identifier (ID) of the notebook page may be invalid or the page may be missing the major or minor tab attribute.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 2
public:
virtual INotebook& setTabText( const IPageHandle& referencePage, const IResourceId& resourceId )

referencePage
Reference to the handle of the specified notebook page.
resourceId
Reference to a resource identifier object that identifies the text to use on the tab of the specified notebook page.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
setTabTextAlignment
public:
virtual INotebook& setTabTextAlignment( TextAlignment alignment )

Sets the alignment of the text in the notebook's tabs.

Exception

IInvalidParameter The tab text alignment style was not set. The alignment parameter is invalid.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes

Windows Considerations

This function has no affect on Windows because the native Windows version of INotebook does not support tab text alignment.


[view class]
tabShape
public:
virtual TabShape tabShape() const

Returns the shape of the notebook's tabs. The return value is a TabShape enumerator.

Supported Platforms

Windows OS/2 AIX
Yes Yes Ignored


[view class]
tabTextAlignment
public:
virtual TextAlignment tabTextAlignment() const

Returns the alignment of the text in the notebook's tabs. The returned value is a TextAlignment enumerator.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


INotebook - Enumerations


[view class]
Binding
enum Binding { spiral, 
               solid }

Use these enumerators to specify the binding for the notebook:

spiral
Draws a spiral binding for the notebook.
solid
Draws a solid binding for the notebook.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
Orientation
enum Orientation { backpagesBottomTabsRight, 
                   backpagesTopTabsRight, 
                   backpagesBottomTabsLeft, 
                   backpagesTopTabsLeft, 
                   backpagesRightTabsTop, 
                   backpagesLeftTabsTop, 
                   backpagesRightTabsBottom, 
                   backpagesLeftTabsBottom }

Use these enumerators to specify the orientation of the back pages' corner in relation to the location of the major tabs:

backpagesBottomTabsRight
Places back pages on the bottom-right corner and the major tabs on the right side of the notebook.
backpagesTopTabsRight
Places back pages on the top-right corner and the major tabs on the right side of the notebook.
backpagesBottomTabsLeft
Places back pages on the bottom-left corner and the major tabs on the left side of the notebook.
backpagesTopTabsLeft
Places back pages on the top-left corner and the major tabs on the left side of the notebook.
backpagesRightTabsTop
Places back pages on the top-right corner and the major tabs on the top of the notebook.
backpagesLeftTabsTop
Places back pages on the top-left corner and the major tabs on the top of the notebook.
backpagesRightTabsBottom
Places back pages on the bottom-right corner and the major tabs on the bottom of the notebook.
backpagesLeftTabsBottom
Places back pages on the bottom-left corner and the major tabs on the bottom of the notebook.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
TabShape
enum TabShape { square, 
                rounded, 
                polygon }

Use these enumerators to specify the shape of the notebook's tabs:

square
Draws the tabs with square corners.
rounded
Draws the tabs with rounded corners.
polygon
Draws the tabs with polygon corners.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
TextAlignment
enum TextAlignment { left, 
                     right, 
                     center }

Use these enumerators to specify the alignment for the text in the status line and in the tabs:

left
Left-justifies the text.
right
Right-justifies the text.
center
Centers the text.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


INotebook - 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