ReactOS 0.4.15-dev-8344-g0574987
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)
 

Variables

CPaletteWindow paletteWindow
 

Macro Definition Documentation

◆ COLOR_COUNT

#define COLOR_COUNT   28

Definition at line 16 of file palette.cpp.

◆ CXY_SELECTEDBOX

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

Definition at line 12 of file palette.cpp.

◆ HALF_COLOR_COUNT

#define HALF_COLOR_COUNT   (COLOR_COUNT / 2)

Definition at line 17 of file palette.cpp.

◆ X_COLORBOX_OFFSET

#define X_COLORBOX_OFFSET   (X_MARGIN + CXY_BIGBOX + X_MARGIN)

Definition at line 15 of file palette.cpp.

◆ X_MARGIN

#define X_MARGIN   4 /* horizontal margin */

Definition at line 13 of file palette.cpp.

◆ Y_MARGIN

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

Definition at line 14 of file palette.cpp.

Function Documentation

◆ drawColorBox()

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

Definition at line 34 of file palette.cpp.

35{
36 RECT rc = *prc;
37 ::FillRect(hDC, &rc, (HBRUSH)(COLOR_3DFACE + 1));
38 ::DrawEdge(hDC, &rc, nBorder, BF_RECT | BF_ADJUST);
39
40 HBRUSH hbr = ::CreateSolidBrush(rgbColor);
41 ::FillRect(hDC, &rc, hbr);
42 ::DeleteObject(hbr);
43}
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:929

Referenced by CPaletteWindow::OnPaint().

◆ getColorBoxRect()

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

Definition at line 45 of file palette.cpp.

46{
47 INT dx = (iColor % HALF_COLOR_COUNT) * CXY_COLORBOX; /* delta x */
48 INT dy = (iColor / HALF_COLOR_COUNT) * CXY_COLORBOX; /* delta y */
51 prc->top = Y_MARGIN + dy;
53}
#define CXY_COLORBOX
Definition: palette.h:10
GLint dy
Definition: linetemp.h:97
GLint dx
Definition: linetemp.h:97
#define Y_MARGIN
Definition: palette.cpp:14
#define HALF_COLOR_COUNT
Definition: palette.cpp:17
#define X_COLORBOX_OFFSET
Definition: palette.cpp:15
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().

Variable Documentation

◆ paletteWindow