Contents User Forum Source Index APIs by Task APIs by Level Data


G3D::WidgetManager Class Reference

Manages a group of GModules. More...

#include <Widget.h>

Inherits G3D::Widget.

List of all members.

Public Types

typedef ReferenceCountedPointer<
class WidgetManager
Ref

Public Member Functions

void add (const Widget::Ref &m)
void beginLock ()
void clear ()
void defocusWidget (const Widget::Ref &m)
void endLock ()
void fireEvent (const GEvent &event)
Widget::Ref focusedWidget () const
virtual bool onEvent (const GEvent &event)
virtual void onLogic ()
virtual void onNetwork ()
virtual void onPose (Array< PosedModel::Ref > &posedArray, Array< PosedModel2DRef > &posed2DArray)
virtual void onSimulation (RealTime rdt, SimTime sdt, SimTime idt)
virtual void onUserInput (UserInput *ui)
const Widget::Refoperator[] (int i) const
void ReferenceCountedObject_zeroWeakPointers ()
void remove (const Widget::Ref &m)
void setFocusedWidget (const Widget::Ref &m)
virtual void setManager (WidgetManager *m)
int size () const
virtual GWindowwindow () const

Static Public Member Functions

static WidgetManager::Ref create (GWindow *window)
static bool onEvent (const GEvent &event, WidgetManager::Ref &a)
static bool onEvent (const GEvent &event, WidgetManager::Ref &a, WidgetManager::Ref &b)

Public Attributes

AtomicInt32 ReferenceCountedObject_refCount
_WeakPtrLinkedListReferenceCountedObject_weakPointer

Protected Attributes

WidgetManagerm_manager

Classes

class  DelayedEvent
 Manager events that have been delayed by a lock.


Detailed Description

Manages a group of GModules.

This is used internally by G3D::GApp to process its modules. It also enables use of GModules without the GApp infrastructure. Most users do not need to use this class.

You can use GModules without this class.


Member Typedef Documentation


Member Function Documentation

void G3D::WidgetManager::add ( const Widget::Ref m  ) 

If a lock is in effect, the add may be delayed until the unlock.

Priorities should generally not be used; they are largely for supporting debugging components at HIGH_PRIORITY that intercept events before they can hit the regular infrastructure.

void G3D::WidgetManager::beginLock (  ) 

Between beginLock and endLock, add and remove operations are delayed so that iteration is safe.

Locks may not be executed recursively; only one level of locking is allowed.

void G3D::WidgetManager::clear (  ) 

Removes all.

static WidgetManager::Ref G3D::WidgetManager::create ( GWindow window  )  [static]

Parameters:
window The window that generates events for this manager.

void G3D::WidgetManager::defocusWidget ( const Widget::Ref m  ) 

Removes focus from this module if it had focus, otherwise does nothing.

void G3D::WidgetManager::endLock (  ) 

void G3D::WidgetManager::fireEvent ( const GEvent event  )  [virtual]

Queues an event on the window associated with this manager.

Reimplemented from G3D::Widget.

Widget::Ref G3D::WidgetManager::focusedWidget (  )  const

At most one widget has focus at a time.

May be NULL.

virtual bool G3D::WidgetManager::onEvent ( const GEvent event  )  [virtual]

Returning true consumes the event and prevents other GModules from seeing it.

Motion events (GEventType::MOUSEMOTION, GEventType::JOYHATMOTION, JGEventType::OYBALLMOTION, and GEventType::JOYAXISMOTION) cannot be cancelled.

Implements G3D::Widget.

static bool G3D::WidgetManager::onEvent ( const GEvent event,
WidgetManager::Ref a 
) [static]

static bool G3D::WidgetManager::onEvent ( const GEvent event,
WidgetManager::Ref a,
WidgetManager::Ref b 
) [static]

Deprecated:
Runs the event handles of each manager interlaced, as if all the modules from b were in a.

virtual void G3D::WidgetManager::onLogic (  )  [virtual]

Implements G3D::Widget.

virtual void G3D::WidgetManager::onNetwork (  )  [virtual]

Implements G3D::Widget.

virtual void G3D::WidgetManager::onPose ( Array< PosedModel::Ref > &  posedArray,
Array< PosedModel2DRef > &  posed2DArray 
) [virtual]

Calls onPose on all children.

Implements G3D::Widget.

virtual void G3D::WidgetManager::onSimulation ( RealTime  rdt,
SimTime  sdt,
SimTime  idt 
) [virtual]

Implements G3D::Widget.

virtual void G3D::WidgetManager::onUserInput ( UserInput ui  )  [virtual]

Implements G3D::Widget.

const Widget::Ref& G3D::WidgetManager::operator[] ( int  i  )  const

Returns a module by index number.

The highest index is the one that receives events first.

void G3D::ReferenceCountedObject::ReferenceCountedObject_zeroWeakPointers (  )  [inline, inherited]

Automatically called immediately before the object is deleted.

This is not called from the destructor because it needs to be invoked before the subclass destructor.

void G3D::WidgetManager::remove ( const Widget::Ref m  ) 

If a lock is in effect the remove will be delayed until the unlock.

void G3D::WidgetManager::setFocusedWidget ( const Widget::Ref m  ) 

The module must have already been added.

This module will be moved to the top of the priority list (i.e., it will receive events first). You can pass NULL.

If you change the focus during a lock, the actual focus change will not take effect until the lock is released.

Setting the focus automatically brings a module to the front of the event processing list.

virtual void G3D::Widget::setManager ( WidgetManager m  )  [inline, virtual, inherited]

Called by the WidgetManager when this module is added to it.

The argument may be NULL

Reimplemented in G3D::DeveloperWindow.

int G3D::WidgetManager::size (  )  const

Number of installed modules.

virtual GWindow* G3D::WidgetManager::window (  )  const [virtual]

Returns the operating system window that is currently rendering this Widget.

Reimplemented from G3D::Widget.


Member Data Documentation

WidgetManager* G3D::Widget::m_manager [protected, inherited]

The manager, set by setManager().

This cannot be a reference counted pointer because that would create a cycle between the Widget and its manager.

The long name is to keep this from accidentally conflicting with a subclass's variable name.

Do not use or explicitly manipulate this value--its type may change in the future and is not part of the supported API.

Linked list of all weak pointers that reference this (some may be on the stack!).

Do not use or explicitly manipulate this value.


The documentation for this class was generated from the following file:
Generated on Thu Aug 2 11:40:48 2007 for G3D by doxygen 1.5.2
Hosted by SourceForge.net Logo