Version: 8.3.0
YACS::HMI::EditionContainer Class Reference

#include <EditionContainer.hxx>

Inheritance diagram for YACS::HMI::EditionContainer:
Collaboration diagram for YACS::HMI::EditionContainer:

Public Slots

virtual void fillContainerPanel ()
 
virtual void onApply ()
 
virtual void onCancel ()
 
- Public Slots inherited from YACS::HMI::ItemEdition
virtual void onApply ()
 
virtual void onCancel ()
 
virtual void onModifyName (const QString &text)
 

Public Member Functions

 EditionContainer (Subject *subject, QWidget *parent=0, const char *name=0)
 
virtual ~EditionContainer ()
 
virtual void update (GuiEvent event, int type, Subject *son)
 
- Public Member Functions inherited from YACS::HMI::ItemEdition
 ItemEdition (Subject *subject, QWidget *parent=0, const char *name=0)
 
virtual ~ItemEdition ()
 
virtual void synchronize ()
 
virtual void select (bool isSelected)
 
virtual void setName (std::string name)
 
virtual void setEdited (bool isEdited)
 
- Public Member Functions inherited from FormEditItem
 FormEditItem (QWidget *parent=0)
 
virtual ~FormEditItem ()
 
- Public Member Functions inherited from YACS::HMI::ItemEditionBase
 ItemEditionBase (Subject *subject)
 
virtual ~ItemEditionBase ()
 
virtual SubjectgetSubject ()
 
- Public Member Functions inherited from YACS::HMI::GuiObserver
 GuiObserver ()
 
virtual ~GuiObserver ()
 
virtual void incrementSubjects (Subject *subject)
 
virtual void decrementSubjects (Subject *subject)
 
int getNbSubjects ()
 
bool isDestructible ()
 

Protected Attributes

FormContainerDecorator_wContainer
 
- Protected Attributes inherited from YACS::HMI::ItemEdition
bool _isEdited
 
bool _haveScript
 
- Protected Attributes inherited from FormEditItem
WidEditItem_wid
 
- Protected Attributes inherited from YACS::HMI::ItemEditionBase
Subject_subject
 
int _stackId
 
std::string _name
 
std::string _type
 
std::string _category
 
- Protected Attributes inherited from YACS::HMI::GuiObserver
std::set< Subject * > _subjectSet
 
bool _destructible
 

Private Member Functions

YACS::ENGINE::ContainergetContainer ()
 

Additional Inherited Members

- Static Public Member Functions inherited from YACS::HMI::ItemEdition
static std::string filterName (const std::string &name)
 
- Static Protected Attributes inherited from YACS::HMI::GuiObserver
static std::map< int, std::string > _eventNameMap
 

Detailed Description

Definition at line 32 of file EditionContainer.hxx.

Constructor & Destructor Documentation

EditionContainer::EditionContainer ( Subject subject,
QWidget parent = 0,
const char *  name = 0 
)

Definition at line 39 of file EditionContainer.cxx.

References _wContainer, FormEditItem::_wid, fillContainerPanel(), and getContainer().

39  :ItemEdition(subject, parent, name)
40 {
42  _wid->gridLayout1->addWidget(_wContainer);
43  connect(_wContainer, SIGNAL(resourceMousePressed()), this, SLOT(fillContainerPanel()));
44  connect(_wContainer->tb_container, SIGNAL(toggled(bool)), this, SLOT(fillContainerPanel())); // --- to update display of current selection
45  _wContainer->tb_container->toggle();
46 }
EditionContainer::~EditionContainer ( )
virtual

Definition at line 48 of file EditionContainer.cxx.

49 {
50 }

Member Function Documentation

void EditionContainer::fillContainerPanel ( )
virtualslot

Definition at line 68 of file EditionContainer.cxx.

References _wContainer, DEBTRACE, FormContainerDecorator::FillPanel(), and getContainer().

Referenced by EditionContainer(), and update().

69 {
70  DEBTRACE("EditionContainer::fillContainerPanel");
72 }
YACS::ENGINE::Container * EditionContainer::getContainer ( )
private

Definition at line 96 of file EditionContainer.cxx.

References YACS::HMI::ItemEditionBase::_subject, YACS::HMI::SubjectContainerBase::getContainer(), and YASSERT.

Referenced by EditionContainer(), and fillContainerPanel().

97 {
98  SubjectContainerBase *scont(dynamic_cast<SubjectContainerBase*>(_subject));
99  YASSERT(scont);
100  return scont->getContainer();
101 }
void EditionContainer::onApply ( )
virtualslot

Definition at line 74 of file EditionContainer.cxx.

References YACS::HMI::ItemEdition::_isEdited, _wContainer, DEBTRACE, YACS::HMI::GuiContext::getCurrent(), FormContainerDecorator::onApply(), and YACS::HMI::ItemEdition::onApply().

75 {
76  DEBTRACE("EditionContainer::onApply");
77  bool edited = true;
78  if (!_wContainer->onApply())
79  {
80  _isEdited = true;
81  Message mess(GuiContext::getCurrent()->_lastErrorMessage);
82  return;
83  }
84  edited = false;
85  _isEdited = _isEdited || edited;
87 }
void EditionContainer::onCancel ( )
virtualslot

Definition at line 89 of file EditionContainer.cxx.

References _wContainer, DEBTRACE, FormContainerDecorator::onCancel(), and YACS::HMI::ItemEdition::onCancel().

90 {
91  DEBTRACE("EditionContainer::onCancel");
94 }
void EditionContainer::update ( GuiEvent  event,
int  type,
Subject son 
)
virtual

when loading a schema, creation of all edition widgets is time and memory consuming, so, widget edition creation is differed until user select an item in tree or 2D vue.

Reimplemented from YACS::HMI::ItemEdition.

Definition at line 52 of file EditionContainer.cxx.

References _wContainer, DEBTRACE, fillContainerPanel(), YACS::HMI::Subject::getName(), YACS::HMI::RENAME, FormContainerDecorator::setName(), YACS::HMI::ItemEdition::update(), and YACS::HMI::UPDATE.

Referenced by gui.graph.MyCanvas::customEvent().

53 {
54  DEBTRACE("EditionContainer::update");
55  ItemEdition::update(event, type, son);
56  switch (event)
57  {
58  case RENAME:
59  case UPDATE:
60  _wContainer->setName(son->getName());
62  break;
63  default:
64  ;
65  }
66 }

Member Data Documentation

FormContainerDecorator* YACS::HMI::EditionContainer::_wContainer
protected

Definition at line 53 of file EditionContainer.hxx.

Referenced by EditionContainer(), fillContainerPanel(), onApply(), onCancel(), and update().


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