ReactOS  0.4.13-dev-464-g6b95727
PaletteModel Class Reference

#include <palettemodel.h>

Collaboration diagram for PaletteModel:

Public Member Functions

 PaletteModel ()
 
int SelectedPalette ()
 
void SelectPalette (int nPalette)
 
int GetColor (int nIndex)
 
void SetColor (int nIndex, int newColor)
 
int GetFgColor ()
 
void SetFgColor (int newColor)
 
int GetBgColor ()
 
void SetBgColor (int newColor)
 

Private Member Functions

void NotifyColorChanged ()
 
void NotifyPaletteChanged ()
 

Private Attributes

int m_colors [28]
 
int m_nSelectedPalette
 
int m_fgColor
 
int m_bgColor
 

Detailed Description

Definition at line 13 of file palettemodel.h.

Constructor & Destructor Documentation

◆ PaletteModel()

PaletteModel::PaletteModel ( )

Definition at line 15 of file palettemodel.cpp.

16 {
17  m_fgColor = 0x00000000;
18  m_bgColor = 0x00ffffff;
19  SelectPalette(1);
20 }
void SelectPalette(int nPalette)

Member Function Documentation

◆ GetBgColor()

◆ GetColor()

int PaletteModel::GetColor ( int  nIndex)

Definition at line 51 of file palettemodel.cpp.

52 {
53  if (nIndex < 28)
54  return m_colors[nIndex];
55  else
56  return 0;
57 }
int m_colors[28]
Definition: palettemodel.h:16

Referenced by CPaletteWindow::OnLButtonDown(), CPaletteWindow::OnPaint(), and CPaletteWindow::OnRButtonDown().

◆ GetFgColor()

◆ NotifyColorChanged()

void PaletteModel::NotifyColorChanged ( )
private

Definition at line 90 of file palettemodel.cpp.

91 {
94 }
#define WM_PALETTEMODELCOLORCHANGED
Definition: definitions.h:244
CPaletteWindow paletteWindow
Definition: main.cpp:67
CSelectionWindow selectionWindow
Definition: main.cpp:70

Referenced by SetBgColor(), and SetFgColor().

◆ NotifyPaletteChanged()

void PaletteModel::NotifyPaletteChanged ( )
private

Definition at line 96 of file palettemodel.cpp.

97 {
99 }
#define WM_PALETTEMODELPALETTECHANGED
Definition: definitions.h:245
CPaletteWindow paletteWindow
Definition: main.cpp:67

Referenced by SelectPalette(), and SetColor().

◆ SelectedPalette()

int PaletteModel::SelectedPalette ( )

Definition at line 22 of file palettemodel.cpp.

23 {
24  return m_nSelectedPalette;
25 }
int m_nSelectedPalette
Definition: palettemodel.h:17

Referenced by CMainWindow::OnInitMenuPopup().

◆ SelectPalette()

void PaletteModel::SelectPalette ( int  nPalette)

Definition at line 27 of file palettemodel.cpp.

28 {
29  int modernColors[28] = {
30  0x000000, 0x464646, 0x787878, 0x300099, 0x241ced, 0x0078ff, 0x0ec2ff,
31  0x00f2ff, 0x1de6a8, 0x4cb122, 0xefb700, 0xf36d4d, 0x99362f, 0x98316f,
32  0xffffff, 0xdcdcdc, 0xb4b4b4, 0x3c5a9c, 0xb1a3ff, 0x7aaae5, 0x9ce4f5,
33  0xbdf9ff, 0xbcf9d3, 0x61bb9d, 0xead999, 0xd19a70, 0x8e6d54, 0xd5a5b5
34  };
35  int oldColors[28] = {
36  0x000000, 0x808080, 0x000080, 0x008080, 0x008000, 0x808000, 0x800000,
37  0x800080, 0x408080, 0x404000, 0xff8000, 0x804000, 0xff0040, 0x004080,
38  0xffffff, 0xc0c0c0, 0x0000ff, 0x00ffff, 0x00ff00, 0xffff00, 0xff0000,
39  0xff00ff, 0x80ffff, 0x80ff00, 0xffff80, 0xff8080, 0x8000ff, 0x4080ff
40  };
41  if (nPalette == 1)
42  CopyMemory(m_colors, modernColors, sizeof(m_colors));
43  else if (nPalette == 2)
44  CopyMemory(m_colors, oldColors, sizeof(m_colors));
45  else
46  return;
47  m_nSelectedPalette = nPalette;
49 }
void NotifyPaletteChanged()
int m_colors[28]
Definition: palettemodel.h:16
#define CopyMemory
Definition: winbase.h:1633
int m_nSelectedPalette
Definition: palettemodel.h:17

Referenced by CMainWindow::OnCommand(), and PaletteModel().

◆ SetBgColor()

void PaletteModel::SetBgColor ( int  newColor)

Definition at line 84 of file palettemodel.cpp.

85 {
86  m_bgColor = newColor;
88 }
void NotifyColorChanged()

Referenced by CPaletteWindow::OnRButtonDblClk(), CPaletteWindow::OnRButtonDown(), and CImgAreaWindow::OnRButtonUp().

◆ SetColor()

void PaletteModel::SetColor ( int  nIndex,
int  newColor 
)

Definition at line 59 of file palettemodel.cpp.

60 {
61  if (nIndex < 28)
62  {
63  m_colors[nIndex] = newColor;
65  }
66 }
void NotifyPaletteChanged()
int m_colors[28]
Definition: palettemodel.h:16

Referenced by CPaletteWindow::OnLButtonDblClk(), and CPaletteWindow::OnRButtonDblClk().

◆ SetFgColor()

void PaletteModel::SetFgColor ( int  newColor)

Member Data Documentation

◆ m_bgColor

int PaletteModel::m_bgColor
private

Definition at line 19 of file palettemodel.h.

Referenced by GetBgColor(), PaletteModel(), and SetBgColor().

◆ m_colors

int PaletteModel::m_colors[28]
private

Definition at line 16 of file palettemodel.h.

Referenced by GetColor(), SelectPalette(), and SetColor().

◆ m_fgColor

int PaletteModel::m_fgColor
private

Definition at line 18 of file palettemodel.h.

Referenced by GetFgColor(), PaletteModel(), and SetFgColor().

◆ m_nSelectedPalette

int PaletteModel::m_nSelectedPalette
private

Definition at line 17 of file palettemodel.h.

Referenced by SelectedPalette(), and SelectPalette().


The documentation for this class was generated from the following files: