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
This commit is contained in:
parent
ac6f6ffccf
commit
d699f48ba3
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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 <!-- include files from what will be the new path
|
||||
// we cannot just grab this value from the base class since it is not correct until after LoadPage is
|
||||
// called. And we need the incPreprocessor to know the right path before LoadPage.
|
||||
wxFileSystem fs;
|
||||
fs.ChangePathTo(m_FS->GetPath(), true);
|
||||
fs.ChangePathTo(link);
|
||||
incPreprocessor->ChangeDirectory(fs.GetPath());
|
||||
|
||||
// Inform all the applets that the new page is being loaded
|
||||
for (wxAppletList::Node *node = m_AppletList.GetFirst(); node; node = node->GetNext())
|
||||
(node->GetData())->OnLinkClicked(wxHtmlLinkInfo(href));
|
||||
Show(false);
|
||||
bool stat = wxHtmlWindow::LoadPage(href);
|
||||
|
||||
|
||||
Show(true);
|
||||
|
||||
// Enable/Dis the navbar tools
|
||||
if (m_NavBar) {
|
||||
@ -426,12 +430,9 @@ need to change the page for the current window to a new window.
|
||||
void wxHtmlAppletWindow::OnLoadPage(
|
||||
wxLoadPageEvent &event)
|
||||
{
|
||||
// Test the mutex lock. We have to do this here because wxHTML constantly
|
||||
// calls wxYield which processes the message queue. This in turns means
|
||||
// that we may end up processing a new 'loadPage' event while the new
|
||||
// page is still loading! We need to avoid this so we use a simple
|
||||
// lock to avoid loading a page while presently loading another page.
|
||||
if (TryLock()) {
|
||||
// Test the mutex lock.
|
||||
if (!(IsLocked())){
|
||||
Lock();
|
||||
if (event.GetHtmlWindow() == this){
|
||||
if (LoadPage(event.GetHRef())){
|
||||
// wxPageLoadedEvent evt;
|
||||
@ -493,6 +494,18 @@ VirtualData::VirtualData(
|
||||
m_href = href;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
PARAMETERS:
|
||||
REMARKS:
|
||||
****************************************************************************/
|
||||
void AppletProcess::OnTerminate(
|
||||
int,
|
||||
int )
|
||||
{
|
||||
// we're not needed any more
|
||||
delete this;
|
||||
}
|
||||
|
||||
#include "wx/html/m_templ.h"
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -60,7 +60,7 @@ where these are used.
|
||||
SEE ALSO:
|
||||
wxEchoPrep
|
||||
****************************************************************************/
|
||||
static wxString wxEchoVariable::GetValue(
|
||||
static wxString wxEchoVariable::FindValue(
|
||||
const wxString &cls,
|
||||
const char *parms)
|
||||
{
|
||||
|
@ -59,7 +59,7 @@ where these are used.
|
||||
SEE ALSO:
|
||||
wxIfElsePrep
|
||||
****************************************************************************/
|
||||
static bool wxIfElseVariable::GetValue(
|
||||
static bool wxIfElseVariable::FindValue(
|
||||
const wxString &cls)
|
||||
{
|
||||
wxObject * tmpclass;
|
||||
|
@ -97,7 +97,7 @@ wxString wxEchoPrep::Process(
|
||||
cname = tag.Mid(10, n);
|
||||
|
||||
// grab the value from the class, put it in tag since the data is no longer needed
|
||||
tag = wxEchoVariable::GetValue(cname, NULL);
|
||||
tag = wxEchoVariable::FindValue(cname, NULL);
|
||||
}
|
||||
else {
|
||||
// Find the parms
|
||||
@ -114,7 +114,7 @@ wxString wxEchoPrep::Process(
|
||||
cname = tag.Mid(10, n);
|
||||
|
||||
// grab the value from the class, put it in tag since the data is no longer needed
|
||||
tag = wxEchoVariable::GetValue(cname, parms.c_str());
|
||||
tag = wxEchoVariable::FindValue(cname, parms.c_str());
|
||||
}
|
||||
|
||||
|
||||
|
@ -130,7 +130,7 @@ wxString wxIfElsePrep::Process(
|
||||
if (c != -1) cname = cname.Mid(0, c);
|
||||
|
||||
// Grab the value from the variable class identified by cname
|
||||
value = wxIfElseVariable::GetValue(cname);
|
||||
value = wxIfElseVariable::FindValue(cname);
|
||||
|
||||
// Find the end of the tag (<!--#endif-->) and copy it all into the variable code
|
||||
end = ((output.Mid(b)).Lower()).Find("<!--#endif-->");
|
||||
|
@ -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];
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
28
include/wx/spawnbrowser.h
Normal file
28
include/wx/spawnbrowser.h
Normal file
@ -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 <jasonq@scitechsoft.com>
|
||||
// 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_
|
@ -1,4 +1,4 @@
|
||||
#include "wx/setup.h"
|
||||
#include "wx/defs.h"
|
||||
|
||||
#include <math.h>
|
||||
|
||||
|
@ -14,7 +14,7 @@ $Id$
|
||||
|
||||
|
||||
|
||||
#include "wx/setup.h"
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_ZLIB && wxUSE_ZIPSTREAM
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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()") );
|
||||
|
@ -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 )
|
||||
|
@ -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?") );
|
||||
|
48
src/msw/spawnbrowser.cpp
Normal file
48
src/msw/spawnbrowser.cpp
Normal file
@ -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 <jasonq@scitechsoft.com>
|
||||
// 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
|
Loading…
Reference in New Issue
Block a user