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:
@@ -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.
|
||||
*/
|
||||
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())
|
||||
{
|
||||
// This is used to represent whether the database connection should be released
|
||||
@@ -1817,9 +1817,9 @@ bool CeditorDlg::GetData()
|
||||
|
||||
if (!invalid)
|
||||
{
|
||||
wxGetApp().Contact->JoinDate.month = mm;
|
||||
wxGetApp().Contact->JoinDate.day = dd;
|
||||
wxGetApp().Contact->JoinDate.year = yyyy;
|
||||
wxGetApp().Contact->JoinDate.month = (SQLUSMALLINT)mm;
|
||||
wxGetApp().Contact->JoinDate.day = (SQLUSMALLINT)dd;
|
||||
wxGetApp().Contact->JoinDate.year = (SQLSMALLINT)yyyy;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1836,7 +1836,7 @@ bool CeditorDlg::GetData()
|
||||
wxStrcpy(wxGetApp().Contact->Country,pCountryTxt->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->NativeLanguage = (enum Language) pNativeLangChoice->GetSelection();
|
||||
@@ -1870,7 +1870,7 @@ bool CeditorDlg::Save()
|
||||
|
||||
if (mode == mCreate)
|
||||
{
|
||||
RETCODE result = wxGetApp().Contact->Insert();
|
||||
RETCODE result = (RETCODE)wxGetApp().Contact->Insert();
|
||||
|
||||
failed = (result != DB_SUCCESS);
|
||||
if (failed)
|
||||
@@ -2363,11 +2363,6 @@ CqueryDlg::CqueryDlg(wxWindow *parent, wxDb *pDb, wxChar *tblName[],
|
||||
} // CqueryDlg() constructor
|
||||
|
||||
|
||||
CqueryDlg::~CqueryDlg()
|
||||
{
|
||||
} // CqueryDlg::~CqueryDlg() destructor
|
||||
|
||||
|
||||
void CqueryDlg::OnButton(wxCommandEvent &event)
|
||||
{
|
||||
wxWindow *win = (wxWindow*) event.GetEventObject();
|
||||
@@ -2712,7 +2707,7 @@ void CqueryDlg::ProcessCountBtn()
|
||||
|
||||
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,
|
||||
wxGetApp().DbConnectInf->GetDefaultDir());
|
||||
if (!dbTable)
|
||||
|
@@ -515,7 +515,7 @@ class CqueryDlg : public wxDialog
|
||||
wxTextCtrl *pFocusTxt;
|
||||
|
||||
CqueryDlg(wxWindow *parent, wxDb *pDb, wxChar *tblName[], const wxString &pWhereArg);
|
||||
~CqueryDlg();
|
||||
~CqueryDlg(){};
|
||||
|
||||
void OnButton( wxCommandEvent &event );
|
||||
void OnCommand(wxWindow& win, wxCommandEvent& event);
|
||||
|
@@ -131,7 +131,7 @@ const wxChar *GetExtendedDBErrorMsg2(wxDb *pDb, wxChar *ErrFile, int ErrLine)
|
||||
|
||||
// Clookup constructor
|
||||
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)
|
||||
{
|
||||
|
||||
@@ -143,7 +143,7 @@ Clookup::Clookup(wxChar *tblName, wxChar *colName, wxDb *pDb, const wxString &de
|
||||
// Clookup2 constructor
|
||||
Clookup2::Clookup2(wxChar *tblName, wxChar *colName1, wxChar *colName2,
|
||||
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)
|
||||
{
|
||||
wxASSERT(pDb);
|
||||
@@ -153,10 +153,10 @@ Clookup2::Clookup2(wxChar *tblName, wxChar *colName1, wxChar *colName2,
|
||||
|
||||
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)
|
||||
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()
|
||||
|
||||
|
@@ -473,10 +473,6 @@ DragShape::DragShape(const wxBitmap& bitmap)
|
||||
m_show = true;
|
||||
}
|
||||
|
||||
DragShape::~DragShape()
|
||||
{
|
||||
}
|
||||
|
||||
bool DragShape::HitTest(const wxPoint& pt) const
|
||||
{
|
||||
wxRect rect(GetRect());
|
||||
|
@@ -123,7 +123,7 @@ class DragShape: public wxObject
|
||||
{
|
||||
public:
|
||||
DragShape(const wxBitmap& bitmap);
|
||||
~DragShape();
|
||||
~DragShape(){};
|
||||
|
||||
//// Operations
|
||||
|
||||
|
@@ -674,11 +674,12 @@ void MyCanvas::DrawDefault(wxDC& dc)
|
||||
wxMemoryDC memdc2;
|
||||
memdc2.SelectObject(bitmap2);
|
||||
|
||||
wxBrush yellowBrush(wxColour(255, 255, 0), wxSOLID);
|
||||
wxColour clr(255, 255, 0);
|
||||
wxBrush yellowBrush(clr, wxSOLID);
|
||||
memdc2.SetBackground(yellowBrush);
|
||||
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
|
||||
// entirely eclipse the yellow background.
|
||||
@@ -951,7 +952,8 @@ void MyCanvas::OnPaint(wxPaintEvent &WXUNUSED(event))
|
||||
|
||||
if ( m_owner->m_textureBackground) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
@@ -198,7 +198,7 @@ void MyCanvas::OnChar( wxKeyEvent &event )
|
||||
case WXK_RIGHT: m_text += wxT( "<RIGHT>" ); break;
|
||||
case WXK_DOWN: m_text += wxT( "<DOWN>" ); break;
|
||||
case WXK_RETURN: m_text += wxT( "<ENTER>" ); break;
|
||||
default: m_text += event.m_keyCode; break;
|
||||
default: m_text += (wxChar)event.m_keyCode; break;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -32,8 +32,10 @@
|
||||
#include "wx/splitter.h"
|
||||
#include "wx/textfile.h"
|
||||
|
||||
#ifdef __WXMAC__
|
||||
#undef wxFontDialog
|
||||
#include "wx/mac/fontdlg.h"
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// private classes
|
||||
@@ -57,7 +59,7 @@ class MyCanvas: public wxWindow
|
||||
{
|
||||
public:
|
||||
MyCanvas( wxWindow *parent );
|
||||
virtual ~MyCanvas();
|
||||
virtual ~MyCanvas(){};
|
||||
|
||||
// accessors for the frame
|
||||
const wxFont& GetTextFont() const { return m_font; }
|
||||
@@ -714,10 +716,6 @@ MyCanvas::MyCanvas( wxWindow *parent )
|
||||
{
|
||||
}
|
||||
|
||||
MyCanvas::~MyCanvas()
|
||||
{
|
||||
}
|
||||
|
||||
void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) )
|
||||
{
|
||||
wxPaintDC dc(this);
|
||||
@@ -784,7 +782,7 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) )
|
||||
{
|
||||
for ( int j = 0; j < 32; j++ )
|
||||
{
|
||||
wxChar c = 32 * (i + 1) + j;
|
||||
wxChar c = (wxChar)(32 * (i + 1) + j);
|
||||
|
||||
long charWidth, charHeight;
|
||||
dc.GetTextExtent(c, &charWidth, &charHeight);
|
||||
|
@@ -722,7 +722,8 @@ void GridFrame::SetCellBgColour( wxCommandEvent& WXUNUSED(ev) )
|
||||
{
|
||||
// Check the new Refresh function by passing it a rectangle
|
||||
// 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->Refresh(true, &r);
|
||||
}
|
||||
@@ -1349,10 +1350,6 @@ wxString BugsGridTable::GetColLabelValue( int col )
|
||||
return headers[col];
|
||||
}
|
||||
|
||||
BugsGridTable::BugsGridTable()
|
||||
{
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// BugsGridFrame
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@@ -232,7 +232,7 @@ private:
|
||||
class BugsGridTable : public wxGridTableBase
|
||||
{
|
||||
public:
|
||||
BugsGridTable();
|
||||
BugsGridTable(){};
|
||||
|
||||
virtual int GetNumberRows();
|
||||
virtual int GetNumberCols();
|
||||
|
@@ -203,7 +203,7 @@ public:
|
||||
{
|
||||
unsigned char *cmap = new unsigned char [256];
|
||||
for ( int i = 0; i < 256; i++ )
|
||||
cmap[i] = i;
|
||||
cmap[i] = (unsigned char)i;
|
||||
image.SetPalette(wxPalette(256, cmap, cmap, cmap));
|
||||
|
||||
delete cmap;
|
||||
@@ -549,7 +549,7 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id,
|
||||
wxFile file(dir + _T("horse.bmp"));
|
||||
if ( file.IsOpened() )
|
||||
{
|
||||
off_t len = file.Length();
|
||||
size_t len = (size_t)file.Length();
|
||||
void *data = malloc(len);
|
||||
if ( file.Read(data, len) != len )
|
||||
wxLogError(_T("Reading bitmap file failed"));
|
||||
@@ -822,7 +822,7 @@ void MyCanvas::CreateAntiAliasedBitmap()
|
||||
original.GetBlue( x*2, y*2+1 ) +
|
||||
original.GetBlue( x*2+1, y*2+1 );
|
||||
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);
|
||||
}
|
||||
|
@@ -251,15 +251,15 @@ void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
|
||||
localeInfo.Printf(_("Language: %s\nSystem locale name:\n%s\nCanonical locale name: %s\n"),
|
||||
locale.c_str(), sysname.c_str(), canname.c_str() );
|
||||
|
||||
wxMessageDialog
|
||||
(
|
||||
wxMessageDialog dlg(
|
||||
this,
|
||||
wxString(_("I18n sample\n(c) 1998, 1999 Vadim Zeitlin and Julian Smart"))
|
||||
+ wxT("\n\n")
|
||||
+ localeInfo,
|
||||
_("About Internat"),
|
||||
wxOK | wxICON_INFORMATION
|
||||
).ShowModal();
|
||||
);
|
||||
dlg.ShowModal();
|
||||
}
|
||||
|
||||
void MyFrame::OnPlay(wxCommandEvent& WXUNUSED(event))
|
||||
|
@@ -178,11 +178,6 @@ MyFrame::MyFrame(wxFrame *parent, const wxString& title, const wxPoint& pos,
|
||||
canvas = new MyCanvas(this);
|
||||
}
|
||||
|
||||
MyFrame::~MyFrame()
|
||||
{
|
||||
// Empty
|
||||
}
|
||||
|
||||
void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
Close(true);
|
||||
|
@@ -45,7 +45,7 @@ public:
|
||||
MyCanvas *canvas;
|
||||
MyFrame(wxFrame *parent, const wxString& title,
|
||||
const wxPoint& pos, const wxSize& size, const long style);
|
||||
~MyFrame();
|
||||
~MyFrame(){};
|
||||
void OnActivate(wxActivateEvent& event);
|
||||
void OnQuit(wxCommandEvent& event);
|
||||
|
||||
|
@@ -37,10 +37,6 @@
|
||||
|
||||
IMPLEMENT_APP(MyApp)
|
||||
|
||||
MyApp::MyApp()
|
||||
{
|
||||
}
|
||||
|
||||
bool MyApp::OnInit()
|
||||
{
|
||||
// Create the main frame window
|
||||
|
@@ -13,7 +13,7 @@
|
||||
class MyApp: public wxApp
|
||||
{
|
||||
public:
|
||||
MyApp();
|
||||
MyApp(){};
|
||||
bool OnInit();
|
||||
};
|
||||
|
||||
|
@@ -88,10 +88,6 @@ void MyFrame::OnCloseWindow( wxCloseEvent &WXUNUSED(event) )
|
||||
|
||||
IMPLEMENT_APP(MyApp)
|
||||
|
||||
MyApp::MyApp()
|
||||
{
|
||||
}
|
||||
|
||||
bool MyApp::OnInit()
|
||||
{
|
||||
wxInitAllImageHandlers();
|
||||
|
@@ -57,7 +57,7 @@ private:
|
||||
class MyApp: public wxApp
|
||||
{
|
||||
public:
|
||||
MyApp();
|
||||
MyApp(){};
|
||||
|
||||
virtual bool OnInit();
|
||||
virtual int OnExit();
|
||||
|
@@ -399,10 +399,6 @@ void MyFrame::OnCloseWindow( wxCloseEvent& WXUNUSED(event) )
|
||||
|
||||
IMPLEMENT_APP(MyApp)
|
||||
|
||||
MyApp::MyApp()
|
||||
{
|
||||
}
|
||||
|
||||
bool MyApp::OnInit()
|
||||
{
|
||||
SetVendorName(_T("Free world"));
|
||||
|
@@ -94,7 +94,7 @@ private:
|
||||
class MyApp: public wxApp
|
||||
{
|
||||
public:
|
||||
MyApp();
|
||||
MyApp(){};
|
||||
|
||||
virtual bool OnInit();
|
||||
virtual int OnExit();
|
||||
|
@@ -34,11 +34,6 @@
|
||||
|
||||
IMPLEMENT_APP(MyApp)
|
||||
|
||||
// Testing of ressources
|
||||
MyApp::MyApp()
|
||||
{
|
||||
}
|
||||
|
||||
bool MyApp::OnInit(void)
|
||||
{
|
||||
// Create the main frame window
|
||||
|
@@ -17,7 +17,7 @@
|
||||
class MyApp: public wxApp
|
||||
{
|
||||
public:
|
||||
MyApp(void) ;
|
||||
MyApp(void){};
|
||||
bool OnInit(void);
|
||||
};
|
||||
|
||||
|
@@ -373,10 +373,6 @@ TestGLCanvas::TestGLCanvas(wxWindow *parent, wxWindowID id,
|
||||
}
|
||||
|
||||
|
||||
TestGLCanvas::~TestGLCanvas()
|
||||
{
|
||||
}
|
||||
|
||||
void TestGLCanvas::OnPaint( wxPaintEvent& WXUNUSED(event) )
|
||||
{
|
||||
// This is a dummy, to avoid an endless succession of paint messages.
|
||||
|
@@ -29,7 +29,7 @@ public:
|
||||
const wxSize& size = wxDefaultSize, long style = 0,
|
||||
const wxString& name = _T("TestGLCanvas"), int *gl_attrib = NULL);
|
||||
|
||||
~TestGLCanvas();
|
||||
~TestGLCanvas(){};
|
||||
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
void OnSize(wxSizeEvent& event);
|
||||
|
@@ -91,7 +91,7 @@ static int read_string(FILE *f, char *s)
|
||||
do {
|
||||
c = read_char(f);
|
||||
if (cnt < LW_MAX_NAME_LEN)
|
||||
s[cnt] = c;
|
||||
s[cnt] = (char)c;
|
||||
else
|
||||
s[LW_MAX_NAME_LEN-1] = 0;
|
||||
cnt++;
|
||||
|
@@ -41,7 +41,7 @@ class OwnerDrawnFrame : public wxFrame
|
||||
public:
|
||||
// ctor & dtor
|
||||
OwnerDrawnFrame(wxFrame *frame, wxChar *title, int x, int y, int w, int h);
|
||||
~OwnerDrawnFrame();
|
||||
~OwnerDrawnFrame(){};
|
||||
|
||||
// notifications
|
||||
void OnQuit (wxCommandEvent& event);
|
||||
@@ -279,7 +279,7 @@ OwnerDrawnFrame::OwnerDrawnFrame(wxFrame *frame, wxChar *title,
|
||||
|
||||
#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},
|
||||
{0,255,0}, {255,255,128},
|
||||
@@ -307,10 +307,6 @@ OwnerDrawnFrame::OwnerDrawnFrame(wxFrame *frame, wxChar *title,
|
||||
Show(true);
|
||||
}
|
||||
|
||||
OwnerDrawnFrame::~OwnerDrawnFrame()
|
||||
{
|
||||
}
|
||||
|
||||
void OwnerDrawnFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
Close(true);
|
||||
|
@@ -29,10 +29,6 @@ wxBitmap *g_TestBitmap = (wxBitmap *) NULL;
|
||||
|
||||
IMPLEMENT_APP(MyApp)
|
||||
|
||||
MyApp::MyApp()
|
||||
{
|
||||
}
|
||||
|
||||
bool MyApp::OnInit(void)
|
||||
{
|
||||
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
|
||||
void MyCanvas::OnPaint(wxPaintEvent& WXUNUSED(event))
|
||||
{
|
||||
|
@@ -19,7 +19,7 @@
|
||||
class MyApp: public wxApp
|
||||
{
|
||||
public:
|
||||
MyApp(void) ;
|
||||
MyApp(void){};
|
||||
bool OnInit(void);
|
||||
};
|
||||
|
||||
@@ -46,7 +46,7 @@ class MyCanvas: public wxScrolledWindow
|
||||
{
|
||||
public:
|
||||
MyCanvas(wxWindow *parent, const wxPoint& pos, const wxSize& size);
|
||||
~MyCanvas(void) ;
|
||||
~MyCanvas(void){};
|
||||
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
DECLARE_EVENT_TABLE()
|
||||
|
@@ -66,10 +66,6 @@ IMPLEMENT_APP(MyApp)
|
||||
// Writes a header on a page. Margin units are in millimetres.
|
||||
bool WritePageHeader(wxPrintout *printout, wxDC *dc, wxChar *text, float mmToLogical);
|
||||
|
||||
MyApp::MyApp()
|
||||
{
|
||||
}
|
||||
|
||||
// The `main program' equivalent, creating the windows and returning the
|
||||
// main frame
|
||||
bool MyApp::OnInit(void)
|
||||
@@ -340,10 +336,6 @@ MyCanvas::MyCanvas(wxFrame *frame, const wxPoint& pos, const wxSize& size, long
|
||||
SetBackgroundColour(* wxWHITE);
|
||||
}
|
||||
|
||||
MyCanvas::~MyCanvas(void)
|
||||
{
|
||||
}
|
||||
|
||||
// Define the repainting behaviour
|
||||
void MyCanvas::OnDraw(wxDC& dc)
|
||||
{
|
||||
|
@@ -17,7 +17,7 @@
|
||||
class MyApp: public wxApp
|
||||
{
|
||||
public:
|
||||
MyApp() ;
|
||||
MyApp(){};
|
||||
bool OnInit();
|
||||
int OnExit();
|
||||
|
||||
@@ -59,7 +59,7 @@ class MyCanvas: public wxScrolledWindow
|
||||
{
|
||||
public:
|
||||
MyCanvas(wxFrame *frame, const wxPoint& pos, const wxSize& size, long style = wxRETAINED);
|
||||
~MyCanvas(void) ;
|
||||
~MyCanvas(void){};
|
||||
|
||||
virtual void OnDraw(wxDC& dc);
|
||||
void OnEvent(wxMouseEvent& event);
|
||||
|
@@ -735,11 +735,6 @@ wxLayoutLine::wxLayoutLine(wxLayoutLine *prev, wxLayoutList *llist)
|
||||
llist->IncNumLines();
|
||||
}
|
||||
|
||||
wxLayoutLine::~wxLayoutLine()
|
||||
{
|
||||
// kbList cleans itself
|
||||
}
|
||||
|
||||
wxPoint
|
||||
wxLayoutLine::RecalculatePosition(wxLayoutList *llist)
|
||||
{
|
||||
@@ -777,14 +772,15 @@ wxLayoutLine::FindObject(CoordType xpos, CoordType *offset) const
|
||||
wxASSERT(offset);
|
||||
wxLayoutObjectList::iterator
|
||||
i,
|
||||
found = NULLIT;
|
||||
found(NULL),
|
||||
nulled(NULL);
|
||||
CoordType x = 0, len;
|
||||
|
||||
/* We search through the objects. As we don't like returning the
|
||||
object that the cursor is behind, we just remember such an
|
||||
object in "found" so we can return it if there is really no
|
||||
further object following it. */
|
||||
for(i = m_ObjectList.begin(); i != NULLIT; i++)
|
||||
for(i = m_ObjectList.begin(); i != nulled; i++)
|
||||
{
|
||||
len = (**i).GetLength();
|
||||
if( x <= xpos && xpos <= x + len )
|
||||
@@ -809,10 +805,10 @@ wxLayoutLine::FindObjectScreen(wxDC &dc, wxLayoutList *llist,
|
||||
|
||||
llist->ApplyStyle(GetStyleInfo(), dc);
|
||||
|
||||
wxLayoutObjectList::iterator i;
|
||||
wxLayoutObjectList::iterator i, nulled(NULL);
|
||||
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;
|
||||
if ( obj->GetType() == WXLO_TYPE_CMD )
|
||||
@@ -883,7 +879,8 @@ wxLayoutLine::Insert(CoordType xpos, wxLayoutObject *obj)
|
||||
|
||||
CoordType offset;
|
||||
wxLOiterator i = FindObject(xpos, &offset);
|
||||
if(i == NULLIT)
|
||||
wxLayoutObjectList::iterator nulled(NULL);
|
||||
if(i == nulled)
|
||||
{
|
||||
if(xpos == 0 ) // aha, empty line!
|
||||
{
|
||||
@@ -940,7 +937,8 @@ wxLayoutLine::Insert(CoordType xpos, const wxString& text)
|
||||
|
||||
CoordType 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;
|
||||
tobj->GetText().insert(offset, text);
|
||||
@@ -964,9 +962,10 @@ wxLayoutLine::Delete(CoordType xpos, CoordType npos)
|
||||
wxASSERT(npos >= 0);
|
||||
MarkDirty(xpos);
|
||||
wxLOiterator i = FindObject(xpos, &offset);
|
||||
wxLayoutObjectList::iterator nulled(NULL);
|
||||
while(npos > 0)
|
||||
{
|
||||
if(i == NULLIT) return npos;
|
||||
if(i == nulled) return npos;
|
||||
// now delete from that object:
|
||||
if((**i).GetType() != WXLO_TYPE_TEXT)
|
||||
{
|
||||
@@ -1020,10 +1019,10 @@ wxLayoutLine::DeleteWord(CoordType xpos)
|
||||
MarkDirty(xpos);
|
||||
|
||||
wxLOiterator i = FindObject(xpos, &offset);
|
||||
|
||||
wxLayoutObjectList::iterator nulled(NULL);
|
||||
for(;;)
|
||||
{
|
||||
if(i == NULLIT) return false;
|
||||
if(i == nulled) return false;
|
||||
if((**i).GetType() != WXLO_TYPE_TEXT)
|
||||
{
|
||||
// This should only happen when at end of line, behind a non-text
|
||||
@@ -1094,7 +1093,7 @@ wxLayoutLine::Draw(wxDC &dc,
|
||||
wxLayoutList *llist,
|
||||
const wxPoint & offset) const
|
||||
{
|
||||
wxLayoutObjectList::iterator i;
|
||||
wxLayoutObjectList::iterator i, nulled(NULL);
|
||||
wxPoint pos = offset;
|
||||
pos = pos + GetPosition();
|
||||
|
||||
@@ -1111,7 +1110,7 @@ wxLayoutLine::Draw(wxDC &dc,
|
||||
else
|
||||
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
|
||||
{
|
||||
@@ -1142,7 +1141,7 @@ wxLayoutLine::Layout(wxDC &dc,
|
||||
int cx,
|
||||
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
|
||||
// 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
|
||||
for(i = m_ObjectList.begin(); i != NULLIT; i++)
|
||||
for(i = m_ObjectList.begin(); i != nulled; i++)
|
||||
{
|
||||
wxLayoutObject *obj = *i;
|
||||
obj->Layout(dc, llist);
|
||||
@@ -1313,7 +1312,8 @@ wxLayoutLine::Break(CoordType xpos, wxLayoutList *llist)
|
||||
|
||||
CoordType 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
|
||||
return new wxLayoutLine(this, llist);
|
||||
// split this line:
|
||||
@@ -1356,18 +1356,19 @@ wxLayoutLine::Break(CoordType xpos, wxLayoutList *llist)
|
||||
bool
|
||||
wxLayoutLine::Wrap(CoordType wrapmargin, wxLayoutList *llist)
|
||||
{
|
||||
wxLayoutObjectList::iterator nulled(NULL);
|
||||
if(GetLength() < wrapmargin)
|
||||
return false; // nothing to do
|
||||
|
||||
// find the object which covers the wrapmargin:
|
||||
CoordType offset;
|
||||
wxLOiterator i = FindObject(wrapmargin, &offset);
|
||||
wxCHECK_MSG( i != NULLIT, false,
|
||||
wxCHECK_MSG( i != nulled, false,
|
||||
wxT("Cannot find object covering wrapmargin."));
|
||||
|
||||
// from this object on, the rest of the line must be copied to the
|
||||
// next one:
|
||||
wxLOiterator copyObject = NULLIT;
|
||||
wxLOiterator copyObject = nulled;
|
||||
// if we split a text-object, we must pre-pend some text to the
|
||||
// next line later on, remember it here:
|
||||
wxString prependText = _T("");
|
||||
@@ -1390,7 +1391,7 @@ wxLayoutLine::Wrap(CoordType wrapmargin, wxLayoutList *llist)
|
||||
bool foundSpace = false;
|
||||
do
|
||||
{
|
||||
// while(i != NULLIT && (**i).GetType() != WXLO_TYPE_TEXT)
|
||||
// while(i != nulled && (**i).GetType() != WXLO_TYPE_TEXT)
|
||||
// i--;
|
||||
// try to find a suitable place to split the object:
|
||||
wxLayoutObjectText *tobj = (wxLayoutObjectText *)*i;
|
||||
@@ -1431,7 +1432,7 @@ wxLayoutLine::Wrap(CoordType wrapmargin, wxLayoutList *llist)
|
||||
if( this == llist->GetCursorLine() && xpos >= breakpos )
|
||||
{
|
||||
for(wxLOiterator j = m_ObjectList.begin();
|
||||
j != NULLIT && j != i; j++)
|
||||
j != nulled && j != i; j++)
|
||||
objectCursorPos += (**j).GetLength();
|
||||
}
|
||||
// now we know where to break it:
|
||||
@@ -1449,7 +1450,7 @@ wxLayoutLine::Wrap(CoordType wrapmargin, wxLayoutList *llist)
|
||||
wxASSERT(m_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.
|
||||
if(copyObject != NULLIT)
|
||||
if(copyObject != nulled)
|
||||
{
|
||||
wxLOiterator j;
|
||||
for(j = m_ObjectList.tail(); j != copyObject; j--)
|
||||
@@ -1558,7 +1559,8 @@ wxLayoutLine::GetWrapPosition(CoordType column)
|
||||
{
|
||||
CoordType 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
|
||||
do
|
||||
@@ -1582,20 +1584,20 @@ wxLayoutLine::GetWrapPosition(CoordType column)
|
||||
column -= (**i).GetLength();
|
||||
i--;
|
||||
}
|
||||
if( i != NULLIT)
|
||||
if( i != nulled)
|
||||
offset = (**i).GetLength();
|
||||
}while(i != NULLIT);
|
||||
}while(i != nulled);
|
||||
/* If we reached the begin of the list and have more than one
|
||||
object, that one is longer than the margin, so break behind
|
||||
it. */
|
||||
CoordType pos = 0;
|
||||
i = m_ObjectList.begin();
|
||||
while(i != NULLIT && (**i).GetType() != WXLO_TYPE_TEXT)
|
||||
while(i != nulled && (**i).GetType() != WXLO_TYPE_TEXT)
|
||||
{
|
||||
pos += (**i).GetLength();
|
||||
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
|
||||
// first space in it
|
||||
@@ -1613,6 +1615,7 @@ wxLayoutLine::GetWrapPosition(CoordType column)
|
||||
void
|
||||
wxLayoutLine::Debug() const
|
||||
{
|
||||
wxLayoutObjectList::iterator nulled(NULL);
|
||||
wxPoint pos = GetPosition();
|
||||
WXLO_DEBUG((wxT("Line %ld, Pos (%ld,%ld), Height %ld, BL %ld, Font: %d"),
|
||||
(long int) GetLineNumber(),
|
||||
@@ -1620,7 +1623,7 @@ wxLayoutLine::Debug() const
|
||||
(long int) GetHeight(),
|
||||
(long int) m_BaseLine,
|
||||
(int) m_StyleInfo.family));
|
||||
if(m_ObjectList.begin() != NULLIT)
|
||||
if(m_ObjectList.begin() != nulled)
|
||||
{
|
||||
WXLO_DEBUG(((**m_ObjectList.begin()).DebugDump().c_str()));
|
||||
}
|
||||
@@ -1633,6 +1636,7 @@ wxLayoutLine::Copy(wxLayoutList *llist,
|
||||
CoordType from,
|
||||
CoordType to)
|
||||
{
|
||||
wxLayoutObjectList::iterator nulled(NULL);
|
||||
CoordType firstOffset, lastOffset;
|
||||
|
||||
if(to == -1) to = GetLength();
|
||||
@@ -1642,7 +1646,7 @@ wxLayoutLine::Copy(wxLayoutList *llist,
|
||||
wxLOiterator last = FindObject(to, &lastOffset);
|
||||
|
||||
// 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 )
|
||||
{
|
||||
@@ -2003,6 +2007,7 @@ wxLayoutList::MoveCursorHorizontally(int n)
|
||||
bool
|
||||
wxLayoutList::MoveCursorWord(int n, bool untilNext)
|
||||
{
|
||||
wxLayoutObjectList::iterator nulled(NULL);
|
||||
wxCHECK_MSG( m_CursorLine, false, wxT("no current line") );
|
||||
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 ? i++ : i-- )
|
||||
{
|
||||
if ( i == NULLIT )
|
||||
if ( i == nulled )
|
||||
{
|
||||
if ( n > 0 )
|
||||
{
|
||||
@@ -2032,7 +2037,7 @@ wxLayoutList::MoveCursorWord(int n, bool untilNext)
|
||||
i = lineCur->GetLastObject();
|
||||
}
|
||||
|
||||
if ( i == NULLIT )
|
||||
if ( i == nulled )
|
||||
{
|
||||
// moved to the end/beginning of text
|
||||
return false;
|
||||
@@ -2209,6 +2214,7 @@ wxLayoutList::Insert(wxLayoutObject *obj)
|
||||
bool
|
||||
wxLayoutList::Insert(wxLayoutList *llist)
|
||||
{
|
||||
wxLayoutObjectList::iterator nulled(NULL);
|
||||
wxASSERT(llist);
|
||||
bool rc = true;
|
||||
|
||||
@@ -2218,7 +2224,7 @@ wxLayoutList::Insert(wxLayoutList *llist)
|
||||
)
|
||||
{
|
||||
for(wxLOiterator i = line->GetFirstObject();
|
||||
i != NULLIT;
|
||||
i != nulled;
|
||||
i++)
|
||||
rc |= Insert(*i);
|
||||
LineBreak();
|
||||
@@ -2596,6 +2602,7 @@ wxLayoutObject *
|
||||
wxLayoutList::FindObjectScreen(wxDC &dc, wxPoint const pos,
|
||||
wxPoint *cursorPos, bool *found)
|
||||
{
|
||||
wxLayoutObjectList::iterator nulled(NULL);
|
||||
// First, find the right line:
|
||||
wxLayoutLine
|
||||
*line = m_FirstLine,
|
||||
@@ -2646,7 +2653,7 @@ wxLayoutList::FindObjectScreen(wxDC &dc, wxPoint const pos,
|
||||
if ( found )
|
||||
*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
|
||||
}
|
||||
|
||||
wxLayoutPrintout::~wxLayoutPrintout()
|
||||
{
|
||||
}
|
||||
|
||||
float
|
||||
wxLayoutPrintout::ScaleDC(wxDC *dc)
|
||||
{
|
||||
|
@@ -260,9 +260,6 @@ protected:
|
||||
/// Define a list type of wxLayoutObject pointers.
|
||||
KBLIST_DEFINE(wxLayoutObjectList, wxLayoutObject);
|
||||
|
||||
/// An illegal iterator to save typing.
|
||||
#define NULLIT (wxLayoutObjectList::iterator(NULL))
|
||||
|
||||
/// The iterator type.
|
||||
typedef wxLayoutObjectList::iterator wxLOiterator;
|
||||
|
||||
@@ -595,7 +592,7 @@ public:
|
||||
@param xpos the column number
|
||||
@param offset where to store the difference between xpos and
|
||||
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
|
||||
*offset) const ;
|
||||
@@ -607,7 +604,7 @@ public:
|
||||
@param xpos the screen x coordinate
|
||||
@param offset where to store the difference between xpos and
|
||||
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,
|
||||
wxLayoutList *llist,
|
||||
@@ -771,7 +768,7 @@ public:
|
||||
|
||||
private:
|
||||
/// Destructor is private. Use DeleteLine() to remove it.
|
||||
~wxLayoutLine();
|
||||
~wxLayoutLine(){};
|
||||
|
||||
/**@name Functions to let the lines synchronise with each other. */
|
||||
//@{
|
||||
@@ -1412,7 +1409,7 @@ public:
|
||||
_T("wxLayout Printout"));
|
||||
|
||||
/// Destructor.
|
||||
~wxLayoutPrintout();
|
||||
~wxLayoutPrintout(){};
|
||||
|
||||
/** Function which prints the n-th page.
|
||||
@param page the page number to print
|
||||
|
@@ -180,10 +180,11 @@ wxLayoutExportStatus::wxLayoutExportStatus(wxLayoutList *list)
|
||||
wxLayoutExportObject *wxLayoutExport(wxLayoutExportStatus *status,
|
||||
int mode, int flags)
|
||||
{
|
||||
wxLayoutObjectList::iterator nulled(NULL);
|
||||
wxASSERT(status);
|
||||
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)
|
||||
// reached end of list
|
||||
@@ -191,7 +192,7 @@ wxLayoutExportObject *wxLayoutExport(wxLayoutExportStatus *status,
|
||||
}
|
||||
exp = new wxLayoutExportObject();
|
||||
wxLayoutObjectType type;
|
||||
if(status->m_iterator != NULLIT)
|
||||
if(status->m_iterator != nulled)
|
||||
{
|
||||
type = (** status->m_iterator).GetType();
|
||||
if( mode == WXLO_EXPORT_AS_OBJECTS || ! WXLO_IS_TEXT(type)) // simple case
|
||||
@@ -203,7 +204,7 @@ wxLayoutExportObject *wxLayoutExport(wxLayoutExportStatus *status,
|
||||
}
|
||||
}
|
||||
else
|
||||
{ // iterator == NULLIT
|
||||
{ // iterator == nulled
|
||||
if(mode == WXLO_EXPORT_AS_OBJECTS)
|
||||
{
|
||||
exp->type = WXLO_EXPORT_EMPTYLINE;
|
||||
@@ -222,7 +223,7 @@ wxLayoutExportObject *wxLayoutExport(wxLayoutExportStatus *status,
|
||||
// text must be concatenated
|
||||
for(;;)
|
||||
{
|
||||
while(status->m_iterator == NULLIT)
|
||||
while(status->m_iterator == nulled)
|
||||
{
|
||||
if(mode & WXLO_EXPORT_AS_HTML)
|
||||
*str += _T("<br>");
|
||||
|
@@ -37,7 +37,7 @@ class MyCanvas: public wxScrolledWindow
|
||||
public:
|
||||
MyCanvas() {}
|
||||
MyCanvas( wxWindow *parent, wxWindowID, const wxPoint &pos, const wxSize &size );
|
||||
~MyCanvas();
|
||||
~MyCanvas(){};
|
||||
void OnPaint( wxPaintEvent &event );
|
||||
void OnQueryPosition( wxCommandEvent &event );
|
||||
void OnAddButton( wxCommandEvent &event );
|
||||
@@ -272,10 +272,6 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id,
|
||||
SetCursor( wxCursor( wxCURSOR_IBEAM ) );
|
||||
}
|
||||
|
||||
MyCanvas::~MyCanvas()
|
||||
{
|
||||
}
|
||||
|
||||
void MyCanvas::OnMouseDown( wxMouseEvent &event )
|
||||
{
|
||||
if (event.LeftDown())
|
||||
|
@@ -36,9 +36,9 @@ class MyApp;
|
||||
class MyScrolledWindow: public wxScrolledWindow
|
||||
{
|
||||
public:
|
||||
MyScrolledWindow() {}
|
||||
MyScrolledWindow(){};
|
||||
MyScrolledWindow( wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size );
|
||||
~MyScrolledWindow();
|
||||
~MyScrolledWindow(){};
|
||||
void OnPaint( wxPaintEvent &event );
|
||||
|
||||
private:
|
||||
@@ -87,10 +87,10 @@ private:
|
||||
class MyCanvas: public wxPanel
|
||||
{
|
||||
public:
|
||||
MyCanvas() {}
|
||||
MyCanvas(){};
|
||||
MyCanvas( wxScrolledWindow *parent, MyTopLabels *top, MyRightLabels *right,
|
||||
wxWindowID id, const wxPoint &pos, const wxSize &size );
|
||||
~MyCanvas();
|
||||
~MyCanvas(){};
|
||||
void OnPaint( wxPaintEvent &event );
|
||||
void ScrollWindow( int dx, int dy, const wxRect *rect );
|
||||
|
||||
@@ -177,10 +177,6 @@ MyScrolledWindow::MyScrolledWindow( wxWindow *parent, wxWindowID id,
|
||||
SetSizer( mainsizer );
|
||||
}
|
||||
|
||||
MyScrolledWindow::~MyScrolledWindow()
|
||||
{
|
||||
}
|
||||
|
||||
void MyScrolledWindow::OnPaint( wxPaintEvent &WXUNUSED(event) )
|
||||
{
|
||||
wxPaintDC dc( this );
|
||||
@@ -296,10 +292,6 @@ MyCanvas::MyCanvas( wxScrolledWindow *parent, MyTopLabels *top, MyRightLabels *r
|
||||
SetCursor( wxCursor( wxCURSOR_IBEAM ) );
|
||||
}
|
||||
|
||||
MyCanvas::~MyCanvas()
|
||||
{
|
||||
}
|
||||
|
||||
void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) )
|
||||
{
|
||||
wxPaintDC dc( this );
|
||||
|
@@ -363,7 +363,7 @@ void MyFrame::OnTest1(wxCommandEvent& WXUNUSED(event))
|
||||
m_sock->SetFlags(wxSOCKET_WAITALL);
|
||||
|
||||
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];
|
||||
|
||||
m_text->AppendText(_("Sending a test buffer to the server ..."));
|
||||
|
@@ -73,7 +73,7 @@ class MyFrame: public wxFrame
|
||||
{
|
||||
public:
|
||||
MyFrame();
|
||||
virtual ~MyFrame();
|
||||
virtual ~MyFrame(){};
|
||||
|
||||
// Menu commands
|
||||
void SplitHorizontal(wxCommandEvent& event);
|
||||
@@ -121,7 +121,7 @@ class MyCanvas: public wxScrolledWindow
|
||||
{
|
||||
public:
|
||||
MyCanvas(wxWindow* parent, bool mirror);
|
||||
virtual ~MyCanvas();
|
||||
virtual ~MyCanvas(){};
|
||||
|
||||
virtual void OnDraw(wxDC& dc);
|
||||
|
||||
@@ -242,10 +242,6 @@ MyFrame::MyFrame()
|
||||
#endif // wxUSE_STATUSBAR
|
||||
}
|
||||
|
||||
MyFrame::~MyFrame()
|
||||
{
|
||||
}
|
||||
|
||||
// menu command handlers
|
||||
|
||||
void MyFrame::Quit(wxCommandEvent& WXUNUSED(event) )
|
||||
@@ -419,10 +415,6 @@ MyCanvas::MyCanvas(wxWindow* parent, bool mirror)
|
||||
m_mirror = mirror;
|
||||
}
|
||||
|
||||
MyCanvas::~MyCanvas()
|
||||
{
|
||||
}
|
||||
|
||||
void MyCanvas::OnDraw(wxDC& dcOrig)
|
||||
{
|
||||
wxMirrorDC dc(dcOrig, m_mirror);
|
||||
|
@@ -1568,7 +1568,7 @@ void RichTextFrame::OnChangeTextColour(wxCommandEvent& WXUNUSED(event))
|
||||
data.SetChooseFull(true);
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -1597,7 +1597,7 @@ void RichTextFrame::OnChangeBackgroundColour(wxCommandEvent& WXUNUSED(event))
|
||||
data.SetChooseFull(true);
|
||||
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);
|
||||
}
|
||||
|
||||
|
@@ -47,7 +47,7 @@ class MyApp : public wxApp
|
||||
{
|
||||
public:
|
||||
MyApp();
|
||||
virtual ~MyApp();
|
||||
virtual ~MyApp(){};
|
||||
|
||||
virtual bool OnInit();
|
||||
|
||||
@@ -358,10 +358,6 @@ MyApp::MyApp()
|
||||
m_waitingUntilAllDone = false;
|
||||
}
|
||||
|
||||
MyApp::~MyApp()
|
||||
{
|
||||
}
|
||||
|
||||
// `Main program' equivalent, creating windows and returning main app frame
|
||||
bool MyApp::OnInit()
|
||||
{
|
||||
|
@@ -758,10 +758,6 @@ void MyTreeCtrl::CreateButtonsImageList(int WXUNUSED(size))
|
||||
#endif
|
||||
}
|
||||
|
||||
MyTreeCtrl::~MyTreeCtrl()
|
||||
{
|
||||
}
|
||||
|
||||
int MyTreeCtrl::OnCompareItems(const wxTreeItemId& item1,
|
||||
const wxTreeItemId& item2)
|
||||
{
|
||||
|
@@ -65,7 +65,7 @@ public:
|
||||
MyTreeCtrl(wxWindow *parent, const wxWindowID id,
|
||||
const wxPoint& pos, const wxSize& size,
|
||||
long style);
|
||||
virtual ~MyTreeCtrl();
|
||||
virtual ~MyTreeCtrl(){};
|
||||
|
||||
void OnBeginDrag(wxTreeEvent& event);
|
||||
void OnBeginRDrag(wxTreeEvent& event);
|
||||
|
@@ -71,6 +71,9 @@ BEGIN_EVENT_TABLE(MyApp, wxApp)
|
||||
EVT_MENU(TYPES_MIME, MyApp::DoMIMEDemo)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
wxString file_name = _T("test_wx.dat");
|
||||
wxString file_name2 = wxString(_T("test_wx2.dat"));
|
||||
|
||||
bool MyApp::OnInit()
|
||||
{
|
||||
// Create the main frame window
|
||||
@@ -129,7 +132,7 @@ void MyApp::DoStreamDemo(wxCommandEvent& WXUNUSED(event))
|
||||
textCtrl.WriteText( _T("Writing to ofstream and wxFileOutputStream:\n") );
|
||||
|
||||
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 );
|
||||
wxTextOutputStream text_output( buf_output );
|
||||
|
||||
@@ -194,7 +197,7 @@ void MyApp::DoStreamDemo(wxCommandEvent& WXUNUSED(event))
|
||||
|
||||
buf_output.Sync();
|
||||
|
||||
wxFileInputStream file_input( wxString(_T("test_wx.dat")) );
|
||||
wxFileInputStream file_input( file_name );
|
||||
wxBufferedInputStream buf_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") );
|
||||
|
||||
wxFileOutputStream file_output( wxString(_T("test_wx.dat")) );
|
||||
wxFileOutputStream file_output( file_name );
|
||||
wxBufferedOutputStream buf_output( file_output );
|
||||
for (ch = 0; ch < 10; ch++)
|
||||
buf_output.Write( &ch, 1 );
|
||||
buf_output.Sync();
|
||||
|
||||
wxFileInputStream file_input( wxString(_T("test_wx.dat")) );
|
||||
wxFileInputStream file_input( file_name );
|
||||
for (ch2 = 0; ch2 < 10; ch2++)
|
||||
{
|
||||
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("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 );
|
||||
for (ch = 0; ch < 10; ch++)
|
||||
buf_output2.Write( &ch, 1 );
|
||||
@@ -308,7 +311,7 @@ void MyApp::DoStreamDemo2(wxCommandEvent& WXUNUSED(event))
|
||||
buf_output2.Write( &ch, 1 );
|
||||
buf_output2.Sync();
|
||||
|
||||
wxFileInputStream file_input2( wxString(_T("test_wx2.dat")) );
|
||||
wxFileInputStream file_input2( file_name2 );
|
||||
for (ch2 = 0; ch2 < 10; ch2++)
|
||||
{
|
||||
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("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 );
|
||||
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") );
|
||||
|
||||
wxFileOutputStream file_output( wxString(_T("test_wx.dat")) );
|
||||
wxFileOutputStream file_output( file_name );
|
||||
for (ch = 0; ch < 10; ch++)
|
||||
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") );
|
||||
|
||||
wxFileInputStream file_input( wxString(_T("test_wx.dat")) );
|
||||
wxFileInputStream file_input( file_name );
|
||||
for (ch2 = 0; ch2 < 11; ch2++)
|
||||
{
|
||||
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") );
|
||||
|
||||
wxFFileInputStream ffile_input( wxString(_T("test_wx.dat")) );
|
||||
wxFFileInputStream ffile_input( file_name );
|
||||
for (ch2 = 0; ch2 < 11; ch2++)
|
||||
{
|
||||
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") );
|
||||
|
||||
wxFFileInputStream ffile_input2( wxString(_T("test_wx.dat")) );
|
||||
wxFFileInputStream ffile_input2( file_name );
|
||||
wxBufferedInputStream buf_input( ffile_input2 );
|
||||
for (ch2 = 0; ch2 < 11; ch2++)
|
||||
{
|
||||
@@ -516,7 +519,7 @@ void MyApp::DoStreamDemo4(wxCommandEvent& WXUNUSED(event))
|
||||
// bigger than buffer
|
||||
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++)
|
||||
{
|
||||
char ch = 1;
|
||||
@@ -525,7 +528,7 @@ void MyApp::DoStreamDemo4(wxCommandEvent& WXUNUSED(event))
|
||||
|
||||
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 );
|
||||
|
||||
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") );
|
||||
|
||||
wxFileOutputStream file_output( wxString(_T("test_wx.dat")) );
|
||||
wxFileOutputStream file_output( file_name );
|
||||
for (ch = 0; ch < 10; ch++)
|
||||
file_output.Write( &ch, 1 );
|
||||
|
||||
file_output.Sync();
|
||||
|
||||
wxFileInputStream file_input( wxString(_T("test_wx.dat")) );
|
||||
wxFileInputStream file_input( file_name );
|
||||
|
||||
ch = file_input.Peek();
|
||||
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") );
|
||||
|
||||
wxFileOutputStream file_output( wxString(_T("test_wx.dat")) );
|
||||
wxFileOutputStream file_output( file_name );
|
||||
for (ch = 0; ch < 10; ch++)
|
||||
file_output.Write( &ch, 1 );
|
||||
|
||||
@@ -738,52 +741,52 @@ void MyApp::DoStreamDemo6(wxCommandEvent& WXUNUSED(event))
|
||||
|
||||
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();
|
||||
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 );
|
||||
textCtrl.WriteText( str );
|
||||
|
||||
textCtrl.WriteText( _T("Reading another char from wxFileInputStream:\n\n") );
|
||||
|
||||
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 );
|
||||
textCtrl.WriteText( str );
|
||||
|
||||
textCtrl.WriteText( _T("Reading yet another char from wxFileInputStream:\n\n") );
|
||||
|
||||
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 );
|
||||
textCtrl.WriteText( str );
|
||||
|
||||
textCtrl.WriteText( _T("Now calling Ungetch( 5 ) from wxFileInputStream...\n\n") );
|
||||
|
||||
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 );
|
||||
textCtrl.WriteText( str );
|
||||
|
||||
textCtrl.WriteText( _T("Reading char from wxFileInputStream:\n\n") );
|
||||
|
||||
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 );
|
||||
textCtrl.WriteText( str );
|
||||
|
||||
textCtrl.WriteText( _T("Reading another char from wxFileInputStream:\n\n") );
|
||||
|
||||
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 );
|
||||
textCtrl.WriteText( str );
|
||||
|
||||
textCtrl.WriteText( _T("Now calling Ungetch( 5 ) from wxFileInputStream again...\n\n") );
|
||||
|
||||
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 );
|
||||
textCtrl.WriteText( str );
|
||||
|
||||
@@ -792,7 +795,7 @@ void MyApp::DoStreamDemo6(wxCommandEvent& WXUNUSED(event))
|
||||
file_input.SeekI( 3 );
|
||||
|
||||
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 );
|
||||
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") );
|
||||
|
||||
wxFileOutputStream file_output( wxString(_T("test_wx.dat")) );
|
||||
wxFileOutputStream file_output( file_name );
|
||||
for (ch = 0; ch < 10; ch++)
|
||||
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") );
|
||||
|
||||
wxFileInputStream file_input( wxString(_T("test_wx.dat")) );
|
||||
wxFileInputStream file_input( file_name );
|
||||
wxBufferedInputStream buf_input( file_input );
|
||||
|
||||
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 );
|
||||
textCtrl.WriteText( str );
|
||||
|
||||
textCtrl.WriteText( _T("Reading another char from wxBufferedInputStream:\n\n") );
|
||||
|
||||
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 );
|
||||
textCtrl.WriteText( str );
|
||||
|
||||
textCtrl.WriteText( _T("Reading yet another char from wxBufferedInputStream:\n\n") );
|
||||
|
||||
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 );
|
||||
textCtrl.WriteText( str );
|
||||
|
||||
textCtrl.WriteText( _T("Now calling Ungetch( 5 ) from wxBufferedInputStream...\n\n") );
|
||||
|
||||
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 );
|
||||
textCtrl.WriteText( str );
|
||||
|
||||
textCtrl.WriteText( _T("Reading char from wxBufferedInputStream:\n\n") );
|
||||
|
||||
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 );
|
||||
textCtrl.WriteText( str );
|
||||
|
||||
textCtrl.WriteText( _T("Reading another char from wxBufferedInputStream:\n\n") );
|
||||
|
||||
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 );
|
||||
textCtrl.WriteText( str );
|
||||
|
||||
textCtrl.WriteText( _T("Now calling Ungetch( 5 ) from wxBufferedInputStream again...\n\n") );
|
||||
|
||||
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 );
|
||||
textCtrl.WriteText( str );
|
||||
|
||||
@@ -872,7 +875,7 @@ void MyApp::DoStreamDemo7(wxCommandEvent& WXUNUSED(event))
|
||||
buf_input.SeekI( 3 );
|
||||
|
||||
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 );
|
||||
textCtrl.WriteText( str );
|
||||
}
|
||||
|
@@ -102,11 +102,6 @@ MyResizableListCtrl::MyResizableListCtrl( wxWindow *parent, wxWindowID id,
|
||||
}
|
||||
|
||||
|
||||
MyResizableListCtrl::~MyResizableListCtrl()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void MyResizableListCtrl::ContextSensitiveMenu( wxMouseEvent& event )
|
||||
{
|
||||
// Make an instance of a menu.
|
||||
|
@@ -69,7 +69,7 @@ public:
|
||||
);
|
||||
|
||||
// Destuctor.
|
||||
~MyResizableListCtrl();
|
||||
~MyResizableListCtrl(){};
|
||||
|
||||
protected:
|
||||
|
||||
|
@@ -64,11 +64,6 @@ PreferencesDialog::PreferencesDialog(wxWindow* parent)
|
||||
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)
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@@ -45,7 +45,7 @@ public:
|
||||
PreferencesDialog( wxWindow* parent );
|
||||
|
||||
// Destructor.
|
||||
~PreferencesDialog();
|
||||
~PreferencesDialog(){};
|
||||
|
||||
private:
|
||||
|
||||
|
Reference in New Issue
Block a user