Index: trunk/src/comctl32/progress.c
===================================================================
--- trunk/src/comctl32/progress.c	(revision 601)
+++ trunk/src/comctl32/progress.c	(revision 603)
@@ -1,3 +1,3 @@
-/* $Id: progress.c,v 1.9 1999-08-19 21:24:19 cbratschi Exp $ */
+/* $Id: progress.c,v 1.10 1999-08-21 12:10:01 cbratschi Exp $ */
 /*
  * Progress control
@@ -28,7 +28,7 @@
 //        "Unknown parameter(s) for message " #msg     \
 //      "(%04x): wp=%04x lp=%08lx\n", msg, wParam, lParam);
-#define UNKNOWN_PARAM(msg, wParam, lParam)
-
-#define PROGRESS_GetInfoPtr(hwnd) ((PROGRESS_INFO *)GetWindowLongA(hwnd, 0))
+//#define UNKNOWN_PARAM(msg, wParam, lParam)
+
+#define PROGRESS_GetInfoPtr(hwnd) ((PROGRESS_INFO *)GetWindowLongA(hwnd,0))
 
 
Index: trunk/src/comctl32/tab.c
===================================================================
--- trunk/src/comctl32/tab.c	(revision 601)
+++ trunk/src/comctl32/tab.c	(revision 603)
@@ -1,3 +1,3 @@
-/* $Id: tab.c,v 1.10 1999-08-14 16:13:13 cbratschi Exp $ */
+/* $Id: tab.c,v 1.11 1999-08-21 12:10:02 cbratschi Exp $ */
 /*
  * Tab control
@@ -389,5 +389,6 @@
   TAB_INFO *infoPtr = TAB_GetInfoPtr(hwnd);
   POINT pt;
-  INT newItem,dummy;
+  INT newItem;
+  UINT dummy;
 
   if (infoPtr->hwndToolTip)
@@ -1795,4 +1796,6 @@
 TAB_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 {
+//if (uMsg == WM_CREATE) MessageBoxA(hwnd,"wm_create!",NULL,MB_OK);//CB:bug!!!
+//CB: WM_CREATE never send!!!
     switch (uMsg)
     {
Index: trunk/src/comctl32/trackbar.c
===================================================================
--- trunk/src/comctl32/trackbar.c	(revision 601)
+++ trunk/src/comctl32/trackbar.c	(revision 603)
@@ -1,3 +1,3 @@
-/* $Id: trackbar.c,v 1.14 1999-08-19 21:24:19 cbratschi Exp $ */
+/* $Id: trackbar.c,v 1.15 1999-08-21 12:10:02 cbratschi Exp $ */
 /*
  * Trackbar control
@@ -357,4 +357,27 @@
 }
 
+static VOID TRACKBAR_FillHorzTics(TRACKBAR_INFO *infoPtr,HDC hdc,int flags,COLORREF clrTic)
+{
+  RECT rect;
+  INT range = infoPtr->nRangeMax-infoPtr->nRangeMin;
+  INT width = infoPtr->rcChannel.right-infoPtr->rcChannel.left;
+  HBRUSH hbr = CreateSolidBrush(clrTic);
+
+  if (flags & TBS_TOP)
+  {
+    rect.bottom = infoPtr->rcFullThumb.top-SCALE_SPACE-1+1;
+    rect.top = rect.bottom-3;
+  } else
+  {
+    rect.top = infoPtr->rcFullThumb.bottom+SCALE_SPACE+1;
+    rect.bottom = rect.top+3;
+  }
+  rect.left = infoPtr->rcChannel.left+(width*(infoPtr->tics[0]-infoPtr->nRangeMin))/range;
+  rect.right = infoPtr->rcChannel.left+(width*(infoPtr->tics[infoPtr->uNumTics-1]-infoPtr->nRangeMin))/range+1;
+
+  FillRect(hdc,&rect,hbr);
+  DeleteObject(hbr);
+}
+
 static VOID
 TRACKBAR_DrawVertTic (TRACKBAR_INFO *infoPtr, HDC hdc, LONG ticPos,
@@ -415,4 +438,26 @@
 }
 
+static VOID TRACKBAR_FillVertTics(TRACKBAR_INFO *infoPtr,HDC hdc,int flags,COLORREF clrTic)
+{
+  RECT rect;
+  INT range = infoPtr->nRangeMax-infoPtr->nRangeMin;
+  INT width = infoPtr->rcChannel.bottom-infoPtr->rcChannel.top;
+  HBRUSH hbr = CreateSolidBrush(clrTic);
+
+  if (flags & TBS_TOP)
+  {
+    rect.right = infoPtr->rcFullThumb.left-SCALE_SPACE-1+1;
+    rect.left = rect.right-3;
+  } else
+  {
+    rect.left = infoPtr->rcFullThumb.right+SCALE_SPACE+1;
+    rect.right = rect.left+3;
+  }
+  rect.top = infoPtr->rcChannel.top+(width*(infoPtr->tics[0]-infoPtr->nRangeMin))/range;
+  rect.bottom = infoPtr->rcChannel.top+(width*(infoPtr->tics[infoPtr->uNumTics-1]-infoPtr->nRangeMin))/range+1;
+
+  FillRect(hdc,&rect,hbr);
+  DeleteObject(hbr);
+}
 
 static VOID
@@ -749,7 +794,29 @@
         int ticFlags = dwStyle & 0x0f;
         COLORREF clrTic = GetSysColor(COLOR_3DDKSHADOW);
-
-        for (i = 0;i < infoPtr->uNumTics;i++)
-            TRACKBAR_DrawTics(infoPtr,hdc,infoPtr->tics[i],ticFlags,clrTic);
+        INT range = infoPtr->nRangeMax-infoPtr->nRangeMin;
+        INT width = (dwStyle & TBS_VERT) ? rcChannel.bottom-rcChannel.top:rcChannel.right-rcChannel.left;
+
+        //check if maximum of visible marks is reached
+        if (dwStyle & TBS_AUTOTICKS && infoPtr->uNumTics > 1 && (INT)(width*infoPtr->tics[0]/range) == (INT)(width*infoPtr->tics[1]/range))
+        {
+          //draw all pixels at once -> much faster
+          if (dwStyle & TBS_VERT)
+          {
+            if ((ticFlags & TBS_LEFT) || (ticFlags & TBS_BOTH))
+              TRACKBAR_FillVertTics(infoPtr,hdc,ticFlags | TBS_LEFT,clrTic);
+            if (!(ticFlags & TBS_LEFT) || (ticFlags & TBS_BOTH))
+              TRACKBAR_FillVertTics(infoPtr,hdc,ticFlags & ~TBS_LEFT,clrTic);
+          } else
+          {
+            if ((ticFlags & TBS_TOP) || (ticFlags & TBS_BOTH))
+              TRACKBAR_FillHorzTics(infoPtr,hdc,ticFlags | TBS_TOP,clrTic);
+            if (!(ticFlags & TBS_TOP) || (ticFlags & TBS_BOTH))
+              TRACKBAR_FillHorzTics(infoPtr,hdc,ticFlags & ~TBS_TOP,clrTic);
+          }
+        } else
+        {
+          for (i = 0;i < infoPtr->uNumTics;i++)
+              TRACKBAR_DrawTics(infoPtr,hdc,infoPtr->tics[i],ticFlags,clrTic);
+        }
 
         TRACKBAR_DrawTics(infoPtr,hdc,0,ticFlags | TIC_LEFTEDGE,clrTic);
@@ -817,5 +884,5 @@
    TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(hwnd);
    DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE);
-   RECT lastRect,newRect,windowRect;
+   RECT lastRect,newRect,updateRect;
    HDC hdcCompatible;
    HBITMAP bitmap,oldbmp;
@@ -830,5 +897,5 @@
      infoPtr->flags &= ~TB_DRAGPOSVALID;
    }
-   if (infoPtr->nPos == lastPos) return;
+   if (!mustRedraw && infoPtr->nPos == lastPos) return;
 
    if (dwStyle & TBS_NOTHUMB) return;
@@ -848,8 +915,11 @@
 
    //BitBlt from memory -> no flickering
-   GetClientRect(hwnd,&windowRect);
+   updateRect.left = MIN(lastRect.left,newRect.left);
+   updateRect.right = MAX(lastRect.right,newRect.right);
+   updateRect.top = MIN(lastRect.top,newRect.top);
+   updateRect.bottom = MAX(lastRect.bottom,newRect.bottom);
    hdc = GetDC(hwnd);
    hdcCompatible = CreateCompatibleDC(hdc);
-   bitmap = CreateCompatibleBitmap(hdc,windowRect.right,windowRect.bottom);
+   bitmap = CreateCompatibleBitmap(hdc,updateRect.right,updateRect.bottom);
    oldbmp = SelectObject(hdcCompatible,bitmap);
    TRACKBAR_Draw(hwnd,hdcCompatible);
@@ -883,24 +953,4 @@
 }
 
-//redraw thumb at same position
-
-static VOID TRACKBAR_UpdateThumb(HWND hwnd)
-{
-   HDC hdc;
-   TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr (hwnd);
-   DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE);
-   HRGN hrgn;
-
-   if (dwStyle & TBS_NOTHUMB) return;
-
-   hdc = GetDC(hwnd);
-   hrgn = CreateRectRgnIndirect(&infoPtr->rcFullThumb);
-   SelectClipRgn(hdc,hrgn);
-   TRACKBAR_Draw(hwnd,hdc);
-   SelectClipRgn(hdc,0);
-   DeleteObject(hrgn);
-   ReleaseDC(hwnd,hdc);
-}
-
 //redraw everything
 
@@ -1751,5 +1801,5 @@
     int clickPlace,prevPos,vertical;
     DOUBLE clickPos;
-    RECT thumb;
+    RECT thumb,fullThumb;
     POINT clickPoint;
 
@@ -1765,15 +1815,62 @@
 
     //Button down on thumb?
-    thumb = infoPtr->rcFullThumb; //approzimative
+    thumb = infoPtr->rcThumb;
+    fullThumb = infoPtr->rcFullThumb;
     if ((vertical &&
-         (clickPoint.y >= thumb.top) &&
-         (clickPoint.y <= thumb.bottom) &&
-         (clickPoint.x >= thumb.left) &&
-         (clickPoint.x <= thumb.right))   ||
+         clickPoint.y >= thumb.top &&
+         clickPoint.y <= thumb.bottom &&
+         ((dwStyle & TBS_BOTH &&
+           clickPoint.x >= thumb.left &&
+           clickPoint.x <= thumb.right
+          ) ||
+          (dwStyle & TBS_LEFT &&
+           clickPoint.x <= thumb.right &&
+           (clickPoint.x >= thumb.left ||
+            (clickPoint.x >= fullThumb.left &&
+             (thumb.left-clickPoint.x <= clickPoint.y-thumb.top &&
+              thumb.left-clickPoint.x <= thumb.bottom-clickPoint.y
+             )
+            )
+           )
+          ) ||
+          (!(dwStyle & (TBS_BOTH | TBS_LEFT)) &&
+           clickPoint.x >= thumb.left &&
+           (clickPoint.x <= thumb.right ||
+            (clickPoint.x <= fullThumb.right &&
+             (clickPoint.x-thumb.right <= clickPoint.y-thumb.top &&
+              clickPoint.x-thumb.right <= thumb.bottom-clickPoint.y
+             )
+            )
+           )
+         ))
+        ) ||
         (!vertical &&
-         (clickPoint.x >= thumb.left) &&
-         (clickPoint.x <= thumb.right) &&
-         (clickPoint.y >= thumb.top) &&
-         (clickPoint.y <= thumb.bottom)))
+         clickPoint.x >= thumb.left &&
+         clickPoint.x <= thumb.right &&
+         ((dwStyle & TBS_BOTH &&
+           clickPoint.y >= thumb.top &&
+           clickPoint.y <= thumb.bottom
+          ) ||
+          (dwStyle & TBS_TOP &&
+           clickPoint.y <= thumb.bottom &&
+           (clickPoint.y >= thumb.top ||
+            (clickPoint.y >= fullThumb.top &&
+             (thumb.top-clickPoint.y <= clickPoint.x-thumb.left &&
+              thumb.top-clickPoint.y <= thumb.right-clickPoint.x
+             )
+            )
+           )
+          ) ||
+          (!(dwStyle & (TBS_BOTH | TBS_TOP)) &&
+           clickPoint.y >= thumb.top &&
+           (clickPoint.y <= thumb.bottom ||
+            (clickPoint.y <= fullThumb.bottom &&
+             (clickPoint.y-thumb.bottom <= clickPoint.x-thumb.left &&
+              clickPoint.y-thumb.bottom <= thumb.right-clickPoint.x
+             )
+            )
+           )
+         ))
+       ))
        {
          infoPtr->flags |= TB_DRAG_MODE;
@@ -1801,5 +1898,5 @@
          }
          SetCapture(hwnd);
-         TRACKBAR_UpdateThumb(hwnd); //change arrow color
+         TRACKBAR_UpdateThumbPosition(hwnd,infoPtr->nPos,TRUE); //change arrow color
          return 0;
        }
@@ -1873,5 +1970,5 @@
       }
 
-      TRACKBAR_UpdateThumb(hwnd); //change arrow color
+      TRACKBAR_UpdateThumbPosition(hwnd,infoPtr->nPos,TRUE); //change arrow color
     }
 
