rwlogo

Rogue Wave Views
Manager Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

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

Gadget class. More...

#include <ilviews/gadmgr/gadmgr.h>

Inheritance diagram for IlvGadgetManager:
IlvManager

Public Member Functions

 IlvGadgetManager (IlvDisplay *display, int layers=2, IlBoolean useacc=IlTrue, IlUShort maxInList=IlvMaxObjectsInList, IlUShort maxInNode=IlvMaxObjectsInList)
 Constructor. More...
 
virtual void addObject (IlvGraphic *obj, IlBoolean redraw=IlTrue, int layer=-1)
 Adds an object to the manager. More...
 
virtual void addObject (const char *objectName, IlvGraphic *obj, IlBoolean redraw=IlTrue, int layer=-1)
 Adds a graphic object to a manager, and then names the object. More...
 
virtual void addView (IlvView *view)
 Adds a view to the manager. More...
 
virtual IlBoolean allowFocus (IlBoolean flag)
 Enable or disables keyboard focus handling. More...
 
virtual void applyResize (IlvView *view, IlFloat sx, IlFloat sy, IlBoolean redraw=IlTrue)
 Resolves attachment constraints when the view is resized. More...
 
void applyResize (IlvView *view, IlBoolean redraw=IlTrue)
 Resolves attachment constraints when the view is resized. More...
 
virtual void applyResize (IlvView *view, IlvGraphic *g, IlFloat sx, IlFloat sy, IlBoolean redraw=IlTrue)
 Resolves attachment constraints for an object when the view is resized. More...
 
void applyResize (IlvView *view, IlvGraphic *g, IlBoolean redraw=IlTrue)
 Resolves attachment constraints for an object when the view is resized. More...
 
IlBoolean autoResize (IlBoolean a)
 Sets the auto resizing mechanism. More...
 
virtual IlBoolean dispatchToObjects (IlvEvent &event, IlvView *view)
 Dispatches an event to the appropriate graphic objects. More...
 
virtual void drawFocus (IlvPort *dst, const IlvTransformer *t=0, const IlvRegion *clip=0) const
 Draws the representation of the keyboard focus. More...
 
virtual IlvGraphicgetFirstFocusGraphic () const
 Returns the first graphic object in the focus chain. More...
 
virtual IlvGraphicgetFocus () const
 Returns the graphic object with the keyboard focus. More...
 
virtual IlvGraphicgetGrab () const
 Returns the grabbing graphic object. More...
 
virtual IlvGraphicgetLastFocusGraphic () const
 Returns the last graphic object in the focus chain. More...
 
IlvLookFeelHandlergetLookFeelHandler () const
 Returns the look and feel handler associated with this gadget manager. More...
 
virtual IlvGraphicgetNextFocusGraphic (IlvGraphic *object) const
 Returns the next graphic object in the focus chain. More...
 
virtual IlvGraphicgetPreviousFocusGraphic (IlvGraphic *object) const
 Returns the previous graphic object in the focus chain. More...
 
IlBoolean isAutoResizing () const
 Indicates whether the auto resizing mechanism is enabled. More...
 
virtual IlBoolean isFocusAllowed () const
 Indicates if keyboard focus handling is enabled. More...
 
virtual void moveFocusAfter (IlBoolean redraw=IlTrue)
 Moves the keyboard focus to the next graphic object in the focus chain. More...
 
virtual void moveFocusBefore (IlBoolean redraw=IlTrue)
 Moves the keyboard focus to the previous graphic object in the focus chain. More...
 
virtual void removeGrab ()
 
virtual IlBoolean removeView (IlvView *view)
 Removes a view from the manager view list. More...
 
virtual void setBackground (IlvView *view, IlvColor *color, IlvBitmap *bitmap=0)
 Sets the background of a manager view. More...
 
virtual void setFocus (IlvGraphic *graphic=0, IlBoolean redraw=IlTrue)
 Sets the keyboard focus on a graphic object. More...
 
virtual void setGrab (IlvGraphic *object)
 Sets a graphic object to grab events. More...
 
void setLookFeelHandler (IlvLookFeelHandler *lfh)
 Sets the look and feel handler of this gadget manager. More...
 
virtual void setSelected (IlvGraphic *, IlBoolean selected=IlTrue, IlBoolean erase=IlTrue)
 Selects or deselects a graphic object. More...
 
- Public Member Functions inherited from IlvManager
 IlvManager (IlvDisplay *display, int layers=2, IlBoolean useacc=IlTrue, IlUShort maxInList=IlvMaxObjectsInList, IlUShort maxInNode=IlvMaxObjectsInList)
 Constructor. More...
 
virtual ~IlvManager ()
 Destructor. More...
 
IlvMgrViewgetView (const IlvView *v) const
 Returns the IlvMrgView of a manager view. More...
 
void applyInside (int layer, IlvApplyObject func, IlAny arg, const IlvRect &rect, const IlvTransformer *t=0, IlBoolean redraw=IlTrue)
 Applies a user function to objects of a layer located in a rectangle. More...
 
void applyIntersects (int layer, IlvApplyObject func, IlAny arg, const IlvRect &rect, const IlvTransformer *t=0, IlBoolean redraw=IlTrue)
 Applies a user function to objects of a layer intersecting a rectangle. More...
 
void applyInside (IlvApplyObject func, IlAny arg, const IlvRect &rect, const IlvTransformer *t=0, IlBoolean redraw=IlTrue)
 Applies a user function to graphic objects located in a rectangle. More...
 
void applyIntersects (IlvApplyObject func, IlAny arg, const IlvRect &rect, const IlvTransformer *t=0, IlBoolean redraw=IlTrue)
 Applies a user function to graphic objects intersecting a rectangle. More...
 
IlBoolean isInApply () const
 Indicates if an applyTo...() method is being executed. More...
 
virtual void applyToObjects (IlUInt count, IlvGraphic *const *objects, IlvApplyObject func, IlAny arg, IlBoolean redraw=IlTrue)
 Applies a user function to a set of graphic objects. More...
 
virtual void applyToObjects (IlUInt count, IlvGraphic *const *objects, IlvApplyFunction func, IlAny arg, IlBoolean redraw=IlTrue)
 Applies a user function to a set of graphic objects. More...
 
virtual void applyToObjects (int layer, IlvApplyObject func, IlAny arg, IlBoolean redraw=IlTrue)
 Applies a user function to all graphic objects of a manager layer. More...
 
virtual void applyToObjects (int layer, IlvApplyFunction func, IlAny arg, IlBoolean redraw=IlTrue)
 Applies a user function to the graphic objects of a manager layer. More...
 
virtual void applyToObject (IlvGraphic *object, IlvApplyObject func, IlAny arg, IlBoolean redraw=IlTrue)
 Applies a user function to a graphic object. More...
 
IlvManagerObjectInteractorgetObjectInteractor (const IlvGraphic *object) const
 The object interactor associated with a graphic object. More...
 
IlBoolean setObjectInteractor (IlvGraphic *object, IlvManagerObjectInteractor *i)
 Sets an object interactor on a graphic object. More...
 
void setInteractor (IlvManagerViewInteractor *i, const IlvView *view=0)
 Sets a view interactor on a manager view. More...
 
void removeInteractor (const IlvView *view)
 Removes the view interactor from a manager view. More...
 
IlvManagerViewInteractorgetInteractor (const IlvView *view) const
 Returns the view interactor associated with a manager view. More...
 
void registerCallback (const char *callbackName, IlvGraphicCallback callback)
 Registers a callback and its name. More...
 
void unregisterCallback (const char *callbackName)
 Removes the callback function registered with the specified name from the callback list. More...
 
virtual char * cut (IlUInt &count)
 Saves the selected graphic objects in a string and then deletes them. More...
 
virtual char * copy (IlUInt &count)
 Saves all the selected graphic objects in a string. More...
 
virtual void paste (const IlvView *view, const char *str, IlvPoint &location)
 Reads graphic objects from a string. More...
 
void cutToClipboard ()
 Saves the selected graphic objects in the clipboard and deletes them. More...
 
void copyToClipboard ()
 Saves the selected graphic objects in the clipboard. More...
 
void pasteFromClipboard (const IlvView *view, IlvPoint &location)
 Reads graphic objects from the clipboard and adds them to the manager. More...
 
virtual IlvGraphicSetgroup (IlUInt count, IlvGraphic *const *objects)
 Groups several graphic objects. More...
 
virtual void unGroup (IlvGraphic *object, IlBoolean undoCommand=IlTrue)
 Ungroups the graphic objects of a graphic set. More...
 
virtual void eraseRegion (IlvView *view, const IlvRegion &region) const
 Erases a region of a manager view. More...
 
virtual void draw (IlvView *view, IlBoolean erase, const IlvRegion *clip=0) const
 Draws the graphic objects of the manager in a manager view. More...
 
void draw (IlvPort *dst, const IlvTransformer *t=0, const IlvRegion *region=0, const IlvRegion *clip=0) const
 Draws the contents of a manager in a destination port. More...
 
void draw (int layer, IlvPort *dst, const IlvTransformer *t=0, const IlvRegion *region=0, const IlvRegion *clip=0) const
 Draws the contents of a manager layer in a destination port. More...
 
void draw () const
 Draws the contents of the manager. More...
 
void reDraw () const
 Erases all manager views and draws the contents of the manager. More...
 
void reDraw (const IlvGraphic *object, IlBoolean erase=IlTrue) const
 Draws a graphic object in all manager views. More...
 
void reDraw (IlUInt count, const IlvGraphic *const *objects, IlBoolean erase=IlTrue) const
 Draws a set of graphic objects in all manager views. More...
 
void bufferedDraw (IlvView *view, const IlvRect &rect) const
 Redraws a rectangular area of a manager view by means of a temporary pixmap. More...
 
void bufferedDraw (IlvView *view, const IlvRegion &region) const
 Redraws a region of a manager view by means of a temporary pixmap. More...
 
void bufferedDraw (IlvView *view, const IlvGraphic *object) const
 Draws a graphic object in a manager view by means of a temporary pixmap. More...
 
const char * getName () const
 Returns the name of the manager. More...
 
virtual void setName (const char *name)
 Sets the name of the manager. More...
 
IlvDisplaygetDisplay () const
 Returns the display. More...
 
IlvPalettegetPalette () const
 Returns the manager palette. More...
 
IlBoolean isModified () const
 Indicates whether the manager contents have been modified. More...
 
void setModified (IlBoolean value)
 Sets the modification status of the manager. More...
 
IlUInt getCardinal () const
 Returns the number of graphic objects. More...
 
virtual IlvGraphic *const * getObjects (IlUInt &count) const
 Returns the graphic objects stored in the manager. More...
 
virtual IlvGraphic *const * getObjects (int layer, IlUInt &count) const
 Returns the graphic objects stored in a manager layer. More...
 
virtual IlvGraphiclastContains (const IlvPoint &p, const IlvView *view) const
 Returns the graphic object containing a given point. More...
 
IlvGraphiclastContains (int layer, const IlvPoint &p, const IlvView *view) const
 Returns the graphic object containing a given point in a layer. More...
 
IlvGraphicfilteredLastContains (const IlvPoint &p, const IlvView *view, const IlvGraphicFilter &f) const
 Returns the graphic object containing a given point. More...
 
IlvGraphicfilteredLastContains (int layer, const IlvPoint &p, const IlvView *view, const IlvGraphicFilter &f) const
 Returns the graphic object containing a given point in a layer. More...
 
IlvGraphic *const * allContains (const IlvPoint &p, const IlvView *view, IlUInt &count) const
 Returns all graphic objects containing a given point. More...
 
IlvGraphic *const * allContains (int layer, const IlvPoint &p, const IlvView *view, IlUInt &count) const
 Returns all graphic objects containing a given point in a layer. More...
 
IlvGraphicfirstIntersects (const IlvRegion &tr, const IlvTransformer *t) const
 Returns the first object intersecting a region. More...
 
IlvGraphicfirstIntersects (int layer, const IlvRegion &tr, const IlvTransformer *t) const
 Returns the first object of a layer intersecting a region. More...
 
IlvGraphic *const * allInside (IlUInt &count, const IlvRect &rect, const IlvTransformer *t=0) const
 Returns all graphic objects located in a rectangle. More...
 
IlvGraphic *const * allIntersects (IlUInt &count, const IlvRect &rect, const IlvTransformer *t=0) const
 Returns all graphic objects intersecting a rectangle. More...
 
IlvGraphic *const * allIntersects (int layer, IlUInt &count, const IlvRect &rect, const IlvTransformer *t=0) const
 Returns all graphic objects of a layer intersecting a rectangle. More...
 
IlvGraphic *const * allInside (int layer, IlUInt &count, const IlvRect &rect, const IlvTransformer *t=0) const
 Returns all graphic objects of a layer located in a rectangle. More...
 
IlUInt getCardinal (int layer) const
 Returns the number of graphic objects in a layer. More...
 
virtual void contentsChanged ()
 Called automatically by the manager each time objects are created, removed, moved, or resized in the manager. More...
 
void setCleanFunction (IlvApplyObject func)
 Sets a function to be called when an object is removed from the manager. More...
 
void computeBBox (IlvRect &bbox, const IlvTransformer *t=0) const
 Computes the bounding box of all the objects stored in all the visible layers. More...
 
void computeBBox (IlvRect &bbox, const IlvView *view) const
 Computes the bounding box of all the objects. More...
 
IlvManagerGridgetGrid (const IlvView *view) const
 Returns the manager grid associated with a manager view. More...
 
void setGrid (IlvView *const view, IlvManagerGrid *grid)
 Sets a manager grid on a manager view. More...
 
void snapToGrid (const IlvView *view, IlvPoint &p) const
 Moves a given point to the closest grid point on a manager view. More...
 
IlBoolean transformThroughGrid (const IlvView *view, IlvPoint &p) const
 Transforms and moves a given point on a manager view to the closest grid point in the manager coordinate system. More...
 
virtual IlvManagerInputFilecreateInputFile (std::istream &stream)
 Creates an IlvManagerInputFile from an input stream. More...
 
virtual IlvManagerOutputFilecreateOutputFile (std::ostream &stream) const
 Creates an IlvManagerOutputFile from an output stream. More...
 
virtual void save (std::ostream &stream) const
 Saves all the graphic objects in an output stream. More...
 
virtual void read (std::istream &stream)
 Reads a set of graphic objects from the specified input stream. More...
 
virtual void read (const char *filename)
 Loads a Rogue Wave Views data file. More...
 
IlBoolean installEventHook (const IlvManagerEventHook *hook)
 Installs an event hook on the manager. More...
 
IlvManagerEventHookremoveEventHook (const IlvManagerEventHook *hook)
 Removes and returns an event hook installed on the manager. More...
 
virtual IlBoolean shortCut (IlvEvent &event, IlvView *view)
 Dispatches an incoming event to manager accelerators. More...
 
void addAccelerator (IlvManagerAcceleratorAction f, IlvEventType type, IlUShort buttonOrKey=0, IlUShort modifiers=0, IlAny userArg=0, IlUShort optModifiers=0)
 Adds an accelerator to the manager. More...
 
void removeAccelerator (IlvEventType type, IlUShort buttonOrKey=0, IlUShort modifiers=0)
 Removes the accelerator matching the event description. More...
 
IlBoolean getAccelerator (IlvManagerAcceleratorAction *f, IlAny *userArg, IlvEventType type, IlUShort buttonOrKey=0, IlUShort modifiers=0)
 Gets an accelerator action matching an event description. More...
 
void removeAccelerators ()
 Removes all accelerators. More...
 
IlBoolean setDoubleBuffering (const IlvView *view, IlBoolean useDblBuffering)
 Enables or disables double buffering for a manager view. More...
 
IlBoolean isDoubleBuffering (const IlvView *view) const
 Indicates whether double buffering is used for a manager view. More...
 
IlBoolean isVisible (int layer) const
 Indicates whether a layer is considered visible by the manager. More...
 
void setVisible (int layer, IlBoolean visible)
 Sets the visibility of a layer for the manager. More...
 
IlBoolean isVisible (const IlvView *view, int layer) const
 Indicates the visibility of a layer in a manager view. More...
 
void setVisible (const IlvView *view, int layer, IlBoolean visible)
 Sets the visibility of a layer for a manager view. More...
 
IlBoolean isSelectable (int layer) const
 Indicates if a manager layer allows the selection of its graphic objects. More...
 
void setSelectable (int layer, IlBoolean selectable)
 Enables or disables the selection of graphic objects in a manager layer. More...
 
virtual void pop (IlvGraphic *object, IlBoolean redraw=IlTrue)
 Moves a graphic object higher in the drawing stacking order. More...
 
virtual void push (IlvGraphic *object, IlBoolean redraw=IlTrue)
 Moves a graphic object lower in the drawing stacking order. More...
 
IlvManagerLayergetManagerLayer (const IlvGraphic *object) const
 Returns the IlvManagerLayer instance of a graphic object. More...
 
int getLayer (const IlvGraphic *object) const
 Returns the manager layer containing a given graphic object. More...
 
void setLayer (IlvGraphic *object, int layer, IlBoolean redraw=IlTrue)
 Moves a graphic object to a given manager layer. More...
 
int getNumLayers () const
 Returns the number of manager layers. More...
 
void setNumLayers (int numLayers)
 Sets the number of manager layers. More...
 
void swapLayers (int layer1, int layer2, IlBoolean redraw=IlTrue)
 Swaps the contents of two manager layers. More...
 
void addLayer (int position=-1, IlUShort maxInList=IlvMaxObjectsInList, IlUShort maxInNode=IlvMaxObjectsInList)
 Adds a layer to the manager. More...
 
void removeLayer (int layer=-1)
 Removes a layer from the manager. More...
 
int addLayer (IlvManagerLayer *layer, int position=-1)
 Adds a layer to the manager. More...
 
IlvManagerLayergetManagerLayer (int index) const
 Returns the IlvManagerLayer instance from its index. More...
 
int getLayerIndex (const IlvManagerLayer *layer) const
 Returns the index of a manager layer instance. More...
 
IlvMakeSelection setMakeSelection (IlvMakeSelection func)
 Sets the function that creates a selection object for a graphic object. More...
 
IlBoolean installSelectionHook (const IlvManagerSelectionHook *hook)
 Sets a selection hook on the manager. More...
 
IlvManagerSelectionHookremoveSelectionHook (const IlvManagerSelectionHook *hook)
 Removes the selection hook from the manager, if it is installed. More...
 
void applyToSelections (IlvApplyObject func, IlAny arg, IlBoolean redraw=IlTrue)
 Applies a user function to the selected graphic objects. More...
 
IlUInt numberOfSelections () const
 Returns the number of selected graphic objects. More...
 
virtual void deSelectAll (IlBoolean redraw=IlTrue)
 Deselects the selected graphic objects. More...
 
virtual void selectAll (IlBoolean redraw=IlTrue)
 Selects all the objects of the manager. More...
 
IlvGraphic *const * getSelections (IlUInt &count) const
 Returns the selected graphic objects. More...
 
IlvDrawSelectiongetSelection (const IlvGraphic *object) const
 Returns the selection object of a graphic object. More...
 
IlvGraphic *const * sortObjects (IlvGraphic *const *objs, IlUInt count) const
 Sorts a set of object. More...
 
IlBoolean isSelected (const IlvGraphic *obj) const
 Indicates if a graphic object is selected. More...
 
virtual void duplicate (IlvPos dx=0, IlvPos dy=0)
 Duplicates the selected graphic objects. More...
 
virtual void deleteSelections (IlBoolean redraw=IlTrue)
 Removes the selected objects from the manager and deletes them if undo is disabled. More...
 
IlvSmartSetgetSmartSet (const char *name) const
 Gets a smartset by its name. More...
 
virtual IlBoolean addSmartSet (IlvSmartSet *set, IlBoolean redraw=IlTrue)
 Adds a smartset to the manager. More...
 
virtual IlBoolean removeSmartSet (IlvSmartSet *set)
 Removes a smartset from the manager. More...
 
virtual IlvSmartSetduplicateSmartSet (IlvSmartSet *set, IlvPos dx=0, IlvPos dy=0)
 Makes a copy of a smartset. More...
 
IlBoolean isUndoEnabled () const
 Indicates whether the manager lets you undo commands. More...
 
void setUndoEnabled (IlBoolean enable)
 Enables or disables the possibility of undoing commands in the manager. More...
 
void forgetUndo ()
 Resets the undo command queue. More...
 
virtual void repeat ()
 Executes again the last command.
 
virtual void reDo (IlBoolean unused)
 Executes again the last canceled command. More...
 
virtual void unDo ()
 Cancels the most recent command, leaving manager objects as they were before the previous command was applied.
 
virtual void addCommand (IlvCommand *command)
 Appends a new command to the command queue. More...
 
IlvCommandHistorygetCommandHistory () const
 Returns the object which handles the stack of commands. More...
 
void installViewHook (const IlvManagerViewHook *hook)
 Adds a view hook to the manager. More...
 
void removeViewHook (const IlvManagerViewHook *hook)
 Removes a view hook from the manager. More...
 
IlvManagerViewHook *const * getViewHooks (const IlvView *view, IlUInt &count) const
 Gets the view hooks of a manager view. More...
 
virtual void translateObject (IlvGraphic *object, IlvPos dx, IlvPos dy, IlBoolean redraw=IlTrue)
 Translates a graphic object. More...
 
void moveObject (IlvGraphic *object, IlvPos x, IlvPos y, IlBoolean redraw=IlTrue)
 Moves a graphic object. More...
 
virtual void reshapeObject (IlvGraphic *object, const IlvRect &bbox, IlBoolean redraw=IlTrue)
 Resizes a graphic object to fit in a rectangle. More...
 
virtual void align (IlvPosition alignment, IlBoolean redraw=IlTrue)
 Aligns the selected objects. More...
 
virtual void makeColumn (IlvDim spacing=0, IlBoolean redraw=IlTrue)
 Arranges the selected graphic objects in a column. More...
 
virtual void makeRow (IlvDim spacing=0, IlBoolean redraw=IlTrue)
 Arranges the selected graphic objects in a row. More...
 
virtual void sameWidth (IlBoolean redraw=IlTrue)
 Resizes the selected graphic objects to the same width. More...
 
virtual void sameHeight (IlBoolean redraw=IlTrue)
 Resizes the selected graphic objects to the same height. More...
 
IlvPalettegetCreatorPalette () const
 Gets the default palette used to create graphic objects interactively. More...
 
void setCreatorPalette (IlvPalette *palette)
 Sets the default palette used to create new graphic objects interactively. More...
 
int getInsertionLayer () const
 Gets the default layer used to store the graphic objects created interactively. More...
 
void setInsertionLayer (int layer=-1)
 Sets the layer where new objects created interactively using the predefined interactors will be stored. More...
 
void initReDraws ()
 Initializes the manager so that calls to IlvManager::invalidateRegion() can begin. More...
 
void invalidateRegion (const IlvGraphic *object)
 Invalidates the bounding box of a graphic object. More...
 
void invalidateRegion (const IlvRect &rect)
 Invalidates a rectangle. More...
 
void invalidateRegion (const IlvView *view, const IlvRect &rect)
 Invalidates a rectangle in a manager view. More...
 
void invalidateRegion (const IlvRegionUpdater &updater, const IlvGraphic *g=0)
 Updates the invalidated region. More...
 
void reDrawViews (IlBoolean erase=IlTrue)
 Draws the invalidated regions. More...
 
void abortReDraws ()
 Resets the invalidated regions. More...
 
virtual void flushRedraw ()
 Performs the actual redraw of invalid regions. More...
 
void disableRedrawTask ()
 Deactivates the lazy redraw mechanism. More...
 
IlvReDrawMode getReDrawMode () const
 Returns the redraw mode of the manager. More...
 
void setReDrawMode (IlvReDrawMode reDrawMode)
 Sets the redraw mode of the manager. More...
 
IlBoolean isInvalidating () const
 Indicates whether the manager is in a phase of invalidating regions. More...
 
IlvGraphic *const * getTaggedObjects (const IlSymbol *tag, IlUInt &count) const
 Returns the graphic objects associated with a given tag. More...
 
void setTaggedObjectsSelected (const IlSymbol *tag, IlBoolean selected=IlTrue, IlBoolean redraw=IlTrue)
 Selects or deselects the graphic objects associated with a given tag. More...
 
void removeTaggedObjects (const IlSymbol *tag, IlBoolean redraw=IlTrue)
 Removes graphic objects associated with a given tag. More...
 
void applyToTaggedObjects (const IlSymbol *tag, IlvApplyObject func, IlAny arg, IlBoolean redraw=IlTrue)
 Applies a user function to all graphic objects associated with a given tag. More...
 
IlvView ** getViews (IlUInt &count) const
 Returns the array of views associated with the manager. More...
 
IlvViewgetFirstView () const
 Returns the first view associated with the manager. More...
 
IlvTransformergetTransformer (const IlvView *view) const
 Returns the transformer associated with a manager view. More...
 
virtual void setTransformer (const IlvView *view, IlvTransformer *t=0)
 Sets a transformer to a manager view. More...
 
virtual void addTransformer (const IlvView *view, IlvTransformer *t=0)
 Composes a manager view transformer with another transformer. More...
 
void translateView (const IlvView *view, IlvPos dx, IlvPos dy, IlBoolean redraw=IlTrue)
 Scroll the contents of a manager. More...
 
void zoomView (const IlvView *view, const IlvPoint &point, IlFloat scalex, IlFloat scaley, IlBoolean redraw=IlTrue)
 Zoom the contents of a manager view. More...
 
void rotateView (const IlvView *view, const IlvPoint &point, IlFloat angle, IlBoolean redraw=IlTrue)
 Rotates the contents of a manager view. More...
 
void fitTransformerToContents (const IlvView *view, IlBoolean redraw=IlTrue, IlBoolean ratio=IlFalse)
 Rescales the contents of a manager view to fit in the view. More...
 
void fitToContents (IlvView *view)
 Resizes a manager view to fit the bounding box of the graphic objects. More...
 
IlBoolean isKeepingAspectRatio (const IlvView *view) const
 Indicates whether a manager view preserves the x/y ratio. More...
 
void setKeepingAspectRatio (const IlvView *view, IlBoolean ratio=IlTrue, IlBoolean redraw=IlTrue) const
 Sets or unsets the automatic preservation of the x/y ratio in a manager view. More...
 
void ensureVisible (IlvView *view, const IlvPoint &point)
 Translates the contents of a manager view in order to make a given location visible. More...
 
void ensureVisible (IlvView *view, const IlvRect &rect)
 Translates the contents of a manager view in order to make a given rectangle visible. More...
 
virtual IlBoolean removeObject (IlvGraphic *object, IlBoolean redraw=IlTrue, IlBoolean destroyIt=IlTrue)
 Removes a graphic object from the manager set. More...
 
IlvDrawSelectionwhichSelection (const IlvPoint &p, const IlvView *view) const
 Returns the selection object located at the given location. More...
 
IlBoolean isVisible (const IlvGraphic *object) const
 Indicates whether a graphic object is visible. More...
 
IlBoolean isVisible (const IlvGraphic *graphic, IlvView *view) const
 Indicates whether a graphic object is visible in a manager view. More...
 
void setVisible (IlvGraphic *object, IlBoolean visible, IlBoolean redraw=IlFalse)
 Sets the visibility of a graphic object in the manager to visible. More...
 
const char * getObjectName (const IlvGraphic *object) const
 Returns the name of a graphic object. More...
 
virtual IlBoolean setObjectName (IlvGraphic *object, const char *name)
 Sets the name of a graphic object in the manager. More...
 
IlvGraphicgetObject (const char *name) const
 Gets a graphic object by its name. More...
 
virtual IlBoolean isSelectable (const IlvGraphic *obj) const
 Indicates if a graphic object can be selected. More...
 
virtual void setSelectable (IlvGraphic *object, IlBoolean selectable)
 Sets a graphic object as selectable or not selectable. More...
 
IlBoolean isMoveable (const IlvGraphic *object) const
 Indicates if a graphic object can be moved. More...
 
void setMoveable (IlvGraphic *object, IlBoolean moveable)
 Sets the moveability of a graphic object. More...
 
IlBoolean isResizeable (const IlvGraphic *object) const
 Indicates if a graphic object can be resized. More...
 
void setResizeable (IlvGraphic *object, IlBoolean resizable)
 Sets a graphic object as resizable or not resizable. More...
 
IlBoolean isEditable (const IlvGraphic *object) const
 Indicates whether a graphic object can be edited. More...
 
void setEditable (IlvGraphic *object, IlBoolean editable)
 Indicates whether a graphic object can be edited. More...
 
IlBoolean isManaged (const IlvGraphic *object) const
 Indicates whether a graphic object is stored by the manager. More...
 
IlBoolean isASelection (const IlvGraphic *object) const
 Indicates if a graphic object is a selection object. More...
 
virtual void deleteAll (IlBoolean destroy, IlBoolean redraw)
 Removes all the graphic objects from the manager. More...
 
virtual void deleteAll (int layer, IlBoolean destroy, IlBoolean redraw)
 Removes all the objects stored in a specified layer of the manager. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from IlvManager
static IlvManagerGet (const IlvView *view)
 Returns the manager connected to the specified view, if any. More...
 
static IlvManagergetManager (const IlvGraphic *object)
 Gets the manager holding a given graphic object. More...
 

Detailed Description

Gadget class.

Library: ilvgadmgr

The IlvGadgetManager class creates a manager that is specifically designed to handle gadgets. It has special member functions handling the input focus and the grabbing of an object (so that the object interactor attached to the grabbing object receives every event). This class also manages the attachments of objects to the view in which they are located. The input focus determines which gadget must receive keyboard events when a view gets the focus. The IlvGadgetManager has a keyboard navigation mechanism allowing the end user to give the input focus to any gadget by cycling through the list of objects using the Tab key (and sometimes the arrow keys). The IlvGadgetManager must decide which gadget will be the next to get the input focus at each step of keyboard navigation; the default algorithm is based on the geometry of the gadgets (from left to right and from top to bottom). The programmer can force the use of a given order in keyboard navigation, that is, define its own focus chain.

See Also
IlvGraphic ("Gadget Properties" and "Focus Chain Management" member functions).

Constructor & Destructor Documentation

IlvGadgetManager::IlvGadgetManager ( IlvDisplay display,
int  layers = 2,
IlBoolean  useacc = IlTrue,
IlUShort  maxInList = IlvMaxObjectsInList,
IlUShort  maxInNode = IlvMaxObjectsInList 
)

Constructor.

Initializes a new instance of the IlvGadgetManager class, with the same initialization parameters as those described for the IlvManager class.

Member Function Documentation

virtual void IlvGadgetManager::addObject ( IlvGraphic object,
IlBoolean  redraw = IlTrue,
int  layer = -1 
)
virtual

Adds an object to the manager.

If an object is inserted in a non-existent layer, the layer, as well as any intermediate ones, are automatically created. For example, by default, a manager is created with three layers (0, 1 and 2); the code

addObject(obj, IlTrue, 5);

creates layers 3, 4, and 5.

An object cannot be added to a manager more than once.

Parameters
objectThe graphic object.
redrawIndicates whether the manager must immediately display the object.
layerSpecifies the layer index where the object must be inserted. The default value -1 indicates that the object is stored in the last (topmost) layer.
Note
You can accelerate the process of storing and removing objects to and from the manager. When you call IlvManager::addObject() or IlvManager::removeObject(), tests ensure that the data structure remains consistent. These tests ensure that an object is not stored twice, or remove an object that is not stored in this manager. You can bypass these tests and accelerate the process of storing and removing objects in a manager. See the global functions IlvGetOptimizeMode() and IlvSetOptimizeMode().

Reimplemented from IlvManager.

virtual void IlvGadgetManager::addObject ( const char *  name,
IlvGraphic object,
IlBoolean  redraw = IlTrue,
int  layer = -1 
)
virtual

Adds a graphic object to a manager, and then names the object.

This function is equivalent to

addObject(object, redraw, layer);
setObjectName(object, name);

If the object has a name that is already in use in the manager, the name is removed from the object. For more information, see the description of the IlvManager::addObject() member function.

Parameters
nameSpecifies the name to set on the object.
objectThe graphic object.
redrawIndicates whether the manager must immediately display the object.
layerSpecifies the layer index where the object must be inserted. The default value -1 indicates that the object is stored in the last (topmost) layer.
Note
See "Note" under the first IlvManager::addObject() member function.

Reimplemented from IlvManager.

virtual void IlvGadgetManager::addView ( IlvView view)
virtual

Adds a view to the manager.

Attaches a new view to the manager. All events are then handled by the hierarchy of interactors located in the manager.

Parameters
viewThe view.

Reimplemented from IlvManager.

virtual IlBoolean IlvGadgetManager::allowFocus ( IlBoolean  flag)
virtual

Enable or disables keyboard focus handling.

Parameters
flagIlTrue to enable keyboard focus handling and IlFalse to disable it.

Reimplemented from IlvManager.

virtual void IlvGadgetManager::applyResize ( IlvView view,
IlFloat  sx,
IlFloat  sy,
IlBoolean  redraw = IlTrue 
)
virtual

Resolves attachment constraints when the view is resized.

Applies geometric rules to satisfy all constraint attachments when the specified view is scaled by the specified factors. If this manager is not in autoResize mode, this member function does nothing (see the member function autoResize()).

Parameters
viewThe manager view.
sxHorizontal scaling factor.
syVertical scaling factor.
redrawSpecifies whether to redraw the view contents.
void IlvGadgetManager::applyResize ( IlvView view,
IlBoolean  redraw = IlTrue 
)

Resolves attachment constraints when the view is resized.

Recomputes the positions of all objects depending on their relative attachments. It corresponds to a call to the first member function applyResize(), where the scaling factors are set.

Parameters
viewThe manager view.
redrawSpecifies whether to redraw the view contents.
virtual void IlvGadgetManager::applyResize ( IlvView view,
IlvGraphic g,
IlFloat  sx,
IlFloat  sy,
IlBoolean  redraw = IlTrue 
)
virtual

Resolves attachment constraints for an object when the view is resized.

Does the same as the first applyResize() member function for the particular graphic object.

Parameters
viewThe manager view.
gThe graphic object.
sxHorizontal scaling factor.
syVertical scaling factor.
redrawSpecifies whether to redraw the view contents.
void IlvGadgetManager::applyResize ( IlvView view,
IlvGraphic g,
IlBoolean  redraw = IlTrue 
)

Resolves attachment constraints for an object when the view is resized.

Recomputes the position of a graphic object depending on its attachments settings. It corresponds to a call to the second member function applyResize(), where the scaling factors are set.

Parameters
viewThe manager view.
gThe graphic object.
redrawSpecifies whether to redraw the view contents.
IlBoolean IlvGadgetManager::autoResize ( IlBoolean  a)

Sets the auto resizing mechanism.

Sets or unsets the mechanism for managing attachments.

Parameters
aIlTrue to enable auto resizing and IlFalse to disable it.
virtual IlBoolean IlvGadgetManager::dispatchToObjects ( IlvEvent ,
IlvView  
)
virtual

Dispatches an event to the appropriate graphic objects.

Called by the manager event handler for every incoming user event when no view interactor was set in the view where the event occurred. It checks whether there is an object under the cursor. If there is one and if it is associated with an interactor, the event handler propagates the event to the interactor.

Returns
IlTrue if the object interactor handled the event. If there is no object under the pointer or if its object interactor cannot handle the event, the returned value is IlFalse.

Reimplemented from IlvManager.

virtual void IlvGadgetManager::drawFocus ( IlvPort dst,
const IlvTransformer t = 0,
const IlvRegion clip = 0 
) const
virtual

Draws the representation of the keyboard focus.

Draws the graphic representation of the keyboard focus on the focus object.

Parameters
dstThe destination port.
tThe transformer to apply.
clipThe clipping region.

Reimplemented from IlvManager.

virtual IlvGraphic* IlvGadgetManager::getFirstFocusGraphic ( ) const
virtual

Returns the first graphic object in the focus chain.

Returns
The first object that receives the keyboard focus.
virtual IlvGraphic* IlvGadgetManager::getFocus ( ) const
virtual

Returns the graphic object with the keyboard focus.

Returns
The current object that has the keyboard focus in this manager, or 0 if there is none.

Reimplemented from IlvManager.

virtual IlvGraphic* IlvGadgetManager::getGrab ( ) const
virtual

Returns the grabbing graphic object.

Returns
The current object that is currently grabbing in this manager. It returns 0 if there is no grabbing object in this manager.

Reimplemented from IlvManager.

virtual IlvGraphic* IlvGadgetManager::getLastFocusGraphic ( ) const
virtual

Returns the last graphic object in the focus chain.

Returns
The last object that receives the keyboard focus.
Note
getFirstFocusGraphic() and getLastFocusGraphic() are only used by getNextFocusGraphic() and getPreviousFocusGraphic() to make the focus chain circular. These four member functions implement the linking of objects using their names. Redefining them would break this mechanism.
IlvLookFeelHandler* IlvGadgetManager::getLookFeelHandler ( ) const

Returns the look and feel handler associated with this gadget manager.

Returns
The look and feel handler associated with this gadget manager.
virtual IlvGraphic* IlvGadgetManager::getNextFocusGraphic ( IlvGraphic object) const
virtual

Returns the next graphic object in the focus chain.

The default focus chain orders the objects according to their position, from left to right and from top to bottom. The method looks for an object that would fulfill the following conditions:

  • must be visible (method IlvManager::isVisible())
  • must be sensitive (method IlvGraphic::isSensitive())
  • must have an interactor (or be active and focusable in case of a gadget)

The search is performed down the focus chain, starting after object.

Parameters
objectThe graphic object.
Returns
The next graphic object that must receive the keyboard focus after object. It returns getFirstFocusGraphic() when object is 0. If no valid object is found, the method returns 0.
virtual IlvGraphic* IlvGadgetManager::getPreviousFocusGraphic ( IlvGraphic object) const
virtual

Returns the previous graphic object in the focus chain.

Parameters
objectThe graphic object.
Returns
The previous object that must receive the focus before object. It returns getLastFocusGraphic() when object is 0.
The method is similar to getNextFocusGraphic(), except that the search is performed up the focus chain, starting before object.
IlBoolean IlvGadgetManager::isAutoResizing ( ) const

Indicates whether the auto resizing mechanism is enabled.

Returns
IlTrue if this gadget manager allows the automatic resizing of the objects it stores, depending on their relative graphic attachments. It returns IlFalse if this manager does not handle the attachments.
virtual IlBoolean IlvGadgetManager::isFocusAllowed ( ) const
virtual

Indicates if keyboard focus handling is enabled.

Returns
IlTrue if this gadget manager allows the manipulation of the keyboard focus on the objects it stores. Otherwise it returns IlFalse.

Reimplemented from IlvManager.

virtual void IlvGadgetManager::moveFocusAfter ( IlBoolean  redraw = IlTrue)
virtual

Moves the keyboard focus to the next graphic object in the focus chain.

Calls getNextFocusGraphic() with the object that currently has the focus to get the next valid object in the focus chain, and then calls setFocus on it. If getNextFocusGraphic returns 0, the result of getFirstFocusGraphic is used instead.

Parameters
redrawSpecifies whether to redraw the graphic objects.

Reimplemented from IlvManager.

virtual void IlvGadgetManager::moveFocusBefore ( IlBoolean  redraw = IlTrue)
virtual

Moves the keyboard focus to the previous graphic object in the focus chain.

Calls getPreviousFocusGraphic() with the object that currently has the focus to get the previous valid object in the focus chain, and then calls setFocus() on it. If getPreviousFocusGraphic() returns 0, the result of getLastFocusGraphic() is used instead.

Parameters
redrawSpecifies whether to redraw the graphic objects.

Reimplemented from IlvManager.

virtual void IlvGadgetManager::removeGrab ( )
virtual

Removes any grab that has been set in this manager.

Reimplemented from IlvManager.

virtual IlBoolean IlvGadgetManager::removeView ( IlvView view)
virtual

Removes a view from the manager view list.

The view is no longer handled by the manager.

Parameters
viewThe manager view.
Returns
IlTrue on success, and IlFalse on error (the view could not be detached).

Reimplemented from IlvManager.

virtual void IlvGadgetManager::setBackground ( IlvView view,
IlvColor color,
IlvBitmap bitmap = 0 
)
virtual

Sets the background of a manager view.

Sets the color used to erase the double buffering bitmap for the view. When the view is set to double buffering mode, the color is initially updated to the background color of the view. If you change the view background color and want to set the double buffering color accordingly, call this member function with this color. If a bitmap is specified, it will be used as the background for the view; this means that it will not remain as a single image but will be tiled to the size of the manager 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
Parameters
viewThe manager view.
colorThe background color.
bitmapThe background bitmap.

Reimplemented from IlvManager.

virtual void IlvGadgetManager::setFocus ( IlvGraphic graphic = 0,
IlBoolean  redraw = IlTrue 
)
virtual

Sets the keyboard focus on a graphic object.

If the manager has disallowed the keyboard focus mechanism, this method has no effect.

Parameters
graphicThe graphic object.
redrawSpecifies whether to redraw the graphic object.

Reimplemented from IlvManager.

virtual void IlvGadgetManager::setGrab ( IlvGraphic object)
virtual

Sets a graphic object to grab events.

Sets the grab on the specified graphic object; every event is sent to this object. If this object has no object interactor, the events are lost.

Parameters
objectThe graphic object.

Reimplemented from IlvManager.

void IlvGadgetManager::setLookFeelHandler ( IlvLookFeelHandler lfh)

Sets the look and feel handler of this gadget manager.

Parameters
lfhThe new look and feel handler.
virtual void IlvGadgetManager::setSelected ( IlvGraphic object,
IlBoolean  selected = IlTrue,
IlBoolean  redraw = IlTrue 
)
virtual

Selects or deselects a graphic object.

Selects or deselects an object in the manager.

Parameters
objectThe graphic object.
selectedIlTrue if the graphic object must be selected, IlFalse otherwise.
redrawSpecifies whether the manager must redraw the invalidate region occupied by the selection object.

Reimplemented from IlvManager.


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