Compare commits
1 Commits
wxPy_b4_vi
...
LAST_WITH_
Author | SHA1 | Date | |
---|---|---|---|
|
5335e9ae5e |
123
include/wx/accel.h
Normal file
123
include/wx/accel.h
Normal file
@@ -0,0 +1,123 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/accel.h
|
||||
// Purpose: wxAcceleratorEntry and wxAcceleratorTable classes
|
||||
// Author: Julian Smart, Robert Roebling, Vadim Zeitlin
|
||||
// Modified by:
|
||||
// Created: 31.05.01 (extracted from other files)
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) wxWindows team
|
||||
// Licence: wxWindows license
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_ACCEL_H_BASE_
|
||||
#define _WX_ACCEL_H_BASE_
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_ACCEL
|
||||
|
||||
#include "wx/object.h"
|
||||
|
||||
class WXDLLEXPORT wxAcceleratorTable;
|
||||
class WXDLLEXPORT wxMenuItem;
|
||||
class WXDLLEXPORT wxKeyEvent;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// constants
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// wxAcceleratorEntry flags
|
||||
enum
|
||||
{
|
||||
wxACCEL_NORMAL = 0x0000, // no modifiers
|
||||
wxACCEL_ALT = 0x0001, // hold Alt key down
|
||||
wxACCEL_CTRL = 0x0002, // hold Ctrl key down
|
||||
wxACCEL_SHIFT = 0x0004 // hold Shift key down
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// an entry in wxAcceleratorTable corresponds to one accelerator
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxAcceleratorEntry
|
||||
{
|
||||
public:
|
||||
wxAcceleratorEntry(int flags = 0, int keyCode = 0, int cmd = 0,
|
||||
wxMenuItem *item = NULL)
|
||||
{
|
||||
Set(flags, keyCode, cmd, item);
|
||||
}
|
||||
|
||||
void Set(int flags, int keyCode, int cmd, wxMenuItem *item = NULL)
|
||||
{
|
||||
m_flags = flags;
|
||||
m_keyCode = keyCode;
|
||||
m_command = cmd;
|
||||
m_item = item;
|
||||
}
|
||||
|
||||
void SetMenuItem(wxMenuItem *item) { m_item = item; }
|
||||
|
||||
int GetFlags() const { return m_flags; }
|
||||
int GetKeyCode() const { return m_keyCode; }
|
||||
int GetCommand() const { return m_command; }
|
||||
|
||||
wxMenuItem *GetMenuItem() const { return m_item; }
|
||||
|
||||
bool operator==(const wxAcceleratorEntry& entry) const
|
||||
{
|
||||
return m_flags == entry.m_flags &&
|
||||
m_keyCode == entry.m_keyCode &&
|
||||
m_command == entry.m_command &&
|
||||
m_item == entry.m_item;
|
||||
}
|
||||
|
||||
bool operator!=(const wxAcceleratorEntry& entry) const
|
||||
{ return !(*this == entry); }
|
||||
|
||||
#ifdef __WXMOTIF__
|
||||
// Implementation use only
|
||||
bool MatchesEvent(const wxKeyEvent& event) const ;
|
||||
#endif
|
||||
|
||||
private:
|
||||
int m_flags; // combination of wxACCEL_XXX constants
|
||||
int m_keyCode; // ASCII or virtual keycode
|
||||
int m_command; // Command id to generate
|
||||
|
||||
// the menu item this entry corresponds to, may be NULL
|
||||
wxMenuItem *m_item;
|
||||
|
||||
// for compatibility with old code, use accessors now!
|
||||
friend class WXDLLEXPORT wxMenu;
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// include wxAcceleratorTable class declaration, it is only used by the library
|
||||
// and so doesn't have any published user visible interface
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__WXUNIVERSAL__)
|
||||
#include "wx/generic/accel.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/accel.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/accel.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/accel.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/accel.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/accel.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/accel.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/stubs/accel.h"
|
||||
#endif
|
||||
|
||||
WXDLLEXPORT_DATA(extern wxAcceleratorTable) wxNullAcceleratorTable;
|
||||
|
||||
#endif // wxUSE_ACCEL
|
||||
|
||||
#endif
|
||||
// _WX_ACCEL_H_BASE_
|
512
include/wx/app.h
Normal file
512
include/wx/app.h
Normal file
@@ -0,0 +1,512 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: app.h
|
||||
// Purpose: wxAppBase class and macros used for declaration of wxApp
|
||||
// derived class in the user code
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_APP_H_BASE_
|
||||
#define _WX_APP_H_BASE_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "appbase.h"
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// typedefs
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if (defined(__WXMSW__) && !defined(__WXMICROWIN__)) || defined (__WXPM__)
|
||||
class WXDLLEXPORT wxApp;
|
||||
typedef wxApp* (*wxAppInitializerFunction)();
|
||||
#else
|
||||
// returning wxApp* won't work with gcc
|
||||
#include "wx/object.h"
|
||||
|
||||
typedef wxObject* (*wxAppInitializerFunction)();
|
||||
#endif
|
||||
|
||||
class WXDLLEXPORT wxCmdLineParser;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers we have to include here
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#include "wx/event.h" // for the base class
|
||||
|
||||
#if wxUSE_GUI
|
||||
#include "wx/window.h" // for wxTopLevelWindows
|
||||
#endif // wxUSE_GUI
|
||||
|
||||
#if wxUSE_LOG
|
||||
#include "wx/log.h"
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// constants
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
static const int wxPRINT_WINDOWS = 1;
|
||||
static const int wxPRINT_POSTSCRIPT = 2;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// the common part of wxApp implementations for all platforms
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxAppBase : public wxEvtHandler
|
||||
{
|
||||
public:
|
||||
wxAppBase();
|
||||
|
||||
// the virtual functions which may/must be overridden in the derived class
|
||||
// -----------------------------------------------------------------------
|
||||
#ifdef __DARWIN__
|
||||
virtual ~wxAppBase() { }
|
||||
#endif
|
||||
|
||||
// called during the program initialization, returning FALSE from here
|
||||
// prevents the program from continuing - it's a good place to create
|
||||
// the top level program window and return TRUE.
|
||||
//
|
||||
// Override: always in GUI application, rarely in console ones.
|
||||
virtual bool OnInit();
|
||||
|
||||
#if wxUSE_GUI
|
||||
// a platform-dependent version of OnInit(): the code here is likely to
|
||||
// depend on the toolkit. default version does nothing.
|
||||
//
|
||||
// Override: rarely.
|
||||
virtual bool OnInitGui();
|
||||
#endif // wxUSE_GUI
|
||||
|
||||
// called to start program execution - the default version just enters
|
||||
// the main GUI loop in which events are received and processed until
|
||||
// the last window is not deleted (if GetExitOnFrameDelete) or
|
||||
// ExitMainLoop() is called. In console mode programs, the execution
|
||||
// of the program really starts here
|
||||
//
|
||||
// Override: rarely in GUI applications, always in console ones.
|
||||
#if wxUSE_GUI
|
||||
virtual int OnRun() { return MainLoop(); };
|
||||
#else // !GUI
|
||||
virtual int OnRun() = 0;
|
||||
#endif // wxUSE_GUI
|
||||
|
||||
// called after the main loop termination. This is a good place for
|
||||
// cleaning up (it may be too late in dtor) and is also useful if you
|
||||
// want to return some non-default exit code - this is just the return
|
||||
// value of this method.
|
||||
//
|
||||
// Override: often.
|
||||
virtual int OnExit();
|
||||
|
||||
// called when a fatal exception occurs, this function should take care
|
||||
// not to do anything which might provoke a nested exception! It may be
|
||||
// overridden if you wish to react somehow in non-default way (core
|
||||
// dump under Unix, application crash under Windows) to fatal program
|
||||
// errors, however extreme care should be taken if you don't want this
|
||||
// function to crash.
|
||||
//
|
||||
// Override: rarely.
|
||||
virtual void OnFatalException() { }
|
||||
|
||||
// the worker functions - usually not used directly by the user code
|
||||
// -----------------------------------------------------------------
|
||||
|
||||
#if wxUSE_GUI
|
||||
// execute the main GUI loop, the function returns when the loop ends
|
||||
virtual int MainLoop() = 0;
|
||||
|
||||
// exit the main GUI loop during the next iteration (i.e. it does not
|
||||
// stop the program immediately!)
|
||||
virtual void ExitMainLoop() = 0;
|
||||
|
||||
// returns TRUE if the program is initialized
|
||||
virtual bool Initialized() = 0;
|
||||
|
||||
// returns TRUE if there are unprocessed events in the event queue
|
||||
virtual bool Pending() = 0;
|
||||
|
||||
// process the first event in the event queue (blocks until an event
|
||||
// apperas if there are none currently)
|
||||
virtual void Dispatch() = 0;
|
||||
#endif // wxUSE_GUI
|
||||
|
||||
// application info: name, description, vendor
|
||||
// -------------------------------------------
|
||||
|
||||
// NB: all these should be set by the application itself, there are no
|
||||
// reasonable default except for the application name which is taken to
|
||||
// be argv[0]
|
||||
|
||||
// set/get the application name
|
||||
wxString GetAppName() const
|
||||
{
|
||||
if ( !m_appName )
|
||||
return m_className;
|
||||
else
|
||||
return m_appName;
|
||||
}
|
||||
void SetAppName(const wxString& name) { m_appName = name; }
|
||||
|
||||
// set/get the app class name
|
||||
wxString GetClassName() const { return m_className; }
|
||||
void SetClassName(const wxString& name) { m_className = name; }
|
||||
|
||||
// set/get the vendor name
|
||||
const wxString& GetVendorName() const { return m_vendorName; }
|
||||
void SetVendorName(const wxString& name) { m_vendorName = name; }
|
||||
|
||||
#if wxUSE_GUI
|
||||
// top level window functions
|
||||
// --------------------------
|
||||
|
||||
// return TRUE if our app has focus
|
||||
virtual bool IsActive() const { return m_isActive; }
|
||||
|
||||
// set the "main" top level window
|
||||
void SetTopWindow(wxWindow *win) { m_topWindow = win; }
|
||||
|
||||
// return the "main" top level window (if it hadn't been set previously
|
||||
// with SetTopWindow(), will return just some top level window and, if
|
||||
// there are none, will return NULL)
|
||||
virtual wxWindow *GetTopWindow() const
|
||||
{
|
||||
if (m_topWindow)
|
||||
return m_topWindow;
|
||||
else if (wxTopLevelWindows.GetCount() > 0)
|
||||
return wxTopLevelWindows.GetFirst()->GetData();
|
||||
else
|
||||
return (wxWindow *)NULL;
|
||||
}
|
||||
|
||||
// control the exit behaviour: by default, the program will exit the
|
||||
// main loop (and so, usually, terminate) when the last top-level
|
||||
// program window is deleted. Beware that if you disabel this (with
|
||||
// SetExitOnFrameDelete(FALSE)), you'll have to call ExitMainLoop()
|
||||
// explicitly from somewhere.
|
||||
void SetExitOnFrameDelete(bool flag) { m_exitOnFrameDelete = flag; }
|
||||
bool GetExitOnFrameDelete() const { return m_exitOnFrameDelete; }
|
||||
|
||||
#endif // wxUSE_GUI
|
||||
|
||||
// cmd line parsing stuff
|
||||
// ----------------------
|
||||
|
||||
// all of these methods may be overridden in the derived class to
|
||||
// customize the command line parsing (by default only a few standard
|
||||
// options are handled)
|
||||
//
|
||||
// you also need to call wxApp::OnInit() from YourApp::OnInit() for all
|
||||
// this to work
|
||||
|
||||
#if wxUSE_CMDLINE_PARSER
|
||||
// this one is called from OnInit() to add all supported options
|
||||
// to the given parser
|
||||
virtual void OnInitCmdLine(wxCmdLineParser& parser);
|
||||
|
||||
// called after successfully parsing the command line, return TRUE
|
||||
// to continue and FALSE to exit
|
||||
virtual bool OnCmdLineParsed(wxCmdLineParser& parser);
|
||||
|
||||
// called if "--help" option was specified, return TRUE to continue
|
||||
// and FALSE to exit
|
||||
virtual bool OnCmdLineHelp(wxCmdLineParser& parser);
|
||||
|
||||
// called if incorrect command line options were given, return
|
||||
// FALSE to abort and TRUE to continue
|
||||
virtual bool OnCmdLineError(wxCmdLineParser& parser);
|
||||
#endif // wxUSE_CMDLINE_PARSER
|
||||
|
||||
// miscellaneous customization functions
|
||||
// -------------------------------------
|
||||
|
||||
#if wxUSE_LOG
|
||||
// override this function to create default log target of arbitrary
|
||||
// user-defined class (default implementation creates a wxLogGui
|
||||
// object) - this log object is used by default by all wxLogXXX()
|
||||
// functions.
|
||||
virtual wxLog *CreateLogTarget()
|
||||
#if wxUSE_GUI && wxUSE_LOGGUI && !defined(__WXMICROWIN__)
|
||||
{ return new wxLogGui; }
|
||||
#else // !GUI
|
||||
{ return new wxLogStderr; }
|
||||
#endif // wxUSE_GUI
|
||||
#endif // wxUSE_LOG
|
||||
|
||||
#if wxUSE_GUI
|
||||
// get the standard icon used by wxWin dialogs - this allows the user
|
||||
// to customize the standard dialogs. The 'which' parameter is one of
|
||||
// wxICON_XXX values
|
||||
virtual wxIcon GetStdIcon(int which) const = 0;
|
||||
|
||||
// VZ: what does this do exactly?
|
||||
void SetWantDebugOutput( bool flag ) { m_wantDebugOutput = flag; }
|
||||
bool GetWantDebugOutput() const { return m_wantDebugOutput; }
|
||||
|
||||
// set use of best visual flag (see below)
|
||||
void SetUseBestVisual( bool flag ) { m_useBestVisual = flag; }
|
||||
bool GetUseBestVisual() const { return m_useBestVisual; }
|
||||
|
||||
// set/get printing mode: see wxPRINT_XXX constants.
|
||||
//
|
||||
// default behaviour is the normal one for Unix: always use PostScript
|
||||
// printing.
|
||||
virtual void SetPrintMode(int WXUNUSED(mode)) { }
|
||||
int GetPrintMode() const { return wxPRINT_POSTSCRIPT; }
|
||||
|
||||
// called by toolkit-specific code to set the app status: active (we have
|
||||
// focus) or not and also the last window which had focus before we were
|
||||
// deactivated
|
||||
virtual void SetActive(bool isActive, wxWindow *lastFocus);
|
||||
#endif // wxUSE_GUI
|
||||
|
||||
// debugging support
|
||||
// -----------------
|
||||
|
||||
// this function is called when an assert failure occurs, the base class
|
||||
// version does the normal processing (i.e. shows the usual assert failure
|
||||
// dialog box)
|
||||
#ifdef __WXDEBUG__
|
||||
virtual void OnAssert(const wxChar *file, int line, const wxChar *msg);
|
||||
#endif // __WXDEBUG__
|
||||
|
||||
// implementation only from now on
|
||||
// -------------------------------
|
||||
|
||||
// helpers for dynamic wxApp construction
|
||||
static void SetInitializerFunction(wxAppInitializerFunction fn)
|
||||
{ m_appInitFn = fn; }
|
||||
static wxAppInitializerFunction GetInitializerFunction()
|
||||
{ return m_appInitFn; }
|
||||
|
||||
// process all events in the wxPendingEvents list
|
||||
virtual void ProcessPendingEvents();
|
||||
|
||||
// access to the command line arguments
|
||||
int argc;
|
||||
wxChar **argv;
|
||||
|
||||
protected:
|
||||
// function used for dynamic wxApp creation
|
||||
static wxAppInitializerFunction m_appInitFn;
|
||||
|
||||
// application info (must be set from the user code)
|
||||
wxString m_vendorName, // vendor name (ACME Inc)
|
||||
m_appName, // app name
|
||||
m_className; // class name
|
||||
|
||||
// TRUE if the application wants to get debug output
|
||||
bool m_wantDebugOutput;
|
||||
|
||||
#if wxUSE_GUI
|
||||
// the main top level window - may be NULL
|
||||
wxWindow *m_topWindow;
|
||||
|
||||
// if TRUE, exit the main loop when the last top level window is deleted
|
||||
bool m_exitOnFrameDelete;
|
||||
|
||||
// TRUE if the apps whats to use the best visual on systems where
|
||||
// more than one are available (Sun, SGI, XFree86 4.0 ?)
|
||||
bool m_useBestVisual;
|
||||
|
||||
// does any of our windows has focus?
|
||||
bool m_isActive;
|
||||
#endif // wxUSE_GUI
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// now include the declaration of the real class
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_GUI
|
||||
#if defined(__WXMSW__)
|
||||
#include "wx/msw/app.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/app.h"
|
||||
#elif defined(__WXMGL__)
|
||||
#include "wx/mgl/app.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/app.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/app.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/app.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/app.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/stubs/app.h"
|
||||
#endif
|
||||
#else // !GUI
|
||||
// can't use typedef because wxApp forward declared as a class
|
||||
class WXDLLEXPORT wxApp : public wxAppBase
|
||||
{
|
||||
};
|
||||
#endif // GUI/!GUI
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// the global data
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// the one and only application object - use of wxTheApp in application code
|
||||
// is discouraged, consider using DECLARE_APP() after which you may call
|
||||
// wxGetApp() which will return the object of the correct type (i.e. MyApp and
|
||||
// not wxApp)
|
||||
WXDLLEXPORT_DATA(extern wxApp*) wxTheApp;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// global functions
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// event loop related functions only work in GUI programs
|
||||
// ------------------------------------------------------
|
||||
|
||||
// Force an exit from main loop
|
||||
extern void WXDLLEXPORT wxExit();
|
||||
|
||||
// Yield to other apps/messages
|
||||
extern bool WXDLLEXPORT wxYield();
|
||||
|
||||
// Yield to other apps/messages
|
||||
extern void WXDLLEXPORT wxWakeUpIdle();
|
||||
|
||||
// Post a message to the given eventhandler which will be processed during the
|
||||
// next event loop iteration
|
||||
inline void wxPostEvent(wxEvtHandler *dest, wxEvent& event)
|
||||
{
|
||||
wxCHECK_RET( dest, wxT("need an object to post event to in wxPostEvent") );
|
||||
|
||||
#if wxUSE_GUI
|
||||
dest->AddPendingEvent(event);
|
||||
#else
|
||||
dest->ProcessEvent(event);
|
||||
#endif // wxUSE_GUI
|
||||
}
|
||||
|
||||
// console applications may avoid using DECLARE_APP and IMPLEMENT_APP macros
|
||||
// and call these functions instead at the program startup and termination
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
#if !wxUSE_GUI
|
||||
|
||||
// initialize the library (may be called as many times as needed, but each
|
||||
// call to wxInitialize() must be matched by wxUninitialize())
|
||||
extern bool WXDLLEXPORT wxInitialize();
|
||||
|
||||
// clean up - the library can't be used any more after the last call to
|
||||
// wxUninitialize()
|
||||
extern void WXDLLEXPORT wxUninitialize();
|
||||
|
||||
// create an object of this class on stack to initialize/cleanup thel ibrary
|
||||
// automatically
|
||||
class WXDLLEXPORT wxInitializer
|
||||
{
|
||||
public:
|
||||
// initialize the library
|
||||
wxInitializer() { m_ok = wxInitialize(); }
|
||||
|
||||
// has the initialization been successful? (explicit test)
|
||||
bool IsOk() const { return m_ok; }
|
||||
|
||||
// has the initialization been successful? (implicit test)
|
||||
operator bool() const { return m_ok; }
|
||||
|
||||
// dtor only does clean up if we initialized the library properly
|
||||
~wxInitializer() { if ( m_ok ) wxUninitialize(); }
|
||||
|
||||
private:
|
||||
bool m_ok;
|
||||
};
|
||||
|
||||
#endif // !wxUSE_GUI
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// macros for dynamic creation of the application object
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// Having a global instance of this class allows wxApp to be aware of the app
|
||||
// creator function. wxApp can then call this function to create a new app
|
||||
// object. Convoluted, but necessary.
|
||||
|
||||
class WXDLLEXPORT wxAppInitializer
|
||||
{
|
||||
public:
|
||||
wxAppInitializer(wxAppInitializerFunction fn)
|
||||
{ wxApp::SetInitializerFunction(fn); }
|
||||
};
|
||||
|
||||
// Here's a macro you can use if your compiler really, really wants main() to
|
||||
// be in your main program (e.g. hello.cpp). Now IMPLEMENT_APP should add this
|
||||
// code if required.
|
||||
|
||||
#if !wxUSE_GUI || defined(__WXMOTIF__) || defined(__WXGTK__) || defined(__WXPM__) || defined(__WXMGL__)
|
||||
#define IMPLEMENT_WXWIN_MAIN \
|
||||
extern int wxEntry( int argc, char *argv[] ); \
|
||||
int main(int argc, char *argv[]) { return wxEntry(argc, argv); }
|
||||
#elif defined(__WXMAC__) && defined(__UNIX__)
|
||||
// wxMac seems to have a specific wxEntry prototype
|
||||
#define IMPLEMENT_WXWIN_MAIN \
|
||||
extern int wxEntry( int argc, char *argv[], bool enterLoop = 1 ); \
|
||||
int main(int argc, char *argv[]) { return wxEntry(argc, argv); }
|
||||
#elif defined(__WXMSW__) && defined(WXUSINGDLL)
|
||||
// NT defines APIENTRY, 3.x not
|
||||
#if !defined(WXAPIENTRY)
|
||||
#define WXAPIENTRY WXFAR wxSTDCALL
|
||||
#endif
|
||||
|
||||
#include <windows.h>
|
||||
#include "wx/msw/winundef.h"
|
||||
|
||||
#define IMPLEMENT_WXWIN_MAIN \
|
||||
extern "C" int WXAPIENTRY WinMain(HINSTANCE hInstance,\
|
||||
HINSTANCE hPrevInstance,\
|
||||
LPSTR m_lpCmdLine, int nCmdShow)\
|
||||
{\
|
||||
return wxEntry((WXHINSTANCE) hInstance,\
|
||||
(WXHINSTANCE) hPrevInstance,\
|
||||
m_lpCmdLine, nCmdShow);\
|
||||
}
|
||||
#else
|
||||
#define IMPLEMENT_WXWIN_MAIN
|
||||
#endif
|
||||
|
||||
#ifdef __WXUNIVERSAL__
|
||||
#include "wx/univ/theme.h"
|
||||
|
||||
#define IMPLEMENT_WX_THEME_SUPPORT \
|
||||
WX_USE_THEME(win32); \
|
||||
WX_USE_THEME(gtk);
|
||||
#else
|
||||
#define IMPLEMENT_WX_THEME_SUPPORT
|
||||
#endif
|
||||
|
||||
// Use this macro if you want to define your own main() or WinMain() function
|
||||
// and call wxEntry() from there.
|
||||
#define IMPLEMENT_APP_NO_MAIN(appname) \
|
||||
wxApp *wxCreateApp() { return new appname; } \
|
||||
wxAppInitializer wxTheAppInitializer((wxAppInitializerFunction) wxCreateApp); \
|
||||
appname& wxGetApp() { return *(appname *)wxTheApp; }
|
||||
|
||||
// Same as IMPLEMENT_APP() normally but doesn't include themes support in
|
||||
// wxUniversal builds
|
||||
#define IMPLEMENT_APP_NO_THEMES(appname) \
|
||||
IMPLEMENT_APP_NO_MAIN(appname) \
|
||||
IMPLEMENT_WXWIN_MAIN
|
||||
|
||||
// Use this macro exactly once, the argument is the name of the wxApp-derived
|
||||
// class which is the class of your application.
|
||||
#define IMPLEMENT_APP(appname) \
|
||||
IMPLEMENT_APP_NO_THEMES(appname) \
|
||||
IMPLEMENT_WX_THEME_SUPPORT
|
||||
|
||||
// this macro can be used multiple times and just allows you to use wxGetApp()
|
||||
// function
|
||||
#define DECLARE_APP(appname) extern appname& wxGetApp();
|
||||
|
||||
#endif
|
||||
// _WX_APP_H_BASE_
|
175
include/wx/bitmap.h
Normal file
175
include/wx/bitmap.h
Normal file
@@ -0,0 +1,175 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/bitmap.h
|
||||
// Purpose: wxBitmap class interface
|
||||
// Author: Vaclav Slavik
|
||||
// Modified by:
|
||||
// Created: 22.04.01
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) wxWindows team
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_BITMAP_H_BASE_
|
||||
#define _WX_BITMAP_H_BASE_
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "bitmapbase.h"
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
#include "wx/object.h"
|
||||
#include "wx/string.h"
|
||||
#include "wx/gdiobj.h"
|
||||
#include "wx/gdicmn.h" // for wxBitmapType
|
||||
|
||||
class WXDLLEXPORT wxBitmap;
|
||||
class WXDLLEXPORT wxBitmapHandler;
|
||||
class WXDLLEXPORT wxImage;
|
||||
class WXDLLEXPORT wxMask;
|
||||
class WXDLLEXPORT wxPalette;
|
||||
|
||||
#if defined(__WXMGL__) || defined(__WXMAC__)
|
||||
// Only used by some ports
|
||||
// FIXME -- make all ports (but MSW which uses wxGDIImage) use these base classes
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxBitmapHandler: class which knows how to create/load/save bitmaps in
|
||||
// different formats
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxBitmapHandlerBase : public wxObject
|
||||
{
|
||||
public:
|
||||
wxBitmapHandlerBase()
|
||||
{
|
||||
m_type = wxBITMAP_TYPE_INVALID;
|
||||
}
|
||||
|
||||
virtual ~wxBitmapHandlerBase() { }
|
||||
|
||||
virtual bool Create(wxBitmap *bitmap, void *data, long flags,
|
||||
int width, int height, int depth = 1) = 0;
|
||||
virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, long flags,
|
||||
int desiredWidth, int desiredHeight) = 0;
|
||||
virtual bool SaveFile(const wxBitmap *bitmap, const wxString& name,
|
||||
int type, const wxPalette *palette = NULL) = 0;
|
||||
|
||||
void SetName(const wxString& name) { m_name = name; }
|
||||
void SetExtension(const wxString& ext) { m_extension = ext; }
|
||||
void SetType(wxBitmapType type) { m_type = type; }
|
||||
wxString GetName() const { return m_name; }
|
||||
wxString GetExtension() const { return m_extension; }
|
||||
wxBitmapType GetType() const { return m_type; }
|
||||
|
||||
protected:
|
||||
wxString m_name;
|
||||
wxString m_extension;
|
||||
wxBitmapType m_type;
|
||||
|
||||
DECLARE_ABSTRACT_CLASS(wxBitmapHandlerBase)
|
||||
};
|
||||
|
||||
class WXDLLEXPORT wxBitmapBase : public wxGDIObject
|
||||
{
|
||||
public:
|
||||
wxBitmapBase() : wxGDIObject() {}
|
||||
virtual ~wxBitmapBase() {}
|
||||
|
||||
/*
|
||||
Derived class must implement these:
|
||||
|
||||
wxBitmap();
|
||||
wxBitmap(int width, int height, int depth = -1);
|
||||
wxBitmap(const char bits[], int width, int height, int depth = 1);
|
||||
wxBitmap(const char **bits);
|
||||
wxBitmap(char **bits);
|
||||
wxBitmap(const wxBitmap& bmp);
|
||||
wxBitmap(const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_XPM);
|
||||
wxBitmap(const wxImage& image, int depth = -1);
|
||||
wxBitmap& operator = (const wxBitmap& bmp);
|
||||
bool operator == (const wxBitmap& bmp) const;
|
||||
bool operator != (const wxBitmap& bmp) const;
|
||||
|
||||
bool Create(int width, int height, int depth = -1);
|
||||
|
||||
static void InitStandardHandlers();
|
||||
*/
|
||||
|
||||
virtual bool Ok() const = 0;
|
||||
|
||||
virtual int GetHeight() const = 0;
|
||||
virtual int GetWidth() const = 0;
|
||||
virtual int GetDepth() const = 0;
|
||||
|
||||
virtual wxImage ConvertToImage() const = 0;
|
||||
|
||||
virtual wxMask *GetMask() const = 0;
|
||||
virtual void SetMask(wxMask *mask) = 0;
|
||||
|
||||
virtual wxBitmap GetSubBitmap(const wxRect& rect) const = 0;
|
||||
|
||||
virtual bool SaveFile(const wxString &name, wxBitmapType type,
|
||||
const wxPalette *palette = (wxPalette *)NULL) const = 0;
|
||||
virtual bool LoadFile(const wxString &name, wxBitmapType type) = 0;
|
||||
|
||||
virtual wxPalette *GetPalette() const = 0;
|
||||
virtual void SetPalette(const wxPalette& palette) = 0;
|
||||
|
||||
#if WXWIN_COMPATIBILITY
|
||||
wxPalette *GetColourMap() const { return GetPalette(); }
|
||||
void SetColourMap(wxPalette *cmap) { SetPalette(*cmap); };
|
||||
#endif // WXWIN_COMPATIBILITY
|
||||
|
||||
// copies the contents and mask of the given (colour) icon to the bitmap
|
||||
virtual bool CopyFromIcon(const wxIcon& icon) = 0;
|
||||
|
||||
// implementation:
|
||||
virtual void SetHeight(int height) = 0;
|
||||
virtual void SetWidth(int width) = 0;
|
||||
virtual void SetDepth(int depth) = 0;
|
||||
|
||||
// Format handling
|
||||
static inline wxList& GetHandlers() { return sm_handlers; }
|
||||
static void AddHandler(wxBitmapHandlerBase *handler);
|
||||
static void InsertHandler(wxBitmapHandlerBase *handler);
|
||||
static bool RemoveHandler(const wxString& name);
|
||||
static wxBitmapHandler *FindHandler(const wxString& name);
|
||||
static wxBitmapHandler *FindHandler(const wxString& extension, wxBitmapType bitmapType);
|
||||
static wxBitmapHandler *FindHandler(wxBitmapType bitmapType);
|
||||
|
||||
//static void InitStandardHandlers();
|
||||
// (wxBitmap must implement this one)
|
||||
|
||||
static void CleanUpHandlers();
|
||||
|
||||
protected:
|
||||
static wxList sm_handlers;
|
||||
|
||||
DECLARE_ABSTRACT_CLASS(wxBitmapBase)
|
||||
};
|
||||
#endif
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#include "wx/msw/bitmap.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/bitmap.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/bitmap.h"
|
||||
#elif defined(__WXMGL__)
|
||||
#include "wx/mgl/bitmap.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/bitmap.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/bitmap.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/bitmap.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/stubs/bitmap.h"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
// _WX_BITMAP_H_BASE_
|
98
include/wx/bmpbuttn.h
Normal file
98
include/wx/bmpbuttn.h
Normal file
@@ -0,0 +1,98 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/bmpbutton.h
|
||||
// Purpose: wxBitmapButton class interface
|
||||
// Author: Vadim Zeitlin
|
||||
// Modified by:
|
||||
// Created: 25.08.00
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2000 Vadim Zeitlin
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_BMPBUTTON_H_BASE_
|
||||
#define _WX_BMPBUTTON_H_BASE_
|
||||
|
||||
#if wxUSE_BMPBUTTON
|
||||
|
||||
#include "wx/bitmap.h"
|
||||
#include "wx/button.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const wxChar*) wxButtonNameStr;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxBitmapButton: a button which shows bitmaps instead of the usual string.
|
||||
// It has different bitmaps for different states (focused/disabled/pressed)
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxBitmapButtonBase : public wxButton
|
||||
{
|
||||
public:
|
||||
wxBitmapButtonBase() { m_marginX = m_marginY = 0; }
|
||||
|
||||
// set the bitmaps
|
||||
void SetBitmapLabel(const wxBitmap& bitmap)
|
||||
{ m_bmpNormal = bitmap; OnSetBitmap(); }
|
||||
void SetBitmapSelected(const wxBitmap& sel)
|
||||
{ m_bmpSelected = sel; OnSetBitmap(); };
|
||||
void SetBitmapFocus(const wxBitmap& focus)
|
||||
{ m_bmpFocus = focus; OnSetBitmap(); };
|
||||
void SetBitmapDisabled(const wxBitmap& disabled)
|
||||
{ m_bmpDisabled = disabled; OnSetBitmap(); };
|
||||
void SetLabel(const wxBitmap& bitmap)
|
||||
{ SetBitmapLabel(bitmap); }
|
||||
|
||||
// retrieve the bitmaps
|
||||
const wxBitmap& GetBitmapLabel() const { return m_bmpNormal; }
|
||||
const wxBitmap& GetBitmapSelected() const { return m_bmpSelected; }
|
||||
const wxBitmap& GetBitmapFocus() const { return m_bmpFocus; }
|
||||
const wxBitmap& GetBitmapDisabled() const { return m_bmpDisabled; }
|
||||
wxBitmap& GetBitmapLabel() { return m_bmpNormal; }
|
||||
wxBitmap& GetBitmapSelected() { return m_bmpSelected; }
|
||||
wxBitmap& GetBitmapFocus() { return m_bmpFocus; }
|
||||
wxBitmap& GetBitmapDisabled() { return m_bmpDisabled; }
|
||||
|
||||
// set/get the margins around the button
|
||||
virtual void SetMargins(int x, int y) { m_marginX = x; m_marginY = y; }
|
||||
int GetMarginX() const { return m_marginX; }
|
||||
int GetMarginY() const { return m_marginY; }
|
||||
|
||||
protected:
|
||||
// function called when any of the bitmaps changes
|
||||
virtual void OnSetBitmap() { }
|
||||
|
||||
// the bitmaps for various states
|
||||
wxBitmap m_bmpNormal,
|
||||
m_bmpSelected,
|
||||
m_bmpFocus,
|
||||
m_bmpDisabled;
|
||||
|
||||
// the margins around the bitmap
|
||||
int m_marginX,
|
||||
m_marginY;
|
||||
private:
|
||||
// Prevent Virtual function hiding warnings
|
||||
void SetLabel(const wxString& rsLabel)
|
||||
{ wxWindowBase::SetLabel(rsLabel); }
|
||||
};
|
||||
|
||||
#if defined(__WXUNIVERSAL__)
|
||||
#include "wx/univ/bmpbuttn.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/bmpbuttn.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/bmpbuttn.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/bmpbuttn.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/bmpbuttn.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/bmpbuttn.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/bmpbuttn.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/stubs/bmpbuttn.h"
|
||||
#endif
|
||||
|
||||
#endif // wxUSE_BMPBUTTON
|
||||
|
||||
#endif // _WX_BMPBUTTON_H_BASE_
|
23
include/wx/brush.h
Normal file
23
include/wx/brush.h
Normal file
@@ -0,0 +1,23 @@
|
||||
#ifndef _WX_BRUSH_H_BASE_
|
||||
#define _WX_BRUSH_H_BASE_
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#include "wx/msw/brush.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/brush.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/brush.h"
|
||||
#elif defined(__WXMGL__)
|
||||
#include "wx/mgl/brush.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/brush.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/brush.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/brush.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/stubs/brush.h"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
// _WX_BRUSH_H_BASE_
|
82
include/wx/button.h
Normal file
82
include/wx/button.h
Normal file
@@ -0,0 +1,82 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/button.h
|
||||
// Purpose: wxButtonBase class
|
||||
// Author: Vadim Zetlin
|
||||
// Modified by:
|
||||
// Created: 15.08.00
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Vadim Zetlin
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_BUTTON_H_BASE_
|
||||
#define _WX_BUTTON_H_BASE_
|
||||
|
||||
#if wxUSE_BUTTON
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxButton flags
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// all these flags are obsolete
|
||||
#define wxBU_NOAUTODRAW 0x0000
|
||||
#define wxBU_AUTODRAW 0x0004
|
||||
#define wxBU_LEFT 0x0040
|
||||
#define wxBU_TOP 0x0080
|
||||
#define wxBU_RIGHT 0x0100
|
||||
#define wxBU_BOTTOM 0x0200
|
||||
|
||||
// by default, the buttons will be created with some (system dependent)
|
||||
// minimal size to make them look nicer, giving this style will make them as
|
||||
// small as possible
|
||||
#define wxBU_EXACTFIT 0x0001
|
||||
|
||||
#include "wx/control.h"
|
||||
|
||||
class WXDLLEXPORT wxBitmap;
|
||||
|
||||
WXDLLEXPORT_DATA(extern const wxChar*) wxButtonNameStr;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxButton: a push button
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxButtonBase : public wxControl
|
||||
{
|
||||
public:
|
||||
// show the image in the button in addition to the label
|
||||
virtual void SetImageLabel(const wxBitmap& WXUNUSED(bitmap)) { }
|
||||
|
||||
// set the margins around the image
|
||||
virtual void SetImageMargins(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y)) { }
|
||||
|
||||
// this wxButton method is called when the button becomes the default one
|
||||
// on its panel
|
||||
virtual void SetDefault() { }
|
||||
|
||||
// returns the default button size for this platform
|
||||
static wxSize GetDefaultSize();
|
||||
};
|
||||
|
||||
#if defined(__WXUNIVERSAL__)
|
||||
#include "wx/univ/button.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/button.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/button.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/button.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/button.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/button.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/button.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/stubs/button.h"
|
||||
#endif
|
||||
|
||||
#endif // wxUSE_BUTTON
|
||||
|
||||
#endif
|
||||
// _WX_BUTTON_H_BASE_
|
56
include/wx/checkbox.h
Normal file
56
include/wx/checkbox.h
Normal file
@@ -0,0 +1,56 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/checkbox.h
|
||||
// Purpose: wxCheckBox class interface
|
||||
// Author: Vadim Zeitlin
|
||||
// Modified by:
|
||||
// Created: 07.09.00
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) wxWindows team
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_CHECKBOX_H_BASE_
|
||||
#define _WX_CHECKBOX_H_BASE_
|
||||
|
||||
#if wxUSE_CHECKBOX
|
||||
|
||||
#include "wx/control.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const wxChar*) wxCheckBoxNameStr;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxCheckBox: a control which shows a label and a box which may be checked
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxCheckBoxBase : public wxControl
|
||||
{
|
||||
public:
|
||||
// set/get the checked status of the listbox
|
||||
virtual void SetValue(bool value) = 0;
|
||||
virtual bool GetValue() const = 0;
|
||||
|
||||
bool IsChecked() const { return GetValue(); }
|
||||
};
|
||||
|
||||
#if defined(__WXUNIVERSAL__)
|
||||
#include "wx/univ/checkbox.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/checkbox.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/checkbox.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/checkbox.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/checkbox.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/checkbox.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/checkbox.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/stubs/checkbox.h"
|
||||
#endif
|
||||
|
||||
#endif // wxUSE_CHECKBOX
|
||||
|
||||
#endif
|
||||
// _WX_CHECKBOX_H_BASE_
|
52
include/wx/checklst.h
Normal file
52
include/wx/checklst.h
Normal file
@@ -0,0 +1,52 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/checklst.h
|
||||
// Purpose: wxCheckListBox class interface
|
||||
// Author: Vadim Zeitlin
|
||||
// Modified by:
|
||||
// Created: 12.09.00
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Vadim Zeitlin
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_CHECKLST_H_BASE_
|
||||
#define _WX_CHECKLST_H_BASE_
|
||||
|
||||
#if wxUSE_CHECKLISTBOX
|
||||
|
||||
#include "wx/listbox.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxCheckListBox: a listbox whose items may be checked
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxCheckListBoxBase : public wxListBox
|
||||
{
|
||||
public:
|
||||
// check list box specific methods
|
||||
virtual bool IsChecked(size_t item) const = 0;
|
||||
virtual void Check(size_t item, bool check = TRUE) = 0;
|
||||
};
|
||||
|
||||
#if defined(__WXUNIVERSAL__)
|
||||
#include "wx/univ/checklst.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/checklst.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/checklst.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/checklst.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/checklst.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/checklst.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/checklst.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/stubs/checklst.h"
|
||||
#endif
|
||||
|
||||
#endif // wxUSE_CHECKLISTBOX
|
||||
|
||||
#endif
|
||||
// _WX_CHECKLST_H_BASE_
|
85
include/wx/choice.h
Normal file
85
include/wx/choice.h
Normal file
@@ -0,0 +1,85 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/choice.h
|
||||
// Purpose: wxChoice class interface
|
||||
// Author: Vadim Zeitlin
|
||||
// Modified by:
|
||||
// Created: 26.07.99
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) wxWindows team
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_CHOICE_H_BASE_
|
||||
#define _WX_CHOICE_H_BASE_
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "choicebase.h"
|
||||
#endif
|
||||
|
||||
#if wxUSE_CHOICE
|
||||
|
||||
#include "wx/ctrlsub.h" // the base class
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// global data
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
WXDLLEXPORT_DATA(extern const wxChar*) wxChoiceNameStr;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxChoice allows to select one of a non-modifiable list of strings
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxChoiceBase : public wxControlWithItems
|
||||
{
|
||||
public:
|
||||
// all generic methods are in wxControlWithItems
|
||||
#ifdef __DARWIN__
|
||||
virtual ~wxChoiceBase() {}
|
||||
#endif
|
||||
|
||||
// single selection logic
|
||||
virtual void SetSelection(int n) = 0;
|
||||
virtual bool SetStringSelection(const wxString& s);
|
||||
|
||||
// don't override this
|
||||
virtual void Select(int n) { SetSelection(n); }
|
||||
|
||||
// set/get the number of columns in the control (as they're not supporte on
|
||||
// most platforms, they do nothing by default)
|
||||
virtual void SetColumns(int WXUNUSED(n) = 1 ) { }
|
||||
virtual int GetColumns() const { return 1 ; }
|
||||
|
||||
// emulate selecting the item event.GetInt()
|
||||
void Command(wxCommandEvent& event);
|
||||
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// include the platform-dependent class definition
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#include "wx/msw/choice.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/choice.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/choice.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/choice.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/choice.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/choice.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/stubs/choice.h"
|
||||
#endif
|
||||
|
||||
#endif // wxUSE_CHOICE
|
||||
|
||||
#endif
|
||||
// _WX_CHOICE_H_BASE_
|
142
include/wx/clipbrd.h
Normal file
142
include/wx/clipbrd.h
Normal file
@@ -0,0 +1,142 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/clipbrd.h
|
||||
// Purpose: wxClipboad class and clipboard functions
|
||||
// Author: Vadim Zeitlin
|
||||
// Modified by:
|
||||
// Created: 19.10.99
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) wxWindows Team
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_CLIPBRD_H_BASE_
|
||||
#define _WX_CLIPBRD_H_BASE_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "clipboardbase.h"
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_CLIPBOARD
|
||||
|
||||
|
||||
#include "wx/object.h"
|
||||
#include "wx/wxchar.h"
|
||||
|
||||
class WXDLLEXPORT wxDataFormat;
|
||||
class WXDLLEXPORT wxDataObject;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxClipboard represents the system clipboard. Normally, you should use
|
||||
// wxTheClipboard which is a global pointer to the (unique) clipboard.
|
||||
//
|
||||
// Clipboard can be used to copy data to/paste data from. It works together
|
||||
// with wxDataObject.
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxClipboardBase : public wxObject
|
||||
{
|
||||
public:
|
||||
wxClipboardBase();
|
||||
|
||||
// open the clipboard before Add/SetData() and GetData()
|
||||
virtual bool Open() = 0;
|
||||
|
||||
// close the clipboard after Add/SetData() and GetData()
|
||||
virtual void Close() = 0;
|
||||
|
||||
// query whether the clipboard is opened
|
||||
virtual bool IsOpened() const = 0;
|
||||
|
||||
// add to the clipboard data
|
||||
//
|
||||
// NB: the clipboard owns the pointer and will delete it, so data must be
|
||||
// allocated on the heap
|
||||
virtual bool AddData( wxDataObject *data ) = 0;
|
||||
|
||||
// set the clipboard data, this is the same as Clear() followed by
|
||||
// AddData()
|
||||
virtual bool SetData( wxDataObject *data ) = 0;
|
||||
|
||||
// ask if data in correct format is available
|
||||
virtual bool IsSupported( const wxDataFormat& format ) = 0;
|
||||
|
||||
// fill data with data on the clipboard (if available)
|
||||
virtual bool GetData( wxDataObject& data ) = 0;
|
||||
|
||||
// clears wxTheClipboard and the system's clipboard if possible
|
||||
virtual void Clear() = 0;
|
||||
|
||||
// flushes the clipboard: this means that the data which is currently on
|
||||
// clipboard will stay available even after the application exits (possibly
|
||||
// eating memory), otherwise the clipboard will be emptied on exit
|
||||
virtual bool Flush() { return FALSE; }
|
||||
|
||||
// X11 has two clipboards which get selected by this call. Empty on MSW.
|
||||
virtual void UsePrimarySelection( bool WXUNUSED(primary) = FALSE ) { }
|
||||
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// include platform-specific class declaration
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#include "wx/msw/clipbrd.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/clipbrd.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/clipbrd.h"
|
||||
#elif defined(__WXMGL__)
|
||||
#include "wx/mgl/clipbrd.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/gtk/clipbrd.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/clipbrd.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/clipbrd.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/stubs/clipbrd.h"
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// globals
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// The global clipboard object
|
||||
WXDLLEXPORT_DATA(extern wxClipboard *) wxTheClipboard;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// helpful class for opening the clipboard and automatically closing it
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxClipboardLocker
|
||||
{
|
||||
public:
|
||||
wxClipboardLocker(wxClipboard *clipboard = (wxClipboard *)NULL)
|
||||
{
|
||||
m_clipboard = clipboard ? clipboard : wxTheClipboard;
|
||||
if ( m_clipboard )
|
||||
{
|
||||
m_clipboard->Open();
|
||||
}
|
||||
}
|
||||
|
||||
bool operator!() const { return !m_clipboard->IsOpened(); }
|
||||
|
||||
~wxClipboardLocker()
|
||||
{
|
||||
if ( m_clipboard )
|
||||
{
|
||||
m_clipboard->Close();
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
wxClipboard *m_clipboard;
|
||||
};
|
||||
|
||||
#endif // wxUSE_CLIPBOARD
|
||||
|
||||
#endif // _WX_CLIPBRD_H_BASE_
|
25
include/wx/colour.h
Normal file
25
include/wx/colour.h
Normal file
@@ -0,0 +1,25 @@
|
||||
#ifndef _WX_COLOUR_H_BASE_
|
||||
#define _WX_COLOUR_H_BASE_
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#include "wx/msw/colour.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/colour.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/colour.h"
|
||||
#elif defined(__WXMGL__)
|
||||
#include "wx/mgl/colour.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/colour.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/colour.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/colour.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/stubs/colour.h"
|
||||
#endif
|
||||
|
||||
#define wxColor wxColour
|
||||
|
||||
#endif
|
||||
// _WX_COLOUR_H_BASE_
|
75
include/wx/combobox.h
Normal file
75
include/wx/combobox.h
Normal file
@@ -0,0 +1,75 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/combobox.h
|
||||
// Purpose: wxComboBox declaration
|
||||
// Author: Vadim Zeitlin
|
||||
// Modified by:
|
||||
// Created: 24.12.00
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 1996-2000 wxWindows team
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_COMBOBOX_H_BASE_
|
||||
#define _WX_COMBOBOX_H_BASE_
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_COMBOBOX
|
||||
|
||||
WXDLLEXPORT_DATA(extern const wxChar*) wxComboBoxNameStr;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxComboBoxBase: this interface defines the methods wxComboBox must implement
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#include "wx/ctrlsub.h"
|
||||
|
||||
class WXDLLEXPORT wxComboBoxBase : public wxItemContainer
|
||||
{
|
||||
public:
|
||||
// wxTextCtrl-like methods wxComboBox must implement
|
||||
virtual wxString GetValue() const = 0;
|
||||
virtual void SetValue(const wxString& value) = 0;
|
||||
|
||||
virtual void Copy() = 0;
|
||||
virtual void Cut() = 0;
|
||||
virtual void Paste() = 0;
|
||||
virtual void SetInsertionPoint(long pos) = 0;
|
||||
virtual long GetInsertionPoint() const = 0;
|
||||
virtual long GetLastPosition() const = 0;
|
||||
virtual void Replace(long from, long to, const wxString& value) = 0;
|
||||
virtual void SetSelection(long from, long to) = 0;
|
||||
virtual void SetEditable(bool editable) = 0;
|
||||
|
||||
virtual void SetInsertionPointEnd()
|
||||
{ SetInsertionPoint(GetLastPosition()); }
|
||||
virtual void Remove(long from, long to)
|
||||
{ Replace(from, to, wxEmptyString); }
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// include the platform-dependent header defining the real class
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__WXUNIVERSAL__)
|
||||
#include "wx/univ/combobox.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/combobox.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/combobox.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/combobox.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/combobox.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/combobox.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/combobox.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/stubs/combobox.h"
|
||||
#endif
|
||||
|
||||
#endif // wxUSE_COMBOBOX
|
||||
|
||||
#endif
|
||||
// _WX_COMBOBOX_H_BASE_
|
98
include/wx/control.h
Normal file
98
include/wx/control.h
Normal file
@@ -0,0 +1,98 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/control.h
|
||||
// Purpose: wxControl common interface
|
||||
// Author: Vadim Zeitlin
|
||||
// Modified by:
|
||||
// Created: 26.07.99
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) wxWindows team
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_CONTROL_H_BASE_
|
||||
#define _WX_CONTROL_H_BASE_
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "controlbase.h"
|
||||
#endif
|
||||
|
||||
#if wxUSE_CONTROLS
|
||||
|
||||
#include "wx/window.h" // base class
|
||||
|
||||
WXDLLEXPORT_DATA(extern const wxChar*) wxControlNameStr;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxControl is the base class for all controls
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxControlBase : public wxWindow
|
||||
{
|
||||
public:
|
||||
// Create() function adds the validator parameter
|
||||
bool Create(wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxControlNameStr);
|
||||
|
||||
// simulates the event of given type (i.e. wxButton::Command() is just as
|
||||
// if the button was clicked)
|
||||
virtual void Command(wxCommandEvent &event);
|
||||
|
||||
// get the control alignment (left/right/centre, top/bottom/centre)
|
||||
int GetAlignment() const { return m_windowStyle & wxALIGN_MASK; }
|
||||
|
||||
#ifdef __DARWIN__
|
||||
virtual ~wxControlBase() { }
|
||||
#endif
|
||||
|
||||
protected:
|
||||
// creates the control (calls wxWindowBase::CreateBase inside) and adds it
|
||||
// to the list of parents children
|
||||
bool CreateControl(wxWindowBase *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
long style,
|
||||
const wxValidator& validator,
|
||||
const wxString& name);
|
||||
|
||||
// inherit colour and font settings from the parent window
|
||||
void InheritAttributes();
|
||||
|
||||
// initialize the common fields of wxCommandEvent
|
||||
void InitCommandEvent(wxCommandEvent& event) const;
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// include platform-dependent wxControl declarations
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__WXUNIVERSAL__)
|
||||
#include "wx/univ/control.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/control.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/control.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/control.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/control.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/control.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/control.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/stubs/control.h"
|
||||
#endif
|
||||
|
||||
#endif // wxUSE_CONTROLS
|
||||
|
||||
#endif
|
||||
// _WX_CONTROL_H_BASE_
|
60
include/wx/cursor.h
Normal file
60
include/wx/cursor.h
Normal file
@@ -0,0 +1,60 @@
|
||||
#ifndef _WX_CURSOR_H_BASE_
|
||||
#define _WX_CURSOR_H_BASE_
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#include "wx/msw/cursor.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/cursor.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/cursor.h"
|
||||
#elif defined(__WXMGL__)
|
||||
#include "wx/mgl/cursor.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/cursor.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/cursor.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/cursor.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/stubs/cursor.h"
|
||||
#endif
|
||||
|
||||
#include "wx/utils.h"
|
||||
|
||||
/* This is a small class which can be used by all ports
|
||||
to temporarily suspend the busy cursor. Useful in modal
|
||||
dialogs.
|
||||
|
||||
Actually that is not (any longer) quite true.. currently it is
|
||||
only used in wxGTK Dialog::ShowModal() and now uses static
|
||||
wxBusyCursor methods that are only implemented for wxGTK so far.
|
||||
The BusyCursor handling code should probably be implemented in
|
||||
common code somewhere instead of the separate implementations we
|
||||
currently have. Also the name BusyCursorSuspender is a little
|
||||
misleading since it doesn't actually suspend the BusyCursor, just
|
||||
masks one that is already showing.
|
||||
If another call to wxBeginBusyCursor is made while this is active
|
||||
the Busy Cursor will again be shown. But at least now it doesn't
|
||||
interfere with the state of wxIsBusy() -- RL
|
||||
|
||||
*/
|
||||
class wxBusyCursorSuspender
|
||||
{
|
||||
public:
|
||||
wxBusyCursorSuspender()
|
||||
{
|
||||
if( wxIsBusy() )
|
||||
{
|
||||
wxSetCursor( wxBusyCursor::GetStoredCursor() );
|
||||
}
|
||||
}
|
||||
~wxBusyCursorSuspender()
|
||||
{
|
||||
if( wxIsBusy() )
|
||||
{
|
||||
wxSetCursor( wxBusyCursor::GetBusyCursor() );
|
||||
}
|
||||
}
|
||||
};
|
||||
#endif
|
||||
// _WX_CURSOR_H_BASE_
|
467
include/wx/dataobj.h
Normal file
467
include/wx/dataobj.h
Normal file
@@ -0,0 +1,467 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/dataobj.h
|
||||
// Purpose: common data object classes
|
||||
// Author: Vadim Zeitlin, Robert Roebling
|
||||
// Modified by:
|
||||
// Created: 26.05.99
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) wxWindows Team
|
||||
// Licence: wxWindows license
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_DATAOBJ_H_BASE_
|
||||
#define _WX_DATAOBJ_H_BASE_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "dataobjbase.h"
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#include "wx/defs.h"
|
||||
#include "wx/string.h"
|
||||
#include "wx/bitmap.h"
|
||||
#include "wx/list.h"
|
||||
|
||||
// ============================================================================
|
||||
/*
|
||||
Generic data transfer related classes. The class hierarchy is as follows:
|
||||
|
||||
- wxDataObject-
|
||||
/ \
|
||||
/ \
|
||||
wxDataObjectSimple wxDataObjectComposite
|
||||
/ | \
|
||||
/ | \
|
||||
wxTextDataObject | wxBitmapDataObject
|
||||
|
|
||||
wxCustomDataObject
|
||||
|
||||
*/
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxDataFormat class is declared in platform-specific headers: it represents
|
||||
// a format for data which may be either one of the standard ones (text,
|
||||
// bitmap, ...) or a custom one which is then identified by a unique string.
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
/* the class interface looks like this (pseudo code):
|
||||
|
||||
class wxDataFormat
|
||||
{
|
||||
public:
|
||||
typedef <integral type> NativeFormat;
|
||||
|
||||
wxDataFormat(NativeFormat format = wxDF_INVALID);
|
||||
wxDataFormat(const wxChar *format);
|
||||
|
||||
wxDataFormat& operator=(NativeFormat format);
|
||||
wxDataFormat& operator=(const wxDataFormat& format);
|
||||
|
||||
bool operator==(NativeFormat format) const;
|
||||
bool operator!=(NativeFormat format) const;
|
||||
|
||||
void SetType(NativeFormat format);
|
||||
NativeFormat GetType() const;
|
||||
|
||||
wxString GetId() const;
|
||||
void SetId(const wxChar *format);
|
||||
};
|
||||
|
||||
*/
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#include "wx/msw/ole/dataform.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/dataform.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/dataform.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/dataform.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/dataform.h"
|
||||
#endif
|
||||
|
||||
// the value for default argument to some functions (corresponds to
|
||||
// wxDF_INVALID)
|
||||
extern WXDLLEXPORT const wxDataFormat& wxFormatInvalid;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxDataObject represents a piece of data which knows which formats it
|
||||
// supports and knows how to render itself in each of them - GetDataHere(),
|
||||
// and how to restore data from the buffer (SetData()).
|
||||
//
|
||||
// Although this class may be used directly (i.e. custom classes may be
|
||||
// derived from it), in many cases it might be simpler to use either
|
||||
// wxDataObjectSimple or wxDataObjectComposite classes.
|
||||
//
|
||||
// A data object may be "read only", i.e. support only GetData() functions or
|
||||
// "read-write", i.e. support both GetData() and SetData() (in principle, it
|
||||
// might be "write only" too, but this is rare). Moreover, it doesn't have to
|
||||
// support the same formats in Get() and Set() directions: for example, a data
|
||||
// object containing JPEG image might accept BMPs in GetData() because JPEG
|
||||
// image may be easily transformed into BMP but not in SetData(). Accordingly,
|
||||
// all methods dealing with formats take an additional "direction" argument
|
||||
// which is either SET or GET and which tells the function if the format needs
|
||||
// to be supported by SetData() or GetDataHere().
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxDataObjectBase
|
||||
{
|
||||
public:
|
||||
enum Direction
|
||||
{
|
||||
Get = 0x01, // format is supported by GetDataHere()
|
||||
Set = 0x02, // format is supported by SetData()
|
||||
Both = 0x03 // format is supported by both (unused currently)
|
||||
};
|
||||
|
||||
// this class is polymorphic, hence it needs a virtual dtor
|
||||
virtual ~wxDataObjectBase();
|
||||
|
||||
// get the best suited format for rendering our data
|
||||
virtual wxDataFormat GetPreferredFormat(Direction dir = Get) const = 0;
|
||||
|
||||
// get the number of formats we support
|
||||
virtual size_t GetFormatCount(Direction dir = Get) const = 0;
|
||||
|
||||
// return all formats in the provided array (of size GetFormatCount())
|
||||
virtual void GetAllFormats(wxDataFormat *formats,
|
||||
Direction dir = Get) const = 0;
|
||||
|
||||
// get the (total) size of data for the given format
|
||||
virtual size_t GetDataSize(const wxDataFormat& format) const = 0;
|
||||
|
||||
// copy raw data (in the specified format) to the provided buffer, return
|
||||
// TRUE if data copied successfully, FALSE otherwise
|
||||
virtual bool GetDataHere(const wxDataFormat& format, void *buf) const = 0;
|
||||
|
||||
// get data from the buffer of specified length (in the given format),
|
||||
// return TRUE if the data was read successfully, FALSE otherwise
|
||||
virtual bool SetData(const wxDataFormat& WXUNUSED(format),
|
||||
size_t WXUNUSED(len), const void * WXUNUSED(buf))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// returns TRUE if this format is supported
|
||||
bool IsSupported(const wxDataFormat& format, Direction dir = Get) const;
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// include the platform-specific declarations of wxDataObject
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#include "wx/msw/ole/dataobj.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/dataobj.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/dataobj.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/dnd.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/dataobj.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/dataobj.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/stubs/dnd.h"
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxDataObjectSimple is a wxDataObject which only supports one format (in
|
||||
// both Get and Set directions, but you may return FALSE from GetDataHere() or
|
||||
// SetData() if one of them is not supported). This is the simplest possible
|
||||
// wxDataObject implementation.
|
||||
//
|
||||
// This is still an "abstract base class" (although it doesn't have any pure
|
||||
// virtual functions), to use it you should derive from it and implement
|
||||
// GetDataSize(), GetDataHere() and SetData() functions because the base class
|
||||
// versions don't do anything - they just return "not implemented".
|
||||
//
|
||||
// This class should be used when you provide data in only one format (no
|
||||
// conversion to/from other formats), either a standard or a custom one.
|
||||
// Otherwise, you should use wxDataObjectComposite or wxDataObject directly.
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxDataObjectSimple : public wxDataObject
|
||||
{
|
||||
public:
|
||||
// ctor takes the format we support, but it can also be set later with
|
||||
// SetFormat()
|
||||
wxDataObjectSimple(const wxDataFormat& format = wxFormatInvalid)
|
||||
: m_format(format)
|
||||
{
|
||||
}
|
||||
|
||||
// get/set the format we support
|
||||
const wxDataFormat& GetFormat() const { return m_format; }
|
||||
void SetFormat(const wxDataFormat& format) { m_format = format; }
|
||||
|
||||
// virtual functions to override in derived class (the base class versions
|
||||
// just return "not implemented")
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
// get the size of our data
|
||||
virtual size_t GetDataSize() const
|
||||
{ return 0; }
|
||||
|
||||
// copy our data to the buffer
|
||||
virtual bool GetDataHere(void *WXUNUSED(buf)) const
|
||||
{ return FALSE; }
|
||||
|
||||
// copy data from buffer to our data
|
||||
virtual bool SetData(size_t WXUNUSED(len), const void *WXUNUSED(buf))
|
||||
{ return FALSE; }
|
||||
|
||||
// implement base class pure virtuals
|
||||
// ----------------------------------
|
||||
virtual wxDataFormat GetPreferredFormat(wxDataObjectBase::Direction WXUNUSED(dir) = Get) const
|
||||
{ return m_format; }
|
||||
virtual size_t GetFormatCount(wxDataObjectBase::Direction WXUNUSED(dir) = Get) const
|
||||
{ return 1; }
|
||||
virtual void GetAllFormats(wxDataFormat *formats,
|
||||
wxDataObjectBase::Direction WXUNUSED(dir) = Get) const
|
||||
{ *formats = m_format; }
|
||||
virtual size_t GetDataSize(const wxDataFormat& WXUNUSED(format)) const
|
||||
{ return GetDataSize(); }
|
||||
virtual bool GetDataHere(const wxDataFormat& WXUNUSED(format),
|
||||
void *buf) const
|
||||
{ return GetDataHere(buf); }
|
||||
virtual bool SetData(const wxDataFormat& WXUNUSED(format),
|
||||
size_t len, const void *buf)
|
||||
{ return SetData(len, buf); }
|
||||
|
||||
private:
|
||||
// the one and only format we support
|
||||
wxDataFormat m_format;
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxDataObjectComposite is the simplest way to implement wxDataObject
|
||||
// supporting multiple formats. It contains several wxDataObjectSimple and
|
||||
// supports all formats supported by any of them.
|
||||
//
|
||||
// This class shouldn't be (normally) derived from, but may be used directly.
|
||||
// If you need more flexibility than what it provides, you should probably use
|
||||
// wxDataObject directly.
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
WX_DECLARE_EXPORTED_LIST(wxDataObjectSimple, wxSimpleDataObjectList);
|
||||
|
||||
class WXDLLEXPORT wxDataObjectComposite : public wxDataObject
|
||||
{
|
||||
public:
|
||||
// ctor
|
||||
wxDataObjectComposite() { m_preferred = 0; }
|
||||
|
||||
// add data object (it will be deleted by wxDataObjectComposite, hence it
|
||||
// must be allocated on the heap) whose format will become the preferred
|
||||
// one if preferred == TRUE
|
||||
void Add(wxDataObjectSimple *dataObject, bool preferred = FALSE);
|
||||
|
||||
// implement base class pure virtuals
|
||||
// ----------------------------------
|
||||
virtual wxDataFormat GetPreferredFormat(wxDataObjectBase::Direction dir = Get) const;
|
||||
virtual size_t GetFormatCount(wxDataObjectBase::Direction dir = Get) const;
|
||||
virtual void GetAllFormats(wxDataFormat *formats, wxDataObjectBase::Direction dir = Get) const;
|
||||
virtual size_t GetDataSize(const wxDataFormat& format) const;
|
||||
virtual bool GetDataHere(const wxDataFormat& format, void *buf) const;
|
||||
virtual bool SetData(const wxDataFormat& format, size_t len, const void *buf);
|
||||
|
||||
protected:
|
||||
// returns the pointer to the object which supports this format or NULL
|
||||
wxDataObjectSimple *GetObject(const wxDataFormat& format) const;
|
||||
|
||||
private:
|
||||
// the list of all (simple) data objects whose formats we support
|
||||
wxSimpleDataObjectList m_dataObjects;
|
||||
|
||||
// the index of the preferred one (0 initially, so by default the first
|
||||
// one is the preferred)
|
||||
size_t m_preferred;
|
||||
};
|
||||
|
||||
// ============================================================================
|
||||
// Standard implementations of wxDataObjectSimple which can be used directly
|
||||
// (i.e. without having to derive from them) for standard data type transfers.
|
||||
//
|
||||
// Note that although all of them can work with provided data, you can also
|
||||
// override their virtual GetXXX() functions to only provide data on demand.
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxTextDataObject contains text data
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxTextDataObject : public wxDataObjectSimple
|
||||
{
|
||||
public:
|
||||
// ctor: you can specify the text here or in SetText(), or override
|
||||
// GetText()
|
||||
wxTextDataObject(const wxString& text = wxEmptyString)
|
||||
: wxDataObjectSimple(wxDF_TEXT), m_text(text)
|
||||
{
|
||||
}
|
||||
|
||||
// virtual functions which you may override if you want to provide text on
|
||||
// demand only - otherwise, the trivial default versions will be used
|
||||
virtual size_t GetTextLength() const { return m_text.Len() + 1; }
|
||||
virtual wxString GetText() const { return m_text; }
|
||||
virtual void SetText(const wxString& text) { m_text = text; }
|
||||
|
||||
// implement base class pure virtuals
|
||||
// ----------------------------------
|
||||
virtual size_t GetDataSize() const;
|
||||
virtual bool GetDataHere(void *buf) const;
|
||||
virtual bool SetData(size_t len, const void *buf);
|
||||
|
||||
private:
|
||||
wxString m_text;
|
||||
|
||||
// virtual function hiding supression
|
||||
size_t GetDataSize(const wxDataFormat& format) const
|
||||
{ return(wxDataObjectSimple::GetDataSize(format)); }
|
||||
bool GetDataHere(const wxDataFormat& format, void *pBuf) const
|
||||
{ return(wxDataObjectSimple::GetDataHere(format, pBuf)); }
|
||||
bool SetData(const wxDataFormat& format, size_t nLen, const void* pBuf)
|
||||
{ return(wxDataObjectSimple::SetData(format, nLen, pBuf)); }
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxBitmapDataObject contains a bitmap
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxBitmapDataObjectBase : public wxDataObjectSimple
|
||||
{
|
||||
public:
|
||||
// ctor: you can specify the bitmap here or in SetBitmap(), or override
|
||||
// GetBitmap()
|
||||
wxBitmapDataObjectBase(const wxBitmap& bitmap = wxNullBitmap)
|
||||
: wxDataObjectSimple(wxDF_BITMAP), m_bitmap(bitmap)
|
||||
{
|
||||
}
|
||||
|
||||
// virtual functions which you may override if you want to provide data on
|
||||
// demand only - otherwise, the trivial default versions will be used
|
||||
virtual wxBitmap GetBitmap() const { return m_bitmap; }
|
||||
virtual void SetBitmap(const wxBitmap& bitmap) { m_bitmap = bitmap; }
|
||||
|
||||
protected:
|
||||
wxBitmap m_bitmap;
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxFileDataObject contains a list of filenames
|
||||
//
|
||||
// NB: notice that this is a "write only" object, it can only be filled with
|
||||
// data from drag and drop operation.
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxFileDataObjectBase : public wxDataObjectSimple
|
||||
{
|
||||
public:
|
||||
// ctor: use AddFile() later to fill the array
|
||||
wxFileDataObjectBase() : wxDataObjectSimple(wxDF_FILENAME) { }
|
||||
|
||||
// get a reference to our array
|
||||
const wxArrayString& GetFilenames() const { return m_filenames; }
|
||||
|
||||
// the Get() functions do nothing for us
|
||||
virtual size_t GetDataSize() const { return 0; }
|
||||
virtual bool GetDataHere(void *WXUNUSED(buf)) const { return FALSE; }
|
||||
|
||||
protected:
|
||||
wxArrayString m_filenames;
|
||||
|
||||
private:
|
||||
// Virtual function hiding supression
|
||||
size_t GetDataSize(const wxDataFormat& format) const
|
||||
{ return(wxDataObjectSimple::GetDataSize(format)); }
|
||||
bool GetDataHere(const wxDataFormat& format, void* pBuf) const
|
||||
{ return(wxDataObjectSimple::GetDataHere(format, pBuf)); }
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxCustomDataObject contains arbitrary untyped user data.
|
||||
//
|
||||
// It is understood that this data can be copied bitwise.
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxCustomDataObject : public wxDataObjectSimple
|
||||
{
|
||||
public:
|
||||
// if you don't specify the format in the ctor, you can still use
|
||||
// SetFormat() later
|
||||
wxCustomDataObject(const wxDataFormat& format = wxFormatInvalid);
|
||||
|
||||
// the dtor calls Free()
|
||||
virtual ~wxCustomDataObject();
|
||||
|
||||
// you can call SetData() to set m_data: it will make a copy of the data
|
||||
// you pass - or you can use TakeData() which won't copy anything, but
|
||||
// will take ownership of data (i.e. will call Free() on it later)
|
||||
void TakeData(size_t size, void *data);
|
||||
|
||||
// this function is called to allocate "size" bytes of memory from
|
||||
// SetData(). The default version uses operator new[].
|
||||
virtual void *Alloc(size_t size);
|
||||
|
||||
// this function is called when the data is freed, you may override it to
|
||||
// anything you want (or may be nothing at all). The default version calls
|
||||
// operator delete[] on m_data
|
||||
virtual void Free();
|
||||
|
||||
// get data: you may override these functions if you wish to provide data
|
||||
// only when it's requested
|
||||
virtual size_t GetSize() const { return m_size; }
|
||||
virtual void *GetData() const { return m_data; }
|
||||
|
||||
// implement base class pure virtuals
|
||||
// ----------------------------------
|
||||
virtual size_t GetDataSize() const;
|
||||
virtual bool GetDataHere(void *buf) const;
|
||||
virtual bool SetData(size_t size, const void *buf);
|
||||
|
||||
private:
|
||||
size_t m_size;
|
||||
void *m_data;
|
||||
|
||||
// virtual function hiding supression
|
||||
size_t GetDataSize(const wxDataFormat& format) const
|
||||
{ return(wxDataObjectSimple::GetDataSize(format)); }
|
||||
bool GetDataHere(const wxDataFormat& format, void* pBuf) const
|
||||
{ return(wxDataObjectSimple::GetDataHere(format, pBuf)); }
|
||||
bool SetData(const wxDataFormat& format, size_t nLen, const void* pBuf)
|
||||
{ return(wxDataObjectSimple::SetData(format, nLen, pBuf)); }
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// include platform-specific declarations of wxXXXBase classes
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#include "wx/msw/ole/dataobj2.h"
|
||||
|
||||
// wxURLDataObject defined in msw/ole/dataobj2.h
|
||||
#else // !__WXMSW__
|
||||
#if defined(__WXGTK__)
|
||||
#include "wx/gtk/dataobj2.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/dataobj2.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/dataobj2.h"
|
||||
#endif
|
||||
|
||||
// wxURLDataObject is simply wxTextDataObject with a different name
|
||||
class WXDLLEXPORT wxURLDataObject : public wxTextDataObject
|
||||
{
|
||||
public:
|
||||
wxString GetURL() const { return GetText(); }
|
||||
};
|
||||
#endif // __WXMSW__/!__WXMSW__
|
||||
|
||||
#endif // _WX_DATAOBJ_H_BASE_
|
812
include/wx/dc.h
Normal file
812
include/wx/dc.h
Normal file
@@ -0,0 +1,812 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: dc.h
|
||||
// Purpose: wxDC class
|
||||
// Author: Vadim Zeitlin
|
||||
// Modified by:
|
||||
// Created: 05/25/99
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) wxWindows team
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_DC_H_BASE_
|
||||
#define _WX_DC_H_BASE_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "dcbase.h"
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers which we must include here
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#include "wx/object.h" // the base class
|
||||
|
||||
#include "wx/cursor.h" // we have member variables of these classes
|
||||
#include "wx/font.h" // so we can't do without them
|
||||
#include "wx/colour.h"
|
||||
#include "wx/brush.h"
|
||||
#include "wx/pen.h"
|
||||
#include "wx/palette.h"
|
||||
|
||||
#include "wx/list.h" // we use wxList in inline functions
|
||||
|
||||
class WXDLLEXPORT wxDCBase;
|
||||
|
||||
class WXDLLEXPORT wxDrawObject
|
||||
{
|
||||
public:
|
||||
|
||||
wxDrawObject()
|
||||
{
|
||||
ResetBoundingBox();
|
||||
}
|
||||
|
||||
virtual ~wxDrawObject() { }
|
||||
|
||||
virtual void Draw(wxDCBase&) const { }
|
||||
|
||||
virtual void CalcBoundingBox(wxCoord x, wxCoord y)
|
||||
{
|
||||
if ( m_isBBoxValid )
|
||||
{
|
||||
if ( x < m_minX ) m_minX = x;
|
||||
if ( y < m_minY ) m_minY = y;
|
||||
if ( x > m_maxX ) m_maxX = x;
|
||||
if ( y > m_maxY ) m_maxY = y;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_isBBoxValid = TRUE;
|
||||
|
||||
m_minX = x;
|
||||
m_minY = y;
|
||||
m_maxX = x;
|
||||
m_maxY = y;
|
||||
}
|
||||
}
|
||||
|
||||
void ResetBoundingBox()
|
||||
{
|
||||
m_isBBoxValid = FALSE;
|
||||
|
||||
m_minX = m_maxX = m_minY = m_maxY = 0;
|
||||
}
|
||||
|
||||
// Get the final bounding box of the PostScript or Metafile picture.
|
||||
|
||||
wxCoord MinX() const { return m_minX; }
|
||||
wxCoord MaxX() const { return m_maxX; }
|
||||
wxCoord MinY() const { return m_minY; }
|
||||
wxCoord MaxY() const { return m_maxY; }
|
||||
|
||||
//to define the type of object for derived objects
|
||||
virtual int GetType()=0;
|
||||
|
||||
protected:
|
||||
//for boundingbox calculation
|
||||
bool m_isBBoxValid:1;
|
||||
//for boundingbox calculation
|
||||
wxCoord m_minX, m_minY, m_maxX, m_maxY;
|
||||
};
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// global variables
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
WXDLLEXPORT_DATA(extern int) wxPageNumber;
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// wxDC is the device context - object on which any drawing is done
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxDCBase : public wxObject
|
||||
{
|
||||
public:
|
||||
wxDCBase()
|
||||
{
|
||||
m_clipping = FALSE;
|
||||
m_ok = TRUE;
|
||||
|
||||
ResetBoundingBox();
|
||||
|
||||
m_signX = m_signY = 1;
|
||||
|
||||
m_logicalOriginX = m_logicalOriginY =
|
||||
m_deviceOriginX = m_deviceOriginY = 0;
|
||||
|
||||
m_logicalScaleX = m_logicalScaleY =
|
||||
m_userScaleX = m_userScaleY =
|
||||
m_scaleX = m_scaleY = 1.0;
|
||||
|
||||
m_logicalFunction = wxCOPY;
|
||||
|
||||
m_backgroundMode = wxTRANSPARENT;
|
||||
|
||||
m_mappingMode = wxMM_TEXT;
|
||||
|
||||
m_backgroundBrush = *wxTRANSPARENT_BRUSH;
|
||||
|
||||
m_textForegroundColour = *wxBLACK;
|
||||
m_textBackgroundColour = *wxWHITE;
|
||||
|
||||
m_colour = wxColourDisplay();
|
||||
}
|
||||
|
||||
~wxDCBase() { }
|
||||
|
||||
virtual void BeginDrawing() { }
|
||||
virtual void EndDrawing() { }
|
||||
|
||||
// graphic primitives
|
||||
// ------------------
|
||||
|
||||
virtual void DrawObject(wxDrawObject* drawobject)
|
||||
{
|
||||
drawobject->Draw(*this);
|
||||
CalcBoundingBox(drawobject->MinX(),drawobject->MinY());
|
||||
CalcBoundingBox(drawobject->MaxX(),drawobject->MaxY());
|
||||
}
|
||||
|
||||
void FloodFill(wxCoord x, wxCoord y, const wxColour& col,
|
||||
int style = wxFLOOD_SURFACE)
|
||||
{ DoFloodFill(x, y, col, style); }
|
||||
void FloodFill(const wxPoint& pt, const wxColour& col,
|
||||
int style = wxFLOOD_SURFACE)
|
||||
{ DoFloodFill(pt.x, pt.y, col, style); }
|
||||
|
||||
bool GetPixel(wxCoord x, wxCoord y, wxColour *col) const
|
||||
{ return DoGetPixel(x, y, col); }
|
||||
bool GetPixel(const wxPoint& pt, wxColour *col) const
|
||||
{ return DoGetPixel(pt.x, pt.y, col); }
|
||||
|
||||
void DrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2)
|
||||
{ DoDrawLine(x1, y1, x2, y2); }
|
||||
void DrawLine(const wxPoint& pt1, const wxPoint& pt2)
|
||||
{ DoDrawLine(pt1.x, pt1.y, pt2.x, pt2.y); }
|
||||
|
||||
void CrossHair(wxCoord x, wxCoord y)
|
||||
{ DoCrossHair(x, y); }
|
||||
void CrossHair(const wxPoint& pt)
|
||||
{ DoCrossHair(pt.x, pt.y); }
|
||||
|
||||
void DrawArc(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2,
|
||||
wxCoord xc, wxCoord yc)
|
||||
{ DoDrawArc(x1, y1, x2, y2, xc, yc); }
|
||||
void DrawArc(const wxPoint& pt1, const wxPoint& pt2, const wxPoint& centre)
|
||||
{ DoDrawArc(pt1.x, pt1.y, pt2.x, pt2.y, centre.x, centre.y); }
|
||||
|
||||
void DrawCheckMark(wxCoord x, wxCoord y,
|
||||
wxCoord width, wxCoord height)
|
||||
{ DoDrawCheckMark(x, y, width, height); }
|
||||
void DrawCheckMark(const wxRect& rect)
|
||||
{ DoDrawCheckMark(rect.x, rect.y, rect.width, rect.height); }
|
||||
|
||||
void DrawEllipticArc(wxCoord x, wxCoord y, wxCoord w, wxCoord h,
|
||||
double sa, double ea)
|
||||
{ DoDrawEllipticArc(x, y, w, h, sa, ea); }
|
||||
void DrawEllipticArc(const wxPoint& pt, const wxSize& sz,
|
||||
double sa, double ea)
|
||||
{ DoDrawEllipticArc(pt.x, pt.y, sz.x, sz.y, sa, ea); }
|
||||
|
||||
void DrawPoint(wxCoord x, wxCoord y)
|
||||
{ DoDrawPoint(x, y); }
|
||||
void DrawPoint(const wxPoint& pt)
|
||||
{ DoDrawPoint(pt.x, pt.y); }
|
||||
|
||||
void DrawLines(int n, wxPoint points[],
|
||||
wxCoord xoffset = 0, wxCoord yoffset = 0)
|
||||
{ DoDrawLines(n, points, xoffset, yoffset); }
|
||||
void DrawLines(const wxList *list,
|
||||
wxCoord xoffset = 0, wxCoord yoffset = 0);
|
||||
|
||||
void DrawPolygon(int n, wxPoint points[],
|
||||
wxCoord xoffset = 0, wxCoord yoffset = 0,
|
||||
int fillStyle = wxODDEVEN_RULE)
|
||||
{ DoDrawPolygon(n, points, xoffset, yoffset, fillStyle); }
|
||||
|
||||
void DrawPolygon(const wxList *list,
|
||||
wxCoord xoffset = 0, wxCoord yoffset = 0,
|
||||
int fillStyle = wxODDEVEN_RULE);
|
||||
|
||||
void DrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
|
||||
{ DoDrawRectangle(x, y, width, height); }
|
||||
void DrawRectangle(const wxPoint& pt, const wxSize& sz)
|
||||
{ DoDrawRectangle(pt.x, pt.y, sz.x, sz.y); }
|
||||
void DrawRectangle(const wxRect& rect)
|
||||
{ DoDrawRectangle(rect.x, rect.y, rect.width, rect.height); }
|
||||
|
||||
void DrawRoundedRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height,
|
||||
double radius)
|
||||
{ DoDrawRoundedRectangle(x, y, width, height, radius); }
|
||||
void DrawRoundedRectangle(const wxPoint& pt, const wxSize& sz,
|
||||
double radius)
|
||||
{ DoDrawRoundedRectangle(pt.x, pt.y, sz.x, sz.y, radius); }
|
||||
void DrawRoundedRectangle(const wxRect& r, double radius)
|
||||
{ DoDrawRoundedRectangle(r.x, r.y, r.width, r.height, radius); }
|
||||
|
||||
void DrawCircle(wxCoord x, wxCoord y, wxCoord radius)
|
||||
{ DoDrawEllipse(x - radius, y - radius, 2*radius, 2*radius); }
|
||||
void DrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
|
||||
{ DoDrawEllipse(x, y, width, height); }
|
||||
void DrawEllipse(const wxPoint& pt, const wxSize& sz)
|
||||
{ DoDrawEllipse(pt.x, pt.y, sz.x, sz.y); }
|
||||
void DrawEllipse(const wxRect& rect)
|
||||
{ DoDrawEllipse(rect.x, rect.y, rect.width, rect.height); }
|
||||
|
||||
void DrawIcon(const wxIcon& icon, wxCoord x, wxCoord y)
|
||||
{ DoDrawIcon(icon, x, y); }
|
||||
void DrawIcon(const wxIcon& icon, const wxPoint& pt)
|
||||
{ DoDrawIcon(icon, pt.x, pt.y); }
|
||||
|
||||
void DrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y,
|
||||
bool useMask = FALSE)
|
||||
{ DoDrawBitmap(bmp, x, y, useMask); }
|
||||
void DrawBitmap(const wxBitmap &bmp, const wxPoint& pt,
|
||||
bool useMask = FALSE)
|
||||
{ DoDrawBitmap(bmp, pt.x, pt.y, useMask); }
|
||||
|
||||
void DrawText(const wxString& text, wxCoord x, wxCoord y)
|
||||
{ DoDrawText(text, x, y); }
|
||||
void DrawText(const wxString& text, const wxPoint& pt)
|
||||
{ DoDrawText(text, pt.x, pt.y); }
|
||||
|
||||
void DrawRotatedText(const wxString& text, wxCoord x, wxCoord y, double angle)
|
||||
{ DoDrawRotatedText(text, x, y, angle); }
|
||||
void DrawRotatedText(const wxString& text, const wxPoint& pt, double angle)
|
||||
{ DoDrawRotatedText(text, pt.x, pt.y, angle); }
|
||||
|
||||
// this version puts both optional bitmap and the text into the given
|
||||
// rectangle and aligns is as specified by alignment parameter; it also
|
||||
// will emphasize the character with the given index if it is != -1 and
|
||||
// return the bounding rectangle if required
|
||||
virtual void DrawLabel(const wxString& text,
|
||||
const wxBitmap& image,
|
||||
const wxRect& rect,
|
||||
int alignment = wxALIGN_LEFT | wxALIGN_TOP,
|
||||
int indexAccel = -1,
|
||||
wxRect *rectBounding = NULL);
|
||||
|
||||
void DrawLabel(const wxString& text, const wxRect& rect,
|
||||
int alignment = wxALIGN_LEFT | wxALIGN_TOP,
|
||||
int indexAccel = -1)
|
||||
{ DrawLabel(text, wxNullBitmap, rect, alignment, indexAccel); }
|
||||
|
||||
bool Blit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
|
||||
wxDC *source, wxCoord xsrc, wxCoord ysrc,
|
||||
int rop = wxCOPY, bool useMask = FALSE, wxCoord xsrcMask = -1, wxCoord ysrcMask = -1)
|
||||
{
|
||||
return DoBlit(xdest, ydest, width, height,
|
||||
source, xsrc, ysrc, rop, useMask, xsrcMask, ysrcMask);
|
||||
}
|
||||
bool Blit(const wxPoint& destPt, const wxSize& sz,
|
||||
wxDC *source, const wxPoint& srcPt,
|
||||
int rop = wxCOPY, bool useMask = FALSE, const wxPoint& srcPtMask = wxPoint(-1, -1))
|
||||
{
|
||||
return DoBlit(destPt.x, destPt.y, sz.x, sz.y,
|
||||
source, srcPt.x, srcPt.y, rop, useMask, srcPtMask.x, srcPtMask.y);
|
||||
}
|
||||
|
||||
#if wxUSE_SPLINES
|
||||
// TODO: this API needs fixing (wxPointList, why (!const) "wxList *"?)
|
||||
void DrawSpline(wxCoord x1, wxCoord y1,
|
||||
wxCoord x2, wxCoord y2,
|
||||
wxCoord x3, wxCoord y3);
|
||||
void DrawSpline(int n, wxPoint points[]);
|
||||
|
||||
void DrawSpline(wxList *points) { DoDrawSpline(points); }
|
||||
#endif // wxUSE_SPLINES
|
||||
|
||||
// global DC operations
|
||||
// --------------------
|
||||
|
||||
virtual void Clear() = 0;
|
||||
|
||||
virtual bool StartDoc(const wxString& WXUNUSED(message)) { return TRUE; }
|
||||
virtual void EndDoc() { }
|
||||
|
||||
virtual void StartPage() { }
|
||||
virtual void EndPage() { }
|
||||
|
||||
// set objects to use for drawing
|
||||
// ------------------------------
|
||||
|
||||
virtual void SetFont(const wxFont& font) = 0;
|
||||
virtual void SetPen(const wxPen& pen) = 0;
|
||||
virtual void SetBrush(const wxBrush& brush) = 0;
|
||||
virtual void SetBackground(const wxBrush& brush) = 0;
|
||||
virtual void SetBackgroundMode(int mode) = 0;
|
||||
virtual void SetPalette(const wxPalette& palette) = 0;
|
||||
|
||||
// clipping region
|
||||
// ---------------
|
||||
|
||||
void SetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
|
||||
{ DoSetClippingRegion(x, y, width, height); }
|
||||
void SetClippingRegion(const wxPoint& pt, const wxSize& sz)
|
||||
{ DoSetClippingRegion(pt.x, pt.y, sz.x, sz.y); }
|
||||
void SetClippingRegion(const wxRect& rect)
|
||||
{ DoSetClippingRegion(rect.x, rect.y, rect.width, rect.height); }
|
||||
void SetClippingRegion(const wxRegion& region)
|
||||
{ DoSetClippingRegionAsRegion(region); }
|
||||
|
||||
virtual void DestroyClippingRegion() = 0;
|
||||
|
||||
void GetClippingBox(wxCoord *x, wxCoord *y, wxCoord *w, wxCoord *h) const
|
||||
{ DoGetClippingBox(x, y, w, h); }
|
||||
void GetClippingBox(wxRect& rect) const
|
||||
{
|
||||
// Necessary to use intermediate variables for 16-bit compilation
|
||||
wxCoord x, y, w, h;
|
||||
DoGetClippingBox(&x, &y, &w, &h);
|
||||
rect.x = x; rect.y = y; rect.width = w; rect.height = h;
|
||||
}
|
||||
|
||||
// text extent
|
||||
// -----------
|
||||
|
||||
virtual wxCoord GetCharHeight() const = 0;
|
||||
virtual wxCoord GetCharWidth() const = 0;
|
||||
|
||||
// only works for single line strings
|
||||
void GetTextExtent(const wxString& string,
|
||||
wxCoord *x, wxCoord *y,
|
||||
wxCoord *descent = NULL,
|
||||
wxCoord *externalLeading = NULL,
|
||||
wxFont *theFont = NULL) const
|
||||
{ DoGetTextExtent(string, x, y, descent, externalLeading, theFont); }
|
||||
|
||||
// works for single as well as multi-line strings
|
||||
virtual void GetMultiLineTextExtent(const wxString& text,
|
||||
wxCoord *width,
|
||||
wxCoord *height,
|
||||
wxCoord *heightLine = NULL,
|
||||
wxFont *font = NULL);
|
||||
|
||||
// size and resolution
|
||||
// -------------------
|
||||
|
||||
// in device units
|
||||
void GetSize(int *width, int *height) const
|
||||
{ DoGetSize(width, height); }
|
||||
wxSize GetSize() const
|
||||
{
|
||||
int w, h;
|
||||
DoGetSize(&w, &h);
|
||||
|
||||
return wxSize(w, h);
|
||||
}
|
||||
|
||||
// in mm
|
||||
void GetSizeMM(int* width, int* height) const
|
||||
{ DoGetSizeMM(width, height); }
|
||||
wxSize GetSizeMM() const
|
||||
{
|
||||
int w, h;
|
||||
DoGetSizeMM(&w, &h);
|
||||
|
||||
return wxSize(w, h);
|
||||
}
|
||||
|
||||
// coordinates conversions
|
||||
// -----------------------
|
||||
|
||||
// This group of functions does actual conversion of the input, as you'd
|
||||
// expect.
|
||||
wxCoord DeviceToLogicalX(wxCoord x) const;
|
||||
wxCoord DeviceToLogicalY(wxCoord y) const;
|
||||
wxCoord DeviceToLogicalXRel(wxCoord x) const;
|
||||
wxCoord DeviceToLogicalYRel(wxCoord y) const;
|
||||
wxCoord LogicalToDeviceX(wxCoord x) const;
|
||||
wxCoord LogicalToDeviceY(wxCoord y) const;
|
||||
wxCoord LogicalToDeviceXRel(wxCoord x) const;
|
||||
wxCoord LogicalToDeviceYRel(wxCoord y) const;
|
||||
|
||||
// query DC capabilities
|
||||
// ---------------------
|
||||
|
||||
virtual bool CanDrawBitmap() const = 0;
|
||||
virtual bool CanGetTextExtent() const = 0;
|
||||
|
||||
// colour depth
|
||||
virtual int GetDepth() const = 0;
|
||||
|
||||
// Resolution in Pixels per inch
|
||||
virtual wxSize GetPPI() const = 0;
|
||||
|
||||
virtual bool Ok() const { return m_ok; }
|
||||
|
||||
// accessors
|
||||
// ---------
|
||||
|
||||
// const...
|
||||
int GetBackgroundMode() const { return m_backgroundMode; }
|
||||
const wxBrush& GetBackground() const { return m_backgroundBrush; }
|
||||
const wxBrush& GetBrush() const { return m_brush; }
|
||||
const wxFont& GetFont() const { return m_font; }
|
||||
const wxPen& GetPen() const { return m_pen; }
|
||||
const wxColour& GetTextBackground() const { return m_textBackgroundColour; }
|
||||
const wxColour& GetTextForeground() const { return m_textForegroundColour; }
|
||||
|
||||
// ... and non const
|
||||
wxBrush& GetBackground() { return m_backgroundBrush; }
|
||||
wxBrush& GetBrush() { return m_brush; }
|
||||
wxFont& GetFont() { return m_font; }
|
||||
wxPen& GetPen() { return m_pen; }
|
||||
wxColour& GetTextBackground() { return m_textBackgroundColour; }
|
||||
wxColour& GetTextForeground() { return m_textForegroundColour; }
|
||||
|
||||
virtual void SetTextForeground(const wxColour& colour)
|
||||
{ m_textForegroundColour = colour; }
|
||||
virtual void SetTextBackground(const wxColour& colour)
|
||||
{ m_textBackgroundColour = colour; }
|
||||
|
||||
int GetMapMode() const { return m_mappingMode; }
|
||||
virtual void SetMapMode(int mode) = 0;
|
||||
|
||||
virtual void GetUserScale(double *x, double *y) const
|
||||
{
|
||||
if ( x ) *x = m_userScaleX;
|
||||
if ( y ) *y = m_userScaleY;
|
||||
}
|
||||
virtual void SetUserScale(double x, double y) = 0;
|
||||
|
||||
virtual void GetLogicalScale(double *x, double *y)
|
||||
{
|
||||
if ( x ) *x = m_logicalScaleX;
|
||||
if ( y ) *y = m_logicalScaleY;
|
||||
}
|
||||
virtual void SetLogicalScale(double x, double y)
|
||||
{
|
||||
m_logicalScaleX = x;
|
||||
m_logicalScaleY = y;
|
||||
}
|
||||
|
||||
void GetLogicalOrigin(wxCoord *x, wxCoord *y) const
|
||||
{ DoGetLogicalOrigin(x, y); }
|
||||
wxPoint GetLogicalOrigin() const
|
||||
{ wxCoord x, y; DoGetLogicalOrigin(&x, &y); return wxPoint(x, y); }
|
||||
virtual void SetLogicalOrigin(wxCoord x, wxCoord y) = 0;
|
||||
|
||||
void GetDeviceOrigin(wxCoord *x, wxCoord *y) const
|
||||
{ DoGetDeviceOrigin(x, y); }
|
||||
wxPoint GetDeviceOrigin() const
|
||||
{ wxCoord x, y; DoGetDeviceOrigin(&x, &y); return wxPoint(x, y); }
|
||||
virtual void SetDeviceOrigin(wxCoord x, wxCoord y) = 0;
|
||||
|
||||
virtual void SetAxisOrientation(bool xLeftRight, bool yBottomUp) = 0;
|
||||
|
||||
int GetLogicalFunction() const { return m_logicalFunction; }
|
||||
virtual void SetLogicalFunction(int function) = 0;
|
||||
|
||||
// Sometimes we need to override optimization, e.g. if other software is
|
||||
// drawing onto our surface and we can't be sure of who's done what.
|
||||
//
|
||||
// FIXME: is this (still) used?
|
||||
virtual void SetOptimization(bool WXUNUSED(opt)) { }
|
||||
virtual bool GetOptimization() { return FALSE; }
|
||||
|
||||
// Some platforms have a DC cache, which should be cleared
|
||||
// at appropriate points such as after a series of DC operations.
|
||||
// Put ClearCache in the wxDC implementation class, since it has to be
|
||||
// static.
|
||||
// static void ClearCache() ;
|
||||
#if 0 // wxUSE_DC_CACHEING
|
||||
static void EnableCache(bool cacheing) { sm_cacheing = cacheing; }
|
||||
static bool CacheEnabled() { return sm_cacheing ; }
|
||||
#endif
|
||||
|
||||
// bounding box
|
||||
// ------------
|
||||
|
||||
virtual void CalcBoundingBox(wxCoord x, wxCoord y)
|
||||
{
|
||||
if ( m_isBBoxValid )
|
||||
{
|
||||
if ( x < m_minX ) m_minX = x;
|
||||
if ( y < m_minY ) m_minY = y;
|
||||
if ( x > m_maxX ) m_maxX = x;
|
||||
if ( y > m_maxY ) m_maxY = y;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_isBBoxValid = TRUE;
|
||||
|
||||
m_minX = x;
|
||||
m_minY = y;
|
||||
m_maxX = x;
|
||||
m_maxY = y;
|
||||
}
|
||||
}
|
||||
|
||||
void ResetBoundingBox()
|
||||
{
|
||||
m_isBBoxValid = FALSE;
|
||||
|
||||
m_minX = m_maxX = m_minY = m_maxY = 0;
|
||||
}
|
||||
|
||||
// Get the final bounding box of the PostScript or Metafile picture.
|
||||
wxCoord MinX() const { return m_minX; }
|
||||
wxCoord MaxX() const { return m_maxX; }
|
||||
wxCoord MinY() const { return m_minY; }
|
||||
wxCoord MaxY() const { return m_maxY; }
|
||||
|
||||
// misc old functions
|
||||
// ------------------
|
||||
|
||||
// for compatibility with the old code when wxCoord was long everywhere
|
||||
#ifndef __WIN16__
|
||||
void GetTextExtent(const wxString& string,
|
||||
long *x, long *y,
|
||||
long *descent = NULL,
|
||||
long *externalLeading = NULL,
|
||||
wxFont *theFont = NULL) const
|
||||
{
|
||||
wxCoord x2, y2, descent2, externalLeading2;
|
||||
DoGetTextExtent(string, &x2, &y2,
|
||||
&descent2, &externalLeading2,
|
||||
theFont);
|
||||
if ( x )
|
||||
*x = x2;
|
||||
if ( y )
|
||||
*y = y2;
|
||||
if ( descent )
|
||||
*descent = descent2;
|
||||
if ( externalLeading )
|
||||
*externalLeading = externalLeading2;
|
||||
}
|
||||
|
||||
void GetLogicalOrigin(long *x, long *y) const
|
||||
{
|
||||
wxCoord x2, y2;
|
||||
DoGetLogicalOrigin(&x2, &y2);
|
||||
if ( x )
|
||||
*x = x2;
|
||||
if ( y )
|
||||
*y = y2;
|
||||
}
|
||||
|
||||
void GetDeviceOrigin(long *x, long *y) const
|
||||
{
|
||||
wxCoord x2, y2;
|
||||
DoGetDeviceOrigin(&x2, &y2);
|
||||
if ( x )
|
||||
*x = x2;
|
||||
if ( y )
|
||||
*y = y2;
|
||||
}
|
||||
void GetClippingBox(long *x, long *y, long *w, long *h) const
|
||||
{
|
||||
wxCoord xx,yy,ww,hh;
|
||||
DoGetClippingBox(&xx, &yy, &ww, &hh);
|
||||
if (x) *x = xx;
|
||||
if (y) *y = yy;
|
||||
if (w) *w = ww;
|
||||
if (h) *h = hh;
|
||||
}
|
||||
#endif // !Win16
|
||||
|
||||
#if WXWIN_COMPATIBILITY
|
||||
virtual void SetColourMap(const wxPalette& palette) { SetPalette(palette); }
|
||||
void GetTextExtent(const wxString& string, float *x, float *y,
|
||||
float *descent = NULL, float *externalLeading = NULL,
|
||||
wxFont *theFont = NULL, bool use16bit = FALSE) const ;
|
||||
void GetSize(float* width, float* height) const { int w, h; GetSize(& w, & h); *width = w; *height = h; }
|
||||
void GetSizeMM(float *width, float *height) const { long w, h; GetSizeMM(& w, & h); *width = (float) w; *height = (float) h; }
|
||||
#endif // WXWIN_COMPATIBILITY
|
||||
|
||||
protected:
|
||||
// the pure virtual functions which should be implemented by wxDC
|
||||
virtual void DoFloodFill(wxCoord x, wxCoord y, const wxColour& col,
|
||||
int style = wxFLOOD_SURFACE) = 0;
|
||||
|
||||
virtual bool DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const = 0;
|
||||
|
||||
virtual void DoDrawPoint(wxCoord x, wxCoord y) = 0;
|
||||
virtual void DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2) = 0;
|
||||
|
||||
virtual void DoDrawArc(wxCoord x1, wxCoord y1,
|
||||
wxCoord x2, wxCoord y2,
|
||||
wxCoord xc, wxCoord yc) = 0;
|
||||
virtual void DoDrawCheckMark(wxCoord x, wxCoord y,
|
||||
wxCoord width, wxCoord height);
|
||||
virtual void DoDrawEllipticArc(wxCoord x, wxCoord y, wxCoord w, wxCoord h,
|
||||
double sa, double ea) = 0;
|
||||
|
||||
virtual void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height) = 0;
|
||||
virtual void DoDrawRoundedRectangle(wxCoord x, wxCoord y,
|
||||
wxCoord width, wxCoord height,
|
||||
double radius) = 0;
|
||||
virtual void DoDrawEllipse(wxCoord x, wxCoord y,
|
||||
wxCoord width, wxCoord height) = 0;
|
||||
|
||||
virtual void DoCrossHair(wxCoord x, wxCoord y) = 0;
|
||||
|
||||
virtual void DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y) = 0;
|
||||
virtual void DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y,
|
||||
bool useMask = FALSE) = 0;
|
||||
|
||||
virtual void DoDrawText(const wxString& text, wxCoord x, wxCoord y) = 0;
|
||||
virtual void DoDrawRotatedText(const wxString& text,
|
||||
wxCoord x, wxCoord y, double angle) = 0;
|
||||
|
||||
virtual bool DoBlit(wxCoord xdest, wxCoord ydest,
|
||||
wxCoord width, wxCoord height,
|
||||
wxDC *source, wxCoord xsrc, wxCoord ysrc,
|
||||
int rop = wxCOPY, bool useMask = FALSE, wxCoord xsrcMask = -1, wxCoord ysrcMask = -1) = 0;
|
||||
|
||||
virtual void DoGetSize(int *width, int *height) const = 0;
|
||||
virtual void DoGetSizeMM(int* width, int* height) const = 0;
|
||||
|
||||
virtual void DoDrawLines(int n, wxPoint points[],
|
||||
wxCoord xoffset, wxCoord yoffset) = 0;
|
||||
virtual void DoDrawPolygon(int n, wxPoint points[],
|
||||
wxCoord xoffset, wxCoord yoffset,
|
||||
int fillStyle = wxODDEVEN_RULE) = 0;
|
||||
|
||||
virtual void DoSetClippingRegionAsRegion(const wxRegion& region) = 0;
|
||||
virtual void DoSetClippingRegion(wxCoord x, wxCoord y,
|
||||
wxCoord width, wxCoord height) = 0;
|
||||
|
||||
// FIXME are these functions really different?
|
||||
virtual void DoGetClippingRegion(wxCoord *x, wxCoord *y,
|
||||
wxCoord *w, wxCoord *h)
|
||||
{ DoGetClippingBox(x, y, w, h); }
|
||||
virtual void DoGetClippingBox(wxCoord *x, wxCoord *y,
|
||||
wxCoord *w, wxCoord *h) const
|
||||
{
|
||||
if ( m_clipping )
|
||||
{
|
||||
if ( x ) *x = m_clipX1;
|
||||
if ( y ) *y = m_clipY1;
|
||||
if ( w ) *w = m_clipX2 - m_clipX1;
|
||||
if ( h ) *h = m_clipY2 - m_clipY1;
|
||||
}
|
||||
else
|
||||
{
|
||||
*x = *y = *w = *h = 0;
|
||||
}
|
||||
}
|
||||
|
||||
virtual void DoGetLogicalOrigin(wxCoord *x, wxCoord *y) const
|
||||
{
|
||||
if ( x ) *x = m_logicalOriginX;
|
||||
if ( y ) *y = m_logicalOriginY;
|
||||
}
|
||||
|
||||
virtual void DoGetDeviceOrigin(wxCoord *x, wxCoord *y) const
|
||||
{
|
||||
if ( x ) *x = m_deviceOriginX;
|
||||
if ( y ) *y = m_deviceOriginY;
|
||||
}
|
||||
|
||||
virtual void DoGetTextExtent(const wxString& string,
|
||||
wxCoord *x, wxCoord *y,
|
||||
wxCoord *descent = NULL,
|
||||
wxCoord *externalLeading = NULL,
|
||||
wxFont *theFont = NULL) const = 0;
|
||||
|
||||
#if wxUSE_SPLINES
|
||||
virtual void DoDrawSpline(wxList *points);
|
||||
#endif
|
||||
|
||||
protected:
|
||||
// flags
|
||||
bool m_colour:1;
|
||||
bool m_ok:1;
|
||||
bool m_clipping:1;
|
||||
bool m_isInteractive:1;
|
||||
bool m_isBBoxValid:1;
|
||||
#if wxUSE_DC_CACHEING
|
||||
// static bool sm_cacheing;
|
||||
#endif
|
||||
|
||||
// coordinate system variables
|
||||
|
||||
// TODO short descriptions of what exactly they are would be nice...
|
||||
|
||||
wxCoord m_logicalOriginX, m_logicalOriginY;
|
||||
wxCoord m_deviceOriginX, m_deviceOriginY;
|
||||
|
||||
double m_logicalScaleX, m_logicalScaleY;
|
||||
double m_userScaleX, m_userScaleY;
|
||||
double m_scaleX, m_scaleY;
|
||||
|
||||
// Used by SetAxisOrientation() to invert the axes
|
||||
int m_signX, m_signY;
|
||||
|
||||
// bounding and clipping boxes
|
||||
wxCoord m_minX, m_minY, m_maxX, m_maxY;
|
||||
wxCoord m_clipX1, m_clipY1, m_clipX2, m_clipY2;
|
||||
|
||||
int m_logicalFunction;
|
||||
int m_backgroundMode;
|
||||
int m_mappingMode;
|
||||
|
||||
// GDI objects
|
||||
wxPen m_pen;
|
||||
wxBrush m_brush;
|
||||
wxBrush m_backgroundBrush;
|
||||
wxColour m_textForegroundColour;
|
||||
wxColour m_textBackgroundColour;
|
||||
wxFont m_font;
|
||||
wxPalette m_palette;
|
||||
|
||||
private:
|
||||
DECLARE_NO_COPY_CLASS(wxDCBase)
|
||||
DECLARE_ABSTRACT_CLASS(wxDCBase)
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// now include the declaration of wxDC class
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#include "wx/msw/dc.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/dc.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/dc.h"
|
||||
#elif defined(__WXMGL__)
|
||||
#include "wx/mgl/dc.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/dc.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/dc.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/dc.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/stubs/dc.h"
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// helper class: you can use it to temporarily change the DC text colour and
|
||||
// restore it automatically when the object goes out of scope
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxDCTextColourChanger
|
||||
{
|
||||
public:
|
||||
wxDCTextColourChanger(wxDC& dc) : m_dc(dc) { }
|
||||
|
||||
~wxDCTextColourChanger()
|
||||
{
|
||||
if ( m_colFgOld.Ok() )
|
||||
m_dc.SetTextForeground(m_colFgOld);
|
||||
}
|
||||
|
||||
void Set(const wxColour& col)
|
||||
{
|
||||
if ( !m_colFgOld.Ok() )
|
||||
m_colFgOld = m_dc.GetTextForeground();
|
||||
m_dc.SetTextForeground(col);
|
||||
}
|
||||
|
||||
private:
|
||||
wxDC& m_dc;
|
||||
|
||||
wxColour m_colFgOld;
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// another small helper class: sets the clipping region in its ctor and
|
||||
// destroys it in the dtor
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxDCClipper
|
||||
{
|
||||
public:
|
||||
wxDCClipper(wxDC& dc, const wxRect& r) : m_dc(dc)
|
||||
{ dc.SetClippingRegion(r.x, r.y, r.width, r.height); }
|
||||
wxDCClipper(wxDC& dc, wxCoord x, wxCoord y, wxCoord w, wxCoord h) : m_dc(dc)
|
||||
{ dc.SetClippingRegion(x, y, w, h); }
|
||||
|
||||
~wxDCClipper() { m_dc.DestroyClippingRegion(); }
|
||||
|
||||
private:
|
||||
wxDC& m_dc;
|
||||
};
|
||||
|
||||
#endif
|
||||
// _WX_DC_H_BASE_
|
23
include/wx/dcclient.h
Normal file
23
include/wx/dcclient.h
Normal file
@@ -0,0 +1,23 @@
|
||||
#ifndef _WX_DCCLIENT_H_BASE_
|
||||
#define _WX_DCCLIENT_H_BASE_
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#include "wx/msw/dcclient.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/dcclient.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/dcclient.h"
|
||||
#elif defined(__WXMGL__)
|
||||
#include "wx/mgl/dcclient.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/dcclient.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/dcclient.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/dcclient.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/stubs/dcclient.h"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
// _WX_DCCLIENT_H_BASE_
|
23
include/wx/dcmemory.h
Normal file
23
include/wx/dcmemory.h
Normal file
@@ -0,0 +1,23 @@
|
||||
#ifndef _WX_DCMEMORY_H_BASE_
|
||||
#define _WX_DCMEMORY_H_BASE_
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#include "wx/msw/dcmemory.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/dcmemory.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/dcmemory.h"
|
||||
#elif defined(__WXMGL__)
|
||||
#include "wx/mgl/dcmemory.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/dcmemory.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/dcmemory.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/dcmemory.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/stubs/dcmemory.h"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
// _WX_DCMEMORY_H_BASE_
|
23
include/wx/dcscreen.h
Normal file
23
include/wx/dcscreen.h
Normal file
@@ -0,0 +1,23 @@
|
||||
#ifndef _WX_DCSCREEN_H_BASE_
|
||||
#define _WX_DCSCREEN_H_BASE_
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#include "wx/msw/dcscreen.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/dcscreen.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/dcscreen.h"
|
||||
#elif defined(__WXMGL__)
|
||||
#include "wx/mgl/dcscreen.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/dcscreen.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/dcscreen.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/dcscreen.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/stubs/dcscreen.h"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
// _WX_DCSCREEN_H_BASE_
|
21
include/wx/dde.h
Normal file
21
include/wx/dde.h
Normal file
@@ -0,0 +1,21 @@
|
||||
#ifndef _WX_DDE_H_BASE_
|
||||
#define _WX_DDE_H_BASE_
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#include "wx/msw/dde.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/dde.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/dde.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/dde.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/dde.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/dde.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/stubs/dde.h"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
// _WX_DDE_H_BASE_
|
2094
include/wx/defs.h
Normal file
2094
include/wx/defs.h
Normal file
File diff suppressed because it is too large
Load Diff
69
include/wx/dialog.h
Normal file
69
include/wx/dialog.h
Normal file
@@ -0,0 +1,69 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/dialog.h
|
||||
// Purpose: wxDialogBase class
|
||||
// Author: Vadim Zeitlin
|
||||
// Modified by:
|
||||
// Created: 29.06.99
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Vadim Zeitlin
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_DIALOG_H_BASE_
|
||||
#define _WX_DIALOG_H_BASE_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "dialogbase.h"
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
#include "wx/panel.h"
|
||||
|
||||
class WXDLLEXPORT wxDialogBase : public wxPanel
|
||||
{
|
||||
public:
|
||||
#ifdef __DARWIN__
|
||||
~wxDialogBase() { }
|
||||
#endif
|
||||
// the modal dialogs have a return code - usually the id of the last
|
||||
// pressed button
|
||||
void SetReturnCode(int returnCode) { m_returnCode = returnCode; }
|
||||
int GetReturnCode() const { return m_returnCode; }
|
||||
|
||||
#if wxUSE_STATTEXT && wxUSE_TEXTCTRL
|
||||
// splits text up at newlines and places the
|
||||
// lines into a vertical wxBoxSizer
|
||||
wxSizer *CreateTextSizer( const wxString &message );
|
||||
#endif // wxUSE_STATTEXT && wxUSE_TEXTCTRL
|
||||
|
||||
#if wxUSE_BUTTON
|
||||
// places buttons into a horizontal wxBoxSizer
|
||||
wxSizer *CreateButtonSizer( long flags );
|
||||
#endif // wxUSE_BUTTON
|
||||
|
||||
protected:
|
||||
// the return code from modal dialog
|
||||
int m_returnCode;
|
||||
};
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#include "wx/msw/dialog.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/dialog.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/dialog.h"
|
||||
#elif defined(__WXMGL__)
|
||||
#include "wx/mgl/dialog.h"
|
||||
// FIXME_MGL -- belongs to wxUniv
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/dialog.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/dialog.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/dialog.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/stubs/dialog.h"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
// _WX_DIALOG_H_BASE_
|
41
include/wx/dirdlg.h
Normal file
41
include/wx/dirdlg.h
Normal file
@@ -0,0 +1,41 @@
|
||||
#ifndef _WX_DIRDLG_H_BASE_
|
||||
#define _WX_DIRDLG_H_BASE_
|
||||
|
||||
#if wxUSE_DIRDLG
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// constants
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
WXDLLEXPORT_DATA(extern const wxChar*) wxDirDialogNameStr;
|
||||
WXDLLEXPORT_DATA(extern const wxChar*) wxDirDialogDefaultFolderStr;
|
||||
WXDLLEXPORT_DATA(extern const wxChar*) wxEmptyString;
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#if defined(__WIN16__) || (defined(__GNUWIN32__) && !wxUSE_NORLANDER_HEADERS) || defined(__SALFORDC__)
|
||||
#include "wx/generic/dirdlgg.h"
|
||||
#else
|
||||
#include "wx/msw/dirdlg.h"
|
||||
#endif
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/generic/dirdlgg.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/generic/dirdlgg.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/dirdlg.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#ifdef __DARWIN__
|
||||
#include "wx/generic/dirdlgg.h"
|
||||
#else
|
||||
#include "wx/mac/dirdlg.h"
|
||||
#endif
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/dirdlg.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/stubs/dirdlg.h"
|
||||
#endif
|
||||
|
||||
#endif // wxUSE_DIRDLG
|
||||
|
||||
#endif
|
||||
// _WX_DIRDLG_H_BASE_
|
232
include/wx/dnd.h
Normal file
232
include/wx/dnd.h
Normal file
@@ -0,0 +1,232 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/dnd.h
|
||||
// Purpose: Drag and drop classes declarations
|
||||
// Author: Vadim Zeitlin, Robert Roebling
|
||||
// Modified by:
|
||||
// Created: 26.05.99
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) wxWindows Team
|
||||
// Licence: wxWindows license
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_DND_H_BASE_
|
||||
#define _WX_DND_H_BASE_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "dndbase.h"
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_DRAG_AND_DROP
|
||||
|
||||
#include "wx/dataobj.h"
|
||||
#include "wx/cursor.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// constants
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// result of wxDropSource::DoDragDrop() call
|
||||
enum wxDragResult
|
||||
{
|
||||
wxDragError, // error prevented the d&d operation from completing
|
||||
wxDragNone, // drag target didn't accept the data
|
||||
wxDragCopy, // the data was successfully copied
|
||||
wxDragMove, // the data was successfully moved (MSW only)
|
||||
wxDragCancel // the operation was cancelled by user (not an error)
|
||||
};
|
||||
|
||||
inline WXDLLEXPORT bool wxIsDragResultOk(wxDragResult res)
|
||||
{
|
||||
return res == wxDragCopy || res == wxDragMove;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxDropSource is the object you need to create (and call DoDragDrop on it)
|
||||
// to initiate a drag-and-drop operation
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxDropSourceBase
|
||||
{
|
||||
public:
|
||||
wxDropSourceBase(const wxCursor &cursorCopy = wxNullCursor,
|
||||
const wxCursor &cursorMove = wxNullCursor,
|
||||
const wxCursor &cursorStop = wxNullCursor)
|
||||
: m_cursorCopy(cursorCopy),
|
||||
m_cursorMove(cursorMove),
|
||||
m_cursorStop(cursorStop)
|
||||
{ m_data = (wxDataObject *)NULL; }
|
||||
virtual ~wxDropSourceBase() { }
|
||||
|
||||
// set the data which is transfered by drag and drop
|
||||
void SetData(wxDataObject& data)
|
||||
{ m_data = &data; }
|
||||
|
||||
wxDataObject *GetDataObject()
|
||||
{ return m_data; }
|
||||
|
||||
// set the icon corresponding to given drag result
|
||||
void SetCursor(wxDragResult res, const wxCursor& cursor)
|
||||
{
|
||||
if ( res == wxDragCopy )
|
||||
m_cursorCopy = cursor;
|
||||
else if ( res == wxDragMove )
|
||||
m_cursorMove = cursor;
|
||||
else
|
||||
m_cursorStop = cursor;
|
||||
}
|
||||
|
||||
// start drag action, see enum wxDragResult for return value description
|
||||
//
|
||||
// if bAllowMove is TRUE, data can be moved, if not - only copied
|
||||
virtual wxDragResult DoDragDrop(bool bAllowMove = FALSE) = 0;
|
||||
|
||||
// override to give feedback depending on the current operation result
|
||||
// "effect" and return TRUE if you did something, FALSE to let the library
|
||||
// give the default feedback
|
||||
virtual bool GiveFeedback(wxDragResult WXUNUSED(effect)) { return FALSE; }
|
||||
|
||||
protected:
|
||||
const wxCursor& GetCursor(wxDragResult res) const
|
||||
{
|
||||
if ( res == wxDragCopy )
|
||||
return m_cursorCopy;
|
||||
else if ( res == wxDragMove )
|
||||
return m_cursorMove;
|
||||
else
|
||||
return m_cursorStop;
|
||||
}
|
||||
|
||||
wxDataObject *m_data;
|
||||
|
||||
// the cursors to use for feedback
|
||||
wxCursor m_cursorCopy, m_cursorMove, m_cursorStop;
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxDropTarget should be associated with a window if it wants to be able to
|
||||
// receive data via drag and drop.
|
||||
//
|
||||
// To use this class, you should derive from wxDropTarget and implement
|
||||
// OnData() pure virtual method. You may also wish to override OnDrop() if you
|
||||
// want to accept the data only inside some region of the window (this may
|
||||
// avoid having to copy the data to this application which happens only when
|
||||
// OnData() is called)
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxDropTargetBase
|
||||
{
|
||||
public:
|
||||
// ctor takes a pointer to heap-allocated wxDataObject which will be owned
|
||||
// by wxDropTarget and deleted by it automatically. If you don't give it
|
||||
// here, you can use SetDataObject() later.
|
||||
wxDropTargetBase(wxDataObject *dataObject = (wxDataObject*)NULL)
|
||||
{ m_dataObject = dataObject; }
|
||||
// dtor deletes our data object
|
||||
virtual ~wxDropTargetBase()
|
||||
{ delete m_dataObject; }
|
||||
|
||||
// get/set the associated wxDataObject
|
||||
wxDataObject *GetDataObject() const
|
||||
{ return m_dataObject; }
|
||||
void SetDataObject(wxDataObject *dataObject)
|
||||
{ if (m_dataObject) delete m_dataObject;
|
||||
m_dataObject = dataObject; }
|
||||
|
||||
// these functions are called when data is moved over position (x, y) and
|
||||
// may return either wxDragCopy, wxDragMove or wxDragNone depending on
|
||||
// what would happen if the data were dropped here.
|
||||
//
|
||||
// the last parameter is what would happen by default and is determined by
|
||||
// the platform-specific logic (for example, under Windows it's wxDragCopy
|
||||
// if Ctrl key is pressed and wxDragMove otherwise) except that it will
|
||||
// always be wxDragNone if the carried data is in an unsupported format.
|
||||
|
||||
// called when the mouse enters the window (only once until OnLeave())
|
||||
virtual wxDragResult OnEnter(wxCoord x, wxCoord y, wxDragResult def)
|
||||
{ return OnDragOver(x, y, def); }
|
||||
|
||||
// called when the mouse moves in the window - shouldn't take long to
|
||||
// execute or otherwise mouse movement would be too slow
|
||||
virtual wxDragResult OnDragOver(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y),
|
||||
wxDragResult def)
|
||||
{ return def; }
|
||||
|
||||
// called when mouse leaves the window: might be used to remove the
|
||||
// feedback which was given in OnEnter()
|
||||
virtual void OnLeave() { }
|
||||
|
||||
// this function is called when data is dropped at position (x, y) - if it
|
||||
// returns TRUE, OnData() will be called immediately afterwards which will
|
||||
// allow to retrieve the data dropped.
|
||||
virtual bool OnDrop(wxCoord x, wxCoord y) = 0;
|
||||
|
||||
// called after OnDrop() returns TRUE: you will usually just call
|
||||
// GetData() from here and, probably, also refresh something to update the
|
||||
// new data and, finally, return the code indicating how did the operation
|
||||
// complete (returning default value in case of success and wxDragError on
|
||||
// failure is usually ok)
|
||||
virtual wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult def) = 0;
|
||||
|
||||
// may be called *only* from inside OnData() and will fill m_dataObject
|
||||
// with the data from the drop source if it returns TRUE
|
||||
virtual bool GetData() = 0;
|
||||
|
||||
protected:
|
||||
wxDataObject *m_dataObject;
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// include platform dependent class declarations
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#include "wx/msw/ole/dropsrc.h"
|
||||
#include "wx/msw/ole/droptgt.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/dnd.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/dnd.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/dnd.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/dnd.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/dnd.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/stubs/dnd.h"
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// standard wxDropTarget implementations (implemented in common/dobjcmn.cpp)
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// A simple wxDropTarget derived class for text data: you only need to
|
||||
// override OnDropText() to get something working
|
||||
class WXDLLEXPORT wxTextDropTarget : public wxDropTarget
|
||||
{
|
||||
public:
|
||||
wxTextDropTarget();
|
||||
|
||||
virtual bool OnDropText(wxCoord x, wxCoord y, const wxString& text) = 0;
|
||||
|
||||
virtual wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult def);
|
||||
};
|
||||
|
||||
// A drop target which accepts files (dragged from File Manager or Explorer)
|
||||
class WXDLLEXPORT wxFileDropTarget : public wxDropTarget
|
||||
{
|
||||
public:
|
||||
wxFileDropTarget();
|
||||
|
||||
// parameters are the number of files and the array of file names
|
||||
virtual bool OnDropFiles(wxCoord x, wxCoord y,
|
||||
const wxArrayString& filenames) = 0;
|
||||
|
||||
virtual wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult def);
|
||||
};
|
||||
|
||||
#endif // wxUSE_DRAG_AND_DROP
|
||||
|
||||
#endif // _WX_DND_H_BASE_
|
50
include/wx/dragimag.h
Normal file
50
include/wx/dragimag.h
Normal file
@@ -0,0 +1,50 @@
|
||||
#ifndef _WX_DRAGIMAG_H_BASE_
|
||||
#define _WX_DRAGIMAG_H_BASE_
|
||||
|
||||
#if wxUSE_DRAGIMAGE
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#ifdef __WIN16__
|
||||
#include "wx/generic/dragimgg.h"
|
||||
#define wxDragImage wxGenericDragImage
|
||||
#define sm_classwxDragImage sm_classwxGenericDragImage
|
||||
|
||||
#else
|
||||
#include "wx/msw/dragimag.h"
|
||||
#endif
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/generic/dragimgg.h"
|
||||
#define wxDragImage wxGenericDragImage
|
||||
#define sm_classwxDragImage sm_classwxGenericDragImage
|
||||
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/generic/dragimgg.h"
|
||||
#define wxDragImage wxGenericDragImage
|
||||
#define sm_classwxDragImage sm_classwxGenericDragImage
|
||||
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/generic/dragimgg.h"
|
||||
#define wxDragImage wxGenericDragImage
|
||||
#define sm_classwxDragImage sm_classwxGenericDragImage
|
||||
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/generic/dragimgg.h"
|
||||
#define wxDragImage wxGenericDragImage
|
||||
#define sm_classwxDragImage sm_classwxGenericDragImage
|
||||
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/generic/dragimgg.h"
|
||||
#define wxDragImage wxGenericDragImage
|
||||
#define sm_classwxDragImage sm_classwxGenericDragImage
|
||||
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/generic/dragimgg.h"
|
||||
#define wxDragImage wxGenericDragImage
|
||||
#define sm_classwxDragImage sm_classwxGenericDragImage
|
||||
|
||||
#endif
|
||||
|
||||
#endif // wxUSE_DRAGIMAGE
|
||||
|
||||
#endif
|
||||
// _WX_DRAGIMAG_H_BASE_
|
40
include/wx/filedlg.h
Normal file
40
include/wx/filedlg.h
Normal file
@@ -0,0 +1,40 @@
|
||||
#ifndef _WX_FILEDLG_H_BASE_
|
||||
#define _WX_FILEDLG_H_BASE_
|
||||
|
||||
#if wxUSE_FILEDLG
|
||||
|
||||
enum
|
||||
{
|
||||
wxOPEN = 0x0001,
|
||||
wxSAVE = 0x0002,
|
||||
wxOVERWRITE_PROMPT = 0x0004,
|
||||
wxHIDE_READONLY = 0x0008,
|
||||
wxFILE_MUST_EXIST = 0x0010,
|
||||
wxMULTIPLE = 0x0020,
|
||||
wxCHANGE_DIR = 0x0040
|
||||
};
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#include "wx/msw/filedlg.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/filedlg.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/generic/filedlgg.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/filedlg.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#ifdef __DARWIN__
|
||||
#include "wx/generic/filedlgg.h"
|
||||
#else
|
||||
#include "wx/mac/filedlg.h"
|
||||
#endif
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/filedlg.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/stubs/filedlg.h"
|
||||
#endif
|
||||
|
||||
#endif // wxUSE_FILEDLG
|
||||
|
||||
#endif
|
||||
// _WX_FILEDLG_H_BASE_
|
183
include/wx/font.h
Normal file
183
include/wx/font.h
Normal file
@@ -0,0 +1,183 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/font.h
|
||||
// Purpose: wxFontBase class: the interface of wxFont
|
||||
// Author: Vadim Zeitlin
|
||||
// Modified by:
|
||||
// Created: 20.09.99
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) wxWindows team
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_FONT_H_BASE_
|
||||
#define _WX_FONT_H_BASE_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "fontbase.h"
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#include "wx/defs.h" // for wxDEFAULT &c
|
||||
#include "wx/fontenc.h" // the font encoding constants
|
||||
#include "wx/gdiobj.h" // the base class
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// forward declarations
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxFontData;
|
||||
class WXDLLEXPORT wxFontBase;
|
||||
class WXDLLEXPORT wxFont;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// font constants
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// standard font families
|
||||
enum wxFontFamily
|
||||
{
|
||||
wxFONTFAMILY_DEFAULT = wxDEFAULT,
|
||||
wxFONTFAMILY_DECORATIVE = wxDECORATIVE,
|
||||
wxFONTFAMILY_ROMAN = wxROMAN,
|
||||
wxFONTFAMILY_SCRIPT = wxSCRIPT,
|
||||
wxFONTFAMILY_SWISS = wxSWISS,
|
||||
wxFONTFAMILY_MODERN = wxMODERN,
|
||||
wxFONTFAMILY_TELETYPE = wxTELETYPE,
|
||||
wxFONTFAMILY_MAX
|
||||
};
|
||||
|
||||
// font styles
|
||||
enum wxFontStyle
|
||||
{
|
||||
wxFONTSTYLE_NORMAL = wxNORMAL,
|
||||
wxFONTSTYLE_ITALIC = wxITALIC,
|
||||
wxFONTSTYLE_SLANT = wxSLANT,
|
||||
wxFONTSTYLE_MAX
|
||||
};
|
||||
|
||||
// font weights
|
||||
enum wxFontWeight
|
||||
{
|
||||
wxFONTWEIGHT_NORMAL = wxNORMAL,
|
||||
wxFONTWEIGHT_LIGHT = wxLIGHT,
|
||||
wxFONTWEIGHT_BOLD = wxBOLD,
|
||||
wxFONTWEIGHT_MAX
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxFontBase represents a font object
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxFontRefData;
|
||||
struct WXDLLEXPORT wxNativeFontInfo;
|
||||
|
||||
class WXDLLEXPORT wxFontBase : public wxGDIObject
|
||||
{
|
||||
public:
|
||||
// creator function
|
||||
#ifdef __DARWIN__
|
||||
virtual ~wxFontBase() { }
|
||||
#endif
|
||||
|
||||
// from the font components
|
||||
static wxFont *New(
|
||||
int pointSize, // size of the font in points
|
||||
int family, // see wxFontFamily enum
|
||||
int style, // see wxFontStyle enum
|
||||
int weight, // see wxFontWeight enum
|
||||
bool underlined = FALSE, // not underlined by default
|
||||
const wxString& face = wxEmptyString, // facename
|
||||
wxFontEncoding encoding = wxFONTENCODING_DEFAULT); // ISO8859-X, ...
|
||||
|
||||
// from the (opaque) native font description object
|
||||
static wxFont *New(const wxNativeFontInfo& nativeFontDesc);
|
||||
|
||||
// from the string representation of wxNativeFontInfo
|
||||
static wxFont *New(const wxString& strNativeFontDesc);
|
||||
|
||||
// was the font successfully created?
|
||||
bool Ok() const { return m_refData != NULL; }
|
||||
|
||||
// comparison
|
||||
bool operator == (const wxFont& font) const;
|
||||
bool operator != (const wxFont& font) const;
|
||||
|
||||
// accessors: get the font characteristics
|
||||
virtual int GetPointSize() const = 0;
|
||||
virtual int GetFamily() const = 0;
|
||||
virtual int GetStyle() const = 0;
|
||||
virtual int GetWeight() const = 0;
|
||||
virtual bool GetUnderlined() const = 0;
|
||||
virtual wxString GetFaceName() const = 0;
|
||||
virtual wxFontEncoding GetEncoding() const = 0;
|
||||
virtual wxNativeFontInfo *GetNativeFontInfo() const;
|
||||
wxString GetNativeFontInfoDesc() const;
|
||||
|
||||
// change the font characteristics
|
||||
virtual void SetPointSize( int pointSize ) = 0;
|
||||
virtual void SetFamily( int family ) = 0;
|
||||
virtual void SetStyle( int style ) = 0;
|
||||
virtual void SetWeight( int weight ) = 0;
|
||||
virtual void SetFaceName( const wxString& faceName ) = 0;
|
||||
virtual void SetUnderlined( bool underlined ) = 0;
|
||||
virtual void SetEncoding(wxFontEncoding encoding) = 0;
|
||||
virtual void SetNativeFontInfo(const wxNativeFontInfo& info);
|
||||
|
||||
// VZ: there is no void SetNativeFontInfo(const wxString& info), needed?
|
||||
|
||||
// translate the fonts into human-readable string (i.e. GetStyleString()
|
||||
// will return "wxITALIC" for an italic font, ...)
|
||||
wxString GetFamilyString() const;
|
||||
wxString GetStyleString() const;
|
||||
wxString GetWeightString() const;
|
||||
|
||||
// the default encoding is used for creating all fonts with default
|
||||
// encoding parameter
|
||||
static wxFontEncoding GetDefaultEncoding()
|
||||
{ return ms_encodingDefault; }
|
||||
static void SetDefaultEncoding(wxFontEncoding encoding)
|
||||
{ ms_encodingDefault = encoding; }
|
||||
|
||||
protected:
|
||||
// get the internal data
|
||||
wxFontRefData *GetFontData() const
|
||||
{ return (wxFontRefData *)m_refData; }
|
||||
|
||||
private:
|
||||
// the currently default encoding: by default, it's the default system
|
||||
// encoding, but may be changed by the application using
|
||||
// SetDefaultEncoding() to make all subsequent fonts created without
|
||||
// specifing encoding parameter using this encoding
|
||||
static wxFontEncoding ms_encodingDefault;
|
||||
};
|
||||
|
||||
// include the real class declaration
|
||||
#if defined(__WXMSW__)
|
||||
#include "wx/msw/font.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/font.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/font.h"
|
||||
#elif defined(__WXMGL__)
|
||||
#include "wx/mgl/font.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/font.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/font.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/font.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/stubs/font.h"
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// macros
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#define M_FONTDATA GetFontData()
|
||||
|
||||
#endif
|
||||
// _WX_FONT_H_BASE_
|
102
include/wx/gauge.h
Normal file
102
include/wx/gauge.h
Normal file
@@ -0,0 +1,102 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gauge.h
|
||||
// Purpose: wxGauge interface
|
||||
// Author: Vadim Zeitlin
|
||||
// Modified by:
|
||||
// Created: 20.02.01
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 1996-2001 wxWindows team
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GAUGE_H_BASE_
|
||||
#define _WX_GAUGE_H_BASE_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "gaugebase.h"
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_GAUGE
|
||||
|
||||
#include "wx/control.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const wxChar*) wxGaugeNameStr;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxGauge: a progress bar
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxGaugeBase : public wxControl
|
||||
{
|
||||
public:
|
||||
#ifdef __DARWIN__
|
||||
virtual ~wxGaugeBase() { }
|
||||
#endif
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
int range,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxGA_HORIZONTAL,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxGaugeNameStr);
|
||||
|
||||
// set/get the control range
|
||||
virtual void SetRange(int range);
|
||||
virtual int GetRange() const;
|
||||
|
||||
// position
|
||||
virtual void SetValue(int pos);
|
||||
virtual int GetValue() const;
|
||||
|
||||
// appearance params (not implemented for most ports)
|
||||
|
||||
virtual void SetShadowWidth(int w);
|
||||
virtual int GetShadowWidth() const;
|
||||
|
||||
virtual void SetBezelFace(int w);
|
||||
virtual int GetBezelFace() const;
|
||||
|
||||
// overriden base class virtuals
|
||||
virtual bool AcceptsFocus() const { return FALSE; }
|
||||
|
||||
protected:
|
||||
// the max position
|
||||
int m_rangeMax;
|
||||
|
||||
// the current position
|
||||
int m_gaugePos;
|
||||
};
|
||||
|
||||
#if defined(__WXUNIVERSAL__)
|
||||
#include "wx/univ/gauge.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#ifdef __WIN95__
|
||||
#include "wx/msw/gauge95.h"
|
||||
#define wxGauge wxGauge95
|
||||
#define sm_classwxGauge sm_classwxGauge95
|
||||
#else // !__WIN95__
|
||||
#include "wx/msw/gaugemsw.h"
|
||||
#define wxGauge wxGaugeMSW
|
||||
#define sm_classwxGauge sm_classwxGaugeMSW
|
||||
#endif
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/gauge.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/gauge.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/gauge.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/gauge.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/gauge.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/stubs/gauge.h"
|
||||
#endif
|
||||
|
||||
#endif // wxUSE_GAUGE
|
||||
|
||||
#endif
|
||||
// _WX_GAUGE_H_BASE_
|
23
include/wx/gdiobj.h
Normal file
23
include/wx/gdiobj.h
Normal file
@@ -0,0 +1,23 @@
|
||||
#ifndef _WX_GDIOBJ_H_BASE_
|
||||
#define _WX_GDIOBJ_H_BASE_
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#include "wx/msw/gdiobj.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/gdiobj.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/gdiobj.h"
|
||||
#elif defined(__WXMGL__)
|
||||
#include "wx/mgl/gdiobj.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/gdiobj.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/gdiobj.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/gdiobj.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/stubs/gdiobj.h"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
// _WX_GDIOBJ_H_BASE_
|
21
include/wx/glcanvas.h
Normal file
21
include/wx/glcanvas.h
Normal file
@@ -0,0 +1,21 @@
|
||||
#ifndef _WX_GLCANVAS_H_BASE_
|
||||
#define _WX_GLCANVAS_H_BASE_
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#include "wx/msw/glcanvas.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/glcanvas.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/glcanvas.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/glcanvas.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/glcanvas.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/glcanvas.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/stubs/glcanvas.h"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
// _WX_GLCANVAS_H_BASE_
|
29
include/wx/icon.h
Normal file
29
include/wx/icon.h
Normal file
@@ -0,0 +1,29 @@
|
||||
#ifndef _WX_ICON_H_BASE_
|
||||
#define _WX_ICON_H_BASE_
|
||||
|
||||
/* Commenting out since duplicated in gdicmn.h
|
||||
// this is for Unix (i.e. now for anything other than MSW)
|
||||
#undef wxICON
|
||||
#define wxICON(icon_name) wxIcon(icon_name##_xpm)
|
||||
*/
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#include "wx/msw/icon.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/icon.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/icon.h"
|
||||
#elif defined(__WXMGL__)
|
||||
#include "wx/mgl/icon.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/icon.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/icon.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/icon.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/stubs/icon.h"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
// _WX_ICON_H_BASE_
|
149
include/wx/listbox.h
Normal file
149
include/wx/listbox.h
Normal file
@@ -0,0 +1,149 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/listbox.h
|
||||
// Purpose: wxListBox class interface
|
||||
// Author: Vadim Zeitlin
|
||||
// Modified by:
|
||||
// Created: 22.10.99
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) wxWindows team
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_LISTBOX_H_BASE_
|
||||
#define _WX_LISTBOX_H_BASE_
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "listboxbase.h"
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_LISTBOX
|
||||
|
||||
#include "wx/ctrlsub.h" // base class
|
||||
|
||||
// forward declarations are enough here
|
||||
class WXDLLEXPORT wxArrayInt;
|
||||
class WXDLLEXPORT wxArrayString;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// global data
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
WXDLLEXPORT_DATA(extern const wxChar*) wxListBoxNameStr;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxListBox interface is defined by the class wxListBoxBase
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxListBoxBase : public wxControlWithItems
|
||||
{
|
||||
public:
|
||||
// all generic methods are in wxControlWithItems, except for the following
|
||||
// ones which are not yet implemented by wxChoice/wxCombobox
|
||||
#ifdef __DARWIN__
|
||||
virtual ~wxListBoxBase() { }
|
||||
#endif
|
||||
|
||||
void Insert(const wxString& item, int pos)
|
||||
{ DoInsert(item, pos); }
|
||||
void Insert(const wxString& item, int pos, void *clientData)
|
||||
{ DoInsert(item, pos); SetClientData(pos, clientData); }
|
||||
void Insert(const wxString& item, int pos, wxClientData *clientData)
|
||||
{ DoInsert(item, pos); SetClientObject(pos, clientData); }
|
||||
|
||||
void InsertItems(int nItems, const wxString *items, int pos);
|
||||
void InsertItems(const wxArrayString& items, int pos)
|
||||
{ DoInsertItems(items, pos); }
|
||||
|
||||
void Set(int n, const wxString* items, void **clientData = NULL);
|
||||
void Set(const wxArrayString& items, void **clientData = NULL)
|
||||
{ DoSetItems(items, clientData); }
|
||||
|
||||
// multiple selection logic
|
||||
virtual bool IsSelected(int n) const = 0;
|
||||
virtual void SetSelection(int n, bool select = TRUE) = 0;
|
||||
virtual void Select(int n) { SetSelection(n, TRUE); }
|
||||
void Deselect(int n) { SetSelection(n, FALSE); }
|
||||
void DeselectAll(int itemToLeaveSelected = -1);
|
||||
|
||||
virtual bool SetStringSelection(const wxString& s, bool select = TRUE);
|
||||
|
||||
// works for single as well as multiple selection listboxes (unlike
|
||||
// GetSelection which only works for listboxes with single selection)
|
||||
virtual int GetSelections(wxArrayInt& aSelections) const = 0;
|
||||
|
||||
// set the specified item at the first visible item or scroll to max
|
||||
// range.
|
||||
void SetFirstItem(int n) { DoSetFirstItem(n); }
|
||||
void SetFirstItem(const wxString& s);
|
||||
|
||||
// ensures that the given item is visible scrolling the listbox if
|
||||
// necessary
|
||||
virtual void EnsureVisible(int n);
|
||||
|
||||
// a combination of Append() and EnsureVisible(): appends the item to the
|
||||
// listbox and ensures that it is visible i.e. not scrolled out of view
|
||||
void AppendAndEnsureVisible(const wxString& s);
|
||||
|
||||
// return TRUE if the listbox allows multiple selection
|
||||
bool HasMultipleSelection() const
|
||||
{
|
||||
return (m_windowStyle & wxLB_MULTIPLE) ||
|
||||
(m_windowStyle & wxLB_EXTENDED);
|
||||
}
|
||||
|
||||
// return TRUE if this listbox is sorted
|
||||
bool IsSorted() const { return (m_windowStyle & wxLB_SORT) != 0; }
|
||||
|
||||
// emulate selecting or deselecting the item event.GetInt() (depending on
|
||||
// event.GetExtraLong())
|
||||
void Command(wxCommandEvent& event);
|
||||
|
||||
// compatibility - these functions are deprecated, use the new ones
|
||||
// instead
|
||||
bool Selected(int n) const { return IsSelected(n); }
|
||||
|
||||
protected:
|
||||
// NB: due to wxGTK implementation details, DoInsert() is implemented
|
||||
// using DoInsertItems() and not the other way round
|
||||
void DoInsert(const wxString& item, int pos)
|
||||
{ InsertItems(1, &item, pos); }
|
||||
|
||||
// to be implemented in derived classes
|
||||
virtual void DoInsertItems(const wxArrayString& items, int pos) = 0;
|
||||
virtual void DoSetItems(const wxArrayString& items, void **clientData) = 0;
|
||||
|
||||
virtual void DoSetFirstItem(int n) = 0;
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// include the platform-specific class declaration
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__WXUNIVERSAL__)
|
||||
#include "wx/univ/listbox.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/listbox.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/listbox.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/listbox.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/listbox.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/listbox.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/listbox.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/stubs/listbox.h"
|
||||
#endif
|
||||
|
||||
#endif // wxUSE_LISTBOX
|
||||
|
||||
#endif
|
||||
// _WX_LISTBOX_H_BASE_
|
21
include/wx/mdi.h
Normal file
21
include/wx/mdi.h
Normal file
@@ -0,0 +1,21 @@
|
||||
#ifndef _WX_MDI_H_BASE_
|
||||
#define _WX_MDI_H_BASE_
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#include "wx/msw/mdi.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/mdi.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/mdi.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/mdi.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/mdi.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/mdi.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/stubs/mdi.h"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
// _WX_MDI_H_BASE_
|
468
include/wx/menu.h
Normal file
468
include/wx/menu.h
Normal file
@@ -0,0 +1,468 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/menu.h
|
||||
// Purpose: wxMenu and wxMenuBar classes
|
||||
// Author: Vadim Zeitlin
|
||||
// Modified by:
|
||||
// Created: 26.10.99
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) wxWindows team
|
||||
// Licence: wxWindows license
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_MENU_H_BASE_
|
||||
#define _WX_MENU_H_BASE_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "menubase.h"
|
||||
#endif
|
||||
|
||||
#if wxUSE_MENUS
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#include "wx/list.h" // for "template" list classes
|
||||
#include "wx/window.h" // base class for wxMenuBar
|
||||
|
||||
// also include this one to ensure compatibility with old code which only
|
||||
// included wx/menu.h
|
||||
#include "wx/menuitem.h"
|
||||
|
||||
class WXDLLEXPORT wxMenu;
|
||||
class WXDLLEXPORT wxMenuBarBase;
|
||||
class WXDLLEXPORT wxMenuBar;
|
||||
class WXDLLEXPORT wxMenuItem;
|
||||
|
||||
// pseudo template list classes
|
||||
WX_DECLARE_EXPORTED_LIST(wxMenu, wxMenuList);
|
||||
WX_DECLARE_EXPORTED_LIST(wxMenuItem, wxMenuItemList);
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// conditional compilation
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// having callbacks in menus is a wxWin 1.6x feature which should be replaced
|
||||
// with event tables in wxWin 2.xx code - however provide it because many
|
||||
// people like it a lot by default
|
||||
#ifndef wxUSE_MENU_CALLBACK
|
||||
#if WXWIN_COMPATIBILITY_2
|
||||
#define wxUSE_MENU_CALLBACK 1
|
||||
#else
|
||||
#define wxUSE_MENU_CALLBACK 0
|
||||
#endif // WXWIN_COMPATIBILITY_2
|
||||
#endif // !defined(wxUSE_MENU_CALLBACK)
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxMenu
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxMenuBase : public wxEvtHandler
|
||||
{
|
||||
public:
|
||||
// create a menu
|
||||
static wxMenu *New(const wxString& title = wxEmptyString, long style = 0);
|
||||
|
||||
// ctors
|
||||
wxMenuBase(const wxString& title, long style = 0) : m_title(title)
|
||||
{ Init(style); }
|
||||
wxMenuBase(long style = 0)
|
||||
{ Init(style); }
|
||||
|
||||
// dtor deletes all the menu items we own
|
||||
virtual ~wxMenuBase();
|
||||
|
||||
// menu construction
|
||||
// -----------------
|
||||
|
||||
// append a normal item to the menu
|
||||
void Append(int id,
|
||||
const wxString& text,
|
||||
const wxString& help = wxEmptyString,
|
||||
bool isCheckable = FALSE)
|
||||
{
|
||||
DoAppend(wxMenuItem::New((wxMenu *)this, id, text, help, isCheckable));
|
||||
}
|
||||
|
||||
// append a separator to the menu
|
||||
void AppendSeparator() { Append(wxID_SEPARATOR, wxEmptyString); }
|
||||
|
||||
// append a submenu
|
||||
void Append(int id,
|
||||
const wxString& text,
|
||||
wxMenu *submenu,
|
||||
const wxString& help = wxEmptyString)
|
||||
{
|
||||
DoAppend(wxMenuItem::New((wxMenu *)this, id, text, help, FALSE, submenu));
|
||||
}
|
||||
|
||||
// the most generic form of Append() - append anything
|
||||
void Append(wxMenuItem *item) { DoAppend(item); }
|
||||
|
||||
// insert a break in the menu (only works when appending the items, not
|
||||
// inserting them)
|
||||
virtual void Break() { }
|
||||
|
||||
// insert an item before given position
|
||||
bool Insert(size_t pos, wxMenuItem *item);
|
||||
void Insert(size_t pos,
|
||||
int id,
|
||||
const wxString& text,
|
||||
const wxString& help = wxEmptyString,
|
||||
bool isCheckable = FALSE)
|
||||
{
|
||||
Insert(pos, wxMenuItem::New((wxMenu *)this, id, text, help, isCheckable));
|
||||
}
|
||||
|
||||
// insert a separator
|
||||
void InsertSeparator(size_t pos)
|
||||
{
|
||||
Insert(pos, wxMenuItem::New((wxMenu *)this));
|
||||
}
|
||||
|
||||
// insert a submenu
|
||||
void Insert(size_t pos,
|
||||
int id,
|
||||
const wxString& text,
|
||||
wxMenu *submenu,
|
||||
const wxString& help = wxEmptyString)
|
||||
{
|
||||
Insert(pos, wxMenuItem::New((wxMenu *)this, id, text, help, FALSE, submenu));
|
||||
}
|
||||
|
||||
// prepend an item to the menu
|
||||
void Prepend(wxMenuItem *item)
|
||||
{
|
||||
Insert(0u, item);
|
||||
}
|
||||
|
||||
void Prepend(int id,
|
||||
const wxString& text,
|
||||
const wxString& help = wxEmptyString,
|
||||
bool isCheckable = FALSE)
|
||||
{
|
||||
Insert(0u, id, text, help, isCheckable);
|
||||
}
|
||||
|
||||
// insert a separator
|
||||
void PrependSeparator()
|
||||
{
|
||||
InsertSeparator(0u);
|
||||
}
|
||||
|
||||
// insert a submenu
|
||||
void Prepend(int id,
|
||||
const wxString& text,
|
||||
wxMenu *submenu,
|
||||
const wxString& help = wxEmptyString)
|
||||
{
|
||||
Insert(0u, id, text, submenu, help);
|
||||
}
|
||||
|
||||
// detach an item from the menu, but don't delete it so that it can be
|
||||
// added back later (but if it's not, the caller is responsible for
|
||||
// deleting it!)
|
||||
wxMenuItem *Remove(int id) { return Remove(FindChildItem(id)); }
|
||||
wxMenuItem *Remove(wxMenuItem *item);
|
||||
|
||||
// delete an item from the menu (submenus are not destroyed by this
|
||||
// function, see Destroy)
|
||||
bool Delete(int id) { return Delete(FindChildItem(id)); }
|
||||
bool Delete(wxMenuItem *item);
|
||||
|
||||
// delete the item from menu and destroy it (if it's a submenu)
|
||||
bool Destroy(int id) { return Destroy(FindChildItem(id)); }
|
||||
bool Destroy(wxMenuItem *item);
|
||||
|
||||
// menu items access
|
||||
// -----------------
|
||||
|
||||
// get the items
|
||||
size_t GetMenuItemCount() const { return m_items.GetCount(); }
|
||||
|
||||
const wxMenuItemList& GetMenuItems() const { return m_items; }
|
||||
wxMenuItemList& GetMenuItems() { return m_items; }
|
||||
|
||||
// search
|
||||
virtual int FindItem(const wxString& item) const;
|
||||
wxMenuItem* FindItem(int id, wxMenu **menu = NULL) const;
|
||||
|
||||
// get/set items attributes
|
||||
void Enable(int id, bool enable);
|
||||
bool IsEnabled(int id) const;
|
||||
|
||||
void Check(int id, bool check);
|
||||
bool IsChecked(int id) const;
|
||||
|
||||
void SetLabel(int id, const wxString& label);
|
||||
wxString GetLabel(int id) const;
|
||||
|
||||
virtual void SetHelpString(int id, const wxString& helpString);
|
||||
virtual wxString GetHelpString(int id) const;
|
||||
|
||||
// misc accessors
|
||||
// --------------
|
||||
|
||||
// the title
|
||||
virtual void SetTitle(const wxString& title) { m_title = title; }
|
||||
const wxString GetTitle() const { return m_title; }
|
||||
|
||||
// client data
|
||||
void SetClientData(void* clientData) { m_clientData = clientData; }
|
||||
void* GetClientData() const { return m_clientData; }
|
||||
|
||||
// event handler
|
||||
void SetEventHandler(wxEvtHandler *handler) { m_eventHandler = handler; }
|
||||
wxEvtHandler *GetEventHandler() const { return m_eventHandler; }
|
||||
|
||||
// invoking window
|
||||
void SetInvokingWindow(wxWindow *win) { m_invokingWindow = win; }
|
||||
wxWindow *GetInvokingWindow() const { return m_invokingWindow; }
|
||||
|
||||
// style
|
||||
long GetStyle() const { return m_style; }
|
||||
|
||||
// implementation helpers
|
||||
// ----------------------
|
||||
|
||||
// Updates the UI for a menu and all submenus recursively. source is the
|
||||
// object that has the update event handlers defined for it. If NULL, the
|
||||
// menu or associated window will be used.
|
||||
void UpdateUI(wxEvtHandler* source = (wxEvtHandler*)NULL);
|
||||
|
||||
// get the menu bar this menu is attached to (may be NULL, always NULL for
|
||||
// popup menus)
|
||||
wxMenuBar *GetMenuBar() const { return m_menuBar; }
|
||||
|
||||
// called when the menu is attached/detached to/from a menu bar
|
||||
virtual void Attach(wxMenuBarBase *menubar);
|
||||
virtual void Detach();
|
||||
|
||||
// is the menu attached to a menu bar (or is it a popup one)?
|
||||
bool IsAttached() const { return m_menuBar != NULL; }
|
||||
|
||||
// set/get the parent of this menu
|
||||
void SetParent(wxMenu *parent) { m_menuParent = parent; }
|
||||
wxMenu *GetParent() const { return m_menuParent; }
|
||||
|
||||
#if WXWIN_COMPATIBILITY
|
||||
// compatibility: these functions are deprecated, use the new ones instead
|
||||
bool Enabled(int id) const { return IsEnabled(id); }
|
||||
bool Checked(int id) const { return IsChecked(id); }
|
||||
|
||||
wxMenuItem* FindItemForId(int itemId, wxMenu **itemMenu) const
|
||||
{ return FindItem(itemId, itemMenu); }
|
||||
|
||||
wxList& GetItems() const { return (wxList &)m_items; }
|
||||
#endif // WXWIN_COMPATIBILITY
|
||||
|
||||
#if wxUSE_MENU_CALLBACK || defined(__WXMOTIF__)
|
||||
// wxWin 1.6x compatible menu event handling
|
||||
wxFunction GetCallback() const { return m_callback; }
|
||||
void Callback(const wxFunction func) { m_callback = func; }
|
||||
|
||||
wxFunction m_callback;
|
||||
#endif // wxUSE_MENU_CALLBACK
|
||||
|
||||
// unlike FindItem(), this function doesn't recurse but only looks through
|
||||
// our direct children and also may return the index of the found child if
|
||||
// pos != NULL
|
||||
wxMenuItem *FindChildItem(int id, size_t *pos = NULL) const;
|
||||
|
||||
// called to generate a wxCommandEvent, return TRUE if it was processed,
|
||||
// FALSE otherwise
|
||||
//
|
||||
// the checked parameter may have boolean value or -1 for uncheckable items
|
||||
bool SendEvent(int id, int checked = -1);
|
||||
|
||||
protected:
|
||||
// virtuals to override in derived classes
|
||||
// ---------------------------------------
|
||||
|
||||
virtual bool DoAppend(wxMenuItem *item);
|
||||
virtual bool DoInsert(size_t pos, wxMenuItem *item);
|
||||
|
||||
virtual wxMenuItem *DoRemove(wxMenuItem *item);
|
||||
virtual bool DoDelete(wxMenuItem *item);
|
||||
virtual bool DoDestroy(wxMenuItem *item);
|
||||
|
||||
// helpers
|
||||
// -------
|
||||
|
||||
// common part of all ctors
|
||||
void Init(long style);
|
||||
|
||||
// associate the submenu with this menu
|
||||
void AddSubMenu(wxMenu *submenu);
|
||||
|
||||
wxMenuBar *m_menuBar; // menubar we belong to or NULL
|
||||
wxMenu *m_menuParent; // parent menu or NULL
|
||||
|
||||
wxString m_title; // the menu title or label
|
||||
wxMenuItemList m_items; // the list of menu items
|
||||
|
||||
wxWindow *m_invokingWindow; // for popup menus
|
||||
void *m_clientData; // associated with the menu
|
||||
|
||||
long m_style; // combination of wxMENU_XXX flags
|
||||
|
||||
wxEvtHandler *m_eventHandler; // a pluggable in event handler
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxMenuBar
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxMenuBarBase : public wxWindow
|
||||
{
|
||||
public:
|
||||
// default ctor
|
||||
wxMenuBarBase();
|
||||
|
||||
// dtor will delete all menus we own
|
||||
virtual ~wxMenuBarBase();
|
||||
|
||||
// menu bar construction
|
||||
// ---------------------
|
||||
|
||||
// append a menu to the end of menubar, return TRUE if ok
|
||||
virtual bool Append(wxMenu *menu, const wxString& title);
|
||||
|
||||
// insert a menu before the given position into the menubar, return TRUE
|
||||
// if inserted ok
|
||||
virtual bool Insert(size_t pos, wxMenu *menu, const wxString& title);
|
||||
|
||||
// menu bar items access
|
||||
// ---------------------
|
||||
|
||||
// get the number of menus in the menu bar
|
||||
size_t GetMenuCount() const { return m_menus.GetCount(); }
|
||||
|
||||
// get the menu at given position
|
||||
wxMenu *GetMenu(size_t pos) const;
|
||||
|
||||
// replace the menu at given position with another one, returns the
|
||||
// previous menu (which should be deleted by the caller)
|
||||
virtual wxMenu *Replace(size_t pos, wxMenu *menu, const wxString& title);
|
||||
|
||||
// delete the menu at given position from the menu bar, return the pointer
|
||||
// to the menu (which should be deleted by the caller)
|
||||
virtual wxMenu *Remove(size_t pos);
|
||||
|
||||
// enable or disable a submenu
|
||||
virtual void EnableTop(size_t pos, bool enable) = 0;
|
||||
|
||||
// is the menu enabled?
|
||||
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;
|
||||
virtual wxString GetLabelTop(size_t pos) const = 0;
|
||||
|
||||
// item search
|
||||
// -----------
|
||||
|
||||
// by menu and item names, returns wxNOT_FOUND if not found or id of the
|
||||
// found item
|
||||
virtual int FindMenuItem(const wxString& menu, const wxString& item) const;
|
||||
|
||||
// find item by id (in any menu), returns NULL if not found
|
||||
//
|
||||
// if menu is !NULL, it will be filled with wxMenu this item belongs to
|
||||
virtual wxMenuItem* FindItem(int id, wxMenu **menu = NULL) const;
|
||||
|
||||
// find menu by its caption, return wxNOT_FOUND on failure
|
||||
int FindMenu(const wxString& title) const;
|
||||
|
||||
// item access
|
||||
// -----------
|
||||
|
||||
// all these functions just use FindItem() and then call an appropriate
|
||||
// method on it
|
||||
//
|
||||
// NB: under MSW, these methods can only be used after the menubar had
|
||||
// been attached to the frame
|
||||
|
||||
void Enable(int id, bool enable);
|
||||
void Check(int id, bool check);
|
||||
bool IsChecked(int id) const;
|
||||
bool IsEnabled(int id) const;
|
||||
|
||||
void SetLabel(int id, const wxString &label);
|
||||
wxString GetLabel(int id) const;
|
||||
|
||||
void SetHelpString(int id, const wxString& helpString);
|
||||
wxString GetHelpString(int id) const;
|
||||
|
||||
// implementation helpers
|
||||
|
||||
// get the frame we are attached to (may return NULL)
|
||||
wxFrame *GetFrame() const { return m_menuBarFrame; }
|
||||
|
||||
// returns TRUE if we're attached to a frame
|
||||
bool IsAttached() const { return GetFrame() != NULL; }
|
||||
|
||||
// associate the menubar with the frame
|
||||
virtual void Attach(wxFrame *frame);
|
||||
|
||||
// called before deleting the menubar normally
|
||||
virtual void Detach();
|
||||
|
||||
// need to override these ones to avoid virtual function hiding
|
||||
virtual bool Enable(bool enable = TRUE) { return wxWindow::Enable(enable); }
|
||||
virtual void SetLabel(const wxString& s) { wxWindow::SetLabel(s); }
|
||||
virtual wxString GetLabel() const { return wxWindow::GetLabel(); }
|
||||
|
||||
// don't want menu bars to accept the focus by tabbing to them
|
||||
virtual bool AcceptsFocusFromKeyboard() const { return FALSE; }
|
||||
|
||||
// compatibility only: these functions are deprecated, use the new ones
|
||||
// instead
|
||||
#if WXWIN_COMPATIBILITY
|
||||
bool Enabled(int id) const { return IsEnabled(id); }
|
||||
bool Checked(int id) const { return IsChecked(id); }
|
||||
|
||||
wxMenuItem* FindMenuItemById(int id) const
|
||||
{ return FindItem(id); }
|
||||
wxMenuItem* FindItemForId(int id, wxMenu **menu = NULL) const
|
||||
{ return FindItem(id, menu); }
|
||||
#endif // WXWIN_COMPATIBILITY
|
||||
|
||||
protected:
|
||||
// the list of all our menus
|
||||
wxMenuList m_menus;
|
||||
|
||||
// the frame we are attached to (may be NULL)
|
||||
wxFrame *m_menuBarFrame;
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// include the real class declaration
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#ifdef wxUSE_BASE_CLASSES_ONLY
|
||||
#define wxMenuItem wxMenuItemBase
|
||||
#else // !wxUSE_BASE_CLASSES_ONLY
|
||||
#if defined(__WXUNIVERSAL__)
|
||||
#include "wx/univ/menu.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/menu.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/menu.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/menu.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/menu.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/menu.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/menu.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/stubs/menu.h"
|
||||
#endif
|
||||
#endif // wxUSE_BASE_CLASSES_ONLY/!wxUSE_BASE_CLASSES_ONLY
|
||||
|
||||
#endif // wxUSE_MENUS
|
||||
|
||||
#endif
|
||||
// _WX_MENU_H_BASE_
|
157
include/wx/menuitem.h
Normal file
157
include/wx/menuitem.h
Normal file
@@ -0,0 +1,157 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/menuitem.h
|
||||
// Purpose: wxMenuItem class
|
||||
// Author: Vadim Zeitlin
|
||||
// Modified by:
|
||||
// Created: 25.10.99
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 1999 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
|
||||
// Licence: wxWindows license
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_MENUITEM_H_BASE_
|
||||
#define _WX_MENUITEM_H_BASE_
|
||||
|
||||
#if wxUSE_MENUS
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#include "wx/object.h" // base class
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// forward declarations
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxAcceleratorEntry;
|
||||
class WXDLLEXPORT wxMenuItem;
|
||||
class WXDLLEXPORT wxMenu;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxMenuItem is an item in the menu which may be either a normal item, a sub
|
||||
// menu or a separator
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxMenuItemBase : public wxObject
|
||||
{
|
||||
public:
|
||||
// creation
|
||||
static wxMenuItem *New(wxMenu *parentMenu = (wxMenu *)NULL,
|
||||
int id = wxID_SEPARATOR,
|
||||
const wxString& text = wxEmptyString,
|
||||
const wxString& help = wxEmptyString,
|
||||
bool isCheckable = FALSE,
|
||||
wxMenu *subMenu = (wxMenu *)NULL);
|
||||
|
||||
// destruction: wxMenuItem will delete its submenu
|
||||
virtual ~wxMenuItemBase();
|
||||
|
||||
// the menu we're in
|
||||
wxMenu *GetMenu() const { return m_parentMenu; }
|
||||
|
||||
// get/set id
|
||||
void SetId(int id) { m_id = id; }
|
||||
int GetId() const { return m_id; }
|
||||
bool IsSeparator() const { return m_id == wxID_SEPARATOR; }
|
||||
|
||||
// the item's text (or name)
|
||||
//
|
||||
// NB: the item's text includes the accelerators and mnemonics info (if
|
||||
// any), i.e. it may contain '&' or '_' or "\t..." and thus is
|
||||
// different from the item's label which only contains the text shown
|
||||
// in the menu
|
||||
virtual void SetText(const wxString& str) { m_text = str; }
|
||||
wxString GetLabel() const { return GetLabelFromText(m_text); }
|
||||
const wxString& GetText() const { return m_text; }
|
||||
|
||||
// get the label from text (implemented in platform-specific code)
|
||||
static wxString GetLabelFromText(const wxString& text);
|
||||
|
||||
// what kind of menu item we are
|
||||
virtual void SetCheckable(bool checkable) { m_isCheckable = checkable; }
|
||||
bool IsCheckable() const { return m_isCheckable; }
|
||||
|
||||
bool IsSubMenu() const { return m_subMenu != NULL; }
|
||||
void SetSubMenu(wxMenu *menu) { m_subMenu = menu; }
|
||||
wxMenu *GetSubMenu() const { return m_subMenu; }
|
||||
|
||||
// state
|
||||
virtual void Enable(bool enable = TRUE) { m_isEnabled = enable; }
|
||||
virtual bool IsEnabled() const { return m_isEnabled; }
|
||||
|
||||
virtual void Check(bool check = TRUE) { m_isChecked = check; }
|
||||
virtual bool IsChecked() const { return m_isChecked; }
|
||||
void Toggle() { Check(!m_isChecked); }
|
||||
|
||||
// help string (displayed in the status bar by default)
|
||||
void SetHelp(const wxString& str) { m_help = str; }
|
||||
const wxString& GetHelp() const { return m_help; }
|
||||
|
||||
#if wxUSE_ACCEL
|
||||
// extract the accelerator from the given menu string, return NULL if none
|
||||
// found
|
||||
static wxAcceleratorEntry *GetAccelFromString(const wxString& label);
|
||||
|
||||
// get our accelerator or NULL (caller must delete the pointer)
|
||||
virtual wxAcceleratorEntry *GetAccel() const;
|
||||
|
||||
// set the accel for this item - this may also be done indirectly with
|
||||
// SetText()
|
||||
virtual void SetAccel(wxAcceleratorEntry *accel);
|
||||
#endif // wxUSE_ACCEL
|
||||
|
||||
// compatibility only, use new functions in the new code
|
||||
void SetName(const wxString& str) { SetText(str); }
|
||||
const wxString& GetName() const { return GetText(); }
|
||||
|
||||
protected:
|
||||
int m_id; // numeric id of the item >= 0 or -1
|
||||
wxMenu *m_parentMenu, // the menu we belong to
|
||||
*m_subMenu; // our sub menu or NULL
|
||||
wxString m_text, // label of the item
|
||||
m_help; // the help string for the item
|
||||
bool m_isCheckable; // can be checked?
|
||||
bool m_isChecked; // is checked?
|
||||
bool m_isEnabled; // is enabled?
|
||||
|
||||
// some compilers need a default constructor here, do not remove
|
||||
wxMenuItemBase() { }
|
||||
|
||||
private:
|
||||
// and, if we have one ctor, compiler won't generate a default copy one, so
|
||||
// declare them ourselves - but don't implement as they shouldn't be used
|
||||
wxMenuItemBase(const wxMenuItemBase& item);
|
||||
wxMenuItemBase& operator=(const wxMenuItemBase& item);
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// include the real class declaration
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#ifdef wxUSE_BASE_CLASSES_ONLY
|
||||
#define wxMenuItem wxMenuItemBase
|
||||
#else // !wxUSE_BASE_CLASSES_ONLY
|
||||
#if defined(__WXUNIVERSAL__)
|
||||
#include "wx/univ/menuitem.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/menuitem.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/menuitem.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/menuitem.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/menuitem.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/menuitem.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/menuitem.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/stubs/menuitem.h"
|
||||
#endif
|
||||
#endif // wxUSE_BASE_CLASSES_ONLY/!wxUSE_BASE_CLASSES_ONLY
|
||||
|
||||
#endif // wxUSE_MENUS
|
||||
|
||||
#endif
|
||||
// _WX_MENUITEM_H_BASE_
|
37
include/wx/msgdlg.h
Normal file
37
include/wx/msgdlg.h
Normal file
@@ -0,0 +1,37 @@
|
||||
#ifndef _WX_MSGDLG_H_BASE_
|
||||
#define _WX_MSGDLG_H_BASE_
|
||||
|
||||
#if wxUSE_MSGDLG
|
||||
|
||||
#if defined(__WXUNIVERSAL__)
|
||||
#include "wx/generic/msgdlgg.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/msgdlg.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/msgdlg.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/generic/msgdlgg.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/generic/msgdlgg.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/msgdlg.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/msgdlg.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/generic/msgdlgg.h"
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxMessageBox: the simplest way to use wxMessageDialog
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
int WXDLLEXPORT wxMessageBox(const wxString& message,
|
||||
const wxString& caption = wxMessageBoxCaptionStr,
|
||||
long style = wxOK | wxCENTRE,
|
||||
wxWindow *parent = NULL,
|
||||
int x = -1, int y = -1);
|
||||
|
||||
#endif // wxUSE_MSGDLG
|
||||
|
||||
#endif
|
||||
// _WX_MSGDLG_H_BASE_
|
289
include/wx/notebook.h
Normal file
289
include/wx/notebook.h
Normal file
@@ -0,0 +1,289 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/notebook.h
|
||||
// Purpose: wxNotebook interface
|
||||
// Author: Vadim Zeitlin
|
||||
// Modified by:
|
||||
// Created: 01.02.01
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 1996-2000 wxWindows team
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_NOTEBOOK_H_BASE_
|
||||
#define _WX_NOTEBOOK_H_BASE_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "notebookbase.h"
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_NOTEBOOK
|
||||
|
||||
#include "wx/control.h"
|
||||
#include "wx/dynarray.h"
|
||||
|
||||
class WXDLLEXPORT wxImageList;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// types
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// array of notebook pages
|
||||
typedef wxWindow wxNotebookPage; // so far, any window can be a page
|
||||
|
||||
WX_DEFINE_EXPORTED_ARRAY(wxNotebookPage *, wxArrayPages);
|
||||
|
||||
#define wxNOTEBOOK_NAME _T("notebook")
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxNotebookBase: define wxNotebook interface
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxNotebookBase : public wxControl
|
||||
{
|
||||
public:
|
||||
// ctor
|
||||
wxNotebookBase()
|
||||
{
|
||||
Init();
|
||||
}
|
||||
|
||||
// quasi ctor
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxNOTEBOOK_NAME);
|
||||
|
||||
// dtor
|
||||
virtual ~wxNotebookBase();
|
||||
|
||||
// accessors
|
||||
// ---------
|
||||
|
||||
// get number of pages in the dialog
|
||||
int GetPageCount() const { return m_pages.GetCount(); }
|
||||
|
||||
// get the panel which represents the given page
|
||||
wxNotebookPage *GetPage(int nPage) { return m_pages[nPage]; }
|
||||
|
||||
// get the currently selected page
|
||||
virtual int GetSelection() const = 0;
|
||||
|
||||
// set/get the title of a page
|
||||
virtual bool SetPageText(int nPage, const wxString& strText) = 0;
|
||||
virtual wxString GetPageText(int nPage) const = 0;
|
||||
|
||||
// image list stuff: each page may have an image associated with it (all
|
||||
// images belong to the same image list)
|
||||
virtual void SetImageList(wxImageList* imageList);
|
||||
|
||||
// as SetImageList() but we will delete the image list ourselves
|
||||
void AssignImageList(wxImageList* imageList);
|
||||
|
||||
// get pointer (may be NULL) to the associated image list
|
||||
wxImageList* GetImageList() const { return m_imageList; }
|
||||
|
||||
// sets/returns item's image index in the current image list
|
||||
virtual int GetPageImage(int nPage) const = 0;
|
||||
virtual bool SetPageImage(int nPage, int nImage) = 0;
|
||||
|
||||
// get the number of rows for a control with wxNB_MULTILINE style (not all
|
||||
// versions support it - they will always return 1 then)
|
||||
virtual int GetRowCount() const { return 1; }
|
||||
|
||||
// set the size (the same for all pages)
|
||||
virtual void SetPageSize(const wxSize& size) = 0;
|
||||
|
||||
// set the padding between tabs (in pixels)
|
||||
virtual void SetPadding(const wxSize& padding) = 0;
|
||||
|
||||
// set the size of the tabs for wxNB_FIXEDWIDTH controls
|
||||
virtual void SetTabSize(const wxSize& sz) = 0;
|
||||
|
||||
// calculate the size of the notebook from the size of its page
|
||||
virtual wxSize CalcSizeFromPage(const wxSize& sizePage);
|
||||
|
||||
// operations
|
||||
// ----------
|
||||
|
||||
// remove one page from the notebook and delete it
|
||||
virtual bool DeletePage(int nPage);
|
||||
|
||||
// remove one page from the notebook, without deleting it
|
||||
virtual bool RemovePage(int nPage) { return DoRemovePage(nPage) != NULL; }
|
||||
|
||||
// remove all pages and delete them
|
||||
virtual bool DeleteAllPages() { WX_CLEAR_ARRAY(m_pages); return TRUE; }
|
||||
|
||||
// adds a new page to the notebook (it will be deleted by the notebook,
|
||||
// don't delete it yourself) and make it the current one if bSelect
|
||||
virtual bool AddPage(wxNotebookPage *pPage,
|
||||
const wxString& strText,
|
||||
bool bSelect = FALSE,
|
||||
int imageId = -1)
|
||||
{
|
||||
return InsertPage(GetPageCount(), pPage, strText, bSelect, imageId);
|
||||
}
|
||||
|
||||
// the same as AddPage(), but adds the page at the specified position
|
||||
virtual bool InsertPage(int nPage,
|
||||
wxNotebookPage *pPage,
|
||||
const wxString& strText,
|
||||
bool bSelect = FALSE,
|
||||
int imageId = -1) = 0;
|
||||
|
||||
// set the currently selected page, return the index of the previously
|
||||
// selected one (or -1 on error)
|
||||
//
|
||||
// NB: this function will _not_ generate wxEVT_NOTEBOOK_PAGE_xxx events
|
||||
virtual int SetSelection(int nPage) = 0;
|
||||
|
||||
// cycle thru the tabs
|
||||
void AdvanceSelection(bool forward = TRUE)
|
||||
{
|
||||
int nPage = GetNextPage(forward);
|
||||
if ( nPage != -1 )
|
||||
SetSelection(nPage);
|
||||
}
|
||||
|
||||
protected:
|
||||
// remove the page and return a pointer to it
|
||||
virtual wxNotebookPage *DoRemovePage(int page);
|
||||
|
||||
// common part of all ctors
|
||||
void Init();
|
||||
|
||||
// get the next page wrapping if we reached the end
|
||||
int GetNextPage(bool forward) const;
|
||||
|
||||
wxArrayPages m_pages; // array of pages
|
||||
wxImageList *m_imageList; // we can have an associated image list
|
||||
bool m_ownsImageList; // true if we must delete m_imageList
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// notebook event class (used by NOTEBOOK_PAGE_CHANGED/ING events)
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxNotebookEvent : public wxNotifyEvent
|
||||
{
|
||||
public:
|
||||
wxNotebookEvent(wxEventType commandType = wxEVT_NULL, int id = 0,
|
||||
int nSel = -1, int nOldSel = -1)
|
||||
: wxNotifyEvent(commandType, id)
|
||||
{
|
||||
m_nSel = nSel;
|
||||
m_nOldSel = nOldSel;
|
||||
}
|
||||
|
||||
// accessors
|
||||
// the currently selected page (-1 if none)
|
||||
int GetSelection() const { return m_nSel; }
|
||||
void SetSelection(int nSel) { m_nSel = nSel; }
|
||||
// the page that was selected before the change (-1 if none)
|
||||
int GetOldSelection() const { return m_nOldSel; }
|
||||
void SetOldSelection(int nOldSel) { m_nOldSel = nOldSel; }
|
||||
|
||||
private:
|
||||
int m_nSel, // currently selected page
|
||||
m_nOldSel; // previously selected page
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxNotebookEvent)
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// event types and macros for them
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__BORLANDC__) && defined(__WIN16__)
|
||||
// For 16-bit BC++, these 2 would be identical otherwise (truncated)
|
||||
#define wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED wxEVT_COMMAND_NB_PAGE_CHANGED
|
||||
#define wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING wxEVT_COMMAND_NB_PAGE_CHANGING
|
||||
#endif
|
||||
|
||||
BEGIN_DECLARE_EVENT_TYPES()
|
||||
DECLARE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, 802)
|
||||
DECLARE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, 803)
|
||||
END_DECLARE_EVENT_TYPES()
|
||||
|
||||
typedef void (wxEvtHandler::*wxNotebookEventFunction)(wxNotebookEvent&);
|
||||
|
||||
// Truncation in 16-bit BC++ means we need to define these differently
|
||||
#if defined(__BORLANDC__) && defined(__WIN16__)
|
||||
#define EVT_NOTEBOOK_PAGE_CHANGED(id, fn) \
|
||||
DECLARE_EVENT_TABLE_ENTRY( \
|
||||
wxEVT_COMMAND_NB_PAGE_CHANGED, \
|
||||
id, \
|
||||
-1, \
|
||||
(wxObjectEventFunction)(wxEventFunction)(wxNotebookEventFunction) &fn, \
|
||||
NULL \
|
||||
),
|
||||
|
||||
#define EVT_NOTEBOOK_PAGE_CHANGING(id, fn) \
|
||||
DECLARE_EVENT_TABLE_ENTRY( \
|
||||
wxEVT_COMMAND_NB_PAGE_CHANGING, \
|
||||
id, \
|
||||
-1, \
|
||||
(wxObjectEventFunction)(wxEventFunction)(wxNotebookEventFunction) &fn, \
|
||||
NULL \
|
||||
),
|
||||
|
||||
#else
|
||||
|
||||
#define EVT_NOTEBOOK_PAGE_CHANGED(id, fn) \
|
||||
DECLARE_EVENT_TABLE_ENTRY( \
|
||||
wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, \
|
||||
id, \
|
||||
-1, \
|
||||
(wxObjectEventFunction)(wxEventFunction)(wxNotebookEventFunction) &fn, \
|
||||
NULL \
|
||||
),
|
||||
|
||||
#define EVT_NOTEBOOK_PAGE_CHANGING(id, fn) \
|
||||
DECLARE_EVENT_TABLE_ENTRY( \
|
||||
wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, \
|
||||
id, \
|
||||
-1, \
|
||||
(wxObjectEventFunction)(wxEventFunction)(wxNotebookEventFunction) &fn, \
|
||||
NULL \
|
||||
),
|
||||
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxNotebook class itself
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__WXUNIVERSAL__)
|
||||
#include "wx/univ/notebook.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#ifdef __WIN16__
|
||||
#include "wx/generic/notebook.h"
|
||||
#else
|
||||
#include "wx/msw/notebook.h"
|
||||
#endif
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/generic/notebook.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/notebook.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/notebook.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/notebook.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/notebook.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/stubs/notebook.h"
|
||||
#endif
|
||||
|
||||
#endif // wxUSE_NOTEBOOK
|
||||
|
||||
#endif
|
||||
// _WX_NOTEBOOK_H_BASE_
|
23
include/wx/palette.h
Normal file
23
include/wx/palette.h
Normal file
@@ -0,0 +1,23 @@
|
||||
#ifndef _WX_PALETTE_H_BASE_
|
||||
#define _WX_PALETTE_H_BASE_
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#include "wx/msw/palette.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/palette.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/generic/paletteg.h"
|
||||
#elif defined(__WXMGL__)
|
||||
#include "wx/mgl/palette.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/palette.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/palette.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/palette.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/stubs/palette.h"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
// _WX_PALETTE_H_BASE_
|
23
include/wx/pen.h
Normal file
23
include/wx/pen.h
Normal file
@@ -0,0 +1,23 @@
|
||||
#ifndef _WX_PEN_H_BASE_
|
||||
#define _WX_PEN_H_BASE_
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#include "wx/msw/pen.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/pen.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/pen.h"
|
||||
#elif defined(__WXMGL__)
|
||||
#include "wx/mgl/pen.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/pen.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/pen.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/pen.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/stubs/pen.h"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
// _WX_PEN_H_BASE_
|
32
include/wx/printdlg.h
Normal file
32
include/wx/printdlg.h
Normal file
@@ -0,0 +1,32 @@
|
||||
#ifndef _WX_PRINTDLG_H_BASE_
|
||||
#define _WX_PRINTDLG_H_BASE_
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#include "wx/msw/printdlg.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/generic/prntdlgg.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/generic/prntdlgg.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/generic/prntdlgg.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/printdlg.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/generic/prntdlgg.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/generic/prntdlgg.h"
|
||||
#endif
|
||||
|
||||
#if !defined(__WXMSW__) && !defined(__WXMAC__)
|
||||
#define wxPrintDialog wxGenericPrintDialog
|
||||
#define sm_classwxPrintDialog sm_classwxGenericPrintDialog
|
||||
|
||||
#define wxPrintSetupDialog wxGenericPrintSetupDialog
|
||||
#define sm_classwxPrintSetupDialog sm_classwxGenericPrintSetupDialog
|
||||
|
||||
#define wxPageSetupDialog wxGenericPageSetupDialog
|
||||
#define sm_classwxPageSetupDialog sm_classwxGenericPageSetupDialog
|
||||
#endif
|
||||
|
||||
#endif
|
||||
// _WX_PRINTDLG_H_BASE_
|
118
include/wx/radiobox.h
Normal file
118
include/wx/radiobox.h
Normal file
@@ -0,0 +1,118 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/radiobox.h
|
||||
// Purpose: wxRadioBox declaration
|
||||
// Author: Vadim Zeitlin
|
||||
// Modified by:
|
||||
// Created: 10.09.00
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) wxWindows team
|
||||
// Licence: wxWindows license
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_RADIOBOX_H_BASE_
|
||||
#define _WX_RADIOBOX_H_BASE_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "radioboxbase.h"
|
||||
#endif
|
||||
|
||||
#if wxUSE_RADIOBOX
|
||||
|
||||
#include "wx/control.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const wxChar*) wxRadioBoxNameStr;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxRadioBoxBase is not a normal base class, but rather a mix-in because the
|
||||
// real wxRadioBox derives from different classes on different platforms: for
|
||||
// example, it is a wxStaticBox in wxUniv but not in wxMSW
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxRadioBoxBase
|
||||
{
|
||||
public:
|
||||
// selection
|
||||
virtual void SetSelection(int n) = 0;
|
||||
virtual int GetSelection() const = 0;
|
||||
|
||||
virtual wxString GetStringSelection() const
|
||||
{
|
||||
wxString s;
|
||||
int sel = GetSelection();
|
||||
if ( sel != wxNOT_FOUND )
|
||||
s = GetString(sel);
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
virtual bool SetStringSelection(const wxString& s)
|
||||
{
|
||||
int sel = FindString(s);
|
||||
if ( sel != wxNOT_FOUND )
|
||||
{
|
||||
SetSelection(sel);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// string access
|
||||
virtual int GetCount() const = 0;
|
||||
virtual int FindString(const wxString& s) const
|
||||
{
|
||||
int count = GetCount();
|
||||
for ( int n = 0; n < count; n++ )
|
||||
{
|
||||
if ( GetString(n) == s )
|
||||
return n;
|
||||
}
|
||||
|
||||
return wxNOT_FOUND;
|
||||
}
|
||||
|
||||
virtual wxString GetString(int n) const = 0;
|
||||
virtual void SetString(int n, const wxString& label) = 0;
|
||||
|
||||
// change the individual radio button state
|
||||
virtual void Enable(int n, bool enable = TRUE) = 0;
|
||||
virtual void Show(int n, bool show = TRUE) = 0;
|
||||
|
||||
// layout parameters
|
||||
virtual int GetColumnCount() const = 0;
|
||||
virtual int GetRowCount() const = 0;
|
||||
|
||||
// return the item above/below/to the left/right of the given one
|
||||
int GetNextItem(int item, wxDirection dir, long style) const;
|
||||
|
||||
// for compatibility only, don't use these methods in new code!
|
||||
#if WXWIN_COMPATIBILITY_2_2
|
||||
int Number() const { return GetCount(); }
|
||||
wxString GetLabel(int n) const { return GetString(n); }
|
||||
void SetLabel(int n, const wxString& label) { SetString(n, label); }
|
||||
#endif // WXWIN_COMPATIBILITY_2_2
|
||||
};
|
||||
|
||||
#if defined(__WXUNIVERSAL__)
|
||||
#include "wx/univ/radiobox.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/radiobox.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/radiobox.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/radiobox.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/radiobox.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/radiobox.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/radiobox.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/stubs/radiobox.h"
|
||||
#endif
|
||||
|
||||
#endif // wxUSE_RADIOBOX
|
||||
|
||||
#endif
|
||||
// _WX_RADIOBOX_H_BASE_
|
57
include/wx/radiobut.h
Normal file
57
include/wx/radiobut.h
Normal file
@@ -0,0 +1,57 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/radiobut.h
|
||||
// Purpose: wxRadioButton declaration
|
||||
// Author: Vadim Zeitlin
|
||||
// Modified by:
|
||||
// Created: 07.09.00
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) wxWindows team
|
||||
// Licence: wxWindows license
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_RADIOBUT_H_BASE_
|
||||
#define _WX_RADIOBUT_H_BASE_
|
||||
|
||||
#if wxUSE_RADIOBTN
|
||||
|
||||
/*
|
||||
There is no wxRadioButtonBase class as wxRadioButton interface is the same
|
||||
as of wxCheckBox(Base), but under some platforms wxRadioButton really
|
||||
derives from wxCheckBox and on the others it doesn't.
|
||||
|
||||
The pseudo-declaration of wxRadioButtonBase would look like this:
|
||||
|
||||
class wxRadioButtonBase : public ...
|
||||
{
|
||||
public:
|
||||
virtual void SetValue(bool value);
|
||||
virtual bool GetValue() const;
|
||||
};
|
||||
*/
|
||||
|
||||
#include "wx/control.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const wxChar*) wxRadioButtonNameStr;
|
||||
|
||||
#if defined(__WXUNIVERSAL__)
|
||||
#include "wx/univ/radiobut.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/radiobut.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/radiobut.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/radiobut.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/radiobut.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/radiobut.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/radiobut.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/stubs/radiobut.h"
|
||||
#endif
|
||||
|
||||
#endif // wxUSE_RADIOBTN
|
||||
|
||||
#endif
|
||||
// _WX_RADIOBUT_H_BASE_
|
23
include/wx/region.h
Normal file
23
include/wx/region.h
Normal file
@@ -0,0 +1,23 @@
|
||||
#ifndef _WX_REGION_H_BASE_
|
||||
#define _WX_REGION_H_BASE_
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#include "wx/msw/region.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/region.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/region.h"
|
||||
#elif defined(__WXMGL__)
|
||||
#include "wx/mgl/region.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/region.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/region.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/region.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/stubs/region.h"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
// _WX_REGION_H_BASE_
|
62
include/wx/scrolbar.h
Normal file
62
include/wx/scrolbar.h
Normal file
@@ -0,0 +1,62 @@
|
||||
#ifndef _WX_SCROLBAR_H_BASE_
|
||||
#define _WX_SCROLBAR_H_BASE_
|
||||
|
||||
#if wxUSE_SCROLLBAR
|
||||
|
||||
#include "wx/control.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const wxChar*) wxScrollBarNameStr;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxScrollBar: a scroll bar control
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxScrollBarBase : public wxControl
|
||||
{
|
||||
public:
|
||||
// scrollbar construction
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxSB_HORIZONTAL,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxScrollBarNameStr);
|
||||
|
||||
// accessors
|
||||
virtual int GetThumbPosition() const = 0;
|
||||
virtual int GetThumbSize() const = 0;
|
||||
virtual int GetPageSize() const = 0;
|
||||
virtual int GetRange() const = 0;
|
||||
|
||||
bool IsVertical() const { return (m_windowStyle & wxVERTICAL) != 0; }
|
||||
|
||||
// operations
|
||||
virtual void SetThumbPosition(int viewStart) = 0;
|
||||
virtual void SetScrollbar(int position, int thumbSize,
|
||||
int range, int pageSize,
|
||||
bool refresh = TRUE) = 0;
|
||||
};
|
||||
|
||||
#if defined(__WXUNIVERSAL__)
|
||||
#include "wx/univ/scrolbar.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/scrolbar.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/scrolbar.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/scrolbar.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/scrolbar.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/scrolbar.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/scrolbar.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/stubs/scrolbar.h"
|
||||
#endif
|
||||
|
||||
#endif // wxUSE_SCROLLBAR
|
||||
|
||||
#endif
|
||||
// _WX_SCROLBAR_H_BASE_
|
129
include/wx/settings.h
Normal file
129
include/wx/settings.h
Normal file
@@ -0,0 +1,129 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: settings.h
|
||||
// Purpose: wxSystemSettings defines; includes platform settings.h
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_SETTINGS_H_BASE_
|
||||
#define _WX_SETTINGS_H_BASE_
|
||||
|
||||
#define wxSYS_WHITE_BRUSH 0
|
||||
#define wxSYS_LTGRAY_BRUSH 1
|
||||
#define wxSYS_GRAY_BRUSH 2
|
||||
#define wxSYS_DKGRAY_BRUSH 3
|
||||
#define wxSYS_BLACK_BRUSH 4
|
||||
#define wxSYS_NULL_BRUSH 5
|
||||
#define wxSYS_HOLLOW_BRUSH wxSYS_NULL_BRUSH
|
||||
#define wxSYS_WHITE_PEN 6
|
||||
#define wxSYS_BLACK_PEN 7
|
||||
#define wxSYS_NULL_PEN 8
|
||||
#define wxSYS_OEM_FIXED_FONT 10
|
||||
#define wxSYS_ANSI_FIXED_FONT 11
|
||||
#define wxSYS_ANSI_VAR_FONT 12
|
||||
#define wxSYS_SYSTEM_FONT 13
|
||||
#define wxSYS_DEVICE_DEFAULT_FONT 14
|
||||
#define wxSYS_DEFAULT_PALETTE 15
|
||||
#define wxSYS_SYSTEM_FIXED_FONT 16
|
||||
#define wxSYS_DEFAULT_GUI_FONT 17
|
||||
|
||||
#define wxSYS_COLOUR_SCROLLBAR 0
|
||||
#define wxSYS_COLOUR_BACKGROUND 1
|
||||
#define wxSYS_COLOUR_ACTIVECAPTION 2
|
||||
#define wxSYS_COLOUR_INACTIVECAPTION 3
|
||||
#define wxSYS_COLOUR_MENU 4
|
||||
#define wxSYS_COLOUR_WINDOW 5
|
||||
#define wxSYS_COLOUR_WINDOWFRAME 6
|
||||
#define wxSYS_COLOUR_MENUTEXT 7
|
||||
#define wxSYS_COLOUR_WINDOWTEXT 8
|
||||
#define wxSYS_COLOUR_CAPTIONTEXT 9
|
||||
#define wxSYS_COLOUR_ACTIVEBORDER 10
|
||||
#define wxSYS_COLOUR_INACTIVEBORDER 11
|
||||
#define wxSYS_COLOUR_APPWORKSPACE 12
|
||||
#define wxSYS_COLOUR_HIGHLIGHT 13
|
||||
#define wxSYS_COLOUR_HIGHLIGHTTEXT 14
|
||||
#define wxSYS_COLOUR_BTNFACE 15
|
||||
#define wxSYS_COLOUR_BTNSHADOW 16
|
||||
#define wxSYS_COLOUR_GRAYTEXT 17
|
||||
#define wxSYS_COLOUR_BTNTEXT 18
|
||||
#define wxSYS_COLOUR_INACTIVECAPTIONTEXT 19
|
||||
#define wxSYS_COLOUR_BTNHIGHLIGHT 20
|
||||
|
||||
#define wxSYS_COLOUR_3DDKSHADOW 21
|
||||
#define wxSYS_COLOUR_3DLIGHT 22
|
||||
#define wxSYS_COLOUR_INFOTEXT 23
|
||||
#define wxSYS_COLOUR_INFOBK 24
|
||||
|
||||
#define wxSYS_COLOUR_LISTBOX 25
|
||||
|
||||
#define wxSYS_COLOUR_DESKTOP wxSYS_COLOUR_BACKGROUND
|
||||
#define wxSYS_COLOUR_3DFACE wxSYS_COLOUR_BTNFACE
|
||||
#define wxSYS_COLOUR_3DSHADOW wxSYS_COLOUR_BTNSHADOW
|
||||
#define wxSYS_COLOUR_3DHIGHLIGHT wxSYS_COLOUR_BTNHIGHLIGHT
|
||||
#define wxSYS_COLOUR_3DHILIGHT wxSYS_COLOUR_BTNHIGHLIGHT
|
||||
#define wxSYS_COLOUR_BTNHILIGHT wxSYS_COLOUR_BTNHIGHLIGHT
|
||||
|
||||
// Metrics
|
||||
#define wxSYS_MOUSE_BUTTONS 1
|
||||
#define wxSYS_BORDER_X 2
|
||||
#define wxSYS_BORDER_Y 3
|
||||
#define wxSYS_CURSOR_X 4
|
||||
#define wxSYS_CURSOR_Y 5
|
||||
#define wxSYS_DCLICK_X 6
|
||||
#define wxSYS_DCLICK_Y 7
|
||||
#define wxSYS_DRAG_X 8
|
||||
#define wxSYS_DRAG_Y 9
|
||||
#define wxSYS_EDGE_X 10
|
||||
#define wxSYS_EDGE_Y 11
|
||||
#define wxSYS_HSCROLL_ARROW_X 12
|
||||
#define wxSYS_HSCROLL_ARROW_Y 13
|
||||
#define wxSYS_HTHUMB_X 14
|
||||
#define wxSYS_ICON_X 15
|
||||
#define wxSYS_ICON_Y 16
|
||||
#define wxSYS_ICONSPACING_X 17
|
||||
#define wxSYS_ICONSPACING_Y 18
|
||||
#define wxSYS_WINDOWMIN_X 19
|
||||
#define wxSYS_WINDOWMIN_Y 20
|
||||
#define wxSYS_SCREEN_X 21
|
||||
#define wxSYS_SCREEN_Y 22
|
||||
#define wxSYS_FRAMESIZE_X 23
|
||||
#define wxSYS_FRAMESIZE_Y 24
|
||||
#define wxSYS_SMALLICON_X 25
|
||||
#define wxSYS_SMALLICON_Y 26
|
||||
#define wxSYS_HSCROLL_Y 27
|
||||
#define wxSYS_VSCROLL_X 28
|
||||
#define wxSYS_VSCROLL_ARROW_X 29
|
||||
#define wxSYS_VSCROLL_ARROW_Y 30
|
||||
#define wxSYS_VTHUMB_Y 31
|
||||
#define wxSYS_CAPTION_Y 32
|
||||
#define wxSYS_MENU_Y 33
|
||||
#define wxSYS_NETWORK_PRESENT 34
|
||||
#define wxSYS_PENWINDOWS_PRESENT 35
|
||||
#define wxSYS_SHOW_SOUNDS 36
|
||||
#define wxSYS_SWAP_BUTTONS 37
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#include "wx/msw/settings.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/settings.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/settings.h"
|
||||
#elif defined(__WXMGL__)
|
||||
#include "wx/mgl/settings.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/settings.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/settings.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/settings.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/stubs/settings.h"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
// _WX_SETTINGS_H_BASE_
|
||||
|
84
include/wx/setup.h
Normal file
84
include/wx/setup.h
Normal file
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
* The main configuration file for wxWindows.
|
||||
*
|
||||
* NB: this file can be included in .c files, so it must be compileable by a C
|
||||
* compiler - use #ifdef __cplusplus for C++ specific features and avoid
|
||||
* using C++ style comments
|
||||
*/
|
||||
|
||||
#ifndef _WX_SETUP_H_BASE_
|
||||
#define _WX_SETUP_H_BASE_
|
||||
|
||||
/* compatibility code, to be removed asap: */
|
||||
|
||||
#if !defined(__WXBASE__) && !defined(__WXMSW__) && !defined(__WXGTK__) && !defined(__WXMOTIF__) && !defined(__WXQT__) && !defined(__WXSTUBS__) && !defined(__WXMAC__) && !defined(__WXPM__)
|
||||
#error No __WXxxx__ define set! Please define one of __WXBASE__,__WXGTK__,__WXMSW__,__WXMOTIF__,__WXMAC__,__WXQT__,__WXPM__,__WXSTUBS__
|
||||
#endif
|
||||
|
||||
/*
|
||||
wxUniversal is defined together with one of other ports, so test for it
|
||||
first
|
||||
*/
|
||||
#ifdef __WXUNIVERSAL__
|
||||
#if defined(__USE_WXCONFIG__) && defined(__WXDEBUG__)
|
||||
#include "wx/univd/setup.h"
|
||||
#else
|
||||
#include "wx/univ/setup.h"
|
||||
#endif
|
||||
|
||||
#elif defined(__WXBASE__)
|
||||
#if defined(__USE_WXCONFIG__) && defined(__WXDEBUG__)
|
||||
#include "wx/based/setup.h"
|
||||
#else
|
||||
#include "wx/base/setup.h"
|
||||
#endif
|
||||
|
||||
#elif defined(__VMS)
|
||||
#include "wx_root:[wxwindows]setup.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/setup.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/setup.h"
|
||||
|
||||
#elif defined(__WXQT__)
|
||||
#if defined(__USE_WXCONFIG__) && defined(__WXDEBUG__)
|
||||
#include "wx/qtd/setup.h"
|
||||
#else
|
||||
#include "wx/qt/setup.h"
|
||||
#endif
|
||||
|
||||
#elif defined(__WXMOTIF__)
|
||||
#if defined(__USE_WXCONFIG__) && defined(__WXDEBUG__)
|
||||
#include "wx/motifd/setup.h"
|
||||
#else
|
||||
#include "wx/motif/setup.h"
|
||||
#endif
|
||||
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/setup.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/stubs/setup.h"
|
||||
|
||||
#elif defined(__WXGTK__)
|
||||
#if defined(__USE_WXCONFIG__) && defined(__WXDEBUG__)
|
||||
#include "wx/gtkd/setup.h"
|
||||
#else
|
||||
#include "wx/gtk/setup.h"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#include "wx/chkconf.h"
|
||||
|
||||
/*
|
||||
define some constants identifying wxWindows version in more details than
|
||||
just the version number
|
||||
*/
|
||||
|
||||
// wxLogChain class available
|
||||
#define wxHAS_LOG_CHAIN
|
||||
|
||||
// define this when wxDC::Blit() respects SetDeviceOrigin() in wxGTK
|
||||
#undef wxHAS_WORKING_GTK_DC_BLIT
|
||||
|
||||
#endif /* _WX_SETUP_H_BASE_ */
|
114
include/wx/slider.h
Normal file
114
include/wx/slider.h
Normal file
@@ -0,0 +1,114 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/slider.h
|
||||
// Purpose: wxSlider interface
|
||||
// Author: Vadim Zeitlin
|
||||
// Modified by:
|
||||
// Created: 09.02.01
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 1996-2001 wxWindows team
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_SLIDER_H_BASE_
|
||||
#define _WX_SLIDER_H_BASE_
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_SLIDER
|
||||
|
||||
#include "wx/control.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const wxChar*) wxSliderNameStr;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxSliderBase: define wxSlider interface
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxSliderBase : public wxControl
|
||||
{
|
||||
public:
|
||||
/* the ctor of the derived class should have the following form:
|
||||
|
||||
wxSlider(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
int value, int minValue, int maxValue,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxSL_HORIZONTAL,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxSliderNameStr);
|
||||
*/
|
||||
|
||||
// get/set the current slider value (should be in range)
|
||||
virtual int GetValue() const = 0;
|
||||
virtual void SetValue(int value) = 0;
|
||||
|
||||
// retrieve/change the range
|
||||
virtual void SetRange(int minValue, int maxValue) = 0;
|
||||
virtual int GetMin() const = 0;
|
||||
virtual int GetMax() const = 0;
|
||||
|
||||
// the line/page size is the increment by which the slider moves when
|
||||
// cursor arrow key/page up or down are pressed (clicking the mouse is like
|
||||
// pressing PageUp/Down) and are by default set to 1 and 1/10 of the range
|
||||
virtual void SetLineSize(int lineSize) = 0;
|
||||
virtual void SetPageSize(int pageSize) = 0;
|
||||
virtual int GetLineSize() const = 0;
|
||||
virtual int GetPageSize() const = 0;
|
||||
|
||||
// these methods get/set the length of the slider pointer in pixels
|
||||
virtual void SetThumbLength(int lenPixels) = 0;
|
||||
virtual int GetThumbLength() const = 0;
|
||||
|
||||
// warning: most of subsequent methods are currently only implemented in
|
||||
// wxMSW under Win95 and are silently ignored on other platforms
|
||||
|
||||
virtual void SetTickFreq(int WXUNUSED(n), int WXUNUSED(pos)) { }
|
||||
virtual int GetTickFreq() const { return 0; }
|
||||
virtual void ClearTicks() { }
|
||||
virtual void SetTick(int WXUNUSED(tickPos)) { }
|
||||
|
||||
virtual void ClearSel() { }
|
||||
virtual int GetSelEnd() const { return GetMin(); }
|
||||
virtual int GetSelStart() const { return GetMax(); }
|
||||
virtual void SetSelection(int WXUNUSED(min), int WXUNUSED(max)) { }
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// include the real class declaration
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__WXUNIVERSAL__)
|
||||
#include "wx/univ/slider.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#ifdef __WIN95__
|
||||
#include "wx/msw/slider95.h"
|
||||
#define wxSlider wxSlider95
|
||||
#define sm_classwxSlider sm_classwxSlider95
|
||||
#else // Win16
|
||||
#include "wx/msw/slidrmsw.h"
|
||||
#define wxSlider wxSliderMSW
|
||||
#define sm_classwxSlider sm_classwxSliderMSW
|
||||
#endif // Win32/Win16
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/slider.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/slider.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/slider.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/slider.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/slider.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/stubs/slider.h"
|
||||
#endif
|
||||
|
||||
#endif // wxUSE_SLIDER
|
||||
|
||||
#endif
|
||||
// _WX_SLIDER_H_BASE_
|
128
include/wx/spinbutt.h
Normal file
128
include/wx/spinbutt.h
Normal file
@@ -0,0 +1,128 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/spinbutt.h
|
||||
// Purpose: wxSpinButtonBase class
|
||||
// Author: Julian Smart, Vadim Zeitlin
|
||||
// Modified by:
|
||||
// Created: 23.07.99
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_SPINBUTT_H_BASE_
|
||||
#define _WX_SPINBUTT_H_BASE_
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_SPINBTN
|
||||
|
||||
#include "wx/control.h"
|
||||
#include "wx/event.h"
|
||||
|
||||
#define wxSPIN_BUTTON_NAME _T("wxSpinButton")
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// The wxSpinButton is like a small scrollbar than is often placed next
|
||||
// to a text control.
|
||||
//
|
||||
// Styles:
|
||||
// wxSP_HORIZONTAL: horizontal spin button
|
||||
// wxSP_VERTICAL: vertical spin button (the default)
|
||||
// wxSP_ARROW_KEYS: arrow keys increment/decrement value
|
||||
// wxSP_WRAP: value wraps at either end
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxSpinButtonBase : public wxControl
|
||||
{
|
||||
public:
|
||||
wxSpinButtonBase() { InitBase(); }
|
||||
|
||||
// accessors
|
||||
virtual int GetValue() const = 0;
|
||||
virtual int GetMin() const { return m_min; }
|
||||
virtual int GetMax() const { return m_max; }
|
||||
|
||||
// operations
|
||||
virtual void SetValue(int val) = 0;
|
||||
virtual void SetRange(int minVal, int maxVal)
|
||||
{
|
||||
m_min = minVal;
|
||||
m_max = maxVal;
|
||||
}
|
||||
|
||||
// is this spin button vertically oriented?
|
||||
bool IsVertical() const { return (m_windowStyle & wxSP_VERTICAL) != 0; }
|
||||
|
||||
protected:
|
||||
// init the base part of the control
|
||||
void InitBase()
|
||||
{
|
||||
m_min = 0;
|
||||
m_max = 100;
|
||||
}
|
||||
|
||||
// the range value
|
||||
int m_min;
|
||||
int m_max;
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// include the declaration of the real class
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__WXUNIVERSAL__)
|
||||
#include "wx/univ/spinbutt.h"
|
||||
#elif defined(__WXMSW__) && defined(__WIN95__)
|
||||
#include "wx/msw/spinbutt.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/spinbutt.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/spinbutt.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/spinbutt.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/spinbutt.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/spinbutt.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/stubs/spinbutt.h"
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// the wxSpinButton event
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxSpinEvent : public wxNotifyEvent
|
||||
{
|
||||
public:
|
||||
wxSpinEvent(wxEventType commandType = wxEVT_NULL, int id = 0)
|
||||
: wxNotifyEvent(commandType, id)
|
||||
{
|
||||
}
|
||||
|
||||
// get the current value of the control
|
||||
int GetPosition() const { return m_commandInt; }
|
||||
void SetPosition(int pos) { m_commandInt = pos; }
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxSpinEvent)
|
||||
};
|
||||
|
||||
typedef void (wxEvtHandler::*wxSpinEventFunction)(wxSpinEvent&);
|
||||
|
||||
// macros for handling spin events
|
||||
#define EVT_SPIN_UP(id, func) \
|
||||
DECLARE_EVENT_TABLE_ENTRY( wxEVT_SCROLL_LINEUP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func, NULL ),
|
||||
#define EVT_SPIN_DOWN(id, func) \
|
||||
DECLARE_EVENT_TABLE_ENTRY( wxEVT_SCROLL_LINEDOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func, NULL ),
|
||||
#define EVT_SPIN(id, func) \
|
||||
DECLARE_EVENT_TABLE_ENTRY( wxEVT_SCROLL_THUMBTRACK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func, NULL ),
|
||||
|
||||
#endif // wxUSE_SPINBTN
|
||||
|
||||
#endif
|
||||
// _WX_SPINBUTT_H_BASE_
|
70
include/wx/statbmp.h
Normal file
70
include/wx/statbmp.h
Normal file
@@ -0,0 +1,70 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/statbmp.h
|
||||
// Purpose: wxStaticBitmap class interface
|
||||
// Author: Vadim Zeitlin
|
||||
// Modified by:
|
||||
// Created: 25.08.00
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2000 Vadim Zeitlin
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_STATBMP_H_BASE_
|
||||
#define _WX_STATBMP_H_BASE_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "statbmpbase.h"
|
||||
#endif
|
||||
|
||||
#if wxUSE_STATBMP
|
||||
|
||||
#include "wx/control.h"
|
||||
#include "wx/bitmap.h"
|
||||
|
||||
class WXDLLEXPORT wxIcon;
|
||||
class WXDLLEXPORT wxBitmap;
|
||||
|
||||
WXDLLEXPORT_DATA(extern const wxChar*) wxStaticBitmapNameStr;
|
||||
|
||||
// a control showing an icon or a bitmap
|
||||
class WXDLLEXPORT wxStaticBitmapBase : public wxControl
|
||||
{
|
||||
public:
|
||||
#ifdef __DARWIN__
|
||||
~wxStaticBitmapBase() { }
|
||||
#endif
|
||||
|
||||
// our interface
|
||||
virtual void SetIcon(const wxIcon& icon) = 0;
|
||||
virtual void SetBitmap(const wxBitmap& bitmap) = 0;
|
||||
virtual wxBitmap GetBitmap() const = 0;
|
||||
|
||||
// overriden base class virtuals
|
||||
virtual bool AcceptsFocus() const { return FALSE; }
|
||||
|
||||
protected:
|
||||
virtual wxSize DoGetBestClientSize() const;
|
||||
};
|
||||
|
||||
#if defined(__WXUNIVERSAL__)
|
||||
#include "wx/univ/statbmp.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/statbmp.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/statbmp.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/statbmp.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/statbmp.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/statbmp.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/statbmp.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/stubs/statbmp.h"
|
||||
#endif
|
||||
|
||||
#endif // wxUSE_STATBMP
|
||||
|
||||
#endif
|
||||
// _WX_STATBMP_H_BASE_
|
42
include/wx/statbox.h
Normal file
42
include/wx/statbox.h
Normal file
@@ -0,0 +1,42 @@
|
||||
#ifndef _WX_STATBOX_H_BASE_
|
||||
#define _WX_STATBOX_H_BASE_
|
||||
|
||||
#if wxUSE_STATBOX
|
||||
|
||||
#include "wx/control.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const wxChar*) wxStaticBoxNameStr;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxStaticBox: a grouping box with a label
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxStaticBoxBase : public wxControl
|
||||
{
|
||||
public:
|
||||
// overriden base class virtuals
|
||||
virtual bool AcceptsFocus() const { return FALSE; }
|
||||
};
|
||||
|
||||
#if defined(__WXUNIVERSAL__)
|
||||
#include "wx/univ/statbox.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/statbox.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/statbox.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/statbox.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/statbox.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/statbox.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/statbox.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/stubs/statbox.h"
|
||||
#endif
|
||||
|
||||
#endif // wxUSE_STATBOX
|
||||
|
||||
#endif
|
||||
// _WX_STATBOX_H_BASE_
|
38
include/wx/stattext.h
Normal file
38
include/wx/stattext.h
Normal file
@@ -0,0 +1,38 @@
|
||||
#ifndef _WX_STATTEXT_H_BASE_
|
||||
#define _WX_STATTEXT_H_BASE_
|
||||
|
||||
#if wxUSE_STATTEXT
|
||||
|
||||
#include "wx/control.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const wxChar*) wxStaticTextNameStr;
|
||||
|
||||
class WXDLLEXPORT wxStaticTextBase : public wxControl
|
||||
{
|
||||
public:
|
||||
// overriden base class virtuals
|
||||
virtual bool AcceptsFocus() const { return FALSE; }
|
||||
};
|
||||
|
||||
#if defined(__WXUNIVERSAL__)
|
||||
#include "wx/univ/stattext.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/stattext.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/stattext.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/stattext.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/stattext.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/stattext.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/stattext.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/stubs/stattext.h"
|
||||
#endif
|
||||
|
||||
#endif // wxUSE_STATTEXT
|
||||
|
||||
#endif
|
||||
// _WX_STATTEXT_H_BASE_
|
19
include/wx/taskbar.h
Normal file
19
include/wx/taskbar.h
Normal file
@@ -0,0 +1,19 @@
|
||||
#ifndef _WX_TASKBAR_H_BASE_
|
||||
#define _WX_TASKBAR_H_BASE_
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#include "wx/msw/taskbar.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/taskbar.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#elif defined(__WXQT__)
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/taskbar.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/taskbar.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/stubs/taskbar.h"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
// _WX_TASKBAR_H_BASE_
|
345
include/wx/textctrl.h
Normal file
345
include/wx/textctrl.h
Normal file
@@ -0,0 +1,345 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: textctrl.h
|
||||
// Purpose: wxTextCtrlBase class - the interface of wxTextCtrl
|
||||
// Author: Vadim Zeitlin
|
||||
// Modified by:
|
||||
// Created: 13.07.99
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) wxWindows team
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_TEXTCTRL_H_BASE_
|
||||
#define _WX_TEXTCTRL_H_BASE_
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "textctrlbase.h"
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_TEXTCTRL
|
||||
|
||||
#include "wx/control.h" // the base class
|
||||
|
||||
// 16-bit Borland 4.0 doesn't seem to allow multiple inheritance with wxWindow
|
||||
// and streambuf: it complains about deriving a huge class from the huge class
|
||||
// streambuf. !! Also, can't use streambuf if making or using a DLL :-(
|
||||
|
||||
#if (defined(__BORLANDC__)) || defined(__MWERKS__) || defined(_WINDLL) || defined(WXUSINGDLL) || defined(WXMAKINGDLL)
|
||||
#define NO_TEXT_WINDOW_STREAM
|
||||
#endif
|
||||
|
||||
// the streambuf which is used in the declaration of wxTextCtrlBase below is not compatible
|
||||
// with the standard-conforming implementation found in newer egcs versions
|
||||
// (that is, the libstdc++ v3 that is shipped with it)
|
||||
#if defined(__GNUC__)&&( (__GNUC__>2) ||( (__GNUC__==2)&&(__GNUC_MINOR__>97) ) )
|
||||
#define NO_TEXT_WINDOW_STREAM
|
||||
#endif
|
||||
|
||||
#ifndef NO_TEXT_WINDOW_STREAM
|
||||
#if wxUSE_STD_IOSTREAM
|
||||
#include "wx/ioswrap.h" // for iostream classes if we need them
|
||||
#else // !wxUSE_STD_IOSTREAM
|
||||
// can't compile this feature in if we don't use streams at all
|
||||
#define NO_TEXT_WINDOW_STREAM
|
||||
#endif // wxUSE_STD_IOSTREAM/!wxUSE_STD_IOSTREAM
|
||||
#endif
|
||||
|
||||
class WXDLLEXPORT wxTextCtrl;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// constants
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
WXDLLEXPORT_DATA(extern const wxChar*) wxTextCtrlNameStr;
|
||||
WXDLLEXPORT_DATA(extern const wxChar*) wxEmptyString;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxTextCtrl style flags
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// the flag bits 0x0001, 2, 4 and 8 are free but should be used only for the
|
||||
// things which don't make sense for a text control used by wxTextEntryDialog
|
||||
// because they would otherwise conflict with wxOK, wxCANCEL, wxCENTRE
|
||||
#define wxTE_READONLY 0x0010
|
||||
#define wxTE_MULTILINE 0x0020
|
||||
#define wxTE_PROCESS_TAB 0x0040
|
||||
|
||||
// this style means to use RICHEDIT control and does something only under wxMSW
|
||||
// and Win32 and is silently ignored under all other platforms
|
||||
#define wxTE_RICH 0x0080
|
||||
#define wxTE_NO_VSCROLL 0x0100
|
||||
#define wxTE_AUTO_SCROLL 0x0200
|
||||
#define wxTE_PROCESS_ENTER 0x0400
|
||||
#define wxTE_PASSWORD 0x0800
|
||||
|
||||
// automatically detect the URLs and generate the events when mouse is
|
||||
// moved/clicked over an URL
|
||||
//
|
||||
// this is for Win32 richedit controls only so far
|
||||
#define wxTE_AUTO_URL 0x1000
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxTextAttr: a structure containing the visual attributes of a text
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxTextAttr
|
||||
{
|
||||
public:
|
||||
// ctors
|
||||
wxTextAttr() { }
|
||||
wxTextAttr(const wxColour& colText,
|
||||
const wxColour& colBack = wxNullColour,
|
||||
const wxFont& font = wxNullFont)
|
||||
: m_colText(colText), m_colBack(colBack), m_font(font) { }
|
||||
|
||||
// setters
|
||||
void SetTextColour(const wxColour& colText) { m_colText = colText; }
|
||||
void SetBackgroundColour(const wxColour& colBack) { m_colBack = colBack; }
|
||||
void SetFont(const wxFont& font) { m_font = font; }
|
||||
|
||||
// accessors
|
||||
bool HasTextColour() const { return m_colText.Ok(); }
|
||||
bool HasBackgroundColour() const { return m_colBack.Ok(); }
|
||||
bool HasFont() const { return m_font.Ok(); }
|
||||
|
||||
// setters
|
||||
const wxColour& GetTextColour() const { return m_colText; }
|
||||
const wxColour& GetBackgroundColour() const { return m_colBack; }
|
||||
const wxFont& GetFont() const { return m_font; }
|
||||
|
||||
// returns false if we have any attributes set, true otherwise
|
||||
bool IsDefault() const
|
||||
{
|
||||
return !HasTextColour() && !HasBackgroundColour() && !HasFont();
|
||||
}
|
||||
|
||||
private:
|
||||
wxColour m_colText,
|
||||
m_colBack;
|
||||
wxFont m_font;
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxTextCtrl: a single or multiple line text zone where user can enter and
|
||||
// edit text
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxTextCtrlBase : public wxControl
|
||||
#ifndef NO_TEXT_WINDOW_STREAM
|
||||
, public wxSTD streambuf
|
||||
#endif
|
||||
|
||||
{
|
||||
public:
|
||||
// creation
|
||||
// --------
|
||||
|
||||
wxTextCtrlBase();
|
||||
~wxTextCtrlBase();
|
||||
|
||||
// accessors
|
||||
// ---------
|
||||
|
||||
virtual wxString GetValue() const = 0;
|
||||
virtual void SetValue(const wxString& value) = 0;
|
||||
|
||||
virtual int GetLineLength(long lineNo) const = 0;
|
||||
virtual wxString GetLineText(long lineNo) const = 0;
|
||||
virtual int GetNumberOfLines() const = 0;
|
||||
|
||||
virtual bool IsModified() const = 0;
|
||||
virtual bool IsEditable() const = 0;
|
||||
|
||||
// If the return values from and to are the same, there is no selection.
|
||||
virtual void GetSelection(long* from, long* to) const = 0;
|
||||
|
||||
// operations
|
||||
// ----------
|
||||
|
||||
// editing
|
||||
virtual void Clear() = 0;
|
||||
virtual void Replace(long from, long to, const wxString& value) = 0;
|
||||
virtual void Remove(long from, long to) = 0;
|
||||
|
||||
// load/save the controls contents from/to the file
|
||||
virtual bool LoadFile(const wxString& file);
|
||||
virtual bool SaveFile(const wxString& file = wxEmptyString);
|
||||
|
||||
// clears the dirty flag
|
||||
virtual void DiscardEdits() = 0;
|
||||
|
||||
// set the max number of characters which may be entered in a single line
|
||||
// text control
|
||||
virtual void SetMaxLength(unsigned long WXUNUSED(len)) { }
|
||||
|
||||
// writing text inserts it at the current position, appending always
|
||||
// inserts it at the end
|
||||
virtual void WriteText(const wxString& text) = 0;
|
||||
virtual void AppendText(const wxString& text) = 0;
|
||||
|
||||
// text control under some platforms supports the text styles: these
|
||||
// methods allow to apply the given text style to the given selection or to
|
||||
// set/get the style which will be used for all appended text
|
||||
virtual bool SetStyle(long start, long end, const wxTextAttr& style);
|
||||
virtual bool SetDefaultStyle(const wxTextAttr& style);
|
||||
virtual const wxTextAttr& GetDefaultStyle() const;
|
||||
|
||||
// translate between the position (which is just an index in the text ctrl
|
||||
// considering all its contents as a single strings) and (x, y) coordinates
|
||||
// which represent column and line.
|
||||
virtual long XYToPosition(long x, long y) const = 0;
|
||||
virtual bool PositionToXY(long pos, long *x, long *y) const = 0;
|
||||
|
||||
virtual void ShowPosition(long pos) = 0;
|
||||
|
||||
// Clipboard operations
|
||||
virtual void Copy() = 0;
|
||||
virtual void Cut() = 0;
|
||||
virtual void Paste() = 0;
|
||||
|
||||
virtual bool CanCopy() const;
|
||||
virtual bool CanCut() const;
|
||||
virtual bool CanPaste() const;
|
||||
|
||||
// Undo/redo
|
||||
virtual void Undo() = 0;
|
||||
virtual void Redo() = 0;
|
||||
|
||||
virtual bool CanUndo() const = 0;
|
||||
virtual bool CanRedo() const = 0;
|
||||
|
||||
// Insertion point
|
||||
virtual void SetInsertionPoint(long pos) = 0;
|
||||
virtual void SetInsertionPointEnd() = 0;
|
||||
virtual long GetInsertionPoint() const = 0;
|
||||
virtual long GetLastPosition() const = 0;
|
||||
|
||||
virtual void SetSelection(long from, long to) = 0;
|
||||
virtual void SelectAll();
|
||||
virtual void SetEditable(bool editable) = 0;
|
||||
|
||||
// streambuf methods
|
||||
#ifndef NO_TEXT_WINDOW_STREAM
|
||||
int overflow(int i);
|
||||
int sync();
|
||||
int underflow();
|
||||
#endif // NO_TEXT_WINDOW_STREAM
|
||||
|
||||
// stream-like insertion operators: these are always available, whether we
|
||||
// were, or not, compiled with streambuf support
|
||||
wxTextCtrl& operator<<(const wxString& s);
|
||||
wxTextCtrl& operator<<(int i);
|
||||
wxTextCtrl& operator<<(long i);
|
||||
wxTextCtrl& operator<<(float f);
|
||||
wxTextCtrl& operator<<(double d);
|
||||
wxTextCtrl& operator<<(const wxChar c);
|
||||
|
||||
// obsolete functions
|
||||
#if WXWIN_COMPATIBILITY
|
||||
bool Modified() const { return IsModified(); }
|
||||
#endif
|
||||
|
||||
protected:
|
||||
// the name of the last file loaded with LoadFile() which will be used by
|
||||
// SaveFile() by default
|
||||
wxString m_filename;
|
||||
|
||||
// the text style which will be used for any new text added to the control
|
||||
wxTextAttr m_defaultStyle;
|
||||
|
||||
private:
|
||||
#ifndef NO_TEXT_WINDOW_STREAM
|
||||
#if !wxUSE_IOSTREAMH
|
||||
char *m_streambuf;
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// include the platform-dependent class definition
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__WXUNIVERSAL__)
|
||||
#include "wx/univ/textctrl.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/textctrl.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/textctrl.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/textctrl.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/textctrl.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/textctrl.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/textctrl.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/stubs/textctrl.h"
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxTextCtrl events
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if !WXWIN_COMPATIBILITY_EVENT_TYPES
|
||||
|
||||
BEGIN_DECLARE_EVENT_TYPES()
|
||||
DECLARE_EVENT_TYPE(wxEVT_COMMAND_TEXT_UPDATED, 7)
|
||||
DECLARE_EVENT_TYPE(wxEVT_COMMAND_TEXT_ENTER, 8)
|
||||
DECLARE_EVENT_TYPE(wxEVT_COMMAND_TEXT_URL, 13)
|
||||
DECLARE_EVENT_TYPE(wxEVT_COMMAND_TEXT_MAXLEN, 14)
|
||||
END_DECLARE_EVENT_TYPES()
|
||||
|
||||
#endif // !WXWIN_COMPATIBILITY_EVENT_TYPES
|
||||
|
||||
class WXDLLEXPORT wxTextUrlEvent : public wxCommandEvent
|
||||
{
|
||||
public:
|
||||
wxTextUrlEvent(int id, const wxMouseEvent& evtMouse,
|
||||
long start, long end)
|
||||
: wxCommandEvent(wxEVT_COMMAND_TEXT_URL, id),
|
||||
m_evtMouse(evtMouse)
|
||||
{ m_start = start; m_end = end; }
|
||||
|
||||
// get the mouse event which happend over the URL
|
||||
const wxMouseEvent& GetMouseEvent() const { return m_evtMouse; }
|
||||
|
||||
// get the start of the URL
|
||||
long GetURLStart() const { return m_start; }
|
||||
|
||||
// get the end of the URL
|
||||
long GetURLEnd() const { return m_end; }
|
||||
|
||||
protected:
|
||||
// the corresponding mouse event
|
||||
wxMouseEvent m_evtMouse;
|
||||
|
||||
// the start and end indices of the URL in the text control
|
||||
long m_start,
|
||||
m_end;
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxTextUrlEvent)
|
||||
|
||||
public:
|
||||
// for wxWin RTTI only, don't use
|
||||
wxTextUrlEvent() { }
|
||||
};
|
||||
|
||||
typedef void (wxEvtHandler::*wxTextUrlEventFunction)(wxTextUrlEvent&);
|
||||
|
||||
#define EVT_TEXT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TEXT_UPDATED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL ),
|
||||
#define EVT_TEXT_ENTER(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TEXT_ENTER, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL ),
|
||||
#define EVT_TEXT_URL(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TEXT_URL, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) (wxTextUrlEventFunction) & fn, (wxObject *) NULL ),
|
||||
#define EVT_TEXT_MAXLEN(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TEXT_MAXLEN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL ),
|
||||
|
||||
#endif // wxUSE_TEXTCTRL
|
||||
|
||||
#endif
|
||||
// _WX_TEXTCTRL_H_BASE_
|
50
include/wx/tglbtn.h
Normal file
50
include/wx/tglbtn.h
Normal file
@@ -0,0 +1,50 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/tglbtn.h
|
||||
// Purpose: This dummy header includes the proper header file for the
|
||||
// system we're compiling under.
|
||||
// Author: John Norris, minor changes by Axel Schlueter
|
||||
// Modified by:
|
||||
// Created: 08.02.01
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2000 Johnny C. Norris II
|
||||
// License: Rocketeer license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_TOGGLEBUTTON_H_BASE_
|
||||
#define _WX_TOGGLEBUTTON_H_BASE_
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_TOGGLEBTN
|
||||
|
||||
#include "wx/event.h"
|
||||
#include "wx/control.h" // base class
|
||||
|
||||
BEGIN_DECLARE_EVENT_TYPES()
|
||||
DECLARE_EVENT_TYPE(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, 19)
|
||||
END_DECLARE_EVENT_TYPES()
|
||||
|
||||
#define EVT_TOGGLEBUTTON(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL ),
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#include "wx/msw/tglbtn.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/tglbtn.h"
|
||||
/*
|
||||
# elif defined(__WXMOTIF__)
|
||||
# include "wx/motif/tglbtn.h"
|
||||
# elif defined(__WXQT__)
|
||||
# include "wx/qt/tglbtn.h"
|
||||
# elif defined(__WXMAC__)
|
||||
# include "wx/mac/tglbtn.h"
|
||||
# elif defined(__WXPM__)
|
||||
# include "wx/os2/tglbtn.h"
|
||||
# elif defined(__WXSTUBS__)
|
||||
# include "wx/stubs/tglbtn.h"
|
||||
*/
|
||||
#endif
|
||||
|
||||
#endif // wxUSE_TOGGLEBTN
|
||||
|
||||
#endif // _WX_TOGGLEBUTTON_H_BASE_
|
||||
|
244
include/wx/timer.h
Normal file
244
include/wx/timer.h
Normal file
@@ -0,0 +1,244 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/timer.h
|
||||
// Purpose: wxTimer, wxStopWatch and global time-related functions
|
||||
// Author: Julian Smart (wxTimer), Sylvain Bougnoux (wxStopWatch)
|
||||
// Modified by: Vadim Zeitlin (wxTimerBase)
|
||||
// Guillermo Rodriguez (global clean up)
|
||||
// Created: 04/01/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) wxWindows team
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_TIMER_H_BASE_
|
||||
#define _WX_TIMER_H_BASE_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "timerbase.h"
|
||||
#endif
|
||||
|
||||
#include "wx/setup.h"
|
||||
#include "wx/object.h"
|
||||
#include "wx/longlong.h"
|
||||
#include "wx/event.h"
|
||||
|
||||
#if wxUSE_GUI && wxUSE_TIMER
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxTimer
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// the interface of wxTimer class
|
||||
class WXDLLEXPORT wxTimerBase : public wxObject
|
||||
{
|
||||
public:
|
||||
// ctors and initializers
|
||||
// ----------------------
|
||||
|
||||
// default: if you don't call SetOwner(), your only chance to get timer
|
||||
// notifications is to override Notify() in the derived class
|
||||
wxTimerBase() { Init(); SetOwner(NULL); }
|
||||
|
||||
// ctor which allows to avoid having to override Notify() in the derived
|
||||
// class: the owner will get timer notifications which can be handled with
|
||||
// EVT_TIMER
|
||||
wxTimerBase(wxEvtHandler *owner, int id = -1)
|
||||
{ Init(); SetOwner(owner, id); }
|
||||
|
||||
// same as ctor above
|
||||
void SetOwner(wxEvtHandler *owner, int id = -1)
|
||||
{ m_owner = owner; m_idTimer = id; }
|
||||
|
||||
#ifdef __DARWIN__
|
||||
virtual ~wxTimerBase() { }
|
||||
#endif
|
||||
|
||||
// working with the timer
|
||||
// ----------------------
|
||||
|
||||
// start the timer: if milliseconds == -1, use the same value as for the
|
||||
// last Start()
|
||||
//
|
||||
// it is now valid to call Start() multiple times: this just restarts the
|
||||
// timer if it is already running
|
||||
virtual bool Start(int milliseconds = -1, bool oneShot = FALSE);
|
||||
|
||||
// stop the timer
|
||||
virtual void Stop() = 0;
|
||||
|
||||
// override this in your wxTimer-derived class if you want to process timer
|
||||
// messages in it, use non default ctor or SetOwner() otherwise
|
||||
virtual void Notify();
|
||||
|
||||
// getting info
|
||||
// ------------
|
||||
|
||||
// return TRUE if the timer is running
|
||||
virtual bool IsRunning() const = 0;
|
||||
|
||||
// get the (last) timer interval in the milliseconds
|
||||
int GetInterval() const { return m_milli; }
|
||||
|
||||
// return TRUE if the timer is one shot
|
||||
bool IsOneShot() const { return m_oneShot; }
|
||||
|
||||
#if WXWIN_COMPATIBILITY_2
|
||||
// deprecated functions
|
||||
int Interval() const { return GetInterval(); };
|
||||
bool OneShot() const { return IsOneShot(); }
|
||||
#endif // WXWIN_COMPATIBILITY_2
|
||||
|
||||
protected:
|
||||
// common part of all ctors
|
||||
void Init() { m_oneShot = FALSE; m_milli = 0; }
|
||||
|
||||
wxEvtHandler *m_owner;
|
||||
int m_idTimer;
|
||||
|
||||
int m_milli; // the timer interval
|
||||
bool m_oneShot; // TRUE if one shot
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxTimer itself
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#include "wx/msw/timer.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/timer.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/timer.h"
|
||||
#elif defined(__WXMGL__)
|
||||
#include "wx/mgl/timer.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/timer.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/timer.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/timer.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/stubs/timer.h"
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxTimerRunner: starts the timer in its ctor, stops in the dtor
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxTimerRunner
|
||||
{
|
||||
public:
|
||||
wxTimerRunner(wxTimer& timer) : m_timer(timer) { }
|
||||
wxTimerRunner(wxTimer& timer, int milli, bool oneShot = FALSE)
|
||||
: m_timer(timer)
|
||||
{
|
||||
m_timer.Start(milli, oneShot);
|
||||
}
|
||||
|
||||
void Start(int milli, bool oneShot = FALSE)
|
||||
{
|
||||
m_timer.Start(milli, oneShot);
|
||||
}
|
||||
|
||||
~wxTimerRunner()
|
||||
{
|
||||
if ( m_timer.IsRunning() )
|
||||
{
|
||||
m_timer.Stop();
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
wxTimer& m_timer;
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxTimerEvent
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxTimerEvent : public wxEvent
|
||||
{
|
||||
public:
|
||||
wxTimerEvent(int id = 0, int interval = 0) : wxEvent(id)
|
||||
{
|
||||
m_eventType = wxEVT_TIMER;
|
||||
|
||||
m_interval = interval;
|
||||
}
|
||||
|
||||
// accessors
|
||||
int GetInterval() const { return m_interval; }
|
||||
|
||||
private:
|
||||
int m_interval;
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxTimerEvent)
|
||||
};
|
||||
|
||||
typedef void (wxEvtHandler::*wxTimerEventFunction)(wxTimerEvent&);
|
||||
|
||||
#define EVT_TIMER(id, func) \
|
||||
DECLARE_EVENT_TABLE_ENTRY( wxEVT_TIMER, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTimerEventFunction) & func, NULL),
|
||||
|
||||
#endif // wxUSE_GUI && wxUSE_TIMER
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxStopWatch: measure time intervals with up to 1ms resolution
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if wxUSE_STOPWATCH
|
||||
|
||||
class WXDLLEXPORT wxStopWatch
|
||||
{
|
||||
public:
|
||||
// ctor starts the stop watch
|
||||
wxStopWatch() { Start(); }
|
||||
void Start(long t = 0);
|
||||
void Pause() { m_pause = GetElapsedTime(); }
|
||||
void Resume() { Start(m_pause); }
|
||||
|
||||
// get elapsed time since the last Start() or Pause() in milliseconds
|
||||
long Time() const;
|
||||
|
||||
protected:
|
||||
// returns the elapsed time since t0
|
||||
long GetElapsedTime() const;
|
||||
|
||||
private:
|
||||
wxLongLong m_t0; // the time of the last Start()
|
||||
long m_pause; // the time of the last Pause() or 0
|
||||
};
|
||||
|
||||
#endif // wxUSE_STOPWATCH
|
||||
|
||||
#if wxUSE_LONGLONG
|
||||
|
||||
// Starts a global timer
|
||||
// -- DEPRECATED: use wxStopWatch instead
|
||||
void WXDLLEXPORT wxStartTimer();
|
||||
|
||||
// Gets elapsed milliseconds since last wxStartTimer or wxGetElapsedTime
|
||||
// -- DEPRECATED: use wxStopWatch instead
|
||||
long WXDLLEXPORT wxGetElapsedTime(bool resetTimer = TRUE);
|
||||
|
||||
#endif // wxUSE_LONGLONG
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// global time functions
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// Get number of seconds since local time 00:00:00 Jan 1st 1970.
|
||||
extern long WXDLLEXPORT wxGetLocalTime();
|
||||
|
||||
// Get number of seconds since GMT 00:00:00, Jan 1st 1970.
|
||||
extern long WXDLLEXPORT wxGetUTCTime();
|
||||
|
||||
#if wxUSE_LONGLONG
|
||||
// Get number of milliseconds since local time 00:00:00 Jan 1st 1970
|
||||
extern wxLongLong WXDLLEXPORT wxGetLocalTimeMillis();
|
||||
#endif // wxUSE_LONGLONG
|
||||
|
||||
#define wxGetCurrentTime() wxGetLocalTime()
|
||||
|
||||
#endif
|
||||
// _WX_TIMER_H_BASE_
|
59
include/wx/toolbar.h
Normal file
59
include/wx/toolbar.h
Normal file
@@ -0,0 +1,59 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/toolbar.h
|
||||
// Purpose: wxToolBar interface declaration
|
||||
// Author: Vadim Zeitlin
|
||||
// Modified by:
|
||||
// Created: 20.11.99
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) wxWindows team
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_TOOLBAR_H_BASE_
|
||||
#define _WX_TOOLBAR_H_BASE_
|
||||
|
||||
#include "wx/tbarbase.h" // the base class for all toolbars
|
||||
|
||||
#if wxUSE_TOOLBAR
|
||||
#if !wxUSE_TOOLBAR_NATIVE || defined(__WXUNIVERSAL__)
|
||||
#include "wx/tbarsmpl.h"
|
||||
|
||||
class WXDLLEXPORT wxToolBar : public wxToolBarSimple
|
||||
{
|
||||
public:
|
||||
wxToolBar() { }
|
||||
|
||||
wxToolBar(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxNO_BORDER | wxTB_HORIZONTAL,
|
||||
const wxString& name = wxToolBarNameStr)
|
||||
: wxToolBarSimple(parent, id, pos, size, style, name) { }
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxToolBar)
|
||||
};
|
||||
#else // wxUSE_TOOLBAR_NATIVE
|
||||
#if defined(__WXMSW__) && defined(__WIN95__)
|
||||
#include "wx/msw/tbar95.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/tbarmsw.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/motif/toolbar.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/tbargtk.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/tbarqt.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/toolbar.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/toolbar.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/stubs/toolbar.h"
|
||||
#endif
|
||||
#endif // !wxUSE_TOOLBAR_NATIVE/wxUSE_TOOLBAR_NATIVE
|
||||
#endif // wxUSE_TOOLBAR
|
||||
|
||||
#endif
|
||||
// _WX_TOOLBAR_H_BASE_
|
21
include/wx/tooltip.h
Normal file
21
include/wx/tooltip.h
Normal file
@@ -0,0 +1,21 @@
|
||||
#ifndef _WX_TOOLTIP_H_BASE_
|
||||
#define _WX_TOOLTIP_H_BASE_
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#include "wx/msw/tooltip.h"
|
||||
#elif defined(__WXMOTIF__)
|
||||
// #include "wx/motif/tooltip.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/tooltip.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/tooltip.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/tooltip.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/tooltip.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
// #include "wx/stubs/tooltip.h"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
// _WX_TOOLTIP_H_BASE_
|
40
include/wx/treectrl.h
Normal file
40
include/wx/treectrl.h
Normal file
@@ -0,0 +1,40 @@
|
||||
#ifndef _WX_TREECTRL_H_BASE_
|
||||
#define _WX_TREECTRL_H_BASE_
|
||||
|
||||
#include "wx/treebase.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// include the platform-dependent wxTreeCtrl class
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__WXUNIVERSAL__)
|
||||
#include "wx/generic/treectlg.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#ifdef __WIN16__
|
||||
#include "wx/generic/treectlg.h"
|
||||
#else
|
||||
#include "wx/msw/treectrl.h"
|
||||
#endif
|
||||
#elif defined(__WXMOTIF__)
|
||||
#include "wx/generic/treectlg.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/generic/treectlg.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/treectrl.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/generic/treectlg.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/generic/treectlg.h"
|
||||
#elif defined(__WXSTUBS__)
|
||||
#include "wx/generic/treectlg.h"
|
||||
#endif
|
||||
|
||||
/*
|
||||
#if !defined(__WXMSW__)
|
||||
#define wxTreeCtrl wxGenericTreeCtrl
|
||||
#define sm_classwxTreeCtrl sm_classwxGenericTreeCtrl
|
||||
#endif
|
||||
*/
|
||||
|
||||
#endif // _WX_TREECTRL_H_BASE_
|
||||
|
19
include/wx/wave.h
Normal file
19
include/wx/wave.h
Normal file
@@ -0,0 +1,19 @@
|
||||
#ifndef _WX_WAVE_H_BASE_
|
||||
#define _WX_WAVE_H_BASE_
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
#include "wx/msw/wave.h"
|
||||
#elif defined(__WXGTK__)
|
||||
#include "wx/gtk/wave.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/wave.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/wave.h"
|
||||
#elif defined(__WXPM__)
|
||||
#include "wx/os2/wave.h"
|
||||
#elif defined(__WXMAC__)
|
||||
#include "wx/mac/wave.h"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
// _WX_TREECTRL_H_BASE_
|
1080
include/wx/window.h
Normal file
1080
include/wx/window.h
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,24 +0,0 @@
|
||||
.DS_Store
|
||||
.emacs.desktop
|
||||
.gdb_history
|
||||
BUILD
|
||||
MANIFEST
|
||||
_build_dmg
|
||||
_build_rpm
|
||||
build
|
||||
build-dbg
|
||||
build-gtk
|
||||
build-gtk2
|
||||
build-gtk2-dbg.unicode
|
||||
build-gtk2.unicode
|
||||
build-pkg
|
||||
build-pkg-debug
|
||||
build-x11
|
||||
build.local
|
||||
build.unicode
|
||||
build_options.py
|
||||
dist
|
||||
licence
|
||||
s.bat
|
||||
temp
|
||||
update.log
|
@@ -1,138 +0,0 @@
|
||||
SWIG 1.3.x Patches
|
||||
==================
|
||||
|
||||
This directory holds a set of patches for the CVS version of SWIG that
|
||||
are required if you wish to use SWIG for wxPython development, or for
|
||||
building your own extension modules that need to interface with
|
||||
wxPython. These have been submitted to SWIG's SourceForge patch
|
||||
tracker, so hopefully they will get incorporated into the main SWIG
|
||||
source tree soon.
|
||||
|
||||
wxPython currently uses the 1.3.27 version of SWIG, which you can get
|
||||
from https://sourceforge.net/projects/swig/, plus the patch(es) in
|
||||
this directory. Download the SWIG sources, apply the patch(es) here
|
||||
and then build as normal. I have also have made available a tarball
|
||||
containing the patched SWIG sources, plus a win32 binary, located
|
||||
here:
|
||||
|
||||
http://starship.python.net/crew/robind/wxPython/tools/
|
||||
|
||||
If you want to use the patched version of SWIG and still have the
|
||||
stock version available for other projects, then you can configure the
|
||||
patched version to use a different --prefix and then specify that
|
||||
executable when running setup.py, like this:
|
||||
|
||||
python setup.py SWIG=/path/to/my/swig [other params]
|
||||
|
||||
|
||||
|
||||
------------------------------------------------------------------------
|
||||
|
||||
swig-1.3.27.patch
|
||||
|
||||
SWIG changed slightly how the runtime type_info data is structured
|
||||
in order to optimize load time and runtime access. wxPython
|
||||
uncovered a bug in the implementation, so this patch includes the
|
||||
fix that was checked in to CVS for 1.3.28.
|
||||
|
||||
SWIG changed how the import statments are output to the proxy
|
||||
file, but this also caused the order to change (they all moved to
|
||||
the very top of the file) so this broke the module docstring, as
|
||||
well as some behavior that Chandler development is depending upon,
|
||||
so this patch changes back to how it was done in prior releases.
|
||||
|
||||
Bug fix for SWIG's definition of the %makedefault macro.
|
||||
|
||||
Add a SWIG_VERSION macro to the wrapper file so C/C++ code can
|
||||
integrate with different versions of the generated runtime code.
|
||||
|
||||
|
||||
|
||||
------------------------------------------------------------------------
|
||||
|
||||
swig-1.3.24.patch (now obsolete)
|
||||
|
||||
A bug was introduced in SWIG 1.3.23 and remains in 1.3.24 that
|
||||
causes compilation problems with wxPython (copies are being made
|
||||
of objects that don't have a copy constructor.) This patch fixes
|
||||
the code generator to use a reference to the object instead of
|
||||
making a copy.
|
||||
|
||||
Part of my autodoc patch was disabled becuase a unit-test failed.
|
||||
It turns out that the failure was due to a name clash in the unit
|
||||
test itself, so I re-enabled that section of code in this patch.
|
||||
|
||||
Don't generate the autodocs string for a class if it has a
|
||||
docstring attribute.
|
||||
|
||||
Some typos fixed, etc.
|
||||
|
||||
|
||||
|
||||
|
||||
------------------------------------------------------------------------
|
||||
This patch was added to SWIG's CVS on 10/2/2004 and a modified version
|
||||
of it is in 1.3.23 and 1.3.24.
|
||||
------------------------------------------------------------------------
|
||||
|
||||
|
||||
swig.python-2.patch
|
||||
|
||||
Adds the following features to the Python Module in SWIG. See the
|
||||
updated docs in the patch for more details.
|
||||
|
||||
%feature("autodoc")
|
||||
%feature("docstring")
|
||||
%feature("pythonprepend")
|
||||
%feature("pythonappend")
|
||||
|
||||
%module(docstring="string")
|
||||
%module(package="string")
|
||||
|
||||
https://sourceforge.net/tracker/index.php?func=detail&aid=1023309&group_id=1645&atid=301645
|
||||
|
||||
|
||||
------------------------------------------------------------------------
|
||||
This patch was applied to SWIG's CVS on 07/12/2004 and is in the
|
||||
1.3.22 relese.
|
||||
------------------------------------------------------------------------
|
||||
|
||||
swig.xmlout.patch Fixes a couple problems in the XML output
|
||||
of SWIG: an extra "/>" was removed and
|
||||
newlines in attribute values were changed
|
||||
to the #10; entity reference so they will
|
||||
be preserved by parsers.
|
||||
|
||||
Also, added options for dumping or
|
||||
writing to a file the XML of the parse
|
||||
tree *after* other language modules have
|
||||
been run (previously you could only do
|
||||
the XML output *instead of* a regular
|
||||
language module.)
|
||||
See SF Patch #864689
|
||||
|
||||
|
||||
|
||||
------------------------------------------------------------------------
|
||||
These patches have already been checked in to SWIG's CVS and are in
|
||||
the 1.3.20 release.
|
||||
------------------------------------------------------------------------
|
||||
|
||||
swig.SplitLines.patch Adds a new SplitLines function to the DOH
|
||||
library. See SF Patch #829317.
|
||||
*Checked in 10/31/2003*
|
||||
|
||||
swig.xml.patch Adds an option that drastically reduces
|
||||
the size of the XML output of SWIG, which
|
||||
increases the performance of the
|
||||
build_renamers script used in the wxPython
|
||||
build. See SF Patch #829319.
|
||||
*Checked in 10/31/2003*
|
||||
|
||||
swig.python.patch Lots of changes for SWIG's Python module,
|
||||
especially in how the proxy code is
|
||||
generated. See swig.python.patch.txt for
|
||||
more details, also SF Patch #829325.
|
||||
*Checked in 10/31/2003*
|
||||
|
||||
------------------------------------------------------------------------
|
@@ -1,201 +0,0 @@
|
||||
? .configure
|
||||
? .emacs.desktop
|
||||
? .test
|
||||
? mytests
|
||||
? switch_cvs.py
|
||||
? Source/Modules/mystuff
|
||||
Index: Doc/Manual/Python.html
|
||||
===================================================================
|
||||
RCS file: /cvsroot/swig/SWIG/Doc/Manual/Python.html,v
|
||||
retrieving revision 1.20
|
||||
diff -u -4 -r1.20 Python.html
|
||||
--- Doc/Manual/Python.html 25 Oct 2004 20:42:08 -0000 1.20
|
||||
+++ Doc/Manual/Python.html 15 Apr 2005 23:11:25 -0000
|
||||
@@ -3869,10 +3869,10 @@
|
||||
|
||||
<H2><a name="Python_nn65"></a>26.10 Docstring Features</H2>
|
||||
|
||||
|
||||
-Usign docstrings in Python code is becoming more and more important
|
||||
-ans more tools are coming on the scene that take advantage of them,
|
||||
+Using docstrings in Python code is becoming more and more important
|
||||
+and more tools are coming on the scene that take advantage of them,
|
||||
everything from full-blown documentaiton generators to class browsers
|
||||
and popup call-tips in Python-aware IDEs. Given the way that SWIG
|
||||
generates the proxy code by default, your users will normally get
|
||||
something like <tt>"function_name(*args)"</tt> in the popup calltip of
|
||||
Index: Lib/python/pyrun.swg
|
||||
===================================================================
|
||||
RCS file: /cvsroot/swig/SWIG/Lib/python/pyrun.swg,v
|
||||
retrieving revision 1.53
|
||||
diff -u -4 -r1.53 pyrun.swg
|
||||
--- Lib/python/pyrun.swg 11 Dec 2004 23:38:44 -0000 1.53
|
||||
+++ Lib/python/pyrun.swg 15 Apr 2005 23:11:25 -0000
|
||||
@@ -455,9 +455,10 @@
|
||||
} else {
|
||||
PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received",
|
||||
type, otype);
|
||||
}
|
||||
- Py_DECREF(str);
|
||||
+ if (str)
|
||||
+ Py_DECREF(str);
|
||||
return;
|
||||
}
|
||||
}
|
||||
PyErr_Format(PyExc_TypeError, "a '%s' is expected", type);
|
||||
Index: Source/Modules/python.cxx
|
||||
===================================================================
|
||||
RCS file: /cvsroot/swig/SWIG/Source/Modules/python.cxx,v
|
||||
retrieving revision 1.81
|
||||
diff -u -4 -r1.81 python.cxx
|
||||
--- Source/Modules/python.cxx 13 Dec 2004 22:12:47 -0000 1.81
|
||||
+++ Source/Modules/python.cxx 15 Apr 2005 23:11:26 -0000
|
||||
@@ -74,9 +74,9 @@
|
||||
-modern - Use modern python features only, without compatibility code\n\
|
||||
-apply - Use apply() in proxy classes\n\
|
||||
-new_vwm - New value wrapper mode, use only when everything else fails \n\
|
||||
-new_repr - Use more informative version of __repr__ in proxy classes\n\
|
||||
- -old_repr - Use shorter ald old version of __repr__ in proxy classes\n\
|
||||
+ -old_repr - Use shorter and old version of __repr__ in proxy classes\n\
|
||||
-noexcept - No automatic exception handling\n\
|
||||
-noh - Don't generate the output header file\n\
|
||||
-noproxy - Don't generate proxy classes \n\n";
|
||||
|
||||
@@ -749,10 +749,15 @@
|
||||
|
||||
// Do the param type too?
|
||||
if (showTypes) {
|
||||
type = SwigType_base(type);
|
||||
- lookup = Swig_symbol_clookup(type, 0);
|
||||
- if (lookup) type = Getattr(lookup, "sym:name");
|
||||
+ SwigType* qt = SwigType_typedef_resolve_all(type);
|
||||
+ if (SwigType_isenum(qt))
|
||||
+ type = NewString("int");
|
||||
+ else {
|
||||
+ lookup = Swig_symbol_clookup(type, 0);
|
||||
+ if (lookup) type = Getattr(lookup, "sym:name");
|
||||
+ }
|
||||
Printf(doc, "%s ", type);
|
||||
}
|
||||
|
||||
if (name) {
|
||||
@@ -853,13 +858,19 @@
|
||||
}
|
||||
|
||||
switch ( ad_type ) {
|
||||
case AUTODOC_CLASS:
|
||||
- if (CPlusPlus) {
|
||||
- Printf(doc, "Proxy of C++ %s class", class_name);
|
||||
- } else {
|
||||
- Printf(doc, "Proxy of C %s struct", class_name);
|
||||
- }
|
||||
+ {
|
||||
+ // Only do the autodoc if there isn't a docstring for the class
|
||||
+ String* str = Getattr(n, "feature:docstring");
|
||||
+ if (str == NULL || Len(str) == 0) {
|
||||
+ if (CPlusPlus) {
|
||||
+ Printf(doc, "Proxy of C++ %s class", class_name);
|
||||
+ } else {
|
||||
+ Printf(doc, "Proxy of C %s struct", class_name);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
break;
|
||||
case AUTODOC_CTOR:
|
||||
if ( Strcmp(class_name, symname) == 0) {
|
||||
String* paramList = make_autodocParmList(n, showTypes);
|
||||
@@ -1027,10 +1038,12 @@
|
||||
Printf(methods,"\t { (char *)\"%s\", (PyCFunction) %s, METH_VARARGS | METH_KEYWORDS, ", name, function);
|
||||
|
||||
if (n && Getattr(n,"feature:callback")) {
|
||||
if (have_docstring(n)) {
|
||||
+ String* ds = docstring(n, AUTODOC_FUNC, "", false);
|
||||
+ Replaceall(ds, "\n", "\\n");
|
||||
Printf(methods,"(char *)\"%s\\nswig_ptr: %s\"",
|
||||
- docstring(n, AUTODOC_FUNC, "", false),
|
||||
+ ds,
|
||||
Getattr(n,"feature:callback:name"));
|
||||
} else {
|
||||
Printf(methods,"(char *)\"swig_ptr: %s\"",Getattr(n,"feature:callback:name"));
|
||||
}
|
||||
@@ -1950,11 +1963,13 @@
|
||||
Printf(f_shadow, modern ? "(object)" : "(_object)");
|
||||
}
|
||||
}
|
||||
Printf(f_shadow,":\n");
|
||||
- if ( have_docstring(n) )
|
||||
- Printv(f_shadow, tab4, docstring(n, AUTODOC_CLASS, tab4), "\n", NIL);
|
||||
-
|
||||
+ if ( have_docstring(n) ) {
|
||||
+ String* str = docstring(n, AUTODOC_CLASS, tab4);
|
||||
+ if (str != NULL && Len(str))
|
||||
+ Printv(f_shadow, tab4, str, "\n", NIL);
|
||||
+ }
|
||||
if (!modern) {
|
||||
Printv(f_shadow,tab4,"__swig_setmethods__ = {}\n",NIL);
|
||||
if (Len(base_class)) {
|
||||
Printf(f_shadow,"%sfor _s in [%s]: __swig_setmethods__.update(_s.__swig_setmethods__)\n",tab4,base_class);
|
||||
@@ -2139,11 +2154,11 @@
|
||||
Replaceall(pycode,"$action", pyaction);
|
||||
Delete(pyaction);
|
||||
Printv(f_shadow,pycode,"\n",NIL);
|
||||
} else {
|
||||
- Printv(f_shadow, tab4, "def ", symname, "(*args", (allow_kwargs ? ", **kwargs" : ""), "): ", NIL);
|
||||
+ Printv(f_shadow, tab4, "def ", symname, "(*args", (allow_kwargs ? ", **kwargs" : ""), "):", NIL);
|
||||
if (!have_addtofunc(n)) {
|
||||
- Printv(f_shadow, "return ", funcCallHelper(Swig_name_member(class_name,symname), allow_kwargs), "\n", NIL);
|
||||
+ Printv(f_shadow, " return ", funcCallHelper(Swig_name_member(class_name,symname), allow_kwargs), "\n", NIL);
|
||||
} else {
|
||||
Printv(f_shadow, "\n", NIL);
|
||||
if ( have_docstring(n) )
|
||||
Printv(f_shadow, tab8, docstring(n, AUTODOC_METHOD, tab8), "\n", NIL);
|
||||
@@ -2175,12 +2190,9 @@
|
||||
return SWIG_OK;
|
||||
}
|
||||
|
||||
if (shadow) {
|
||||
- //
|
||||
- // static + autodoc/prepend/append + def args not working!!!, disable by now
|
||||
- //
|
||||
- if (0 && !classic && !Getattr(n,"feature:python:callback") && have_addtofunc(n)) {
|
||||
+ if ( !classic && !Getattr(n,"feature:python:callback") && have_addtofunc(n)) {
|
||||
int kw = (check_kwargs(n) && !Getattr(n,"sym:overloaded")) ? 1 : 0;
|
||||
Printv(f_shadow, tab4, "def ", symname, "(*args", (kw ? ", **kwargs" : ""), "):\n", NIL);
|
||||
if ( have_docstring(n) )
|
||||
Printv(f_shadow, tab8, docstring(n, AUTODOC_STATICFUNC, tab8), "\n", NIL);
|
||||
Index: Source/Swig/cwrap.c
|
||||
===================================================================
|
||||
RCS file: /cvsroot/swig/SWIG/Source/Swig/cwrap.c,v
|
||||
retrieving revision 1.51
|
||||
diff -u -4 -r1.51 cwrap.c
|
||||
--- Source/Swig/cwrap.c 4 Dec 2004 08:33:02 -0000 1.51
|
||||
+++ Source/Swig/cwrap.c 15 Apr 2005 23:11:26 -0000
|
||||
@@ -172,17 +172,26 @@
|
||||
tycode = SwigType_type(type);
|
||||
if (tycode == T_REFERENCE) {
|
||||
if (pvalue) {
|
||||
SwigType *tvalue;
|
||||
- String *defname, *defvalue, *rvalue;
|
||||
+ String *defname, *defvalue, *rvalue, *qvalue;
|
||||
rvalue = SwigType_typedef_resolve_all(pvalue);
|
||||
+ qvalue = SwigType_typedef_qualified(rvalue);
|
||||
defname = NewStringf("%s_defvalue", lname);
|
||||
tvalue = Copy(type);
|
||||
SwigType_del_reference(tvalue);
|
||||
- defvalue = NewStringf("%s = %s", SwigType_lstr(tvalue,defname), rvalue);
|
||||
+ tycode = SwigType_type(tvalue);
|
||||
+ if (tycode != T_USER) {
|
||||
+ /* plain primitive type, we copy the the def value */
|
||||
+ defvalue = NewStringf("%s = %s", SwigType_lstr(tvalue,defname),qvalue);
|
||||
+ } else {
|
||||
+ /* user type, we copy the reference value */
|
||||
+ defvalue = NewStringf("%s = %s",SwigType_str(type,defname),qvalue);
|
||||
+ }
|
||||
Wrapper_add_localv(w,defname, defvalue, NIL);
|
||||
Delete(tvalue);
|
||||
Delete(rvalue);
|
||||
+ Delete(qvalue);
|
||||
Delete(defname);
|
||||
Delete(defvalue);
|
||||
}
|
||||
} else if (!pvalue && ((tycode == T_POINTER) || (tycode == T_STRING))) {
|
@@ -1,290 +0,0 @@
|
||||
Index: Doc/Manual/Python.html
|
||||
===================================================================
|
||||
RCS file: /cvsroot/swig/SWIG/Doc/Manual/Python.html,v
|
||||
retrieving revision 1.31
|
||||
diff -u -4 -r1.31 Python.html
|
||||
--- Doc/Manual/Python.html 6 Oct 2005 21:49:58 -0000 1.31
|
||||
+++ Doc/Manual/Python.html 29 Jan 2006 02:05:55 -0000
|
||||
@@ -4461,10 +4461,10 @@
|
||||
<H2><a name="Python_nn65"></a>26.10 Docstring Features</H2>
|
||||
|
||||
|
||||
<p>
|
||||
-Usign docstrings in Python code is becoming more and more important
|
||||
-ans more tools are coming on the scene that take advantage of them,
|
||||
+Using docstrings in Python code is becoming more and more important
|
||||
+and more tools are coming on the scene that take advantage of them,
|
||||
everything from full-blown documentaiton generators to class browsers
|
||||
and popup call-tips in Python-aware IDEs. Given the way that SWIG
|
||||
generates the proxy code by default, your users will normally get
|
||||
something like <tt>"function_name(*args)"</tt> in the popup calltip of
|
||||
Index: Lib/swig.swg
|
||||
===================================================================
|
||||
RCS file: /cvsroot/swig/SWIG/Lib/swig.swg,v
|
||||
retrieving revision 1.49
|
||||
diff -u -4 -r1.49 swig.swg
|
||||
--- Lib/swig.swg 15 Oct 2005 00:15:30 -0000 1.49
|
||||
+++ Lib/swig.swg 29 Jan 2006 02:05:55 -0000
|
||||
@@ -51,9 +51,9 @@
|
||||
|
||||
#define %nodefault %feature("nodefault","1")
|
||||
#define %default %feature("nodefault","0")
|
||||
#define %clearnodefault %feature("nodefault","")
|
||||
-#define %makedefault %cleardefault
|
||||
+#define %makedefault %clearnodefault
|
||||
|
||||
/* the %exception directive */
|
||||
|
||||
#ifdef SWIGCSHARP
|
||||
Index: Lib/swiginit.swg
|
||||
===================================================================
|
||||
RCS file: /cvsroot/swig/SWIG/Lib/swiginit.swg,v
|
||||
retrieving revision 1.5
|
||||
diff -u -4 -r1.5 swiginit.swg
|
||||
--- Lib/swiginit.swg 12 Sep 2005 23:25:03 -0000 1.5
|
||||
+++ Lib/swiginit.swg 29 Jan 2006 02:05:55 -0000
|
||||
@@ -40,14 +40,19 @@
|
||||
**/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
+#if 0
|
||||
+} /* c-mode */
|
||||
+#endif
|
||||
+#endif
|
||||
+
|
||||
+#if 0
|
||||
+#define SWIGRUNTIME_DEBUG
|
||||
#endif
|
||||
|
||||
SWIGRUNTIME void
|
||||
SWIG_InitializeModule(void *clientdata) {
|
||||
- swig_type_info *type, *ret;
|
||||
- swig_cast_info *cast;
|
||||
size_t i;
|
||||
swig_module_info *module_head;
|
||||
static int init_run = 0;
|
||||
|
||||
@@ -71,18 +76,35 @@
|
||||
SWIG_SetModule(clientdata, &swig_module);
|
||||
}
|
||||
|
||||
/* Now work on filling in swig_module.types */
|
||||
+#ifdef SWIGRUNTIME_DEBUG
|
||||
+ printf("SWIG_InitializeModule: size %d\n", swig_module.size);
|
||||
+#endif
|
||||
for (i = 0; i < swig_module.size; ++i) {
|
||||
- type = 0;
|
||||
+ swig_type_info *type = 0;
|
||||
+ swig_type_info *ret;
|
||||
+ swig_cast_info *cast;
|
||||
+
|
||||
+#ifdef SWIGRUNTIME_DEBUG
|
||||
+ printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
|
||||
+#endif
|
||||
|
||||
/* if there is another module already loaded */
|
||||
if (swig_module.next != &swig_module) {
|
||||
type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
|
||||
}
|
||||
if (type) {
|
||||
/* Overwrite clientdata field */
|
||||
- if (swig_module.type_initial[i]->clientdata) type->clientdata = swig_module.type_initial[i]->clientdata;
|
||||
+#ifdef SWIGRUNTIME_DEBUG
|
||||
+ printf("SWIG_InitializeModule: found type %s\n", type->name);
|
||||
+#endif
|
||||
+ if (swig_module.type_initial[i]->clientdata) {
|
||||
+ type->clientdata = swig_module.type_initial[i]->clientdata;
|
||||
+#ifdef SWIGRUNTIME_DEBUG
|
||||
+ printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
|
||||
+#endif
|
||||
+ }
|
||||
} else {
|
||||
type = swig_module.type_initial[i];
|
||||
}
|
||||
|
||||
@@ -91,31 +113,66 @@
|
||||
while (cast->type) {
|
||||
|
||||
/* Don't need to add information already in the list */
|
||||
ret = 0;
|
||||
+#ifdef SWIGRUNTIME_DEBUG
|
||||
+ printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
|
||||
+#endif
|
||||
if (swig_module.next != &swig_module) {
|
||||
ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
|
||||
+#ifdef SWIGRUNTIME_DEBUG
|
||||
+ if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
|
||||
+#endif
|
||||
}
|
||||
- if (ret && type == swig_module.type_initial[i]) {
|
||||
- cast->type = ret;
|
||||
- ret = 0;
|
||||
+ if (ret) {
|
||||
+ if (type == swig_module.type_initial[i]) {
|
||||
+#ifdef SWIGRUNTIME_DEBUG
|
||||
+ printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
|
||||
+#endif
|
||||
+ cast->type = ret;
|
||||
+ ret = 0;
|
||||
+ } else {
|
||||
+ /* Check for casting already in the list */
|
||||
+ swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
|
||||
+#ifdef SWIGRUNTIME_DEBUG
|
||||
+ if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
|
||||
+#endif
|
||||
+ if (!ocast) ret = 0;
|
||||
+ }
|
||||
}
|
||||
-
|
||||
+
|
||||
if (!ret) {
|
||||
+#ifdef SWIGRUNTIME_DEBUG
|
||||
+ printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
|
||||
+#endif
|
||||
if (type->cast) {
|
||||
type->cast->prev = cast;
|
||||
cast->next = type->cast;
|
||||
}
|
||||
type->cast = cast;
|
||||
}
|
||||
-
|
||||
cast++;
|
||||
}
|
||||
-
|
||||
/* Set entry in modules->types array equal to the type */
|
||||
swig_module.types[i] = type;
|
||||
}
|
||||
swig_module.types[i] = 0;
|
||||
+
|
||||
+#ifdef SWIGRUNTIME_DEBUG
|
||||
+ printf("**** SWIG_InitializeModule: Cast List ******\n");
|
||||
+ for (i = 0; i < swig_module.size; ++i) {
|
||||
+ int j = 0;
|
||||
+ swig_cast_info *cast = swig_module.cast_initial[i];
|
||||
+ printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
|
||||
+ while (cast->type) {
|
||||
+ printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
|
||||
+ cast++;
|
||||
+ ++j;
|
||||
+ }
|
||||
+ printf("---- Total casts: %d\n",j);
|
||||
+ }
|
||||
+ printf("**** SWIG_InitializeModule: Cast List ******\n");
|
||||
+#endif
|
||||
}
|
||||
|
||||
/* This function will propagate the clientdata field of type to
|
||||
* any new swig_type_info structures that have been added into the list
|
||||
@@ -145,6 +202,9 @@
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
+#if 0
|
||||
+{ /* c-mode */
|
||||
+#endif
|
||||
}
|
||||
#endif
|
||||
Index: Source/Modules/python.cxx
|
||||
===================================================================
|
||||
RCS file: /cvsroot/swig/SWIG/Source/Modules/python.cxx,v
|
||||
retrieving revision 1.107
|
||||
diff -u -4 -r1.107 python.cxx
|
||||
--- Source/Modules/python.cxx 7 Oct 2005 13:17:41 -0000 1.107
|
||||
+++ Source/Modules/python.cxx 29 Jan 2006 02:05:56 -0000
|
||||
@@ -36,9 +36,8 @@
|
||||
static File *f_directors_h = 0;
|
||||
static File *f_init = 0;
|
||||
static File *f_shadow_py = 0;
|
||||
static String *f_shadow = 0;
|
||||
-static String *f_shadow_imports = 0;
|
||||
static String *f_shadow_stubs = 0;
|
||||
|
||||
static String *methods;
|
||||
static String *class_name;
|
||||
@@ -281,8 +280,20 @@
|
||||
Swig_banner(f_runtime);
|
||||
|
||||
Printf(f_runtime,"#define SWIGPYTHON\n");
|
||||
|
||||
+ String *package_version = NewString(PACKAGE_VERSION);
|
||||
+ char *token = strtok(Char(package_version), ".");
|
||||
+ String *vers = NewString("#define SWIG_VERSION 0x");
|
||||
+ while (token) {
|
||||
+ int len = strlen(token);
|
||||
+ Printf(vers, "%s%s", (len == 1) ? "0" : "", token);
|
||||
+ token = strtok(NULL, ".");
|
||||
+ }
|
||||
+ Printf(f_runtime, "%s\n", vers);
|
||||
+ Delete(package_version);
|
||||
+ Delete(vers);
|
||||
+
|
||||
if (directorsEnabled()) {
|
||||
Printf(f_runtime,"#define SWIG_DIRECTORS\n");
|
||||
}
|
||||
|
||||
@@ -322,9 +333,8 @@
|
||||
}
|
||||
Delete(filen); filen = NULL;
|
||||
|
||||
f_shadow = NewString("");
|
||||
- f_shadow_imports = NewString("");
|
||||
f_shadow_stubs = NewString("");
|
||||
|
||||
Swig_register_filebyname("shadow",f_shadow);
|
||||
Swig_register_filebyname("python",f_shadow);
|
||||
@@ -343,8 +353,10 @@
|
||||
if (mod_docstring && Len(mod_docstring)) {
|
||||
Printv(f_shadow, "\n\"\"\"\n", mod_docstring, "\n\"\"\"\n", NIL);
|
||||
Delete(mod_docstring); mod_docstring = NULL;
|
||||
}
|
||||
+
|
||||
+ Printf(f_shadow,"\nimport %s\n\n", module);
|
||||
|
||||
/* if (!modern) */
|
||||
/* always needed, a class can be forced to be no-modern, such as an exception */
|
||||
{
|
||||
@@ -445,10 +457,8 @@
|
||||
Printf(f_wrappers,"}\n");
|
||||
Printf(f_wrappers,"#endif\n");
|
||||
|
||||
if (shadow) {
|
||||
- Printf(f_shadow_imports,"\nimport %s\n", module);
|
||||
- Printv(f_shadow_py, f_shadow_imports, "\n",NIL);
|
||||
Printv(f_shadow_py, f_shadow, "\n",NIL);
|
||||
Printv(f_shadow_py, f_shadow_stubs, "\n",NIL);
|
||||
|
||||
Close(f_shadow_py);
|
||||
@@ -507,12 +517,9 @@
|
||||
}
|
||||
|
||||
// finally, output the name of the imported module
|
||||
Printf(import, "%s\n", modname);
|
||||
-
|
||||
- if (!Strstr(f_shadow_imports, import)) {
|
||||
- Printf(f_shadow_imports, "%s", import);
|
||||
- }
|
||||
+ Printf(f_shadow, "%s", import);
|
||||
Delete(import);
|
||||
}
|
||||
}
|
||||
return Language::importDirective(n);
|
||||
@@ -774,10 +781,15 @@
|
||||
|
||||
// Do the param type too?
|
||||
if (showTypes) {
|
||||
type = SwigType_base(type);
|
||||
- lookup = Swig_symbol_clookup(type, 0);
|
||||
- if (lookup) type = Getattr(lookup, "sym:name");
|
||||
+ SwigType* qt = SwigType_typedef_resolve_all(type);
|
||||
+ if (SwigType_isenum(qt))
|
||||
+ type = NewString("int");
|
||||
+ else {
|
||||
+ lookup = Swig_symbol_clookup(type, 0);
|
||||
+ if (lookup) type = Getattr(lookup, "sym:name");
|
||||
+ }
|
||||
Printf(doc, "%s ", type);
|
||||
}
|
||||
|
||||
if (name) {
|
157
wxPython/b
157
wxPython/b
@@ -1,157 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Are we using bash on win32? If so source that file and then exit.
|
||||
if [ "$OSTYPE" = "cygwin" ]; then
|
||||
source b.win32
|
||||
exit
|
||||
fi
|
||||
|
||||
|
||||
function getpyver {
|
||||
if [ "$1" = "15" ]; then
|
||||
PYVER=1.5
|
||||
elif [ "$1" = "20" ]; then
|
||||
PYVER=2.0
|
||||
elif [ "$1" = "21" ]; then
|
||||
PYVER=2.1
|
||||
elif [ "$1" = "22" ]; then
|
||||
PYVER=2.2
|
||||
elif [ "$1" = "23" ]; then
|
||||
PYVER=2.3
|
||||
elif [ "$1" = "24" ]; then
|
||||
PYVER=2.4
|
||||
else
|
||||
echo You must specify Python version as first parameter.
|
||||
exit
|
||||
fi
|
||||
}
|
||||
|
||||
getpyver $1
|
||||
shift
|
||||
|
||||
python$PYVER -c "import sys;print '\n', sys.version, '\n'"
|
||||
|
||||
|
||||
SETUP="python$PYVER -u setup.py"
|
||||
FLAGS="USE_SWIG=1 SWIG=/opt/swig/bin/swig"
|
||||
OTHERFLAGS=""
|
||||
PORTFLAGS=""
|
||||
UNIFLAG="UNICODE=1"
|
||||
|
||||
|
||||
|
||||
if [ "$1" = "gtk1" -o "$1" = "gtk" ]; then
|
||||
PORTFLAGS="WXPORT=gtk"
|
||||
UNIFLAG="UNICODE=0"
|
||||
shift
|
||||
elif [ "$1" = "gtk2" ]; then
|
||||
PORTFLAGS="WXPORT=gtk2"
|
||||
UNIFLAG="UNICODE=1"
|
||||
shift
|
||||
fi
|
||||
|
||||
for p in $*; do
|
||||
if [ "$p" = "UNICODE=0" -o "$p" = "UNICODE=1" ]; then
|
||||
UNIFLAG=""
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
FLAGS="$FLAGS $PORTFLAGS $UNIFLAG"
|
||||
|
||||
|
||||
|
||||
|
||||
# "c" --> clean
|
||||
if [ "$1" = "c" ]; then
|
||||
shift
|
||||
CMD="$SETUP $FLAGS $OTHERFLAGS clean $*"
|
||||
OTHERCMD="rm -f wx/*.so"
|
||||
|
||||
# "d" --> clean extension modules only
|
||||
elif [ "$1" = "d" ]; then
|
||||
shift
|
||||
CMD="rm -f wx/*.so"
|
||||
|
||||
# "t" --> touch *.i files
|
||||
elif [ "$1" = "t" ]; then
|
||||
shift
|
||||
CMD='find . -name "*.i" | xargs touch'
|
||||
|
||||
# "i" --> install
|
||||
elif [ "$1" = "i" ]; then
|
||||
shift
|
||||
CMD="$SETUP $FLAGS $OTHERFLAGS build_ext install $*"
|
||||
|
||||
# "s" --> source dist
|
||||
elif [ "$1" = "s" ]; then
|
||||
shift
|
||||
CMD="$SETUP $OTHERFLAGS sdist $*"
|
||||
|
||||
# "r" --> rpm dist
|
||||
elif [ "$1" = "r" ]; then
|
||||
WXPYVER=`python$PYVER -c "import setup;print setup.VERSION"`
|
||||
for VER in 21 22; do
|
||||
getpyver $VER
|
||||
|
||||
echo "*****************************************************************"
|
||||
echo "******* Building wxPython for Python $PYVER"
|
||||
echo "*****************************************************************"
|
||||
|
||||
SETUP="python$PYVER -u setup.py"
|
||||
|
||||
# save the original
|
||||
cp setup.py setup.py.save
|
||||
|
||||
# fix up setup.py the way we want...
|
||||
sed "s/BUILD_GLCANVAS = /BUILD_GLCANVAS = 0 #/" < setup.py.save > setup.py.temp
|
||||
sed "s/GL_ONLY = /GL_ONLY = 1 #/" < setup.py.temp > setup.py
|
||||
|
||||
# build wxPython-gl RPM
|
||||
$SETUP $OTHERFLAGS bdist_rpm --binary-only --doc-files README.txt --python=python$PYVER
|
||||
### --requires=python$PYVER
|
||||
rm dist/wxPython-gl*.tar.gz
|
||||
|
||||
# Build wxPython RPM
|
||||
cp setup.py setup.py.temp
|
||||
sed "s/GL_ONLY = /GL_ONLY = 0 #/" < setup.py.temp > setup.py
|
||||
$SETUP $OTHERFLAGS bdist_rpm --binary-only --python=python$PYVER
|
||||
### --requires=python$PYVER
|
||||
|
||||
# put the oringal setup.py back
|
||||
cp setup.py.save setup.py
|
||||
rm setup.py.*
|
||||
|
||||
# rename the binary RPM's
|
||||
mv dist/wxPython-$WXPYVER-1.i386.rpm dist/wxPython-$WXPYVER-1-Py$VER.i386.rpm
|
||||
mv dist/wxPython-gl-$WXPYVER-1.i386.rpm dist/wxPython-gl-$WXPYVER-1-Py$VER.i386.rpm
|
||||
|
||||
done
|
||||
|
||||
# rebuild the source dists without the munched up setup.py
|
||||
$SETUP $OTHERFLAGS bdist_rpm --source-only
|
||||
exit 0
|
||||
|
||||
|
||||
# "f" --> FINAL (no debug)
|
||||
elif [ "$1" = "f" ]; then
|
||||
shift
|
||||
CMD="$SETUP $FLAGS $OTHERFLAGS build_ext --inplace $*"
|
||||
|
||||
# (no command arg) --> normal build for development
|
||||
else
|
||||
CMD="$SETUP $FLAGS $OTHERFLAGS build_ext --inplace --debug $*"
|
||||
fi
|
||||
|
||||
|
||||
echo $CMD
|
||||
eval $CMD
|
||||
RC=$?
|
||||
|
||||
if [ "$RC" = "0" -a "$OTHERCMD" != "" ]; then
|
||||
echo $OTHERCMD
|
||||
$OTHERCMD
|
||||
RC=$?
|
||||
fi
|
||||
|
||||
exit $RC
|
@@ -1,3 +0,0 @@
|
||||
@echo off
|
||||
|
||||
call bash.bat -c "b.win32 %*"
|
131
wxPython/b.win32
131
wxPython/b.win32
@@ -1,131 +0,0 @@
|
||||
#!/bin/bash
|
||||
# ----------------------------------------------------------------------
|
||||
|
||||
# To Robin: I tried to avoid making any changes to the existing
|
||||
# build scripts, but my env requires me to specify Windows paths...
|
||||
# if this breaks something at your end, let me know and we can
|
||||
# figure out some solution for both of us.
|
||||
if [ "$SWIGDIR" = "" ]; then
|
||||
SWIGDIR=$PROJECTS\\SWIG-1.3.27
|
||||
fi
|
||||
|
||||
|
||||
# Use non-default python?
|
||||
case $1 in
|
||||
21 | 2.1) VER=21; shift ;;
|
||||
22 | 2.2) VER=22; shift ;;
|
||||
23 | 2.3) VER=23; shift ;;
|
||||
24 | 2.4) VER=24; shift ;;
|
||||
|
||||
*) VER=24
|
||||
esac
|
||||
|
||||
PYTHON=$TOOLS/python$VER/python.exe
|
||||
|
||||
SETUP="$PYTHON -u setup.py"
|
||||
$PYTHON -c "import sys;print '\n', sys.version, '\n'"
|
||||
|
||||
|
||||
FLAGS="USE_SWIG=1 SWIG=$SWIGDIR\\swig.exe"
|
||||
UNIFLAG="UNICODE=1"
|
||||
|
||||
for p in $*; do
|
||||
if [ "$p" = "UNICODE=0" -o "$p" = "UNICODE=1" ]; then
|
||||
UNIFLAG=""
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
FLAGS="$FLAGS $UNIFLAG"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# "c" --> clean
|
||||
if [ "$1" = "c" ]; then
|
||||
shift
|
||||
CMD="$SETUP $FLAGS clean $@"
|
||||
OTHERCMD="rm wx/*.pyd"
|
||||
|
||||
# just remove the *.pyd's
|
||||
elif [ "$1" = "d" ]; then
|
||||
shift
|
||||
CMD="rm wx/*.pyd"
|
||||
|
||||
# touch all the *.i files so swig will regenerate
|
||||
elif [ "$1" = "t" ]; then
|
||||
shift
|
||||
CMD=
|
||||
find . -name "*.i" | xargs -l touch
|
||||
|
||||
# "i" --> install
|
||||
elif [ "$1" = "i" ]; then
|
||||
shift
|
||||
CMD="$SETUP build install"
|
||||
|
||||
# "r" --> make installer
|
||||
elif [ "$1" = "r" ]; then
|
||||
shift
|
||||
CMD="$PYTHON -u distrib\make_installer.py $@"
|
||||
|
||||
# "s" --> source dist
|
||||
elif [ "$1" = "s" ]; then
|
||||
shift
|
||||
CMD="$SETUP sdist"
|
||||
|
||||
# "f" --> FINAL
|
||||
elif [ "$1" == "f" ]; then
|
||||
shift
|
||||
CMD="$SETUP $FLAGS FINAL=1 build_ext --inplace $@"
|
||||
|
||||
# "h" --> HYBRID
|
||||
elif [ "$1" = "h" ]; then
|
||||
shift
|
||||
CMD="$SETUP $FLAGS HYBRID=1 build_ext --inplace $@"
|
||||
|
||||
# "a" --> make all installers
|
||||
elif [ "$1" = "a" ]; then
|
||||
shift
|
||||
CMD=
|
||||
|
||||
# $0 22 d
|
||||
# $0 22 h
|
||||
# $0 22 r
|
||||
# $0 22 d UNICODE=1
|
||||
# $0 22 h UNICODE=1
|
||||
# $0 22 r UNICODE=1
|
||||
|
||||
$0 23 d
|
||||
$0 23 h
|
||||
$0 23 r
|
||||
$0 23 d UNICODE=1
|
||||
$0 23 h UNICODE=1
|
||||
$0 23 r UNICODE=1
|
||||
|
||||
|
||||
# "b" --> both debug and hybrid builds
|
||||
elif [ "$1" = "b" ]; then
|
||||
shift
|
||||
CMD="echo Finished!"
|
||||
$0 $VER $@
|
||||
$0 $VER h $@
|
||||
|
||||
# (no command arg) --> normal debug build for development
|
||||
else
|
||||
CMD="$SETUP $FLAGS HYBRID=0 build_ext --inplace --debug $@"
|
||||
fi
|
||||
|
||||
|
||||
|
||||
if [ "$CMD" != "" ]; then
|
||||
echo $CMD
|
||||
$CMD
|
||||
fi
|
||||
|
||||
if [ "$OTHERCMD" != "" ]; then
|
||||
echo $OTHERCMD
|
||||
$OTHERCMD
|
||||
fi
|
||||
|
1134
wxPython/config.py
1134
wxPython/config.py
File diff suppressed because it is too large
Load Diff
@@ -1 +0,0 @@
|
||||
update.log
|
@@ -1,3 +0,0 @@
|
||||
These sub directories contain add-on modules that are not part of the
|
||||
core wxPython, either because of licensing issues, optional code in
|
||||
wxWindows, contrib code in wxWindows, or whatever.
|
@@ -1,211 +0,0 @@
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Some helper and utility functions for ActiveX
|
||||
|
||||
|
||||
t4 = " " * 4
|
||||
t8 = " " * 8
|
||||
|
||||
def GetAXInfo(ax):
|
||||
"""
|
||||
Returns a printable summary of the TypeInfo from the ActiveX instance
|
||||
passed in.
|
||||
"""
|
||||
|
||||
def ProcessFuncX(f, out, name):
|
||||
out.append(name)
|
||||
out.append(t4 + "retType: %s" % f.retType.vt_type)
|
||||
if f.params:
|
||||
out.append(t4 + "params:")
|
||||
for p in f.params:
|
||||
out.append(t8 + p.name)
|
||||
out.append(t8+t4+ "in:%s out:%s optional:%s type:%s" % (p.isIn, p.isOut, p.isOptional, p.vt_type))
|
||||
out.append('')
|
||||
|
||||
def ProcessPropX(p, out):
|
||||
out.append(GernerateAXModule.trimPropName(p.name))
|
||||
out.append(t4+ "type:%s arg:%s canGet:%s canSet:%s" % (p.type.vt_type, p.arg.vt_type, p.canGet, p.canSet))
|
||||
out.append('')
|
||||
|
||||
out = []
|
||||
|
||||
out.append("PROPERTIES")
|
||||
out.append("-"*20)
|
||||
for p in ax.GetAXProperties():
|
||||
ProcessPropX(p, out)
|
||||
out.append('\n\n')
|
||||
|
||||
out.append("METHODS")
|
||||
out.append("-"*20)
|
||||
for m in ax.GetAXMethods():
|
||||
ProcessFuncX(m, out, GernerateAXModule.trimMethodName(m.name))
|
||||
out.append('\n\n')
|
||||
|
||||
out.append("EVENTS")
|
||||
out.append("-"*20)
|
||||
for e in ax.GetAXEvents():
|
||||
ProcessFuncX(e, out, GernerateAXModule.trimEventName(e.name))
|
||||
out.append('\n\n')
|
||||
|
||||
return "\n".join(out)
|
||||
|
||||
|
||||
|
||||
class GernerateAXModule:
|
||||
def __init__(self, ax, className, modulePath, moduleName=None, verbose=False):
|
||||
"""
|
||||
Make a Python module file with a class that has been specialized
|
||||
for the AcitveX object.
|
||||
|
||||
ax An instance of the ActiveXWindow class
|
||||
className The name to use for the new class
|
||||
modulePath The path where the new module should be written to
|
||||
moduleName The name of the .py file to create. If not given
|
||||
then the className will be used.
|
||||
"""
|
||||
import os
|
||||
if moduleName is None:
|
||||
moduleName = className + '.py'
|
||||
filename = os.path.join(modulePath, moduleName)
|
||||
if verbose:
|
||||
print "Creating module in:", filename
|
||||
print " ProgID: ", ax.GetCLSID().GetProgIDString()
|
||||
print " CLSID: ", ax.GetCLSID().GetCLSIDString()
|
||||
print
|
||||
self.mf = file(filename, "w")
|
||||
self.WriteFileHeader(ax)
|
||||
self.WriteEvents(ax)
|
||||
self.WriteClassHeader(ax, className)
|
||||
self.WriteMethods(ax)
|
||||
self.WriteProperties(ax)
|
||||
self.WriteDocs(ax)
|
||||
self.mf.close()
|
||||
del self.mf
|
||||
|
||||
|
||||
def WriteFileHeader(self, ax):
|
||||
self.write("# This module was generated by the wx.activex.GernerateAXModule class\n"
|
||||
"# (See also the genaxmodule script.)\n")
|
||||
self.write("import wx")
|
||||
self.write("import wx.activex\n")
|
||||
self.write("clsID = '%s'\nprogID = '%s'\n"
|
||||
% (ax.GetCLSID().GetCLSIDString(), ax.GetCLSID().GetProgIDString()))
|
||||
self.write("\n")
|
||||
|
||||
|
||||
def WriteEvents(self, ax):
|
||||
events = ax.GetAXEvents()
|
||||
if events:
|
||||
self.write("# Create eventTypes and event binders")
|
||||
for e in events:
|
||||
self.write("wxEVT_%s = wx.activex.RegisterActiveXEvent('%s')"
|
||||
% (self.trimEventName(e.name), e.name))
|
||||
self.write()
|
||||
for e in events:
|
||||
n = self.trimEventName(e.name)
|
||||
self.write("EVT_%s = wx.PyEventBinder(wxEVT_%s, 1)" % (n,n))
|
||||
self.write("\n")
|
||||
|
||||
|
||||
def WriteClassHeader(self, ax, className):
|
||||
self.write("# Derive a new class from ActiveXWindow")
|
||||
self.write("""\
|
||||
class %s(wx.activex.ActiveXWindow):
|
||||
def __init__(self, parent, ID=-1, pos=wx.DefaultPosition,
|
||||
size=wx.DefaultSize, style=0, name='%s'):
|
||||
wx.activex.ActiveXWindow.__init__(self, parent,
|
||||
wx.activex.CLSID('%s'),
|
||||
ID, pos, size, style, name)
|
||||
""" % (className, className, ax.GetCLSID().GetCLSIDString()) )
|
||||
|
||||
|
||||
def WriteMethods(self, ax):
|
||||
methods = ax.GetAXMethods()
|
||||
if methods:
|
||||
self.write(t4, "# Methods exported by the ActiveX object")
|
||||
for m in methods:
|
||||
name = self.trimMethodName(m.name)
|
||||
self.write(t4, "def %s(self%s):" % (name, self.getParameters(m, True)))
|
||||
self.write(t8, "return self.CallAXMethod('%s'%s)" % (m.name, self.getParameters(m, False)))
|
||||
self.write()
|
||||
|
||||
|
||||
def WriteProperties(self, ax):
|
||||
props = ax.GetAXProperties()
|
||||
if props:
|
||||
self.write(t4, "# Getters, Setters and properties")
|
||||
for p in props:
|
||||
getterName = setterName = "None"
|
||||
if p.canGet:
|
||||
getterName = "_get_" + p.name
|
||||
self.write(t4, "def %s(self):" % getterName)
|
||||
self.write(t8, "return self.GetAXProp('%s')" % p.name)
|
||||
if p.canSet:
|
||||
setterName = "_set_" + p.name
|
||||
self.write(t4, "def %s(self, %s):" % (setterName, p.arg.name))
|
||||
self.write(t8, "self.SetAXProp('%s', %s)" % (p.name, p.arg.name))
|
||||
|
||||
self.write(t4, "%s = property(%s, %s)" %
|
||||
(self.trimPropName(p.name), getterName, setterName))
|
||||
self.write()
|
||||
|
||||
|
||||
def WriteDocs(self, ax):
|
||||
self.write()
|
||||
doc = GetAXInfo(ax)
|
||||
for line in doc.split('\n'):
|
||||
self.write("# ", line)
|
||||
|
||||
|
||||
|
||||
def write(self, *args):
|
||||
for a in args:
|
||||
self.mf.write(a)
|
||||
self.mf.write("\n")
|
||||
|
||||
|
||||
def trimEventName(name):
|
||||
if name.startswith("On"):
|
||||
name = name[2:]
|
||||
return name
|
||||
trimEventName = staticmethod(trimEventName)
|
||||
|
||||
|
||||
def trimPropName(name):
|
||||
#name = name[0].lower() + name[1:]
|
||||
name = name.lower()
|
||||
import keyword
|
||||
if name in keyword.kwlist: name += '_'
|
||||
return name
|
||||
trimPropName = staticmethod(trimPropName)
|
||||
|
||||
|
||||
def trimMethodName(name):
|
||||
import keyword
|
||||
if name in keyword.kwlist: name += '_'
|
||||
return name
|
||||
trimMethodName = staticmethod(trimMethodName)
|
||||
|
||||
|
||||
def getParameters(self, m, withDefaults):
|
||||
import keyword
|
||||
st = ""
|
||||
# collect the input parameters, if both isIn and isOut are
|
||||
# False then assume it is an input paramater
|
||||
params = []
|
||||
for p in m.params:
|
||||
if p.isIn or (not p.isIn and not p.isOut):
|
||||
params.append(p)
|
||||
# did we get any?
|
||||
for p in params:
|
||||
name = p.name
|
||||
if name in keyword.kwlist: name += '_'
|
||||
st += ", "
|
||||
st += name
|
||||
if withDefaults and p.isOptional:
|
||||
st += '=None'
|
||||
return st
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------
|
@@ -1,16 +0,0 @@
|
||||
// A bunch of %rename directives generated by BuildRenamers in config.py
|
||||
// in order to remove the wx prefix from all global scope names.
|
||||
|
||||
#ifndef BUILDING_RENAMERS
|
||||
|
||||
%rename(ParamX) wxParamX;
|
||||
%rename(FuncX) wxFuncX;
|
||||
%rename(PropX) wxPropX;
|
||||
%rename(ParamXArray) wxParamXArray;
|
||||
%rename(FuncXArray) wxFuncXArray;
|
||||
%rename(PropXArray) wxPropXArray;
|
||||
%rename(ActiveXWindow) wxActiveXWindow;
|
||||
%rename(ActiveXEvent) wxActiveXEvent;
|
||||
%rename(IEHtmlWindowBase) wxIEHtmlWindowBase;
|
||||
|
||||
#endif
|
@@ -1,2 +0,0 @@
|
||||
|
||||
EVT*
|
File diff suppressed because it is too large
Load Diff
@@ -1,670 +0,0 @@
|
||||
# This file was created automatically by SWIG 1.3.27.
|
||||
# Don't modify this file, modify the SWIG interface instead.
|
||||
|
||||
import _activex
|
||||
|
||||
def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
|
||||
if (name == "this"):
|
||||
if isinstance(value, class_type):
|
||||
self.__dict__[name] = value.this
|
||||
if hasattr(value,"thisown"): self.__dict__["thisown"] = value.thisown
|
||||
del value.thisown
|
||||
return
|
||||
method = class_type.__swig_setmethods__.get(name,None)
|
||||
if method: return method(self,value)
|
||||
if (not static) or hasattr(self,name) or (name == "thisown"):
|
||||
self.__dict__[name] = value
|
||||
else:
|
||||
raise AttributeError("You cannot add attributes to %s" % self)
|
||||
|
||||
def _swig_setattr(self,class_type,name,value):
|
||||
return _swig_setattr_nondynamic(self,class_type,name,value,0)
|
||||
|
||||
def _swig_getattr(self,class_type,name):
|
||||
method = class_type.__swig_getmethods__.get(name,None)
|
||||
if method: return method(self)
|
||||
raise AttributeError,name
|
||||
|
||||
import types
|
||||
try:
|
||||
_object = types.ObjectType
|
||||
_newclass = 1
|
||||
except AttributeError:
|
||||
class _object : pass
|
||||
_newclass = 0
|
||||
del types
|
||||
|
||||
|
||||
def _swig_setattr_nondynamic_method(set):
|
||||
def set_attr(self,name,value):
|
||||
if hasattr(self,name) or (name in ("this", "thisown")):
|
||||
set(self,name,value)
|
||||
else:
|
||||
raise AttributeError("You cannot add attributes to %s" % self)
|
||||
return set_attr
|
||||
|
||||
|
||||
import _core
|
||||
wx = _core
|
||||
__docfilter__ = wx.__DocFilter(globals())
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
class CLSID(object):
|
||||
"""
|
||||
This class wraps the Windows CLSID structure and is used to
|
||||
specify the class of the ActiveX object that is to be created. A
|
||||
CLSID can be constructed from either a ProgID string, (such as
|
||||
'WordPad.Document.1') or a classID string, (such as
|
||||
'{CA8A9783-280D-11CF-A24D-444553540000}').
|
||||
"""
|
||||
def __repr__(self):
|
||||
return "<%s.%s; proxy of C++ CLSID instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
|
||||
def __init__(self, *args, **kwargs):
|
||||
"""
|
||||
__init__(self, String id) -> CLSID
|
||||
|
||||
This class wraps the Windows CLSID structure and is used to
|
||||
specify the class of the ActiveX object that is to be created. A
|
||||
CLSID can be constructed from either a ProgID string, (such as
|
||||
'WordPad.Document.1') or a classID string, (such as
|
||||
'{CA8A9783-280D-11CF-A24D-444553540000}').
|
||||
"""
|
||||
newobj = _activex.new_CLSID(*args, **kwargs)
|
||||
self.this = newobj.this
|
||||
self.thisown = 1
|
||||
del newobj.thisown
|
||||
def __del__(self, destroy=_activex.delete_CLSID):
|
||||
"""__del__(self)"""
|
||||
try:
|
||||
if self.thisown: destroy(self)
|
||||
except: pass
|
||||
|
||||
def GetCLSIDString(*args, **kwargs):
|
||||
"""GetCLSIDString(self) -> String"""
|
||||
return _activex.CLSID_GetCLSIDString(*args, **kwargs)
|
||||
|
||||
def GetProgIDString(*args, **kwargs):
|
||||
"""GetProgIDString(self) -> String"""
|
||||
return _activex.CLSID_GetProgIDString(*args, **kwargs)
|
||||
|
||||
def __str__(self): return self.GetCLSIDString()
|
||||
|
||||
class CLSIDPtr(CLSID):
|
||||
def __init__(self, this):
|
||||
self.this = this
|
||||
if not hasattr(self,"thisown"): self.thisown = 0
|
||||
self.__class__ = CLSID
|
||||
_activex.CLSID_swigregister(CLSIDPtr)
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
class ParamX(object):
|
||||
"""Proxy of C++ ParamX class"""
|
||||
def __init__(self): raise RuntimeError, "No constructor defined"
|
||||
def __repr__(self):
|
||||
return "<%s.%s; proxy of C++ wxParamX instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
|
||||
flags = property(_activex.ParamX_flags_get)
|
||||
isPtr = property(_activex.ParamX_isPtr_get)
|
||||
isSafeArray = property(_activex.ParamX_isSafeArray_get)
|
||||
isOptional = property(_activex.ParamX_isOptional_get)
|
||||
vt = property(_activex.ParamX_vt_get)
|
||||
name = property(_activex.ParamX_name_get)
|
||||
vt_type = property(_activex.ParamX_vt_type_get)
|
||||
|
||||
isIn = property(_activex.ParamX_IsIn)
|
||||
|
||||
isOut = property(_activex.ParamX_IsOut)
|
||||
|
||||
isRetVal = property(_activex.ParamX_IsRetVal)
|
||||
|
||||
|
||||
class ParamXPtr(ParamX):
|
||||
def __init__(self, this):
|
||||
self.this = this
|
||||
if not hasattr(self,"thisown"): self.thisown = 0
|
||||
self.__class__ = ParamX
|
||||
_activex.ParamX_swigregister(ParamXPtr)
|
||||
|
||||
class FuncX(object):
|
||||
"""Proxy of C++ FuncX class"""
|
||||
def __init__(self): raise RuntimeError, "No constructor defined"
|
||||
def __repr__(self):
|
||||
return "<%s.%s; proxy of C++ wxFuncX instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
|
||||
name = property(_activex.FuncX_name_get)
|
||||
memid = property(_activex.FuncX_memid_get)
|
||||
hasOut = property(_activex.FuncX_hasOut_get)
|
||||
retType = property(_activex.FuncX_retType_get)
|
||||
params = property(_activex.FuncX_params_get)
|
||||
|
||||
class FuncXPtr(FuncX):
|
||||
def __init__(self, this):
|
||||
self.this = this
|
||||
if not hasattr(self,"thisown"): self.thisown = 0
|
||||
self.__class__ = FuncX
|
||||
_activex.FuncX_swigregister(FuncXPtr)
|
||||
|
||||
class PropX(object):
|
||||
"""Proxy of C++ PropX class"""
|
||||
def __init__(self): raise RuntimeError, "No constructor defined"
|
||||
def __repr__(self):
|
||||
return "<%s.%s; proxy of C++ wxPropX instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
|
||||
name = property(_activex.PropX_name_get)
|
||||
memid = property(_activex.PropX_memid_get)
|
||||
type = property(_activex.PropX_type_get)
|
||||
arg = property(_activex.PropX_arg_get)
|
||||
putByRef = property(_activex.PropX_putByRef_get)
|
||||
canGet = property(_activex.PropX_CanGet)
|
||||
|
||||
canSet = property(_activex.PropX_CanSet)
|
||||
|
||||
|
||||
class PropXPtr(PropX):
|
||||
def __init__(self, this):
|
||||
self.this = this
|
||||
if not hasattr(self,"thisown"): self.thisown = 0
|
||||
self.__class__ = PropX
|
||||
_activex.PropX_swigregister(PropXPtr)
|
||||
|
||||
class ParamXArray(object):
|
||||
"""Proxy of C++ ParamXArray class"""
|
||||
def __init__(self): raise RuntimeError, "No constructor defined"
|
||||
def __repr__(self):
|
||||
return "<%s.%s; proxy of C++ wxParamXArray instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
|
||||
def __nonzero__(*args, **kwargs):
|
||||
"""__nonzero__(self) -> bool"""
|
||||
return _activex.ParamXArray___nonzero__(*args, **kwargs)
|
||||
|
||||
def __len__(*args, **kwargs):
|
||||
"""__len__(self) -> int"""
|
||||
return _activex.ParamXArray___len__(*args, **kwargs)
|
||||
|
||||
def __getitem__(*args, **kwargs):
|
||||
"""__getitem__(self, int idx) -> ParamX"""
|
||||
return _activex.ParamXArray___getitem__(*args, **kwargs)
|
||||
|
||||
|
||||
class ParamXArrayPtr(ParamXArray):
|
||||
def __init__(self, this):
|
||||
self.this = this
|
||||
if not hasattr(self,"thisown"): self.thisown = 0
|
||||
self.__class__ = ParamXArray
|
||||
_activex.ParamXArray_swigregister(ParamXArrayPtr)
|
||||
|
||||
class FuncXArray(object):
|
||||
"""Proxy of C++ FuncXArray class"""
|
||||
def __init__(self): raise RuntimeError, "No constructor defined"
|
||||
def __repr__(self):
|
||||
return "<%s.%s; proxy of C++ wxFuncXArray instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
|
||||
def __nonzero__(*args, **kwargs):
|
||||
"""__nonzero__(self) -> bool"""
|
||||
return _activex.FuncXArray___nonzero__(*args, **kwargs)
|
||||
|
||||
def __len__(*args, **kwargs):
|
||||
"""__len__(self) -> int"""
|
||||
return _activex.FuncXArray___len__(*args, **kwargs)
|
||||
|
||||
def __getitem__(*args, **kwargs):
|
||||
"""__getitem__(self, int idx) -> FuncX"""
|
||||
return _activex.FuncXArray___getitem__(*args, **kwargs)
|
||||
|
||||
|
||||
class FuncXArrayPtr(FuncXArray):
|
||||
def __init__(self, this):
|
||||
self.this = this
|
||||
if not hasattr(self,"thisown"): self.thisown = 0
|
||||
self.__class__ = FuncXArray
|
||||
_activex.FuncXArray_swigregister(FuncXArrayPtr)
|
||||
|
||||
class PropXArray(object):
|
||||
"""Proxy of C++ PropXArray class"""
|
||||
def __init__(self): raise RuntimeError, "No constructor defined"
|
||||
def __repr__(self):
|
||||
return "<%s.%s; proxy of C++ wxPropXArray instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
|
||||
def __nonzero__(*args, **kwargs):
|
||||
"""__nonzero__(self) -> bool"""
|
||||
return _activex.PropXArray___nonzero__(*args, **kwargs)
|
||||
|
||||
def __len__(*args, **kwargs):
|
||||
"""__len__(self) -> int"""
|
||||
return _activex.PropXArray___len__(*args, **kwargs)
|
||||
|
||||
def __getitem__(*args, **kwargs):
|
||||
"""__getitem__(self, int idx) -> PropX"""
|
||||
return _activex.PropXArray___getitem__(*args, **kwargs)
|
||||
|
||||
|
||||
class PropXArrayPtr(PropXArray):
|
||||
def __init__(self, this):
|
||||
self.this = this
|
||||
if not hasattr(self,"thisown"): self.thisown = 0
|
||||
self.__class__ = PropXArray
|
||||
_activex.PropXArray_swigregister(PropXArrayPtr)
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
class ActiveXWindow(_core.Window):
|
||||
"""
|
||||
ActiveXWindow derives from wxWindow and the constructor accepts a
|
||||
CLSID for the ActiveX Control that should be created. The
|
||||
ActiveXWindow class simply adds methods that allow you to query
|
||||
some of the TypeInfo exposed by the ActiveX object, and also to
|
||||
get/set properties or call methods by name. The Python
|
||||
implementation automatically handles converting parameters and
|
||||
return values to/from the types expected by the ActiveX code as
|
||||
specified by the TypeInfo.
|
||||
|
||||
"""
|
||||
def __repr__(self):
|
||||
return "<%s.%s; proxy of C++ wxActiveXWindow instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
|
||||
def __init__(self, *args, **kwargs):
|
||||
"""
|
||||
__init__(self, Window parent, CLSID clsId, int id=-1, Point pos=DefaultPosition,
|
||||
Size size=DefaultSize, long style=0,
|
||||
String name=PanelNameStr) -> ActiveXWindow
|
||||
|
||||
Creates an ActiveX control from the clsID given and makes it act
|
||||
as much like a regular wx.Window as possible.
|
||||
"""
|
||||
newobj = _activex.new_ActiveXWindow(*args, **kwargs)
|
||||
self.this = newobj.this
|
||||
self.thisown = 1
|
||||
del newobj.thisown
|
||||
self._setOORInfo(self)
|
||||
|
||||
def GetCLSID(*args, **kwargs):
|
||||
"""
|
||||
GetCLSID(self) -> CLSID
|
||||
|
||||
Return the CLSID used to construct this ActiveX window
|
||||
"""
|
||||
return _activex.ActiveXWindow_GetCLSID(*args, **kwargs)
|
||||
|
||||
def GetAXEventCount(*args, **kwargs):
|
||||
"""
|
||||
GetAXEventCount(self) -> int
|
||||
|
||||
Number of events defined for this control
|
||||
"""
|
||||
return _activex.ActiveXWindow_GetAXEventCount(*args, **kwargs)
|
||||
|
||||
def GetAXEventDesc(*args, **kwargs):
|
||||
"""
|
||||
GetAXEventDesc(self, int idx) -> FuncX
|
||||
|
||||
Returns event description by index
|
||||
"""
|
||||
return _activex.ActiveXWindow_GetAXEventDesc(*args, **kwargs)
|
||||
|
||||
def GetAXPropCount(*args, **kwargs):
|
||||
"""
|
||||
GetAXPropCount(self) -> int
|
||||
|
||||
Number of properties defined for this control
|
||||
"""
|
||||
return _activex.ActiveXWindow_GetAXPropCount(*args, **kwargs)
|
||||
|
||||
def GetAXPropDesc(*args):
|
||||
"""
|
||||
GetAXPropDesc(self, int idx) -> PropX
|
||||
GetAXPropDesc(self, String name) -> PropX
|
||||
"""
|
||||
return _activex.ActiveXWindow_GetAXPropDesc(*args)
|
||||
|
||||
def GetAXMethodCount(*args, **kwargs):
|
||||
"""
|
||||
GetAXMethodCount(self) -> int
|
||||
|
||||
Number of methods defined for this control
|
||||
"""
|
||||
return _activex.ActiveXWindow_GetAXMethodCount(*args, **kwargs)
|
||||
|
||||
def GetAXMethodDesc(*args):
|
||||
"""
|
||||
GetAXMethodDesc(self, int idx) -> FuncX
|
||||
GetAXMethodDesc(self, String name) -> FuncX
|
||||
"""
|
||||
return _activex.ActiveXWindow_GetAXMethodDesc(*args)
|
||||
|
||||
def GetAXEvents(*args, **kwargs):
|
||||
"""
|
||||
GetAXEvents(self) -> FuncXArray
|
||||
|
||||
Returns a sequence of FuncX objects describing the events
|
||||
available for this ActiveX object.
|
||||
"""
|
||||
return _activex.ActiveXWindow_GetAXEvents(*args, **kwargs)
|
||||
|
||||
def GetAXMethods(*args, **kwargs):
|
||||
"""
|
||||
GetAXMethods(self) -> FuncXArray
|
||||
|
||||
Returns a sequence of FuncX objects describing the methods
|
||||
available for this ActiveX object.
|
||||
"""
|
||||
return _activex.ActiveXWindow_GetAXMethods(*args, **kwargs)
|
||||
|
||||
def GetAXProperties(*args, **kwargs):
|
||||
"""
|
||||
GetAXProperties(self) -> PropXArray
|
||||
|
||||
Returns a sequence of PropX objects describing the properties
|
||||
available for this ActiveX object.
|
||||
"""
|
||||
return _activex.ActiveXWindow_GetAXProperties(*args, **kwargs)
|
||||
|
||||
def SetAXProp(*args, **kwargs):
|
||||
"""
|
||||
SetAXProp(self, String name, PyObject value)
|
||||
|
||||
Set a property of the ActiveX object by name.
|
||||
"""
|
||||
return _activex.ActiveXWindow_SetAXProp(*args, **kwargs)
|
||||
|
||||
def GetAXProp(*args, **kwargs):
|
||||
"""
|
||||
GetAXProp(self, String name) -> PyObject
|
||||
|
||||
Get the value of an ActiveX property by name.
|
||||
"""
|
||||
return _activex.ActiveXWindow_GetAXProp(*args, **kwargs)
|
||||
|
||||
def _CallAXMethod(*args):
|
||||
"""
|
||||
_CallAXMethod(self, String name, PyObject args) -> PyObject
|
||||
|
||||
The implementation for CallMethod. Calls an ActiveX method, by
|
||||
name passing the parameters given in args.
|
||||
"""
|
||||
return _activex.ActiveXWindow__CallAXMethod(*args)
|
||||
|
||||
def CallAXMethod(self, name, *args):
|
||||
"""
|
||||
Front-end for _CallMethod. Simply passes all positional args
|
||||
after the name as a single tuple to _CallMethod.
|
||||
"""
|
||||
return self._CallAXMethod(name, args)
|
||||
|
||||
|
||||
class ActiveXWindowPtr(ActiveXWindow):
|
||||
def __init__(self, this):
|
||||
self.this = this
|
||||
if not hasattr(self,"thisown"): self.thisown = 0
|
||||
self.__class__ = ActiveXWindow
|
||||
_activex.ActiveXWindow_swigregister(ActiveXWindowPtr)
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
|
||||
def RegisterActiveXEvent(*args, **kwargs):
|
||||
"""
|
||||
RegisterActiveXEvent(String eventName) -> wxEventType
|
||||
|
||||
Creates a standard wx event ID for the given eventName.
|
||||
"""
|
||||
return _activex.RegisterActiveXEvent(*args, **kwargs)
|
||||
class ActiveXEvent(_core.CommandEvent):
|
||||
"""
|
||||
An instance of ActiveXEvent is sent to the handler for all bound
|
||||
ActiveX events. Any event parameters from the ActiveX cntrol are
|
||||
turned into attributes of the Python proxy for this event object.
|
||||
Additionally, there is a property called eventName that will
|
||||
return (surprisingly <wink>) the name of the ActiveX event.
|
||||
"""
|
||||
def __init__(self): raise RuntimeError, "No constructor defined"
|
||||
def __repr__(self):
|
||||
return "<%s.%s; proxy of C++ wxActiveXEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
|
||||
eventName = property(_activex.ActiveXEvent_EventName)
|
||||
|
||||
def _preCallInit(*args, **kwargs):
|
||||
"""_preCallInit(self, PyObject pyself)"""
|
||||
return _activex.ActiveXEvent__preCallInit(*args, **kwargs)
|
||||
|
||||
def _postCallCleanup(*args, **kwargs):
|
||||
"""_postCallCleanup(self, PyObject pyself)"""
|
||||
return _activex.ActiveXEvent__postCallCleanup(*args, **kwargs)
|
||||
|
||||
|
||||
class ActiveXEventPtr(ActiveXEvent):
|
||||
def __init__(self, this):
|
||||
self.this = this
|
||||
if not hasattr(self,"thisown"): self.thisown = 0
|
||||
self.__class__ = ActiveXEvent
|
||||
_activex.ActiveXEvent_swigregister(ActiveXEventPtr)
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
class IEHtmlWindowBase(ActiveXWindow):
|
||||
def __repr__(self):
|
||||
return "<%s.%s; proxy of C++ wxIEHtmlWindowBase instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,)
|
||||
def __init__(self, *args, **kwargs):
|
||||
newobj = _activex.new_IEHtmlWindowBase(*args, **kwargs)
|
||||
self.this = newobj.this
|
||||
self.thisown = 1
|
||||
del newobj.thisown
|
||||
self._setOORInfo(self)
|
||||
|
||||
def SetCharset(*args, **kwargs): return _activex.IEHtmlWindowBase_SetCharset(*args, **kwargs)
|
||||
def LoadString(*args, **kwargs): return _activex.IEHtmlWindowBase_LoadString(*args, **kwargs)
|
||||
def LoadStream(*args, **kwargs): return _activex.IEHtmlWindowBase_LoadStream(*args, **kwargs)
|
||||
def GetStringSelection(*args, **kwargs): return _activex.IEHtmlWindowBase_GetStringSelection(*args, **kwargs)
|
||||
def GetText(*args, **kwargs): return _activex.IEHtmlWindowBase_GetText(*args, **kwargs)
|
||||
|
||||
class IEHtmlWindowBasePtr(IEHtmlWindowBase):
|
||||
def __init__(self, this):
|
||||
self.this = this
|
||||
if not hasattr(self,"thisown"): self.thisown = 0
|
||||
self.__class__ = IEHtmlWindowBase
|
||||
_activex.IEHtmlWindowBase_swigregister(IEHtmlWindowBasePtr)
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Some helper and utility functions for ActiveX
|
||||
|
||||
|
||||
t4 = " " * 4
|
||||
t8 = " " * 8
|
||||
|
||||
def GetAXInfo(ax):
|
||||
"""
|
||||
Returns a printable summary of the TypeInfo from the ActiveX instance
|
||||
passed in.
|
||||
"""
|
||||
|
||||
def ProcessFuncX(f, out, name):
|
||||
out.append(name)
|
||||
out.append(t4 + "retType: %s" % f.retType.vt_type)
|
||||
if f.params:
|
||||
out.append(t4 + "params:")
|
||||
for p in f.params:
|
||||
out.append(t8 + p.name)
|
||||
out.append(t8+t4+ "in:%s out:%s optional:%s type:%s" % (p.isIn, p.isOut, p.isOptional, p.vt_type))
|
||||
out.append('')
|
||||
|
||||
def ProcessPropX(p, out):
|
||||
out.append(GernerateAXModule.trimPropName(p.name))
|
||||
out.append(t4+ "type:%s arg:%s canGet:%s canSet:%s" % (p.type.vt_type, p.arg.vt_type, p.canGet, p.canSet))
|
||||
out.append('')
|
||||
|
||||
out = []
|
||||
|
||||
out.append("PROPERTIES")
|
||||
out.append("-"*20)
|
||||
for p in ax.GetAXProperties():
|
||||
ProcessPropX(p, out)
|
||||
out.append('\n\n')
|
||||
|
||||
out.append("METHODS")
|
||||
out.append("-"*20)
|
||||
for m in ax.GetAXMethods():
|
||||
ProcessFuncX(m, out, GernerateAXModule.trimMethodName(m.name))
|
||||
out.append('\n\n')
|
||||
|
||||
out.append("EVENTS")
|
||||
out.append("-"*20)
|
||||
for e in ax.GetAXEvents():
|
||||
ProcessFuncX(e, out, GernerateAXModule.trimEventName(e.name))
|
||||
out.append('\n\n')
|
||||
|
||||
return "\n".join(out)
|
||||
|
||||
|
||||
|
||||
class GernerateAXModule:
|
||||
def __init__(self, ax, className, modulePath, moduleName=None, verbose=False):
|
||||
"""
|
||||
Make a Python module file with a class that has been specialized
|
||||
for the AcitveX object.
|
||||
|
||||
ax An instance of the ActiveXWindow class
|
||||
className The name to use for the new class
|
||||
modulePath The path where the new module should be written to
|
||||
moduleName The name of the .py file to create. If not given
|
||||
then the className will be used.
|
||||
"""
|
||||
import os
|
||||
if moduleName is None:
|
||||
moduleName = className + '.py'
|
||||
filename = os.path.join(modulePath, moduleName)
|
||||
if verbose:
|
||||
print "Creating module in:", filename
|
||||
print " ProgID: ", ax.GetCLSID().GetProgIDString()
|
||||
print " CLSID: ", ax.GetCLSID().GetCLSIDString()
|
||||
print
|
||||
self.mf = file(filename, "w")
|
||||
self.WriteFileHeader(ax)
|
||||
self.WriteEvents(ax)
|
||||
self.WriteClassHeader(ax, className)
|
||||
self.WriteMethods(ax)
|
||||
self.WriteProperties(ax)
|
||||
self.WriteDocs(ax)
|
||||
self.mf.close()
|
||||
del self.mf
|
||||
|
||||
|
||||
def WriteFileHeader(self, ax):
|
||||
self.write("# This module was generated by the wx.activex.GernerateAXModule class\n"
|
||||
"# (See also the genaxmodule script.)\n")
|
||||
self.write("import wx")
|
||||
self.write("import wx.activex\n")
|
||||
self.write("clsID = '%s'\nprogID = '%s'\n"
|
||||
% (ax.GetCLSID().GetCLSIDString(), ax.GetCLSID().GetProgIDString()))
|
||||
self.write("\n")
|
||||
|
||||
|
||||
def WriteEvents(self, ax):
|
||||
events = ax.GetAXEvents()
|
||||
if events:
|
||||
self.write("# Create eventTypes and event binders")
|
||||
for e in events:
|
||||
self.write("wxEVT_%s = wx.activex.RegisterActiveXEvent('%s')"
|
||||
% (self.trimEventName(e.name), e.name))
|
||||
self.write()
|
||||
for e in events:
|
||||
n = self.trimEventName(e.name)
|
||||
self.write("EVT_%s = wx.PyEventBinder(wxEVT_%s, 1)" % (n,n))
|
||||
self.write("\n")
|
||||
|
||||
|
||||
def WriteClassHeader(self, ax, className):
|
||||
self.write("# Derive a new class from ActiveXWindow")
|
||||
self.write("""\
|
||||
class %s(wx.activex.ActiveXWindow):
|
||||
def __init__(self, parent, ID=-1, pos=wx.DefaultPosition,
|
||||
size=wx.DefaultSize, style=0, name='%s'):
|
||||
wx.activex.ActiveXWindow.__init__(self, parent,
|
||||
wx.activex.CLSID('%s'),
|
||||
ID, pos, size, style, name)
|
||||
""" % (className, className, ax.GetCLSID().GetCLSIDString()) )
|
||||
|
||||
|
||||
def WriteMethods(self, ax):
|
||||
methods = ax.GetAXMethods()
|
||||
if methods:
|
||||
self.write(t4, "# Methods exported by the ActiveX object")
|
||||
for m in methods:
|
||||
name = self.trimMethodName(m.name)
|
||||
self.write(t4, "def %s(self%s):" % (name, self.getParameters(m, True)))
|
||||
self.write(t8, "return self.CallAXMethod('%s'%s)" % (m.name, self.getParameters(m, False)))
|
||||
self.write()
|
||||
|
||||
|
||||
def WriteProperties(self, ax):
|
||||
props = ax.GetAXProperties()
|
||||
if props:
|
||||
self.write(t4, "# Getters, Setters and properties")
|
||||
for p in props:
|
||||
getterName = setterName = "None"
|
||||
if p.canGet:
|
||||
getterName = "_get_" + p.name
|
||||
self.write(t4, "def %s(self):" % getterName)
|
||||
self.write(t8, "return self.GetAXProp('%s')" % p.name)
|
||||
if p.canSet:
|
||||
setterName = "_set_" + p.name
|
||||
self.write(t4, "def %s(self, %s):" % (setterName, p.arg.name))
|
||||
self.write(t8, "self.SetAXProp('%s', %s)" % (p.name, p.arg.name))
|
||||
|
||||
self.write(t4, "%s = property(%s, %s)" %
|
||||
(self.trimPropName(p.name), getterName, setterName))
|
||||
self.write()
|
||||
|
||||
|
||||
def WriteDocs(self, ax):
|
||||
self.write()
|
||||
doc = GetAXInfo(ax)
|
||||
for line in doc.split('\n'):
|
||||
self.write("# ", line)
|
||||
|
||||
|
||||
|
||||
def write(self, *args):
|
||||
for a in args:
|
||||
self.mf.write(a)
|
||||
self.mf.write("\n")
|
||||
|
||||
|
||||
def trimEventName(name):
|
||||
if name.startswith("On"):
|
||||
name = name[2:]
|
||||
return name
|
||||
trimEventName = staticmethod(trimEventName)
|
||||
|
||||
|
||||
def trimPropName(name):
|
||||
#name = name[0].lower() + name[1:]
|
||||
name = name.lower()
|
||||
import keyword
|
||||
if name in keyword.kwlist: name += '_'
|
||||
return name
|
||||
trimPropName = staticmethod(trimPropName)
|
||||
|
||||
|
||||
def trimMethodName(name):
|
||||
import keyword
|
||||
if name in keyword.kwlist: name += '_'
|
||||
return name
|
||||
trimMethodName = staticmethod(trimMethodName)
|
||||
|
||||
|
||||
def getParameters(self, m, withDefaults):
|
||||
import keyword
|
||||
st = ""
|
||||
# collect the input parameters, if both isIn and isOut are
|
||||
# False then assume it is an input paramater
|
||||
params = []
|
||||
for p in m.params:
|
||||
if p.isIn or (not p.isIn and not p.isOut):
|
||||
params.append(p)
|
||||
# did we get any?
|
||||
for p in params:
|
||||
name = p.name
|
||||
if name in keyword.kwlist: name += '_'
|
||||
st += ", "
|
||||
st += name
|
||||
if withDefaults and p.isOptional:
|
||||
st += '=None'
|
||||
return st
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
@@ -1,133 +0,0 @@
|
||||
/*
|
||||
wxActiveX Library Licence, Version 3
|
||||
====================================
|
||||
|
||||
Copyright (C) 2003 Lindsay Mathieson [, ...]
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this licence document, but changing it is not allowed.
|
||||
|
||||
wxActiveX LIBRARY LICENCE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
This library is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library General Public Licence as published by
|
||||
the Free Software Foundation; either version 2 of the Licence, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
|
||||
General Public Licence for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public Licence
|
||||
along with this software, usually in a file named COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
Boston, MA 02111-1307 USA.
|
||||
|
||||
EXCEPTION NOTICE
|
||||
|
||||
1. As a special exception, the copyright holders of this library give
|
||||
permission for additional uses of the text contained in this release of
|
||||
the library as licenced under the wxActiveX Library Licence, applying
|
||||
either version 3 of the Licence, or (at your option) any later version of
|
||||
the Licence as published by the copyright holders of version 3 of the
|
||||
Licence document.
|
||||
|
||||
2. The exception is that you may use, copy, link, modify and distribute
|
||||
under the user's own terms, binary object code versions of works based
|
||||
on the Library.
|
||||
|
||||
3. If you copy code from files distributed under the terms of the GNU
|
||||
General Public Licence or the GNU Library General Public Licence into a
|
||||
copy of this library, as this licence permits, the exception does not
|
||||
apply to the code that you add in this way. To avoid misleading anyone as
|
||||
to the status of such modified files, you must delete this exception
|
||||
notice from such code and/or adjust the licensing conditions notice
|
||||
accordingly.
|
||||
|
||||
4. If you write modifications of your own for this library, it is your
|
||||
choice whether to permit this exception to apply to your modifications.
|
||||
If you do not wish that, you must delete the exception notice from such
|
||||
code and/or adjust the licensing conditions notice accordingly.
|
||||
*/
|
||||
|
||||
// This module contains the declarations of the stream adapters and such that
|
||||
// used to be in IEHtmlWin.cpp, so that they can be used independently in the
|
||||
// wxPython wrappers...
|
||||
|
||||
|
||||
#ifndef _IEHTMLSTREAM_H_
|
||||
#define _IEHTMLSTREAM_H_
|
||||
|
||||
|
||||
class IStreamAdaptorBase : public IStream
|
||||
{
|
||||
private:
|
||||
DECLARE_OLE_UNKNOWN(IStreamAdaptorBase);
|
||||
|
||||
public:
|
||||
string prepend;
|
||||
|
||||
IStreamAdaptorBase() {}
|
||||
virtual ~IStreamAdaptorBase() {}
|
||||
|
||||
virtual int Read(char *buf, int cb) = 0;
|
||||
|
||||
// ISequentialStream
|
||||
HRESULT STDMETHODCALLTYPE Read(void __RPC_FAR *pv, ULONG cb, ULONG __RPC_FAR *pcbRead);
|
||||
|
||||
HRESULT STDMETHODCALLTYPE Write(const void __RPC_FAR *pv, ULONG cb, ULONG __RPC_FAR *pcbWritten) {return E_NOTIMPL;}
|
||||
|
||||
// IStream
|
||||
HRESULT STDMETHODCALLTYPE Seek(LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER __RPC_FAR *plibNewPosition) {return E_NOTIMPL;}
|
||||
HRESULT STDMETHODCALLTYPE SetSize(ULARGE_INTEGER libNewSize) {return E_NOTIMPL;}
|
||||
HRESULT STDMETHODCALLTYPE CopyTo(IStream __RPC_FAR *pstm, ULARGE_INTEGER cb, ULARGE_INTEGER __RPC_FAR *pcbRead, ULARGE_INTEGER __RPC_FAR *pcbWritten) {return E_NOTIMPL;}
|
||||
HRESULT STDMETHODCALLTYPE Commit(DWORD grfCommitFlags) {return E_NOTIMPL;}
|
||||
HRESULT STDMETHODCALLTYPE Revert(void) {return E_NOTIMPL;}
|
||||
HRESULT STDMETHODCALLTYPE LockRegion(ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType) {return E_NOTIMPL;}
|
||||
HRESULT STDMETHODCALLTYPE UnlockRegion(ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType) {return E_NOTIMPL;}
|
||||
HRESULT STDMETHODCALLTYPE Stat(STATSTG __RPC_FAR *pstatstg, DWORD grfStatFlag) {return E_NOTIMPL;}
|
||||
HRESULT STDMETHODCALLTYPE Clone(IStream __RPC_FAR *__RPC_FAR *ppstm) {return E_NOTIMPL;}
|
||||
};
|
||||
|
||||
|
||||
|
||||
class IStreamAdaptor : public IStreamAdaptorBase
|
||||
{
|
||||
private:
|
||||
istream *m_is;
|
||||
|
||||
public:
|
||||
IStreamAdaptor(istream *is);
|
||||
~IStreamAdaptor();
|
||||
int Read(char *buf, int cb);
|
||||
};
|
||||
|
||||
|
||||
|
||||
class IwxStreamAdaptor : public IStreamAdaptorBase
|
||||
{
|
||||
private:
|
||||
wxInputStream *m_is;
|
||||
|
||||
public:
|
||||
IwxStreamAdaptor(wxInputStream *is);
|
||||
~IwxStreamAdaptor();
|
||||
int Read(char *buf, int cb);
|
||||
};
|
||||
|
||||
|
||||
class wxOwnedMemInputStream : public wxMemoryInputStream
|
||||
{
|
||||
public:
|
||||
char *m_data;
|
||||
|
||||
wxOwnedMemInputStream(char *data, size_t len);
|
||||
~wxOwnedMemInputStream();
|
||||
};
|
||||
|
||||
|
||||
wxAutoOleInterface<IHTMLTxtRange> wxieGetSelRange(IOleObject *oleObject);
|
||||
|
||||
#endif
|
@@ -1,478 +0,0 @@
|
||||
/*
|
||||
wxActiveX Library Licence, Version 3
|
||||
====================================
|
||||
|
||||
Copyright (C) 2003 Lindsay Mathieson [, ...]
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this licence document, but changing it is not allowed.
|
||||
|
||||
wxActiveX LIBRARY LICENCE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
This library is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library General Public Licence as published by
|
||||
the Free Software Foundation; either version 2 of the Licence, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
|
||||
General Public Licence for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public Licence
|
||||
along with this software, usually in a file named COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
Boston, MA 02111-1307 USA.
|
||||
|
||||
EXCEPTION NOTICE
|
||||
|
||||
1. As a special exception, the copyright holders of this library give
|
||||
permission for additional uses of the text contained in this release of
|
||||
the library as licenced under the wxActiveX Library Licence, applying
|
||||
either version 3 of the Licence, or (at your option) any later version of
|
||||
the Licence as published by the copyright holders of version 3 of the
|
||||
Licence document.
|
||||
|
||||
2. The exception is that you may use, copy, link, modify and distribute
|
||||
under the user's own terms, binary object code versions of works based
|
||||
on the Library.
|
||||
|
||||
3. If you copy code from files distributed under the terms of the GNU
|
||||
General Public Licence or the GNU Library General Public Licence into a
|
||||
copy of this library, as this licence permits, the exception does not
|
||||
apply to the code that you add in this way. To avoid misleading anyone as
|
||||
to the status of such modified files, you must delete this exception
|
||||
notice from such code and/or adjust the licensing conditions notice
|
||||
accordingly.
|
||||
|
||||
4. If you write modifications of your own for this library, it is your
|
||||
choice whether to permit this exception to apply to your modifications.
|
||||
If you do not wish that, you must delete the exception notice from such
|
||||
code and/or adjust the licensing conditions notice accordingly.
|
||||
*/
|
||||
|
||||
#include "IEHtmlWin.h"
|
||||
#include <wx/strconv.h>
|
||||
#include <wx/string.h>
|
||||
#include <wx/event.h>
|
||||
#include <wx/listctrl.h>
|
||||
#include <wx/mstream.h>
|
||||
#include <oleidl.h>
|
||||
#include <winerror.h>
|
||||
#include <exdispid.h>
|
||||
#include <exdisp.h>
|
||||
#include <olectl.h>
|
||||
#include <Mshtml.h>
|
||||
#include <sstream>
|
||||
#include <IEHtmlStream.h>
|
||||
using namespace std;
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Stream adapters and such
|
||||
|
||||
HRESULT STDMETHODCALLTYPE IStreamAdaptorBase::Read(void __RPC_FAR *pv, ULONG cb, ULONG __RPC_FAR *pcbRead)
|
||||
{
|
||||
if (prepend.size() > 0)
|
||||
{
|
||||
int n = wxMin(prepend.size(), cb);
|
||||
prepend.copy((char *) pv, n);
|
||||
prepend = prepend.substr(n);
|
||||
if (pcbRead)
|
||||
*pcbRead = n;
|
||||
|
||||
return S_OK;
|
||||
};
|
||||
|
||||
int rc = Read((char *) pv, cb);
|
||||
if (pcbRead)
|
||||
*pcbRead = rc;
|
||||
|
||||
return S_OK;
|
||||
};
|
||||
|
||||
DEFINE_OLE_TABLE(IStreamAdaptorBase)
|
||||
OLE_IINTERFACE(IUnknown)
|
||||
OLE_IINTERFACE(ISequentialStream)
|
||||
OLE_IINTERFACE(IStream)
|
||||
END_OLE_TABLE;
|
||||
|
||||
|
||||
IStreamAdaptor::IStreamAdaptor(istream *is)
|
||||
: IStreamAdaptorBase(), m_is(is)
|
||||
{
|
||||
wxASSERT(m_is != NULL);
|
||||
}
|
||||
|
||||
IStreamAdaptor::~IStreamAdaptor()
|
||||
{
|
||||
delete m_is;
|
||||
}
|
||||
|
||||
int IStreamAdaptor::Read(char *buf, int cb)
|
||||
{
|
||||
m_is->read(buf, cb);
|
||||
return m_is->gcount();
|
||||
}
|
||||
|
||||
|
||||
IwxStreamAdaptor::IwxStreamAdaptor(wxInputStream *is)
|
||||
: IStreamAdaptorBase(), m_is(is)
|
||||
{
|
||||
wxASSERT(m_is != NULL);
|
||||
}
|
||||
IwxStreamAdaptor::~IwxStreamAdaptor()
|
||||
{
|
||||
delete m_is;
|
||||
}
|
||||
|
||||
// ISequentialStream
|
||||
int IwxStreamAdaptor::Read(char *buf, int cb)
|
||||
{
|
||||
m_is->Read(buf, cb);
|
||||
return m_is->LastRead();
|
||||
};
|
||||
|
||||
wxOwnedMemInputStream::wxOwnedMemInputStream(char *data, size_t len)
|
||||
: wxMemoryInputStream(data, len), m_data(data)
|
||||
{}
|
||||
|
||||
wxOwnedMemInputStream::~wxOwnedMemInputStream()
|
||||
{
|
||||
free(m_data);
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
BEGIN_EVENT_TABLE(wxIEHtmlWin, wxActiveX)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
|
||||
static const CLSID CLSID_MozillaBrowser =
|
||||
{ 0x1339B54C, 0x3453, 0x11D2,
|
||||
{ 0x93, 0xB9, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00 } };
|
||||
|
||||
|
||||
//#define PROGID "Shell.Explorer"
|
||||
#define PROGID CLSID_WebBrowser
|
||||
//#define PROGID CLSID_MozillaBrowser
|
||||
//#define PROGID CLSID_HTMLDocument
|
||||
//#define PROGID "MSCAL.Calendar"
|
||||
//#define PROGID ""
|
||||
//#define PROGID "SoftwareFX.ChartFX.20"
|
||||
|
||||
wxIEHtmlWin::wxIEHtmlWin(wxWindow * parent, wxWindowID id,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
long style,
|
||||
const wxString& name) :
|
||||
wxActiveX(parent, PROGID, id, pos, size, style, name)
|
||||
{
|
||||
SetupBrowser();
|
||||
}
|
||||
|
||||
|
||||
wxIEHtmlWin::~wxIEHtmlWin()
|
||||
{
|
||||
}
|
||||
|
||||
void wxIEHtmlWin::SetupBrowser()
|
||||
{
|
||||
HRESULT hret;
|
||||
|
||||
// Get IWebBrowser2 Interface
|
||||
hret = m_webBrowser.QueryInterface(IID_IWebBrowser2, m_ActiveX);
|
||||
assert(SUCCEEDED(hret));
|
||||
|
||||
// web browser setup
|
||||
m_webBrowser->put_MenuBar(VARIANT_FALSE);
|
||||
m_webBrowser->put_AddressBar(VARIANT_FALSE);
|
||||
m_webBrowser->put_StatusBar(VARIANT_FALSE);
|
||||
m_webBrowser->put_ToolBar(VARIANT_FALSE);
|
||||
|
||||
m_webBrowser->put_RegisterAsBrowser(VARIANT_TRUE);
|
||||
m_webBrowser->put_RegisterAsDropTarget(VARIANT_TRUE);
|
||||
|
||||
m_webBrowser->Navigate( L"about:blank", NULL, NULL, NULL, NULL );
|
||||
}
|
||||
|
||||
|
||||
void wxIEHtmlWin::SetEditMode(bool seton)
|
||||
{
|
||||
m_bAmbientUserMode = ! seton;
|
||||
AmbientPropertyChanged(DISPID_AMBIENT_USERMODE);
|
||||
};
|
||||
|
||||
bool wxIEHtmlWin::GetEditMode()
|
||||
{
|
||||
return ! m_bAmbientUserMode;
|
||||
};
|
||||
|
||||
|
||||
void wxIEHtmlWin::SetCharset(const wxString& charset)
|
||||
{
|
||||
// HTML Document ?
|
||||
IDispatch *pDisp = NULL;
|
||||
HRESULT hret = m_webBrowser->get_Document(&pDisp);
|
||||
wxAutoOleInterface<IDispatch> disp(pDisp);
|
||||
|
||||
if (disp.Ok())
|
||||
{
|
||||
wxAutoOleInterface<IHTMLDocument2> doc(IID_IHTMLDocument2, disp);
|
||||
if (doc.Ok())
|
||||
doc->put_charset((BSTR) (const wchar_t *) charset.wc_str(wxConvUTF8));
|
||||
//doc->put_charset((BSTR) wxConvUTF8.cMB2WC(charset).data());
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
void wxIEHtmlWin::LoadUrl(const wxString& url)
|
||||
{
|
||||
VARIANTARG navFlag, targetFrame, postData, headers;
|
||||
navFlag.vt = VT_EMPTY;
|
||||
navFlag.vt = VT_I2;
|
||||
navFlag.iVal = navNoReadFromCache;
|
||||
targetFrame.vt = VT_EMPTY;
|
||||
postData.vt = VT_EMPTY;
|
||||
headers.vt = VT_EMPTY;
|
||||
|
||||
HRESULT hret = 0;
|
||||
hret = m_webBrowser->Navigate((BSTR) (const wchar_t *) url.wc_str(wxConvUTF8),
|
||||
&navFlag, &targetFrame, &postData, &headers);
|
||||
};
|
||||
|
||||
|
||||
bool wxIEHtmlWin::LoadString(const wxString& html)
|
||||
{
|
||||
char *data = NULL;
|
||||
size_t len = html.length();
|
||||
#ifdef UNICODE
|
||||
len *= 2;
|
||||
#endif
|
||||
data = (char *) malloc(len);
|
||||
memcpy(data, html.c_str(), len);
|
||||
return LoadStream(new wxOwnedMemInputStream(data, len));
|
||||
};
|
||||
|
||||
bool wxIEHtmlWin::LoadStream(IStreamAdaptorBase *pstrm)
|
||||
{
|
||||
// need to prepend this as poxy MSHTML will not recognise a HTML comment
|
||||
// as starting a html document and treats it as plain text
|
||||
// Does nayone know how to force it to html mode ?
|
||||
pstrm->prepend = "<html>";
|
||||
|
||||
// strip leading whitespace as it can confuse MSHTML
|
||||
wxAutoOleInterface<IStream> strm(pstrm);
|
||||
|
||||
// Document Interface
|
||||
IDispatch *pDisp = NULL;
|
||||
HRESULT hret = m_webBrowser->get_Document(&pDisp);
|
||||
if (! pDisp)
|
||||
return false;
|
||||
wxAutoOleInterface<IDispatch> disp(pDisp);
|
||||
|
||||
|
||||
// get IPersistStreamInit
|
||||
wxAutoOleInterface<IPersistStreamInit>
|
||||
pPersistStreamInit(IID_IPersistStreamInit, disp);
|
||||
|
||||
if (pPersistStreamInit.Ok())
|
||||
{
|
||||
HRESULT hr = pPersistStreamInit->InitNew();
|
||||
if (SUCCEEDED(hr))
|
||||
hr = pPersistStreamInit->Load(strm);
|
||||
|
||||
return SUCCEEDED(hr);
|
||||
}
|
||||
else
|
||||
return false;
|
||||
};
|
||||
|
||||
bool wxIEHtmlWin::LoadStream(istream *is)
|
||||
{
|
||||
// wrap reference around stream
|
||||
IStreamAdaptor *pstrm = new IStreamAdaptor(is);
|
||||
pstrm->AddRef();
|
||||
|
||||
return LoadStream(pstrm);
|
||||
};
|
||||
|
||||
bool wxIEHtmlWin::LoadStream(wxInputStream *is)
|
||||
{
|
||||
// wrap reference around stream
|
||||
IwxStreamAdaptor *pstrm = new IwxStreamAdaptor(is);
|
||||
pstrm->AddRef();
|
||||
|
||||
return LoadStream(pstrm);
|
||||
};
|
||||
|
||||
|
||||
bool wxIEHtmlWin::GoBack()
|
||||
{
|
||||
HRESULT hret = 0;
|
||||
hret = m_webBrowser->GoBack();
|
||||
return hret == S_OK;
|
||||
}
|
||||
|
||||
bool wxIEHtmlWin::GoForward()
|
||||
{
|
||||
HRESULT hret = 0;
|
||||
hret = m_webBrowser->GoForward();
|
||||
return hret == S_OK;
|
||||
}
|
||||
|
||||
bool wxIEHtmlWin::GoHome()
|
||||
{
|
||||
try
|
||||
{
|
||||
CallMethod(_T("GoHome"));
|
||||
return true;
|
||||
}
|
||||
catch(exception&)
|
||||
{
|
||||
return false;
|
||||
};
|
||||
}
|
||||
|
||||
bool wxIEHtmlWin::GoSearch()
|
||||
{
|
||||
HRESULT hret = 0;
|
||||
hret = m_webBrowser->GoSearch();
|
||||
return hret == S_OK;
|
||||
}
|
||||
|
||||
bool wxIEHtmlWin::Refresh(wxIEHtmlRefreshLevel level)
|
||||
{
|
||||
VARIANTARG levelArg;
|
||||
HRESULT hret = 0;
|
||||
|
||||
levelArg.vt = VT_I2;
|
||||
levelArg.iVal = level;
|
||||
hret = m_webBrowser->Refresh2(&levelArg);
|
||||
return hret == S_OK;
|
||||
}
|
||||
|
||||
bool wxIEHtmlWin::Stop()
|
||||
{
|
||||
HRESULT hret = 0;
|
||||
hret = m_webBrowser->Stop();
|
||||
return hret == S_OK;
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static wxAutoOleInterface<IHTMLSelectionObject> GetSelObject(IOleObject *oleObject)
|
||||
{
|
||||
// Query for IWebBrowser interface
|
||||
wxAutoOleInterface<IWebBrowser2> wb(IID_IWebBrowser2, oleObject);
|
||||
if (! wb.Ok())
|
||||
return wxAutoOleInterface<IHTMLSelectionObject>();
|
||||
|
||||
IDispatch *iDisp = NULL;
|
||||
HRESULT hr = wb->get_Document(&iDisp);
|
||||
if (hr != S_OK)
|
||||
return wxAutoOleInterface<IHTMLSelectionObject>();
|
||||
|
||||
// Query for Document Interface
|
||||
wxAutoOleInterface<IHTMLDocument2> hd(IID_IHTMLDocument2, iDisp);
|
||||
iDisp->Release();
|
||||
|
||||
if (! hd.Ok())
|
||||
return wxAutoOleInterface<IHTMLSelectionObject>();
|
||||
|
||||
IHTMLSelectionObject *_so = NULL;
|
||||
hr = hd->get_selection(&_so);
|
||||
|
||||
// take ownership of selection object
|
||||
wxAutoOleInterface<IHTMLSelectionObject> so(_so);
|
||||
|
||||
return so;
|
||||
};
|
||||
|
||||
wxAutoOleInterface<IHTMLTxtRange> wxieGetSelRange(IOleObject *oleObject)
|
||||
{
|
||||
wxAutoOleInterface<IHTMLTxtRange> tr;
|
||||
|
||||
wxAutoOleInterface<IHTMLSelectionObject> so(GetSelObject(oleObject));
|
||||
if (! so)
|
||||
return tr;
|
||||
|
||||
IDispatch *iDisp = NULL;
|
||||
HRESULT hr = so->createRange(&iDisp);
|
||||
if (hr != S_OK)
|
||||
return tr;
|
||||
|
||||
// Query for IHTMLTxtRange interface
|
||||
tr.QueryInterface(IID_IHTMLTxtRange, iDisp);
|
||||
iDisp->Release();
|
||||
return tr;
|
||||
};
|
||||
|
||||
|
||||
wxString wxIEHtmlWin::GetStringSelection(bool asHTML)
|
||||
{
|
||||
wxAutoOleInterface<IHTMLTxtRange> tr(wxieGetSelRange(m_oleObject));
|
||||
if (! tr)
|
||||
return wxEmptyString;
|
||||
|
||||
BSTR text = NULL;
|
||||
HRESULT hr = E_FAIL;
|
||||
|
||||
if (asHTML)
|
||||
hr = tr->get_htmlText(&text);
|
||||
else
|
||||
hr = tr->get_text(&text);
|
||||
if (hr != S_OK)
|
||||
return wxEmptyString;
|
||||
|
||||
wxString s = text;
|
||||
SysFreeString(text);
|
||||
|
||||
return s;
|
||||
};
|
||||
|
||||
wxString wxIEHtmlWin::GetText(bool asHTML)
|
||||
{
|
||||
if (! m_webBrowser.Ok())
|
||||
return wxEmptyString;
|
||||
|
||||
// get document dispatch interface
|
||||
IDispatch *iDisp = NULL;
|
||||
HRESULT hr = m_webBrowser->get_Document(&iDisp);
|
||||
if (hr != S_OK)
|
||||
return wxEmptyString;
|
||||
|
||||
// Query for Document Interface
|
||||
wxAutoOleInterface<IHTMLDocument2> hd(IID_IHTMLDocument2, iDisp);
|
||||
iDisp->Release();
|
||||
|
||||
if (! hd.Ok())
|
||||
return wxEmptyString;
|
||||
|
||||
// get body element
|
||||
IHTMLElement *_body = NULL;
|
||||
hd->get_body(&_body);
|
||||
if (! _body)
|
||||
return wxEmptyString;
|
||||
wxAutoOleInterface<IHTMLElement> body(_body);
|
||||
|
||||
// get inner text
|
||||
BSTR text = NULL;
|
||||
hr = E_FAIL;
|
||||
|
||||
if (asHTML)
|
||||
hr = body->get_innerHTML(&text);
|
||||
else
|
||||
hr = body->get_innerText(&text);
|
||||
if (hr != S_OK)
|
||||
return wxEmptyString;
|
||||
|
||||
wxString s = text;
|
||||
SysFreeString(text);
|
||||
|
||||
return s;
|
||||
};
|
@@ -1,120 +0,0 @@
|
||||
/*
|
||||
wxActiveX Library Licence, Version 3
|
||||
====================================
|
||||
|
||||
Copyright (C) 2003 Lindsay Mathieson [, ...]
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this licence document, but changing it is not allowed.
|
||||
|
||||
wxActiveX LIBRARY LICENCE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
This library is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library General Public Licence as published by
|
||||
the Free Software Foundation; either version 2 of the Licence, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
|
||||
General Public Licence for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public Licence
|
||||
along with this software, usually in a file named COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
Boston, MA 02111-1307 USA.
|
||||
|
||||
EXCEPTION NOTICE
|
||||
|
||||
1. As a special exception, the copyright holders of this library give
|
||||
permission for additional uses of the text contained in this release of
|
||||
the library as licenced under the wxActiveX Library Licence, applying
|
||||
either version 3 of the Licence, or (at your option) any later version of
|
||||
the Licence as published by the copyright holders of version 3 of the
|
||||
Licence document.
|
||||
|
||||
2. The exception is that you may use, copy, link, modify and distribute
|
||||
under the user's own terms, binary object code versions of works based
|
||||
on the Library.
|
||||
|
||||
3. If you copy code from files distributed under the terms of the GNU
|
||||
General Public Licence or the GNU Library General Public Licence into a
|
||||
copy of this library, as this licence permits, the exception does not
|
||||
apply to the code that you add in this way. To avoid misleading anyone as
|
||||
to the status of such modified files, you must delete this exception
|
||||
notice from such code and/or adjust the licensing conditions notice
|
||||
accordingly.
|
||||
|
||||
4. If you write modifications of your own for this library, it is your
|
||||
choice whether to permit this exception to apply to your modifications.
|
||||
If you do not wish that, you must delete the exception notice from such
|
||||
code and/or adjust the licensing conditions notice accordingly.
|
||||
*/
|
||||
|
||||
/*! \file iehtmlwin.h
|
||||
\brief implements wxIEHtmlWin window class
|
||||
*/
|
||||
#ifndef _IEHTMLWIN_H_
|
||||
#define _IEHTMLWIN_H_
|
||||
#pragma warning( disable : 4101 4786)
|
||||
#pragma warning( disable : 4786)
|
||||
|
||||
|
||||
#include <wx/setup.h>
|
||||
#include <wx/wx.h>
|
||||
#include <exdisp.h>
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
#include "wxactivex.h"
|
||||
|
||||
|
||||
enum wxIEHtmlRefreshLevel
|
||||
{
|
||||
wxIEHTML_REFRESH_NORMAL = 0,
|
||||
wxIEHTML_REFRESH_IFEXPIRED = 1,
|
||||
wxIEHTML_REFRESH_CONTINUE = 2,
|
||||
wxIEHTML_REFRESH_COMPLETELY = 3
|
||||
};
|
||||
|
||||
class IStreamAdaptorBase;
|
||||
|
||||
class wxIEHtmlWin : public wxActiveX
|
||||
{
|
||||
public:
|
||||
wxIEHtmlWin(wxWindow * parent, wxWindowID id = -1,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxPanelNameStr);
|
||||
virtual ~wxIEHtmlWin();
|
||||
|
||||
void LoadUrl(const wxString& url);
|
||||
bool LoadString(const wxString& html);
|
||||
bool LoadStream(istream *strm);
|
||||
bool LoadStream(wxInputStream *is);
|
||||
|
||||
void SetCharset(const wxString& charset);
|
||||
void SetEditMode(bool seton);
|
||||
bool GetEditMode();
|
||||
wxString GetStringSelection(bool asHTML = false);
|
||||
wxString GetText(bool asHTML = false);
|
||||
|
||||
bool GoBack();
|
||||
bool GoForward();
|
||||
bool GoHome();
|
||||
bool GoSearch();
|
||||
bool Refresh(wxIEHtmlRefreshLevel level);
|
||||
bool Stop();
|
||||
|
||||
DECLARE_EVENT_TABLE();
|
||||
|
||||
protected:
|
||||
void SetupBrowser();
|
||||
bool LoadStream(IStreamAdaptorBase *pstrm);
|
||||
|
||||
wxAutoOleInterface<IWebBrowser2> m_webBrowser;
|
||||
};
|
||||
|
||||
#endif /* _IEHTMLWIN_H_ */
|
@@ -1,6 +0,0 @@
|
||||
The contents of this dir are from the 9-Jan-2004 version of wxie.zip
|
||||
downloaded from:
|
||||
|
||||
http://members.optusnet.com.au/~blackpaw1/wxactivex.html
|
||||
|
||||
|
@@ -1,205 +0,0 @@
|
||||
# Doxyfile 1.3-rc2
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# General configuration options
|
||||
#---------------------------------------------------------------------------
|
||||
PROJECT_NAME = wxActiveX
|
||||
PROJECT_NUMBER =
|
||||
OUTPUT_DIRECTORY =
|
||||
OUTPUT_LANGUAGE = English
|
||||
EXTRACT_ALL = NO
|
||||
EXTRACT_PRIVATE = NO
|
||||
EXTRACT_STATIC = YES
|
||||
EXTRACT_LOCAL_CLASSES = YES
|
||||
HIDE_UNDOC_MEMBERS = YES
|
||||
HIDE_UNDOC_CLASSES = YES
|
||||
HIDE_FRIEND_COMPOUNDS = NO
|
||||
HIDE_IN_BODY_DOCS = NO
|
||||
BRIEF_MEMBER_DESC = YES
|
||||
REPEAT_BRIEF = YES
|
||||
ALWAYS_DETAILED_SEC = NO
|
||||
INLINE_INHERITED_MEMB = NO
|
||||
FULL_PATH_NAMES = NO
|
||||
STRIP_FROM_PATH =
|
||||
INTERNAL_DOCS = NO
|
||||
CASE_SENSE_NAMES = YES
|
||||
SHORT_NAMES = NO
|
||||
HIDE_SCOPE_NAMES = NO
|
||||
VERBATIM_HEADERS = YES
|
||||
SHOW_INCLUDE_FILES = YES
|
||||
JAVADOC_AUTOBRIEF = YES
|
||||
MULTILINE_CPP_IS_BRIEF = NO
|
||||
DETAILS_AT_TOP = YES
|
||||
INHERIT_DOCS = NO
|
||||
INLINE_INFO = YES
|
||||
SORT_MEMBER_DOCS = NO
|
||||
DISTRIBUTE_GROUP_DOC = YES
|
||||
TAB_SIZE = 8
|
||||
GENERATE_TODOLIST = YES
|
||||
GENERATE_TESTLIST = YES
|
||||
GENERATE_BUGLIST = YES
|
||||
GENERATE_DEPRECATEDLIST= YES
|
||||
ALIASES =
|
||||
ENABLED_SECTIONS =
|
||||
MAX_INITIALIZER_LINES = 30
|
||||
OPTIMIZE_OUTPUT_FOR_C = YES
|
||||
OPTIMIZE_OUTPUT_JAVA = NO
|
||||
SHOW_USED_FILES = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to warning and progress messages
|
||||
#---------------------------------------------------------------------------
|
||||
QUIET = NO
|
||||
WARNINGS = YES
|
||||
WARN_IF_UNDOCUMENTED = YES
|
||||
WARN_IF_DOC_ERROR = YES
|
||||
WARN_FORMAT = "$file($line): $text"
|
||||
WARN_LOGFILE =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the input files
|
||||
#---------------------------------------------------------------------------
|
||||
INPUT = .\wxactivex.h .\iehtmlwin.h
|
||||
FILE_PATTERNS = *.cpp \
|
||||
*.c \
|
||||
*.h \
|
||||
*.cxx \
|
||||
*.idl
|
||||
RECURSIVE = NO
|
||||
EXCLUDE =
|
||||
EXCLUDE_SYMLINKS = NO
|
||||
EXCLUDE_PATTERNS =
|
||||
EXAMPLE_PATH =
|
||||
EXAMPLE_PATTERNS =
|
||||
EXAMPLE_RECURSIVE = NO
|
||||
IMAGE_PATH =
|
||||
INPUT_FILTER =
|
||||
FILTER_SOURCE_FILES = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to source browsing
|
||||
#---------------------------------------------------------------------------
|
||||
SOURCE_BROWSER = YES
|
||||
INLINE_SOURCES = NO
|
||||
STRIP_CODE_COMMENTS = YES
|
||||
REFERENCED_BY_RELATION = NO
|
||||
REFERENCES_RELATION = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the alphabetical class index
|
||||
#---------------------------------------------------------------------------
|
||||
ALPHABETICAL_INDEX = YES
|
||||
COLS_IN_ALPHA_INDEX = 4
|
||||
IGNORE_PREFIX =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the HTML output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_HTML = YES
|
||||
HTML_OUTPUT = doxydoc
|
||||
HTML_FILE_EXTENSION = .html
|
||||
HTML_HEADER =
|
||||
HTML_FOOTER =
|
||||
HTML_STYLESHEET =
|
||||
HTML_ALIGN_MEMBERS = YES
|
||||
GENERATE_HTMLHELP = no
|
||||
CHM_FILE = wxactivex.chm
|
||||
HHC_LOCATION = hhc.exe
|
||||
GENERATE_CHI = NO
|
||||
BINARY_TOC = NO
|
||||
TOC_EXPAND = NO
|
||||
DISABLE_INDEX = NO
|
||||
ENUM_VALUES_PER_LINE = 4
|
||||
GENERATE_TREEVIEW = NO
|
||||
TREEVIEW_WIDTH = 250
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the LaTeX output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_LATEX = YES
|
||||
LATEX_OUTPUT = latex
|
||||
LATEX_CMD_NAME = latex
|
||||
MAKEINDEX_CMD_NAME = makeindex
|
||||
COMPACT_LATEX = NO
|
||||
PAPER_TYPE = a4wide
|
||||
EXTRA_PACKAGES =
|
||||
LATEX_HEADER =
|
||||
PDF_HYPERLINKS = NO
|
||||
USE_PDFLATEX = NO
|
||||
LATEX_BATCHMODE = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the RTF output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_RTF = NO
|
||||
RTF_OUTPUT = rtf
|
||||
COMPACT_RTF = NO
|
||||
RTF_HYPERLINKS = NO
|
||||
RTF_STYLESHEET_FILE =
|
||||
RTF_EXTENSIONS_FILE =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the man page output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_MAN = NO
|
||||
MAN_OUTPUT = man
|
||||
MAN_EXTENSION = .3
|
||||
MAN_LINKS = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the XML output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_XML = NO
|
||||
XML_SCHEMA =
|
||||
XML_DTD =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options for the AutoGen Definitions output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_AUTOGEN_DEF = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the Perl module output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_PERLMOD = NO
|
||||
PERLMOD_LATEX = NO
|
||||
PERLMOD_PRETTY = YES
|
||||
PERLMOD_MAKEVAR_PREFIX =
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the preprocessor
|
||||
#---------------------------------------------------------------------------
|
||||
ENABLE_PREPROCESSING = YES
|
||||
MACRO_EXPANSION = NO
|
||||
EXPAND_ONLY_PREDEF = NO
|
||||
SEARCH_INCLUDES = YES
|
||||
INCLUDE_PATH =
|
||||
INCLUDE_FILE_PATTERNS =
|
||||
PREDEFINED =
|
||||
EXPAND_AS_DEFINED =
|
||||
SKIP_FUNCTION_MACROS = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration::addtions related to external references
|
||||
#---------------------------------------------------------------------------
|
||||
TAGFILES =
|
||||
GENERATE_TAGFILE =
|
||||
ALLEXTERNALS = NO
|
||||
EXTERNAL_GROUPS = YES
|
||||
PERL_PATH = /usr/bin/perl
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the dot tool
|
||||
#---------------------------------------------------------------------------
|
||||
CLASS_DIAGRAMS = YES
|
||||
HIDE_UNDOC_RELATIONS = YES
|
||||
HAVE_DOT = NO
|
||||
CLASS_GRAPH = YES
|
||||
COLLABORATION_GRAPH = YES
|
||||
TEMPLATE_RELATIONS = YES
|
||||
INCLUDE_GRAPH = YES
|
||||
INCLUDED_BY_GRAPH = YES
|
||||
GRAPHICAL_HIERARCHY = YES
|
||||
DOT_IMAGE_FORMAT = png
|
||||
DOT_PATH =
|
||||
DOTFILE_DIRS =
|
||||
MAX_DOT_GRAPH_WIDTH = 1024
|
||||
MAX_DOT_GRAPH_HEIGHT = 1024
|
||||
GENERATE_LEGEND = YES
|
||||
DOT_CLEANUP = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration::addtions related to the search engine
|
||||
#---------------------------------------------------------------------------
|
||||
SEARCHENGINE = NO
|
||||
CGI_NAME = search.cgi
|
||||
CGI_URL =
|
||||
DOC_URL =
|
||||
DOC_ABSPATH =
|
||||
BIN_ABSPATH = /usr/local/bin/
|
||||
EXT_DOC_PATHS =
|
@@ -1,53 +0,0 @@
|
||||
wxActiveX Library Licence, Version 3
|
||||
====================================
|
||||
|
||||
Copyright (C) 2003 Lindsay Mathieson [, ...]
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this licence document, but changing it is not allowed.
|
||||
|
||||
wxActiveX LIBRARY LICENCE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
This library is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library General Public Licence as published by
|
||||
the Free Software Foundation; either version 2 of the Licence, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
|
||||
General Public Licence for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public Licence
|
||||
along with this software, usually in a file named COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
Boston, MA 02111-1307 USA.
|
||||
|
||||
EXCEPTION NOTICE
|
||||
|
||||
1. As a special exception, the copyright holders of this library give
|
||||
permission for additional uses of the text contained in this release of
|
||||
the library as licenced under the wxActiveX Library Licence, applying
|
||||
either version 3 of the Licence, or (at your option) any later version of
|
||||
the Licence as published by the copyright holders of version 3 of the
|
||||
Licence document.
|
||||
|
||||
2. The exception is that you may use, copy, link, modify and distribute
|
||||
under the user's own terms, binary object code versions of works based
|
||||
on the Library.
|
||||
|
||||
3. If you copy code from files distributed under the terms of the GNU
|
||||
General Public Licence or the GNU Library General Public Licence into a
|
||||
copy of this library, as this licence permits, the exception does not
|
||||
apply to the code that you add in this way. To avoid misleading anyone as
|
||||
to the status of such modified files, you must delete this exception
|
||||
notice from such code and/or adjust the licensing conditions notice
|
||||
accordingly.
|
||||
|
||||
4. If you write modifications of your own for this library, it is your
|
||||
choice whether to permit this exception to apply to your modifications.
|
||||
If you do not wish that, you must delete the exception notice from such
|
||||
code and/or adjust the licensing conditions notice accordingly.
|
||||
|
||||
|
@@ -1,24 +0,0 @@
|
||||
CC = gcc
|
||||
|
||||
PROGRAM = wxIE
|
||||
|
||||
CFLAGS = -I/m/snowball/icicle/gswd/devenv/include -D__WXMOTIF__
|
||||
LFLAGS = -L/m/snowball/icicle/devenv/lib
|
||||
|
||||
# implementation
|
||||
|
||||
.SUFFIXES: .o .cpp
|
||||
|
||||
SOURCES:sh= /bin/ls *.cpp
|
||||
|
||||
OBJECTS = $(SOURCES:.cpp=.o)
|
||||
|
||||
.cpp.o :
|
||||
$(CC) -c $(CFLAGS) `wx-config --cflags` -o $@ $<
|
||||
|
||||
$(PROGRAM): $(OBJECTS)
|
||||
$(CC) -o $(PROGRAM) $(OBJECTS) $(LFLAGS) `wx-config --libs`
|
||||
|
||||
clean:
|
||||
rm -f *.o $(PROGRAM)
|
||||
|
@@ -1,24 +0,0 @@
|
||||
CC = gcc
|
||||
|
||||
PROGRAM = wxIE
|
||||
|
||||
CFLAGS = -I/m/snowball/icicle/gswd/devenv/include -D__WXGTK__
|
||||
LFLAGS = -L/m/snowball/icicle/devenv/lib
|
||||
|
||||
# implementation
|
||||
|
||||
.SUFFIXES: .o .cpp
|
||||
|
||||
SOURCES:sh= /bin/ls *.cpp
|
||||
|
||||
OBJECTS = $(SOURCES:.cpp=.o)
|
||||
|
||||
.cpp.o :
|
||||
$(CC) -c $(CFLAGS) `wx-config --cflags` -o $@ $<
|
||||
|
||||
$(PROGRAM): $(OBJECTS)
|
||||
$(CC) -o $(PROGRAM) $(OBJECTS) $(LFLAGS) `wx-config --libs`
|
||||
|
||||
clean:
|
||||
rm -f *.o $(PROGRAM)
|
||||
|
@@ -1,24 +0,0 @@
|
||||
CC = gcc
|
||||
|
||||
PROGRAM = wxIE
|
||||
|
||||
CFLAGS = -I/m/snowball/icicle/gswd/devenv/include -D__WXMOTIF__
|
||||
LFLAGS = -L/m/snowball/icicle/devenv/lib
|
||||
|
||||
# implementation
|
||||
|
||||
.SUFFIXES: .o .cpp
|
||||
|
||||
SOURCES:sh= /bin/ls *.cpp
|
||||
|
||||
OBJECTS = $(SOURCES:.cpp=.o)
|
||||
|
||||
.cpp.o :
|
||||
$(CC) -c $(CFLAGS) `wx-config --cflags` -o $@ $<
|
||||
|
||||
$(PROGRAM): $(OBJECTS)
|
||||
$(CC) -o $(PROGRAM) $(OBJECTS) $(LFLAGS) `wx-config --libs`
|
||||
|
||||
clean:
|
||||
rm -f *.o $(PROGRAM)
|
||||
|
@@ -1,2 +0,0 @@
|
||||
Flash needs the following GUID for its event interface
|
||||
{D27CDB6D-AE6D-11CF-96B8-444553540000}
|
@@ -1,149 +0,0 @@
|
||||
Lindsay Mathieson
|
||||
Email : <lmathieson@optusnet.com.au>
|
||||
|
||||
This is prelimanary stuff - the controls need extra methods and events etc,
|
||||
feel free to email with suggestions &/or patches.
|
||||
|
||||
Tested with wxWindows 2.3.2.
|
||||
Built with MS Visual C++ 6.0 & DevStudio
|
||||
Minor use of templates and STL
|
||||
|
||||
-----------------------------------------------------------
|
||||
This sample illustrates using wxActiveX and wxIEHtmlWin too:
|
||||
1. Host an arbitrary ActiveX control
|
||||
1.1 - Capture and logging of all events from control
|
||||
2. Specifically host the MSHTML Control
|
||||
|
||||
|
||||
wxActiveX:
|
||||
==========
|
||||
wxActiveX is used to host and siplay any activeX control, all the wxWindows developer
|
||||
needs to know is either the ProgID or CLSID of the control in question.
|
||||
|
||||
Derived From:
|
||||
- wxWindow
|
||||
|
||||
Include Files:
|
||||
- wxactivex.h
|
||||
|
||||
Source Files:
|
||||
- wxactivex.cpp
|
||||
|
||||
Event Handling:
|
||||
---------------
|
||||
- EVT_ACTIVEX(id, eventName, handler) (handler = void OnActiveX(wxActiveXEvent& event))
|
||||
- EVT_ACTIVEX_DISPID(id, eventDispId, handler) (handler = void OnActiveX(wxActiveXEvent& event))
|
||||
class wxActiveXEvent : public wxNotifyEvent
|
||||
wxString EventName();
|
||||
int ParamCount() const;
|
||||
wxString ParamType(int idx);
|
||||
wxString ParamName(int idx);
|
||||
wxVariant operator[] (int idx) const; // parameter by index
|
||||
wxVariant& operator[] (int idx);
|
||||
wxVariant operator[] (wxString name) const; // named parameters
|
||||
wxVariant& operator[] (wxString name);
|
||||
|
||||
|
||||
Members:
|
||||
--------
|
||||
wxActiveX::wxActiveX(wxWindow * parent, REFCLSID clsid, wxWindowID id = -1);
|
||||
- Creates a activeX control identified by clsid
|
||||
e.g
|
||||
wxFrame *frame = new wxFrame(this, -1, "test");
|
||||
wxActiveX *X = new wxActiveX(frame, CLSID_WebBrowser);
|
||||
|
||||
wxActiveX::wxActiveX(wxWindow * parent, wxString progId, wxWindowID id = -1);
|
||||
- Creates a activeX control identified by progId
|
||||
e.g.
|
||||
wxFrame *frame = new wxFrame(this, -1, "test");
|
||||
wxActiveX *X = new wxActiveX(frame, "MSCAL.Calendar");
|
||||
|
||||
|
||||
wxActiveX::~wxActiveX();
|
||||
- Destroys the control
|
||||
- disconnects all connection points
|
||||
|
||||
- int GetEventCount() const;
|
||||
Number of events generated by control
|
||||
|
||||
- const FuncX& GetEvent(int idx) const;
|
||||
Names, Params and Typeinfo for events
|
||||
|
||||
HRESULT wxActiveX::ConnectAdvise(REFIID riid, IUnknown *eventSink);
|
||||
- Connects a event sink. Connections are automaticlly diconnected in the destructor
|
||||
e.g.
|
||||
FS_DWebBrowserEvents2 *events = new FS_DWebBrowserEvents2(iecontrol);
|
||||
hret = iecontrol->ConnectAdvise(DIID_DWebBrowserEvents2, events);
|
||||
if (! SUCCEEDED(hret))
|
||||
delete events;
|
||||
|
||||
|
||||
Sample Events:
|
||||
--------------
|
||||
EVT_ACTIVEX(ID_MSHTML, "BeforeNavigate2", OnMSHTMLBeforeNavigate2X)
|
||||
|
||||
void wxIEFrame::OnMSHTMLBeforeNavigate2X(wxActiveXEvent& event)
|
||||
{
|
||||
wxString url = event["Url"];
|
||||
|
||||
int rc = wxMessageBox(url, "Allow open url ?", wxYES_NO);
|
||||
|
||||
if (rc != wxYES)
|
||||
event["Cancel"] = true;
|
||||
};
|
||||
|
||||
|
||||
wxIEHtmlWin:
|
||||
============
|
||||
wxIEHtmlWin is a specialisation of the wxActiveX control for hosting the MSHTML control.
|
||||
|
||||
Derived From:
|
||||
- wxActiveX
|
||||
- wxWindow
|
||||
|
||||
Event Handling:
|
||||
---------------
|
||||
- see wxActiveX
|
||||
Members:
|
||||
--------
|
||||
wxIEHtmlWin::wxIEHtmlWin(wxWindow * parent, wxWindowID id = -1);
|
||||
- Constructs and initialises the MSHTML control
|
||||
- LoadUrl("about:blank") is called
|
||||
|
||||
wxIEHtmlWin::~wxIEHtmlWin();
|
||||
- destroys the control
|
||||
|
||||
void wxIEHtmlWin::LoadUrl(const wxString&);
|
||||
- Attempts to browse to the url, the control uses its internal (MS)
|
||||
network streams
|
||||
|
||||
bool wxIEHtmlWin::LoadString(wxString html);
|
||||
- Load the passed HTML string
|
||||
|
||||
bool wxIEHtmlWin::LoadStream(istream *strm);
|
||||
- load the passed HTML stream. The control takes ownership of
|
||||
the pointer, deleting when finished.
|
||||
|
||||
bool wxIEHtmlWin::LoadStream(wxInputStream *is);
|
||||
- load the passed HTML stream. The control takes ownership of
|
||||
the pointer, deleting when finished.
|
||||
|
||||
void wxIEHtmlWin::SetCharset(wxString charset);
|
||||
- Sets the charset of the loaded document
|
||||
|
||||
void wxIEHtmlWin::SetEditMode(bool seton);
|
||||
- Sets edit mode.
|
||||
NOTE: This does work, but is bare bones - we need more events exposed before
|
||||
this is usable as an HTML editor.
|
||||
|
||||
bool wxIEHtmlWin::GetEditMode();
|
||||
- Returns the edit mode setting
|
||||
|
||||
wxString wxIEHtmlWin::GetStringSelection(bool asHTML = false);
|
||||
- Returns the currently selected text (plain or HTML text)
|
||||
|
||||
wxString GetText(bool asHTML = false);
|
||||
- Returns the body text (plain or HTML text)
|
||||
|
||||
Lindsay Mathieson
|
||||
Email : <lmathieson@optusnet.com.au>
|
@@ -1,70 +0,0 @@
|
||||
/*
|
||||
wxActiveX Library Licence, Version 3
|
||||
====================================
|
||||
|
||||
Copyright (C) 2003 Lindsay Mathieson [, ...]
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this licence document, but changing it is not allowed.
|
||||
|
||||
wxActiveX LIBRARY LICENCE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
This library is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library General Public Licence as published by
|
||||
the Free Software Foundation; either version 2 of the Licence, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
|
||||
General Public Licence for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public Licence
|
||||
along with this software, usually in a file named COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
Boston, MA 02111-1307 USA.
|
||||
|
||||
EXCEPTION NOTICE
|
||||
|
||||
1. As a special exception, the copyright holders of this library give
|
||||
permission for additional uses of the text contained in this release of
|
||||
the library as licenced under the wxActiveX Library Licence, applying
|
||||
either version 3 of the Licence, or (at your option) any later version of
|
||||
the Licence as published by the copyright holders of version 3 of the
|
||||
Licence document.
|
||||
|
||||
2. The exception is that you may use, copy, link, modify and distribute
|
||||
under the user's own terms, binary object code versions of works based
|
||||
on the Library.
|
||||
|
||||
3. If you copy code from files distributed under the terms of the GNU
|
||||
General Public Licence or the GNU Library General Public Licence into a
|
||||
copy of this library, as this licence permits, the exception does not
|
||||
apply to the code that you add in this way. To avoid misleading anyone as
|
||||
to the status of such modified files, you must delete this exception
|
||||
notice from such code and/or adjust the licensing conditions notice
|
||||
accordingly.
|
||||
|
||||
4. If you write modifications of your own for this library, it is your
|
||||
choice whether to permit this exception to apply to your modifications.
|
||||
If you do not wish that, you must delete the exception notice from such
|
||||
code and/or adjust the licensing conditions notice accordingly.
|
||||
*/
|
||||
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Developer Studio generated include file.
|
||||
// Used by wxIE.rc
|
||||
//
|
||||
#define DUMMY 4
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 102
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
#define _APS_NEXT_CONTROL_VALUE 1000
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
@@ -1,284 +0,0 @@
|
||||
/*
|
||||
wxActiveX Library Licence, Version 3
|
||||
====================================
|
||||
|
||||
Copyright (C) 2003 Lindsay Mathieson [, ...]
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this licence document, but changing it is not allowed.
|
||||
|
||||
wxActiveX LIBRARY LICENCE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
This library is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library General Public Licence as published by
|
||||
the Free Software Foundation; either version 2 of the Licence, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
|
||||
General Public Licence for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public Licence
|
||||
along with this software, usually in a file named COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
Boston, MA 02111-1307 USA.
|
||||
|
||||
EXCEPTION NOTICE
|
||||
|
||||
1. As a special exception, the copyright holders of this library give
|
||||
permission for additional uses of the text contained in this release of
|
||||
the library as licenced under the wxActiveX Library Licence, applying
|
||||
either version 3 of the Licence, or (at your option) any later version of
|
||||
the Licence as published by the copyright holders of version 3 of the
|
||||
Licence document.
|
||||
|
||||
2. The exception is that you may use, copy, link, modify and distribute
|
||||
under the user's own terms, binary object code versions of works based
|
||||
on the Library.
|
||||
|
||||
3. If you copy code from files distributed under the terms of the GNU
|
||||
General Public Licence or the GNU Library General Public Licence into a
|
||||
copy of this library, as this licence permits, the exception does not
|
||||
apply to the code that you add in this way. To avoid misleading anyone as
|
||||
to the status of such modified files, you must delete this exception
|
||||
notice from such code and/or adjust the licensing conditions notice
|
||||
accordingly.
|
||||
|
||||
4. If you write modifications of your own for this library, it is your
|
||||
choice whether to permit this exception to apply to your modifications.
|
||||
If you do not wish that, you must delete the exception notice from such
|
||||
code and/or adjust the licensing conditions notice accordingly.
|
||||
*/
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
// For compilers that support precompilation, includes "wx/wx.h".
|
||||
#if defined(__WXGTK__) || defined(__WXMOTIF__)
|
||||
#include "wx/wx.h"
|
||||
#endif
|
||||
#include "wx/wxprec.h"
|
||||
#include "wx/filedlg.h"
|
||||
#include "wx/textdlg.h"
|
||||
#include "wxActiveXFrame.h"
|
||||
#include <sstream>
|
||||
using namespace std;
|
||||
#include "wx/splitter.h"
|
||||
#include "wx/textctrl.h"
|
||||
#include "wx/clipbrd.h"
|
||||
#include <wx/msgdlg.h>
|
||||
|
||||
enum
|
||||
{
|
||||
// menu items
|
||||
MENU_GETTYPEINFO = 700,
|
||||
MENU_INVOKEMETHOD,
|
||||
MENU_TEST
|
||||
};
|
||||
|
||||
BEGIN_EVENT_TABLE(wxActiveXFrame, wxFrame)
|
||||
EVT_MENU(MENU_GETTYPEINFO, wxActiveXFrame::OnGetTypeInfo)
|
||||
EVT_MENU(MENU_INVOKEMETHOD, wxActiveXFrame::OnInvokeMethod)
|
||||
EVT_MENU(MENU_TEST, wxActiveXFrame::OnTest)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
|
||||
wxActiveXFrame::wxActiveXFrame(wxWindow *parent, wxString title) :
|
||||
wxFrame(parent, -1, title)
|
||||
{
|
||||
// create a menu bar
|
||||
wxMenu *xMenu = new wxMenu("", wxMENU_TEAROFF);
|
||||
|
||||
xMenu->Append(MENU_GETTYPEINFO, "Get Type Info", "");
|
||||
xMenu->Append(MENU_INVOKEMETHOD, "Invoke Method (no params)", "");
|
||||
xMenu->Append(MENU_TEST, "Test", "For debugging purposes");
|
||||
|
||||
// now append the freshly created menu to the menu bar...
|
||||
wxMenuBar *menuBar = new wxMenuBar();
|
||||
menuBar->Append(xMenu, "&ActiveX");
|
||||
|
||||
// ... and attach this menu bar to the frame
|
||||
SetMenuBar(menuBar);
|
||||
|
||||
wxSplitterWindow *sp = new wxSplitterWindow(this);
|
||||
X = new wxActiveX(sp, title, 101);
|
||||
|
||||
textLog = new wxTextCtrl(sp, -1, "", wxPoint(0,0), wxDefaultSize, wxTE_MULTILINE | wxTE_READONLY);
|
||||
|
||||
sp->SplitHorizontally(X, textLog, 0);
|
||||
|
||||
// conenct all events
|
||||
for (int i = 0; i < X->GetEventCount(); i++)
|
||||
{
|
||||
const wxActiveX::FuncX& func = X->GetEventDesc(i);
|
||||
const wxEventType& ev = RegisterActiveXEvent((DISPID) func.memid);
|
||||
Connect(101, ev, (wxObjectEventFunction) OnActiveXEvent);
|
||||
};
|
||||
}
|
||||
|
||||
wxString VarTypeAsString(VARTYPE vt)
|
||||
{
|
||||
#define VT(vtype, desc) case vtype : return desc
|
||||
|
||||
if (vt & VT_BYREF)
|
||||
vt -= VT_BYREF;
|
||||
|
||||
if (vt & VT_ARRAY)
|
||||
vt -= VT_ARRAY;
|
||||
|
||||
switch (vt)
|
||||
{
|
||||
VT(VT_SAFEARRAY, "SafeArray");
|
||||
VT(VT_EMPTY, "empty");
|
||||
VT(VT_NULL, "null");
|
||||
VT(VT_UI1, "byte");
|
||||
VT(VT_I1, "char");
|
||||
VT(VT_I2, "short");
|
||||
VT(VT_I4, "long");
|
||||
VT(VT_UI2, "unsigned short");
|
||||
VT(VT_UI4, "unsigned long");
|
||||
VT(VT_INT, "int");
|
||||
VT(VT_UINT, "unsigned int");
|
||||
VT(VT_R4, "real(4)");
|
||||
VT(VT_R8, "real(8)");
|
||||
VT(VT_CY, "Currency");
|
||||
VT(VT_DATE, "wxDate");
|
||||
VT(VT_BSTR, "wxString");
|
||||
VT(VT_DISPATCH, "IDispatch");
|
||||
VT(VT_ERROR, "SCode Error");
|
||||
VT(VT_BOOL, "bool");
|
||||
VT(VT_VARIANT, "wxVariant");
|
||||
VT(VT_UNKNOWN, "IUknown");
|
||||
VT(VT_VOID, "void");
|
||||
VT(VT_PTR, "void *");
|
||||
VT(VT_USERDEFINED, "*user defined*");
|
||||
|
||||
default:
|
||||
{
|
||||
wxString s;
|
||||
s << "Unknown(" << vt << ")";
|
||||
return s;
|
||||
};
|
||||
};
|
||||
|
||||
#undef VT
|
||||
};
|
||||
|
||||
#define ENDL "\r\n"
|
||||
|
||||
|
||||
void OutFunc(wxString& os, const wxActiveX::FuncX& func)
|
||||
{
|
||||
os << VarTypeAsString(func.retType.vt) << " " << func.name << "(";
|
||||
for (unsigned int p = 0; p < func.params.size(); p++)
|
||||
{
|
||||
const wxActiveX::ParamX& param = func.params[p];
|
||||
if (param.IsIn() && param.IsOut())
|
||||
os << "[IN OUT] ";
|
||||
else if (param.IsIn())
|
||||
os << "[IN] ";
|
||||
else if (param.IsIn())
|
||||
os << "[OUT] ";
|
||||
os << VarTypeAsString(param.vt) << " " << (param.isPtr ? "*" : "") << param.name;
|
||||
if (p < func.params.size() - 1)
|
||||
os << ", ";
|
||||
};
|
||||
os << ")" << ENDL;
|
||||
};
|
||||
|
||||
void wxActiveXFrame::OnGetTypeInfo(wxCommandEvent& event)
|
||||
{
|
||||
wxString os;
|
||||
|
||||
int i =0;
|
||||
os <<
|
||||
"Props" << ENDL <<
|
||||
"=====" << ENDL;
|
||||
for (i = 0; i < X->GetPropCount(); i++)
|
||||
{
|
||||
wxActiveX::PropX prop = X->GetPropDesc(i);
|
||||
os << VarTypeAsString(prop.type.vt) << " " << prop.name << "(";
|
||||
if (prop.CanSet())
|
||||
{
|
||||
os << VarTypeAsString(prop.arg.vt);
|
||||
};
|
||||
os << ")" << ENDL;
|
||||
|
||||
};
|
||||
os << ENDL;
|
||||
|
||||
os <<
|
||||
"Events" << ENDL <<
|
||||
"======" << ENDL;
|
||||
for (i = 0; i < X->GetEventCount(); i++)
|
||||
OutFunc(os, X->GetEventDesc(i));
|
||||
os << ENDL;
|
||||
|
||||
os <<
|
||||
"Methods" << ENDL <<
|
||||
"=======" << ENDL;
|
||||
for (i = 0; i < X->GetMethodCount(); i++)
|
||||
OutFunc(os, X->GetMethodDesc(i));
|
||||
os << ENDL;
|
||||
|
||||
|
||||
if (wxTheClipboard->Open())
|
||||
{
|
||||
wxDataObjectSimple *wo = new wxTextDataObject(os);
|
||||
wxTheClipboard->SetData(wo);
|
||||
wxTheClipboard->Flush();
|
||||
wxTheClipboard->Close();
|
||||
};
|
||||
|
||||
wxMessageBox(os, "Type Info", wxOK, this);
|
||||
};
|
||||
|
||||
void wxActiveXFrame::OnInvokeMethod(wxCommandEvent& event)
|
||||
{
|
||||
//wxTextEntryDialog dlg(this, "Method");
|
||||
//if (dlg.ShowModal() == wxID_OK)
|
||||
// X->CallMethod(dlg.GetValue());
|
||||
};
|
||||
|
||||
void wxActiveXFrame::OnTest(wxCommandEvent& event)
|
||||
{
|
||||
// flash testing
|
||||
wxVariant args[] = {0L, "http://www.macromedia.com/support/flash/ts/documents/java_script_comm/flash_to_javascript.swf"};
|
||||
X->CallMethod("LoadMovie", args);
|
||||
//X->Prop("Movie") = "http://www.macromedia.com/support/flash/ts/documents/java_script_comm/flash_to_javascript.swf";
|
||||
|
||||
// mc cal testing
|
||||
//X->Prop("year") = 1964L;
|
||||
//X->Prop("Value") = wxDateTime::Now();
|
||||
|
||||
// pdf testing
|
||||
//wxVariant file = "C:\\WINNT\\wx2\\docs\\pdf\\dialoged.pdf";
|
||||
//X->CallMethod("LoadFile", &file);
|
||||
};
|
||||
|
||||
void wxActiveXFrame::OnActiveXEvent(wxActiveXEvent& event)
|
||||
{
|
||||
#ifdef UNICODE
|
||||
wostringstream os;
|
||||
#else
|
||||
ostringstream os;
|
||||
#endif
|
||||
|
||||
os << (const wxChar *) event.EventName() << wxT("(");
|
||||
|
||||
for (int p = 0; p < event.ParamCount(); p++)
|
||||
{
|
||||
os <<
|
||||
(const wxChar *) event.ParamType(p) << wxT(" ") <<
|
||||
(const wxChar *) event.ParamName(p) << wxT(" = ") <<
|
||||
(const wxChar *) (wxString) event[p];
|
||||
if (p < event.ParamCount() - 1)
|
||||
os << wxT(", ");
|
||||
};
|
||||
os << wxT(")") << endl;
|
||||
wxString data = os.str().c_str();
|
||||
textLog->AppendText(data);
|
||||
};
|
||||
|
@@ -1,77 +0,0 @@
|
||||
/*
|
||||
wxActiveX Library Licence, Version 3
|
||||
====================================
|
||||
|
||||
Copyright (C) 2003 Lindsay Mathieson [, ...]
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this licence document, but changing it is not allowed.
|
||||
|
||||
wxActiveX LIBRARY LICENCE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
This library is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library General Public Licence as published by
|
||||
the Free Software Foundation; either version 2 of the Licence, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
|
||||
General Public Licence for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public Licence
|
||||
along with this software, usually in a file named COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
Boston, MA 02111-1307 USA.
|
||||
|
||||
EXCEPTION NOTICE
|
||||
|
||||
1. As a special exception, the copyright holders of this library give
|
||||
permission for additional uses of the text contained in this release of
|
||||
the library as licenced under the wxActiveX Library Licence, applying
|
||||
either version 3 of the Licence, or (at your option) any later version of
|
||||
the Licence as published by the copyright holders of version 3 of the
|
||||
Licence document.
|
||||
|
||||
2. The exception is that you may use, copy, link, modify and distribute
|
||||
under the user's own terms, binary object code versions of works based
|
||||
on the Library.
|
||||
|
||||
3. If you copy code from files distributed under the terms of the GNU
|
||||
General Public Licence or the GNU Library General Public Licence into a
|
||||
copy of this library, as this licence permits, the exception does not
|
||||
apply to the code that you add in this way. To avoid misleading anyone as
|
||||
to the status of such modified files, you must delete this exception
|
||||
notice from such code and/or adjust the licensing conditions notice
|
||||
accordingly.
|
||||
|
||||
4. If you write modifications of your own for this library, it is your
|
||||
choice whether to permit this exception to apply to your modifications.
|
||||
If you do not wish that, you must delete the exception notice from such
|
||||
code and/or adjust the licensing conditions notice accordingly.
|
||||
*/
|
||||
|
||||
#ifndef wxActiveXFrame_h
|
||||
#define wxActiveXFrame_h
|
||||
|
||||
#include "wxactivex.h"
|
||||
|
||||
class wxActiveXFrame : public wxFrame
|
||||
{
|
||||
public:
|
||||
wxActiveX *X;
|
||||
wxTextCtrl *textLog;
|
||||
|
||||
wxActiveXFrame(wxWindow *parent, wxString title);
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
|
||||
void OnGetTypeInfo(wxCommandEvent& event);
|
||||
void OnInvokeMethod(wxCommandEvent& event);
|
||||
void OnTest(wxCommandEvent& event);
|
||||
void OnActiveXEvent(wxActiveXEvent& event);
|
||||
};
|
||||
|
||||
|
||||
#endif
|
@@ -1,404 +0,0 @@
|
||||
# Microsoft Developer Studio Project File - Name="wxIE" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=wxIE - Win32 Unicode Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "wxIE.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "wxIE.mak" CFG="wxIE - Win32 Unicode Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "wxIE - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "wxIE - Win32 Debug" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "wxIE - Win32 Unicode Debug" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "wxIE - Win32 Unicode Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "wxIE - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O1 /Ob2 /I "$(WXWIN)\include" /I "$(WXWIN)\contrib\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /YX /FD /c
|
||||
# ADD BASE RSC /l 0xc09 /d "NDEBUG"
|
||||
# ADD RSC /l 0xc09 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wxmsw.lib /nologo /subsystem:windows /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libci.lib" /nodefaultlib:"msvcrtd.lib" /libpath:"$(WXWIN)\Lib" /libpath:"$(WXWIN)\contrib\Lib"
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ELSEIF "$(CFG)" == "wxIE - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "$(WXWIN)\lib\vc_dll\mswd" /I "$(WXWIN)\include" /I "$(WXWIN)\contrib\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D DEBUG=1 /D "__WXDEBUG__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /Yu"wx/wxprec.h" /FD /GZ /c
|
||||
# ADD BASE RSC /l 0xc09 /d "_DEBUG"
|
||||
# ADD RSC /l 0xc09 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wxbase25d.lib wxbase25d_net.lib wxbase25d_xml.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:"libcd.lib" /nodefaultlib:"libcid.lib" /nodefaultlib:"msvcrt.lib" /pdbtype:sept /libpath:"$(WXWIN)\Lib" /libpath:"$(WXWIN)\lib\vc_dll" /libpath:"$(WXWIN)\contrib\Lib"
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ELSEIF "$(CFG)" == "wxIE - Win32 Unicode Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "wxIE___Win32_Unicode_Debug"
|
||||
# PROP BASE Intermediate_Dir "wxIE___Win32_Unicode_Debug"
|
||||
# PROP BASE Ignore_Export_Lib 0
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "wxIE___Win32_Unicode_Debug"
|
||||
# PROP Intermediate_Dir "wxIE___Win32_Unicode_Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "$(WXWIN)\include" /I "$(WXWIN)\contrib\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D DEBUG=1 /D "__WXDEBUG__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /Yu"wx/wxprec.h" /FD /GZ /c
|
||||
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "$(WXWIN)\include" /I "$(WXWIN)\contrib\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D DEBUG=1 /D "__WXDEBUG__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /D UNICODE=1 /Yu"wx/wxprec.h" /FD /GZ /c
|
||||
# ADD BASE RSC /l 0xc09 /d "_DEBUG"
|
||||
# ADD RSC /l 0xc09 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wxmswd.lib pngd.lib zlibd.lib jpegd.lib tiffd.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:"libcd.lib" /nodefaultlib:"libcid.lib" /nodefaultlib:"msvcrt.lib" /out:"wxIE.exe" /pdbtype:sept /libpath:"$(WXWIN)\Lib" /libpath:"$(WXWIN)\contrib\Lib"
|
||||
# SUBTRACT BASE LINK32 /pdb:none
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wxmswud.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:"libcd.lib" /nodefaultlib:"libcid.lib" /nodefaultlib:"msvcrt.lib" /out:"wxIE.exe" /pdbtype:sept /libpath:"$(WXWIN)\Lib" /libpath:"$(WXWIN)\contrib\Lib"
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ELSEIF "$(CFG)" == "wxIE - Win32 Unicode Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "wxIE___Win32_Unicode_Release"
|
||||
# PROP BASE Intermediate_Dir "wxIE___Win32_Unicode_Release"
|
||||
# PROP BASE Ignore_Export_Lib 0
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "wxIE___Win32_Unicode_Release"
|
||||
# PROP Intermediate_Dir "wxIE___Win32_Unicode_Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MD /W3 /GX /O1 /Ob2 /I "$(WXWIN)\include" /I "$(WXWIN)\contrib\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O1 /Ob2 /I "$(WXWIN)\include" /I "$(WXWIN)\contrib\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /YX /FD /c
|
||||
# ADD BASE RSC /l 0xc09 /d "NDEBUG"
|
||||
# ADD RSC /l 0xc09 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wx.lib xpm.lib png.lib zlib.lib jpeg.lib tiff.lib /nologo /subsystem:windows /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libci.lib" /nodefaultlib:"msvcrtd.lib" /out:"wxIE.exe"
|
||||
# SUBTRACT BASE LINK32 /pdb:none
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wxmswu.lib /nologo /subsystem:windows /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libci.lib" /nodefaultlib:"msvcrtd.lib" /out:"wxIE.exe" /libpath:"$(WXWIN)\Lib" /libpath:"$(WXWIN)\contrib\Lib"
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "wxIE - Win32 Release"
|
||||
# Name "wxIE - Win32 Debug"
|
||||
# Name "wxIE - Win32 Unicode Debug"
|
||||
# Name "wxIE - Win32 Unicode Release"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\IEHtmlWin.cpp
|
||||
|
||||
!IF "$(CFG)" == "wxIE - Win32 Release"
|
||||
|
||||
# SUBTRACT CPP /YX
|
||||
|
||||
!ELSEIF "$(CFG)" == "wxIE - Win32 Debug"
|
||||
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
|
||||
!ELSEIF "$(CFG)" == "wxIE - Win32 Unicode Debug"
|
||||
|
||||
# SUBTRACT BASE CPP /YX /Yc /Yu
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
|
||||
!ELSEIF "$(CFG)" == "wxIE - Win32 Unicode Release"
|
||||
|
||||
# SUBTRACT BASE CPP /YX
|
||||
# SUBTRACT CPP /YX
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wxactivex.cpp
|
||||
|
||||
!IF "$(CFG)" == "wxIE - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "wxIE - Win32 Debug"
|
||||
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
|
||||
!ELSEIF "$(CFG)" == "wxIE - Win32 Unicode Debug"
|
||||
|
||||
# SUBTRACT BASE CPP /YX /Yc /Yu
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
|
||||
!ELSEIF "$(CFG)" == "wxIE - Win32 Unicode Release"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wxActiveXFrame.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wxIE.rc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wxIEApp.cpp
|
||||
# ADD CPP /Yc"wx/wxprec.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wxIEFrm.cpp
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\IEHtmlWin.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\resource.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wxactivex.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wxActiveXFrame.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wxIEApp.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wxIEFrm.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Resource Files"
|
||||
|
||||
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wx\msw\blank.cur
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wx\msw\bullseye.cur
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wx\msw\colours.bmp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wx\msw\cross.bmp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wx\msw\disable.bmp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wx\msw\error.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wx\msw\hand.cur
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wx\msw\info.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wx\msw\magnif1.cur
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wx\msw\noentry.cur
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wx\msw\pbrush.cur
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wx\msw\pencil.cur
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wx\msw\plot_dwn.bmp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wx\msw\plot_enl.bmp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wx\msw\plot_shr.bmp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wx\msw\plot_up.bmp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wx\msw\plot_zin.bmp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wx\msw\plot_zot.bmp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wx\msw\pntleft.cur
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wx\msw\pntright.cur
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wx\msw\query.cur
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wx\msw\question.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wx\msw\roller.cur
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wx\msw\size.cur
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wx\msw\tick.bmp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wx\msw\tip.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wx\msw\warning.ico
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wx\msw\watch1.cur
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wxIE.ico
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\default.doxygen
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\license.txt
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\makefile
|
||||
# PROP Exclude_From_Scan -1
|
||||
# PROP BASE Exclude_From_Build 1
|
||||
# PROP Exclude_From_Build 1
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\makefile.gtk
|
||||
# PROP Exclude_From_Scan -1
|
||||
# PROP BASE Exclude_From_Build 1
|
||||
# PROP Exclude_From_Build 1
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\makefile.mtf
|
||||
# PROP Exclude_From_Scan -1
|
||||
# PROP BASE Exclude_From_Build 1
|
||||
# PROP Exclude_From_Build 1
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\notes.txt
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\readme.txt
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\wxIE.xpm
|
||||
# PROP Exclude_From_Scan -1
|
||||
# PROP BASE Exclude_From_Build 1
|
||||
# PROP Exclude_From_Build 1
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
Binary file not shown.
Before Width: | Height: | Size: 766 B |
@@ -1,169 +0,0 @@
|
||||
//Microsoft Developer Studio generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
//#include "afxres.h"
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
#include <winuser.rh>
|
||||
#include <commctrl.rh>
|
||||
#include <dde.rh>
|
||||
#include <winnt.rh>
|
||||
#include <dlgs.h>
|
||||
#include <winver.h>
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (U.S.) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#include ""afxres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Bitmap
|
||||
//
|
||||
|
||||
/*
|
||||
WXDISABLE_BUTTON_BITMAP BITMAP MOVEABLE PURE "wx/msw/disable.bmp"
|
||||
WXBITMAP_STD_COLOURS BITMAP MOVEABLE PURE "wx/msw/colours.bmp"
|
||||
TICK_BMP BITMAP MOVEABLE PURE "wx/msw/tick.bmp"
|
||||
PLOT_ZOT_BMP BITMAP MOVEABLE PURE "wx/msw/plot_zot.bmp"
|
||||
PLOT_ZIN_BMP BITMAP MOVEABLE PURE "wx/msw/plot_zin.bmp"
|
||||
PLOT_UP_BMP BITMAP MOVEABLE PURE "wx/msw/plot_up.bmp"
|
||||
PLOT_SHR_BMP BITMAP MOVEABLE PURE "wx/msw/plot_shr.bmp"
|
||||
PLOT_ENL_BMP BITMAP MOVEABLE PURE "wx/msw/plot_enl.bmp"
|
||||
PLOT_DWN_BMP BITMAP MOVEABLE PURE "wx/msw/plot_dwn.bmp"
|
||||
CROSS_BMP BITMAP MOVEABLE PURE "wx/msw/cross.bmp"
|
||||
*/
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Cursor
|
||||
//
|
||||
|
||||
/*
|
||||
WXCURSOR_WATCH CURSOR DISCARDABLE "wx\\msw\\watch1.cur"
|
||||
WXCURSOR_SIZING CURSOR DISCARDABLE "wx/msw/size.cur"
|
||||
WXCURSOR_ROLLER CURSOR DISCARDABLE "wx/msw/roller.cur"
|
||||
WXCURSOR_QARROW CURSOR DISCARDABLE "wx/msw/query.cur"
|
||||
WXCURSOR_PRIGHT CURSOR DISCARDABLE "wx/msw/pntright.cur"
|
||||
WXCURSOR_PLEFT CURSOR DISCARDABLE "wx/msw/pntleft.cur"
|
||||
WXCURSOR_PENCIL CURSOR DISCARDABLE "wx/msw/pencil.cur"
|
||||
WXCURSOR_PBRUSH CURSOR DISCARDABLE "wx/msw/pbrush.cur"
|
||||
WXCURSOR_NO_ENTRY CURSOR DISCARDABLE "wx/msw/noentry.cur"
|
||||
WXCURSOR_MAGNIFIER CURSOR DISCARDABLE "wx/msw/magnif1.cur"
|
||||
WXCURSOR_HAND CURSOR DISCARDABLE "wx/msw/hand.cur"
|
||||
WXCURSOR_BULLSEYE CURSOR DISCARDABLE "wx/msw/bullseye.cur"
|
||||
WXCURSOR_BLANK CURSOR DISCARDABLE "wx/msw/blank.cur"
|
||||
*/
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
WXRESIZEABLEDIALOG DIALOG DISCARDABLE 34, 22, 144, 75
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
|
||||
BEGIN
|
||||
END
|
||||
|
||||
WXNOCAPTIONDIALOG DIALOG DISCARDABLE 34, 22, 144, 75
|
||||
STYLE WS_POPUP
|
||||
BEGIN
|
||||
END
|
||||
|
||||
WXCAPTIONDIALOG DIALOG DISCARDABLE 34, 22, 144, 75
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Dummy dialog"
|
||||
BEGIN
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Icon
|
||||
//
|
||||
|
||||
// Icon with lowest ID value placed first to ensure application icon
|
||||
// remains consistent on all systems.
|
||||
WXIE ICON DISCARDABLE "wxIE.ico"
|
||||
/*
|
||||
WXICON_WARNING ICON DISCARDABLE "wx\\msw\\warning.ico"
|
||||
WXICON_TIP ICON DISCARDABLE "wx/msw/tip.ico"
|
||||
WXICON_QUESTION ICON DISCARDABLE "wx/msw/question.ico"
|
||||
WXICON_INFO ICON DISCARDABLE "wx/msw/info.ico"
|
||||
WXICON_ERROR ICON DISCARDABLE "wx/msw/error.ico"
|
||||
*/
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Menu
|
||||
//
|
||||
|
||||
WXWINDOWMENU MENU DISCARDABLE
|
||||
BEGIN
|
||||
POPUP "&Window"
|
||||
BEGIN
|
||||
MENUITEM "&Cascade", 4002
|
||||
MENUITEM "Tile &Horizontally", 4001
|
||||
MENUITEM "Tile &Vertically", 4005
|
||||
MENUITEM "", 65535
|
||||
MENUITEM "&Arrange Icons", 4003
|
||||
MENUITEM "&Next", 4004
|
||||
END
|
||||
END
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
@@ -1,44 +0,0 @@
|
||||
/* XPM */
|
||||
static char *wxIE_xpm[] = {
|
||||
/* columns rows colors chars-per-pixel */
|
||||
"32 32 6 1",
|
||||
" c Black",
|
||||
". c Blue",
|
||||
"X c #00bf00",
|
||||
"o c Red",
|
||||
"O c Yellow",
|
||||
"+ c Gray100",
|
||||
/* pixels */
|
||||
" ",
|
||||
" oooooo +++++++++++++++++++++++ ",
|
||||
" oooooo +++++++++++++++++++++++ ",
|
||||
" oooooo +++++++++++++++++++++++ ",
|
||||
" oooooo +++++++++++++++++++++++ ",
|
||||
" oooooo +++++++++++++++++++++++ ",
|
||||
" oooooo +++++++++++++++++++++++ ",
|
||||
" oooooo +++++++++++++++++++++++ ",
|
||||
" ",
|
||||
" ++++++ ++++++++++++++++++ .... ",
|
||||
" ++++++ ++++++++++++++++++ .... ",
|
||||
" ++++++ ++++++++++++++++++ .... ",
|
||||
" ++++++ ++++++++++++++++++ .... ",
|
||||
" ++++++ ++++++++++++++++++ .... ",
|
||||
" ++++++ ++++++++++++++++++ ",
|
||||
" ++++++ ++++++++++++++++++ ++++ ",
|
||||
" ++++++ ++++++++++++++++++ ++++ ",
|
||||
" ++++++ ++++++++++++++++++ ++++ ",
|
||||
" ++++++ ++++++++++++++++++ ++++ ",
|
||||
" ++++++ ++++++++++++++++++ ++++ ",
|
||||
" ++++++ ++++++++++++++++++ ++++ ",
|
||||
" ++++++ ++++++++++++++++++ ++++ ",
|
||||
" ++++++ ++++++++++++++++++ ++++ ",
|
||||
" ++++++ ++++++++++++++++++ ++++ ",
|
||||
" ++++++ ++++ ",
|
||||
" ++++++ OOOOOOOOOOOO XXXXX ++++ ",
|
||||
" ++++++ OOOOOOOOOOOO XXXXX ++++ ",
|
||||
" ++++++ OOOOOOOOOOOO XXXXX ++++ ",
|
||||
" ++++++ OOOOOOOOOOOO XXXXX ++++ ",
|
||||
" ++++++ OOOOOOOOOOOO XXXXX ++++ ",
|
||||
" ++++++ OOOOOOOOOOOO XXXXX ++++ ",
|
||||
" "
|
||||
};
|
@@ -1,99 +0,0 @@
|
||||
/*
|
||||
wxActiveX Library Licence, Version 3
|
||||
====================================
|
||||
|
||||
Copyright (C) 2003 Lindsay Mathieson [, ...]
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this licence document, but changing it is not allowed.
|
||||
|
||||
wxActiveX LIBRARY LICENCE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
This library is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library General Public Licence as published by
|
||||
the Free Software Foundation; either version 2 of the Licence, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
|
||||
General Public Licence for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public Licence
|
||||
along with this software, usually in a file named COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
Boston, MA 02111-1307 USA.
|
||||
|
||||
EXCEPTION NOTICE
|
||||
|
||||
1. As a special exception, the copyright holders of this library give
|
||||
permission for additional uses of the text contained in this release of
|
||||
the library as licenced under the wxActiveX Library Licence, applying
|
||||
either version 3 of the Licence, or (at your option) any later version of
|
||||
the Licence as published by the copyright holders of version 3 of the
|
||||
Licence document.
|
||||
|
||||
2. The exception is that you may use, copy, link, modify and distribute
|
||||
under the user's own terms, binary object code versions of works based
|
||||
on the Library.
|
||||
|
||||
3. If you copy code from files distributed under the terms of the GNU
|
||||
General Public Licence or the GNU Library General Public Licence into a
|
||||
copy of this library, as this licence permits, the exception does not
|
||||
apply to the code that you add in this way. To avoid misleading anyone as
|
||||
to the status of such modified files, you must delete this exception
|
||||
notice from such code and/or adjust the licensing conditions notice
|
||||
accordingly.
|
||||
|
||||
4. If you write modifications of your own for this library, it is your
|
||||
choice whether to permit this exception to apply to your modifications.
|
||||
If you do not wish that, you must delete the exception notice from such
|
||||
code and/or adjust the licensing conditions notice accordingly.
|
||||
*/
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
// For compilers that support precompilation, includes "wx/wx.h".
|
||||
#if defined(__WXGTK__) || defined(__WXMOTIF__)
|
||||
#include "wx/wx.h"
|
||||
#endif
|
||||
#include "wx/wxprec.h"
|
||||
#include "wxIEApp.h"
|
||||
#include "wxIEFrm.h"
|
||||
#include "resource.h"
|
||||
|
||||
|
||||
|
||||
// Create a new application object: this macro will allow wxWindows to create
|
||||
// the application object during program execution (it's better than using a
|
||||
// static object for many reasons) and also declares the accessor function
|
||||
// wxGetApp() which will return the reference of the right type (i.e. wxIEApp and
|
||||
// not wxApp)
|
||||
IMPLEMENT_APP(wxIEApp)
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// the application class
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// 'Main program' equivalent: the program execution "starts" here
|
||||
bool wxIEApp::OnInit()
|
||||
{
|
||||
// create the main application window
|
||||
wxIEFrame *frame = new wxIEFrame(wxT("IE Test"));
|
||||
|
||||
// and show it (the frames, unlike simple controls, are not shown when
|
||||
// created initially)
|
||||
frame->Show(TRUE);
|
||||
|
||||
// success: wxApp::OnRun() will be called which will enter the main message
|
||||
// loop and the application will run. If we returned FALSE here, the
|
||||
// application would exit immediately.
|
||||
return TRUE;
|
||||
}
|
||||
|
@@ -1,66 +0,0 @@
|
||||
/*
|
||||
wxActiveX Library Licence, Version 3
|
||||
====================================
|
||||
|
||||
Copyright (C) 2003 Lindsay Mathieson [, ...]
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this licence document, but changing it is not allowed.
|
||||
|
||||
wxActiveX LIBRARY LICENCE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
This library is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library General Public Licence as published by
|
||||
the Free Software Foundation; either version 2 of the Licence, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
|
||||
General Public Licence for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public Licence
|
||||
along with this software, usually in a file named COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
Boston, MA 02111-1307 USA.
|
||||
|
||||
EXCEPTION NOTICE
|
||||
|
||||
1. As a special exception, the copyright holders of this library give
|
||||
permission for additional uses of the text contained in this release of
|
||||
the library as licenced under the wxActiveX Library Licence, applying
|
||||
either version 3 of the Licence, or (at your option) any later version of
|
||||
the Licence as published by the copyright holders of version 3 of the
|
||||
Licence document.
|
||||
|
||||
2. The exception is that you may use, copy, link, modify and distribute
|
||||
under the user's own terms, binary object code versions of works based
|
||||
on the Library.
|
||||
|
||||
3. If you copy code from files distributed under the terms of the GNU
|
||||
General Public Licence or the GNU Library General Public Licence into a
|
||||
copy of this library, as this licence permits, the exception does not
|
||||
apply to the code that you add in this way. To avoid misleading anyone as
|
||||
to the status of such modified files, you must delete this exception
|
||||
notice from such code and/or adjust the licensing conditions notice
|
||||
accordingly.
|
||||
|
||||
4. If you write modifications of your own for this library, it is your
|
||||
choice whether to permit this exception to apply to your modifications.
|
||||
If you do not wish that, you must delete the exception notice from such
|
||||
code and/or adjust the licensing conditions notice accordingly.
|
||||
*/
|
||||
|
||||
// Define a new application type, each program should derive a class from wxApp
|
||||
class wxIEApp : public wxApp
|
||||
{
|
||||
public:
|
||||
// override base class virtuals
|
||||
// ----------------------------
|
||||
|
||||
// this one is called on application startup and is a good place for the app
|
||||
// initialization (doing it here and not in the ctor allows to have an error
|
||||
// return: if OnInit() returns false, the application terminates)
|
||||
virtual bool OnInit();
|
||||
};
|
@@ -1,381 +0,0 @@
|
||||
/*
|
||||
wxActiveX Library Licence, Version 3
|
||||
====================================
|
||||
|
||||
Copyright (C) 2003 Lindsay Mathieson [, ...]
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this licence document, but changing it is not allowed.
|
||||
|
||||
wxActiveX LIBRARY LICENCE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
This library is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library General Public Licence as published by
|
||||
the Free Software Foundation; either version 2 of the Licence, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
|
||||
General Public Licence for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public Licence
|
||||
along with this software, usually in a file named COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
Boston, MA 02111-1307 USA.
|
||||
|
||||
EXCEPTION NOTICE
|
||||
|
||||
1. As a special exception, the copyright holders of this library give
|
||||
permission for additional uses of the text contained in this release of
|
||||
the library as licenced under the wxActiveX Library Licence, applying
|
||||
either version 3 of the Licence, or (at your option) any later version of
|
||||
the Licence as published by the copyright holders of version 3 of the
|
||||
Licence document.
|
||||
|
||||
2. The exception is that you may use, copy, link, modify and distribute
|
||||
under the user's own terms, binary object code versions of works based
|
||||
on the Library.
|
||||
|
||||
3. If you copy code from files distributed under the terms of the GNU
|
||||
General Public Licence or the GNU Library General Public Licence into a
|
||||
copy of this library, as this licence permits, the exception does not
|
||||
apply to the code that you add in this way. To avoid misleading anyone as
|
||||
to the status of such modified files, you must delete this exception
|
||||
notice from such code and/or adjust the licensing conditions notice
|
||||
accordingly.
|
||||
|
||||
4. If you write modifications of your own for this library, it is your
|
||||
choice whether to permit this exception to apply to your modifications.
|
||||
If you do not wish that, you must delete the exception notice from such
|
||||
code and/or adjust the licensing conditions notice accordingly.
|
||||
*/
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
// For compilers that support precompilation, includes "wx/wx.h".
|
||||
#if defined(__WXGTK__) || defined(__WXMOTIF__)
|
||||
#include "wx/wx.h"
|
||||
#endif
|
||||
#include "wx/wxprec.h"
|
||||
#include "wx/filedlg.h"
|
||||
#include "wxIEApp.h"
|
||||
#include "wxIEFrm.h"
|
||||
#include "wxActiveXFrame.h"
|
||||
#include <istream>
|
||||
#include <fstream>
|
||||
using namespace std;
|
||||
#include <exdispid.h>
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// resources
|
||||
// ----------------------------------------------------------------------------
|
||||
// the application icon
|
||||
#if defined(__WXGTK__) || defined(__WXMOTIF__)
|
||||
#include "wxIE.xpm"
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// constants
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// IDs for the controls and the menu commands
|
||||
enum
|
||||
{
|
||||
// menu items
|
||||
FILE_QUIT = 1,
|
||||
FILE_OPEN,
|
||||
FILE_BROWSE,
|
||||
FILE_HTML_EDITMODE,
|
||||
FILE_TEST_HTML,
|
||||
FILE_TEST_SELECT,
|
||||
FILE_TEST_HTMLSELECT,
|
||||
FILE_TEST_GETTEXT,
|
||||
FILE_TEST_HTMLGETTEXT,
|
||||
FILE_TEST_HOME,
|
||||
FILE_TEST_ACTIVEX,
|
||||
FILE_ABOUT,
|
||||
|
||||
// controls
|
||||
ID_MSHTML = 501,
|
||||
ID_PROGRESS_GAUGE
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// event tables and other macros for wxWindows
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// the event tables connect the wxWindows events with the functions (event
|
||||
// handlers) which process them. It can be also done at run-time, but for the
|
||||
// simple menu events like this the static method is much simpler.
|
||||
BEGIN_EVENT_TABLE(wxIEFrame, wxFrame)
|
||||
EVT_SIZE(wxIEFrame::OnSize)
|
||||
EVT_MENU(FILE_QUIT, wxIEFrame::OnQuit)
|
||||
EVT_MENU(FILE_BROWSE, wxIEFrame::OnBrowse)
|
||||
EVT_MENU(FILE_OPEN, wxIEFrame::OnOpen)
|
||||
EVT_MENU(FILE_HTML_EDITMODE, wxIEFrame::OnEditMode)
|
||||
EVT_UPDATE_UI(FILE_HTML_EDITMODE, wxIEFrame::OnEditModeUI)
|
||||
EVT_MENU(FILE_TEST_HTML, wxIEFrame::OnTestHTML)
|
||||
EVT_MENU(FILE_TEST_SELECT, wxIEFrame::OnTestSelect)
|
||||
EVT_MENU(FILE_TEST_HTMLSELECT, wxIEFrame::OnTestHTMLSelect)
|
||||
EVT_MENU(FILE_TEST_GETTEXT, wxIEFrame::OnTestGetText)
|
||||
EVT_MENU(FILE_TEST_HTMLGETTEXT, wxIEFrame::OnTestHTMLGetText)
|
||||
EVT_MENU(FILE_TEST_HOME, wxIEFrame::OnTestHome)
|
||||
EVT_MENU(FILE_TEST_ACTIVEX, wxIEFrame::OnTestActiveX)
|
||||
EVT_MENU(FILE_ABOUT, wxIEFrame::OnAbout)
|
||||
|
||||
// ActiveX Events
|
||||
EVT_ACTIVEX_DISPID(ID_MSHTML, DISPID_STATUSTEXTCHANGE, OnMSHTMLStatusTextChangeX)
|
||||
EVT_ACTIVEX(ID_MSHTML, "BeforeNavigate2", OnMSHTMLBeforeNavigate2X)
|
||||
EVT_ACTIVEX(ID_MSHTML, "TitleChange", OnMSHTMLTitleChangeX)
|
||||
EVT_ACTIVEX(ID_MSHTML, "NewWindow2", OnMSHTMLNewWindow2X)
|
||||
EVT_ACTIVEX(ID_MSHTML, "ProgressChange", OnMSHTMLProgressChangeX)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// main frame
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// frame constructor
|
||||
wxIEFrame::wxIEFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
|
||||
: wxFrame((wxFrame *)NULL, -1, title, pos, size)
|
||||
{
|
||||
// set the frame icon
|
||||
SetIcon(wxICON(wxIE));
|
||||
|
||||
// create a menu bar
|
||||
wxMenu *menuFile = new wxMenu("", wxMENU_TEAROFF);
|
||||
|
||||
// the "About" item should be in the help menu
|
||||
wxMenu *helpMenu = new wxMenu;
|
||||
helpMenu->Append(FILE_ABOUT, "&About...\tCtrl-A", "Show about dialog");
|
||||
|
||||
menuFile->Append(FILE_TEST_HTML, "Test HTML", "Demonstrates LoadString()");
|
||||
menuFile->Append(FILE_OPEN, "Open HTML File", "Demonstrates LoadStream(istream *)");
|
||||
menuFile->Append(FILE_BROWSE, "Browse Web Page", "Demonstrates LoadUrl(url)");
|
||||
menuFile->Append(FILE_HTML_EDITMODE, "Edit Mode", "Demonstrates editing html", true);
|
||||
menuFile->AppendSeparator();
|
||||
menuFile->Append(FILE_TEST_SELECT, "Get Selected Text", "Demonstrates GetStringSelection(false)");
|
||||
menuFile->Append(FILE_TEST_HTMLSELECT, "Get HTML Selected Text", "Demonstrates GetStringSelection(true)");
|
||||
menuFile->AppendSeparator();
|
||||
menuFile->Append(FILE_TEST_GETTEXT, "Get Text", "Demonstrates GetText(false)");
|
||||
menuFile->Append(FILE_TEST_HTMLGETTEXT, "Get HTML Text", "Demonstrates GetText(true)");
|
||||
menuFile->Append(FILE_TEST_HOME, "Open Home Page", "Demonstrates GoHome()");
|
||||
menuFile->AppendSeparator();
|
||||
menuFile->Append(FILE_TEST_ACTIVEX, "Display a ActiveX control", "Demonstrates the Generic ActiveX Container");
|
||||
menuFile->AppendSeparator();
|
||||
menuFile->Append(FILE_QUIT, "E&xit\tAlt-X", "Quit this program");
|
||||
|
||||
// now append the freshly created menu to the menu bar...
|
||||
wxMenuBar *menuBar = new wxMenuBar();
|
||||
menuBar->Append(menuFile, "&File");
|
||||
menuBar->Append(helpMenu, "&Help");
|
||||
|
||||
// ... and attach this menu bar to the frame
|
||||
SetMenuBar(menuBar);
|
||||
|
||||
// create a status bar just for fun (by default with 1 pane only)
|
||||
wxStatusBar * sb = CreateStatusBar(2);
|
||||
SetStatusText("Ready");
|
||||
|
||||
// progress gauge (belongs to status bar)
|
||||
m_gauge = new wxGauge(sb, ID_PROGRESS_GAUGE, 100);
|
||||
|
||||
// IE Control
|
||||
m_ie = new wxIEHtmlWin(this, ID_MSHTML);
|
||||
|
||||
}
|
||||
|
||||
|
||||
// event handlers
|
||||
|
||||
void wxIEFrame::OnSize(wxSizeEvent& event)
|
||||
{
|
||||
wxFrame::OnSize(event);
|
||||
|
||||
wxStatusBar* sb = GetStatusBar();
|
||||
if (! sb)
|
||||
return;
|
||||
|
||||
wxRect rc;
|
||||
sb->GetFieldRect(1, rc);
|
||||
|
||||
m_gauge->SetSize(rc);
|
||||
};
|
||||
|
||||
void wxIEFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
// TRUE is to force the frame to close
|
||||
Close(TRUE);
|
||||
}
|
||||
|
||||
void wxIEFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
wxString msg;
|
||||
msg.Printf( _T("About wxIE...\n"));
|
||||
wxMessageBox(msg, "About wxIE", wxOK | wxICON_INFORMATION, this);
|
||||
}
|
||||
|
||||
void wxIEFrame::OnTestHTML(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
wxString html =
|
||||
"<HTML><BODY><H1>Hello World</H1>Plain Text</body></html>";
|
||||
m_ie->LoadString(html);
|
||||
}
|
||||
|
||||
|
||||
void wxIEFrame::OnTestSelect(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
wxString s = m_ie->GetStringSelection();
|
||||
|
||||
wxMessageBox(s);
|
||||
}
|
||||
|
||||
void wxIEFrame::OnTestHTMLSelect(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
wxString s = m_ie->GetStringSelection(true);
|
||||
|
||||
wxMessageBox(s);
|
||||
}
|
||||
|
||||
void wxIEFrame::OnTestGetText(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
wxString s = m_ie->GetText();
|
||||
|
||||
wxMessageBox(s);
|
||||
}
|
||||
|
||||
void wxIEFrame::OnTestHTMLGetText(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
wxString s = m_ie->GetText(true);
|
||||
|
||||
wxMessageBox(s);
|
||||
}
|
||||
|
||||
void wxIEFrame::OnTestHome(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
m_ie->GoHome();
|
||||
};
|
||||
|
||||
|
||||
void wxIEFrame::OnOpen(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
wxFileDialog dlg(this, "Chooose a HTML File", "", "", "HTML files (*.html; *.htm)|*.html;*.htm|",wxOPEN);
|
||||
|
||||
if (dlg.ShowModal() == wxID_OK)
|
||||
{
|
||||
wxString fname = dlg.GetPath();
|
||||
|
||||
ifstream *is = new ifstream(fname.mb_str());
|
||||
m_ie->LoadStream(is);
|
||||
};
|
||||
}
|
||||
|
||||
void wxIEFrame::OnEditMode(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
m_ie->SetEditMode(! m_ie->GetEditMode());
|
||||
}
|
||||
|
||||
void wxIEFrame::OnEditModeUI(wxUpdateUIEvent& event)
|
||||
{
|
||||
if (m_ie)
|
||||
event.Check(m_ie->GetEditMode());
|
||||
}
|
||||
|
||||
void wxIEFrame::OnBrowse(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
wxString url = wxGetTextFromUser("Enter URL:", "Browse", "", this);
|
||||
|
||||
m_ie->LoadUrl(url);
|
||||
}
|
||||
|
||||
void wxIEFrame::OnMSHTMLStatusTextChangeX(wxActiveXEvent& event)
|
||||
{
|
||||
SetStatusText(event["Text"]);
|
||||
};
|
||||
|
||||
|
||||
void wxIEFrame::OnMSHTMLBeforeNavigate2X(wxActiveXEvent& event)
|
||||
{
|
||||
wxString url = event["Url"];
|
||||
if (url == "about:blank")
|
||||
return;
|
||||
|
||||
int rc = wxMessageBox(url, "Allow open url ?", wxYES_NO);
|
||||
|
||||
if (rc != wxYES)
|
||||
event["Cancel"] = true;
|
||||
};
|
||||
|
||||
void wxIEFrame::OnMSHTMLTitleChangeX(wxActiveXEvent& event)
|
||||
{
|
||||
SetTitle(event["Text"]);
|
||||
};
|
||||
|
||||
|
||||
void wxIEFrame::OnMSHTMLNewWindow2X(wxActiveXEvent& event)
|
||||
{
|
||||
int rc = wxMessageBox("New Window requested", "Allow New Window ?", wxYES_NO);
|
||||
|
||||
if (rc != wxYES)
|
||||
event["Cancel"] = true;
|
||||
};
|
||||
|
||||
|
||||
void wxIEFrame::OnMSHTMLProgressChangeX(wxActiveXEvent& event)
|
||||
{
|
||||
if ((long) event["ProgressMax"] != m_gauge->GetRange())
|
||||
m_gauge->SetRange((long) event["ProgressMax"]);
|
||||
|
||||
m_gauge->SetValue((long) event["Progress"]);
|
||||
};
|
||||
|
||||
void wxIEFrame::OnTestActiveX(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
// Some known prog ids
|
||||
//#define PROGID "Shell.Explorer"
|
||||
//#define PROGID CLSID_WebBrowser
|
||||
//#define PROGID CLSID_MozillaBrowser
|
||||
//#define PROGID CLSID_HTMLDocument
|
||||
//#define PROGID "MSCAL.Calendar"
|
||||
//#define PROGID "WordPad.Document"
|
||||
//#define PROGID "SoftwareFX.ChartFX"
|
||||
//#define PROGID "PDF.PdfCtrl"
|
||||
#define PROGID "ShockwaveFlash.ShockwaveFlash"
|
||||
|
||||
wxDialog dlg(this, -1, wxString(wxT("Test ActiveX")));
|
||||
|
||||
wxFlexGridSizer *sz = new wxFlexGridSizer(2);
|
||||
sz->Add(new wxStaticText(&dlg, -1, wxT("Enter a ActiveX ProgId")), 0, wxALL, 5 );
|
||||
|
||||
wxComboBox *cb = new wxComboBox(&dlg, 101, "");
|
||||
cb->Append(wxT("ShockwaveFlash.ShockwaveFlash"));
|
||||
cb->Append(wxT("MSCAL.Calendar"));
|
||||
cb->Append(wxT("Shell.Explorer"));
|
||||
cb->Append(wxT("WordPad.Document.1"));
|
||||
cb->Append(wxT("SoftwareFX.ChartFX.20"));
|
||||
cb->Append(wxT("PDF.PdfCtrl.5"));
|
||||
cb->SetSelection(0);
|
||||
|
||||
sz->Add(cb, 0, wxALL, 5 );
|
||||
|
||||
// next row
|
||||
sz->Add(new wxButton(&dlg, wxID_CANCEL, "Cancel"), 0, wxALIGN_RIGHT|wxALL, 5 );
|
||||
sz->Add(new wxButton(&dlg, wxID_OK, "Ok"), 0, wxALIGN_RIGHT|wxALL, 5 );
|
||||
|
||||
dlg.SetAutoLayout( TRUE );
|
||||
dlg.SetSizer(sz);
|
||||
sz->Fit(&dlg);
|
||||
sz->SetSizeHints(&dlg);
|
||||
|
||||
|
||||
if (dlg.ShowModal() == wxID_OK)
|
||||
{
|
||||
wxString progId = cb->GetValue();
|
||||
wxActiveXFrame *frame = new wxActiveXFrame(this, progId);
|
||||
frame->Show();
|
||||
};
|
||||
}
|
||||
|
@@ -1,95 +0,0 @@
|
||||
/*
|
||||
wxActiveX Library Licence, Version 3
|
||||
====================================
|
||||
|
||||
Copyright (C) 2003 Lindsay Mathieson [, ...]
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this licence document, but changing it is not allowed.
|
||||
|
||||
wxActiveX LIBRARY LICENCE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
This library is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library General Public Licence as published by
|
||||
the Free Software Foundation; either version 2 of the Licence, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
|
||||
General Public Licence for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public Licence
|
||||
along with this software, usually in a file named COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
Boston, MA 02111-1307 USA.
|
||||
|
||||
EXCEPTION NOTICE
|
||||
|
||||
1. As a special exception, the copyright holders of this library give
|
||||
permission for additional uses of the text contained in this release of
|
||||
the library as licenced under the wxActiveX Library Licence, applying
|
||||
either version 3 of the Licence, or (at your option) any later version of
|
||||
the Licence as published by the copyright holders of version 3 of the
|
||||
Licence document.
|
||||
|
||||
2. The exception is that you may use, copy, link, modify and distribute
|
||||
under the user's own terms, binary object code versions of works based
|
||||
on the Library.
|
||||
|
||||
3. If you copy code from files distributed under the terms of the GNU
|
||||
General Public Licence or the GNU Library General Public Licence into a
|
||||
copy of this library, as this licence permits, the exception does not
|
||||
apply to the code that you add in this way. To avoid misleading anyone as
|
||||
to the status of such modified files, you must delete this exception
|
||||
notice from such code and/or adjust the licensing conditions notice
|
||||
accordingly.
|
||||
|
||||
4. If you write modifications of your own for this library, it is your
|
||||
choice whether to permit this exception to apply to your modifications.
|
||||
If you do not wish that, you must delete the exception notice from such
|
||||
code and/or adjust the licensing conditions notice accordingly.
|
||||
*/
|
||||
|
||||
#include "IEHtmlWin.h"
|
||||
#include "wx/gauge.h"
|
||||
|
||||
// Define a new frame type: this is going to be our main frame
|
||||
class wxIEFrame : public wxFrame
|
||||
{
|
||||
public:
|
||||
wxIEHtmlWin *m_ie;
|
||||
wxGauge *m_gauge;
|
||||
|
||||
// ctor(s)
|
||||
wxIEFrame(const wxString& title, const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize);
|
||||
|
||||
// event handlers (these functions should _not_ be virtual)
|
||||
void OnSize(wxSizeEvent& event);
|
||||
void OnQuit(wxCommandEvent& event);
|
||||
void OnAbout(wxCommandEvent& event);
|
||||
|
||||
void OnEditMode(wxCommandEvent& event);
|
||||
void OnEditModeUI(wxUpdateUIEvent& event);
|
||||
void OnBrowse(wxCommandEvent& event);
|
||||
void OnOpen(wxCommandEvent& event);
|
||||
void OnTestHTML(wxCommandEvent& event);
|
||||
void OnTestSelect(wxCommandEvent& event);
|
||||
void OnTestHTMLSelect(wxCommandEvent& event);
|
||||
void OnTestGetText(wxCommandEvent& event);
|
||||
void OnTestHTMLGetText(wxCommandEvent& event);
|
||||
void OnTestHome(wxCommandEvent& event);
|
||||
void OnTestActiveX(wxCommandEvent& event);
|
||||
|
||||
private:
|
||||
// any class wishing to process wxWindows events must use this macro
|
||||
DECLARE_EVENT_TABLE()
|
||||
|
||||
void OnMSHTMLStatusTextChangeX(wxActiveXEvent& event);
|
||||
void OnMSHTMLBeforeNavigate2X(wxActiveXEvent& event);
|
||||
void OnMSHTMLTitleChangeX(wxActiveXEvent& event);
|
||||
void OnMSHTMLNewWindow2X(wxActiveXEvent& event);
|
||||
void OnMSHTMLProgressChangeX(wxActiveXEvent& event);
|
||||
};
|
File diff suppressed because it is too large
Load Diff
@@ -1,680 +0,0 @@
|
||||
/*
|
||||
wxActiveX Library Licence, Version 3
|
||||
====================================
|
||||
|
||||
Copyright (C) 2003 Lindsay Mathieson [, ...]
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this licence document, but changing it is not allowed.
|
||||
|
||||
wxActiveX LIBRARY LICENCE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
This library is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library General Public Licence as published by
|
||||
the Free Software Foundation; either version 2 of the Licence, or (at
|
||||
your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
|
||||
General Public Licence for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public Licence
|
||||
along with this software, usually in a file named COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
Boston, MA 02111-1307 USA.
|
||||
|
||||
EXCEPTION NOTICE
|
||||
|
||||
1. As a special exception, the copyright holders of this library give
|
||||
permission for additional uses of the text contained in this release of
|
||||
the library as licenced under the wxActiveX Library Licence, applying
|
||||
either version 3 of the Licence, or (at your option) any later version of
|
||||
the Licence as published by the copyright holders of version 3 of the
|
||||
Licence document.
|
||||
|
||||
2. The exception is that you may use, copy, link, modify and distribute
|
||||
under the user's own terms, binary object code versions of works based
|
||||
on the Library.
|
||||
|
||||
3. If you copy code from files distributed under the terms of the GNU
|
||||
General Public Licence or the GNU Library General Public Licence into a
|
||||
copy of this library, as this licence permits, the exception does not
|
||||
apply to the code that you add in this way. To avoid misleading anyone as
|
||||
to the status of such modified files, you must delete this exception
|
||||
notice from such code and/or adjust the licensing conditions notice
|
||||
accordingly.
|
||||
|
||||
4. If you write modifications of your own for this library, it is your
|
||||
choice whether to permit this exception to apply to your modifications.
|
||||
If you do not wish that, you must delete the exception notice from such
|
||||
code and/or adjust the licensing conditions notice accordingly.
|
||||
*/
|
||||
|
||||
/*! \file wxactivex.h
|
||||
\brief implements wxActiveX window class and OLE tools
|
||||
*/
|
||||
|
||||
#ifndef WX_ACTIVE_X
|
||||
#define WX_ACTIVE_X
|
||||
#pragma warning( disable : 4101 4786)
|
||||
#pragma warning( disable : 4786)
|
||||
|
||||
|
||||
#include <wx/setup.h>
|
||||
#include <wx/wx.h>
|
||||
#include <wx/variant.h>
|
||||
#include <wx/datetime.h>
|
||||
#include <oleidl.h>
|
||||
#include <exdisp.h>
|
||||
#include <docobj.h>
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
using namespace std;
|
||||
|
||||
/// \brief wxActiveX Namespace for stuff I want to keep out of other tools way.
|
||||
namespace NS_wxActiveX
|
||||
{
|
||||
/// STL utilty class.
|
||||
/// specific to wxActiveX, for creating
|
||||
/// case insenstive maps etc
|
||||
struct less_wxStringI
|
||||
{
|
||||
bool operator()(const wxString& x, const wxString& y) const
|
||||
{
|
||||
return x.CmpNoCase(y) < 0;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
//////////////////////////////////////////
|
||||
/// Template class for smart interface handling.
|
||||
/// - Automatically dereferences ole interfaces
|
||||
/// - Smart Copy Semantics
|
||||
/// - Can Create Interfaces
|
||||
/// - Can query for other interfaces
|
||||
template <class I> class wxAutoOleInterface
|
||||
{
|
||||
protected:
|
||||
I *m_interface;
|
||||
|
||||
public:
|
||||
/// takes ownership of an existing interface
|
||||
/// Assumed to already have a AddRef() applied
|
||||
explicit wxAutoOleInterface(I *pInterface = NULL) : m_interface(pInterface) {}
|
||||
|
||||
/// queries for an interface
|
||||
wxAutoOleInterface(REFIID riid, IUnknown *pUnk) : m_interface(NULL)
|
||||
{
|
||||
QueryInterface(riid, pUnk);
|
||||
};
|
||||
/// queries for an interface
|
||||
wxAutoOleInterface(REFIID riid, IDispatch *pDispatch) : m_interface(NULL)
|
||||
{
|
||||
QueryInterface(riid, pDispatch);
|
||||
};
|
||||
|
||||
/// Creates an Interface
|
||||
wxAutoOleInterface(REFCLSID clsid, REFIID riid) : m_interface(NULL)
|
||||
{
|
||||
CreateInstance(clsid, riid);
|
||||
};
|
||||
|
||||
/// copy constructor
|
||||
wxAutoOleInterface(const wxAutoOleInterface<I>& ti) : m_interface(NULL)
|
||||
{
|
||||
operator = (ti);
|
||||
}
|
||||
|
||||
/// assignment operator
|
||||
wxAutoOleInterface<I>& operator = (const wxAutoOleInterface<I>& ti)
|
||||
{
|
||||
if (ti.m_interface)
|
||||
ti.m_interface->AddRef();
|
||||
Free();
|
||||
m_interface = ti.m_interface;
|
||||
return *this;
|
||||
}
|
||||
|
||||
/// takes ownership of an existing interface
|
||||
/// Assumed to already have a AddRef() applied
|
||||
wxAutoOleInterface<I>& operator = (I *&ti)
|
||||
{
|
||||
Free();
|
||||
m_interface = ti;
|
||||
return *this;
|
||||
}
|
||||
|
||||
/// invokes Free()
|
||||
~wxAutoOleInterface()
|
||||
{
|
||||
Free();
|
||||
};
|
||||
|
||||
|
||||
/// Releases interface (i.e decrements refCount)
|
||||
inline void Free()
|
||||
{
|
||||
if (m_interface)
|
||||
m_interface->Release();
|
||||
m_interface = NULL;
|
||||
};
|
||||
|
||||
/// queries for an interface
|
||||
HRESULT QueryInterface(REFIID riid, IUnknown *pUnk)
|
||||
{
|
||||
Free();
|
||||
wxCHECK(pUnk != NULL, -1);
|
||||
return pUnk->QueryInterface(riid, (void **) &m_interface);
|
||||
};
|
||||
|
||||
/// Create a Interface instance
|
||||
HRESULT CreateInstance(REFCLSID clsid, REFIID riid)
|
||||
{
|
||||
Free();
|
||||
return CoCreateInstance(clsid, NULL, CLSCTX_ALL, riid, (void **) &m_interface);
|
||||
};
|
||||
|
||||
|
||||
/// returns the interface pointer
|
||||
inline operator I *() const {return m_interface;}
|
||||
|
||||
/// returns the dereferenced interface pointer
|
||||
inline I* operator ->() {return m_interface;}
|
||||
/// returns a pointer to the interface pointer
|
||||
inline I** GetRef() {return &m_interface;}
|
||||
/// returns true if we have a valid interface pointer
|
||||
inline bool Ok() const {return m_interface != NULL;}
|
||||
};
|
||||
|
||||
|
||||
/// \brief Converts a std HRESULT to its error code.
|
||||
/// Hardcoded, by no means a definitive list.
|
||||
wxString OLEHResultToString(HRESULT hr);
|
||||
/// \brief Returns the string description of a IID.
|
||||
/// Hardcoded, by no means a definitive list.
|
||||
wxString GetIIDName(REFIID riid);
|
||||
|
||||
//#define __WXOLEDEBUG
|
||||
|
||||
|
||||
#ifdef __WXOLEDEBUG
|
||||
#define WXOLE_TRACE(str) {OutputDebugString(str);OutputDebugString("\r\n");}
|
||||
#define WXOLE_TRACEOUT(stuff)\
|
||||
{\
|
||||
wxString os;\
|
||||
os << stuff << "\r\n";\
|
||||
WXOLE_TRACE(os.mb_str());\
|
||||
}
|
||||
|
||||
#define WXOLE_WARN(__hr,msg)\
|
||||
{\
|
||||
if (__hr != S_OK)\
|
||||
{\
|
||||
wxString s = "*** ";\
|
||||
s += msg;\
|
||||
s += " : "+ OLEHResultToString(__hr);\
|
||||
WXOLE_TRACE(s.c_str());\
|
||||
}\
|
||||
}
|
||||
#else
|
||||
#define WXOLE_TRACE(str)
|
||||
#define WXOLE_TRACEOUT(stuff)
|
||||
#define WXOLE_WARN(_proc,msg) {_proc;}
|
||||
#endif
|
||||
|
||||
class wxOleInit
|
||||
{
|
||||
public:
|
||||
static IMalloc *GetIMalloc();
|
||||
|
||||
wxOleInit();
|
||||
~wxOleInit();
|
||||
};
|
||||
|
||||
#define DECLARE_OLE_UNKNOWN(cls)\
|
||||
private:\
|
||||
class TAutoInitInt\
|
||||
{\
|
||||
public:\
|
||||
LONG l;\
|
||||
TAutoInitInt() : l(0) {}\
|
||||
};\
|
||||
TAutoInitInt refCount, lockCount;\
|
||||
wxOleInit oleInit;\
|
||||
static void _GetInterface(cls *self, REFIID iid, void **_interface, const char *&desc);\
|
||||
public:\
|
||||
LONG GetRefCount();\
|
||||
HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, void ** ppvObject);\
|
||||
ULONG STDMETHODCALLTYPE AddRef();\
|
||||
ULONG STDMETHODCALLTYPE Release();\
|
||||
ULONG STDMETHODCALLTYPE AddLock();\
|
||||
ULONG STDMETHODCALLTYPE ReleaseLock()
|
||||
|
||||
#define DEFINE_OLE_TABLE(cls)\
|
||||
LONG cls::GetRefCount() {return refCount.l;}\
|
||||
HRESULT STDMETHODCALLTYPE cls::QueryInterface(REFIID iid, void ** ppvObject)\
|
||||
{\
|
||||
if (! ppvObject)\
|
||||
{\
|
||||
WXOLE_TRACE("*** NULL POINTER ***");\
|
||||
return E_FAIL;\
|
||||
};\
|
||||
const char *desc = NULL;\
|
||||
cls::_GetInterface(this, iid, ppvObject, desc);\
|
||||
if (! *ppvObject)\
|
||||
{\
|
||||
WXOLE_TRACEOUT("<" << GetIIDName(iid).c_str() << "> Not Found");\
|
||||
return E_NOINTERFACE;\
|
||||
};\
|
||||
WXOLE_TRACEOUT("QI : <" << desc <<">");\
|
||||
((IUnknown * )(*ppvObject))->AddRef();\
|
||||
return S_OK;\
|
||||
};\
|
||||
ULONG STDMETHODCALLTYPE cls::AddRef()\
|
||||
{\
|
||||
WXOLE_TRACEOUT(# cls << "::Add ref(" << refCount.l << ")");\
|
||||
InterlockedIncrement(&refCount.l);\
|
||||
return refCount.l;\
|
||||
};\
|
||||
ULONG STDMETHODCALLTYPE cls::Release()\
|
||||
{\
|
||||
if (refCount.l > 0)\
|
||||
{\
|
||||
InterlockedDecrement(&refCount.l);\
|
||||
WXOLE_TRACEOUT(# cls << "::Del ref(" << refCount.l << ")");\
|
||||
if (refCount.l == 0)\
|
||||
{\
|
||||
delete this;\
|
||||
return 0;\
|
||||
};\
|
||||
return refCount.l;\
|
||||
}\
|
||||
else\
|
||||
return 0;\
|
||||
}\
|
||||
ULONG STDMETHODCALLTYPE cls::AddLock()\
|
||||
{\
|
||||
WXOLE_TRACEOUT(# cls << "::Add Lock(" << lockCount.l << ")");\
|
||||
InterlockedIncrement(&lockCount.l);\
|
||||
return lockCount.l;\
|
||||
};\
|
||||
ULONG STDMETHODCALLTYPE cls::ReleaseLock()\
|
||||
{\
|
||||
if (lockCount.l > 0)\
|
||||
{\
|
||||
InterlockedDecrement(&lockCount.l);\
|
||||
WXOLE_TRACEOUT(# cls << "::Del Lock(" << lockCount.l << ")");\
|
||||
return lockCount.l;\
|
||||
}\
|
||||
else\
|
||||
return 0;\
|
||||
}\
|
||||
DEFINE_OLE_BASE(cls)
|
||||
|
||||
#define DEFINE_OLE_BASE(cls)\
|
||||
void cls::_GetInterface(cls *self, REFIID iid, void **_interface, const char *&desc)\
|
||||
{\
|
||||
*_interface = NULL;\
|
||||
desc = NULL;
|
||||
|
||||
#define OLE_INTERFACE(_iid, _type)\
|
||||
if (IsEqualIID(iid, _iid))\
|
||||
{\
|
||||
WXOLE_TRACE("Found Interface <" # _type ">");\
|
||||
*_interface = (IUnknown *) (_type *) self;\
|
||||
desc = # _iid;\
|
||||
return;\
|
||||
}
|
||||
|
||||
#define OLE_IINTERFACE(_face) OLE_INTERFACE(IID_##_face, _face)
|
||||
|
||||
#define OLE_INTERFACE_CUSTOM(func)\
|
||||
if (func(self, iid, _interface, desc))\
|
||||
{\
|
||||
return;\
|
||||
}
|
||||
|
||||
#define END_OLE_TABLE\
|
||||
}
|
||||
|
||||
|
||||
/// Main class for embedding a ActiveX control.
|
||||
/// Use by itself or derive from it
|
||||
/// \note The utility program (wxie) can generate a list of events, methods & properties
|
||||
/// for a control.
|
||||
/// First display the control (File|Display),
|
||||
/// then get the type info (ActiveX|Get Type Info) - these are copied to the clipboard.
|
||||
/// Eventually this will be expanded to autogenerate
|
||||
/// wxWindows source files for a control with all methods etc encapsulated.
|
||||
/// \par Usage:
|
||||
/// construct using a ProgId or class id
|
||||
/// \code new wxActiveX(parent, CLSID_WebBrowser, id, pos, size, style, name)\endcode
|
||||
/// \code new wxActiveX(parent, "ShockwaveFlash.ShockwaveFlash", id, pos, size, style, name)\endcode
|
||||
/// \par Properties
|
||||
/// Properties can be set using \c SetProp() and set/retrieved using \c Prop()
|
||||
/// \code SetProp(name, wxVariant(x)) \endcode or
|
||||
/// \code wxString Prop("<name>") = x\endcode
|
||||
/// \code wxString result = Prop("<name>")\endcode
|
||||
/// \code flash_ctl.Prop("movie") = "file:///movies/test.swf";\endcode
|
||||
/// \code flash_ctl.Prop("Playing") = false;\endcode
|
||||
/// \code wxString current_movie = flash_ctl.Prop("movie");\endcode
|
||||
/// \par Methods
|
||||
/// Methods are invoked with \c CallMethod()
|
||||
/// \code wxVariant result = CallMethod("<name>", args, nargs = -1)\endcode
|
||||
/// \code wxVariant args[] = {0L, "file:///e:/dev/wxie/bug-zap.swf"};
|
||||
/// wxVariant result = X->CallMethod("LoadMovie", args);\endcode
|
||||
/// \par events
|
||||
/// respond to events with the
|
||||
/// \c EVT_ACTIVEX(controlId, eventName, handler) &
|
||||
/// \c EVT_ACTIVEX_DISPID(controlId, eventDispId, handler) macros
|
||||
/// \code
|
||||
/// BEGIN_EVENT_TABLE(wxIEFrame, wxFrame)
|
||||
/// EVT_ACTIVEX_DISPID(ID_MSHTML, DISPID_STATUSTEXTCHANGE, OnMSHTMLStatusTextChangeX)
|
||||
/// EVT_ACTIVEX(ID_MSHTML, "BeforeNavigate2", OnMSHTMLBeforeNavigate2X)
|
||||
/// EVT_ACTIVEX(ID_MSHTML, "TitleChange", OnMSHTMLTitleChangeX)
|
||||
/// EVT_ACTIVEX(ID_MSHTML, "NewWindow2", OnMSHTMLNewWindow2X)
|
||||
/// EVT_ACTIVEX(ID_MSHTML, "ProgressChange", OnMSHTMLProgressChangeX)
|
||||
/// END_EVENT_TABLE()\endcode
|
||||
class wxActiveX : public wxWindow {
|
||||
public:
|
||||
/// General parameter and return type infoformation for Events, Properties and Methods.
|
||||
/// refer to ELEMDESC, IDLDESC in MSDN
|
||||
class ParamX
|
||||
{
|
||||
public:
|
||||
USHORT flags;
|
||||
bool isPtr;
|
||||
bool isSafeArray;
|
||||
bool isOptional;
|
||||
VARTYPE vt;
|
||||
wxString name;
|
||||
|
||||
ParamX() : isOptional(false), vt(VT_EMPTY) {}
|
||||
inline bool IsIn() const {return (flags & IDLFLAG_FIN) != 0;}
|
||||
inline bool IsOut() const {return (flags & IDLFLAG_FOUT) != 0;}
|
||||
inline bool IsRetVal() const {return (flags & IDLFLAG_FRETVAL) != 0;}
|
||||
};
|
||||
typedef vector<ParamX> ParamXArray;
|
||||
|
||||
|
||||
/// Type & Parameter info for Events and Methods.
|
||||
/// refer to FUNCDESC in MSDN
|
||||
class FuncX
|
||||
{
|
||||
public:
|
||||
wxString name;
|
||||
MEMBERID memid;
|
||||
bool hasOut;
|
||||
|
||||
ParamX retType;
|
||||
ParamXArray params;
|
||||
};
|
||||
typedef vector<FuncX> FuncXArray;
|
||||
|
||||
|
||||
/// Type info for properties.
|
||||
class PropX
|
||||
{
|
||||
public:
|
||||
wxString name;
|
||||
MEMBERID memid;
|
||||
ParamX type;
|
||||
ParamX arg;
|
||||
bool putByRef;
|
||||
|
||||
PropX() : putByRef (false) {}
|
||||
inline bool CanGet() const {return type.vt != VT_EMPTY;}
|
||||
inline bool CanSet() const {return arg.vt != VT_EMPTY;}
|
||||
};
|
||||
typedef vector<PropX> PropXArray;
|
||||
|
||||
|
||||
/// Create using clsid.
|
||||
wxActiveX(wxWindow * parent, REFCLSID clsid, wxWindowID id = -1,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxPanelNameStr);
|
||||
/// create using progid.
|
||||
wxActiveX(wxWindow * parent, const wxString& progId, wxWindowID id = -1,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxPanelNameStr);
|
||||
virtual ~wxActiveX();
|
||||
|
||||
/// Number of events defined for this control.
|
||||
inline int GetEventCount() const {return m_events.size();}
|
||||
/// returns event description by index.
|
||||
/// throws exception for invalid index
|
||||
const FuncX& GetEventDesc(int idx) const;
|
||||
|
||||
/// Number of properties defined for this control.
|
||||
inline int GetPropCount() const {return m_props.size();}
|
||||
/// returns property description by index.
|
||||
/// throws exception for invalid index
|
||||
const PropX& GetPropDesc(int idx) const;
|
||||
/// returns property description by name.
|
||||
/// throws exception for invalid name
|
||||
const PropX& GetPropDesc(const wxString& name) const;
|
||||
|
||||
/// Number of methods defined for this control.
|
||||
inline int GetMethodCount() const {return m_methods.size();}
|
||||
/// returns method description by name.
|
||||
/// throws exception for invalid index
|
||||
const FuncX& GetMethodDesc(int idx) const;
|
||||
/// returns method description by name.
|
||||
/// throws exception for invalid name
|
||||
const FuncX& GetMethodDesc(const wxString& name) const;
|
||||
|
||||
/// Set property VARIANTARG value by MEMBERID.
|
||||
void SetProp(MEMBERID name, VARIANTARG& value);
|
||||
/// Set property using wxVariant by name.
|
||||
void SetProp(const wxString &name, const wxVariant &value);
|
||||
|
||||
class wxPropertySetter
|
||||
{
|
||||
public:
|
||||
wxActiveX *m_ctl;
|
||||
wxString m_propName;
|
||||
|
||||
wxPropertySetter(wxActiveX *ctl, const wxString& propName) :
|
||||
m_ctl(ctl), m_propName(propName) {}
|
||||
|
||||
inline const wxPropertySetter& operator = (wxVariant v) const
|
||||
{
|
||||
m_ctl->SetProp(m_propName, v);
|
||||
return *this;
|
||||
};
|
||||
|
||||
inline operator wxVariant() const {return m_ctl->GetPropAsWxVariant(m_propName);};
|
||||
inline operator wxString() const {return m_ctl->GetPropAsString(m_propName);};
|
||||
inline operator char() const {return m_ctl->GetPropAsChar(m_propName);};
|
||||
inline operator long() const {return m_ctl->GetPropAsLong(m_propName);};
|
||||
inline operator bool() const {return m_ctl->GetPropAsBool(m_propName);};
|
||||
inline operator double() const {return m_ctl->GetPropAsDouble(m_propName);};
|
||||
inline operator wxDateTime() const {return m_ctl->GetPropAsDateTime(m_propName);};
|
||||
inline operator void *() const {return m_ctl->GetPropAsPointer(m_propName);};
|
||||
};
|
||||
|
||||
/// \fn inline wxPropertySetter Prop(wxString name) {return wxPropertySetter(this, name);}
|
||||
/// \param name Property name to read/set
|
||||
/// \return wxPropertySetter, which has overloads for setting/getting the property
|
||||
/// \brief Generic Get/Set Property by name.
|
||||
/// Automatically handles most types
|
||||
/// \par Usage:
|
||||
/// - Prop("\<name\>") = \<value\>
|
||||
/// - var = Prop("\<name\>")
|
||||
/// - e.g:
|
||||
/// - \code flash_ctl.Prop("movie") = "file:///movies/test.swf";\endcode
|
||||
/// - \code flash_ctl.Prop("Playing") = false;\endcode
|
||||
/// - \code wxString current_movie = flash_ctl.Prop("movie");\endcode
|
||||
/// \exception raises exception if \<name\> is invalid
|
||||
/// \note Have to add a few more type conversions yet ...
|
||||
inline wxPropertySetter Prop(wxString name) {return wxPropertySetter(this, name);}
|
||||
|
||||
VARIANT GetPropAsVariant(MEMBERID name);
|
||||
VARIANT GetPropAsVariant(const wxString& name);
|
||||
wxVariant GetPropAsWxVariant(const wxString& name);
|
||||
wxString GetPropAsString(const wxString& name);
|
||||
char GetPropAsChar(const wxString& name);
|
||||
long GetPropAsLong(const wxString& name);
|
||||
bool GetPropAsBool(const wxString& name);
|
||||
double GetPropAsDouble(const wxString& name);
|
||||
wxDateTime GetPropAsDateTime(const wxString& name);
|
||||
void *GetPropAsPointer(const wxString& name);
|
||||
|
||||
// methods
|
||||
// VARIANTARG form is passed straight to Invoke,
|
||||
// so args in *REVERSE* order
|
||||
VARIANT CallMethod(MEMBERID name, VARIANTARG args[], int argc);
|
||||
VARIANT CallMethod(const wxString& name, VARIANTARG args[] = NULL, int argc = -1);
|
||||
// args are in *NORMAL* order
|
||||
// args can be a single wxVariant or an array
|
||||
/// \fn wxVariant CallMethod(wxString name, wxVariant args[], int nargs = -1);
|
||||
/// \param name name of method to call
|
||||
/// \param args array of wxVariant's, defaults to NULL (no args)
|
||||
/// \param nargs number of arguments passed via args. Defaults to actual number of args for the method
|
||||
/// \return wxVariant
|
||||
/// \brief Call a method of the ActiveX control.
|
||||
/// Automatically handles most types
|
||||
/// \par Usage:
|
||||
/// - result = CallMethod("\<name\>", args, nargs)
|
||||
/// - e.g.
|
||||
/// - \code
|
||||
/// wxVariant args[] = {0L, "file:///e:/dev/wxie/bug-zap.swf"};
|
||||
/// wxVariant result = X->CallMethod("LoadMovie", args);\endcode
|
||||
/// \exception raises exception if \<name\> is invalid
|
||||
/// \note Since wxVariant has built in type conversion, most the std types can be passed easily
|
||||
wxVariant CallMethod(const wxString& name, wxVariant args[], int nargs = -1);
|
||||
|
||||
HRESULT ConnectAdvise(REFIID riid, IUnknown *eventSink);
|
||||
|
||||
void OnSize(wxSizeEvent&);
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
void OnMouse(wxMouseEvent& event);
|
||||
void OnSetFocus(wxFocusEvent&);
|
||||
void OnKillFocus(wxFocusEvent&);
|
||||
|
||||
DECLARE_EVENT_TABLE();
|
||||
|
||||
protected:
|
||||
friend class FrameSite;
|
||||
friend class wxActiveXEvents;
|
||||
|
||||
unsigned long m_pdwRegister;
|
||||
|
||||
typedef map<MEMBERID, int> MemberIdMap;
|
||||
typedef map<wxString, int, NS_wxActiveX::less_wxStringI> NameMap;
|
||||
|
||||
typedef wxAutoOleInterface<IConnectionPoint> wxOleConnectionPoint;
|
||||
typedef pair<wxOleConnectionPoint, DWORD> wxOleConnection;
|
||||
typedef vector<wxOleConnection> wxOleConnectionArray;
|
||||
|
||||
wxAutoOleInterface<IDispatch> m_Dispatch;
|
||||
wxAutoOleInterface<IOleClientSite> m_clientSite;
|
||||
wxAutoOleInterface<IUnknown> m_ActiveX;
|
||||
wxAutoOleInterface<IOleObject> m_oleObject;
|
||||
wxAutoOleInterface<IOleInPlaceObject> m_oleInPlaceObject;
|
||||
wxAutoOleInterface<IOleInPlaceActiveObject>
|
||||
|
||||
m_oleInPlaceActiveObject;
|
||||
wxAutoOleInterface<IOleDocumentView> m_docView;
|
||||
wxAutoOleInterface<IViewObject> m_viewObject;
|
||||
HWND m_oleObjectHWND;
|
||||
bool m_bAmbientUserMode;
|
||||
DWORD m_docAdviseCookie;
|
||||
wxOleConnectionArray m_connections;
|
||||
|
||||
void CreateActiveX(REFCLSID clsid);
|
||||
void CreateActiveX(LPOLESTR progId);
|
||||
HRESULT AmbientPropertyChanged(DISPID dispid);
|
||||
|
||||
void GetTypeInfo();
|
||||
void GetTypeInfo(ITypeInfo *ti, bool defInterface, bool defEventSink);
|
||||
|
||||
|
||||
// events
|
||||
FuncXArray m_events;
|
||||
MemberIdMap m_eventMemberIds;
|
||||
|
||||
// properties
|
||||
PropXArray m_props;
|
||||
NameMap m_propNames;
|
||||
|
||||
// Methods
|
||||
FuncXArray m_methods;
|
||||
NameMap m_methodNames;
|
||||
|
||||
virtual bool MSWTranslateMessage(WXMSG* pMsg);
|
||||
long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
||||
|
||||
DECLARE_CLASS(wxActiveX)
|
||||
};
|
||||
|
||||
// events
|
||||
class wxActiveXEvent : public wxCommandEvent
|
||||
{
|
||||
private:
|
||||
friend class wxActiveXEvents;
|
||||
|
||||
wxVariant m_params;
|
||||
|
||||
public:
|
||||
|
||||
virtual wxEvent *Clone() const { return new wxActiveXEvent(*this); }
|
||||
|
||||
wxString EventName();
|
||||
int ParamCount() const;
|
||||
wxString ParamType(int idx);
|
||||
wxString ParamName(int idx);
|
||||
wxVariant& operator[] (int idx);
|
||||
wxVariant& operator[] (wxString name);
|
||||
|
||||
private:
|
||||
DECLARE_CLASS(wxActiveXEvent)
|
||||
};
|
||||
|
||||
const wxEventType& RegisterActiveXEvent(const wxChar *eventName);
|
||||
const wxEventType& RegisterActiveXEvent(DISPID event);
|
||||
|
||||
typedef void (wxEvtHandler::*wxActiveXEventFunction)(wxActiveXEvent&);
|
||||
|
||||
/// \def EVT_ACTIVEX(id, eventName, fn)
|
||||
/// \brief Event handle for events by name
|
||||
#define EVT_ACTIVEX(id, eventName, fn) DECLARE_EVENT_TABLE_ENTRY(RegisterActiveXEvent(wxT(eventName)), id, -1, (wxObjectEventFunction) (wxEventFunction) (wxActiveXEventFunction) & fn, (wxObject *) NULL ),
|
||||
/// \def EVT_ACTIVEX_DISPID(id, eventDispId, fn)
|
||||
/// \brief Event handle for events by DISPID (dispath id)
|
||||
#define EVT_ACTIVEX_DISPID(id, eventDispId, fn) DECLARE_EVENT_TABLE_ENTRY(RegisterActiveXEvent(eventDispId), id, -1, (wxObjectEventFunction) (wxEventFunction) (wxActiveXEventFunction) & fn, (wxObject *) NULL ),
|
||||
|
||||
//util
|
||||
bool wxDateTimeToVariant(wxDateTime dt, VARIANTARG& va);
|
||||
bool VariantToWxDateTime(VARIANTARG va, wxDateTime& dt);
|
||||
/// \relates wxActiveX
|
||||
/// \fn bool MSWVariantToVariant(VARIANTARG& va, wxVariant& vx);
|
||||
/// \param va VARAIANTARG to convert from
|
||||
/// \param vx Destination wxVariant
|
||||
/// \return success/failure (true/false)
|
||||
/// \brief Convert MSW VARIANTARG to wxVariant.
|
||||
/// Handles basic types, need to add:
|
||||
/// - VT_ARRAY | VT_*
|
||||
/// - better support for VT_UNKNOWN (currently treated as void *)
|
||||
/// - better support for VT_DISPATCH (currently treated as void *)
|
||||
bool MSWVariantToVariant(VARIANTARG& va, wxVariant& vx);
|
||||
/// \relates wxActiveX
|
||||
/// \fn bool VariantToMSWVariant(const wxVariant& vx, VARIANTARG& va);
|
||||
/// \param vx wxVariant to convert from
|
||||
/// \param va Destination VARIANTARG
|
||||
/// \return success/failure (true/false)
|
||||
/// \brief Convert wxVariant to MSW VARIANTARG.
|
||||
/// Handles basic types, need to add:
|
||||
/// - VT_ARRAY | VT_*
|
||||
/// - better support for VT_UNKNOWN (currently treated as void *)
|
||||
/// - better support for VT_DISPATCH (currently treated as void *)
|
||||
bool VariantToMSWVariant(const wxVariant& vx, VARIANTARG& va);
|
||||
|
||||
#endif /* _IEHTMLWIN_H_ */
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user