Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

111 lines
4.5 KiB

  1. /*-----------------------------------------------------------------------------+
  2. | TRACKI.H |
  3. | |
  4. | Contains all the useful information for a trackbar. |
  5. | |
  6. | (C) Copyright Microsoft Corporation 1991. All rights reserved. |
  7. | |
  8. | Revision History |
  9. | Oct-1992 MikeTri Ported to WIN32 / WIN16 common code |
  10. | |
  11. +-----------------------------------------------------------------------------*/
  12. #include "track.h"
  13. static TCHAR szSTrackBarClass[] = TRACKBAR_CLASS;
  14. typedef struct {
  15. HWND hwnd; // our window handle
  16. HDC hdc; // current DC
  17. LONG lLogMin; // Logical minimum
  18. LONG lLogMax; // Logical maximum
  19. LONG lLogPos; // Logical position
  20. LONG lSelStart; // Logical selection start
  21. LONG lSelEnd; // Logical selection end
  22. LONG lTrackStart; // Logical track start
  23. UINT wThumbWidth; // Width of the thumb
  24. UINT wThumbHeight; // Height of the thumb
  25. int iSizePhys; // Size of where thumb lives
  26. RECT rc; // track bar rect.
  27. RECT Thumb; // Rectangle we current thumb
  28. DWORD dwDragPos; // Logical position of mouse while dragging.
  29. UINT Flags; // Flags for our window
  30. int Timer; // Our timer.
  31. UINT Cmd; // The command we're repeating.
  32. int nTics; // number of ticks.
  33. PDWORD pTics; // the tick marks.
  34. } TrackBar, *PTrackBar;
  35. // Trackbar flags
  36. #define TBF_NOTHUMB 0x0001 // No thumb because not wide enough.
  37. /*
  38. useful constants.
  39. */
  40. #define REPEATTIME 500 // mouse auto repeat 1/2 of a second
  41. #define TIMER_ID 1
  42. #define GWW_TRACKMEM 0 /* handle to track bar memory */
  43. #define EXTRA_TB_BYTES sizeof(HLOCAL) /* Total extra bytes. */
  44. /*
  45. Useful defines.
  46. */
  47. /* We allocate enough window words to store a pointer (not a handle), so the
  48. definition of EXTRA_TB_BYTES is slightly bad style. Sorry. On creation
  49. we allocate space for the TrackBar struct. On destruction we free it.
  50. In between we just retrieve the pointer.
  51. */
  52. #define CREATETRACKBAR(hwnd) SetWindowLongPtr( hwnd \
  53. , GWW_TRACKMEM \
  54. , AllocMem(sizeof(TrackBar)) \
  55. )
  56. #define DESTROYTRACKBAR(hwnd) FreeMem( (LPVOID)GetWindowLongPtr(hwnd, GWW_TRACKMEM), \
  57. sizeof(TrackBar) )
  58. #define GETTRACKBAR(hwnd) (PTrackBar)GetWindowLongPtr(hwnd,GWW_TRACKMEM)
  59. /*
  60. Function Prototypes
  61. */
  62. void FAR PASCAL DoTrack(PTrackBar, int, DWORD);
  63. UINT FAR PASCAL WTrackType(PTrackBar, LONG);
  64. void FAR PASCAL TBTrackInit(PTrackBar, LONG);
  65. void FAR PASCAL TBTrackEnd(PTrackBar, LONG);
  66. void FAR PASCAL TBTrack(PTrackBar, LONG);
  67. void FAR PASCAL DrawThumb(PTrackBar);
  68. HBRUSH FAR PASCAL SelectColorObjects(PTrackBar, BOOL);
  69. void FAR PASCAL SetTBCaretPos(PTrackBar);
  70. extern DWORD FAR PASCAL muldiv32(long, long, long);
  71. /* objects from sbutton.c */
  72. extern HBRUSH hbrButtonFace;
  73. extern HBRUSH hbrButtonShadow;
  74. extern HBRUSH hbrButtonText;
  75. extern HBRUSH hbrButtonHighLight;
  76. extern HBRUSH hbrWindowFrame; //???
  77. extern HBITMAP FAR PASCAL LoadUIBitmap(
  78. HANDLE hInstance, // EXE file to load resource from
  79. LPCTSTR szName, // name of bitmap resource
  80. COLORREF rgbText, // color to use for "Button Text"
  81. COLORREF rgbFace, // color to use for "Button Face"
  82. COLORREF rgbShadow, // color to use for "Button Shadow"
  83. COLORREF rgbHighlight, // color to use for "Button Hilight"
  84. COLORREF rgbWindow, // color to use for "Window Color"
  85. COLORREF rgbFrame); // color to use for "Window Frame"
  86.