From d699f48ba33c96c24f7ab3764ad98ded0633c1c5 Mon Sep 17 00:00:00 2001 From: Kendall Bennett Date: Tue, 31 Jul 2001 17:50:16 +0000 Subject: [PATCH] Latest updates from SciTech code tree including numerous warning fixes for the Watcom and other compilers. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11217 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- contrib/include/wx/applet/echovar.h | 10 +-- contrib/include/wx/applet/ifelsevar.h | 9 ++- contrib/include/wx/applet/window.h | 68 ++++++++++++++------ contrib/src/applet/appletwindow.cpp | 93 +++++++++++++++------------ contrib/src/applet/echovar.cpp | 2 +- contrib/src/applet/ifelsevar.cpp | 2 +- contrib/src/applet/prepecho.cpp | 4 +- contrib/src/applet/prepifelse.cpp | 2 +- contrib/src/applet/prepinclude.cpp | 2 +- include/wx/button.h | 4 +- include/wx/html/htmlcell.h | 4 +- include/wx/menu.h | 2 +- include/wx/spawnbrowser.h | 28 ++++++++ src/common/extended.c | 2 +- src/common/unzip.c | 2 +- src/html/htmlcell.cpp | 30 ++++----- src/html/htmlpars.cpp | 52 ++++++++------- src/html/m_hline.cpp | 4 +- src/html/m_image.cpp | 2 +- src/html/m_list.cpp | 2 +- src/msw/dcprint.cpp | 2 +- src/msw/listctrl.cpp | 8 +-- src/msw/slider95.cpp | 2 +- src/msw/snglinst.cpp | 2 +- src/msw/spawnbrowser.cpp | 48 ++++++++++++++ 25 files changed, 251 insertions(+), 135 deletions(-) create mode 100644 include/wx/spawnbrowser.h create mode 100644 src/msw/spawnbrowser.cpp diff --git a/contrib/include/wx/applet/echovar.h b/contrib/include/wx/applet/echovar.h index 27fb78cb6b..9fd5708f5c 100644 --- a/contrib/include/wx/applet/echovar.h +++ b/contrib/include/wx/applet/echovar.h @@ -44,7 +44,7 @@ public: wxEchoVariable() : wxObject() {} ~wxEchoVariable() {} - /**************************************************************************** + /**************************************************************************** RETURNS: The boolean value of the variable @@ -65,8 +65,8 @@ public: public: // static function to retrieve any variable avaliable - static wxString GetValue(const wxString &cls, const char *parms = NULL); -}; + static wxString FindValue(const wxString &cls, const char *parms = NULL); + }; /*--------------------------------- MACROS --------------------------------*/ @@ -83,13 +83,13 @@ public: wxString wxEchoVariable##name :: GetValue(const char *parms) const { \ wxString _BEV_parm = wxString(parms); -#define END_ECHO_VARIABLE(name, returnval) \ +#define END_ECHO_VARIABLE(returnval) \ return returnval; \ } #define STRING_ECHO_VARIABLE(name, string) \ BEGIN_ECHO_VARIABLE(##name##); \ - END_ECHO_VARIABLE(##name##, wxString(##string##)) + END_ECHO_VARIABLE(wxString(##string##)) #endif // __WX_ECHOVAR_H diff --git a/contrib/include/wx/applet/ifelsevar.h b/contrib/include/wx/applet/ifelsevar.h index 851cc82a53..5a95b84ff7 100644 --- a/contrib/include/wx/applet/ifelsevar.h +++ b/contrib/include/wx/applet/ifelsevar.h @@ -66,8 +66,8 @@ public: public: // static function to retrieve any variable avaliable - static bool GetValue(const wxString &cls); -}; + static bool FindValue(const wxString &cls); + }; /*--------------------------------- MACROS --------------------------------*/ @@ -82,14 +82,13 @@ public: IMPLEMENT_DYNAMIC_CLASS(wxIfElseVariable##name##, wxIfElseVariable); \ bool wxIfElseVariable##name :: GetValue() const { -#define END_IFELSE_VARIABLE(name, returnval) \ +#define END_IFELSE_VARIABLE(returnval) \ return returnval; \ } #define IFELSE_VARIABLE(name, state) \ BEGIN_IFELSE_VARIABLE(##name##); \ - END_IFELSE_VARIABLE(##name##, bool (state)) - + END_IFELSE_VARIABLE(bool (state)) #endif // __WX_IFELSEVAR_H diff --git a/contrib/include/wx/applet/window.h b/contrib/include/wx/applet/window.h index 97ff94d869..470c1091c7 100644 --- a/contrib/include/wx/applet/window.h +++ b/contrib/include/wx/applet/window.h @@ -5,19 +5,23 @@ * Copyright (C) 1991-2001 SciTech Software, Inc. * All rights reserved. * -* ======================================================================== -* -* The contents of this file are subject to the wxWindows License -* Version 3.0 (the "License"); you may not use this file except in -* compliance with the License. You may obtain a copy of the License at -* http://www.wxwindows.org/licence3.txt -* -* Software distributed under the License is distributed on an -* "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or -* implied. See the License for the specific language governing -* rights and limitations under the License. -* -* ======================================================================== +* ====================================================================== +* |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW| +* | | +* |This copyrighted computer code is a proprietary trade secret of | +* |SciTech Software, Inc., located at 505 Wall Street, Chico, CA 95928 | +* |USA (www.scitechsoft.com). ANY UNAUTHORIZED POSSESSION, USE, | +* |VIEWING, COPYING, MODIFICATION OR DISSEMINATION OF THIS CODE IS | +* |STRICTLY PROHIBITED BY LAW. Unless you have current, express | +* |written authorization from SciTech to possess or use this code, you | +* |may be subject to civil and/or criminal penalties. | +* | | +* |If you received this code in error or you would like to report | +* |improper use, please immediately contact SciTech Software, Inc. at | +* |530-894-8400. | +* | | +* |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW| +* ====================================================================== * * Language: ANSI C++ * Environment: Any @@ -30,6 +34,7 @@ #define __WX_APPLET_WINDOW_H #include "wx/html/htmlwin.h" +#include "wx/process.h" // Forward declare class wxApplet; @@ -89,7 +94,7 @@ protected: wxToolBarBase *m_NavBar; int m_NavBackId; int m_NavForwardId; - + wxString m_DocRoot; public: // Constructor wxHtmlAppletWindow( @@ -101,7 +106,8 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxHW_SCROLLBAR_AUTO, - const wxString& name = "htmlAppletWindow"); + const wxString& name = "htmlAppletWindow", + const wxString& docroot = "" ); // Destructor ~wxHtmlAppletWindow(); @@ -135,13 +141,13 @@ public: void SendMessage(wxEvent& msg); // Register a cookie of data in the applet manager - bool RegisterCookie(const wxString& name,wxObject *cookie); + static bool RegisterCookie(const wxString& name,wxObject *cookie); // UnRegister a cookie of data in the applet manager - bool UnRegisterCookie(const wxString& name); + static bool UnRegisterCookie(const wxString& name); // Find a cookie of data given it's public name - wxObject *FindCookie(const wxString& name); + static wxObject *FindCookie(const wxString& name); // Event handlers to load a new page void OnLoadPage(wxLoadPageEvent &event); @@ -150,16 +156,36 @@ public: void OnPageLoaded(wxPageLoadedEvent &event); // LoadPage mutex locks - void Lock() { m_mutexLock = true;}; - void UnLock() { m_mutexLock = false;}; + void Lock(){ m_mutexLock = true;}; + void UnLock(){ m_mutexLock = false;}; // Returns TRUE if the mutex is locked, FALSE otherwise. - bool IsLocked() { return m_mutexLock;}; + bool IsLocked(){ return m_mutexLock;}; // Tries to lock the mutex. If it can't, returns immediately with false. bool TryLock(); }; +/**************************************************************************** +REMARKS: +Defines the class for AppetProcess +***************************************************************************/ +class AppletProcess : public wxProcess { +public: + AppletProcess( + wxWindow *parent) + : wxProcess(parent) + { + } + + // instead of overriding this virtual function we might as well process the + // event from it in the frame class - this might be more convenient in some + // cases + virtual void OnTerminate(int pid, int status); + + }; + + #endif // __WX_APPLET_WINDOW_H diff --git a/contrib/src/applet/appletwindow.cpp b/contrib/src/applet/appletwindow.cpp index 82c5f851ba..ab460c0542 100644 --- a/contrib/src/applet/appletwindow.cpp +++ b/contrib/src/applet/appletwindow.cpp @@ -5,19 +5,23 @@ * Copyright (C) 1991-2001 SciTech Software, Inc. * All rights reserved. * -* ======================================================================== -* -* The contents of this file are subject to the wxWindows License -* Version 3.0 (the "License"); you may not use this file except in -* compliance with the License. You may obtain a copy of the License at -* http://www.wxwindows.org/licence3.txt -* -* Software distributed under the License is distributed on an -* "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or -* implied. See the License for the specific language governing -* rights and limitations under the License. -* -* ======================================================================== +* ====================================================================== +* |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW| +* | | +* |This copyrighted computer code is a proprietary trade secret of | +* |SciTech Software, Inc., located at 505 Wall Street, Chico, CA 95928 | +* |USA (www.scitechsoft.com). ANY UNAUTHORIZED POSSESSION, USE, | +* |VIEWING, COPYING, MODIFICATION OR DISSEMINATION OF THIS CODE IS | +* |STRICTLY PROHIBITED BY LAW. Unless you have current, express | +* |written authorization from SciTech to possess or use this code, you | +* |may be subject to civil and/or criminal penalties. | +* | | +* |If you received this code in error or you would like to report | +* |improper use, please immediately contact SciTech Software, Inc. at | +* |530-894-8400. | +* | | +* |REMOVAL OR MODIFICATION OF THIS HEADER IS STRICTLY PROHIBITED BY LAW| +* ====================================================================== * * Language: ANSI C++ * Environment: Any @@ -28,6 +32,9 @@ // For compilers that support precompilation #include "wx/wxprec.h" +#include "wx/utils.h" +#include "wx/process.h" +#include "wx/spawnbrowser.h" #include "wx/html/forcelnk.h" // Include private headers @@ -40,7 +47,6 @@ #include "wx/applet/prepecho.h" #include "wx/applet/prepifelse.h" - /*---------------------------- Global variables ---------------------------*/ wxHashTable wxHtmlAppletWindow::m_Cookies; @@ -75,7 +81,8 @@ wxHtmlAppletWindow::wxHtmlAppletWindow( const wxPoint& pos, const wxSize& size, long style, - const wxString& name) + const wxString& name, + const wxString& docroot ) : wxHtmlWindow(parent,id,pos,size,style,name) { // Init our locks @@ -91,10 +98,15 @@ wxHtmlAppletWindow::wxHtmlAppletWindow( m_NavBar = NULL; } + // Set up docroot + m_DocRoot = docroot; + // Add HTML preprocessors // deleting preprocessors is done by the code within the window incPreprocessor = new wxIncludePrep(); // #include preprocessor + incPreprocessor->ChangeDirectory(m_DocRoot); + wxEchoPrep * echoPreprocessor = new wxEchoPrep(); // #echo preprocessor wxIfElsePrep * ifPreprocessor = new wxIfElsePrep(); @@ -206,21 +218,21 @@ bool wxHtmlAppletWindow::LoadPage( { wxString href(link); + // Check for abs path. If it is not then tack on the path + // supplied at creation. + if (!wxIsAbsolutePath(href)) + href = m_DocRoot + href; + // TODO: This needs to be made platform inde if possible. if (link.GetChar(0) == '?'){ wxString cmd = link.BeforeFirst('='); wxString cmdValue = link.AfterFirst('='); - if(!(cmd.CmpNoCase("?EXTERNAL"))){ -#ifdef __WINDOWS__ - ShellExecute(this ? (HWND)this->GetHWND() : NULL,NULL,cmdValue.c_str(),NULL,"",SW_SHOWNORMAL); -#else - #error Platform not implemented yet! -#endif - return true; + return wxSpawnBrowser(this, cmdValue.c_str()); } if (!(cmd.CmpNoCase("?EXECUTE"))){ - wxMessageBox(cmdValue); + wxProcess *child = new AppletProcess(this); + wxExecute(cmdValue, false, child); return true; } if (!(cmd.CmpNoCase("?VIRTUAL"))){ @@ -230,27 +242,19 @@ bool wxHtmlAppletWindow::LoadPage( } else { #ifdef CHECKED - wxMessageBox("VIRTUAL LINK ERROR: " + cmdValue + " does not exist."); + wxLogError(_T("VIRTUAL LINK ERROR: '%s' does not exist."), cmdValue.c_str()); #endif return true; } } } - // Make a copy of the current path the translate for ) and copy it all into the variable code end = ((output.Mid(b)).Lower()).Find(""); diff --git a/contrib/src/applet/prepinclude.cpp b/contrib/src/applet/prepinclude.cpp index 74d85e5962..600bd30579 100644 --- a/contrib/src/applet/prepinclude.cpp +++ b/contrib/src/applet/prepinclude.cpp @@ -98,11 +98,11 @@ wxString wxIncludePrep::Process( #ifdef CHECKED wxMessageBox(wxString("wxHTML #include error: File not Found ") + fname + wxString("."),"Error",wxICON_ERROR); #endif + delete file; continue; } wxString tmp; - do { char tmp2[257]; diff --git a/include/wx/button.h b/include/wx/button.h index 3018394065..0a7ccc6a8b 100644 --- a/include/wx/button.h +++ b/include/wx/button.h @@ -45,10 +45,10 @@ class WXDLLEXPORT wxButtonBase : public wxControl { public: // show the image in the button in addition to the label - virtual void SetImageLabel(const wxBitmap& bitmap) { } + virtual void SetImageLabel(const wxBitmap& WXUNUSED(bitmap)) { } // set the margins around the image - virtual void SetImageMargins(wxCoord x, wxCoord y) { } + virtual void SetImageMargins(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y)) { } // this wxButton method is called when the button becomes the default one // on its panel diff --git a/include/wx/html/htmlcell.h b/include/wx/html/htmlcell.h index 5be4aad97c..17e108a08d 100644 --- a/include/wx/html/htmlcell.h +++ b/include/wx/html/htmlcell.h @@ -72,11 +72,11 @@ public: virtual void Layout(int w); // renders the cell - virtual void Draw(wxDC& dc, int x, int y, int view_y1, int view_y2) {} + virtual void Draw(wxDC& WXUNUSED(dc), int WXUNUSED(x), int WXUNUSED(y), int WXUNUSED(view_y1), int WXUNUSED(view_y2)) {} // proceed drawing actions in case the cell is not visible (scrolled out of screen). // This is needed to change fonts, colors and so on - virtual void DrawInvisible(wxDC& dc, int x, int y) {} + virtual void DrawInvisible(wxDC& WXUNUSED(dc), int WXUNUSED(x), int WXUNUSED(y)) {} // This method returns pointer to the FIRST cell for that // the condition diff --git a/include/wx/menu.h b/include/wx/menu.h index 293ce4a763..0ffe2447a9 100644 --- a/include/wx/menu.h +++ b/include/wx/menu.h @@ -353,7 +353,7 @@ public: virtual void EnableTop(size_t pos, bool enable) = 0; // is the menu enabled? - virtual bool IsEnabledTop(size_t pos) const { return TRUE; } + virtual bool IsEnabledTop(size_t WXUNUSED(pos)) const { return TRUE; } // get or change the label of the menu at given position virtual void SetLabelTop(size_t pos, const wxString& label) = 0; diff --git a/include/wx/spawnbrowser.h b/include/wx/spawnbrowser.h new file mode 100644 index 0000000000..94fa83bd66 --- /dev/null +++ b/include/wx/spawnbrowser.h @@ -0,0 +1,28 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: wx/spawnbrowser.h +// Purpose: wxSpawnBrowser can be used to spawn a browser +// Author: Jason Quijano +// Modified by: +// Created: 13.06.01 +// RCS-ID: +// Copyright: (c) 2001 Jason Quijano +// Licence: wxWindows licence +/////////////////////////////////////////////////////////////////////////////// + +#ifndef _WX_SPAWNBROWSER_H_ +#define _WX_SPAWNBROWSER_H_ + +#ifdef __GNUG__ + #pragma interface "spawnbrowser.h" +#endif + +#if wxUSE_SPAWNBROWSER + +// ---------------------------------------------------------------------------- +// wxSpawnBrowser +// ---------------------------------------------------------------------------- + +WXDLLEXPORT bool wxSpawnBrowser(wxWindow *parent, wxString href); +#endif // wxUSE_SPAWNBROWSER + +#endif // _WX_SPAWNBROWSER_H_ diff --git a/src/common/extended.c b/src/common/extended.c index cf9f95fd2f..f81792f6d6 100644 --- a/src/common/extended.c +++ b/src/common/extended.c @@ -1,4 +1,4 @@ -#include "wx/setup.h" +#include "wx/defs.h" #include diff --git a/src/common/unzip.c b/src/common/unzip.c index 551b1c6b2d..dd8494835d 100644 --- a/src/common/unzip.c +++ b/src/common/unzip.c @@ -14,7 +14,7 @@ $Id$ -#include "wx/setup.h" +#include "wx/defs.h" #if wxUSE_ZLIB && wxUSE_ZIPSTREAM diff --git a/src/html/htmlcell.cpp b/src/html/htmlcell.cpp index 9e49b42543..dcd3b4b4cf 100644 --- a/src/html/htmlcell.cpp +++ b/src/html/htmlcell.cpp @@ -91,13 +91,13 @@ void wxHtmlCell::SetLink(const wxHtmlLinkInfo& link) -void wxHtmlCell::Layout(int w) +void wxHtmlCell::Layout(int WXUNUSED(w)) { SetPos(0, 0); } -const wxHtmlCell* wxHtmlCell::Find(int condition, const void* param) const +const wxHtmlCell* wxHtmlCell::Find(int WXUNUSED(condition), const void* WXUNUSED(param)) const { return NULL; } @@ -117,7 +117,7 @@ wxHtmlWordCell::wxHtmlWordCell(const wxString& word, wxDC& dc) : wxHtmlCell() -void wxHtmlWordCell::Draw(wxDC& dc, int x, int y, int view_y1, int view_y2) +void wxHtmlWordCell::Draw(wxDC& dc, int x, int y, int WXUNUSED(view_y1), int WXUNUSED(view_y2)) { dc.DrawText(m_Word, x + m_PosX, y + m_PosY); } @@ -208,11 +208,11 @@ bool wxHtmlContainerCell::AdjustPagebreak(int *pagebreak) const while (c) { - if (c->AdjustPagebreak(&pbrk)) + if (c->AdjustPagebreak(&pbrk)) rt = TRUE; c = c->GetNext(); } - if (rt) + if (rt) *pagebreak = pbrk + m_PosY; return rt; } @@ -406,7 +406,7 @@ void wxHtmlContainerCell::Draw(wxDC& dc, int x, int y, int view_y1, int view_y2) dc.DrawLine(x + m_PosX, y + m_PosY + m_Height - 1, x + m_PosX + m_Width - 1, y + m_PosY + m_Height - 1); } - if (m_Cells) + if (m_Cells) { for (wxHtmlCell *cell = m_Cells; cell; cell = cell->GetNext()) cell->Draw(dc, x + m_PosX, y + m_PosY, view_y1, view_y2); @@ -415,7 +415,7 @@ void wxHtmlContainerCell::Draw(wxDC& dc, int x, int y, int view_y1, int view_y2) // container invisible, just proceed font+color changing: else { - if (m_Cells) + if (m_Cells) { for (wxHtmlCell *cell = m_Cells; cell; cell = cell->GetNext()) cell->DrawInvisible(dc, x + m_PosX, y + m_PosY); @@ -427,7 +427,7 @@ void wxHtmlContainerCell::Draw(wxDC& dc, int x, int y, int view_y1, int view_y2) void wxHtmlContainerCell::DrawInvisible(wxDC& dc, int x, int y) { - if (m_Cells) + if (m_Cells) { for (wxHtmlCell *cell = m_Cells; cell; cell = cell->GetNext()) cell->DrawInvisible(dc, x + m_PosX, y + m_PosY); @@ -515,7 +515,7 @@ void wxHtmlContainerCell::SetWidthFloat(const wxHtmlTag& tag, double pixel_scale const wxHtmlCell* wxHtmlContainerCell::Find(int condition, const void* param) const { if (m_Cells) - { + { const wxHtmlCell *r = NULL; for (wxHtmlCell *cell = m_Cells; cell; cell = cell->GetNext()) @@ -557,7 +557,7 @@ void wxHtmlContainerCell::OnMouseClick(wxWindow *parent, int x, int y, const wxM // wxHtmlColourCell //-------------------------------------------------------------------------------- -void wxHtmlColourCell::Draw(wxDC& dc, int x, int y, int view_y1, int view_y2) +void wxHtmlColourCell::Draw(wxDC& dc, int WXUNUSED(x), int WXUNUSED(y), int WXUNUSED(view_y1), int WXUNUSED(view_y2)) { if (m_Flags & wxHTML_CLR_FOREGROUND) dc.SetTextForeground(m_Colour); @@ -568,7 +568,7 @@ void wxHtmlColourCell::Draw(wxDC& dc, int x, int y, int view_y1, int view_y2) } } -void wxHtmlColourCell::DrawInvisible(wxDC& dc, int x, int y) +void wxHtmlColourCell::DrawInvisible(wxDC& dc, int WXUNUSED(x), int WXUNUSED(y)) { if (m_Flags & wxHTML_CLR_FOREGROUND) dc.SetTextForeground(m_Colour); @@ -586,12 +586,12 @@ void wxHtmlColourCell::DrawInvisible(wxDC& dc, int x, int y) // wxHtmlFontCell //-------------------------------------------------------------------------------- -void wxHtmlFontCell::Draw(wxDC& dc, int x, int y, int view_y1, int view_y2) +void wxHtmlFontCell::Draw(wxDC& dc, int WXUNUSED(x), int WXUNUSED(y), int WXUNUSED(view_y1), int WXUNUSED(view_y2)) { dc.SetFont(m_Font); } -void wxHtmlFontCell::DrawInvisible(wxDC& dc, int x, int y) +void wxHtmlFontCell::DrawInvisible(wxDC& dc, int WXUNUSED(x), int WXUNUSED(y)) { dc.SetFont(m_Font); } @@ -617,7 +617,7 @@ wxHtmlWidgetCell::wxHtmlWidgetCell(wxWindow *wnd, int w) } -void wxHtmlWidgetCell::Draw(wxDC& dc, int x, int y, int view_y1, int view_y2) +void wxHtmlWidgetCell::Draw(wxDC& WXUNUSED(dc), int WXUNUSED(x), int WXUNUSED(y), int WXUNUSED(view_y1), int WXUNUSED(view_y2)) { int absx = 0, absy = 0, stx, sty; wxHtmlCell *c = this; @@ -635,7 +635,7 @@ void wxHtmlWidgetCell::Draw(wxDC& dc, int x, int y, int view_y1, int view_y2) -void wxHtmlWidgetCell::DrawInvisible(wxDC& dc, int x, int y) +void wxHtmlWidgetCell::DrawInvisible(wxDC& WXUNUSED(dc), int WXUNUSED(x), int WXUNUSED(y)) { int absx = 0, absy = 0, stx, sty; wxHtmlCell *c = this; diff --git a/src/html/htmlpars.cpp b/src/html/htmlpars.cpp index 31bc825d5c..64054fc2d2 100644 --- a/src/html/htmlpars.cpp +++ b/src/html/htmlpars.cpp @@ -136,7 +136,7 @@ void wxHtmlParser::CreateDOMSubTree(wxHtmlTag *cur, wxChar c; int i = begin_pos; int textBeginning = begin_pos; - + while (i < end_pos) { c = m_Source.GetChar(i); @@ -160,7 +160,7 @@ void wxHtmlParser::CreateDOMSubTree(wxHtmlTag *cur, while (i < end_pos) { c = m_Source.GetChar(i++); - if ((c == wxT(' ') || c == wxT('\n') || + if ((c == wxT(' ') || c == wxT('\n') || c == wxT('\r') || c == wxT('\t')) && dashes >= 2) {} else if (c == wxT('>') && dashes >= 2) { @@ -169,31 +169,31 @@ void wxHtmlParser::CreateDOMSubTree(wxHtmlTag *cur, } else if (c == wxT('-')) dashes++; - else + else dashes = 0; } } - + // add another tag to the tree: else if (i < end_pos-1 && m_Source.GetChar(i+1) != wxT('/')) { wxHtmlTag *chd; - if (cur) - chd = new wxHtmlTag(cur, m_Source, + if (cur) + chd = new wxHtmlTag(cur, m_Source, i, end_pos, cache, m_entitiesParser); - else + else { chd = new wxHtmlTag(NULL, m_Source, i, end_pos, cache, m_entitiesParser); - if (!m_Tags) + if (!m_Tags) { - // if this is the first tag to be created make the root + // if this is the first tag to be created make the root // m_Tags point to it: m_Tags = chd; } else { - // if there is already a root tag add this tag as + // if there is already a root tag add this tag as // the last sibling: chd->m_Prev = m_Tags->GetLastSibling(); chd->m_Prev->m_Next = chd; @@ -203,7 +203,7 @@ void wxHtmlParser::CreateDOMSubTree(wxHtmlTag *cur, if (chd->HasEnding()) { CreateDOMSubTree(chd, - chd->GetBeginPos(), chd->GetEndPos1(), + chd->GetBeginPos(), chd->GetEndPos1(), cache); i = chd->GetEndPos2(); } @@ -213,7 +213,7 @@ void wxHtmlParser::CreateDOMSubTree(wxHtmlTag *cur, } // ... or skip ending tag: - else + else { while (i < end_pos && m_Source.GetChar(i) != wxT('>')) i++; textBeginning = i+1; @@ -244,36 +244,36 @@ void wxHtmlParser::DestroyDOMTree() m_TextPieces = NULL; } -void wxHtmlParser::DoParsing() +void wxHtmlParser::DoParsing() { m_CurTag = m_Tags; m_CurTextPiece = 0; - DoParsing(0, m_Source.Length()); + DoParsing(0, m_Source.Length()); } void wxHtmlParser::DoParsing(int begin_pos, int end_pos) { if (end_pos <= begin_pos) return; - + wxHtmlTextPieces& pieces = *m_TextPieces; size_t piecesCnt = pieces.GetCount(); - + while (begin_pos < end_pos) { while (m_CurTag && m_CurTag->GetBeginPos() < begin_pos) m_CurTag = m_CurTag->GetNextTag(); - while (m_CurTextPiece < piecesCnt && + while (m_CurTextPiece < piecesCnt && pieces[m_CurTextPiece].m_pos < begin_pos) m_CurTextPiece++; - if (m_CurTextPiece < piecesCnt && - (!m_CurTag || + if (m_CurTextPiece < piecesCnt && + (!m_CurTag || pieces[m_CurTextPiece].m_pos < m_CurTag->GetBeginPos())) { // Add text: AddText(m_Source.Mid(pieces[m_CurTextPiece].m_pos, pieces[m_CurTextPiece].m_lng)); - begin_pos = pieces[m_CurTextPiece].m_pos + + begin_pos = pieces[m_CurTextPiece].m_pos + pieces[m_CurTextPiece].m_lng; m_CurTextPiece++; } @@ -284,7 +284,7 @@ void wxHtmlParser::DoParsing(int begin_pos, int end_pos) { if (m_CurTag->HasEnding()) begin_pos = m_CurTag->GetEndPos2(); - else + else begin_pos = m_CurTag->GetBeginPos(); } wxHtmlTag *t = m_CurTag; @@ -377,23 +377,23 @@ void wxHtmlParser::SetSourceAndSaveState(const wxString& src) m_TextPieces = NULL; m_CurTextPiece = 0; m_Source = wxEmptyString; - + SetSource(src); } bool wxHtmlParser::RestoreState() { if (!m_SavedStates) return FALSE; - + wxHtmlParserState *s = m_SavedStates; m_SavedStates = s->m_nextState; - + m_CurTag = s->m_curTag; m_Tags = s->m_tags; m_TextPieces = s->m_textPieces; m_CurTextPiece = s->m_curTextPiece; m_Source = s->m_source; - + delete s; return TRUE; } @@ -434,6 +434,8 @@ void wxHtmlEntitiesParser::SetEncoding(wxFontEncoding encoding) m_encoding = encoding; if (m_encoding != wxFONTENCODING_SYSTEM) m_conv = new wxCSConv(wxFontMapper::GetEncodingName(m_encoding)); +#else + (void) encoding; #endif } diff --git a/src/html/m_hline.cpp b/src/html/m_hline.cpp index 7ff5b19a4d..ca4cdd48a3 100644 --- a/src/html/m_hline.cpp +++ b/src/html/m_hline.cpp @@ -43,12 +43,12 @@ class wxHtmlLineCell : public wxHtmlCell public: wxHtmlLineCell(int size) : wxHtmlCell() {m_Height = size;} void Draw(wxDC& dc, int x, int y, int view_y1, int view_y2); - void Layout(int w) + void Layout(int w) { m_Width = w; wxHtmlCell::Layout(w); } }; -void wxHtmlLineCell::Draw(wxDC& dc, int x, int y, int view_y1, int view_y2) +void wxHtmlLineCell::Draw(wxDC& dc, int x, int y, int WXUNUSED(view_y1), int WXUNUSED(view_y2)) { wxBrush mybrush("BLACK", wxSOLID); wxPen mypen("BLACK", 1, wxSOLID); diff --git a/src/html/m_image.cpp b/src/html/m_image.cpp index 1492201871..2445a8fe8a 100644 --- a/src/html/m_image.cpp +++ b/src/html/m_image.cpp @@ -337,7 +337,7 @@ wxHtmlImageCell::wxHtmlImageCell(wxFSFile *input, int w, int h, double scale, in -void wxHtmlImageCell::Draw(wxDC& dc, int x, int y, int view_y1, int view_y2) +void wxHtmlImageCell::Draw(wxDC& dc, int x, int y, int WXUNUSED(view_y1), int WXUNUSED(view_y2)) { if (m_Image) { diff --git a/src/html/m_list.cpp b/src/html/m_list.cpp index c7d7aca7ea..51488e2d3d 100644 --- a/src/html/m_list.cpp +++ b/src/html/m_list.cpp @@ -55,7 +55,7 @@ wxHtmlListmarkCell::wxHtmlListmarkCell(wxDC* dc, const wxColour& clr) : wxHtmlCe -void wxHtmlListmarkCell::Draw(wxDC& dc, int x, int y, int view_y1, int view_y2) +void wxHtmlListmarkCell::Draw(wxDC& dc, int x, int y, int WXUNUSED(view_y1), int WXUNUSED(view_y2)) { dc.SetBrush(m_Brush); dc.DrawEllipse(x + m_PosX + m_Width / 4, y + m_PosY + m_Height / 4, m_Width / 2, m_Width / 2); diff --git a/src/msw/dcprint.cpp b/src/msw/dcprint.cpp index 76b581fa9f..76b0ff965a 100644 --- a/src/msw/dcprint.cpp +++ b/src/msw/dcprint.cpp @@ -475,7 +475,7 @@ bool wxPrinterDC::DoBlit(wxCoord xdest, wxCoord ydest, wxDC *source, wxCoord xsrc, wxCoord ysrc, int WXUNUSED(rop), bool useMask, - wxCoord xsrcMask, wxCoord ysrcMask) + wxCoord WXUNUSED(xsrcMask), wxCoord WXUNUSED(ysrcMask)) { bool success = TRUE; diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp index 52f37500cb..c974aaf47f 100644 --- a/src/msw/listctrl.cpp +++ b/src/msw/listctrl.cpp @@ -1101,7 +1101,7 @@ wxTextCtrl* wxListCtrl::EditLabel(long item, wxClassInfo* textControlClass) { wxASSERT( (textControlClass->IsKindOf(CLASSINFO(wxTextCtrl))) ); - // VS: ListView_EditLabel requires that the list has focus. + // VS: ListView_EditLabel requires that the list has focus. SetFocus(); HWND hWnd = (HWND) ListView_EditLabel(GetHwnd(), item); @@ -1881,7 +1881,7 @@ void wxListCtrl::OnPaint(wxPaintEvent& event) // virtual list controls // ---------------------------------------------------------------------------- -wxString wxListCtrl::OnGetItemText(long item, long col) const +wxString wxListCtrl::OnGetItemText(long WXUNUSED(item), long WXUNUSED(col)) const { // this is a pure virtual function, in fact - which is not really pure // because the controls which are not virtual don't need to implement it @@ -1890,7 +1890,7 @@ wxString wxListCtrl::OnGetItemText(long item, long col) const return wxEmptyString; } -int wxListCtrl::OnGetItemImage(long item) const +int wxListCtrl::OnGetItemImage(long WXUNUSED(item)) const { // same as above wxFAIL_MSG( _T("not supposed to be called") ); @@ -1898,7 +1898,7 @@ int wxListCtrl::OnGetItemImage(long item) const return -1; } -wxListItemAttr *wxListCtrl::OnGetItemAttr(long item) const +wxListItemAttr *wxListCtrl::OnGetItemAttr(long WXUNUSED_UNLESS_DEBUG(item)) const { wxASSERT_MSG( item >= 0 && item < GetItemCount(), _T("invalid item index in OnGetItemAttr()") ); diff --git a/src/msw/slider95.cpp b/src/msw/slider95.cpp index bbfae8f866..116e2e5647 100644 --- a/src/msw/slider95.cpp +++ b/src/msw/slider95.cpp @@ -203,7 +203,7 @@ bool wxSlider95::Create(wxWindow *parent, wxWindowID id, } bool wxSlider95::MSWOnScroll(int WXUNUSED(orientation), WXWORD wParam, - WXWORD pos, WXHWND control) + WXWORD WXUNUSED(pos), WXHWND control) { wxEventType scrollEvent; switch ( wParam ) diff --git a/src/msw/snglinst.cpp b/src/msw/snglinst.cpp index 0f9ba06276..ab93c3d66b 100644 --- a/src/msw/snglinst.cpp +++ b/src/msw/snglinst.cpp @@ -102,7 +102,7 @@ private: // ============================================================================ bool wxSingleInstanceChecker::Create(const wxString& name, - const wxString& path) + const wxString& WXUNUSED(path)) { wxASSERT_MSG( !m_impl, _T("calling wxSingleInstanceChecker::Create() twice?") ); diff --git a/src/msw/spawnbrowser.cpp b/src/msw/spawnbrowser.cpp new file mode 100644 index 0000000000..80bb1becd7 --- /dev/null +++ b/src/msw/spawnbrowser.cpp @@ -0,0 +1,48 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: msw/spawnbrowser.cpp +// Purpose: implements wxSpawnBrowser misc function +// Author: Jason Quijano +// Modified by: +// Created: 13.06.01 +// RCS-ID: +// Copyright: (c) 2001 Jason Quijano +// License: wxWindows license +/////////////////////////////////////////////////////////////////////////////// + +// ============================================================================ +// declarations +// ============================================================================ + +// ---------------------------------------------------------------------------- +// headers +// ---------------------------------------------------------------------------- + +#ifdef __GNUG__ + #pragma implementation "spawnbrowser.h" +#endif + +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#if wxUSE_SPAWNBROWSER + +#ifndef WX_PRECOMP + #include "wx/string.h" +#endif //WX_PRECOMP + +#include "wx/spawnbrowser.h" + +// ---------------------------------------------------------------------------- +// wxSpawnBrowser: +// ---------------------------------------------------------------------------- + +bool wxSpawnBrowser (wxWindow *parent, wxString href) +{ + return ShellExecute(parent ? (HWND)parent->GetHWND() : NULL,NULL,href.c_str(),NULL,"",SW_SHOWNORMAL); +} + +#endif // wxUSE_SPAWNBROWSER -- 2.45.2