[Go to CFHT Home Page] Man Pages
Back to Software Index  BORDER=0Manpage Top Level
    Scene(3X) manual page Table of Contents

Name

Scene - class for creating interactor compositions

Synopsis

#include <ivplus/scene.h>

Description

Scene is the abstract base class for all interactors that arranges one or more component interactors into layouts. Different classes derived from Scene arrange their components differently. For example, an hbox tiles its components left to right, and a deck stacks them one on top of the other.

Class Hierarchy

Scene->Interactor

Constructors

Scene()

Creates a new scene. Since Scene is an abstract base class, this constructor is protected.

Public Operations

void Change(Interactor* = nil)

Notifies a scene that one or more of its components has changed. A component may have been resized, inserted, or removed. The change will not become apparent until Change() is called on the scene containing the changed component. The given interactor is passed to the DoChange() operation and may or may not be used by derived classes. If the propagation flag is set to true (see Propagate()), Change() will be called on successive parents until the top level scene or a scene with the propagation flag set to false is reached. At that point, a Resize() traversal is begun and the changes will become visible.

virtual void Disable()

Disables all items contained within a scene, including the scene itself. Calls DoEnable(false).

virtual void Enable()

Enables all items contained within a scene, including the scene itself. Calls DoEnable(true).

virtual void HighLight(boolean)

If called with true, calls Highlight(true) on all components in the scene, including the scene itself. Otherwise, it calls Highlight(false) on all components and the scene.

void Insert(Interactor*)

Inserts an interactor into the scene. Insert() first calls Wrap() to wrap any additional interactors around the inserted interactor. Then calls DoInsert() to perform the insertion. If an interactor is inserted into a scene that is already mapped, the interactor and its descendants will be configured before DoInsert() is called.

void Insert(Interactor*, IntCoord x, IntCoord y, Alignment = BottomLeft)

Inserts an interactor and aligns it to a specific position relative to the lower left hand corner of the screen. Alignment defaults to BottomLeft meaning that the bottom left corner of the interactor will be placed at <IntCoord x, IntCoord y>. See Alignment(3X) .

virtual boolean Interpret(const char* action)

Performs some function based on the given string.
Action StringFunction Description
TabGroupFwd()
TabGroupBwd()
TraverseFwd()
TraverseBwd()
TraverseHome()


If the string matches any of the above actions return 
true,otherwise call 
Interactor::Interpret(action)and return the result. For more information,
see
Interpret()in
Interactor(3X).

void Lower(Interactor*)Requests to have an interactor’s canvas
put below all others in the scene, potentially obscuring it. Users call
 Lower() and subclasses implement  DoLower(). 
void Move(Interactor*, IntCoord
x, IntCoord y, Alignment = BottomLeft)Requests that an interactor be moved
to the given coordinates using the given alignment. Users call  Move() and
subclasses implement  DoMove() to redefine the current functionality.  
void
Propagate(boolean)Sets the propagation flag to the given value. Propagation
refers to how parents are notified when Change() is called on a scene. If
set to true, the parent is notified of a scene’s change by actually calling
Change() on the parent. If set to false, the scene’s parent will not be notified
and the scene’s Resize() operation will be called instead. 
void Raise(Interactor*)Requests
to have an interactor’s canvas put above all others in the scene, making
it fully visible. Users call  Raise() and subclasses implement  DoRaise().

void Remove(Interactor*)Removes an interactor from a scene. Users call 
Remove() and subclasses implement  DoRemove(). 
virtual void TabGroupDefault(int
n)Makes the nth traversable interactor (using insertion order, starting
with 1) the tab group default. This interactor will receive the keyboard
focus whenever this tab group is traversed. If not specified, the first
interactor in the tab group is the default. 
virtual int TabGroupDefault()Returns
the index of the default item within the tab group associated with this
scene. The index is the nth traversable interactor in the scene. 
Protected
Operationsvirtual void DoChange(Interactor*)Not implemented in the  Scene
class. Must be implemented in classes derived from  Scene to handle changing
the given interactor’s shape. 
virtual void DoEnable(boolean)Used to enable
or disable all components in a scene.  DoEnable(true) calls each component’s
Enable() operation.  DoEnable(false) calls each component’s  Disable() operation.
 
virtual void DoInsert(Interactor*, boolean, IntCoord& x, IntCoord& y)Not
implemented in the  Scene class. Must be implemented in classes derived
from Scene to handle inserting interactors at  <IntCoord& x, IntCoord& y>,
with a given shape. 
virtual void DoLower(Interactor*)Not implemented in
the  Scene class. Must be implemented in classes derived from  Scene to
handle putting the canvas of the given interactor below all other interactors
in the scene. 
virtual void DoMove(Interactor*, IntCoord& x, IntCoord& y)Not
implemented in the  Scene class. Must be implemented in classes derived
from  Scene to handle moving the given interactor to the new <x, y> coordinates.

virtual void DoRaise(Interactor*)Not implemented in the  Scene class. Must
be implemented in classes derived from  Scene to handle putting the canvas
of the given interactor above all other  interactors in the scene, thus
making it fully visible. 
virtual void DoRemove(Interactor*)Not implemented
in the  Scene class. Must be implemented in classes derived from  Scene
to handle removing the given interactor.  
virtual Interactor* Wrap(Interactor*)By
default,  Wrap() simply returns the passed interactor. It is provided so
that when deriving from  Scene, a user may optionally wrap some interactor
around the passed interactor. For example, Wrap() could insert the passed
interactor in a frame and return the frame. 
void Map(Interactor* i, boolean
raised = true)Maps the given interactor  i in the window. If  raised is
 true, the interactor is raised to the front. The interactor’s canvas status
is set to  mapped. 
void Place(Interactor*, IntCoord, IntCoord, IntCoord,
IntCoord, boolean map = true)Places the given interactor at the given coordinates
and sets  map to  true to raise the interactor’s canvas above all other
interactors. This function checks for a valid  window in which to place
the interactor. If there is none, then a new  window is created, the interactor
is placed and raised. 
void PrepareToInsert(Interactor)Checks to see that
the interactor has a valid canvas and that the canvas is mapped. It then
calls  Interactor::Config() on the scene.  
void UnMap(Interactor* i)Unmaps
the given interactor. The interactor is unmapped in the window and the canvas
status of the interactor is set to unmapped. 
X ResourcesNone. 
Default Keyboard
Translations Default Keyboard TranslationsKey BindingAction String Shift<Key>Tab<Key>BackTab<Key>Tab<Key>osfRight<Key>osfDown<Key>osfLeft<Key>osfUp<Key>osfBeginLine

  
These translations are only set on top level scenes. See the 
Interpret()operation for a description of the action strings. 


ExamplesNo example for this abstract base class. See MonoScene(3X) and HBox(3X)
for examples. 
Files
scene.h

See Also

Alignment(3X) , Canvas(3X) , Interactor(3X) , Shape(3X) , VirtualBindings(3X) , World(3X) .


Table of Contents