ReactOS  0.4.12-dev-685-gf36cbf7
CardWindow Class Reference

#include <cardwindow.h>

Collaboration diagram for CardWindow:

Public Member Functions

 CardWindow ()
 
 ~CardWindow ()
 
BOOL Create (HWND hwndParent, DWORD dwExStyle, DWORD dwStyle, int x, int y, int width, int height)
 
BOOL Destroy ()
 
 operator HWND ()
 
CardButtonCreateButton (int id, TCHAR *szText, UINT uStyle, bool fVisible, int x, int y, int width, int height)
 
CardRegionCreateRegion (int id, bool fVisible, int x, int y, int xoffset, int yoffset)
 
CardButtonCardButtonFromId (int id)
 
CardRegionCardRegionFromId (int id)
 
bool DeleteButton (CardButton *pButton)
 
bool DeleteRegion (CardRegion *pRegion)
 
bool DeleteAll ()
 
void SetBackColor (COLORREF cr)
 
COLORREF GetBackColor ()
 
void SetBackCardIdx (UINT uBackIdx)
 
UINT GetBackCardIdx ()
 
void SetBackImage (HBITMAP hBitmap)
 
void EmptyStacks (void)
 
void Redraw (void)
 
void Update (void)
 
bool DistributeStacks (int nIdFrom, int nNumStacks, UINT xJustify, int xSpacing, int nStartX)
 
void SetResizeProc (pResizeWndProc proc)
 
int GetWidth ()
 
int GetHeight ()
 
bool RegisterDropZone (int id, RECT *rect, pDropZoneProc proc)
 
bool DeleteDropZone (int id)
 

Private Member Functions

int GetNumDropZones ()
 
DropZoneGetDropZoneFromRect (RECT *rect)
 
LRESULT CALLBACK WndProc (HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
 
void Paint (HDC hdc)
 
void PaintCardRgn (HDC hdc, int dx, int dy, int width, int height, int sx, int sy)
 
HPALETTE CreateCardPalette ()
 
CardButtonCardButtonFromPoint (int x, int y)
 
CardRegionCardRegionFromPoint (int x, int y)
 
CardRegionGetBestStack (int x, int y, int w, int h)
 

Static Private Member Functions

static LRESULT CALLBACK CardWndProc (HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
 

Private Attributes

HWND m_hWnd
 
int nWidth
 
int nHeight
 
UINT nBackCardIdx
 
HBITMAP hbmBackImage
 
HDC hdcBackImage
 
CardButtonButtons [MAXBUTTONS]
 
int nNumButtons
 
CardRegionRegions [MAXCARDSTACKS]
 
int nNumCardRegions
 
DropZonedropzone [MAXDROPZONES]
 
int nNumDropZones
 
COLORREF crBackgnd
 
pResizeWndProc ResizeWndCallback
 

Friends

class CardRegion
 
class CardButton
 
void RegisterCardWindow ()
 

Detailed Description

Definition at line 13 of file cardwindow.h.

Constructor & Destructor Documentation

◆ CardWindow()

CardWindow::CardWindow ( )

Definition at line 63 of file cardwindow.cpp.

63  : m_hWnd(0)
64 {
65  HDC hdc = GetDC(0);
66 
67  nNumButtons = 0;
68  nNumCardRegions = 0;
69  nNumDropZones = 0;
70  nBackCardIdx = 53;
71 
73  hbmBackImage = 0;
74  hdcBackImage = 0;
75 
76  srand((unsigned)GetTickCount());
77 
78  //All colours (buttons, highlights, decks)
79  //are calculated off this single base colour
80  crBackgnd = PALETTERGB(0,80,0);//PALETTERGB(0,64,100);
81 
82  // If uCardBitmapRef was previously zero, then
83  // load the card bitmaps
85  {
87 
89 
91 
93 
95 
96  }
97 
98  ReleaseDC(0, hdc);
99 
100  //register the window class if necessary
101  if(!fRegistered)
102  {
103  fRegistered = true;
105  }
106 
107 }
HPALETTE CreateCardPalette()
Definition: cardwindow.cpp:702
HPALETTE __holdplacepal
Definition: cardlib.cpp:23
#define HDC
Definition: msvc.h:22
int nNumCardRegions
Definition: cardwindow.h:104
HDC WINAPI GetDC(_In_opt_ HWND)
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:445
void __cdecl srand(_In_ unsigned int _Seed)
HBITMAP __hbmPlaceHolder
Definition: cardlib.cpp:22
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
void LoadCardBitmaps()
Definition: cardbitmaps.cpp:82
HDC __hdcPlaceHolder
Definition: cardlib.cpp:21
int nNumDropZones
Definition: cardwindow.h:107
COLORREF crBackgnd
Definition: cardwindow.h:109
HDC hdcBackImage
Definition: cardwindow.h:97
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
HDC hdc
Definition: msvc.h:53
HBITMAP CreateSinkBmp(HDC hdcCompat, HDC hdc, COLORREF col, int width, int height)
HPALETTE UseNicePalette(HDC hdc, HPALETTE hPalette)
Definition: cardwindow.cpp:14
HWND m_hWnd
Definition: cardwindow.h:91
HPALETTE __hPalette
Definition: cardlib.cpp:28
static bool fRegistered
Definition: cardwindow.cpp:38
int __cardwidth
Definition: cardlib.cpp:25
static LONG uCardBitmapRef
Definition: cardwindow.cpp:39
HBITMAP hbmBackImage
Definition: cardwindow.h:96
#define InterlockedIncrement
Definition: armddk.h:53
#define PALETTERGB(r, g, b)
Definition: wingdi.h:2920
pResizeWndProc ResizeWndCallback
Definition: cardwindow.h:111
int __cardheight
Definition: cardlib.cpp:26
int nNumButtons
Definition: cardwindow.h:101
UINT nBackCardIdx
Definition: cardwindow.h:94
friend void RegisterCardWindow()
Definition: cardwindow.cpp:42

◆ ~CardWindow()

CardWindow::~CardWindow ( )

Definition at line 131 of file cardwindow.cpp.

132 {
133  if(m_hWnd)
135 
136  DeleteAll();
137 
139  {
140  FreeCardBitmaps();
141 
144 
146 
147  if(__hPalette)
149  }
150 }
HPALETTE __holdplacepal
Definition: cardlib.cpp:23
HBITMAP __hbmPlaceHolder
Definition: cardlib.cpp:22
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
HDC __hdcPlaceHolder
Definition: cardlib.cpp:21
BOOL WINAPI DestroyWindow(_In_ HWND)
void RestorePalette(HDC hdc, HPALETTE hOldPal)
Definition: cardwindow.cpp:24
HWND m_hWnd
Definition: cardwindow.h:91
HPALETTE __hPalette
Definition: cardlib.cpp:28
bool DeleteAll()
Definition: cardwindow.cpp:152
void FreeCardBitmaps()
#define InterlockedDecrement
Definition: armddk.h:52
static LONG uCardBitmapRef
Definition: cardwindow.cpp:39
BOOL WINAPI DeleteDC(_In_ HDC)

Member Function Documentation

◆ CardButtonFromId()

CardButton * CardWindow::CardButtonFromId ( int  id)

Definition at line 542 of file cardwindow.cpp.

543 {
544  for(int i = 0; i < nNumButtons; i++)
545  {
546  if(Buttons[i]->id == id)
547  return Buttons[i];
548  }
549 
550  return 0;
551 }
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
CardButton * Buttons[MAXBUTTONS]
Definition: cardwindow.h:100
int nNumButtons
Definition: cardwindow.h:101

◆ CardButtonFromPoint()

CardButton * CardWindow::CardButtonFromPoint ( int  x,
int  y 
)
private

Definition at line 229 of file cardwindow.cpp.

230 {
231  CardButton *bptr = 0;
232 
233  POINT pt;
234  pt.x = x;
235  pt.y = y;
236 
237  //Search BACKWARDS...to reflect the implicit Z-order that
238  //the button creation provided
239  for(int i = nNumButtons - 1; i >= 0; i--)
240  {
241  bptr = Buttons[i];
242  if(PtInRect(&bptr->rect, pt) && bptr->fVisible)
243  return bptr;
244  }
245 
246  return 0;
247 }
RECT rect
Definition: cardbutton.h:70
#define pt(x, y)
Definition: drawing.c:79
bool fVisible
Definition: cardbutton.h:73
INT INT y
Definition: msvc.h:62
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
CardButton * Buttons[MAXBUTTONS]
Definition: cardwindow.h:100
INT x
Definition: msvc.h:62
BOOL WINAPI PtInRect(_In_ LPCRECT, _In_ POINT)
int nNumButtons
Definition: cardwindow.h:101

Referenced by CardButton::OnLButtonUp(), and WndProc().

◆ CardRegionFromId()

CardRegion * CardWindow::CardRegionFromId ( int  id)

Definition at line 531 of file cardwindow.cpp.

532 {
533  for(int i = 0; i < nNumCardRegions; i++)
534  {
535  if(Regions[i]->id == id)
536  return Regions[i];
537  }
538 
539  return 0;
540 }
int nNumCardRegions
Definition: cardwindow.h:104
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
CardRegion * Regions[MAXCARDSTACKS]
Definition: cardwindow.h:103

Referenced by CardRegion::OnLButtonUp().

◆ CardRegionFromPoint()

CardRegion * CardWindow::CardRegionFromPoint ( int  x,
int  y 
)
private

Definition at line 249 of file cardwindow.cpp.

250 {
251  POINT pt;
252  pt.x = x;
253  pt.y = y;
254 
255  //Search BACKWARDS...to reflect the implicit Z-order that
256  //the stack creation provided
257  for(int i = nNumCardRegions - 1; i >= 0; i--)
258  {
259  if(Regions[i]->IsPointInStack(x, y))
260  return Regions[i];
261  }
262 
263  return 0;
264 }
int nNumCardRegions
Definition: cardwindow.h:104
#define pt(x, y)
Definition: drawing.c:79
INT INT y
Definition: msvc.h:62
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
CardRegion * Regions[MAXCARDSTACKS]
Definition: cardwindow.h:103
INT x
Definition: msvc.h:62

Referenced by WndProc().

◆ CardWndProc()

LRESULT CALLBACK CardWindow::CardWndProc ( HWND  hwnd,
UINT  iMsg,
WPARAM  wParam,
LPARAM  lParam 
)
staticprivate

Definition at line 270 of file cardwindow.cpp.

271 {
273  return cw->WndProc(hwnd, iMsg, wParam, lParam);
274 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
WPARAM wParam
Definition: combotst.c:138
#define GetWindowLongPtr
Definition: treelist.c:73
LPARAM lParam
Definition: combotst.c:139
LRESULT CALLBACK WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
Definition: cardwindow.cpp:339

Referenced by RegisterCardWindow().

◆ Create()

BOOL CardWindow::Create ( HWND  hwndParent,
DWORD  dwExStyle,
DWORD  dwStyle,
int  x,
int  y,
int  width,
int  height 
)

Definition at line 109 of file cardwindow.cpp.

110 {
111  if(m_hWnd)
112  return FALSE;
113 
114  //Create the window associated with this object
115  m_hWnd = CreateWindowEx(dwExStyle, szCardName, NULL,
116  dwStyle,
117  x, y, width, height,
119 
120  return TRUE;
121 }
GLint GLint GLsizei width
Definition: gl.h:1546
#define TRUE
Definition: types.h:120
static TCHAR szCardName[]
Definition: cardwindow.cpp:37
INT INT y
Definition: msvc.h:62
#define CreateWindowEx
Definition: winuser.h:5621
smooth NULL
Definition: ftsmooth.c:416
static HWND hwndParent
Definition: cryptui.c:300
HWND m_hWnd
Definition: cardwindow.h:91
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
#define GetModuleHandle
Definition: winbase.h:3641
INT x
Definition: msvc.h:62

Referenced by WndProc().

◆ CreateButton()

CardButton * CardWindow::CreateButton ( int  id,
TCHAR szText,
UINT  uStyle,
bool  fVisible,
int  x,
int  y,
int  width,
int  height 
)

Definition at line 334 of file cardbutton.cpp.

335 {
336  CardButton *cb;
337 
338  if(nNumButtons == MAXBUTTONS)
339  return 0;
340 
341  cb = new CardButton(*this, id, szText, uStyle, fVisible, x, y, width, height);
342  Buttons[nNumButtons++] = cb;
343 
344  if(uStyle & CB_PUSHBUTTON)
345  {
346  cb->SetBackColor(CardButton::GetFace(crBackgnd));
347  //cb->SetBackColor(ScaleLumRGB(crBackgnd, 0.1));
348  cb->SetForeColor(RGB(255,255,255));
349  }
350  else
351  {
352  cb->SetBackColor(crBackgnd);
353  cb->SetForeColor(RGB(255,255,255));
354  }
355 
356  return cb;
357 }
GLint GLint GLsizei width
Definition: gl.h:1546
static COLORREF GetFace(COLORREF crBase)
Definition: cardbutton.cpp:426
INT INT y
Definition: msvc.h:62
COLORREF crBackgnd
Definition: cardwindow.h:109
static const WCHAR szText[]
Definition: dialog.c:139
#define CB_PUSHBUTTON
Definition: cardlib.h:46
#define MAXBUTTONS
Definition: cardwindow.h:4
#define RGB(r, g, b)
Definition: wingdi.h:2918
CardButton * Buttons[MAXBUTTONS]
Definition: cardwindow.h:100
static DWORD cb
Definition: integrity.c:41
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
INT x
Definition: msvc.h:62
friend class CardButton
Definition: cardwindow.h:16
int nNumButtons
Definition: cardwindow.h:101

◆ CreateCardPalette()

HPALETTE CardWindow::CreateCardPalette ( )
private

Definition at line 702 of file cardwindow.cpp.

703 {
704  COLORREF cols[10];
705  int nNumCols;
706 
707 
708  //include button text colours
709  cols[0] = RGB(0, 0, 0);
710  cols[1] = RGB(255, 255, 255);
711 
712  //include the base background colour
713  cols[2] = crBackgnd;
714 
715  //include the standard button colours...
717  cols[4] = CardButton::GetShadow(crBackgnd);
718  cols[5] = CardButton::GetFace(crBackgnd);
719 
720  //include the sunken image bitmap colours...
721  GetSinkCols(crBackgnd, &cols[6], &cols[7], &cols[8], &cols[9]);
722 
723  nNumCols = 10;
724 
725  return MakePaletteFromCols(cols, nNumCols);
726 }
static COLORREF GetFace(COLORREF crBase)
Definition: cardbutton.cpp:426
static COLORREF GetHighlight(COLORREF crBase)
Definition: cardbutton.cpp:415
void GetSinkCols(COLORREF crBase, COLORREF *fg, COLORREF *bg, COLORREF *sh1, COLORREF *sh2)
COLORREF crBackgnd
Definition: cardwindow.h:109
static COLORREF GetShadow(COLORREF crBase)
Definition: cardbutton.cpp:421
#define RGB(r, g, b)
Definition: wingdi.h:2918
HPALETTE MakePaletteFromCols(COLORREF cols[], int nNumColours)
DWORD COLORREF
Definition: windef.h:285

Referenced by CardWindow(), and SetBackColor().

◆ CreateRegion()

CardRegion * CardWindow::CreateRegion ( int  id,
bool  fVisible,
int  x,
int  y,
int  xoffset,
int  yoffset 
)

Definition at line 104 of file cardregion.cpp.

105 {
106  CardRegion *cr;
107 
109  return FALSE;
110 
111  cr = new CardRegion(*this, id, fVisible, x, y, xoffset, yoffset);
112  cr->SetBackColor(crBackgnd);
114 
115  Regions[nNumCardRegions++] = cr;
116 
117  return cr;
118 }
int nNumCardRegions
Definition: cardwindow.h:104
GLint GLint GLint yoffset
Definition: gl.h:1547
#define MAXCARDSTACKS
Definition: cardwindow.h:5
INT INT y
Definition: msvc.h:62
COLORREF crBackgnd
Definition: cardwindow.h:109
GLint GLint xoffset
Definition: gl.h:1547
friend class CardRegion
Definition: cardwindow.h:15
CardRegion * Regions[MAXCARDSTACKS]
Definition: cardwindow.h:103
void SetBackCardIdx(UINT uBackIdx)
Definition: cardregion.cpp:384
INT x
Definition: msvc.h:62
void SetBackColor(COLORREF cr)
Definition: cardregion.cpp:67
UINT nBackCardIdx
Definition: cardwindow.h:94

Referenced by CreateSol(), and CreateSpider().

◆ DeleteAll()

bool CardWindow::DeleteAll ( )

Definition at line 152 of file cardwindow.cpp.

153 {
154  int i;
155 
156  for(i = 0; i < nNumCardRegions; i++)
157  {
158  delete Regions[i];
159  }
160 
161  for(i = 0; i < nNumButtons; i++)
162  {
163  delete Buttons[i];
164  }
165 
166  for(i = 0; i < nNumDropZones; i++)
167  {
168  delete dropzone[i];
169  }
170 
172 
173  return true;
174 }
int nNumCardRegions
Definition: cardwindow.h:104
int nNumDropZones
Definition: cardwindow.h:107
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
DropZone * dropzone[MAXDROPZONES]
Definition: cardwindow.h:106
CardButton * Buttons[MAXBUTTONS]
Definition: cardwindow.h:100
CardRegion * Regions[MAXCARDSTACKS]
Definition: cardwindow.h:103
int nNumButtons
Definition: cardwindow.h:101

Referenced by ~CardWindow().

◆ DeleteButton()

bool CardWindow::DeleteButton ( CardButton pButton)

Definition at line 559 of file cardwindow.cpp.

560 {
561  for(int i = 0; i < nNumButtons; i++)
562  {
563  if(Buttons[i] == pButton)
564  {
565  CardButton *cb = Buttons[i];
566 
567  //shift any after this one backwards
568  for(int j = i; j < nNumButtons - 1; j++)
569  {
570  Buttons[j] = Buttons[j + 1];
571  }
572 
573  delete cb;
574  nNumButtons--;
575 
576  return true;
577  }
578  }
579 
580  return false;
581 }
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
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 GLint GLint j
Definition: glfuncs.h:250
CardButton * Buttons[MAXBUTTONS]
Definition: cardwindow.h:100
static DWORD cb
Definition: integrity.c:41
int nNumButtons
Definition: cardwindow.h:101

◆ DeleteDropZone()

bool CardWindow::DeleteDropZone ( int  id)

Definition at line 44 of file dropzone.cpp.

45 {
46  for(int i = 0; i < nNumDropZones; i++)
47  {
48  if(dropzone[i]->id == id)
49  {
50  DropZone *dz = dropzone[i];
51 
52  //shift any after this one backwards
53  for(int j = i; j < nNumDropZones - 1; j++)
54  {
55  dropzone[j] = dropzone[j + 1];
56  }
57 
58  delete dz;
59  nNumDropZones--;
60  return true;
61  }
62  }
63 
64  return false;
65 }
int nNumDropZones
Definition: cardwindow.h:107
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
DropZone * dropzone[MAXDROPZONES]
Definition: cardwindow.h:106
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 GLint GLint j
Definition: glfuncs.h:250

◆ DeleteRegion()

bool CardWindow::DeleteRegion ( CardRegion pRegion)

Definition at line 583 of file cardwindow.cpp.

584 {
585  for(int i = 0; i < nNumCardRegions; i++)
586  {
587  if(Regions[i] == pRegion)
588  {
589  CardRegion *cr = Regions[i];
590 
591  //shift any after this one backwards
592  for(int j = i; j < nNumCardRegions - 1; j++)
593  {
594  Regions[j] = Regions[j + 1];
595  }
596 
597  delete cr;
598  nNumCardRegions--;
599 
600  return true;
601  }
602  }
603 
604  return false;
605 }
int nNumCardRegions
Definition: cardwindow.h:104
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
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 GLint GLint j
Definition: glfuncs.h:250
CardRegion * Regions[MAXCARDSTACKS]
Definition: cardwindow.h:103

◆ Destroy()

BOOL CardWindow::Destroy ( )

Definition at line 123 of file cardwindow.cpp.

124 {
126  m_hWnd = 0;
127 
128  return TRUE;
129 }
#define TRUE
Definition: types.h:120
BOOL WINAPI DestroyWindow(_In_ HWND)
HWND m_hWnd
Definition: cardwindow.h:91

◆ DistributeStacks()

bool CardWindow::DistributeStacks ( int  nIdFrom,
int  nNumStacks,
UINT  xJustify,
int  xSpacing,
int  nStartX 
)

Definition at line 618 of file cardwindow.cpp.

619 {
620  int numvisiblestacks = 0;
621  int curx = nStartX;
622  int startindex = -1;
623  int i;
624 
625  //find the stack which starts with our ID
626  for(i = 0; i < nNumCardRegions; i++)
627  {
628  if(Regions[i]->Id() == nIdFrom)
629  {
630  startindex = i;
631  break;
632  }
633  }
634 
635  //if didn't find, return
636  if(i == nNumCardRegions) return false;
637 
638  //count the stacks that are visible
639  for(i = startindex; i < startindex + nNumStacks; i++)
640  {
641  if(Regions[i]->IsVisible())
642  numvisiblestacks++;
643  }
644 
645  if(xJustify == CS_XJUST_CENTER)
646  {
647  //startx -= ((numvisiblestacks + spacing) * cardwidth - spacing) / 2;
648  int viswidth;
649  viswidth = numvisiblestacks * __cardwidth;
650  viswidth += xSpacing * (numvisiblestacks - 1);
651  curx = -(viswidth - __cardwidth) / 2;
652 
653  for(i = startindex; i < startindex + nNumStacks; i++)
654  {
655  if(Regions[i]->IsVisible())
656  {
657  Regions[i]->xadjust = curx;
659  curx += Regions[i]->width + xSpacing;
660  }
661 
662  }
663  }
664 
665  if(xJustify == CS_XJUST_RIGHT)
666  {
667  nStartX -= ((numvisiblestacks + xSpacing) * __cardwidth - xSpacing);
668  }
669 
670  if(xJustify == CS_XJUST_NONE)
671  {
672  for(i = startindex; i < startindex + nNumStacks; i++)
673  {
674  if(Regions[i]->IsVisible())
675  {
676  Regions[i]->xpos = curx;
677  curx += Regions[i]->width + xSpacing;
678  Regions[i]->UpdateSize();
679  }
680 
681  }
682  }
683 
684  return 0;
685 }
int nNumCardRegions
Definition: cardwindow.h:104
#define CS_XJUST_RIGHT
Definition: cardlib.h:38
DWORD Id
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
#define CS_XJUST_NONE
Definition: cardlib.h:37
int xjustify
Definition: cardregion.h:159
#define CS_XJUST_CENTER
Definition: cardlib.h:39
void UpdateSize()
Definition: cardregion.cpp:83
CardRegion * Regions[MAXCARDSTACKS]
Definition: cardwindow.h:103
int __cardwidth
Definition: cardlib.cpp:25

◆ EmptyStacks()

void CardWindow::EmptyStacks ( void  )

Definition at line 607 of file cardwindow.cpp.

608 {
609  for(int i = 0; i < nNumCardRegions; i++)
610  {
611  Regions[i]->Clear();
612  Regions[i]->Update();
613  }
614 
615  Redraw();
616 }
int nNumCardRegions
Definition: cardwindow.h:104
void Redraw(void)
Definition: cardwindow.cpp:553
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
void Update()
Definition: cardregion.cpp:207
CardRegion * Regions[MAXCARDSTACKS]
Definition: cardwindow.h:103
void Clear()
Definition: cardregion.h:84

Referenced by GameFinished(), NewGame(), and SuitStackAddProc().

◆ GetBackCardIdx()

UINT CardWindow::GetBackCardIdx ( )

Definition at line 738 of file cardwindow.cpp.

739 {
740  return nBackCardIdx;
741 }
UINT nBackCardIdx
Definition: cardwindow.h:94

Referenced by SaveSettings().

◆ GetBackColor()

COLORREF CardWindow::GetBackColor ( )

Definition at line 224 of file cardwindow.cpp.

225 {
226  return crBackgnd;
227 }
COLORREF crBackgnd
Definition: cardwindow.h:109

◆ GetBestStack()

CardRegion * CardWindow::GetBestStack ( int  x,
int  y,
int  w,
int  h 
)
private

Definition at line 34 of file cardrgnmouse.cpp.

35 {
36  int maxoverlap = 0;
37  int maxoverlapidx = -1;
38 
39  //find the stack which is most covered by the dropped
40  //cards. Only include those which allow drops.
41  //
42  for(int i = 0; i < nNumCardRegions; i++)
43  {
44  int percent = Regions[i]->GetOverlapRatio(x, y, w, h);
45 
46  //if this stack has the biggest coverage yet
47  if(percent > maxoverlap && Regions[i]->IsVisible())
48  {
49  maxoverlap = percent;
50  maxoverlapidx = i;
51  }
52  }
53 
54  //if we found a stack to drop onto
55  if(maxoverlapidx != -1)
56  {
57  return Regions[maxoverlapidx];
58  }
59  else
60  {
61  return 0;
62  }
63 }
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6102
int nNumCardRegions
Definition: cardwindow.h:104
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
INT INT y
Definition: msvc.h:62
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
int GetOverlapRatio(int x, int y, int width, int height)
Definition: cardregion.cpp:120
CardRegion * Regions[MAXCARDSTACKS]
Definition: cardwindow.h:103
INT x
Definition: msvc.h:62

Referenced by CardRegion::OnLButtonUp().

◆ GetDropZoneFromRect()

DropZone * CardWindow::GetDropZoneFromRect ( RECT rect)
private

Definition at line 22 of file dropzone.cpp.

23 {
24  for(int i = 0; i < nNumDropZones; i++)
25  {
26  RECT inter;
27  RECT zone;
28 
29  //if any part of the drag rectangle falls within a drop zone,
30  //let that take priority over any other card stack.
31  dropzone[i]->GetZone(&zone);
32 
33  if(IntersectRect(&inter, rect, &zone))
34  {
35  //see if the callback wants us to drop a card on
36  //a particular stack
37  return dropzone[i];
38  }
39  }
40 
41  return 0;
42 }
& rect
Definition: startmenu.cpp:1413
int nNumDropZones
Definition: cardwindow.h:107
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
DropZone * dropzone[MAXDROPZONES]
Definition: cardwindow.h:106
BOOL WINAPI IntersectRect(_Out_ LPRECT, _In_ LPCRECT, _In_ LPCRECT)
DWORD zone
Definition: sec_mgr.c:1760
void GetZone(RECT *rect)
Definition: dropzone.h:21

Referenced by CardRegion::OnLButtonUp().

◆ GetHeight()

int CardWindow::GetHeight ( )
inline

Definition at line 56 of file cardwindow.h.

56 { return nHeight; }
int nHeight
Definition: cardwindow.h:92

◆ GetNumDropZones()

int CardWindow::GetNumDropZones ( )
inlineprivate

Definition at line 66 of file cardwindow.h.

66 { return nNumDropZones; }
int nNumDropZones
Definition: cardwindow.h:107

◆ GetWidth()

int CardWindow::GetWidth ( )
inline

Definition at line 55 of file cardwindow.h.

55 { return nWidth; }
int nWidth
Definition: cardwindow.h:92

◆ operator HWND()

Definition at line 31 of file cardwindow.h.

31 { return m_hWnd; }
HWND m_hWnd
Definition: cardwindow.h:91

◆ Paint()

void CardWindow::Paint ( HDC  hdc)
private

Definition at line 276 of file cardwindow.cpp.

277 {
278  int i;
279  RECT rect;
280  HPALETTE hOldPal;
281 
282  hOldPal = UseNicePalette(hdc, __hPalette);
283 
284  //
285  // Clip the card stacks so that they won't
286  // get painted over
287  //
288  for(i = 0; i < nNumCardRegions; i++)
289  {
290  Regions[i]->Clip(hdc);
291  }
292 
293  //
294  // Clip the buttons
295  //
296  for(i = 0; i < nNumButtons; i++)
297  {
298  Buttons[i]->Clip(hdc);
299  }
300 
301 
302  // Now paint the whole screen with background colour,
303  //
305 
306  //PaintRect(hdc, &rect, MAKE_PALETTERGB(crBackgnd));
307  PaintCardRgn(hdc, 0, 0, rect.right, rect.bottom, 0, 0);
309 
310  // Don't let cards draw over buttons, so clip buttons again
311  //
312  for(i = 0; i < nNumButtons; i++)
313  {
314  Buttons[i]->Clip(hdc);
315  }
316 
317  // Paint each card stack in turn
318  //
319  for(i = 0; i < nNumCardRegions; i++)
320  {
321  Regions[i]->Render(hdc);
322  }
323 
324  // Paint each button now
325  //
327 
328  for(i = 0; i < nNumButtons; i++)
329  {
330  Buttons[i]->Redraw();
331  }
332 
333  RestorePalette(hdc, hOldPal);
334 }
int nNumCardRegions
Definition: cardwindow.h:104
int WINAPI SelectClipRgn(_In_ HDC, _In_opt_ HRGN)
& rect
Definition: startmenu.cpp:1413
void Redraw()
Definition: cardbutton.cpp:385
void PaintCardRgn(HDC hdc, int dx, int dy, int width, int height, int sx, int sy)
Definition: cardwindow.cpp:743
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
HDC hdc
Definition: msvc.h:53
smooth NULL
Definition: ftsmooth.c:416
void Clip(HDC hdc)
Definition: cardbutton.cpp:102
void RestorePalette(HDC hdc, HPALETTE hOldPal)
Definition: cardwindow.cpp:24
HPALETTE UseNicePalette(HDC hdc, HPALETTE hPalette)
Definition: cardwindow.cpp:14
HWND m_hWnd
Definition: cardwindow.h:91
HPALETTE __hPalette
Definition: cardlib.cpp:28
CardButton * Buttons[MAXBUTTONS]
Definition: cardwindow.h:100
void Render(HDC hdc)
CardRegion * Regions[MAXCARDSTACKS]
Definition: cardwindow.h:103
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
int nNumButtons
Definition: cardwindow.h:101
void Clip(HDC hdc)

Referenced by WndProc().

◆ PaintCardRgn()

void CardWindow::PaintCardRgn ( HDC  hdc,
int  dx,
int  dy,
int  width,
int  height,
int  sx,
int  sy 
)
private

Definition at line 743 of file cardwindow.cpp.

744 {
745  RECT rect;
746 
747  //if just a solid background colour
748  if(hbmBackImage == 0)
749  {
750  SetRect(&rect, dx, dy, dx+width, dy+height);
751 
752  /*if(GetVersion() < 0x80000000)
753  {
754  PaintRect(hdc, &rect, MAKE_PALETTERGB(crBackgnd));
755  }
756  else*/
757  {
759  FillRect(hdc, &rect, hbr);
760  DeleteObject(hbr);
761  }
762  }
763  //otherwise, paint using the bitmap
764  else
765  {
766  // Draw whatever part of background we can
767  BitBlt(hdc, dx, dy, width, height, hdcBackImage, sx, sy, SRCCOPY);
768 
769  // Now we need to paint any area outside the bitmap,
770  // just in case the bitmap is too small to fill whole window
771  if(0)//sx + width > bm.bmWidth || sy + height > bm.bmHeight)
772  {
773  // Find out size of bitmap
774  BITMAP bm;
775  GetObject(hbmBackImage, sizeof(bm), &bm);
776 
777  HRGN hr1 = CreateRectRgn(sx, sy, sx+width, sy+height);
778  HRGN hr2 = CreateRectRgn(0, 0, bm.bmWidth, bm.bmHeight);
779  HRGN hr3 = CreateRectRgn(0,0, 1, 1);
780  HRGN hr4 = CreateRectRgn(0,0, 1, 1);
781 
782  CombineRgn(hr3, hr1, hr2, RGN_DIFF);
783 
784  GetClipRgn(hdc, hr4);
785 
786  CombineRgn(hr3, hr4, hr3, RGN_AND);
787  SelectClipRgn(hdc, hr3);
788 
789  // Fill remaining space not filled with bitmap
790  HBRUSH hbr = CreateSolidBrush(crBackgnd);
791  FillRgn(hdc, hr3, hbr);
792  DeleteObject(hbr);
793 
794  // Clean up
795  SelectClipRgn(hdc, hr4);
796 
797  DeleteObject(hr1);
798  DeleteObject(hr2);
799  DeleteObject(hr3);
800  DeleteObject(hr4);
801  }
802  }
803 }
int WINAPI CombineRgn(_In_opt_ HRGN hrgnDest, _In_opt_ HRGN hrgnSrc1, _In_opt_ HRGN hrgnSrc2, _In_ int fnCombineMode)
GLint GLint GLsizei width
Definition: gl.h:1546
#define MAKE_PALETTERGB(colref)
Definition: cardcolor.h:17
int WINAPI FillRgn(_In_ HDC, _In_ HRGN, _In_ HBRUSH)
Definition: painting.c:173
int WINAPI SelectClipRgn(_In_ HDC, _In_opt_ HRGN)
#define HRGN
Definition: msvc.h:39
INT dx
Definition: msvc.h:65
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
static VOID NTAPI BitBlt(IN ULONG Left, IN ULONG Top, IN ULONG Width, IN ULONG Height, IN PUCHAR Buffer, IN ULONG BitsPerPixel, IN ULONG Delta)
Definition: vga.c:416
& rect
Definition: startmenu.cpp:1413
#define RGN_AND
Definition: wingdi.h:355
COLORREF crBackgnd
Definition: cardwindow.h:109
HDC hdcBackImage
Definition: cardwindow.h:97
HDC hdc
Definition: msvc.h:53
HRGN WINAPI CreateRectRgn(_In_ int, _In_ int, _In_ int, _In_ int)
#define GetObject
Definition: wingdi.h:4446
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
HBITMAP hbmBackImage
Definition: cardwindow.h:96
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
#define RGN_DIFF
Definition: wingdi.h:357
Definition: bl.h:1331
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)
INT INT dy
Definition: msvc.h:65
int WINAPI GetClipRgn(_In_ HDC, _In_ HRGN)
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
#define SRCCOPY
Definition: wingdi.h:332

Referenced by Paint(), CardRegion::PrepareDragBitmaps(), CardRegion::PrepareDragBitmapsThreed(), and CardRegion::Render().

◆ Redraw()

void CardWindow::Redraw ( void  )

Definition at line 553 of file cardwindow.cpp.

554 {
555  InvalidateRect(m_hWnd, 0, 0);
557 }
BOOL WINAPI UpdateWindow(_In_ HWND)
HWND m_hWnd
Definition: cardwindow.h:91
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)

Referenced by DeckClickProc(), CardRegion::DoFlash(), EmptyStacks(), CardRegion::Flash(), NewGame(), CardRegion::RedrawIfNotDim(), and ShowDeckOptionsDlg().

◆ RegisterDropZone()

bool CardWindow::RegisterDropZone ( int  id,
RECT rect,
pDropZoneProc  proc 
)

Definition at line 10 of file dropzone.cpp.

11 {
13  return false;
14 
15  DropZone *dz = new DropZone(id, rect, proc);
16 
17  dropzone[nNumDropZones++] = dz;
18 
19  return false;
20 }
static HANDLE proc()
Definition: pdb.c:32
#define MAXDROPZONES
Definition: cardwindow.h:6
& rect
Definition: startmenu.cpp:1413
int nNumDropZones
Definition: cardwindow.h:107
DropZone * dropzone[MAXDROPZONES]
Definition: cardwindow.h:106

◆ SetBackCardIdx()

void CardWindow::SetBackCardIdx ( UINT  uBackIdx)

Definition at line 728 of file cardwindow.cpp.

729 {
730  if(uBackIdx >= 52 && uBackIdx <= 68)
731  nBackCardIdx = uBackIdx;
732 
733  for(int i = 0; i < nNumCardRegions; i++)
734  Regions[i]->SetBackCardIdx(uBackIdx);
735 
736 }
int nNumCardRegions
Definition: cardwindow.h:104
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
CardRegion * Regions[MAXCARDSTACKS]
Definition: cardwindow.h:103
void SetBackCardIdx(UINT uBackIdx)
Definition: cardwindow.cpp:728
UINT nBackCardIdx
Definition: cardwindow.h:94

Referenced by LoadSettings(), and ShowDeckOptionsDlg().

◆ SetBackColor()

void CardWindow::SetBackColor ( COLORREF  cr)

Definition at line 176 of file cardwindow.cpp.

177 {
178  crBackgnd = cr;
179  int i;
180 
181  //
182  // Create the exact palette we need to render the buttons/stacks
183  //
185 
186  if(__hPalette)
188 
190 
191  //
192  // re-create the place-holder!
193  HDC hdc = GetDC(m_hWnd);
194 
196 
198 
200  //SelectObject(__hdcPlaceHolder, __hbmPlaceHolder);
201 
202  //reset all buttons to same colour
203  for(i = 0; i < nNumButtons; i++)
204  {
205  if(Buttons[i]->GetStyle() & CB_PUSHBUTTON)
206  {
207  Buttons[i]->SetBackColor(ColorScaleRGB(crBackgnd, RGB(255,255,255), 0.1));
208  }
209  else
210  {
212  }
213  }
214 
215  for(i = 0; i < nNumCardRegions; i++)
216  {
218  }
219 
220 
221  ReleaseDC(m_hWnd, hdc);
222 }
HPALETTE CreateCardPalette()
Definition: cardwindow.cpp:702
HPALETTE __holdplacepal
Definition: cardlib.cpp:23
#define HDC
Definition: msvc.h:22
int nNumCardRegions
Definition: cardwindow.h:104
COLORREF ColorScaleRGB(const COLORREF Col1, const COLORREF Col2, const double Ratio)
Definition: cardcolor.cpp:154
HDC WINAPI GetDC(_In_opt_ HWND)
HBITMAP __hbmPlaceHolder
Definition: cardlib.cpp:22
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
HDC __hdcPlaceHolder
Definition: cardlib.cpp:21
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
COLORREF crBackgnd
Definition: cardwindow.h:109
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
HDC hdc
Definition: msvc.h:53
#define CB_PUSHBUTTON
Definition: cardlib.h:46
void RestorePalette(HDC hdc, HPALETTE hOldPal)
Definition: cardwindow.cpp:24
HBITMAP CreateSinkBmp(HDC hdcCompat, HDC hdc, COLORREF col, int width, int height)
HPALETTE UseNicePalette(HDC hdc, HPALETTE hPalette)
Definition: cardwindow.cpp:14
HWND m_hWnd
Definition: cardwindow.h:91
HPALETTE __hPalette
Definition: cardlib.cpp:28
#define RGB(r, g, b)
Definition: wingdi.h:2918
CardButton * Buttons[MAXBUTTONS]
Definition: cardwindow.h:100
void SetBackColor(COLORREF cr)
Definition: cardbutton.cpp:403
CardRegion * Regions[MAXCARDSTACKS]
Definition: cardwindow.h:103
int __cardwidth
Definition: cardlib.cpp:25
void SetBackColor(COLORREF cr)
Definition: cardregion.cpp:67
int __cardheight
Definition: cardlib.cpp:26
int nNumButtons
Definition: cardwindow.h:101

◆ SetBackImage()

void CardWindow::SetBackImage ( HBITMAP  hBitmap)

Definition at line 805 of file cardwindow.cpp.

806 {
807  //delete current image?? NO!
808  if(hdcBackImage == 0)
809  {
811  }
812 
814 
815  if(hBitmap)
817 }
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
HDC hdcBackImage
Definition: cardwindow.h:97
HBITMAP hbmBackImage
Definition: cardwindow.h:96
static HBITMAP hBitmap
Definition: timezone.c:34

◆ SetResizeProc()

void CardWindow::SetResizeProc ( pResizeWndProc  proc)

Definition at line 696 of file cardwindow.cpp.

697 {
699 }
static HANDLE proc()
Definition: pdb.c:32
pResizeWndProc ResizeWndCallback
Definition: cardwindow.h:111

◆ Update()

void CardWindow::Update ( void  )

Definition at line 687 of file cardwindow.cpp.

688 {
689  for(int i = 0; i < nNumCardRegions; i++)
690  {
692  }
693 }
int nNumCardRegions
Definition: cardwindow.h:104
int nHeight
Definition: cardwindow.h:92
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
int nWidth
Definition: cardwindow.h:92
CardRegion * Regions[MAXCARDSTACKS]
Definition: cardwindow.h:103
void AdjustPosition(int winwidth, int winheight)
Definition: cardregion.cpp:281

◆ WndProc()

LRESULT CALLBACK CardWindow::WndProc ( HWND  hwnd,
UINT  iMsg,
WPARAM  wParam,
LPARAM  lParam 
)
private

Definition at line 339 of file cardwindow.cpp.

340 {
341  HDC hdc;
342  PAINTSTRUCT ps;
343 
344  CREATESTRUCT *cs;
345 
346  static CardButton *buttonptr = 0;
347  static CardRegion *stackptr = 0;
348 
349  int x, y, i;
350 
351  switch(iMsg)
352  {
353  case WM_NCCREATE:
354 
355  // When we created this window, we passed in the
356  // pointer to the class object (CardWindow *) in the
357  // call to CreateWindow.
358  cs = (CREATESTRUCT *)lParam;
359 
360  //
361  // associate this class with the window
362  //
363  SetWindowLongPtr(hwnd, 0, (LONG_PTR)cs->lpCreateParams);
364 
365  return 1;
366 
367  case WM_NCDESTROY:
368  // Don't delete anything here..
369  break;
370 
371  case WM_SIZE:
372  nWidth = LOWORD(lParam);
373  nHeight = HIWORD(lParam);
374 
375  //
376  // reposition all the stacks and buttons
377  // in case any of them are centered, right-justified etc
378  //
379  for(i = 0; i < nNumCardRegions; i++)
380  {
382  }
383 
384  for(i = 0; i < nNumButtons; i++)
385  {
387  }
388 
389  //
390  // Call the user-defined resize proc AFTER all the stacks
391  // have been positioned
392  //
395 
396  return 0;
397 
398  case WM_PAINT:
399 
400  hdc = BeginPaint(hwnd, &ps);
401 
402  Paint(hdc);
403 
404  EndPaint(hwnd, &ps);
405  return 0;
406 
407  case WM_TIMER:
408 
409  //find the timer object in the registered funcs
410  /*if(wParam >= 0x10000)
411  {
412  for(i = 0; i < nRegFuncs; i++)
413  {
414  if(RegFuncs[i].id == wParam)
415  {
416  KillTimer(hwnd, wParam);
417 
418  //call the registered function!!
419  RegFuncs[i].func(RegFuncs[i].dwParam);
420 
421  RegFuncs[i] = RegFuncs[nRegFuncs-1];
422  nRegFuncs--;
423  }
424  }
425  }
426  else*/
427  {
428  //find the cardstack
429  CardRegion *stackobj = (CardRegion *)wParam;//CardStackFromId(wParam);
430  stackobj->DoFlash();
431  }
432 
433  return 0;
434 
435  case WM_LBUTTONDBLCLK:
436 
437  x = (short)LOWORD(lParam);
438  y = (short)HIWORD(lParam);
439 
440  if((buttonptr = CardButtonFromPoint(x, y)) != 0)
441  {
442  buttonptr->OnLButtonDown(hwnd, x, y);
443  return 0;
444  }
445 
446  if((stackptr = CardRegionFromPoint(x, y)) != 0)
447  {
448  stackptr->OnLButtonDblClk(x, y);
449  stackptr = 0;
450  }
451 
452  return 0;
453 
454  case WM_LBUTTONDOWN:
455 
456  x = (short)LOWORD(lParam);
457  y = (short)HIWORD(lParam);
458 
459  //if clicked on a button
460  if((buttonptr = CardButtonFromPoint(x, y)) != 0)
461  {
462  if(buttonptr->OnLButtonDown(hwnd, x, y) == 0)
463  buttonptr = 0;
464 
465  return 0;
466  }
467 
468  if((stackptr = CardRegionFromPoint(x, y)) != 0)
469  {
470  if(!stackptr->OnLButtonDown(x, y))
471  stackptr = 0;
472  }
473 
474  return 0;
475 
476  case WM_LBUTTONUP:
477 
478  x = (short)LOWORD(lParam);
479  y = (short)HIWORD(lParam);
480 
481  //
482  // if we were clicking a button
483  //
484  if(buttonptr != 0)
485  {
486  buttonptr->OnLButtonUp(hwnd, x, y);
487  buttonptr = 0;
488  return 0;
489  }
490 
491  if(stackptr != 0)
492  {
493  stackptr->OnLButtonUp(x, y);
494  stackptr = 0;
495  return 0;
496  }
497 
498  if ((stackptr = CardRegionFromPoint(x, y)) != 0)
499  {
500  stackptr->ClickRelease(x, y);
501  stackptr = 0;
502  }
503 
504  return 0;
505 
506  case WM_MOUSEMOVE:
507 
508  x = (short)LOWORD(lParam);
509  y = (short)HIWORD(lParam);
510 
511  // if we were clicking a button
512  if(buttonptr != 0)
513  {
514  buttonptr->OnMouseMove(hwnd, x, y);
515  return 0;
516  }
517 
518  if(stackptr != 0)
519  {
520  return stackptr->OnMouseMove(x, y);
521  }
522 
523  return 0;
524 
525  }
526 
527  return DefWindowProc (hwnd, iMsg, wParam, lParam);
528 }
CardButton * CardButtonFromPoint(int x, int y)
Definition: cardwindow.cpp:229
#define HDC
Definition: msvc.h:22
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
int nNumCardRegions
Definition: cardwindow.h:104
#define WM_LBUTTONDOWN
Definition: winuser.h:1752
int OnLButtonUp(HWND hwnd, int x, int y)
Definition: cardbutton.cpp:301
void AdjustPosition(int winwidth, int winheight)
Definition: cardbutton.cpp:208
bool OnLButtonUp(int x, int y)
int OnMouseMove(HWND hwnd, int x, int y)
Definition: cardbutton.cpp:278
void Paint(HDC hdc)
Definition: cardwindow.cpp:276
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
#define WM_NCCREATE
Definition: winuser.h:1665
#define SetWindowLongPtr
Definition: treelist.c:70
WPARAM wParam
Definition: combotst.c:138
bool OnMouseMove(int x, int y)
INT INT y
Definition: msvc.h:62
int nHeight
Definition: cardwindow.h:92
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
Definition: typeof.h:91
uint32_t cs
Definition: isohybrid.c:75
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
CardRegion * CardRegionFromPoint(int x, int y)
Definition: cardwindow.cpp:249
int OnLButtonDown(HWND hwnd, int x, int y)
Definition: cardbutton.cpp:253
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
HDC hdc
Definition: msvc.h:53
bool OnLButtonDblClk(int x, int y)
#define DefWindowProc
Definition: ros2win.h:31
bool OnLButtonDown(int x, int y)
#define WM_SIZE
Definition: winuser.h:1593
#define WM_TIMER
Definition: winuser.h:1718
int nWidth
Definition: cardwindow.h:92
#define WM_NCDESTROY
Definition: winuser.h:1666
CardButton * Buttons[MAXBUTTONS]
Definition: cardwindow.h:100
#define WM_PAINT
Definition: winuser.h:1602
CardRegion * Regions[MAXCARDSTACKS]
Definition: cardwindow.h:103
#define WM_LBUTTONDBLCLK
Definition: winuser.h:1754
INT x
Definition: msvc.h:62
#define WM_LBUTTONUP
Definition: winuser.h:1753
pResizeWndProc ResizeWndCallback
Definition: cardwindow.h:111
void AdjustPosition(int winwidth, int winheight)
Definition: cardregion.cpp:281
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define WM_MOUSEMOVE
Definition: winuser.h:1751
void DoFlash()
Definition: cardregion.cpp:344
#define HIWORD(l)
Definition: typedefs.h:246
void ClickRelease(int x, int y)
int nNumButtons
Definition: cardwindow.h:101
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82

Referenced by CardWndProc().

Friends And Related Function Documentation

◆ CardButton

friend class CardButton
friend

Definition at line 16 of file cardwindow.h.

Referenced by CreateButton().

◆ CardRegion

friend class CardRegion
friend

Definition at line 15 of file cardwindow.h.

Referenced by CreateRegion().

◆ RegisterCardWindow

void RegisterCardWindow ( )
friend

Definition at line 42 of file cardwindow.cpp.

43 {
44  WNDCLASSEX wc;
45 
46  //Window class for the main application parent window
47  wc.cbSize = sizeof(wc);
50  wc.cbClsExtra = 0;
51  wc.cbWndExtra = sizeof(CardWindow *);
52  wc.hInstance = GetModuleHandle(0);
53  wc.hIcon = 0;
55  wc.hbrBackground = 0;
56  wc.lpszMenuName = 0;
58  wc.hIconSm = 0;
59 
60  RegisterClassEx(&wc);
61 }
UINT style
Definition: winuser.h:3155
LPCSTR lpszMenuName
Definition: winuser.h:3163
#define RegisterClassEx
Definition: winuser.h:5703
HCURSOR hCursor
Definition: winuser.h:3161
WNDPROC lpfnWndProc
Definition: winuser.h:3156
static TCHAR szCardName[]
Definition: cardwindow.cpp:37
LPCSTR lpszClassName
Definition: winuser.h:3164
#define CS_HREDRAW
Definition: winuser.h:648
HICON hIconSm
Definition: winuser.h:3165
HINSTANCE hInstance
Definition: winuser.h:3159
smooth NULL
Definition: ftsmooth.c:416
UINT cbSize
Definition: winuser.h:3154
HBRUSH hbrBackground
Definition: winuser.h:3162
#define CS_VREDRAW
Definition: winuser.h:653
int cbWndExtra
Definition: winuser.h:3158
static LRESULT CALLBACK CardWndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
Definition: cardwindow.cpp:270
HICON hIcon
Definition: winuser.h:3160
#define CS_DBLCLKS
Definition: winuser.h:646
#define LoadCursor
Definition: winuser.h:5678
int cbClsExtra
Definition: winuser.h:3157
#define GetModuleHandle
Definition: winbase.h:3641
#define IDC_ARROW
Definition: winuser.h:682

Referenced by CardWindow().

Member Data Documentation

◆ Buttons

CardButton* CardWindow::Buttons[MAXBUTTONS]
private

◆ crBackgnd

COLORREF CardWindow::crBackgnd
private

◆ dropzone

DropZone* CardWindow::dropzone[MAXDROPZONES]
private

Definition at line 106 of file cardwindow.h.

Referenced by DeleteAll(), DeleteDropZone(), GetDropZoneFromRect(), and RegisterDropZone().

◆ hbmBackImage

HBITMAP CardWindow::hbmBackImage
private

Definition at line 96 of file cardwindow.h.

Referenced by CardWindow(), PaintCardRgn(), and SetBackImage().

◆ hdcBackImage

HDC CardWindow::hdcBackImage
private

Definition at line 97 of file cardwindow.h.

Referenced by CardWindow(), PaintCardRgn(), and SetBackImage().

◆ m_hWnd

HWND CardWindow::m_hWnd
private

Definition at line 91 of file cardwindow.h.

Referenced by Create(), Destroy(), operator HWND(), Paint(), Redraw(), SetBackColor(), and ~CardWindow().

◆ nBackCardIdx

UINT CardWindow::nBackCardIdx
private

Definition at line 94 of file cardwindow.h.

Referenced by CardWindow(), CreateRegion(), GetBackCardIdx(), and SetBackCardIdx().

◆ nHeight

int CardWindow::nHeight
private

Definition at line 92 of file cardwindow.h.

Referenced by GetHeight(), Update(), and WndProc().

◆ nNumButtons

int CardWindow::nNumButtons
private

◆ nNumCardRegions

◆ nNumDropZones

int CardWindow::nNumDropZones
private

◆ nWidth

int CardWindow::nWidth
private

Definition at line 92 of file cardwindow.h.

Referenced by GetWidth(), Update(), and WndProc().

◆ Regions

◆ ResizeWndCallback

pResizeWndProc CardWindow::ResizeWndCallback
private

Definition at line 111 of file cardwindow.h.

Referenced by CardWindow(), SetResizeProc(), and WndProc().


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