ReactOS 0.4.15-dev-5875-g7c755d9
palette.cpp File Reference
#include "precomp.h"
Include dependency graph for palette.cpp:

Go to the source code of this file.

Macros

#define CXY_SELECTEDBOX   15 /* width / height of a selected color box */
 
#define X_MARGIN   4 /* horizontal margin */
 
#define Y_MARGIN   ((rcClient.bottom / 2) - CXY_COLORBOX) /* center position minus one color box */
 
#define X_COLORBOX_OFFSET   (X_MARGIN + CXY_BIGBOX + X_MARGIN)
 
#define COLOR_COUNT   28
 
#define HALF_COLOR_COUNT   (COLOR_COUNT / 2)
 

Functions

static VOID drawColorBox (HDC hDC, LPCRECT prc, COLORREF rgbColor, UINT nBorder)
 
static VOID getColorBoxRect (LPRECT prc, const RECT &rcClient, INT iColor)
 

Macro Definition Documentation

◆ COLOR_COUNT

#define COLOR_COUNT   28

Definition at line 17 of file palette.cpp.

◆ CXY_SELECTEDBOX

#define CXY_SELECTEDBOX   15 /* width / height of a selected color box */

Definition at line 13 of file palette.cpp.

◆ HALF_COLOR_COUNT

#define HALF_COLOR_COUNT   (COLOR_COUNT / 2)

Definition at line 18 of file palette.cpp.

◆ X_COLORBOX_OFFSET

#define X_COLORBOX_OFFSET   (X_MARGIN + CXY_BIGBOX + X_MARGIN)

Definition at line 16 of file palette.cpp.

◆ X_MARGIN

#define X_MARGIN   4 /* horizontal margin */

Definition at line 14 of file palette.cpp.

◆ Y_MARGIN

#define Y_MARGIN   ((rcClient.bottom / 2) - CXY_COLORBOX) /* center position minus one color box */

Definition at line 15 of file palette.cpp.

Function Documentation

◆ drawColorBox()

static VOID drawColorBox ( HDC  hDC,
LPCRECT  prc,
COLORREF  rgbColor,
UINT  nBorder 
)
static

Definition at line 22 of file palette.cpp.

23{
24 RECT rc = *prc;
25 ::FillRect(hDC, &rc, (HBRUSH)(COLOR_3DFACE + 1));
26 ::DrawEdge(hDC, &rc, nBorder, BF_RECT | BF_ADJUST);
27
28 HBRUSH hbr = ::CreateSolidBrush(rgbColor);
29 ::FillRect(hDC, &rc, hbr);
30 ::DeleteObject(hbr);
31}
static HDC hDC
Definition: 3dtext.c:33
pKey DeleteObject()
_Out_ LPRECT prc
Definition: ntgdi.h:1658
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)
#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
#define COLOR_3DFACE
Definition: winuser.h:923

Referenced by CPaletteWindow::OnPaint().

◆ getColorBoxRect()

static VOID getColorBoxRect ( LPRECT  prc,
const RECT rcClient,
INT  iColor 
)
static

Definition at line 33 of file palette.cpp.

34{
35 INT dx = (iColor % HALF_COLOR_COUNT) * CXY_COLORBOX; /* delta x */
36 INT dy = (iColor / HALF_COLOR_COUNT) * CXY_COLORBOX; /* delta y */
39 prc->top = Y_MARGIN + dy;
41}
#define CXY_COLORBOX
Definition: palette.h:11
GLint dy
Definition: linetemp.h:97
GLint dx
Definition: linetemp.h:97
#define Y_MARGIN
Definition: palette.cpp:15
#define HALF_COLOR_COUNT
Definition: palette.cpp:18
#define X_COLORBOX_OFFSET
Definition: palette.cpp:16
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
_In_ ULONG iColor
Definition: xlateobj.h:17

Referenced by CPaletteWindow::OnPaint().