Gadget-related class. More...
#include <ilviews/gadgets/notebook.h>
Public Member Functions | |
IlvNotebookPage (IlvNotebook *notebook, const char *label, IlvBitmap *bitmap, IlBoolean transparent, const char *filename) | |
Constructor. More... | |
virtual IlvView * | createView (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... | |
IlvBitmap * | getBitmap () const |
Returns the page bitmap. More... | |
const char * | getFileName () const |
Returns the filename of the page. More... | |
IlvBitmap * | getInsensitiveBitmap () 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... | |
IlvNamedProperty * | getNamedProperty (const IlSymbol *name) const |
Returns a named property of the object. More... | |
IlvNotebook * | getNotebook () 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 IlvView * | getView () |
Returns the view associated with the page. More... | |
virtual IlvContainer * | getViewAsContainer () |
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... | |
IlvNamedProperty * | removeNamedProperty (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... | |
IlvNamedProperty * | setNamedProperty (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 IlvNotebookPage * | read (IlvInputFile &file, IlvNotebook *notebook) |
Reads an object description from a file. More... | |
Friends | |
class | IlvNotebook |
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.
IlvNotebook
.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() |
IlvNotebookPage::IlvNotebookPage | ( | IlvNotebook * | notebook, |
const char * | label, | ||
IlvBitmap * | bitmap, | ||
IlBoolean | transparent, | ||
const char * | filename | ||
) |
Constructor.
Initializes a new instance of the IlvNotebookPage
class.
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. |
|
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
.
parent | The parent view of the created view. |
rect | The size and position of the created view. |
deleteView()
.
|
virtual |
Is called when the view associated with the page is deleted.
createView()
.
|
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.
IlvNotebook::pageDeselected()
, select()
.
|
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.
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. |
drawTab()
.
|
virtual |
Draws the content of the tab.
Draws the content of the tab. You can overload this method to draw whatever you need.
dst | The drawing destination port. |
rect | The bounding box of the tab. |
clip | The clipping area. |
draw()
. IlvBitmap* IlvNotebookPage::getBitmap | ( | ) | const |
Returns the page bitmap.
setBitmap()
, getInsensitiveBitmap()
, IlvBitmap
. const char* IlvNotebookPage::getFileName | ( | ) | const |
Returns the filename of the page.
.ilv
file) associated with the page. 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.
0
if there is none. setInsensitiveBitmap()
, setBitmap()
. const char* IlvNotebookPage::getLabel | ( | ) | const |
Returns the page label.
0
if the tab has no label. setLabel()
.
|
virtual |
Returns the page name.
0
if there is none. Do not modify or delete the returned string. setName()
, IlvNotebook::getPage(const char*)
. Reimplemented from IlvValueInterface.
IlvNamedProperty* IlvNotebookPage::getNamedProperty | ( | const IlSymbol * | name | ) | const |
Returns a named property of the object.
name | The property name. |
null
if no named property matches the name name. setNamedProperty()
, removeNamedProperty()
. IlvNotebook* IlvNotebookPage::getNotebook | ( | ) | const |
Returns the notebook associated with this page.
IlvNotebook::addPage()
. Returns a given property of the object.
key | The symbol that specifies the property. |
0
when no property name matches the key parameter. setProperty()
, removeProperty()
, hasProperty()
. Computes the size of the tab.
Overload this method to change the size of the tab.
width | The width of the tab. |
height | The height of the tab. |
|
virtual |
Returns the view associated with the page.
If no such view exists, the method creates the views by calling the IlvNotebook::createView()
method.
|
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.
Checks that the object has a given property.
key | The symbol that specifies the property. |
IlTrue
if the key property was found, or IlFalse
if the key property was not found. setProperty()
, removeProperty()
, getProperty()
. IlBoolean IlvNotebookPage::isSensitive | ( | ) | const |
Returns a Boolean indicating the page sensitivity.
IlTrue
if the page is sensitive, that is, it can be selected. setSensitive()
.
|
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:
file | The file to be read from. |
notebook | The notebook that contains the page. |
IlvNamedProperty* IlvNotebookPage::removeNamedProperty | ( | IlSymbol * | name | ) |
Removes a named property from the object.
name | The property name. |
0
.getNamedProperty()
, setNamedProperty()
. Removes a property of the object.
key | The symbol that specifies the property. |
IlTrue
if the key property was found, or IlFalse
if the key property was not found. setProperty()
, getProperty()
, hasProperty()
.
|
virtual |
Is called when the page is resized.
The default implementation resizes the view associated with this page.
IlvNotebook::pageResized()
.
|
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.
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.
color | The 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.
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. |
getBitmap()
, setInsensitiveBitmap()
, IlvBitmap
.
|
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.
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. |
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.
bitmap | The new insensitive bitmap. |
getInsensitiveBitmap()
, getBitmap()
. void IlvNotebookPage::setLabel | ( | const char * | label | ) |
Changes the page label.
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()
.
name | The new page name. The string is copied. |
getName()
, IlvNotebook::getPage()
. IlvNamedProperty* IlvNotebookPage::setNamedProperty | ( | IlvNamedProperty * | property | ) |
Sets a named property of the object.
property | The named property. |
0
.getNamedProperty()
, removeNamedProperty()
. Sets a property to the object.
key | The symbol that specifies the property. |
value | The new value for the property. If value is 0 , the property is removed. |
removeProperty()
, getProperty()
, hasProperty()
. void IlvNotebookPage::setSensitive | ( | IlBoolean | value | ) |
Changes the sensitivity of the page.
A page that is not sensitive cannot be selected.
value | A Boolean specifying whether the page should be sensitive. |
isSensitive()
. void IlvNotebookPage::setView | ( | IlvView * | view | ) |
|
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()
.
file | The name of the file to be written to. |