Commit ba211eeb authored by Alex Priem's avatar Alex Priem Committed by Alexandre Julliard

Further improvements.

parent 62d6e981
......@@ -33,24 +33,8 @@
#include "debug.h"
#include <asm/bitops.h> /* FIXME: linux specific */
static int TREEVIEW_Timer;
#define TREEVIEW_GetInfoPtr(wndPtr) ((TREEVIEW_INFO *)wndPtr->wExtra[0])
#include <asm/bitops.h> /* FIXME: linux specific */
static int TREEVIEW_Timer;
#define TREEVIEW_GetInfoPtr(wndPtr) ((TREEVIEW_INFO *)wndPtr->wExtra[0])
static BOOL32
TREEVIEW_SendSimpleNotify (WND *wndPtr, UINT32 code);
static BOOL32
......@@ -198,22 +182,21 @@ static void TREEVIEW_RemoveAllChildren (TREEVIEW_INFO *infoPtr,
}
/* Note:TREEVIEW_RemoveTree doesn't remove infoPtr itself */
static void TREEVIEW_RemoveTree (TREEVIEW_INFO *infoPtr)
{
TREEVIEW_ITEM *killItem;
int i;
TREEVIEW_ITEM *killItem;
int i;
/* bummer: if we didn't delete anything, test_bit is overhead */
for (i=1; i<=infoPtr->uMaxHandle; i++)
if (!test_bit (i, infoPtr->freeList)) {
killItem=& infoPtr->items [i];
if (killItem->pszText!=LPSTR_TEXTCALLBACK32A)
HeapFree (GetProcessHeap (), 0, killItem->pszText);
}
if (!test_bit (i, infoPtr->freeList)) {
killItem=& infoPtr->items [i];
if (killItem->pszText!=LPSTR_TEXTCALLBACK32A)
HeapFree (GetProcessHeap (), 0, killItem->pszText);
}
if (infoPtr->uNumPtrsAlloced) {
HeapFree (GetProcessHeap (), 0, infoPtr->items);
......@@ -222,8 +205,6 @@ static void TREEVIEW_RemoveTree (TREEVIEW_INFO *infoPtr)
infoPtr->uNumPtrsAlloced=0;
infoPtr->uMaxHandle=0;
}
/* this function doesn't remove infoPtr itself */
}
......@@ -561,9 +542,9 @@ TREEVIEW_Refresh (WND *wndPtr, HDC32 hdc)
TRACE (treeview,"\n");
if (TREEVIEW_Timer & TV_REFRESH_TIMER_SET) {
if (infoPtr->Timer & TV_REFRESH_TIMER_SET) {
KillTimer32 (wndPtr->hwndSelf, TV_REFRESH_TIMER);
TREEVIEW_Timer &= ~TV_REFRESH_TIMER_SET;
infoPtr->Timer &= ~TV_REFRESH_TIMER_SET;
}
......@@ -669,14 +650,14 @@ TREEVIEW_HandleTimer ( WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
switch (wParam) {
case TV_REFRESH_TIMER:
KillTimer32 (wndPtr->hwndSelf, TV_REFRESH_TIMER);
TREEVIEW_Timer &= ~TV_REFRESH_TIMER_SET;
infoPtr->Timer &= ~TV_REFRESH_TIMER_SET;
hdc=GetDC32 (wndPtr->hwndSelf);
TREEVIEW_Refresh (wndPtr, hdc);
ReleaseDC32 (wndPtr->hwndSelf, hdc);
return 0;
case TV_EDIT_TIMER:
KillTimer32 (wndPtr->hwndSelf, TV_EDIT_TIMER);
TREEVIEW_Timer &= ~TV_EDIT_TIMER_SET;
infoPtr->Timer &= ~TV_EDIT_TIMER_SET;
return 0;
}
......@@ -688,14 +669,15 @@ static void
TREEVIEW_QueueRefresh (WND *wndPtr)
{
TREEVIEW_INFO *infoPtr = TREEVIEW_GetInfoPtr(wndPtr);
TRACE (treeview,"queued\n");
if (TREEVIEW_Timer & TV_REFRESH_TIMER_SET) {
if (infoPtr->Timer & TV_REFRESH_TIMER_SET) {
KillTimer32 (wndPtr->hwndSelf, TV_REFRESH_TIMER);
}
SetTimer32 (wndPtr->hwndSelf, TV_REFRESH_TIMER, TV_REFRESH_DELAY, 0);
TREEVIEW_Timer|=TV_REFRESH_TIMER_SET;
infoPtr->Timer|=TV_REFRESH_TIMER_SET;
}
......@@ -1113,6 +1095,8 @@ TREEVIEW_Destroy (WND *wndPtr)
TREEVIEW_INFO *infoPtr = TREEVIEW_GetInfoPtr(wndPtr);
TREEVIEW_RemoveTree (infoPtr);
if (infoPtr->Timer & TV_REFRESH_TIMER_SET)
KillTimer32 (wndPtr->hwndSelf, TV_REFRESH_TIMER);
HeapFree (GetProcessHeap (), 0, infoPtr);
......
......@@ -30,10 +30,16 @@ typedef struct tagTRACKBAR_INFO
RECT32 rcChannel;
RECT32 rcSelection;
RECT32 rcThumb;
INT32 dragPos;
LPLONG tics;
} TRACKBAR_INFO;
#define TB_DRAG_TIMER 1
#define TB_DRAG_DELAY 10
extern void TRACKBAR_Register (void);
#endif /* __WINE_TRACKBAR_H */
......@@ -51,6 +51,7 @@ typedef struct {
typedef struct tagTREEVIEW_INFO
{
UINT32 uInternalStatus;
INT32 Timer;
UINT32 uNumItems; /* number of valid TREEVIEW_ITEMs */
UINT32 uNumPtrsAlloced;
UINT32 uMaxHandle; /* needed for delete_item */
......
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