Applied patch [ 807060 ] warning free demos
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23668 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
f0b1ccde63
commit
babd36de3a
@ -40,7 +40,7 @@ bool AppClass::OnInit()
|
|||||||
level=IDM_EASY;
|
level=IDM_EASY;
|
||||||
|
|
||||||
BombsFrame =
|
BombsFrame =
|
||||||
new BombsFrameClass(NULL, _T("wxBombs"), wxPoint(155, 165), wxSize(300, 300), wxMINIMIZE_BOX | wxSYSTEM_MENU | wxCAPTION);
|
new BombsFrameClass(NULL, _T("wxBombs"), wxPoint(155, 165), wxSize(300, 300), wxMINIMIZE_BOX | wxSYSTEM_MENU | wxCAPTION | wxCLOSE_BOX );
|
||||||
|
|
||||||
int xmax=BombsFrame->BombsCanvas->field_width*BombsFrame->BombsCanvas->x_cell*X_UNIT;
|
int xmax=BombsFrame->BombsCanvas->field_width*BombsFrame->BombsCanvas->x_cell*X_UNIT;
|
||||||
int ymax=BombsFrame->BombsCanvas->field_height*BombsFrame->BombsCanvas->y_cell*Y_UNIT;
|
int ymax=BombsFrame->BombsCanvas->field_height*BombsFrame->BombsCanvas->y_cell*Y_UNIT;
|
||||||
@ -104,17 +104,17 @@ BombsFrameClass::~BombsFrameClass(void)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void BombsFrameClass::OnCloseWindow(wxCloseEvent& event)
|
void BombsFrameClass::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
|
||||||
{
|
{
|
||||||
this->Destroy();
|
this->Destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BombsFrameClass::OnExit(wxCommandEvent& event)
|
void BombsFrameClass::OnExit(wxCommandEvent& WXUNUSED(event))
|
||||||
{
|
{
|
||||||
this->Destroy();
|
this->Destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BombsFrameClass::OnRestart(wxCommandEvent& event)
|
void BombsFrameClass::OnRestart(wxCommandEvent& WXUNUSED(event))
|
||||||
{
|
{
|
||||||
BombsCanvas->UpdateFieldSize();
|
BombsCanvas->UpdateFieldSize();
|
||||||
int xmax=BombsCanvas->field_width*BombsCanvas->x_cell*X_UNIT;
|
int xmax=BombsCanvas->field_width*BombsCanvas->x_cell*X_UNIT;
|
||||||
@ -122,26 +122,26 @@ void BombsFrameClass::OnRestart(wxCommandEvent& event)
|
|||||||
wxGetApp().BombsFrame->SetClientSize(xmax, ymax);
|
wxGetApp().BombsFrame->SetClientSize(xmax, ymax);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BombsFrameClass::OnAbout(wxCommandEvent& event)
|
void BombsFrameClass::OnAbout(wxCommandEvent& WXUNUSED(event))
|
||||||
{
|
{
|
||||||
wxMessageBox(_T("wxBombs (c) 1996 by P. Foggia\n<foggia@amalfi.dis.unina.it>"), _T("About wxBombs"));
|
wxMessageBox(_T("wxBombs (c) 1996 by P. Foggia\n<foggia@amalfi.dis.unina.it>"), _T("About wxBombs"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void BombsFrameClass::OnEasy(wxCommandEvent& event)
|
void BombsFrameClass::OnEasy(wxCommandEvent& WXUNUSED(event))
|
||||||
{
|
{
|
||||||
menuBar->Check(wxGetApp().level, FALSE);
|
menuBar->Check(wxGetApp().level, FALSE);
|
||||||
wxGetApp().level=IDM_EASY;
|
wxGetApp().level=IDM_EASY;
|
||||||
menuBar->Check(wxGetApp().level, TRUE);
|
menuBar->Check(wxGetApp().level, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BombsFrameClass::OnMedium(wxCommandEvent& event)
|
void BombsFrameClass::OnMedium(wxCommandEvent& WXUNUSED(event))
|
||||||
{
|
{
|
||||||
menuBar->Check(wxGetApp().level, FALSE);
|
menuBar->Check(wxGetApp().level, FALSE);
|
||||||
wxGetApp().level=IDM_MEDIUM;
|
wxGetApp().level=IDM_MEDIUM;
|
||||||
menuBar->Check(wxGetApp().level, TRUE);
|
menuBar->Check(wxGetApp().level, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BombsFrameClass::OnDifficult(wxCommandEvent& event)
|
void BombsFrameClass::OnDifficult(wxCommandEvent& WXUNUSED(event))
|
||||||
{
|
{
|
||||||
menuBar->Check(wxGetApp().level, FALSE);
|
menuBar->Check(wxGetApp().level, FALSE);
|
||||||
wxGetApp().level=IDM_DIFFICULT;
|
wxGetApp().level=IDM_DIFFICULT;
|
||||||
@ -169,8 +169,8 @@ BombsCanvasClass::BombsCanvasClass(wxFrame *parent, const wxPoint& pos, const wx
|
|||||||
|
|
||||||
dc.SetMapMode(wxMM_METRIC);
|
dc.SetMapMode(wxMM_METRIC);
|
||||||
|
|
||||||
int xcm = dc.LogicalToDeviceX(10.0);
|
int xcm = dc.LogicalToDeviceX(10);
|
||||||
int ycm = dc.LogicalToDeviceY(10.0);
|
int ycm = dc.LogicalToDeviceY(10);
|
||||||
// To have a square cell, there must be :
|
// To have a square cell, there must be :
|
||||||
// sx*ycm == sy*xcm
|
// sx*ycm == sy*xcm
|
||||||
if (chw*ycm < chh*xcm)
|
if (chw*ycm < chh*xcm)
|
||||||
@ -195,7 +195,7 @@ BombsCanvasClass::~BombsCanvasClass(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Called when canvas needs to be repainted.
|
// Called when canvas needs to be repainted.
|
||||||
void BombsCanvasClass::OnPaint(wxPaintEvent& event)
|
void BombsCanvasClass::OnPaint(wxPaintEvent& WXUNUSED(event))
|
||||||
{
|
{
|
||||||
wxPaintDC dc(this);
|
wxPaintDC dc(this);
|
||||||
|
|
||||||
|
@ -94,7 +94,7 @@ class BombsCanvasClass: public wxWindow
|
|||||||
|
|
||||||
void OnPaint(wxPaintEvent& event);
|
void OnPaint(wxPaintEvent& event);
|
||||||
void DrawField(wxDC *, int xc1, int yc1, int xc2, int yc2);
|
void DrawField(wxDC *, int xc1, int yc1, int xc2, int yc2);
|
||||||
void Refresh(int xc1, int yc1, int xc2, int yc2);
|
void RefreshField(int xc1, int yc1, int xc2, int yc2);
|
||||||
void Uncover(int x, int y);
|
void Uncover(int x, int y);
|
||||||
void OnEvent(wxMouseEvent& event);
|
void OnEvent(wxMouseEvent& event);
|
||||||
void UpdateFieldSize();
|
void UpdateFieldSize();
|
||||||
|
@ -148,12 +148,12 @@ void BombsCanvasClass::DrawField(wxDC *dc, int xc1, int yc1, int xc2, int yc2)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*-------- BombCanvasClass::Refresh(xc1, yc1, xc2, yc2) -------------*/
|
/*-------- BombCanvasClass::RefreshField(xc1, yc1, xc2, yc2) --------*/
|
||||||
/* Refreshes the field image */
|
/* Refreshes the field image */
|
||||||
/* xc1,yc1 etc. are the (inclusive) limits of the area to be drawn, */
|
/* xc1,yc1 etc. are the (inclusive) limits of the area to be drawn, */
|
||||||
/* expressed in cells. */
|
/* expressed in cells. */
|
||||||
/*---------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------*/
|
||||||
void BombsCanvasClass::Refresh(int xc1, int yc1, int xc2, int yc2)
|
void BombsCanvasClass::RefreshField(int xc1, int yc1, int xc2, int yc2)
|
||||||
{
|
{
|
||||||
wxClientDC dc(this);
|
wxClientDC dc(this);
|
||||||
DrawField(& dc, xc1, yc1, xc2, yc2);
|
DrawField(& dc, xc1, yc1, xc2, yc2);
|
||||||
@ -169,7 +169,7 @@ void BombsCanvasClass::Refresh(int xc1, int yc1, int xc2, int yc2)
|
|||||||
void BombsCanvasClass::Uncover(int x, int y)
|
void BombsCanvasClass::Uncover(int x, int y)
|
||||||
{
|
{
|
||||||
wxGetApp().Game.Unhide(x,y);
|
wxGetApp().Game.Unhide(x,y);
|
||||||
Refresh(x, y, x, y);
|
RefreshField(x, y, x, y);
|
||||||
if (wxGetApp().Game.IsBomb(x,y) || wxGetApp().Game.GetRemainingCells()==0)
|
if (wxGetApp().Game.IsBomb(x,y) || wxGetApp().Game.GetRemainingCells()==0)
|
||||||
{ wxBell();
|
{ wxBell();
|
||||||
if (!wxGetApp().Game.IsBomb(x,y))
|
if (!wxGetApp().Game.IsBomb(x,y))
|
||||||
@ -182,7 +182,7 @@ void BombsCanvasClass::Uncover(int x, int y)
|
|||||||
for(x=0; x<field_width; x++)
|
for(x=0; x<field_width; x++)
|
||||||
for(y=0; y<field_height; y++)
|
for(y=0; y<field_height; y++)
|
||||||
wxGetApp().Game.Unhide(x,y);
|
wxGetApp().Game.Unhide(x,y);
|
||||||
Refresh(0, 0, field_width-1, field_height-1);
|
RefreshField(0, 0, field_width-1, field_height-1);
|
||||||
}
|
}
|
||||||
else if (!wxGetApp().Game.Get(x, y))
|
else if (!wxGetApp().Game.Get(x, y))
|
||||||
{ int left = ( x > 0 ) ? x-1 : 0;
|
{ int left = ( x > 0 ) ? x-1 : 0;
|
||||||
@ -212,7 +212,7 @@ void BombsCanvasClass::OnEvent(wxMouseEvent& event)
|
|||||||
&& (wxGetApp().Game.IsHidden(x,y)
|
&& (wxGetApp().Game.IsHidden(x,y)
|
||||||
|| wxGetApp().Game.GetRemainingCells()==0))
|
|| wxGetApp().Game.GetRemainingCells()==0))
|
||||||
{ wxGetApp().Game.Mark(x,y);
|
{ wxGetApp().Game.Mark(x,y);
|
||||||
Refresh(x, y, x, y);
|
RefreshField(x, y, x, y);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (event.LeftDown() && wxGetApp().Game.IsHidden(x,y)
|
else if (event.LeftDown() && wxGetApp().Game.IsHidden(x,y)
|
||||||
|
@ -253,117 +253,117 @@ void Card::Draw(wxDC& dc, int x, int y)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Draw the value
|
// Draw the value
|
||||||
dc.Blit(x + m_scale*3, y + m_scale*3, valuewidth, valueheight,
|
dc.Blit((wxCoord)(x + m_scale*3), (wxCoord)(y + m_scale*3), valuewidth, valueheight,
|
||||||
&memoryDC, valuewidth * (m_pipValue - 1), valuepos, wxCOPY);
|
&memoryDC, valuewidth * (m_pipValue - 1), valuepos, wxCOPY);
|
||||||
dc.Blit(x + m_width - m_scale*3 - valuewidth, y + m_height - valueheight - m_scale*3,
|
dc.Blit((wxCoord)(x + m_width - m_scale*3 - valuewidth), (wxCoord)(y + m_height - valueheight - m_scale*3),
|
||||||
valuewidth, valueheight,
|
valuewidth, valueheight,
|
||||||
&memoryDC, valuewidth * (m_pipValue - 1), valuepos+valueheight, wxCOPY);
|
&memoryDC, valuewidth * (m_pipValue - 1), valuepos+valueheight, wxCOPY);
|
||||||
|
|
||||||
// Draw the pips
|
// Draw the pips
|
||||||
dc.Blit(x + m_scale*3 + valuewidth+2, y + m_scale*3, pipsize, pipsize,
|
dc.Blit((wxCoord)(x + m_scale*3 + valuewidth+2), (wxCoord)(y + m_scale*3), pipsize, pipsize,
|
||||||
&memoryDC, pipsize * m_suit, pippos, wxCOPY);
|
&memoryDC, pipsize * m_suit, pippos, wxCOPY);
|
||||||
dc.Blit(x + m_width - m_scale*3-valuewidth-pipsize-2, y + m_height - pipsize - m_scale*3,
|
dc.Blit((wxCoord)(x + m_width - m_scale*3-valuewidth-pipsize-2), (wxCoord)(y + m_height - pipsize - m_scale*3),
|
||||||
pipsize, pipsize,
|
pipsize, pipsize,
|
||||||
&memoryDC, pipsize * m_suit, pipsize+pippos, wxCOPY);
|
&memoryDC, pipsize * m_suit, pipsize+pippos, wxCOPY);
|
||||||
|
|
||||||
switch (m_pipValue)
|
switch (m_pipValue)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
dc.Blit(x - symdist + m_width / 2, y - m_scale*5 + m_height / 2, symsize, symsize,
|
dc.Blit((wxCoord)(x - symdist + m_width / 2), (wxCoord)(y - m_scale*5 + m_height / 2), symsize, symsize,
|
||||||
&memoryDC, symsize * m_suit, sympos, wxCOPY);
|
&memoryDC, symsize * m_suit, sympos, wxCOPY);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
dc.Blit(x - symdist + m_width / 2, y - symdist + m_height / 2, symsize, symsize,
|
dc.Blit((wxCoord)(x - symdist + m_width / 2), (wxCoord)(y - symdist + m_height / 2), symsize, symsize,
|
||||||
&memoryDC, symsize * m_suit, sympos, wxCOPY);
|
&memoryDC, symsize * m_suit, sympos, wxCOPY);
|
||||||
case 2:
|
case 2:
|
||||||
dc.Blit(x - symdist + m_width / 2,
|
dc.Blit((wxCoord)(x - symdist + m_width / 2),
|
||||||
y - symdist + m_height / 4, symsize, symsize,
|
(wxCoord)(y - symdist + m_height / 4), symsize, symsize,
|
||||||
&memoryDC, symsize * m_suit, sympos, wxCOPY);
|
&memoryDC, symsize * m_suit, sympos, wxCOPY);
|
||||||
dc.Blit(x - symdist + m_width / 2,
|
dc.Blit((wxCoord)(x - symdist + m_width / 2),
|
||||||
y - symdist + 3 * m_height / 4, symsize, symsize,
|
(wxCoord)(y - symdist + 3 * m_height / 4), symsize, symsize,
|
||||||
&memoryDC, symsize * m_suit, sympos2, wxCOPY);
|
&memoryDC, symsize * m_suit, sympos2, wxCOPY);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 5:
|
case 5:
|
||||||
dc.Blit(x - symdist + m_width / 2, y - symdist + m_height / 2, symsize, symsize,
|
dc.Blit((wxCoord)(x - symdist + m_width / 2), (wxCoord)(y - symdist + m_height / 2), symsize, symsize,
|
||||||
&memoryDC, symsize * m_suit, sympos, wxCOPY);
|
&memoryDC, symsize * m_suit, sympos, wxCOPY);
|
||||||
case 4:
|
case 4:
|
||||||
dc.Blit(x - symdist + m_width / 4,
|
dc.Blit((wxCoord)(x - symdist + m_width / 4),
|
||||||
y - symdist + m_height / 4, symsize, symsize,
|
(wxCoord)(y - symdist + m_height / 4), symsize, symsize,
|
||||||
&memoryDC, symsize * m_suit, sympos, wxCOPY);
|
&memoryDC, symsize * m_suit, sympos, wxCOPY);
|
||||||
dc.Blit(x - symdist + m_width / 4,
|
dc.Blit((wxCoord)(x - symdist + m_width / 4),
|
||||||
y - symdist + 3 * m_height / 4, symsize, symsize,
|
(wxCoord)(y - symdist + 3 * m_height / 4), symsize, symsize,
|
||||||
&memoryDC, symsize * m_suit, sympos2, wxCOPY);
|
&memoryDC, symsize * m_suit, sympos2, wxCOPY);
|
||||||
dc.Blit(x - symdist + 3 * m_width / 4,
|
dc.Blit((wxCoord)(x - symdist + 3 * m_width / 4),
|
||||||
y - symdist + m_height / 4, symsize, symsize,
|
(wxCoord)(y - symdist + m_height / 4), symsize, symsize,
|
||||||
&memoryDC, symsize * m_suit, sympos, wxCOPY);
|
&memoryDC, symsize * m_suit, sympos, wxCOPY);
|
||||||
dc.Blit(x - symdist + 3 * m_width / 4,
|
dc.Blit((wxCoord)(x - symdist + 3 * m_width / 4),
|
||||||
y - symdist + 3 * m_height / 4, symsize, symsize,
|
(wxCoord)(y - symdist + 3 * m_height / 4), symsize, symsize,
|
||||||
&memoryDC, symsize * m_suit, sympos2, wxCOPY);
|
&memoryDC, symsize * m_suit, sympos2, wxCOPY);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 8:
|
case 8:
|
||||||
dc.Blit(x - symdist + 5 * m_width / 10,
|
dc.Blit((wxCoord)(x - symdist + 5 * m_width / 10),
|
||||||
y - symdist + 5 * m_height / 8, symsize, symsize,
|
(wxCoord)(y - symdist + 5 * m_height / 8), symsize, symsize,
|
||||||
&memoryDC, symsize * m_suit, sympos2, wxCOPY);
|
&memoryDC, symsize * m_suit, sympos2, wxCOPY);
|
||||||
case 7:
|
case 7:
|
||||||
dc.Blit(x - symdist + 5 * m_width / 10,
|
dc.Blit((wxCoord)(x - symdist + 5 * m_width / 10),
|
||||||
y - symdist + 3 * m_height / 8, symsize, symsize,
|
(wxCoord)(y - symdist + 3 * m_height / 8), symsize, symsize,
|
||||||
&memoryDC, symsize * m_suit, sympos, wxCOPY);
|
&memoryDC, symsize * m_suit, sympos, wxCOPY);
|
||||||
case 6:
|
case 6:
|
||||||
dc.Blit(x - symdist + m_width / 4,
|
dc.Blit((wxCoord)(x - symdist + m_width / 4),
|
||||||
y - symdist + m_height / 4, symsize, symsize,
|
(wxCoord)(y - symdist + m_height / 4), symsize, symsize,
|
||||||
&memoryDC, symsize * m_suit, sympos, wxCOPY);
|
&memoryDC, symsize * m_suit, sympos, wxCOPY);
|
||||||
dc.Blit(x - symdist + m_width / 4,
|
dc.Blit((wxCoord)(x - symdist + m_width / 4),
|
||||||
y - symdist + m_height / 2, symsize, symsize,
|
(wxCoord)(y - symdist + m_height / 2), symsize, symsize,
|
||||||
&memoryDC, symsize * m_suit, sympos, wxCOPY);
|
&memoryDC, symsize * m_suit, sympos, wxCOPY);
|
||||||
dc.Blit(x - symdist + m_width / 4,
|
dc.Blit((wxCoord)(x - symdist + m_width / 4),
|
||||||
y - symdist + 3 * m_height / 4, symsize, symsize,
|
(wxCoord)(y - symdist + 3 * m_height / 4), symsize, symsize,
|
||||||
&memoryDC, symsize * m_suit, sympos2, wxCOPY);
|
&memoryDC, symsize * m_suit, sympos2, wxCOPY);
|
||||||
dc.Blit(x - symdist + 3 * m_width / 4,
|
dc.Blit((wxCoord)(x - symdist + 3 * m_width / 4),
|
||||||
y - symdist + m_height / 4, symsize, symsize,
|
(wxCoord)(y - symdist + m_height / 4), symsize, symsize,
|
||||||
&memoryDC, symsize * m_suit, sympos, wxCOPY);
|
&memoryDC, symsize * m_suit, sympos, wxCOPY);
|
||||||
dc.Blit(x - symdist + 3 * m_width / 4,
|
dc.Blit((wxCoord)(x - symdist + 3 * m_width / 4),
|
||||||
y - symdist + m_height / 2, symsize, symsize,
|
(wxCoord)(y - symdist + m_height / 2), symsize, symsize,
|
||||||
&memoryDC, symsize * m_suit, sympos, wxCOPY);
|
&memoryDC, symsize * m_suit, sympos, wxCOPY);
|
||||||
dc.Blit(x - symdist + 3 * m_width / 4,
|
dc.Blit((wxCoord)(x - symdist + 3 * m_width / 4),
|
||||||
y - symdist + 3 * m_height / 4, symsize, symsize,
|
(wxCoord)(y - symdist + 3 * m_height / 4), symsize, symsize,
|
||||||
&memoryDC, symsize * m_suit, sympos2, wxCOPY);
|
&memoryDC, symsize * m_suit, sympos2, wxCOPY);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 10:
|
case 10:
|
||||||
dc.Blit(x - symdist + m_width / 2,
|
dc.Blit((wxCoord)(x - symdist + m_width / 2),
|
||||||
y - symdist + 2 * m_height / 3, symsize, symsize,
|
(wxCoord)(y - symdist + 2 * m_height / 3), symsize, symsize,
|
||||||
&memoryDC, symsize * m_suit, sympos2, wxCOPY);
|
&memoryDC, symsize * m_suit, sympos2, wxCOPY);
|
||||||
case 9:
|
case 9:
|
||||||
dc.Blit(x - symdist + m_width / 4,
|
dc.Blit((wxCoord)(x - symdist + m_width / 4),
|
||||||
y - symdist2 + m_height / 4, symsize, symsize,
|
(wxCoord)(y - symdist2 + m_height / 4), symsize, symsize,
|
||||||
&memoryDC, symsize * m_suit, sympos, wxCOPY);
|
&memoryDC, symsize * m_suit, sympos, wxCOPY);
|
||||||
dc.Blit(x - symdist + m_width / 4,
|
dc.Blit((wxCoord)(x - symdist + m_width / 4),
|
||||||
y - symdist2 + 5 * m_height / 12, symsize, symsize,
|
(wxCoord)(y - symdist2 + 5 * m_height / 12), symsize, symsize,
|
||||||
&memoryDC, symsize * m_suit, sympos, wxCOPY);
|
&memoryDC, symsize * m_suit, sympos, wxCOPY);
|
||||||
dc.Blit(x - symdist + m_width / 4,
|
dc.Blit((wxCoord)(x - symdist + m_width / 4),
|
||||||
y - symdist + 7 * m_height / 12, symsize, symsize,
|
(wxCoord)(y - symdist + 7 * m_height / 12), symsize, symsize,
|
||||||
&memoryDC, symsize * m_suit, sympos2, wxCOPY);
|
&memoryDC, symsize * m_suit, sympos2, wxCOPY);
|
||||||
dc.Blit(x - symdist + m_width / 4,
|
dc.Blit((wxCoord)(x - symdist + m_width / 4),
|
||||||
y - symdist + 3 * m_height / 4, symsize, symsize,
|
(wxCoord)(y - symdist + 3 * m_height / 4), symsize, symsize,
|
||||||
&memoryDC, symsize * m_suit, sympos2, wxCOPY);
|
&memoryDC, symsize * m_suit, sympos2, wxCOPY);
|
||||||
|
|
||||||
dc.Blit(x - symdist + 3 * m_width / 4,
|
dc.Blit((wxCoord)(x - symdist + 3 * m_width / 4),
|
||||||
y - symdist2 + m_height / 4, symsize, symsize,
|
(wxCoord)(y - symdist2 + m_height / 4), symsize, symsize,
|
||||||
&memoryDC, symsize * m_suit, sympos, wxCOPY);
|
&memoryDC, symsize * m_suit, sympos, wxCOPY);
|
||||||
dc.Blit(x - symdist + 3 * m_width / 4,
|
dc.Blit((wxCoord)(x - symdist + 3 * m_width / 4),
|
||||||
y - symdist2 + 5 * m_height / 12, symsize, symsize,
|
(wxCoord)(y - symdist2 + 5 * m_height / 12), symsize, symsize,
|
||||||
&memoryDC, symsize * m_suit, sympos, wxCOPY);
|
&memoryDC, symsize * m_suit, sympos, wxCOPY);
|
||||||
dc.Blit(x - symdist + 3 * m_width / 4,
|
dc.Blit((wxCoord)(x - symdist + 3 * m_width / 4),
|
||||||
y - symdist + 7 * m_height / 12, symsize, symsize,
|
(wxCoord)(y - symdist + 7 * m_height / 12), symsize, symsize,
|
||||||
&memoryDC, symsize * m_suit, sympos2, wxCOPY);
|
&memoryDC, symsize * m_suit, sympos2, wxCOPY);
|
||||||
dc.Blit(x - symdist + 3 * m_width / 4,
|
dc.Blit((wxCoord)(x - symdist + 3 * m_width / 4),
|
||||||
y - symdist + 3 * m_height / 4, symsize, symsize,
|
(wxCoord)(y - symdist + 3 * m_height / 4), symsize, symsize,
|
||||||
&memoryDC, symsize * m_suit, sympos2, wxCOPY);
|
&memoryDC, symsize * m_suit, sympos2, wxCOPY);
|
||||||
dc.Blit(x - symdist + m_width / 2,
|
dc.Blit((wxCoord)(x - symdist + m_width / 2),
|
||||||
y - symdist + m_height / 3, symsize, symsize,
|
(wxCoord)(y - symdist + m_height / 3), symsize, symsize,
|
||||||
&memoryDC, symsize * m_suit, sympos, wxCOPY);
|
&memoryDC, symsize * m_suit, sympos, wxCOPY);
|
||||||
break;
|
break;
|
||||||
case 11:
|
case 11:
|
||||||
@ -371,14 +371,14 @@ void Card::Draw(wxDC& dc, int x, int y)
|
|||||||
case 13:
|
case 13:
|
||||||
memoryDC.SelectObject(*m_pictureBmap);
|
memoryDC.SelectObject(*m_pictureBmap);
|
||||||
int picwidth = 40,picheight = 45;
|
int picwidth = 40,picheight = 45;
|
||||||
dc.Blit(x + (m_width-picwidth)/2, y - picheight/2 + m_height/2,
|
dc.Blit((wxCoord)(x + (m_width-picwidth)/2), (wxCoord)(y - picheight/2 + m_height/2),
|
||||||
picwidth, picheight,
|
picwidth, picheight,
|
||||||
&memoryDC, picwidth * (m_pipValue - 11), 0, wxCOPY);
|
&memoryDC, picwidth * (m_pipValue - 11), 0, wxCOPY);
|
||||||
|
|
||||||
memoryDC.SelectObject(*m_symbolBmap);
|
memoryDC.SelectObject(*m_symbolBmap);
|
||||||
dc.Blit(x + m_width-(m_width-picwidth)/2-symsize-3,y - picheight/2+m_height/2+1, symsize, symsize,
|
dc.Blit((wxCoord)(x + m_width-(m_width-picwidth)/2-symsize-3),(wxCoord)(y - picheight/2+m_height/2+1), symsize, symsize,
|
||||||
&memoryDC, symsize * m_suit, sympos, wxCOPY);
|
&memoryDC, symsize * m_suit, sympos, wxCOPY);
|
||||||
dc.Blit(x + (m_width-picwidth)/2+2,y + picheight/2 + m_height/2-symsize, symsize, symsize,
|
dc.Blit((wxCoord)(x + (m_width-picwidth)/2+2),(wxCoord)(y + picheight/2 + m_height/2-symsize), symsize, symsize,
|
||||||
&memoryDC, symsize * m_suit, sympos2, wxCOPY);
|
&memoryDC, symsize * m_suit, sympos2, wxCOPY);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -193,8 +193,8 @@ void Game::DoMove(wxDC& dc, Pile* src, Pile* dest)
|
|||||||
|
|
||||||
if (frame)
|
if (frame)
|
||||||
{
|
{
|
||||||
wxNode *node = frame->GetChildren().First();
|
wxNode *node = (wxNode *)frame->GetChildren().GetFirst();
|
||||||
if (node) canvas = (wxWindow*)node->Data();
|
if (node) canvas = (wxWindow*)node->GetData();
|
||||||
}
|
}
|
||||||
|
|
||||||
// This game is over
|
// This game is over
|
||||||
|
@ -88,7 +88,7 @@ void Pile::Redraw(wxDC& dc )
|
|||||||
{
|
{
|
||||||
if (m_dx == 0 && m_dy == 0)
|
if (m_dx == 0 && m_dy == 0)
|
||||||
{
|
{
|
||||||
if ((canvas) && (canvas->IsExposed(m_x,m_y,Card::GetScale()*60,Card::GetScale()*200)))
|
if ((canvas) && (canvas->IsExposed(m_x,m_y,(int)(Card::GetScale()*60),(int)(Card::GetScale()*200))))
|
||||||
m_cards[m_topCard]->Draw(dc, m_x, m_y);
|
m_cards[m_topCard]->Draw(dc, m_x, m_y);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -97,7 +97,7 @@ void Pile::Redraw(wxDC& dc )
|
|||||||
int y = m_y;
|
int y = m_y;
|
||||||
for (int i = 0; i <= m_topCard; i++)
|
for (int i = 0; i <= m_topCard; i++)
|
||||||
{
|
{
|
||||||
if ((canvas) && (canvas->IsExposed(x,y,Card::GetScale()*60,Card::GetScale()*200)))
|
if ((canvas) && (canvas->IsExposed(x,y,(int)(Card::GetScale()*60),(int)(Card::GetScale()*200))))
|
||||||
m_cards[i]->Draw(dc, x, y);
|
m_cards[i]->Draw(dc, x, y);
|
||||||
x += (int)Card::GetScale()*m_dx;
|
x += (int)Card::GetScale()*m_dx;
|
||||||
y += (int)Card::GetScale()*m_dy;
|
y += (int)Card::GetScale()*m_dy;
|
||||||
@ -106,7 +106,7 @@ void Pile::Redraw(wxDC& dc )
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ((canvas) && (canvas->IsExposed(m_x,m_y,Card::GetScale()*60,Card::GetScale()*200)))
|
if ((canvas) && (canvas->IsExposed(m_x,m_y,(int)(Card::GetScale()*60),(int)(Card::GetScale()*200))))
|
||||||
Card::DrawNullCard(dc, m_x, m_y);
|
Card::DrawNullCard(dc, m_x, m_y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -147,7 +147,7 @@ const wxString& PlayerSelectionDialog::GetPlayersName()
|
|||||||
return m_player;
|
return m_player;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlayerSelectionDialog::OnCloseWindow(wxCloseEvent& event)
|
void PlayerSelectionDialog::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
|
||||||
{
|
{
|
||||||
m_player = _T("");
|
m_player = _T("");
|
||||||
EndModal(wxID_CANCEL);
|
EndModal(wxID_CANCEL);
|
||||||
|
@ -174,7 +174,7 @@ void ScoreDialog::Display()
|
|||||||
Show(TRUE);
|
Show(TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScoreDialog::OnCloseWindow(wxCloseEvent& event)
|
void ScoreDialog::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
|
||||||
{
|
{
|
||||||
EndModal(wxID_OK);
|
EndModal(wxID_OK);
|
||||||
}
|
}
|
||||||
|
@ -122,12 +122,12 @@ MyFrame::MyFrame(wxFrame *frame, const wxString& title, const wxPoint& pos, cons
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Intercept menu commands
|
// Intercept menu commands
|
||||||
void MyFrame::OnExit(wxCommandEvent& event)
|
void MyFrame::OnExit(wxCommandEvent& WXUNUSED(event))
|
||||||
{
|
{
|
||||||
this->Destroy();
|
this->Destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyFrame::OnCloseWindow(wxCloseEvent& event)
|
void MyFrame::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
|
||||||
{
|
{
|
||||||
static bool destroyed = FALSE;
|
static bool destroyed = FALSE;
|
||||||
if (destroyed)
|
if (destroyed)
|
||||||
@ -159,7 +159,7 @@ MyCanvas::MyCanvas(wxFrame *frame):
|
|||||||
WaterBrush = wxBrush(wxCol4, wxSOLID);
|
WaterBrush = wxBrush(wxCol4, wxSOLID);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyCanvas::OnPaint(wxPaintEvent& event)
|
void MyCanvas::OnPaint(wxPaintEvent& WXUNUSED(event))
|
||||||
{
|
{
|
||||||
wxPaintDC dc(this);
|
wxPaintDC dc(this);
|
||||||
Draw(dc);
|
Draw(dc);
|
||||||
|
@ -809,7 +809,7 @@ void LifeCanvas::DrawChanged()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// event handlers
|
// event handlers
|
||||||
void LifeCanvas::OnPaint(wxPaintEvent& event)
|
void LifeCanvas::OnPaint(wxPaintEvent& WXUNUSED(event))
|
||||||
{
|
{
|
||||||
wxPaintDC dc(this);
|
wxPaintDC dc(this);
|
||||||
wxRect rect = GetUpdateRegion().GetBox();
|
wxRect rect = GetUpdateRegion().GetBox();
|
||||||
|
@ -608,7 +608,7 @@ bool MyApp::OnInit()
|
|||||||
// randomize();
|
// randomize();
|
||||||
pages[0] = 0;
|
pages[0] = 0;
|
||||||
|
|
||||||
TheMainWindow = new MainWindow(NULL, 500, _T("wxPoem"), wxPoint(XPos, YPos), wxSize(100, 100), wxCAPTION|wxMINIMIZE_BOX|wxSYSTEM_MENU);
|
TheMainWindow = new MainWindow(NULL, 500, _T("wxPoem"), wxPoint(XPos, YPos), wxSize(100, 100), wxCAPTION|wxMINIMIZE_BOX|wxSYSTEM_MENU|wxCLOSE_BOX);
|
||||||
|
|
||||||
#ifdef wx_x
|
#ifdef wx_x
|
||||||
TheMainWindow->SetIcon(Icon(_T("wxpoem")));
|
TheMainWindow->SetIcon(Icon(_T("wxpoem")));
|
||||||
@ -775,7 +775,7 @@ void MyCanvas::OnMouseEvent(wxMouseEvent& event)
|
|||||||
// Process characters
|
// Process characters
|
||||||
void MyCanvas::OnChar(wxKeyEvent& event)
|
void MyCanvas::OnChar(wxKeyEvent& event)
|
||||||
{
|
{
|
||||||
switch (event.KeyCode())
|
switch (event.GetKeyCode())
|
||||||
{
|
{
|
||||||
case 'n':
|
case 'n':
|
||||||
case 'N':
|
case 'N':
|
||||||
|
Loading…
Reference in New Issue
Block a user