Rogue Wave Views
Gadgets Package API Reference Guide
Product Documentation:

Rogue Wave Views
Documentation Home
List of all members | Public Member Functions | Static Public Member Functions | Friends
IlvSplitterGadget Class Reference

Gadget class. More...

#include <ilviews/gadgets/splitgad.h>

Inheritance diagram for IlvSplitterGadget:
IlvGadget IlvSimpleGraphic IlvStylable IlvGraphic IlvValueInterface

Public Member Functions

 IlvSplitterGadget (IlvDisplay *display, const IlvRect &rect, IlUShort thickness=IlvDefaultGadgetThickness, IlvPalette *palette=0)
 Constructor. More...
 
void addIntersect (IlAny intersect)
 Adds an intersection point between two splitter gadgets. More...
 
IlvGraphicCallback getCollapseCallback () const
 Returns a pointer to the first unnamed callback in the Collapse callback list. More...
 
IlvDirection getDirection () const
 Returns the direction of the splitter gadget. More...
 
IlvGraphicCallback getExpandCallback () const
 Returns a pointer to the first unnamed callback in the Expand callback list. More...
 
IlvPos getMousePos () const
 Returns the last mouse position registered by the interactor. More...
 
IlBoolean isCollapsed () const
 Indicates whether the splitter gadget is collapsed. More...
 
virtual void moveGuide (IlvPos position)
 Moves the associated guide to the specified position. More...
 
void setCollapseCallback (IlvGraphicCallback callback, IlAny arg)
 Sets a Collapse callback. More...
 
void setCollapsed (IlBoolean collapsed)
 Specifies whether the splitter gadget should be collapsed. More...
 
void setExpandCallback (IlvGraphicCallback callback, IlAny arg)
 Sets an Expand callback. More...
 
void setMousePos (IlvPos pos)
 Memorizes the position of the mouse when the splitter gadget is being dragged. More...
 

Static Public Member Functions

static IlSymbolCollapseCallbackType ()
 Returns the callback type of the Collapse callback. More...
 
static IlSymbolExpandCallbackType ()
 Returns the callback type of the Expand callback. More...
 

Friends

class IlvDefaultSplitterGadgetLFHandler
 

Detailed Description

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.

Note
To create a guide, it is recommended that you use Rogue Wave Views Studio. However, you can do it by code using the 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.

See also
IlvGraphicHolder, IlvMakeSplitterGadget.

Constructor & Destructor Documentation

§ IlvSplitterGadget()

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.

Parameters
displayThe connection to the display.
rectThe size and position of the splitter gadget.
thicknessThe thickness of the splitter gadget.
paletteThe palette used to draw the splitter gadget.

Member Function Documentation

§ addIntersect()

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:

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.

Parameters
intersectA pointer to the target splitter gadget.

§ CollapseCallbackType()

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.

Returns
The callback type of the Collapse callback.
See also
ExpandCallbackType, IlvGraphic::setCallback(), setCollapseCallback().

§ ExpandCallbackType()

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.

Returns
The callback type of the Expand callback.
See also
CollapseCallbackType, IlvGraphic::setCallback(), setExpandCallback().

§ getCollapseCallback()

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.

Returns
A pointer to the first unnamed callback in the Expand callback list.
See also
setCollapseCallback().

§ getDirection()

IlvDirection IlvSplitterGadget::getDirection ( ) const

Returns the direction of the splitter gadget.

Returns
The direction of the splitter gadget. Valid directions are IlvVertical and IlvHorizontal.

§ getExpandCallback()

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.

Returns
A pointer to the first unnamed callback in the Expand callback list.
See also
setExpandCallback().

§ getMousePos()

IlvPos IlvSplitterGadget::getMousePos ( ) const

Returns the last mouse position registered by the interactor.

Returns
The last mouse position registered by the interactor when the splitter was dragged.
See also
setMousePos().

§ isCollapsed()

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.

See also
setCollapsed().

§ moveGuide()

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().

Parameters
positionThe new position of the guide associated with this splitter gadget.
See also
setMousePos(), isCollapsed().

§ setCollapseCallback()

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.

Parameters
callbackA pointer to the new callback.
argThe callback argument.
See also
setExpandCallback(), getCollapseCallback(), CollapseCallbackType.

§ setCollapsed()

void IlvSplitterGadget::setCollapsed ( IlBoolean  collapsed)

Specifies whether the splitter gadget should be collapsed.

Parameters
collapsedA Boolean value specifying whether the splitter gadget should be collapsed.
See also
isCollapsed().

§ setExpandCallback()

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.

Parameters
callbackA pointer to the new callback.
argThe callback argument.
See also
setCollapseCallback(), getExpandCallback(), ExpandCallbackType.

§ setMousePos()

void IlvSplitterGadget::setMousePos ( IlvPos  pos)

Memorizes the position of the mouse when the splitter gadget is being dragged.

Allows the dragging of the splitter to be processed as if the mouse was doing it. See moveGuide().

Parameters
posThe new last mouse position.
See also
moveGuide().

© Copyright 2017, 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.