mirror of
https://github.com/reactos/wine.git
synced 2024-11-25 20:59:54 +00:00
- The usual bugfixes.
- Better unicode support (only defines, currently) - Drag & drop implemented. - LPSTR_TEXTCALLBACK should work now. - First start at custom draw code.
This commit is contained in:
parent
84ee125fd9
commit
d2d7f96938
File diff suppressed because it is too large
Load Diff
@ -64,7 +64,7 @@ static int GetIcon(LPITEMIDLIST lpi, UINT32 uFlags)
|
||||
return sfi.iIcon;
|
||||
}
|
||||
|
||||
static void GetNormalAndSelectedIcons(LPITEMIDLIST lpifq,LPTV_ITEM lpTV_ITEM)
|
||||
static void GetNormalAndSelectedIcons(LPITEMIDLIST lpifq,LPTVITEM32A lpTV_ITEM)
|
||||
{ TRACE (shell,"%p %p\n",lpifq, lpTV_ITEM);
|
||||
|
||||
lpTV_ITEM->iImage = GetIcon(lpifq, SHGFI_PIDL | SHGFI_SYSICONINDEX | SHGFI_SMALLICON);
|
||||
@ -98,8 +98,8 @@ static BOOL32 GetName(LPSHELLFOLDER lpsf, LPITEMIDLIST lpi, DWORD dwFlags, LPSTR
|
||||
|
||||
static void FillTreeView(LPSHELLFOLDER lpsf, LPITEMIDLIST pidl, HTREEITEM hParent)
|
||||
{
|
||||
TV_ITEM tvi;
|
||||
TV_INSERTSTRUCT tvins;
|
||||
TVITEM32A tvi;
|
||||
TVINSERTSTRUCT32A tvins;
|
||||
HTREEITEM hPrev = 0;
|
||||
LPENUMIDLIST lpe=0;
|
||||
LPITEMIDLIST pidlTemp=0;
|
||||
@ -145,7 +145,7 @@ static void FillTreeView(LPSHELLFOLDER lpsf, LPITEMIDLIST pidl, HTREEITEM hPare
|
||||
lptvid->lpifq = ILCombine(pidl, pidlTemp);
|
||||
GetNormalAndSelectedIcons(lptvid->lpifq, &tvi);
|
||||
|
||||
tvins.item = tvi;
|
||||
tvins.DUMMYUNIONNAME.item = tvi;
|
||||
tvins.hInsertAfter = hPrev;
|
||||
tvins.hParent = hParent;
|
||||
|
||||
@ -168,7 +168,7 @@ Done:
|
||||
|
||||
static LRESULT MsgNotify(HWND32 hWnd, UINT32 CtlID, LPNMHDR lpnmh)
|
||||
{
|
||||
NM_TREEVIEW *pnmtv = (NM_TREEVIEW *)lpnmh;
|
||||
NMTREEVIEW32A *pnmtv = (NMTREEVIEW32A *)lpnmh;
|
||||
LPTV_ITEMDATA lptvid; //Long pointer to TreeView item data
|
||||
LPSHELLFOLDER lpsf2=0;
|
||||
|
||||
|
@ -184,7 +184,13 @@ typedef struct tagNMTTCUSTOMDRAW
|
||||
|
||||
#define STATUSCLASSNAME16 "msctls_statusbar"
|
||||
#define STATUSCLASSNAME32A "msctls_statusbar32"
|
||||
#define STATUSCLASSNAME32W L"msctls_statusbar32"
|
||||
/* Does not work. gcc creates 4 byte wide strings.
|
||||
* #define STATUSCLASSNAME32W L"msctls_statusbar32"
|
||||
*/
|
||||
static const WCHAR _scn32w[] = {
|
||||
'm','s','c','t','l','s','_','s','t','a','t','u','s','b','a','r','3','2',0
|
||||
};
|
||||
#define STATUSCLASSNAME32W _scn32w
|
||||
#define STATUSCLASSNAME WINELIB_NAME_AW(STATUSCLASSNAME)
|
||||
|
||||
#define SBT_NOBORDERS 0x0100
|
||||
@ -1755,7 +1761,7 @@ typedef struct {
|
||||
INT32 iSelectedImage;
|
||||
INT32 cChildren;
|
||||
LPARAM lParam;
|
||||
} TVITEMA, *LPTVITEMA;
|
||||
} TVITEM32A, *LPTVITEM32A;
|
||||
|
||||
typedef struct {
|
||||
UINT32 mask;
|
||||
@ -1763,15 +1769,15 @@ typedef struct {
|
||||
UINT32 state;
|
||||
UINT32 stateMask;
|
||||
LPWSTR pszText;
|
||||
int cchTextMax;
|
||||
int iImage;
|
||||
int iSelectedImage;
|
||||
int cChildren;
|
||||
INT32 cchTextMax;
|
||||
INT32 iImage;
|
||||
INT32 iSelectedImage;
|
||||
INT32 cChildren;
|
||||
LPARAM lParam;
|
||||
} TVITEMW, *LPTVITEMW;
|
||||
} TVITEM32W, *LPTVITEM32W;
|
||||
|
||||
#define LPTV_ITEM LPTVITEMA
|
||||
#define TV_ITEM TVITEMA
|
||||
#define TV_ITEM WINELIB_NAME(TV_ITEM)
|
||||
#define LPTV_ITEM WINELIB_NAME(LPTV_ITEM)
|
||||
|
||||
typedef struct {
|
||||
UINT32 mask;
|
||||
@ -1784,8 +1790,8 @@ typedef struct {
|
||||
INT32 iSelectedImage;
|
||||
INT32 cChildren;
|
||||
LPARAM lParam;
|
||||
int iIntegral;
|
||||
} TVITEMEXA, *LPTVITEMEXA;
|
||||
INT32 iIntegral;
|
||||
} TVITEMEX32A, *LPTVITEMEX32A;
|
||||
|
||||
typedef struct {
|
||||
UINT32 mask;
|
||||
@ -1793,63 +1799,78 @@ typedef struct {
|
||||
UINT32 state;
|
||||
UINT32 stateMask;
|
||||
LPWSTR pszText;
|
||||
int cchTextMax;
|
||||
int iImage;
|
||||
int iSelectedImage;
|
||||
int cChildren;
|
||||
INT32 cchTextMax;
|
||||
INT32 iImage;
|
||||
INT32 iSelectedImage;
|
||||
INT32 cChildren;
|
||||
LPARAM lParam;
|
||||
int iIntegral;
|
||||
} TVITEMEXW, *LPTV_ITEMEXW;
|
||||
INT32 iIntegral;
|
||||
} TVITEMEX32W, *LPTV_ITEMEX32W;
|
||||
|
||||
#define TV_ITEMEX TVITEMEXA
|
||||
#define LPTV_ITEMEXA LPTVITEMEXA
|
||||
#define TV_ITEMEX WINELIB_NAME(TV_ITEM)
|
||||
#define LPTV_ITEMEX WINELIB_NAME(LPTV_ITEM)
|
||||
|
||||
typedef struct tagTVINSERTSTRUCTA {
|
||||
|
||||
typedef struct tagTVINSERTSTRUCT32A {
|
||||
HTREEITEM hParent;
|
||||
HTREEITEM hInsertAfter;
|
||||
TVITEMA item;
|
||||
} TVINSERTSTRUCTA, *LPTVINSERTSTRUCTA;
|
||||
union {
|
||||
TVITEMEX32A itemex;
|
||||
TVITEM32A item;
|
||||
} DUMMYUNIONNAME;
|
||||
} TVINSERTSTRUCT32A, *LPTVINSERTSTRUCT32A;
|
||||
|
||||
typedef struct tagTVINSERTSTRUCTW {
|
||||
typedef struct tagTVINSERTSTRUCT32W {
|
||||
HTREEITEM hParent;
|
||||
HTREEITEM hInsertAfter;
|
||||
TVITEMW item;
|
||||
} TVINSERTSTRUCTW, *LPTVINSERTSTRUCTW;
|
||||
union {
|
||||
TVITEMEX32W itemex;
|
||||
TVITEM32W item;
|
||||
} DUMMYUNIONNAME;
|
||||
} TVINSERTSTRUCT32W, *LPTVINSERTSTRUCT32W;
|
||||
|
||||
#define TV_INSERTSTRUCT TVINSERTSTRUCTA
|
||||
#define LPTV_INSERTSTRUCT LPTVINSERTSTRUCTA
|
||||
#define TV_INSERTSTRUCT WINELIB_NAME(TVINSERTSTRUCT)
|
||||
#define LPTV_INSERTSTRUCT WINELIB_NAME(LPTVINSERTSTRUCT)
|
||||
|
||||
typedef struct tagNMTREEVIEWA {
|
||||
#define TVINSERTSTRUCT_V1_SIZE32A CCSIZEOF_STRUCT(TVINSERTSTRUCT32A, item)
|
||||
#define TVINSERTSTRUCT_V1_SIZE32W CCSIZEOF_STRUCT(TVINSERTSTRUCT32W, item)
|
||||
#define TVINSERTSTRUCT_V1_SIZE WINELIB_NAME_AW(TVINSERTSTRUCT_V1_SIZE)
|
||||
|
||||
|
||||
|
||||
|
||||
typedef struct tagNMTREEVIEW32A {
|
||||
NMHDR hdr;
|
||||
UINT32 action;
|
||||
TVITEMA itemOld;
|
||||
TVITEMA itemNew;
|
||||
TVITEM32A itemOld;
|
||||
TVITEM32A itemNew;
|
||||
POINT32 ptDrag;
|
||||
} NMTREEVIEWA, *LPNMTREEVIEWA;
|
||||
} NMTREEVIEW32A, *LPNMTREEVIEW32A;
|
||||
|
||||
typedef struct tagNMTREEVIEWW {
|
||||
typedef struct tagNMTREEVIEW32W {
|
||||
NMHDR hdr;
|
||||
UINT32 action;
|
||||
TVITEMW itemOld;
|
||||
TVITEMW itemNew;
|
||||
TVITEM32W itemOld;
|
||||
TVITEM32W itemNew;
|
||||
POINT32 ptDrag;
|
||||
} NMTREEVIEWW, *LPNMTREEVIEWW;
|
||||
} NMTREEVIEW32W, *LPNMTREEVIEW32W;
|
||||
|
||||
#define NM_TREEVIEW NMTREEVIEWA
|
||||
#define LPNM_TREEVIEW LPNMTREEVIEWA
|
||||
#define NMTREEVIEW WINELIB_NAME_AW(NMTREEVIEW)
|
||||
#define LPNMTREEVIEW WINELIB_NAME_AW(LPNMTREEVIEW)
|
||||
|
||||
typedef struct tagTVDISPINFOA {
|
||||
typedef struct tagTVDISPINFO32A {
|
||||
NMHDR hdr;
|
||||
TVITEMA item;
|
||||
} NMTVDISPINFOA, *LPNMTVDISPINFOA;
|
||||
TVITEM32A item;
|
||||
} NMTVDISPINFO32A, *LPNMTVDISPINFO32A;
|
||||
|
||||
typedef struct tagTVDISPINFOW {
|
||||
typedef struct tagTVDISPINFO32W {
|
||||
NMHDR hdr;
|
||||
TVITEMW item;
|
||||
} NMTVDISPINFOW, *LPNMTVDISPINFOW;
|
||||
TVITEM32W item;
|
||||
} NMTVDISPINFO32W, *LPNMTVDISPINFO32W;
|
||||
|
||||
#define NMTVDISPINFO NMTVDISPINFOA
|
||||
#define LPNMTVDISPINFO LPNMTVDISPINFOA
|
||||
#define NMTVDISPINFO WINELIB_NAME_AW(NMTVDISPINFO)
|
||||
#define LPNMTVDISPINFO WINELIB_NAME_AW(LPNMTVDISPINFO)
|
||||
#define TV_DISPINFO NMTVDISPINFO
|
||||
|
||||
typedef INT32 (CALLBACK *PFNTVCOMPARE)(LPARAM, LPARAM, LPARAM);
|
||||
|
||||
@ -1871,9 +1892,51 @@ typedef struct tagTVHITTESTINFO {
|
||||
|
||||
#define TV_HITTESTINFO TVHITTESTINFO
|
||||
|
||||
|
||||
/* Custom Draw Treeview */
|
||||
|
||||
#define NMTVCUSTOMDRAW_V3_SIZE CCSIZEOF_STRUCT(NMTVCUSTOMDRAW, clrTextBk)
|
||||
|
||||
#define TVCDRF_NOIMAGES 0x00010000
|
||||
|
||||
typedef struct tagNMTVCUSTOMDRAW
|
||||
{
|
||||
NMCUSTOMDRAW nmcd;
|
||||
COLORREF clrText;
|
||||
COLORREF clrTextBk;
|
||||
INT32 iLevel; /* IE>0x0400 */
|
||||
} NMTVCUSTOMDRAW, *LPNMTVCUSTOMDRAW;
|
||||
|
||||
/* Treeview tooltips */
|
||||
|
||||
typedef struct tagNMTVGETINFOTIP32A
|
||||
{
|
||||
NMHDR hdr;
|
||||
LPSTR pszText;
|
||||
INT32 cchTextMax;
|
||||
HTREEITEM hItem;
|
||||
LPARAM lParam;
|
||||
} NMTVGETINFOTIP32A, *LPNMTVGETINFOTIP32A;
|
||||
|
||||
typedef struct tagNMTVGETINFOTIP32W
|
||||
{
|
||||
NMHDR hdr;
|
||||
LPWSTR pszText;
|
||||
INT32 cchTextMax;
|
||||
HTREEITEM hItem;
|
||||
LPARAM lParam;
|
||||
} NMTVGETINFOTIP32W, *LPNMTVGETINFOTIP32W;
|
||||
|
||||
|
||||
#define NMTVGETINFOTIP WINELIB_NAME(NMTVGETINFOTIP)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#define TreeView_InsertItem32A(hwnd, phdi) \
|
||||
(INT32)SendMessage32A((hwnd), TVM_INSERTITEM32A, 0, \
|
||||
(LPARAM)(LPTVINSERTSTRUCTA)(phdi))
|
||||
(LPARAM)(LPTVINSERTSTRUCT32A)(phdi))
|
||||
#define TreeView_DeleteItem(hwnd, hItem) \
|
||||
(BOOL32)SendMessage32A((hwnd), TVM_DELETEITEM, 0, (LPARAM)(HTREEITEM)(hItem))
|
||||
#define TreeView_DeleteAllItems(hwnd) \
|
||||
@ -1945,10 +2008,10 @@ typedef struct tagTVHITTESTINFO {
|
||||
*/
|
||||
|
||||
#define TreeView_GetItem32A(hwnd, pitem) \
|
||||
(BOOL32)SendMessage32A((hwnd), TVM_GETITEM32A, 0, (LPARAM) (TVITEMA *)(pitem))
|
||||
(BOOL32)SendMessage32A((hwnd), TVM_GETITEM32A, 0, (LPARAM) (TVITEM32A *)(pitem))
|
||||
|
||||
#define TreeView_SetItem32A(hwnd, pitem) \
|
||||
(BOOL32)SendMessage32A((hwnd), TVM_SETITEM32A, 0, (LPARAM)(const TVITEMA *)(pitem))
|
||||
(BOOL32)SendMessage32A((hwnd), TVM_SETITEM32A, 0, (LPARAM)(const TVITEM32A *)(pitem))
|
||||
|
||||
#define TreeView_EditLabel(hwnd, hitem) \
|
||||
(HWND)SendMessage32A((hwnd), TVM_EDITLABEL, 0, (LPARAM)(HTREEITEM)(hitem))
|
||||
@ -2432,6 +2495,7 @@ typedef INT32 (CALLBACK *PFNLVCOMPARE)(LPARAM, LPARAM, LPARAM);
|
||||
#define TCS_BOTTOM 0x0002
|
||||
#define TCS_RIGHT 0x0002
|
||||
#define TCS_MULTISELECT 0x0004 /* allow multi-select in button mode */
|
||||
#define TCS_FLATBUTTONS 0x0008
|
||||
#define TCS_FORCEICONLEFT 0x0010
|
||||
#define TCS_FORCELABELLEFT 0x0020
|
||||
#define TCS_HOTTRACK 0x0040
|
||||
@ -2447,6 +2511,9 @@ typedef INT32 (CALLBACK *PFNLVCOMPARE)(LPARAM, LPARAM, LPARAM);
|
||||
#define TCS_OWNERDRAWFIXED 0x2000
|
||||
#define TCS_TOOLTIPS 0x4000
|
||||
#define TCS_FOCUSNEVER 0x8000
|
||||
#define TCS_EX_FLATSEPARATORS 0x00000001 /* to be used with */
|
||||
#define TCS_EX_REGISTERDROP 0x00000002 /* TCM_SETEXTENDEDSTYLE */
|
||||
|
||||
|
||||
#define TCM_FIRST 0x1300
|
||||
|
||||
@ -2493,6 +2560,17 @@ typedef INT32 (CALLBACK *PFNLVCOMPARE)(LPARAM, LPARAM, LPARAM);
|
||||
#define TCIF_PARAM 0x0008
|
||||
#define TCIF_STATE 0x0010
|
||||
|
||||
#define TCIS_BUTTONPRESSED 0x0001
|
||||
#define TCIS_HIGHLIGHTED 0x0002
|
||||
|
||||
|
||||
/* constants for TCHITTESTINFO */
|
||||
|
||||
#define TCHT_NOWHERE 0x01
|
||||
#define TCHT_ONITEMICON 0x02
|
||||
#define TCHT_ONITEMLABEL 0x04
|
||||
#define TCHT_ONITEM (TCHT_ONITEMICON | TCHT_ONITEMLABEL)
|
||||
|
||||
|
||||
typedef struct tagTCITEM32A {
|
||||
UINT32 mask;
|
||||
|
@ -9,15 +9,10 @@
|
||||
#define __WINE_TREEVIEW_H
|
||||
|
||||
#define MINIMUM_INDENT 10
|
||||
|
||||
|
||||
#define TVITEM_ALLOC 16
|
||||
#define TV_REFRESH_TIMER 1
|
||||
#define TV_EDIT_TIMER 2
|
||||
#define TV_REFRESH_TIMER_SET 1
|
||||
#define TV_EDIT_TIMER_SET 2
|
||||
#define TV_REFRESH_DELAY 100 /* 100 ms delay between two refreshes */
|
||||
#define TV_DEFAULTITEMHEIGHT 15
|
||||
#define TV_DEFAULTITEMHEIGHT 16
|
||||
#define TVITEM_ALLOC 16 /* default nr of items to allocate at first try */
|
||||
|
||||
|
||||
/* internal structures */
|
||||
|
||||
@ -33,7 +28,8 @@ typedef struct {
|
||||
int cChildren;
|
||||
LPARAM lParam;
|
||||
int iIntegral;
|
||||
int clrText;
|
||||
int iLevel; /* indentation level:0=root level */
|
||||
COLORREF clrText;
|
||||
|
||||
int parent; /* handle to parent or 0 if at root*/
|
||||
int firstChild; /* handle to first child or 0 if no child*/
|
||||
@ -45,31 +41,40 @@ typedef struct {
|
||||
} TREEVIEW_ITEM;
|
||||
|
||||
|
||||
#define TV_HSCROLL 0x01 /* treeview too large to fit in window */
|
||||
#define TV_VSCROLL 0x02 /* (horizontal/vertical) */
|
||||
|
||||
typedef struct tagTREEVIEW_INFO
|
||||
{
|
||||
UINT32 uInternalStatus;
|
||||
UINT32 bAutoSize; /* merge with uInternalStatus */
|
||||
INT32 Timer;
|
||||
UINT32 uNumItems; /* number of valid TREEVIEW_ITEMs */
|
||||
UINT32 uNumPtrsAlloced;
|
||||
UINT32 uMaxHandle; /* needed for delete_item */
|
||||
HTREEITEM TopRootItem; /* handle to first item in treeview */
|
||||
INT32 cdmode; /* last custom draw setting */
|
||||
|
||||
UINT32 uItemHeight; /* item height, -1 for default item height */
|
||||
UINT32 uRealItemHeight; /* real item height in pixels */
|
||||
UINT32 uRealItemHeight; /* current item height in pixels */
|
||||
UINT32 uVisibleHeight; /* visible height of treeview in pixels */
|
||||
UINT32 uTotalHeight; /* total height of treeview in pixels */
|
||||
UINT32 uIndent; /* indentation in pixels */
|
||||
UINT32 uVisibleWidth;
|
||||
UINT32 uTotalWidth;
|
||||
UINT32 uIndent; /* indentation in pixels */
|
||||
HTREEITEM selectedItem; /* handle to selected item or 0 if none */
|
||||
HTREEITEM focusItem; /* handle to item that has focus, 0 if none */
|
||||
HTREEITEM hotItem; /* handle currently under cursor, 0 if none */
|
||||
HTREEITEM editItem; /* handle to item currently editted, 0 if none */
|
||||
HTREEITEM firstVisible; /* handle to first visible item */
|
||||
HTREEITEM dropItem; /* handle to item selected by drag cursor */
|
||||
HIMAGELIST dragList; /* Bitmap of dragged item */
|
||||
INT32 cx,cy; /* current x/y place in list */
|
||||
COLORREF clrBk;
|
||||
COLORREF clrText;
|
||||
HFONT32 hFont;
|
||||
HFONT32 hBoldFont;
|
||||
HWND32 hwndToolTip;
|
||||
HWND32 hwndEdit;
|
||||
WNDPROC32 wpEditOrig; /* needed for subclassing edit control */
|
||||
|
||||
HIMAGELIST himlNormal;
|
||||
HIMAGELIST himlState;
|
||||
@ -81,6 +86,24 @@ typedef struct tagTREEVIEW_INFO
|
||||
} TREEVIEW_INFO;
|
||||
|
||||
|
||||
|
||||
/* bitflags for infoPtr->uInternalStatus */
|
||||
|
||||
#define TV_HSCROLL 0x01 /* treeview too large to fit in window */
|
||||
#define TV_VSCROLL 0x02 /* (horizontal/vertical) */
|
||||
#define TV_LDRAG 0x04 /* Lbutton pushed to start drag */
|
||||
#define TV_LDRAGGING 0x08 /* Lbutton pushed, mouse moved. */
|
||||
#define TV_RDRAG 0x10 /* dito Rbutton */
|
||||
#define TV_RDRAGGING 0x20
|
||||
|
||||
/* bitflags for infoPtr->timer */
|
||||
|
||||
#define TV_REFRESH_TIMER 1
|
||||
#define TV_EDIT_TIMER 2
|
||||
#define TV_REFRESH_TIMER_SET 1
|
||||
#define TV_EDIT_TIMER_SET 2
|
||||
|
||||
|
||||
extern VOID TREEVIEW_Register (VOID);
|
||||
extern VOID TREEVIEW_Unregister (VOID);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user