Update headers and templates

This commit is contained in:
Joey Yakimowich-Payne 2023-02-11 15:04:28 -07:00
commit c417beda6d
No known key found for this signature in database
GPG key ID: 6BFE655FA5ABD1E1
35 changed files with 38971 additions and 2443 deletions

View file

@ -1,12 +1,11 @@
%module app
%include <common.i>
%{
#include <wx/app.h>
#include "wxext/app_ext.h"
#include <wx/wx.h>
#include <wx/vidmode.h>
#include "wxext/app_ext2.h"
#if defined(__WXMAC__)
#include <objc/runtime.h>
#include "wxext/osx/app_ext.h"
#endif
%}
@ -43,6 +42,7 @@
%import "wx/hashmap.h"
%import "wx/math.h"
%import "wx/localedefs.h"
%import "wx/eventfilter.h"
%import "wx/event.h"
%import "wx/dataobj.h"
%import "wx/cursor.h"
@ -64,11 +64,11 @@
%import "wx/vidmode.h"
%import "wx/cmdargs.h"
%import "wx/string.h"
%import "wx/nonownedwnd.h"
%import "wx/toplevel.h"
%import "wx/frame.h"
%include "wx/app.h"
%include "wx/build.h"
%include "wxext/app_ext.h"
%include "wx/app.h"
#if defined(__WXMSW__)
%include "wx/msw/app.h"
@ -84,11 +84,12 @@
%include "wx/x11/app.h"
#elif defined(__WXMAC__)
%include "wx/osx/app.h"
%include "wxext/osx/app_ext.h"
#elif defined(__WXQT__)
%include "wx/qt/app.h"
#endif
%include "wxext/app_ext2.h"
%{
/* typedef wxWindow* (* InitTopWindow)(); */

View file

@ -3,7 +3,6 @@
%{
#include <wx/vidmode.h>
#include "wxext/button_ext.h"
#include "wxext/osx/button_ext.h"
%}
@ -59,7 +58,6 @@
%import "wx/control.h"
%import "wx/anybutton.h"
%include "wx/button.h"
%include "wxext/button_ext.h"
#if defined(__WXUNIVERSAL__)
%include "wx/univ/button.h"
@ -73,7 +71,8 @@
%include "wx/gtk1/button.h"
#elif defined(__WXMAC__)
%include "wx/osx/button.h"
%include "wxext/osx/button_ext.h"
#elif defined(__WXQT__)
%include "wx/qt/button.h"
#endif
%include "wxext/button_ext.h"

View file

@ -1,4 +1,15 @@
%module event
%{
#include <wx/event.h>
#include "wxext/event_ext.h"
#include "wxext/eventfilter_ext.h"
#if defined(__WXMAC__)
#include <objc/runtime.h>
#endif
%}
%include <common.i>
%ignore wxObject::ms_classInfo;
@ -24,6 +35,9 @@
%import "wx/mousestate.h"
%import "wx/tracker.h"
%include "wx/event.h"
%include "wx/eventfilter.h"
%include "wxext/event_ext.h"
%include "wxext/eventfilter_ext.h"
/* For some reason this doesn't work. Figure out why */

View file

@ -2,10 +2,7 @@
%include <common.i>
%{
#include <wx/vidmode.h>
#include "wxext/frame_ext.h"
#if defined(__WXMAC__)
#include "wxext/osx/frame_ext.h"
#endif
#include "wxext/frame_ext2.h"
%}
%ignore wxWindowList::Nth;
@ -63,7 +60,6 @@
%import "wx/string.h"
%import "wx/toplevel.h"
%include "wx/frame.h"
%include "wxext/frame_ext.h"
#if defined(__WXUNIVERSAL__)
%include "wx/univ/frame.h"
@ -78,8 +74,9 @@
%include "wx/motif/frame.h"
#elif defined(__WXMAC__)
%include "wx/osx/frame.h"
%include "wxext/osx/frame_ext.h"
#elif defined(__WXQT__)
%include "wx/qt/frame.h"
#endif
#endif
%include "wxext/frame_ext2.h"

View file

@ -3,7 +3,6 @@
%{
#include <wx/vidmode.h>
#include "wxext/panel_ext.h"
#include "wxext/generic/panelg_ext.h"
%}
@ -58,8 +57,6 @@
%import "wx/window.h"
%import "wx/control.h"
%include "wx/panel.h"
%include "wxext/panel_ext.h"
%include "wxext/generic/panelg_ext.h"
#if defined(__WXUNIVERSAL__)
%include "wx/univ/panel.h"
@ -69,3 +66,5 @@
#define wxHAS_GENERIC_PANEL
%include "wx/generic/panelg.h"
#endif
%include "wxext/panel_ext.h"

View file

@ -55,7 +55,6 @@
%import "wx/toplevel.h"
%import "wx/frame.h"
%include "wx/window.h"
%include "wxext/window_ext.h"
// include the declaration of the platform-specific class
#if defined(__WXMSW__)
@ -117,4 +116,4 @@
%include "wx/univ/window.h"
#endif // wxUniv
%include "wxext/window_ext_inc.h"
%include "wxext/window_ext.h"

View file

@ -193,7 +193,48 @@ protected:
//#elif defined(__WXGTK__)
// #include "wx/gtk1/anybutton.h"
#elif defined(__WXMAC__)
#include "wx/osx/anybutton.h"
// #include "wx/osx/anybutton.h"
class WXDLLIMPEXP_CORE wxAnyButton : public wxAnyButtonBase
{
public:
wxAnyButton() {}
static wxSize GetDefaultSize();
virtual void SetLabel(const wxString& label) wxOVERRIDE;
protected:
virtual wxSize DoGetBestSize() const wxOVERRIDE;
void OnEnterWindow( wxMouseEvent& event);
void OnLeaveWindow( wxMouseEvent& event);
virtual wxBitmap DoGetBitmap(State which) const wxOVERRIDE;
virtual void DoSetBitmap(const wxBitmapBundle& bitmapBundle, State which) wxOVERRIDE;
virtual void DoSetBitmapPosition(wxDirection dir) wxOVERRIDE;
virtual void DoSetBitmapMargins(int x, int y) wxOVERRIDE
{
m_marginX = x;
m_marginY = y;
InvalidateBestSize();
}
virtual bool DoSetLabelMarkup(const wxString& markup) wxOVERRIDE;
// the margins around the bitmap
int m_marginX;
int m_marginY;
// the bitmaps for the different state of the buttons, all of them may be
// invalid and the button only shows a bitmap at all if State_Normal bitmap
// is valid
wxBitmapBundle m_bitmaps[State_Max];
wxDECLARE_NO_COPY_CLASS(wxAnyButton);
wxDECLARE_EVENT_TABLE();
};
#elif defined(__WXQT__)
#include "wx/qt/anybutton.h"
#else

View file

@ -15,7 +15,6 @@
// ----------------------------------------------------------------------------
// headers we have to include here
// ----------------------------------------------------------------------------
#include "wx/event.h" // for the base class
#include "wx/eventfilter.h" // (and another one)
#include "wx/build.h"
@ -547,7 +546,69 @@ protected:
};
#if defined(__UNIX__) && !defined(__WINDOWS__)
#include "wx/unix/app.h"
#include <signal.h>
class wxFDIODispatcher;
class wxFDIOHandler;
class wxWakeUpPipe;
// wxApp subclass implementing event processing for console applications
class WXDLLIMPEXP_BASE wxAppConsole : public wxAppConsoleBase
{
public:
wxAppConsole();
virtual ~wxAppConsole();
// override base class initialization
virtual bool Initialize(int& argc, wxChar** argv) wxOVERRIDE;
// Unix-specific: Unix signal handling
// -----------------------------------
// type of the function which can be registered as signal handler: notice
// that it isn't really a signal handler, i.e. it's not subject to the
// usual signal handlers constraints, because it is called later from
// CheckSignal() and not when the signal really occurs
typedef void (*SignalHandler)(int);
// Set signal handler for the given signal, SIG_DFL or SIG_IGN can be used
// instead of a function pointer
//
// Return true if handler was installed, false on error
bool SetSignalHandler(int signal, SignalHandler handler);
// Check if any Unix signals arrived since the last call and execute
// handlers for them
void CheckSignal();
// Register the signal wake up pipe with the given dispatcher.
//
// This is used by wxExecute(wxEXEC_NOEVENTS) implementation only.
//
// The pointer to the handler used for processing events on this descriptor
// is returned so that it can be deleted when we no longer needed it.
wxFDIOHandler* RegisterSignalWakeUpPipe(wxFDIODispatcher& dispatcher);
private:
// signal handler set up by SetSignalHandler() for all signals we handle,
// it just adds the signal to m_signalsCaught -- the real processing is
// done later, when CheckSignal() is called
static void HandleSignal(int signal);
// signals for which HandleSignal() had been called (reset from
// CheckSignal())
sigset_t m_signalsCaught;
// the signal handlers
/* WX_DECLARE_HASH_MAP(int, SignalHandler, wxIntegerHash, wxIntegerEqual, SignalHandlerHash); */
/* SignalHandlerHash m_signalHandlerHash; */
// pipe used for wake up signal handling: if a signal arrives while we're
// blocking for input, writing to this pipe triggers a call to our CheckSignal()
wxWakeUpPipe *m_signalWakeUpPipe;
};
#else
// this has to be a class and not a typedef as we forward declare it
class wxAppConsole : public wxAppConsoleBase { };
@ -756,7 +817,90 @@ protected:
#elif defined(__WXX11__)
#include "wx/x11/app.h"
#elif defined(__WXMAC__)
#include "wx/osx/app.h"
#ifndef __CPPAST__
#include "wx/osx/app.h"
#else
#ifndef _WX_APP_H_
#define _WX_APP_H_
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/gdicmn.h"
#include "wx/event.h"
class WXDLLIMPEXP_FWD_CORE wxFrame;
class WXDLLIMPEXP_FWD_CORE wxWindowMac;
class WXDLLIMPEXP_FWD_CORE wxApp ;
class WXDLLIMPEXP_FWD_CORE wxKeyEvent;
class WXDLLIMPEXP_FWD_BASE wxLog;
class WXDLLIMPEXP_FWD_CORE wxMacAutoreleasePool;
// Force an exit from main loop
void WXDLLIMPEXP_CORE wxExit();
// Yield to other apps/messages
bool WXDLLIMPEXP_CORE wxYield();
// Represents the application. Derive OnInit and declare
// a new App object to start application
class WXDLLIMPEXP_CORE wxApp: public wxAppBase
{
wxDECLARE_DYNAMIC_CLASS(wxApp);
wxApp();
virtual ~wxApp();
virtual void WakeUpIdle() wxOVERRIDE;
virtual void SetPrintMode(int mode) wxOVERRIDE { m_printMode = mode; }
virtual int GetPrintMode() const { return m_printMode; }
// calling OnInit with an auto-release pool ready ...
virtual bool CallOnInit() wxOVERRIDE;
#if wxUSE_GUI
// setting up all MacOS Specific Event-Handlers etc
virtual bool OnInitGui() wxOVERRIDE;
#endif // wxUSE_GUI
virtual int OnRun() wxOVERRIDE;
virtual bool ProcessIdle() wxOVERRIDE;
// implementation only
void OnIdle(wxIdleEvent& event);
void OnEndSession(wxCloseEvent& event);
void OnQueryEndSession(wxCloseEvent& event);
protected:
int m_printMode; // wxPRINT_WINDOWS, wxPRINT_POSTSCRIPT
public:
static bool sm_isEmbedded;
// Implementation
virtual bool Initialize(int& argc, wxChar **argv) wxOVERRIDE;
virtual void CleanUp() wxOVERRIDE;
public:
static wxWindow* s_captureWindow ;
static long s_lastModifiers ;
int m_nCmdShow;
private:
virtual bool DoInitGui();
virtual void DoCleanUp();
wxDECLARE_EVENT_TABLE();
};
#endif
// _WX_APP_H_
#endif
#elif defined(__WXQT__)
#include "wx/qt/app.h"
#endif

View file

@ -58,7 +58,40 @@ protected:
#elif defined(__WXGTK__)
#include "wx/gtk1/button.h"
#elif defined(__WXMAC__)
#include "wx/osx/button.h"
/* #include "wx/osx/button.h" */
class WXDLLIMPEXP_CORE wxButton : public wxButtonBase
{
public:
wxButton() {}
wxButton(wxWindow *parent,
wxWindowID id,
const wxString& label = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxASCII_STR(wxButtonNameStr))
{
Create(parent, id, label, pos, size, style, validator, name);
}
bool Create(wxWindow *parent,
wxWindowID id,
const wxString& label = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxASCII_STR(wxButtonNameStr));
virtual void SetLabel(const wxString& label) wxOVERRIDE;
virtual wxWindow *SetDefault() wxOVERRIDE;
virtual void Command(wxCommandEvent& event) wxOVERRIDE;
protected:
wxDECLARE_DYNAMIC_CLASS(wxButton);
};
#elif defined(__WXQT__)
#include "wx/qt/button.h"
#endif

View file

@ -212,7 +212,41 @@ protected:
#elif defined(__WXGTK__)
#include "wx/gtk1/control.h"
#elif defined(__WXMAC__)
#include "wx/osx/control.h"
WXDLLIMPEXP_DATA_CORE(extern const char) wxControlNameStr[];
// General item class
class WXDLLIMPEXP_CORE wxControl : public wxControlBase
{
wxDECLARE_ABSTRACT_CLASS(wxControl);
public:
wxControl();
wxControl(wxWindow *parent, wxWindowID winid,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxASCII_STR(wxControlNameStr))
{
Create(parent, winid, pos, size, style, validator, name);
}
bool Create(wxWindow *parent, wxWindowID winid,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxASCII_STR(wxControlNameStr));
// Simulates an event
virtual void Command(wxCommandEvent& event) wxOVERRIDE { ProcessCommand(event); }
// implementation from now on
// --------------------------
// Calls the callback and appropriate event handlers
bool ProcessCommand(wxCommandEvent& event);
void OnKeyDown( wxKeyEvent &event ) ;
};
#elif defined(__WXQT__)
#include "wx/qt/control.h"
#endif

View file

@ -268,7 +268,100 @@ protected:
#elif defined(__WXMOTIF__)
#include "wx/motif/frame.h"
#elif defined(__WXMAC__)
#ifndef __CPPAST__
#include "wx/osx/frame.h"
#else
#ifndef _WX_FRAME_H_
#define _WX_FRAME_H_
#include "wx/toolbar.h"
#include "wx/accel.h"
#include "wx/icon.h"
class WXDLLIMPEXP_CORE wxFrame: public wxFrameBase
{
public:
// construction
wxFrame() { }
wxFrame(wxWindow *parent,
wxWindowID id,
const wxString& title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE,
const wxString& name = wxASCII_STR(wxFrameNameStr))
{
Create(parent, id, title, pos, size, style, name);
}
bool Create(wxWindow *parent,
wxWindowID id,
const wxString& title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE,
const wxString& name = wxASCII_STR(wxFrameNameStr));
// implementation only from now on
// -------------------------------
// get the origin of the client area (which may be different from (0, 0)
// if the frame has a toolbar) in client coordinates
virtual wxPoint GetClientAreaOrigin() const wxOVERRIDE;
// override some more virtuals
virtual bool Show(bool show = true) wxOVERRIDE;
virtual bool Enable(bool enable = true) wxOVERRIDE;
// event handlers
void OnActivate(wxActivateEvent& event);
void OnSysColourChanged(wxSysColourChangedEvent& event);
// Toolbar
#if wxUSE_TOOLBAR
virtual wxToolBar* CreateToolBar(long style = -1,
wxWindowID id = -1,
const wxString& name = wxASCII_STR(wxToolBarNameStr)) wxOVERRIDE;
virtual void SetToolBar(wxToolBar *toolbar) wxOVERRIDE;
#endif // wxUSE_TOOLBAR
// Status bar
#if wxUSE_STATUSBAR
virtual wxStatusBar* OnCreateStatusBar(int number = 1,
long style = wxSTB_DEFAULT_STYLE,
wxWindowID id = 0,
const wxString& name = wxASCII_STR(wxStatusLineNameStr)) wxOVERRIDE;
virtual void SetStatusBar(wxStatusBar *statbar) wxOVERRIDE;
#endif // wxUSE_STATUSBAR
void PositionBars();
protected:
#if wxUSE_TOOLBAR
virtual void PositionToolBar() wxOVERRIDE;
#endif
#if wxUSE_STATUSBAR
virtual void PositionStatusBar() wxOVERRIDE;
#endif
// override base class virtuals
virtual void DoGetClientSize(int *width, int *height) const wxOVERRIDE;
virtual void DoSetClientSize(int width, int height) wxOVERRIDE;
#if wxUSE_MENUBAR
virtual void DetachMenuBar() wxOVERRIDE;
virtual void AttachMenuBar(wxMenuBar *menubar) wxOVERRIDE;
#endif
wxDECLARE_EVENT_TABLE();
wxDECLARE_DYNAMIC_CLASS(wxFrame);
};
#endif
// _WX_FRAME_H_
#endif
#elif defined(__WXQT__)
#include "wx/qt/frame.h"
#endif

View file

@ -329,7 +329,173 @@ public:
#elif defined(__WXGTK__)
#include "wx/gtk1/glcanvas.h"
#elif defined(__WXMAC__)
#include "wx/osx/glcanvas.h"
#ifndef _WX_GLCANVAS_H_
#define _WX_GLCANVAS_H_
#ifdef __WXOSX_IPHONE__
#import <OpenGLES/ES1/gl.h>
#import <OpenGLES/ES1/glext.h>
#define wxUSE_OPENGL_EMULATION 1
#else
#ifndef GL_SILENCE_DEPRECATION
#define GL_SILENCE_DEPRECATION
#endif
#include <OpenGL/gl.h>
#endif
#include "wx/vector.h"
// low level calls
WXDLLIMPEXP_GL WXGLContext WXGLCreateContext( WXGLPixelFormat pixelFormat, WXGLContext shareContext );
WXDLLIMPEXP_GL void WXGLDestroyContext( WXGLContext context );
WXDLLIMPEXP_GL WXGLContext WXGLGetCurrentContext();
WXDLLIMPEXP_GL bool WXGLSetCurrentContext(WXGLContext context);
WXDLLIMPEXP_GL WXGLPixelFormat WXGLChoosePixelFormat(const int *GLAttrs = NULL,
int n1 = 0,
const int *ctxAttrs = NULL,
int n2 = 0);
WXDLLIMPEXP_GL void WXGLDestroyPixelFormat( WXGLPixelFormat pixelFormat );
class WXDLLIMPEXP_GL wxGLContext : public wxGLContextBase
{
public:
wxGLContext(wxGLCanvas *win,
const wxGLContext *other = NULL,
const wxGLContextAttrs *ctxAttrs = NULL);
virtual ~wxGLContext();
virtual bool SetCurrent(const wxGLCanvas& win) const wxOVERRIDE;
// Mac-specific
WXGLContext GetWXGLContext() const { return m_glContext; }
private:
WXGLContext m_glContext;
wxDECLARE_NO_COPY_CLASS(wxGLContext);
};
class WXDLLIMPEXP_GL wxGLCanvas : public wxGLCanvasBase
{
public:
wxGLCanvas(wxWindow *parent,
const wxGLAttributes& dispAttrs,
wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxGLCanvasName,
const wxPalette& palette = wxNullPalette);
wxGLCanvas(wxWindow *parent,
wxWindowID id = wxID_ANY,
const int *attribList = NULL,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxGLCanvasName,
const wxPalette& palette = wxNullPalette);
bool Create(wxWindow *parent,
const wxGLAttributes& dispAttrs,
wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxGLCanvasName,
const wxPalette& palette = wxNullPalette);
bool Create(wxWindow *parent,
wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxGLCanvasName,
const int *attribList = NULL,
const wxPalette& palette = wxNullPalette);
virtual ~wxGLCanvas();
// implement wxGLCanvasBase methods
virtual bool SwapBuffers() wxOVERRIDE;
// Mac-specific functions
// ----------------------
// return true if multisample extension is supported
static bool IsAGLMultiSampleAvailable();
// return the pixel format used by this window
WXGLPixelFormat GetWXGLPixelFormat() const { return m_glFormat; }
// Return the copy of attributes passed at ctor
wxGLAttributes& GetGLDispAttrs() { return m_GLAttrs; }
// update the view port of the current context to match this window
void SetViewport();
// deprecated methods
// ------------------
#if WXWIN_COMPATIBILITY_2_8
wxDEPRECATED(
wxGLCanvas(wxWindow *parent,
wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxGLCanvasName,
const int *attribList = NULL,
const wxPalette& palette = wxNullPalette)
);
wxDEPRECATED(
wxGLCanvas(wxWindow *parent,
const wxGLContext *shared,
wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxGLCanvasName,
const int *attribList = NULL,
const wxPalette& palette = wxNullPalette)
);
wxDEPRECATED(
wxGLCanvas(wxWindow *parent,
const wxGLCanvas *shared,
wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxGLCanvasName,
const int *attribList = NULL,
const wxPalette& palette = wxNullPalette)
);
#endif // WXWIN_COMPATIBILITY_2_8
// implementation-only from now on
protected:
bool DoCreate(wxWindow *parent,
wxWindowID id,
const wxPoint& pos,
const wxSize& size,
long style,
const wxString& name);
WXGLPixelFormat m_glFormat;
wxGLAttributes m_GLAttrs;
wxDECLARE_EVENT_TABLE();
wxDECLARE_CLASS(wxGLCanvas);
};
#endif // _WX_GLCANVAS_H_
#elif defined(__WXQT__)
#include "wx/qt/glcanvas.h"
#else

View file

@ -15,7 +15,101 @@
#if wxUSE_HELP
#include "wx/helpbase.h"
#ifndef _WX_HELPBASEH__
#define _WX_HELPBASEH__
#include "wx/defs.h"
#if wxUSE_HELP
#include "wx/object.h"
#include "wx/string.h"
#include "wx/gdicmn.h"
#include "wx/frame.h"
// Flags for SetViewer
#define wxHELP_NETSCAPE 1
// Search modes:
enum wxHelpSearchMode
{
wxHELP_SEARCH_INDEX,
wxHELP_SEARCH_ALL
};
// Defines the API for help controllers
class WXDLLIMPEXP_CORE wxHelpControllerBase: public wxObject
{
public:
inline wxHelpControllerBase(wxWindow* parentWindow = NULL) { m_parentWindow = parentWindow; }
inline ~wxHelpControllerBase() {}
// Must call this to set the filename and server name.
// server is only required when implementing TCP/IP-based
// help controllers.
virtual bool Initialize(const wxString& WXUNUSED(file), int WXUNUSED(server) ) { return false; }
virtual bool Initialize(const wxString& WXUNUSED(file)) { return false; }
// Set viewer: only relevant to some kinds of controller
virtual void SetViewer(const wxString& WXUNUSED(viewer), long WXUNUSED(flags) = 0) {}
// If file is "", reloads file given in Initialize
virtual bool LoadFile(const wxString& file = wxEmptyString) = 0;
// Displays the contents
virtual bool DisplayContents() = 0;
// Display the given section
virtual bool DisplaySection(int sectionNo) = 0;
// Display the section using a context id
virtual bool DisplayContextPopup(int WXUNUSED(contextId)) { return false; }
// Display the text in a popup, if possible
virtual bool DisplayTextPopup(const wxString& WXUNUSED(text), const wxPoint& WXUNUSED(pos)) { return false; }
// By default, uses KeywordSection to display a topic. Implementations
// may override this for more specific behaviour.
virtual bool DisplaySection(const wxString& section) { return KeywordSearch(section); }
virtual bool DisplayBlock(long blockNo) = 0;
virtual bool KeywordSearch(const wxString& k,
wxHelpSearchMode mode = wxHELP_SEARCH_ALL) = 0;
/// Allows one to override the default settings for the help frame.
virtual void SetFrameParameters(const wxString& WXUNUSED(title),
const wxSize& WXUNUSED(size),
const wxPoint& WXUNUSED(pos) = wxDefaultPosition,
bool WXUNUSED(newFrameEachTime) = false)
{
// does nothing by default
}
/// Obtains the latest settings used by the help frame and the help
/// frame.
virtual wxFrame *GetFrameParameters(wxSize *WXUNUSED(size) = NULL,
wxPoint *WXUNUSED(pos) = NULL,
bool *WXUNUSED(newFrameEachTime) = NULL)
{
return NULL; // does nothing by default
}
virtual bool Quit() = 0;
virtual void OnQuit() {}
/// Set the window that can optionally be used for the help window's parent.
virtual void SetParentWindow(wxWindow* win) { m_parentWindow = win; }
/// Get the window that can optionally be used for the help window's parent.
virtual wxWindow* GetParentWindow() const { return m_parentWindow; }
protected:
wxWindow* m_parentWindow;
private:
wxDECLARE_CLASS(wxHelpControllerBase);
};
#endif // wxUSE_HELP
#endif
// _WX_HELPBASEH__
#if defined(__WXMSW__)
#include "wx/msw/helpchm.h"
@ -27,7 +121,102 @@
#include "wx/html/helpctrl.h"
#define wxHelpController wxHtmlHelpController
#else
#include "wx/generic/helpext.h"
#ifndef __WX_HELPEXT_H_
#define __WX_HELPEXT_H_
#if wxUSE_HELP
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#include "wx/helpbase.h"
// ----------------------------------------------------------------------------
// wxExtHelpController
// ----------------------------------------------------------------------------
// This class implements help via an external browser.
class WXDLLIMPEXP_ADV wxExtHelpController : public wxHelpControllerBase
{
public:
wxExtHelpController(wxWindow* parentWindow = NULL);
virtual ~wxExtHelpController();
#if WXWIN_COMPATIBILITY_2_8
wxDEPRECATED(void SetBrowser(const wxString& browsername = wxEmptyString, bool isNetscape = false) );
#endif
// Set viewer: new name for SetBrowser
virtual void SetViewer(const wxString& viewer = wxEmptyString,
long flags = wxHELP_NETSCAPE) wxOVERRIDE;
virtual bool Initialize(const wxString& dir, int WXUNUSED(server)) wxOVERRIDE
{ return Initialize(dir); }
virtual bool Initialize(const wxString& dir) wxOVERRIDE;
virtual bool LoadFile(const wxString& file = wxEmptyString) wxOVERRIDE;
virtual bool DisplayContents() wxOVERRIDE;
virtual bool DisplaySection(int sectionNo) wxOVERRIDE;
virtual bool DisplaySection(const wxString& section) wxOVERRIDE;
virtual bool DisplayBlock(long blockNo) wxOVERRIDE;
virtual bool KeywordSearch(const wxString& k,
wxHelpSearchMode mode = wxHELP_SEARCH_ALL) wxOVERRIDE;
virtual bool Quit() wxOVERRIDE;
virtual void OnQuit() wxOVERRIDE;
virtual bool DisplayHelp(const wxString &) ;
virtual void SetFrameParameters(const wxString& WXUNUSED(title),
const wxSize& WXUNUSED(size),
const wxPoint& WXUNUSED(pos) = wxDefaultPosition,
bool WXUNUSED(newFrameEachTime) = false) wxOVERRIDE
{
// does nothing by default
}
virtual wxFrame *GetFrameParameters(wxSize *WXUNUSED(size) = NULL,
wxPoint *WXUNUSED(pos) = NULL,
bool *WXUNUSED(newFrameEachTime) = NULL) wxOVERRIDE
{
return NULL; // does nothing by default
}
protected:
// Filename of currently active map file.
wxString m_helpDir;
// How many entries do we have in the map file?
int m_NumOfEntries;
// A list containing all id,url,documentation triples.
wxList *m_MapList;
private:
// parse a single line of the map file (called by LoadFile())
//
// return true if the line was valid or false otherwise
bool ParseMapFileLine(const wxString& line);
// Deletes the list and all objects.
void DeleteList();
// How to call the html viewer.
wxString m_BrowserName;
// Is the viewer a variant of netscape?
bool m_BrowserIsNetscape;
wxDECLARE_CLASS(wxExtHelpController);
};
#endif // wxUSE_HELP
#endif // __WX_HELPEXT_H_
#define wxHelpController wxExtHelpController
#endif

View file

@ -169,8 +169,8 @@ public:
// sometimes decorations make the client area smaller
virtual wxPoint GetClientAreaOrigin() const wxOVERRIDE;
/* wxWindowMac *FindItem(long id) const; */
/* wxWindowMac *FindItemByHWND(WXHWND hWnd, bool controlOnly = false) const; */
wxWindowMac *FindItem(long id) const;
wxWindowMac *FindItemByHWND(WXHWND hWnd, bool controlOnly = false) const;
virtual void TriggerScrollEvent( wxEventType scrollEvent ) ;
// this should not be overridden in classes above wxWindowMac

View file

@ -27,7 +27,118 @@ extern WXDLLIMPEXP_DATA_CORE(const char) wxPanelNameStr[];
// wxPanel contains other controls and implements TAB traversal between them
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxPanelBase : public wxNavigationEnabled<wxWindow>
// The template parameter W must be a wxWindow-derived class.
class wxNavigationEnabledWindow : public wxWindow
{
public:
typedef wxWindow BaseWindowClass;
wxNavigationEnabledWindow()
{
m_container.SetContainerWindow(this);
#ifndef wxHAS_NATIVE_TAB_TRAVERSAL
BaseWindowClass::Bind(wxEVT_NAVIGATION_KEY,
&wxNavigationEnabledWindow::OnNavigationKey, this);
BaseWindowClass::Bind(wxEVT_SET_FOCUS,
&wxNavigationEnabledWindow::OnFocus, this);
BaseWindowClass::Bind(wxEVT_CHILD_FOCUS,
&wxNavigationEnabledWindow::OnChildFocus, this);
#endif // !wxHAS_NATIVE_TAB_TRAVERSAL
}
WXDLLIMPEXP_INLINE_CORE virtual bool AcceptsFocus() const wxOVERRIDE
{
return m_container.AcceptsFocus();
}
WXDLLIMPEXP_INLINE_CORE virtual bool AcceptsFocusRecursively() const wxOVERRIDE
{
return m_container.AcceptsFocusRecursively();
}
WXDLLIMPEXP_INLINE_CORE virtual bool AcceptsFocusFromKeyboard() const wxOVERRIDE
{
return m_container.AcceptsFocusFromKeyboard();
}
WXDLLIMPEXP_INLINE_CORE virtual void AddChild(wxWindowBase *child) wxOVERRIDE
{
BaseWindowClass::AddChild(child);
if ( m_container.UpdateCanFocusChildren() )
{
// Under MSW we must have wxTAB_TRAVERSAL style for TAB navigation
// to work.
if ( !BaseWindowClass::HasFlag(wxTAB_TRAVERSAL) )
BaseWindowClass::ToggleWindowStyle(wxTAB_TRAVERSAL);
}
}
WXDLLIMPEXP_INLINE_CORE virtual void RemoveChild(wxWindowBase *child) wxOVERRIDE
{
#ifndef wxHAS_NATIVE_TAB_TRAVERSAL
m_container.HandleOnWindowDestroy(child);
#endif // !wxHAS_NATIVE_TAB_TRAVERSAL
BaseWindowClass::RemoveChild(child);
// We could reset wxTAB_TRAVERSAL here but it doesn't seem to do any
// harm to keep it.
m_container.UpdateCanFocusChildren();
}
WXDLLIMPEXP_INLINE_CORE virtual void SetFocus() wxOVERRIDE
{
if ( !m_container.DoSetFocus() )
BaseWindowClass::SetFocus();
}
void SetFocusIgnoringChildren()
{
BaseWindowClass::SetFocus();
}
#ifdef __WXMSW__
WXDLLIMPEXP_INLINE_CORE virtual bool HasTransparentBackground() wxOVERRIDE
{
return m_container.HasTransparentBackground();
}
WXDLLIMPEXP_INLINE_CORE
virtual void WXSetPendingFocus(wxWindow* win) wxOVERRIDE
{
return m_container.SetLastFocus(win);
}
#endif // __WXMSW__
protected:
#ifndef wxHAS_NATIVE_TAB_TRAVERSAL
void OnNavigationKey(wxNavigationKeyEvent& event)
{
m_container.HandleOnNavigationKey(event);
}
void OnFocus(wxFocusEvent& event)
{
m_container.HandleOnFocus(event);
}
void OnChildFocus(wxChildFocusEvent& event)
{
m_container.SetLastFocus(event.GetWindow());
event.Skip();
}
#endif // !wxHAS_NATIVE_TAB_TRAVERSAL
wxControlContainer m_container;
wxDECLARE_NO_COPY_CLASS(wxNavigationEnabledWindow);
};
class WXDLLIMPEXP_CORE wxPanelBase : public wxNavigationEnabledWindow
{
public:
wxPanelBase() { }
@ -66,7 +177,44 @@ private:
#include "wx/msw/panel.h"
#else
#define wxHAS_GENERIC_PANEL
#include "wx/generic/panelg.h"
#ifndef _WX_GENERIC_PANELG_H_
#define _WX_GENERIC_PANELG_H_
#include "wx/bitmap.h"
class WXDLLIMPEXP_CORE wxPanel : public wxPanelBase
{
public:
wxPanel() { }
// Constructor
wxPanel(wxWindow *parent,
wxWindowID winid = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxTAB_TRAVERSAL | wxNO_BORDER,
const wxString& name = wxASCII_STR(wxPanelNameStr))
{
Create(parent, winid, pos, size, style, name);
}
#if WXWIN_COMPATIBILITY_2_8
wxDEPRECATED_CONSTRUCTOR(
wxPanel(wxWindow *parent,
int x, int y, int width, int height,
long style = wxTAB_TRAVERSAL | wxNO_BORDER,
const wxString& name = wxASCII_STR(wxPanelNameStr))
{
Create(parent, wxID_ANY, wxPoint(x, y), wxSize(width, height), style, name);
}
)
#endif // WXWIN_COMPATIBILITY_2_8
private:
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxPanel);
};
#endif // _WX_GENERIC_PANELG_H_
#endif
#endif // _WX_PANELH_BASE_

View file

@ -28,7 +28,228 @@
#define wxPD_CAN_SKIP 0x0080
#include "wx/generic/progdlgg.h"
#ifndef __PROGDLGH_G__
#define __PROGDLGH_G__
#include "wx/dialog.h"
#include "wx/weakref.h"
class WXDLLIMPEXP_FWD_CORE wxButton;
class WXDLLIMPEXP_FWD_CORE wxEventLoop;
class WXDLLIMPEXP_FWD_CORE wxGauge;
class WXDLLIMPEXP_FWD_CORE wxStaticText;
class WXDLLIMPEXP_FWD_CORE wxWindowDisabler;
/*
Progress dialog which shows a moving progress bar.
Taken from the Mahogany project.
*/
class WXDLLIMPEXP_CORE wxGenericProgressDialog : public wxDialog
{
public:
wxGenericProgressDialog();
wxGenericProgressDialog(const wxString& title, const wxString& message,
int maximum = 100,
wxWindow *parent = NULL,
int style = wxPD_APP_MODAL | wxPD_AUTO_HIDE);
virtual ~wxGenericProgressDialog();
bool Create(const wxString& title,
const wxString& message,
int maximum = 100,
wxWindow *parent = NULL,
int style = wxPD_APP_MODAL | wxPD_AUTO_HIDE);
virtual bool Update(int value, const wxString& newmsg = wxEmptyString, bool *skip = NULL);
virtual bool Pulse(const wxString& newmsg = wxEmptyString, bool *skip = NULL);
virtual void Resume();
virtual int GetValue() const;
virtual int GetRange() const;
virtual wxString GetMessage() const;
virtual void SetRange(int maximum);
// Return whether "Cancel" or "Skip" button was pressed, always return
// false if the corresponding button is not shown.
virtual bool WasCancelled() const;
virtual bool WasSkipped() const;
// Must provide overload to avoid hiding it (and warnings about it)
virtual void Update() wxOVERRIDE { wxDialog::Update(); }
virtual bool Show( bool show = true ) wxOVERRIDE;
// This enum is an implementation detail and should not be used
// by user code.
enum State
{
Uncancelable = -1, // dialog can't be canceled
Canceled, // can be cancelled and, in fact, was
Continue, // can be cancelled but wasn't
Finished, // finished, waiting to be removed from screen
Dismissed // was closed by user after finishing
};
protected:
// Update just the m_maximum field, this is used by public SetRange() but,
// unlike it, doesn't update the controls state. This makes it useful for
// both this class and its derived classes that don't use m_gauge to
// display progress.
void SetMaximum(int maximum);
// Return the labels to use for showing the elapsed/estimated/remaining
// times respectively.
static wxString GetElapsedLabel() { return wxGetTranslation("Elapsed time:"); }
static wxString GetEstimatedLabel() { return wxGetTranslation("Estimated time:"); }
static wxString GetRemainingLabel() { return wxGetTranslation("Remaining time:"); }
// Similar to wxWindow::HasFlag() but tests for a presence of a wxPD_XXX
// flag in our (separate) flags instead of using m_windowStyle.
bool HasPDFlag(int flag) const { return (m_pdStyle & flag) != 0; }
// Return the progress dialog style. Prefer to use HasPDFlag() if possible.
int GetPDStyle() const { return m_pdStyle; }
void SetPDStyle(int pdStyle) { m_pdStyle = pdStyle; }
// Updates estimated times from a given progress bar value and stores the
// results in provided arguments.
void UpdateTimeEstimates(int value,
unsigned long &elapsedTime,
unsigned long &estimatedTime,
unsigned long &remainingTime);
// Converts seconds to HH:mm:ss format.
static wxString GetFormattedTime(unsigned long timeInSec);
// Create a new event loop if there is no currently running one.
void EnsureActiveEventLoopExists();
// callback for optional abort button
void OnCancel(wxCommandEvent&);
// callback for optional skip button
void OnSkip(wxCommandEvent&);
// callback to disable "hard" window closing
void OnClose(wxCloseEvent&);
// called to disable the other windows while this dialog is shown
void DisableOtherWindows();
// must be called to re-enable the other windows temporarily disabled while
// the dialog was shown
void ReenableOtherWindows();
// Store the parent window as wxWindow::m_parent and also set the top level
// parent reference we store in this class itself.
void SetTopParent(wxWindow* parent);
// return the top level parent window of this dialog (may be NULL)
wxWindow *GetTopParent() const { return m_parentTop; }
// continue processing or not (return value for Update())
State m_state;
// the maximum value
int m_maximum;
#if defined(__WXMSW__)
// the factor we use to always keep the value in 16 bit range as the native
// control only supports ranges from 0 to 65,535
size_t m_factor;
#endif // __WXMSW__
// time when the dialog was created
unsigned long m_timeStart;
// time when the dialog was closed or cancelled
unsigned long m_timeStop;
// time between the moment the dialog was closed/cancelled and resume
unsigned long m_break;
private:
// update the label to show the given time (in seconds)
static void SetTimeLabel(unsigned long val, wxStaticText *label);
// common part of all ctors
void Init();
// create the label with given text and another one to show the time nearby
// as the next windows in the sizer, returns the created control
wxStaticText *CreateLabel(const wxString& text, wxSizer *sizer);
// updates the label message
void UpdateMessage(const wxString &newmsg);
// common part of Update() and Pulse(), returns true if not cancelled
bool DoBeforeUpdate(bool *skip);
// common part of Update() and Pulse()
void DoAfterUpdate();
// shortcuts for enabling buttons
void EnableClose();
void EnableSkip(bool enable = true);
void EnableAbort(bool enable = true);
void DisableSkip() { EnableSkip(false); }
void DisableAbort() { EnableAbort(false); }
// the widget displaying current status (may be NULL)
wxGauge *m_gauge;
// the message displayed
wxStaticText *m_msg;
// displayed elapsed, estimated, remaining time
wxStaticText *m_elapsed,
*m_estimated,
*m_remaining;
// Reference to the parent top level window, automatically becomes NULL if
// it is destroyed and could be always NULL if it's not given at all.
wxWindowRef m_parentTop;
// Progress dialog styles: this is not the same as m_windowStyle because
// wxPD_XXX constants clash with the existing TLW styles so to be sure we
// don't have any conflicts we just use a separate variable for storing
// them.
int m_pdStyle;
// skip some portion
bool m_skip;
// the abort and skip buttons (or NULL if none)
wxButton *m_btnAbort;
wxButton *m_btnSkip;
// saves the time when elapsed time was updated so there is only one
// update per second
unsigned long m_last_timeupdate;
// tells how often a change of the estimated time has to be confirmed
// before it is actually displayed - this reduces the frequency of updates
// of estimated and remaining time
int m_delay;
// counts the confirmations
int m_ctdelay;
unsigned long m_display_estimated;
// for wxPD_APP_MODAL case
wxWindowDisabler *m_winDisabler;
// Temporary event loop created by the dialog itself if there is no
// currently active loop when it is created.
wxEventLoop *m_tempEventLoop;
wxDECLARE_EVENT_TABLE();
wxDECLARE_NO_COPY_CLASS(wxGenericProgressDialog);
};
#endif // __PROGDLGH_G__
#if defined(__WXMSW__) && !defined(__WXUNIVERSAL__)
// The native implementation requires the use of threads and still has some

View file

@ -64,7 +64,88 @@ extern WXDLLIMPEXP_DATA_CORE(const char) wxRadioButtonNameStr[];
#elif defined(__WXGTK__)
#include "wx/gtk1/radiobut.h"
#elif defined(__WXMAC__)
#include "wx/osx/radiobut.h"
#ifndef _WX_RADIOBUT_H_
#define _WX_RADIOBUT_H_
class WXDLLIMPEXP_CORE wxRadioButton: public wxRadioButtonBase
{
wxDECLARE_DYNAMIC_CLASS(wxRadioButton);
public:
wxRadioButton() {}
wxRadioButton(wxWindow *parent, wxWindowID id,
const wxString& label,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxASCII_STR(wxRadioButtonNameStr))
{
Create(parent, id, label, pos, size, style, validator, name);
}
virtual ~wxRadioButton();
bool Create(wxWindow *parent, wxWindowID id,
const wxString& label,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxASCII_STR(wxRadioButtonNameStr));
virtual void SetValue(bool val) wxOVERRIDE;
virtual bool GetValue() const wxOVERRIDE;
// implementation
void Command(wxCommandEvent& event) wxOVERRIDE;
wxRadioButton *AddInCycle(wxRadioButton *cycle);
void RemoveFromCycle();
wxRadioButton *NextInCycle() {return m_cycle;}
// osx specific event handling common for all osx-ports
protected:
wxRadioButton *m_cycle;
};
// Not implemented
#if 0
class WXDLLIMPEXP_FWD_CORE wxBitmap ;
WXDLLIMPEXP_DATA_CORE(extern const wxChar) wxBitmapRadioButtonNameStr[];
class WXDLLIMPEXP_CORE wxBitmapRadioButton: public wxRadioButton
{
wxDECLARE_DYNAMIC_CLASS(wxBitmapRadioButton);
protected:
wxBitmap *theButtonBitmap;
public:
wxBitmapRadioButton() { theButtonBitmap = NULL; }
wxBitmapRadioButton(wxWindow *parent, wxWindowID id,
const wxBitmap *label,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxBitmapRadioButtonNameStr)
{
Create(parent, id, label, pos, size, style, validator, name);
}
bool Create(wxWindow *parent, wxWindowID id,
const wxBitmap *label,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxBitmapRadioButtonNameStr);
virtual void SetLabel(const wxBitmap *label);
virtual void SetValue(bool val) ;
virtual bool GetValue() const ;
};
#endif
#endif
// _WX_RADIOBUT_H_
#elif defined(__WXQT__)
#include "wx/qt/radiobut.h"
#endif

View file

@ -57,7 +57,74 @@ protected:
#if defined(__WINDOWS__)
#include "wx/msw/sound.h"
#elif defined(__WXMAC__)
#include "wx/osx/sound.h"
#ifndef _WX_SOUND_H_
#define _WX_SOUND_H_
#if wxUSE_SOUND
#include "wx/object.h"
class WXDLLIMPEXP_FWD_CORE wxSoundTimer;
class WXDLLIMPEXP_CORE wxSoundData
{
public :
wxSoundData();
virtual ~wxSoundData();
virtual bool Play(unsigned int flags) = 0;
// stops the sound and deletes the optional timer
virtual void Stop();
// mark this to be deleted
virtual void MarkForDeletion();
virtual bool IsMarkedForDeletion() const { return m_markedForDeletion; }
// does the true work of stopping and cleaning up
virtual void DoStop() = 0;
protected:
unsigned int m_flags;
bool m_markedForDeletion;
} ;
class WXDLLIMPEXP_CORE wxSound : public wxSoundBase
{
public:
wxSound();
wxSound(const wxString& fileName, bool isResource = false);
wxSound(size_t size, const void* data);
virtual ~wxSound();
// Create from resource or file
bool Create(const wxString& fileName, bool isResource = false);
// Create from data
bool Create(size_t size, const void* data);
bool IsOk() const { return m_data != NULL; }
// Stop playing any sound
static void Stop();
// Returns true if a sound is being played
static bool IsPlaying();
// Notification when a sound has stopped
static void SoundStopped(const wxSoundData* data);
protected:
bool DoPlay(unsigned flags) const wxOVERRIDE;
void Init();
private:
// data of this object
class wxSoundData *m_data;
wxDECLARE_NO_COPY_CLASS(wxSound);
};
#endif
#endif
// _WX_SOUND_H_
#elif defined(__UNIX__)
#include "wx/unix/sound.h"
#endif

View file

@ -388,8 +388,108 @@ protected:
#include "wx/dfb/toplevel.h"
#define wxTopLevelWindowNative wxTopLevelWindowDFB
#elif defined(__WXMAC__)
#include "wx/osx/toplevel.h"
#define wxTopLevelWindowNative wxTopLevelWindowMac
#ifndef __CPPAST__
#include "wx/osx/toplevel.h"
#define wxTopLevelWindowNative wxTopLevelWindowMac
#else
#ifndef _WX_MSW_TOPLEVEL_H_
#define _WX_MSW_TOPLEVEL_H_
// ----------------------------------------------------------------------------
// wxTopLevelWindowMac
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxTopLevelWindowNative : public wxTopLevelWindowBase
{
public:
// constructors and such
wxTopLevelWindowNative() { Init(); }
wxTopLevelWindowNative(wxWindow *parent,
wxWindowID id,
const wxString& title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE,
const wxString& name = wxASCII_STR(wxFrameNameStr))
{
Init();
(void)Create(parent, id, title, pos, size, style, name);
}
virtual ~wxTopLevelWindowNative();
bool Create(wxWindow *parent,
wxWindowID id,
const wxString& title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE,
const wxString& name = wxASCII_STR(wxFrameNameStr));
bool Create(wxWindow *parent, WXWindow nativeWindow);
virtual bool Destroy() wxOVERRIDE;
virtual wxPoint GetClientAreaOrigin() const wxOVERRIDE;
// Attracts the users attention to this window if the application is
// inactive (should be called when a background event occurs)
virtual void RequestUserAttention(int flags = wxUSER_ATTENTION_INFO) wxOVERRIDE;
// implement base class pure virtuals
virtual void Maximize(bool maximize = true) wxOVERRIDE;
virtual bool IsMaximized() const wxOVERRIDE;
virtual void Iconize(bool iconize = true) wxOVERRIDE;
virtual bool IsIconized() const wxOVERRIDE;
virtual void Restore() wxOVERRIDE;
virtual bool IsActive() wxOVERRIDE;
virtual void ShowWithoutActivating() wxOVERRIDE;
bool EnableFullScreenView(bool enable = true, long style = wxFULLSCREEN_ALL) wxOVERRIDE;
virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL) wxOVERRIDE;
virtual bool IsFullScreen() const wxOVERRIDE;
virtual wxContentProtection GetContentProtection() const wxOVERRIDE;
virtual bool SetContentProtection(wxContentProtection contentProtection) wxOVERRIDE;
// implementation from now on
// --------------------------
virtual void SetTitle( const wxString& title) wxOVERRIDE;
virtual wxString GetTitle() const wxOVERRIDE;
// EnableCloseButton(false) used to disable the "Close"
// button on the title bar
virtual bool EnableCloseButton(bool enable = true) wxOVERRIDE;
virtual bool EnableMaximizeButton(bool enable = true) wxOVERRIDE;
virtual bool EnableMinimizeButton(bool enable = true) wxOVERRIDE;
virtual void SetLabel(const wxString& label) wxOVERRIDE { SetTitle( label ); }
virtual wxString GetLabel() const wxOVERRIDE { return GetTitle(); }
virtual void SetRepresentedFilename(const wxString& filename) wxOVERRIDE;
protected:
// common part of all ctors
void Init();
// is the frame currently iconized?
bool m_iconized;
// should the frame be maximized when it will be shown? set by Maximize()
// when it is called while the frame is hidden
bool m_maximizeOnShow;
private :
wxDECLARE_EVENT_TABLE();
};
#endif // _WX_MSW_TOPLEVEL_H_
#endif
#elif defined(__WXMOTIF__)
#include "wx/motif/toplevel.h"
#define wxTopLevelWindowNative wxTopLevelWindowMotif

View file

@ -2106,7 +2106,33 @@ inline void wxWindowBase::SetInitialBestSize(const wxSize& size)
#else // !wxUniv
#define wxWindowMac wxWindow
#endif // wxUniv
#ifndef __CPPAST__
#include "wx/osx/window.h"
#else
class wxWindow: public wxWindowBase {
wxDECLARE_DYNAMIC_CLASS(wxWindow);
friend class wxDC;
friend class wxPaintDC;
public:
wxWindowMac();
wxWindowMac( wxWindowMac *parent,
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxASCII_STR(wxPanelNameStr) );
virtual ~wxWindowMac();
private:
wxDECLARE_NO_COPY_CLASS(wxWindow);
wxDECLARE_EVENT_TABLE();
};
#endif
#elif defined(__WXQT__)
#ifdef __WXUNIVERSAL__
#define wxWindowNative wxWindowQt

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

3032
wxheaders/wxext/app_ext2.h Normal file

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

View file

@ -5,26 +5,25 @@
#include <wx/vidmode.h>
class wxEventFilterExt;
typedef int (*wxEventFilterExtFilterEventFunc)(const wxEventFilterExt* self, wxEvent& event);
typedef int (*wxEventFilterExtFilterEventwxEventRFunc)(const wxEventFilterExt* self, wxEvent& event);
class wxEventFilterExt: public wxEventFilter
{
public:
wxEventFilterExt(): wxEventFilter() { }
virtual ~wxEventFilterExt() { }
wxEventFilterExtFilterEventFunc m_wxEventFilterExtFilterEvent = NULL;
wxEventFilterExtFilterEventwxEventRFunc m_wxEventFilterExtFilterEventwxEventR = NULL;
virtual int FilterEvent(wxEvent& event) override
{
int res = wxEventFilter::FilterEvent(event);
if (*m_wxEventFilterExtFilterEvent != NULL){
return m_wxEventFilterExtFilterEvent(this, event);
if (*m_wxEventFilterExtFilterEventwxEventR != NULL){
return m_wxEventFilterExtFilterEventwxEventR(this, event);
}
else {
return res;
return 0;
}
}
wxEventFilterExt(wxEventFilterExtFilterEventFunc a_FilterEvent): wxEventFilter() {
m_wxEventFilterExtFilterEvent = a_FilterEvent;
wxEventFilterExt(wxEventFilterExtFilterEventwxEventRFunc a_FilterEventwxEventR): wxEventFilter() {
m_wxEventFilterExtFilterEventwxEventR = a_FilterEventwxEventR;
}
};

File diff suppressed because it is too large Load diff

1704
wxheaders/wxext/frame_ext2.h Normal file

File diff suppressed because it is too large Load diff

View file

@ -6,9 +6,9 @@
class wxRefCounterExt;
class wxObjectExt;
typedef wxClassInfo* (*wxObjectExtGetClassInfoFunc)(const wxObjectExt* self);
typedef wxObjectRefData* (*wxObjectExtCloneRefDatawxObjectRefDataCPFunc)(const wxObjectExt* self, wxObjectRefData const* data);
typedef wxObjectRefData* (*wxObjectExtCreateRefDataFunc)(const wxObjectExt* self);
typedef wxObjectRefData* (*wxObjectExtCloneRefDataFunc)(const wxObjectExt* self, wxObjectRefData const* data);
typedef wxClassInfo* (*wxObjectExtGetClassInfoFunc)(const wxObjectExt* self);
class wxRefCounterExt: public wxRefCounter
{
@ -23,12 +23,12 @@ public:
wxObjectExt(): wxObject() { }
virtual ~wxObjectExt() { }
wxObjectExt(wxObject const& other): wxObject(other) { }
wxObjectExtGetClassInfoFunc m_wxObjectExtGetClassInfo = NULL;
virtual wxClassInfo* GetClassInfo() const override
wxObjectExtCloneRefDatawxObjectRefDataCPFunc m_wxObjectExtCloneRefDatawxObjectRefDataCP = NULL;
virtual wxObjectRefData* CloneRefData(wxObjectRefData const* data) const override
{
wxClassInfo* res = wxObject::GetClassInfo();
if (*m_wxObjectExtGetClassInfo != NULL){
return m_wxObjectExtGetClassInfo(this);
wxObjectRefData* res = wxObject::CloneRefData(data);
if (*m_wxObjectExtCloneRefDatawxObjectRefDataCP != NULL){
return m_wxObjectExtCloneRefDatawxObjectRefDataCP(this, data);
}
else {
return res;
@ -45,21 +45,21 @@ public:
return res;
}
}
wxObjectExtCloneRefDataFunc m_wxObjectExtCloneRefData = NULL;
virtual wxObjectRefData* CloneRefData(wxObjectRefData const* data) const override
wxObjectExtGetClassInfoFunc m_wxObjectExtGetClassInfo = NULL;
virtual wxClassInfo* GetClassInfo() const override
{
wxObjectRefData* res = wxObject::CloneRefData(data);
if (*m_wxObjectExtCloneRefData != NULL){
return m_wxObjectExtCloneRefData(this, data);
wxClassInfo* res = wxObject::GetClassInfo();
if (*m_wxObjectExtGetClassInfo != NULL){
return m_wxObjectExtGetClassInfo(this);
}
else {
return res;
}
}
wxObjectExt(wxObjectExtGetClassInfoFunc a_GetClassInfo, wxObjectExtCreateRefDataFunc a_CreateRefData, wxObjectExtCloneRefDataFunc a_CloneRefData): wxObject() {
m_wxObjectExtGetClassInfo = a_GetClassInfo;
wxObjectExt(wxObjectExtCloneRefDatawxObjectRefDataCPFunc a_CloneRefDatawxObjectRefDataCP, wxObjectExtCreateRefDataFunc a_CreateRefData, wxObjectExtGetClassInfoFunc a_GetClassInfo): wxObject() {
m_wxObjectExtCloneRefDatawxObjectRefDataCP = a_CloneRefDatawxObjectRefDataCP;
m_wxObjectExtCreateRefData = a_CreateRefData;
m_wxObjectExtCloneRefData = a_CloneRefData;
m_wxObjectExtGetClassInfo = a_GetClassInfo;
}
};

View file

@ -1,258 +0,0 @@
#ifndef _WX_OSX_APP_H_EXT_
#define _WX_OSX_APP_H_EXT_
class wxAppExt;
typedef void (*wxAppExtWakeUpIdleFunc)(const wxAppExt* self);
typedef bool (*wxAppExtCallOnInitFunc)(const wxAppExt* self);
typedef bool (*wxAppExtOnInitGuiFunc)(const wxAppExt* self);
typedef int (*wxAppExtOnRunFunc)(const wxAppExt* self);
typedef bool (*wxAppExtProcessIdleFunc)(const wxAppExt* self);
typedef bool (*wxAppExtInitializeFunc)(const wxAppExt* self, int& argc, wxChar** argv);
typedef void (*wxAppExtCleanUpFunc)(const wxAppExt* self);
typedef WX_NSObject (*wxAppExtOSXCreateAppControllerFunc)(const wxAppExt* self);
typedef void (*wxAppExtMacHandleUnhandledEventFunc)(const wxAppExt* self, WXEVENTREF ev);
typedef void (*wxAppExtMacOpenFilesFunc)(const wxAppExt* self, wxArrayString const& fileNames);
typedef void (*wxAppExtMacOpenFileFunc)(const wxAppExt* self, wxString const& fileName);
typedef void (*wxAppExtMacOpenURLFunc)(const wxAppExt* self, wxString const& url);
typedef void (*wxAppExtMacPrintFilesFunc)(const wxAppExt* self, wxArrayString const& fileNames);
typedef void (*wxAppExtMacPrintFileFunc)(const wxAppExt* self, wxString const& fileName);
typedef void (*wxAppExtMacNewFileFunc)(const wxAppExt* self);
typedef void (*wxAppExtMacReopenAppFunc)(const wxAppExt* self);
typedef void (*wxAppExtOSXOnWillFinishLaunchingFunc)(const wxAppExt* self);
typedef void (*wxAppExtOSXOnDidFinishLaunchingFunc)(const wxAppExt* self);
typedef bool (*wxAppExtOSXOnShouldTerminateFunc)(const wxAppExt* self);
typedef void (*wxAppExtOSXOnWillTerminateFunc)(const wxAppExt* self);
typedef bool (*wxAppBaseExtInitializeFunc)(const wxAppBaseExt* self, int& argc, wxChar** argv);
typedef bool (*wxAppBaseExtOnInitGuiFunc)(const wxAppBaseExt* self);
typedef int (*wxAppBaseExtOnRunFunc)(const wxAppBaseExt* self);
typedef int (*wxAppBaseExtOnExitFunc)(const wxAppBaseExt* self);
typedef void (*wxAppBaseExtCleanUpFunc)(const wxAppBaseExt* self);
typedef bool (*wxAppBaseExtSafeYieldFunc)(const wxAppBaseExt* self, wxWindow* win, bool onlyIfNeeded);
typedef bool (*wxAppBaseExtSafeYieldForFunc)(const wxAppBaseExt* self, wxWindow* win, long eventsToProcess);
typedef bool (*wxAppBaseExtProcessIdleFunc)(const wxAppBaseExt* self);
typedef wxWindow* (*wxAppBaseExtGetTopWindowFunc)(const wxAppBaseExt* self);
typedef wxVideoMode (*wxAppBaseExtGetDisplayModeFunc)(const wxAppBaseExt* self);
typedef wxLayoutDirection (*wxAppBaseExtGetLayoutDirectionFunc)(const wxAppBaseExt* self);
typedef bool (*wxAppBaseExtOnCmdLineParsedFunc)(const wxAppBaseExt* self, wxCmdLineParser& parser);
typedef void (*wxAppBaseExtOnInitCmdLineFunc)(const wxAppBaseExt* self, wxCmdLineParser& parser);
typedef void (*wxAppBaseExtSetActiveFunc)(const wxAppBaseExt* self, bool isActive, wxWindow* lastFocus);
typedef wxAppTraits* (*wxAppBaseExtCreateTraitsFunc)(const wxAppBaseExt* self);
class wxAppExt: public wxApp
{
public:
wxAppExt(): wxApp() { }
virtual ~wxAppExt() { }
wxAppExtWakeUpIdleFunc m_wxAppExtWakeUpIdle = NULL;
virtual void WakeUpIdle() override
{
wxApp::WakeUpIdle();
if (*m_wxAppExtWakeUpIdle != NULL){
return m_wxAppExtWakeUpIdle(this);
}
}
wxAppExtCallOnInitFunc m_wxAppExtCallOnInit = NULL;
virtual bool CallOnInit() override
{
bool res = wxApp::CallOnInit();
if (*m_wxAppExtCallOnInit != NULL){
return m_wxAppExtCallOnInit(this);
}
else {
return res;
}
}
wxAppExtOnInitGuiFunc m_wxAppExtOnInitGui = NULL;
virtual bool OnInitGui() override
{
bool res = wxApp::OnInitGui();
if (*m_wxAppExtOnInitGui != NULL){
return m_wxAppExtOnInitGui(this);
}
else {
return res;
}
}
wxAppExtOnRunFunc m_wxAppExtOnRun = NULL;
virtual int OnRun() override
{
int res = wxApp::OnRun();
if (*m_wxAppExtOnRun != NULL){
return m_wxAppExtOnRun(this);
}
else {
return res;
}
}
wxAppExtProcessIdleFunc m_wxAppExtProcessIdle = NULL;
virtual bool ProcessIdle() override
{
bool res = wxApp::ProcessIdle();
if (*m_wxAppExtProcessIdle != NULL){
return m_wxAppExtProcessIdle(this);
}
else {
return res;
}
}
wxAppExtInitializeFunc m_wxAppExtInitialize = NULL;
virtual bool Initialize(int& argc, wxChar** argv) override
{
bool res = wxApp::Initialize(argc, argv);
if (*m_wxAppExtInitialize != NULL){
return m_wxAppExtInitialize(this, argc, argv);
}
else {
return res;
}
}
wxAppExtCleanUpFunc m_wxAppExtCleanUp = NULL;
virtual void CleanUp() override
{
wxApp::CleanUp();
if (*m_wxAppExtCleanUp != NULL){
return m_wxAppExtCleanUp(this);
}
}
wxAppExtOSXCreateAppControllerFunc m_wxAppExtOSXCreateAppController = NULL;
virtual WX_NSObject OSXCreateAppController() override
{
WX_NSObject res = wxApp::OSXCreateAppController();
if (*m_wxAppExtOSXCreateAppController != NULL){
return m_wxAppExtOSXCreateAppController(this);
}
else {
return res;
}
}
wxAppExtMacHandleUnhandledEventFunc m_wxAppExtMacHandleUnhandledEvent = NULL;
virtual void MacHandleUnhandledEvent(WXEVENTREF ev) override
{
wxApp::MacHandleUnhandledEvent(ev);
if (*m_wxAppExtMacHandleUnhandledEvent != NULL){
return m_wxAppExtMacHandleUnhandledEvent(this, ev);
}
}
wxAppExtMacOpenFilesFunc m_wxAppExtMacOpenFiles = NULL;
virtual void MacOpenFiles(wxArrayString const& fileNames) override
{
wxApp::MacOpenFiles(fileNames);
if (*m_wxAppExtMacOpenFiles != NULL){
return m_wxAppExtMacOpenFiles(this, fileNames);
}
}
wxAppExtMacOpenFileFunc m_wxAppExtMacOpenFile = NULL;
virtual void MacOpenFile(wxString const& fileName) override
{
wxApp::MacOpenFile(fileName);
if (*m_wxAppExtMacOpenFile != NULL){
return m_wxAppExtMacOpenFile(this, fileName);
}
}
wxAppExtMacOpenURLFunc m_wxAppExtMacOpenURL = NULL;
virtual void MacOpenURL(wxString const& url) override
{
wxApp::MacOpenURL(url);
if (*m_wxAppExtMacOpenURL != NULL){
return m_wxAppExtMacOpenURL(this, url);
}
}
wxAppExtMacPrintFilesFunc m_wxAppExtMacPrintFiles = NULL;
virtual void MacPrintFiles(wxArrayString const& fileNames) override
{
wxApp::MacPrintFiles(fileNames);
if (*m_wxAppExtMacPrintFiles != NULL){
return m_wxAppExtMacPrintFiles(this, fileNames);
}
}
wxAppExtMacPrintFileFunc m_wxAppExtMacPrintFile = NULL;
virtual void MacPrintFile(wxString const& fileName) override
{
wxApp::MacPrintFile(fileName);
if (*m_wxAppExtMacPrintFile != NULL){
return m_wxAppExtMacPrintFile(this, fileName);
}
}
wxAppExtMacNewFileFunc m_wxAppExtMacNewFile = NULL;
virtual void MacNewFile() override
{
wxApp::MacNewFile();
if (*m_wxAppExtMacNewFile != NULL){
return m_wxAppExtMacNewFile(this);
}
}
wxAppExtMacReopenAppFunc m_wxAppExtMacReopenApp = NULL;
virtual void MacReopenApp() override
{
wxApp::MacReopenApp();
if (*m_wxAppExtMacReopenApp != NULL){
return m_wxAppExtMacReopenApp(this);
}
}
wxAppExtOSXOnWillFinishLaunchingFunc m_wxAppExtOSXOnWillFinishLaunching = NULL;
virtual void OSXOnWillFinishLaunching() override
{
wxApp::OSXOnWillFinishLaunching();
if (*m_wxAppExtOSXOnWillFinishLaunching != NULL){
return m_wxAppExtOSXOnWillFinishLaunching(this);
}
}
wxAppExtOSXOnDidFinishLaunchingFunc m_wxAppExtOSXOnDidFinishLaunching = NULL;
virtual void OSXOnDidFinishLaunching() override
{
wxApp::OSXOnDidFinishLaunching();
if (*m_wxAppExtOSXOnDidFinishLaunching != NULL){
return m_wxAppExtOSXOnDidFinishLaunching(this);
}
}
wxAppExtOSXOnShouldTerminateFunc m_wxAppExtOSXOnShouldTerminate = NULL;
virtual bool OSXOnShouldTerminate() override
{
bool res = wxApp::OSXOnShouldTerminate();
if (*m_wxAppExtOSXOnShouldTerminate != NULL){
return m_wxAppExtOSXOnShouldTerminate(this);
}
else {
return res;
}
}
wxAppExtOSXOnWillTerminateFunc m_wxAppExtOSXOnWillTerminate = NULL;
virtual void OSXOnWillTerminate() override
{
wxApp::OSXOnWillTerminate();
if (*m_wxAppExtOSXOnWillTerminate != NULL){
return m_wxAppExtOSXOnWillTerminate(this);
}
}
static void SetInitializerFunction(wxAppInitializerFunction fn)
{ ms_appInitFn = fn; }
wxAppExt(wxAppExtWakeUpIdleFunc a_WakeUpIdle, wxAppExtCallOnInitFunc a_CallOnInit, wxAppExtOnInitGuiFunc a_OnInitGui, wxAppExtOnRunFunc a_OnRun, wxAppExtProcessIdleFunc a_ProcessIdle, wxAppExtInitializeFunc a_Initialize, wxAppExtCleanUpFunc a_CleanUp, wxAppExtOSXCreateAppControllerFunc a_OSXCreateAppController, wxAppExtMacHandleUnhandledEventFunc a_MacHandleUnhandledEvent, wxAppExtMacOpenFilesFunc a_MacOpenFiles, wxAppExtMacOpenFileFunc a_MacOpenFile, wxAppExtMacOpenURLFunc a_MacOpenURL, wxAppExtMacPrintFilesFunc a_MacPrintFiles, wxAppExtMacPrintFileFunc a_MacPrintFile, wxAppExtMacNewFileFunc a_MacNewFile, wxAppExtMacReopenAppFunc a_MacReopenApp, wxAppExtOSXOnWillFinishLaunchingFunc a_OSXOnWillFinishLaunching, wxAppExtOSXOnDidFinishLaunchingFunc a_OSXOnDidFinishLaunching, wxAppExtOSXOnShouldTerminateFunc a_OSXOnShouldTerminate, wxAppExtOSXOnWillTerminateFunc a_OSXOnWillTerminate): wxApp() {
m_wxAppExtWakeUpIdle = a_WakeUpIdle;
m_wxAppExtCallOnInit = a_CallOnInit;
m_wxAppExtOnInitGui = a_OnInitGui;
m_wxAppExtOnRun = a_OnRun;
m_wxAppExtProcessIdle = a_ProcessIdle;
m_wxAppExtInitialize = a_Initialize;
m_wxAppExtCleanUp = a_CleanUp;
m_wxAppExtOSXCreateAppController = a_OSXCreateAppController;
m_wxAppExtMacHandleUnhandledEvent = a_MacHandleUnhandledEvent;
m_wxAppExtMacOpenFiles = a_MacOpenFiles;
m_wxAppExtMacOpenFile = a_MacOpenFile;
m_wxAppExtMacOpenURL = a_MacOpenURL;
m_wxAppExtMacPrintFiles = a_MacPrintFiles;
m_wxAppExtMacPrintFile = a_MacPrintFile;
m_wxAppExtMacNewFile = a_MacNewFile;
m_wxAppExtMacReopenApp = a_MacReopenApp;
m_wxAppExtOSXOnWillFinishLaunching = a_OSXOnWillFinishLaunching;
m_wxAppExtOSXOnDidFinishLaunching = a_OSXOnDidFinishLaunching;
m_wxAppExtOSXOnShouldTerminate = a_OSXOnShouldTerminate;
m_wxAppExtOSXOnWillTerminate = a_OSXOnWillTerminate;
}
};
#endif

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long