Views
Gadgets Package API Reference Guide
Product Documentation:
Views Documentation Home
List of all members | Public Member Functions | Static Public Member Functions | Friends
IlvNotebookPage Class Reference

Gadget-related class. More...

#include <ilviews/gadgets/notebook.h>

Inheritance diagram for IlvNotebookPage:
IlvValueInterface IlvStylable

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...
 
virtual IlvContainergetViewAsContainer ()
 Returns the view associated with the page as an IlvContainer. 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
 

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.

Accessors\nAccessors provide a scriptable and uniform way to inspect and modify an object by using its base class methods <tt>IlvValueInterface::queryValue()</tt>, <tt>IlvValueInterface::queryValues()</tt>, <tt>IlvValueInterface::changeValue()</tt>, <tt>IlvValueInterface::changeValues()</tt>.\n\n\nThis class inherits the accessors of its superclass \c IlvValueInterface and adds the following ones:

Name Type Equivalent methods
label String getLabel(), setLabel()
name String getName(), setName()
bitmap Bitmap getBitmap(), setBitmap()
insensitiveBitmap Bitmap getInsensitiveBitmap(), setInsensitiveBitmap()
sensitive Boolean isSensitive(), setSensitive()
fileName String getFileName(), setFileName()
view Object getView(), setView()
background Color setBackground()
notebook Object getNotebook()

Constructor & Destructor Documentation

◆ IlvNotebookPage()

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

◆ createView()

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().

◆ deleteView()

virtual void IlvNotebookPage::deleteView ( )
virtual

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

See also
createView().

◆ deSelect()

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().

◆ draw()

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().

◆ 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().

◆ getBitmap()

IlvBitmap* IlvNotebookPage::getBitmap ( ) const

Returns the page bitmap.

Returns
The page bitmap.
See also
setBitmap(), getInsensitiveBitmap(), IlvBitmap.

◆ getFileName()

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().

◆ getInsensitiveBitmap()

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().

◆ getLabel()

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().

◆ getName()

const char* IlvNotebookPage::getName ( ) const
virtual

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*).

Reimplemented from IlvValueInterface.

◆ getNamedProperty()

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().

◆ getNotebook()

IlvNotebook* IlvNotebookPage::getNotebook ( ) const

Returns the notebook associated with this page.

Returns
The notebook associated with this page.
See also
IlvNotebook::addPage().

◆ getProperty()

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().

◆ getTabSize()

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.

◆ getView()

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().

◆ getViewAsContainer()

virtual IlvContainer* IlvNotebookPage::getViewAsContainer ( )
virtual

Returns the view associated with the page as an IlvContainer.

If the View exists, but is not an IlvContainer, this returns a nullptr. If no such view exists, the method creates the views by calling the IlvNotebook::createView() method.

Returns
The IlvContainer associated with the page.
See also
IlvNotebook::createView(), IlvNotebookPage::createView().

◆ hasProperty()

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().

◆ isSensitive()

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().

◆ read()

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.

◆ removeNamedProperty()

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().

◆ removeProperty()

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().

◆ resized()

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().

◆ select()

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().

◆ setBackground()

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.

◆ setBitmap()

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.

◆ setFileName()

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().

◆ setInsensitiveBitmap()

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().

◆ setLabel()

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.

◆ setName()

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().

◆ setNamedProperty()

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().

◆ setProperty()

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().

◆ setSensitive()

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().

◆ setView()

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().

◆ write()

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().
IlvNotebook
Gadget class.
Definition: notebook.h:316
IlvInputFile
IlvNotebookPage
Gadget-related class.
Definition: notebook.h:1221