rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Gadgets Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IlvNotebookPage Class Reference

Gadget-related class. More...

#include <ilviews/gadgets/notebook.h>

List of all members.

Public Member Functions

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

Static Public Member Functions

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

Friends

class IlvNotebook
class IlvNotebookMLFHandler
class IlvNotebookWLFHandler

Detailed Description

Gadget-related class.

Library: ilvadvgdt

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

IlvNotebookPagea.gif


- 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:
notebook The notebook that will contain the page.
label The label displayed by the tab of the page.
bitmap The bitmap displayed by the tab of the page.
transparent Obsolete.
filename The 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:
parent The parent view of the created view.
rect The 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:
dst The drawing destination port.
pageRect The rectangle of the page, with the margin defined in the notebook taken into account.
t The transformer through which the notebook is drawn.
clip The 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:
dst The drawing destination port.
rect The bounding box of the tab.
clip The 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, IlvBitmap.
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:
name The 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:
key The 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:
width The width of the tab.
height The 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:
key The 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:

 IlvNotebookPage*
 MyClass::read(IlvInputFile& file, IlvNotebook* notebook)
 {
     return new MyClass(file, notebook);
 }
Parameters:
file The file to be read from.
notebook The notebook that contains the page.
See also:
DeclareNotebookPageInfoRO, DeclareNotebookPageInfo, IlvPredefinedNotebookPageIOMembers.
Warning:
[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:
name The 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:
key The 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:
color The new color for this page. color is locked. The previous color is unlocked. if this parameter is null, then the notebook page inherits its color from its associated notebook.
void IlvNotebookPage::setBitmap ( IlvBitmap bitmap  ) 

Changes the page bitmap.

Parameters:
bitmap The 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:
filename The 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:
bitmap The new insensitive bitmap.
See also:
getInsensitiveBitmap, getBitmap, IlvBitmap.
void IlvNotebookPage::setLabel ( const char *  label  ) 

Changes the page label.

Parameters:
label The 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:
name The 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:
property The 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:
key The symbol that specifies the property.
value The 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:
value A 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:
The 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:
file The name of the file to be written to.
See also:
DeclareNotebookPageInfoRO, DeclareNotebookPageInfo, IlvPredefinedNotebookPageIOMembers.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

© Copyright 2012, 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.