VPTissue Reference Manual
SimShell::Gui::PTreeContainer Class Reference

For a given ptree, constructs PTreeMenu, QDockWidget, PTreeEditorWindow. More...

#include <PTreeContainer.h>

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

Signals

void Applied (boost::property_tree::ptree const &)
 
void StatusChanged (QString const &)
 

Public Member Functions

 PTreeContainer (QString const &title, QWidget *parent=0)
 
QDockWidgetGetDock () const
 Get the associated dock widget, containing the ptree editor.
 
std::string GetEditPath () const
 Get the current edit path. More...
 
PTreeMenuGetMenu () const
 Get the associated menu.
 
virtual boost::property_tree::ptree GetPTreeState () const
 
virtual bool IsOpened () const
 
bool Open (boost::property_tree::ptree const &pt, QString const &edit_path="")
 Open ptree with given edit path. More...
 
void Redo ()
 
void SetOnlyEditData (bool)
 If true, the user can't insert, move, delete or edit keys. More...
 
virtual void SetPTreeState (const boost::property_tree::ptree &)
 
void Undo ()
 
- 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

For a given ptree, constructs PTreeMenu, QDockWidget, PTreeEditorWindow.

The ptree menu will reflect the hierarchical structure of the ptree. For each subtree in the ptree, the user can select it in the menu to open it in the editor. By default, the entire ptree is shown in the editor. The editor is encapsulated in a dock widget.

Definition at line 45 of file PTreeContainer.h.

Member Function Documentation

std::string SimShell::Gui::PTreeContainer::GetEditPath ( ) const

Get the current edit path.

The edit path is the current subtree that is shown in the associated ptree editor. If the entire ptree is shown in the editor (=default behavior), the edit path is empty.

Definition at line 65 of file PTreeContainer.cpp.

ptree SimShell::Gui::PTreeContainer::GetPTreeState ( ) const
virtual
See also
IHasPTreeState::GetPTreeState().

Implements SimShell::Gui::IHasPTreeState.

Definition at line 75 of file PTreeContainer.cpp.

Referenced by SimShell::Gui::PTreeContainerPreferencesObserver::Update().

Here is the caller graph for this function:

void SimShell::Gui::PTreeContainer::InternalForceClose ( )
protectedvirtual
See also
HasUnsavedChanges

Implements SimShell::Gui::HasUnsavedChanges.

Definition at line 83 of file PTreeContainer.cpp.

bool SimShell::Gui::PTreeContainer::InternalIsClean ( ) const
protectedvirtual
See also
HasUnsavedChanges

Implements SimShell::Gui::HasUnsavedChanges.

Definition at line 89 of file PTreeContainer.cpp.

bool SimShell::Gui::PTreeContainer::InternalSave ( )
protectedvirtual
See also
HasUnsavedChanges

Implements SimShell::Gui::HasUnsavedChanges.

Definition at line 94 of file PTreeContainer.cpp.

bool SimShell::Gui::PTreeContainer::IsOpened ( ) const
virtual
See also
HasUnsavedChanges

Implements SimShell::Gui::HasUnsavedChanges.

Definition at line 99 of file PTreeContainer.cpp.

bool SimShell::Gui::PTreeContainer::Open ( boost::property_tree::ptree const &  pt,
QString const &  edit_path = "" 
)

Open ptree with given edit path.

The edit path is a path pointing to a subtree. If the edit path is not empty, only the designated subtree will be shown in the editor.

Definition at line 104 of file PTreeContainer.cpp.

References SimShell::Gui::PTreeMenu::OpenPTree().

Referenced by SimShell::Gui::PTreeContainerPreferencesObserver::Update().

Here is the call graph for this function:

Here is the caller graph for this function:

void SimShell::Gui::PTreeContainer::SetOnlyEditData ( bool  b)

If true, the user can't insert, move, delete or edit keys.

This is the same as a read-only property: the user can still edit values in the 'data' column.

Definition at line 144 of file PTreeContainer.cpp.

Referenced by SimPT_Editor::PTreePanels::PTreePanels().

Here is the caller graph for this function:

void SimShell::Gui::PTreeContainer::SetPTreeState ( const boost::property_tree::ptree &  )
virtual
See also
IHasPTreeState::SetPTreeState().

Implements SimShell::Gui::IHasPTreeState.

Definition at line 132 of file PTreeContainer.cpp.

Referenced by SimShell::Gui::PTreeContainerPreferencesObserver::Update().

Here is the caller graph for this function:


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