coolsb_internal.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. #ifndef _COOLSB_INTERNAL_INCLUDED
  2. #define _COOLSB_INTERNAL_INCLUDED
  3. #include <windows.h>
  4. //
  5. // SCROLLBAR datatype. There are two of these structures per window
  6. //
  7. typedef struct
  8. {
  9. UINT fScrollFlags; //flags
  10. BOOL fScrollVisible; //if this scrollbar visible?
  11. SCROLLINFO scrollInfo; //positional data (range, position, page size etc)
  12. int nArrowLength; //perpendicular size (height of a horizontal, width of a vertical)
  13. int nArrowWidth; //parallel size (width of horz, height of vert)
  14. //data for inserted buttons
  15. SCROLLBUT sbButtons[MAX_COOLSB_BUTS];
  16. int nButtons;
  17. int nButSizeBefore; //size to the left / above the bar
  18. int nButSizeAfter; //size to the right / below the bar
  19. BOOL fButVisibleBefore; //if the buttons to the left are visible
  20. BOOL fButVisibleAfter; //if the buttons to the right are visible
  21. int nBarType; //SB_HORZ / SB_VERT
  22. UINT fFlatScrollbar; //do we display flat scrollbars?
  23. int nMinThumbSize;
  24. } SCROLLBAR;
  25. //
  26. // Container structure for a cool scrollbar window.
  27. //
  28. typedef struct
  29. {
  30. UINT bars; //which of the scrollbars do we handle? SB_VERT / SB_HORZ / SB_BOTH
  31. WNDPROC oldproc; //old window procedure to call for every message
  32. SCROLLBAR sbarHorz; //one scrollbar structure each for
  33. SCROLLBAR sbarVert; //the horizontal and vertical scrollbars
  34. BOOL fThumbTracking; // are we currently thumb-tracking??
  35. BOOL fLeftScrollbar; // support the WS_EX_LEFTSCROLLBAR style
  36. HWND hwndToolTip; // tooltip support!!!
  37. //size of the window borders
  38. int cxLeftEdge, cxRightEdge;
  39. int cyTopEdge, cyBottomEdge;
  40. // To prevent calling original WindowProc in response
  41. // to our own temporary style change (fixes TreeView problem)
  42. BOOL bPreventStyleChange;
  43. } SCROLLWND;
  44. //
  45. // PRIVATE INTERNAL FUNCTIONS
  46. //
  47. SCROLLWND *GetScrollWndFromHwnd(HWND hwnd);
  48. #define InvertCOLORREF(col) ((~col) & 0x00ffffff)
  49. #define COOLSB_TIMERID1 65533 //initial timer
  50. #define COOLSB_TIMERID2 65534 //scroll message timer
  51. #define COOLSB_TIMERID3 -14 //mouse hover timer
  52. #define COOLSB_TIMERINTERVAL1 300
  53. #define COOLSB_TIMERINTERVAL2 55
  54. #define COOLSB_TIMERINTERVAL3 20 //mouse hover time
  55. //
  56. // direction: 0 - same axis as scrollbar (i.e. width of a horizontal bar)
  57. // 1 - perpendicular dimesion (i.e. height of a horizontal bar)
  58. //
  59. #define SM_CXVERTSB 1
  60. #define SM_CYVERTSB 0
  61. #define SM_CXHORZSB 0
  62. #define SM_CYHORZSB 1
  63. #define SM_SCROLL_WIDTH 1
  64. #define SM_SCROLL_LENGTH 0
  65. #endif