Rogue Wave Views 5.6 |
Rogue Wave Views |
Rogue Wave Views Documentation Home |
Gadget class. More...
#include <ilviews/gadgets/splitgad.h>
Public Member Functions | |
IlvSplitterGadget (IlvDisplay *display, const IlvRect &rect, IlUShort thickness=IlvDefaultGadgetThickness, IlvPalette *palette=0) | |
Constructor. | |
void | addIntersect (IlAny intersect) |
Adds an intersection point between two splitter gadgets. | |
IlvGraphicCallback | getCollapseCallback () const |
Returns a pointer to the first unnamed callback in the Collapse callback list. | |
IlvDirection | getDirection () const |
Returns the direction of the splitter gadget. | |
IlvGraphicCallback | getExpandCallback () const |
Returns a pointer to the first unnamed callback in the Expand callback list. | |
IlvPos | getMousePos () const |
Returns the last mouse position registered by the interactor. | |
IlBoolean | isCollapsed () const |
Indicates whether the splitter gadget is collapsed. | |
virtual void | moveGuide (IlvPos position) |
Moves the associated guide to the specified position. | |
void | setCollapseCallback (IlvGraphicCallback callback, IlAny arg) |
Sets a Collapse callback. | |
void | setCollapsed (IlBoolean collapsed) |
Specifies whether the splitter gadget should be collapsed. | |
void | setExpandCallback (IlvGraphicCallback callback, IlAny arg) |
Sets an Expand callback. | |
void | setMousePos (IlvPos pos) |
Memorizes the position of the mouse when the splitter gadget is being dragged. | |
Static Public Member Functions | |
static IlSymbol * | CollapseCallbackType () |
Returns the callback type of the Collapse callback. | |
static IlSymbol * | ExpandCallbackType () |
Returns the callback type of the Expand callback. | |
Friends | |
class | IlvDefaultSplitterGadgetLFHandler |
Gadget class.
Library: ilvadvgdt
A gadget container has vertical and horizontal guides to which graphic objects can be attached. These guides divide the container into several horizontal and vertical sections. An IlvSplitterGadget
object is associated with each guide. When the user moves a splitter gadget, its associated guide moves accordingly and the objects attached to the guides are also moved and reshaped.
IlvGraphicHolder
class.Each splitter gadget has the same direction as its associated guide, which can be either horizontal or vertical. A horizontal splitter can only be moved horizontally. Likewise, a vertical splitter can only be moved vertically. It can be useful to have two intersecting splitters (one horizontal and one vertical) move at the same time in their own direction. You can use the IlvSplitterGadget::addIntersect
method to have two intersecting splitters move simultaneously when the user drag their intersection point.
Each section of a container has a minimum size called the limit. The splitter gadget will never resize a section to a size smaller than its limit. When the section reaches its minimum size, it is said to be collapsed. In this case, the splitter simply invokes the Collapse callback defined with IlvSplitterGadget::setCollapseCallback
, if any. When the user resizes a collapsed section, the splitter invokes the Expand callback (see IlvSplitterGadget::setExpandCallback
), if it is set.
IlvSplitterGadget::IlvSplitterGadget | ( | IlvDisplay * | display, | |
const IlvRect & | rect, | |||
IlUShort | thickness = IlvDefaultGadgetThickness , |
|||
IlvPalette * | palette = 0 | |||
) |
Constructor.
Do not call this constructor to create an IlvSplitterGadget
. Instead, use the global function IlvMakeSplitterGadget
to create it.
display | The connection to the display. | |
rect | The size and position of the splitter gadget. | |
thickness | The thickness of the splitter gadget. | |
palette | The palette used to draw the splitter gadget. |
void IlvSplitterGadget::addIntersect | ( | IlAny | intersect | ) |
Adds an intersection point between two splitter gadgets.
The intersect parameter specifies the splitter gadget with which the intersection point should be established. For details, see the general description of the class. Suppose that you have created two splitter gadgets, A
and B
using IlvMakeSplitterGadget
. A
is created first. The right approach to establish an intersection point between A
and B
is to call the IlvSplitterGadget::addIntersect
method with B
as its parameter, like this:
IlvSplitterGadget* A, B; A = IlvMakeSplitterGadget(...); B = IlvMakeSplitterGadget(...); B->addIntersect((IlAny) A);
With this method, the order in which the splitters are created is very important. Do not call A
's addIntersect
method by passing A
as an argument. Never call A
's addIntersect
by passing B
as argument, at the same time as you call B
's addIntersect
passing A
as argument, as this will cause a dead lock.
intersect | A pointer to the target splitter gadget. |
static IlSymbol* IlvSplitterGadget::CollapseCallbackType | ( | ) | [static] |
Returns the callback type of the Collapse callback.
Each section of a container has a minimum size called the limit. The splitter gadget never resizes a section to a size smaller than its limit. In this case, it simply calls the Collapse callback function, if any, and does nothing else.
static IlSymbol* IlvSplitterGadget::ExpandCallbackType | ( | ) | [static] |
Returns the callback type of the Expand callback.
The Expand callback is invoked when the splitter gadget is used to expand a collapsed section.
IlvGraphicCallback IlvSplitterGadget::getCollapseCallback | ( | ) | const |
Returns a pointer to the first unnamed callback in the Collapse callback list.
The Collapse callback is invoked when the splitter gadget is used to resize a section to a size smaller than its limit.
IlvDirection IlvSplitterGadget::getDirection | ( | ) | const |
Returns the direction of the splitter gadget.
IlvVertical
and IlvHorizontal
. IlvGraphicCallback IlvSplitterGadget::getExpandCallback | ( | ) | const |
Returns a pointer to the first unnamed callback in the Expand callback list.
The Expand callback is invoked when the splitter gadget is used to expand a collapsed section.
IlvPos IlvSplitterGadget::getMousePos | ( | ) | const |
Returns the last mouse position registered by the interactor.
IlBoolean IlvSplitterGadget::isCollapsed | ( | ) | const |
Indicates whether the splitter gadget is collapsed.
If this method returns IlTrue
, the Collapse callback is never invoked. If it returns IlFalse
the Expand callback function is never invoked.
virtual void IlvSplitterGadget::moveGuide | ( | IlvPos | position | ) | [virtual] |
Moves the associated guide to the specified position.
Is called automatically when the user drags the splitter gadget. If you want to call this member function in other situations, you must first invoke the IlvSplitterGadget::setMousePos
member function by passing the same value as argument. If the section limit is reached and the IlvSplitterGadget::isCollapsed
method returns IlFalse
, this member function invokes the Collapse callback. If the collapsed section is expanded and the IlvSplitterGadget::isCollapsed
method returns IlTrue
, it calls the Expand callback. see ExpandCallbackType, CollapseCallbackType, isCollapsed
position | The new position of the guide associated with this splitter gadget. |
void IlvSplitterGadget::setCollapseCallback | ( | IlvGraphicCallback | callback, | |
IlAny | arg | |||
) |
Sets a Collapse callback.
Removes all the existing Collapse callbacks before adding callback to the Collapse callback list. The callback function, when invoked, receives the user parameter arg. The Collapse callback is invoked when the splitter gadget is used to resize a section to a size smaller than its limit.
callback | A pointer to the new callback. | |
arg | The callback argument. |
void IlvSplitterGadget::setCollapsed | ( | IlBoolean | collapsed | ) |
Specifies whether the splitter gadget should be collapsed.
value | A Boolean value specifying whether the splitter gadget should be collapsed. |
void IlvSplitterGadget::setExpandCallback | ( | IlvGraphicCallback | callback, | |
IlAny | arg | |||
) |
Sets an Expand callback.
Removes all the existing Expand callbacks before adding callback to the Expand callback list. The callback function, when invoked, receives the user parameter arg. The Expand callback is invoked when the splitter gadget is used to expand a collapsed section.
callback | A pointer to the new callback. | |
arg | The callback argument. |
© 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.