Working with INotebook Parts

The following tasks are associated with using an INotebook* part in visual composition. Tasks that are common to many parts are described in related topics.

Selecting PM compatibility
You can define either a notebook that is native to the system or one that is compatible with the OS/2 Presentation Manager (PM) notebook. The following characteristics of a PM-compatible notebook are not applicable for a native Windows notebook:

To provide a PM-compatible notebook, open the style property in the INotebook* property sheet and set the pmCompatible style to on.

Selecting notebook orientation
For a PM-compatible notebook, you can specify the notebook orientation. The orientation determines where each of the following appear:

To define the orientation, set the orientation property in the INotebook* property sheet. With the <default> value, the back page edges are below and right of the top page, and major tabs are on the right. Alternatively, select one of the following choices in the value column:

Selecting notebook binding
For a PM-compatible notebook, you can specify the notebook binding. The binding is cosmetic, and serves no functional purpose. To define the binding for the notebook, set the binding property in the INotebook* property sheet. With the <default> value, the binding is solid. Alternatively, select one of the following choices in the value column:

Customizing page tabs
For a PM-compatible notebook, you can customize page tabs. To define tab appearance for the notebook, set the following properties in the INotebook* property sheet:
tabShape
The shape of tab corners. With the <default> value, the corners are square. Alternatively, select one of the following choices in the value column:
  • polygon
  • rounded
  • square
tabTextAlignment
The alignment of text on the tabs. With the <default> value, text is centered. Alternatively, select one of the following choices in the value column:
  • center
  • left
  • right
Major tab size
The dimensions of major tabs.
Minor tab size
The dimensions of minor tabs. If you do not intend to use minor tabs, set the minor tab width and height to 0. With no minor tabs specified, window space is not reserved for minor tabs.

Aligning status text
For a PM-compatible notebook, you can specify status text alignment. To align the status text at the bottom of each notebook page, set the statusTextAlignment property in the INotebook* property sheet. With the <default> value, text is left-aligned. Alternatively, select one of the following choices in the value column:

Adding a page
To add a page to the notebook, select an add page choice in the pop-up menu of either the INotebook* part or an IVBNotebookPage* part.

An IVBNotebookPage* part is placed in the notebook.

Adding pages dynamically
To add dynamically created notebook pages, use an add page action. For example, to add a page at the back of the notebook every time a related event occurs, do the following:
  1. Define a primary part for each page, based on a composer part such as an IMultiCellCanvas*. For this discussion, we will call it MyPagePart.

  2. Add a Factory part and a Variable part, and change their type to MyPagePart*.

  3. Connect the related event to the new action of the MyPagePart* factory.

  4. Connect the newEvent feature of the MyPagePart* factory to the this attribute of the MyPagePart* variable.

  5. Connect the newEvent feature of the MyPagePart* factory to the addLastPage action of the INotebook* part.

  6. Connect the this attribute of the MyPagePart* variable to the pageWindow parameter of the newEvent-to-addLastPage connection.

  7. Connect a text attribute for tab text to the pageInfo parameter of the newEvent-to-addLastPage connection.


Related procedures
Common Tasks for Control Parts
Setting Part Style Properties
Setting Part Color Properties
Setting Part Font Properties
Setting Part Handlers Properties
Setting Part Framing Properties
Working with VisualAge User Interface Parts

Related references
INotebook
Property Settings -- INotebook
Portability -- INotebook