doom3-gpl
Doom 3 GPL source release
|
A tree view of all the materials that have been defined. More...
#include <MaterialTreeView.h>
Public Member Functions | |
virtual | ~MaterialTreeView () |
Destructor for MaterialTreeView. More... | |
void | InitializeMaterialList (bool includeFile=true, const char *filename=NULL) |
Clears the tree and rebuilds it. More... | |
void | BuildMaterialList (bool includeFile=true, const char *filename=NULL) |
Builds the tree of materials. More... | |
virtual void | MV_OnMaterialChange (MaterialDoc *pMaterial) |
Called when the material has changed but not applied. More... | |
virtual void | MV_OnMaterialApply (MaterialDoc *pMaterial) |
Called when the material changes have been applied. More... | |
virtual void | MV_OnMaterialSaved (MaterialDoc *pMaterial) |
Called when the material changes have been saved. More... | |
virtual void | MV_OnMaterialAdd (MaterialDoc *pMaterial) |
Called when a material is added. More... | |
virtual void | MV_OnMaterialDelete (MaterialDoc *pMaterial) |
Called when a material is deleted. More... | |
virtual void | MV_OnMaterialNameChanged (MaterialDoc *pMaterial, const char *oldName) |
Called when the material name has changed. More... | |
virtual void | MV_OnFileReload (const char *filename) |
Called when a file has been reloaded. More... | |
bool | CanCopy () |
Returns true if the user can copy the selected item. More... | |
bool | CanPaste () |
Returns true if the user can paste an item in the copy buffer. More... | |
bool | CanCut () |
Returns true if the user can cut the selected item. More... | |
bool | CanDelete () |
Returns true if the user can delete the selected item. More... | |
bool | CanRename () |
Returns true if the user can rename the selected item. More... | |
bool | CanSaveFile () |
Returns true if the currently selected file needs to be saved. More... | |
idStr | GetSaveFilename () |
Returns the filename of currently selected file. More... | |
bool | FindNextMaterial (MaterialSearchData_t *searchData) |
Searches for a material given the supplied search parameters. More... | |
HTREEITEM | FindNextMaterial (HTREEITEM item, MaterialSearchData_t *searchData) |
Searches for a material given the supplied search parameters. More... | |
HTREEITEM | GetNextSeachItem (HTREEITEM item, bool stayInFile) |
Returns the next item to search or NULL if there is nothing else to search. More... | |
void | DeleteFolder (HTREEITEM item, bool addUndo=true) |
Deletes a given folder. More... | |
HTREEITEM | AddFolder (const char *name, HTREEITEM parent) |
Adds a new material folder. More... | |
void | RenameFolder (HTREEITEM item, const char *name) |
Renames a material folder. More... | |
Public Member Functions inherited from MaterialView | |
MaterialView (void) | |
Constructor. More... | |
virtual | ~MaterialView (void) |
Destructor. More... | |
virtual void | SetMaterialDocManager (MaterialDocManager *docManager) |
Sets the material document manager for this view instance. More... | |
virtual void | MV_OnMaterialSelectionChange (MaterialDoc *pMaterial) |
Called when the selected material has changed. More... | |
virtual void | MV_OnMaterialSaveFile (const char *filename) |
Called when a material file has been saved. More... | |
virtual void | MV_OnMaterialStageAdd (MaterialDoc *pMaterial, int stageNum) |
Called when a stage is added. More... | |
virtual void | MV_OnMaterialStageDelete (MaterialDoc *pMaterial, int stageNum) |
Called when a stage is deleted. More... | |
virtual void | MV_OnMaterialStageMove (MaterialDoc *pMaterial, int from, int to) |
Called when a stage is moved. More... | |
virtual void | MV_OnMaterialAttributeChanged (MaterialDoc *pMaterial, int stage, const char *attribName) |
Called when an attribute is changed. More... | |
Protected Types | |
enum | { TYPE_ROOT = 0, TYPE_FOLDER, TYPE_FILE, TYPE_MATERIAL_FOLDER, TYPE_MATERIAL } |
List of tree item types. More... | |
Protected Member Functions | |
MaterialTreeView () | |
Constructor for MaterialTreeView. More... | |
virtual BOOL | PreTranslateMessage (MSG *pMsg) |
Handles the keyboard shortcut for delete. More... | |
afx_msg int | OnCreate (LPCREATESTRUCT lpCreateStruct) |
Called by the MFC framework as the view is being created. More... | |
afx_msg void | OnTvnSelchanged (NMHDR *pNMHDR, LRESULT *pResult) |
Changes the selected material when the select tree item changes. More... | |
afx_msg void | OnTvnBeginlabeledit (NMHDR *pNMHDR, LRESULT *pResult) |
Determines if a tree item's label can be edited. More... | |
afx_msg void | OnTvnEndlabeledit (NMHDR *pNMHDR, LRESULT *pResult) |
Makes sure that a rename operation can be performed after a label edit is complete and performs the folder or material rename. More... | |
afx_msg void | OnContextMenu (CWnd *pWnd, CPoint point) |
Displays the popup menu. More... | |
afx_msg void | OnNMRclick (NMHDR *pNMHDR, LRESULT *pResult) |
Displays the popup menu. More... | |
afx_msg void | OnChar (UINT nChar, UINT nRepCnt, UINT nFlags) |
Handles keyboard shortcut for cut, copy and paste. More... | |
afx_msg void | OnTvnBegindrag (NMHDR *pNMHDR, LRESULT *pResult) |
Begins the process of a drag cut/copy. More... | |
afx_msg void | OnMouseMove (UINT nFlags, CPoint point) |
Handles mouse movement as an item is being dragged. More... | |
afx_msg void | OnLButtonUp (UINT nFlags, CPoint point) |
Handles the end of a drag copy/move when the user releases the left mouse button. More... | |
afx_msg void | OnApplyMaterial () |
Applies the current material. More... | |
afx_msg void | OnApplyFile () |
Applies all materials in the currently selected file. More... | |
afx_msg void | OnApplyAll () |
Applies all materials that need to be applied. More... | |
afx_msg void | OnSaveMaterial () |
Saves the selected material. More... | |
afx_msg void | OnSaveFile () |
Saves all materials in the selected file. More... | |
afx_msg void | OnSaveAll () |
Save all materials that have been changed. More... | |
afx_msg void | OnRenameMaterial () |
Begins a label edit to rename a material or material folder. More... | |
afx_msg void | OnAddMaterial () |
Adds a new material. More... | |
afx_msg void | OnAddFolder () |
Adds a new folder. More... | |
afx_msg void | OnDeleteMaterial () |
Deletes a material or material folder. More... | |
afx_msg void | OnReloadFile () |
Reloads the selected file. More... | |
afx_msg void | OnCut () |
Performs a cut operation. More... | |
afx_msg void | OnCopy () |
Performs a copy operation. More... | |
afx_msg void | OnPaste () |
Performs a paste operation. More... | |
afx_msg LRESULT | OnRenameFolderComplete (WPARAM wParam, LPARAM lParam) |
This message is sent after the label edit is complete to actually perform the rename operation. More... | |
afx_msg LRESULT | OnRenameMaterialComplete (WPARAM wParam, LPARAM lParam) |
This message is sent after the label edit is complete to ensure that the sorting stays consistent. More... | |
void | RenameMaterial (HTREEITEM item, const char *originalName) |
Handles all of the little problems associated with renaming a folder. More... | |
bool | GetFileName (HTREEITEM item, idStr &out) |
Returns the filename of the provided item. More... | |
idStr | GetMediaPath (HTREEITEM item, DWORD type) |
Returns the Doom III name for the provided item. More... | |
void | GetMaterialPaths (HTREEITEM item, idList< MaterialTreeItem_t > *list) |
Creates a list of material paths for all materials under the provided item. More... | |
void | AddStrList (const char *root, idStrList *list, bool includeFile) |
Adds a string list of materials to the tree creating the proper hierarchy. More... | |
void | PopupMenu (CPoint *pt) |
Displays the popup menu with all of the appropriate menu items enabled. More... | |
void | SetItemImage (HTREEITEM item, bool mod, bool apply, bool children) |
Sets the appropriate item image based on the state of the item. More... | |
void | CleanLookupTrees (HTREEITEM item) |
Cleans the lookup tables for the provided item and all children. More... | |
void | BuildLookupTrees (HTREEITEM item) |
Build the lookup tree for a given item and all of its children. More... | |
idStr | GetQuicktreePath (HTREEITEM item) |
Returns the quicktree path for a given item. More... | |
Protected Attributes | |
CImageList | m_image |
bool | treeWithFile |
idHashTable< HTREEITEM > | quickTree |
idHashTable< HTREEITEM > | materialToTree |
idHashTable< HTREEITEM > | fileToTree |
HTREEITEM | renamedFolder |
idList< MaterialTreeItem_t > | affectedMaterials |
CImageList * | dragImage |
bool | bDragging |
CPoint | dropPoint |
HTREEITEM | dragItem |
HTREEITEM | hoverItem |
DWORD | hoverStartTime |
bool | internalChange |
Protected Attributes inherited from MaterialView | |
MaterialDocManager * | materialDocManager |
A tree view of all the materials that have been defined.
Definition at line 46 of file MaterialTreeView.h.
|
protected |
List of tree item types.
Enumerator | |
---|---|
TYPE_ROOT | |
TYPE_FOLDER | |
TYPE_FILE | |
TYPE_MATERIAL_FOLDER | |
TYPE_MATERIAL |
Definition at line 87 of file MaterialTreeView.h.
|
virtual |
Destructor for MaterialTreeView.
Definition at line 93 of file MaterialTreeView.cpp.
|
protected |
Constructor for MaterialTreeView.
Definition at line 83 of file MaterialTreeView.cpp.
HTREEITEM MaterialTreeView::AddFolder | ( | const char * | name, |
HTREEITEM | parent | ||
) |
Adds a new material folder.
name | The name of the folder. |
parent | The parent item of the folder. |
Definition at line 639 of file MaterialTreeView.cpp.
|
protected |
Adds a string list of materials to the tree creating the proper hierarchy.
root | The name of the root item or NULL for no root item. |
list | The list of materials. |
includeFile | If true the materials will be sorted by file. |
Definition at line 1529 of file MaterialTreeView.cpp.
|
protected |
Build the lookup tree for a given item and all of its children.
item | The item to start from |
Definition at line 1881 of file MaterialTreeView.cpp.
Builds the tree of materials.
includeFile | Should the list include the filename |
filename | The file to load or NULL to load all files. |
Definition at line 120 of file MaterialTreeView.cpp.
bool MaterialTreeView::CanCopy | ( | ) |
Returns true if the user can copy the selected item.
Definition at line 371 of file MaterialTreeView.cpp.
bool MaterialTreeView::CanCut | ( | ) |
Returns true if the user can cut the selected item.
Definition at line 395 of file MaterialTreeView.cpp.
bool MaterialTreeView::CanDelete | ( | ) |
Returns true if the user can delete the selected item.
Definition at line 412 of file MaterialTreeView.cpp.
bool MaterialTreeView::CanPaste | ( | ) |
Returns true if the user can paste an item in the copy buffer.
Definition at line 388 of file MaterialTreeView.cpp.
bool MaterialTreeView::CanRename | ( | ) |
Returns true if the user can rename the selected item.
Definition at line 429 of file MaterialTreeView.cpp.
bool MaterialTreeView::CanSaveFile | ( | ) |
Returns true if the currently selected file needs to be saved.
Definition at line 445 of file MaterialTreeView.cpp.
|
protected |
Cleans the lookup tables for the provided item and all children.
item | The item to start from |
Definition at line 1850 of file MaterialTreeView.cpp.
Deletes a given folder.
item | The folder to delete. |
addUndo | True if this operation can be undone. |
Definition at line 597 of file MaterialTreeView.cpp.
bool MaterialTreeView::FindNextMaterial | ( | MaterialSearchData_t * | searchData | ) |
Searches for a material given the supplied search parameters.
searchData | The parameters to use for the search. |
Definition at line 483 of file MaterialTreeView.cpp.
HTREEITEM MaterialTreeView::FindNextMaterial | ( | HTREEITEM | item, |
MaterialSearchData_t * | searchData | ||
) |
Searches for a material given the supplied search parameters.
Returns the tree item where the item was found or NULL if no material was found.
item | The tree item from where to start the search. |
searchData | The parameters to use for the search. |
Definition at line 520 of file MaterialTreeView.cpp.
Returns the filename of the provided item.
item | The item for which to generate the filename |
out | The location the filename will be placed. |
Definition at line 1422 of file MaterialTreeView.cpp.
|
protected |
Creates a list of material paths for all materials under the provided item.
item | The base item for which to generate the list |
list | The list in which the paths will be stored. |
Definition at line 1501 of file MaterialTreeView.cpp.
Returns the Doom III name for the provided item.
item | The item for which to generate the name |
type | The type of the selected item |
Definition at line 1455 of file MaterialTreeView.cpp.
HTREEITEM MaterialTreeView::GetNextSeachItem | ( | HTREEITEM | item, |
bool | stayInFile | ||
) |
Returns the next item to search or NULL if there is nothing else to search.
item | The last item searched. |
stayInFile | True if the search should stay in the current file. |
Definition at line 559 of file MaterialTreeView.cpp.
|
protected |
Returns the quicktree path for a given item.
item | The item for which to generate the quicktree path |
Definition at line 1905 of file MaterialTreeView.cpp.
idStr MaterialTreeView::GetSaveFilename | ( | ) |
Returns the filename of currently selected file.
Definition at line 464 of file MaterialTreeView.cpp.
void MaterialTreeView::InitializeMaterialList | ( | bool | includeFile = true , |
const char * | filename = NULL |
||
) |
Clears the tree and rebuilds it.
includeFile | Should the list include the filename |
filename | The file to load or NULL to load all files. |
Definition at line 101 of file MaterialTreeView.cpp.
Called when a file has been reloaded.
filename | The file that was reloaded. |
Reimplemented from MaterialView.
Definition at line 345 of file MaterialTreeView.cpp.
|
virtual |
Called when a material is added.
pMaterial | The material that was added. |
Reimplemented from MaterialView.
Definition at line 244 of file MaterialTreeView.cpp.
|
virtual |
Called when the material changes have been applied.
pMaterial | The selected material. |
Reimplemented from MaterialView.
Definition at line 196 of file MaterialTreeView.cpp.
|
virtual |
Called when the material has changed but not applied.
pMaterial | The selected material. |
Reimplemented from MaterialView.
Definition at line 164 of file MaterialTreeView.cpp.
|
virtual |
Called when a material is deleted.
pMaterial | The material that was deleted. |
Reimplemented from MaterialView.
Definition at line 278 of file MaterialTreeView.cpp.
|
virtual |
Called when the material name has changed.
pMaterial | The material that was deleted. |
oldName | The old name of the material. |
Reimplemented from MaterialView.
Definition at line 296 of file MaterialTreeView.cpp.
|
virtual |
Called when the material changes have been saved.
pMaterial | The saved material. |
Reimplemented from MaterialView.
Definition at line 213 of file MaterialTreeView.cpp.
|
protected |
Adds a new folder.
Definition at line 1180 of file MaterialTreeView.cpp.
|
protected |
Adds a new material.
Definition at line 1119 of file MaterialTreeView.cpp.
|
protected |
Applies all materials that need to be applied.
Definition at line 1076 of file MaterialTreeView.cpp.
|
protected |
Applies all materials in the currently selected file.
Definition at line 1065 of file MaterialTreeView.cpp.
|
protected |
Applies the current material.
Definition at line 1058 of file MaterialTreeView.cpp.
Handles keyboard shortcut for cut, copy and paste.
Definition at line 881 of file MaterialTreeView.cpp.
|
protected |
Displays the popup menu.
Definition at line 842 of file MaterialTreeView.cpp.
|
protected |
Performs a copy operation.
Definition at line 1288 of file MaterialTreeView.cpp.
|
protected |
Called by the MFC framework as the view is being created.
Definition at line 700 of file MaterialTreeView.cpp.
|
protected |
Performs a cut operation.
Definition at line 1273 of file MaterialTreeView.cpp.
|
protected |
Deletes a material or material folder.
Definition at line 1226 of file MaterialTreeView.cpp.
Handles the end of a drag copy/move when the user releases the left mouse button.
Definition at line 992 of file MaterialTreeView.cpp.
Handles mouse movement as an item is being dragged.
Definition at line 943 of file MaterialTreeView.cpp.
|
protected |
Displays the popup menu.
Definition at line 851 of file MaterialTreeView.cpp.
|
protected |
Performs a paste operation.
Definition at line 1304 of file MaterialTreeView.cpp.
|
protected |
Reloads the selected file.
Definition at line 1249 of file MaterialTreeView.cpp.
|
protected |
This message is sent after the label edit is complete to actually perform the rename operation.
Definition at line 1346 of file MaterialTreeView.cpp.
|
protected |
Begins a label edit to rename a material or material folder.
Definition at line 1108 of file MaterialTreeView.cpp.
|
protected |
This message is sent after the label edit is complete to ensure that the sorting stays consistent.
Definition at line 1367 of file MaterialTreeView.cpp.
|
protected |
Save all materials that have been changed.
Definition at line 1101 of file MaterialTreeView.cpp.
|
protected |
Saves all materials in the selected file.
Definition at line 1090 of file MaterialTreeView.cpp.
|
protected |
Saves the selected material.
Definition at line 1083 of file MaterialTreeView.cpp.
|
protected |
Begins the process of a drag cut/copy.
Definition at line 901 of file MaterialTreeView.cpp.
|
protected |
Determines if a tree item's label can be edited.
Definition at line 746 of file MaterialTreeView.cpp.
|
protected |
Makes sure that a rename operation can be performed after a label edit is complete and performs the folder or material rename.
Definition at line 765 of file MaterialTreeView.cpp.
|
protected |
Changes the selected material when the select tree item changes.
Definition at line 716 of file MaterialTreeView.cpp.
|
protected |
Displays the popup menu with all of the appropriate menu items enabled.
pt | The location where the menu should be displayed. |
Definition at line 1690 of file MaterialTreeView.cpp.
|
protectedvirtual |
Handles the keyboard shortcut for delete.
Definition at line 684 of file MaterialTreeView.cpp.
Renames a material folder.
item | The folder tree item. |
name | The new name of the material folder. |
Definition at line 663 of file MaterialTreeView.cpp.
Handles all of the little problems associated with renaming a folder.
Definition at line 1380 of file MaterialTreeView.cpp.
|
protected |
Sets the appropriate item image based on the state of the item.
item | The item to set. |
mod | Is the item modified |
apply | Does the item need an apply |
children | Should this method recurse through the items children and set their icons. |
Definition at line 1806 of file MaterialTreeView.cpp.
|
protected |
Definition at line 161 of file MaterialTreeView.h.
|
protected |
Definition at line 164 of file MaterialTreeView.h.
|
protected |
Definition at line 163 of file MaterialTreeView.h.
|
protected |
Definition at line 166 of file MaterialTreeView.h.
|
protected |
Definition at line 165 of file MaterialTreeView.h.
|
protected |
Definition at line 156 of file MaterialTreeView.h.
|
protected |
Definition at line 169 of file MaterialTreeView.h.
|
protected |
Definition at line 170 of file MaterialTreeView.h.
|
protected |
Definition at line 172 of file MaterialTreeView.h.
|
protected |
Definition at line 150 of file MaterialTreeView.h.
|
protected |
Definition at line 155 of file MaterialTreeView.h.
|
protected |
Definition at line 154 of file MaterialTreeView.h.
|
protected |
Definition at line 160 of file MaterialTreeView.h.
|
protected |
Definition at line 151 of file MaterialTreeView.h.