|  |  | 
 |  |  | #include "wobject/xcontrol.hpp" | 
 |  |  | #include "win32/win.hpp" | 
 |  |  |  | 
 |  |  | typedef struct _TREEITEM{} *HTREEITEM; | 
 |  |  |  | 
 |  |  | #define TVI_ROOT                ((HTREEITEM)(ULONG_PTR)-0x10000) | 
 |  |  | #define TVI_FIRST               ((HTREEITEM)(ULONG_PTR)-0x0FFFF) | 
 |  |  | #define TVI_LAST                ((HTREEITEM)(ULONG_PTR)-0x0FFFE) | 
 |  |  | #define TVI_SORT                ((HTREEITEM)(ULONG_PTR)-0x0FFFD) | 
 |  |  |  | 
 |  |  | #define TVIF_TEXT               0x0001 | 
 |  |  | #define TVIF_IMAGE              0x0002 | 
 |  |  | #define TVIF_PARAM              0x0004 | 
 |  |  | #define TVIF_STATE              0x0008 | 
 |  |  | #define TVIF_HANDLE             0x0010 | 
 |  |  | #define TVIF_SELECTEDIMAGE      0x0020 | 
 |  |  | #define TVIF_CHILDREN           0x0040 | 
 |  |  | #define TVIF_INTEGRAL           0x0080 | 
 |  |  |  | 
 |  |  | #define TVIF_STATEEX            0x0100 | 
 |  |  | #define TVIF_EXPANDEDIMAGE      0x0200 | 
 |  |  |  | 
 |  |  | #define TVIS_SELECTED           0x0002 | 
 |  |  | #define TVIS_CUT                0x0004 | 
 |  |  | #define TVIS_DROPHILITED        0x0008 | 
 |  |  | #define TVIS_BOLD               0x0010 | 
 |  |  | #define TVIS_EXPANDED           0x0020 | 
 |  |  | #define TVIS_EXPANDEDONCE       0x0040 | 
 |  |  | #define TVIS_EXPANDPARTIAL      0x0080 | 
 |  |  |  | 
 |  |  | #define TVIS_OVERLAYMASK        0x0F00 | 
 |  |  | #define TVIS_STATEIMAGEMASK     0xF000 | 
 |  |  | #define TVIS_USERMASK           0xF000 | 
 |  |  |  | 
 |  |  | #define TVGN_ROOT               0x0000 | 
 |  |  | #define TVGN_NEXT               0x0001 | 
 |  |  | #define TVGN_PREVIOUS           0x0002 | 
 |  |  | #define TVGN_PARENT             0x0003 | 
 |  |  | #define TVGN_CHILD              0x0004 | 
 |  |  | #define TVGN_FIRSTVISIBLE       0x0005 | 
 |  |  | #define TVGN_NEXTVISIBLE        0x0006 | 
 |  |  | #define TVGN_PREVIOUSVISIBLE    0x0007 | 
 |  |  | #define TVGN_DROPHILITE         0x0008 | 
 |  |  | #define TVGN_CARET              0x0009 | 
 |  |  | #define TVGN_LASTVISIBLE        0x000A | 
 |  |  | #define TVGN_NEXTSELECTED       0x000B | 
 |  |  |  | 
 |  |  |  #define TV_FIRST 0x1100  | 
 |  |  |  | 
 |  |  | struct SCROLLINFO  | 
 |  |  | { | 
 |  |  |     int cbSize; | 
 |  |  |     int fMask; | 
 |  |  |     int  nMin; | 
 |  |  |     int  nMax; | 
 |  |  |     int nPage; | 
 |  |  |     int  nPos; | 
 |  |  |     int  nTrackPos; | 
 |  |  | }; | 
 |  |  |  | 
 |  |  | struct tvitem  | 
 |  |  | { | 
 |  |  |     int mask; | 
 |  |  |     HTREEITEM hItem; | 
 |  |  |     int state; | 
 |  |  |     int stateMask; | 
 |  |  |     string pszText; | 
 |  |  |     int cchTextMax; | 
 |  |  |     int iImage; | 
 |  |  |     int iSelectedImage; | 
 |  |  |     int cChildren; | 
 |  |  |     LPARAM lParam; | 
 |  |  | }; | 
 |  |  |  | 
 |  |  | struct tvinsertstruct  | 
 |  |  | { | 
 |  |  |     HTREEITEM hParent; | 
 |  |  |     HTREEITEM hInsertAfter; | 
 |  |  |     tvitem  item; | 
 |  |  | }; | 
 |  |  |      | 
 |  |  |  | 
 |  |  | struct NMTREEVIEW : public NMHDR | 
 |  |  | { | 
 |  |  |     int action; | 
 |  |  |     tvitem itemOld; | 
 |  |  |     tvitem itemNew; | 
 |  |  |     xpoint ptDrag; | 
 |  |  | }; | 
 |  |  |  | 
 |  |  |  | 
 |  |  | struct TVNNMHDR : public NMHDR | 
 |  |  | { | 
 |  |  |     HTREEITEM FromItem; | 
 |  |  |     HTREEITEM ToItem; | 
 |  |  |     xpoint pt; | 
 |  |  |     string PopupMenu; | 
 |  |  | };	 | 
 |  |  |  | 
 |  |  | struct NMTVDISPINFO : public NMHDR | 
 |  |  | { | 
 |  |  |     tvitem    item; | 
 |  |  | };	 | 
 |  |  |  | 
 |  |  | struct TVHITTESTINFO { | 
 |  |  |     xpoint     pt; | 
 |  |  |     int      flags; | 
 |  |  |     HTREEITEM hItem; | 
 |  |  | }; | 
 |  |  |  | 
 |  |  | class xcheckbox:  public xcontrol | 
 |  |  | { | 
 |  |  | public: | 
 |  |  |     xcheckbox() :xcontrol(nullptr) {} | 
 |  |  |     xcheckbox(void* implptr) :xcontrol(implptr) {} | 
 |  |  |  | 
 |  |  |     static int SetCheck(int wid) | 
 |  |  |     static int SetCheck(HWND wid) | 
 |  |  |     { | 
 |  |  |         int BM_SETCHECK = 0x00F1; | 
 |  |  |         int BST_CHECKED = 0x1; | 
 |  |  |         SendMessage(wid, BM_SETCHECK, BST_CHECKED, 0); | 
 |  |  |         return 1; | 
 |  |  |     } | 
 |  |  |     static int SetUnCheck(int wid) | 
 |  |  |     static int SetUnCheck(HWND wid) | 
 |  |  |     { | 
 |  |  |         int BM_SETCHECK = 0x00F1; | 
 |  |  |         int BST_UNCHECKED = 0x0; | 
 |  |  |         win32::SendMessage(wid, BM_SETCHECK, BST_UNCHECKED, 0); | 
 |  |  |         SendMessage(wid, BM_SETCHECK, BST_UNCHECKED, 0); | 
 |  |  |         return 1; | 
 |  |  |     } | 
 |  |  |     static int SetText(int wid, string txt) | 
 |  |  |     static int SetText(HWND wid, string txt) | 
 |  |  |     { | 
 |  |  |         int WM_SETTEXT = 0x000C; | 
 |  |  |         win32::SendMessage(wid, WM_SETTEXT, 0, txt); | 
 |  |  |         SendMessage(wid, WM_SETTEXT, 0, (LPARAM)txt); | 
 |  |  |         return 1; | 
 |  |  |     } | 
 |  |  |     static int GetCheck(int wid) | 
 |  |  |     static int GetCheck(HWND wid) | 
 |  |  |     { | 
 |  |  |         int BM_GETCHECK = 0x00F0; | 
 |  |  |         int BM_GETSTATE = 0x00F2; | 
 |  |  |         int r = win32::SendMessage(wid, BM_GETSTATE, 0, 0); | 
 |  |  |         int r = SendMessage(wid, BM_GETSTATE, 0, 0); | 
 |  |  |         if (r == 8 || r == 0 || r == 520) return -1; | 
 |  |  |         else return 1; | 
 |  |  |     } | 
 |  |  | 
 |  |  |         return 1; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     int SetText(, string txt) | 
 |  |  |     int SetText(string txt) | 
 |  |  |     { | 
 |  |  |         int WM_SETTEXT = 0x000C; | 
 |  |  |         SendMessage(GetHWND(), WM_SETTEXT, 0, txt); | 
 |  |  |         SendMessage(GetHWND(), WM_SETTEXT, 0, (LPARAM)txt); | 
 |  |  |         return 1; | 
 |  |  |     } | 
 |  |  |     int GetCheck() |