compilation fixes (errors and warnings) for wxWin 2.0 compatibility
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1612 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -46,8 +46,6 @@ void BombsCanvasClass::DrawField(wxDC *dc, int xc1, int yc1, int xc2, int yc2)
|
|||||||
wxPen *blackPen = wxThePenList->FindOrCreatePen(*wxBlack, 1, wxSOLID);
|
wxPen *blackPen = wxThePenList->FindOrCreatePen(*wxBlack, 1, wxSOLID);
|
||||||
wxPen *redPen = wxThePenList->FindOrCreatePen(*wxRed, 1, wxSOLID);
|
wxPen *redPen = wxThePenList->FindOrCreatePen(*wxRed, 1, wxSOLID);
|
||||||
wxPen *bluePen = wxThePenList->FindOrCreatePen(*wxBlue, 1, wxSOLID);
|
wxPen *bluePen = wxThePenList->FindOrCreatePen(*wxBlue, 1, wxSOLID);
|
||||||
wxPen *whitePen = wxThePenList->FindOrCreatePen(*wxWhite, 1, wxSOLID);
|
|
||||||
wxPen *greyPen = wxThePenList->FindOrCreatePen(*wxGrey, 1, wxSOLID);
|
|
||||||
wxBrush *whiteBrush = wxTheBrushList->FindOrCreateBrush(*wxWhite, wxSOLID);
|
wxBrush *whiteBrush = wxTheBrushList->FindOrCreateBrush(*wxWhite, wxSOLID);
|
||||||
wxBrush *greyBrush = wxTheBrushList->FindOrCreateBrush(*wxGrey, wxSOLID);
|
wxBrush *greyBrush = wxTheBrushList->FindOrCreateBrush(*wxGrey, wxSOLID);
|
||||||
wxBrush *redBrush = wxTheBrushList->FindOrCreateBrush(*wxRed, wxSOLID);
|
wxBrush *redBrush = wxTheBrushList->FindOrCreateBrush(*wxRed, wxSOLID);
|
||||||
@@ -168,7 +166,8 @@ void BombsCanvasClass::Refresh(int xc1, int yc1, int xc2, int yc2)
|
|||||||
|
|
||||||
// Called when the canvas receives a mouse event.
|
// Called when the canvas receives a mouse event.
|
||||||
void BombsCanvasClass::OnEvent(wxMouseEvent& event)
|
void BombsCanvasClass::OnEvent(wxMouseEvent& event)
|
||||||
{ float fx, fy;
|
{
|
||||||
|
long fx, fy;
|
||||||
event.Position(&fx, &fy);
|
event.Position(&fx, &fy);
|
||||||
int x = fx/(x_cell*X_UNIT);
|
int x = fx/(x_cell*X_UNIT);
|
||||||
int y = fy/(y_cell*Y_UNIT);
|
int y = fy/(y_cell*Y_UNIT);
|
||||||
|
@@ -316,8 +316,8 @@ BEGIN_EVENT_TABLE(MyPanel, wxPanel)
|
|||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
|
MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
|
||||||
: m_notebook(NULL), m_text(NULL),
|
: wxPanel( frame, -1, wxPoint(x, y), wxSize(w, h) ),
|
||||||
wxPanel( frame, -1, wxPoint(x, y), wxSize(w, h) )
|
m_text(NULL), m_notebook(NULL)
|
||||||
{
|
{
|
||||||
// SetBackgroundColour("cadet blue");
|
// SetBackgroundColour("cadet blue");
|
||||||
|
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
// Created: 04/01/98
|
// Created: 04/01/98
|
||||||
// RCS-ID: $Id$
|
// RCS-ID: $Id$
|
||||||
// Copyright: (c) Julian Smart and Markus Holzem
|
// Copyright: (c) Julian Smart and Markus Holzem
|
||||||
// Licence: wxWindows license
|
// Licence: wxWindows license
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
@@ -43,16 +43,16 @@ class MyFrame: public wxFrame
|
|||||||
public:
|
public:
|
||||||
void OnQuit(wxCommandEvent& event);
|
void OnQuit(wxCommandEvent& event);
|
||||||
void OnAbout(wxCommandEvent& event);
|
void OnAbout(wxCommandEvent& event);
|
||||||
bool OnClose(void) { return TRUE; }
|
bool OnClose(void) { return TRUE; }
|
||||||
};
|
};
|
||||||
|
|
||||||
// ID for the menu commands
|
// ID for the menu commands
|
||||||
#define DYNAMIC_QUIT 1
|
#define DYNAMIC_QUIT 1
|
||||||
#define DYNAMIC_TEXT 101
|
#define DYNAMIC_TEXT 101
|
||||||
#define DYNAMIC_ABOUT 102
|
#define DYNAMIC_ABOUT 102
|
||||||
|
|
||||||
// Create a new application object
|
// Create a new application object
|
||||||
IMPLEMENT_APP (MyApp)
|
IMPLEMENT_APP (MyApp)
|
||||||
|
|
||||||
// `Main program' equivalent, creating windows and returning main app frame
|
// `Main program' equivalent, creating windows and returning main app frame
|
||||||
bool MyApp::OnInit(void)
|
bool MyApp::OnInit(void)
|
||||||
@@ -60,8 +60,12 @@ bool MyApp::OnInit(void)
|
|||||||
// Create the main frame window
|
// Create the main frame window
|
||||||
MyFrame *frame = new MyFrame(NULL, "Dynamic wxWindows App", 50, 50, 450, 340);
|
MyFrame *frame = new MyFrame(NULL, "Dynamic wxWindows App", 50, 50, 450, 340);
|
||||||
|
|
||||||
frame->Connect( DYNAMIC_QUIT, -1, wxEVT_COMMAND_MENU_SELECTED, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) MyFrame::OnQuit );
|
frame->Connect( DYNAMIC_QUIT, -1, wxEVT_COMMAND_MENU_SELECTED,
|
||||||
frame->Connect( DYNAMIC_ABOUT, -1, wxEVT_COMMAND_MENU_SELECTED, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) MyFrame::OnAbout );
|
(wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction)
|
||||||
|
&MyFrame::OnQuit );
|
||||||
|
frame->Connect( DYNAMIC_ABOUT, -1, wxEVT_COMMAND_MENU_SELECTED,
|
||||||
|
(wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction)
|
||||||
|
&MyFrame::OnAbout );
|
||||||
|
|
||||||
// Give it an icon
|
// Give it an icon
|
||||||
#ifdef __WXMSW__
|
#ifdef __WXMSW__
|
||||||
@@ -105,7 +109,7 @@ void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event) )
|
|||||||
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event) )
|
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event) )
|
||||||
{
|
{
|
||||||
wxMessageDialog dialog(this, "This demonstrates dynamic event handling",
|
wxMessageDialog dialog(this, "This demonstrates dynamic event handling",
|
||||||
"About Dynamic", wxYES_NO|wxCANCEL);
|
"About Dynamic", wxYES_NO|wxCANCEL);
|
||||||
|
|
||||||
dialog.ShowModal();
|
dialog.ShowModal();
|
||||||
}
|
}
|
||||||
|
@@ -76,8 +76,6 @@ static bool same_search = FALSE; // Searching on same string
|
|||||||
|
|
||||||
static long poem_index[600]; // Index of poem starts
|
static long poem_index[600]; // Index of poem starts
|
||||||
static long nitems = 0; // Number of poems
|
static long nitems = 0; // Number of poems
|
||||||
static int desired_char_height = DEFAULT_CHAR_HEIGHT; // Desired height
|
|
||||||
static char DesiredFont[64]; // Chosen font
|
|
||||||
static int char_height = DEFAULT_CHAR_HEIGHT; // Actual height
|
static int char_height = DEFAULT_CHAR_HEIGHT; // Actual height
|
||||||
static int index_ptr = -1; // Pointer into index
|
static int index_ptr = -1; // Pointer into index
|
||||||
static int poem_height, poem_width; // Size of poem
|
static int poem_height, poem_width; // Size of poem
|
||||||
@@ -724,7 +722,7 @@ void MyCanvas::OnPaint(wxPaintEvent& WXUNUSED(event))
|
|||||||
|
|
||||||
void MyCanvas::OnMouseEvent(wxMouseEvent& event)
|
void MyCanvas::OnMouseEvent(wxMouseEvent& event)
|
||||||
{
|
{
|
||||||
float x, y;
|
long x, y;
|
||||||
event.Position(&x, &y);
|
event.Position(&x, &y);
|
||||||
static int startPosX, startPosY, startFrameX, startFrameY;
|
static int startPosX, startPosY, startFrameX, startFrameY;
|
||||||
|
|
||||||
@@ -733,11 +731,7 @@ void MyCanvas::OnMouseEvent(wxMouseEvent& event)
|
|||||||
if (event.RightDown())
|
if (event.RightDown())
|
||||||
{
|
{
|
||||||
// Versions from wxWin 1.67 are probably OK
|
// Versions from wxWin 1.67 are probably OK
|
||||||
#if 0 // wx_motif
|
|
||||||
FakePopupMenu(popupMenu, x, y);
|
|
||||||
#else
|
|
||||||
PopupMenu(popupMenu, (int)x, (int)y );
|
PopupMenu(popupMenu, (int)x, (int)y );
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
else if (event.LeftDown())
|
else if (event.LeftDown())
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user