rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Gadgets Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

List of all members | Public Member Functions
IlvGadgetContainer Class Reference

View container class. More...

#include <ilviews/gadgets/gadcont.h>

Inheritance diagram for IlvGadgetContainer:
IlvContainer IlvDrawingView IlvView IlvAbstractView IlvSystemPort IlvPort IlvDialog IlvPanedContainer IlvScrolledView IlvViewFrame IlvColorSelector IlvFileChooser IlvFontSelector IlvGradientSelector IlvIFileSelector IlvIMessageDialog IlvIPromptString IlvPageMarginDialog IlvPostScriptPrinterDialog IlvPrinterPreviewDialog IlvDockableContainer

Public Member Functions

 IlvGadgetContainer (IlvDisplay *display, const char *name, const char *title, const IlvRect &rect, IlBoolean useacc=IlFalse, IlBoolean visible=IlTrue)
 Constructor. More...
 
 IlvGadgetContainer (IlvDisplay *display, const char *name, const char *title, const IlvRect &rect, IlUInt properties, IlBoolean useacc=IlFalse, IlBoolean visible=IlTrue, IlvSystemView transientFor=0)
 Constructor. More...
 
 IlvGadgetContainer (IlvAbstractView *parent, const IlvRect &rect, IlBoolean useacc=IlFalse, IlBoolean visible=IlTrue)
 Constructor. More...
 
 IlvGadgetContainer (IlvDisplay *display, IlvSystemView parent, const IlvRect &rect, IlBoolean useacc=IlFalse, IlBoolean visible=IlTrue)
 Constructor. More...
 
 IlvGadgetContainer (IlvDisplay *display, IlvSystemView window, IlBoolean useacc=IlFalse)
 Constructor. More...
 
virtual IlBoolean allowFocus (IlBoolean value)
 Specifies whether the container manages the focus. More...
 
virtual void applyResize (IlFloat sx, IlFloat sy, IlBoolean redraw=IlTrue)
 Is called to carry out the resize events applying to the gadget container. More...
 
IlBoolean autoResize (IlBoolean a)
 Sets the auto resize mode of the gadget container. More...
 
IlvButtongetDefaultButton () const
 Returns the default button of the gadget container. More...
 
virtual IlvGraphicgetFirstFocusGraphic () const
 Returns the first object that receives the focus in this container. More...
 
virtual IlvGraphicgetFocus () const
 Returns the object that has the keyboard focus in the gadget container. More...
 
virtual IlvGraphicgetGrab () const
 Returns the object that is currently grabbing events in the container. More...
 
virtual IlvGraphicgetLastFocusGraphic () const
 Returns the last object that receives the focus in this container. More...
 
IlvLookFeelHandlergetLookFeelHandler () const
 Returns the look and feel handler associated with this container. More...
 
virtual IlvGraphicgetNextFocusGraphic (IlvGraphic *object) const
 Returns the next object that will receive the focus after the specified object. More...
 
IlvGraphicgetOverriddenFocus () const
 Returns the object that will receive the focus after calling setFocus. More...
 
virtual IlvGraphicgetPreviousFocusGraphic (IlvGraphic *object) const
 Returns the previous object that received the focus before the specified object. More...
 
IlBoolean isAutoResizing () const
 Indicates whether the gadget container gets resized when loading a file. More...
 
virtual IlBoolean isFocusAllowed () const
 Indicates whether the focus is allowed in the container. More...
 
virtual void moveFocusAfter (IlBoolean redraw=IlTrue)
 Is called to find the next focusable object. More...
 
virtual void moveFocusBefore (IlBoolean redraw=IlTrue)
 Is called to find the previous focusable object. More...
 
void overrideFocus (IlvGraphic *obj)
 Sets the object that will receive the focus after calling setFocus. More...
 
virtual void removeGrab ()
 Cancels the grabbing settings defined with setGrab. More...
 
void setDefaultButton (IlvButton *, IlBoolean redraw=IlTrue)
 Sets the default button of the gadget container. More...
 
virtual void setFocus (IlvGraphic *graphic=0, IlBoolean redraw=IlTrue)
 Sets the focus to the specified object of the gadget container. More...
 
virtual void setGrab (IlvGraphic *object)
 Sets the specified object as the grabbing object. More...
 
void setLookFeelHandler (IlvLookFeelHandler *lfh)
 Sets the look and feel handler of this container. More...
 

Detailed Description

View container class.

Library: ilvgadgt

IlvGadgetContainer is a predefined subtype of the IlvContainer class used for storing, displaying, and manipulating gadgets. It has special member functions for handling the keyboard focus, 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 container. The keyboard focus determines which gadget must receive keyboard events when the view gets the focus. The IlvGadgetContainer class features a keyboard navigation mechanism that lets the end user give the keyboard focus to any gadget by cycling through the list of objects using the Tab key (and sometimes the arrow keys). The IlvGadgetContainer class determines which gadget will be the next to get the keyboard 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 container to use a given order in keyboard navigation, that is, define its own focus chain.

See Also
IlvGadget, IlvDialog

Constructor & Destructor Documentation

IlvGadgetContainer::IlvGadgetContainer ( IlvDisplay display,
const char *  name,
const char *  title,
const IlvRect rect,
IlBoolean  useacc = IlFalse,
IlBoolean  visible = IlTrue 
)

Constructor.

Initializes a new instance of the IlvGadgetContainer class as a top view.

Parameters
displayThe connection to the display.
nameThe name of the gadget container.
titleThe title of the gadget container.
rectThe size and position of the gadget container.
useaccA Boolean value specifying whether the gadget container should install the default keyboard accelerators.
visibleA Boolean value specifying whether the gadget container should be visible.
IlvGadgetContainer::IlvGadgetContainer ( IlvDisplay display,
const char *  name,
const char *  title,
const IlvRect rect,
IlUInt  properties,
IlBoolean  useacc = IlFalse,
IlBoolean  visible = IlTrue,
IlvSystemView  transientFor = 0 
)

Constructor.

Initializes a new instance of the IlvGadgetContainer class as a top view.

Parameters
displayThe connection to the display.
nameThe name of the gadget container.
titleThe title of the gadget container.
rectThe size and position of the gadget container.
propertiesThe properties of the gadget container. For more details, see the IlvView constructors.
useaccA Boolean value specifying whether the gadget container should install the default keyboard accelerators.
visibleA Boolean value specifying whether the gadget container should be visible.
transientForA system view for which the gadget container is transient. For more details, see the IlvView constructors.
IlvGadgetContainer::IlvGadgetContainer ( IlvAbstractView parent,
const IlvRect rect,
IlBoolean  useacc = IlFalse,
IlBoolean  visible = IlTrue 
)

Constructor.

Initializes a new instance of the IlvGadgetContainer class as a child view of parent.

Parameters
parentThe parent view of the gadget container.
rectThe size and position of the gadget container.
useaccA Boolean value specifying whether the gadget container should install the default keyboard accelerators.
visibleA Boolean value specifying whether the gadget container should be visible.
IlvGadgetContainer::IlvGadgetContainer ( IlvDisplay display,
IlvSystemView  parent,
const IlvRect rect,
IlBoolean  useacc = IlFalse,
IlBoolean  visible = IlTrue 
)

Constructor.

Initializes a new instance of the IlvGadgetContainer class as a child view of the system view specified by parent.

Parameters
displayThe connection to the display.
parentThe parent view of the gadget container.
rectThe size and position of the gadget container.
useaccA Boolean value specifying whether the gadget container should install the default keyboard accelerators.
visibleA Boolean value specifying whether the gadget container should be visible.
IlvGadgetContainer::IlvGadgetContainer ( IlvDisplay display,
IlvSystemView  window,
IlBoolean  useacc = IlFalse 
)

Constructor.

Initializes a new instance of the IlvGadgetContainer class mapped to the existing system view specified by parent.

Parameters
displayThe connection to the display.
windowThe system view to which the gadget container will be mapped.
useaccA Boolean value specifying whether the gadget container should install the default keyboard accelerators.

Member Function Documentation

virtual IlBoolean IlvGadgetContainer::allowFocus ( IlBoolean  value)
virtual

Specifies whether the container manages the focus.

Parameters
valueA Boolean value specifying whether the container manages the focus (IlTrue).
See Also
isFocusAllowed, setFocus
virtual void IlvGadgetContainer::applyResize ( IlFloat  sx,
IlFloat  sy,
IlBoolean  redraw = IlTrue 
)
virtual

Is called to carry out the resize events applying to the gadget container.

This method is called internally to carry out any resize events applying to the view, and to manage the objects changes according to their attachments. It deals with the old Rogue Wave Views attachment model. If you want to use the new one, see the IlvGraphicHolder::attach method.

Parameters
sxThe scale factor that applies to the container width.
syThe scale factor that applies to the container height.
redrawA Boolean value specifying whether the container should be redrawn.
See Also
IlvSetAttachment
IlBoolean IlvGadgetContainer::autoResize ( IlBoolean  a)

Sets the auto resize mode of the gadget container.

Parameters
valueA Boolean value specifying whether the gadget container should be resized automatically when data containing size information is loaded.
Returns
IlTrue if the container should be resized automatically and IlFalse otherwise.
See Also
isAutoResizing
IlvButton* IlvGadgetContainer::getDefaultButton ( ) const

Returns the default button of the gadget container.

Returns
A pointer to the default button of the gadget container, or 0 if this gadget container has no default button.
See Also
IlvGadgetContainer::setDefaultButton
virtual IlvGraphic* IlvGadgetContainer::getFirstFocusGraphic ( ) const
virtual

Returns the first object that receives the focus in this container.

Warning
[note] This member function links the objects using their names. Redefining them would break this mechanism.
Returns
The first object that receives the focus in this container. The object must satisfy the conditions listed in the description of IlvGadgetContainer::getNextFocusGraphic.
See Also
getPreviousFocusGraphic, getLastFocusGraphic
virtual IlvGraphic* IlvGadgetContainer::getFocus ( ) const
virtual

Returns the object that has the keyboard focus in the gadget container.

Returns
The object that has the keyboard focus in this gadget container or 0 if no object has the focus.
See Also
setFocus, allowFocus
virtual IlvGraphic* IlvGadgetContainer::getGrab ( ) const
virtual

Returns the object that is currently grabbing events in the container.

Returns
The object that is currently grabbing events in this container, or 0 if there is no grabbing object in this container.
See Also
setGrab, removeGrab
virtual IlvGraphic* IlvGadgetContainer::getLastFocusGraphic ( ) const
virtual

Returns the last object that receives the focus in this container.

Warning
[note] This member function links the objects using their names. Redefining them would break this mechanism.
Returns
The last object that receives the focus in this container. The object must satisfy the conditions listed in the description of IlvGadgetContainer::getNextFocusGraphic.
See Also
getNextFocusGraphic, getFirstFocusGraphic
IlvLookFeelHandler* IlvGadgetContainer::getLookFeelHandler ( ) const

Returns the look and feel handler associated with this container.

Returns
The look and feel handler associated with this container.
virtual IlvGraphic* IlvGadgetContainer::getNextFocusGraphic ( IlvGraphic object) const
virtual

Returns the next object that will receive the focus after the specified object.

By default, the focus chain goes from left to right and from top to bottom. The method looks for an object that satisfies the following conditions:

  • Is visible (method IlvContainer::isVisible)

  • Is sensitive (method IlvGraphic::isSensitive)

  • Has an associated interactor (or is active and focusable if the object is a gadget)

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

Warning
[note] This member function links the objects using their names. Redefining them would break this mechanism.
Parameters
objectThe graphic object.
Returns
The object that will receive the focus after object. The method returns IlvGadgetContainer::getFirstFocusGraphic when object is 0. If no valid object is found, the method returns 0.
See Also
getPreviousFocusGraphic, getFocus, getLastFocusGraphic
IlvGraphic* IlvGadgetContainer::getOverriddenFocus ( ) const

Returns the object that will receive the focus after calling setFocus.

Returns
The object that will receive the focus after calling setFocus.
See Also
overrideFocus, setFocus
virtual IlvGraphic* IlvGadgetContainer::getPreviousFocusGraphic ( IlvGraphic object) const
virtual

Returns the previous object that received the focus before the specified object.

By default, the focus chain goes from left to right and from top to bottom. The method looks for an object that satisfies the following conditions:

  • Is visible (method IlvContainer::isVisible)

  • Is sensitive (method IlvGraphic::isSensitive)

  • Has an associated interactor (or is active and focusable if the object is a gadget)

The search is performed up the focus chain, starting before object.

Warning
[note] This member function links the objects using their names. Redefining them would break this mechanism.
Parameters
objectThe graphic object.
Returns
The object that had the focus before object. The method returns IlvGadgetContainer::getFirstFocusGraphic when object is 0. If no valid object is found, the method returns 0.
See Also
getNextFocusGraphic, getFocus, getFirstFocusGraphic
IlBoolean IlvGadgetContainer::isAutoResizing ( ) const

Indicates whether the gadget container gets resized when loading a file.

Returns
IlTrue if this gadget container gets resized automatically when data containing size information is loaded. Otherwise, the container keeps its original dimensions.
See Also
autoResize
virtual IlBoolean IlvGadgetContainer::isFocusAllowed ( ) const
virtual

Indicates whether the focus is allowed in the container.

Returns
IlTrue if this gadget container handles the focus for the objects it stores and IlFalse otherwise.
See Also
setFocus, allowFocus
virtual void IlvGadgetContainer::moveFocusAfter ( IlBoolean  redraw = IlTrue)
virtual

Is called to find the next focusable object.

Calls IlvGadgetContainer::getNextFocusGraphic with the object currently having the focus to get the next valid object in the focus chain, then calls IlvGadgetContainer::setFocus on it. If getNextFocusGraphic returns 0, the result of IlvGadgetContainer::getFirstFocusGraphic is used instead.

Parameters
redrawA Boolean value specifying whether the gadget container should be redrawn.
See Also
moveFocusBefore, getFirstFocusGraphic, getFocus
virtual void IlvGadgetContainer::moveFocusBefore ( IlBoolean  redraw = IlTrue)
virtual

Is called to find the previous focusable object.

Calls IlvGadgetContainer::getPreviousFocusGraphic with the object currently having the focus to get the previous valid object in the focus chain, then calls IlvGadgetContainer::setFocus on it. If getPreviousFocusGraphic returns 0, the result of IlvGadgetContainer::getLastFocusGraphic is used instead.

Parameters
redrawA Boolean value specifying whether the gadget container should be redrawn.
See Also
moveFocusAfter, getLastFocusGraphic, getFocus
void IlvGadgetContainer::overrideFocus ( IlvGraphic obj)

Sets the object that will receive the focus after calling setFocus.

Has no effect if it is not called from a Focus Out callback or from the IlvGadget::focusOut member function.

See Also
getOverriddenFocus, setFocus
virtual void IlvGadgetContainer::removeGrab ( )
virtual

Cancels the grabbing settings defined with setGrab.

See Also
getGrab, setGrab
void IlvGadgetContainer::setDefaultButton ( IlvButton ,
IlBoolean  redraw = IlTrue 
)

Sets the default button of the gadget container.

The default button is triggered when the user presses the Return or Enter key in the dialog, even though it does not have the keyboard focus. Note that button doesn't need to be located in this gadget container.

Parameters
buttonThe new default button.
redrawA Boolean value specifying whether the dialog should be redrawn.
See Also
IlvGadgetContainer::getDefaultButton, IlvGadget::usesDefaultButtonKeys
virtual void IlvGadgetContainer::setFocus ( IlvGraphic graphic = 0,
IlBoolean  redraw = IlTrue 
)
virtual

Sets the focus to the specified object of the gadget container.

Sends an IlvKeyboardFocusOut event to the previous focused object, and an IlvKeyboardFocusIn event to graphic. If you set a Focus Out callback (see IlvGadget::setFocusOutCallback) on the previous focused object, It is possible inside this callback to tell the gadget container not to give the focus to graphic, but to another object by using the method IlvGadgetContainer::overrideFocus. This is useful if the "Focus Out" callback validates the previous focused object. In this case, if validation does not succeed, you may want to keep the focus on this object to give the user another try. If the focus mechanism has been disallowed, this method has no effect.

Parameters
graphicThe object that is given the keyboard focus.
redrawA Boolean value specifying whether the gadget container should be redrawn.
See Also
getFocus, isFocusAllowed, IlvGadget::setFocusOutCallback, overrideFocus
virtual void IlvGadgetContainer::setGrab ( IlvGraphic object)
virtual

Sets the specified object as the grabbing object.

Events will be sent to object. If this object has no associated interactor, the events will be lost.

Parameters
objectThe grabbing object.
See Also
getGrab, removeGrab
void IlvGadgetContainer::setLookFeelHandler ( IlvLookFeelHandler lfh)

Sets the look and feel handler of this container.

Parameters
lfhThe new look and feel handler.

© 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.