1 2 #ifndef _RESOURCE_TREE_ 3 #define _RESOURCE_TREE_ 4 5 #include <afxcview.h> 6 7 class resource_view; // forward reference 8 9 class resource_tree 10 { 11 public: 12 resource_tree(resource_view *parent); 13 ~resource_tree(); 14 resource_item *InsertItem(resource_item *parent, res_info *info); 15 resource_item *InsertItem(resource_item *parent, CString &name, CString &val); 16 17 void DeleteAllItems(); 18 void DeleteItem(resource_item *item, BOOL reposition = TRUE); 19 int GetHeight(resource_item *item = NULL); GetWidth()20 int GetWidth() { return m_width;} 21 int GetViewWidth(); 22 INT GetMaxWidth(resource_item *start, CDC *dc); 23 int PositionItems(resource_item *start, int top, int indent, CDC *dc); 24 int PositionItems(); 25 26 void Paint(CDC *dc); 27 28 BOOL DoesFolderExist(CString &find_name, int resource_id); 29 void CreateUniqueFolderName(CString &seed, int resource_id); 30 31 resource_item *FindItem(resource_item *start, CPoint cp); 32 resource_item *FindItem(resource_item *start, int res_type, CString &res_name); 33 resource_item *FindFolder(resource_item *start, int folder_type, int folder_id); 34 resource_item *FindFolderNamed(resource_item *start, int folder_type, int folder_id, CString &folder_name); 35 resource_item *GetCurrentItem(); 36 void SetCurrentItem(resource_item* item); 37 38 //resource_item *GetSelectedItem() {return mpCurrentItem;} GetRoot()39 resource_item *GetRoot() { return mpRoot;} GetParent()40 resource_view* GetParent() { return mParentView; } 41 42 private: 43 void PopupMenu(int MenuId, CPoint &pos); 44 45 resource_view *mParentView; 46 resource_item *mpRoot; 47 res_info m_res_info; 48 int m_height; 49 int m_width; 50 int m_parent_right; 51 }; 52 53 #endif 54 55