Rogue Wave Views 5.6 |
Rogue Wave Views |
Rogue Wave Views Documentation Home |
View container class. More...
#include <ilviews/contain/contain.h>
Public Member Functions | |
IlvContainer (IlvDisplay *, const char *name, const char *title, const IlvRect &dims, IlUInt properties, IlBoolean useacc=((IlBoolean) 1), IlBoolean visible=((IlBoolean) 1), IlvSystemView transientFor=0) | |
Constructor. | |
IlvContainer (IlvDisplay *, const char *name, const char *title, const IlvRect &dims, IlBoolean useacc=((IlBoolean) 1), IlBoolean visible=((IlBoolean) 1)) | |
Constructor. | |
IlvContainer (IlvDisplay *, IlvSystemView w, IlBoolean useacc=((IlBoolean) 1)) | |
Constructor. | |
IlvContainer (IlvDisplay *, IlvSystemView parent, const IlvRect &size, IlBoolean useacc=((IlBoolean) 1), IlBoolean visible=((IlBoolean) 1)) | |
Constructor. | |
IlvContainer (IlvAbstractView *parent, const IlvRect &size, IlBoolean useacc=((IlBoolean) 1), IlBoolean visible=((IlBoolean) 1)) | |
Constructor. | |
virtual | ~IlvContainer () |
Destructor. | |
void | abortReDraw () |
Aborts a redraw. | |
void | addAccelerator (IlvContainerAction action, IlvEventType type, IlUShort data=0, IlUShort modifiers=0, IlAny userArg=0, IlUShort optModifiers=0) |
Adds an accelerator to the container. | |
void | addAccelerator (IlvContainerAccelerator *accelerator) |
Adds or replaces a specified accelerator. | |
virtual void | addObject (const char *objectName, IlvGraphic *obj, IlBoolean redraw=((IlBoolean) 0)) |
Adds an object to the top of the container list and names the object. | |
virtual void | addObject (IlvGraphic *obj, IlBoolean redraw=((IlBoolean) 0)) |
Adds an object to the top of the container list. | |
virtual IlBoolean | addSmartSet (IlvSmartSet *, IlBoolean redraw=((IlBoolean) 1)) |
Adds a SmartSet. | |
void | addTransformer (const IlvTransformer &t) |
Adds to the transformation function. | |
virtual void | afterDraw (IlvPort *dst, const IlvTransformer *t=0, const IlvRegion *clip=0) |
Performs a specified draw after a redraw. | |
virtual void | applyToObject (IlvGraphic *obj, IlvApplyObject func, IlAny arg, IlBoolean reDraw=((IlBoolean) 0)) |
Applies a user function to an object. | |
void | applyToObjects (IlvApplyObject func, IlAny arg, IlBoolean redraw=((IlBoolean) 0)) |
Applies a user function to all objects. | |
void | applyToTaggedObjects (const IlSymbol *tag, IlvApplyObject func, IlAny arg, IlBoolean reDraw=((IlBoolean) 0)) |
Applies a user function to all objects with a specified tag. | |
virtual IlBoolean | applyValue (const IlvValue &) |
Applies an accessor. | |
virtual void | beforeDraw (IlvPort *dst, const IlvTransformer *t=0, const IlvRegion *clip=0) |
Performs a specified draw before a redraw. | |
void | bufferedDraw (const IlvGraphic *object) |
Redraws an object with double buffering. | |
void | bufferedDraw (const IlvRegion ®ion) |
Redraws a region with double buffering. | |
void | bufferedDraw (const IlvRect &rect) |
Redraws a rectangle with double buffering. | |
IlvGraphic * | contains (const IlvPoint &p) const |
Checks whether a point is in the container's objects. | |
virtual IlvViewInputFile * | createInputFile (istream &stream) |
Creates an input file. | |
void | disableRedrawTask () |
Disactivates the lazy redraw mechanism. | |
virtual IlBoolean | dispatchToObjects (IlvEvent &event) |
Dispatches an event to an object. | |
void | draw (const IlvRect *rect) |
Draws all objects within a rectangle. | |
virtual void | draw (IlvPort *dst, const IlvTransformer *t=0, const IlvRegion *clip=0) |
Draws all objects with transformation and a clipping region. | |
virtual void | draw (const IlvRegion *region=0) |
Draws all objects in the container with a clipping region. | |
virtual void | fitToContents () |
Resizes the container to fit the overall bounding box of the graphic objects. | |
virtual void | fitTransformerToContents (IlBoolean redraw=((IlBoolean) 1)) |
Resizes the objects to fit the container. | |
virtual void | flushRedraw () |
Performs the actual redraw of invalid regions. | |
IlBoolean | getAccelerator (IlvContainerAction *action, IlAny *userarg, IlvEventType type, IlUShort buttonOrKey=0, IlUShort modifiers=0) const |
Gets an accelerator by action and user argument. | |
IlvContainerAccelerator * | getAccelerator (IlvEventType type, IlUShort button=0, IlUShort modifiers=0) const |
Gets an accelerator by event. | |
IlUInt | getCardinal () const |
Gets the number of objects in the container. | |
IlInt | getIndex (IlvGraphic *) const |
Gets an index. | |
IlvGraphic * | getObject (const char *) const |
Gets an object by name. | |
IlvGraphic * | getObject (IlUInt index) const |
Gets an object by index. | |
IlvViewObjectInteractor * | getObjectInteractor (const IlvGraphic *g) const |
Gets an object interactor. | |
const char * | getObjectName (const IlvGraphic *obj) const |
Gets an object name. | |
IlvGraphic *const * | getObjects (IlUInt &count) const |
Gets all objects in the container. | |
IlvSmartSet * | getSmartSet (const char *name) const |
Gets a SmartSet. | |
IlvGraphic *const * | getTaggedObjects (const IlSymbol *tag, IlUInt &count) const |
Gets all objects with a specified tag. | |
IlvTransformer * | getTransformer () const |
Gets the transformation function. | |
virtual void | handleExpose (IlvEvent &) |
Handles a newly exposed region. | |
virtual void | handleInput (IlvEvent &) |
Handles an input event. | |
virtual void | hide () |
Hides the view. | |
void | initReDraw () |
Initializes an invalidated region to empty. | |
virtual void | insertObject (IlvGraphic *obj, IlBoolean redraw=((IlBoolean) 0)) |
Inserts the object at the bottom of the container list. | |
void | invalidateRegion (const IlvRegionUpdater &updater, const IlvGraphic *graphic=0) |
Updates the invalidated region. | |
void | invalidateRegion (const IlvRegion &rect) |
Invalidates a region.. | |
void | invalidateRegion (const IlvRect &rect) |
Invalidates a rectangle's region. | |
void | invalidateRegion (const IlvGraphic *object) |
Invalidates an object's region. | |
IlBoolean | isDoubleBuffering () const |
Tests the double buffering setting. | |
IlBoolean | isInvalidating () const |
Indicates whether the container is in a phase of invalidating regions. | |
IlBoolean | isVisible (const IlvGraphic *obj) const |
Tests the visibility setting of an object. | |
IlBoolean | isVisible () const |
Retrieves the visibility. | |
virtual IlvValue & | queryValue (IlvValue &) const |
Retrieves the value of an accessor. | |
virtual IlBoolean | read (istream &stream) |
Loads an Rogue Wave Views data file from the input stream. | |
virtual IlBoolean | readFile (const char *filename) |
Reads an Rogue Wave Views data file. | |
void | reDraw (const IlvRect *rect) |
Redraws all objects within a rectangle. | |
virtual void | reDraw (const IlvRegion *region=0) |
Redraws all objects in the container with a clipping region. | |
void | reDrawObj (IlvGraphic *obj) |
Redraws an object. | |
void | reDrawView (IlBoolean erase=((IlBoolean) 1), IlBoolean buffered=((IlBoolean) 0)) |
Redraws a view. | |
void | registerCallback (const char *callbackName, IlvGraphicCallback callback) |
Registers a callback. | |
void | removeAccelerator (IlvEventType type, IlUShort buttonOrKey=0, IlUShort modifiers=0) |
Removes an accelerator by event. | |
void | removeAccelerator (IlvContainerAccelerator *acc) |
Removes a specified accelerator. | |
virtual IlBoolean | removeObject (IlvGraphic *obj, IlBoolean redraw=((IlBoolean) 0)) |
Removes an object from the container. | |
virtual void | removeObjects (IlBoolean destroy=((IlBoolean) 1), IlBoolean redraw=((IlBoolean) 1)) |
Removes all objects from the container. | |
virtual IlBoolean | removeSmartSet (IlvSmartSet *) |
Removes a SmartSet. | |
void | removeTaggedObjects (const IlSymbol *tag, IlBoolean destroy=((IlBoolean) 1), IlBoolean reDraw=((IlBoolean) 1)) |
Removes all objects with a specified tag. | |
virtual IlvGraphic * | replace (IlvGraphic *oldObject, IlvGraphic *newObject, IlBoolean redraw=((IlBoolean) 0)) |
Replaces an object. | |
virtual void | setBackground (IlvColor *c) |
Sets the background color of this view. | |
virtual void | setBackgroundBitmap (IlvBitmap *) |
Sets the background bitmap of this view. | |
IlBoolean | setDoubleBuffering (IlBoolean value) |
Sets double buffering. | |
IlBoolean | setObjectInteractor (IlvGraphic *obj, IlvViewObjectInteractor *inter) |
Sets an object interactor on a graphic object. | |
virtual void | setObjectName (IlvGraphic *obj, const char *s) |
Sets an object name. | |
void | setTransformer (const IlvTransformer *t=0) |
Sets the transformation function. | |
virtual void | setTransformer (const IlvTransformer &) |
Applies another transformer to the coordinates provided for the drawing functions. | |
virtual void | setVisible (IlvGraphic *obj, IlBoolean visible, IlBoolean redraw=((IlBoolean) 0)) |
Sets the visibility of an object. | |
virtual IlBoolean | shortCut (IlvEvent &event) |
Verbose:. | |
virtual void | show () |
Shows the view. | |
virtual void | swap (IlvGraphic *, IlvGraphic *) |
Swaps two objects. | |
void | translateView (IlvPos dx, IlvPos dy, IlBoolean redraw=((IlBoolean) 1)) |
Translates the current view. | |
void | unregisterCallback (const char *callbackName) |
Unregisters a callback. | |
void | visibleBBox (IlvRect &rect) const |
Determines the visible bounding box of the container. | |
void | zoomView (const IlvPoint ¢er, IlFloat scalex, IlFloat scaley=0.0, IlBoolean redraw=((IlBoolean) 1)) |
Zooms the current view. | |
Static Public Member Functions | |
static IlvContainer * | GetContainer (const IlvGraphic *) |
Gets an object's container. | |
Protected Member Functions | |
virtual void | eraseRegion (const IlvRegion ®ion) |
Erases a region. |
View container class.
Library: views
A container coordinates the storage and the display of graphic objects.
IlvContainer::IlvContainer | ( | IlvAbstractView * | parent, | |
const IlvRect & | size, | |||
IlBoolean | useacc = ((IlBoolean) 1) , |
|||
IlBoolean | visible = ((IlBoolean) 1) | |||
) |
Constructor.
Initializes a container that is a child of the parent view. The dimensions of the container are indicated by size. The new container is not visible if visible is set to IlFalse
.
parent | The parent view. | |
size | The dimensions of the container. | |
useacc | This optional Boolean parameter must be set to IlFalse if you do not want the default accelerators to be installed at creation time. | |
visible | A Boolean value specifying whether the container is to be initially visible (IlTrue ) or invisible (IlFalse ). |
IlvContainer::IlvContainer | ( | IlvDisplay * | , | |
IlvSystemView | parent, | |||
const IlvRect & | size, | |||
IlBoolean | useacc = ((IlBoolean) 1) , |
|||
IlBoolean | visible = ((IlBoolean) 1) | |||
) |
Constructor.
Creates a container that is a child of the existing system view indicated by parent.
display | The display instance. | |
parent | The parent system view. | |
size | The dimensions of the container. | |
useacc | This optional Boolean parameter must be set to IlFalse if you do not want the default accelerators to be installed at creation time. | |
visible | A Boolean value specifying whether the container is to be initially visible (IlTrue ) or invisible (IlFalse ). |
IlvContainer::IlvContainer | ( | IlvDisplay * | , | |
IlvSystemView | w, | |||
IlBoolean | useacc = ((IlBoolean) 1) | |||
) |
Constructor.
Creates a new container object by using the existing system view available.
display | The display instance. | |
available | The existing system view. | |
useacc | This optional Boolean parameter must be set to IlFalse if you do not want the default accelerators to be installed at creation time. |
IlvContainer::IlvContainer | ( | IlvDisplay * | , | |
const char * | name, | |||
const char * | title, | |||
const IlvRect & | dims, | |||
IlBoolean | useacc = ((IlBoolean) 1) , |
|||
IlBoolean | visible = ((IlBoolean) 1) | |||
) |
Constructor.
Initializes a new container object by creating a new top window with the provided parameters.
display | The display window. | |
name | The name of the view. | |
title | The title of this top window. | |
size | The initial location and size of the view, relative to the root window of display. | |
useacc | This optional Boolean parameter must be set to IlFalse if you do not want the default accelerators to be installed at creation time. |
IlvContainer::IlvContainer | ( | IlvDisplay * | , | |
const char * | name, | |||
const char * | title, | |||
const IlvRect & | dims, | |||
IlUInt | properties, | |||
IlBoolean | useacc = ((IlBoolean) 1) , |
|||
IlBoolean | visible = ((IlBoolean) 1) , |
|||
IlvSystemView | transientFor = 0 | |||
) |
Constructor.
Initializes a new container object by creating a new top window with the provided parameters. This constructor lets you specify top-level windows properties.
The useacc optional parameter must be set to IlFalse
if you don't want the default accelerators to be installed at creation time.
display | The display instance. | |
name | The name of the view. | |
title | The title of this top window. | |
size | The initial location and size of the view, relative to the root window of display. | |
properties | The properties of the view. | |
useacc | This optional Boolean parameter must be set to IlFalse if you do not want the default accelerators to be installed at creation time. | |
visible | A Boolean value specifying whether the view is to be initially visible (IlTrue ) or invisible (IlFalse ). | |
transientFor | The possible system view for which this view is transient. If unspecified or set to 0 , this view will not be transient for any view. |
virtual IlvContainer::~IlvContainer | ( | ) | [virtual] |
Destructor.
The destructor deletes all the graphic objects managed by the container.
void IlvContainer::abortReDraw | ( | ) |
Aborts a redraw.
Forgets all invalidated areas. If calls to initReDraw
were embedded, they are all reset.
void IlvContainer::addAccelerator | ( | IlvContainerAction | action, | |
IlvEventType | type, | |||
IlUShort | data = 0 , |
|||
IlUShort | modifiers = 0 , |
|||
IlAny | userArg = 0 , |
|||
IlUShort | optModifiers = 0 | |||
) |
Adds an accelerator to the container.
Creates an IlvContainerAccelerator
using the same arguments and adds it to the IlvContainer
accelerator list (see the constructor for argument descriptions). When the container receives an event, it checks its accelerator list. If an appropriate accelerator is found, that is, accelerator->trigger(<event description>)
returns IlTrue
, then accelerator->activate
is called.
action | The user function used as the accelerator action. | |
type | The accelerator event type. | |
data | The accelerator event data (button or key). | |
modifiers | The accelerator mandatory event modifiers. | |
userArg | The accelerator action user argument. | |
optModifiers | The accelerator optional event modifiers. |
void IlvContainer::addAccelerator | ( | IlvContainerAccelerator * | accelerator | ) |
Adds or replaces a specified accelerator.
Installs an accelerator as a new accelerator in this container. If there already was a matching accelerator (same type, data (button or key), and modifiers), then the previous accelerator is removed (but not destroyed).
accelerator | The accelerator. |
virtual void IlvContainer::addObject | ( | const char * | objectName, | |
IlvGraphic * | obj, | |||
IlBoolean | redraw = ((IlBoolean) 0) | |||
) | [virtual] |
Adds an object to the top of the container list and names the object.
Calls addObject(obj, redraw)
then setObjectName(name)
.
name | The name of the object. | |
obj | The object to be added. | |
redraw | If set to IlTrue the container is redrawn. If it is set to IlFalse , the container will not be redrawn. |
virtual void IlvContainer::addObject | ( | IlvGraphic * | obj, | |
IlBoolean | redraw = ((IlBoolean) 0) | |||
) | [virtual] |
Adds an object to the top of the container list.
Adds obj to the set of objects managed by the IlvContainer
object. The object is appended at the final position. In other words, the new object is placed "on top of" all the others.
obj | The object to be added. | |
redraw | If set to IlTrue the container is updated. |
virtual IlBoolean IlvContainer::addSmartSet | ( | IlvSmartSet * | , | |
IlBoolean | redraw = ((IlBoolean) 1) | |||
) | [virtual] |
Adds a SmartSet.
Adds the SmartSet set to this container. This set must have a name. If there already is a SmartSet in this container with the same name, the SmartSet is renamed by adding 1
at the end of the name, or by incrementing the decimal value at the end of the name.
If the SmartSet contains objects that are not stored in this container, they are added to the container, and refresh is performed if redraw is set to IlTrue
.
set | A SmartSet to be added. | |
redraw | If set to IlTrue the container is redrawn. If it is set to IlFalse , the container will not be redrawn. |
IlFalse
on error, that is, if set contains objects located in another container. void IlvContainer::addTransformer | ( | const IlvTransformer & | t | ) |
Adds to the transformation function.
Composes the current transformer with the one given in t and sets the resulting transformer as the new current one for this container object. The transformer is internally copied during this function call.
t | The additional transformer. |
virtual void IlvContainer::afterDraw | ( | IlvPort * | dst, | |
const IlvTransformer * | t = 0 , |
|||
const IlvRegion * | clip = 0 | |||
) | [virtual] |
Performs a specified draw after a redraw.
Acts in the same way as beforeDraw
but is called after the objects in the container have been drawn. This lets you create additional drawings on top of the container objects.
dst | The destination drawing port. | |
t | The transformation to be applied, or 0 if none. | |
clip | The clipping region, or 0 if none. |
virtual void IlvContainer::applyToObject | ( | IlvGraphic * | obj, | |
IlvApplyObject | func, | |||
IlAny | arg, | |||
IlBoolean | reDraw = ((IlBoolean) 0) | |||
) | [virtual] |
Applies a user function to an object.
Applies the func user-defined function, typed IlvApplyObject
, to the object obj which receives the additional arg parameter. You can set redraw to IlTrue
to update the object's aspect automatically.
obj | The object to which the function is applied. | |
func | The user function. | |
arg | A user argument passed with the user function. | |
reDraw | If set to IlTrue the object is redrawn. If it is set to IlFalse , the object will not be redrawn. |
void IlvContainer::applyToObjects | ( | IlvApplyObject | func, | |
IlAny | arg, | |||
IlBoolean | redraw = ((IlBoolean) 0) | |||
) |
Applies a user function to all objects.
Applies the func user-defined function, typed IlvApplyObject
, to each object of the IlvContainer
which receives the additional arg parameter. You can set redraw to IlTrue
to update the objects' aspect automatically. This redraws all the objects simultaneously (and not one by one).
func | The user function. | |
arg | A user argument passed with the user function. | |
redraw | If set to IlTrue the container is redrawn. If it is set to IlFalse , the container will not be redrawn. |
void IlvContainer::applyToTaggedObjects | ( | const IlSymbol * | tag, | |
IlvApplyObject | func, | |||
IlAny | arg, | |||
IlBoolean | reDraw = ((IlBoolean) 0) | |||
) |
Applies a user function to all objects with a specified tag.
Calls the IlvApplyObject
function func on every object tagged with tag in the container. This function is similar to the method applyToObject
.
tag | The tag that defines the objects to be included. | |
func | The user function. | |
arg | A user argument passed with the user function. | |
reDraw | If set to IlTrue the container is redrawn. If it is set to IlFalse , the container will not be redrawn. |
Applies an accessor.
This member function is called by the changeValue
function and must not be called directly.
Moreover, no drawing operations are carried out here (and should not be). If you add your own new IlvValue
, do not forget to override applyValue
as well as changeValue
and queryValue
, since applyValue
is called by changeValue
.
val | The new value of the accessor. |
IlTrue
if the accessor was applied, IlFalse
otherwise. Reimplemented from IlvView.
virtual void IlvContainer::beforeDraw | ( | IlvPort * | dst, | |
const IlvTransformer * | t = 0 , |
|||
const IlvRegion * | clip = 0 | |||
) | [virtual] |
Performs a specified draw before a redraw.
Called internally by a container just before it redraws the objects stored in it. Use this function if you need to draw something before the objects stored in the container are drawn. Use the dst parameter as the output port for your drawing functions. It may differ from the output port of the container draw
.
The clip parameter gives the clipping region that should be used.
dst | The destination drawing port. | |
t | The transformation to be applied, or 0 if none. | |
clip | The clipping region, or 0 if none. |
void IlvContainer::bufferedDraw | ( | const IlvGraphic * | object | ) |
Redraws an object with double buffering.
Performs temporary drawing in a hidden pixmap, then displays the pixmap on the screen at once. The main difference with double buffering is whether the operation is localized to a rectangle, a region, or an object. This function draws object (in the coordinate system of the object).
object | The object to be redrawn with double buffering. |
void IlvContainer::bufferedDraw | ( | const IlvRegion & | region | ) |
Redraws a region with double buffering.
Performs temporary drawing in a hidden pixmap, then displays the pixmap on the screen at once. The main difference with double buffering is whether the operation is localized to a rectangle, a region, or an object. This function draws the area included in region
(in the coordinate system of the container).
region | The region to be redrawn with double buffering. |
void IlvContainer::bufferedDraw | ( | const IlvRect & | rect | ) |
Redraws a rectangle with double buffering.
Performs temporary drawing in a hidden pixmap, then displays the pixmap on the screen at once. The main difference with double buffering is whether the operation is localized to a rectangle (this member function), a region, or an object.
rect | The rectangle to be redrawn with double buffering. |
IlvGraphic* IlvContainer::contains | ( | const IlvPoint & | p | ) | const |
Checks whether a point is in the container's objects.
Returns the topmost IlvGraphic
object of this container that contains the given point, if such an object exists. If the object does not exist, the function returns 0
.
p | The point to be tested. |
0
if none. virtual IlvViewInputFile* IlvContainer::createInputFile | ( | istream & | stream | ) | [virtual] |
Creates an input file.
Creates an IlvViewInputFile
from an input stream.
stream | The input stream. |
void IlvContainer::disableRedrawTask | ( | ) |
Disactivates the lazy redraw mechanism.
This function prevents the lazy redraw task from happening when the process is idle. Any subsequent call to invalidateRegion()
will restore the lazy redraw mechanism and reschedule the task.
Dispatches an event to an object.
Dispatches event to an object interactor if one exists.
event | The event. |
IlFalse
if the event is not handled by an interactor. void IlvContainer::draw | ( | const IlvRect * | rect | ) |
Draws all objects within a rectangle.
Creates an IlvRegion
from rect and calls the previous draw
member function.
rect | The initial rectangle stored in this region. |
virtual void IlvContainer::draw | ( | IlvPort * | dst, | |
const IlvTransformer * | t = 0 , |
|||
const IlvRegion * | clip = 0 | |||
) | [virtual] |
Draws all objects with transformation and a clipping region.
Draws all the objects that are stored in this IlvContainer
object in the drawing port dst, with the transformer t and the clipping region clip. This virtual function lets you draw the container contents on any destination port, with any possible drawing parameters. It was designed for dumping.
dst | The destination drawing port. | |
t | The transformation to be applied, or 0 if none. | |
clip | The clipping region, or 0 if none. |
virtual void IlvContainer::draw | ( | const IlvRegion * | region = 0 |
) | [virtual] |
Draws all objects in the container with a clipping region.
Draws all the IlvGraphic
objects that are stored in this IlvContainer
object.
clip | The clipping region, or 0 if none. |
Reimplemented from IlvDrawingView.
virtual void IlvContainer::eraseRegion | ( | const IlvRegion & | region | ) | [protected, virtual] |
Erases a region.
Erases the region region.
region | The region to be erased. |
virtual void IlvContainer::fitToContents | ( | ) | [virtual] |
Resizes the container to fit the overall bounding box of the graphic objects.
Resizes the container so it contains all the visible objects. However, the top left coordinates of the view remain at the same location.
virtual void IlvContainer::fitTransformerToContents | ( | IlBoolean | redraw = ((IlBoolean) 1) |
) | [virtual] |
Resizes the objects to fit the container.
Computes a new transformer (scaling and translation only) for this container so that all objects that have the visibility attribute set to IlTrue
can be seen in the view.
The computation is not always accurate: it assumes that the bounding box of a transformed graphic object is equal to the transformed bounding box, which is not true for non-zoomable objects. If there are such objects in the container, several calls to the method may be necessary to obtain the desired result.
redraw | If set to IlTrue the container is redrawn after the transformation. If it is set to IlFalse , the container will not be redrawn. |
virtual void IlvContainer::flushRedraw | ( | ) | [virtual] |
Performs the actual redraw of invalid regions.
This function is called as an idle procedure just before a process becomes idle to handle all pending drawing tasks accumulated by calls to invalidateRegion(). You can call it if you want to force the refresh of your view at a given point in your program.
IlvEventLoop::addIdleProc
. Reimplemented from IlvPort.
IlBoolean IlvContainer::getAccelerator | ( | IlvContainerAction * | action, | |
IlAny * | userarg, | |||
IlvEventType | type, | |||
IlUShort | buttonOrKey = 0 , |
|||
IlUShort | modifiers = 0 | |||
) | const |
Gets an accelerator by action and user argument.
Lets you query a container for a particular accelerator action and user argument. This function returns IlTrue
if this accelerator exists in the container and fills in the action and userArg parameters if they are valid pointers (that is, non-0
).
If no such accelerator exists, it returns IlFalse
. You can thus test the existence of a particular accelerator by calling the * member function getAccelerator
with 0
values for both action and userArg.
action | The returned accelerator action, or 0 . | |
userArg | The returned user argument, or 0 . | |
type | The accelerator event type. | |
buttonOrKey | The accelerator event data, or 0 . | |
modifiers | The accelerator mandatory event modifiers, or 0 . |
IlTrue
if the accelerator exists orIlFalse
if not. IlvContainerAccelerator* IlvContainer::getAccelerator | ( | IlvEventType | type, | |
IlUShort | button = 0 , |
|||
IlUShort | modifiers = 0 | |||
) | const |
Gets an accelerator by event.
Returns a pointer to the IlvContainerAccelerator
instance that matches this event. If an accelerator to match this event does not exist, then 0
is returned.
- Predefined accelerators for containers -
IlvKeyUp
i
Sets the transformer to identity
IlvKeyDown
Right
Moves view to the left.
IlvKeyDown
Left
Moves view to the right.
IlvKeyDown
Down
Moves view to the top (decreasing x).
IlvKeyDown
Up
Moves view to the bottom (increasing x).
IlvKeyUp
Z
Zooms down into the view.
IlvKeyUp
U
Zooms out from the view.
IlvKeyDown
R
Rotates view 90
degrees counter-clockwise.
IlvKeyDown
f
Computes a new transformer so that every object can be seen.
type | The accelerator event type. | |
button | The accelerator event data, or 0 . | |
mods | The accelerator mandatory event modifiers, or 0 . |
IlvContainerAccelerator
instance that matches this event, or 0
if none. IlUInt IlvContainer::getCardinal | ( | ) | const |
Gets the number of objects in the container.
Reimplemented from IlvAbstractView.
static IlvContainer* IlvContainer::GetContainer | ( | const IlvGraphic * | ) | [static] |
Gets an object's container.
Use this static member function to retrieve the container where the specified object is stored. You cannot store an object in more than one container (or manager).
obj | The object. |
0
if this object is not stored in any container. IlInt IlvContainer::getIndex | ( | IlvGraphic * | ) | const |
Gets an index.
Returns the index of object stored in the container list. The first object stored has 0
for index. If object is not located in this container, then the value -1 is returned, which must be considered as an error.
object | The object. |
IlvGraphic* IlvContainer::getObject | ( | const char * | ) | const |
Gets an object by name.
Attempts to return the object whose name is name. If no such object exists, then 0
is returned. If this name is shared by more than one object, the first object created in this container that has this name is returned.
name | The name of the object. |
0
if not found. IlvGraphic* IlvContainer::getObject | ( | IlUInt | index | ) | const |
Gets an object by index.
Returns the object stored at index in the container list. If index is greater than the number of objects in the container, this member function returns 0
.
index | The index of the object in the container list. |
0
if the index is invalid. IlvViewObjectInteractor* IlvContainer::getObjectInteractor | ( | const IlvGraphic * | g | ) | const |
Gets an object interactor.
This method is obsolete. Use IlvGraphic::getInteractor
.
IlvGraphic::getInteractor
. const char* IlvContainer::getObjectName | ( | const IlvGraphic * | obj | ) | const |
Gets an object name.
Returns the name of obj.
obj | The object. |
IlvGraphic* const* IlvContainer::getObjects | ( | IlUInt & | count | ) | const |
Gets all objects in the container.
Returns an array of pointers to the objects stored in this container. count is set to the number of objects in this array. The returned array is stored in a temporary buffer. It must not be modified or deleted by the programmer. Moreover, other Rogue Wave Views routines can overwrite this buffer so it should be copied in a safe place if it needs to be persistent.
count | The returned number of objects in the array. |
IlvSmartSet* IlvContainer::getSmartSet | ( | const char * | name | ) | const |
Gets a SmartSet.
name | The name of the SmartSet. |
0
if there is none. IlvGraphic* const* IlvContainer::getTaggedObjects | ( | const IlSymbol * | tag, | |
IlUInt & | count | |||
) | const |
Gets all objects with a specified tag.
Returns an array of pointers to the objects stored in this container and tagged with tag (or 0
if none are found). count is set to the number of objects in this array. The returned array is stored in a temporary buffer. It must not be modified or deleted by the programmer. Moreover, other Rogue Wave Views routines can overwrite this buffer so it should be copied in a safe place if it needs to be persistent.
tag | The tag that defines the objects to be included. | |
count | The returned number of objects found. |
0
if none. IlvTransformer* IlvContainer::getTransformer | ( | ) | const |
Gets the transformation function.
0
is returned, this container has no transformer associated with it; that is, there is identity. virtual void IlvContainer::handleExpose | ( | IlvEvent & | event | ) | [virtual] |
Handles a newly exposed region.
This member function is called when this view reveals new regions that must be updated.
The default implementation calls reDraw
with the relevant exposed region.
event | The event that is received for this expose event. |
Reimplemented from IlvDrawingView.
virtual void IlvContainer::handleInput | ( | IlvEvent & | event | ) | [virtual] |
Handles an input event.
This member function is called when an input event (keystrokes or mouse events) is received by this view.
Its default implementation does nothing.
event | The input event that is received. |
Reimplemented from IlvDrawingView.
virtual void IlvContainer::hide | ( | ) | [virtual] |
Hides the view.
Removes the window from the visible windows on your screen.
Reimplemented from IlvView.
void IlvContainer::initReDraw | ( | ) |
Initializes an invalidated region to empty.
Initializes the invalidated region to an empty region. These calls can be embedded, that is, if there has been a previous call to initReDraw
and no matching reDrawView
or abortReDraw
, then this function does not reset the invalid region.
virtual void IlvContainer::insertObject | ( | IlvGraphic * | obj, | |
IlBoolean | redraw = ((IlBoolean) 0) | |||
) | [virtual] |
Inserts the object at the bottom of the container list.
Adds obj at the beginning of the list, so that the object is displayed behind all the other objects.
obj | The object to be inserted. | |
redraw | If set to IlTrue the container is redrawn. If it is set to IlFalse , the container will not be redrawn. |
void IlvContainer::invalidateRegion | ( | const IlvRegionUpdater & | updater, | |
const IlvGraphic * | graphic = 0 | |||
) |
Updates the invalidated region.
Uses the updater object to update the invalidated region and schedules a redraw task to happen before the process becomes idle.
updater | The object used to update the invalidated region. | |
graphic | The IlvGraphic that requested the invalidation of this region. |
IlvRegionUpdater::update
. void IlvContainer::invalidateRegion | ( | const IlvRegion & | rect | ) |
Invalidates a region..
Adds a rectangle to the update region and schedules a redraw task to happen before the process becomes idle.
rect | The rectangle, specified in manager coordinates. |
void IlvContainer::invalidateRegion | ( | const IlvRect & | rect | ) |
Invalidates a rectangle's region.
Invalidates the rectangle rect in the view coordinate system.
rect | The rectangle defining the invalid region. |
void IlvContainer::invalidateRegion | ( | const IlvGraphic * | object | ) |
Invalidates an object's region.
Invalidates the area covered by object after it has been applied by the current container's transformer.
object | The object defining the invalid region. |
IlBoolean IlvContainer::isDoubleBuffering | ( | ) | const |
Tests the double buffering setting.
IlTrue
) or not (IlFalse
) this container is actually using double buffering. IlBoolean IlvContainer::isInvalidating | ( | ) | const |
Indicates whether the container is in a phase of invalidating regions.
IlTrue
if the container has scheduled some redraw task to perform when the process is idle. IlBoolean IlvContainer::isVisible | ( | const IlvGraphic * | obj | ) | const |
Tests the visibility setting of an object.
obj | The object. |
IlTrue
if the object is visible, or IlFalse
if it is not. IlBoolean IlvContainer::isVisible | ( | ) | const |
Retrieves the visibility.
Reimplemented from IlvView.
virtual IlBoolean IlvContainer::read | ( | istream & | stream | ) | [virtual] |
Loads an Rogue Wave Views data file from the input stream.
Reads a set of IlvGraphic
objects from the input stream specified in stream.
stream | The input stream. |
virtual IlBoolean IlvContainer::readFile | ( | const char * | filename | ) | [virtual] |
Reads an Rogue Wave Views data file.
Reads a set of IlvGraphic
objects from the file named filename. This member function returns IlTrue
on success or IlFalse
if there has been an error. This file is typically created through an IlvManager
object. If the string filename is a relative path name, then the file is searched in each directory referenced in the display path. This function calls the member function IlvContainer::read
.
IlvManager::save
for more information. Rogue Wave Views Studio uses the text mode. filename | The name of the file to be read from. |
void IlvContainer::reDraw | ( | const IlvRect * | rect | ) |
Redraws all objects within a rectangle.
Creates an IlvRegion
from rect and calls the previous reDraw
member function.
rect | The initial rectangle stored in this region. |
virtual void IlvContainer::reDraw | ( | const IlvRegion * | region = 0 |
) | [virtual] |
Redraws all objects in the container with a clipping region.
Erases the entire clipping region, calls the eraseRegion
function, then calls the draw
function, giving this region as a parameter.
clip | The clipping region, or 0 if none. |
Reimplemented from IlvDrawingView.
void IlvContainer::reDrawObj | ( | IlvGraphic * | obj | ) |
Redraws an object.
Redraws the bounding box of the IlvGraphic
object.
obj | The object whose bounding box is to be redrawn. |
void IlvContainer::reDrawView | ( | IlBoolean | erase = ((IlBoolean) 1) , |
|
IlBoolean | buffered = ((IlBoolean) 0) | |||
) |
Redraws a view.
Refreshes all the invalidated regions. The view is first erased if the parameter erase is set to IlTrue
. The redrawing is buffered if the parameter buffered is set to IlTrue
. The invalid region is reset to an empty region.
If there has been more than one call to initReDraw
before reDrawView
is called, this function does nothing.
erase | A Boolean value indicating whether to erase the view (IlTrue ) or not (IlFalse ). | |
buffered | A Boolean value indicating whether the redraw is buffered (IlTrue ) or not (IlFalse ). |
void IlvContainer::registerCallback | ( | const char * | callbackName, | |
IlvGraphicCallback | callback | |||
) |
Registers a callback.
Associates the user function callback with the string callbackName. This string will be registered using the class IlSymbol
.
callbackName | The name under which the callback is registered. | |
callback | The callback to be registered. |
void IlvContainer::removeAccelerator | ( | IlvEventType | type, | |
IlUShort | buttonOrKey = 0 , |
|||
IlUShort | modifiers = 0 | |||
) |
Removes an accelerator by event.
Removes the association between the event description and the action.
type | The accelerator event type. | |
buttonOrKey | The accelerator event data (button or key). | |
modifiers | The accelerator mandatory event modifiers. |
void IlvContainer::removeAccelerator | ( | IlvContainerAccelerator * | acc | ) |
Removes a specified accelerator.
Removes this accelerator from the accelerator list of the container. The acc parameter is not deleted.
acc | The accelerator to be removed. |
virtual IlBoolean IlvContainer::removeObject | ( | IlvGraphic * | obj, | |
IlBoolean | redraw = ((IlBoolean) 0) | |||
) | [virtual] |
Removes an object from the container.
Removes the association between the object and the container view. The object itself is not deleted.
When the object is removed from the container, all the properties related to the container are removed. However the other properties are retained (that is, the object name, its named properties, and so forth).
obj | The object to be removed. | |
redraw | If set to IlTrue the container is redrawn. If it is set to IlFalse , the container will not be redrawn. |
IlFalse
if the object was not stored in this container. virtual void IlvContainer::removeObjects | ( | IlBoolean | destroy = ((IlBoolean) 1) , |
|
IlBoolean | redraw = ((IlBoolean) 1) | |||
) | [virtual] |
Removes all objects from the container.
Removes the association of all objects with the container view. The objects themselves are not deleted if the destroy parameter is set to IlFalse
.
destroy | Set to IlTrue to delete the objects. | |
redraw | If set to IlTrue the container is redrawn. If it is set to IlFalse , the container will not be redrawn. |
virtual IlBoolean IlvContainer::removeSmartSet | ( | IlvSmartSet * | ) | [virtual] |
Removes a SmartSet.
Removes the SmartSet set from the container. The objects are renamed to their intrinsic name.
set | A SmartSet to be removed. |
IlFalse
on error, that is, if set is not in the container. void IlvContainer::removeTaggedObjects | ( | const IlSymbol * | tag, | |
IlBoolean | destroy = ((IlBoolean) 1) , |
|||
IlBoolean | reDraw = ((IlBoolean) 1) | |||
) |
Removes all objects with a specified tag.
Removes from the container all the objects tagged with tag. If destroy is IlTrue
, the objects are deleted. If reDraw is IlTrue
, the container redraws the applicable areas.
tag | The tag that defines the objects to be included. | |
destroy | A Boolean value specifying whether to delete the objects IlTrue or not IlFalse . | |
reDraw | If set to IlTrue the container is redrawn. If it is set to IlFalse , the container will not be redrawn. |
virtual IlvGraphic* IlvContainer::replace | ( | IlvGraphic * | oldObject, | |
IlvGraphic * | newObject, | |||
IlBoolean | redraw = ((IlBoolean) 0) | |||
) | [virtual] |
Replaces an object.
Replaces the IlvGraphic
instance oldObject by the IlvGraphic
object newObject. If redraw is IlTrue
, the reDrawObj
member function of the newObject is called.
oldObject | The object to be replaced. | |
newObject | The new object. | |
redraw | If set to IlTrue the container is redrawn. If it is set to IlFalse , the container will not be redrawn. |
virtual void IlvContainer::setBackground | ( | IlvColor * | c | ) | [virtual] |
Sets the background color of this view.
The color is used when erasing is required. Thus, a call to setBackground
is effective only when regions are erased.
c | The new background color of this view. This color is locked, and the previous color is unlocked. |
Reimplemented from IlvAbstractView.
virtual void IlvContainer::setBackgroundBitmap | ( | IlvBitmap * | b | ) | [virtual] |
Sets the background bitmap of this view.
The bitmap provided (if it is not 0
) is locked. The previous bitmap, if there was one, is unlocked. If the bitmap provided is 0
, the background color is used to ( erase the view. To remove properly a background bitmap that was previously set, you must do the following:
view->setBackgroundBitmap(0); // Remove the background bitmap manager->setBackground(view, view->getBackground()); // Update the manager manager->draw(view, IlTrue); // Redraw the view
This code must be used also for containers (replaces manager by container in code).
Reimplemented from IlvAbstractView.
Sets double buffering.
Use this member function to indicate whether or not this container should use double buffering.
value | A Boolean value indicating if this container should use double buffering (IlTrue ) or not (IlFalse ). |
IlBoolean IlvContainer::setObjectInteractor | ( | IlvGraphic * | obj, | |
IlvViewObjectInteractor * | inter | |||
) |
Sets an object interactor on a graphic object.
This method is obsolete. Use IlvGraphic::setInteractor
.
IlvGraphic::setInteractor
. virtual void IlvContainer::setObjectName | ( | IlvGraphic * | obj, | |
const char * | s | |||
) | [virtual] |
Sets an object name.
Gives a name to obj. This is done by copying the name argument. You are allowed to give the same name to two different objects but the getObject
method will always return the first object whose name is name.
obj | The object. | |
name | The name to be given to obj. |
void IlvContainer::setTransformer | ( | const IlvTransformer * | t = 0 |
) |
Sets the transformation function.
Sets the transformer associated with the container view. A 0
value means no transformer, that is, the identity transformer. The transformer is internally copied during this function call.
t | The transformation to be applied, or 0 if none. |
virtual void IlvContainer::setTransformer | ( | const IlvTransformer & | t | ) | [virtual] |
Applies another transformer to the coordinates provided for the drawing functions.
Applies another transformer to the coordinates provided for the drawing functions.
t | The transformer that is applied. |
Reimplemented from IlvSystemPort.
virtual void IlvContainer::setVisible | ( | IlvGraphic * | obj, | |
IlBoolean | visible, | |||
IlBoolean | redraw = ((IlBoolean) 0) | |||
) | [virtual] |
Sets the visibility of an object.
Changes the visibility of obj to the value given in the visible parameter. This method only works with an object that is already in the container.
obj | The object. | |
visible | A Boolean value indicating whether the object is to be visible (IlTrue ) or invisible (IlFalse ). | |
redraw | If set to IlTrue the container is redrawn. If it is set to IlFalse , the container will not be redrawn. |
Verbose:.
Dispatches event to an accelerator.
event | The incoming event. |
IlTrue
if the accelerator exists; otherwise, it returns IlFalse
. virtual void IlvContainer::show | ( | ) | [virtual] |
Shows the view.
Displays the window on the screen. A window can be created in such a way that you cannot see it upon creation, which allows you to draw on that window before it is displayed.
Reimplemented from IlvView.
virtual void IlvContainer::swap | ( | IlvGraphic * | , | |
IlvGraphic * | ||||
) | [virtual] |
Swaps two objects.
Interchanges the two objects obj1 and obj2 with respect to their order in the list of objects of the container, thus modifying the order in which objects are stacked.
obj1 | The first object. | |
obj2 | The second object. |
Translates the current view.
Composes the current transformer with a translation specified by dx and dy. Set the redraw parameter to IlFalse
to prevent an immediate display update.
dx | Translation along the horizontal axis. | |
dy | Translation along the vertical axis. | |
redraw | If set to IlTrue the container is redrawn after the transformation. If it is set to IlFalse , the container will not be redrawn. |
void IlvContainer::unregisterCallback | ( | const char * | callbackName | ) |
Unregisters a callback.
Removes the callback function which has been registered with the name callbackName, from the callback list.
callbackName | The name of the callback to be removed. |
void IlvContainer::visibleBBox | ( | IlvRect & | rect | ) | const |
Determines the visible bounding box of the container.
Returns the bounding box of all visible objects in the view coordinate system.
rect | The returned visible bounding box. |
void IlvContainer::zoomView | ( | const IlvPoint & | center, | |
IlFloat | scalex, | |||
IlFloat | scaley = 0.0 , |
|||
IlBoolean | redraw = ((IlBoolean) 1) | |||
) |
Zooms the current view.
Composes the current transformer with a transformer that zooms by a factor of scaleX and scaleY, and leaves the center point in the container at its original place. If scaleY is 0
, then we assume the scaling factor is the same in y as in x. Set the redraw parameter to IlFalse
to prevent an immediate display update.
center | The center point of the transformation. | |
scaleX | Zooming factor on the horizontal axis. | |
scaleY | Zooming factor on the vertical axis. | |
redraw | If set to IlTrue the container is redrawn after the transformation. If it is set to IlFalse , the container will not be redrawn. |
© 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.