Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

sbctl.c

Go to the documentation of this file.
00001 /**************************** Module Header ********************************\ 00002 * Module Name: sbctl.c 00003 * 00004 * Copyright (c) 1985 - 1999, Microsoft Corporation 00005 * 00006 * Scroll bar internal routines 00007 * 00008 * History: 00009 * 11/21/90 JimA Created. 00010 * 02-04-91 IanJa Revalidaion added 00011 \***************************************************************************/ 00012 00013 #include "precomp.h" 00014 #pragma hdrstop 00015 00016 void CalcSBStuff( 00017 PWND pwnd, 00018 PSBCALC pSBCalc, 00019 BOOL fVert); 00020 00021 #define IsScrollBarControl(h) (GETFNID(h) == FNID_SCROLLBAR) 00022 00023 /* 00024 * Now it is possible to selectively Enable/Disable just one arrow of a Window 00025 * scroll bar; Various bits in the 7th word in the rgwScroll array indicates which 00026 * one of these arrows are disabled; The following masks indicate which bit of the 00027 * word indicates which arrow; 00028 */ 00029 #define WSB_HORZ_LF 0x0001 // Represents the Left arrow of the horizontal scroll bar. 00030 #define WSB_HORZ_RT 0x0002 // Represents the Right arrow of the horizontal scroll bar. 00031 #define WSB_VERT_UP 0x0004 // Represents the Up arrow of the vert scroll bar. 00032 #define WSB_VERT_DN 0x0008 // Represents the Down arrow of the vert scroll bar. 00033 00034 #define WSB_VERT (WSB_VERT_UP | WSB_VERT_DN) 00035 #define WSB_HORZ (WSB_HORZ_LF | WSB_HORZ_RT) 00036 00037 void DrawCtlThumb(PSBWND); 00038 00039 /* 00040 * RETURN_IF_PSBTRACK_INVALID: 00041 * This macro tests whether the pSBTrack we have is invalid, which can happen 00042 * if it gets freed during a callback. 00043 * This protects agains the original pSBTrack being freed and no new one 00044 * being allocated or a new one being allocated at a different address. 00045 * This does not protect against the original pSBTrack being freed and a new 00046 * one being allocated at the same address. 00047 * If pSBTrack has changed, we assert that there is not already a new one 00048 * because we are really not expecting this. 00049 */ 00050 #define RETURN_IF_PSBTRACK_INVALID(pSBTrack, pwnd) \ 00051 if ((pSBTrack) != PWNDTOPSBTRACK(pwnd)) { \ 00052 UserAssert(PWNDTOPSBTRACK(pwnd) == NULL); \ 00053 return; \ 00054 } 00055 00056 /* 00057 * REEVALUATE_PSBTRACK 00058 * This macro just refreshes the local variable pSBTrack, in case it has 00059 * been changed during a callback. After performing this operation, pSBTrack 00060 * should be tested to make sure it is not now NULL. 00061 */ 00062 #if DBG 00063 #define REEVALUATE_PSBTRACK(pSBTrack, pwnd, str) \ 00064 if ((pSBTrack) != PWNDTOPSBTRACK(pwnd)) { \ 00065 RIPMSG3(RIP_WARNING, \ 00066 "%s: pSBTrack changed from %#p to %#p", \ 00067 (str), (pSBTrack), PWNDTOPSBTRACK(pwnd)); \ 00068 } \ 00069 (pSBTrack) = PWNDTOPSBTRACK(pwnd) 00070 #else 00071 #define REEVALUATE_PSBTRACK(pSBTrack, pwnd, str) \ 00072 (pSBTrack) = PWNDTOPSBTRACK(pwnd) 00073 #endif 00074 00075 /***************************************************************************\ 00076 * HitTestScrollBar 00077 * 00078 * 11/15/96 vadimg ported from Memphis sources 00079 \***************************************************************************/ 00080 00081 int HitTestScrollBar(