ReactOS 0.4.16-dev-311-g9382aa2
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   0x00000001
 
#define TB_THUMBSIZECHANGED   0x00000002
 
#define TB_THUMBCHANGED   (TB_THUMBPOSCHANGED | TB_THUMBSIZECHANGED)
 
#define TB_SELECTIONCHANGED   0x00000004
 
#define TB_DRAG_MODE   0x00000008 /* we're dragging the slider */
 
#define TB_AUTO_PAGE_LEFT   0x00000010
 
#define TB_AUTO_PAGE_RIGHT   0x00000020
 
#define TB_AUTO_PAGE   (TB_AUTO_PAGE_LEFT | TB_AUTO_PAGE_RIGHT)
 
#define TB_THUMB_HOT   0x00000040 /* mouse hovers above thumb */
 
#define TB_USER_PAGE   0x00000080
 
#define TB_IS_FOCUSED   0x00000100
 
#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 __cdecl 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 void TRACKBAR_UpdatePageSize (TRACKBAR_INFO *infoPtr)
 
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 int get_scaled_metric (const TRACKBAR_INFO *infoPtr, int value)
 
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 87 of file trackbar.c.

◆ TB_AUTO_PAGE_LEFT

#define TB_AUTO_PAGE_LEFT   0x00000010

Definition at line 85 of file trackbar.c.

◆ TB_AUTO_PAGE_RIGHT

#define TB_AUTO_PAGE_RIGHT   0x00000020

Definition at line 86 of file trackbar.c.

◆ TB_DEFAULTPAGESIZE

#define TB_DEFAULTPAGESIZE   20

Definition at line 75 of file trackbar.c.

◆ TB_DRAG_MODE

#define TB_DRAG_MODE   0x00000008 /* we're dragging the slider */

Definition at line 84 of file trackbar.c.

◆ TB_IS_FOCUSED

#define TB_IS_FOCUSED   0x00000100

Definition at line 92 of file trackbar.c.

◆ TB_REFRESH_DELAY

#define TB_REFRESH_DELAY   500

Definition at line 71 of file trackbar.c.

◆ TB_REFRESH_TIMER

#define TB_REFRESH_TIMER   1

Definition at line 70 of file trackbar.c.

◆ TB_SELECTIONCHANGED

#define TB_SELECTIONCHANGED   0x00000004

Definition at line 83 of file trackbar.c.

◆ TB_THUMB_HOT

#define TB_THUMB_HOT   0x00000040 /* mouse hovers above thumb */

Definition at line 88 of file trackbar.c.

◆ TB_THUMBCHANGED

#define TB_THUMBCHANGED   (TB_THUMBPOSCHANGED | TB_THUMBSIZECHANGED)

Definition at line 82 of file trackbar.c.

◆ TB_THUMBPOSCHANGED

#define TB_THUMBPOSCHANGED   0x00000001

Definition at line 80 of file trackbar.c.

◆ TB_THUMBSIZECHANGED

#define TB_THUMBSIZECHANGED   0x00000002

Definition at line 81 of file trackbar.c.

◆ TB_USER_PAGE

#define TB_USER_PAGE   0x00000080

Definition at line 91 of file trackbar.c.

◆ TIC_EDGE

#define TIC_EDGE   0x20

Definition at line 95 of file trackbar.c.

◆ TIC_SELECTIONMARK

#define TIC_SELECTIONMARK   (TIC_SELECTIONMARKMAX | TIC_SELECTIONMARKMIN)

Definition at line 98 of file trackbar.c.

◆ TIC_SELECTIONMARKMAX

#define TIC_SELECTIONMARKMAX   0x80

Definition at line 96 of file trackbar.c.

◆ TIC_SELECTIONMARKMIN

#define TIC_SELECTIONMARKMIN   0x100

Definition at line 97 of file trackbar.c.

◆ TOOLTIP_OFFSET

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

Definition at line 73 of file trackbar.c.

Function Documentation

◆ comp_tics()

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

Definition at line 1128 of file trackbar.c.

1129{
1130 const DWORD a = *(const DWORD *)ap;
1131 const DWORD b = *(const DWORD *)bp;
1132
1133 TRACE("(a=%d, b=%d)\n", a, b);
1134 if (a < b) return -1;
1135 if (a > b) return 1;
1136 return 0;
1137}
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().

◆ get_scaled_metric()

static int get_scaled_metric ( const TRACKBAR_INFO infoPtr,
int  value 
)
static

Definition at line 1475 of file trackbar.c.

1476{
1477 return MulDiv(value, GetDpiForWindow(infoPtr->hwndSelf), 96);
1478}
UINT WINAPI GetDpiForWindow(_In_ HWND hWnd)
Definition: dpi.c:38
INT WINAPI MulDiv(INT nNumber, INT nNumerator, INT nDenominator)
Definition: muldiv.c:25
HWND hwndSelf
Definition: trackbar.c:45
Definition: pdh_main.c:94

Referenced by TRACKBAR_InitializeThumb().

◆ notify()

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

Definition at line 126 of file trackbar.c.

127{
128 NMHDR nmh;
129 return notify_hdr(infoPtr, code, &nmh);
130}
static LRESULT notify_hdr(const TRACKBAR_INFO *infoPtr, INT code, LPNMHDR pnmh)
Definition: trackbar.c:110
Definition: inflate.c:139

◆ notify_customdraw()

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

Definition at line 103 of file trackbar.c.

104{
105 pnmcd->dwDrawStage = stage;
106 return SendMessageW (infoPtr->hwndNotify, WM_NOTIFY,
107 pnmcd->hdr.idFrom, (LPARAM)pnmcd);
108}
#define WM_NOTIFY
Definition: richedit.h:61
HWND hwndNotify
Definition: trackbar.c:57
UINT_PTR idFrom
Definition: winuser.h:3161
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 110 of file trackbar.c.

111{
113
114 TRACE("(code=%d)\n", code);
115
116 pnmh->hwndFrom = infoPtr->hwndSelf;
117 pnmh->idFrom = GetWindowLongPtrW(infoPtr->hwndSelf, GWLP_ID);
118 pnmh->code = code;
119 result = SendMessageW(infoPtr->hwndNotify, WM_NOTIFY, pnmh->idFrom, (LPARAM)pnmh);
120
121 TRACE(" <= %ld\n", result);
122
123 return result;
124}
GLuint64EXT * result
Definition: glext.h:11304
UINT code
Definition: winuser.h:3162
HWND hwndFrom
Definition: winuser.h:3160
LONG_PTR LRESULT
Definition: windef.h:209
#define GetWindowLongPtrW
Definition: winuser.h:4832
#define GWLP_ID
Definition: winuser.h:863

Referenced by notify().

◆ notify_with_scroll()

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

Definition at line 132 of file trackbar.c.

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

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 1721 of file trackbar.c.

1722{
1723 HTHEME theme = GetWindowTheme (infoPtr->hwndSelf);
1724 CloseThemeData (theme);
1725 OpenThemeData (infoPtr->hwndSelf, themeClass);
1726 return 0;
1727}
static const WCHAR themeClass[]
Definition: trackbar.c:100
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 836 of file trackbar.c.

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

Referenced by TRACKBAR_LButtonDown(), and TRACKBAR_LButtonUp().

◆ TRACKBAR_AlignBuddies()

static void TRACKBAR_AlignBuddies ( const TRACKBAR_INFO infoPtr)
static

Definition at line 1026 of file trackbar.c.

1027{
1028 HWND hwndParent = GetParent (infoPtr->hwndSelf);
1029 RECT rcSelf, rcBuddy;
1030 INT x, y;
1031
1032 GetWindowRect (infoPtr->hwndSelf, &rcSelf);
1034
1035 /* align buddy left or above */
1036 if (infoPtr->hwndBuddyLA) {
1037 GetWindowRect (infoPtr->hwndBuddyLA, &rcBuddy);
1039
1040 if (infoPtr->dwStyle & TBS_VERT) {
1041 x = (infoPtr->rcChannel.right + infoPtr->rcChannel.left) / 2 -
1042 (rcBuddy.right - rcBuddy.left) / 2 + rcSelf.left;
1043 y = rcSelf.top - (rcBuddy.bottom - rcBuddy.top);
1044 }
1045 else {
1046 x = rcSelf.left - (rcBuddy.right - rcBuddy.left);
1047 y = (infoPtr->rcChannel.bottom + infoPtr->rcChannel.top) / 2 -
1048 (rcBuddy.bottom - rcBuddy.top) / 2 + rcSelf.top;
1049 }
1050
1051 SetWindowPos (infoPtr->hwndBuddyLA, 0, x, y, 0, 0,
1053 }
1054
1055
1056 /* align buddy right or below */
1057 if (infoPtr->hwndBuddyRB) {
1058 GetWindowRect (infoPtr->hwndBuddyRB, &rcBuddy);
1060
1061 if (infoPtr->dwStyle & TBS_VERT) {
1062 x = (infoPtr->rcChannel.right + infoPtr->rcChannel.left) / 2 -
1063 (rcBuddy.right - rcBuddy.left) / 2 + rcSelf.left;
1064 y = rcSelf.bottom;
1065 }
1066 else {
1067 x = rcSelf.right;
1068 y = (infoPtr->rcChannel.bottom + infoPtr->rcChannel.top) / 2 -
1069 (rcBuddy.bottom - rcBuddy.top) / 2 + rcSelf.top;
1070 }
1071 SetWindowPos (infoPtr->hwndBuddyRB, 0, x, y, 0, 0,
1073 }
1074}
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:64
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:1248
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:1212
HWND WINAPI GetParent(_In_ HWND)
#define SWP_NOZORDER
Definition: winuser.h:1250

Referenced by TRACKBAR_SetBuddy(), and TRACKBAR_Size().

◆ TRACKBAR_AutoPage()

static BOOL TRACKBAR_AutoPage ( TRACKBAR_INFO infoPtr,
POINT  clickPoint 
)
static

Definition at line 441 of file trackbar.c.

442{
443 LONG dir = TRACKBAR_GetAutoPageDirection(infoPtr, clickPoint);
444 LONG prevPos = infoPtr->lPos;
445
446 TRACE("clickPoint=%s, dir=%d\n", wine_dbgstr_point(&clickPoint), dir);
447
448 if (dir > 0 && (infoPtr->flags & TB_AUTO_PAGE_RIGHT))
449 TRACKBAR_PageDown(infoPtr);
450 else if (dir < 0 && (infoPtr->flags & TB_AUTO_PAGE_LEFT))
451 TRACKBAR_PageUp(infoPtr);
452 else return FALSE;
453
454 TRACKBAR_UpdateThumb (infoPtr);
455 TRACKBAR_InvalidateThumbMove (infoPtr, prevPos, infoPtr->lPos);
456
457 return TRUE;
458}
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:393
static LONG TRACKBAR_GetAutoPageDirection(const TRACKBAR_INFO *infoPtr, POINT clickPoint)
Definition: trackbar.c:206
#define TB_AUTO_PAGE_LEFT
Definition: trackbar.c:85
#define TB_AUTO_PAGE_RIGHT
Definition: trackbar.c:86
static void TRACKBAR_PageDown(TRACKBAR_INFO *infoPtr)
Definition: trackbar.c:236
static void TRACKBAR_UpdateThumb(TRACKBAR_INFO *infoPtr)
Definition: trackbar.c:371
static void TRACKBAR_PageUp(TRACKBAR_INFO *infoPtr)
Definition: trackbar.c:248
long LONG
Definition: pedump.c:60
DWORD flags
Definition: trackbar.c:62

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

◆ TRACKBAR_CalcChannel()

static void TRACKBAR_CalcChannel ( TRACKBAR_INFO infoPtr)
static

Definition at line 277 of file trackbar.c.

278{
279 INT cyChannel, offsetthumb, offsetedge;
280 RECT lpRect, *channel = & infoPtr->rcChannel;
281
282 GetClientRect (infoPtr->hwndSelf, &lpRect);
283
284 offsetthumb = infoPtr->uThumbLen / 4;
285 offsetedge = offsetthumb + 3;
286 cyChannel = (infoPtr->dwStyle & TBS_ENABLESELRANGE) ? offsetthumb*3 : 4;
287 if (infoPtr->dwStyle & TBS_VERT) {
288 channel->top = lpRect.top + offsetedge;
289 channel->bottom = lpRect.bottom - offsetedge;
290 if (infoPtr->dwStyle & TBS_ENABLESELRANGE)
291 channel->left = lpRect.left + ((infoPtr->uThumbLen - cyChannel + 2) / 2);
292 else
293 channel->left = lpRect.left + (infoPtr->uThumbLen / 2) - 1;
294 if (infoPtr->dwStyle & TBS_BOTH) {
295 if (infoPtr->dwStyle & TBS_NOTICKS)
296 channel->left += 1;
297 else
298 channel->left += 9;
299 }
300 else if (infoPtr->dwStyle & TBS_TOP) {
301 if (infoPtr->dwStyle & TBS_NOTICKS)
302 channel->left += 2;
303 else
304 channel->left += 10;
305 }
306 channel->right = channel->left + cyChannel;
307 } else {
308 channel->left = lpRect.left + offsetedge;
309 channel->right = lpRect.right - offsetedge;
310 if (infoPtr->dwStyle & TBS_ENABLESELRANGE)
311 channel->top = lpRect.top + ((infoPtr->uThumbLen - cyChannel + 2) / 2);
312 else
313 channel->top = lpRect.top + (infoPtr->uThumbLen / 2) - 1;
314 if (infoPtr->dwStyle & TBS_BOTH) {
315 if (infoPtr->dwStyle & TBS_NOTICKS)
316 channel->top += 1;
317 else
318 channel->top += 9;
319 }
320 else if (infoPtr->dwStyle & TBS_TOP) {
321 if (infoPtr->dwStyle & TBS_NOTICKS)
322 channel->top += 2;
323 else
324 channel->top += 10;
325 }
326 channel->bottom = channel->top + cyChannel;
327 }
328}
#define TBS_BOTH
Definition: commctrl.h:2027
#define TBS_ENABLESELRANGE
Definition: commctrl.h:2029
#define TBS_NOTICKS
Definition: commctrl.h:2028
#define TBS_TOP
Definition: commctrl.h:2023
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 407 of file trackbar.c.

408{
409 RECT *selection = &infoPtr->rcSelection;
410 int range = infoPtr->lRangeMax - infoPtr->lRangeMin;
411 int offsetthumb, height, width;
412
413 if (range <= 0) {
415 } else {
416 if (infoPtr->dwStyle & TBS_VERT) {
417 offsetthumb = (infoPtr->rcThumb.bottom - infoPtr->rcThumb.top)/2;
418 height = infoPtr->rcChannel.bottom - infoPtr->rcChannel.top - offsetthumb*2;
419 selection->top = infoPtr->rcChannel.top + offsetthumb +
420 (height*infoPtr->lSelMin)/range;
421 selection->bottom = infoPtr->rcChannel.top + offsetthumb +
422 (height*infoPtr->lSelMax)/range;
423 selection->left = infoPtr->rcChannel.left + 3;
424 selection->right = infoPtr->rcChannel.right - 3;
425 } else {
426 offsetthumb = (infoPtr->rcThumb.right - infoPtr->rcThumb.left)/2;
427 width = infoPtr->rcChannel.right - infoPtr->rcChannel.left - offsetthumb*2;
428 selection->left = infoPtr->rcChannel.left + offsetthumb +
429 (width*infoPtr->lSelMin)/range;
430 selection->right = infoPtr->rcChannel.left + offsetthumb +
431 (width*infoPtr->lSelMax)/range;
432 selection->top = infoPtr->rcChannel.top + 3;
433 selection->bottom = infoPtr->rcChannel.bottom - 3;
434 }
435 }
436
437 TRACE("selection[%s]\n", wine_dbgstr_rect(selection));
438}
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:66
LONG lRangeMax
Definition: trackbar.c:48
LONG lSelMax
Definition: trackbar.c:52
LONG lRangeMin
Definition: trackbar.c:47
RECT rcSelection
Definition: trackbar.c:65
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 331 of file trackbar.c.

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

Referenced by TRACKBAR_InvalidateThumb(), and TRACKBAR_UpdateThumb().

◆ TRACKBAR_CaptureChanged()

static LRESULT TRACKBAR_CaptureChanged ( const TRACKBAR_INFO infoPtr)
static

Definition at line 1646 of file trackbar.c.

1647{
1649 return 0;
1650}
static void notify_with_scroll(const TRACKBAR_INFO *infoPtr, UINT code)
Definition: trackbar.c:132
#define TB_ENDTRACK
Definition: commctrl.h:2086

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_ClearSel()

static LRESULT TRACKBAR_ClearSel ( TRACKBAR_INFO infoPtr,
BOOL  fRedraw 
)
static

Definition at line 1078 of file trackbar.c.

1079{
1080 infoPtr->lSelMin = 0;
1081 infoPtr->lSelMax = 0;
1082 infoPtr->flags |= TB_SELECTIONCHANGED;
1083
1084 if (fRedraw) TRACKBAR_InvalidateAll(infoPtr);
1085
1086 return 0;
1087}
#define TB_SELECTIONCHANGED
Definition: trackbar.c:83
static void TRACKBAR_InvalidateAll(const TRACKBAR_INFO *infoPtr)
Definition: trackbar.c:377

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_ClearTics()

static LRESULT TRACKBAR_ClearTics ( TRACKBAR_INFO infoPtr,
BOOL  fRedraw 
)
static

Definition at line 1091 of file trackbar.c.

1092{
1093 if (infoPtr->tics) {
1094 Free (infoPtr->tics);
1095 infoPtr->tics = NULL;
1096 infoPtr->uNumTics = 0;
1097 }
1098
1099 if (fRedraw) TRACKBAR_InvalidateAll(infoPtr);
1100
1101 return 0;
1102}
#define NULL
Definition: types.h:112
LPLONG tics
Definition: trackbar.c:67
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 179 of file trackbar.c.

180{
181 double range, width, pos, offsetthumb;
182
183 range = infoPtr->lRangeMax - infoPtr->lRangeMin;
184 if (infoPtr->dwStyle & TBS_VERT) {
185 offsetthumb = (infoPtr->rcThumb.bottom - infoPtr->rcThumb.top)/2;
186 width = infoPtr->rcChannel.bottom - infoPtr->rcChannel.top - (offsetthumb * 2) - 1;
187 pos = (range*(place - infoPtr->rcChannel.top - offsetthumb)) / width;
188 } else {
189 offsetthumb = (infoPtr->rcThumb.right - infoPtr->rcThumb.left)/2;
190 width = infoPtr->rcChannel.right - infoPtr->rcChannel.left - (offsetthumb * 2) - 1;
191 pos = (range*(place - infoPtr->rcChannel.left - offsetthumb)) / width;
192 }
193 pos += infoPtr->lRangeMin;
194 if (pos > infoPtr->lRangeMax)
195 pos = infoPtr->lRangeMax;
196 else if (pos < infoPtr->lRangeMin)
197 pos = infoPtr->lRangeMin;
198
199 TRACE("%.2f\n", pos);
200 return (LONG)floor(pos + 0.5);
201}
_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 1510 of file trackbar.c.

1511{
1512 TRACKBAR_INFO *infoPtr;
1513
1514 infoPtr = Alloc (sizeof(TRACKBAR_INFO));
1515 if (!infoPtr) return -1;
1516 SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr);
1517
1518 /* set default values */
1519 infoPtr->hwndSelf = hwnd;
1520 infoPtr->dwStyle = lpcs->style;
1521 infoPtr->lRangeMin = 0;
1522 infoPtr->lRangeMax = 100;
1523 infoPtr->lLineSize = 1;
1524 infoPtr->lPageSize = TB_DEFAULTPAGESIZE;
1525 infoPtr->lSelMin = 0;
1526 infoPtr->lSelMax = 0;
1527 infoPtr->lPos = 0;
1528 infoPtr->fLocation = TBTS_TOP;
1529 infoPtr->uNumTics = 0; /* start and end tic are not included in count*/
1530 infoPtr->uTicFreq = 1;
1531 infoPtr->tics = NULL;
1532 infoPtr->hwndNotify= lpcs->hwndParent;
1533
1534 TRACKBAR_InitializeThumb (infoPtr);
1535
1536 /* Create tooltip control */
1537 if (infoPtr->dwStyle & TBS_TOOLTIPS) {
1538
1539 infoPtr->hwndToolTip =
1543 hwnd, 0, 0, 0);
1544
1545 if (infoPtr->hwndToolTip) {
1546 TTTOOLINFOW ti;
1547 WCHAR wEmpty = 0;
1548 ZeroMemory (&ti, sizeof(ti));
1549 ti.cbSize = sizeof(ti);
1551 ti.hwnd = hwnd;
1552 ti.lpszText = &wEmpty;
1553
1554 SendMessageW (infoPtr->hwndToolTip, TTM_ADDTOOLW, 0, (LPARAM)&ti);
1555 }
1556 }
1557
1559
1560 return 0;
1561}
PVOID Alloc(IN DWORD dwFlags, IN SIZE_T dwBytes)
Definition: main.c:63
static LRESULT TRACKBAR_InitializeThumb(TRACKBAR_INFO *infoPtr)
Definition: trackbar.c:1481
#define TB_DEFAULTPAGESIZE
Definition: trackbar.c:75
#define WS_POPUP
Definition: pedump.c:616
#define TBS_TOOLTIPS
Definition: commctrl.h:2032
#define TOOLTIPS_CLASSW
Definition: commctrl.h:1707
#define TTF_IDISHWND
Definition: commctrl.h:1764
#define TTM_ADDTOOLW
Definition: commctrl.h:1792
#define TTF_ABSOLUTE
Definition: commctrl.h:1769
#define TBTS_TOP
Definition: commctrl.h:2068
#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:5358
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_Destroy()

static LRESULT TRACKBAR_Destroy ( TRACKBAR_INFO infoPtr)
static

Definition at line 1565 of file trackbar.c.

1566{
1567 /* delete tooltip control */
1568 if (infoPtr->hwndToolTip)
1569 DestroyWindow (infoPtr->hwndToolTip);
1570
1571 Free (infoPtr->tics);
1572 infoPtr->tics = NULL;
1573
1574 SetWindowLongPtrW (infoPtr->hwndSelf, 0, 0);
1576 Free (infoPtr);
1577
1578 return 0;
1579}
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 463 of file trackbar.c.

464{
465 RECT rcChannel = infoPtr->rcChannel;
466 HTHEME theme = GetWindowTheme (infoPtr->hwndSelf);
467
468 if (theme)
469 {
470 DrawThemeBackground (theme, hdc,
471 (infoPtr->dwStyle & TBS_VERT) ?
472 TKP_TRACKVERT : TKP_TRACK, TKS_NORMAL, &rcChannel, 0);
473 }
474 else
475 {
476 DrawEdge (hdc, &rcChannel, EDGE_SUNKEN, BF_RECT | BF_ADJUST);
477 if (infoPtr->dwStyle & TBS_ENABLESELRANGE) { /* fill the channel */
478 FillRect (hdc, &rcChannel, GetStockObject(WHITE_BRUSH));
479 if (TRACKBAR_HasSelection(infoPtr))
481 }
482 }
483}
static BOOL TRACKBAR_HasSelection(const TRACKBAR_INFO *infoPtr)
Definition: trackbar.c:401
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:929
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 486 of file trackbar.c.

487{
488 int x, y, ox, oy, range, side, indent = 0, len = 3;
489 int offsetthumb;
490 RECT rcTics;
491
492 if (flags & TBS_VERT) {
493 offsetthumb = (infoPtr->rcThumb.bottom - infoPtr->rcThumb.top)/2;
494 SetRect(&rcTics, infoPtr->rcThumb.left - 2, infoPtr->rcChannel.top + offsetthumb,
495 infoPtr->rcThumb.right + 2, infoPtr->rcChannel.bottom - offsetthumb - 1);
496 } else {
497 offsetthumb = (infoPtr->rcThumb.right - infoPtr->rcThumb.left)/2;
498 SetRect(&rcTics, infoPtr->rcChannel.left + offsetthumb, infoPtr->rcThumb.top - 2,
499 infoPtr->rcChannel.right - offsetthumb - 1, infoPtr->rcThumb.bottom + 2);
500 }
501
502 if (flags & (TBS_TOP | TBS_LEFT)) {
503 x = rcTics.left;
504 y = rcTics.top;
505 side = -1;
506 } else {
507 x = rcTics.right;
508 y = rcTics.bottom;
509 side = 1;
510 }
511
512 range = infoPtr->lRangeMax - infoPtr->lRangeMin;
513 if (range <= 0)
514 range = 1; /* to avoid division by zero */
515
516 if (flags & TIC_SELECTIONMARK) {
517 indent = (flags & TIC_SELECTIONMARKMIN) ? -1 : 1;
518 } else if (flags & TIC_EDGE) {
519 len++;
520 }
521
522 if (flags & TBS_VERT) {
523 int height = rcTics.bottom - rcTics.top;
524 y = rcTics.top + (height*(ticPos - infoPtr->lRangeMin))/range;
525 } else {
526 int width = rcTics.right - rcTics.left;
527 x = rcTics.left + (width*(ticPos - infoPtr->lRangeMin))/range;
528 }
529
530 ox = x;
531 oy = y;
532 MoveToEx(hdc, x, y, 0);
533 if (flags & TBS_VERT) x += len * side;
534 else y += len * side;
535 LineTo(hdc, x, y);
536
537 if (flags & TIC_SELECTIONMARK) {
538 if (flags & TBS_VERT) {
539 x -= side;
540 } else {
541 y -= side;
542 }
543 MoveToEx(hdc, x, y, 0);
544 if (flags & TBS_VERT) {
545 y += 2 * indent;
546 } else {
547 x += 2 * indent;
548 }
549
550 LineTo(hdc, x, y);
551 LineTo(hdc, ox, oy);
552 }
553}
#define TIC_SELECTIONMARK
Definition: trackbar.c:98
#define TIC_EDGE
Definition: trackbar.c:95
#define TIC_SELECTIONMARKMIN
Definition: trackbar.c:97
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 697 of file trackbar.c.

698{
699 HTHEME theme = GetWindowTheme (infoPtr->hwndSelf);
700 int PointDepth;
701 HBRUSH brush;
702
703 if (theme)
704 {
705 int partId;
706 int stateId;
707 if (infoPtr->dwStyle & TBS_BOTH)
708 partId = (infoPtr->dwStyle & TBS_VERT) ? TKP_THUMBVERT : TKP_THUMB;
709 else if (infoPtr->dwStyle & TBS_LEFT)
710 partId = (infoPtr->dwStyle & TBS_VERT) ? TKP_THUMBLEFT : TKP_THUMBTOP;
711 else
712 partId = (infoPtr->dwStyle & TBS_VERT) ? TKP_THUMBRIGHT : TKP_THUMBBOTTOM;
713
714 if (infoPtr->dwStyle & WS_DISABLED)
715 stateId = TUS_DISABLED;
716 else if (infoPtr->flags & TB_DRAG_MODE)
717 stateId = TUS_PRESSED;
718 else if (infoPtr->flags & TB_THUMB_HOT)
719 stateId = TUS_HOT;
720 else
721 stateId = TUS_NORMAL;
722
723 DrawThemeBackground (theme, hdc, partId, stateId, &infoPtr->rcThumb, NULL);
724
725 return;
726 }
727
728 if (infoPtr->dwStyle & WS_DISABLED || infoPtr->flags & TB_DRAG_MODE)
729 {
732 else
734
737 }
738 else
740
741 PointDepth = TRACKBAR_FillThumb(infoPtr, hdc, brush);
742
743 if (infoPtr->dwStyle & TBS_BOTH)
744 {
746 return;
747 }
748 else
749 {
750 RECT thumb = infoPtr->rcThumb;
751
752 if (infoPtr->dwStyle & TBS_VERT)
753 {
754 if (infoPtr->dwStyle & TBS_LEFT)
755 {
756 /* rectangular part */
757 thumb.left += PointDepth;
759
760 /* light edge */
761 thumb.left -= PointDepth;
762 thumb.right = thumb.left + PointDepth;
763 thumb.bottom = infoPtr->rcThumb.top + PointDepth + 1;
764 thumb.top = infoPtr->rcThumb.top;
766
767 /* shadowed edge */
768 thumb.top += PointDepth;
769 thumb.bottom += PointDepth;
771 return;
772 }
773 else
774 {
775 /* rectangular part */
776 thumb.right -= PointDepth;
778
779 /* light edge */
780 thumb.left = thumb.right;
781 thumb.right += PointDepth + 1;
782 thumb.bottom = infoPtr->rcThumb.top + PointDepth + 1;
783 thumb.top = infoPtr->rcThumb.top;
785
786 /* shadowed edge */
787 thumb.top += PointDepth;
788 thumb.bottom += PointDepth;
790 }
791 }
792 else
793 {
794 if (infoPtr->dwStyle & TBS_TOP)
795 {
796 /* rectangular part */
797 thumb.top += PointDepth;
799
800 /* light edge */
801 thumb.left = infoPtr->rcThumb.left;
802 thumb.right = thumb.left + PointDepth;
803 thumb.bottom = infoPtr->rcThumb.top + PointDepth + 1;
804 thumb.top -= PointDepth;
806
807 /* shadowed edge */
808 thumb.left += PointDepth;
809 thumb.right += PointDepth;
811 }
812 else
813 {
814 /* rectangular part */
815 thumb.bottom -= PointDepth;
817
818 /* light edge */
819 thumb.left = infoPtr->rcThumb.left;
820 thumb.right = thumb.left + PointDepth;
821 thumb.top = infoPtr->rcThumb.bottom - PointDepth - 1;
822 thumb.bottom += PointDepth;
824
825 /* shadowed edge */
826 thumb.left += PointDepth;
827 thumb.right += PointDepth;
829 }
830 }
831 }
832}
COMCTL32_SysColor comctl32_color
Definition: commctrl.c:82
HBRUSH COMCTL32_hPattern55AABrush
Definition: commctrl.c:81
#define TB_THUMB_HOT
Definition: trackbar.c:88
#define TB_DRAG_MODE
Definition: trackbar.c:84
static int TRACKBAR_FillThumb(const TRACKBAR_INFO *infoPtr, HDC hdc, HBRUSH hbrush)
Definition: trackbar.c:606
#define WS_DISABLED
Definition: pedump.c:621
COLORREF clrWindow
Definition: comctl32.h:182
COLORREF clr3dFace
Definition: comctl32.h:181
COLORREF clr3dHilight
Definition: comctl32.h:178
@ 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:915
#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:931

Referenced by TRACKBAR_Refresh().

◆ TRACKBAR_DrawTic()

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

Definition at line 557 of file trackbar.c.

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

Referenced by TRACKBAR_DrawTics().

◆ TRACKBAR_DrawTics()

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

Definition at line 567 of file trackbar.c.

568{
569 unsigned int i;
570 int ticFlags = infoPtr->dwStyle & 0x0f;
571 LOGPEN ticPen = { PS_SOLID, {1, 0}, GetSysColor (COLOR_3DDKSHADOW) };
572 HPEN hOldPen, hTicPen;
573 HTHEME theme = GetWindowTheme (infoPtr->hwndSelf);
574
575 if (theme)
576 {
577 int part = (infoPtr->dwStyle & TBS_VERT) ? TKP_TICSVERT : TKP_TICS;
578 GetThemeColor (theme, part, TSS_NORMAL, TMT_COLOR, &ticPen.lopnColor);
579 }
580 /* create the pen to draw the tics with */
581 hTicPen = CreatePenIndirect(&ticPen);
582 hOldPen = hTicPen ? SelectObject(hdc, hTicPen) : 0;
583
584 /* actually draw the tics */
585 for (i=0; i<infoPtr->uNumTics; i++)
586 TRACKBAR_DrawTic (infoPtr, hdc, infoPtr->tics[i], ticFlags);
587
588 TRACKBAR_DrawTic (infoPtr, hdc, infoPtr->lRangeMin, ticFlags | TIC_EDGE);
589 TRACKBAR_DrawTic (infoPtr, hdc, infoPtr->lRangeMax, ticFlags | TIC_EDGE);
590
591 if ((infoPtr->dwStyle & TBS_ENABLESELRANGE) && TRACKBAR_HasSelection(infoPtr)) {
592 TRACKBAR_DrawTic (infoPtr, hdc, infoPtr->lSelMin,
593 ticFlags | TIC_SELECTIONMARKMIN);
594 TRACKBAR_DrawTic (infoPtr, hdc, infoPtr->lSelMax,
595 ticFlags | TIC_SELECTIONMARKMAX);
596 }
597
598 /* clean up the pen, if we created one */
599 if (hTicPen) {
600 SelectObject(hdc, hOldPen);
601 DeleteObject(hTicPen);
602 }
603}
static void TRACKBAR_DrawTic(const TRACKBAR_INFO *infoPtr, HDC hdc, LONG ticPos, int flags)
Definition: trackbar.c:557
#define TIC_SELECTIONMARKMAX
Definition: trackbar.c:96
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:1546
#define PS_SOLID
Definition: wingdi.h:586
DWORD WINAPI GetSysColor(_In_ int)
#define COLOR_3DDKSHADOW
Definition: winuser.h:942

Referenced by TRACKBAR_Refresh().

◆ TRACKBAR_Enable()

static LRESULT TRACKBAR_Enable ( TRACKBAR_INFO infoPtr,
BOOL  enable 
)
static

Definition at line 1866 of file trackbar.c.

1867{
1868 if (enable)
1869 infoPtr->dwStyle &= ~WS_DISABLED;
1870 else
1871 infoPtr->dwStyle |= WS_DISABLED;
1872
1873 InvalidateRect(infoPtr->hwndSelf, &infoPtr->rcThumb, TRUE);
1874
1875 return 1;
1876}
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 606 of file trackbar.c.

607{
608 const RECT *thumb = &infoPtr->rcThumb;
609 POINT points[6];
610 int PointDepth;
611 HBRUSH oldbr;
612
613 if (infoPtr->dwStyle & TBS_BOTH)
614 {
615 FillRect(hdc, thumb, hbrush);
616 return 0;
617 }
618
619 if (infoPtr->dwStyle & TBS_VERT)
620 {
621 PointDepth = (thumb->bottom - thumb->top) / 2;
622 if (infoPtr->dwStyle & TBS_LEFT)
623 {
624 points[0].x = thumb->right-1;
625 points[0].y = thumb->top;
626 points[1].x = thumb->right-1;
627 points[1].y = thumb->bottom-1;
628 points[2].x = thumb->left + PointDepth;
629 points[2].y = thumb->bottom-1;
630 points[3].x = thumb->left;
631 points[3].y = thumb->top + PointDepth;
632 points[4].x = thumb->left + PointDepth;
633 points[4].y = thumb->top;
634 points[5].x = points[0].x;
635 points[5].y = points[0].y;
636 }
637 else
638 {
639 points[0].x = thumb->right;
640 points[0].y = thumb->top + PointDepth;
641 points[1].x = thumb->right - PointDepth;
642 points[1].y = thumb->bottom-1;
643 points[2].x = thumb->left;
644 points[2].y = thumb->bottom-1;
645 points[3].x = thumb->left;
646 points[3].y = thumb->top;
647 points[4].x = thumb->right - PointDepth;
648 points[4].y = thumb->top;
649 points[5].x = points[0].x;
650 points[5].y = points[0].y;
651 }
652 }
653 else
654 {
655 PointDepth = (thumb->right - thumb->left) / 2;
656 if (infoPtr->dwStyle & TBS_TOP)
657 {
658 points[0].x = thumb->left + PointDepth;
659 points[0].y = thumb->top+1;
660 points[1].x = thumb->right-1;
661 points[1].y = thumb->top + PointDepth + 1;
662 points[2].x = thumb->right-1;
663 points[2].y = thumb->bottom-1;
664 points[3].x = thumb->left;
665 points[3].y = thumb->bottom-1;
666 points[4].x = thumb->left;
667 points[4].y = thumb->top + PointDepth + 1;
668 points[5].x = points[0].x;
669 points[5].y = points[0].y;
670 }
671 else
672 {
673 points[0].x = thumb->right-1;
674 points[0].y = thumb->top;
675 points[1].x = thumb->right-1;
676 points[1].y = thumb->bottom - PointDepth - 1;
677 points[2].x = thumb->left + PointDepth;
678 points[2].y = thumb->bottom-1;
679 points[3].x = thumb->left;
680 points[3].y = thumb->bottom - PointDepth - 1;
681 points[4].x = thumb->left;
682 points[4].y = thumb->top;
683 points[5].x = points[0].x;
684 points[5].y = points[0].y;
685 }
686 }
687
688 oldbr = SelectObject(hdc, hbrush);
691 SelectObject(hdc, oldbr);
692
693 return PointDepth;
694}
static HBRUSH hbrush
#define WINDING
Definition: constants.h:279
#define ARRAY_SIZE(A)
Definition: main.h:20
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:1174

Referenced by TRACKBAR_DrawThumb().

◆ TRACKBAR_GetAutoPageDirection()

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

Definition at line 206 of file trackbar.c.

207{
208 RECT pageRect;
209
210 if (infoPtr->dwStyle & TBS_VERT) {
211 pageRect.top = infoPtr->rcChannel.top;
212 pageRect.bottom = infoPtr->rcChannel.bottom;
213 pageRect.left = infoPtr->rcThumb.left;
214 pageRect.right = infoPtr->rcThumb.right;
215 } else {
216 pageRect.top = infoPtr->rcThumb.top;
217 pageRect.bottom = infoPtr->rcThumb.bottom;
218 pageRect.left = infoPtr->rcChannel.left;
219 pageRect.right = infoPtr->rcChannel.right;
220 }
221
222
223 if (PtInRect(&pageRect, clickPoint))
224 {
225 int clickPlace = (infoPtr->dwStyle & TBS_VERT) ? clickPoint.y : clickPoint.x;
226
227 LONG clickPos = TRACKBAR_ConvertPlaceToPosition(infoPtr, clickPlace);
228
229 return clickPos - infoPtr->lPos;
230 }
231
232 return 0;
233}
static LONG TRACKBAR_ConvertPlaceToPosition(const TRACKBAR_INFO *infoPtr, int place)
Definition: trackbar.c:179
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 1106 of file trackbar.c.

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

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_GetNumTics()

static LONG TRACKBAR_GetNumTics ( const TRACKBAR_INFO infoPtr)
inlinestatic

Definition at line 1120 of file trackbar.c.

1121{
1122 if (infoPtr->dwStyle & TBS_NOTICKS) return 0;
1123
1124 return infoPtr->uNumTics + 2;
1125}

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_GetTic()

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

Definition at line 1141 of file trackbar.c.

1142{
1143 if ((iTic < 0) || (iTic >= infoPtr->uNumTics) || !infoPtr->tics)
1144 return -1;
1145
1146 qsort(infoPtr->tics, infoPtr->uNumTics, sizeof(DWORD), comp_tics);
1147 return infoPtr->tics[iTic];
1148}
static int __cdecl comp_tics(const void *ap, const void *bp)
Definition: trackbar.c:1128
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 1152 of file trackbar.c.

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

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_HasSelection()

static BOOL TRACKBAR_HasSelection ( const TRACKBAR_INFO infoPtr)
inlinestatic

Definition at line 401 of file trackbar.c.

402{
403 return infoPtr->lSelMin != infoPtr->lSelMax;
404}

Referenced by TRACKBAR_DrawChannel(), and TRACKBAR_DrawTics().

◆ TRACKBAR_InitializeThumb()

static LRESULT TRACKBAR_InitializeThumb ( TRACKBAR_INFO infoPtr)
static

Definition at line 1481 of file trackbar.c.

1482{
1483 int client_size;
1484 RECT rect;
1485
1486 infoPtr->uThumbLen = get_scaled_metric(infoPtr, infoPtr->dwStyle & TBS_ENABLESELRANGE ? 23 : 21);
1487
1488 if (!(infoPtr->dwStyle & TBS_FIXEDLENGTH))
1489 {
1490 GetClientRect(infoPtr->hwndSelf, &rect);
1491 if (infoPtr->dwStyle & TBS_VERT)
1492 client_size = rect.right - rect.left;
1493 else
1494 client_size = rect.bottom - rect.top;
1495
1496 if (client_size < infoPtr->uThumbLen)
1497 infoPtr->uThumbLen = client_size > get_scaled_metric(infoPtr, 9) ?
1498 client_size - get_scaled_metric(infoPtr, 5) : get_scaled_metric(infoPtr, 4);
1499 }
1500
1501 TRACKBAR_CalcChannel (infoPtr);
1502 TRACKBAR_UpdateThumb (infoPtr);
1503 infoPtr->flags &= ~TB_SELECTIONCHANGED;
1504
1505 return 0;
1506}
static void TRACKBAR_CalcChannel(TRACKBAR_INFO *infoPtr)
Definition: trackbar.c:277
static int get_scaled_metric(const TRACKBAR_INFO *infoPtr, int value)
Definition: trackbar.c:1475
#define TBS_FIXEDLENGTH
Definition: commctrl.h:2030
& 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 383 of file trackbar.c.

384{
385 RECT rcThumb;
386
387 TRACKBAR_CalcThumb(infoPtr, thumbPos, &rcThumb);
388 InflateRect(&rcThumb, 1, 1);
389 InvalidateRect(infoPtr->hwndSelf, &rcThumb, FALSE);
390}
static void TRACKBAR_CalcThumb(const TRACKBAR_INFO *infoPtr, LONG lPos, RECT *thumb)
Definition: trackbar.c:331
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 393 of file trackbar.c.

394{
395 TRACKBAR_InvalidateThumb (infoPtr, oldPos);
396 if (newPos != oldPos)
397 TRACKBAR_InvalidateThumb (infoPtr, newPos);
398}
static void TRACKBAR_InvalidateThumb(const TRACKBAR_INFO *infoPtr, LONG thumbPos)
Definition: trackbar.c:383

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 1793 of file trackbar.c.

1794{
1795 BOOL downIsLeft = infoPtr->dwStyle & TBS_DOWNISLEFT;
1796 BOOL vert = infoPtr->dwStyle & TBS_VERT;
1797 LONG pos = infoPtr->lPos;
1798
1799 TRACE("%x\n", nVirtKey);
1800
1801 switch (nVirtKey) {
1802 case VK_UP:
1803 if (!vert && downIsLeft) TRACKBAR_LineDown(infoPtr);
1804 else TRACKBAR_LineUp(infoPtr);
1805 break;
1806 case VK_LEFT:
1807 if (vert && downIsLeft) TRACKBAR_LineDown(infoPtr);
1808 else TRACKBAR_LineUp(infoPtr);
1809 break;
1810 case VK_DOWN:
1811 if (!vert && downIsLeft) TRACKBAR_LineUp(infoPtr);
1812 else TRACKBAR_LineDown(infoPtr);
1813 break;
1814 case VK_RIGHT:
1815 if (vert && downIsLeft) TRACKBAR_LineUp(infoPtr);
1816 else TRACKBAR_LineDown(infoPtr);
1817 break;
1818 case VK_NEXT:
1819 if (!vert && downIsLeft) TRACKBAR_PageUp(infoPtr);
1820 else TRACKBAR_PageDown(infoPtr);
1821 break;
1822 case VK_PRIOR:
1823 if (!vert && downIsLeft) TRACKBAR_PageDown(infoPtr);
1824 else TRACKBAR_PageUp(infoPtr);
1825 break;
1826 case VK_HOME:
1827 if (infoPtr->lPos == infoPtr->lRangeMin) return FALSE;
1828 infoPtr->lPos = infoPtr->lRangeMin;
1829 notify_with_scroll (infoPtr, TB_TOP);
1830 break;
1831 case VK_END:
1832 if (infoPtr->lPos == infoPtr->lRangeMax) return FALSE;
1833 infoPtr->lPos = infoPtr->lRangeMax;
1834 notify_with_scroll (infoPtr, TB_BOTTOM);
1835 break;
1836 }
1837
1838 if (pos != infoPtr->lPos) {
1839 TRACKBAR_UpdateThumb (infoPtr);
1840 TRACKBAR_InvalidateThumbMove (infoPtr, pos, infoPtr->lPos);
1841 }
1842
1843 return TRUE;
1844}
static void TRACKBAR_LineDown(TRACKBAR_INFO *infoPtr)
Definition: trackbar.c:267
static void TRACKBAR_LineUp(TRACKBAR_INFO *infoPtr)
Definition: trackbar.c:258
unsigned int BOOL
Definition: ntddk_ex.h:94
#define TB_TOP
Definition: commctrl.h:2084
#define TB_BOTTOM
Definition: commctrl.h:2085
#define TBS_DOWNISLEFT
Definition: commctrl.h:2034
#define VK_UP
Definition: winuser.h:2228
#define VK_NEXT
Definition: winuser.h:2224
#define VK_END
Definition: winuser.h:2225
#define VK_HOME
Definition: winuser.h:2226
#define VK_LEFT
Definition: winuser.h:2227
#define VK_RIGHT
Definition: winuser.h:2229
#define VK_DOWN
Definition: winuser.h:2230
#define VK_PRIOR
Definition: winuser.h:2223

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_KeyUp()

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

Definition at line 1848 of file trackbar.c.

1849{
1850 switch (nVirtKey) {
1851 case VK_LEFT:
1852 case VK_UP:
1853 case VK_RIGHT:
1854 case VK_DOWN:
1855 case VK_NEXT:
1856 case VK_PRIOR:
1857 case VK_HOME:
1858 case VK_END:
1860 }
1861 return TRUE;
1862}

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_KillFocus()

static LRESULT TRACKBAR_KillFocus ( TRACKBAR_INFO infoPtr)
static

Definition at line 1583 of file trackbar.c.

1584{
1585 TRACE("\n");
1586 infoPtr->flags &= ~TB_IS_FOCUSED;
1587 TRACKBAR_InvalidateAll(infoPtr);
1588
1589 return 0;
1590}

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_LButtonDown()

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

Definition at line 1593 of file trackbar.c.

1594{
1595 POINT clickPoint;
1596
1597 clickPoint.x = x;
1598 clickPoint.y = y;
1599
1600 SetFocus(infoPtr->hwndSelf);
1601
1602 if (PtInRect(&infoPtr->rcThumb, clickPoint)) {
1603 infoPtr->flags |= TB_DRAG_MODE;
1604 SetCapture (infoPtr->hwndSelf);
1605 TRACKBAR_UpdateToolTip (infoPtr);
1606 TRACKBAR_ActivateToolTip (infoPtr, TRUE);
1607 TRACKBAR_InvalidateThumb(infoPtr, infoPtr->lPos);
1608 } else {
1609 LONG dir = TRACKBAR_GetAutoPageDirection(infoPtr, clickPoint);
1610 if (dir == 0) return 0;
1611 infoPtr->flags |= (dir < 0) ? TB_AUTO_PAGE_LEFT : TB_AUTO_PAGE_RIGHT;
1612 TRACKBAR_AutoPage (infoPtr, clickPoint);
1613 SetCapture (infoPtr->hwndSelf);
1615 }
1616
1617 return 0;
1618}
static BOOL TRACKBAR_AutoPage(TRACKBAR_INFO *infoPtr, POINT clickPoint)
Definition: trackbar.c:441
#define TB_REFRESH_TIMER
Definition: trackbar.c:70
#define TB_REFRESH_DELAY
Definition: trackbar.c:71
static void TRACKBAR_ActivateToolTip(const TRACKBAR_INFO *infoPtr, BOOL fShow)
Definition: trackbar.c:836
static void TRACKBAR_UpdateToolTip(const TRACKBAR_INFO *infoPtr)
Definition: trackbar.c:851
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 1622 of file trackbar.c.

1623{
1624 if (infoPtr->flags & TB_DRAG_MODE) {
1625 notify_with_scroll (infoPtr, TB_THUMBPOSITION | (infoPtr->lPos<<16));
1627 infoPtr->flags &= ~TB_DRAG_MODE;
1628 ReleaseCapture ();
1629 notify(infoPtr, NM_RELEASEDCAPTURE);
1631 TRACKBAR_InvalidateThumb(infoPtr, infoPtr->lPos);
1632 }
1633 if (infoPtr->flags & TB_AUTO_PAGE) {
1635 infoPtr->flags &= ~TB_AUTO_PAGE;
1637 ReleaseCapture ();
1638 notify(infoPtr, NM_RELEASEDCAPTURE);
1639 }
1640
1641 return 0;
1642}
#define TB_AUTO_PAGE
Definition: trackbar.c:87
int notify
Definition: msacm.c:1366
#define NM_RELEASEDCAPTURE
Definition: commctrl.h:141
#define TB_THUMBPOSITION
Definition: commctrl.h:2082
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 267 of file trackbar.c.

268{
269 if (infoPtr->lPos == infoPtr->lRangeMax) return;
270 infoPtr->lPos += infoPtr->lLineSize;
271 if (infoPtr->lPos > infoPtr->lRangeMax)
272 infoPtr->lPos = infoPtr->lRangeMax;
274}
#define TB_LINEDOWN
Definition: commctrl.h:2079

Referenced by TRACKBAR_KeyDown().

◆ TRACKBAR_LineUp()

static void TRACKBAR_LineUp ( TRACKBAR_INFO infoPtr)
inlinestatic

Definition at line 258 of file trackbar.c.

259{
260 if (infoPtr->lPos == infoPtr->lRangeMin) return;
261 infoPtr->lPos -= infoPtr->lLineSize;
262 if (infoPtr->lPos < infoPtr->lRangeMin)
263 infoPtr->lPos = infoPtr->lRangeMin;
264 notify_with_scroll (infoPtr, TB_LINEUP);
265}
#define TB_LINEUP
Definition: commctrl.h:2078

Referenced by TRACKBAR_KeyDown().

◆ TRACKBAR_MouseMove()

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

Definition at line 1731 of file trackbar.c.

1732{
1733 INT clickPlace = (infoPtr->dwStyle & TBS_VERT) ? y : x;
1734 LONG dragPos, oldPos = infoPtr->lPos;
1735
1736 TRACE("(x=%d. y=%d)\n", x, y);
1737
1738 if (infoPtr->flags & TB_AUTO_PAGE) {
1739 POINT pt;
1740 pt.x = x;
1741 pt.y = y;
1742 TRACKBAR_AutoPage (infoPtr, pt);
1743 return TRUE;
1744 }
1745
1746 if (!(infoPtr->flags & TB_DRAG_MODE))
1747 {
1748 if (GetWindowTheme (infoPtr->hwndSelf))
1749 {
1750 DWORD oldFlags = infoPtr->flags;
1751 POINT pt;
1752 pt.x = x;
1753 pt.y = y;
1754 if (PtInRect (&infoPtr->rcThumb, pt))
1755 {
1756 TRACKMOUSEEVENT tme;
1757 tme.cbSize = sizeof( tme );
1758 tme.dwFlags = TME_LEAVE;
1759 tme.hwndTrack = infoPtr->hwndSelf;
1760 TrackMouseEvent( &tme );
1761 infoPtr->flags |= TB_THUMB_HOT;
1762 }
1763 else
1764 {
1765 TRACKMOUSEEVENT tme;
1766 tme.cbSize = sizeof( tme );
1767 tme.dwFlags = TME_CANCEL;
1768 tme.hwndTrack = infoPtr->hwndSelf;
1769 TrackMouseEvent( &tme );
1770 infoPtr->flags &= ~TB_THUMB_HOT;
1771 }
1772 if (oldFlags != infoPtr->flags) InvalidateRect (infoPtr->hwndSelf, &infoPtr->rcThumb, FALSE);
1773 }
1774 return TRUE;
1775 }
1776
1777 dragPos = TRACKBAR_ConvertPlaceToPosition (infoPtr, clickPlace);
1778
1779 if (dragPos == oldPos) return TRUE;
1780
1781 infoPtr->lPos = dragPos;
1782 TRACKBAR_UpdateThumb (infoPtr);
1783
1784 notify_with_scroll (infoPtr, TB_THUMBTRACK | (infoPtr->lPos<<16));
1785
1786 TRACKBAR_InvalidateThumbMove(infoPtr, oldPos, dragPos);
1787 UpdateWindow (infoPtr->hwndSelf);
1788
1789 return TRUE;
1790}
#define pt(x, y)
Definition: drawing.c:79
#define TME_CANCEL
Definition: commctrl.h:4989
#define TME_LEAVE
Definition: commctrl.h:4986
#define TB_THUMBTRACK
Definition: commctrl.h:2083
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 236 of file trackbar.c.

237{
238 if (infoPtr->lPos == infoPtr->lRangeMax) return;
239
240 infoPtr->lPos += infoPtr->lPageSize;
241 if (infoPtr->lPos > infoPtr->lRangeMax)
242 infoPtr->lPos = infoPtr->lRangeMax;
244}
#define TB_PAGEDOWN
Definition: commctrl.h:2081

Referenced by TRACKBAR_AutoPage(), and TRACKBAR_KeyDown().

◆ TRACKBAR_PageUp()

static void TRACKBAR_PageUp ( TRACKBAR_INFO infoPtr)
inlinestatic

Definition at line 248 of file trackbar.c.

249{
250 if (infoPtr->lPos == infoPtr->lRangeMin) return;
251
252 infoPtr->lPos -= infoPtr->lPageSize;
253 if (infoPtr->lPos < infoPtr->lRangeMin)
254 infoPtr->lPos = infoPtr->lRangeMin;
255 notify_with_scroll (infoPtr, TB_PAGEUP);
256}
#define TB_PAGEUP
Definition: commctrl.h:2080

Referenced by TRACKBAR_AutoPage(), and TRACKBAR_KeyDown().

◆ TRACKBAR_Paint()

static LRESULT TRACKBAR_Paint ( TRACKBAR_INFO infoPtr,
HDC  hdc 
)
static

Definition at line 1654 of file trackbar.c.

1655{
1656 if (hdc) {
1657 TRACKBAR_Refresh(infoPtr, hdc);
1658 } else {
1659 PAINTSTRUCT ps;
1660 hdc = BeginPaint (infoPtr->hwndSelf, &ps);
1661 TRACKBAR_Refresh (infoPtr, hdc);
1662 EndPaint (infoPtr->hwndSelf, &ps);
1663 }
1664
1665 return 0;
1666}
static void TRACKBAR_Refresh(TRACKBAR_INFO *infoPtr, HDC hdcDst)
Definition: trackbar.c:894
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 141 of file trackbar.c.

142{
143 int tic;
144 unsigned nrTics, i;
145
146 if (infoPtr->uTicFreq && infoPtr->lRangeMax >= infoPtr->lRangeMin) {
147 nrTics=(infoPtr->lRangeMax - infoPtr->lRangeMin)/infoPtr->uTicFreq;
148 /* don't add extra tic if there's no remainder */
149 if (nrTics && ((infoPtr->lRangeMax - infoPtr->lRangeMin) % infoPtr->uTicFreq == 0))
150 nrTics--;
151 }
152 else {
153 Free (infoPtr->tics);
154 infoPtr->tics = NULL;
155 infoPtr->uNumTics = 0;
156 return;
157 }
158
159 if (nrTics != infoPtr->uNumTics) {
160 infoPtr->tics=ReAlloc (infoPtr->tics,
161 (nrTics+1)*sizeof (DWORD));
162 if (!infoPtr->tics) {
163 infoPtr->uNumTics = 0;
164 notify(infoPtr, NM_OUTOFMEMORY);
165 return;
166 }
167 infoPtr->uNumTics = nrTics;
168 }
169
170 tic = infoPtr->lRangeMin + infoPtr->uTicFreq;
171 for (i = 0; i < nrTics; i++, tic += infoPtr->uTicFreq)
172 infoPtr->tics[i] = tic;
173}
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 894 of file trackbar.c.

895{
896 RECT rcClient;
897 HDC hdc;
898 HBITMAP hOldBmp = 0, hOffScreenBmp = 0;
899 NMCUSTOMDRAW nmcd;
900 int gcdrf, icdrf;
901
902 if (infoPtr->flags & TB_THUMBCHANGED) {
903 TRACKBAR_UpdateThumb (infoPtr);
904 if (infoPtr->flags & TB_THUMBSIZECHANGED)
905 TRACKBAR_CalcChannel (infoPtr);
906 }
907 if (infoPtr->flags & TB_SELECTIONCHANGED)
908 TRACKBAR_CalcSelection (infoPtr);
909
910 if (infoPtr->flags & TB_DRAG_MODE)
911 TRACKBAR_UpdateToolTip (infoPtr);
912
913 infoPtr->flags &= ~ (TB_THUMBCHANGED | TB_SELECTIONCHANGED);
914
915 GetClientRect (infoPtr->hwndSelf, &rcClient);
916
917 /* try to render offscreen, if we fail, carrry onscreen */
919 if (hdc) {
920 hOffScreenBmp = CreateCompatibleBitmap(hdcDst, rcClient.right, rcClient.bottom);
921 if (hOffScreenBmp) {
922 hOldBmp = SelectObject(hdc, hOffScreenBmp);
923 } else {
925 hdc = hdcDst;
926 }
927 } else {
928 hdc = hdcDst;
929 }
930
931 ZeroMemory(&nmcd, sizeof(nmcd));
932 nmcd.hdr.hwndFrom = infoPtr->hwndSelf;
933 nmcd.hdr.idFrom = GetWindowLongPtrW (infoPtr->hwndSelf, GWLP_ID);
934 nmcd.hdr.code = NM_CUSTOMDRAW;
935 nmcd.hdc = hdc;
936
937 /* start the paint cycle */
938 nmcd.rc = rcClient;
939 gcdrf = notify_customdraw(infoPtr, &nmcd, CDDS_PREPAINT);
940 if (gcdrf & CDRF_SKIPDEFAULT) goto cleanup;
941
942 /* Erase background */
943 if (gcdrf == CDRF_DODEFAULT ||
945 if (GetWindowTheme (infoPtr->hwndSelf)) {
947 }
948#ifndef __REACTOS__
949 else {
950#else
951 {
952#endif
953 HBRUSH brush = (HBRUSH)SendMessageW(infoPtr->hwndNotify, WM_CTLCOLORSTATIC,
954 (WPARAM)hdc, (LPARAM)infoPtr->hwndSelf);
955 FillRect (hdc, &rcClient, brush ? brush : GetSysColorBrush(COLOR_BTNFACE));
956 }
957 if (gcdrf != CDRF_DODEFAULT)
958 notify_customdraw(infoPtr, &nmcd, CDDS_POSTERASE);
959 }
960
961 /* draw channel */
962 if (gcdrf & CDRF_NOTIFYITEMDRAW) {
965 nmcd.rc = infoPtr->rcChannel;
966 icdrf = notify_customdraw(infoPtr, &nmcd, CDDS_ITEMPREPAINT);
967 } else icdrf = CDRF_DODEFAULT;
968 if ( !(icdrf & CDRF_SKIPDEFAULT) ) {
969 TRACKBAR_DrawChannel (infoPtr, hdc);
970 if (icdrf & CDRF_NOTIFYPOSTPAINT)
971 notify_customdraw(infoPtr, &nmcd, CDDS_ITEMPOSTPAINT);
972 }
973
974
975 /* draw tics */
976 if (!(infoPtr->dwStyle & TBS_NOTICKS)) {
977 if (gcdrf & CDRF_NOTIFYITEMDRAW) {
978 nmcd.dwItemSpec = TBCD_TICS;
980 nmcd.rc = rcClient;
981 icdrf = notify_customdraw(infoPtr, &nmcd, CDDS_ITEMPREPAINT);
982 } else icdrf = CDRF_DODEFAULT;
983 if ( !(icdrf & CDRF_SKIPDEFAULT) ) {
984 TRACKBAR_DrawTics (infoPtr, hdc);
985 if (icdrf & CDRF_NOTIFYPOSTPAINT)
986 notify_customdraw(infoPtr, &nmcd, CDDS_ITEMPOSTPAINT);
987 }
988 }
989
990 /* draw thumb */
991 if (!(infoPtr->dwStyle & TBS_NOTHUMB)) {
992 if (gcdrf & CDRF_NOTIFYITEMDRAW) {
993 nmcd.dwItemSpec = TBCD_THUMB;
994 nmcd.uItemState = infoPtr->flags & TB_DRAG_MODE ? CDIS_HOT : CDIS_DEFAULT;
995 nmcd.rc = infoPtr->rcThumb;
996 icdrf = notify_customdraw(infoPtr, &nmcd, CDDS_ITEMPREPAINT);
997 } else icdrf = CDRF_DODEFAULT;
998 if ( !(icdrf & CDRF_SKIPDEFAULT) ) {
999 TRACKBAR_DrawThumb(infoPtr, hdc);
1000 if (icdrf & CDRF_NOTIFYPOSTPAINT)
1001 notify_customdraw(infoPtr, &nmcd, CDDS_ITEMPOSTPAINT);
1002 }
1003 }
1004
1005 /* draw focus rectangle */
1006 if (infoPtr->flags & TB_IS_FOCUSED) {
1007 DrawFocusRect(hdc, &rcClient);
1008 }
1009
1010 /* finish up the painting */
1011 if (gcdrf & CDRF_NOTIFYPOSTPAINT)
1012 notify_customdraw(infoPtr, &nmcd, CDDS_POSTPAINT);
1013
1014cleanup:
1015 /* cleanup, if we rendered offscreen */
1016 if (hdc != hdcDst) {
1017 BitBlt(hdcDst, 0, 0, rcClient.right, rcClient.bottom, hdc, 0, 0, SRCCOPY);
1018 SelectObject(hdc, hOldBmp);
1019 DeleteObject(hOffScreenBmp);
1021 }
1022}
static void TRACKBAR_DrawTics(const TRACKBAR_INFO *infoPtr, HDC hdc)
Definition: trackbar.c:567
static void TRACKBAR_DrawChannel(const TRACKBAR_INFO *infoPtr, HDC hdc)
Definition: trackbar.c:463
#define TB_THUMBCHANGED
Definition: trackbar.c:82
#define TB_THUMBSIZECHANGED
Definition: trackbar.c:81
static int notify_customdraw(const TRACKBAR_INFO *infoPtr, NMCUSTOMDRAW *pnmcd, int stage)
Definition: trackbar.c:103
static void TRACKBAR_DrawThumb(TRACKBAR_INFO *infoPtr, HDC hdc)
Definition: trackbar.c:697
static void TRACKBAR_CalcSelection(TRACKBAR_INFO *infoPtr)
Definition: trackbar.c:407
#define TB_IS_FOCUSED
Definition: trackbar.c:92
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:88
#define CDDS_ITEMPOSTPAINT
Definition: commctrl.h:286
#define TBCD_TICS
Definition: commctrl.h:2088
#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:2031
#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:2090
#define CDIS_HOT
Definition: commctrl.h:297
#define CDDS_PREERASE
Definition: commctrl.h:282
#define TBCD_THUMB
Definition: commctrl.h:2089
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:1775
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 2068 of file trackbar.c.

2069{
2070 WNDCLASSW wndClass;
2071
2072 ZeroMemory (&wndClass, sizeof(WNDCLASSW));
2073 wndClass.style = CS_GLOBALCLASS;
2075 wndClass.cbClsExtra = 0;
2076 wndClass.cbWndExtra = sizeof(TRACKBAR_INFO *);
2077 wndClass.hCursor = LoadCursorW (0, (LPWSTR)IDC_ARROW);
2078 wndClass.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
2079 wndClass.lpszClassName = TRACKBAR_CLASSW;
2080
2081 RegisterClassW (&wndClass);
2082}
static LRESULT WINAPI TRACKBAR_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: trackbar.c:1879
#define TRACKBAR_CLASSW
Definition: commctrl.h:2016
LPCWSTR lpszClassName
Definition: winuser.h:3188
HBRUSH hbrBackground
Definition: winuser.h:3186
int cbClsExtra
Definition: winuser.h:3181
UINT style
Definition: winuser.h:3179
WNDPROC lpfnWndProc
Definition: winuser.h:3180
int cbWndExtra
Definition: winuser.h:3182
HCURSOR hCursor
Definition: winuser.h:3185
ATOM WINAPI RegisterClassW(_In_ CONST WNDCLASSW *)
#define IDC_ARROW
Definition: winuser.h:687
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2157
#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 1172 of file trackbar.c.

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

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_SetFocus()

static LRESULT TRACKBAR_SetFocus ( TRACKBAR_INFO infoPtr)
static

Definition at line 1670 of file trackbar.c.

1671{
1672 TRACE("\n");
1673 infoPtr->flags |= TB_IS_FOCUSED;
1674 TRACKBAR_InvalidateAll(infoPtr);
1675
1676 return 0;
1677}

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_SetLineSize()

static LONG TRACKBAR_SetLineSize ( TRACKBAR_INFO infoPtr,
LONG  lLineSize 
)
inlinestatic

Definition at line 1194 of file trackbar.c.

1195{
1196 LONG lTemp = infoPtr->lLineSize;
1197
1198 infoPtr->lLineSize = lLineSize;
1199
1200 return lTemp;
1201}

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_SetPageSize()

static LONG TRACKBAR_SetPageSize ( TRACKBAR_INFO infoPtr,
LONG  lPageSize 
)
inlinestatic

Definition at line 1213 of file trackbar.c.

1214{
1215 LONG lTemp = infoPtr->lPageSize;
1216
1217 if (lPageSize == -1)
1218 {
1219 infoPtr->flags &= ~TB_USER_PAGE;
1220 TRACKBAR_UpdatePageSize(infoPtr);
1221 }
1222 else
1223 {
1224 infoPtr->flags |= TB_USER_PAGE;
1225 infoPtr->lPageSize = lPageSize;
1226 }
1227
1228 return lTemp;
1229}
static void TRACKBAR_UpdatePageSize(TRACKBAR_INFO *infoPtr)
Definition: trackbar.c:1203
#define TB_USER_PAGE
Definition: trackbar.c:91

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_SetPos()

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

Definition at line 1233 of file trackbar.c.

1234{
1235 LONG oldPos = infoPtr->lPos;
1236 infoPtr->lPos = lPosition;
1237
1238 if (infoPtr->lPos < infoPtr->lRangeMin)
1239 infoPtr->lPos = infoPtr->lRangeMin;
1240
1241 if (infoPtr->lPos > infoPtr->lRangeMax)
1242 infoPtr->lPos = infoPtr->lRangeMax;
1243
1244 if (fPosition && oldPos != lPosition)
1245 {
1246 TRACKBAR_UpdateThumb(infoPtr);
1247 TRACKBAR_InvalidateThumbMove(infoPtr, oldPos, lPosition);
1248 }
1249
1250 return 0;
1251}

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_SetRange()

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

Definition at line 1254 of file trackbar.c.

1255{
1256 BOOL changed = infoPtr->lRangeMin != (SHORT)LOWORD(range) ||
1257 infoPtr->lRangeMax != (SHORT)HIWORD(range);
1258
1259 infoPtr->lRangeMin = (SHORT)LOWORD(range);
1260 infoPtr->lRangeMax = (SHORT)HIWORD(range);
1261
1262 /* clip position to new min/max limit */
1263 if (infoPtr->lPos < infoPtr->lRangeMin)
1264 infoPtr->lPos = infoPtr->lRangeMin;
1265
1266 if (infoPtr->lPos > infoPtr->lRangeMax)
1267 infoPtr->lPos = infoPtr->lRangeMax;
1268
1269 TRACKBAR_UpdatePageSize(infoPtr);
1270
1271 if (changed) {
1272 if (infoPtr->dwStyle & TBS_AUTOTICKS)
1273 TRACKBAR_RecalculateTics (infoPtr);
1274 infoPtr->flags |= TB_THUMBPOSCHANGED;
1275 }
1276
1277 if (redraw) TRACKBAR_InvalidateAll(infoPtr);
1278
1279 return 0;
1280}
#define TB_THUMBPOSCHANGED
Definition: trackbar.c:80
static void TRACKBAR_RecalculateTics(TRACKBAR_INFO *infoPtr)
Definition: trackbar.c:141
#define LOWORD(l)
Definition: pedump.c:82
short SHORT
Definition: pedump.c:59
#define TBS_AUTOTICKS
Definition: commctrl.h:2020
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 1284 of file trackbar.c.

1285{
1286 BOOL changed = infoPtr->lRangeMax != lMax;
1287 LONG rightmost = max(lMax, infoPtr->lRangeMin);
1288
1289 infoPtr->lRangeMax = lMax;
1290 if (infoPtr->lPos > rightmost) {
1291 infoPtr->lPos = rightmost;
1292 infoPtr->flags |= TB_THUMBPOSCHANGED;
1293 }
1294
1295 TRACKBAR_UpdatePageSize(infoPtr);
1296
1297 if (changed && (infoPtr->dwStyle & TBS_AUTOTICKS))
1298 TRACKBAR_RecalculateTics (infoPtr);
1299
1300 if (redraw) TRACKBAR_InvalidateAll(infoPtr);
1301
1302 return 0;
1303}
#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 1307 of file trackbar.c.

1308{
1309 BOOL changed = infoPtr->lRangeMin != lMin;
1310
1311 infoPtr->lRangeMin = lMin;
1312 if (infoPtr->lPos < infoPtr->lRangeMin) {
1313 infoPtr->lPos = infoPtr->lRangeMin;
1314 infoPtr->flags |= TB_THUMBPOSCHANGED;
1315 }
1316
1317 TRACKBAR_UpdatePageSize(infoPtr);
1318
1319 if (changed && (infoPtr->dwStyle & TBS_AUTOTICKS))
1320 TRACKBAR_RecalculateTics (infoPtr);
1321
1322 if (redraw) TRACKBAR_InvalidateAll(infoPtr);
1323
1324 return 0;
1325}

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_SetSel()

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

Definition at line 1329 of file trackbar.c.

1330{
1331 if (!(infoPtr->dwStyle & TBS_ENABLESELRANGE)){
1332 infoPtr->lSelMin = 0;
1333 infoPtr->lSelMax = 0;
1334 return 0;
1335 }
1336
1337 infoPtr->lSelMin = (SHORT)LOWORD(lSel);
1338 infoPtr->lSelMax = (SHORT)HIWORD(lSel);
1339 infoPtr->flags |= TB_SELECTIONCHANGED;
1340
1341 if (infoPtr->lSelMin < infoPtr->lRangeMin)
1342 infoPtr->lSelMin = infoPtr->lRangeMin;
1343 if (infoPtr->lSelMax > infoPtr->lRangeMax)
1344 infoPtr->lSelMax = infoPtr->lRangeMax;
1345
1346 if (fRedraw) TRACKBAR_InvalidateAll(infoPtr);
1347
1348 return 0;
1349}

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_SetSelEnd()

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

Definition at line 1353 of file trackbar.c.

1354{
1355 if (!(infoPtr->dwStyle & TBS_ENABLESELRANGE)){
1356 infoPtr->lSelMax = 0;
1357 return 0;
1358 }
1359
1360 infoPtr->lSelMax = lEnd;
1361 infoPtr->flags |= TB_SELECTIONCHANGED;
1362
1363 if (infoPtr->lSelMax > infoPtr->lRangeMax)
1364 infoPtr->lSelMax = infoPtr->lRangeMax;
1365
1366 if (fRedraw) TRACKBAR_InvalidateAll(infoPtr);
1367
1368 return 0;
1369}

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_SetSelStart()

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

Definition at line 1373 of file trackbar.c.

1374{
1375 if (!(infoPtr->dwStyle & TBS_ENABLESELRANGE)){
1376 infoPtr->lSelMin = 0;
1377 return 0;
1378 }
1379
1380 infoPtr->lSelMin = lStart;
1381 infoPtr->flags |=TB_SELECTIONCHANGED;
1382
1383 if (infoPtr->lSelMin < infoPtr->lRangeMin)
1384 infoPtr->lSelMin = infoPtr->lRangeMin;
1385
1386 if (fRedraw) TRACKBAR_InvalidateAll(infoPtr);
1387
1388 return 0;
1389}

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_SetThumbLength()

static LRESULT TRACKBAR_SetThumbLength ( TRACKBAR_INFO infoPtr,
UINT  iLength 
)
inlinestatic

Definition at line 1393 of file trackbar.c.

1394{
1395 if (infoPtr->dwStyle & TBS_FIXEDLENGTH) {
1396 /* We're not supposed to check if it's really changed or not,
1397 just repaint in any case. */
1398 infoPtr->uThumbLen = iLength;
1399 infoPtr->flags |= TB_THUMBSIZECHANGED;
1400 TRACKBAR_InvalidateAll(infoPtr);
1401 }
1402
1403 return 0;
1404}

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_SetTic()

static LRESULT TRACKBAR_SetTic ( TRACKBAR_INFO infoPtr,
LONG  lPos 
)
inlinestatic

Definition at line 1408 of file trackbar.c.

1409{
1410 if ((lPos < infoPtr->lRangeMin) || (lPos> infoPtr->lRangeMax))
1411 return FALSE;
1412
1413 TRACE("lPos=%d\n", lPos);
1414
1415 infoPtr->uNumTics++;
1416 infoPtr->tics=ReAlloc( infoPtr->tics,
1417 (infoPtr->uNumTics)*sizeof (DWORD));
1418 if (!infoPtr->tics) {
1419 infoPtr->uNumTics = 0;
1420 notify(infoPtr, NM_OUTOFMEMORY);
1421 return FALSE;
1422 }
1423 infoPtr->tics[infoPtr->uNumTics-1] = lPos;
1424
1425 TRACKBAR_InvalidateAll(infoPtr);
1426
1427 return TRUE;
1428}

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_SetTicFreq()

static LRESULT TRACKBAR_SetTicFreq ( TRACKBAR_INFO infoPtr,
WORD  wFreq 
)
inlinestatic

Definition at line 1432 of file trackbar.c.

1433{
1434 if (infoPtr->dwStyle & TBS_AUTOTICKS) {
1435 infoPtr->uTicFreq = wFreq;
1436 TRACKBAR_RecalculateTics (infoPtr);
1437 TRACKBAR_InvalidateAll(infoPtr);
1438 }
1439
1440 TRACKBAR_UpdateThumb (infoPtr);
1441 return 0;
1442}

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_SetTipSide()

static INT TRACKBAR_SetTipSide ( TRACKBAR_INFO infoPtr,
INT  fLocation 
)
inlinestatic

Definition at line 1446 of file trackbar.c.

1447{
1448 INT fTemp = infoPtr->fLocation;
1449
1450 infoPtr->fLocation = fLocation;
1451
1452 return fTemp;
1453}

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_SetToolTips()

static LRESULT TRACKBAR_SetToolTips ( TRACKBAR_INFO infoPtr,
HWND  hwndTT 
)
inlinestatic

Definition at line 1457 of file trackbar.c.

1458{
1459 infoPtr->hwndToolTip = hwndTT;
1460
1461 return 0;
1462}

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_SetUnicodeFormat()

static BOOL TRACKBAR_SetUnicodeFormat ( TRACKBAR_INFO infoPtr,
BOOL  fUnicode 
)
inlinestatic

Definition at line 1466 of file trackbar.c.

1467{
1468 BOOL bTemp = infoPtr->bUnicode;
1469
1470 infoPtr->bUnicode = fUnicode;
1471
1472 return bTemp;
1473}
BOOL bUnicode
Definition: trackbar.c:63

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_Size()

static LRESULT TRACKBAR_Size ( TRACKBAR_INFO infoPtr)
static

Definition at line 1681 of file trackbar.c.

1682{
1683 if (infoPtr->dwStyle & TBS_FIXEDLENGTH)
1684 {
1685 TRACKBAR_CalcChannel(infoPtr);
1686 TRACKBAR_UpdateThumb(infoPtr);
1687 }
1688 else
1689 TRACKBAR_InitializeThumb(infoPtr);
1690 TRACKBAR_AlignBuddies (infoPtr);
1691 TRACKBAR_InvalidateAll(infoPtr);
1692
1693 return 0;
1694}

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_StyleChanged()

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

Definition at line 1697 of file trackbar.c.

1699{
1700 if (wStyleType != GWL_STYLE) return 0;
1701
1702 infoPtr->dwStyle = lpss->styleNew;
1703
1704 return 0;
1705}
DWORD styleNew
Definition: winuser.h:3696
#define GWL_STYLE
Definition: winuser.h:855

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_Timer()

static LRESULT TRACKBAR_Timer ( TRACKBAR_INFO infoPtr)
static

Definition at line 1708 of file trackbar.c.

1709{
1710 if (infoPtr->flags & TB_AUTO_PAGE) {
1711 POINT pt;
1712 if (GetCursorPos(&pt))
1713 if (ScreenToClient(infoPtr->hwndSelf, &pt))
1714 TRACKBAR_AutoPage(infoPtr, pt);
1715 }
1716 return 0;
1717}
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
Definition: cursoricon.c:2722
BOOL WINAPI ScreenToClient(_In_ HWND, _Inout_ LPPOINT)

Referenced by TRACKBAR_WindowProc().

◆ TRACKBAR_Unregister()

void TRACKBAR_Unregister ( void  )

Definition at line 2085 of file trackbar.c.

2086{
2088}
BOOL WINAPI UnregisterClassW(_In_ LPCWSTR, HINSTANCE)

Referenced by DllMain().

◆ TRACKBAR_UpdatePageSize()

static void TRACKBAR_UpdatePageSize ( TRACKBAR_INFO infoPtr)
static

Definition at line 1203 of file trackbar.c.

1204{
1205 if (infoPtr->flags & TB_USER_PAGE)
1206 return;
1207
1208 infoPtr->lPageSize = (infoPtr->lRangeMax - infoPtr->lRangeMin) / 5;
1209 if (infoPtr->lPageSize == 0) infoPtr->lPageSize = 1;
1210}

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

◆ TRACKBAR_UpdateThumb()

static void TRACKBAR_UpdateThumb ( TRACKBAR_INFO infoPtr)
inlinestatic

◆ TRACKBAR_UpdateToolTip()

static void TRACKBAR_UpdateToolTip ( const TRACKBAR_INFO infoPtr)
static

Definition at line 851 of file trackbar.c.

852{
853 WCHAR buf[80];
854 static const WCHAR fmt[] = { '%', 'l', 'd', 0 };
855 TTTOOLINFOW ti;
856 POINT pt;
857 RECT rcClient;
859
860 if (!infoPtr->hwndToolTip) return;
861
862 ZeroMemory(&ti, sizeof(ti));
863 ti.cbSize = sizeof(ti);
864 ti.hwnd = infoPtr->hwndSelf;
866
867 wsprintfW (buf, fmt, infoPtr->lPos);
868 ti.lpszText = buf;
870
871 GetClientRect (infoPtr->hwndSelf, &rcClient);
873 if (infoPtr->dwStyle & TBS_VERT) {
874 if (infoPtr->fLocation == TBTS_LEFT)
875 pt.x = 0 - LOWORD(size) - TOOLTIP_OFFSET;
876 else
877 pt.x = rcClient.right + TOOLTIP_OFFSET;
878 pt.y = (infoPtr->rcThumb.top + infoPtr->rcThumb.bottom - HIWORD(size))/2;
879 } else {
880 if (infoPtr->fLocation == TBTS_TOP)
881 pt.y = 0 - HIWORD(size) - TOOLTIP_OFFSET;
882 else
883 pt.y = rcClient.bottom + TOOLTIP_OFFSET;
884 pt.x = (infoPtr->rcThumb.left + infoPtr->rcThumb.right - LOWORD(size))/2;
885 }
886 ClientToScreen(infoPtr->hwndSelf, &pt);
887
889 0, MAKELPARAM(pt.x, pt.y));
890}
#define TOOLTIP_OFFSET
Definition: trackbar.c:73
GLsizeiptr size
Definition: glext.h:5919
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define TBTS_LEFT
Definition: commctrl.h:2069
#define TTM_TRACKPOSITION
Definition: commctrl.h:1818
#define TTM_UPDATETIPTEXTW
Definition: commctrl.h:1810
#define TTM_GETBUBBLESIZE
Definition: commctrl.h:1830
Definition: dsound.c:943
#define MAKELPARAM(l, h)
Definition: winuser.h:4011
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 1879 of file trackbar.c.

1880{
1882
1883 TRACE("hwnd=%p msg=%x wparam=%lx lparam=%lx\n", hwnd, uMsg, wParam, lParam);
1884
1885 if (!infoPtr && (uMsg != WM_CREATE))
1886 return DefWindowProcW (hwnd, uMsg, wParam, lParam);
1887
1888 switch (uMsg)
1889 {
1890 case TBM_CLEARSEL:
1891 return TRACKBAR_ClearSel (infoPtr, (BOOL)wParam);
1892
1893 case TBM_CLEARTICS:
1894 return TRACKBAR_ClearTics (infoPtr, (BOOL)wParam);
1895
1896 case TBM_GETBUDDY:
1897 return (LRESULT)(wParam ? infoPtr->hwndBuddyLA : infoPtr->hwndBuddyRB);
1898
1899 case TBM_GETCHANNELRECT:
1900 return TRACKBAR_GetChannelRect (infoPtr, (LPRECT)lParam);
1901
1902 case TBM_GETLINESIZE:
1903 return infoPtr->lLineSize;
1904
1905 case TBM_GETNUMTICS:
1906 return TRACKBAR_GetNumTics (infoPtr);
1907
1908 case TBM_GETPAGESIZE:
1909 return infoPtr->lPageSize;
1910
1911 case TBM_GETPOS:
1912 return infoPtr->lPos;
1913
1914 case TBM_GETPTICS:
1915 return (LRESULT)infoPtr->tics;
1916
1917 case TBM_GETRANGEMAX:
1918 return infoPtr->lRangeMax;
1919
1920 case TBM_GETRANGEMIN:
1921 return infoPtr->lRangeMin;
1922
1923 case TBM_GETSELEND:
1924 return infoPtr->lSelMax;
1925
1926 case TBM_GETSELSTART:
1927 return infoPtr->lSelMin;
1928
1929 case TBM_GETTHUMBLENGTH:
1930 return infoPtr->uThumbLen;
1931
1932 case TBM_GETTHUMBRECT:
1933 return CopyRect((LPRECT)lParam, &infoPtr->rcThumb);
1934
1935 case TBM_GETTIC:
1936 return TRACKBAR_GetTic (infoPtr, (INT)wParam);
1937
1938 case TBM_GETTICPOS:
1939 return TRACKBAR_GetTicPos (infoPtr, (INT)wParam);
1940
1941 case TBM_GETTOOLTIPS:
1942 return (LRESULT)infoPtr->hwndToolTip;
1943
1945 return infoPtr->bUnicode;
1946
1947 case TBM_SETBUDDY:
1948 return (LRESULT) TRACKBAR_SetBuddy(infoPtr, (BOOL)wParam, (HWND)lParam);
1949
1950 case TBM_SETLINESIZE:
1951 return TRACKBAR_SetLineSize (infoPtr, (LONG)lParam);
1952
1953 case TBM_SETPAGESIZE:
1954 return TRACKBAR_SetPageSize (infoPtr, (LONG)lParam);
1955
1956 case TBM_SETPOS:
1957 return TRACKBAR_SetPos (infoPtr, (BOOL)wParam, (LONG)lParam);
1958
1959 case TBM_SETRANGE:
1960 return TRACKBAR_SetRange (infoPtr, (BOOL)wParam, (LONG)lParam);
1961
1962 case TBM_SETRANGEMAX:
1963 return TRACKBAR_SetRangeMax (infoPtr, (BOOL)wParam, (LONG)lParam);
1964
1965 case TBM_SETRANGEMIN:
1966 return TRACKBAR_SetRangeMin (infoPtr, (BOOL)wParam, (LONG)lParam);
1967
1968 case TBM_SETSEL:
1969 return TRACKBAR_SetSel (infoPtr, (BOOL)wParam, (LONG)lParam);
1970
1971 case TBM_SETSELEND:
1972 return TRACKBAR_SetSelEnd (infoPtr, (BOOL)wParam, (LONG)lParam);
1973
1974 case TBM_SETSELSTART:
1975 return TRACKBAR_SetSelStart (infoPtr, (BOOL)wParam, (LONG)lParam);
1976
1977 case TBM_SETTHUMBLENGTH:
1978 return TRACKBAR_SetThumbLength (infoPtr, (UINT)wParam);
1979
1980 case TBM_SETTIC:
1981 return TRACKBAR_SetTic (infoPtr, (LONG)lParam);
1982
1983 case TBM_SETTICFREQ:
1984 return TRACKBAR_SetTicFreq (infoPtr, (WORD)wParam);
1985
1986 case TBM_SETTIPSIDE:
1987 return TRACKBAR_SetTipSide (infoPtr, (INT)wParam);
1988
1989 case TBM_SETTOOLTIPS:
1990 return TRACKBAR_SetToolTips (infoPtr, (HWND)wParam);
1991
1993 return TRACKBAR_SetUnicodeFormat (infoPtr, (BOOL)wParam);
1994
1995
1996 case WM_CAPTURECHANGED:
1997 if (hwnd == (HWND)lParam) return 0;
1998 return TRACKBAR_CaptureChanged (infoPtr);
1999
2000 case WM_CREATE:
2002
2003 case WM_DESTROY:
2004 return TRACKBAR_Destroy (infoPtr);
2005
2006 case WM_ENABLE:
2007 return TRACKBAR_Enable (infoPtr, (BOOL)wParam);
2008
2009 case WM_ERASEBKGND:
2010 return 0;
2011
2012 case WM_GETDLGCODE:
2013 return DLGC_WANTARROWS;
2014
2015 case WM_KEYDOWN:
2016 return TRACKBAR_KeyDown (infoPtr, (INT)wParam);
2017
2018 case WM_KEYUP:
2019 return TRACKBAR_KeyUp (infoPtr, (INT)wParam);
2020
2021 case WM_KILLFOCUS:
2022 return TRACKBAR_KillFocus (infoPtr);
2023
2024 case WM_LBUTTONDOWN:
2025 return TRACKBAR_LButtonDown (infoPtr, (SHORT)LOWORD(lParam), (SHORT)HIWORD(lParam));
2026
2027 case WM_LBUTTONUP:
2028 return TRACKBAR_LButtonUp (infoPtr);
2029
2030 case WM_MOUSELEAVE:
2031 infoPtr->flags &= ~TB_THUMB_HOT;
2032 InvalidateRect (infoPtr->hwndSelf, &infoPtr->rcThumb, FALSE);
2033 return 0;
2034
2035 case WM_MOUSEMOVE:
2036 return TRACKBAR_MouseMove (infoPtr, (SHORT)LOWORD(lParam), (SHORT)HIWORD(lParam));
2037
2038 case WM_PRINTCLIENT:
2039 case WM_PAINT:
2040 return TRACKBAR_Paint (infoPtr, (HDC)wParam);
2041
2042 case WM_SETFOCUS:
2043 return TRACKBAR_SetFocus (infoPtr);
2044
2045 case WM_SIZE:
2046 return TRACKBAR_Size (infoPtr);
2047
2048 case WM_STYLECHANGED:
2050
2051 case WM_THEMECHANGED:
2052 return theme_changed (infoPtr);
2053
2054 case WM_TIMER:
2055 return TRACKBAR_Timer (infoPtr);
2056
2057 case WM_WININICHANGE:
2058 return TRACKBAR_InitializeThumb (infoPtr);
2059
2060 default:
2061 if ((uMsg >= WM_USER) && (uMsg < WM_APP) && !COMCTL32_IsReflectedMessage(uMsg))
2062 ERR("unknown msg %04x wp=%08lx lp=%08lx\n", uMsg, wParam, lParam);
2063 return DefWindowProcW (hwnd, uMsg, wParam, lParam);
2064 }
2065}
#define ERR(fmt,...)
Definition: precomp.h:57
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
BOOL COMCTL32_IsReflectedMessage(UINT uMsg) DECLSPEC_HIDDEN
Definition: commctrl.c:1755
static BOOL TRACKBAR_KeyDown(TRACKBAR_INFO *infoPtr, INT nVirtKey)
Definition: trackbar.c:1793
static LRESULT TRACKBAR_Paint(TRACKBAR_INFO *infoPtr, HDC hdc)
Definition: trackbar.c:1654
static LRESULT TRACKBAR_ClearTics(TRACKBAR_INFO *infoPtr, BOOL fRedraw)
Definition: trackbar.c:1091
static LRESULT TRACKBAR_SetPos(TRACKBAR_INFO *infoPtr, BOOL fPosition, LONG lPosition)
Definition: trackbar.c:1233
static LONG TRACKBAR_SetLineSize(TRACKBAR_INFO *infoPtr, LONG lLineSize)
Definition: trackbar.c:1194
static LRESULT TRACKBAR_SetSelEnd(TRACKBAR_INFO *infoPtr, BOOL fRedraw, LONG lEnd)
Definition: trackbar.c:1353
static LRESULT TRACKBAR_Create(HWND hwnd, const CREATESTRUCTW *lpcs)
Definition: trackbar.c:1510
static LRESULT TRACKBAR_GetChannelRect(const TRACKBAR_INFO *infoPtr, LPRECT lprc)
Definition: trackbar.c:1106
static INT TRACKBAR_SetTipSide(TRACKBAR_INFO *infoPtr, INT fLocation)
Definition: trackbar.c:1446
static LRESULT TRACKBAR_SetRange(TRACKBAR_INFO *infoPtr, BOOL redraw, LONG range)
Definition: trackbar.c:1254
static LRESULT TRACKBAR_CaptureChanged(const TRACKBAR_INFO *infoPtr)
Definition: trackbar.c:1646
static LRESULT TRACKBAR_MouseMove(TRACKBAR_INFO *infoPtr, INT x, INT y)
Definition: trackbar.c:1731
static LRESULT TRACKBAR_SetTicFreq(TRACKBAR_INFO *infoPtr, WORD wFreq)
Definition: trackbar.c:1432
static LONG TRACKBAR_GetTicPos(const TRACKBAR_INFO *infoPtr, INT iTic)
Definition: trackbar.c:1152
static HWND TRACKBAR_SetBuddy(TRACKBAR_INFO *infoPtr, BOOL fLocation, HWND hwndBuddy)
Definition: trackbar.c:1172
static LRESULT TRACKBAR_Timer(TRACKBAR_INFO *infoPtr)
Definition: trackbar.c:1708
static LRESULT TRACKBAR_SetThumbLength(TRACKBAR_INFO *infoPtr, UINT iLength)
Definition: trackbar.c:1393
static LRESULT TRACKBAR_SetFocus(TRACKBAR_INFO *infoPtr)
Definition: trackbar.c:1670
static LRESULT TRACKBAR_SetRangeMax(TRACKBAR_INFO *infoPtr, BOOL redraw, LONG lMax)
Definition: trackbar.c:1284
static LRESULT TRACKBAR_Size(TRACKBAR_INFO *infoPtr)
Definition: trackbar.c:1681
static LRESULT TRACKBAR_ClearSel(TRACKBAR_INFO *infoPtr, BOOL fRedraw)
Definition: trackbar.c:1078
static LRESULT TRACKBAR_KillFocus(TRACKBAR_INFO *infoPtr)
Definition: trackbar.c:1583
static LRESULT TRACKBAR_SetTic(TRACKBAR_INFO *infoPtr, LONG lPos)
Definition: trackbar.c:1408
static LONG TRACKBAR_SetPageSize(TRACKBAR_INFO *infoPtr, LONG lPageSize)
Definition: trackbar.c:1213
static LRESULT TRACKBAR_SetToolTips(TRACKBAR_INFO *infoPtr, HWND hwndTT)
Definition: trackbar.c:1457
static LRESULT TRACKBAR_Destroy(TRACKBAR_INFO *infoPtr)
Definition: trackbar.c:1565
static LRESULT TRACKBAR_Enable(TRACKBAR_INFO *infoPtr, BOOL enable)
Definition: trackbar.c:1866
static LRESULT TRACKBAR_StyleChanged(TRACKBAR_INFO *infoPtr, WPARAM wStyleType, const STYLESTRUCT *lpss)
Definition: trackbar.c:1697
static LONG TRACKBAR_GetNumTics(const TRACKBAR_INFO *infoPtr)
Definition: trackbar.c:1120
static LRESULT TRACKBAR_SetSel(TRACKBAR_INFO *infoPtr, BOOL fRedraw, LONG lSel)
Definition: trackbar.c:1329
static BOOL TRACKBAR_SetUnicodeFormat(TRACKBAR_INFO *infoPtr, BOOL fUnicode)
Definition: trackbar.c:1466
static BOOL TRACKBAR_KeyUp(const TRACKBAR_INFO *infoPtr, INT nVirtKey)
Definition: trackbar.c:1848
static LRESULT TRACKBAR_LButtonDown(TRACKBAR_INFO *infoPtr, INT x, INT y)
Definition: trackbar.c:1593
static LRESULT TRACKBAR_SetSelStart(TRACKBAR_INFO *infoPtr, BOOL fRedraw, LONG lStart)
Definition: trackbar.c:1373
static LRESULT theme_changed(const TRACKBAR_INFO *infoPtr)
Definition: trackbar.c:1721
static LRESULT TRACKBAR_SetRangeMin(TRACKBAR_INFO *infoPtr, BOOL redraw, LONG lMin)
Definition: trackbar.c:1307
static LRESULT TRACKBAR_LButtonUp(TRACKBAR_INFO *infoPtr)
Definition: trackbar.c:1622
#define WM_APP
Definition: eventvwr.h:73
unsigned short WORD
Definition: ntddk_ex.h:93
#define TBM_GETBUDDY
Definition: commctrl.h:2074
#define TBM_GETSELSTART
Definition: commctrl.h:2052
#define TBM_CLEARSEL
Definition: commctrl.h:2054
#define TBM_SETPAGESIZE
Definition: commctrl.h:2056
#define TBM_SETTIC
Definition: commctrl.h:2040
#define TBM_SETSELSTART
Definition: commctrl.h:2047
#define TBM_GETPOS
Definition: commctrl.h:2036
#define TBM_GETSELEND
Definition: commctrl.h:2053
#define TBM_SETSELEND
Definition: commctrl.h:2048
#define TBM_SETTOOLTIPS
Definition: commctrl.h:2064
#define TBM_SETLINESIZE
Definition: commctrl.h:2058
#define TBM_GETTHUMBRECT
Definition: commctrl.h:2060
#define TBM_SETRANGEMIN
Definition: commctrl.h:2043
#define TBM_SETSEL
Definition: commctrl.h:2046
#define TBM_GETCHANNELRECT
Definition: commctrl.h:2061
#define TBM_GETLINESIZE
Definition: commctrl.h:2059
#define TBM_CLEARTICS
Definition: commctrl.h:2045
#define TBM_GETRANGEMAX
Definition: commctrl.h:2038
#define TBM_SETRANGE
Definition: commctrl.h:2042
#define TBM_SETPOS
Definition: commctrl.h:2041
#define WM_MOUSELEAVE
Definition: commctrl.h:4980
#define TBM_GETPTICS
Definition: commctrl.h:2049
#define TBM_GETTIC
Definition: commctrl.h:2039
#define TBM_SETTICFREQ
Definition: commctrl.h:2055
#define TBM_GETNUMTICS
Definition: commctrl.h:2051
#define TBM_SETRANGEMAX
Definition: commctrl.h:2044
#define TBM_GETUNICODEFORMAT
Definition: commctrl.h:2076
#define TBM_SETTIPSIDE
Definition: commctrl.h:2066
#define TBM_GETTICPOS
Definition: commctrl.h:2050
#define TBM_SETUNICODEFORMAT
Definition: commctrl.h:2075
#define TBM_GETRANGEMIN
Definition: commctrl.h:2037
#define TBM_SETTHUMBLENGTH
Definition: commctrl.h:2062
#define TBM_GETPAGESIZE
Definition: commctrl.h:2057
#define TBM_SETBUDDY
Definition: commctrl.h:2073
#define TBM_GETTOOLTIPS
Definition: commctrl.h:2065
#define TBM_GETTHUMBLENGTH
Definition: commctrl.h:2063
#define WM_PRINTCLIENT
Definition: richedit.h:70
#define WM_PAINT
Definition: winuser.h:1623
#define WM_ERASEBKGND
Definition: winuser.h:1628
BOOL WINAPI CopyRect(_Out_ LPRECT, _In_ LPCRECT)
#define WM_ENABLE
Definition: winuser.h:1618
#define WM_KEYUP
Definition: winuser.h:1719
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_CAPTURECHANGED
Definition: winuser.h:1811
#define WM_CREATE
Definition: winuser.h:1611
#define WM_SIZE
Definition: winuser.h:1614
#define WM_WININICHANGE
Definition: winuser.h:1633
#define WM_SETFOCUS
Definition: winuser.h:1616
#define WM_MOUSEMOVE
Definition: winuser.h:1778
#define WM_LBUTTONDOWN
Definition: winuser.h:1779
#define WM_TIMER
Definition: winuser.h:1745
#define DLGC_WANTARROWS
Definition: winuser.h:2613
#define WM_LBUTTONUP
Definition: winuser.h:1780
#define WM_USER
Definition: winuser.h:1898
#define WM_DESTROY
Definition: winuser.h:1612
#define WM_KEYDOWN
Definition: winuser.h:1718
#define WM_KILLFOCUS
Definition: winuser.h:1617
#define WM_GETDLGCODE
Definition: winuser.h:1692

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 100 of file trackbar.c.

Referenced by theme_changed(), and TRACKBAR_Create().