ReactOS 0.4.15-dev-7953-g1f49173
draw.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MY_BF_ACTIVEBORDER   0x1000000
 
#define MY_BF_INACTIVEBORDER   0x2000000
 

Functions

BOOL MyDrawFrameControl (HDC hDC, LPRECT rc, UINT uType, UINT uState, COLOR_SCHEME *scheme)
 
BOOL MyDrawEdge (HDC hDC, LPRECT rc, UINT edge, UINT flags, COLOR_SCHEME *scheme)
 
VOID MyDrawCaptionButtons (HDC hdc, LPRECT lpRect, BOOL bMinMax, int x, COLOR_SCHEME *scheme)
 
VOID MyDrawScrollbar (HDC hdc, LPRECT rc, HBRUSH hbrScrollbar, COLOR_SCHEME *scheme)
 
BOOL MyDrawCaptionTemp (HWND hwnd, HDC hdc, const RECT *rect, HFONT hFont, HICON hIcon, LPCWSTR str, UINT uFlags, COLOR_SCHEME *scheme)
 
DWORD MyDrawMenuBarTemp (HWND Wnd, HDC DC, LPRECT Rect, HMENU Menu, HFONT Font, COLOR_SCHEME *scheme)
 

Macro Definition Documentation

◆ MY_BF_ACTIVEBORDER

#define MY_BF_ACTIVEBORDER   0x1000000

Definition at line 16 of file draw.h.

◆ MY_BF_INACTIVEBORDER

#define MY_BF_INACTIVEBORDER   0x2000000

Definition at line 17 of file draw.h.

Function Documentation

◆ MyDrawCaptionButtons()

VOID MyDrawCaptionButtons ( HDC  hdc,
LPRECT  lpRect,
BOOL  bMinMax,
int  x,
COLOR_SCHEME scheme 
)

Definition at line 392 of file draw.c.

393{
394 RECT rc3;
395 RECT rc4;
396 RECT rc5;
397
398 rc3.left = lpRect->right - 2 - x;
399 rc3.top = lpRect->top + 2;
400 rc3.right = lpRect->right - 2;
401 rc3.bottom = lpRect->bottom - 2;
402
404
405 if (bMinMax)
406 {
407 rc4.left = rc3.left - x - 2;
408 rc4.top = rc3.top;
409 rc4.right = rc3.right - x - 2;
410 rc4.bottom = rc3.bottom;
411
413
414 rc5.left = rc4.left - x;
415 rc5.top = rc4.top;
416 rc5.right = rc4.right - x;
417 rc5.bottom = rc4.bottom;
418
420 }
421}
BOOL MyDrawFrameControl(HDC hDC, LPRECT rc, UINT uType, UINT uState, COLOR_SCHEME *scheme)
Definition: draw.c:371
static const WCHAR rc4[]
Definition: oid.c:1217
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
HDC hdc
Definition: main.c:9
DWORD scheme
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
#define DFCS_CAPTIONMIN
Definition: winuser.h:481
#define DFCS_CAPTIONCLOSE
Definition: winuser.h:480
#define DFC_CAPTION
Definition: winuser.h:473
#define DFCS_CAPTIONMAX
Definition: winuser.h:482

Referenced by OnPaint().

◆ MyDrawCaptionTemp()

BOOL MyDrawCaptionTemp ( HWND  hwnd,
HDC  hdc,
const RECT rect,
HFONT  hFont,
HICON  hIcon,
LPCWSTR  str,
UINT  uFlags,
COLOR_SCHEME scheme 
)

Definition at line 457 of file draw.c.

458{
459 //ULONG Height;
460 //UINT VCenter, Padding;
461 //LONG ButtonWidth;
462 HBRUSH hbr;
463 HGDIOBJ hFontOld;
464 RECT rc;
465
466 //Height = scheme->Size[SIZE_CAPTION_Y] - 1;
467 //VCenter = (rect->bottom - rect->top) / 2;
468 //Padding = VCenter - (Height / 2);
469
470 //ButtonWidth = scheme->Size[SIZE_SIZE_X] - 2;
471
472 if (uFlags & DC_GRADIENT)
473 {
474 GRADIENT_RECT gcap = {0, 1};
475 TRIVERTEX vert[2];
476 COLORREF Colors[2];
477
478 Colors[0] = scheme->crColor[((uFlags & DC_ACTIVE) ?
480 Colors[1] = scheme->crColor[((uFlags & DC_ACTIVE) ?
482
483 vert[0].x = rect->left;
484 vert[0].y = rect->top;
485 vert[0].Red = (WORD)Colors[0]<<8;
486 vert[0].Green = (WORD)Colors[0] & 0xFF00;
487 vert[0].Blue = (WORD)(Colors[0]>>8) & 0xFF00;
488 vert[0].Alpha = 0;
489
490 vert[1].x = rect->right;
491 vert[1].y = rect->bottom;
492 vert[1].Red = (WORD)Colors[1]<<8;
493 vert[1].Green = (WORD)Colors[1] & 0xFF00;
494 vert[1].Blue = (WORD)(Colors[1]>>8) & 0xFF00;
495 vert[1].Alpha = 0;
496
497 GdiGradientFill(hdc, vert, 2, &gcap, 1, GRADIENT_FILL_RECT_H);
498 }
499 else
500 {
501 if (uFlags & DC_ACTIVE)
503 else
505 FillRect(hdc, rect, hbr);
506 DeleteObject(hbr);
507 }
508
509 hFontOld = SelectObject(hdc, hFont);
511 if (uFlags & DC_ACTIVE)
513 else
515 rc.left = rect->left + 2;
516 rc.top = rect->top;
517 rc.right = rect->right;
518 rc.bottom = rect->bottom;
520 SelectObject(hdc, hFontOld);
521 return TRUE;
522}
Colors
Definition: ansiprsr.h:4
HFONT hFont
Definition: main.c:53
#define DC_ACTIVE
Definition: dc21x4.h:120
#define TRUE
Definition: types.h:120
UINT uFlags
Definition: api.c:59
unsigned short WORD
Definition: ntddk_ex.h:93
pKey DeleteObject()
BOOL WINAPI GdiGradientFill(HDC hdc, TRIVERTEX *vert_array, ULONG nvert, void *grad_array, ULONG ngrad, ULONG mode)
INT WINAPI DrawTextW(HDC hdc, LPCWSTR str, INT count, LPRECT rect, UINT flags)
Definition: defwnd.c:16
const WCHAR * str
& rect
Definition: startmenu.cpp:1413
COLOR16 Red
Definition: wingdi.h:2786
LONG y
Definition: wingdi.h:2785
COLOR16 Green
Definition: wingdi.h:2787
COLOR16 Alpha
Definition: wingdi.h:2789
COLOR16 Blue
Definition: wingdi.h:2788
LONG x
Definition: wingdi.h:2784
DWORD COLORREF
Definition: windef.h:300
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1539
#define TRANSPARENT
Definition: wingdi.h:950
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
int WINAPI SetBkMode(_In_ HDC, _In_ int)
Definition: dc.c:1056
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
Definition: text.c:918
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)
#define COLOR_INACTIVECAPTIONTEXT
Definition: winuser.h:934
#define COLOR_GRADIENTINACTIVECAPTION
Definition: winuser.h:945
#define DT_SINGLELINE
Definition: winuser.h:540
#define COLOR_ACTIVECAPTION
Definition: winuser.h:915
#define COLOR_INACTIVECAPTION
Definition: winuser.h:916
#define COLOR_GRADIENTACTIVECAPTION
Definition: winuser.h:944
#define DT_VCENTER
Definition: winuser.h:543
#define COLOR_CAPTIONTEXT
Definition: winuser.h:922

Referenced by OnPaint().

◆ MyDrawEdge()

BOOL MyDrawEdge ( HDC  hDC,
LPRECT  rc,
UINT  edge,
UINT  flags,
COLOR_SCHEME scheme 
)

Definition at line 386 of file draw.c.

387{
388 return MyIntDrawRectEdge(hDC, rc, edge, flags, scheme);
389}
static HDC hDC
Definition: 3dtext.c:33
static BOOL MyIntDrawRectEdge(HDC hdc, LPRECT rc, UINT uType, UINT uFlags, COLOR_SCHEME *scheme)
Definition: draw.c:59
GLbitfield flags
Definition: glext.h:7161

Referenced by OnPaint().

◆ MyDrawFrameControl()

BOOL MyDrawFrameControl ( HDC  hDC,
LPRECT  rc,
UINT  uType,
UINT  uState,
COLOR_SCHEME scheme 
)

Definition at line 371 of file draw.c.

372{
373 switch(uType)
374 {
375 case DFC_BUTTON:
376 return MyDrawFrameButton(hDC, rc, uState, scheme);
377 case DFC_CAPTION:
378 return MyDrawFrameCaption(hDC, rc, uState, scheme);
379 case DFC_SCROLL:
380 return MyDrawFrameScroll(hDC, rc, uState, scheme);
381 }
382 return FALSE;
383}
#define FALSE
Definition: types.h:117
static BOOL MyDrawFrameCaption(HDC dc, LPRECT r, UINT uFlags, COLOR_SCHEME *scheme)
Definition: draw.c:233
static BOOL MyDrawFrameButton(HDC hdc, LPRECT rc, UINT uState, COLOR_SCHEME *scheme)
Definition: draw.c:198
static BOOL MyDrawFrameScroll(HDC dc, LPRECT r, UINT uFlags, COLOR_SCHEME *scheme)
Definition: draw.c:302
#define DFC_SCROLL
Definition: winuser.h:475
#define DFC_BUTTON
Definition: winuser.h:476

Referenced by MyDrawCaptionButtons(), MyDrawScrollbar(), and OnPaint().

◆ MyDrawMenuBarTemp()

DWORD MyDrawMenuBarTemp ( HWND  Wnd,
HDC  DC,
LPRECT  Rect,
HMENU  Menu,
HFONT  Font,
COLOR_SCHEME scheme 
)

Definition at line 527 of file draw.c.

528{
529 HBRUSH hbr;
530 HPEN hPen;
531 HGDIOBJ hPenOld, hFontOld;
532 BOOL flat_menu;
533 INT i, bkgnd, x;
534 RECT rect;
535 WCHAR Text[128];
537
538 flat_menu = scheme->bFlatMenus;
539
540 if (flat_menu)
541 hbr = CreateSolidBrush(scheme->crColor[COLOR_MENUBAR]);
542 else
543 hbr = CreateSolidBrush(scheme->crColor[COLOR_MENU]);
544 FillRect(DC, Rect, hbr);
545 DeleteObject(hbr);
546
547 hPen = CreatePen(PS_SOLID, 0, scheme->crColor[COLOR_3DFACE]);
548 hPenOld = SelectObject(DC, hPen);
549 MoveToEx(DC, Rect->left, Rect->bottom - 1, NULL);
550 LineTo(DC, Rect->right, Rect->bottom - 1);
551 SelectObject(DC, hPenOld);
552 DeleteObject(hPen);
553
554 bkgnd = (flat_menu ? COLOR_MENUBAR : COLOR_MENU);
555 x = Rect->left;
556 hFontOld = SelectObject(DC, Font);
557 for (i = 0; i < 3; i++)
558 {
559 GetMenuStringW(Menu, i, Text, 128, MF_BYPOSITION);
560
561 rect.left = rect.right = x;
562 rect.top = Rect->top;
563 rect.bottom = Rect->bottom;
565 rect.bottom = Rect->bottom;
566 rect.right += MENU_BAR_ITEMS_SPACE;
567 x += rect.right - rect.left;
568
569 if (i == 2)
570 {
571 if (flat_menu)
572 {
575
576 InflateRect (&rect, -1, -1);
577 hbr = CreateSolidBrush(scheme->crColor[COLOR_MENUHILIGHT]);
578 FillRect(DC, &rect, hbr);
579 DeleteObject(hbr);
580
581 InflateRect (&rect, 1, 1);
582 hbr = CreateSolidBrush(scheme->crColor[COLOR_HIGHLIGHT]);
583 FrameRect(DC, &rect, hbr);
584 DeleteObject(hbr);
585 }
586 else
587 {
589 SetBkColor(DC, scheme->crColor[COLOR_MENU]);
591 }
592 }
593 else
594 {
595 if (i == 1)
597 else
599
600 SetBkColor(DC, scheme->crColor[bkgnd]);
601 hbr = CreateSolidBrush(scheme->crColor[bkgnd]);
602 FillRect(DC, &rect, hbr);
603 DeleteObject(hbr);
604 }
605
607
608 rect.left += MENU_BAR_ITEMS_SPACE / 2;
609 rect.right -= MENU_BAR_ITEMS_SPACE / 2;
610
611 if (i == 1)
612 {
613 ++rect.left; ++rect.top; ++rect.right; ++rect.bottom;
615 DrawTextW(DC, Text, -1, &rect, uFormat);
616 --rect.left; --rect.top; --rect.right; --rect.bottom;
618 }
619 DrawTextW(DC, Text, -1, &rect, uFormat);
620 }
621 SelectObject(DC, hFontOld);
622
623 return TRUE;
624}
char * Text
Definition: combotst.c:136
#define NULL
Definition: types.h:112
#define MENU_BAR_ITEMS_SPACE
Definition: draw.c:12
unsigned int BOOL
Definition: ntddk_ex.h:94
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
unsigned int UINT
Definition: ndis.h:50
Definition: polytest.cpp:41
int32_t INT
Definition: typedefs.h:58
COLORREF WINAPI SetBkColor(_In_ HDC, _In_ COLORREF)
Definition: dc.c:999
BOOL WINAPI MoveToEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPPOINT)
HPEN WINAPI CreatePen(_In_ int, _In_ int, _In_ COLORREF)
BOOL WINAPI LineTo(_In_ HDC, _In_ int, _In_ int)
#define PS_SOLID
Definition: wingdi.h:586
int WINAPI FrameRect(_In_ HDC, _In_ LPCRECT, _In_ HBRUSH)
#define BDR_SUNKENOUTER
Definition: winuser.h:443
#define COLOR_MENU
Definition: winuser.h:917
#define COLOR_GRAYTEXT
Definition: winuser.h:932
#define DT_CENTER
Definition: winuser.h:527
int WINAPI GetMenuStringW(_In_ HMENU hMenu, _In_ UINT uIDItem, _Out_writes_opt_(cchMax) LPWSTR lpString, _In_ int cchMax, _In_ UINT flags)
#define COLOR_HIGHLIGHT
Definition: winuser.h:926
BOOL WINAPI DrawEdge(_In_ HDC, _Inout_ LPRECT, _In_ UINT, _In_ UINT)
#define MF_BYPOSITION
Definition: winuser.h:203
#define COLOR_HIGHLIGHTTEXT
Definition: winuser.h:927
#define COLOR_BTNSHADOW
Definition: winuser.h:930
#define COLOR_MENUTEXT
Definition: winuser.h:920
#define DT_CALCRECT
Definition: winuser.h:526
BOOL WINAPI InflateRect(_Inout_ LPRECT, _In_ int, _In_ int)
#define COLOR_BTNHIGHLIGHT
Definition: winuser.h:935
#define BF_RECT
Definition: winuser.h:462
#define COLOR_3DFACE
Definition: winuser.h:929
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by OnPaint().

◆ MyDrawScrollbar()

VOID MyDrawScrollbar ( HDC  hdc,
LPRECT  rc,
HBRUSH  hbrScrollbar,
COLOR_SCHEME scheme 
)

Definition at line 424 of file draw.c.

425{
426 RECT rcTop;
427 RECT rcBottom;
428 RECT rcMiddle;
429 int width;
430
431 width = rc->right - rc->left;
432
433 rcTop.left = rc->left;
434 rcTop.right = rc->right;
435 rcTop.top = rc->top;
436 rcTop.bottom = rc->top + width;
437
438 rcMiddle.left = rc->left;
439 rcMiddle.right = rc->right;
440 rcMiddle.top = rc->top + width;
441 rcMiddle.bottom = rc->bottom - width;
442
443 rcBottom.left = rc->left;
444 rcBottom.right = rc->right;
445 rcBottom.top = rc->bottom - width;
446 rcBottom.bottom = rc->bottom;
447
450
451 FillRect(hdc, &rcMiddle, hbrScrollbar);
452}
GLint GLint GLsizei width
Definition: gl.h:1546
#define DFCS_SCROLLUP
Definition: winuser.h:489
#define DFCS_SCROLLDOWN
Definition: winuser.h:490

Referenced by OnPaint().