From 7a893a3152a6ac676b0409320daef188a7be1b7b Mon Sep 17 00:00:00 2001 From: =?utf8?q?W=C5=82odzimierz=20Skiba?= Date: Thu, 21 Jul 2005 16:22:28 +0000 Subject: [PATCH] wxOS2 with Open Watcom: correct PCH usage, missing headers, warning fixes, source cleaning and other Watcom adjustements. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34900 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/cshelp.cpp | 4 ++++ src/common/debugrpt.cpp | 3 +-- src/common/filefn.cpp | 5 +++-- src/common/filename.cpp | 6 ++++++ src/common/imagfill.cpp | 3 +-- src/common/imagpng.cpp | 2 +- src/common/mimecmn.cpp | 11 ++++++++--- src/common/quantize.cpp | 3 +-- src/common/textcmn.cpp | 3 +-- src/generic/colrdlgg.cpp | 15 ++++++++------- src/generic/dbgrptg.cpp | 20 +++++++++++++++++--- 11 files changed, 51 insertions(+), 24 deletions(-) diff --git a/src/common/cshelp.cpp b/src/common/cshelp.cpp index 31af18593e..b8d7e4b7b2 100644 --- a/src/common/cshelp.cpp +++ b/src/common/cshelp.cpp @@ -254,6 +254,8 @@ bool wxContextHelp::DispatchEvent(wxWindow* win, const wxPoint& pt) * to put the application into context help mode. */ +#ifndef __WXPM__ + static const char * csquery_xpm[] = { "12 11 2 1", " c None", @@ -270,6 +272,8 @@ static const char * csquery_xpm[] = { " .. ", " "}; +#endif + IMPLEMENT_CLASS(wxContextHelpButton, wxBitmapButton) BEGIN_EVENT_TABLE(wxContextHelpButton, wxBitmapButton) diff --git a/src/common/debugrpt.cpp b/src/common/debugrpt.cpp index e9d477c1fa..0717408f4f 100644 --- a/src/common/debugrpt.cpp +++ b/src/common/debugrpt.cpp @@ -103,7 +103,7 @@ TextElement(wxXmlNode *node, const wxChar *name, const wxString& value) { wxXmlNode *nodeChild = new wxXmlNode(wxXML_ELEMENT_NODE, name); node->AddChild(nodeChild); - nodeChild->AddChild(new wxXmlNode(wxXML_TEXT_NODE, _T(""), value)); + nodeChild->AddChild(new wxXmlNode(wxXML_TEXT_NODE, wxEmptyString, value)); } static inline void @@ -690,4 +690,3 @@ bool wxDebugReportUpload::DoProcess() #endif // wxUSE_ZIPSTREAM #endif // wxUSE_DEBUGREPORT - diff --git a/src/common/filefn.cpp b/src/common/filefn.cpp index 7b7a499f5f..fc1dc7dc95 100644 --- a/src/common/filefn.cpp +++ b/src/common/filefn.cpp @@ -1151,6 +1151,7 @@ bool wxMkdir(const wxString& dir, int perm) if ( mkdir(wxFNCONV(dirname), perm) != 0 ) #endif #elif defined(__OS2__) + wxUnusedVar(perm); if (::DosCreateDir((PSZ)dirname, NULL) != 0) // enhance for EAB's?? #elif defined(__DOS__) #if defined(__WATCOMC__) @@ -1228,7 +1229,7 @@ bool wxDirExists(const wxChar *pszPathName) return (ret != (DWORD)-1) && (ret & FILE_ATTRIBUTE_DIRECTORY); #elif defined(__OS2__) - return (::DosSetCurrentDir((PSZ)(WXSTRINGCAST strPath))); + return (bool)(::DosSetCurrentDir((PSZ)(WXSTRINGCAST strPath))); #else // !__WIN32__ wxStructStat st; @@ -1406,7 +1407,7 @@ wxChar *wxGetWorkingDirectory(wxChar *buf, int sz) ,cbuf + 3 ,(PULONG)&sz ); - cbuf[0] = 'A' + (ulDriveNum - 1); + cbuf[0] = char('A' + (ulDriveNum - 1)); cbuf[1] = ':'; cbuf[2] = '\\'; ok = rc == 0; diff --git a/src/common/filename.cpp b/src/common/filename.cpp index c1a128ffc1..9af9313ac4 100644 --- a/src/common/filename.cpp +++ b/src/common/filename.cpp @@ -1910,6 +1910,9 @@ bool wxFileName::SetTimes(const wxDateTime *dtAccess, return true; } #else // other platform + wxUnusedVar(dtAccess); + wxUnusedVar(dtMod); + wxUnusedVar(dtCreate); #endif // platforms wxLogSysError(_("Failed to modify file times for '%s'"), @@ -2000,6 +2003,9 @@ bool wxFileName::GetTimes(wxDateTime *dtAccess, return true; } #else // other platform + wxUnusedVar(dtAccess); + wxUnusedVar(dtMod); + wxUnusedVar(dtCreate); #endif // platforms wxLogSysError(_("Failed to retrieve file times for '%s'"), diff --git a/src/common/imagfill.cpp b/src/common/imagfill.cpp index bfe5345247..9545f46ed4 100644 --- a/src/common/imagfill.cpp +++ b/src/common/imagfill.cpp @@ -62,7 +62,7 @@ static void LINKAGEMODE wxImageFloodFill(wxImage *image, wxCoord x, wxCoord y, const wxBrush & fillBrush, const wxColour& testColour, int style, - int LogicalFunction) + int WXUNUSED(LogicalFunction)) { /* A diamond flood-fill using a circular queue system. Each pixel surrounding the current pixel is added to @@ -309,4 +309,3 @@ bool wxDoFloodFill(wxDC *dc, wxCoord x, wxCoord y, } #endif // wxUSE_IMAGE - diff --git a/src/common/imagpng.cpp b/src/common/imagpng.cpp index 007bfadaf0..bf3b40ab49 100644 --- a/src/common/imagpng.cpp +++ b/src/common/imagpng.cpp @@ -109,7 +109,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxPNGHandler,wxImageHandler) #if wxUSE_STREAMS #ifndef PNGLINKAGEMODE - #ifdef __WATCOMC__ + #if defined(__WATCOMC__) && defined(__WXMSW__) // we need an explicit cdecl for Watcom, at least according to // // http://sf.net/tracker/index.php?func=detail&aid=651492&group_id=9863&atid=109863 diff --git a/src/common/mimecmn.cpp b/src/common/mimecmn.cpp index e6ca2e5f63..3ac318ce0b 100644 --- a/src/common/mimecmn.cpp +++ b/src/common/mimecmn.cpp @@ -412,12 +412,16 @@ bool wxFileType::Unassociate() #endif } -bool wxFileType::SetCommand(const wxString& cmd, const wxString& verb, -bool overwriteprompt) +bool wxFileType::SetCommand(const wxString& cmd, + const wxString& verb, + bool overwriteprompt) { #if defined (__WXMSW__) || defined(__UNIX__) return m_impl->SetCommand(cmd, verb, overwriteprompt); #else + wxUnusedVar(cmd); + wxUnusedVar(verb); + wxUnusedVar(overwriteprompt); wxFAIL_MSG(_T("not implemented")); return false; #endif @@ -437,8 +441,8 @@ bool wxFileType::SetDefaultIcon(const wxString& cmd, int index) #if defined (__WXMSW__) || defined(__UNIX__) return m_impl->SetDefaultIcon (cmd, index); #else + wxUnusedVar(index); wxFAIL_MSG(_T("not implemented")); - return false; #endif } @@ -506,6 +510,7 @@ wxMimeTypesManager::Associate(const wxFileTypeInfo& ftInfo) #if defined(__WXMSW__) || defined(__UNIX__) return m_impl->Associate(ftInfo); #else // other platforms + wxUnusedVar(ftInfo); wxFAIL_MSG( _T("not implemented") ); // TODO return NULL; #endif // platforms diff --git a/src/common/quantize.cpp b/src/common/quantize.cpp index 37674b2c4b..c230b983d9 100644 --- a/src/common/quantize.cpp +++ b/src/common/quantize.cpp @@ -77,7 +77,7 @@ typedef unsigned short UINT16; typedef signed short INT16; -#ifndef __WATCOMC__ +#if !(defined(__WATCOMC__) && defined(__WXMSW__)) typedef signed int INT32; #endif @@ -1656,4 +1656,3 @@ bool wxQuantize::Quantize(const wxImage& src, #endif // wxUSE_IMAGE - diff --git a/src/common/textcmn.cpp b/src/common/textcmn.cpp index a9f1f0b34d..4ff84d8a28 100644 --- a/src/common/textcmn.cpp +++ b/src/common/textcmn.cpp @@ -362,7 +362,7 @@ bool wxTextCtrlBase::EmulateKeyPress(const wxKeyEvent& event) case WXK_NUMPAD7: case WXK_NUMPAD8: case WXK_NUMPAD9: - ch = _T('0') + keycode - WXK_NUMPAD0; + ch = (wxChar)(_T('0') + keycode - WXK_NUMPAD0); break; case WXK_MULTIPLY: @@ -523,4 +523,3 @@ wxTextCtrlBase::HitTest(const wxPoint& WXUNUSED(pt), DEFINE_EVENT_TYPE(wxEVT_COMMAND_TEXT_UPDATED) #endif // wxUSE_TEXTCTRL/!wxUSE_TEXTCTRL - diff --git a/src/generic/colrdlgg.cpp b/src/generic/colrdlgg.cpp index b75a681dea..6ac7e393d8 100644 --- a/src/generic/colrdlgg.cpp +++ b/src/generic/colrdlgg.cpp @@ -211,15 +211,17 @@ void wxGenericColourDialog::OnMouseEvent(wxMouseEvent& event) void wxGenericColourDialog::OnPaint(wxPaintEvent& event) { #if !defined(__WXMOTIF__) && !defined(__WXPM__) && !defined(__WXCOCOA__) - wxDialog::OnPaint(event); + wxDialog::OnPaint(event); +#else + wxUnusedVar(event); #endif - wxPaintDC dc(this); + wxPaintDC dc(this); - PaintBasicColours(dc); - PaintCustomColours(dc); - PaintCustomColour(dc); - PaintHighlight(dc, true); + PaintBasicColours(dc); + PaintCustomColours(dc); + PaintCustomColour(dc); + PaintHighlight(dc, true); } void wxGenericColourDialog::CalculateMeasurements() @@ -597,4 +599,3 @@ void wxGenericColourDialog::OnBlueSlider(wxCommandEvent& WXUNUSED(event)) #endif // wxUSE_SLIDER #endif // wxUSE_COLOURDLG && !defined(__WXGTK20__) - diff --git a/src/generic/dbgrptg.cpp b/src/generic/dbgrptg.cpp index efb75d241b..fae5ccd21f 100644 --- a/src/generic/dbgrptg.cpp +++ b/src/generic/dbgrptg.cpp @@ -131,14 +131,21 @@ public: wxString m_command; private: + +#if wxUSE_FILEDLG void OnBrowse(wxCommandEvent& event); +#endif // wxUSE_FILEDLG DECLARE_EVENT_TABLE() DECLARE_NO_COPY_CLASS(wxDumpOpenExternalDlg) }; BEGIN_EVENT_TABLE(wxDumpOpenExternalDlg, wxDialog) + +#if wxUSE_FILEDLG EVT_BUTTON(wxID_MORE, wxDumpOpenExternalDlg::OnBrowse) +#endif + END_EVENT_TABLE() @@ -180,12 +187,17 @@ wxDumpOpenExternalDlg::wxDumpOpenExternalDlg(wxWindow *parent, ); sizerH->Add(command, wxSizerFlags(1).Align(wxALIGN_CENTER_VERTICAL)); + +#if wxUSE_FILEDLG + wxButton *browse = new wxButton(this, wxID_MORE, wxT(">>"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT); sizerH->Add(browse, wxSizerFlags(0).Align(wxALIGN_CENTER_VERTICAL). Border(wxLEFT)); +#endif // wxUSE_FILEDLG + sizerTop->Add(sizerH, wxSizerFlags(0).Expand().Border()); sizerTop->Add(new wxStaticLine(this), wxSizerFlags().Expand().Border()); @@ -204,6 +216,8 @@ wxDumpOpenExternalDlg::wxDumpOpenExternalDlg(wxWindow *parent, command->SetFocus(); } +#if wxUSE_FILEDLG + void wxDumpOpenExternalDlg::OnBrowse(wxCommandEvent& ) { wxFileName fname(m_command); @@ -222,6 +236,7 @@ void wxDumpOpenExternalDlg::OnBrowse(wxCommandEvent& ) } } +#endif // wxUSE_FILEDLG // ---------------------------------------------------------------------------- // wxDebugReportDialog: class showing debug report to the user @@ -401,7 +416,7 @@ bool wxDebugReportDialog::TransferDataFromWindow() void wxDebugReportDialog::OnView(wxCommandEvent& ) { const int sel = m_checklst->GetSelection(); - wxCHECK_RET( sel != -1, _T("invalid selection in OnView()") ); + wxCHECK_RET( sel != wxNOT_FOUND, _T("invalid selection in OnView()") ); wxFileName fn(m_dbgrpt.GetDirectory(), m_files[sel]); wxString str; @@ -417,7 +432,7 @@ void wxDebugReportDialog::OnView(wxCommandEvent& ) void wxDebugReportDialog::OnOpen(wxCommandEvent& ) { const int sel = m_checklst->GetSelection(); - wxCHECK_RET( sel != -1, _T("invalid selection in OnOpen()") ); + wxCHECK_RET( sel != wxNOT_FOUND, _T("invalid selection in OnOpen()") ); wxFileName fn(m_dbgrpt.GetDirectory(), m_files[sel]); @@ -498,4 +513,3 @@ bool wxDebugReportPreviewStd::Show(wxDebugReport& dbgrpt) const } #endif // wxUSE_DEBUGREPORT - -- 2.45.2