papyrus logo

Papyrus::Selector Class Reference

The selector controller captures events and builds a selection. More...

#include <selector.h>

Inheritance diagram for Papyrus::Selector:
Inheritance graph
[legend]

List of all members.

Public Types

typedef PapyrusPointer< Selectorpointer

Public Member Functions

virtual ~Selector ()
Group::pointer select_from_group ()
void set_select_from_group (Group::pointer select_from_group)
void set_select_mode (unsigned mode)
void enable_select_mode (unsigned mode)
void disable_select_mode (unsigned mode)
unsigned select_mode ()
int selection_depth ()
void set_selection_depth (int selection_depth)
const Drawablesselection ()

Static Public Member Functions

static pointer create (Group::pointer select_from_group=Group::pointer(), SelectionMode mode=SELECT_PRESS, int selection_depth=1)
static pointer create (const Glib::ustring &id, DrawableSet::pointer selected, Group::pointer select_from_group=Group::pointer(), SelectionMode mode=SELECT_PRESS, int selection_depth=1)
static pointer create (const Glib::ustring &id, Group::pointer select_from_group=Group::pointer(), SelectionMode mode=SELECT_PRESS, int selection_depth=1)
static pointer create (DrawableSet::pointer selected, Group::pointer select_from_group, SelectionMode mode=SELECT_PRESS, int selection_depth=1)

Protected Member Functions

 Selector (const Glib::ustring &id, DrawableSet::pointer drawables, Group::pointer select_from_group=Group::pointer(), SelectionMode mode=SELECT_PRESS, int selection_depth=1)
virtual bool on_button_press (const Event::ButtonPress &event)
virtual bool on_button_release (const Event::ButtonRelease &event)
virtual bool on_motion (const Event::Motion &event)

Protected Attributes

unsigned m_select_mode
int m_selection_depth
Group::pointer m_select_from_group
bool m_add_drawable_only
Drawable::pointer m_picked
double m_last_position [2]

Detailed Description

The selector controller captures events and builds a selection.

DrawableContainerInterface is an ancestor of Selector. Therefore an owning Papyrus::Group object may be set as well as a drawing Papyrus::Group object.

The containers of these groups are not synchronized to the selection. However as items are selected and deselected they are respectively added to and removed from each group.

Author:
Rick L Vinyard Jr <rvinyard@cs.nmsu.edu>
Todo:
This probably needs to be a vector rather than a set

Member Typedef Documentation

typedef PapyrusPointer<Selector> Papyrus::Selector::pointer

Reimplemented from Papyrus::DrawableController.


Constructor & Destructor Documentation

Papyrus::Selector::Selector ( const Glib::ustring &  id,
DrawableSet::pointer  drawables,
Group::pointer  select_from_group = Group::pointer(),
SelectionMode  mode = SELECT_PRESS,
int  selection_depth = 1 
) [protected]
Papyrus::Selector::~Selector (  )  [virtual]

Member Function Documentation

Selector::pointer Papyrus::Selector::create ( DrawableSet::pointer  selected,
Group::pointer  select_from_group,
SelectionMode  mode = SELECT_PRESS,
int  selection_depth = 1 
) [static]

References PAPYRUS_CREATE.

Selector::pointer Papyrus::Selector::create ( const Glib::ustring &  id,
Group::pointer  select_from_group = Group::pointer(),
SelectionMode  mode = SELECT_PRESS,
int  selection_depth = 1 
) [static]

References PAPYRUS_CREATE.

Selector::pointer Papyrus::Selector::create ( const Glib::ustring &  id,
DrawableSet::pointer  selected,
Group::pointer  select_from_group = Group::pointer(),
SelectionMode  mode = SELECT_PRESS,
int  selection_depth = 1 
) [static]

References PAPYRUS_CREATE.

Selector::pointer Papyrus::Selector::create ( Group::pointer  select_from_group = Group::pointer(),
SelectionMode  mode = SELECT_PRESS,
int  selection_depth = 1 
) [static]

References PAPYRUS_CREATE.

void Papyrus::Selector::disable_select_mode ( unsigned  mode  ) 

References m_select_mode.

void Papyrus::Selector::enable_select_mode ( unsigned  mode  ) 

References m_select_mode.

bool Papyrus::Selector::on_button_press ( const Event::ButtonPress event  )  [protected, virtual]
bool Papyrus::Selector::on_button_release ( const Event::ButtonRelease event  )  [protected, virtual]

Reimplemented from Papyrus::Controller.

bool Papyrus::Selector::on_motion ( const Event::Motion event  )  [protected, virtual]

Reimplemented from Papyrus::Controller.

Group::pointer Papyrus::Selector::select_from_group (  ) 

References m_select_from_group.

unsigned Papyrus::Selector::select_mode (  ) 

References m_select_mode.

const Selector::Drawables & Papyrus::Selector::selection (  ) 
int Papyrus::Selector::selection_depth (  ) 

References m_selection_depth.

void Papyrus::Selector::set_select_from_group ( Group::pointer  select_from_group  ) 
void Papyrus::Selector::set_select_mode ( unsigned  mode  ) 

References m_select_mode.

void Papyrus::Selector::set_selection_depth ( int  selection_depth  ) 

References m_selection_depth.


Member Data Documentation

double Papyrus::Selector::m_last_position[2] [protected]

Referenced by on_button_press().

unsigned Papyrus::Selector::m_select_mode [protected]

The documentation for this class was generated from the following files:

Generated on Fri Apr 16 12:41:09 2010 for papyrus by doxygen 1.6.1