Commit 02300aea authored by Sylvain St.Germain's avatar Sylvain St.Germain Committed by Alexandre Julliard

Fixed some graphical problems of the treeview and added support LMB

click on +/- sign to open and close. Fixed a bug in imagelist where the last image could not be displayed.
parent 6d45e7a9
...@@ -894,7 +894,7 @@ ImageList_DrawIndirect (IMAGELISTDRAWPARAMS *pimldp) ...@@ -894,7 +894,7 @@ ImageList_DrawIndirect (IMAGELISTDRAWPARAMS *pimldp)
return FALSE; return FALSE;
if (pimldp->himl == NULL) if (pimldp->himl == NULL)
return FALSE; return FALSE;
if ((pimldp->i < 0) || (pimldp->i >= pimldp->himl->cCurImage)) if ((pimldp->i < 0) || (pimldp->i > pimldp->himl->cCurImage))
return FALSE; return FALSE;
himlLocal = pimldp->himl; himlLocal = pimldp->himl;
......
...@@ -17,72 +17,68 @@ ...@@ -17,72 +17,68 @@
/* internal structures */ /* internal structures */
typedef struct { typedef struct {
UINT mask; UINT mask;
HTREEITEM hItem; HTREEITEM hItem;
UINT state; UINT state;
UINT stateMask; UINT stateMask;
LPSTR pszText; LPSTR pszText;
int cchTextMax; int cchTextMax;
int iImage; int iImage;
int iSelectedImage; int iSelectedImage;
int cChildren; int cChildren;
LPARAM lParam; LPARAM lParam;
int iIntegral; int iIntegral;
int iLevel; /* indentation level:0=root level */ int iLevel; /* indentation level:0=root level */
COLORREF clrText; COLORREF clrText;
HTREEITEM parent; /* handle to parent or 0 if at root*/
HTREEITEM parent; /* handle to parent or 0 if at root*/ HTREEITEM firstChild; /* handle to first child or 0 if no child*/
HTREEITEM firstChild; /* handle to first child or 0 if no child*/ HTREEITEM sibling; /* handle to next item in list, 0 if last */
HTREEITEM sibling; /* handle to next item in list, 0 if last */ HTREEITEM upsibling; /* handle to previous item in list, 0 if first */
HTREEITEM upsibling; /* handle to previous item in list, 0 if first */ int visible;
int visible; RECT rect;
RECT rect; RECT text;
RECT text; RECT expandBox; /* expand box (+/-) coordinate */
} TREEVIEW_ITEM; } TREEVIEW_ITEM;
typedef struct tagTREEVIEW_INFO typedef struct tagTREEVIEW_INFO
{ {
UINT uInternalStatus; UINT uInternalStatus;
UINT bAutoSize; /* merge with uInternalStatus */ UINT bAutoSize; /* merge with uInternalStatus */
INT Timer; INT Timer;
UINT uNumItems; /* number of valid TREEVIEW_ITEMs */ UINT uNumItems; /* number of valid TREEVIEW_ITEMs */
UINT uNumPtrsAlloced; UINT uNumPtrsAlloced;
HTREEITEM uMaxHandle; /* needed for delete_item */ HTREEITEM uMaxHandle; /* needed for delete_item */
HTREEITEM TopRootItem; /* handle to first item in treeview */ HTREEITEM TopRootItem; /* handle to first item in treeview */
INT cdmode; /* last custom draw setting */ INT cdmode; /* last custom draw setting */
UINT uItemHeight; /* item height, -1 for default item height */
UINT uItemHeight; /* item height, -1 for default item height */ UINT uRealItemHeight;/* current item height in pixels */
UINT uRealItemHeight; /* current item height in pixels */ UINT uVisibleHeight; /* visible height of treeview in pixels */
UINT uVisibleHeight; /* visible height of treeview in pixels */ UINT uTotalHeight; /* total height of treeview in pixels */
UINT uTotalHeight; /* total height of treeview in pixels */ UINT uVisibleWidth;
UINT uVisibleWidth; UINT uTotalWidth;
UINT uTotalWidth; UINT uIndent; /* indentation in pixels */
UINT uIndent; /* indentation in pixels */ HTREEITEM selectedItem; /* handle to selected item or 0 if none */
HTREEITEM selectedItem; /* handle to selected item or 0 if none */ HTREEITEM focusItem; /* handle to item that has focus, 0 if none */
HTREEITEM focusItem; /* handle to item that has focus, 0 if none */ HTREEITEM hotItem; /* handle currently under cursor, 0 if none */
HTREEITEM hotItem; /* handle currently under cursor, 0 if none */ HTREEITEM editItem; /* handle to item currently editted, 0 if none */
HTREEITEM editItem; /* handle to item currently editted, 0 if none */ HTREEITEM firstVisible; /* handle to first visible item */
HTREEITEM firstVisible; /* handle to first visible item */ HTREEITEM dropItem; /* handle to item selected by drag cursor */
HTREEITEM dropItem; /* handle to item selected by drag cursor */ HIMAGELIST dragList; /* Bitmap of dragged item */
HIMAGELIST dragList; /* Bitmap of dragged item */ INT cx,cy; /* current x/y place in list */
INT cx,cy; /* current x/y place in list */ COLORREF clrBk;
COLORREF clrBk; COLORREF clrText;
COLORREF clrText; HFONT hFont;
HFONT hFont; HFONT hBoldFont;
HFONT hBoldFont; HWND hwndToolTip;
HWND hwndToolTip; HWND hwndEdit;
HWND hwndEdit; WNDPROC wpEditOrig; /* needed for subclassing edit control */
WNDPROC wpEditOrig; /* needed for subclassing edit control */ HIMAGELIST himlNormal;
HIMAGELIST himlState;
HIMAGELIST himlNormal; TREEVIEW_ITEM *items; /* itemlist */
HIMAGELIST himlState; INT *freeList; /* bitmap indicating which elements are valid */
TREEVIEW_ITEM *items; /* itemlist */ /* 1=valid, 0=free; */
INT *freeList; /* bitmap indicating which elements are valid */ /* size of list= uNumPtrsAlloced/32 */
/* 1=valid, 0=free; */
/* size of list= uNumPtrsAlloced/32 */
} TREEVIEW_INFO; } TREEVIEW_INFO;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment