Merges from Scitech Branch (George Davison):
Added wxDisplayChangedEvent and triggering in MSW, when display mode changes this event gets triggered. I don't know what should happen with other OS's since I am not familiar with how they handle mode changes. Watcome Version 11 now compiles with wide character support. Fixed watcom warnings in html/htmlwin.h imagbmp.h listctrl.h imagbmp.cpp quantize.cpp strconv.cpp variant.cpp dirctrlg.cpp treectlg.cpp m_style.cpp fontenum.cpp listctrl.cpp ole\dataobj.cpp textctrl.cpp window.cpp xml.cpp msw/setup.h with watcom version 11 it now compiles with wide character support. xrc/xml.cpp fixed memory leak and compile warnings git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14057 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -34,7 +34,7 @@
|
||||
|
||||
// Forward declaration
|
||||
class wxHtmlAppletWindow;
|
||||
|
||||
class wxAppletEvent;
|
||||
/*--------------------------- Class Definitions ---------------------------*/
|
||||
|
||||
/****************************************************************************
|
||||
@@ -76,7 +76,7 @@ public:
|
||||
virtual void OnHistoryBack() = 0;
|
||||
|
||||
// Handle messages from the wxAppletManager and other applets
|
||||
virtual void OnMessage(wxEvent& msg) = 0;
|
||||
virtual void OnMessage(wxAppletEvent& msg) = 0;
|
||||
};
|
||||
|
||||
|
||||
|
@@ -30,57 +30,98 @@
|
||||
#ifndef __WX_ECHOVAR_H
|
||||
#define __WX_ECHOVAR_H
|
||||
|
||||
#include "wx/object.h"
|
||||
#include "wx/hash.h"
|
||||
|
||||
/*--------------------------- Class Definitions ---------------------------*/
|
||||
|
||||
/****************************************************************************
|
||||
RETURNS:
|
||||
The string value of the variable
|
||||
|
||||
PARAMETERS:
|
||||
parms - Optional parameter string passed from parm= field in HTML
|
||||
|
||||
REMARKS:
|
||||
To create new variables for the #echo HTML preprocessing directives
|
||||
you need to derive classes from wxEchoVariable and override the
|
||||
pure virtual GetValue function. However this should not be done directly
|
||||
but by using the BEGIN_ECHO_VARIABLE and END_ECHO_VARIABLE macros
|
||||
|
||||
SEE ALSO:
|
||||
wxEchoPrep, BEGIN_ECHO_VARIABLE, END_ECHO_VARIABLE
|
||||
****************************************************************************/
|
||||
typedef wxString (*wxEchoVariableGetValueFn)(const char *parms);
|
||||
|
||||
/****************************************************************************
|
||||
REMARKS:
|
||||
wxEchoVariable class Definition
|
||||
****************************************************************************/
|
||||
class wxEchoVariable : public wxObject {
|
||||
private:
|
||||
DECLARE_ABSTRACT_CLASS(wxEchoVariable);
|
||||
protected:
|
||||
const wxChar *m_varName;
|
||||
wxEchoVariableGetValueFn m_getValueFn;
|
||||
static wxEchoVariable *sm_first;
|
||||
wxEchoVariable *m_next;
|
||||
static wxHashTable *sm_varTable;
|
||||
|
||||
static inline wxEchoVariable *wxEchoVariable::FindVariable(const wxChar *varName);
|
||||
|
||||
public:
|
||||
wxEchoVariable() : wxObject() {}
|
||||
~wxEchoVariable() {}
|
||||
// Constructor to create the echo variable and register the class
|
||||
wxEchoVariable(
|
||||
const char *varName,
|
||||
wxEchoVariableGetValueFn getValueFn);
|
||||
|
||||
// Member variable access functions
|
||||
const wxChar *GetClassName() const { return m_varName; }
|
||||
wxEchoVariableGetValueFn GetValueFn() const { return m_getValueFn; }
|
||||
static const wxEchoVariable* GetFirst() { return sm_first; }
|
||||
const wxEchoVariable* GetNext() const { return m_next; }
|
||||
|
||||
/****************************************************************************
|
||||
RETURNS:
|
||||
The boolean value of the variable
|
||||
// Static functions to retrieve any variable avaliable
|
||||
static wxString GetValue(const wxChar *varName,const wxChar *parms = NULL);
|
||||
static bool Exists(const wxChar *varName);
|
||||
|
||||
PARAMETERS:
|
||||
parms - Optional parameter string passed from parm= field in HTML
|
||||
// Initializes parent pointers and hash table for fast searching.
|
||||
static void Initialize();
|
||||
|
||||
REMARKS:
|
||||
To create new variables for the #echo HTML preprocessing directives
|
||||
you need to derive classes from wxEchoVariable and override the
|
||||
pure virtual GetValue function. However this should not be done directly
|
||||
but by using the BEGIN_ECHO_VARIABLE and END_ECHO_VARIABLE macros
|
||||
|
||||
SEE ALSO:
|
||||
wxEchoPrep, BEGIN_ECHO_VARIABLE, END_ECHO_VARIABLE
|
||||
****************************************************************************/
|
||||
virtual wxString GetValue(const char *parms = NULL) const = 0;
|
||||
|
||||
|
||||
public:
|
||||
// static function to retrieve any variable avaliable
|
||||
static wxString FindValue(const wxString &cls, const char *parms = NULL);
|
||||
// Cleans up hash table used for fast searching.
|
||||
static void CleanUp();
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
PARAMETERS:
|
||||
class - Name of class for echo variable to find
|
||||
|
||||
RETURNS:
|
||||
Pointer to the echo variable class
|
||||
|
||||
REMARKS:
|
||||
Inline helper function to find the echo variable from it's class name.
|
||||
****************************************************************************/
|
||||
inline wxEchoVariable *wxEchoVariable::FindVariable(
|
||||
const wxChar *varName)
|
||||
{
|
||||
if (sm_varTable)
|
||||
return (wxEchoVariable*)sm_varTable->Get(varName);
|
||||
else {
|
||||
wxEchoVariable *info = sm_first;
|
||||
while (info) {
|
||||
if (info->m_varName && wxStrcmp(info->m_varName, varName) == 0)
|
||||
return info;
|
||||
info = info->m_next;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/*--------------------------------- MACROS --------------------------------*/
|
||||
|
||||
#define ECHO_PARM (_BEV_parm)
|
||||
#define BEGIN_ECHO_VARIABLE(name) \
|
||||
class wxEchoVariable##name : public wxEchoVariable { \
|
||||
private: \
|
||||
DECLARE_DYNAMIC_CLASS(wxEchoVariable##name##); \
|
||||
public: \
|
||||
wxEchoVariable##name##() : wxEchoVariable() {} \
|
||||
virtual wxString GetValue(const char *parms = NULL) const; \
|
||||
}; \
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxEchoVariable##name##, wxEchoVariable); \
|
||||
wxString wxEchoVariable##name :: GetValue(const char *parms) const { \
|
||||
wxString wxEchoVariableFn##name(const char *parms); \
|
||||
wxEchoVariable wxEchoVariable##name(#name,wxEchoVariableFn##name); \
|
||||
wxString wxEchoVariableFn##name(const char *parms) { \
|
||||
wxString _BEV_parm = wxString(parms);
|
||||
|
||||
#define END_ECHO_VARIABLE(returnval) \
|
||||
|
@@ -30,57 +30,98 @@
|
||||
#ifndef __WX_IFELSEVAR_H
|
||||
#define __WX_IFELSEVAR_H
|
||||
|
||||
#include "wx/object.h"
|
||||
#include "wx/hash.h"
|
||||
|
||||
/*--------------------------- Class Definitions ---------------------------*/
|
||||
|
||||
/****************************************************************************
|
||||
RETURNS:
|
||||
The boolean value of the variable
|
||||
|
||||
REMARKS:
|
||||
This class is used to create variables for the HTML preprocessor #if, #else,
|
||||
and #endif directives.
|
||||
To create new variables for the #if, #else and #endif HTML preprocessing
|
||||
blocks you need to derive classes from wxIfElseVariable and override the
|
||||
pure virtual GetValue function. However this should not be done directly
|
||||
but by using the BEGIN_IFELSE_VARIABLE and END_IFELSE_VARIABLE macros
|
||||
|
||||
SEE ALSO:
|
||||
wxIfElsePrep
|
||||
wxIfElsePrep, BEGIN_IFELSE_VARIABLE, END_IFELSE_VARIABLE
|
||||
****************************************************************************/
|
||||
typedef bool (*wxIfElseVariableGetValueFn)();
|
||||
|
||||
/****************************************************************************
|
||||
REMARKS:
|
||||
wxIfElseVariable class Definition
|
||||
****************************************************************************/
|
||||
class wxIfElseVariable : public wxObject {
|
||||
private:
|
||||
DECLARE_ABSTRACT_CLASS(wxIfElseVariable);
|
||||
protected:
|
||||
const wxChar *m_varName;
|
||||
wxIfElseVariableGetValueFn m_getValueFn;
|
||||
static wxIfElseVariable *sm_first;
|
||||
wxIfElseVariable *m_next;
|
||||
static wxHashTable *sm_varTable;
|
||||
bool forced;
|
||||
bool forceVal;
|
||||
|
||||
static inline wxIfElseVariable *wxIfElseVariable::FindVariable(const wxChar *varName);
|
||||
|
||||
public:
|
||||
wxIfElseVariable() : wxObject() {}
|
||||
~wxIfElseVariable() {}
|
||||
// Constructor to create the echo variable and register the class
|
||||
wxIfElseVariable(
|
||||
const char *varName,
|
||||
wxIfElseVariableGetValueFn getValueFn);
|
||||
|
||||
// Member variable access functions
|
||||
const wxChar *GetClassName() const { return m_varName; }
|
||||
wxIfElseVariableGetValueFn GetValueFn() const { return m_getValueFn; }
|
||||
static const wxIfElseVariable* GetFirst() { return sm_first; }
|
||||
const wxIfElseVariable* GetNext() const { return m_next; }
|
||||
|
||||
/****************************************************************************
|
||||
RETURNS:
|
||||
The boolean value of the variable
|
||||
// Static functions to retrieve any variable avaliable
|
||||
static bool GetValue(const wxChar *varName);
|
||||
static bool Exists(const wxChar *varName);
|
||||
static void Force(const wxChar *varName, bool val);
|
||||
|
||||
REMARKS:
|
||||
To create new variables for the #if, #else and #endif HTML preprocessing
|
||||
blocks you need to derive classes from wxIfElseVariable and override the
|
||||
pure virtual GetValue function. However this should not be done directly
|
||||
but by using the BEGIN_IFELSE_VARIABLE and END_IFELSE_VARIABLE macros
|
||||
// Initializes parent pointers and hash table for fast searching.
|
||||
static void Initialize();
|
||||
|
||||
SEE ALSO:
|
||||
wxIfElsePrep, BEGIN_IFELSE_VARIABLE, END_IFELSE_VARIABLE
|
||||
****************************************************************************/
|
||||
virtual bool GetValue() const = 0;
|
||||
|
||||
|
||||
public:
|
||||
// static function to retrieve any variable avaliable
|
||||
static bool FindValue(const wxString &cls);
|
||||
// Cleans up hash table used for fast searching.
|
||||
static void CleanUp();
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
PARAMETERS:
|
||||
class - Name of class for echo variable to find
|
||||
|
||||
RETURNS:
|
||||
Pointer to the echo variable class
|
||||
|
||||
REMARKS:
|
||||
Inline helper function to find the echo variable from it's class name.
|
||||
****************************************************************************/
|
||||
inline wxIfElseVariable *wxIfElseVariable::FindVariable(
|
||||
const wxChar *varName)
|
||||
{
|
||||
if (sm_varTable)
|
||||
return (wxIfElseVariable*)sm_varTable->Get(varName);
|
||||
else {
|
||||
wxIfElseVariable *info = sm_first;
|
||||
while (info) {
|
||||
if (info->m_varName && wxStrcmp(info->m_varName, varName) == 0)
|
||||
return info;
|
||||
info = info->m_next;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/*--------------------------------- MACROS --------------------------------*/
|
||||
|
||||
#define BEGIN_IFELSE_VARIABLE(name) \
|
||||
class wxIfElseVariable##name : public wxIfElseVariable { \
|
||||
private: \
|
||||
DECLARE_DYNAMIC_CLASS(wxIfElseVariable##name##); \
|
||||
public: \
|
||||
wxIfElseVariable##name##() : wxIfElseVariable() {} \
|
||||
virtual bool GetValue() const; \
|
||||
}; \
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxIfElseVariable##name##, wxIfElseVariable); \
|
||||
bool wxIfElseVariable##name :: GetValue() const {
|
||||
bool wxIfElseVariableFn##name(); \
|
||||
wxIfElseVariable wxIfElseVariable##name(#name,wxIfElseVariableFn##name); \
|
||||
bool wxIfElseVariableFn##name() { \
|
||||
|
||||
#define END_IFELSE_VARIABLE(returnval) \
|
||||
return returnval; \
|
||||
|
@@ -68,14 +68,15 @@ public:
|
||||
// Destructor
|
||||
~wxLoadPageEvent() {}
|
||||
|
||||
// Clone Virtual
|
||||
virtual wxEvent *Clone() const { return new wxLoadPageEvent(m_hRef, m_htmlWindow); }
|
||||
|
||||
// Return the hmtl window for the load page operation
|
||||
wxHtmlAppletWindow *GetHtmlWindow() { return m_htmlWindow; };
|
||||
|
||||
// Get the hRef string for the load page operation
|
||||
const wxString & GetHRef() { return m_hRef; };
|
||||
|
||||
// Copy constructor for the object
|
||||
void CopyObject(wxObject& obj) const;
|
||||
};
|
||||
|
||||
|
||||
@@ -97,8 +98,10 @@ public:
|
||||
// Destructor
|
||||
~wxPageLoadedEvent() {}
|
||||
|
||||
// Copy constructor for the object
|
||||
void CopyObject(wxObject& obj) const;
|
||||
// Clone Virtual
|
||||
virtual wxEvent *Clone() const {
|
||||
return new wxPageLoadedEvent(); }
|
||||
|
||||
};
|
||||
|
||||
// Define the macro to create our event type
|
||||
|
@@ -32,17 +32,19 @@
|
||||
// Forward declaration
|
||||
class wxHtmlAppletWindow;
|
||||
|
||||
#include "wx/event.h"
|
||||
|
||||
/*--------------------------- Class Definitions ---------------------------*/
|
||||
|
||||
/****************************************************************************
|
||||
REMARKS:
|
||||
Defines the abstract base class for wxQlet objects.
|
||||
Defines the abstract base class for wxPlugIn objects.
|
||||
****************************************************************************/
|
||||
class wxPlugIn : public wxObject {
|
||||
class wxPlugIn : public wxEvtHandler {
|
||||
private:
|
||||
wxHtmlAppletWindow *m_parent;
|
||||
DECLARE_ABSTRACT_CLASS(wxPlugIn);
|
||||
|
||||
wxHtmlAppletWindow *m_parent;
|
||||
public:
|
||||
// Constructor (called during dynamic creation)
|
||||
wxPlugIn() { m_parent = NULL; };
|
||||
@@ -50,8 +52,12 @@ public:
|
||||
// Psuedo virtual constructor
|
||||
virtual bool Create(wxHtmlAppletWindow *parent);
|
||||
|
||||
// Function that actually executes the main plugin code
|
||||
virtual void Run(const wxString& cmdLine);
|
||||
|
||||
// Virtual destructor
|
||||
virtual ~wxPlugIn();
|
||||
};
|
||||
|
||||
#endif // __WX_PLUGIN_H
|
||||
|
||||
|
@@ -30,6 +30,7 @@
|
||||
#ifndef __WX_PREPECHO_H
|
||||
#define __WX_PREPECHO_H
|
||||
|
||||
#include "wx/object.h"
|
||||
#include "wx/html/htmlproc.h"
|
||||
|
||||
/*--------------------------- Class Definitions ---------------------------*/
|
||||
|
@@ -30,6 +30,7 @@
|
||||
#ifndef __WX_PREPIFELSE_H
|
||||
#define __WX_PREPIFELSE_H
|
||||
|
||||
#include "wx/object.h"
|
||||
#include "wx/html/htmlproc.h"
|
||||
|
||||
/*--------------------------- Class Definitions ---------------------------*/
|
||||
|
@@ -30,8 +30,13 @@
|
||||
#ifndef __WX_PREPINCLUDE_H
|
||||
#define __WX_PREPINCLUDE_H
|
||||
|
||||
#include "wx/object.h"
|
||||
#include "wx/html/htmlproc.h"
|
||||
|
||||
/*------------------------------- Prototypes ------------------------------*/
|
||||
|
||||
class wxFileSystem;
|
||||
|
||||
/*--------------------------- Class Definitions ---------------------------*/
|
||||
|
||||
/****************************************************************************
|
||||
|
@@ -46,6 +46,21 @@ class wxToolBarBase;
|
||||
WX_DECLARE_LIST(wxApplet, wxAppletList);
|
||||
|
||||
/*--------------------------- Class Definitions ---------------------------*/
|
||||
class wxAppletEvent {
|
||||
protected:
|
||||
int m_id;
|
||||
wxObject *m_eventObject;
|
||||
public:
|
||||
wxAppletEvent(int id) { m_eventObject=NULL; m_id = id; }
|
||||
|
||||
int GetId() const { return m_id; }
|
||||
void SetId(int Id) { m_id = Id; }
|
||||
|
||||
wxObject *GetEventObject() const { return m_eventObject; }
|
||||
void SetEventObject(wxObject *obj) { m_eventObject = obj; }
|
||||
|
||||
};
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
REMARKS:
|
||||
@@ -53,16 +68,21 @@ Defines the class for virtual-link data types
|
||||
****************************************************************************/
|
||||
class VirtualData : public wxObject {
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(VirtualData);
|
||||
|
||||
protected:
|
||||
wxString m_name;
|
||||
wxString m_group;
|
||||
wxString m_href;
|
||||
wxString m_plugIn;
|
||||
|
||||
public:
|
||||
// Ctors
|
||||
VirtualData(
|
||||
wxString& name,
|
||||
wxString& group,
|
||||
wxString& href );
|
||||
wxString& href,
|
||||
wxString& plugin );
|
||||
|
||||
VirtualData();
|
||||
|
||||
@@ -70,11 +90,14 @@ public:
|
||||
wxString GetName(){ return m_name;};
|
||||
wxString GetGroup(){ return m_group;};
|
||||
wxString GetHref(){ return m_href;};
|
||||
wxString GetPlugIn(){ return m_plugIn;};
|
||||
|
||||
// Sets
|
||||
void SetName (wxString& s){ m_name = s; };
|
||||
void SetGroup(wxString& s){ m_group = s; };
|
||||
void SetHref (wxString& s){ m_href = s; };
|
||||
void SetPlugIn (wxString& s){ m_plugIn = s;};
|
||||
void EmptyPlugIn () { m_plugIn = "";};
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
@@ -98,7 +121,7 @@ protected:
|
||||
wxToolBarBase *m_NavBar;
|
||||
int m_NavBackId;
|
||||
int m_NavForwardId;
|
||||
wxPalette m_globalPalette;
|
||||
wxString m_openedlast;
|
||||
|
||||
// Override this so we can do proper palette management!!
|
||||
virtual void OnDraw(wxDC& dc);
|
||||
@@ -114,8 +137,7 @@ public:
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxHW_SCROLLBAR_AUTO,
|
||||
const wxString& name = "htmlAppletWindow",
|
||||
const wxPalette& globalPalette = wxNullPalette);
|
||||
const wxString& name = "htmlAppletWindow");
|
||||
|
||||
// Destructor
|
||||
~wxHtmlAppletWindow();
|
||||
@@ -128,7 +150,7 @@ public:
|
||||
const wxSize& size);
|
||||
|
||||
// Create an instance of an Qlet based on it's class name
|
||||
bool CreatePlugIn(const wxString& classId );
|
||||
bool CreatePlugIn(const wxString& classId,const wxString& cmdLine = "");
|
||||
|
||||
// Find an instance of an applet based on it's class name
|
||||
wxApplet *FindApplet(const wxString& className);
|
||||
@@ -157,7 +179,7 @@ public:
|
||||
void SetNavBar(wxToolBarBase *navBar);
|
||||
|
||||
// Broadcast a message to all applets on the page
|
||||
void SendMessage(wxEvent& msg);
|
||||
void SendAppletMessage(wxAppletEvent& msg);
|
||||
|
||||
// Register a cookie of data in the applet manager
|
||||
static bool RegisterCookie(const wxString& name,wxObject *cookie);
|
||||
@@ -184,25 +206,7 @@ public:
|
||||
// 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);
|
||||
|
||||
wxString GetLastOpened() { return m_openedlast; }
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
@@ -213,7 +217,7 @@ class wxHtmlAppletCell : public wxHtmlCell
|
||||
{
|
||||
public:
|
||||
wxHtmlAppletCell(wxWindow *wnd, int w = 0);
|
||||
~wxHtmlAppletCell() { m_Wnd->Destroy(); }
|
||||
virtual ~wxHtmlAppletCell();
|
||||
virtual void Draw(wxDC& dc, int x, int y, int view_y1, int view_y2);
|
||||
virtual void DrawInvisible(wxDC& dc, int x, int y);
|
||||
virtual void Layout(int w);
|
||||
@@ -223,6 +227,5 @@ protected:
|
||||
// width float is used in adjustWidth (it is in percents)
|
||||
};
|
||||
|
||||
|
||||
#endif // __WX_APPLET_WINDOW_H
|
||||
|
||||
|
Reference in New Issue
Block a user