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:
Vadim Zeitlin
1999-02-05 16:44:52 +00:00
parent fe4e9e6c14
commit f5d01a1cb7
4 changed files with 26 additions and 29 deletions

View File

@@ -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);

View File

@@ -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");

View File

@@ -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__

View File

@@ -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())
{ {