VPTissue Reference Manual
SimShell::Gui::PTreeMenu Class Reference

A menu reflecting the structure of a ptree. More...

#include <PTreeMenu.h>

Inheritance diagram for SimShell::Gui::PTreeMenu:
Inheritance graph
Collaboration diagram for SimShell::Gui::PTreeMenu:
Collaboration graph

Signals

void ItemTriggered (QString const &subtree=QString())
 

Public Member Functions

 PTreeMenu (QString const &title, QString const &path_prefix=QString(), QWidget *parent=0)
 
virtual ~PTreeMenu ()
 Destructor does not do a thing, except be virtual.
 
virtual bool IsOpened () const
 Test whether menu is in opened state.
 
bool OpenPTree (boost::property_tree::ptree const &pt, int depth=-1)
 Open a ptree. More...
 
- Public Member Functions inherited from SimShell::Gui::HasUnsavedChanges
 HasUnsavedChanges (std::string &&title)
 
virtual ~HasUnsavedChanges ()
 Virtual destructor.
 
ChildrenType::iterator begin ()
 Get iterator to first child.
 
ChildrenType::const_iterator begin () const
 Get iterator to first child.
 
ChildrenType::iterator end ()
 Get iterator to one position after last child.
 
ChildrenType::const_iterator end () const
 Get iterator to one position after last child.
 
void ForceClose ()
 Force this object and its children to go back to unopened state so it can be safely deleted.
 
const std::string & GetTitle ()
 Get title of this object.
 
bool IsClean () const
 
bool Save ()
 Try to save this widget's (and its children's) changes. More...
 
bool SaveAndClose ()
 Try to save this object (and its children) and, if successful, close them all.
 

Protected Member Functions

virtual void InternalForceClose ()
 
virtual bool InternalIsClean () const
 
virtual bool InternalSave ()
 
- Protected Member Functions inherited from SimShell::Gui::HasUnsavedChanges
void AddChild (ChildrenType::value_type &&v)
 Add child.
 
virtual void InternalPreForceClose ()
 Additional things to do before closing children of this widget.
 
void SetChildren (ChildrenType &&c)
 Set children.
 

Additional Inherited Members

- Public Types inherited from SimShell::Gui::HasUnsavedChanges
typedef std::vector< HasUnsavedChanges * > ChildrenType
 

Detailed Description

A menu reflecting the structure of a ptree.

Given a ptree, this class constructs a hierarchical menu reflecting the ptree structure. Each subtree can be selected, causing the menu to emit the ItemTriggered() signal.

Definition at line 39 of file PTreeMenu.h.

Constructor & Destructor Documentation

SimShell::Gui::PTreeMenu::PTreeMenu ( QString const &  title,
QString const &  path_prefix = QString(),
QWidget parent = 0 
)
Parameters
titleMenu title. Will also be used as dock widget title.
parentParent widget.

Definition at line 34 of file PTreeMenu.cpp.

Member Function Documentation

void SimShell::Gui::PTreeMenu::InternalForceClose ( )
protectedvirtual
See also
IHasUnsavedChanges

Implements SimShell::Gui::HasUnsavedChanges.

Definition at line 55 of file PTreeMenu.cpp.

bool SimShell::Gui::PTreeMenu::InternalIsClean ( ) const
protectedvirtual
See also
IHasUnsavedChanges

Implements SimShell::Gui::HasUnsavedChanges.

Definition at line 67 of file PTreeMenu.cpp.

bool SimShell::Gui::PTreeMenu::InternalSave ( )
protectedvirtual
See also
IHasUnsavedChanges

Implements SimShell::Gui::HasUnsavedChanges.

Definition at line 72 of file PTreeMenu.cpp.

bool SimShell::Gui::PTreeMenu::OpenPTree ( boost::property_tree::ptree const &  pt,
int  depth = -1 
)

Open a ptree.

Menu will reflect hierarchical structure of the ptree.

Parameters
ptPTree to display in menu.
depthMaximum depth of submenu hierarchy. If depth = -1, there is no maximum depth.

Definition at line 82 of file PTreeMenu.cpp.

References SimShell::Gui::HasUnsavedChanges::SaveAndClose().

Referenced by SimShell::Gui::PTreeContainer::Open().

Here is the call graph for this function:

Here is the caller graph for this function:


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