Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

projecttree Class Reference

Tree view into the project structure and manipulation tools. More...

#include <projecttree.h>

List of all members.

Public Member Functions

 projecttree (wxWindow *parent, wxWindowID id=-1)
 Constuctor.
void onExpand (wxTreeEvent &evt)
 Expands the current node.
void onSelect (wxTreeEvent &evt)
 user has selected a node action.
void onRightClick (wxTreeEvent &evt)
 Called when user right-clicks on a node.
void onLabelEdit (wxCommandEvent &evt)
 Allows user to rename a node.
void onEndLabelEdit (wxTreeEvent &evt)
 Called when the user has finsihed editing a node label.
void onProperties (wxCommandEvent &evt)
 Allow user to view the properties of the selected node.
void onRemove (wxCommandEvent &evt)
 Removes a node from the tree.
void onAddSource (wxCommandEvent &evt)
 Queries the user to add a source element to the tree.
void onAddGroup (wxCommandEvent &evt)
 Queries the user to add a group element to the tree.
void onAddTool (wxCommandEvent &evt)
 Queries the user to add a tool to the tree.
void onEditScript (wxCommandEvent &evt)
 Opens a script in the editor.
void onCopy (wxCommandEvent &evt)
 Copy a disk file.
void onMove (wxCommandEvent &evt)
 Move a disk file to another place.
void onRename (wxCommandEvent &evt)
 Renames a node.
void onDelete (wxCommandEvent &evt)
 Delete a node from the tree.
void onEditFile (wxCommandEvent &evt)
 Attempt to open the file on the editor.
void onMkDir (wxCommandEvent &evt)
 Ask the user about creating a new folder on disk.
void onNew (wxCommandEvent &evt)
 Create a new project.
void doNew ()
 This creates a new project without regard, erasing the old, if any.
void doNewFromTemplate ()
 Open a new project template.
void onOpen (wxCommandEvent &evt)
 Opens a new project, querying about saving first.
void onSave (wxCommandEvent &evt)
 Calls doSave to save the current project.
void doSave ()
 Calls saveProject or doSaveAs if the project has yet to be saved.
void onSaveAs (wxCommandEvent &evt)
 Calls doSaveAs.
bool doSaveAs ()
 Names and saves the project to disk setting the work dir.
void onNewFile (wxCommandEvent &evt)
 Create a new file under the parent node and in the editor.
void onNewFileFromTemplate (wxCommandEvent &evt)
 Create a new file from a template.
void doRunTool (const wxString &path)
 Attempt to execute the tool at tree path.
void onScm (wxCommandEvent &evt)
 Handle SCM operations.
void onClose (wxCloseEvent &evt)
 Called when the project window is about to be destroyed.
void onBeginDrag (wxTreeEvent &evt)
 User has started an internal drag operation.
void onEndDrag (wxTreeEvent &evt)
 User has finished the internal drag operation.
bool askSaveNewProject ()
 Ask if the user wants to save this project.
bool addToProject (wxString fname)
 Adds a file or dir to the sources or a group element.
bool openProject (wxString fname)
 Opens a new project.
bool saveProject ()
 Saves the current project to disk.
int getFileType (const wxString &fname)
 Return the index into the image list for tree node bitmaps based on the file type.
void addChildren (const wxString &rootPath, TiXmlElement *item, wxTreeItemId &id)
 Recursive method to add children to the tree while reading proj file.
void writeProjectTree (const wxTreeItemId &idParent, wxTreeItemIdValue cookie, wxTextOutputStream &outp, int depth)
 Traverse the project tree, writing xml elements.
bool isDirty ()


Detailed Description

Tree view into the project structure and manipulation tools.


Constructor & Destructor Documentation

projecttree::projecttree wxWindow *  parent,
wxWindowID  id = -1
 

Constuctor.


Member Function Documentation

void projecttree::addChildren const wxString &  rootPath,
TiXmlElement *  item,
wxTreeItemId &  id
 

Recursive method to add children to the tree while reading proj file.

Parameters:
rootPath the root disk path of the project
item the xml element to add to
id the parent node id

bool projecttree::addToProject wxString  fname  ) 
 

Adds a file or dir to the sources or a group element.

Parameters:
fname the file or dir to add

bool projecttree::askSaveNewProject  ) 
 

Ask if the user wants to save this project.

This is not used anymore I think.

void projecttree::doNew  ) 
 

This creates a new project without regard, erasing the old, if any.

void projecttree::doNewFromTemplate  ) 
 

Open a new project template.

Project templates are simply zip files that get decompressed somewhere chosen by the user. A simple gsub takes place as the files are being decompressed, subbing MF_PROJECT_NAME with the project name.

Todo:
this mechanism needs to be enhanced.

void projecttree::doRunTool const wxString &  path  ) 
 

Attempt to execute the tool at tree path.

Navigates the tree and locates the tool named. If found, sends an ITEM_ACTIVATED event to itself.

Parameters:
path the tree path to the tool.

void projecttree::doSave  ) 
 

Calls saveProject or doSaveAs if the project has yet to be saved.

bool projecttree::doSaveAs  ) 
 

Names and saves the project to disk setting the work dir.

int projecttree::getFileType const wxString &  fname  ) 
 

Return the index into the image list for tree node bitmaps based on the file type.

Parameters:
fname the file name
Returns:
the index into the imagelist

bool projecttree::isDirty  )  [inline]
 

void projecttree::onAddGroup wxCommandEvent &  evt  ) 
 

Queries the user to add a group element to the tree.

Parameters:
evt called by wx

void projecttree::onAddSource wxCommandEvent &  evt  ) 
 

Queries the user to add a source element to the tree.

Parameters:
evt called by wx

void projecttree::onAddTool wxCommandEvent &  evt  ) 
 

Queries the user to add a tool to the tree.

Parameters:
evt called by wx

void projecttree::onBeginDrag wxTreeEvent &  evt  ) 
 

User has started an internal drag operation.

Parameters:
evt called by wx

void projecttree::onClose wxCloseEvent &  evt  ) 
 

Called when the project window is about to be destroyed.

Parameters:
evt called by wx

void projecttree::onCopy wxCommandEvent &  evt  ) 
 

Copy a disk file.

Parameters:
evt called by wx

void projecttree::onDelete wxCommandEvent &  evt  ) 
 

Delete a node from the tree.

If this is a file or dir node, delete from disk as well.

Parameters:
evt called by wx

void projecttree::onEditFile wxCommandEvent &  evt  ) 
 

Attempt to open the file on the editor.

Parameters:
evt called by wx

void projecttree::onEditScript wxCommandEvent &  evt  ) 
 

Opens a script in the editor.

Parameters:
evt called by wx

void projecttree::onEndDrag wxTreeEvent &  evt  ) 
 

User has finished the internal drag operation.

Parameters:
evt called by wx
Bug:
see dirtree::onEndDrag

void projecttree::onEndLabelEdit wxTreeEvent &  evt  ) 
 

Called when the user has finsihed editing a node label.

May just change the label or perhaps the file or dir name as well, if applicable.

Parameters:
evt called by wx

void projecttree::onExpand wxTreeEvent &  evt  ) 
 

Expands the current node.

Parameters:
evt called by wx

void projecttree::onLabelEdit wxCommandEvent &  evt  ) 
 

Allows user to rename a node.

Parameters:
evt called by wx

void projecttree::onMkDir wxCommandEvent &  evt  ) 
 

Ask the user about creating a new folder on disk.

Parameters:
evt called by wx

void projecttree::onMove wxCommandEvent &  evt  ) 
 

Move a disk file to another place.

Parameters:
evt called by wx

void projecttree::onNew wxCommandEvent &  evt  ) 
 

Create a new project.

If a project is currently open and has been modified, asks about a save.

Parameters:
evt called by wx

void projecttree::onNewFile wxCommandEvent &  evt  ) 
 

Create a new file under the parent node and in the editor.

Parameters:
evt called by wx

void projecttree::onNewFileFromTemplate wxCommandEvent &  evt  ) 
 

Create a new file from a template.

Parameters:
evt called by wx
Todo:
this does nothing and is called by no one.

void projecttree::onOpen wxCommandEvent &  evt  ) 
 

Opens a new project, querying about saving first.

Parameters:
evt called by wx

void projecttree::onProperties wxCommandEvent &  evt  ) 
 

Allow user to view the properties of the selected node.

Parameters:
evt called by wx

void projecttree::onRemove wxCommandEvent &  evt  ) 
 

Removes a node from the tree.

Parameters:
evt called by wx

void projecttree::onRename wxCommandEvent &  evt  ) 
 

Renames a node.

This may also rename the associated file on disk.

Parameters:
evt called by wx
Todo:
need to crawl the tree for any references and change thos as well.

void projecttree::onRightClick wxTreeEvent &  evt  ) 
 

Called when user right-clicks on a node.

Creates a relevant popup menu.

Parameters:
evt called by wx

void projecttree::onSave wxCommandEvent &  evt  ) 
 

Calls doSave to save the current project.

Parameters:
evt called by wx

void projecttree::onSaveAs wxCommandEvent &  evt  ) 
 

Calls doSaveAs.

Parameters:
evt called by wx

void projecttree::onScm wxCommandEvent &  evt  ) 
 

Handle SCM operations.

Parameters:
evt called by wx
Bug:
this does not remove the temp file if one was created.

void projecttree::onSelect wxTreeEvent &  evt  ) 
 

user has selected a node action.

Parameters:
evt called by wx

bool projecttree::openProject wxString  fname  ) 
 

Opens a new project.

Parameters:
fname the path of the project file

bool projecttree::saveProject  ) 
 

Saves the current project to disk.

void projecttree::writeProjectTree const wxTreeItemId &  idParent,
wxTreeItemIdValue  cookie,
wxTextOutputStream &  outp,
int  depth
 

Traverse the project tree, writing xml elements.

Parameters:
idParent the parent id
cookie used by wx to keep track of the tree walk
outp the output stream to write to
depth the indent level


The documentation for this class was generated from the following files:
Generated on Fri Mar 10 12:32:03 2006 for MonkeyFish by  doxygen 1.4.4