ReactOS 0.4.15-dev-7953-g1f49173
trackbar.c File Reference
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winnls.h"
#include "commctrl.h"
#include "uxtheme.h"
#include "vssym32.h"
#include "wine/debug.h"
#include "comctl32.h"
Include dependency graph for trackbar.c:

Go to the source code of this file.

Classes

struct  TRACKBAR_INFO
 

Macros

#define TB_REFRESH_TIMER   1
 
#define TB_REFRESH_DELAY   500
 
#define TOOLTIP_OFFSET   2 /* distance from ctrl edge to tooltip */
 
#define TB_DEFAULTPAGESIZE   20
 
#define TB_THUMBPOSCHANGED   1
 
#define TB_THUMBSIZECHANGED   2
 
#define TB_THUMBCHANGED   (TB_THUMBPOSCHANGED | TB_THUMBSIZECHANGED)
 
#define TB_SELECTIONCHANGED   4
 
#define TB_DRAG_MODE   8 /* we're dragging the slider */
 
#define TB_AUTO_PAGE_LEFT   16
 
#define TB_AUTO_PAGE_RIGHT   32
 
#define TB_AUTO_PAGE   (TB_AUTO_PAGE_LEFT | TB_AUTO_PAGE_RIGHT)
 
#define TB_THUMB_HOT   64 /* mouse hovers above thumb */
 
#define TIC_EDGE   0x20
 
#define TIC_SELECTIONMARKMAX   0x80
 
#define TIC_SELECTIONMARKMIN   0x100
 
#define TIC_SELECTIONMARK   (TIC_SELECTIONMARKMAX | TIC_SELECTIONMARKMIN)
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (trackbar)
 
static int notify_customdraw (const TRACKBAR_INFO *infoPtr, NMCUSTOMDRAW *pnmcd, int stage)
 
static LRESULT notify_hdr (const TRACKBAR_INFO *infoPtr, INT code, LPNMHDR pnmh)
 
static int notify (const TRACKBAR_INFO *infoPtr, INT code)
 
static void notify_with_scroll (const TRACKBAR_INFO *infoPtr, UINT code)
 
static void TRACKBAR_RecalculateTics (TRACKBAR_INFO *infoPtr)
 
static LONG TRACKBAR_ConvertPlaceToPosition (const TRACKBAR_INFO *infoPtr, int place)
 
static LONG TRACKBAR_GetAutoPageDirection (const TRACKBAR_INFO *infoPtr, POINT clickPoint)
 
static void TRACKBAR_PageDown (TRACKBAR_INFO *infoPtr)
 
static void TRACKBAR_PageUp (TRACKBAR_INFO *infoPtr)
 
static void TRACKBAR_LineUp (TRACKBAR_INFO *infoPtr)
 
static void TRACKBAR_LineDown (TRACKBAR_INFO *infoPtr)
 
static void TRACKBAR_CalcChannel (TRACKBAR_INFO *infoPtr)
 
static void TRACKBAR_CalcThumb (const TRACKBAR_INFO *infoPtr, LONG lPos, RECT *thumb)
 
static void TRACKBAR_UpdateThumb (TRACKBAR_INFO *infoPtr)
 
static void TRACKBAR_InvalidateAll (const TRACKBAR_INFO *infoPtr)
 
static void TRACKBAR_InvalidateThumb (const TRACKBAR_INFO *infoPtr, LONG thumbPos)
 
static void TRACKBAR_InvalidateThumbMove (const TRACKBAR_INFO *infoPtr, LONG oldPos, LONG newPos)
 
static BOOL TRACKBAR_HasSelection (const TRACKBAR_INFO *infoPtr)
 
static void TRACKBAR_CalcSelection (TRACKBAR_INFO *infoPtr)
 
static BOOL TRACKBAR_AutoPage (TRACKBAR_INFO *infoPtr, POINT clickPoint)
 
static void TRACKBAR_DrawChannel (const TRACKBAR_INFO *infoPtr, HDC hdc)
 
static void TRACKBAR_DrawOneTic (const TRACKBAR_INFO *infoPtr, HDC hdc, LONG ticPos, int flags)
 
static void TRACKBAR_DrawTic (const TRACKBAR_INFO *infoPtr, HDC hdc, LONG ticPos, int flags)
 
static void TRACKBAR_DrawTics (const TRACKBAR_INFO *infoPtr, HDC hdc)
 
static int TRACKBAR_FillThumb (const TRACKBAR_INFO *infoPtr, HDC hdc, HBRUSH hbrush)
 
static void TRACKBAR_DrawThumb (TRACKBAR_INFO *infoPtr, HDC hdc)
 
static void TRACKBAR_ActivateToolTip (const TRACKBAR_INFO *infoPtr, BOOL fShow)
 
static void TRACKBAR_UpdateToolTip (const TRACKBAR_INFO *infoPtr)
 
static void TRACKBAR_Refresh (TRACKBAR_INFO *infoPtr, HDC hdcDst)
 
static void TRACKBAR_AlignBuddies (const TRACKBAR_INFO *infoPtr)
 
static LRESULT TRACKBAR_ClearSel (TRACKBAR_INFO *infoPtr, BOOL fRedraw)
 
static LRESULT TRACKBAR_ClearTics (TRACKBAR_INFO *infoPtr, BOOL fRedraw)
 
static LRESULT TRACKBAR_GetChannelRect (const TRACKBAR_INFO *infoPtr, LPRECT lprc)
 
static LONG TRACKBAR_GetNumTics (const TRACKBAR_INFO *infoPtr)
 
static int comp_tics (const void *ap, const void *bp)
 
static LONG TRACKBAR_GetTic (const TRACKBAR_INFO *infoPtr, INT iTic)
 
static LONG TRACKBAR_GetTicPos (const TRACKBAR_INFO *infoPtr, INT iTic)
 
static HWND TRACKBAR_SetBuddy (TRACKBAR_INFO *infoPtr, BOOL fLocation, HWND hwndBuddy)
 
static LONG TRACKBAR_SetLineSize (TRACKBAR_INFO *infoPtr, LONG lLineSize)
 
static LONG TRACKBAR_SetPageSize (TRACKBAR_INFO *infoPtr, LONG lPageSize)
 
static LRESULT TRACKBAR_SetPos (TRACKBAR_INFO *infoPtr, BOOL fPosition, LONG lPosition)
 
static LRESULT TRACKBAR_SetRange (TRACKBAR_INFO *infoPtr, BOOL redraw, LONG range)
 
static LRESULT TRACKBAR_SetRangeMax (TRACKBAR_INFO *infoPtr, BOOL redraw, LONG lMax)
 
static LRESULT TRACKBAR_SetRangeMin (TRACKBAR_INFO *infoPtr, BOOL redraw, LONG lMin)
 
static LRESULT TRACKBAR_SetSel (TRACKBAR_INFO *infoPtr, BOOL fRedraw, LONG lSel)
 
static LRESULT TRACKBAR_SetSelEnd (TRACKBAR_INFO *infoPtr, BOOL fRedraw, LONG lEnd)
 
static LRESULT TRACKBAR_SetSelStart (TRACKBAR_INFO *infoPtr, BOOL fRedraw, LONG lStart)
 
static LRESULT TRACKBAR_SetThumbLength (TRACKBAR_INFO *infoPtr, UINT iLength)
 
static LRESULT TRACKBAR_SetTic (TRACKBAR_INFO *infoPtr, LONG lPos)
 
static LRESULT TRACKBAR_SetTicFreq (TRACKBAR_INFO *infoPtr, WORD wFreq)
 
static INT TRACKBAR_SetTipSide (TRACKBAR_INFO *infoPtr, INT fLocation)
 
static LRESULT TRACKBAR_SetToolTips (TRACKBAR_INFO *infoPtr, HWND hwndTT)
 
static BOOL TRACKBAR_SetUnicodeFormat (TRACKBAR_INFO *infoPtr, BOOL fUnicode)
 
static LRESULT TRACKBAR_InitializeThumb (TRACKBAR_INFO *infoPtr)
 
static LRESULT TRACKBAR_Create (HWND hwnd, const CREATESTRUCTW *lpcs)
 
static LRESULT TRACKBAR_Destroy (TRACKBAR_INFO *infoPtr)
 
static LRESULT TRACKBAR_KillFocus (TRACKBAR_INFO *infoPtr)
 
static LRESULT TRACKBAR_LButtonDown (TRACKBAR_INFO *infoPtr, INT x, INT y)
 
static LRESULT TRACKBAR_LButtonUp (TRACKBAR_INFO *infoPtr)
 
static LRESULT TRACKBAR_CaptureChanged (const TRACKBAR_INFO *infoPtr)
 
static LRESULT TRACKBAR_Paint (TRACKBAR_INFO *infoPtr, HDC hdc)
 
static LRESULT TRACKBAR_SetFocus (TRACKBAR_INFO *infoPtr)
 
static LRESULT TRACKBAR_Size (TRACKBAR_INFO *infoPtr)
 
static LRESULT TRACKBAR_StyleChanged (TRACKBAR_INFO *infoPtr, WPARAM wStyleType, const STYLESTRUCT *lpss)
 
static LRESULT TRACKBAR_Timer (TRACKBAR_INFO *infoPtr)
 
static LRESULT theme_changed (const TRACKBAR_INFO *infoPtr)
 
static LRESULT TRACKBAR_MouseMove (TRACKBAR_INFO *infoPtr, INT x, INT y)
 
static BOOL TRACKBAR_KeyDown (TRACKBAR_INFO *infoPtr, INT nVirtKey)
 
static BOOL TRACKBAR_KeyUp (const TRACKBAR_INFO *infoPtr, INT nVirtKey)
 
static LRESULT TRACKBAR_Enable (TRACKBAR_INFO *infoPtr, BOOL enable)
 
static LRESULT WINAPI TRACKBAR_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
void TRACKBAR_Register (void)
 
void TRACKBAR_Unregister (void)
 

Variables

static const WCHAR themeClass [] = { 'T','r','a','c','k','b','a','r',0 }
 

Macro Definition Documentation

◆ TB_AUTO_PAGE

Definition at line 88 of file trackbar.c.

◆ TB_AUTO_PAGE_LEFT

#define TB_AUTO_PAGE_LEFT   16

Definition at line 86 of file trackbar.c.

◆ TB_AUTO_PAGE_RIGHT

#define TB_AUTO_PAGE_RIGHT   32

Definition at line 87 of file trackbar.c.

◆ TB_DEFAULTPAGESIZE

#define TB_DEFAULTPAGESIZE   20

Definition at line 76 of file trackbar.c.

◆ TB_DRAG_MODE

#define TB_DRAG_MODE   8 /* we're dragging the slider */

Definition at line 85 of file trackbar.c.

◆ TB_REFRESH_DELAY

#define TB_REFRESH_DELAY   500

Definition at line 72 of file trackbar.c.

◆ TB_REFRESH_TIMER

#define TB_REFRESH_TIMER   1

Definition at line 71 of file trackbar.c.

◆ TB_SELECTIONCHANGED

#define TB_SELECTIONCHANGED   4

Definition at line 84 of file trackbar.c.

◆ TB_THUMB_HOT

#define TB_THUMB_HOT   64 /* mouse hovers above thumb */

Definition at line 89 of file trackbar.c.

◆ TB_THUMBCHANGED

#define TB_THUMBCHANGED   (TB_THUMBPOSCHANGED | TB_THUMBSIZECHANGED)

Definition at line 83 of file trackbar.c.

◆ TB_THUMBPOSCHANGED

#define TB_THUMBPOSCHANGED   1

Definition at line 81 of file trackbar.c.

◆ TB_THUMBSIZECHANGED

#define TB_THUMBSIZECHANGED   2

Definition at line 82 of file trackbar.c.

◆ TIC_EDGE

#define TIC_EDGE   0x20

Definition at line 92 of file trackbar.c.

◆ TIC_SELECTIONMARK

#define TIC_SELECTIONMARK   (TIC_SELECTIONMARKMAX | TIC_SELECTIONMARKMIN)

Definition at line 95 of file trackbar.c.

◆ TIC_SELECTIONMARKMAX

#define TIC_SELECTIONMARKMAX   0x80

Definition at line 93 of file trackbar.c.

◆ TIC_SELECTIONMARKMIN

#define TIC_SELECTIONMARKMIN   0x100

Definition at line 94 of file trackbar.c.

◆ TOOLTIP_OFFSET

#define TOOLTIP_OFFSET   2 /* distance from ctrl edge to tooltip */

Definition at line 74 of file trackbar.c.

Function Documentation

◆ comp_tics()

static int comp_tics ( const void ap,
const void bp 
)
static

Definition at line 1125 of file trackbar.c.

1126{
1127 const DWORD a = *(const DWORD *)ap;
1128 const DWORD b = *(const DWORD *)bp;
1129
1130 TRACE("(a=%d, b=%d)\n", a, b);
1131 if (a < b) return -1;
1132 if (a > b) return 1;
1133 return 0;
1134}
unsigned long DWORD
Definition: ntddk_ex.h:95
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
#define TRACE(s)
Definition: solgame.cpp:4
void int int ULONGLONG int va_list * ap
Definition: winesup.h:36

Referenced by TRACKBAR_GetTic().

◆ notify()

static int notify ( const TRACKBAR_INFO infoPtr,
INT  code 
)
inlinestatic

Definition at line 123 of file trackbar.c.

124{
125 NMHDR nmh;
126 return notify_hdr(infoPtr, code, &nmh);
127}
static LRESULT notify_hdr(const TRACKBAR_INFO *infoPtr, INT code, LPNMHDR pnmh)
Definition: trackbar.c:107
Definition: inflate.c:139

◆ notify_customdraw()

static int notify_customdraw ( const TRACKBAR_INFO infoPtr,
NMCUSTOMDRAW pnmcd,
int  stage 
)
inlinestatic

Definition at line 100 of file trackbar.c.

101{
102 pnmcd->dwDrawStage = stage;
103 return SendMessageW (infoPtr->hwndNotify, WM_NOTIFY,
104 pnmcd->hdr.idFrom, (LPARAM)pnmcd);
105}
#define WM_NOTIFY
Definition: richedit.h:61
HWND hwndNotify
Definition: trackbar.c:57
UINT_PTR idFrom
Definition: winuser.h:3158
LONG_PTR LPARAM
Definition: windef.h:208
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by TRACKBAR_Refresh().

◆ notify_hdr()

static LRESULT notify_hdr ( const TRACKBAR_INFO infoPtr,
INT  code,
LPNMHDR  pnmh 
)
static

Definition at line 107 of file trackbar.c.

108{
110
111 TRACE("(code=%d)\n", code);
112
113 pnmh->hwndFrom = infoPtr->hwndSelf;
114 pnmh->idFrom = GetWindowLongPtrW(infoPtr->hwndSelf, GWLP_ID);
115 pnmh->code = code;
116 result = SendMessageW(infoPtr->hwndNotify, WM_NOTIFY, pnmh->idFrom, (LPARAM)pnmh);
117
118 TRACE(" <= %ld\n", result);
119
120 return result;
121}
GLuint64EXT * result
Definition: glext.h:11304
HWND hwndSelf
Definition: trackbar.c:45
UINT code
Definition: winuser.h:3159
HWND hwndFrom
Definition: winuser.h:3157
LONG_PTR LRESULT
Definition: windef.h:209
#define GetWindowLongPtrW
Definition: winuser.h:4829
#define GWLP_ID
Definition: winuser.h:860

Referenced by notify().

◆ notify_with_scroll()

static void notify_with_scroll ( const TRACKBAR_INFO infoPtr,
UINT  code 
)
static

Definition at line 129 of file trackbar.c.

130{
131 UINT scroll = infoPtr->dwStyle & TBS_VERT ? WM_VSCROLL : WM_HSCROLL;
132
133 TRACE("%x\n", code);
134
135 SendMessageW (infoPtr->hwndNotify, scroll, code, (LPARAM)infoPtr->hwndSelf);
136}
unsigned int UINT
Definition: ndis.h:50
#define TBS_VERT
Definition: commctrl.h:2016
DWORD dwStyle
Definition: trackbar.c:46
#define WM_HSCROLL
Definition: winuser.h:1743
#define WM_VSCROLL
Definition: winuser.h:1744

Referenced by TRACKBAR_CaptureChanged(), TRACKBAR_KeyDown(), TRACKBAR_KeyUp(), TRACKBAR_LButtonUp(), TRACKBAR_LineDown(), TRACKBAR_LineUp(), TRACKBAR_MouseMove(), TRACKBAR_PageDown(), and TRACKBAR_PageUp().

◆ theme_changed()

static LRESULT theme_changed ( const TRACKBAR_INFO infoPtr)
static

Definition at line 1702 of file trackbar.c.

1703{
1704 HTHEME theme = GetWindowTheme (infoPtr->hwndSelf);
1705 CloseThemeData (theme);
1706 OpenThemeData (infoPtr->hwndSelf, themeClass);
1707 return 0;
1708}
static const WCHAR themeClass[]
Definition: trackbar.c:97
HTHEME WINAPI OpenThemeData(HWND hwnd, LPCWSTR classlist)
Definition: system.c:835
HTHEME WINAPI GetWindowTheme(HWND hwnd)
Definition: system.c:851
HRESULT WINAPI CloseThemeData(HTHEME hTheme)
Definition: system.c:950
static HTHEME(WINAPI *pOpenThemeDataEx)(HWND

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_ActivateToolTip()

static void TRACKBAR_ActivateToolTip ( const TRACKBAR_INFO infoPtr,
BOOL  fShow 
)
inlinestatic

Definition at line 833 of file trackbar.c.

834{
835 TTTOOLINFOW ti;
836
837 if (!infoPtr->hwndToolTip) return;
838
839 ZeroMemory(&ti, sizeof(ti));
840 ti.cbSize = sizeof(ti);
841 ti.hwnd = infoPtr->hwndSelf;
842
843 SendMessageW (infoPtr->hwndToolTip, TTM_TRACKACTIVATE, fShow, (LPARAM)&ti);
844}
#define TTM_TRACKACTIVATE
Definition: commctrl.h:1812
HWND hwndToolTip
Definition: trackbar.c:58
#define ZeroMemory
Definition: winbase.h:1712

Referenced by TRACKBAR_LButtonDown(), and TRACKBAR_LButtonUp().

◆ TRACKBAR_AlignBuddies()

static void TRACKBAR_AlignBuddies ( const TRACKBAR_INFO infoPtr)
static

Definition at line 1023 of file trackbar.c.

1024{
1025 HWND hwndParent = GetParent (infoPtr->hwndSelf);
1026 RECT rcSelf, rcBuddy;
1027 INT x, y;
1028
1029 GetWindowRect (infoPtr->hwndSelf, &rcSelf);
1031
1032 /* align buddy left or above */
1033 if (infoPtr->hwndBuddyLA) {
1034 GetWindowRect (infoPtr->hwndBuddyLA, &rcBuddy);
1036
1037 if (infoPtr->dwStyle & TBS_VERT) {
1038 x = (infoPtr->rcChannel.right + infoPtr->rcChannel.left) / 2 -
1039 (rcBuddy.right - rcBuddy.left) / 2 + rcSelf.left;
1040 y = rcSelf.top - (rcBuddy.bottom - rcBuddy.top);
1041 }
1042 else {
1043 x = rcSelf.left - (rcBuddy.right - rcBuddy.left);
1044 y = (infoPtr->rcChannel.bottom + infoPtr->rcChannel.top) / 2 -
1045 (rcBuddy.bottom - rcBuddy.top) / 2 + rcSelf.top;
1046 }
1047
1048 SetWindowPos (infoPtr->hwndBuddyLA, 0, x, y, 0, 0,
1050 }
1051
1052
1053 /* align buddy right or below */
1054 if (infoPtr->hwndBuddyRB) {
1055 GetWindowRect (infoPtr->hwndBuddyRB, &rcBuddy);
1057
1058 if (infoPtr->dwStyle & TBS_VERT) {
1059 x = (infoPtr->rcChannel.right + infoPtr->rcChannel.left) / 2 -
1060 (rcBuddy.right - rcBuddy.left) / 2 + rcSelf.left;
1061 y = rcSelf.bottom;
1062 }
1063 else {
1064 x = rcSelf.right;
1065 y = (infoPtr->rcChannel.bottom + infoPtr->rcChannel.top) / 2 -
1066 (rcBuddy.bottom - rcBuddy.top) / 2 + rcSelf.top;
1067 }
1068 SetWindowPos (infoPtr->hwndBuddyRB, 0, x, y, 0, 0,
1070 }
1071}
static HWND hwndParent
Definition: cryptui.c:300
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
HWND hwndBuddyLA
Definition: trackbar.c:59
RECT rcChannel
Definition: trackbar.c:65
HWND hwndBuddyRB
Definition: trackbar.c:60
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
int32_t INT
Definition: typedefs.h:58
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define SWP_NOSIZE
Definition: winuser.h:1245
int WINAPI MapWindowPoints(_In_opt_ HWND hWndFrom, _In_opt_ HWND hWndTo, _Inout_updates_(cPoints) LPPOINT lpPoints, _In_ UINT cPoints)
#define HWND_DESKTOP
Definition: winuser.h:1209
HWND WINAPI GetParent(_In_ HWND)
#define SWP_NOZORDER
Definition: winuser.h:1247

Referenced by TRACKBAR_SetBuddy(), and TRACKBAR_Size().

◆ TRACKBAR_AutoPage()

static BOOL TRACKBAR_AutoPage ( TRACKBAR_INFO infoPtr,
POINT  clickPoint 
)
static

Definition at line 438 of file trackbar.c.

439{
440 LONG dir = TRACKBAR_GetAutoPageDirection(infoPtr, clickPoint);
441 LONG prevPos = infoPtr->lPos;
442
443 TRACE("clickPoint=%s, dir=%d\n", wine_dbgstr_point(&clickPoint), dir);
444
445 if (dir > 0 && (infoPtr->flags & TB_AUTO_PAGE_RIGHT))
446 TRACKBAR_PageDown(infoPtr);
447 else if (dir < 0 && (infoPtr->flags & TB_AUTO_PAGE_LEFT))
448 TRACKBAR_PageUp(infoPtr);
449 else return FALSE;
450
451 TRACKBAR_UpdateThumb (infoPtr);
452 TRACKBAR_InvalidateThumbMove (infoPtr, prevPos, infoPtr->lPos);
453
454 return TRUE;
455}
unsigned int dir
Definition: maze.c:112
static const char * wine_dbgstr_point(const POINT *ppt)
Definition: atltest.h:138
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
static void TRACKBAR_InvalidateThumbMove(const TRACKBAR_INFO *infoPtr, LONG oldPos, LONG newPos)
Definition: trackbar.c:390
static LONG TRACKBAR_GetAutoPageDirection(const TRACKBAR_INFO *infoPtr, POINT clickPoint)
Definition: trackbar.c:203
#define TB_AUTO_PAGE_LEFT
Definition: trackbar.c:86
#define TB_AUTO_PAGE_RIGHT
Definition: trackbar.c:87
static void TRACKBAR_PageDown(TRACKBAR_INFO *infoPtr)
Definition: trackbar.c:233
static void TRACKBAR_UpdateThumb(TRACKBAR_INFO *infoPtr)
Definition: trackbar.c:368
static void TRACKBAR_PageUp(TRACKBAR_INFO *infoPtr)
Definition: trackbar.c:245
long LONG
Definition: pedump.c:60

Referenced by TRACKBAR_LButtonDown(), TRACKBAR_MouseMove(), and TRACKBAR_Timer().

◆ TRACKBAR_CalcChannel()

static void TRACKBAR_CalcChannel ( TRACKBAR_INFO infoPtr)
static

Definition at line 274 of file trackbar.c.

275{
276 INT cyChannel, offsetthumb, offsetedge;
277 RECT lpRect, *channel = & infoPtr->rcChannel;
278
279 GetClientRect (infoPtr->hwndSelf, &lpRect);
280
281 offsetthumb = infoPtr->uThumbLen / 4;
282 offsetedge = offsetthumb + 3;
283 cyChannel = (infoPtr->dwStyle & TBS_ENABLESELRANGE) ? offsetthumb*3 : 4;
284 if (infoPtr->dwStyle & TBS_VERT) {
285 channel->top = lpRect.top + offsetedge;
286 channel->bottom = lpRect.bottom - offsetedge;
287 if (infoPtr->dwStyle & TBS_ENABLESELRANGE)
288 channel->left = lpRect.left + ((infoPtr->uThumbLen - cyChannel + 2) / 2);
289 else
290 channel->left = lpRect.left + (infoPtr->uThumbLen / 2) - 1;
291 if (infoPtr->dwStyle & TBS_BOTH) {
292 if (infoPtr->dwStyle & TBS_NOTICKS)
293 channel->left += 1;
294 else
295 channel->left += 9;
296 }
297 else if (infoPtr->dwStyle & TBS_TOP) {
298 if (infoPtr->dwStyle & TBS_NOTICKS)
299 channel->left += 2;
300 else
301 channel->left += 10;
302 }
303 channel->right = channel->left + cyChannel;
304 } else {
305 channel->left = lpRect.left + offsetedge;
306 channel->right = lpRect.right - offsetedge;
307 if (infoPtr->dwStyle & TBS_ENABLESELRANGE)
308 channel->top = lpRect.top + ((infoPtr->uThumbLen - cyChannel + 2) / 2);
309 else
310 channel->top = lpRect.top + (infoPtr->uThumbLen / 2) - 1;
311 if (infoPtr->dwStyle & TBS_BOTH) {
312 if (infoPtr->dwStyle & TBS_NOTICKS)
313 channel->top += 1;
314 else
315 channel->top += 9;
316 }
317 else if (infoPtr->dwStyle & TBS_TOP) {
318 if (infoPtr->dwStyle & TBS_NOTICKS)
319 channel->top += 2;
320 else
321 channel->top += 10;
322 }
323 channel->bottom = channel->top + cyChannel;
324 }
325}
#define TBS_BOTH
Definition: commctrl.h:2022
#define TBS_ENABLESELRANGE
Definition: commctrl.h:2024
#define TBS_NOTICKS
Definition: commctrl.h:2023
#define TBS_TOP
Definition: commctrl.h:2018
UINT uThumbLen
Definition: trackbar.c:54
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)

Referenced by TRACKBAR_InitializeThumb(), TRACKBAR_Refresh(), and TRACKBAR_Size().

◆ TRACKBAR_CalcSelection()

static void TRACKBAR_CalcSelection ( TRACKBAR_INFO infoPtr)
static

Definition at line 404 of file trackbar.c.

405{
406 RECT *selection = &infoPtr->rcSelection;
407 int range = infoPtr->lRangeMax - infoPtr->lRangeMin;
408 int offsetthumb, height, width;
409
410 if (range <= 0) {
412 } else {
413 if (infoPtr->dwStyle & TBS_VERT) {
414 offsetthumb = (infoPtr->rcThumb.bottom - infoPtr->rcThumb.top)/2;
415 height = infoPtr->rcChannel.bottom - infoPtr->rcChannel.top - offsetthumb*2;
416 selection->top = infoPtr->rcChannel.top + offsetthumb +
417 (height*infoPtr->lSelMin)/range;
418 selection->bottom = infoPtr->rcChannel.top + offsetthumb +
419 (height*infoPtr->lSelMax)/range;
420 selection->left = infoPtr->rcChannel.left + 3;
421 selection->right = infoPtr->rcChannel.right - 3;
422 } else {
423 offsetthumb = (infoPtr->rcThumb.right - infoPtr->rcThumb.left)/2;
424 width = infoPtr->rcChannel.right - infoPtr->rcChannel.left - offsetthumb*2;
425 selection->left = infoPtr->rcChannel.left + offsetthumb +
426 (width*infoPtr->lSelMin)/range;
427 selection->right = infoPtr->rcChannel.left + offsetthumb +
428 (width*infoPtr->lSelMax)/range;
429 selection->top = infoPtr->rcChannel.top + 3;
430 selection->bottom = infoPtr->rcChannel.bottom - 3;
431 }
432 }
433
434 TRACE("selection[%s]\n", wine_dbgstr_rect(selection));
435}
static const char * wine_dbgstr_rect(const RECT *prc)
Definition: atltest.h:160
int selection
Definition: ctm.c:92
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLint GLint GLsizei width
Definition: gl.h:1546
GLenum GLint * range
Definition: glext.h:7539
LONG lSelMin
Definition: trackbar.c:51
RECT rcThumb
Definition: trackbar.c:67
LONG lRangeMax
Definition: trackbar.c:48
LONG lSelMax
Definition: trackbar.c:52
LONG lRangeMin
Definition: trackbar.c:47
RECT rcSelection
Definition: trackbar.c:66
BOOL WINAPI SetRectEmpty(_Out_ LPRECT)

Referenced by TRACKBAR_Refresh().

◆ TRACKBAR_CalcThumb()

static void TRACKBAR_CalcThumb ( const TRACKBAR_INFO infoPtr,
LONG  lPos,
RECT thumb 
)
static

Definition at line 328 of file trackbar.c.

329{
330 int range, width, height, thumbwidth;
331 RECT lpRect;
332
333 range = infoPtr->lRangeMax - infoPtr->lRangeMin;
334 thumbwidth = (infoPtr->uThumbLen / 2) | 1;
335
336 if (!range) range = 1;
337
338 GetClientRect(infoPtr->hwndSelf, &lpRect);
339 if (infoPtr->dwStyle & TBS_VERT)
340 {
341 height = infoPtr->rcChannel.bottom - infoPtr->rcChannel.top - thumbwidth;
342
343 if ((infoPtr->dwStyle & (TBS_BOTH | TBS_LEFT)) && !(infoPtr->dwStyle & TBS_NOTICKS))
344 thumb->left = 10;
345 else
346 thumb->left = 2;
347 thumb->right = thumb->left + infoPtr->uThumbLen;
348 thumb->top = infoPtr->rcChannel.top +
349 (height*(lPos - infoPtr->lRangeMin))/range;
350 thumb->bottom = thumb->top + thumbwidth;
351 }
352 else
353 {
354 width = infoPtr->rcChannel.right - infoPtr->rcChannel.left - thumbwidth;
355
356 thumb->left = infoPtr->rcChannel.left +
357 (width*(lPos - infoPtr->lRangeMin))/range;
358 thumb->right = thumb->left + thumbwidth;
359 if ((infoPtr->dwStyle & (TBS_BOTH | TBS_TOP)) && !(infoPtr->dwStyle & TBS_NOTICKS))
360 thumb->top = 10;
361 else
362 thumb->top = 2;
363 thumb->bottom = thumb->top + infoPtr->uThumbLen;
364 }
365}
#define TBS_LEFT
Definition: commctrl.h:2020

Referenced by TRACKBAR_InvalidateThumb(), and TRACKBAR_UpdateThumb().

◆ TRACKBAR_CaptureChanged()

static LRESULT TRACKBAR_CaptureChanged ( const TRACKBAR_INFO infoPtr)
static

Definition at line 1627 of file trackbar.c.

1628{
1630 return 0;
1631}
static void notify_with_scroll(const TRACKBAR_INFO *infoPtr, UINT code)
Definition: trackbar.c:129
#define TB_ENDTRACK
Definition: commctrl.h:2081

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_ClearSel()

static LRESULT TRACKBAR_ClearSel ( TRACKBAR_INFO infoPtr,
BOOL  fRedraw 
)
static

Definition at line 1075 of file trackbar.c.

1076{
1077 infoPtr->lSelMin = 0;
1078 infoPtr->lSelMax = 0;
1079 infoPtr->flags |= TB_SELECTIONCHANGED;
1080
1081 if (fRedraw) TRACKBAR_InvalidateAll(infoPtr);
1082
1083 return 0;
1084}
#define TB_SELECTIONCHANGED
Definition: trackbar.c:84
static void TRACKBAR_InvalidateAll(const TRACKBAR_INFO *infoPtr)
Definition: trackbar.c:374

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_ClearTics()

static LRESULT TRACKBAR_ClearTics ( TRACKBAR_INFO infoPtr,
BOOL  fRedraw 
)
static

Definition at line 1088 of file trackbar.c.

1089{
1090 if (infoPtr->tics) {
1091 Free (infoPtr->tics);
1092 infoPtr->tics = NULL;
1093 infoPtr->uNumTics = 0;
1094 }
1095
1096 if (fRedraw) TRACKBAR_InvalidateAll(infoPtr);
1097
1098 return 0;
1099}
#define NULL
Definition: types.h:112
LPLONG tics
Definition: trackbar.c:68
UINT uNumTics
Definition: trackbar.c:55
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION Free
Definition: exfuncs.h:815

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_ConvertPlaceToPosition()

static LONG TRACKBAR_ConvertPlaceToPosition ( const TRACKBAR_INFO infoPtr,
int  place 
)
inlinestatic

Definition at line 176 of file trackbar.c.

177{
178 double range, width, pos, offsetthumb;
179
180 range = infoPtr->lRangeMax - infoPtr->lRangeMin;
181 if (infoPtr->dwStyle & TBS_VERT) {
182 offsetthumb = (infoPtr->rcThumb.bottom - infoPtr->rcThumb.top)/2;
183 width = infoPtr->rcChannel.bottom - infoPtr->rcChannel.top - (offsetthumb * 2) - 1;
184 pos = (range*(place - infoPtr->rcChannel.top - offsetthumb)) / width;
185 } else {
186 offsetthumb = (infoPtr->rcThumb.right - infoPtr->rcThumb.left)/2;
187 width = infoPtr->rcChannel.right - infoPtr->rcChannel.left - (offsetthumb * 2) - 1;
188 pos = (range*(place - infoPtr->rcChannel.left - offsetthumb)) / width;
189 }
190 pos += infoPtr->lRangeMin;
191 if (pos > infoPtr->lRangeMax)
192 pos = infoPtr->lRangeMax;
193 else if (pos < infoPtr->lRangeMin)
194 pos = infoPtr->lRangeMin;
195
196 TRACE("%.2f\n", pos);
197 return (LONG)floor(pos + 0.5);
198}
_Check_return_ _CRTIMP double __cdecl floor(_In_ double x)
static char * place
Definition: getopt.c:55

Referenced by TRACKBAR_GetAutoPageDirection(), and TRACKBAR_MouseMove().

◆ TRACKBAR_Create()

static LRESULT TRACKBAR_Create ( HWND  hwnd,
const CREATESTRUCTW lpcs 
)
static

Definition at line 1491 of file trackbar.c.

1492{
1493 TRACKBAR_INFO *infoPtr;
1494
1495 infoPtr = Alloc (sizeof(TRACKBAR_INFO));
1496 if (!infoPtr) return -1;
1497 SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr);
1498
1499 /* set default values */
1500 infoPtr->hwndSelf = hwnd;
1501 infoPtr->dwStyle = lpcs->style;
1502 infoPtr->lRangeMin = 0;
1503 infoPtr->lRangeMax = 100;
1504 infoPtr->lLineSize = 1;
1505 infoPtr->lPageSize = TB_DEFAULTPAGESIZE;
1506 infoPtr->lSelMin = 0;
1507 infoPtr->lSelMax = 0;
1508 infoPtr->lPos = 0;
1509 infoPtr->fLocation = TBTS_TOP;
1510 infoPtr->uNumTics = 0; /* start and end tic are not included in count*/
1511 infoPtr->uTicFreq = 1;
1512 infoPtr->tics = NULL;
1513 infoPtr->hwndNotify= lpcs->hwndParent;
1514
1515 TRACKBAR_InitializeThumb (infoPtr);
1516
1517 /* Create tooltip control */
1518 if (infoPtr->dwStyle & TBS_TOOLTIPS) {
1519
1520 infoPtr->hwndToolTip =
1524 hwnd, 0, 0, 0);
1525
1526 if (infoPtr->hwndToolTip) {
1527 TTTOOLINFOW ti;
1528 WCHAR wEmpty = 0;
1529 ZeroMemory (&ti, sizeof(ti));
1530 ti.cbSize = sizeof(ti);
1532 ti.hwnd = hwnd;
1533 ti.lpszText = &wEmpty;
1534
1535 SendMessageW (infoPtr->hwndToolTip, TTM_ADDTOOLW, 0, (LPARAM)&ti);
1536 }
1537 }
1538
1540
1541 return 0;
1542}
PVOID Alloc(IN DWORD dwFlags, IN SIZE_T dwBytes)
Definition: main.c:63
static LRESULT TRACKBAR_InitializeThumb(TRACKBAR_INFO *infoPtr)
Definition: trackbar.c:1464
#define TB_DEFAULTPAGESIZE
Definition: trackbar.c:76
#define WS_POPUP
Definition: pedump.c:616
#define TBS_TOOLTIPS
Definition: commctrl.h:2027
#define TOOLTIPS_CLASSW
Definition: commctrl.h:1707
#define TTF_IDISHWND
Definition: commctrl.h:1764
#define TTM_ADDTOOLW
Definition: commctrl.h:1787
#define TTF_ABSOLUTE
Definition: commctrl.h:1769
#define TBTS_TOP
Definition: commctrl.h:2063
#define TTF_TRACK
Definition: commctrl.h:1768
LONG lLineSize
Definition: trackbar.c:49
LONG lPageSize
Definition: trackbar.c:50
INT fLocation
Definition: trackbar.c:61
UINT uTicFreq
Definition: trackbar.c:56
LPWSTR lpszText
Definition: commctrl.h:1746
uint32_t DWORD_PTR
Definition: typedefs.h:65
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
HWND WINAPI CreateWindowExW(_In_ DWORD dwExStyle, _In_opt_ LPCWSTR lpClassName, _In_opt_ LPCWSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
#define CW_USEDEFAULT
Definition: winuser.h:225
#define SetWindowLongPtrW
Definition: winuser.h:5346
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_Destroy()

static LRESULT TRACKBAR_Destroy ( TRACKBAR_INFO infoPtr)
static

Definition at line 1546 of file trackbar.c.

1547{
1548 /* delete tooltip control */
1549 if (infoPtr->hwndToolTip)
1550 DestroyWindow (infoPtr->hwndToolTip);
1551
1552 Free (infoPtr->tics);
1553 infoPtr->tics = NULL;
1554
1555 SetWindowLongPtrW (infoPtr->hwndSelf, 0, 0);
1557 Free (infoPtr);
1558
1559 return 0;
1560}
BOOL WINAPI DestroyWindow(_In_ HWND)

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_DrawChannel()

static void TRACKBAR_DrawChannel ( const TRACKBAR_INFO infoPtr,
HDC  hdc 
)
static

Definition at line 460 of file trackbar.c.

461{
462 RECT rcChannel = infoPtr->rcChannel;
463 HTHEME theme = GetWindowTheme (infoPtr->hwndSelf);
464
465 if (theme)
466 {
467 DrawThemeBackground (theme, hdc,
468 (infoPtr->dwStyle & TBS_VERT) ?
469 TKP_TRACKVERT : TKP_TRACK, TKS_NORMAL, &rcChannel, 0);
470 }
471 else
472 {
473 DrawEdge (hdc, &rcChannel, EDGE_SUNKEN, BF_RECT | BF_ADJUST);
474 if (infoPtr->dwStyle & TBS_ENABLESELRANGE) { /* fill the channel */
475 FillRect (hdc, &rcChannel, GetStockObject(WHITE_BRUSH));
476 if (TRACKBAR_HasSelection(infoPtr))
478 }
479 }
480}
static BOOL TRACKBAR_HasSelection(const TRACKBAR_INFO *infoPtr)
Definition: trackbar.c:398
HRESULT WINAPI DrawThemeBackground(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, const RECT *pClipRect)
Definition: draw.c:128
HDC hdc
Definition: main.c:9
@ TKS_NORMAL
Definition: vsstyle.h:1491
@ TKP_TRACK
Definition: vsstyle.h:1476
@ TKP_TRACKVERT
Definition: vsstyle.h:1477
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define WHITE_BRUSH
Definition: wingdi.h:902
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
#define EDGE_SUNKEN
Definition: winuser.h:451
#define COLOR_HIGHLIGHT
Definition: winuser.h:926
HBRUSH WINAPI GetSysColorBrush(_In_ int)
#define BF_ADJUST
Definition: winuser.h:470
BOOL WINAPI DrawEdge(_In_ HDC, _Inout_ LPRECT, _In_ UINT, _In_ UINT)
#define BF_RECT
Definition: winuser.h:462

Referenced by TRACKBAR_Refresh().

◆ TRACKBAR_DrawOneTic()

static void TRACKBAR_DrawOneTic ( const TRACKBAR_INFO infoPtr,
HDC  hdc,
LONG  ticPos,
int  flags 
)
static

Definition at line 483 of file trackbar.c.

484{
485 int x, y, ox, oy, range, side, indent = 0, len = 3;
486 int offsetthumb;
487 RECT rcTics;
488
489 if (flags & TBS_VERT) {
490 offsetthumb = (infoPtr->rcThumb.bottom - infoPtr->rcThumb.top)/2;
491 SetRect(&rcTics, infoPtr->rcThumb.left - 2, infoPtr->rcChannel.top + offsetthumb,
492 infoPtr->rcThumb.right + 2, infoPtr->rcChannel.bottom - offsetthumb - 1);
493 } else {
494 offsetthumb = (infoPtr->rcThumb.right - infoPtr->rcThumb.left)/2;
495 SetRect(&rcTics, infoPtr->rcChannel.left + offsetthumb, infoPtr->rcThumb.top - 2,
496 infoPtr->rcChannel.right - offsetthumb - 1, infoPtr->rcThumb.bottom + 2);
497 }
498
499 if (flags & (TBS_TOP | TBS_LEFT)) {
500 x = rcTics.left;
501 y = rcTics.top;
502 side = -1;
503 } else {
504 x = rcTics.right;
505 y = rcTics.bottom;
506 side = 1;
507 }
508
509 range = infoPtr->lRangeMax - infoPtr->lRangeMin;
510 if (range <= 0)
511 range = 1; /* to avoid division by zero */
512
513 if (flags & TIC_SELECTIONMARK) {
514 indent = (flags & TIC_SELECTIONMARKMIN) ? -1 : 1;
515 } else if (flags & TIC_EDGE) {
516 len++;
517 }
518
519 if (flags & TBS_VERT) {
520 int height = rcTics.bottom - rcTics.top;
521 y = rcTics.top + (height*(ticPos - infoPtr->lRangeMin))/range;
522 } else {
523 int width = rcTics.right - rcTics.left;
524 x = rcTics.left + (width*(ticPos - infoPtr->lRangeMin))/range;
525 }
526
527 ox = x;
528 oy = y;
529 MoveToEx(hdc, x, y, 0);
530 if (flags & TBS_VERT) x += len * side;
531 else y += len * side;
532 LineTo(hdc, x, y);
533
534 if (flags & TIC_SELECTIONMARK) {
535 if (flags & TBS_VERT) {
536 x -= side;
537 } else {
538 y -= side;
539 }
540 MoveToEx(hdc, x, y, 0);
541 if (flags & TBS_VERT) {
542 y += 2 * indent;
543 } else {
544 x += 2 * indent;
545 }
546
547 LineTo(hdc, x, y);
548 LineTo(hdc, ox, oy);
549 }
550}
#define TIC_SELECTIONMARK
Definition: trackbar.c:95
#define TIC_EDGE
Definition: trackbar.c:92
#define TIC_SELECTIONMARKMIN
Definition: trackbar.c:94
static const WCHAR indent[]
Definition: object.c:1156
GLbitfield flags
Definition: glext.h:7161
GLenum GLsizei len
Definition: glext.h:6722
BOOL WINAPI MoveToEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPPOINT)
BOOL WINAPI LineTo(_In_ HDC, _In_ int, _In_ int)
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)

Referenced by TRACKBAR_DrawTic().

◆ TRACKBAR_DrawThumb()

static void TRACKBAR_DrawThumb ( TRACKBAR_INFO infoPtr,
HDC  hdc 
)
static

Definition at line 694 of file trackbar.c.

695{
696 HTHEME theme = GetWindowTheme (infoPtr->hwndSelf);
697 int PointDepth;
698 HBRUSH brush;
699
700 if (theme)
701 {
702 int partId;
703 int stateId;
704 if (infoPtr->dwStyle & TBS_BOTH)
705 partId = (infoPtr->dwStyle & TBS_VERT) ? TKP_THUMBVERT : TKP_THUMB;
706 else if (infoPtr->dwStyle & TBS_LEFT)
707 partId = (infoPtr->dwStyle & TBS_VERT) ? TKP_THUMBLEFT : TKP_THUMBTOP;
708 else
709 partId = (infoPtr->dwStyle & TBS_VERT) ? TKP_THUMBRIGHT : TKP_THUMBBOTTOM;
710
711 if (infoPtr->dwStyle & WS_DISABLED)
712 stateId = TUS_DISABLED;
713 else if (infoPtr->flags & TB_DRAG_MODE)
714 stateId = TUS_PRESSED;
715 else if (infoPtr->flags & TB_THUMB_HOT)
716 stateId = TUS_HOT;
717 else
718 stateId = TUS_NORMAL;
719
720 DrawThemeBackground (theme, hdc, partId, stateId, &infoPtr->rcThumb, NULL);
721
722 return;
723 }
724
725 if (infoPtr->dwStyle & WS_DISABLED || infoPtr->flags & TB_DRAG_MODE)
726 {
729 else
731
734 }
735 else
737
738 PointDepth = TRACKBAR_FillThumb(infoPtr, hdc, brush);
739
740 if (infoPtr->dwStyle & TBS_BOTH)
741 {
743 return;
744 }
745 else
746 {
747 RECT thumb = infoPtr->rcThumb;
748
749 if (infoPtr->dwStyle & TBS_VERT)
750 {
751 if (infoPtr->dwStyle & TBS_LEFT)
752 {
753 /* rectangular part */
754 thumb.left += PointDepth;
756
757 /* light edge */
758 thumb.left -= PointDepth;
759 thumb.right = thumb.left + PointDepth;
760 thumb.bottom = infoPtr->rcThumb.top + PointDepth + 1;
761 thumb.top = infoPtr->rcThumb.top;
763
764 /* shadowed edge */
765 thumb.top += PointDepth;
766 thumb.bottom += PointDepth;
768 return;
769 }
770 else
771 {
772 /* rectangular part */
773 thumb.right -= PointDepth;
775
776 /* light edge */
777 thumb.left = thumb.right;
778 thumb.right += PointDepth + 1;
779 thumb.bottom = infoPtr->rcThumb.top + PointDepth + 1;
780 thumb.top = infoPtr->rcThumb.top;
782
783 /* shadowed edge */
784 thumb.top += PointDepth;
785 thumb.bottom += PointDepth;
787 }
788 }
789 else
790 {
791 if (infoPtr->dwStyle & TBS_TOP)
792 {
793 /* rectangular part */
794 thumb.top += PointDepth;
796
797 /* light edge */
798 thumb.left = infoPtr->rcThumb.left;
799 thumb.right = thumb.left + PointDepth;
800 thumb.bottom = infoPtr->rcThumb.top + PointDepth + 1;
801 thumb.top -= PointDepth;
803
804 /* shadowed edge */
805 thumb.left += PointDepth;
806 thumb.right += PointDepth;
808 }
809 else
810 {
811 /* rectangular part */
812 thumb.bottom -= PointDepth;
814
815 /* light edge */
816 thumb.left = infoPtr->rcThumb.left;
817 thumb.right = thumb.left + PointDepth;
818 thumb.top = infoPtr->rcThumb.bottom - PointDepth - 1;
819 thumb.bottom += PointDepth;
821
822 /* shadowed edge */
823 thumb.left += PointDepth;
824 thumb.right += PointDepth;
826 }
827 }
828 }
829}
COMCTL32_SysColor comctl32_color
Definition: commctrl.c:82
HBRUSH COMCTL32_hPattern55AABrush
Definition: commctrl.c:81
#define TB_THUMB_HOT
Definition: trackbar.c:89
#define TB_DRAG_MODE
Definition: trackbar.c:85
static int TRACKBAR_FillThumb(const TRACKBAR_INFO *infoPtr, HDC hdc, HBRUSH hbrush)
Definition: trackbar.c:603
#define WS_DISABLED
Definition: pedump.c:621
COLORREF clrWindow
Definition: comctl32.h:176
COLORREF clr3dFace
Definition: comctl32.h:175
COLORREF clr3dHilight
Definition: comctl32.h:172
@ TKP_THUMBBOTTOM
Definition: vsstyle.h:1479
@ TKP_THUMB
Definition: vsstyle.h:1478
@ TKP_THUMBRIGHT
Definition: vsstyle.h:1483
@ TKP_THUMBLEFT
Definition: vsstyle.h:1482
@ TKP_THUMBTOP
Definition: vsstyle.h:1480
@ TKP_THUMBVERT
Definition: vsstyle.h:1481
@ TUS_HOT
Definition: vsstyle.h:1504
@ TUS_DISABLED
Definition: vsstyle.h:1507
@ TUS_PRESSED
Definition: vsstyle.h:1505
@ TUS_NORMAL
Definition: vsstyle.h:1503
COLORREF WINAPI SetBkColor(_In_ HDC, _In_ COLORREF)
Definition: dc.c:999
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
Definition: text.c:918
#define COLOR_SCROLLBAR
Definition: winuser.h:912
#define BF_LEFT
Definition: winuser.h:454
#define BF_DIAGONAL_ENDTOPRIGHT
Definition: winuser.h:464
#define BF_BOTTOM
Definition: winuser.h:457
#define BF_TOP
Definition: winuser.h:455
#define BF_RIGHT
Definition: winuser.h:456
#define BF_DIAGONAL_ENDBOTTOMLEFT
Definition: winuser.h:466
#define BF_DIAGONAL_ENDBOTTOMRIGHT
Definition: winuser.h:467
#define BF_SOFT
Definition: winuser.h:469
#define EDGE_RAISED
Definition: winuser.h:450
#define BF_DIAGONAL_ENDTOPLEFT
Definition: winuser.h:465
#define COLOR_BTNFACE
Definition: winuser.h:928

Referenced by TRACKBAR_Refresh().

◆ TRACKBAR_DrawTic()

static void TRACKBAR_DrawTic ( const TRACKBAR_INFO infoPtr,
HDC  hdc,
LONG  ticPos,
int  flags 
)
inlinestatic

Definition at line 554 of file trackbar.c.

555{
556 if ((flags & (TBS_LEFT | TBS_TOP)) || (flags & TBS_BOTH))
557 TRACKBAR_DrawOneTic (infoPtr, hdc, ticPos, flags | TBS_LEFT);
558
559 if (!(flags & (TBS_LEFT | TBS_TOP)) || (flags & TBS_BOTH))
560 TRACKBAR_DrawOneTic (infoPtr, hdc, ticPos, flags & ~TBS_LEFT);
561}
static void TRACKBAR_DrawOneTic(const TRACKBAR_INFO *infoPtr, HDC hdc, LONG ticPos, int flags)
Definition: trackbar.c:483

Referenced by TRACKBAR_DrawTics().

◆ TRACKBAR_DrawTics()

static void TRACKBAR_DrawTics ( const TRACKBAR_INFO infoPtr,
HDC  hdc 
)
static

Definition at line 564 of file trackbar.c.

565{
566 unsigned int i;
567 int ticFlags = infoPtr->dwStyle & 0x0f;
568 LOGPEN ticPen = { PS_SOLID, {1, 0}, GetSysColor (COLOR_3DDKSHADOW) };
569 HPEN hOldPen, hTicPen;
570 HTHEME theme = GetWindowTheme (infoPtr->hwndSelf);
571
572 if (theme)
573 {
574 int part = (infoPtr->dwStyle & TBS_VERT) ? TKP_TICSVERT : TKP_TICS;
575 GetThemeColor (theme, part, TSS_NORMAL, TMT_COLOR, &ticPen.lopnColor);
576 }
577 /* create the pen to draw the tics with */
578 hTicPen = CreatePenIndirect(&ticPen);
579 hOldPen = hTicPen ? SelectObject(hdc, hTicPen) : 0;
580
581 /* actually draw the tics */
582 for (i=0; i<infoPtr->uNumTics; i++)
583 TRACKBAR_DrawTic (infoPtr, hdc, infoPtr->tics[i], ticFlags);
584
585 TRACKBAR_DrawTic (infoPtr, hdc, infoPtr->lRangeMin, ticFlags | TIC_EDGE);
586 TRACKBAR_DrawTic (infoPtr, hdc, infoPtr->lRangeMax, ticFlags | TIC_EDGE);
587
588 if ((infoPtr->dwStyle & TBS_ENABLESELRANGE) && TRACKBAR_HasSelection(infoPtr)) {
589 TRACKBAR_DrawTic (infoPtr, hdc, infoPtr->lSelMin,
590 ticFlags | TIC_SELECTIONMARKMIN);
591 TRACKBAR_DrawTic (infoPtr, hdc, infoPtr->lSelMax,
592 ticFlags | TIC_SELECTIONMARKMAX);
593 }
594
595 /* clean up the pen, if we created one */
596 if (hTicPen) {
597 SelectObject(hdc, hOldPen);
598 DeleteObject(hTicPen);
599 }
600}
static void TRACKBAR_DrawTic(const TRACKBAR_INFO *infoPtr, HDC hdc, LONG ticPos, int flags)
Definition: trackbar.c:554
#define TIC_SELECTIONMARKMAX
Definition: trackbar.c:93
HRESULT WINAPI GetThemeColor(HTHEME hTheme, int iPartId, int iStateId, int iPropId, COLORREF *pColor)
Definition: property.c:45
pKey DeleteObject()
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
COLORREF lopnColor
Definition: wingdi.h:1847
@ TSS_NORMAL
Definition: vsstyle.h:1551
@ TKP_TICSVERT
Definition: vsstyle.h:1485
@ TKP_TICS
Definition: vsstyle.h:1484
#define TMT_COLOR
Definition: vssym32.h:138
HPEN WINAPI CreatePenIndirect(_In_ const LOGPEN *)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1539
#define PS_SOLID
Definition: wingdi.h:586
DWORD WINAPI GetSysColor(_In_ int)
#define COLOR_3DDKSHADOW
Definition: winuser.h:939

Referenced by TRACKBAR_Refresh().

◆ TRACKBAR_Enable()

static LRESULT TRACKBAR_Enable ( TRACKBAR_INFO infoPtr,
BOOL  enable 
)
static

Definition at line 1847 of file trackbar.c.

1848{
1849 if (enable)
1850 infoPtr->dwStyle &= ~WS_DISABLED;
1851 else
1852 infoPtr->dwStyle |= WS_DISABLED;
1853
1854 InvalidateRect(infoPtr->hwndSelf, &infoPtr->rcThumb, TRUE);
1855
1856 return 1;
1857}
GLboolean enable
Definition: glext.h:11120
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_FillThumb()

static int TRACKBAR_FillThumb ( const TRACKBAR_INFO infoPtr,
HDC  hdc,
HBRUSH  hbrush 
)
static

Definition at line 603 of file trackbar.c.

604{
605 const RECT *thumb = &infoPtr->rcThumb;
606 POINT points[6];
607 int PointDepth;
608 HBRUSH oldbr;
609
610 if (infoPtr->dwStyle & TBS_BOTH)
611 {
612 FillRect(hdc, thumb, hbrush);
613 return 0;
614 }
615
616 if (infoPtr->dwStyle & TBS_VERT)
617 {
618 PointDepth = (thumb->bottom - thumb->top) / 2;
619 if (infoPtr->dwStyle & TBS_LEFT)
620 {
621 points[0].x = thumb->right-1;
622 points[0].y = thumb->top;
623 points[1].x = thumb->right-1;
624 points[1].y = thumb->bottom-1;
625 points[2].x = thumb->left + PointDepth;
626 points[2].y = thumb->bottom-1;
627 points[3].x = thumb->left;
628 points[3].y = thumb->top + PointDepth;
629 points[4].x = thumb->left + PointDepth;
630 points[4].y = thumb->top;
631 points[5].x = points[0].x;
632 points[5].y = points[0].y;
633 }
634 else
635 {
636 points[0].x = thumb->right;
637 points[0].y = thumb->top + PointDepth;
638 points[1].x = thumb->right - PointDepth;
639 points[1].y = thumb->bottom-1;
640 points[2].x = thumb->left;
641 points[2].y = thumb->bottom-1;
642 points[3].x = thumb->left;
643 points[3].y = thumb->top;
644 points[4].x = thumb->right - PointDepth;
645 points[4].y = thumb->top;
646 points[5].x = points[0].x;
647 points[5].y = points[0].y;
648 }
649 }
650 else
651 {
652 PointDepth = (thumb->right - thumb->left) / 2;
653 if (infoPtr->dwStyle & TBS_TOP)
654 {
655 points[0].x = thumb->left + PointDepth;
656 points[0].y = thumb->top+1;
657 points[1].x = thumb->right-1;
658 points[1].y = thumb->top + PointDepth + 1;
659 points[2].x = thumb->right-1;
660 points[2].y = thumb->bottom-1;
661 points[3].x = thumb->left;
662 points[3].y = thumb->bottom-1;
663 points[4].x = thumb->left;
664 points[4].y = thumb->top + PointDepth + 1;
665 points[5].x = points[0].x;
666 points[5].y = points[0].y;
667 }
668 else
669 {
670 points[0].x = thumb->right-1;
671 points[0].y = thumb->top;
672 points[1].x = thumb->right-1;
673 points[1].y = thumb->bottom - PointDepth - 1;
674 points[2].x = thumb->left + PointDepth;
675 points[2].y = thumb->bottom-1;
676 points[3].x = thumb->left;
677 points[3].y = thumb->bottom - PointDepth - 1;
678 points[4].x = thumb->left;
679 points[4].y = thumb->top;
680 points[5].x = points[0].x;
681 points[5].y = points[0].y;
682 }
683 }
684
685 oldbr = SelectObject(hdc, hbrush);
688 SelectObject(hdc, oldbr);
689
690 return PointDepth;
691}
static HBRUSH hbrush
#define WINDING
Definition: constants.h:279
#define ARRAY_SIZE(A)
Definition: main.h:33
GLsizei const GLfloat * points
Definition: glext.h:8112
BOOL Polygon(CONST PPOINT UnsafePoints, int Count, int polyFillMode)
Definition: polytest.cpp:730
int WINAPI SetPolyFillMode(_In_ HDC, _In_ int)
Definition: dc.c:1167

Referenced by TRACKBAR_DrawThumb().

◆ TRACKBAR_GetAutoPageDirection()

static LONG TRACKBAR_GetAutoPageDirection ( const TRACKBAR_INFO infoPtr,
POINT  clickPoint 
)
static

Definition at line 203 of file trackbar.c.

204{
205 RECT pageRect;
206
207 if (infoPtr->dwStyle & TBS_VERT) {
208 pageRect.top = infoPtr->rcChannel.top;
209 pageRect.bottom = infoPtr->rcChannel.bottom;
210 pageRect.left = infoPtr->rcThumb.left;
211 pageRect.right = infoPtr->rcThumb.right;
212 } else {
213 pageRect.top = infoPtr->rcThumb.top;
214 pageRect.bottom = infoPtr->rcThumb.bottom;
215 pageRect.left = infoPtr->rcChannel.left;
216 pageRect.right = infoPtr->rcChannel.right;
217 }
218
219
220 if (PtInRect(&pageRect, clickPoint))
221 {
222 int clickPlace = (infoPtr->dwStyle & TBS_VERT) ? clickPoint.y : clickPoint.x;
223
224 LONG clickPos = TRACKBAR_ConvertPlaceToPosition(infoPtr, clickPlace);
225
226 return clickPos - infoPtr->lPos;
227 }
228
229 return 0;
230}
static LONG TRACKBAR_ConvertPlaceToPosition(const TRACKBAR_INFO *infoPtr, int place)
Definition: trackbar.c:176
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
BOOL WINAPI PtInRect(_In_ LPCRECT, _In_ POINT)

Referenced by TRACKBAR_AutoPage(), and TRACKBAR_LButtonDown().

◆ TRACKBAR_GetChannelRect()

static LRESULT TRACKBAR_GetChannelRect ( const TRACKBAR_INFO infoPtr,
LPRECT  lprc 
)
inlinestatic

Definition at line 1103 of file trackbar.c.

1104{
1105 if (lprc == NULL) return 0;
1106
1107 lprc->left = infoPtr->rcChannel.left;
1108 lprc->right = infoPtr->rcChannel.right;
1109 lprc->bottom = infoPtr->rcChannel.bottom;
1110 lprc->top = infoPtr->rcChannel.top;
1111
1112 return 0;
1113}
_In_ int _Inout_ LPRECT lprc
Definition: winuser.h:4466

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_GetNumTics()

static LONG TRACKBAR_GetNumTics ( const TRACKBAR_INFO infoPtr)
inlinestatic

Definition at line 1117 of file trackbar.c.

1118{
1119 if (infoPtr->dwStyle & TBS_NOTICKS) return 0;
1120
1121 return infoPtr->uNumTics + 2;
1122}

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_GetTic()

static LONG TRACKBAR_GetTic ( const TRACKBAR_INFO infoPtr,
INT  iTic 
)
inlinestatic

Definition at line 1138 of file trackbar.c.

1139{
1140 if ((iTic < 0) || (iTic >= infoPtr->uNumTics) || !infoPtr->tics)
1141 return -1;
1142
1143 qsort(infoPtr->tics, infoPtr->uNumTics, sizeof(DWORD), comp_tics);
1144 return infoPtr->tics[iTic];
1145}
static int comp_tics(const void *ap, const void *bp)
Definition: trackbar.c:1125
void __cdecl qsort(_Inout_updates_bytes_(_NumOfElements *_SizeOfElements) void *_Base, _In_ size_t _NumOfElements, _In_ size_t _SizeOfElements, _In_ int(__cdecl *_PtFuncCompare)(const void *, const void *))

Referenced by TRACKBAR_GetTicPos(), and TRACKBAR_WindowProc().

◆ TRACKBAR_GetTicPos()

static LONG TRACKBAR_GetTicPos ( const TRACKBAR_INFO infoPtr,
INT  iTic 
)
inlinestatic

Definition at line 1149 of file trackbar.c.

1150{
1151 LONG range, width, pos, tic;
1152 int offsetthumb;
1153
1154 if ((iTic < 0) || (iTic >= infoPtr->uNumTics) || !infoPtr->tics)
1155 return -1;
1156
1157 tic = TRACKBAR_GetTic (infoPtr, iTic);
1158 range = infoPtr->lRangeMax - infoPtr->lRangeMin;
1159 if (range <= 0) range = 1;
1160 offsetthumb = (infoPtr->rcThumb.right - infoPtr->rcThumb.left)/2;
1161 width = infoPtr->rcChannel.right - infoPtr->rcChannel.left - offsetthumb*2;
1162 pos = infoPtr->rcChannel.left + offsetthumb + (width * tic) / range;
1163
1164 return pos;
1165}
static LONG TRACKBAR_GetTic(const TRACKBAR_INFO *infoPtr, INT iTic)
Definition: trackbar.c:1138

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_HasSelection()

static BOOL TRACKBAR_HasSelection ( const TRACKBAR_INFO infoPtr)
inlinestatic

Definition at line 398 of file trackbar.c.

399{
400 return infoPtr->lSelMin != infoPtr->lSelMax;
401}

Referenced by TRACKBAR_DrawChannel(), and TRACKBAR_DrawTics().

◆ TRACKBAR_InitializeThumb()

static LRESULT TRACKBAR_InitializeThumb ( TRACKBAR_INFO infoPtr)
static

Definition at line 1464 of file trackbar.c.

1465{
1466 RECT rect;
1467 int clientWidth, clientMetric;
1468
1469 /* initial thumb length */
1470 clientMetric = (infoPtr->dwStyle & TBS_ENABLESELRANGE) ? 23 : 21;
1471 GetClientRect(infoPtr->hwndSelf,&rect);
1472 if (infoPtr->dwStyle & TBS_VERT) {
1473 clientWidth = rect.right - rect.left;
1474 } else {
1475 clientWidth = rect.bottom - rect.top;
1476 }
1477 if (clientWidth >= clientMetric)
1478 infoPtr->uThumbLen = clientMetric;
1479 else
1480 infoPtr->uThumbLen = clientWidth > 9 ? clientWidth - 6 : 4;
1481
1482 TRACKBAR_CalcChannel (infoPtr);
1483 TRACKBAR_UpdateThumb (infoPtr);
1484 infoPtr->flags &= ~TB_SELECTIONCHANGED;
1485
1486 return 0;
1487}
static void TRACKBAR_CalcChannel(TRACKBAR_INFO *infoPtr)
Definition: trackbar.c:274
& rect
Definition: startmenu.cpp:1413

Referenced by TRACKBAR_Create(), TRACKBAR_Size(), and TRACKBAR_WindowProc().

◆ TRACKBAR_InvalidateAll()

◆ TRACKBAR_InvalidateThumb()

static void TRACKBAR_InvalidateThumb ( const TRACKBAR_INFO infoPtr,
LONG  thumbPos 
)
static

Definition at line 380 of file trackbar.c.

381{
382 RECT rcThumb;
383
384 TRACKBAR_CalcThumb(infoPtr, thumbPos, &rcThumb);
385 InflateRect(&rcThumb, 1, 1);
386 InvalidateRect(infoPtr->hwndSelf, &rcThumb, FALSE);
387}
static void TRACKBAR_CalcThumb(const TRACKBAR_INFO *infoPtr, LONG lPos, RECT *thumb)
Definition: trackbar.c:328
BOOL WINAPI InflateRect(_Inout_ LPRECT, _In_ int, _In_ int)

Referenced by TRACKBAR_InvalidateThumbMove(), TRACKBAR_LButtonDown(), and TRACKBAR_LButtonUp().

◆ TRACKBAR_InvalidateThumbMove()

static void TRACKBAR_InvalidateThumbMove ( const TRACKBAR_INFO infoPtr,
LONG  oldPos,
LONG  newPos 
)
inlinestatic

Definition at line 390 of file trackbar.c.

391{
392 TRACKBAR_InvalidateThumb (infoPtr, oldPos);
393 if (newPos != oldPos)
394 TRACKBAR_InvalidateThumb (infoPtr, newPos);
395}
static void TRACKBAR_InvalidateThumb(const TRACKBAR_INFO *infoPtr, LONG thumbPos)
Definition: trackbar.c:380

Referenced by TRACKBAR_AutoPage(), TRACKBAR_KeyDown(), TRACKBAR_MouseMove(), and TRACKBAR_SetPos().

◆ TRACKBAR_KeyDown()

static BOOL TRACKBAR_KeyDown ( TRACKBAR_INFO infoPtr,
INT  nVirtKey 
)
static

Definition at line 1774 of file trackbar.c.

1775{
1776 BOOL downIsLeft = infoPtr->dwStyle & TBS_DOWNISLEFT;
1777 BOOL vert = infoPtr->dwStyle & TBS_VERT;
1778 LONG pos = infoPtr->lPos;
1779
1780 TRACE("%x\n", nVirtKey);
1781
1782 switch (nVirtKey) {
1783 case VK_UP:
1784 if (!vert && downIsLeft) TRACKBAR_LineDown(infoPtr);
1785 else TRACKBAR_LineUp(infoPtr);
1786 break;
1787 case VK_LEFT:
1788 if (vert && downIsLeft) TRACKBAR_LineDown(infoPtr);
1789 else TRACKBAR_LineUp(infoPtr);
1790 break;
1791 case VK_DOWN:
1792 if (!vert && downIsLeft) TRACKBAR_LineUp(infoPtr);
1793 else TRACKBAR_LineDown(infoPtr);
1794 break;
1795 case VK_RIGHT:
1796 if (vert && downIsLeft) TRACKBAR_LineUp(infoPtr);
1797 else TRACKBAR_LineDown(infoPtr);
1798 break;
1799 case VK_NEXT:
1800 if (!vert && downIsLeft) TRACKBAR_PageUp(infoPtr);
1801 else TRACKBAR_PageDown(infoPtr);
1802 break;
1803 case VK_PRIOR:
1804 if (!vert && downIsLeft) TRACKBAR_PageDown(infoPtr);
1805 else TRACKBAR_PageUp(infoPtr);
1806 break;
1807 case VK_HOME:
1808 if (infoPtr->lPos == infoPtr->lRangeMin) return FALSE;
1809 infoPtr->lPos = infoPtr->lRangeMin;
1810 notify_with_scroll (infoPtr, TB_TOP);
1811 break;
1812 case VK_END:
1813 if (infoPtr->lPos == infoPtr->lRangeMax) return FALSE;
1814 infoPtr->lPos = infoPtr->lRangeMax;
1815 notify_with_scroll (infoPtr, TB_BOTTOM);
1816 break;
1817 }
1818
1819 if (pos != infoPtr->lPos) {
1820 TRACKBAR_UpdateThumb (infoPtr);
1821 TRACKBAR_InvalidateThumbMove (infoPtr, pos, infoPtr->lPos);
1822 }
1823
1824 return TRUE;
1825}
static void TRACKBAR_LineDown(TRACKBAR_INFO *infoPtr)
Definition: trackbar.c:264
static void TRACKBAR_LineUp(TRACKBAR_INFO *infoPtr)
Definition: trackbar.c:255
unsigned int BOOL
Definition: ntddk_ex.h:94
#define TB_TOP
Definition: commctrl.h:2079
#define TB_BOTTOM
Definition: commctrl.h:2080
#define TBS_DOWNISLEFT
Definition: commctrl.h:2029
#define VK_UP
Definition: winuser.h:2225
#define VK_NEXT
Definition: winuser.h:2221
#define VK_END
Definition: winuser.h:2222
#define VK_HOME
Definition: winuser.h:2223
#define VK_LEFT
Definition: winuser.h:2224
#define VK_RIGHT
Definition: winuser.h:2226
#define VK_DOWN
Definition: winuser.h:2227
#define VK_PRIOR
Definition: winuser.h:2220

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_KeyUp()

static BOOL TRACKBAR_KeyUp ( const TRACKBAR_INFO infoPtr,
INT  nVirtKey 
)
inlinestatic

Definition at line 1829 of file trackbar.c.

1830{
1831 switch (nVirtKey) {
1832 case VK_LEFT:
1833 case VK_UP:
1834 case VK_RIGHT:
1835 case VK_DOWN:
1836 case VK_NEXT:
1837 case VK_PRIOR:
1838 case VK_HOME:
1839 case VK_END:
1841 }
1842 return TRUE;
1843}

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_KillFocus()

static LRESULT TRACKBAR_KillFocus ( TRACKBAR_INFO infoPtr)
static

Definition at line 1564 of file trackbar.c.

1565{
1566 TRACE("\n");
1567 infoPtr->bFocussed = FALSE;
1568 TRACKBAR_InvalidateAll(infoPtr);
1569
1570 return 0;
1571}
BOOL bFocussed
Definition: trackbar.c:64

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_LButtonDown()

static LRESULT TRACKBAR_LButtonDown ( TRACKBAR_INFO infoPtr,
INT  x,
INT  y 
)
static

Definition at line 1574 of file trackbar.c.

1575{
1576 POINT clickPoint;
1577
1578 clickPoint.x = x;
1579 clickPoint.y = y;
1580
1581 SetFocus(infoPtr->hwndSelf);
1582
1583 if (PtInRect(&infoPtr->rcThumb, clickPoint)) {
1584 infoPtr->flags |= TB_DRAG_MODE;
1585 SetCapture (infoPtr->hwndSelf);
1586 TRACKBAR_UpdateToolTip (infoPtr);
1587 TRACKBAR_ActivateToolTip (infoPtr, TRUE);
1588 TRACKBAR_InvalidateThumb(infoPtr, infoPtr->lPos);
1589 } else {
1590 LONG dir = TRACKBAR_GetAutoPageDirection(infoPtr, clickPoint);
1591 if (dir == 0) return 0;
1592 infoPtr->flags |= (dir < 0) ? TB_AUTO_PAGE_LEFT : TB_AUTO_PAGE_RIGHT;
1593 TRACKBAR_AutoPage (infoPtr, clickPoint);
1594 SetCapture (infoPtr->hwndSelf);
1596 }
1597
1598 return 0;
1599}
static BOOL TRACKBAR_AutoPage(TRACKBAR_INFO *infoPtr, POINT clickPoint)
Definition: trackbar.c:438
#define TB_REFRESH_TIMER
Definition: trackbar.c:71
#define TB_REFRESH_DELAY
Definition: trackbar.c:72
static void TRACKBAR_ActivateToolTip(const TRACKBAR_INFO *infoPtr, BOOL fShow)
Definition: trackbar.c:833
static void TRACKBAR_UpdateToolTip(const TRACKBAR_INFO *infoPtr)
Definition: trackbar.c:848
HWND WINAPI SetCapture(_In_ HWND hWnd)
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
HWND WINAPI SetFocus(_In_opt_ HWND)

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_LButtonUp()

static LRESULT TRACKBAR_LButtonUp ( TRACKBAR_INFO infoPtr)
static

Definition at line 1603 of file trackbar.c.

1604{
1605 if (infoPtr->flags & TB_DRAG_MODE) {
1606 notify_with_scroll (infoPtr, TB_THUMBPOSITION | (infoPtr->lPos<<16));
1608 infoPtr->flags &= ~TB_DRAG_MODE;
1609 ReleaseCapture ();
1610 notify(infoPtr, NM_RELEASEDCAPTURE);
1612 TRACKBAR_InvalidateThumb(infoPtr, infoPtr->lPos);
1613 }
1614 if (infoPtr->flags & TB_AUTO_PAGE) {
1616 infoPtr->flags &= ~TB_AUTO_PAGE;
1618 ReleaseCapture ();
1619 notify(infoPtr, NM_RELEASEDCAPTURE);
1620 }
1621
1622 return 0;
1623}
#define TB_AUTO_PAGE
Definition: trackbar.c:88
int notify
Definition: msacm.c:1366
#define NM_RELEASEDCAPTURE
Definition: commctrl.h:141
#define TB_THUMBPOSITION
Definition: commctrl.h:2077
BOOL WINAPI ReleaseCapture(void)
Definition: message.c:2890
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_LineDown()

static void TRACKBAR_LineDown ( TRACKBAR_INFO infoPtr)
inlinestatic

Definition at line 264 of file trackbar.c.

265{
266 if (infoPtr->lPos == infoPtr->lRangeMax) return;
267 infoPtr->lPos += infoPtr->lLineSize;
268 if (infoPtr->lPos > infoPtr->lRangeMax)
269 infoPtr->lPos = infoPtr->lRangeMax;
271}
#define TB_LINEDOWN
Definition: commctrl.h:2074

Referenced by TRACKBAR_KeyDown().

◆ TRACKBAR_LineUp()

static void TRACKBAR_LineUp ( TRACKBAR_INFO infoPtr)
inlinestatic

Definition at line 255 of file trackbar.c.

256{
257 if (infoPtr->lPos == infoPtr->lRangeMin) return;
258 infoPtr->lPos -= infoPtr->lLineSize;
259 if (infoPtr->lPos < infoPtr->lRangeMin)
260 infoPtr->lPos = infoPtr->lRangeMin;
261 notify_with_scroll (infoPtr, TB_LINEUP);
262}
#define TB_LINEUP
Definition: commctrl.h:2073

Referenced by TRACKBAR_KeyDown().

◆ TRACKBAR_MouseMove()

static LRESULT TRACKBAR_MouseMove ( TRACKBAR_INFO infoPtr,
INT  x,
INT  y 
)
static

Definition at line 1712 of file trackbar.c.

1713{
1714 INT clickPlace = (infoPtr->dwStyle & TBS_VERT) ? y : x;
1715 LONG dragPos, oldPos = infoPtr->lPos;
1716
1717 TRACE("(x=%d. y=%d)\n", x, y);
1718
1719 if (infoPtr->flags & TB_AUTO_PAGE) {
1720 POINT pt;
1721 pt.x = x;
1722 pt.y = y;
1723 TRACKBAR_AutoPage (infoPtr, pt);
1724 return TRUE;
1725 }
1726
1727 if (!(infoPtr->flags & TB_DRAG_MODE))
1728 {
1729 if (GetWindowTheme (infoPtr->hwndSelf))
1730 {
1731 DWORD oldFlags = infoPtr->flags;
1732 POINT pt;
1733 pt.x = x;
1734 pt.y = y;
1735 if (PtInRect (&infoPtr->rcThumb, pt))
1736 {
1737 TRACKMOUSEEVENT tme;
1738 tme.cbSize = sizeof( tme );
1739 tme.dwFlags = TME_LEAVE;
1740 tme.hwndTrack = infoPtr->hwndSelf;
1741 TrackMouseEvent( &tme );
1742 infoPtr->flags |= TB_THUMB_HOT;
1743 }
1744 else
1745 {
1746 TRACKMOUSEEVENT tme;
1747 tme.cbSize = sizeof( tme );
1748 tme.dwFlags = TME_CANCEL;
1749 tme.hwndTrack = infoPtr->hwndSelf;
1750 TrackMouseEvent( &tme );
1751 infoPtr->flags &= ~TB_THUMB_HOT;
1752 }
1753 if (oldFlags != infoPtr->flags) InvalidateRect (infoPtr->hwndSelf, &infoPtr->rcThumb, FALSE);
1754 }
1755 return TRUE;
1756 }
1757
1758 dragPos = TRACKBAR_ConvertPlaceToPosition (infoPtr, clickPlace);
1759
1760 if (dragPos == oldPos) return TRUE;
1761
1762 infoPtr->lPos = dragPos;
1763 TRACKBAR_UpdateThumb (infoPtr);
1764
1765 notify_with_scroll (infoPtr, TB_THUMBTRACK | (infoPtr->lPos<<16));
1766
1767 TRACKBAR_InvalidateThumbMove(infoPtr, oldPos, dragPos);
1768 UpdateWindow (infoPtr->hwndSelf);
1769
1770 return TRUE;
1771}
#define pt(x, y)
Definition: drawing.c:79
#define TME_CANCEL
Definition: commctrl.h:4984
#define TME_LEAVE
Definition: commctrl.h:4981
#define TB_THUMBTRACK
Definition: commctrl.h:2078
BOOL WINAPI TrackMouseEvent(_Inout_ LPTRACKMOUSEEVENT)
BOOL WINAPI UpdateWindow(_In_ HWND)

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_PageDown()

static void TRACKBAR_PageDown ( TRACKBAR_INFO infoPtr)
inlinestatic

Definition at line 233 of file trackbar.c.

234{
235 if (infoPtr->lPos == infoPtr->lRangeMax) return;
236
237 infoPtr->lPos += infoPtr->lPageSize;
238 if (infoPtr->lPos > infoPtr->lRangeMax)
239 infoPtr->lPos = infoPtr->lRangeMax;
241}
#define TB_PAGEDOWN
Definition: commctrl.h:2076

Referenced by TRACKBAR_AutoPage(), and TRACKBAR_KeyDown().

◆ TRACKBAR_PageUp()

static void TRACKBAR_PageUp ( TRACKBAR_INFO infoPtr)
inlinestatic

Definition at line 245 of file trackbar.c.

246{
247 if (infoPtr->lPos == infoPtr->lRangeMin) return;
248
249 infoPtr->lPos -= infoPtr->lPageSize;
250 if (infoPtr->lPos < infoPtr->lRangeMin)
251 infoPtr->lPos = infoPtr->lRangeMin;
252 notify_with_scroll (infoPtr, TB_PAGEUP);
253}
#define TB_PAGEUP
Definition: commctrl.h:2075

Referenced by TRACKBAR_AutoPage(), and TRACKBAR_KeyDown().

◆ TRACKBAR_Paint()

static LRESULT TRACKBAR_Paint ( TRACKBAR_INFO infoPtr,
HDC  hdc 
)
static

Definition at line 1635 of file trackbar.c.

1636{
1637 if (hdc) {
1638 TRACKBAR_Refresh(infoPtr, hdc);
1639 } else {
1640 PAINTSTRUCT ps;
1641 hdc = BeginPaint (infoPtr->hwndSelf, &ps);
1642 TRACKBAR_Refresh (infoPtr, hdc);
1643 EndPaint (infoPtr->hwndSelf, &ps);
1644 }
1645
1646 return 0;
1647}
static void TRACKBAR_Refresh(TRACKBAR_INFO *infoPtr, HDC hdcDst)
Definition: trackbar.c:891
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_RecalculateTics()

static void TRACKBAR_RecalculateTics ( TRACKBAR_INFO infoPtr)
static

Definition at line 138 of file trackbar.c.

139{
140 int tic;
141 unsigned nrTics, i;
142
143 if (infoPtr->uTicFreq && infoPtr->lRangeMax >= infoPtr->lRangeMin) {
144 nrTics=(infoPtr->lRangeMax - infoPtr->lRangeMin)/infoPtr->uTicFreq;
145 /* don't add extra tic if there's no remainder */
146 if (nrTics && ((infoPtr->lRangeMax - infoPtr->lRangeMin) % infoPtr->uTicFreq == 0))
147 nrTics--;
148 }
149 else {
150 Free (infoPtr->tics);
151 infoPtr->tics = NULL;
152 infoPtr->uNumTics = 0;
153 return;
154 }
155
156 if (nrTics != infoPtr->uNumTics) {
157 infoPtr->tics=ReAlloc (infoPtr->tics,
158 (nrTics+1)*sizeof (DWORD));
159 if (!infoPtr->tics) {
160 infoPtr->uNumTics = 0;
161 notify(infoPtr, NM_OUTOFMEMORY);
162 return;
163 }
164 infoPtr->uNumTics = nrTics;
165 }
166
167 tic = infoPtr->lRangeMin + infoPtr->uTicFreq;
168 for (i = 0; i < nrTics; i++, tic += infoPtr->uTicFreq)
169 infoPtr->tics[i] = tic;
170}
PVOID ReAlloc(IN DWORD dwFlags, IN PVOID lpMem, IN SIZE_T dwBytes)
Definition: main.c:76
if(dx< 0)
Definition: linetemp.h:194
#define NM_OUTOFMEMORY
Definition: commctrl.h:129
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList

Referenced by TRACKBAR_SetRange(), TRACKBAR_SetRangeMax(), TRACKBAR_SetRangeMin(), and TRACKBAR_SetTicFreq().

◆ TRACKBAR_Refresh()

static void TRACKBAR_Refresh ( TRACKBAR_INFO infoPtr,
HDC  hdcDst 
)
static

Definition at line 891 of file trackbar.c.

892{
893 RECT rcClient;
894 HDC hdc;
895 HBITMAP hOldBmp = 0, hOffScreenBmp = 0;
896 NMCUSTOMDRAW nmcd;
897 int gcdrf, icdrf;
898
899 if (infoPtr->flags & TB_THUMBCHANGED) {
900 TRACKBAR_UpdateThumb (infoPtr);
901 if (infoPtr->flags & TB_THUMBSIZECHANGED)
902 TRACKBAR_CalcChannel (infoPtr);
903 }
904 if (infoPtr->flags & TB_SELECTIONCHANGED)
905 TRACKBAR_CalcSelection (infoPtr);
906
907 if (infoPtr->flags & TB_DRAG_MODE)
908 TRACKBAR_UpdateToolTip (infoPtr);
909
910 infoPtr->flags &= ~ (TB_THUMBCHANGED | TB_SELECTIONCHANGED);
911
912 GetClientRect (infoPtr->hwndSelf, &rcClient);
913
914 /* try to render offscreen, if we fail, carrry onscreen */
916 if (hdc) {
917 hOffScreenBmp = CreateCompatibleBitmap(hdcDst, rcClient.right, rcClient.bottom);
918 if (hOffScreenBmp) {
919 hOldBmp = SelectObject(hdc, hOffScreenBmp);
920 } else {
922 hdc = hdcDst;
923 }
924 } else {
925 hdc = hdcDst;
926 }
927
928 ZeroMemory(&nmcd, sizeof(nmcd));
929 nmcd.hdr.hwndFrom = infoPtr->hwndSelf;
930 nmcd.hdr.idFrom = GetWindowLongPtrW (infoPtr->hwndSelf, GWLP_ID);
931 nmcd.hdr.code = NM_CUSTOMDRAW;
932 nmcd.hdc = hdc;
933
934 /* start the paint cycle */
935 nmcd.rc = rcClient;
936 gcdrf = notify_customdraw(infoPtr, &nmcd, CDDS_PREPAINT);
937 if (gcdrf & CDRF_SKIPDEFAULT) goto cleanup;
938
939 /* Erase background */
940 if (gcdrf == CDRF_DODEFAULT ||
942 if (GetWindowTheme (infoPtr->hwndSelf)) {
944 }
945#ifndef __REACTOS__
946 else {
947#else
948 {
949#endif
950 HBRUSH brush = (HBRUSH)SendMessageW(infoPtr->hwndNotify, WM_CTLCOLORSTATIC,
951 (WPARAM)hdc, (LPARAM)infoPtr->hwndSelf);
952 FillRect (hdc, &rcClient, brush ? brush : GetSysColorBrush(COLOR_BTNFACE));
953 }
954 if (gcdrf != CDRF_DODEFAULT)
955 notify_customdraw(infoPtr, &nmcd, CDDS_POSTERASE);
956 }
957
958 /* draw channel */
959 if (gcdrf & CDRF_NOTIFYITEMDRAW) {
962 nmcd.rc = infoPtr->rcChannel;
963 icdrf = notify_customdraw(infoPtr, &nmcd, CDDS_ITEMPREPAINT);
964 } else icdrf = CDRF_DODEFAULT;
965 if ( !(icdrf & CDRF_SKIPDEFAULT) ) {
966 TRACKBAR_DrawChannel (infoPtr, hdc);
967 if (icdrf & CDRF_NOTIFYPOSTPAINT)
968 notify_customdraw(infoPtr, &nmcd, CDDS_ITEMPOSTPAINT);
969 }
970
971
972 /* draw tics */
973 if (!(infoPtr->dwStyle & TBS_NOTICKS)) {
974 if (gcdrf & CDRF_NOTIFYITEMDRAW) {
975 nmcd.dwItemSpec = TBCD_TICS;
977 nmcd.rc = rcClient;
978 icdrf = notify_customdraw(infoPtr, &nmcd, CDDS_ITEMPREPAINT);
979 } else icdrf = CDRF_DODEFAULT;
980 if ( !(icdrf & CDRF_SKIPDEFAULT) ) {
981 TRACKBAR_DrawTics (infoPtr, hdc);
982 if (icdrf & CDRF_NOTIFYPOSTPAINT)
983 notify_customdraw(infoPtr, &nmcd, CDDS_ITEMPOSTPAINT);
984 }
985 }
986
987 /* draw thumb */
988 if (!(infoPtr->dwStyle & TBS_NOTHUMB)) {
989 if (gcdrf & CDRF_NOTIFYITEMDRAW) {
990 nmcd.dwItemSpec = TBCD_THUMB;
991 nmcd.uItemState = infoPtr->flags & TB_DRAG_MODE ? CDIS_HOT : CDIS_DEFAULT;
992 nmcd.rc = infoPtr->rcThumb;
993 icdrf = notify_customdraw(infoPtr, &nmcd, CDDS_ITEMPREPAINT);
994 } else icdrf = CDRF_DODEFAULT;
995 if ( !(icdrf & CDRF_SKIPDEFAULT) ) {
996 TRACKBAR_DrawThumb(infoPtr, hdc);
997 if (icdrf & CDRF_NOTIFYPOSTPAINT)
998 notify_customdraw(infoPtr, &nmcd, CDDS_ITEMPOSTPAINT);
999 }
1000 }
1001
1002 /* draw focus rectangle */
1003 if (infoPtr->bFocussed) {
1004 DrawFocusRect(hdc, &rcClient);
1005 }
1006
1007 /* finish up the painting */
1008 if (gcdrf & CDRF_NOTIFYPOSTPAINT)
1009 notify_customdraw(infoPtr, &nmcd, CDDS_POSTPAINT);
1010
1011cleanup:
1012 /* cleanup, if we rendered offscreen */
1013 if (hdc != hdcDst) {
1014 BitBlt(hdcDst, 0, 0, rcClient.right, rcClient.bottom, hdc, 0, 0, SRCCOPY);
1015 SelectObject(hdc, hOldBmp);
1016 DeleteObject(hOffScreenBmp);
1018 }
1019}
static void TRACKBAR_DrawTics(const TRACKBAR_INFO *infoPtr, HDC hdc)
Definition: trackbar.c:564
static void TRACKBAR_DrawChannel(const TRACKBAR_INFO *infoPtr, HDC hdc)
Definition: trackbar.c:460
#define TB_THUMBCHANGED
Definition: trackbar.c:83
#define TB_THUMBSIZECHANGED
Definition: trackbar.c:82
static int notify_customdraw(const TRACKBAR_INFO *infoPtr, NMCUSTOMDRAW *pnmcd, int stage)
Definition: trackbar.c:100
static void TRACKBAR_DrawThumb(TRACKBAR_INFO *infoPtr, HDC hdc)
Definition: trackbar.c:694
static void TRACKBAR_CalcSelection(TRACKBAR_INFO *infoPtr)
Definition: trackbar.c:404
static void cleanup(void)
Definition: main.c:1335
HRESULT WINAPI DrawThemeParentBackground(HWND hwnd, HDC hdc, RECT *prc)
Definition: draw.c:72
static VOID BitBlt(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Width, _In_ ULONG Height, _In_reads_bytes_(Delta *Height) PUCHAR Buffer, _In_ ULONG BitsPerPixel, _In_ ULONG Delta)
Definition: common.c:57
static HBITMAP
Definition: button.c:44
static HDC
Definition: imagelist.c:92
#define CDDS_ITEMPOSTPAINT
Definition: commctrl.h:286
#define TBCD_TICS
Definition: commctrl.h:2083
#define CDDS_ITEMPREPAINT
Definition: commctrl.h:285
#define CDRF_NOTIFYITEMDRAW
Definition: commctrl.h:275
#define CDRF_DODEFAULT
Definition: commctrl.h:268
#define CDRF_NOTIFYPOSTPAINT
Definition: commctrl.h:274
#define CDDS_POSTERASE
Definition: commctrl.h:283
#define NM_CUSTOMDRAW
Definition: commctrl.h:137
#define TBS_NOTHUMB
Definition: commctrl.h:2026
#define CDDS_PREPAINT
Definition: commctrl.h:280
#define CDIS_DEFAULT
Definition: commctrl.h:296
#define CDDS_POSTPAINT
Definition: commctrl.h:281
#define CDRF_SKIPDEFAULT
Definition: commctrl.h:270
#define TBCD_CHANNEL
Definition: commctrl.h:2085
#define CDIS_HOT
Definition: commctrl.h:297
#define CDDS_PREERASE
Definition: commctrl.h:282
#define TBCD_THUMB
Definition: commctrl.h:2084
DWORD_PTR dwItemSpec
Definition: commctrl.h:307
UINT_PTR WPARAM
Definition: windef.h:207
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
#define SRCCOPY
Definition: wingdi.h:333
HBITMAP WINAPI CreateCompatibleBitmap(_In_ HDC hdc, _In_ INT cx, _In_ INT cy)
#define WM_CTLCOLORSTATIC
Definition: winuser.h:1772
BOOL WINAPI DrawFocusRect(_In_ HDC, _In_ LPCRECT)
static HDC hdcDst
Definition: xlate.c:32

Referenced by TRACKBAR_Paint().

◆ TRACKBAR_Register()

void TRACKBAR_Register ( void  )

Definition at line 2049 of file trackbar.c.

2050{
2051 WNDCLASSW wndClass;
2052
2053 ZeroMemory (&wndClass, sizeof(WNDCLASSW));
2054 wndClass.style = CS_GLOBALCLASS;
2056 wndClass.cbClsExtra = 0;
2057 wndClass.cbWndExtra = sizeof(TRACKBAR_INFO *);
2058 wndClass.hCursor = LoadCursorW (0, (LPWSTR)IDC_ARROW);
2059 wndClass.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
2060 wndClass.lpszClassName = TRACKBAR_CLASSW;
2061
2062 RegisterClassW (&wndClass);
2063}
static LRESULT WINAPI TRACKBAR_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: trackbar.c:1860
#define TRACKBAR_CLASSW
Definition: commctrl.h:2011
LPCWSTR lpszClassName
Definition: winuser.h:3185
HBRUSH hbrBackground
Definition: winuser.h:3183
int cbClsExtra
Definition: winuser.h:3178
UINT style
Definition: winuser.h:3176
WNDPROC lpfnWndProc
Definition: winuser.h:3177
int cbWndExtra
Definition: winuser.h:3179
HCURSOR hCursor
Definition: winuser.h:3182
ATOM WINAPI RegisterClassW(_In_ CONST WNDCLASSW *)
#define IDC_ARROW
Definition: winuser.h:687
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2105
#define CS_GLOBALCLASS
Definition: winuser.h:652
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by DllMain().

◆ TRACKBAR_SetBuddy()

static HWND TRACKBAR_SetBuddy ( TRACKBAR_INFO infoPtr,
BOOL  fLocation,
HWND  hwndBuddy 
)
static

Definition at line 1169 of file trackbar.c.

1170{
1171 HWND hwndTemp;
1172
1173 if (fLocation) {
1174 /* buddy is left or above */
1175 hwndTemp = infoPtr->hwndBuddyLA;
1176 infoPtr->hwndBuddyLA = hwndBuddy;
1177 }
1178 else {
1179 /* buddy is right or below */
1180 hwndTemp = infoPtr->hwndBuddyRB;
1181 infoPtr->hwndBuddyRB = hwndBuddy;
1182 }
1183
1184 TRACKBAR_AlignBuddies (infoPtr);
1185
1186 return hwndTemp;
1187}
static void TRACKBAR_AlignBuddies(const TRACKBAR_INFO *infoPtr)
Definition: trackbar.c:1023

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_SetFocus()

static LRESULT TRACKBAR_SetFocus ( TRACKBAR_INFO infoPtr)
static

Definition at line 1651 of file trackbar.c.

1652{
1653 TRACE("\n");
1654 infoPtr->bFocussed = TRUE;
1655 TRACKBAR_InvalidateAll(infoPtr);
1656
1657 return 0;
1658}

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_SetLineSize()

static LONG TRACKBAR_SetLineSize ( TRACKBAR_INFO infoPtr,
LONG  lLineSize 
)
inlinestatic

Definition at line 1191 of file trackbar.c.

1192{
1193 LONG lTemp = infoPtr->lLineSize;
1194
1195 infoPtr->lLineSize = lLineSize;
1196
1197 return lTemp;
1198}

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_SetPageSize()

static LONG TRACKBAR_SetPageSize ( TRACKBAR_INFO infoPtr,
LONG  lPageSize 
)
inlinestatic

Definition at line 1202 of file trackbar.c.

1203{
1204 LONG lTemp = infoPtr->lPageSize;
1205
1206 if (lPageSize != -1)
1207 infoPtr->lPageSize = lPageSize;
1208 else
1209 infoPtr->lPageSize = TB_DEFAULTPAGESIZE;
1210
1211 return lTemp;
1212}

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_SetPos()

static LRESULT TRACKBAR_SetPos ( TRACKBAR_INFO infoPtr,
BOOL  fPosition,
LONG  lPosition 
)
inlinestatic

Definition at line 1216 of file trackbar.c.

1217{
1218 LONG oldPos = infoPtr->lPos;
1219 infoPtr->lPos = lPosition;
1220
1221 if (infoPtr->lPos < infoPtr->lRangeMin)
1222 infoPtr->lPos = infoPtr->lRangeMin;
1223
1224 if (infoPtr->lPos > infoPtr->lRangeMax)
1225 infoPtr->lPos = infoPtr->lRangeMax;
1226
1227 if (fPosition && oldPos != lPosition)
1228 {
1229 TRACKBAR_UpdateThumb(infoPtr);
1230 TRACKBAR_InvalidateThumbMove(infoPtr, oldPos, lPosition);
1231 }
1232
1233 return 0;
1234}

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_SetRange()

static LRESULT TRACKBAR_SetRange ( TRACKBAR_INFO infoPtr,
BOOL  redraw,
LONG  range 
)
inlinestatic

Definition at line 1238 of file trackbar.c.

1239{
1240 BOOL changed = infoPtr->lRangeMin != (SHORT)LOWORD(range) ||
1241 infoPtr->lRangeMax != (SHORT)HIWORD(range);
1242
1243 infoPtr->lRangeMin = (SHORT)LOWORD(range);
1244 infoPtr->lRangeMax = (SHORT)HIWORD(range);
1245
1246 /* clip position to new min/max limit */
1247 if (infoPtr->lPos < infoPtr->lRangeMin)
1248 infoPtr->lPos = infoPtr->lRangeMin;
1249
1250 if (infoPtr->lPos > infoPtr->lRangeMax)
1251 infoPtr->lPos = infoPtr->lRangeMax;
1252
1253 infoPtr->lPageSize = (infoPtr->lRangeMax - infoPtr->lRangeMin) / 5;
1254 if (infoPtr->lPageSize == 0) infoPtr->lPageSize = 1;
1255
1256 if (changed) {
1257 if (infoPtr->dwStyle & TBS_AUTOTICKS)
1258 TRACKBAR_RecalculateTics (infoPtr);
1259 infoPtr->flags |= TB_THUMBPOSCHANGED;
1260 }
1261
1262 if (redraw) TRACKBAR_InvalidateAll(infoPtr);
1263
1264 return 0;
1265}
#define TB_THUMBPOSCHANGED
Definition: trackbar.c:81
static void TRACKBAR_RecalculateTics(TRACKBAR_INFO *infoPtr)
Definition: trackbar.c:138
#define LOWORD(l)
Definition: pedump.c:82
short SHORT
Definition: pedump.c:59
#define TBS_AUTOTICKS
Definition: commctrl.h:2015
void redraw(int x, int y, int cx, int cy)
Definition: qtewin.cpp:1248
#define HIWORD(l)
Definition: typedefs.h:247

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_SetRangeMax()

static LRESULT TRACKBAR_SetRangeMax ( TRACKBAR_INFO infoPtr,
BOOL  redraw,
LONG  lMax 
)
inlinestatic

Definition at line 1269 of file trackbar.c.

1270{
1271 BOOL changed = infoPtr->lRangeMax != lMax;
1272 LONG rightmost = max(lMax, infoPtr->lRangeMin);
1273
1274 infoPtr->lRangeMax = lMax;
1275 if (infoPtr->lPos > rightmost) {
1276 infoPtr->lPos = rightmost;
1277 infoPtr->flags |= TB_THUMBPOSCHANGED;
1278 }
1279
1280 infoPtr->lPageSize = (infoPtr->lRangeMax - infoPtr->lRangeMin) / 5;
1281 if (infoPtr->lPageSize == 0) infoPtr->lPageSize = 1;
1282
1283 if (changed && (infoPtr->dwStyle & TBS_AUTOTICKS))
1284 TRACKBAR_RecalculateTics (infoPtr);
1285
1286 if (redraw) TRACKBAR_InvalidateAll(infoPtr);
1287
1288 return 0;
1289}
#define max(a, b)
Definition: svc.c:63

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_SetRangeMin()

static LRESULT TRACKBAR_SetRangeMin ( TRACKBAR_INFO infoPtr,
BOOL  redraw,
LONG  lMin 
)
inlinestatic

Definition at line 1293 of file trackbar.c.

1294{
1295 BOOL changed = infoPtr->lRangeMin != lMin;
1296
1297 infoPtr->lRangeMin = lMin;
1298 if (infoPtr->lPos < infoPtr->lRangeMin) {
1299 infoPtr->lPos = infoPtr->lRangeMin;
1300 infoPtr->flags |= TB_THUMBPOSCHANGED;
1301 }
1302
1303 infoPtr->lPageSize = (infoPtr->lRangeMax - infoPtr->lRangeMin) / 5;
1304 if (infoPtr->lPageSize == 0) infoPtr->lPageSize = 1;
1305
1306 if (changed && (infoPtr->dwStyle & TBS_AUTOTICKS))
1307 TRACKBAR_RecalculateTics (infoPtr);
1308
1309 if (redraw) TRACKBAR_InvalidateAll(infoPtr);
1310
1311 return 0;
1312}

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_SetSel()

static LRESULT TRACKBAR_SetSel ( TRACKBAR_INFO infoPtr,
BOOL  fRedraw,
LONG  lSel 
)
inlinestatic

Definition at line 1316 of file trackbar.c.

1317{
1318 if (!(infoPtr->dwStyle & TBS_ENABLESELRANGE)){
1319 infoPtr->lSelMin = 0;
1320 infoPtr->lSelMax = 0;
1321 return 0;
1322 }
1323
1324 infoPtr->lSelMin = (SHORT)LOWORD(lSel);
1325 infoPtr->lSelMax = (SHORT)HIWORD(lSel);
1326 infoPtr->flags |= TB_SELECTIONCHANGED;
1327
1328 if (infoPtr->lSelMin < infoPtr->lRangeMin)
1329 infoPtr->lSelMin = infoPtr->lRangeMin;
1330 if (infoPtr->lSelMax > infoPtr->lRangeMax)
1331 infoPtr->lSelMax = infoPtr->lRangeMax;
1332
1333 if (fRedraw) TRACKBAR_InvalidateAll(infoPtr);
1334
1335 return 0;
1336}

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_SetSelEnd()

static LRESULT TRACKBAR_SetSelEnd ( TRACKBAR_INFO infoPtr,
BOOL  fRedraw,
LONG  lEnd 
)
inlinestatic

Definition at line 1340 of file trackbar.c.

1341{
1342 if (!(infoPtr->dwStyle & TBS_ENABLESELRANGE)){
1343 infoPtr->lSelMax = 0;
1344 return 0;
1345 }
1346
1347 infoPtr->lSelMax = lEnd;
1348 infoPtr->flags |= TB_SELECTIONCHANGED;
1349
1350 if (infoPtr->lSelMax > infoPtr->lRangeMax)
1351 infoPtr->lSelMax = infoPtr->lRangeMax;
1352
1353 if (fRedraw) TRACKBAR_InvalidateAll(infoPtr);
1354
1355 return 0;
1356}

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_SetSelStart()

static LRESULT TRACKBAR_SetSelStart ( TRACKBAR_INFO infoPtr,
BOOL  fRedraw,
LONG  lStart 
)
inlinestatic

Definition at line 1360 of file trackbar.c.

1361{
1362 if (!(infoPtr->dwStyle & TBS_ENABLESELRANGE)){
1363 infoPtr->lSelMin = 0;
1364 return 0;
1365 }
1366
1367 infoPtr->lSelMin = lStart;
1368 infoPtr->flags |=TB_SELECTIONCHANGED;
1369
1370 if (infoPtr->lSelMin < infoPtr->lRangeMin)
1371 infoPtr->lSelMin = infoPtr->lRangeMin;
1372
1373 if (fRedraw) TRACKBAR_InvalidateAll(infoPtr);
1374
1375 return 0;
1376}

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_SetThumbLength()

static LRESULT TRACKBAR_SetThumbLength ( TRACKBAR_INFO infoPtr,
UINT  iLength 
)
inlinestatic

Definition at line 1380 of file trackbar.c.

1381{
1382 if (infoPtr->dwStyle & TBS_FIXEDLENGTH) {
1383 /* We're not supposed to check if it's really changed or not,
1384 just repaint in any case. */
1385 infoPtr->uThumbLen = iLength;
1386 infoPtr->flags |= TB_THUMBSIZECHANGED;
1387 TRACKBAR_InvalidateAll(infoPtr);
1388 }
1389
1390 return 0;
1391}
#define TBS_FIXEDLENGTH
Definition: commctrl.h:2025

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_SetTic()

static LRESULT TRACKBAR_SetTic ( TRACKBAR_INFO infoPtr,
LONG  lPos 
)
inlinestatic

Definition at line 1395 of file trackbar.c.

1396{
1397 if ((lPos < infoPtr->lRangeMin) || (lPos> infoPtr->lRangeMax))
1398 return FALSE;
1399
1400 TRACE("lPos=%d\n", lPos);
1401
1402 infoPtr->uNumTics++;
1403 infoPtr->tics=ReAlloc( infoPtr->tics,
1404 (infoPtr->uNumTics)*sizeof (DWORD));
1405 if (!infoPtr->tics) {
1406 infoPtr->uNumTics = 0;
1407 notify(infoPtr, NM_OUTOFMEMORY);
1408 return FALSE;
1409 }
1410 infoPtr->tics[infoPtr->uNumTics-1] = lPos;
1411
1412 TRACKBAR_InvalidateAll(infoPtr);
1413
1414 return TRUE;
1415}

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_SetTicFreq()

static LRESULT TRACKBAR_SetTicFreq ( TRACKBAR_INFO infoPtr,
WORD  wFreq 
)
inlinestatic

Definition at line 1419 of file trackbar.c.

1420{
1421 if (infoPtr->dwStyle & TBS_AUTOTICKS) {
1422 infoPtr->uTicFreq = wFreq;
1423 TRACKBAR_RecalculateTics (infoPtr);
1424 TRACKBAR_InvalidateAll(infoPtr);
1425 }
1426
1427 TRACKBAR_UpdateThumb (infoPtr);
1428 return 0;
1429}

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_SetTipSide()

static INT TRACKBAR_SetTipSide ( TRACKBAR_INFO infoPtr,
INT  fLocation 
)
inlinestatic

Definition at line 1433 of file trackbar.c.

1434{
1435 INT fTemp = infoPtr->fLocation;
1436
1437 infoPtr->fLocation = fLocation;
1438
1439 return fTemp;
1440}

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_SetToolTips()

static LRESULT TRACKBAR_SetToolTips ( TRACKBAR_INFO infoPtr,
HWND  hwndTT 
)
inlinestatic

Definition at line 1444 of file trackbar.c.

1445{
1446 infoPtr->hwndToolTip = hwndTT;
1447
1448 return 0;
1449}

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_SetUnicodeFormat()

static BOOL TRACKBAR_SetUnicodeFormat ( TRACKBAR_INFO infoPtr,
BOOL  fUnicode 
)
inlinestatic

Definition at line 1453 of file trackbar.c.

1454{
1455 BOOL bTemp = infoPtr->bUnicode;
1456
1457 infoPtr->bUnicode = fUnicode;
1458
1459 return bTemp;
1460}
BOOL bUnicode
Definition: trackbar.c:63

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_Size()

static LRESULT TRACKBAR_Size ( TRACKBAR_INFO infoPtr)
static

Definition at line 1662 of file trackbar.c.

1663{
1664 if (infoPtr->dwStyle & TBS_FIXEDLENGTH)
1665 {
1666 TRACKBAR_CalcChannel(infoPtr);
1667 TRACKBAR_UpdateThumb(infoPtr);
1668 }
1669 else
1670 TRACKBAR_InitializeThumb(infoPtr);
1671 TRACKBAR_AlignBuddies (infoPtr);
1672 TRACKBAR_InvalidateAll(infoPtr);
1673
1674 return 0;
1675}

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_StyleChanged()

static LRESULT TRACKBAR_StyleChanged ( TRACKBAR_INFO infoPtr,
WPARAM  wStyleType,
const STYLESTRUCT lpss 
)
static

Definition at line 1678 of file trackbar.c.

1680{
1681 if (wStyleType != GWL_STYLE) return 0;
1682
1683 infoPtr->dwStyle = lpss->styleNew;
1684
1685 return 0;
1686}
DWORD styleNew
Definition: winuser.h:3693
#define GWL_STYLE
Definition: winuser.h:852

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_Timer()

static LRESULT TRACKBAR_Timer ( TRACKBAR_INFO infoPtr)
static

Definition at line 1689 of file trackbar.c.

1690{
1691 if (infoPtr->flags & TB_AUTO_PAGE) {
1692 POINT pt;
1693 if (GetCursorPos(&pt))
1694 if (ScreenToClient(infoPtr->hwndSelf, &pt))
1695 TRACKBAR_AutoPage(infoPtr, pt);
1696 }
1697 return 0;
1698}
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
Definition: cursoricon.c:2670
BOOL WINAPI ScreenToClient(_In_ HWND, _Inout_ LPPOINT)

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_Unregister()

void TRACKBAR_Unregister ( void  )

Definition at line 2066 of file trackbar.c.

2067{
2069}
BOOL WINAPI UnregisterClassW(_In_ LPCWSTR, HINSTANCE)

Referenced by DllMain().

◆ TRACKBAR_UpdateThumb()

static void TRACKBAR_UpdateThumb ( TRACKBAR_INFO infoPtr)
inlinestatic

◆ TRACKBAR_UpdateToolTip()

static void TRACKBAR_UpdateToolTip ( const TRACKBAR_INFO infoPtr)
static

Definition at line 848 of file trackbar.c.

849{
850 WCHAR buf[80];
851 static const WCHAR fmt[] = { '%', 'l', 'd', 0 };
852 TTTOOLINFOW ti;
853 POINT pt;
854 RECT rcClient;
856
857 if (!infoPtr->hwndToolTip) return;
858
859 ZeroMemory(&ti, sizeof(ti));
860 ti.cbSize = sizeof(ti);
861 ti.hwnd = infoPtr->hwndSelf;
863
864 wsprintfW (buf, fmt, infoPtr->lPos);
865 ti.lpszText = buf;
867
868 GetClientRect (infoPtr->hwndSelf, &rcClient);
870 if (infoPtr->dwStyle & TBS_VERT) {
871 if (infoPtr->fLocation == TBTS_LEFT)
872 pt.x = 0 - LOWORD(size) - TOOLTIP_OFFSET;
873 else
874 pt.x = rcClient.right + TOOLTIP_OFFSET;
875 pt.y = (infoPtr->rcThumb.top + infoPtr->rcThumb.bottom - HIWORD(size))/2;
876 } else {
877 if (infoPtr->fLocation == TBTS_TOP)
878 pt.y = 0 - HIWORD(size) - TOOLTIP_OFFSET;
879 else
880 pt.y = rcClient.bottom + TOOLTIP_OFFSET;
881 pt.x = (infoPtr->rcThumb.left + infoPtr->rcThumb.right - LOWORD(size))/2;
882 }
883 ClientToScreen(infoPtr->hwndSelf, &pt);
884
886 0, MAKELPARAM(pt.x, pt.y));
887}
#define TOOLTIP_OFFSET
Definition: trackbar.c:74
GLsizeiptr size
Definition: glext.h:5919
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define TBTS_LEFT
Definition: commctrl.h:2064
#define TTM_TRACKPOSITION
Definition: commctrl.h:1813
#define TTM_UPDATETIPTEXTW
Definition: commctrl.h:1805
#define TTM_GETBUBBLESIZE
Definition: commctrl.h:1825
Definition: dsound.c:943
#define MAKELPARAM(l, h)
Definition: winuser.h:4008
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
BOOL WINAPI ClientToScreen(_In_ HWND, _Inout_ LPPOINT)

Referenced by TRACKBAR_LButtonDown(), and TRACKBAR_Refresh().

◆ TRACKBAR_WindowProc()

static LRESULT WINAPI TRACKBAR_WindowProc ( HWND  hwnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 1860 of file trackbar.c.

1861{
1863
1864 TRACE("hwnd=%p msg=%x wparam=%lx lparam=%lx\n", hwnd, uMsg, wParam, lParam);
1865
1866 if (!infoPtr && (uMsg != WM_CREATE))
1867 return DefWindowProcW (hwnd, uMsg, wParam, lParam);
1868
1869 switch (uMsg)
1870 {
1871 case TBM_CLEARSEL:
1872 return TRACKBAR_ClearSel (infoPtr, (BOOL)wParam);
1873
1874 case TBM_CLEARTICS:
1875 return TRACKBAR_ClearTics (infoPtr, (BOOL)wParam);
1876
1877 case TBM_GETBUDDY:
1878 return (LRESULT)(wParam ? infoPtr->hwndBuddyLA : infoPtr->hwndBuddyRB);
1879
1880 case TBM_GETCHANNELRECT:
1881 return TRACKBAR_GetChannelRect (infoPtr, (LPRECT)lParam);
1882
1883 case TBM_GETLINESIZE:
1884 return infoPtr->lLineSize;
1885
1886 case TBM_GETNUMTICS:
1887 return TRACKBAR_GetNumTics (infoPtr);
1888
1889 case TBM_GETPAGESIZE:
1890 return infoPtr->lPageSize;
1891
1892 case TBM_GETPOS:
1893 return infoPtr->lPos;
1894
1895 case TBM_GETPTICS:
1896 return (LRESULT)infoPtr->tics;
1897
1898 case TBM_GETRANGEMAX:
1899 return infoPtr->lRangeMax;
1900
1901 case TBM_GETRANGEMIN:
1902 return infoPtr->lRangeMin;
1903
1904 case TBM_GETSELEND:
1905 return infoPtr->lSelMax;
1906
1907 case TBM_GETSELSTART:
1908 return infoPtr->lSelMin;
1909
1910 case TBM_GETTHUMBLENGTH:
1911 return infoPtr->uThumbLen;
1912
1913 case TBM_GETTHUMBRECT:
1914 return CopyRect((LPRECT)lParam, &infoPtr->rcThumb);
1915
1916 case TBM_GETTIC:
1917 return TRACKBAR_GetTic (infoPtr, (INT)wParam);
1918
1919 case TBM_GETTICPOS:
1920 return TRACKBAR_GetTicPos (infoPtr, (INT)wParam);
1921
1922 case TBM_GETTOOLTIPS:
1923 return (LRESULT)infoPtr->hwndToolTip;
1924
1926 return infoPtr->bUnicode;
1927
1928 case TBM_SETBUDDY:
1929 return (LRESULT) TRACKBAR_SetBuddy(infoPtr, (BOOL)wParam, (HWND)lParam);
1930
1931 case TBM_SETLINESIZE:
1932 return TRACKBAR_SetLineSize (infoPtr, (LONG)lParam);
1933
1934 case TBM_SETPAGESIZE:
1935 return TRACKBAR_SetPageSize (infoPtr, (LONG)lParam);
1936
1937 case TBM_SETPOS:
1938 return TRACKBAR_SetPos (infoPtr, (BOOL)wParam, (LONG)lParam);
1939
1940 case TBM_SETRANGE:
1941 return TRACKBAR_SetRange (infoPtr, (BOOL)wParam, (LONG)lParam);
1942
1943 case TBM_SETRANGEMAX:
1944 return TRACKBAR_SetRangeMax (infoPtr, (BOOL)wParam, (LONG)lParam);
1945
1946 case TBM_SETRANGEMIN:
1947 return TRACKBAR_SetRangeMin (infoPtr, (BOOL)wParam, (LONG)lParam);
1948
1949 case TBM_SETSEL:
1950 return TRACKBAR_SetSel (infoPtr, (BOOL)wParam, (LONG)lParam);
1951
1952 case TBM_SETSELEND:
1953 return TRACKBAR_SetSelEnd (infoPtr, (BOOL)wParam, (LONG)lParam);
1954
1955 case TBM_SETSELSTART:
1956 return TRACKBAR_SetSelStart (infoPtr, (BOOL)wParam, (LONG)lParam);
1957
1958 case TBM_SETTHUMBLENGTH:
1959 return TRACKBAR_SetThumbLength (infoPtr, (UINT)wParam);
1960
1961 case TBM_SETTIC:
1962 return TRACKBAR_SetTic (infoPtr, (LONG)lParam);
1963
1964 case TBM_SETTICFREQ:
1965 return TRACKBAR_SetTicFreq (infoPtr, (WORD)wParam);
1966
1967 case TBM_SETTIPSIDE:
1968 return TRACKBAR_SetTipSide (infoPtr, (INT)wParam);
1969
1970 case TBM_SETTOOLTIPS:
1971 return TRACKBAR_SetToolTips (infoPtr, (HWND)wParam);
1972
1974 return TRACKBAR_SetUnicodeFormat (infoPtr, (BOOL)wParam);
1975
1976
1977 case WM_CAPTURECHANGED:
1978 if (hwnd == (HWND)lParam) return 0;
1979 return TRACKBAR_CaptureChanged (infoPtr);
1980
1981 case WM_CREATE:
1983
1984 case WM_DESTROY:
1985 return TRACKBAR_Destroy (infoPtr);
1986
1987 case WM_ENABLE:
1988 return TRACKBAR_Enable (infoPtr, (BOOL)wParam);
1989
1990 case WM_ERASEBKGND:
1991 return 0;
1992
1993 case WM_GETDLGCODE:
1994 return DLGC_WANTARROWS;
1995
1996 case WM_KEYDOWN:
1997 return TRACKBAR_KeyDown (infoPtr, (INT)wParam);
1998
1999 case WM_KEYUP:
2000 return TRACKBAR_KeyUp (infoPtr, (INT)wParam);
2001
2002 case WM_KILLFOCUS:
2003 return TRACKBAR_KillFocus (infoPtr);
2004
2005 case WM_LBUTTONDOWN:
2006 return TRACKBAR_LButtonDown (infoPtr, (SHORT)LOWORD(lParam), (SHORT)HIWORD(lParam));
2007
2008 case WM_LBUTTONUP:
2009 return TRACKBAR_LButtonUp (infoPtr);
2010
2011 case WM_MOUSELEAVE:
2012 infoPtr->flags &= ~TB_THUMB_HOT;
2013 InvalidateRect (infoPtr->hwndSelf, &infoPtr->rcThumb, FALSE);
2014 return 0;
2015
2016 case WM_MOUSEMOVE:
2017 return TRACKBAR_MouseMove (infoPtr, (SHORT)LOWORD(lParam), (SHORT)HIWORD(lParam));
2018
2019 case WM_PRINTCLIENT:
2020 case WM_PAINT:
2021 return TRACKBAR_Paint (infoPtr, (HDC)wParam);
2022
2023 case WM_SETFOCUS:
2024 return TRACKBAR_SetFocus (infoPtr);
2025
2026 case WM_SIZE:
2027 return TRACKBAR_Size (infoPtr);
2028
2029 case WM_STYLECHANGED:
2031
2032 case WM_THEMECHANGED:
2033 return theme_changed (infoPtr);
2034
2035 case WM_TIMER:
2036 return TRACKBAR_Timer (infoPtr);
2037
2038 case WM_WININICHANGE:
2039 return TRACKBAR_InitializeThumb (infoPtr);
2040
2041 default:
2042 if ((uMsg >= WM_USER) && (uMsg < WM_APP) && !COMCTL32_IsReflectedMessage(uMsg))
2043 ERR("unknown msg %04x wp=%08lx lp=%08lx\n", uMsg, wParam, lParam);
2044 return DefWindowProcW (hwnd, uMsg, wParam, lParam);
2045 }
2046}
#define ERR(fmt,...)
Definition: debug.h:110
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
BOOL COMCTL32_IsReflectedMessage(UINT uMsg) DECLSPEC_HIDDEN
Definition: commctrl.c:1748
static BOOL TRACKBAR_KeyDown(TRACKBAR_INFO *infoPtr, INT nVirtKey)
Definition: trackbar.c:1774
static LRESULT TRACKBAR_Paint(TRACKBAR_INFO *infoPtr, HDC hdc)
Definition: trackbar.c:1635
static LRESULT TRACKBAR_ClearTics(TRACKBAR_INFO *infoPtr, BOOL fRedraw)
Definition: trackbar.c:1088
static LRESULT TRACKBAR_SetPos(TRACKBAR_INFO *infoPtr, BOOL fPosition, LONG lPosition)
Definition: trackbar.c:1216
static LONG TRACKBAR_SetLineSize(TRACKBAR_INFO *infoPtr, LONG lLineSize)
Definition: trackbar.c:1191
static LRESULT TRACKBAR_SetSelEnd(TRACKBAR_INFO *infoPtr, BOOL fRedraw, LONG lEnd)
Definition: trackbar.c:1340
static LRESULT TRACKBAR_Create(HWND hwnd, const CREATESTRUCTW *lpcs)
Definition: trackbar.c:1491
static LRESULT TRACKBAR_GetChannelRect(const TRACKBAR_INFO *infoPtr, LPRECT lprc)
Definition: trackbar.c:1103
static INT TRACKBAR_SetTipSide(TRACKBAR_INFO *infoPtr, INT fLocation)
Definition: trackbar.c:1433
static LRESULT TRACKBAR_SetRange(TRACKBAR_INFO *infoPtr, BOOL redraw, LONG range)
Definition: trackbar.c:1238
static LRESULT TRACKBAR_CaptureChanged(const TRACKBAR_INFO *infoPtr)
Definition: trackbar.c:1627
static LRESULT TRACKBAR_MouseMove(TRACKBAR_INFO *infoPtr, INT x, INT y)
Definition: trackbar.c:1712
static LRESULT TRACKBAR_SetTicFreq(TRACKBAR_INFO *infoPtr, WORD wFreq)
Definition: trackbar.c:1419
static LONG TRACKBAR_GetTicPos(const TRACKBAR_INFO *infoPtr, INT iTic)
Definition: trackbar.c:1149
static HWND TRACKBAR_SetBuddy(TRACKBAR_INFO *infoPtr, BOOL fLocation, HWND hwndBuddy)
Definition: trackbar.c:1169
static LRESULT TRACKBAR_Timer(TRACKBAR_INFO *infoPtr)
Definition: trackbar.c:1689
static LRESULT TRACKBAR_SetThumbLength(TRACKBAR_INFO *infoPtr, UINT iLength)
Definition: trackbar.c:1380
static LRESULT TRACKBAR_SetFocus(TRACKBAR_INFO *infoPtr)
Definition: trackbar.c:1651
static LRESULT TRACKBAR_SetRangeMax(TRACKBAR_INFO *infoPtr, BOOL redraw, LONG lMax)
Definition: trackbar.c:1269
static LRESULT TRACKBAR_Size(TRACKBAR_INFO *infoPtr)
Definition: trackbar.c:1662
static LRESULT TRACKBAR_ClearSel(TRACKBAR_INFO *infoPtr, BOOL fRedraw)
Definition: trackbar.c:1075
static LRESULT TRACKBAR_KillFocus(TRACKBAR_INFO *infoPtr)
Definition: trackbar.c:1564
static LRESULT TRACKBAR_SetTic(TRACKBAR_INFO *infoPtr, LONG lPos)
Definition: trackbar.c:1395
static LONG TRACKBAR_SetPageSize(TRACKBAR_INFO *infoPtr, LONG lPageSize)
Definition: trackbar.c:1202
static LRESULT TRACKBAR_SetToolTips(TRACKBAR_INFO *infoPtr, HWND hwndTT)
Definition: trackbar.c:1444
static LRESULT TRACKBAR_Destroy(TRACKBAR_INFO *infoPtr)
Definition: trackbar.c:1546
static LRESULT TRACKBAR_Enable(TRACKBAR_INFO *infoPtr, BOOL enable)
Definition: trackbar.c:1847
static LRESULT TRACKBAR_StyleChanged(TRACKBAR_INFO *infoPtr, WPARAM wStyleType, const STYLESTRUCT *lpss)
Definition: trackbar.c:1678
static LONG TRACKBAR_GetNumTics(const TRACKBAR_INFO *infoPtr)
Definition: trackbar.c:1117
static LRESULT TRACKBAR_SetSel(TRACKBAR_INFO *infoPtr, BOOL fRedraw, LONG lSel)
Definition: trackbar.c:1316
static BOOL TRACKBAR_SetUnicodeFormat(TRACKBAR_INFO *infoPtr, BOOL fUnicode)
Definition: trackbar.c:1453
static BOOL TRACKBAR_KeyUp(const TRACKBAR_INFO *infoPtr, INT nVirtKey)
Definition: trackbar.c:1829
static LRESULT TRACKBAR_LButtonDown(TRACKBAR_INFO *infoPtr, INT x, INT y)
Definition: trackbar.c:1574
static LRESULT TRACKBAR_SetSelStart(TRACKBAR_INFO *infoPtr, BOOL fRedraw, LONG lStart)
Definition: trackbar.c:1360
static LRESULT theme_changed(const TRACKBAR_INFO *infoPtr)
Definition: trackbar.c:1702
static LRESULT TRACKBAR_SetRangeMin(TRACKBAR_INFO *infoPtr, BOOL redraw, LONG lMin)
Definition: trackbar.c:1293
static LRESULT TRACKBAR_LButtonUp(TRACKBAR_INFO *infoPtr)
Definition: trackbar.c:1603
#define WM_APP
Definition: eventvwr.h:73
unsigned short WORD
Definition: ntddk_ex.h:93
#define TBM_GETBUDDY
Definition: commctrl.h:2069
#define TBM_GETSELSTART
Definition: commctrl.h:2047
#define TBM_CLEARSEL
Definition: commctrl.h:2049
#define TBM_SETPAGESIZE
Definition: commctrl.h:2051
#define TBM_SETTIC
Definition: commctrl.h:2035
#define TBM_SETSELSTART
Definition: commctrl.h:2042
#define TBM_GETPOS
Definition: commctrl.h:2031
#define TBM_GETSELEND
Definition: commctrl.h:2048
#define TBM_SETSELEND
Definition: commctrl.h:2043
#define TBM_SETTOOLTIPS
Definition: commctrl.h:2059
#define TBM_SETLINESIZE
Definition: commctrl.h:2053
#define TBM_GETTHUMBRECT
Definition: commctrl.h:2055
#define TBM_SETRANGEMIN
Definition: commctrl.h:2038
#define TBM_SETSEL
Definition: commctrl.h:2041
#define TBM_GETCHANNELRECT
Definition: commctrl.h:2056
#define TBM_GETLINESIZE
Definition: commctrl.h:2054
#define TBM_CLEARTICS
Definition: commctrl.h:2040
#define TBM_GETRANGEMAX
Definition: commctrl.h:2033
#define TBM_SETRANGE
Definition: commctrl.h:2037
#define TBM_SETPOS
Definition: commctrl.h:2036
#define WM_MOUSELEAVE
Definition: commctrl.h:4975
#define TBM_GETPTICS
Definition: commctrl.h:2044
#define TBM_GETTIC
Definition: commctrl.h:2034
#define TBM_SETTICFREQ
Definition: commctrl.h:2050
#define TBM_GETNUMTICS
Definition: commctrl.h:2046
#define TBM_SETRANGEMAX
Definition: commctrl.h:2039
#define TBM_GETUNICODEFORMAT
Definition: commctrl.h:2071
#define TBM_SETTIPSIDE
Definition: commctrl.h:2061
#define TBM_GETTICPOS
Definition: commctrl.h:2045
#define TBM_SETUNICODEFORMAT
Definition: commctrl.h:2070
#define TBM_GETRANGEMIN
Definition: commctrl.h:2032
#define TBM_SETTHUMBLENGTH
Definition: commctrl.h:2057
#define TBM_GETPAGESIZE
Definition: commctrl.h:2052
#define TBM_SETBUDDY
Definition: commctrl.h:2068
#define TBM_GETTOOLTIPS
Definition: commctrl.h:2060
#define TBM_GETTHUMBLENGTH
Definition: commctrl.h:2058
#define WM_PRINTCLIENT
Definition: richedit.h:70
#define WM_PAINT
Definition: winuser.h:1620
#define WM_ERASEBKGND
Definition: winuser.h:1625
BOOL WINAPI CopyRect(_Out_ LPRECT, _In_ LPCRECT)
#define WM_ENABLE
Definition: winuser.h:1615
#define WM_KEYUP
Definition: winuser.h:1716
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_CAPTURECHANGED
Definition: winuser.h:1808
#define WM_CREATE
Definition: winuser.h:1608
#define WM_SIZE
Definition: winuser.h:1611
#define WM_WININICHANGE
Definition: winuser.h:1630
#define WM_SETFOCUS
Definition: winuser.h:1613
#define WM_MOUSEMOVE
Definition: winuser.h:1775
#define WM_LBUTTONDOWN
Definition: winuser.h:1776
#define WM_TIMER
Definition: winuser.h:1742
#define DLGC_WANTARROWS
Definition: winuser.h:2610
#define WM_LBUTTONUP
Definition: winuser.h:1777
#define WM_USER
Definition: winuser.h:1895
#define WM_DESTROY
Definition: winuser.h:1609
#define WM_KEYDOWN
Definition: winuser.h:1715
#define WM_KILLFOCUS
Definition: winuser.h:1614
#define WM_GETDLGCODE
Definition: winuser.h:1689

Referenced by TRACKBAR_Register().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( trackbar  )

Variable Documentation

◆ themeClass

const WCHAR themeClass[] = { 'T','r','a','c','k','b','a','r',0 }
static

Definition at line 97 of file trackbar.c.

Referenced by theme_changed(), and TRACKBAR_Create().