The selector controller captures events and builds a selection. More...
#include <selector.h>
Public Types | |
typedef PapyrusPointer< Selector > | pointer |
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 Drawables & | selection () |
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] |
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.
typedef PapyrusPointer<Selector> Papyrus::Selector::pointer |
Reimplemented from Papyrus::DrawableController.
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] |
References Papyrus::DrawableSet::add().
Papyrus::Selector::~Selector | ( | ) | [virtual] |
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] |
Reimplemented from Papyrus::Controller.
References Papyrus::DrawableSet::add(), Papyrus::DrawableSet::clear(), Papyrus::Event::CONTROL_MASK, Papyrus::DrawableSet::has(), m_last_position, m_select_from_group, m_select_mode, m_selection_depth, Papyrus::SELECT_PRESS, Papyrus::Event::Event::state, Papyrus::Event::Button::x, and Papyrus::Event::Button::y.
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 | ( | ) |
References Papyrus::DrawableSet::m_drawables.
int Papyrus::Selector::selection_depth | ( | ) |
References m_selection_depth.
void Papyrus::Selector::set_select_from_group | ( | Group::pointer | select_from_group | ) |
References Papyrus::DrawableSet::clear(), and m_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.
bool Papyrus::Selector::m_add_drawable_only [protected] |
double Papyrus::Selector::m_last_position[2] [protected] |
Referenced by on_button_press().
Drawable::pointer Papyrus::Selector::m_picked [protected] |
Group::pointer Papyrus::Selector::m_select_from_group [protected] |
Referenced by on_button_press(), select_from_group(), and set_select_from_group().
unsigned Papyrus::Selector::m_select_mode [protected] |
Referenced by disable_select_mode(), enable_select_mode(), on_button_press(), select_mode(), and set_select_mode().
int Papyrus::Selector::m_selection_depth [protected] |
Referenced by on_button_press(), selection_depth(), and set_selection_depth().