rwlogo

Rogue Wave Views
Gadgets Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
List of all members | Public Member Functions | Static Public Member Functions | Friends
IlvNotebookPage Class Reference

Gadget-related class. More...

#include <ilviews/gadgets/notebook.h>

Inherits IlvValueInterface.

Public Member Functions

 IlvNotebookPage (IlvNotebook *notebook, const char *label, IlvBitmap *bitmap, IlBoolean transparent, const char *filename)
 Constructor. More...
 
virtual IlvViewcreateView (IlvAbstractView *parent, const IlvRect &rect)
 Is called to create the view associated with the page. More...
 
virtual void deleteView ()
 Is called when the view associated with the page is deleted. More...
 
virtual void deSelect ()
 Is called by the notebook when the page is deselected. More...
 
virtual void draw (IlvPort *dst, const IlvRect &pageRect, const IlvTransformer *t, const IlvRegion *clip) const
 Called by the notebook to draw the contents of the page. More...
 
virtual void drawTab (IlvPort *dst, const IlvRect &rect, const IlvRegion *clip) const
 Draws the content of the tab. More...
 
IlvBitmapgetBitmap () const
 Returns the page bitmap. More...
 
const char * getFileName () const
 Returns the filename of the page. More...
 
IlvBitmapgetInsensitiveBitmap () const
 Returns the insensitive bitmap of the page. More...
 
const char * getLabel () const
 Returns the page label. More...
 
const char * getName () const
 Returns the page name. More...
 
IlvNamedPropertygetNamedProperty (const IlSymbol *name) const
 Returns a named property of the object. More...
 
IlvNotebookgetNotebook () const
 Returns the notebook associated with this page. More...
 
IlAny getProperty (const IlSymbol *key) const
 Returns a given property of the object. More...
 
virtual void getTabSize (IlvDim &width, IlvDim &height) const
 Computes the size of the tab. More...
 
virtual IlvViewgetView ()
 Returns the view associated with the page. More...
 
IlBoolean hasProperty (const IlSymbol *key) const
 Checks that the object has a given property. More...
 
IlBoolean isSensitive () const
 Returns a Boolean indicating the page sensitivity. More...
 
IlvNamedPropertyremoveNamedProperty (IlSymbol *name)
 Removes a named property from the object. More...
 
IlBoolean removeProperty (const IlSymbol *key)
 Removes a property of the object. More...
 
virtual void resized ()
 Is called when the page is resized. More...
 
virtual void select ()
 Is called by the notebook when the page is selected. More...
 
void setBackground (IlvColor *color)
 Changes the background color of the notebook page. More...
 
void setBitmap (IlvBitmap *bitmap)
 Changes the page bitmap. More...
 
virtual void setFileName (const char *filename)
 Sets the filename of the page. More...
 
void setInsensitiveBitmap (IlvBitmap *bitmap)
 Sets the insensitive bitmap of the page. More...
 
void setLabel (const char *label)
 Changes the page label. More...
 
void setName (const char *name)
 Changes the page name. More...
 
IlvNamedPropertysetNamedProperty (IlvNamedProperty *property)
 Sets a named property of the object. More...
 
void setProperty (const IlSymbol *key, IlAny value)
 Sets a property to the object. More...
 
void setSensitive (IlBoolean value)
 Changes the sensitivity of the page. More...
 
void setView (IlvView *view)
 Changes the view associated with the page. More...
 
virtual void write (IlvOutputFile &file) const
 Writes an object description to a file. More...
 

Static Public Member Functions

static IlvNotebookPageread (IlvInputFile &file, IlvNotebook *notebook)
 Reads an object description from a file. More...
 

Friends

class IlvNotebook
 
class IlvNotebookMLFHandler
 
class IlvNotebookVXLFHandler
 
class IlvNotebookWLFHandler
 

Detailed Description

Gadget-related class.

Library: ilvadvgdt

IlvNotebookPage is the implementation of the page of a notebook (see the class IlvNotebook).


- IlvNotebook and IlvNotebookPage -


The notebook page is composed of a rectangular usable area and a tab that can contain a label, a bitmap or both. The class IlvNotebookPage creates an IlvGadgetContainer to display the contents of the page.

See Also
IlvNotebook.

Constructor & Destructor Documentation

IlvNotebookPage::IlvNotebookPage ( IlvNotebook notebook,
const char *  label,
IlvBitmap bitmap,
IlBoolean  transparent,
const char *  filename 
)

Constructor.

Initializes a new instance of the IlvNotebookPage class.

Parameters
notebookThe notebook that will contain the page.
labelThe label displayed by the tab of the page.
bitmapThe bitmap displayed by the tab of the page.
transparentObsolete.
filenameThe name of the .ilv file to be loaded onto the page.

Member Function Documentation

virtual IlvView* IlvNotebookPage::createView ( IlvAbstractView parent,
const IlvRect rect 
)
virtual

Is called to create the view associated with the page.

Creates the view associated with the page. You can overload this method to create any kind of view. This method also reads the .ilv file. The default implementation creates and returns an IlvGadgetContainer.

Parameters
parentThe parent view of the created view.
rectThe size and position of the created view.
See Also
deleteView().
virtual void IlvNotebookPage::deleteView ( )
virtual

Is called when the view associated with the page is deleted.

See Also
createView().
virtual void IlvNotebookPage::deSelect ( )
virtual

Is called by the notebook when the page is deselected.

Is called by the IlvNotebook::pageDeselected() method when the page is deselected. The default implementation hides the view associated with this page.

See Also
IlvNotebook::pageDeselected(), select().
virtual void IlvNotebookPage::draw ( IlvPort dst,
const IlvRect pageRect,
const IlvTransformer t,
const IlvRegion clip 
) const
virtual

Called by the notebook to draw the contents of the page.

If the page has no associated view, the method tries to create the view by calling the IlvNotebook::createView() method. You can overload this method to do your own drawing.

Parameters
dstThe drawing destination port.
pageRectThe rectangle of the page, with the margin defined in the notebook taken into account.
tThe transformer through which the notebook is drawn.
clipThe clipping area.
See Also
drawTab().
virtual void IlvNotebookPage::drawTab ( IlvPort dst,
const IlvRect rect,
const IlvRegion clip 
) const
virtual

Draws the content of the tab.

Draws the content of the tab. You can overload this method to draw whatever you need.

Parameters
dstThe drawing destination port.
rectThe bounding box of the tab.
clipThe clipping area.
See Also
draw().
IlvBitmap* IlvNotebookPage::getBitmap ( ) const

Returns the page bitmap.

Returns
The page bitmap.
See Also
setBitmap(), getInsensitiveBitmap(), IlvBitmap.
const char* IlvNotebookPage::getFileName ( ) const

Returns the filename of the page.

Returns
the filename (the name of the .ilv file) associated with the page.
See Also
setFileName().
IlvBitmap* IlvNotebookPage::getInsensitiveBitmap ( ) const

Returns the insensitive bitmap of the page.

The insensitive bitmap is displayed by the page when it's set insensitive (see IlvNotebookPage::setSensitive()). If only a sensitive bitmap is provided, and if the notebook page is set insensitive, a default insensitive bitmap is automatically computed using the sensitive bitmap.

Returns
The bitmap used by this notebook page when insensitive, or 0 if there is none.
See Also
setInsensitiveBitmap(), setBitmap().
const char* IlvNotebookPage::getLabel ( ) const

Returns the page label.

Returns
The page label. The label can be a reference to the language database. The result can be 0 if the tab has no label.
See Also
setLabel().
const char* IlvNotebookPage::getName ( ) const

Returns the page name.

Returns
The page name or 0 if there is none. Do not modify or delete the returned string.
See Also
setName(), IlvNotebook::getPage(const char*).
IlvNamedProperty* IlvNotebookPage::getNamedProperty ( const IlSymbol name) const

Returns a named property of the object.

Parameters
nameThe property name.
Returns
A pointer to the named property object associated with the current object having the name name. Returns null if no named property matches the name name.
See Also
setNamedProperty(), removeNamedProperty().
IlvNotebook* IlvNotebookPage::getNotebook ( ) const

Returns the notebook associated with this page.

Returns
The notebook associated with this page.
See Also
IlvNotebook::addPage().
IlAny IlvNotebookPage::getProperty ( const IlSymbol key) const

Returns a given property of the object.

Parameters
keyThe symbol that specifies the property.
Returns
The given property value when it can be found. Returns 0 when no property name matches the key parameter.
See Also
setProperty(), removeProperty(), hasProperty().
virtual void IlvNotebookPage::getTabSize ( IlvDim width,
IlvDim height 
) const
virtual

Computes the size of the tab.

Overload this method to change the size of the tab.

Parameters
widthThe width of the tab.
heightThe height of the tab.
virtual IlvView* IlvNotebookPage::getView ( )
virtual

Returns the view associated with the page.

If no such view exists, the method creates the views by calling the IlvNotebook::createView() method.

Returns
The view associated with the page.
See Also
IlvNotebook::createView(), IlvNotebookPage::createView().
IlBoolean IlvNotebookPage::hasProperty ( const IlSymbol key) const

Checks that the object has a given property.

Parameters
keyThe symbol that specifies the property.
Returns
IlTrue if the key property was found, or IlFalse if the key property was not found.
See Also
setProperty(), removeProperty(), getProperty().
IlBoolean IlvNotebookPage::isSensitive ( ) const

Returns a Boolean indicating the page sensitivity.

Returns
IlTrue if the page is sensitive, that is, it can be selected.
See Also
setSensitive().
static IlvNotebookPage* IlvNotebookPage::read ( IlvInputFile file,
IlvNotebook notebook 
)
static

Reads an object description from a file.

Reads an object description from the file input. It reads the information that was saved by the member function write() to be able to create a new instance of this object. Usually, because of the availability of the constructor that expects an IlvInputFile, readItem() should be equivalent to:

MyClass::read(IlvInputFile& file, IlvNotebook* notebook)
{
return new MyClass(file, notebook);
}
Parameters
fileThe file to be read from.
notebookThe notebook that contains the page.
See Also
DeclareNotebookPageInfoRO(), DeclareNotebookPageInfo(), IlvPredefinedNotebookPageIOMembers().
Note
The read() method is not capitalized like other static methods so that it is consistent with the write() method.
IlvNamedProperty* IlvNotebookPage::removeNamedProperty ( IlSymbol name)

Removes a named property from the object.

Parameters
nameThe property name.
Returns
The named property that was previously associated with this object having the same name, so that you can delete it or keep it for further handling. If no previous named property was associated with this object having the name property, this function returns 0.
See Also
getNamedProperty(), setNamedProperty().
IlBoolean IlvNotebookPage::removeProperty ( const IlSymbol key)

Removes a property of the object.

Parameters
keyThe symbol that specifies the property.
Returns
IlTrue if the key property was found, or IlFalse if the key property was not found.
See Also
setProperty(), getProperty(), hasProperty().
virtual void IlvNotebookPage::resized ( )
virtual

Is called when the page is resized.

The default implementation resizes the view associated with this page.

See Also
IlvNotebook::pageResized().
virtual void IlvNotebookPage::select ( )
virtual

Is called by the notebook when the page is selected.

Is called by the IlvNotebook::pageSelected() method when the page is selected. The default implementation shows the view associated with this page.

See Also
IlvNotebook::pageSelected(), deSelect().
void IlvNotebookPage::setBackground ( IlvColor color)

Changes the background color of the notebook page.

By default, a notebook page has no background, and thus it uses the one of its associated notebook.

Parameters
colorThe new color for this page. color is locked. The previous color is unlocked. If this parameter is 0, then the notebook page inherits its color from its associated notebook.
void IlvNotebookPage::setBitmap ( IlvBitmap bitmap)

Changes the page bitmap.

Parameters
bitmapThe new page bitmap. The new bitmap is locked, and the previous bitmap is unlocked. Giving a value of 0 removes the bitmap from the tab.
See Also
getBitmap(), setInsensitiveBitmap(), IlvBitmap.
virtual void IlvNotebookPage::setFileName ( const char *  filename)
virtual

Sets the filename of the page.

The .ilv file corresponding to filename is loaded into the page. Note that this method assumes that the encapsulated view is a subclass of the IlvGadgetContainer class.

Parameters
filenameThe file name of the .ilv file to load into the page. if filename is 0, all the objects of the encapsulated gadget container are removed.
See Also
getFileName().
void IlvNotebookPage::setInsensitiveBitmap ( IlvBitmap bitmap)

Sets the insensitive bitmap of the page.

Allows you to set an insensitive bitmap for this notebook page. If the notebook page already owns an insensitive bitmap, it's unlocked. The new bitmap is locked.

Parameters
bitmapThe new insensitive bitmap.
See Also
getInsensitiveBitmap(), getBitmap().
void IlvNotebookPage::setLabel ( const char *  label)

Changes the page label.

Parameters
labelThe new page label. Giving a value of 0 removes the label from the tab.
void IlvNotebookPage::setName ( const char *  name)

Changes the page name.

To find a page from its name, you can use the member function IlvNotebook::getPage().

Parameters
nameThe new page name. The string is copied.
See Also
getName(), IlvNotebook::getPage().
IlvNamedProperty* IlvNotebookPage::setNamedProperty ( IlvNamedProperty property)

Sets a named property of the object.

Parameters
propertyThe named property.
Returns
The named property that was previously associated with this object having the same name, so that you can delete it or keep it for further handling. If no previous named property was associated with this object having the name property, this function returns 0.
See Also
getNamedProperty(), removeNamedProperty().
void IlvNotebookPage::setProperty ( const IlSymbol key,
IlAny  value 
)

Sets a property to the object.

Parameters
keyThe symbol that specifies the property.
valueThe new value for the property. If value is 0, the property is removed.
See Also
removeProperty(), getProperty(), hasProperty().
void IlvNotebookPage::setSensitive ( IlBoolean  value)

Changes the sensitivity of the page.

A page that is not sensitive cannot be selected.

Parameters
valueA Boolean specifying whether the page should be sensitive.
See Also
isSensitive().
void IlvNotebookPage::setView ( IlvView view)

Changes the view associated with the page.

The view passed to setView() must be a subview.

Parameters
viewThe new view associated with this page. The previous view is deleted
See Also
getView().
virtual void IlvNotebookPage::write ( IlvOutputFile file) const
virtual

Writes an object description to a file.

Writes out, in a file, the object description. This description contains all the information necessary to create an exact copy of this object by means of the member function read().

Parameters
fileThe name of the file to be written to.
See Also
DeclareNotebookPageInfoRO(), DeclareNotebookPageInfo(), IlvPredefinedNotebookPageIOMembers().

© Copyright 2015, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.