source: trunk/src/user32/uitools.cpp@ 158

Last change on this file since 158 was 158, checked in by achimha, 26 years ago

Ported latest DrawEdge from WINE, moved everything to new src/user32/uitools.cpp

File size: 17.8 KB
Line 
1/* $Id: uitools.cpp,v 1.1 1999-06-22 20:00:04 achimha Exp $ */
2/*
3 * User Interface Functions
4 *
5 * Copyright 1997 Dimitrie O. Paun
6 * Copyright 1997 Bertho A. Stultiens
7 * Copyright 1999 Achim Hasenmueller
8 */
9
10#include "winuser.h"
11#include "user32.h"
12
13/* These tables are used in:
14 * UITOOLS_DrawDiagEdge()
15 * UITOOLS_DrawRectEdge()
16 */
17static const char LTInnerNormal[] = {
18 -1, -1, -1, -1,
19 -1, COLOR_BTNHIGHLIGHT, COLOR_BTNHIGHLIGHT, -1,
20 -1, COLOR_3DDKSHADOW, COLOR_3DDKSHADOW, -1,
21 -1, -1, -1, -1
22};
23
24static const char LTOuterNormal[] = {
25 -1, COLOR_3DLIGHT, COLOR_BTNSHADOW, -1,
26 COLOR_BTNHIGHLIGHT, COLOR_3DLIGHT, COLOR_BTNSHADOW, -1,
27 COLOR_3DDKSHADOW, COLOR_3DLIGHT, COLOR_BTNSHADOW, -1,
28 -1, COLOR_3DLIGHT, COLOR_BTNSHADOW, -1
29};
30
31static const char RBInnerNormal[] = {
32 -1, -1, -1, -1,
33 -1, COLOR_BTNSHADOW, COLOR_BTNSHADOW, -1,
34 -1, COLOR_3DLIGHT, COLOR_3DLIGHT, -1,
35 -1, -1, -1, -1
36};
37
38static const char RBOuterNormal[] = {
39 -1, COLOR_3DDKSHADOW, COLOR_BTNHIGHLIGHT, -1,
40 COLOR_BTNSHADOW, COLOR_3DDKSHADOW, COLOR_BTNHIGHLIGHT, -1,
41 COLOR_3DLIGHT, COLOR_3DDKSHADOW, COLOR_BTNHIGHLIGHT, -1,
42 -1, COLOR_3DDKSHADOW, COLOR_BTNHIGHLIGHT, -1
43};
44
45static const char LTInnerSoft[] = {
46 -1, -1, -1, -1,
47 -1, COLOR_3DLIGHT, COLOR_3DLIGHT, -1,
48 -1, COLOR_BTNSHADOW, COLOR_BTNSHADOW, -1,
49 -1, -1, -1, -1
50};
51
52static const char LTOuterSoft[] = {
53 -1, COLOR_BTNHIGHLIGHT, COLOR_3DDKSHADOW, -1,
54 COLOR_3DLIGHT, COLOR_BTNHIGHLIGHT, COLOR_3DDKSHADOW, -1,
55 COLOR_BTNSHADOW, COLOR_BTNHIGHLIGHT, COLOR_3DDKSHADOW, -1,
56 -1, COLOR_BTNHIGHLIGHT, COLOR_3DDKSHADOW, -1
57};
58
59#define RBInnerSoft RBInnerNormal /* These are the same */
60#define RBOuterSoft RBOuterNormal
61
62static const char LTRBOuterMono[] = {
63 -1, COLOR_WINDOWFRAME, COLOR_WINDOWFRAME, COLOR_WINDOWFRAME,
64 COLOR_WINDOW, COLOR_WINDOWFRAME, COLOR_WINDOWFRAME, COLOR_WINDOWFRAME,
65 COLOR_WINDOW, COLOR_WINDOWFRAME, COLOR_WINDOWFRAME, COLOR_WINDOWFRAME,
66 COLOR_WINDOW, COLOR_WINDOWFRAME, COLOR_WINDOWFRAME, COLOR_WINDOWFRAME,
67};
68
69static const char LTRBInnerMono[] = {
70 -1, -1, -1, -1,
71 -1, COLOR_WINDOW, COLOR_WINDOW, COLOR_WINDOW,
72 -1, COLOR_WINDOW, COLOR_WINDOW, COLOR_WINDOW,
73 -1, COLOR_WINDOW, COLOR_WINDOW, COLOR_WINDOW,
74};
75
76static const char LTRBOuterFlat[] = {
77 -1, COLOR_BTNSHADOW, COLOR_BTNSHADOW, COLOR_BTNSHADOW,
78 COLOR_WINDOWFRAME, COLOR_BTNSHADOW, COLOR_BTNSHADOW, COLOR_BTNSHADOW,
79 COLOR_WINDOWFRAME, COLOR_BTNSHADOW, COLOR_BTNSHADOW, COLOR_BTNSHADOW,
80 COLOR_WINDOWFRAME, COLOR_BTNSHADOW, COLOR_BTNSHADOW, COLOR_BTNSHADOW,
81};
82
83static const char LTRBInnerFlat[] = {
84 -1, -1, -1, -1,
85 -1, COLOR_WINDOWFRAME, COLOR_WINDOWFRAME, COLOR_WINDOWFRAME,
86 -1, COLOR_WINDOWFRAME, COLOR_WINDOWFRAME, COLOR_WINDOWFRAME,
87 -1, COLOR_WINDOWFRAME, COLOR_WINDOWFRAME, COLOR_WINDOWFRAME,
88};
89
90/***********************************************************************
91 * UITOOLS_DrawDiagEdge
92 *
93 * Same as DrawEdge invoked with BF_DIAGONAL
94 *
95 * 03-Dec-1997: Changed by Bertho Stultiens
96 *
97 * See also comments with UITOOLS_DrawRectEdge()
98 */
99static BOOL UITOOLS95_DrawDiagEdge(HDC hdc, LPRECT rc,
100 UINT uType, UINT uFlags)
101{
102 POINT Points[4];
103 char InnerI, OuterI;
104 HPEN InnerPen, OuterPen;
105 POINT SavePoint;
106 HPEN SavePen;
107 int spx, spy;
108 int epx, epy;
109 int Width = rc->right - rc->left;
110 int Height= rc->bottom - rc->top;
111 int SmallDiam = Width > Height ? Height : Width;
112 BOOL retval = !( ((uType & BDR_INNER) == BDR_INNER
113 || (uType & BDR_OUTER) == BDR_OUTER)
114 && !(uFlags & (BF_FLAT|BF_MONO)) );
115 int add = (LTRBInnerMono[uType & (BDR_INNER|BDR_OUTER)] != -1 ? 1 : 0)
116 + (LTRBOuterMono[uType & (BDR_INNER|BDR_OUTER)] != -1 ? 1 : 0);
117
118 /* Init some vars */
119 OuterPen = InnerPen = (HPEN)GetStockObject(NULL_PEN);
120 SavePen = (HPEN)SelectObject(hdc, InnerPen);
121 spx = spy = epx = epy = 0; /* Satisfy the compiler... */
122
123 /* Determine the colors of the edges */
124 if(uFlags & BF_MONO)
125 {
126 InnerI = LTRBInnerMono[uType & (BDR_INNER|BDR_OUTER)];
127 OuterI = LTRBOuterMono[uType & (BDR_INNER|BDR_OUTER)];
128 }
129 else if(uFlags & BF_FLAT)
130 {
131 InnerI = LTRBInnerFlat[uType & (BDR_INNER|BDR_OUTER)];
132 OuterI = LTRBOuterFlat[uType & (BDR_INNER|BDR_OUTER)];
133 }
134 else if(uFlags & BF_SOFT)
135 {
136 if(uFlags & BF_BOTTOM)
137 {
138 InnerI = RBInnerSoft[uType & (BDR_INNER|BDR_OUTER)];
139 OuterI = RBOuterSoft[uType & (BDR_INNER|BDR_OUTER)];
140 }
141 else
142 {
143 InnerI = LTInnerSoft[uType & (BDR_INNER|BDR_OUTER)];
144 OuterI = LTOuterSoft[uType & (BDR_INNER|BDR_OUTER)];
145 }
146 }
147 else
148 {
149 if(uFlags & BF_BOTTOM)
150 {
151 InnerI = RBInnerNormal[uType & (BDR_INNER|BDR_OUTER)];
152 OuterI = RBOuterNormal[uType & (BDR_INNER|BDR_OUTER)];
153 }
154 else
155 {
156 InnerI = LTInnerNormal[uType & (BDR_INNER|BDR_OUTER)];
157 OuterI = LTOuterNormal[uType & (BDR_INNER|BDR_OUTER)];
158 }
159 }
160
161 if(InnerI != -1) InnerPen = GetSysColorPen(InnerI);
162 if(OuterI != -1) OuterPen = GetSysColorPen(OuterI);
163
164 MoveToEx(hdc, 0, 0, &SavePoint);
165
166 /* Don't ask me why, but this is what is visible... */
167 /* This must be possible to do much simpler, but I fail to */
168 /* see the logic in the MS implementation (sigh...). */
169 /* So, this might look a bit brute force here (and it is), but */
170 /* it gets the job done;) */
171
172 switch(uFlags & BF_RECT)
173 {
174 case 0:
175 case BF_LEFT:
176 case BF_BOTTOM:
177 case BF_BOTTOMLEFT:
178 /* Left bottom endpoint */
179 epx = rc->left-1;
180 spx = epx + SmallDiam;
181 epy = rc->bottom;
182 spy = epy - SmallDiam;
183 break;
184
185 case BF_TOPLEFT:
186 case BF_BOTTOMRIGHT:
187 /* Left top endpoint */
188 epx = rc->left-1;
189 spx = epx + SmallDiam;
190 epy = rc->top-1;
191 spy = epy + SmallDiam;
192 break;
193
194 case BF_TOP:
195 case BF_RIGHT:
196 case BF_TOPRIGHT:
197 case BF_RIGHT|BF_LEFT:
198 case BF_RIGHT|BF_LEFT|BF_TOP:
199 case BF_BOTTOM|BF_TOP:
200 case BF_BOTTOM|BF_TOP|BF_LEFT:
201 case BF_BOTTOMRIGHT|BF_LEFT:
202 case BF_BOTTOMRIGHT|BF_TOP:
203 case BF_RECT:
204 /* Right top endpoint */
205 spx = rc->left;
206 epx = spx + SmallDiam;
207 spy = rc->bottom-1;
208 epy = spy - SmallDiam;
209 break;
210 }
211
212 MoveToEx(hdc, spx, spy, NULL);
213 SelectObject(hdc, OuterPen);
214 LineTo(hdc, epx, epy);
215
216 SelectObject(hdc, InnerPen);
217
218 switch(uFlags & (BF_RECT|BF_DIAGONAL))
219 {
220 case BF_DIAGONAL_ENDBOTTOMLEFT:
221 case (BF_DIAGONAL|BF_BOTTOM):
222 case BF_DIAGONAL:
223 case (BF_DIAGONAL|BF_LEFT):
224 MoveToEx(hdc, spx-1, spy, NULL);
225 LineTo(hdc, epx, epy-1);
226 Points[0].x = spx-add;
227 Points[0].y = spy;
228 Points[1].x = rc->left;
229 Points[1].y = rc->top;
230 Points[2].x = epx+1;
231 Points[2].y = epy-1-add;
232 Points[3] = Points[2];
233 break;
234
235 case BF_DIAGONAL_ENDBOTTOMRIGHT:
236 MoveToEx(hdc, spx-1, spy, NULL);
237 LineTo(hdc, epx, epy+1);
238 Points[0].x = spx-add;
239 Points[0].y = spy;
240 Points[1].x = rc->left;
241 Points[1].y = rc->bottom-1;
242 Points[2].x = epx+1;
243 Points[2].y = epy+1+add;
244 Points[3] = Points[2];
245 break;
246
247 case (BF_DIAGONAL|BF_BOTTOM|BF_RIGHT|BF_TOP):
248 case (BF_DIAGONAL|BF_BOTTOM|BF_RIGHT|BF_TOP|BF_LEFT):
249 case BF_DIAGONAL_ENDTOPRIGHT:
250 case (BF_DIAGONAL|BF_RIGHT|BF_TOP|BF_LEFT):
251 MoveToEx(hdc, spx+1, spy, NULL);
252 LineTo(hdc, epx, epy+1);
253 Points[0].x = epx-1;
254 Points[0].y = epy+1+add;
255 Points[1].x = rc->right-1;
256 Points[1].y = rc->top+add;
257 Points[2].x = rc->right-1;
258 Points[2].y = rc->bottom-1;
259 Points[3].x = spx+add;
260 Points[3].y = spy;
261 break;
262
263 case BF_DIAGONAL_ENDTOPLEFT:
264 MoveToEx(hdc, spx, spy-1, NULL);
265 LineTo(hdc, epx+1, epy);
266 Points[0].x = epx+1+add;
267 Points[0].y = epy+1;
268 Points[1].x = rc->right-1;
269 Points[1].y = rc->top;
270 Points[2].x = rc->right-1;
271 Points[2].y = rc->bottom-1-add;
272 Points[3].x = spx;
273 Points[3].y = spy-add;
274 break;
275
276 case (BF_DIAGONAL|BF_TOP):
277 case (BF_DIAGONAL|BF_BOTTOM|BF_TOP):
278 case (BF_DIAGONAL|BF_BOTTOM|BF_TOP|BF_LEFT):
279 MoveToEx(hdc, spx+1, spy-1, NULL);
280 LineTo(hdc, epx, epy);
281 Points[0].x = epx-1;
282 Points[0].y = epy+1;
283 Points[1].x = rc->right-1;
284 Points[1].y = rc->top;
285 Points[2].x = rc->right-1;
286 Points[2].y = rc->bottom-1-add;
287 Points[3].x = spx+add;
288 Points[3].y = spy-add;
289 break;
290
291 case (BF_DIAGONAL|BF_RIGHT):
292 case (BF_DIAGONAL|BF_RIGHT|BF_LEFT):
293 case (BF_DIAGONAL|BF_RIGHT|BF_LEFT|BF_BOTTOM):
294 MoveToEx(hdc, spx, spy, NULL);
295 LineTo(hdc, epx-1, epy+1);
296 Points[0].x = spx;
297 Points[0].y = spy;
298 Points[1].x = rc->left;
299 Points[1].y = rc->top+add;
300 Points[2].x = epx-1-add;
301 Points[2].y = epy+1+add;
302 Points[3] = Points[2];
303 break;
304 }
305
306 /* Fill the interior if asked */
307 if((uFlags & BF_MIDDLE) && retval)
308 {
309 HBRUSH hbsave;
310 HBRUSH hb = GetSysColorBrush(uFlags & BF_MONO ? COLOR_WINDOW
311 :COLOR_BTNFACE);
312 HPEN hpsave;
313 HPEN hp = GetSysColorPen(uFlags & BF_MONO ? COLOR_WINDOW
314 : COLOR_BTNFACE);
315 hbsave = (HBRUSH)SelectObject(hdc, hb);
316 hpsave = (HPEN)SelectObject(hdc, hp);
317 Polygon(hdc, Points, 4);
318 SelectObject(hdc, hbsave);
319 SelectObject(hdc, hpsave);
320 }
321
322 /* Adjust rectangle if asked */
323 if(uFlags & BF_ADJUST)
324 {
325 if(uFlags & BF_LEFT) rc->left += add;
326 if(uFlags & BF_RIGHT) rc->right -= add;
327 if(uFlags & BF_TOP) rc->top += add;
328 if(uFlags & BF_BOTTOM) rc->bottom -= add;
329 }
330
331 /* Cleanup */
332 SelectObject(hdc, SavePen);
333 MoveToEx(hdc, SavePoint.x, SavePoint.y, NULL);
334
335 return retval;
336}
337
338/***********************************************************************
339 * UITOOLS_DrawRectEdge
340 *
341 * Same as DrawEdge invoked without BF_DIAGONAL
342 *
343 * 23-Nov-1997: Changed by Bertho Stultiens
344 *
345 * Well, I started testing this and found out that there are a few things
346 * that weren't quite as win95. The following rewrite should reproduce
347 * win95 results completely.
348 * The colorselection is table-driven to avoid awfull if-statements.
349 * The table below show the color settings.
350 *
351 * Pen selection table for uFlags = 0
352 *
353 * uType | LTI | LTO | RBI | RBO
354 * ------+-------+-------+-------+-------
355 * 0000 | x | x | x | x
356 * 0001 | x | 22 | x | 21
357 * 0010 | x | 16 | x | 20
358 * 0011 | x | x | x | x
359 * ------+-------+-------+-------+-------
360 * 0100 | x | 20 | x | 16
361 * 0101 | 20 | 22 | 16 | 21
362 * 0110 | 20 | 16 | 16 | 20
363 * 0111 | x | x | x | x
364 * ------+-------+-------+-------+-------
365 * 1000 | x | 21 | x | 22
366 * 1001 | 21 | 22 | 22 | 21
367 * 1010 | 21 | 16 | 22 | 20
368 * 1011 | x | x | x | x
369 * ------+-------+-------+-------+-------
370 * 1100 | x | x | x | x
371 * 1101 | x | x (22)| x | x (21)
372 * 1110 | x | x (16)| x | x (20)
373 * 1111 | x | x | x | x
374 *
375 * Pen selection table for uFlags = BF_SOFT
376 *
377 * uType | LTI | LTO | RBI | RBO
378 * ------+-------+-------+-------+-------
379 * 0000 | x | x | x | x
380 * 0001 | x | 20 | x | 21
381 * 0010 | x | 21 | x | 20
382 * 0011 | x | x | x | x
383 * ------+-------+-------+-------+-------
384 * 0100 | x | 22 | x | 16
385 * 0101 | 22 | 20 | 16 | 21
386 * 0110 | 22 | 21 | 16 | 20
387 * 0111 | x | x | x | x
388 * ------+-------+-------+-------+-------
389 * 1000 | x | 16 | x | 22
390 * 1001 | 16 | 20 | 22 | 21
391 * 1010 | 16 | 21 | 22 | 20
392 * 1011 | x | x | x | x
393 * ------+-------+-------+-------+-------
394 * 1100 | x | x | x | x
395 * 1101 | x | x (20)| x | x (21)
396 * 1110 | x | x (21)| x | x (20)
397 * 1111 | x | x | x | x
398 *
399 * x = don't care; (n) = is what win95 actually uses
400 * LTI = left Top Inner line
401 * LTO = left Top Outer line
402 * RBI = Right Bottom Inner line
403 * RBO = Right Bottom Outer line
404 * 15 = COLOR_BTNFACE
405 * 16 = COLOR_BTNSHADOW
406 * 20 = COLOR_BTNHIGHLIGHT
407 * 21 = COLOR_3DDKSHADOW
408 * 22 = COLOR_3DLIGHT
409 */
410
411
412static BOOL UITOOLS95_DrawRectEdge(HDC hdc, LPRECT rc,
413 UINT uType, UINT uFlags)
414{
415 char LTInnerI, LTOuterI;
416 char RBInnerI, RBOuterI;
417 HPEN LTInnerPen, LTOuterPen;
418 HPEN RBInnerPen, RBOuterPen;
419 RECT InnerRect = *rc;
420 POINT SavePoint;
421 HPEN SavePen;
422 int LBpenplus = 0;
423 int LTpenplus = 0;
424 int RTpenplus = 0;
425 int RBpenplus = 0;
426 BOOL retval = !( ((uType & BDR_INNER) == BDR_INNER
427 || (uType & BDR_OUTER) == BDR_OUTER)
428 && !(uFlags & (BF_FLAT|BF_MONO)) );
429
430 /* Init some vars */
431 LTInnerPen = LTOuterPen = RBInnerPen = RBOuterPen = (HPEN)GetStockObject(NULL_PEN);
432 SavePen = (HPEN)SelectObject(hdc, LTInnerPen);
433
434 /* Determine the colors of the edges */
435 if(uFlags & BF_MONO)
436 {
437 LTInnerI = RBInnerI = LTRBInnerMono[uType & (BDR_INNER|BDR_OUTER)];
438 LTOuterI = RBOuterI = LTRBOuterMono[uType & (BDR_INNER|BDR_OUTER)];
439 }
440 else if(uFlags & BF_FLAT)
441 {
442 LTInnerI = RBInnerI = LTRBInnerFlat[uType & (BDR_INNER|BDR_OUTER)];
443 LTOuterI = RBOuterI = LTRBOuterFlat[uType & (BDR_INNER|BDR_OUTER)];
444 }
445 else if(uFlags & BF_SOFT)
446 {
447 LTInnerI = LTInnerSoft[uType & (BDR_INNER|BDR_OUTER)];
448 LTOuterI = LTOuterSoft[uType & (BDR_INNER|BDR_OUTER)];
449 RBInnerI = RBInnerSoft[uType & (BDR_INNER|BDR_OUTER)];
450 RBOuterI = RBOuterSoft[uType & (BDR_INNER|BDR_OUTER)];
451 }
452 else
453 {
454 LTInnerI = LTInnerNormal[uType & (BDR_INNER|BDR_OUTER)];
455 LTOuterI = LTOuterNormal[uType & (BDR_INNER|BDR_OUTER)];
456 RBInnerI = RBInnerNormal[uType & (BDR_INNER|BDR_OUTER)];
457 RBOuterI = RBOuterNormal[uType & (BDR_INNER|BDR_OUTER)];
458 }
459
460 if((uFlags & BF_BOTTOMLEFT) == BF_BOTTOMLEFT) LBpenplus = 1;
461 if((uFlags & BF_TOPRIGHT) == BF_TOPRIGHT) RTpenplus = 1;
462 if((uFlags & BF_BOTTOMRIGHT) == BF_BOTTOMRIGHT) RBpenplus = 1;
463 if((uFlags & BF_TOPLEFT) == BF_TOPLEFT) LTpenplus = 1;
464
465 if(LTInnerI != -1) LTInnerPen = GetSysColorPen(LTInnerI);
466 if(LTOuterI != -1) LTOuterPen = GetSysColorPen(LTOuterI);
467 if(RBInnerI != -1) RBInnerPen = GetSysColorPen(RBInnerI);
468 if(RBOuterI != -1) RBOuterPen = GetSysColorPen(RBOuterI);
469
470 if((uFlags & BF_MIDDLE) && retval)
471 {
472 FillRect(hdc, &InnerRect, GetSysColorBrush(uFlags & BF_MONO ?
473 COLOR_WINDOW : COLOR_BTNFACE));
474 }
475
476 MoveToEx(hdc, 0, 0, &SavePoint);
477
478 /* Draw the outer edge */
479 SelectObject(hdc, LTOuterPen);
480 if(uFlags & BF_TOP)
481 {
482 MoveToEx(hdc, InnerRect.left, InnerRect.top, NULL);
483 LineTo(hdc, InnerRect.right, InnerRect.top);
484 }
485 if(uFlags & BF_LEFT)
486 {
487 MoveToEx(hdc, InnerRect.left, InnerRect.top, NULL);
488 LineTo(hdc, InnerRect.left, InnerRect.bottom);
489 }
490 SelectObject(hdc, RBOuterPen);
491 if(uFlags & BF_BOTTOM)
492 {
493 MoveToEx(hdc, InnerRect.right-1, InnerRect.bottom-1, NULL);
494 LineTo(hdc, InnerRect.left-1, InnerRect.bottom-1);
495 }
496 if(uFlags & BF_RIGHT)
497 {
498 MoveToEx(hdc, InnerRect.right-1, InnerRect.bottom-1, NULL);
499 LineTo(hdc, InnerRect.right-1, InnerRect.top-1);
500 }
501
502 /* Draw the inner edge */
503 SelectObject(hdc, LTInnerPen);
504 if(uFlags & BF_TOP)
505 {
506 MoveToEx(hdc, InnerRect.left+LTpenplus, InnerRect.top+1, NULL);
507 LineTo(hdc, InnerRect.right-RTpenplus, InnerRect.top+1);
508 }
509 if(uFlags & BF_LEFT)
510 {
511 MoveToEx(hdc, InnerRect.left+1, InnerRect.top+LTpenplus, NULL);
512 LineTo(hdc, InnerRect.left+1, InnerRect.bottom-LBpenplus);
513 }
514 SelectObject(hdc, RBInnerPen);
515 if(uFlags & BF_BOTTOM)
516 {
517 MoveToEx(hdc, InnerRect.right-1-RBpenplus, InnerRect.bottom-2, NULL);
518 LineTo(hdc, InnerRect.left-1+LBpenplus, InnerRect.bottom-2);
519 }
520 if(uFlags & BF_RIGHT)
521 {
522 MoveToEx(hdc, InnerRect.right-2, InnerRect.bottom-1-RBpenplus, NULL);
523 LineTo(hdc, InnerRect.right-2, InnerRect.top-1+RTpenplus);
524 }
525
526 /* Adjust rectangle if asked */
527 if(uFlags & BF_ADJUST)
528 {
529 int add = (LTRBInnerMono[uType & (BDR_INNER|BDR_OUTER)] != -1 ? 1 : 0)
530 + (LTRBOuterMono[uType & (BDR_INNER|BDR_OUTER)] != -1 ? 1 : 0);
531 if(uFlags & BF_LEFT) rc->left += add;
532 if(uFlags & BF_RIGHT) rc->right -= add;
533 if(uFlags & BF_TOP) rc->top += add;
534 if(uFlags & BF_BOTTOM) rc->bottom -= add;
535 }
536
537 /* Cleanup */
538 SelectObject(hdc, SavePen);
539 MoveToEx(hdc, SavePoint.x, SavePoint.y, NULL);
540 return retval;
541}
542
543
544//**********************************************************************
545// DrawEdge (USER32.155)
546//
547BOOL WIN32API DrawEdge(HDC hdc, LPRECT rc, UINT edge, UINT flags)
548{
549
550 if(flags & BF_DIAGONAL)
551 return UITOOLS95_DrawDiagEdge(hdc, rc, edge, flags);
552 else
553 return UITOOLS95_DrawRectEdge(hdc, rc, edge, flags);
554}
Note: See TracBrowser for help on using the repository browser.