The SelectionObserver class simplifies the step to write classes that listen to what happens to the selection. More...
#include <Selection.h>
Public Member Functions | |
void | attachSelection () |
Attaches to the selection. More... | |
bool | blockSelection (bool block) |
void | detachSelection () |
Detaches from the selection. More... | |
bool | isSelectionAttached () const |
bool | isSelectionBlocked () const |
SelectionObserver (bool attach=true, ResolveMode resolve=ResolveMode::OldStyleElement) | |
Constructor. More... | |
SelectionObserver (const Gui::ViewProviderDocumentObject *vp, bool attach=true, ResolveMode resolve=ResolveMode::OldStyleElement) | |
Constructor. More... | |
virtual | ~SelectionObserver () |
The SelectionObserver class simplifies the step to write classes that listen to what happens to the selection.
SelectionObserver::SelectionObserver | ( | bool | attach = true , |
ResolveMode | resolve = ResolveMode::OldStyleElement |
||
) |
Constructor.
attach | whether to attach this observer on construction |
resolve | sub-object resolving mode. 0 no resolve, 1 resolve sub-object with old style element name 2 resolve sub-object with new style element name |
References attachSelection().
SelectionObserver::SelectionObserver | ( | const Gui::ViewProviderDocumentObject * | vp, |
bool | attach = true , |
||
ResolveMode | resolve = ResolveMode::OldStyleElement |
||
) |
Constructor.
vp | filtering view object. |
attach | whether to attach this observer on construction |
resolve | sub-object resolving mode. 0 no resolve, 1 resolve sub-object with old style element name 2 resolve sub-object with new style element name |
Constructs an selection observer that receives only selection event of objects within the same document as the input view object.
References attachSelection(), App::DocumentObject::getDocument(), App::Document::getName(), App::DocumentObject::getNameInDocument(), and Gui::ViewProviderDocumentObject::getObject().
|
virtual |
References detachSelection().
void SelectionObserver::attachSelection | ( | ) |
Attaches to the selection.
References Gui::SelectionSingleton::addSelectionGate(), draftgeoutils.faces::bind(), Gui::NewStyleElement, Gui::OldStyleElement, Gui::Selection(), Gui::SelectionSingleton::signalSelectionChanged, Gui::SelectionSingleton::signalSelectionChanged2, and Gui::SelectionSingleton::signalSelectionChanged3.
Referenced by Gui::Dialog::DlgPropertyLink::attachObserver(), Gui::View3DInventorViewer::init(), SelectionObserver(), SketcherGui::ViewProviderSketch::setEdit(), Gui::PropertyView::showEvent(), and Gui::TreeWidget::showEvent().
Referenced by SketcherGui::TaskSketcherConstraints::on_listWidgetConstraints_itemSelectionChanged(), SketcherGui::TaskSketcherElements::on_listWidgetElements_itemSelectionChanged(), SketcherGui::TaskSketcherConstraints::onSelectionChanged(), PartDesignGui::TaskSketchBasedParameters::onSelectReference(), Gui::TreeWidget::onSelectTimer(), Gui::DocumentItem::populateItem(), TechDrawGui::MDIViewPage::print(), TechDrawGui::MDIViewPage::saveSVG(), Gui::DocumentItem::selectAllInstances(), TechDrawGui::MDIViewPage::setTreeToSceneSelect(), PartDesignGui::TaskPipeOrientation::TaskPipeOrientation(), PartDesignGui::TaskPipeParameters::TaskPipeParameters(), PartDesignGui::TaskPipeScaling::TaskPipeScaling(), PartDesignGui::TaskSketchBasedParameters::TaskSketchBasedParameters(), and Gui::DocumentItem::updateSelection().
void SelectionObserver::detachSelection | ( | ) |
Detaches from the selection.
References Gui::SelectionSingleton::rmvSelectionGate(), and Gui::Selection().
Referenced by TechDrawGui::MDIViewPage::closeEvent(), Gui::Dialog::DlgPropertyLink::detachObserver(), Gui::PropertyView::hideEvent(), Gui::TreeWidget::hideEvent(), SketcherGui::ViewProviderSketch::unsetEdit(), ~SelectionObserver(), and Gui::View3DInventorViewer::~View3DInventorViewer().
bool SelectionObserver::isSelectionAttached | ( | ) | const |
Referenced by Gui::Dialog::DlgPropertyLink::attachObserver(), Gui::Dialog::DlgPropertyLink::detachObserver(), Gui::TreeWidget::expandSelectedItems(), Gui::TreeWidget::getSelection(), Gui::PropertyView::onTimer(), Gui::TreeWidget::selectAllInstances(), Gui::TreeWidget::selectAllLinks(), and Gui::TreeWidget::selectLinkedObject().
bool SelectionObserver::isSelectionBlocked | ( | ) | const |
Referenced by Gui::TreeWidget::selectLinkedObject().