aswang
1.0
|
00001 /* 00002 Copyright 2003 Joseph Alvis 00003 00004 This file is part of Aswang. 00005 00006 Aswang is free software: you can redistribute it and/or modify 00007 it under the terms of the GNU Lesser General Public License as published by 00008 the Free Software Foundation, either version 3 of the License, or 00009 (at your option) any later version. 00010 00011 Aswang is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU Lesser General Public License for more details. 00015 00016 You should have received a copy of the GNU Lesser General Public License 00017 along with Aswang. If not, see <http://www.gnu.org/licenses/>. 00018 */ 00019 00020 #pragma once 00021 #include "window.h" 00022 00023 namespace aswang { 00024 class TreeView : public window { 00025 public: 00026 enum TreeStyles { 00027 hasButtons = TVS_HASBUTTONS, 00028 hasLines = TVS_HASLINES, 00029 hasLinesAtRoot = TVS_LINESATROOT, 00030 editLabels = TVS_EDITLABELS, 00031 disableDragDrop = TVS_DISABLEDRAGDROP, 00032 showSelAlways = TVS_SHOWSELALWAYS, 00033 #if (_WIN32_IE >= 0x0300) 00034 rtlReading = TVS_RTLREADING, 00035 noToolTips = TVS_NOTOOLTIPS, 00036 checkBoxes = TVS_CHECKBOXES, 00037 trackSelect = TVS_TRACKSELECT, 00038 #if (_WIN32_IE >= 0x0400) 00039 singleExpand = TVS_SINGLEEXPAND, 00040 infoTip = TVS_INFOTIP, 00041 fullRowSelect = TVS_FULLROWSELECT, 00042 noScroll = TVS_NOSCROLL, 00043 nonEvenHeight = TVS_NONEVENHEIGHT, 00044 #if (_WIN32_IE >= 0x500) 00045 noHScroll = TVS_NOHSCROLL, 00046 #endif 00047 #endif 00048 #endif 00049 }; 00050 public: 00051 TreeView(HWND h,window *p=NULL) : window(h,p) {} 00052 TreeView(window *p,unsigned long newStyle=(WS_CHILD|hasButtons|hasLines|hasLinesAtRoot)) : window(p,newStyle) {} 00053 virtual ~TreeView() {} 00054 00055 virtual const _TCHAR *GetClassName() const {return WC_TREEVIEW;} 00056 00057 virtual HTREEITEM AddTextItem(const AswangStr &text,HTREEITEM treeParent=TVI_ROOT,HTREEITEM insertAfter=TVI_ROOT); 00058 virtual AswangStr GetItemText(HTREEITEM item); 00059 virtual void DeleteItem(HTREEITEM item); 00060 virtual void DeleteAllItems() {DeleteItem(TVI_ROOT);} 00061 }; 00062 }