rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Gadgets Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IlvSplitterGadget Class Reference

Gadget class. More...

#include <ilviews/gadgets/splitgad.h>

Inheritance diagram for IlvSplitterGadget:
IlvGadget IlvSimpleGraphic IlvGraphic

List of all members.

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 IlSymbolCollapseCallbackType ()
 Returns the callback type of the Collapse callback.
static IlSymbolExpandCallbackType ()
 Returns the callback type of the Expand callback.

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.

Warning:
[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 ( 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:
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.

Member Function Documentation

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

Returns:
The callback type of the Collapse callback.
See also:
ExpandCallbackType, IlvGraphic::setCallback, setCollapseCallback
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
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
IlvDirection IlvSplitterGadget::getDirection (  )  const

Returns the direction of the splitter gadget.

Returns:
The direction of the splitter gadget. Valid directions are 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.

Returns:
A pointer to the first unnamed callback in the Expand callback list.
See also:
setExpandCallback
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
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
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:
position The new position of the guide associated with this splitter gadget.
See also:
setMousePos, isCollapsed
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:
callback A pointer to the new callback.
arg The callback argument.
See also:
setExpandCallback, getCollapseCallback, CollapseCallbackType
void IlvSplitterGadget::setCollapsed ( IlBoolean  collapsed  ) 

Specifies whether the splitter gadget should be collapsed.

Parameters:
value A Boolean value specifying whether the splitter gadget should be collapsed.
See also:
isCollapsed
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:
callback A pointer to the new callback.
arg The callback argument.
See also:
setCollapseCallback, getExpandCallback, ExpandCallbackType
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:
pos The new last mouse position.
See also:
moveGuide
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

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