29 #include "../../idlib/precompiled.h"
34 static const int ARROW_SIZE_CX = 4 ;
35 static const int ARROW_SIZE_CY = 2 ;
50 SetWindowLong ( hWnd, GWL_USERDATA, color );
66 sscanf ( color,
"%f,%f,%f,%f", &red, &green, &blue, &alpha );
83 sscanf ( color,
"%f,%f,%f,%f", &red, &green, &blue, &alpha );
97 return (COLORREF) GetWindowLong ( hWnd, GWL_USERDATA );
107 static void ColorButton_DrawArrow (
HDC hDC, RECT* pRect, COLORREF
color )
111 ptsArrow[0].
x = pRect->left;
112 ptsArrow[0].
y = pRect->top;
113 ptsArrow[1].
x = pRect->right;
114 ptsArrow[1].
y = pRect->top;
115 ptsArrow[2].
x = (pRect->left + pRect->right)/2;
116 ptsArrow[2].
y = pRect->bottom;
118 HBRUSH arrowBrush = CreateSolidBrush ( color );
119 HPEN arrowPen = CreatePen ( PS_SOLID, 1, color );
121 HGDIOBJ oldBrush = SelectObject ( hDC, arrowBrush );
122 HGDIOBJ oldPen = SelectObject ( hDC, arrowPen );
124 SetPolyFillMode(hDC, WINDING);
125 Polygon(hDC, ptsArrow, 3);
127 SelectObject ( hDC, oldBrush );
128 SelectObject ( hDC, oldPen );
130 DeleteObject ( arrowBrush );
131 DeleteObject ( arrowPen );
146 UINT state = dis->itemState;
147 RECT rDraw = dis->rcItem;
151 UINT uFrameState = DFCS_BUTTONPUSH|DFCS_ADJUSTRECT;
153 if (state & ODS_SELECTED)
155 uFrameState |= DFCS_PUSHED;
158 if (state & ODS_DISABLED)
160 uFrameState |= DFCS_INACTIVE;
163 DrawFrameControl ( hDC, &rDraw, DFC_BUTTON, uFrameState );
166 if (state & ODS_SELECTED)
168 OffsetRect(&rDraw, 1,1);
171 if (state & ODS_FOCUS)
173 RECT rFocus = {rDraw.left,
178 DrawFocusRect ( hDC, &rFocus );
181 InflateRect ( &rDraw, -GetSystemMetrics(SM_CXEDGE), -GetSystemMetrics(SM_CYEDGE) );
184 rArrow.left = rDraw.right - ARROW_SIZE_CX - GetSystemMetrics(SM_CXEDGE) /2;
185 rArrow.right = rArrow.left + ARROW_SIZE_CX;
186 rArrow.top = (rDraw.bottom + rDraw.top)/2 - ARROW_SIZE_CY / 2;
187 rArrow.bottom = (rDraw.bottom + rDraw.top)/2 + ARROW_SIZE_CY / 2;
189 ColorButton_DrawArrow ( hDC, &rArrow, (state & ODS_DISABLED) ? ::GetSysColor(COLOR_GRAYTEXT) : RGB(0,0,0) );
191 rDraw.right = rArrow.left - GetSystemMetrics(SM_CXEDGE)/2;
194 DrawEdge ( hDC, &rDraw, EDGE_ETCHED, BF_RIGHT);
196 rDraw.right -= (GetSystemMetrics(SM_CXEDGE) * 2) + 1 ;
199 if ((state & ODS_DISABLED) == 0)
201 HBRUSH
color = CreateSolidBrush ( (COLORREF)GetWindowLong ( hWnd, GWL_USERDATA ) );
202 FillRect ( hDC, &rDraw, color );
203 FrameRect ( hDC, &rDraw, (HBRUSH)::GetStockObject(BLACK_BRUSH));
204 DeleteObject( color );
assert(prefInfo.fullscreenBtn)
CONST PIXELFORMATDESCRIPTOR UINT
GLclampf GLclampf GLclampf alpha
typedef HDC(WINAPI *PFNWGLGETCURRENTREADDCARBPROC)(void)