Warning fixes found under hardest mode of OpenWatcom. Seems clean in Borland, MinGW and DMC.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29684 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2004-10-06 20:54:57 +00:00
parent 958d3a7e4b
commit 925e9792d3
46 changed files with 377 additions and 469 deletions

View File

@@ -994,7 +994,7 @@ void DatabaseDemoFrame::BuildParameterDialog(wxWindow *parent)
* will be committed or rolled back when any of the objects has this function call made. * will be committed or rolled back when any of the objects has this function call made.
*/ */
Ccontact::Ccontact (wxDb *pwxDb) : wxDbTable(pwxDb ? pwxDb : wxDbGetConnection(wxGetApp().DbConnectInf), Ccontact::Ccontact (wxDb *pwxDb) : wxDbTable(pwxDb ? pwxDb : wxDbGetConnection(wxGetApp().DbConnectInf),
CONTACT_TABLE_NAME, CONTACT_NO_COLS, wxT(""), CONTACT_TABLE_NAME, CONTACT_NO_COLS, wxEmptyString,
!wxDB_QUERY_ONLY, wxGetApp().DbConnectInf->GetDefaultDir()) !wxDB_QUERY_ONLY, wxGetApp().DbConnectInf->GetDefaultDir())
{ {
// This is used to represent whether the database connection should be released // This is used to represent whether the database connection should be released
@@ -1817,9 +1817,9 @@ bool CeditorDlg::GetData()
if (!invalid) if (!invalid)
{ {
wxGetApp().Contact->JoinDate.month = mm; wxGetApp().Contact->JoinDate.month = (SQLUSMALLINT)mm;
wxGetApp().Contact->JoinDate.day = dd; wxGetApp().Contact->JoinDate.day = (SQLUSMALLINT)dd;
wxGetApp().Contact->JoinDate.year = yyyy; wxGetApp().Contact->JoinDate.year = (SQLSMALLINT)yyyy;
} }
else else
{ {
@@ -1836,7 +1836,7 @@ bool CeditorDlg::GetData()
wxStrcpy(wxGetApp().Contact->Country,pCountryTxt->GetValue()); wxStrcpy(wxGetApp().Contact->Country,pCountryTxt->GetValue());
wxStrcpy(wxGetApp().Contact->PostalCode,pPostalCodeTxt->GetValue()); wxStrcpy(wxGetApp().Contact->PostalCode,pPostalCodeTxt->GetValue());
wxGetApp().Contact->Contributions = wxAtoi(pContribTxt->GetValue()); wxGetApp().Contact->Contributions = (UCHAR)wxAtoi(pContribTxt->GetValue());
wxGetApp().Contact->LinesOfCode = wxAtol(pLinesTxt->GetValue()); wxGetApp().Contact->LinesOfCode = wxAtol(pLinesTxt->GetValue());
wxGetApp().Contact->NativeLanguage = (enum Language) pNativeLangChoice->GetSelection(); wxGetApp().Contact->NativeLanguage = (enum Language) pNativeLangChoice->GetSelection();
@@ -1870,7 +1870,7 @@ bool CeditorDlg::Save()
if (mode == mCreate) if (mode == mCreate)
{ {
RETCODE result = wxGetApp().Contact->Insert(); RETCODE result = (RETCODE)wxGetApp().Contact->Insert();
failed = (result != DB_SUCCESS); failed = (result != DB_SUCCESS);
if (failed) if (failed)
@@ -2363,11 +2363,6 @@ CqueryDlg::CqueryDlg(wxWindow *parent, wxDb *pDb, wxChar *tblName[],
} // CqueryDlg() constructor } // CqueryDlg() constructor
CqueryDlg::~CqueryDlg()
{
} // CqueryDlg::~CqueryDlg() destructor
void CqueryDlg::OnButton(wxCommandEvent &event) void CqueryDlg::OnButton(wxCommandEvent &event)
{ {
wxWindow *win = (wxWindow*) event.GetEventObject(); wxWindow *win = (wxWindow*) event.GetEventObject();
@@ -2712,7 +2707,7 @@ void CqueryDlg::ProcessCountBtn()
if (!dbTable) // wxDbTable object needs to be created and opened if (!dbTable) // wxDbTable object needs to be created and opened
{ {
dbTable = new wxDbTable(pDB, masterTableName, 0, wxT(""), dbTable = new wxDbTable(pDB, masterTableName, 0, wxEmptyString,
!wxDB_QUERY_ONLY, !wxDB_QUERY_ONLY,
wxGetApp().DbConnectInf->GetDefaultDir()); wxGetApp().DbConnectInf->GetDefaultDir());
if (!dbTable) if (!dbTable)

View File

@@ -515,7 +515,7 @@ class CqueryDlg : public wxDialog
wxTextCtrl *pFocusTxt; wxTextCtrl *pFocusTxt;
CqueryDlg(wxWindow *parent, wxDb *pDb, wxChar *tblName[], const wxString &pWhereArg); CqueryDlg(wxWindow *parent, wxDb *pDb, wxChar *tblName[], const wxString &pWhereArg);
~CqueryDlg(); ~CqueryDlg(){};
void OnButton( wxCommandEvent &event ); void OnButton( wxCommandEvent &event );
void OnCommand(wxWindow& win, wxCommandEvent& event); void OnCommand(wxWindow& win, wxCommandEvent& event);

View File

@@ -131,7 +131,7 @@ const wxChar *GetExtendedDBErrorMsg2(wxDb *pDb, wxChar *ErrFile, int ErrLine)
// Clookup constructor // Clookup constructor
Clookup::Clookup(wxChar *tblName, wxChar *colName, wxDb *pDb, const wxString &defDir) Clookup::Clookup(wxChar *tblName, wxChar *colName, wxDb *pDb, const wxString &defDir)
: wxDbTable(pDb, tblName, 1, wxT(""), !wxDB_QUERY_ONLY, : wxDbTable(pDb, tblName, 1, wxEmptyString, !wxDB_QUERY_ONLY,
defDir) defDir)
{ {
@@ -143,7 +143,7 @@ Clookup::Clookup(wxChar *tblName, wxChar *colName, wxDb *pDb, const wxString &de
// Clookup2 constructor // Clookup2 constructor
Clookup2::Clookup2(wxChar *tblName, wxChar *colName1, wxChar *colName2, Clookup2::Clookup2(wxChar *tblName, wxChar *colName1, wxChar *colName2,
wxDb *pDb, const wxString &defDir) wxDb *pDb, const wxString &defDir)
: wxDbTable(pDb, tblName, (1 + (wxStrlen(colName2) > 0)), wxT(""), : wxDbTable(pDb, tblName, (UWORD)(1 + (wxStrlen(colName2) > 0)), wxEmptyString,
!wxDB_QUERY_ONLY, defDir) !wxDB_QUERY_ONLY, defDir)
{ {
wxASSERT(pDb); wxASSERT(pDb);
@@ -153,10 +153,10 @@ Clookup2::Clookup2(wxChar *tblName, wxChar *colName1, wxChar *colName2,
int i = 0; int i = 0;
SetColDefs (i, colName1, DB_DATA_TYPE_VARCHAR, lookupCol1, SQL_C_CHAR, LOOKUP_COL_LEN+1, false, false); SetColDefs ((UWORD)i, colName1, DB_DATA_TYPE_VARCHAR, lookupCol1, SQL_C_CHAR, LOOKUP_COL_LEN+1, false, false);
if (wxStrlen(colName2) > 0) if (wxStrlen(colName2) > 0)
SetColDefs (++i, colName2, DB_DATA_TYPE_VARCHAR, lookupCol2, SQL_C_CHAR, LOOKUP_COL_LEN+1, false, false); SetColDefs ((UWORD)(++i), colName2, DB_DATA_TYPE_VARCHAR, lookupCol2, SQL_C_CHAR, LOOKUP_COL_LEN+1, false, false);
} // Clookup2() } // Clookup2()

View File

@@ -473,10 +473,6 @@ DragShape::DragShape(const wxBitmap& bitmap)
m_show = true; m_show = true;
} }
DragShape::~DragShape()
{
}
bool DragShape::HitTest(const wxPoint& pt) const bool DragShape::HitTest(const wxPoint& pt) const
{ {
wxRect rect(GetRect()); wxRect rect(GetRect());

View File

@@ -123,7 +123,7 @@ class DragShape: public wxObject
{ {
public: public:
DragShape(const wxBitmap& bitmap); DragShape(const wxBitmap& bitmap);
~DragShape(); ~DragShape(){};
//// Operations //// Operations

View File

@@ -674,11 +674,12 @@ void MyCanvas::DrawDefault(wxDC& dc)
wxMemoryDC memdc2; wxMemoryDC memdc2;
memdc2.SelectObject(bitmap2); memdc2.SelectObject(bitmap2);
wxBrush yellowBrush(wxColour(255, 255, 0), wxSOLID); wxColour clr(255, 255, 0);
wxBrush yellowBrush(clr, wxSOLID);
memdc2.SetBackground(yellowBrush); memdc2.SetBackground(yellowBrush);
memdc2.Clear(); memdc2.Clear();
wxPen yellowPen(wxColour(255, 255, 0), 1, wxSOLID); wxPen yellowPen(clr, 1, wxSOLID);
// Now draw a white rectangle with red outline. It should // Now draw a white rectangle with red outline. It should
// entirely eclipse the yellow background. // entirely eclipse the yellow background.
@@ -951,7 +952,8 @@ void MyCanvas::OnPaint(wxPaintEvent &WXUNUSED(event))
if ( m_owner->m_textureBackground) { if ( m_owner->m_textureBackground) {
if ( ! m_owner->m_backgroundBrush.Ok() ) { if ( ! m_owner->m_backgroundBrush.Ok() ) {
wxBrush b(wxColour(0,128,0), wxSOLID); wxColour clr(0,128,0);
wxBrush b(clr, wxSOLID);
dc.SetBackground(b); dc.SetBackground(b);
} }
} }

View File

@@ -198,7 +198,7 @@ void MyCanvas::OnChar( wxKeyEvent &event )
case WXK_RIGHT: m_text += wxT( "<RIGHT>" ); break; case WXK_RIGHT: m_text += wxT( "<RIGHT>" ); break;
case WXK_DOWN: m_text += wxT( "<DOWN>" ); break; case WXK_DOWN: m_text += wxT( "<DOWN>" ); break;
case WXK_RETURN: m_text += wxT( "<ENTER>" ); break; case WXK_RETURN: m_text += wxT( "<ENTER>" ); break;
default: m_text += event.m_keyCode; break; default: m_text += (wxChar)event.m_keyCode; break;
} }
} }

View File

@@ -32,8 +32,10 @@
#include "wx/splitter.h" #include "wx/splitter.h"
#include "wx/textfile.h" #include "wx/textfile.h"
#ifdef __WXMAC__
#undef wxFontDialog #undef wxFontDialog
#include "wx/mac/fontdlg.h" #include "wx/mac/fontdlg.h"
#endif
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// private classes // private classes
@@ -57,7 +59,7 @@ class MyCanvas: public wxWindow
{ {
public: public:
MyCanvas( wxWindow *parent ); MyCanvas( wxWindow *parent );
virtual ~MyCanvas(); virtual ~MyCanvas(){};
// accessors for the frame // accessors for the frame
const wxFont& GetTextFont() const { return m_font; } const wxFont& GetTextFont() const { return m_font; }
@@ -714,10 +716,6 @@ MyCanvas::MyCanvas( wxWindow *parent )
{ {
} }
MyCanvas::~MyCanvas()
{
}
void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) ) void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) )
{ {
wxPaintDC dc(this); wxPaintDC dc(this);
@@ -784,7 +782,7 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) )
{ {
for ( int j = 0; j < 32; j++ ) for ( int j = 0; j < 32; j++ )
{ {
wxChar c = 32 * (i + 1) + j; wxChar c = (wxChar)(32 * (i + 1) + j);
long charWidth, charHeight; long charWidth, charHeight;
dc.GetTextExtent(c, &charWidth, &charHeight); dc.GetTextExtent(c, &charWidth, &charHeight);

View File

@@ -722,7 +722,8 @@ void GridFrame::SetCellBgColour( wxCommandEvent& WXUNUSED(ev) )
{ {
// Check the new Refresh function by passing it a rectangle // Check the new Refresh function by passing it a rectangle
// which exactly fits the grid. // which exactly fits the grid.
wxRect r(wxPoint(0, 0), grid->GetSize()); wxPoint pt(0, 0);
wxRect r(pt, grid->GetSize());
grid->SetDefaultCellBackgroundColour(col); grid->SetDefaultCellBackgroundColour(col);
grid->Refresh(true, &r); grid->Refresh(true, &r);
} }
@@ -1349,10 +1350,6 @@ wxString BugsGridTable::GetColLabelValue( int col )
return headers[col]; return headers[col];
} }
BugsGridTable::BugsGridTable()
{
}
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// BugsGridFrame // BugsGridFrame
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@@ -232,7 +232,7 @@ private:
class BugsGridTable : public wxGridTableBase class BugsGridTable : public wxGridTableBase
{ {
public: public:
BugsGridTable(); BugsGridTable(){};
virtual int GetNumberRows(); virtual int GetNumberRows();
virtual int GetNumberCols(); virtual int GetNumberCols();

View File

@@ -203,7 +203,7 @@ public:
{ {
unsigned char *cmap = new unsigned char [256]; unsigned char *cmap = new unsigned char [256];
for ( int i = 0; i < 256; i++ ) for ( int i = 0; i < 256; i++ )
cmap[i] = i; cmap[i] = (unsigned char)i;
image.SetPalette(wxPalette(256, cmap, cmap, cmap)); image.SetPalette(wxPalette(256, cmap, cmap, cmap));
delete cmap; delete cmap;
@@ -549,7 +549,7 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id,
wxFile file(dir + _T("horse.bmp")); wxFile file(dir + _T("horse.bmp"));
if ( file.IsOpened() ) if ( file.IsOpened() )
{ {
off_t len = file.Length(); size_t len = (size_t)file.Length();
void *data = malloc(len); void *data = malloc(len);
if ( file.Read(data, len) != len ) if ( file.Read(data, len) != len )
wxLogError(_T("Reading bitmap file failed")); wxLogError(_T("Reading bitmap file failed"));
@@ -822,7 +822,7 @@ void MyCanvas::CreateAntiAliasedBitmap()
original.GetBlue( x*2, y*2+1 ) + original.GetBlue( x*2, y*2+1 ) +
original.GetBlue( x*2+1, y*2+1 ); original.GetBlue( x*2+1, y*2+1 );
blue = blue/4; blue = blue/4;
anti.SetRGB( x, y, red, green, blue ); anti.SetRGB( x, y, (unsigned char)red, (unsigned char)green, (unsigned char)blue );
} }
my_anti = new wxBitmap(anti); my_anti = new wxBitmap(anti);
} }

View File

@@ -251,15 +251,15 @@ void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
localeInfo.Printf(_("Language: %s\nSystem locale name:\n%s\nCanonical locale name: %s\n"), localeInfo.Printf(_("Language: %s\nSystem locale name:\n%s\nCanonical locale name: %s\n"),
locale.c_str(), sysname.c_str(), canname.c_str() ); locale.c_str(), sysname.c_str(), canname.c_str() );
wxMessageDialog wxMessageDialog dlg(
(
this, this,
wxString(_("I18n sample\n(c) 1998, 1999 Vadim Zeitlin and Julian Smart")) wxString(_("I18n sample\n(c) 1998, 1999 Vadim Zeitlin and Julian Smart"))
+ wxT("\n\n") + wxT("\n\n")
+ localeInfo, + localeInfo,
_("About Internat"), _("About Internat"),
wxOK | wxICON_INFORMATION wxOK | wxICON_INFORMATION
).ShowModal(); );
dlg.ShowModal();
} }
void MyFrame::OnPlay(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnPlay(wxCommandEvent& WXUNUSED(event))

View File

@@ -178,11 +178,6 @@ MyFrame::MyFrame(wxFrame *parent, const wxString& title, const wxPoint& pos,
canvas = new MyCanvas(this); canvas = new MyCanvas(this);
} }
MyFrame::~MyFrame()
{
// Empty
}
void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
{ {
Close(true); Close(true);

View File

@@ -45,7 +45,7 @@ public:
MyCanvas *canvas; MyCanvas *canvas;
MyFrame(wxFrame *parent, const wxString& title, MyFrame(wxFrame *parent, const wxString& title,
const wxPoint& pos, const wxSize& size, const long style); const wxPoint& pos, const wxSize& size, const long style);
~MyFrame(); ~MyFrame(){};
void OnActivate(wxActivateEvent& event); void OnActivate(wxActivateEvent& event);
void OnQuit(wxCommandEvent& event); void OnQuit(wxCommandEvent& event);

View File

@@ -37,10 +37,6 @@
IMPLEMENT_APP(MyApp) IMPLEMENT_APP(MyApp)
MyApp::MyApp()
{
}
bool MyApp::OnInit() bool MyApp::OnInit()
{ {
// Create the main frame window // Create the main frame window

View File

@@ -13,7 +13,7 @@
class MyApp: public wxApp class MyApp: public wxApp
{ {
public: public:
MyApp(); MyApp(){};
bool OnInit(); bool OnInit();
}; };

View File

@@ -88,10 +88,6 @@ void MyFrame::OnCloseWindow( wxCloseEvent &WXUNUSED(event) )
IMPLEMENT_APP(MyApp) IMPLEMENT_APP(MyApp)
MyApp::MyApp()
{
}
bool MyApp::OnInit() bool MyApp::OnInit()
{ {
wxInitAllImageHandlers(); wxInitAllImageHandlers();

View File

@@ -57,7 +57,7 @@ private:
class MyApp: public wxApp class MyApp: public wxApp
{ {
public: public:
MyApp(); MyApp(){};
virtual bool OnInit(); virtual bool OnInit();
virtual int OnExit(); virtual int OnExit();

View File

@@ -399,10 +399,6 @@ void MyFrame::OnCloseWindow( wxCloseEvent& WXUNUSED(event) )
IMPLEMENT_APP(MyApp) IMPLEMENT_APP(MyApp)
MyApp::MyApp()
{
}
bool MyApp::OnInit() bool MyApp::OnInit()
{ {
SetVendorName(_T("Free world")); SetVendorName(_T("Free world"));

View File

@@ -94,7 +94,7 @@ private:
class MyApp: public wxApp class MyApp: public wxApp
{ {
public: public:
MyApp(); MyApp(){};
virtual bool OnInit(); virtual bool OnInit();
virtual int OnExit(); virtual int OnExit();

View File

@@ -34,11 +34,6 @@
IMPLEMENT_APP(MyApp) IMPLEMENT_APP(MyApp)
// Testing of ressources
MyApp::MyApp()
{
}
bool MyApp::OnInit(void) bool MyApp::OnInit(void)
{ {
// Create the main frame window // Create the main frame window

View File

@@ -17,7 +17,7 @@
class MyApp: public wxApp class MyApp: public wxApp
{ {
public: public:
MyApp(void) ; MyApp(void){};
bool OnInit(void); bool OnInit(void);
}; };

View File

@@ -373,10 +373,6 @@ TestGLCanvas::TestGLCanvas(wxWindow *parent, wxWindowID id,
} }
TestGLCanvas::~TestGLCanvas()
{
}
void TestGLCanvas::OnPaint( wxPaintEvent& WXUNUSED(event) ) void TestGLCanvas::OnPaint( wxPaintEvent& WXUNUSED(event) )
{ {
// This is a dummy, to avoid an endless succession of paint messages. // This is a dummy, to avoid an endless succession of paint messages.

View File

@@ -29,7 +29,7 @@ public:
const wxSize& size = wxDefaultSize, long style = 0, const wxSize& size = wxDefaultSize, long style = 0,
const wxString& name = _T("TestGLCanvas"), int *gl_attrib = NULL); const wxString& name = _T("TestGLCanvas"), int *gl_attrib = NULL);
~TestGLCanvas(); ~TestGLCanvas(){};
void OnPaint(wxPaintEvent& event); void OnPaint(wxPaintEvent& event);
void OnSize(wxSizeEvent& event); void OnSize(wxSizeEvent& event);

View File

@@ -91,7 +91,7 @@ static int read_string(FILE *f, char *s)
do { do {
c = read_char(f); c = read_char(f);
if (cnt < LW_MAX_NAME_LEN) if (cnt < LW_MAX_NAME_LEN)
s[cnt] = c; s[cnt] = (char)c;
else else
s[LW_MAX_NAME_LEN-1] = 0; s[LW_MAX_NAME_LEN-1] = 0;
cnt++; cnt++;

View File

@@ -41,7 +41,7 @@ class OwnerDrawnFrame : public wxFrame
public: public:
// ctor & dtor // ctor & dtor
OwnerDrawnFrame(wxFrame *frame, wxChar *title, int x, int y, int w, int h); OwnerDrawnFrame(wxFrame *frame, wxChar *title, int x, int y, int w, int h);
~OwnerDrawnFrame(); ~OwnerDrawnFrame(){};
// notifications // notifications
void OnQuit (wxCommandEvent& event); void OnQuit (wxCommandEvent& event);
@@ -279,7 +279,7 @@ OwnerDrawnFrame::OwnerDrawnFrame(wxFrame *frame, wxChar *title,
#if defined(__WXMSW__) && !defined(__WXUNIVERSAL__) #if defined(__WXMSW__) && !defined(__WXUNIVERSAL__)
struct { unsigned int r, g, b; } aColors[] = struct { unsigned char r, g, b; } aColors[] =
{ {
{255,0,0}, {0,0,255}, {255,128,192}, {255,0,0}, {0,0,255}, {255,128,192},
{0,255,0}, {255,255,128}, {0,255,0}, {255,255,128},
@@ -307,10 +307,6 @@ OwnerDrawnFrame::OwnerDrawnFrame(wxFrame *frame, wxChar *title,
Show(true); Show(true);
} }
OwnerDrawnFrame::~OwnerDrawnFrame()
{
}
void OwnerDrawnFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) void OwnerDrawnFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
{ {
Close(true); Close(true);

View File

@@ -29,10 +29,6 @@ wxBitmap *g_TestBitmap = (wxBitmap *) NULL;
IMPLEMENT_APP(MyApp) IMPLEMENT_APP(MyApp)
MyApp::MyApp()
{
}
bool MyApp::OnInit(void) bool MyApp::OnInit(void)
{ {
wxImage::AddHandler(new wxPNGHandler); wxImage::AddHandler(new wxPNGHandler);
@@ -173,10 +169,6 @@ MyCanvas::MyCanvas(wxWindow *parent, const wxPoint& pos, const wxSize& size):
{ {
} }
MyCanvas::~MyCanvas(void)
{
}
// Define the repainting behaviour // Define the repainting behaviour
void MyCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) void MyCanvas::OnPaint(wxPaintEvent& WXUNUSED(event))
{ {

View File

@@ -19,7 +19,7 @@
class MyApp: public wxApp class MyApp: public wxApp
{ {
public: public:
MyApp(void) ; MyApp(void){};
bool OnInit(void); bool OnInit(void);
}; };
@@ -46,7 +46,7 @@ class MyCanvas: public wxScrolledWindow
{ {
public: public:
MyCanvas(wxWindow *parent, const wxPoint& pos, const wxSize& size); MyCanvas(wxWindow *parent, const wxPoint& pos, const wxSize& size);
~MyCanvas(void) ; ~MyCanvas(void){};
void OnPaint(wxPaintEvent& event); void OnPaint(wxPaintEvent& event);
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()

View File

@@ -66,10 +66,6 @@ IMPLEMENT_APP(MyApp)
// Writes a header on a page. Margin units are in millimetres. // Writes a header on a page. Margin units are in millimetres.
bool WritePageHeader(wxPrintout *printout, wxDC *dc, wxChar *text, float mmToLogical); bool WritePageHeader(wxPrintout *printout, wxDC *dc, wxChar *text, float mmToLogical);
MyApp::MyApp()
{
}
// The `main program' equivalent, creating the windows and returning the // The `main program' equivalent, creating the windows and returning the
// main frame // main frame
bool MyApp::OnInit(void) bool MyApp::OnInit(void)
@@ -340,10 +336,6 @@ MyCanvas::MyCanvas(wxFrame *frame, const wxPoint& pos, const wxSize& size, long
SetBackgroundColour(* wxWHITE); SetBackgroundColour(* wxWHITE);
} }
MyCanvas::~MyCanvas(void)
{
}
// Define the repainting behaviour // Define the repainting behaviour
void MyCanvas::OnDraw(wxDC& dc) void MyCanvas::OnDraw(wxDC& dc)
{ {

View File

@@ -17,7 +17,7 @@
class MyApp: public wxApp class MyApp: public wxApp
{ {
public: public:
MyApp() ; MyApp(){};
bool OnInit(); bool OnInit();
int OnExit(); int OnExit();
@@ -59,7 +59,7 @@ class MyCanvas: public wxScrolledWindow
{ {
public: public:
MyCanvas(wxFrame *frame, const wxPoint& pos, const wxSize& size, long style = wxRETAINED); MyCanvas(wxFrame *frame, const wxPoint& pos, const wxSize& size, long style = wxRETAINED);
~MyCanvas(void) ; ~MyCanvas(void){};
virtual void OnDraw(wxDC& dc); virtual void OnDraw(wxDC& dc);
void OnEvent(wxMouseEvent& event); void OnEvent(wxMouseEvent& event);

View File

@@ -735,11 +735,6 @@ wxLayoutLine::wxLayoutLine(wxLayoutLine *prev, wxLayoutList *llist)
llist->IncNumLines(); llist->IncNumLines();
} }
wxLayoutLine::~wxLayoutLine()
{
// kbList cleans itself
}
wxPoint wxPoint
wxLayoutLine::RecalculatePosition(wxLayoutList *llist) wxLayoutLine::RecalculatePosition(wxLayoutList *llist)
{ {
@@ -777,14 +772,15 @@ wxLayoutLine::FindObject(CoordType xpos, CoordType *offset) const
wxASSERT(offset); wxASSERT(offset);
wxLayoutObjectList::iterator wxLayoutObjectList::iterator
i, i,
found = NULLIT; found(NULL),
nulled(NULL);
CoordType x = 0, len; CoordType x = 0, len;
/* We search through the objects. As we don't like returning the /* We search through the objects. As we don't like returning the
object that the cursor is behind, we just remember such an object that the cursor is behind, we just remember such an
object in "found" so we can return it if there is really no object in "found" so we can return it if there is really no
further object following it. */ further object following it. */
for(i = m_ObjectList.begin(); i != NULLIT; i++) for(i = m_ObjectList.begin(); i != nulled; i++)
{ {
len = (**i).GetLength(); len = (**i).GetLength();
if( x <= xpos && xpos <= x + len ) if( x <= xpos && xpos <= x + len )
@@ -809,10 +805,10 @@ wxLayoutLine::FindObjectScreen(wxDC &dc, wxLayoutList *llist,
llist->ApplyStyle(GetStyleInfo(), dc); llist->ApplyStyle(GetStyleInfo(), dc);
wxLayoutObjectList::iterator i; wxLayoutObjectList::iterator i, nulled(NULL);
CoordType x = 0, cx = 0, width; CoordType x = 0, cx = 0, width;
for(i = m_ObjectList.begin(); i != NULLIT; i++) for(i = m_ObjectList.begin(); i != nulled; i++)
{ {
wxLayoutObject *obj = *i; wxLayoutObject *obj = *i;
if ( obj->GetType() == WXLO_TYPE_CMD ) if ( obj->GetType() == WXLO_TYPE_CMD )
@@ -883,7 +879,8 @@ wxLayoutLine::Insert(CoordType xpos, wxLayoutObject *obj)
CoordType offset; CoordType offset;
wxLOiterator i = FindObject(xpos, &offset); wxLOiterator i = FindObject(xpos, &offset);
if(i == NULLIT) wxLayoutObjectList::iterator nulled(NULL);
if(i == nulled)
{ {
if(xpos == 0 ) // aha, empty line! if(xpos == 0 ) // aha, empty line!
{ {
@@ -940,7 +937,8 @@ wxLayoutLine::Insert(CoordType xpos, const wxString& text)
CoordType offset; CoordType offset;
wxLOiterator i = FindObject(xpos, &offset); wxLOiterator i = FindObject(xpos, &offset);
if(i != NULLIT && (**i).GetType() == WXLO_TYPE_TEXT) wxLayoutObjectList::iterator nulled(NULL);
if(i != nulled && (**i).GetType() == WXLO_TYPE_TEXT)
{ {
wxLayoutObjectText *tobj = (wxLayoutObjectText *) *i; wxLayoutObjectText *tobj = (wxLayoutObjectText *) *i;
tobj->GetText().insert(offset, text); tobj->GetText().insert(offset, text);
@@ -964,9 +962,10 @@ wxLayoutLine::Delete(CoordType xpos, CoordType npos)
wxASSERT(npos >= 0); wxASSERT(npos >= 0);
MarkDirty(xpos); MarkDirty(xpos);
wxLOiterator i = FindObject(xpos, &offset); wxLOiterator i = FindObject(xpos, &offset);
wxLayoutObjectList::iterator nulled(NULL);
while(npos > 0) while(npos > 0)
{ {
if(i == NULLIT) return npos; if(i == nulled) return npos;
// now delete from that object: // now delete from that object:
if((**i).GetType() != WXLO_TYPE_TEXT) if((**i).GetType() != WXLO_TYPE_TEXT)
{ {
@@ -1020,10 +1019,10 @@ wxLayoutLine::DeleteWord(CoordType xpos)
MarkDirty(xpos); MarkDirty(xpos);
wxLOiterator i = FindObject(xpos, &offset); wxLOiterator i = FindObject(xpos, &offset);
wxLayoutObjectList::iterator nulled(NULL);
for(;;) for(;;)
{ {
if(i == NULLIT) return false; if(i == nulled) return false;
if((**i).GetType() != WXLO_TYPE_TEXT) if((**i).GetType() != WXLO_TYPE_TEXT)
{ {
// This should only happen when at end of line, behind a non-text // This should only happen when at end of line, behind a non-text
@@ -1094,7 +1093,7 @@ wxLayoutLine::Draw(wxDC &dc,
wxLayoutList *llist, wxLayoutList *llist,
const wxPoint & offset) const const wxPoint & offset) const
{ {
wxLayoutObjectList::iterator i; wxLayoutObjectList::iterator i, nulled(NULL);
wxPoint pos = offset; wxPoint pos = offset;
pos = pos + GetPosition(); pos = pos + GetPosition();
@@ -1111,7 +1110,7 @@ wxLayoutLine::Draw(wxDC &dc,
else else
llist->EndHighlighting(dc); llist->EndHighlighting(dc);
for(i = m_ObjectList.begin(); i != NULLIT; i++) for(i = m_ObjectList.begin(); i != nulled; i++)
{ {
if(highlight == -1) // partially highlight line if(highlight == -1) // partially highlight line
{ {
@@ -1142,7 +1141,7 @@ wxLayoutLine::Layout(wxDC &dc,
int cx, int cx,
bool WXUNUSED(suppressSIupdate)) bool WXUNUSED(suppressSIupdate))
{ {
wxLayoutObjectList::iterator i; wxLayoutObjectList::iterator i, nulled(NULL);
// when a line becomes dirty, we redraw it from the place where it was // when a line becomes dirty, we redraw it from the place where it was
// changed till the end of line (because the following wxLayoutObjects are // changed till the end of line (because the following wxLayoutObjects are
@@ -1177,7 +1176,7 @@ wxLayoutLine::Layout(wxDC &dc,
} }
m_StyleInfo = llist->GetStyleInfo(); // save current style m_StyleInfo = llist->GetStyleInfo(); // save current style
for(i = m_ObjectList.begin(); i != NULLIT; i++) for(i = m_ObjectList.begin(); i != nulled; i++)
{ {
wxLayoutObject *obj = *i; wxLayoutObject *obj = *i;
obj->Layout(dc, llist); obj->Layout(dc, llist);
@@ -1313,7 +1312,8 @@ wxLayoutLine::Break(CoordType xpos, wxLayoutList *llist)
CoordType offset; CoordType offset;
wxLOiterator i = FindObject(xpos, &offset); wxLOiterator i = FindObject(xpos, &offset);
if(i == NULLIT) wxLayoutObjectList::iterator nulled(NULL);
if(i == nulled)
// must be at the end of the line then // must be at the end of the line then
return new wxLayoutLine(this, llist); return new wxLayoutLine(this, llist);
// split this line: // split this line:
@@ -1356,18 +1356,19 @@ wxLayoutLine::Break(CoordType xpos, wxLayoutList *llist)
bool bool
wxLayoutLine::Wrap(CoordType wrapmargin, wxLayoutList *llist) wxLayoutLine::Wrap(CoordType wrapmargin, wxLayoutList *llist)
{ {
wxLayoutObjectList::iterator nulled(NULL);
if(GetLength() < wrapmargin) if(GetLength() < wrapmargin)
return false; // nothing to do return false; // nothing to do
// find the object which covers the wrapmargin: // find the object which covers the wrapmargin:
CoordType offset; CoordType offset;
wxLOiterator i = FindObject(wrapmargin, &offset); wxLOiterator i = FindObject(wrapmargin, &offset);
wxCHECK_MSG( i != NULLIT, false, wxCHECK_MSG( i != nulled, false,
wxT("Cannot find object covering wrapmargin.")); wxT("Cannot find object covering wrapmargin."));
// from this object on, the rest of the line must be copied to the // from this object on, the rest of the line must be copied to the
// next one: // next one:
wxLOiterator copyObject = NULLIT; wxLOiterator copyObject = nulled;
// if we split a text-object, we must pre-pend some text to the // if we split a text-object, we must pre-pend some text to the
// next line later on, remember it here: // next line later on, remember it here:
wxString prependText = _T(""); wxString prependText = _T("");
@@ -1390,7 +1391,7 @@ wxLayoutLine::Wrap(CoordType wrapmargin, wxLayoutList *llist)
bool foundSpace = false; bool foundSpace = false;
do do
{ {
// while(i != NULLIT && (**i).GetType() != WXLO_TYPE_TEXT) // while(i != nulled && (**i).GetType() != WXLO_TYPE_TEXT)
// i--; // i--;
// try to find a suitable place to split the object: // try to find a suitable place to split the object:
wxLayoutObjectText *tobj = (wxLayoutObjectText *)*i; wxLayoutObjectText *tobj = (wxLayoutObjectText *)*i;
@@ -1431,7 +1432,7 @@ wxLayoutLine::Wrap(CoordType wrapmargin, wxLayoutList *llist)
if( this == llist->GetCursorLine() && xpos >= breakpos ) if( this == llist->GetCursorLine() && xpos >= breakpos )
{ {
for(wxLOiterator j = m_ObjectList.begin(); for(wxLOiterator j = m_ObjectList.begin();
j != NULLIT && j != i; j++) j != nulled && j != i; j++)
objectCursorPos += (**j).GetLength(); objectCursorPos += (**j).GetLength();
} }
// now we know where to break it: // now we know where to break it:
@@ -1449,7 +1450,7 @@ wxLayoutLine::Wrap(CoordType wrapmargin, wxLayoutList *llist)
wxASSERT(m_Next); wxASSERT(m_Next);
// We need to move this and all following objects to the next // We need to move this and all following objects to the next
// line. Starting from the end of line, to keep the order right. // line. Starting from the end of line, to keep the order right.
if(copyObject != NULLIT) if(copyObject != nulled)
{ {
wxLOiterator j; wxLOiterator j;
for(j = m_ObjectList.tail(); j != copyObject; j--) for(j = m_ObjectList.tail(); j != copyObject; j--)
@@ -1558,7 +1559,8 @@ wxLayoutLine::GetWrapPosition(CoordType column)
{ {
CoordType offset; CoordType offset;
wxLOiterator i = FindObject(column, &offset); wxLOiterator i = FindObject(column, &offset);
if(i == NULLIT) return -1; // cannot wrap wxLayoutObjectList::iterator nulled(NULL);
if(i == nulled) return -1; // cannot wrap
// go backwards through the list and look for space in text objects // go backwards through the list and look for space in text objects
do do
@@ -1582,20 +1584,20 @@ wxLayoutLine::GetWrapPosition(CoordType column)
column -= (**i).GetLength(); column -= (**i).GetLength();
i--; i--;
} }
if( i != NULLIT) if( i != nulled)
offset = (**i).GetLength(); offset = (**i).GetLength();
}while(i != NULLIT); }while(i != nulled);
/* If we reached the begin of the list and have more than one /* If we reached the begin of the list and have more than one
object, that one is longer than the margin, so break behind object, that one is longer than the margin, so break behind
it. */ it. */
CoordType pos = 0; CoordType pos = 0;
i = m_ObjectList.begin(); i = m_ObjectList.begin();
while(i != NULLIT && (**i).GetType() != WXLO_TYPE_TEXT) while(i != nulled && (**i).GetType() != WXLO_TYPE_TEXT)
{ {
pos += (**i).GetLength(); pos += (**i).GetLength();
i++; i++;
} }
if(i == NULLIT) return -1; //why should this happen? if(i == nulled) return -1; //why should this happen?
// now we are behind the one long text object and need to find the // now we are behind the one long text object and need to find the
// first space in it // first space in it
@@ -1613,6 +1615,7 @@ wxLayoutLine::GetWrapPosition(CoordType column)
void void
wxLayoutLine::Debug() const wxLayoutLine::Debug() const
{ {
wxLayoutObjectList::iterator nulled(NULL);
wxPoint pos = GetPosition(); wxPoint pos = GetPosition();
WXLO_DEBUG((wxT("Line %ld, Pos (%ld,%ld), Height %ld, BL %ld, Font: %d"), WXLO_DEBUG((wxT("Line %ld, Pos (%ld,%ld), Height %ld, BL %ld, Font: %d"),
(long int) GetLineNumber(), (long int) GetLineNumber(),
@@ -1620,7 +1623,7 @@ wxLayoutLine::Debug() const
(long int) GetHeight(), (long int) GetHeight(),
(long int) m_BaseLine, (long int) m_BaseLine,
(int) m_StyleInfo.family)); (int) m_StyleInfo.family));
if(m_ObjectList.begin() != NULLIT) if(m_ObjectList.begin() != nulled)
{ {
WXLO_DEBUG(((**m_ObjectList.begin()).DebugDump().c_str())); WXLO_DEBUG(((**m_ObjectList.begin()).DebugDump().c_str()));
} }
@@ -1633,6 +1636,7 @@ wxLayoutLine::Copy(wxLayoutList *llist,
CoordType from, CoordType from,
CoordType to) CoordType to)
{ {
wxLayoutObjectList::iterator nulled(NULL);
CoordType firstOffset, lastOffset; CoordType firstOffset, lastOffset;
if(to == -1) to = GetLength(); if(to == -1) to = GetLength();
@@ -1642,7 +1646,7 @@ wxLayoutLine::Copy(wxLayoutList *llist,
wxLOiterator last = FindObject(to, &lastOffset); wxLOiterator last = FindObject(to, &lastOffset);
// Common special case: only one object // Common special case: only one object
if( first != NULLIT && last != NULLIT && *first == *last ) if( first != nulled && last != nulled && *first == *last )
{ {
if( (**first).GetType() == WXLO_TYPE_TEXT ) if( (**first).GetType() == WXLO_TYPE_TEXT )
{ {
@@ -2003,6 +2007,7 @@ wxLayoutList::MoveCursorHorizontally(int n)
bool bool
wxLayoutList::MoveCursorWord(int n, bool untilNext) wxLayoutList::MoveCursorWord(int n, bool untilNext)
{ {
wxLayoutObjectList::iterator nulled(NULL);
wxCHECK_MSG( m_CursorLine, false, wxT("no current line") ); wxCHECK_MSG( m_CursorLine, false, wxT("no current line") );
wxCHECK_MSG( n == -1 || n == +1, false, wxT("not implemented yet") ); wxCHECK_MSG( n == -1 || n == +1, false, wxT("not implemented yet") );
@@ -2013,7 +2018,7 @@ wxLayoutList::MoveCursorWord(int n, bool untilNext)
n != 0; n != 0;
n > 0 ? i++ : i-- ) n > 0 ? i++ : i-- )
{ {
if ( i == NULLIT ) if ( i == nulled )
{ {
if ( n > 0 ) if ( n > 0 )
{ {
@@ -2032,7 +2037,7 @@ wxLayoutList::MoveCursorWord(int n, bool untilNext)
i = lineCur->GetLastObject(); i = lineCur->GetLastObject();
} }
if ( i == NULLIT ) if ( i == nulled )
{ {
// moved to the end/beginning of text // moved to the end/beginning of text
return false; return false;
@@ -2209,6 +2214,7 @@ wxLayoutList::Insert(wxLayoutObject *obj)
bool bool
wxLayoutList::Insert(wxLayoutList *llist) wxLayoutList::Insert(wxLayoutList *llist)
{ {
wxLayoutObjectList::iterator nulled(NULL);
wxASSERT(llist); wxASSERT(llist);
bool rc = true; bool rc = true;
@@ -2218,7 +2224,7 @@ wxLayoutList::Insert(wxLayoutList *llist)
) )
{ {
for(wxLOiterator i = line->GetFirstObject(); for(wxLOiterator i = line->GetFirstObject();
i != NULLIT; i != nulled;
i++) i++)
rc |= Insert(*i); rc |= Insert(*i);
LineBreak(); LineBreak();
@@ -2596,6 +2602,7 @@ wxLayoutObject *
wxLayoutList::FindObjectScreen(wxDC &dc, wxPoint const pos, wxLayoutList::FindObjectScreen(wxDC &dc, wxPoint const pos,
wxPoint *cursorPos, bool *found) wxPoint *cursorPos, bool *found)
{ {
wxLayoutObjectList::iterator nulled(NULL);
// First, find the right line: // First, find the right line:
wxLayoutLine wxLayoutLine
*line = m_FirstLine, *line = m_FirstLine,
@@ -2646,7 +2653,7 @@ wxLayoutList::FindObjectScreen(wxDC &dc, wxPoint const pos,
if ( found ) if ( found )
*found = didFind && foundinline; *found = didFind && foundinline;
return (i == NULLIT) ? NULL : *i; return (i == nulled) ? NULL : *i;
} }
@@ -3208,10 +3215,6 @@ wxLayoutPrintout::wxLayoutPrintout(wxLayoutList *llist,
// layout is called in ScaleDC() when we have a DC // layout is called in ScaleDC() when we have a DC
} }
wxLayoutPrintout::~wxLayoutPrintout()
{
}
float float
wxLayoutPrintout::ScaleDC(wxDC *dc) wxLayoutPrintout::ScaleDC(wxDC *dc)
{ {

View File

@@ -260,9 +260,6 @@ protected:
/// Define a list type of wxLayoutObject pointers. /// Define a list type of wxLayoutObject pointers.
KBLIST_DEFINE(wxLayoutObjectList, wxLayoutObject); KBLIST_DEFINE(wxLayoutObjectList, wxLayoutObject);
/// An illegal iterator to save typing.
#define NULLIT (wxLayoutObjectList::iterator(NULL))
/// The iterator type. /// The iterator type.
typedef wxLayoutObjectList::iterator wxLOiterator; typedef wxLayoutObjectList::iterator wxLOiterator;
@@ -595,7 +592,7 @@ public:
@param xpos the column number @param xpos the column number
@param offset where to store the difference between xpos and @param offset where to store the difference between xpos and
the object's head the object's head
@return iterator to the object or NULLIT @return iterator to the object or iterator to NULL
*/ */
wxLayoutObjectList::iterator FindObject(CoordType xpos, CoordType wxLayoutObjectList::iterator FindObject(CoordType xpos, CoordType
*offset) const ; *offset) const ;
@@ -607,7 +604,7 @@ public:
@param xpos the screen x coordinate @param xpos the screen x coordinate
@param offset where to store the difference between xpos and @param offset where to store the difference between xpos and
the object's head the object's head
@return iterator to the object or NULLIT @return iterator to the object or iterator to NULL
*/ */
wxLayoutObjectList::iterator FindObjectScreen(wxDC &dc, wxLayoutObjectList::iterator FindObjectScreen(wxDC &dc,
wxLayoutList *llist, wxLayoutList *llist,
@@ -771,7 +768,7 @@ public:
private: private:
/// Destructor is private. Use DeleteLine() to remove it. /// Destructor is private. Use DeleteLine() to remove it.
~wxLayoutLine(); ~wxLayoutLine(){};
/**@name Functions to let the lines synchronise with each other. */ /**@name Functions to let the lines synchronise with each other. */
//@{ //@{
@@ -1412,7 +1409,7 @@ public:
_T("wxLayout Printout")); _T("wxLayout Printout"));
/// Destructor. /// Destructor.
~wxLayoutPrintout(); ~wxLayoutPrintout(){};
/** Function which prints the n-th page. /** Function which prints the n-th page.
@param page the page number to print @param page the page number to print

View File

@@ -180,10 +180,11 @@ wxLayoutExportStatus::wxLayoutExportStatus(wxLayoutList *list)
wxLayoutExportObject *wxLayoutExport(wxLayoutExportStatus *status, wxLayoutExportObject *wxLayoutExport(wxLayoutExportStatus *status,
int mode, int flags) int mode, int flags)
{ {
wxLayoutObjectList::iterator nulled(NULL);
wxASSERT(status); wxASSERT(status);
wxLayoutExportObject * exp; wxLayoutExportObject * exp;
if(status->m_iterator == NULLIT) // end of line if(status->m_iterator == nulled) // end of line
{ {
if(!status->m_line || status->m_line->GetNextLine() == NULL) if(!status->m_line || status->m_line->GetNextLine() == NULL)
// reached end of list // reached end of list
@@ -191,7 +192,7 @@ wxLayoutExportObject *wxLayoutExport(wxLayoutExportStatus *status,
} }
exp = new wxLayoutExportObject(); exp = new wxLayoutExportObject();
wxLayoutObjectType type; wxLayoutObjectType type;
if(status->m_iterator != NULLIT) if(status->m_iterator != nulled)
{ {
type = (** status->m_iterator).GetType(); type = (** status->m_iterator).GetType();
if( mode == WXLO_EXPORT_AS_OBJECTS || ! WXLO_IS_TEXT(type)) // simple case if( mode == WXLO_EXPORT_AS_OBJECTS || ! WXLO_IS_TEXT(type)) // simple case
@@ -203,7 +204,7 @@ wxLayoutExportObject *wxLayoutExport(wxLayoutExportStatus *status,
} }
} }
else else
{ // iterator == NULLIT { // iterator == nulled
if(mode == WXLO_EXPORT_AS_OBJECTS) if(mode == WXLO_EXPORT_AS_OBJECTS)
{ {
exp->type = WXLO_EXPORT_EMPTYLINE; exp->type = WXLO_EXPORT_EMPTYLINE;
@@ -222,7 +223,7 @@ wxLayoutExportObject *wxLayoutExport(wxLayoutExportStatus *status,
// text must be concatenated // text must be concatenated
for(;;) for(;;)
{ {
while(status->m_iterator == NULLIT) while(status->m_iterator == nulled)
{ {
if(mode & WXLO_EXPORT_AS_HTML) if(mode & WXLO_EXPORT_AS_HTML)
*str += _T("<br>"); *str += _T("<br>");

View File

@@ -37,7 +37,7 @@ class MyCanvas: public wxScrolledWindow
public: public:
MyCanvas() {} MyCanvas() {}
MyCanvas( wxWindow *parent, wxWindowID, const wxPoint &pos, const wxSize &size ); MyCanvas( wxWindow *parent, wxWindowID, const wxPoint &pos, const wxSize &size );
~MyCanvas(); ~MyCanvas(){};
void OnPaint( wxPaintEvent &event ); void OnPaint( wxPaintEvent &event );
void OnQueryPosition( wxCommandEvent &event ); void OnQueryPosition( wxCommandEvent &event );
void OnAddButton( wxCommandEvent &event ); void OnAddButton( wxCommandEvent &event );
@@ -272,10 +272,6 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id,
SetCursor( wxCursor( wxCURSOR_IBEAM ) ); SetCursor( wxCursor( wxCURSOR_IBEAM ) );
} }
MyCanvas::~MyCanvas()
{
}
void MyCanvas::OnMouseDown( wxMouseEvent &event ) void MyCanvas::OnMouseDown( wxMouseEvent &event )
{ {
if (event.LeftDown()) if (event.LeftDown())

View File

@@ -36,9 +36,9 @@ class MyApp;
class MyScrolledWindow: public wxScrolledWindow class MyScrolledWindow: public wxScrolledWindow
{ {
public: public:
MyScrolledWindow() {} MyScrolledWindow(){};
MyScrolledWindow( wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size ); MyScrolledWindow( wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size );
~MyScrolledWindow(); ~MyScrolledWindow(){};
void OnPaint( wxPaintEvent &event ); void OnPaint( wxPaintEvent &event );
private: private:
@@ -87,10 +87,10 @@ private:
class MyCanvas: public wxPanel class MyCanvas: public wxPanel
{ {
public: public:
MyCanvas() {} MyCanvas(){};
MyCanvas( wxScrolledWindow *parent, MyTopLabels *top, MyRightLabels *right, MyCanvas( wxScrolledWindow *parent, MyTopLabels *top, MyRightLabels *right,
wxWindowID id, const wxPoint &pos, const wxSize &size ); wxWindowID id, const wxPoint &pos, const wxSize &size );
~MyCanvas(); ~MyCanvas(){};
void OnPaint( wxPaintEvent &event ); void OnPaint( wxPaintEvent &event );
void ScrollWindow( int dx, int dy, const wxRect *rect ); void ScrollWindow( int dx, int dy, const wxRect *rect );
@@ -177,10 +177,6 @@ MyScrolledWindow::MyScrolledWindow( wxWindow *parent, wxWindowID id,
SetSizer( mainsizer ); SetSizer( mainsizer );
} }
MyScrolledWindow::~MyScrolledWindow()
{
}
void MyScrolledWindow::OnPaint( wxPaintEvent &WXUNUSED(event) ) void MyScrolledWindow::OnPaint( wxPaintEvent &WXUNUSED(event) )
{ {
wxPaintDC dc( this ); wxPaintDC dc( this );
@@ -296,10 +292,6 @@ MyCanvas::MyCanvas( wxScrolledWindow *parent, MyTopLabels *top, MyRightLabels *r
SetCursor( wxCursor( wxCURSOR_IBEAM ) ); SetCursor( wxCursor( wxCURSOR_IBEAM ) );
} }
MyCanvas::~MyCanvas()
{
}
void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) ) void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) )
{ {
wxPaintDC dc( this ); wxPaintDC dc( this );

View File

@@ -363,7 +363,7 @@ void MyFrame::OnTest1(wxCommandEvent& WXUNUSED(event))
m_sock->SetFlags(wxSOCKET_WAITALL); m_sock->SetFlags(wxSOCKET_WAITALL);
buf1 = _("Test string (less than 256 chars!)"); buf1 = _("Test string (less than 256 chars!)");
len = (wxStrlen(buf1) + 1) * sizeof(wxChar); len = (unsigned char)((wxStrlen(buf1) + 1) * sizeof(wxChar));
buf2 = new wxChar[wxStrlen(buf1) + 1]; buf2 = new wxChar[wxStrlen(buf1) + 1];
m_text->AppendText(_("Sending a test buffer to the server ...")); m_text->AppendText(_("Sending a test buffer to the server ..."));

View File

@@ -73,7 +73,7 @@ class MyFrame: public wxFrame
{ {
public: public:
MyFrame(); MyFrame();
virtual ~MyFrame(); virtual ~MyFrame(){};
// Menu commands // Menu commands
void SplitHorizontal(wxCommandEvent& event); void SplitHorizontal(wxCommandEvent& event);
@@ -121,7 +121,7 @@ class MyCanvas: public wxScrolledWindow
{ {
public: public:
MyCanvas(wxWindow* parent, bool mirror); MyCanvas(wxWindow* parent, bool mirror);
virtual ~MyCanvas(); virtual ~MyCanvas(){};
virtual void OnDraw(wxDC& dc); virtual void OnDraw(wxDC& dc);
@@ -242,10 +242,6 @@ MyFrame::MyFrame()
#endif // wxUSE_STATUSBAR #endif // wxUSE_STATUSBAR
} }
MyFrame::~MyFrame()
{
}
// menu command handlers // menu command handlers
void MyFrame::Quit(wxCommandEvent& WXUNUSED(event) ) void MyFrame::Quit(wxCommandEvent& WXUNUSED(event) )
@@ -419,10 +415,6 @@ MyCanvas::MyCanvas(wxWindow* parent, bool mirror)
m_mirror = mirror; m_mirror = mirror;
} }
MyCanvas::~MyCanvas()
{
}
void MyCanvas::OnDraw(wxDC& dcOrig) void MyCanvas::OnDraw(wxDC& dcOrig)
{ {
wxMirrorDC dc(dcOrig, m_mirror); wxMirrorDC dc(dcOrig, m_mirror);

View File

@@ -1568,7 +1568,7 @@ void RichTextFrame::OnChangeTextColour(wxCommandEvent& WXUNUSED(event))
data.SetChooseFull(true); data.SetChooseFull(true);
for (int i = 0; i < 16; i++) for (int i = 0; i < 16; i++)
{ {
wxColour colour(i*16, i*16, i*16); wxColour colour((unsigned char)(i*16), (unsigned char)(i*16), (unsigned char)(i*16));
data.SetCustomColour(i, colour); data.SetCustomColour(i, colour);
} }
@@ -1597,7 +1597,7 @@ void RichTextFrame::OnChangeBackgroundColour(wxCommandEvent& WXUNUSED(event))
data.SetChooseFull(true); data.SetChooseFull(true);
for (int i = 0; i < 16; i++) for (int i = 0; i < 16; i++)
{ {
wxColour colour(i*16, i*16, i*16); wxColour colour((unsigned char)(i*16), (unsigned char)(i*16), (unsigned char)(i*16));
data.SetCustomColour(i, colour); data.SetCustomColour(i, colour);
} }

View File

@@ -47,7 +47,7 @@ class MyApp : public wxApp
{ {
public: public:
MyApp(); MyApp();
virtual ~MyApp(); virtual ~MyApp(){};
virtual bool OnInit(); virtual bool OnInit();
@@ -358,10 +358,6 @@ MyApp::MyApp()
m_waitingUntilAllDone = false; m_waitingUntilAllDone = false;
} }
MyApp::~MyApp()
{
}
// `Main program' equivalent, creating windows and returning main app frame // `Main program' equivalent, creating windows and returning main app frame
bool MyApp::OnInit() bool MyApp::OnInit()
{ {

View File

@@ -758,10 +758,6 @@ void MyTreeCtrl::CreateButtonsImageList(int WXUNUSED(size))
#endif #endif
} }
MyTreeCtrl::~MyTreeCtrl()
{
}
int MyTreeCtrl::OnCompareItems(const wxTreeItemId& item1, int MyTreeCtrl::OnCompareItems(const wxTreeItemId& item1,
const wxTreeItemId& item2) const wxTreeItemId& item2)
{ {

View File

@@ -65,7 +65,7 @@ public:
MyTreeCtrl(wxWindow *parent, const wxWindowID id, MyTreeCtrl(wxWindow *parent, const wxWindowID id,
const wxPoint& pos, const wxSize& size, const wxPoint& pos, const wxSize& size,
long style); long style);
virtual ~MyTreeCtrl(); virtual ~MyTreeCtrl(){};
void OnBeginDrag(wxTreeEvent& event); void OnBeginDrag(wxTreeEvent& event);
void OnBeginRDrag(wxTreeEvent& event); void OnBeginRDrag(wxTreeEvent& event);

View File

@@ -71,6 +71,9 @@ BEGIN_EVENT_TABLE(MyApp, wxApp)
EVT_MENU(TYPES_MIME, MyApp::DoMIMEDemo) EVT_MENU(TYPES_MIME, MyApp::DoMIMEDemo)
END_EVENT_TABLE() END_EVENT_TABLE()
wxString file_name = _T("test_wx.dat");
wxString file_name2 = wxString(_T("test_wx2.dat"));
bool MyApp::OnInit() bool MyApp::OnInit()
{ {
// Create the main frame window // Create the main frame window
@@ -129,7 +132,7 @@ void MyApp::DoStreamDemo(wxCommandEvent& WXUNUSED(event))
textCtrl.WriteText( _T("Writing to ofstream and wxFileOutputStream:\n") ); textCtrl.WriteText( _T("Writing to ofstream and wxFileOutputStream:\n") );
wxSTD ofstream std_file_output( "test_std.dat" ); wxSTD ofstream std_file_output( "test_std.dat" );
wxFileOutputStream file_output( wxString(_T("test_wx.dat")) ); wxFileOutputStream file_output( file_name );
wxBufferedOutputStream buf_output( file_output ); wxBufferedOutputStream buf_output( file_output );
wxTextOutputStream text_output( buf_output ); wxTextOutputStream text_output( buf_output );
@@ -194,7 +197,7 @@ void MyApp::DoStreamDemo(wxCommandEvent& WXUNUSED(event))
buf_output.Sync(); buf_output.Sync();
wxFileInputStream file_input( wxString(_T("test_wx.dat")) ); wxFileInputStream file_input( file_name );
wxBufferedInputStream buf_input( file_input ); wxBufferedInputStream buf_input( file_input );
wxTextInputStream text_input( file_input ); wxTextInputStream text_input( file_input );
@@ -282,13 +285,13 @@ void MyApp::DoStreamDemo2(wxCommandEvent& WXUNUSED(event))
textCtrl.WriteText( _T("Writing number 0 to 9 to buffered wxFileOutputStream:\n\n") ); textCtrl.WriteText( _T("Writing number 0 to 9 to buffered wxFileOutputStream:\n\n") );
wxFileOutputStream file_output( wxString(_T("test_wx.dat")) ); wxFileOutputStream file_output( file_name );
wxBufferedOutputStream buf_output( file_output ); wxBufferedOutputStream buf_output( file_output );
for (ch = 0; ch < 10; ch++) for (ch = 0; ch < 10; ch++)
buf_output.Write( &ch, 1 ); buf_output.Write( &ch, 1 );
buf_output.Sync(); buf_output.Sync();
wxFileInputStream file_input( wxString(_T("test_wx.dat")) ); wxFileInputStream file_input( file_name );
for (ch2 = 0; ch2 < 10; ch2++) for (ch2 = 0; ch2 < 10; ch2++)
{ {
file_input.Read( &ch, 1 ); file_input.Read( &ch, 1 );
@@ -299,7 +302,7 @@ void MyApp::DoStreamDemo2(wxCommandEvent& WXUNUSED(event))
textCtrl.WriteText( _T("Writing number 0 to 9 to buffered wxFileOutputStream, then\n") ); textCtrl.WriteText( _T("Writing number 0 to 9 to buffered wxFileOutputStream, then\n") );
textCtrl.WriteText( _T("seeking back to #3 and writing 0:\n\n") ); textCtrl.WriteText( _T("seeking back to #3 and writing 0:\n\n") );
wxFileOutputStream file_output2( wxString(_T("test_wx2.dat")) ); wxFileOutputStream file_output2( file_name2 );
wxBufferedOutputStream buf_output2( file_output2 ); wxBufferedOutputStream buf_output2( file_output2 );
for (ch = 0; ch < 10; ch++) for (ch = 0; ch < 10; ch++)
buf_output2.Write( &ch, 1 ); buf_output2.Write( &ch, 1 );
@@ -308,7 +311,7 @@ void MyApp::DoStreamDemo2(wxCommandEvent& WXUNUSED(event))
buf_output2.Write( &ch, 1 ); buf_output2.Write( &ch, 1 );
buf_output2.Sync(); buf_output2.Sync();
wxFileInputStream file_input2( wxString(_T("test_wx2.dat")) ); wxFileInputStream file_input2( file_name2 );
for (ch2 = 0; ch2 < 10; ch2++) for (ch2 = 0; ch2 < 10; ch2++)
{ {
file_input2.Read( &ch, 1 ); file_input2.Read( &ch, 1 );
@@ -326,7 +329,7 @@ void MyApp::DoStreamDemo2(wxCommandEvent& WXUNUSED(event))
textCtrl.WriteText( _T("Reading number 0 to 9 from buffered wxFileInputStream, then\n") ); textCtrl.WriteText( _T("Reading number 0 to 9 from buffered wxFileInputStream, then\n") );
textCtrl.WriteText( _T("seeking back to #3 and reading the 0:\n\n") ); textCtrl.WriteText( _T("seeking back to #3 and reading the 0:\n\n") );
wxFileInputStream file_input3( wxString(_T("test_wx2.dat")) ); wxFileInputStream file_input3( file_name2 );
wxBufferedInputStream buf_input3( file_input3 ); wxBufferedInputStream buf_input3( file_input3 );
for (ch2 = 0; ch2 < 10; ch2++) for (ch2 = 0; ch2 < 10; ch2++)
{ {
@@ -354,7 +357,7 @@ void MyApp::DoStreamDemo3(wxCommandEvent& WXUNUSED(event))
textCtrl.WriteText( _T("Writing number 0 to 9 to wxFileOutputStream:\n\n") ); textCtrl.WriteText( _T("Writing number 0 to 9 to wxFileOutputStream:\n\n") );
wxFileOutputStream file_output( wxString(_T("test_wx.dat")) ); wxFileOutputStream file_output( file_name );
for (ch = 0; ch < 10; ch++) for (ch = 0; ch < 10; ch++)
file_output.Write( &ch, 1 ); file_output.Write( &ch, 1 );
@@ -362,7 +365,7 @@ void MyApp::DoStreamDemo3(wxCommandEvent& WXUNUSED(event))
textCtrl.WriteText( _T("Reading 0 to 10 to wxFileInputStream:\n\n") ); textCtrl.WriteText( _T("Reading 0 to 10 to wxFileInputStream:\n\n") );
wxFileInputStream file_input( wxString(_T("test_wx.dat")) ); wxFileInputStream file_input( file_name );
for (ch2 = 0; ch2 < 11; ch2++) for (ch2 = 0; ch2 < 11; ch2++)
{ {
file_input.Read( &ch, 1 ); file_input.Read( &ch, 1 );
@@ -411,7 +414,7 @@ void MyApp::DoStreamDemo3(wxCommandEvent& WXUNUSED(event))
textCtrl.WriteText( _T("Reading 0 to 10 to wxFFileInputStream:\n\n") ); textCtrl.WriteText( _T("Reading 0 to 10 to wxFFileInputStream:\n\n") );
wxFFileInputStream ffile_input( wxString(_T("test_wx.dat")) ); wxFFileInputStream ffile_input( file_name );
for (ch2 = 0; ch2 < 11; ch2++) for (ch2 = 0; ch2 < 11; ch2++)
{ {
ffile_input.Read( &ch, 1 ); ffile_input.Read( &ch, 1 );
@@ -459,7 +462,7 @@ void MyApp::DoStreamDemo3(wxCommandEvent& WXUNUSED(event))
textCtrl.WriteText( _T("Reading 0 to 10 to buffered wxFFileInputStream:\n\n") ); textCtrl.WriteText( _T("Reading 0 to 10 to buffered wxFFileInputStream:\n\n") );
wxFFileInputStream ffile_input2( wxString(_T("test_wx.dat")) ); wxFFileInputStream ffile_input2( file_name );
wxBufferedInputStream buf_input( ffile_input2 ); wxBufferedInputStream buf_input( ffile_input2 );
for (ch2 = 0; ch2 < 11; ch2++) for (ch2 = 0; ch2 < 11; ch2++)
{ {
@@ -516,7 +519,7 @@ void MyApp::DoStreamDemo4(wxCommandEvent& WXUNUSED(event))
// bigger than buffer // bigger than buffer
textCtrl.WriteText( _T("Writing 2000x 1 to wxFileOutputStream.\n\n") ); textCtrl.WriteText( _T("Writing 2000x 1 to wxFileOutputStream.\n\n") );
wxFileOutputStream file_output( wxString(_T("test_wx.dat")) ); wxFileOutputStream file_output( file_name );
for (int i = 0; i < 2000; i++) for (int i = 0; i < 2000; i++)
{ {
char ch = 1; char ch = 1;
@@ -525,7 +528,7 @@ void MyApp::DoStreamDemo4(wxCommandEvent& WXUNUSED(event))
textCtrl.WriteText( _T("Opening with a buffered wxFileInputStream:\n\n") ); textCtrl.WriteText( _T("Opening with a buffered wxFileInputStream:\n\n") );
wxFileInputStream file_input( wxString(_T("test_wx.dat")) ); wxFileInputStream file_input( file_name );
wxBufferedInputStream buf_input( file_input ); wxBufferedInputStream buf_input( file_input );
textCtrl.WriteText( _T("wxBufferedInputStream.GetLastError() returns: ") ); textCtrl.WriteText( _T("wxBufferedInputStream.GetLastError() returns: ") );
@@ -655,13 +658,13 @@ void MyApp::DoStreamDemo5(wxCommandEvent& WXUNUSED(event))
textCtrl.WriteText( _T("Writing number 0 to 9 to wxFileOutputStream:\n\n") ); textCtrl.WriteText( _T("Writing number 0 to 9 to wxFileOutputStream:\n\n") );
wxFileOutputStream file_output( wxString(_T("test_wx.dat")) ); wxFileOutputStream file_output( file_name );
for (ch = 0; ch < 10; ch++) for (ch = 0; ch < 10; ch++)
file_output.Write( &ch, 1 ); file_output.Write( &ch, 1 );
file_output.Sync(); file_output.Sync();
wxFileInputStream file_input( wxString(_T("test_wx.dat")) ); wxFileInputStream file_input( file_name );
ch = file_input.Peek(); ch = file_input.Peek();
str.Printf( wxT("First char peeked: %d\n"), (int) ch ); str.Printf( wxT("First char peeked: %d\n"), (int) ch );
@@ -730,7 +733,7 @@ void MyApp::DoStreamDemo6(wxCommandEvent& WXUNUSED(event))
textCtrl.WriteText( _T("Writing number 0 to 9 to wxFileOutputStream...\n\n") ); textCtrl.WriteText( _T("Writing number 0 to 9 to wxFileOutputStream...\n\n") );
wxFileOutputStream file_output( wxString(_T("test_wx.dat")) ); wxFileOutputStream file_output( file_name );
for (ch = 0; ch < 10; ch++) for (ch = 0; ch < 10; ch++)
file_output.Write( &ch, 1 ); file_output.Write( &ch, 1 );
@@ -738,52 +741,52 @@ void MyApp::DoStreamDemo6(wxCommandEvent& WXUNUSED(event))
textCtrl.WriteText( _T("Reading char from wxFileInputStream:\n\n") ); textCtrl.WriteText( _T("Reading char from wxFileInputStream:\n\n") );
wxFileInputStream file_input( wxString(_T("test_wx.dat")) ); wxFileInputStream file_input( file_name );
ch = file_input.GetC(); ch = file_input.GetC();
size_t pos = file_input.TellI(); size_t pos = (size_t)file_input.TellI();
str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos ); str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos );
textCtrl.WriteText( str ); textCtrl.WriteText( str );
textCtrl.WriteText( _T("Reading another char from wxFileInputStream:\n\n") ); textCtrl.WriteText( _T("Reading another char from wxFileInputStream:\n\n") );
ch = file_input.GetC(); ch = file_input.GetC();
pos = file_input.TellI(); pos = (size_t)file_input.TellI();
str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos ); str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos );
textCtrl.WriteText( str ); textCtrl.WriteText( str );
textCtrl.WriteText( _T("Reading yet another char from wxFileInputStream:\n\n") ); textCtrl.WriteText( _T("Reading yet another char from wxFileInputStream:\n\n") );
ch = file_input.GetC(); ch = file_input.GetC();
pos = file_input.TellI(); pos = (size_t)file_input.TellI();
str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos ); str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos );
textCtrl.WriteText( str ); textCtrl.WriteText( str );
textCtrl.WriteText( _T("Now calling Ungetch( 5 ) from wxFileInputStream...\n\n") ); textCtrl.WriteText( _T("Now calling Ungetch( 5 ) from wxFileInputStream...\n\n") );
file_input.Ungetch( 5 ); file_input.Ungetch( 5 );
pos = file_input.TellI(); pos = (size_t)file_input.TellI();
str.Printf( wxT("Now at position %d\n\n"), (int) pos ); str.Printf( wxT("Now at position %d\n\n"), (int) pos );
textCtrl.WriteText( str ); textCtrl.WriteText( str );
textCtrl.WriteText( _T("Reading char from wxFileInputStream:\n\n") ); textCtrl.WriteText( _T("Reading char from wxFileInputStream:\n\n") );
ch = file_input.GetC(); ch = file_input.GetC();
pos = file_input.TellI(); pos = (size_t)file_input.TellI();
str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos ); str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos );
textCtrl.WriteText( str ); textCtrl.WriteText( str );
textCtrl.WriteText( _T("Reading another char from wxFileInputStream:\n\n") ); textCtrl.WriteText( _T("Reading another char from wxFileInputStream:\n\n") );
ch = file_input.GetC(); ch = file_input.GetC();
pos = file_input.TellI(); pos = (size_t)file_input.TellI();
str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos ); str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos );
textCtrl.WriteText( str ); textCtrl.WriteText( str );
textCtrl.WriteText( _T("Now calling Ungetch( 5 ) from wxFileInputStream again...\n\n") ); textCtrl.WriteText( _T("Now calling Ungetch( 5 ) from wxFileInputStream again...\n\n") );
file_input.Ungetch( 5 ); file_input.Ungetch( 5 );
pos = file_input.TellI(); pos = (size_t)file_input.TellI();
str.Printf( wxT("Now at position %d\n\n"), (int) pos ); str.Printf( wxT("Now at position %d\n\n"), (int) pos );
textCtrl.WriteText( str ); textCtrl.WriteText( str );
@@ -792,7 +795,7 @@ void MyApp::DoStreamDemo6(wxCommandEvent& WXUNUSED(event))
file_input.SeekI( 3 ); file_input.SeekI( 3 );
ch = file_input.GetC(); ch = file_input.GetC();
pos = file_input.TellI(); pos = (size_t)file_input.TellI();
str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos ); str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos );
textCtrl.WriteText( str ); textCtrl.WriteText( str );
} }
@@ -809,7 +812,7 @@ void MyApp::DoStreamDemo7(wxCommandEvent& WXUNUSED(event))
textCtrl.WriteText( _T("Writing number 0 to 9 to wxFileOutputStream...\n\n") ); textCtrl.WriteText( _T("Writing number 0 to 9 to wxFileOutputStream...\n\n") );
wxFileOutputStream file_output( wxString(_T("test_wx.dat")) ); wxFileOutputStream file_output( file_name );
for (ch = 0; ch < 10; ch++) for (ch = 0; ch < 10; ch++)
file_output.Write( &ch, 1 ); file_output.Write( &ch, 1 );
@@ -817,53 +820,53 @@ void MyApp::DoStreamDemo7(wxCommandEvent& WXUNUSED(event))
textCtrl.WriteText( _T("Reading char from wxBufferedInputStream via wxFileInputStream:\n\n") ); textCtrl.WriteText( _T("Reading char from wxBufferedInputStream via wxFileInputStream:\n\n") );
wxFileInputStream file_input( wxString(_T("test_wx.dat")) ); wxFileInputStream file_input( file_name );
wxBufferedInputStream buf_input( file_input ); wxBufferedInputStream buf_input( file_input );
ch = buf_input.GetC(); ch = buf_input.GetC();
size_t pos = buf_input.TellI(); size_t pos = (size_t)buf_input.TellI();
str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos ); str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos );
textCtrl.WriteText( str ); textCtrl.WriteText( str );
textCtrl.WriteText( _T("Reading another char from wxBufferedInputStream:\n\n") ); textCtrl.WriteText( _T("Reading another char from wxBufferedInputStream:\n\n") );
ch = buf_input.GetC(); ch = buf_input.GetC();
pos = buf_input.TellI(); pos = (size_t)buf_input.TellI();
str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos ); str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos );
textCtrl.WriteText( str ); textCtrl.WriteText( str );
textCtrl.WriteText( _T("Reading yet another char from wxBufferedInputStream:\n\n") ); textCtrl.WriteText( _T("Reading yet another char from wxBufferedInputStream:\n\n") );
ch = buf_input.GetC(); ch = buf_input.GetC();
pos = buf_input.TellI(); pos = (size_t)buf_input.TellI();
str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos ); str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos );
textCtrl.WriteText( str ); textCtrl.WriteText( str );
textCtrl.WriteText( _T("Now calling Ungetch( 5 ) from wxBufferedInputStream...\n\n") ); textCtrl.WriteText( _T("Now calling Ungetch( 5 ) from wxBufferedInputStream...\n\n") );
buf_input.Ungetch( 5 ); buf_input.Ungetch( 5 );
pos = buf_input.TellI(); pos = (size_t)buf_input.TellI();
str.Printf( wxT("Now at position %d\n\n"), (int) pos ); str.Printf( wxT("Now at position %d\n\n"), (int) pos );
textCtrl.WriteText( str ); textCtrl.WriteText( str );
textCtrl.WriteText( _T("Reading char from wxBufferedInputStream:\n\n") ); textCtrl.WriteText( _T("Reading char from wxBufferedInputStream:\n\n") );
ch = buf_input.GetC(); ch = buf_input.GetC();
pos = buf_input.TellI(); pos = (size_t)buf_input.TellI();
str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos ); str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos );
textCtrl.WriteText( str ); textCtrl.WriteText( str );
textCtrl.WriteText( _T("Reading another char from wxBufferedInputStream:\n\n") ); textCtrl.WriteText( _T("Reading another char from wxBufferedInputStream:\n\n") );
ch = buf_input.GetC(); ch = buf_input.GetC();
pos = buf_input.TellI(); pos = (size_t)buf_input.TellI();
str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos ); str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos );
textCtrl.WriteText( str ); textCtrl.WriteText( str );
textCtrl.WriteText( _T("Now calling Ungetch( 5 ) from wxBufferedInputStream again...\n\n") ); textCtrl.WriteText( _T("Now calling Ungetch( 5 ) from wxBufferedInputStream again...\n\n") );
buf_input.Ungetch( 5 ); buf_input.Ungetch( 5 );
pos = buf_input.TellI(); pos = (size_t)buf_input.TellI();
str.Printf( wxT("Now at position %d\n\n"), (int) pos ); str.Printf( wxT("Now at position %d\n\n"), (int) pos );
textCtrl.WriteText( str ); textCtrl.WriteText( str );
@@ -872,7 +875,7 @@ void MyApp::DoStreamDemo7(wxCommandEvent& WXUNUSED(event))
buf_input.SeekI( 3 ); buf_input.SeekI( 3 );
ch = buf_input.GetC(); ch = buf_input.GetC();
pos = buf_input.TellI(); pos = (size_t)buf_input.TellI();
str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos ); str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos );
textCtrl.WriteText( str ); textCtrl.WriteText( str );
} }

View File

@@ -102,11 +102,6 @@ MyResizableListCtrl::MyResizableListCtrl( wxWindow *parent, wxWindowID id,
} }
MyResizableListCtrl::~MyResizableListCtrl()
{
}
void MyResizableListCtrl::ContextSensitiveMenu( wxMouseEvent& event ) void MyResizableListCtrl::ContextSensitiveMenu( wxMouseEvent& event )
{ {
// Make an instance of a menu. // Make an instance of a menu.

View File

@@ -69,7 +69,7 @@ public:
); );
// Destuctor. // Destuctor.
~MyResizableListCtrl(); ~MyResizableListCtrl(){};
protected: protected:

View File

@@ -64,11 +64,6 @@ PreferencesDialog::PreferencesDialog(wxWindow* parent)
wxXmlResource::Get()->LoadDialog(this, parent, wxT("derived_dialog")); wxXmlResource::Get()->LoadDialog(this, parent, wxT("derived_dialog"));
} }
// Destructor. (Empty, as I don't need anything special done when destructing).
PreferencesDialog::~PreferencesDialog()
{
}
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Private members (including the event handlers) // Private members (including the event handlers)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------

View File

@@ -45,7 +45,7 @@ public:
PreferencesDialog( wxWindow* parent ); PreferencesDialog( wxWindow* parent );
// Destructor. // Destructor.
~PreferencesDialog(); ~PreferencesDialog(){};
private: private: