replaced by stubs files
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@509 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1,138 +1,153 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: app.h
|
// Name: app.h
|
||||||
// Purpose:
|
// Purpose: wxApp class
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
// Licence: wxWindows licence
|
// Copyright: (c) AUTHOR
|
||||||
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifndef __GTKAPPH__
|
#ifndef _WX_APP_H_
|
||||||
#define __GTKAPPH__
|
#define _WX_APP_H_
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma interface
|
#pragma interface "app.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/window.h"
|
#include "wx/defs.h"
|
||||||
#include "wx/frame.h"
|
#include "wx/object.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
class WXDLLEXPORT wxFrame;
|
||||||
// classes
|
class WXDLLEXPORT wxWindow;
|
||||||
//-----------------------------------------------------------------------------
|
class WXDLLEXPORT wxApp ;
|
||||||
|
class WXDLLEXPORT wxKeyEvent;
|
||||||
class wxApp;
|
class WXDLLEXPORT wxLog;
|
||||||
class wxLog;
|
|
||||||
class wxConfig; // it's not used #if !USE_WXCONFIG, but fwd decl doesn't harm
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// global data
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
extern wxApp *wxTheApp;
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// global functions
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
void wxExit(void);
|
|
||||||
bool wxYield(void);
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// constants
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
#define wxPRINT_WINDOWS 1
|
#define wxPRINT_WINDOWS 1
|
||||||
#define wxPRINT_POSTSCRIPT 2
|
#define wxPRINT_POSTSCRIPT 2
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
WXDLLEXPORT_DATA(extern wxApp*) wxTheApp;
|
||||||
// wxApp
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxApp: public wxEvtHandler
|
void WXDLLEXPORT wxCleanUp();
|
||||||
|
void WXDLLEXPORT wxCommonCleanUp(); // Call this from the platform's wxCleanUp()
|
||||||
|
void WXDLLEXPORT wxCommonInit(); // Call this from the platform's initialization
|
||||||
|
|
||||||
|
// Force an exit from main loop
|
||||||
|
void WXDLLEXPORT wxExit();
|
||||||
|
|
||||||
|
// Yield to other apps/messages
|
||||||
|
bool WXDLLEXPORT wxYield();
|
||||||
|
|
||||||
|
// Represents the application. Derive OnInit and declare
|
||||||
|
// a new App object to start application
|
||||||
|
class WXDLLEXPORT wxApp: public wxEvtHandler
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxApp)
|
DECLARE_DYNAMIC_CLASS(wxApp)
|
||||||
|
wxApp();
|
||||||
|
inline ~wxApp() {}
|
||||||
|
|
||||||
public:
|
static void SetInitializerFunction(wxAppInitializerFunction fn) { m_appInitFn = fn; }
|
||||||
|
static wxAppInitializerFunction GetInitializerFunction() { return m_appInitFn; }
|
||||||
wxApp(void);
|
|
||||||
~wxApp(void);
|
|
||||||
|
|
||||||
static void SetInitializerFunction(wxAppInitializerFunction fn) { m_appInitFn = fn; }
|
|
||||||
static wxAppInitializerFunction GetInitializerFunction(void) { return m_appInitFn; }
|
|
||||||
|
|
||||||
virtual bool OnInit(void);
|
|
||||||
virtual bool OnInitGui(void);
|
|
||||||
virtual int OnRun(void);
|
|
||||||
virtual int OnExit(void);
|
|
||||||
|
|
||||||
wxWindow *GetTopWindow(void);
|
|
||||||
void SetTopWindow( wxWindow *win );
|
|
||||||
virtual int MainLoop(void);
|
|
||||||
void ExitMainLoop(void);
|
|
||||||
bool Initialized(void);
|
|
||||||
virtual bool Pending(void);
|
|
||||||
virtual void Dispatch(void);
|
|
||||||
|
|
||||||
inline void SetWantDebugOutput(bool flag) { m_wantDebugOutput = flag; }
|
virtual int MainLoop();
|
||||||
inline bool GetWantDebugOutput(void) { return m_wantDebugOutput; }
|
void ExitMainLoop();
|
||||||
|
bool Initialized();
|
||||||
|
virtual bool Pending() ;
|
||||||
|
virtual void Dispatch() ;
|
||||||
|
|
||||||
void OnIdle( wxIdleEvent &event );
|
virtual void OnIdle(wxIdleEvent& event);
|
||||||
bool SendIdleEvents(void);
|
|
||||||
bool SendIdleEvents( wxWindow* win );
|
// Generic
|
||||||
|
virtual bool OnInit() { return FALSE; };
|
||||||
inline wxString GetAppName(void) const {
|
|
||||||
|
// No specific tasks to do here.
|
||||||
|
virtual bool OnInitGui() { return TRUE; }
|
||||||
|
|
||||||
|
// Called to set off the main loop
|
||||||
|
virtual int OnRun() { return MainLoop(); };
|
||||||
|
virtual int OnExit() { return 0; }
|
||||||
|
|
||||||
|
inline void SetPrintMode(int mode) { m_printMode = mode; }
|
||||||
|
inline int GetPrintMode() const { return m_printMode; }
|
||||||
|
|
||||||
|
inline void SetExitOnFrameDelete(bool flag) { m_exitOnFrameDelete = flag; }
|
||||||
|
inline bool GetExitOnFrameDelete() const { return m_exitOnFrameDelete; }
|
||||||
|
|
||||||
|
inline wxString GetAppName() const {
|
||||||
if (m_appName != "")
|
if (m_appName != "")
|
||||||
return m_appName;
|
return m_appName;
|
||||||
else return m_className;
|
else return m_className;
|
||||||
}
|
}
|
||||||
inline void SetAppName(const wxString& name) { m_appName = name; };
|
|
||||||
inline wxString GetClassName(void) const { return m_className; }
|
|
||||||
inline void SetClassName(const wxString& name) { m_className = name; }
|
|
||||||
const wxString& GetVendorName() const { return m_vendorName; }
|
|
||||||
void SetVendorName(const wxString& name) { m_vendorName = name; }
|
|
||||||
|
|
||||||
inline void SetExitOnFrameDelete(bool flag) { m_exitOnFrameDelete = flag; }
|
inline void SetAppName(const wxString& name) { m_appName = name; };
|
||||||
inline bool GetExitOnFrameDelete(void) const { return m_exitOnFrameDelete; }
|
inline wxString GetClassName() const { return m_className; }
|
||||||
|
inline void SetClassName(const wxString& name) { m_className = name; }
|
||||||
void SetPrintMode(int WXUNUSED(mode) ) {};
|
|
||||||
int GetPrintMode(void) const { return wxPRINT_POSTSCRIPT; };
|
|
||||||
|
|
||||||
// override this function to create default log target of arbitrary
|
|
||||||
// user-defined classv (default implementation creates a wxLogGui object)
|
|
||||||
virtual wxLog *CreateLogTarget();
|
|
||||||
|
|
||||||
#if USE_WXCONFIG
|
|
||||||
// override this function to create a global wxConfig object of different
|
|
||||||
// than default type (right now the default implementation returns NULL)
|
|
||||||
virtual wxConfig *CreateConfig() { return NULL; }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// GTK implementation
|
|
||||||
|
|
||||||
static void CommonInit(void);
|
void SetVendorName(const wxString& vendorName) { m_vendorName = vendorName; }
|
||||||
static void CommonCleanUp(void);
|
const wxString& GetVendorName() const { return m_vendorName; }
|
||||||
|
|
||||||
bool ProcessIdle(void);
|
|
||||||
void DeletePendingObjects(void);
|
|
||||||
|
|
||||||
bool m_initialized;
|
|
||||||
bool m_exitOnFrameDelete;
|
|
||||||
bool m_wantDebugOutput;
|
|
||||||
wxWindow *m_topWindow;
|
|
||||||
|
|
||||||
int argc;
|
|
||||||
char **argv;
|
|
||||||
|
|
||||||
static wxAppInitializerFunction m_appInitFn;
|
|
||||||
|
|
||||||
private:
|
|
||||||
wxString m_vendorName,
|
|
||||||
m_appName,
|
|
||||||
m_className;
|
|
||||||
|
|
||||||
DECLARE_EVENT_TABLE()
|
wxWindow *GetTopWindow() const ;
|
||||||
|
inline void SetTopWindow(wxWindow *win) { m_topWindow = win; }
|
||||||
|
|
||||||
|
inline void SetWantDebugOutput(bool flag) { m_wantDebugOutput = flag; }
|
||||||
|
inline bool GetWantDebugOutput() { return m_wantDebugOutput; }
|
||||||
|
|
||||||
|
// Send idle event to all top-level windows.
|
||||||
|
// Returns TRUE if more idle time is requested.
|
||||||
|
bool SendIdleEvents();
|
||||||
|
|
||||||
|
// Send idle event to window and all subwindows
|
||||||
|
// Returns TRUE if more idle time is requested.
|
||||||
|
bool SendIdleEvents(wxWindow* win);
|
||||||
|
|
||||||
|
// Windows only, but for compatibility...
|
||||||
|
inline void SetAuto3D(bool flag) { m_auto3D = flag; }
|
||||||
|
inline bool GetAuto3D() const { return m_auto3D; }
|
||||||
|
|
||||||
|
// Creates a log object
|
||||||
|
virtual wxLog* CreateLogTarget();
|
||||||
|
|
||||||
|
public:
|
||||||
|
// Will always be set to the appropriate, main-style values.
|
||||||
|
int argc;
|
||||||
|
char ** argv;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool m_wantDebugOutput ;
|
||||||
|
wxString m_className;
|
||||||
|
wxString m_appName,
|
||||||
|
m_vendorName;
|
||||||
|
wxWindow * m_topWindow;
|
||||||
|
bool m_exitOnFrameDelete;
|
||||||
|
bool m_showOnInit;
|
||||||
|
int m_printMode; // wxPRINT_WINDOWS, wxPRINT_POSTSCRIPT
|
||||||
|
bool m_auto3D ; // Always use 3D controls, except
|
||||||
|
// where overriden
|
||||||
|
static wxAppInitializerFunction m_appInitFn;
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
// Implementation
|
||||||
|
static void CommonInit();
|
||||||
|
static void CommonCleanUp();
|
||||||
|
void DeletePendingObjects();
|
||||||
|
bool ProcessIdle();
|
||||||
|
|
||||||
|
public:
|
||||||
|
static long sm_lastMessageTime;
|
||||||
|
int m_nCmdShow;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool m_keepGoing ;
|
||||||
|
|
||||||
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // __GTKAPPH__
|
// TODO: add platform-specific arguments
|
||||||
|
int WXDLLEXPORT wxEntry( int argc, char *argv[] );
|
||||||
|
|
||||||
|
#endif
|
||||||
|
// _WX_APP_H_
|
||||||
|
|
||||||
|
|||||||
@@ -1,125 +1,198 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: bitmap.h
|
// Name: bitmap.h
|
||||||
// Purpose:
|
// Purpose: wxBitmap class
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
|
// Created: ??/??/98
|
||||||
// RCS-ID: $Id$
|
// RCS-ID: $Id$
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_BITMAP_H_
|
||||||
#ifndef __GTKBITMAPH__
|
#define _WX_BITMAP_H_
|
||||||
#define __GTKBITMAPH__
|
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma interface
|
#pragma interface "bitmap.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/defs.h"
|
#include "wx/gdiobj.h"
|
||||||
#include "wx/object.h"
|
#include "wx/gdicmn.h"
|
||||||
#include "wx/string.h"
|
|
||||||
#include "wx/palette.h"
|
#include "wx/palette.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
// Bitmap
|
||||||
// classes
|
class WXDLLEXPORT wxDC;
|
||||||
//-----------------------------------------------------------------------------
|
class WXDLLEXPORT wxControl;
|
||||||
|
class WXDLLEXPORT wxBitmap;
|
||||||
|
class WXDLLEXPORT wxBitmapHandler;
|
||||||
|
class WXDLLEXPORT wxIcon;
|
||||||
|
class WXDLLEXPORT wxCursor;
|
||||||
|
|
||||||
class wxDC;
|
// A mask is a mono bitmap used for drawing bitmaps
|
||||||
class wxPaintDC;
|
// transparently.
|
||||||
class wxMemoryDC;
|
class WXDLLEXPORT wxMask: public wxObject
|
||||||
class wxToolBar;
|
|
||||||
class wxBitmapButton;
|
|
||||||
class wxStaticBitmap;
|
|
||||||
class wxFrame;
|
|
||||||
|
|
||||||
class wxMask;
|
|
||||||
class wxBitmap;
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// wxMask
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxMask: public wxObject
|
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxMask)
|
DECLARE_DYNAMIC_CLASS(wxMask)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
wxMask();
|
||||||
|
|
||||||
wxMask();
|
// Construct a mask from a bitmap and a colour indicating
|
||||||
wxMask( const wxBitmap& bitmap, const wxColour& colour );
|
// the transparent area
|
||||||
wxMask( const wxBitmap& bitmap, int paletteIndex );
|
wxMask(const wxBitmap& bitmap, const wxColour& colour);
|
||||||
wxMask( const wxBitmap& bitmap );
|
|
||||||
~wxMask();
|
|
||||||
|
|
||||||
private:
|
// Construct a mask from a bitmap and a palette index indicating
|
||||||
|
// the transparent area
|
||||||
|
wxMask(const wxBitmap& bitmap, int paletteIndex);
|
||||||
|
|
||||||
friend wxBitmap;
|
// Construct a mask from a mono bitmap (copies the bitmap).
|
||||||
friend wxDC;
|
wxMask(const wxBitmap& bitmap);
|
||||||
friend wxPaintDC;
|
|
||||||
friend wxToolBar;
|
|
||||||
friend wxBitmapButton;
|
|
||||||
friend wxStaticBitmap;
|
|
||||||
friend wxFrame;
|
|
||||||
|
|
||||||
protected:
|
~wxMask();
|
||||||
|
|
||||||
|
bool Create(const wxBitmap& bitmap, const wxColour& colour);
|
||||||
|
bool Create(const wxBitmap& bitmap, int paletteIndex);
|
||||||
|
bool Create(const wxBitmap& bitmap);
|
||||||
|
|
||||||
|
/* TODO: platform-specific data access
|
||||||
|
// Implementation
|
||||||
|
inline WXHBITMAP GetMaskBitmap() const { return m_maskBitmap; }
|
||||||
|
inline void SetMaskBitmap(WXHBITMAP bmp) { m_maskBitmap = bmp; }
|
||||||
|
protected:
|
||||||
|
WXHBITMAP m_maskBitmap;
|
||||||
|
*/
|
||||||
};
|
};
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
class WXDLLEXPORT wxBitmapRefData: public wxGDIRefData
|
||||||
// wxBitmap
|
{
|
||||||
//-----------------------------------------------------------------------------
|
friend class WXDLLEXPORT wxBitmap;
|
||||||
|
friend class WXDLLEXPORT wxIcon;
|
||||||
|
friend class WXDLLEXPORT wxCursor;
|
||||||
|
public:
|
||||||
|
wxBitmapRefData();
|
||||||
|
~wxBitmapRefData();
|
||||||
|
|
||||||
// CMB 20/5/98: added xbm constructor and GetBitmap() method
|
public:
|
||||||
class wxBitmap: public wxObject
|
int m_width;
|
||||||
|
int m_height;
|
||||||
|
int m_depth;
|
||||||
|
bool m_ok;
|
||||||
|
int m_numColors;
|
||||||
|
wxPalette m_bitmapPalette;
|
||||||
|
int m_quality;
|
||||||
|
|
||||||
|
/* WXHBITMAP m_hBitmap; TODO: platform-specific handle */
|
||||||
|
wxMask * m_bitmapMask; // Optional mask
|
||||||
|
};
|
||||||
|
|
||||||
|
#define M_BITMAPDATA ((wxBitmapRefData *)m_refData)
|
||||||
|
|
||||||
|
class WXDLLEXPORT wxBitmapHandler: public wxObject
|
||||||
|
{
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxBitmapHandler)
|
||||||
|
public:
|
||||||
|
wxBitmapHandler() { m_name = ""; m_extension = ""; m_type = 0; };
|
||||||
|
|
||||||
|
virtual bool Create(wxBitmap *bitmap, void *data, long flags, int width, int height, int depth = 1);
|
||||||
|
virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, long flags,
|
||||||
|
int desiredWidth, int desiredHeight);
|
||||||
|
virtual bool SaveFile(wxBitmap *bitmap, const wxString& name, int type, const wxPalette *palette = NULL);
|
||||||
|
|
||||||
|
inline void SetName(const wxString& name) { m_name = name; }
|
||||||
|
inline void SetExtension(const wxString& ext) { m_extension = ext; }
|
||||||
|
inline void SetType(long type) { m_type = type; }
|
||||||
|
inline wxString GetName() const { return m_name; }
|
||||||
|
inline wxString GetExtension() const { return m_extension; }
|
||||||
|
inline long GetType() const { return m_type; }
|
||||||
|
protected:
|
||||||
|
wxString m_name;
|
||||||
|
wxString m_extension;
|
||||||
|
long m_type;
|
||||||
|
};
|
||||||
|
|
||||||
|
#define M_BITMAPHANDLERDATA ((wxBitmapRefData *)bitmap->GetRefData())
|
||||||
|
|
||||||
|
class WXDLLEXPORT wxBitmap: public wxGDIObject
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxBitmap)
|
DECLARE_DYNAMIC_CLASS(wxBitmap)
|
||||||
|
|
||||||
public:
|
friend class WXDLLEXPORT wxBitmapHandler;
|
||||||
|
|
||||||
wxBitmap();
|
public:
|
||||||
wxBitmap( int width, int height, int depth = -1 );
|
wxBitmap(); // Platform-specific
|
||||||
wxBitmap( const char bits[], int width, int height, int depth = 1 );
|
|
||||||
wxBitmap( char **bits );
|
|
||||||
wxBitmap( const wxBitmap& bmp );
|
|
||||||
wxBitmap( const wxBitmap* bmp );
|
|
||||||
wxBitmap( const wxString &filename, int type = wxBITMAP_TYPE_XPM);
|
|
||||||
~wxBitmap();
|
|
||||||
wxBitmap& operator = ( const wxBitmap& bmp );
|
|
||||||
bool operator == ( const wxBitmap& bmp );
|
|
||||||
bool operator != ( const wxBitmap& bmp );
|
|
||||||
bool Ok() const;
|
|
||||||
|
|
||||||
int GetHeight() const;
|
// Copy constructors
|
||||||
int GetWidth() const;
|
inline wxBitmap(const wxBitmap& bitmap)
|
||||||
int GetDepth() const;
|
{ Ref(bitmap); if ( wxTheBitmapList ) wxTheBitmapList->AddBitmap(this); }
|
||||||
void SetHeight( int height );
|
inline wxBitmap(const wxBitmap* bitmap) { if (bitmap) Ref(*bitmap); if ( wxTheBitmapList ) wxTheBitmapList->AddBitmap(this); }
|
||||||
void SetWidth( int width );
|
|
||||||
void SetDepth( int depth );
|
|
||||||
|
|
||||||
wxMask *GetMask() const;
|
// Initialize with raw data.
|
||||||
void SetMask( wxMask *mask );
|
wxBitmap(const char bits[], int width, int height, int depth = 1);
|
||||||
|
|
||||||
void Resize( int height, int width );
|
/* TODO: maybe implement XPM reading
|
||||||
|
// Initialize with XPM data
|
||||||
|
wxBitmap(const char **data);
|
||||||
|
*/
|
||||||
|
|
||||||
bool SaveFile( const wxString &name, int type, wxPalette *palette = NULL );
|
// Load a file or resource
|
||||||
bool LoadFile( const wxString &name, int type = wxBITMAP_TYPE_XPM);
|
// TODO: make default type whatever's appropriate for the platform.
|
||||||
|
wxBitmap(const wxString& name, long type = wxBITMAP_TYPE_BMP_RESOURCE);
|
||||||
|
|
||||||
wxPalette *GetPalette() const;
|
// Constructor for generalised creation from data
|
||||||
wxPalette *GetColourMap() const
|
wxBitmap(void *data, long type, int width, int height, int depth = 1);
|
||||||
{ return GetPalette(); };
|
|
||||||
|
|
||||||
private:
|
// If depth is omitted, will create a bitmap compatible with the display
|
||||||
|
wxBitmap(int width, int height, int depth = -1);
|
||||||
|
~wxBitmap();
|
||||||
|
|
||||||
friend wxDC;
|
virtual bool Create(int width, int height, int depth = -1);
|
||||||
friend wxPaintDC;
|
virtual bool Create(void *data, long type, int width, int height, int depth = 1);
|
||||||
friend wxMemoryDC;
|
virtual bool LoadFile(const wxString& name, long type = wxBITMAP_TYPE_BMP_RESOURCE);
|
||||||
friend wxToolBar;
|
virtual bool SaveFile(const wxString& name, int type, const wxPalette *cmap = NULL);
|
||||||
friend wxBitmapButton;
|
|
||||||
friend wxStaticBitmap;
|
inline bool Ok() const { return (M_BITMAPDATA && M_BITMAPDATA->m_ok); }
|
||||||
friend wxFrame;
|
inline int GetWidth() const { return (M_BITMAPDATA ? M_BITMAPDATA->m_width : 0); }
|
||||||
|
inline int GetHeight() const { return (M_BITMAPDATA ? M_BITMAPDATA->m_height : 0); }
|
||||||
|
inline int GetDepth() const { return (M_BITMAPDATA ? M_BITMAPDATA->m_depth : 0); }
|
||||||
|
inline int GetQuality() const { return (M_BITMAPDATA ? M_BITMAPDATA->m_quality : 0); }
|
||||||
|
void SetWidth(int w);
|
||||||
|
void SetHeight(int h);
|
||||||
|
void SetDepth(int d);
|
||||||
|
void SetQuality(int q);
|
||||||
|
void SetOk(bool isOk);
|
||||||
|
|
||||||
|
inline wxPalette* GetPalette() const { return (M_BITMAPDATA ? (& M_BITMAPDATA->m_bitmapPalette) : NULL); }
|
||||||
|
void SetPalette(const wxPalette& palette);
|
||||||
|
|
||||||
|
inline wxMask *GetMask() const { return (M_BITMAPDATA ? M_BITMAPDATA->m_bitmapMask : NULL); }
|
||||||
|
void SetMask(wxMask *mask) ;
|
||||||
|
|
||||||
|
inline wxBitmap& operator = (const wxBitmap& bitmap) { if (*this == bitmap) return (*this); Ref(bitmap); return *this; }
|
||||||
|
inline bool operator == (const wxBitmap& bitmap) { return m_refData == bitmap.m_refData; }
|
||||||
|
inline bool operator != (const wxBitmap& bitmap) { return m_refData != bitmap.m_refData; }
|
||||||
|
|
||||||
|
// Format handling
|
||||||
|
static inline wxList& GetHandlers() { return sm_handlers; }
|
||||||
|
static void AddHandler(wxBitmapHandler *handler);
|
||||||
|
static void InsertHandler(wxBitmapHandler *handler);
|
||||||
|
static bool RemoveHandler(const wxString& name);
|
||||||
|
static wxBitmapHandler *FindHandler(const wxString& name);
|
||||||
|
static wxBitmapHandler *FindHandler(const wxString& extension, long bitmapType);
|
||||||
|
static wxBitmapHandler *FindHandler(long bitmapType);
|
||||||
|
|
||||||
|
static void InitStandardHandlers();
|
||||||
|
static void CleanUpHandlers();
|
||||||
|
protected:
|
||||||
|
static wxList sm_handlers;
|
||||||
|
|
||||||
|
/*
|
||||||
|
// TODO: Implementation
|
||||||
|
public:
|
||||||
|
void SetHBITMAP(WXHBITMAP bmp);
|
||||||
|
inline WXHBITMAP GetHBITMAP() const { return (M_BITMAPDATA ? M_BITMAPDATA->m_hBitmap : 0); }
|
||||||
|
bool FreeResource(bool force = FALSE);
|
||||||
|
*/
|
||||||
|
|
||||||
// no data :-)
|
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
#endif // __GTKBITMAPH__
|
// _WX_BITMAP_H_
|
||||||
|
|||||||
@@ -1,62 +1,83 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: bmpbutton.h
|
// Name: bmpbuttn.h
|
||||||
// Purpose:
|
// Purpose: wxBitmapButton class
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_BMPBUTTN_H_
|
||||||
#ifndef __BMPBUTTONH__
|
#define _WX_BMPBUTTN_H_
|
||||||
#define __BMPBUTTONH__
|
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma interface
|
#pragma interface "bmpbuttn.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/defs.h"
|
#include "wx/button.h"
|
||||||
#include "wx/object.h"
|
|
||||||
#include "wx/list.h"
|
|
||||||
#include "wx/control.h"
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
WXDLLEXPORT_DATA(extern const char*) wxButtonNameStr;
|
||||||
// classes
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxBitmapButton;
|
#define wxDEFAULT_BUTTON_MARGIN 4
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
class WXDLLEXPORT wxBitmapButton: public wxButton
|
||||||
// global data
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
extern const char *wxButtonNameStr;
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// wxBitmapButton
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxBitmapButton: public wxControl
|
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxBitmapButton)
|
DECLARE_DYNAMIC_CLASS(wxBitmapButton)
|
||||||
|
public:
|
||||||
|
inline wxBitmapButton() { m_marginX = wxDEFAULT_BUTTON_MARGIN; m_marginY = wxDEFAULT_BUTTON_MARGIN; }
|
||||||
|
inline wxBitmapButton(wxWindow *parent, wxWindowID id, const wxBitmap& bitmap,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize, long style = wxBU_AUTODRAW,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
|
const wxString& name = wxButtonNameStr)
|
||||||
|
{
|
||||||
|
Create(parent, id, bitmap, pos, size, style, validator, name);
|
||||||
|
}
|
||||||
|
|
||||||
public:
|
bool Create(wxWindow *parent, wxWindowID id, const wxBitmap& bitmap,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize, long style = wxBU_AUTODRAW,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
|
const wxString& name = wxButtonNameStr);
|
||||||
|
|
||||||
wxBitmapButton(void);
|
virtual void SetLabel(const wxBitmap& bitmap)
|
||||||
wxBitmapButton( wxWindow *parent, wxWindowID id, const wxBitmap &bitmap,
|
{
|
||||||
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
|
SetBitmapLabel(bitmap);
|
||||||
long style = 0, const wxString &name = wxButtonNameStr );
|
}
|
||||||
bool Create( wxWindow *parent, wxWindowID id, const wxBitmap &bitmap,
|
|
||||||
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
|
virtual void SetBitmapLabel(const wxBitmap& bitmap);
|
||||||
long style = 0, const wxString &name = wxButtonNameStr );
|
|
||||||
void SetDefault(void);
|
inline wxBitmap& GetBitmapLabel() const { return (wxBitmap&) m_buttonBitmap; }
|
||||||
void SetLabel( const wxString &label );
|
inline wxBitmap& GetBitmapSelected() const { return (wxBitmap&) m_buttonBitmapSelected; }
|
||||||
wxString GetLabel(void) const;
|
inline wxBitmap& GetBitmapFocus() const { return (wxBitmap&) m_buttonBitmapFocus; }
|
||||||
|
inline wxBitmap& GetBitmapDisabled() const { return (wxBitmap&) m_buttonBitmapDisabled; }
|
||||||
public:
|
|
||||||
|
inline void SetBitmapSelected(const wxBitmap& sel) { m_buttonBitmapSelected = sel; };
|
||||||
wxBitmap m_bitmap;
|
inline void SetBitmapFocus(const wxBitmap& focus) { m_buttonBitmapFocus = focus; };
|
||||||
|
inline void SetBitmapDisabled(const wxBitmap& disabled) { m_buttonBitmapDisabled = disabled; };
|
||||||
|
|
||||||
|
inline void SetMargins(int x, int y) { m_marginX = x; m_marginY = y; }
|
||||||
|
inline int GetMarginX() { return m_marginX; }
|
||||||
|
inline int GetMarginY() { return m_marginY; }
|
||||||
|
|
||||||
|
/*
|
||||||
|
// TODO: Implementation
|
||||||
|
virtual bool MSWOnDraw(WXDRAWITEMSTRUCT *item);
|
||||||
|
virtual void DrawFace( WXHDC dc, int left, int top, int right, int bottom, bool sel );
|
||||||
|
virtual void DrawButtonFocus( WXHDC dc, int left, int top, int right, int bottom, bool sel );
|
||||||
|
virtual void DrawButtonDisable( WXHDC dc, int left, int top, int right, int bottom, bool with_marg );
|
||||||
|
*/
|
||||||
|
|
||||||
|
protected:
|
||||||
|
wxBitmap m_buttonBitmap;
|
||||||
|
wxBitmap m_buttonBitmapSelected;
|
||||||
|
wxBitmap m_buttonBitmapFocus;
|
||||||
|
wxBitmap m_buttonBitmapDisabled;
|
||||||
|
int m_marginX;
|
||||||
|
int m_marginY;
|
||||||
};
|
};
|
||||||
#endif // __BMPBUTTONH__
|
|
||||||
|
#endif
|
||||||
|
// _WX_BMPBUTTN_H_
|
||||||
|
|||||||
@@ -1,60 +1,86 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: brush.h
|
// Name: brush.h
|
||||||
// Purpose:
|
// Purpose: wxBrush class
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_BRUSH_H_
|
||||||
#ifndef __GTKBRUSHH__
|
#define _WX_BRUSH_H_
|
||||||
#define __GTKBRUSHH__
|
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma interface
|
#pragma interface "brush.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/defs.h"
|
#include "wx/gdicmn.h"
|
||||||
#include "wx/object.h"
|
|
||||||
#include "wx/string.h"
|
|
||||||
#include "wx/gdiobj.h"
|
#include "wx/gdiobj.h"
|
||||||
#include "wx/bitmap.h"
|
#include "wx/bitmap.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
class WXDLLEXPORT wxBrush;
|
||||||
// classes
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxBrush;
|
class WXDLLEXPORT wxBrushRefData: public wxGDIRefData
|
||||||
|
{
|
||||||
|
friend class WXDLLEXPORT wxBrush;
|
||||||
|
public:
|
||||||
|
wxBrushRefData();
|
||||||
|
wxBrushRefData(const wxBrushRefData& data);
|
||||||
|
~wxBrushRefData();
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
protected:
|
||||||
// wxBrush
|
int m_style;
|
||||||
//-----------------------------------------------------------------------------
|
wxBitmap m_stipple ;
|
||||||
|
wxColour m_colour;
|
||||||
|
|
||||||
class wxBrush: public wxGDIObject
|
/* TODO: implementation
|
||||||
|
WXHBRUSH m_hBrush;
|
||||||
|
*/
|
||||||
|
};
|
||||||
|
|
||||||
|
#define M_BRUSHDATA ((wxBrushRefData *)m_refData)
|
||||||
|
|
||||||
|
// Brush
|
||||||
|
class WXDLLEXPORT wxBrush: public wxGDIObject
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxBrush)
|
DECLARE_DYNAMIC_CLASS(wxBrush)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
wxBrush();
|
||||||
|
wxBrush(const wxColour& col, int style);
|
||||||
|
wxBrush(const wxString& col, int style);
|
||||||
|
wxBrush(const wxBitmap& stipple);
|
||||||
|
inline wxBrush(const wxBrush& brush) { Ref(brush); }
|
||||||
|
inline wxBrush(const wxBrush* brush) { if (brush) Ref(*brush); }
|
||||||
|
~wxBrush();
|
||||||
|
|
||||||
wxBrush(void);
|
virtual void SetColour(const wxColour& col) ;
|
||||||
wxBrush( const wxColour &colour, int style );
|
virtual void SetColour(const wxString& col) ;
|
||||||
wxBrush( const wxString &colourName, int style );
|
virtual void SetColour(unsigned char r, unsigned char g, unsigned char b) ;
|
||||||
wxBrush( const wxBitmap &stippleBitmap );
|
virtual void SetStyle(int style) ;
|
||||||
wxBrush( const wxBrush &brush );
|
virtual void SetStipple(const wxBitmap& stipple) ;
|
||||||
wxBrush( const wxBrush *brush );
|
|
||||||
~wxBrush(void);
|
|
||||||
wxBrush& operator = ( const wxBrush& brush );
|
|
||||||
bool operator == ( const wxBrush& brush );
|
|
||||||
bool operator != ( const wxBrush& brush );
|
|
||||||
bool Ok(void) const;
|
|
||||||
|
|
||||||
int GetStyle(void) const;
|
inline wxBrush& operator = (const wxBrush& brush) { if (*this == brush) return (*this); Ref(brush); return *this; }
|
||||||
wxColour &GetColour(void) const;
|
inline bool operator == (const wxBrush& brush) { return m_refData == brush.m_refData; }
|
||||||
wxBitmap *GetStipple(void) const;
|
inline bool operator != (const wxBrush& brush) { return m_refData != brush.m_refData; }
|
||||||
|
|
||||||
// no data :-)
|
inline wxColour& GetColour() const { return (M_BRUSHDATA ? M_BRUSHDATA->m_colour : wxNullColour); };
|
||||||
|
inline int GetStyle() const { return (M_BRUSHDATA ? M_BRUSHDATA->m_style : 0); };
|
||||||
|
inline wxBitmap *GetStipple() const { return (M_BRUSHDATA ? & M_BRUSHDATA->m_stipple : 0); };
|
||||||
|
|
||||||
|
virtual bool Ok() const { return (m_refData != NULL) ; }
|
||||||
|
|
||||||
|
// Implementation
|
||||||
|
|
||||||
|
// Useful helper: create the brush resource
|
||||||
|
void RealizeResource();
|
||||||
|
|
||||||
|
// When setting properties, we must make sure we're not changing
|
||||||
|
// another object
|
||||||
|
void Unshare();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // __GTKBRUSHH__
|
#endif
|
||||||
|
// _WX_BRUSH_H_
|
||||||
|
|||||||
@@ -1,58 +1,53 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: button.h
|
// Name: button.h
|
||||||
// Purpose:
|
// Purpose: wxButton class
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_BUTTON_H_
|
||||||
#ifndef __GTKBUTTONH__
|
#define _WX_BUTTON_H_
|
||||||
#define __GTKBUTTONH__
|
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma interface
|
#pragma interface "button.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/defs.h"
|
|
||||||
#include "wx/object.h"
|
|
||||||
#include "wx/list.h"
|
|
||||||
#include "wx/control.h"
|
#include "wx/control.h"
|
||||||
|
#include "wx/gdicmn.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
WXDLLEXPORT_DATA(extern const char*) wxButtonNameStr;
|
||||||
// classes
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxButton;
|
// Pushbutton
|
||||||
|
class WXDLLEXPORT wxButton: public wxControl
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// global data
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
extern const char *wxButtonNameStr;
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// wxButton
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxButton: public wxControl
|
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxButton)
|
DECLARE_DYNAMIC_CLASS(wxButton)
|
||||||
|
public:
|
||||||
|
inline wxButton() {}
|
||||||
|
inline wxButton(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 = wxButtonNameStr)
|
||||||
|
{
|
||||||
|
Create(parent, id, label, pos, size, style, validator, name);
|
||||||
|
}
|
||||||
|
|
||||||
public:
|
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 = wxButtonNameStr);
|
||||||
|
|
||||||
wxButton(void);
|
virtual void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
|
||||||
wxButton( wxWindow *parent, wxWindowID id, const wxString &label,
|
virtual void SetDefault();
|
||||||
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
|
virtual void SetLabel(const wxString& label);
|
||||||
long style = 0, const wxString &name = wxButtonNameStr );
|
virtual wxString GetLabel() const ;
|
||||||
bool Create( wxWindow *parent, wxWindowID id, const wxString &label,
|
virtual void Command(wxCommandEvent& event);
|
||||||
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
|
|
||||||
long style = 0, const wxString &name = wxButtonNameStr );
|
|
||||||
void SetDefault(void);
|
|
||||||
void SetLabel( const wxString &label );
|
|
||||||
wxString GetLabel(void) const;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // __GTKBUTTONH__
|
#endif
|
||||||
|
// _WX_BUTTON_H_
|
||||||
|
|||||||
@@ -1,57 +1,81 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: checkbox.h
|
// Name: checkbox.h
|
||||||
// Purpose:
|
// Purpose: wxCheckBox class
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_CHECKBOX_H_
|
||||||
#ifndef __GTKCHECKBOXH__
|
#define _WX_CHECKBOX_H_
|
||||||
#define __GTKCHECKBOXH__
|
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma interface
|
#pragma interface "checkbox.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/defs.h"
|
|
||||||
#include "wx/object.h"
|
|
||||||
#include "wx/list.h"
|
|
||||||
#include "wx/control.h"
|
#include "wx/control.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
WXDLLEXPORT_DATA(extern const char*) wxCheckBoxNameStr;
|
||||||
// classes
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxCheckBox;
|
// Checkbox item (single checkbox)
|
||||||
|
class WXDLLEXPORT wxBitmap;
|
||||||
//-----------------------------------------------------------------------------
|
class WXDLLEXPORT wxCheckBox: public wxControl
|
||||||
// global data
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
extern const char *wxCheckBoxNameStr;
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// wxCheckBox
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxCheckBox: public wxControl
|
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxCheckBox)
|
DECLARE_DYNAMIC_CLASS(wxCheckBox)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
inline wxCheckBox() { }
|
||||||
|
inline wxCheckBox(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 = wxCheckBoxNameStr)
|
||||||
|
{
|
||||||
|
Create(parent, id, label, pos, size, style, validator, name);
|
||||||
|
}
|
||||||
|
|
||||||
wxCheckBox(void);
|
bool Create(wxWindow *parent, wxWindowID id, const wxString& label,
|
||||||
wxCheckBox( wxWindow *parent, wxWindowID id, const wxString &label,
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
|
const wxSize& size = wxDefaultSize, long style = 0,
|
||||||
long style = 0, const wxString &name = wxCheckBoxNameStr );
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
bool Create( wxWindow *parent, wxWindowID id, const wxString &label,
|
const wxString& name = wxCheckBoxNameStr);
|
||||||
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
|
virtual void SetValue(bool);
|
||||||
long style = 0, const wxString &name = wxCheckBoxNameStr );
|
virtual bool GetValue() const ;
|
||||||
void SetValue( bool state );
|
virtual void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
|
||||||
bool GetValue(void) const;
|
virtual void SetLabel(const wxString& label);
|
||||||
|
virtual void Command(wxCommandEvent& event);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // __GTKCHECKBOXH__
|
class WXDLLEXPORT wxBitmapCheckBox: public wxCheckBox
|
||||||
|
{
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxBitmapCheckBox)
|
||||||
|
|
||||||
|
public:
|
||||||
|
int checkWidth ;
|
||||||
|
int checkHeight ;
|
||||||
|
|
||||||
|
inline wxBitmapCheckBox() { checkWidth = -1; checkHeight = -1; }
|
||||||
|
inline wxBitmapCheckBox(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 = wxCheckBoxNameStr)
|
||||||
|
{
|
||||||
|
Create(parent, id, label, pos, size, style, validator, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Create(wxWindow *parent, wxWindowID id, const wxBitmap *bitmap,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize, long style = 0,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
|
const wxString& name = wxCheckBoxNameStr);
|
||||||
|
virtual void SetValue(bool);
|
||||||
|
virtual bool GetValue() const ;
|
||||||
|
virtual void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
|
||||||
|
virtual void SetLabel(const wxBitmap *bitmap);
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
// _WX_CHECKBOX_H_
|
||||||
|
|||||||
@@ -1,68 +1,72 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: choice.h
|
// Name: choice.h
|
||||||
// Purpose:
|
// Purpose: wxChoice class
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_CHOICE_H_
|
||||||
#ifndef __GTKCHOICEH__
|
#define _WX_CHOICE_H_
|
||||||
#define __GTKCHOICEH__
|
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma interface
|
#pragma interface "choice.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/defs.h"
|
|
||||||
#include "wx/object.h"
|
|
||||||
#include "wx/list.h"
|
|
||||||
#include "wx/control.h"
|
#include "wx/control.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
WXDLLEXPORT_DATA(extern const char*) wxChoiceNameStr;
|
||||||
// classes
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxChoice;
|
// Choice item
|
||||||
|
class WXDLLEXPORT wxChoice: public wxControl
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// global data
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
extern const char *wxChoiceNameStr;
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// wxChoice
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxChoice: public wxControl
|
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxChoice)
|
DECLARE_DYNAMIC_CLASS(wxChoice)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
inline wxChoice() { m_noStrings = 0; }
|
||||||
|
|
||||||
wxChoice(void);
|
inline wxChoice(wxWindow *parent, wxWindowID id,
|
||||||
wxChoice( wxWindow *parent, wxWindowID id,
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
|
const wxSize& size = wxDefaultSize,
|
||||||
int n = 0, const wxString choices[] = NULL,
|
int n = 0, const wxString choices[] = NULL,
|
||||||
long style = 0, const wxString &name = wxChoiceNameStr );
|
long style = 0,
|
||||||
bool Create( wxWindow *parent, wxWindowID id,
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
|
const wxString& name = wxChoiceNameStr)
|
||||||
int n = 0, const wxString choices[] = NULL,
|
{
|
||||||
long style = 0, const wxString &name = wxChoiceNameStr );
|
Create(parent, id, pos, size, n, choices, style, validator, name);
|
||||||
void Append( const wxString &item );
|
}
|
||||||
void Clear(void);
|
|
||||||
int FindString( const wxString &string ) const;
|
bool Create(wxWindow *parent, wxWindowID id,
|
||||||
int GetColumns(void) const;
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
int GetSelection(void);
|
const wxSize& size = wxDefaultSize,
|
||||||
wxString GetString( int n ) const;
|
int n = 0, const wxString choices[] = NULL,
|
||||||
wxString GetStringSelection(void) const;
|
long style = 0,
|
||||||
int Number(void) const;
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
void SetColumns( int n = 1 );
|
const wxString& name = wxChoiceNameStr);
|
||||||
void SetSelection( int n );
|
|
||||||
void SetStringSelection( const wxString &string );
|
virtual void Append(const wxString& item);
|
||||||
|
virtual void Delete(int n);
|
||||||
|
virtual void Clear();
|
||||||
|
virtual int GetSelection() const ;
|
||||||
|
virtual void SetSelection(int n);
|
||||||
|
virtual int FindString(const wxString& s) const;
|
||||||
|
virtual wxString GetString(int n) const ;
|
||||||
|
virtual void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
|
||||||
|
virtual wxString GetStringSelection() const ;
|
||||||
|
virtual bool SetStringSelection(const wxString& sel);
|
||||||
|
|
||||||
|
virtual inline int Number() const { return m_noStrings; }
|
||||||
|
virtual void Command(wxCommandEvent& event);
|
||||||
|
|
||||||
|
virtual inline void SetColumns(int WXUNUSED(n) = 1 ) { /* No effect */ } ;
|
||||||
|
virtual inline int GetColumns() const { return 1 ; };
|
||||||
|
|
||||||
|
protected:
|
||||||
|
int m_noStrings;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // __GTKCHOICEH__
|
#endif
|
||||||
|
// _WX_CHOICE_H_
|
||||||
|
|||||||
@@ -1,75 +1,68 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: colour.h
|
// Name: colour.h
|
||||||
// Purpose:
|
// Purpose: wxColour class
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_COLOUR_H_
|
||||||
#ifndef __GTKCOLOURH__
|
#define _WX_COLOUR_H_
|
||||||
#define __GTKCOLOURH__
|
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma interface
|
#pragma interface "colour.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/defs.h"
|
// Colour
|
||||||
#include "wx/object.h"
|
class WXDLLEXPORT wxColour: public wxObject
|
||||||
#include "wx/string.h"
|
|
||||||
#include "wx/gdiobj.h"
|
|
||||||
#include "wx/palette.h"
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// classes
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxDC;
|
|
||||||
class wxPaintDC;
|
|
||||||
class wxBitmap;
|
|
||||||
class wxWindow;
|
|
||||||
|
|
||||||
class wxColour;
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// wxColour
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxColour: public wxGDIObject
|
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxColour)
|
DECLARE_DYNAMIC_CLASS(wxColour)
|
||||||
|
public:
|
||||||
|
wxColour();
|
||||||
|
wxColour(unsigned char r, unsigned char g, unsigned char b);
|
||||||
|
wxColour(unsigned long colRGB) { Set(colRGB); }
|
||||||
|
wxColour(const wxColour& col);
|
||||||
|
wxColour(const wxString& col);
|
||||||
|
~wxColour() ;
|
||||||
|
wxColour& operator =(const wxColour& src) ;
|
||||||
|
wxColour& operator =(const wxString& src) ;
|
||||||
|
inline int Ok() const { return (m_isInit) ; }
|
||||||
|
|
||||||
public:
|
void Set(unsigned char r, unsigned char g, unsigned char b);
|
||||||
|
void Set(unsigned long colRGB)
|
||||||
|
{
|
||||||
|
// we don't need to know sizeof(long) here because we assume that the three
|
||||||
|
// least significant bytes contain the R, G and B values
|
||||||
|
Set((unsigned char)colRGB,
|
||||||
|
(unsigned char)(colRGB >> 8),
|
||||||
|
(unsigned char)(colRGB >> 16));
|
||||||
|
}
|
||||||
|
|
||||||
wxColour(void);
|
inline unsigned char Red() const { return m_red; }
|
||||||
wxColour( char red, char green, char blue );
|
inline unsigned char Green() const { return m_green; }
|
||||||
wxColour( const wxString &colourName );
|
inline unsigned char Blue() const { return m_blue; }
|
||||||
wxColour( const wxColour& col );
|
|
||||||
wxColour( const wxColour* col );
|
|
||||||
~wxColour(void);
|
|
||||||
wxColour& operator = ( const wxColour& col );
|
|
||||||
wxColour& operator = ( const wxString& colourName );
|
|
||||||
bool operator == ( const wxColour& col );
|
|
||||||
bool operator != ( const wxColour& col );
|
|
||||||
void Set( const unsigned char red, const unsigned char green, const unsigned char blue );
|
|
||||||
unsigned char Red(void) const;
|
|
||||||
unsigned char Green(void) const;
|
|
||||||
unsigned char Blue(void) const;
|
|
||||||
bool Ok(void) const;
|
|
||||||
|
|
||||||
private:
|
inline bool operator == (const wxColour& colour) { return (m_red == colour.m_red && m_green == colour.m_green && m_blue == colour.m_blue); }
|
||||||
public:
|
|
||||||
|
inline bool operator != (const wxColour& colour) { return (!(m_red == colour.m_red && m_green == colour.m_green && m_blue == colour.m_blue)); }
|
||||||
friend wxDC;
|
|
||||||
friend wxPaintDC;
|
WXCOLORREF GetPixel() const { return m_pixel; };
|
||||||
friend wxBitmap;
|
|
||||||
friend wxWindow;
|
private:
|
||||||
|
bool m_isInit;
|
||||||
int GetPixel(void);
|
unsigned char m_red;
|
||||||
|
unsigned char m_blue;
|
||||||
// no data :-)
|
unsigned char m_green;
|
||||||
|
public:
|
||||||
|
/* TODO: implementation
|
||||||
|
WXCOLORREF m_pixel ;
|
||||||
|
*/
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // __GTKCOLOURH__
|
#define wxColor wxColour
|
||||||
|
|
||||||
|
#endif
|
||||||
|
// _WX_COLOUR_H_
|
||||||
|
|||||||
@@ -1,48 +1,33 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: combobox.h
|
// Name: combobox.h
|
||||||
// Purpose:
|
// Purpose: wxComboBox class
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id: $Id$
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_COMBOBOX_H_
|
||||||
#ifndef __GTKCOMBOBOXH__
|
#define _WX_COMBOBOX_H_
|
||||||
#define __GTKCOMBOBOXH__
|
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma interface "combobox.h"
|
#pragma interface "combobox.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/defs.h"
|
#include "wx/choice.h"
|
||||||
#include "wx/object.h"
|
|
||||||
#include "wx/control.h"
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
WXDLLEXPORT_DATA(extern const char*) wxComboBoxNameStr;
|
||||||
// classes
|
WXDLLEXPORT_DATA(extern const char*) wxEmptyString;
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxComboBox;
|
// Combobox item
|
||||||
|
class WXDLLEXPORT wxComboBox: public wxChoice
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// global data
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
extern const char* wxComboBoxNameStr;
|
|
||||||
extern const char* wxEmptyString;
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// wxComboBox
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxComboBox: public wxControl
|
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxComboBox)
|
DECLARE_DYNAMIC_CLASS(wxComboBox)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
inline wxComboBox(void) {}
|
inline wxComboBox() {}
|
||||||
|
|
||||||
inline wxComboBox(wxWindow *parent, wxWindowID id,
|
inline wxComboBox(wxWindow *parent, wxWindowID id,
|
||||||
const wxString& value = wxEmptyString,
|
const wxString& value = wxEmptyString,
|
||||||
@@ -50,9 +35,10 @@ class wxComboBox: public wxControl
|
|||||||
const wxSize& size = wxDefaultSize,
|
const wxSize& size = wxDefaultSize,
|
||||||
int n = 0, const wxString choices[] = NULL,
|
int n = 0, const wxString choices[] = NULL,
|
||||||
long style = 0,
|
long style = 0,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
const wxString& name = wxComboBoxNameStr)
|
const wxString& name = wxComboBoxNameStr)
|
||||||
{
|
{
|
||||||
Create(parent, id, value, pos, size, n, choices, style, name);
|
Create(parent, id, value, pos, size, n, choices, style, validator, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Create(wxWindow *parent, wxWindowID id,
|
bool Create(wxWindow *parent, wxWindowID id,
|
||||||
@@ -61,40 +47,32 @@ class wxComboBox: public wxControl
|
|||||||
const wxSize& size = wxDefaultSize,
|
const wxSize& size = wxDefaultSize,
|
||||||
int n = 0, const wxString choices[] = NULL,
|
int n = 0, const wxString choices[] = NULL,
|
||||||
long style = 0,
|
long style = 0,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
const wxString& name = wxComboBoxNameStr);
|
const wxString& name = wxComboBoxNameStr);
|
||||||
|
|
||||||
// List functions
|
// List functions: see wxChoice
|
||||||
void Clear(void);
|
|
||||||
void Append( const wxString &item );
|
|
||||||
void Append( const wxString &item, char* clientData );
|
|
||||||
void Delete( int n );
|
|
||||||
int FindString( const wxString &item );
|
|
||||||
char* GetClientData( int n );
|
|
||||||
void SetClientData( int n, char * clientData );
|
|
||||||
int GetSelection(void) const;
|
|
||||||
wxString GetString( int n ) const;
|
|
||||||
wxString GetStringSelection(void) const;
|
|
||||||
int Number(void) const;
|
|
||||||
void SetSelection( int n );
|
|
||||||
void SetStringSelection( const wxString &string );
|
|
||||||
|
|
||||||
// Text field functions
|
// Text field functions
|
||||||
wxString GetValue(void) const ;
|
virtual wxString GetValue() const ;
|
||||||
void SetValue(const wxString& value);
|
virtual void SetValue(const wxString& value);
|
||||||
|
|
||||||
// Clipboard operations
|
// Clipboard operations
|
||||||
void Copy(void);
|
virtual void Copy();
|
||||||
void Cut(void);
|
virtual void Cut();
|
||||||
void Paste(void);
|
virtual void Paste();
|
||||||
void SetInsertionPoint(long pos);
|
virtual void SetInsertionPoint(long pos);
|
||||||
void SetInsertionPointEnd(void);
|
virtual void SetInsertionPointEnd();
|
||||||
long GetInsertionPoint(void) const ;
|
virtual long GetInsertionPoint() const ;
|
||||||
long GetLastPosition(void) const ;
|
virtual long GetLastPosition() const ;
|
||||||
void Replace(long from, long to, const wxString& value);
|
virtual void Replace(long from, long to, const wxString& value);
|
||||||
void Remove(long from, long to);
|
virtual void Remove(long from, long to);
|
||||||
void SetSelection(long from, long to);
|
virtual void SetSelection(int n)
|
||||||
void SetEditable(bool editable);
|
{
|
||||||
|
wxChoice::SetSelection(n);
|
||||||
|
}
|
||||||
|
virtual void SetSelection(long from, long to);
|
||||||
|
virtual void SetEditable(bool editable);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // __GTKCOMBOBOXH__
|
#endif
|
||||||
|
// _WX_COMBOBOX_H_
|
||||||
|
|||||||
@@ -1,60 +1,50 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: control.h
|
// Name: control.h
|
||||||
// Purpose:
|
// Purpose: wxControl class
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_CONTROL_H_
|
||||||
#ifndef __GTKCONTROLH__
|
#define _WX_CONTROL_H_
|
||||||
#define __GTKCONTROLH__
|
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma interface
|
#pragma interface "control.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/defs.h"
|
|
||||||
#include "wx/object.h"
|
|
||||||
#include "wx/list.h"
|
|
||||||
#include "wx/window.h"
|
#include "wx/window.h"
|
||||||
|
#include "wx/list.h"
|
||||||
|
#include "wx/validate.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
// General item class
|
||||||
// classes
|
class WXDLLEXPORT wxControl: public wxWindow
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxControl;
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// wxControl
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxControl: public wxWindow
|
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxControl)
|
DECLARE_ABSTRACT_CLASS(wxControl)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// construction
|
wxControl();
|
||||||
wxControl();
|
~wxControl();
|
||||||
wxControl( wxWindow *parent, wxWindowID id,
|
|
||||||
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
|
|
||||||
long style = 0, const wxString &name = wxPanelNameStr );
|
|
||||||
|
|
||||||
// overridables
|
|
||||||
virtual void Command( wxCommandEvent &event );
|
|
||||||
|
|
||||||
// accessors
|
virtual void Command(wxCommandEvent& WXUNUSED(event)) = 0; // Simulates an event
|
||||||
// this function will filter out '&' characters and will put the accelerator
|
virtual void ProcessCommand(wxCommandEvent& event); // Calls the callback and
|
||||||
// char (the one immediately after '&') into m_chAccel (@@ not yet)
|
// appropriate event handlers
|
||||||
virtual void SetLabel( const wxString &label );
|
virtual void SetLabel(const wxString& label);
|
||||||
virtual wxString GetLabel() const;
|
virtual wxString GetLabel() const ;
|
||||||
|
|
||||||
|
// Places item in centre of panel - so can't be used BEFORE panel->Fit()
|
||||||
|
void Centre(int direction = wxHORIZONTAL);
|
||||||
|
inline void Callback(const wxFunction function) { m_callback = function; }; // Adds callback
|
||||||
|
|
||||||
|
inline wxFunction GetCallback() { return m_callback; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
wxString m_label;
|
wxFunction m_callback; // Callback associated with the window
|
||||||
// when we implement keyboard interface we will make use of this, but not yet
|
|
||||||
//char m_chAccel;
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // __GTKCONTROLH__
|
#endif
|
||||||
|
// _WX_CONTROL_H_
|
||||||
|
|||||||
@@ -1,59 +1,75 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: cursor.h
|
// Name: cursor.h
|
||||||
// Purpose:
|
// Purpose: wxCursor class
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_CURSOR_H_
|
||||||
#ifndef __GTKCURSORH__
|
#define _WX_CURSOR_H_
|
||||||
#define __GTKCURSORH__
|
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma interface
|
#pragma interface "cursor.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/defs.h"
|
#include "wx/bitmap.h"
|
||||||
#include "wx/object.h"
|
|
||||||
#include "wx/gdicmn.h"
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
class WXDLLEXPORT wxCursorRefData: public wxBitmapRefData
|
||||||
// classes
|
{
|
||||||
//-----------------------------------------------------------------------------
|
friend class WXDLLEXPORT wxBitmap;
|
||||||
|
friend class WXDLLEXPORT wxCursor;
|
||||||
|
public:
|
||||||
|
wxCursorRefData();
|
||||||
|
~wxCursorRefData();
|
||||||
|
|
||||||
class wxWindow;
|
protected:
|
||||||
|
/* TODO: implementation
|
||||||
|
WXHCURSOR m_hCursor;
|
||||||
|
*/
|
||||||
|
};
|
||||||
|
|
||||||
class wxCursor;
|
#define M_CURSORDATA ((wxCursorRefData *)m_refData)
|
||||||
|
#define M_CURSORHANDLERDATA ((wxCursorRefData *)bitmap->m_refData)
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
// Cursor
|
||||||
// wxCursor
|
class WXDLLEXPORT wxCursor: public wxBitmap
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxCursor: public wxObject
|
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxCursor)
|
DECLARE_DYNAMIC_CLASS(wxCursor)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
wxCursor();
|
||||||
|
|
||||||
wxCursor(void);
|
// Copy constructors
|
||||||
wxCursor( int cursorId );
|
inline wxCursor(const wxCursor& cursor) { Ref(cursor); }
|
||||||
wxCursor( const wxCursor &cursor );
|
inline wxCursor(const wxCursor* cursor) { if (cursor) Ref(*cursor); }
|
||||||
wxCursor( const wxCursor *cursor );
|
|
||||||
~wxCursor(void);
|
|
||||||
wxCursor& operator = ( const wxCursor& cursor );
|
|
||||||
bool operator == ( const wxCursor& cursor );
|
|
||||||
bool operator != ( const wxCursor& cursor );
|
|
||||||
bool Ok(void) const;
|
|
||||||
|
|
||||||
private:
|
|
||||||
public:
|
|
||||||
|
|
||||||
friend wxWindow;
|
|
||||||
|
|
||||||
// no data :-)
|
wxCursor(const char bits[], int width, int height, int hotSpotX = -1, int hotSpotY = -1,
|
||||||
|
const char maskBits[] = NULL);
|
||||||
|
|
||||||
|
/* TODO: make default type suit platform */
|
||||||
|
wxCursor(const wxString& name, long flags = wxBITMAP_TYPE_CUR_RESOURCE,
|
||||||
|
int hotSpotX = 0, int hotSpotY = 0);
|
||||||
|
|
||||||
|
wxCursor(int cursor_type);
|
||||||
|
~wxCursor();
|
||||||
|
|
||||||
|
virtual bool Ok() const { return (m_refData != NULL && M_CURSORDATA->m_hCursor) ; }
|
||||||
|
|
||||||
|
inline wxCursor& operator = (const wxCursor& cursor) { if (*this == cursor) return (*this); Ref(cursor); return *this; }
|
||||||
|
inline bool operator == (const wxCursor& cursor) { return m_refData == cursor.m_refData; }
|
||||||
|
inline bool operator != (const wxCursor& cursor) { return m_refData != cursor.m_refData; }
|
||||||
|
|
||||||
|
/* TODO: implementation
|
||||||
|
void SetHCURSOR(WXHCURSOR cursor);
|
||||||
|
inline WXHCURSOR GetHCURSOR() const { return (M_CURSORDATA ? M_CURSORDATA->m_hCursor : 0); }
|
||||||
|
*/
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // __GTKCURSORH__
|
extern WXDLLEXPORT void wxSetCursor(const wxCursor& cursor);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
// _WX_CURSOR_H_
|
||||||
|
|||||||
@@ -1,43 +1,34 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: dc.h
|
// Name: dc.h
|
||||||
// Purpose:
|
// Purpose: wxDC class
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_DC_H_
|
||||||
#ifndef __GTKDCH__
|
#define _WX_DC_H_
|
||||||
#define __GTKDCH__
|
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma interface
|
#pragma interface "dc.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/defs.h"
|
|
||||||
#include "wx/object.h"
|
|
||||||
#include "wx/gdicmn.h"
|
|
||||||
#include "wx/pen.h"
|
#include "wx/pen.h"
|
||||||
#include "wx/brush.h"
|
#include "wx/brush.h"
|
||||||
#include "wx/icon.h"
|
#include "wx/icon.h"
|
||||||
#include "wx/font.h"
|
#include "wx/font.h"
|
||||||
#include "wx/gdicmn.h"
|
#include "wx/gdicmn.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// classes
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxDC;
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// constants
|
// constants
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
#define MM_TEXT 0
|
#define MM_TEXT 0
|
||||||
#define MM_ISOTROPIC 1
|
#define MM_ISOTROPIC 1
|
||||||
#define MM_ANISOTROPIC 2
|
#define MM_ANISOTROPIC 2
|
||||||
#define MM_LOMETRIC 3
|
#define MM_LOMETRIC 3
|
||||||
#define MM_HIMETRIC 4
|
#define MM_HIMETRIC 4
|
||||||
#define MM_TWIPS 5
|
#define MM_TWIPS 5
|
||||||
@@ -54,7 +45,7 @@ extern int wxPageNumber;
|
|||||||
// wxDC
|
// wxDC
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
class wxDC: public wxObject
|
class WXDLLEXPORT wxDC: public wxObject
|
||||||
{
|
{
|
||||||
DECLARE_ABSTRACT_CLASS(wxDC)
|
DECLARE_ABSTRACT_CLASS(wxDC)
|
||||||
|
|
||||||
@@ -69,12 +60,40 @@ class wxDC: public wxObject
|
|||||||
virtual bool Ok(void) const { return m_ok; };
|
virtual bool Ok(void) const { return m_ok; };
|
||||||
|
|
||||||
virtual void FloodFill( long x1, long y1, wxColour *col, int style=wxFLOOD_SURFACE ) = 0;
|
virtual void FloodFill( long x1, long y1, wxColour *col, int style=wxFLOOD_SURFACE ) = 0;
|
||||||
|
inline void FloodFill(const wxPoint& pt, const wxColour& col, int style=wxFLOOD_SURFACE)
|
||||||
|
{
|
||||||
|
FloodFill(pt.x, pt.y, col, style);
|
||||||
|
}
|
||||||
virtual bool GetPixel( long x1, long y1, wxColour *col ) const = 0;
|
virtual bool GetPixel( long x1, long y1, wxColour *col ) const = 0;
|
||||||
|
inline bool GetPixel(const wxPoint& pt, wxColour *col) const
|
||||||
|
{
|
||||||
|
return GetPixel(pt.x, pt.y, col);
|
||||||
|
}
|
||||||
|
|
||||||
virtual void DrawLine( long x1, long y1, long x2, long y2 ) = 0;
|
virtual void DrawLine( long x1, long y1, long x2, long y2 ) = 0;
|
||||||
|
inline void DrawLine(const wxPoint& pt1, const wxPoint& pt2)
|
||||||
|
{
|
||||||
|
DrawLine(pt1.x, pt1.y, pt2.x, pt2.y);
|
||||||
|
}
|
||||||
|
|
||||||
virtual void CrossHair( long x, long y ) = 0;
|
virtual void CrossHair( long x, long y ) = 0;
|
||||||
virtual void DrawArc( long x1, long y1, long x2, long y2, double xc, double yc );
|
inline void CrossHair(const wxPoint& pt)
|
||||||
|
{
|
||||||
|
CrossHair(pt.x, pt.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void DrawArc( long x1, long y1, long x2, long y2, double xc, double yc ) = 0;
|
||||||
|
inline void DrawArc(const wxPoint& pt1, const wxPoint& pt2, double xc, double yc)
|
||||||
|
{
|
||||||
|
DrawArc(pt1.x, pt1.y, pt2.x, pt2.y, xc, yc);
|
||||||
|
}
|
||||||
|
|
||||||
virtual void DrawEllipticArc( long x, long y, long width, long height, double sa, double ea ) = 0;
|
virtual void DrawEllipticArc( long x, long y, long width, long height, double sa, double ea ) = 0;
|
||||||
|
virtual void DrawEllipticArc (const wxPoint& pt, const wxSize& sz, double sa, double ea)
|
||||||
|
{
|
||||||
|
DrawEllipticArc(pt.x, pt.y, sz.x, sz.y, sa, ea);
|
||||||
|
}
|
||||||
|
|
||||||
virtual void DrawPoint( long x, long y ) = 0;
|
virtual void DrawPoint( long x, long y ) = 0;
|
||||||
virtual void DrawPoint( wxPoint& point );
|
virtual void DrawPoint( wxPoint& point );
|
||||||
|
|
||||||
@@ -86,21 +105,67 @@ class wxDC: public wxObject
|
|||||||
int fillStyle=wxODDEVEN_RULE );
|
int fillStyle=wxODDEVEN_RULE );
|
||||||
|
|
||||||
virtual void DrawRectangle( long x, long y, long width, long height ) = 0;
|
virtual void DrawRectangle( long x, long y, long width, long height ) = 0;
|
||||||
|
inline void DrawRectangle(const wxPoint& pt, const wxSize& sz)
|
||||||
|
{
|
||||||
|
DrawRectangle(pt.x, pt.y, sz.x, sz.y);
|
||||||
|
}
|
||||||
|
inline void DrawRectangle(const wxRect& rect)
|
||||||
|
{
|
||||||
|
DrawRectangle(rect.x, rect.y, rect.width, rect.height);
|
||||||
|
}
|
||||||
virtual void DrawRoundedRectangle( long x, long y, long width, long height, double radius = 20.0 ) = 0;
|
virtual void DrawRoundedRectangle( long x, long y, long width, long height, double radius = 20.0 ) = 0;
|
||||||
|
inline void DrawRoundedRectangle(const wxPoint& pt, const wxSize& sz, double radius = 20.0)
|
||||||
|
{
|
||||||
|
DrawRoundedRectangle(pt.x, pt.y, sz.x, sz.y, radius);
|
||||||
|
}
|
||||||
|
inline void DrawRoundedRectangle(const wxRect& rect, double radius = 20.0)
|
||||||
|
{
|
||||||
|
DrawRoundedRectangle(rect.x, rect.y, rect.width, rect.height, radius);
|
||||||
|
}
|
||||||
|
|
||||||
virtual void DrawEllipse( long x, long y, long width, long height ) = 0;
|
virtual void DrawEllipse( long x, long y, long width, long height ) = 0;
|
||||||
|
inline void DrawEllipse(const wxPoint& pt, const wxSize& sz)
|
||||||
|
{
|
||||||
|
DrawEllipse(pt.x, pt.y, sz.x, sz.y);
|
||||||
|
}
|
||||||
|
inline void DrawEllipse(const wxRect& rect)
|
||||||
|
{
|
||||||
|
DrawEllipse(rect.x, rect.y, rect.width, rect.height);
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void DrawIcon(const wxIcon& icon, long x, long y) = 0;
|
||||||
|
|
||||||
virtual void DrawSpline( long x1, long y1, long x2, long y2, long x3, long y3 );
|
virtual void DrawSpline( long x1, long y1, long x2, long y2, long x3, long y3 );
|
||||||
virtual void DrawSpline( wxList *points );
|
virtual void DrawSpline( wxList *points );
|
||||||
virtual void DrawSpline( int n, wxPoint points[] );
|
virtual void DrawSpline( int n, wxPoint points[] );
|
||||||
|
|
||||||
virtual bool CanDrawBitmap(void) const = 0;
|
virtual bool CanDrawBitmap(void) const = 0;
|
||||||
|
|
||||||
virtual void DrawIcon( const wxIcon &icon, long x, long y, bool useMask=FALSE );
|
virtual void DrawIcon( const wxIcon &icon, long x, long y, bool useMask=FALSE );
|
||||||
void DrawBitmap( const wxBitmap &bmp, long x, long y, bool useMask=FALSE )
|
inline void DrawIcon(const wxIcon& icon, const wxPoint& pt)
|
||||||
{ DrawIcon( *((wxIcon*)(&bmp)), x, y, useMask ); }
|
{
|
||||||
|
DrawIcon(icon, pt.x, pt.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO DrawBitmap is not always the same as DrawIcon, especially if bitmaps and
|
||||||
|
// icons are implemented differently.
|
||||||
|
void DrawBitmap( const wxBitmap &bmp, long x, long y, bool useMask=FALSE )
|
||||||
|
{ DrawIcon( *((wxIcon*)(&bmp)), x, y, useMask ); }
|
||||||
|
|
||||||
virtual bool Blit( long xdest, long ydest, long width, long height,
|
virtual bool Blit( long xdest, long ydest, long width, long height,
|
||||||
wxDC *source, long xsrc, long ysrc, int logical_func = wxCOPY, bool useMask=FALSE ) = 0;
|
wxDC *source, long xsrc, long ysrc, int logical_func = wxCOPY, bool useMask=FALSE ) = 0;
|
||||||
|
inline bool Blit(const wxPoint& destPt, const wxSize& sz,
|
||||||
|
wxDC *source, const wxPoint& srcPt, int rop = wxCOPY, bool useMask = FALSE)
|
||||||
|
{
|
||||||
|
return Blit(destPt.x, destPt.y, sz.x, sz.y, source, srcPt.x, srcPt.y, rop, useMask);
|
||||||
|
}
|
||||||
|
|
||||||
virtual void DrawText( const wxString &text, long x, long y, bool use16 = FALSE ) = 0;
|
virtual void DrawText( const wxString &text, long x, long y, bool use16 = FALSE ) = 0;
|
||||||
|
inline void DrawText(const wxString& text, const wxPoint& pt, bool use16bit = FALSE)
|
||||||
|
{
|
||||||
|
DrawText(text, pt.x, pt.y, use16bit);
|
||||||
|
}
|
||||||
|
|
||||||
virtual bool CanGetTextExtent(void) const = 0;
|
virtual bool CanGetTextExtent(void) const = 0;
|
||||||
virtual void GetTextExtent( const wxString &string, long *width, long *height,
|
virtual void GetTextExtent( const wxString &string, long *width, long *height,
|
||||||
long *descent = NULL, long *externalLeading = NULL,
|
long *descent = NULL, long *externalLeading = NULL,
|
||||||
@@ -111,19 +176,19 @@ class wxDC: public wxObject
|
|||||||
virtual void Clear(void) = 0;
|
virtual void Clear(void) = 0;
|
||||||
|
|
||||||
virtual void SetFont( const wxFont &font ) = 0;
|
virtual void SetFont( const wxFont &font ) = 0;
|
||||||
virtual wxFont *GetFont(void) { return &m_font; };
|
virtual wxFont *GetFont(void) const { return &m_font; };
|
||||||
|
|
||||||
virtual void SetPen( const wxPen &pen ) = 0;
|
virtual void SetPen( const wxPen &pen ) = 0;
|
||||||
virtual wxPen *GetPen(void) { return &m_pen; };
|
virtual wxPen *GetPen(void) const { return &m_pen; };
|
||||||
|
|
||||||
virtual void SetBrush( const wxBrush &brush ) = 0;
|
virtual void SetBrush( const wxBrush &brush ) = 0;
|
||||||
virtual wxBrush *GetBrush(void) { return &m_brush; };
|
virtual wxBrush *GetBrush(void) const { return &m_brush; };
|
||||||
|
|
||||||
virtual void SetBackground( const wxBrush &brush ) = 0;
|
virtual void SetBackground( const wxBrush &brush ) = 0;
|
||||||
virtual wxBrush *GetBackground(void) { return &m_backgroundBrush; };
|
virtual wxBrush *GetBackground(void) const { return &m_backgroundBrush; };
|
||||||
|
|
||||||
virtual void SetLogicalFunction( int function ) = 0;
|
virtual void SetLogicalFunction( int function ) = 0;
|
||||||
virtual int GetLogicalFunction(void) { return m_logicalFunction; };
|
virtual int GetLogicalFunction(void) const { return m_logicalFunction; };
|
||||||
|
|
||||||
virtual void SetTextForeground( const wxColour &col );
|
virtual void SetTextForeground( const wxColour &col );
|
||||||
virtual void SetTextBackground( const wxColour &col );
|
virtual void SetTextBackground( const wxColour &col );
|
||||||
@@ -131,10 +196,10 @@ class wxDC: public wxObject
|
|||||||
virtual wxColour& GetTextForeground(void) const { return (wxColour&)m_textForegroundColour; };
|
virtual wxColour& GetTextForeground(void) const { return (wxColour&)m_textForegroundColour; };
|
||||||
|
|
||||||
virtual void SetBackgroundMode( int mode ) = 0;
|
virtual void SetBackgroundMode( int mode ) = 0;
|
||||||
virtual int GetBackgroundMode(void) { return m_backgroundMode; };
|
virtual int GetBackgroundMode(void) const { return m_backgroundMode; };
|
||||||
|
|
||||||
virtual void SetPalette( const wxPalette& palette ) = 0;
|
virtual void SetPalette( const wxPalette& palette ) = 0;
|
||||||
void SetColourMap( const wxPalette& palette ) { SetPalette(palette); };
|
void SetColourMap( const wxPalette& palette ) { SetPalette(palette); };
|
||||||
|
|
||||||
// the first two must be overridden and called
|
// the first two must be overridden and called
|
||||||
virtual void SetClippingRegion( long x, long y, long width, long height );
|
virtual void SetClippingRegion( long x, long y, long width, long height );
|
||||||
@@ -306,4 +371,5 @@ class wxDC: public wxObject
|
|||||||
long m_minX,m_maxX,m_minY,m_maxY;
|
long m_minX,m_maxX,m_minY,m_maxY;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // __GTKDCH__
|
#endif
|
||||||
|
// _WX_DC_H_
|
||||||
|
|||||||
@@ -1,29 +1,32 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: dcclient.h
|
// Name: dcclient.h
|
||||||
// Purpose:
|
// Purpose: wxClientDC, wxPaintDC and wxWindowDC classes
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_DCCLIENT_H_
|
||||||
#ifndef __GTKDCCLIENTH__
|
#define _WX_DCCLIENT_H_
|
||||||
#define __GTKDCCLIENTH__
|
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma interface
|
#pragma interface "dcclient.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/dc.h"
|
#include "wx/dc.h"
|
||||||
#include "wx/window.h"
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// classes
|
// classes
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
class wxPaintDC;
|
class WXDLLEXPORT wxPaintDC;
|
||||||
|
|
||||||
|
// Under Windows, wxClientDC, wxPaintDC and wxWindowDC are implemented differently.
|
||||||
|
// On many platforms, however, they will be the same.
|
||||||
|
|
||||||
typedef wxPaintDC wxClientDC;
|
typedef wxPaintDC wxClientDC;
|
||||||
typedef wxPaintDC wxWindowDC;
|
typedef wxPaintDC wxWindowDC;
|
||||||
|
|
||||||
@@ -31,7 +34,7 @@ typedef wxPaintDC wxWindowDC;
|
|||||||
// wxPaintDC
|
// wxPaintDC
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
class wxPaintDC: public wxDC
|
class WXDLLEXPORT wxPaintDC: public wxDC
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxPaintDC)
|
DECLARE_DYNAMIC_CLASS(wxPaintDC)
|
||||||
|
|
||||||
@@ -91,7 +94,7 @@ class wxPaintDC: public wxDC
|
|||||||
virtual void DestroyClippingRegion(void);
|
virtual void DestroyClippingRegion(void);
|
||||||
|
|
||||||
virtual void DrawOpenSpline( wxList *points );
|
virtual void DrawOpenSpline( wxList *points );
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // __GTKDCCLIENTH__
|
#endif
|
||||||
|
// _WX_DCCLIENT_H_
|
||||||
|
|||||||
@@ -1,34 +1,23 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: dcmemory.h
|
// Name: dcmemory.h
|
||||||
// Purpose:
|
// Purpose: wxMemoryDC class
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
|
// Created: ??/??/98
|
||||||
// RCS-ID: $Id$
|
// RCS-ID: $Id$
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_DCMEMORY_H_
|
||||||
#ifndef __GTKDCMEMORYH__
|
#define _WX_DCMEMORY_H_
|
||||||
#define __GTKDCMEMORYH__
|
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma interface
|
#pragma interface "dcmemory.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/defs.h"
|
|
||||||
#include "wx/dcclient.h"
|
#include "wx/dcclient.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// classes
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxMemoryDC;
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// wxMemoryDC
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class WXDLLEXPORT wxMemoryDC: public wxPaintDC
|
class WXDLLEXPORT wxMemoryDC: public wxPaintDC
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxMemoryDC)
|
DECLARE_DYNAMIC_CLASS(wxMemoryDC)
|
||||||
@@ -46,5 +35,4 @@ class WXDLLEXPORT wxMemoryDC: public wxPaintDC
|
|||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
// __GTKDCMEMORYH__
|
// _WX_DCMEMORY_H_
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,20 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: dcscreen.h
|
// Name: dcscreen.h
|
||||||
// Purpose:
|
// Purpose: wxScreenDC class
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_DCSCREEN_H_
|
||||||
|
#define _WX_DCSCREEN_H_
|
||||||
|
|
||||||
#ifndef __GTKDCSCREENH__
|
#ifdef __GNUG__
|
||||||
#define __GTKDCSCREENH__
|
#pragma interface "dcscreen.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "wx/dcclient.h"
|
#include "wx/dcclient.h"
|
||||||
|
|
||||||
@@ -19,14 +23,17 @@ class WXDLLEXPORT wxScreenDC: public wxPaintDC
|
|||||||
DECLARE_DYNAMIC_CLASS(wxScreenDC)
|
DECLARE_DYNAMIC_CLASS(wxScreenDC)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
wxScreenDC(void);
|
// Create a DC representing the whole screen
|
||||||
~wxScreenDC(void);
|
wxScreenDC();
|
||||||
|
~wxScreenDC();
|
||||||
|
|
||||||
static bool StartDrawingOnTop( wxWindow *window );
|
// Compatibility with X's requirements for
|
||||||
static bool StartDrawingOnTop( wxRectangle *rect = NULL );
|
// drawing on top of all windows
|
||||||
static bool EndDrawingOnTop(void);
|
static bool StartDrawingOnTop(wxWindow* WXUNUSED(window)) { return TRUE; }
|
||||||
|
static bool StartDrawingOnTop(wxRectangle* WXUNUSED(rect) = NULL) { return TRUE; }
|
||||||
|
static bool EndDrawingOnTop() { return TRUE; }
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
// __GTKDCSCREENH__
|
// _WX_DCSCREEN_H_
|
||||||
|
|
||||||
|
|||||||
@@ -1,91 +1,98 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: dialog.h
|
// Name: dialog.h
|
||||||
// Purpose:
|
// Purpose: wxDialog class
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_DIALOG_H_
|
||||||
#ifndef __GTKDIALOGH__
|
#define _WX_DIALOG_H_
|
||||||
#define __GTKDIALOGH__
|
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma interface
|
#pragma interface "dialog.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/defs.h"
|
#include "wx/panel.h"
|
||||||
#include "wx/object.h"
|
|
||||||
#include "wx/string.h"
|
|
||||||
#include "wx/event.h"
|
|
||||||
#include "wx/window.h"
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
WXDLLEXPORT_DATA(extern const char*) wxDialogNameStr;
|
||||||
// forward decls
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxRadioBox;
|
// Dialog boxes
|
||||||
|
class WXDLLEXPORT wxDialog: public wxPanel
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// classes
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxDialog;
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// global data
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
extern const char *wxDialogNameStr;
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// wxDialog
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxDialog: public wxWindow
|
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxDialog)
|
DECLARE_DYNAMIC_CLASS(wxDialog)
|
||||||
|
public:
|
||||||
|
|
||||||
public:
|
wxDialog();
|
||||||
|
|
||||||
wxDialog(void);
|
// Constructor with a modal flag, but no window id - the old convention
|
||||||
wxDialog( wxWindow *parent, wxWindowID id, const wxString &title,
|
inline wxDialog(wxWindow *parent,
|
||||||
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
|
const wxString& title, bool modal,
|
||||||
long style = wxDEFAULT_DIALOG_STYLE, const wxString &name = wxDialogNameStr );
|
int x = -1, int y= -1, int width = 500, int height = 500,
|
||||||
bool Create( wxWindow *parent, wxWindowID id, const wxString &title,
|
long style = wxDEFAULT_DIALOG_STYLE,
|
||||||
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
|
const wxString& name = wxDialogNameStr)
|
||||||
long style = wxDEFAULT_DIALOG_STYLE, const wxString &name = wxDialogNameStr );
|
{
|
||||||
~wxDialog(void);
|
long modalStyle = modal ? wxDIALOG_MODAL : wxDIALOG_MODELESS ;
|
||||||
void SetTitle(const wxString& title);
|
Create(parent, -1, title, wxPoint(x, y), wxSize(width, height), style|modalStyle, name);
|
||||||
wxString GetTitle(void) const;
|
}
|
||||||
bool OnClose(void);
|
|
||||||
void OnApply( wxCommandEvent &event );
|
// Constructor with no modal flag - the new convention.
|
||||||
void OnCancel( wxCommandEvent &event );
|
inline wxDialog(wxWindow *parent, wxWindowID id,
|
||||||
void OnOk( wxCommandEvent &event );
|
const wxString& title,
|
||||||
void OnPaint(wxPaintEvent& event);
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
bool Destroy(void);
|
const wxSize& size = wxDefaultSize,
|
||||||
void OnCloseWindow(wxCloseEvent& event);
|
long style = wxDEFAULT_DIALOG_STYLE,
|
||||||
/*
|
const wxString& name = wxDialogNameStr)
|
||||||
void OnCharHook(wxKeyEvent& event);
|
{
|
||||||
*/
|
Create(parent, id, title, pos, size, style, name);
|
||||||
virtual bool Show( bool show );
|
}
|
||||||
virtual int ShowModal(void);
|
|
||||||
virtual void EndModal(int retCode);
|
bool Create(wxWindow *parent, wxWindowID id,
|
||||||
virtual bool IsModal(void) const { return ((GetWindowStyleFlag() & wxDIALOG_MODAL) == wxDIALOG_MODAL); }
|
const wxString& title, // bool modal = FALSE, // TODO make this a window style?
|
||||||
virtual void InitDialog(void);
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
private:
|
long style = wxDEFAULT_DIALOG_STYLE,
|
||||||
|
const wxString& name = wxDialogNameStr);
|
||||||
friend wxWindow;
|
|
||||||
friend wxDC;
|
~wxDialog();
|
||||||
friend wxRadioBox;
|
|
||||||
bool m_modalShowing;
|
virtual bool Destroy();
|
||||||
wxString m_title;
|
void SetClientSize(int width, int height);
|
||||||
|
void GetPosition(int *x, int *y) const;
|
||||||
DECLARE_EVENT_TABLE()
|
bool Show(bool show);
|
||||||
|
void Iconize(bool iconize);
|
||||||
|
|
||||||
|
virtual bool IsIconized() const;
|
||||||
|
void Fit();
|
||||||
|
|
||||||
|
void SetTitle(const wxString& title);
|
||||||
|
wxString GetTitle() const ;
|
||||||
|
|
||||||
|
bool OnClose();
|
||||||
|
void OnCharHook(wxKeyEvent& event);
|
||||||
|
void OnCloseWindow(wxCloseEvent& event);
|
||||||
|
|
||||||
|
void SetModal(bool flag);
|
||||||
|
|
||||||
|
virtual void Centre(int direction = wxBOTH);
|
||||||
|
virtual bool IsModal() const { return ((GetWindowStyleFlag() & wxDIALOG_MODAL) == wxDIALOG_MODAL); }
|
||||||
|
|
||||||
|
virtual int ShowModal();
|
||||||
|
virtual void EndModal(int retCode);
|
||||||
|
|
||||||
|
// Standard buttons
|
||||||
|
void OnOK(wxCommandEvent& event);
|
||||||
|
void OnApply(wxCommandEvent& event);
|
||||||
|
void OnCancel(wxCommandEvent& event);
|
||||||
|
|
||||||
|
// Responds to colour changes
|
||||||
|
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
||||||
|
|
||||||
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // __GTKDIALOGH__
|
#endif
|
||||||
|
// _WX_DIALOG_H_
|
||||||
|
|||||||
@@ -1,35 +1,47 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: dirdlg.h
|
// Name: dirdlg.h
|
||||||
// Purpose:
|
// Purpose: wxDirDialog class
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_DIRDLG_H_
|
||||||
#ifndef __DIRDIALOGH__
|
#define _WX_DIRDLG_H_
|
||||||
#define __DIRDIALOGH__
|
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma interface
|
#pragma interface "dirdlg.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/defs.h"
|
|
||||||
#include "wx/object.h"
|
|
||||||
#include "wx/list.h"
|
|
||||||
#include "wx/control.h"
|
|
||||||
#include "wx/dialog.h"
|
#include "wx/dialog.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
class WXDLLEXPORT wxDirDialog: public wxDialog
|
||||||
// classes
|
{
|
||||||
//-----------------------------------------------------------------------------
|
DECLARE_DYNAMIC_CLASS(wxDirDialog)
|
||||||
|
public:
|
||||||
|
wxDirDialog(wxWindow *parent, const wxString& message = wxFileSelectorPromptStr,
|
||||||
|
const wxString& defaultPath = "",
|
||||||
|
long style = 0, const wxPoint& pos = wxDefaultPosition);
|
||||||
|
|
||||||
class wxDirDialog;
|
inline void SetMessage(const wxString& message) { m_message = message; }
|
||||||
|
inline void SetPath(const wxString& path) { m_path = path; }
|
||||||
|
inline void SetStyle(long style) { m_dialogStyle = style; }
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
inline wxString GetMessage() const { return m_message; }
|
||||||
// wxDirDialog
|
inline wxString GetPath() const { return m_path; }
|
||||||
//-----------------------------------------------------------------------------
|
inline long GetStyle() const { return m_dialogStyle; }
|
||||||
|
|
||||||
#endif // __DIRDIALOGH__
|
int ShowModal();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
wxString m_message;
|
||||||
|
long m_dialogStyle;
|
||||||
|
wxWindow * m_parent;
|
||||||
|
wxString m_path;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
// _WX_DIRDLG_H_
|
||||||
|
|||||||
@@ -1,42 +1,45 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: filedlg.h
|
// Name: filedlg.h
|
||||||
// Purpose:
|
// Purpose: wxFileDialog class
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
// Licence: wxWindows licence
|
// Copyright: (c) AUTHOR
|
||||||
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_FILEDLG_H_
|
||||||
#ifndef __GTKFILEDLGH__
|
#define _WX_FILEDLG_H_
|
||||||
#define __GTKFILEDLGH__
|
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma interface
|
#pragma interface "filedlg.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/dialog.h"
|
#include "wx/dialog.h"
|
||||||
|
|
||||||
//-------------------------------------------------------------------------
|
/*
|
||||||
// File selector
|
* File selector
|
||||||
//-------------------------------------------------------------------------
|
*/
|
||||||
|
|
||||||
extern const char *wxFileSelectorPromptStr;
|
WXDLLEXPORT_DATA(extern const char*) wxFileSelectorPromptStr;
|
||||||
extern const char *wxFileSelectorDefaultWildcardStr;
|
WXDLLEXPORT_DATA(extern const char*) wxFileSelectorDefaultWildcardStr;
|
||||||
|
|
||||||
class wxFileDialog: public wxDialog
|
class WXDLLEXPORT wxFileDialog: public wxDialog
|
||||||
{
|
{
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxFileDialog)
|
||||||
DECLARE_DYNAMIC_CLASS(wxFileDialog)
|
protected:
|
||||||
|
wxString m_message;
|
||||||
public:
|
long m_dialogStyle;
|
||||||
|
wxWindow * m_parent;
|
||||||
wxFileDialog() {};
|
wxString m_dir;
|
||||||
|
wxString m_path; // Full path
|
||||||
|
wxString m_fileName;
|
||||||
|
wxString m_wildCard;
|
||||||
|
int m_filterIndex;
|
||||||
|
public:
|
||||||
wxFileDialog(wxWindow *parent, const wxString& message = wxFileSelectorPromptStr,
|
wxFileDialog(wxWindow *parent, const wxString& message = wxFileSelectorPromptStr,
|
||||||
const wxString& defaultDir = "", const wxString& defaultFile = "",
|
const wxString& defaultDir = "", const wxString& defaultFile = "", const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
|
||||||
const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
|
|
||||||
long style = 0, const wxPoint& pos = wxDefaultPosition);
|
long style = 0, const wxPoint& pos = wxDefaultPosition);
|
||||||
|
|
||||||
inline void SetMessage(const wxString& message) { m_message = message; }
|
inline void SetMessage(const wxString& message) { m_message = message; }
|
||||||
@@ -47,48 +50,40 @@ class wxFileDialog: public wxDialog
|
|||||||
inline void SetStyle(long style) { m_dialogStyle = style; }
|
inline void SetStyle(long style) { m_dialogStyle = style; }
|
||||||
inline void SetFilterIndex(int filterIndex) { m_filterIndex = filterIndex; }
|
inline void SetFilterIndex(int filterIndex) { m_filterIndex = filterIndex; }
|
||||||
|
|
||||||
inline wxString GetMessage(void) const { return m_message; }
|
inline wxString GetMessage() const { return m_message; }
|
||||||
inline wxString GetPath(void) const { return m_path; }
|
inline wxString GetPath() const { return m_path; }
|
||||||
inline wxString GetDirectory(void) const { return m_dir; }
|
inline wxString GetDirectory() const { return m_dir; }
|
||||||
inline wxString GetFilename(void) const { return m_fileName; }
|
inline wxString GetFilename() const { return m_fileName; }
|
||||||
inline wxString GetWildcard(void) const { return m_wildCard; }
|
inline wxString GetWildcard() const { return m_wildCard; }
|
||||||
inline long GetStyle(void) const { return m_dialogStyle; }
|
inline long GetStyle() const { return m_dialogStyle; }
|
||||||
inline int GetFilterIndex(void) const { return m_filterIndex ; }
|
inline int GetFilterIndex() const { return m_filterIndex ; }
|
||||||
|
|
||||||
int ShowModal(void);
|
int ShowModal();
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
wxString m_message;
|
|
||||||
long m_dialogStyle;
|
|
||||||
wxWindow * m_parent;
|
|
||||||
wxString m_dir;
|
|
||||||
wxString m_path; // Full path
|
|
||||||
wxString m_fileName;
|
|
||||||
wxString m_wildCard;
|
|
||||||
int m_filterIndex;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#define wxOPEN 1
|
#define wxOPEN 0x0001
|
||||||
#define wxSAVE 2
|
#define wxSAVE 0x0002
|
||||||
#define wxOVERWRITE_PROMPT 4
|
#define wxOVERWRITE_PROMPT 0x0004
|
||||||
#define wxHIDE_READONLY 8
|
#define wxHIDE_READONLY 0x0008
|
||||||
#define wxFILE_MUST_EXIST 16
|
#define wxFILE_MUST_EXIST 0x0010
|
||||||
|
|
||||||
// File selector - backward compatibility
|
// File selector - backward compatibility
|
||||||
|
char* WXDLLEXPORT wxFileSelector(const char *message = wxFileSelectorPromptStr, const char *default_path = NULL,
|
||||||
|
const char *default_filename = NULL, const char *default_extension = NULL,
|
||||||
|
const char *wildcard = wxFileSelectorDefaultWildcardStr, int flags = 0,
|
||||||
|
wxWindow *parent = NULL, int x = -1, int y = -1);
|
||||||
|
|
||||||
char* wxFileSelector(const char *message = wxFileSelectorPromptStr, const char *default_path = NULL,
|
// An extended version of wxFileSelector
|
||||||
const char *default_filename = NULL, const char *default_extension = NULL,
|
char* WXDLLEXPORT wxFileSelectorEx(const char *message = wxFileSelectorPromptStr, const char *default_path = NULL,
|
||||||
const char *wildcard = wxFileSelectorDefaultWildcardStr, int flags = 0,
|
const char *default_filename = NULL, int *indexDefaultExtension = NULL,
|
||||||
wxWindow *parent = NULL, int x = -1, int y = -1);
|
const char *wildcard = wxFileSelectorDefaultWildcardStr, int flags = 0,
|
||||||
|
wxWindow *parent = NULL, int x = -1, int y = -1);
|
||||||
char* wxLoadFileSelector(const char *what, const char *extension, const char *default_name = NULL,
|
|
||||||
wxWindow *parent = NULL);
|
|
||||||
|
|
||||||
char* wxSaveFileSelector(const char *what, const char *extension, const char *default_name = NULL,
|
|
||||||
wxWindow *parent = NULL);
|
|
||||||
|
|
||||||
|
// Generic file load dialog
|
||||||
|
char* WXDLLEXPORT wxLoadFileSelector(const char *what, const char *extension, const char *default_name = NULL, wxWindow *parent = NULL);
|
||||||
|
|
||||||
|
// Generic file save dialog
|
||||||
|
char* WXDLLEXPORT wxSaveFileSelector(const char *what, const char *extension, const char *default_name = NULL, wxWindow *parent = NULL);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
// __GTKFILEDLGH__
|
// _WX_FILEDLG_H_
|
||||||
|
|||||||
@@ -1,87 +1,88 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: font.h
|
// Name: font.h
|
||||||
// Purpose:
|
// Purpose: wxFont class
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_FONT_H_
|
||||||
#ifndef __GTKFONTH__
|
#define _WX_FONT_H_
|
||||||
#define __GTKFONTH__
|
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma interface
|
#pragma interface "font.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/defs.h"
|
|
||||||
#include "wx/object.h"
|
|
||||||
#include "wx/string.h"
|
|
||||||
#include "wx/hash.h"
|
|
||||||
#include "wx/gdiobj.h"
|
#include "wx/gdiobj.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
class WXDLLEXPORT wxFont;
|
||||||
// classes
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxDC;
|
class WXDLLEXPORT wxFontRefData: public wxGDIRefData
|
||||||
class wxPaintDC;
|
|
||||||
class wxWindow;
|
|
||||||
|
|
||||||
class wxFont;
|
|
||||||
class wxFontNameDirectory;
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// global variables
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
// extern wxFontNameDirectory wxTheFontNameDirectory; // defined below
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// wxFont
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxFont: public wxGDIObject
|
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxFont)
|
friend class WXDLLEXPORT wxFont;
|
||||||
|
public:
|
||||||
public:
|
wxFontRefData();
|
||||||
wxFont(void);
|
~wxFontRefData();
|
||||||
wxFont( int PointSize, int FontIdOrFamily, int Style, int Weight,
|
protected:
|
||||||
bool underlined = FALSE, const char *Face=NULL );
|
int m_pointSize;
|
||||||
wxFont( int PointSize, const char *Face, int Family, int Style, int Weight,
|
int m_family;
|
||||||
bool underlined = FALSE );
|
int m_style;
|
||||||
wxFont( const wxFont& font );
|
int m_weight;
|
||||||
wxFont( const wxFont* font );
|
bool m_underlined;
|
||||||
~wxFont(void);
|
wxString m_faceName;
|
||||||
wxFont& operator = ( const wxFont& font );
|
/* TODO: implementation
|
||||||
bool operator == ( const wxFont& font );
|
WXHFONT m_hFont;
|
||||||
bool operator != ( const wxFont& font );
|
*/
|
||||||
bool Ok();
|
|
||||||
|
|
||||||
int GetPointSize(void) const;
|
|
||||||
wxString GetFaceName(void) const;
|
|
||||||
int GetFamily(void) const;
|
|
||||||
wxString GetFamilyString(void) const;
|
|
||||||
int GetFontId(void) const;
|
|
||||||
wxString GetFaceString(void) const;
|
|
||||||
int GetStyle(void) const;
|
|
||||||
wxString GetStyleString(void) const;
|
|
||||||
int GetWeight(void) const;
|
|
||||||
wxString GetWeightString(void) const;
|
|
||||||
bool GetUnderlined(void) const;
|
|
||||||
|
|
||||||
wxFont( char *xFontName );
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
friend wxDC;
|
|
||||||
friend wxPaintDC;
|
|
||||||
friend wxWindow;
|
|
||||||
|
|
||||||
// no data :-)
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // __GTKFONTH__
|
#define M_FONTDATA ((wxFontRefData *)m_refData)
|
||||||
|
|
||||||
|
WXDLLEXPORT_DATA(extern const char*) wxEmptyString;
|
||||||
|
|
||||||
|
// Font
|
||||||
|
class WXDLLEXPORT wxFont: public wxGDIObject
|
||||||
|
{
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxFont)
|
||||||
|
public:
|
||||||
|
wxFont();
|
||||||
|
wxFont(int pointSize, int family, int style, int weight, bool underlined = FALSE, const wxString& faceName = wxEmptyString);
|
||||||
|
inline wxFont(const wxFont& font) { Ref(font); }
|
||||||
|
inline wxFont(const wxFont* font) { if (font) Ref(*font); }
|
||||||
|
|
||||||
|
~wxFont();
|
||||||
|
|
||||||
|
bool Create(int pointSize, int family, int style, int weight, bool underlined = FALSE, const wxString& faceName = wxEmptyString);
|
||||||
|
|
||||||
|
virtual bool Ok() const { return (m_refData != NULL) ; }
|
||||||
|
|
||||||
|
inline int GetPointSize() const { return M_FONTDATA->m_pointSize; }
|
||||||
|
inline int GetFamily() const { return M_FONTDATA->m_family; }
|
||||||
|
inline int GetStyle() const { return M_FONTDATA->m_style; }
|
||||||
|
inline int GetWeight() const { return M_FONTDATA->m_weight; }
|
||||||
|
wxString GetFamilyString() const ;
|
||||||
|
wxString GetFaceName() const ;
|
||||||
|
wxString GetStyleString() const ;
|
||||||
|
wxString GetWeightString() const ;
|
||||||
|
inline bool GetUnderlined() const { return M_FONTDATA->m_underlined; }
|
||||||
|
|
||||||
|
void SetPointSize(int pointSize);
|
||||||
|
void SetFamily(int family);
|
||||||
|
void SetStyle(int style);
|
||||||
|
void SetWeight(int weight);
|
||||||
|
void SetFaceName(const wxString& faceName);
|
||||||
|
void SetUnderlined(bool underlined);
|
||||||
|
|
||||||
|
inline wxFont& operator = (const wxFont& font) { if (*this == font) return (*this); Ref(font); return *this; }
|
||||||
|
inline bool operator == (const wxFont& font) { return m_refData == font.m_refData; }
|
||||||
|
inline bool operator != (const wxFont& font) { return m_refData != font.m_refData; }
|
||||||
|
|
||||||
|
// Implementation
|
||||||
|
protected:
|
||||||
|
void Unshare();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
// _WX_FONT_H_
|
||||||
|
|||||||
@@ -1,112 +1,156 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: frame.h
|
// Name: frame.h
|
||||||
// Purpose:
|
// Purpose: wxFrame class
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
// Licence: wxWindows licence
|
// Copyright: (c) AUTHOR
|
||||||
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_FRAME_H_
|
||||||
#ifndef __GTKFRAMEH__
|
#define _WX_FRAME_H_
|
||||||
#define __GTKFRAMEH__
|
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma interface
|
#pragma interface "frame.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/defs.h"
|
|
||||||
#include "wx/object.h"
|
|
||||||
#include "wx/window.h"
|
#include "wx/window.h"
|
||||||
|
#include "wx/toolbar.h"
|
||||||
|
#include "wx/accel.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
WXDLLEXPORT_DATA(extern const char*) wxFrameNameStr;
|
||||||
// classes
|
WXDLLEXPORT_DATA(extern const char*) wxToolBarNameStr;
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxMDIChildFrame;
|
class WXDLLEXPORT wxMenuBar;
|
||||||
class wxMDIClientWindow;
|
class WXDLLEXPORT wxStatusBar;
|
||||||
class wxMenu;
|
|
||||||
class wxMenuBar;
|
|
||||||
class wxToolBar;
|
|
||||||
class wxStatusBar;
|
|
||||||
|
|
||||||
class wxFrame;
|
class WXDLLEXPORT wxFrame: public wxWindow {
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// global data
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
extern const char *wxFrameNameStr;
|
|
||||||
extern const char *wxToolBarNameStr;
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// wxFrame
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxFrame: public wxWindow
|
|
||||||
{
|
|
||||||
DECLARE_DYNAMIC_CLASS(wxFrame)
|
DECLARE_DYNAMIC_CLASS(wxFrame)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
wxFrame();
|
wxFrame();
|
||||||
wxFrame( wxWindow *parent, wxWindowID id, const wxString &title,
|
inline wxFrame(wxWindow *parent,
|
||||||
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
|
wxWindowID id,
|
||||||
long style = wxDEFAULT_FRAME_STYLE, const wxString &name = wxFrameNameStr );
|
const wxString& title,
|
||||||
bool Create( wxWindow *parent, wxWindowID id, const wxString &title,
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
|
const wxSize& size = wxDefaultSize,
|
||||||
long style = wxDEFAULT_FRAME_STYLE, const wxString &name = wxFrameNameStr );
|
long style = wxDEFAULT_FRAME_STYLE,
|
||||||
|
const wxString& name = wxFrameNameStr)
|
||||||
|
{
|
||||||
|
Create(parent, id, title, pos, size, style, name);
|
||||||
|
}
|
||||||
|
|
||||||
~wxFrame();
|
~wxFrame();
|
||||||
bool Destroy();
|
|
||||||
|
|
||||||
virtual bool Show( bool show );
|
bool Create(wxWindow *parent,
|
||||||
virtual void Enable( bool enable );
|
wxWindowID id,
|
||||||
|
const wxString& title,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = wxDEFAULT_FRAME_STYLE,
|
||||||
|
const wxString& name = wxFrameNameStr);
|
||||||
|
|
||||||
virtual void GetClientSize( int *width, int *height ) const;
|
virtual bool Destroy();
|
||||||
|
void SetClientSize(int width, int height);
|
||||||
// set minimal/maxmimal size for the frame
|
void GetClientSize(int *width, int *height) const;
|
||||||
virtual void SetSizeHints( int minW, int minH, int maxW, int maxH, int incW = -1 );
|
|
||||||
|
|
||||||
|
void GetSize(int *width, int *height) const ;
|
||||||
|
void GetPosition(int *x, int *y) const ;
|
||||||
|
void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
|
||||||
|
|
||||||
|
virtual bool OnClose();
|
||||||
|
|
||||||
|
void OnSize(wxSizeEvent& event);
|
||||||
|
void OnMenuHighlight(wxMenuEvent& event);
|
||||||
|
void OnActivate(wxActivateEvent& event);
|
||||||
|
void OnIdle(wxIdleEvent& event);
|
||||||
|
void OnCloseWindow(wxCloseEvent& event);
|
||||||
|
|
||||||
|
bool Show(bool show);
|
||||||
|
|
||||||
|
// Set menu bar
|
||||||
|
void SetMenuBar(wxMenuBar *menu_bar);
|
||||||
|
virtual wxMenuBar *GetMenuBar() const ;
|
||||||
|
|
||||||
|
// Set title
|
||||||
|
void SetTitle(const wxString& title);
|
||||||
|
wxString GetTitle() const ;
|
||||||
|
|
||||||
|
void Centre(int direction = wxBOTH);
|
||||||
|
|
||||||
|
// Call this to simulate a menu command
|
||||||
|
virtual void Command(int id);
|
||||||
|
virtual void ProcessCommand(int id);
|
||||||
|
|
||||||
|
// Set icon
|
||||||
|
virtual void SetIcon(const wxIcon& icon);
|
||||||
|
|
||||||
|
// Create status line
|
||||||
virtual wxStatusBar* CreateStatusBar(int number=1, long style = wxST_SIZEGRIP, wxWindowID id = 0,
|
virtual wxStatusBar* CreateStatusBar(int number=1, long style = wxST_SIZEGRIP, wxWindowID id = 0,
|
||||||
const wxString& name = "statusBar");
|
const wxString& name = "statusBar");
|
||||||
virtual wxStatusBar *GetStatusBar();
|
inline wxStatusBar *GetStatusBar() const { return m_frameStatusBar; }
|
||||||
virtual void SetStatusText( const wxString &text, int number = 0 );
|
virtual void PositionStatusBar();
|
||||||
virtual void SetStatusWidths( int n, int *width );
|
virtual wxStatusBar *OnCreateStatusBar(int number, long style, wxWindowID id,
|
||||||
|
const wxString& name);
|
||||||
|
|
||||||
virtual wxToolBar* CreateToolBar( long style = wxNO_BORDER|wxTB_HORIZONTAL, wxWindowID id = -1,
|
// Create toolbar
|
||||||
const wxString& name = wxToolBarNameStr);
|
virtual wxToolBar* CreateToolBar(long style = wxNO_BORDER|wxTB_HORIZONTAL, wxWindowID id = -1, const wxString& name = wxToolBarNameStr);
|
||||||
virtual wxToolBar *GetToolBar();
|
virtual wxToolBar *OnCreateToolBar(long style, wxWindowID id, const wxString& name);
|
||||||
|
// If made known to the frame, the frame will manage it automatically.
|
||||||
virtual void SetMenuBar( wxMenuBar *menuBar );
|
virtual inline void SetToolBar(wxToolBar *toolbar) { m_frameToolBar = toolbar; }
|
||||||
virtual wxMenuBar *GetMenuBar();
|
virtual inline wxToolBar *GetToolBar() const { return m_frameToolBar; }
|
||||||
|
virtual void PositionToolBar();
|
||||||
|
|
||||||
virtual void SetTitle( const wxString &title );
|
// Set status line text
|
||||||
virtual wxString GetTitle() const { return m_title; }
|
virtual void SetStatusText(const wxString& text, int number = 0);
|
||||||
|
|
||||||
virtual void SetIcon( const wxIcon &icon );
|
|
||||||
|
|
||||||
void OnActivate( wxActivateEvent &WXUNUSED(event) ) { } // called from docview.cpp
|
// Set status line widths
|
||||||
void OnSize( wxSizeEvent &event );
|
virtual void SetStatusWidths(int n, const int widths_field[]);
|
||||||
void OnCloseWindow( wxCloseEvent& event );
|
|
||||||
void OnIdle(wxIdleEvent& event);
|
|
||||||
|
|
||||||
private:
|
// Hint to tell framework which status bar to use
|
||||||
friend wxWindow;
|
// TODO: should this go into a wxFrameworkSettings class perhaps?
|
||||||
friend wxMDIChildFrame;
|
static void UseNativeStatusBar(bool useNative) { m_useNativeStatusBar = useNative; };
|
||||||
friend wxMDIClientWindow;
|
static bool UsesNativeStatusBar() { return m_useNativeStatusBar; };
|
||||||
|
|
||||||
// update frame's menus (called from OnIdle)
|
// Fit frame around subwindows
|
||||||
|
virtual void Fit();
|
||||||
|
|
||||||
|
// Iconize
|
||||||
|
virtual void Iconize(bool iconize);
|
||||||
|
|
||||||
|
virtual bool IsIconized() const ;
|
||||||
|
|
||||||
|
// Compatibility
|
||||||
|
inline bool Iconized() const { return IsIconized(); }
|
||||||
|
|
||||||
|
virtual void Maximize(bool maximize);
|
||||||
|
|
||||||
|
virtual void SetAcceleratorTable(const wxAcceleratorTable& accel);
|
||||||
|
|
||||||
|
// Responds to colour changes
|
||||||
|
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
||||||
|
|
||||||
|
// Query app for menu item updates (called from OnIdle)
|
||||||
void DoMenuUpdates();
|
void DoMenuUpdates();
|
||||||
void DoMenuUpdates(wxMenu* menu);
|
void DoMenuUpdates(wxMenu* menu);
|
||||||
|
|
||||||
wxMenuBar *m_frameMenuBar;
|
// Checks if there is a toolbar, and returns the first free client position
|
||||||
wxStatusBar *m_frameStatusBar;
|
virtual wxPoint GetClientAreaOrigin() const;
|
||||||
wxToolBar *m_frameToolBar;
|
|
||||||
int m_toolBarHeight;
|
protected:
|
||||||
wxString m_title;
|
wxMenuBar * m_frameMenuBar;
|
||||||
wxIcon m_icon;
|
wxStatusBar * m_frameStatusBar;
|
||||||
|
wxIcon m_icon;
|
||||||
|
bool m_iconized;
|
||||||
|
static bool m_useNativeStatusBar;
|
||||||
|
wxToolBar * m_frameToolBar ;
|
||||||
|
wxAcceleratorTable m_acceleratorTable;
|
||||||
|
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // __GTKFRAMEH__
|
#endif
|
||||||
|
// _WX_FRAME_H_
|
||||||
|
|||||||
@@ -1,83 +1,69 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: gauge.h
|
// Name: gauge.h
|
||||||
// Purpose:
|
// Purpose: wxGauge class
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_GAUGE_H_
|
||||||
#ifndef __GTKGAUGEH__
|
#define _WX_GAUGE_H_
|
||||||
#define __GTKGAUGEH__
|
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma interface
|
#pragma interface "gauge.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/defs.h"
|
|
||||||
#include "wx/object.h"
|
|
||||||
#include "wx/list.h"
|
|
||||||
#include "wx/control.h"
|
#include "wx/control.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
WXDLLEXPORT_DATA(extern const char*) wxGaugeNameStr;
|
||||||
// classes
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxGauge;
|
// Group box
|
||||||
|
class WXDLLEXPORT wxGauge: public wxControl
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// global data
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
extern const char* wxGaugeNameStr;
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// wxGaugeBox
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxGauge: public wxControl
|
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxGauge)
|
DECLARE_DYNAMIC_CLASS(wxGauge)
|
||||||
|
public:
|
||||||
public:
|
inline wxGauge() { m_rangeMax = 0; m_gaugePos = 0; }
|
||||||
inline wxGauge(void) { m_rangeMax = 0; m_gaugePos = 0; m_useProgressBar = TRUE; }
|
|
||||||
|
|
||||||
inline wxGauge(wxWindow *parent, wxWindowID id,
|
inline wxGauge(wxWindow *parent, wxWindowID id,
|
||||||
int range,
|
int range,
|
||||||
const wxPoint& pos = wxDefaultPosition,
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
const wxSize& size = wxDefaultSize,
|
const wxSize& size = wxDefaultSize,
|
||||||
long style = wxGA_HORIZONTAL,
|
long style = wxGA_HORIZONTAL,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
const wxString& name = wxGaugeNameStr)
|
const wxString& name = wxGaugeNameStr)
|
||||||
{
|
{
|
||||||
Create(parent, id, range, pos, size, style, name);
|
Create(parent, id, range, pos, size, style, validator, name);
|
||||||
};
|
}
|
||||||
|
|
||||||
bool Create(wxWindow *parent, wxWindowID id,
|
bool Create(wxWindow *parent, wxWindowID id,
|
||||||
int range,
|
int range,
|
||||||
const wxPoint& pos = wxDefaultPosition,
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
const wxSize& size = wxDefaultSize,
|
const wxSize& size = wxDefaultSize,
|
||||||
long style = wxGA_HORIZONTAL,
|
long style = wxGA_HORIZONTAL,
|
||||||
const wxString& name = wxGaugeNameStr );
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
|
const wxString& name = wxGaugeNameStr);
|
||||||
|
|
||||||
void SetShadowWidth( int WXUNUSED(w) ) {};
|
void SetShadowWidth(int w);
|
||||||
void SetBezelFace( int WXUNUSED(w) ) {};
|
void SetBezelFace(int w);
|
||||||
void SetRange( int r );
|
void SetRange(int r);
|
||||||
void SetValue( int pos );
|
void SetValue(int pos);
|
||||||
int GetShadowWidth(void) const { return 0; };
|
|
||||||
int GetBezelFace(void) const { return 0; };
|
|
||||||
int GetRange(void) const;
|
|
||||||
int GetValue(void) const;
|
|
||||||
|
|
||||||
// Are we a Win95/GTK progress bar, or a normal gauge?
|
int GetShadowWidth() const ;
|
||||||
inline bool GetProgressBar(void) const { return m_useProgressBar; }
|
int GetBezelFace() const ;
|
||||||
|
int GetRange() const ;
|
||||||
|
int GetValue() const ;
|
||||||
|
|
||||||
|
void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
|
||||||
|
|
||||||
|
virtual void Command(wxCommandEvent& WXUNUSED(event)) {} ;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
int m_rangeMax;
|
int m_rangeMax;
|
||||||
int m_gaugePos;
|
int m_gaugePos;
|
||||||
bool m_useProgressBar;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // __GTKGAUGEH__
|
#endif
|
||||||
|
// _WX_GAUGE_H_
|
||||||
|
|||||||
@@ -1,31 +1,42 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: gdiobj.h
|
// Name: gdiobj.h
|
||||||
// Purpose:
|
// Purpose: wxGDIObject class: base class for other GDI classes
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_GDIOBJ_H_
|
||||||
#ifndef __GDIOBJH__
|
#define _WX_GDIOBJ_H_
|
||||||
#define __GDIOBJH__
|
|
||||||
|
|
||||||
#include "wx/object.h"
|
#include "wx/object.h"
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma interface
|
#pragma interface "gdiobj.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
class WXDLLEXPORT wxGDIRefData: public wxObjectRefData {
|
||||||
|
public:
|
||||||
|
inline wxGDIRefData()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
#define M_GDIDATA ((wxGDIRefData *)m_refData)
|
||||||
|
|
||||||
class WXDLLEXPORT wxGDIObject: public wxObject
|
class WXDLLEXPORT wxGDIObject: public wxObject
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxGDIObject)
|
DECLARE_DYNAMIC_CLASS(wxGDIObject)
|
||||||
public:
|
public:
|
||||||
inline wxGDIObject(void) { m_visible = FALSE; };
|
inline wxGDIObject() { m_visible = FALSE; };
|
||||||
inline ~wxGDIObject(void) {};
|
inline ~wxGDIObject() {};
|
||||||
|
|
||||||
virtual bool GetVisible(void) { return m_visible; }
|
inline bool IsNull() const { return (m_refData == 0); }
|
||||||
|
|
||||||
|
virtual bool GetVisible() { return m_visible; }
|
||||||
virtual void SetVisible(bool v) { m_visible = v; }
|
virtual void SetVisible(bool v) { m_visible = v; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@@ -34,4 +45,4 @@ protected:
|
|||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
// __GDIOBJH__
|
// _WX_GDIOBJ_H_
|
||||||
|
|||||||
@@ -1,51 +1,107 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: icon.h
|
// Name: icon.h
|
||||||
// Purpose:
|
// Purpose: wxIcon class
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_ICON_H_
|
||||||
#ifndef __GTKICONH__
|
#define _WX_ICON_H_
|
||||||
#define __GTKICONH__
|
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma interface
|
#pragma interface "icon.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/defs.h"
|
|
||||||
#include "wx/object.h"
|
|
||||||
#include "wx/bitmap.h"
|
#include "wx/bitmap.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
class WXDLLEXPORT wxIconRefData: public wxBitmapRefData
|
||||||
// classes
|
{
|
||||||
//-----------------------------------------------------------------------------
|
friend class WXDLLEXPORT wxBitmap;
|
||||||
|
friend class WXDLLEXPORT wxIcon;
|
||||||
|
public:
|
||||||
|
wxIconRefData();
|
||||||
|
~wxIconRefData();
|
||||||
|
|
||||||
class wxIcon;
|
public:
|
||||||
|
/* TODO: whatever your actual icon handle is
|
||||||
|
WXHICON m_hIcon;
|
||||||
|
*/
|
||||||
|
};
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
#define M_ICONDATA ((wxIconRefData *)m_refData)
|
||||||
// wxIcon
|
#define M_ICONHANDLERDATA ((wxIconRefData *)bitmap->GetRefData())
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxIcon: public wxBitmap
|
// Icon
|
||||||
|
class WXDLLEXPORT wxIcon: public wxBitmap
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxIcon)
|
DECLARE_DYNAMIC_CLASS(wxIcon)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
wxIcon();
|
||||||
|
|
||||||
wxIcon(void) {};
|
// Copy constructors
|
||||||
|
|
||||||
inline wxIcon(const wxIcon& icon) { Ref(icon); }
|
inline wxIcon(const wxIcon& icon) { Ref(icon); }
|
||||||
inline wxIcon(const wxIcon* icon) { if (icon) Ref(*icon); }
|
inline wxIcon(const wxIcon* icon) { if (icon) Ref(*icon); }
|
||||||
wxIcon( char **bits, int width=-1, int height=-1 );
|
|
||||||
|
wxIcon(const char bits[], int width, int height);
|
||||||
|
wxIcon(const wxString& name, long flags = wxBITMAP_TYPE_ICO_RESOURCE,
|
||||||
|
int desiredWidth = -1, int desiredHeight = -1);
|
||||||
|
~wxIcon();
|
||||||
|
|
||||||
|
bool LoadFile(const wxString& name, long flags = wxBITMAP_TYPE_ICO_RESOURCE,
|
||||||
|
int desiredWidth = -1, int desiredHeight = -1);
|
||||||
|
|
||||||
inline wxIcon& operator = (const wxIcon& icon) { if (*this == icon) return (*this); Ref(icon); return *this; }
|
inline wxIcon& operator = (const wxIcon& icon) { if (*this == icon) return (*this); Ref(icon); return *this; }
|
||||||
inline bool operator == (const wxIcon& icon) { return m_refData == icon.m_refData; }
|
inline bool operator == (const wxIcon& icon) { return m_refData == icon.m_refData; }
|
||||||
inline bool operator != (const wxIcon& icon) { return m_refData != icon.m_refData; }
|
inline bool operator != (const wxIcon& icon) { return m_refData != icon.m_refData; }
|
||||||
|
|
||||||
|
/* TODO: implementation
|
||||||
|
void SetHICON(WXHICON ico);
|
||||||
|
inline WXHICON GetHICON() const { return (M_ICONDATA ? M_ICONDATA->m_hIcon : 0); }
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* TODO */
|
||||||
|
virtual bool Ok() const { return (m_refData != NULL) ; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* Example handlers. TODO: write your own handlers for relevant types.
|
||||||
|
|
||||||
#endif // __GTKICONH__
|
class WXDLLEXPORT wxICOFileHandler: public wxBitmapHandler
|
||||||
|
{
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxICOFileHandler)
|
||||||
|
public:
|
||||||
|
inline wxICOFileHandler()
|
||||||
|
{
|
||||||
|
m_name = "ICO icon file";
|
||||||
|
m_extension = "ico";
|
||||||
|
m_type = wxBITMAP_TYPE_ICO;
|
||||||
|
};
|
||||||
|
|
||||||
|
virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, long flags,
|
||||||
|
int desiredWidth = -1, int desiredHeight = -1);
|
||||||
|
};
|
||||||
|
|
||||||
|
class WXDLLEXPORT wxICOResourceHandler: public wxBitmapHandler
|
||||||
|
{
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxICOResourceHandler)
|
||||||
|
public:
|
||||||
|
inline wxICOResourceHandler()
|
||||||
|
{
|
||||||
|
m_name = "ICO resource";
|
||||||
|
m_extension = "ico";
|
||||||
|
m_type = wxBITMAP_TYPE_ICO_RESOURCE;
|
||||||
|
};
|
||||||
|
|
||||||
|
virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, long flags,
|
||||||
|
int desiredWidth = -1, int desiredHeight = -1);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
#endif
|
||||||
|
// _WX_ICON_H_
|
||||||
|
|||||||
@@ -1,25 +1,24 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: joystick.h
|
// Name: joystick.h
|
||||||
// Purpose: wxJoystick class
|
// Purpose: wxJoystick class
|
||||||
// Author: Guilhem Lavaux
|
// Author: AUTHOR
|
||||||
// Modified by:
|
// Modified by:
|
||||||
// Created: 01/02/97
|
// Created: ??/??/98
|
||||||
// RCS-ID: $Id$
|
// RCS-ID: $Id$
|
||||||
// Copyright:
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifndef __JOYSTICKH__
|
#ifndef _WX_JOYSTICK_H_
|
||||||
#define __JOYSTICKH__
|
#define _WX_JOYSTICK_H_
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma interface "joystick.h"
|
#pragma interface "joystick.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/event.h"
|
#include "wx/event.h"
|
||||||
#include "wx/thread.h"
|
|
||||||
|
|
||||||
class WXDLLEXPORT wxJoystick: public wxObject, public wxThread
|
class WXDLLEXPORT wxJoystick: public wxObject
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxJoystick)
|
DECLARE_DYNAMIC_CLASS(wxJoystick)
|
||||||
public:
|
public:
|
||||||
@@ -27,56 +26,56 @@ class WXDLLEXPORT wxJoystick: public wxObject, public wxThread
|
|||||||
* Public interface
|
* Public interface
|
||||||
*/
|
*/
|
||||||
|
|
||||||
wxJoystick(int joystick = wxJOYSTICK1);
|
wxJoystick(int joystick = wxJOYSTICK1) { m_joystick = joystick; };
|
||||||
|
|
||||||
// Attributes
|
// Attributes
|
||||||
////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
wxPoint GetPosition(void) const;
|
wxPoint GetPosition() const;
|
||||||
int GetZPosition(void) const;
|
int GetZPosition() const;
|
||||||
int GetButtonState(void) const;
|
int GetButtonState() const;
|
||||||
int GetPOVPosition(void) const;
|
int GetPOVPosition() const;
|
||||||
int GetPOVCTSPosition(void) const;
|
int GetPOVCTSPosition() const;
|
||||||
int GetRudderPosition(void) const;
|
int GetRudderPosition() const;
|
||||||
int GetUPosition(void) const;
|
int GetUPosition() const;
|
||||||
int GetVPosition(void) const;
|
int GetVPosition() const;
|
||||||
int GetMovementThreshold(void) const;
|
int GetMovementThreshold() const;
|
||||||
void SetMovementThreshold(int threshold) ;
|
void SetMovementThreshold(int threshold) ;
|
||||||
|
|
||||||
// Capabilities
|
// Capabilities
|
||||||
////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
bool IsOk(void) const; // Checks that the joystick is functioning
|
bool IsOk() const; // Checks that the joystick is functioning
|
||||||
int GetNumberJoysticks(void) const ;
|
int GetNumberJoysticks() const ;
|
||||||
int GetManufacturerId(void) const ;
|
int GetManufacturerId() const ;
|
||||||
int GetProductId(void) const ;
|
int GetProductId() const ;
|
||||||
wxString GetProductName(void) const ;
|
wxString GetProductName() const ;
|
||||||
int GetXMin(void) const;
|
int GetXMin() const;
|
||||||
int GetYMin(void) const;
|
int GetYMin() const;
|
||||||
int GetZMin(void) const;
|
int GetZMin() const;
|
||||||
int GetXMax(void) const;
|
int GetXMax() const;
|
||||||
int GetYMax(void) const;
|
int GetYMax() const;
|
||||||
int GetZMax(void) const;
|
int GetZMax() const;
|
||||||
int GetNumberButtons(void) const;
|
int GetNumberButtons() const;
|
||||||
int GetNumberAxes(void) const;
|
int GetNumberAxes() const;
|
||||||
int GetMaxButtons(void) const;
|
int GetMaxButtons() const;
|
||||||
int GetMaxAxes(void) const;
|
int GetMaxAxes() const;
|
||||||
int GetPollingMin(void) const;
|
int GetPollingMin() const;
|
||||||
int GetPollingMax(void) const;
|
int GetPollingMax() const;
|
||||||
int GetRudderMin(void) const;
|
int GetRudderMin() const;
|
||||||
int GetRudderMax(void) const;
|
int GetRudderMax() const;
|
||||||
int GetUMin(void) const;
|
int GetUMin() const;
|
||||||
int GetUMax(void) const;
|
int GetUMax() const;
|
||||||
int GetVMin(void) const;
|
int GetVMin() const;
|
||||||
int GetVMax(void) const;
|
int GetVMax() const;
|
||||||
|
|
||||||
bool HasRudder(void) const;
|
bool HasRudder() const;
|
||||||
bool HasZ(void) const;
|
bool HasZ() const;
|
||||||
bool HasU(void) const;
|
bool HasU() const;
|
||||||
bool HasV(void) const;
|
bool HasV() const;
|
||||||
bool HasPOV(void) const;
|
bool HasPOV() const;
|
||||||
bool HasPOV4Dir(void) const;
|
bool HasPOV4Dir() const;
|
||||||
bool HasPOVCTS(void) const;
|
bool HasPOVCTS() const;
|
||||||
|
|
||||||
// Operations
|
// Operations
|
||||||
////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////
|
||||||
@@ -84,19 +83,11 @@ class WXDLLEXPORT wxJoystick: public wxObject, public wxThread
|
|||||||
// pollingFreq = 0 means that movement events are sent when above the threshold.
|
// pollingFreq = 0 means that movement events are sent when above the threshold.
|
||||||
// If pollingFreq > 0, events are received every this many milliseconds.
|
// If pollingFreq > 0, events are received every this many milliseconds.
|
||||||
bool SetCapture(wxWindow* win, int pollingFreq = 0);
|
bool SetCapture(wxWindow* win, int pollingFreq = 0);
|
||||||
bool ReleaseCapture(void);
|
bool ReleaseCapture();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int m_joystick;
|
int m_joystick;
|
||||||
wxPoint m_lastposition;
|
|
||||||
int m_axe[15];
|
|
||||||
int m_buttons;
|
|
||||||
wxWindow *m_catchwin;
|
|
||||||
int m_polling;
|
|
||||||
|
|
||||||
void *Entry(void);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
// __JOYSTICKH__
|
// _WX_JOYSTICK_H_
|
||||||
|
|
||||||
|
|||||||
@@ -1,78 +1,97 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: listbox.h
|
// Name: listbox.h
|
||||||
// Purpose:
|
// Purpose: wxListBox class
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_LISTBOX_H_
|
||||||
#ifndef __GTKLISTBOXH__
|
#define _WX_LISTBOX_H_
|
||||||
#define __GTKLISTBOXH__
|
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma interface
|
#pragma interface "listbox.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/defs.h"
|
|
||||||
#include "wx/object.h"
|
|
||||||
#include "wx/list.h"
|
|
||||||
#include "wx/control.h"
|
#include "wx/control.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
WXDLLEXPORT_DATA(extern const char*) wxListBoxNameStr;
|
||||||
// classes
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxListBox;
|
// forward decl for GetSelections()
|
||||||
|
class WXDLLEXPORT wxArrayInt;
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
WXDLLEXPORT_DATA(extern const char*) wxEmptyString;
|
||||||
// global data
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
extern const char *wxListBoxNameStr;
|
// List box item
|
||||||
|
class WXDLLEXPORT wxListBox: public wxControl
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// wxListBox
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxListBox: public wxControl
|
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxListBox)
|
DECLARE_DYNAMIC_CLASS(wxListBox)
|
||||||
|
public:
|
||||||
|
|
||||||
public:
|
wxListBox();
|
||||||
|
inline wxListBox(wxWindow *parent, wxWindowID id,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
int n = 0, const wxString choices[] = NULL,
|
||||||
|
long style = 0,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
|
const wxString& name = wxListBoxNameStr)
|
||||||
|
{
|
||||||
|
Create(parent, id, pos, size, n, choices, style, validator, name);
|
||||||
|
}
|
||||||
|
|
||||||
wxListBox(void);
|
bool Create(wxWindow *parent, wxWindowID id,
|
||||||
wxListBox( wxWindow *parent, wxWindowID id,
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
|
const wxSize& size = wxDefaultSize,
|
||||||
int n = 0, const wxString choices[] = NULL,
|
int n = 0, const wxString choices[] = NULL,
|
||||||
long style = 0, const wxString &name = wxListBoxNameStr );
|
long style = 0,
|
||||||
bool Create( wxWindow *parent, wxWindowID id,
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
|
const wxString& name = wxListBoxNameStr);
|
||||||
int n = 0, const wxString choices[] = NULL,
|
|
||||||
long style = 0, const wxString &name = wxListBoxNameStr );
|
|
||||||
void Append( const wxString &item );
|
|
||||||
void Append( const wxString &item, char *clientData );
|
|
||||||
void Clear(void);
|
|
||||||
void Delete( int n );
|
|
||||||
void Deselect( int n );
|
|
||||||
int FindString( const wxString &item ) const;
|
|
||||||
char *GetClientData( int n ) const;
|
|
||||||
int GetSelection(void) const;
|
|
||||||
int GetSelections( class wxArrayInt &) const;
|
|
||||||
wxString GetString( int n ) const;
|
|
||||||
wxString GetStringSelection(void) const;
|
|
||||||
int Number(void);
|
|
||||||
bool Selected( int n );
|
|
||||||
void Set( int n, const wxString *choices );
|
|
||||||
void SetClientData( int n, char *clientData );
|
|
||||||
void SetFirstItem( int n );
|
|
||||||
void SetFirstItem( const wxString &item );
|
|
||||||
void SetSelection( int n, bool select = TRUE );
|
|
||||||
void SetString( int n, const wxString &string );
|
|
||||||
void SetStringSelection( const wxString &string, bool select = TRUE );
|
|
||||||
|
|
||||||
|
~wxListBox();
|
||||||
|
|
||||||
|
virtual void Append(const wxString& item);
|
||||||
|
virtual void Append(const wxString& item, char *clientData);
|
||||||
|
virtual void Set(int n, const wxString* choices, char **clientData = NULL);
|
||||||
|
virtual int FindString(const wxString& s) const ;
|
||||||
|
virtual void Clear();
|
||||||
|
virtual void SetSelection(int n, bool select = TRUE);
|
||||||
|
|
||||||
|
virtual void Deselect(int n);
|
||||||
|
|
||||||
|
// For single choice list item only
|
||||||
|
virtual int GetSelection() const ;
|
||||||
|
virtual void Delete(int n);
|
||||||
|
virtual char *GetClientData(int n) const ;
|
||||||
|
virtual void SetClientData(int n, char *clientData);
|
||||||
|
virtual void SetString(int n, const wxString& s);
|
||||||
|
|
||||||
|
// For single or multiple choice list item
|
||||||
|
virtual int GetSelections(wxArrayInt& aSelections) const;
|
||||||
|
virtual bool Selected(int n) const ;
|
||||||
|
virtual wxString GetString(int n) const ;
|
||||||
|
virtual void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
|
||||||
|
|
||||||
|
// Set the specified item at the first visible item
|
||||||
|
// or scroll to max range.
|
||||||
|
virtual void SetFirstItem(int n) ;
|
||||||
|
virtual void SetFirstItem(const wxString& s) ;
|
||||||
|
|
||||||
|
virtual void InsertItems(int nItems, const wxString items[], int pos);
|
||||||
|
|
||||||
|
virtual wxString GetStringSelection() const ;
|
||||||
|
virtual bool SetStringSelection(const wxString& s, bool flag = TRUE);
|
||||||
|
virtual int Number() const ;
|
||||||
|
|
||||||
|
void Command(wxCommandEvent& event);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
int m_noItems;
|
||||||
|
int m_selected;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // __GTKLISTBOXH__
|
#endif
|
||||||
|
// _WX_LISTBOX_H_
|
||||||
|
|||||||
@@ -1,181 +1,160 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: mdi.h
|
// Name: mdi.h
|
||||||
// Purpose:
|
// Purpose: MDI (Multiple Document Interface) classes.
|
||||||
// Author: Robert Roebling
|
// This doesn't have to be implemented just like Windows,
|
||||||
// Created: 01/02/97
|
// it could be a tabbed design as in wxGTK.
|
||||||
// Id:
|
// Author: AUTHOR
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// Modified by:
|
||||||
|
// Created: ??/??/98
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_MDI_H_
|
||||||
#ifndef __MDIH__
|
#define _WX_MDI_H_
|
||||||
#define __MDIH__
|
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma interface
|
#pragma interface "mdi.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/defs.h"
|
|
||||||
#include "wx/object.h"
|
|
||||||
#include "wx/list.h"
|
|
||||||
#include "wx/control.h"
|
|
||||||
#include "wx/panel.h"
|
|
||||||
#include "wx/frame.h"
|
#include "wx/frame.h"
|
||||||
#include "wx/toolbar.h"
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
WXDLLEXPORT_DATA(extern const char*) wxFrameNameStr;
|
||||||
// classes
|
WXDLLEXPORT_DATA(extern const char*) wxStatusLineNameStr;
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxMDIParentFrame;
|
class WXDLLEXPORT wxMDIClientWindow;
|
||||||
class wxMDIClientWindow;
|
class WXDLLEXPORT wxMDIChildFrame;
|
||||||
class wxMDIChildFrame;
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
class WXDLLEXPORT wxMDIParentFrame: public wxFrame
|
||||||
// global data
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
extern const char* wxFrameNameStr;
|
|
||||||
extern const char* wxStatusLineNameStr;
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// wxMDIParentFrame
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxMDIParentFrame: public wxFrame
|
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxMDIParentFrame)
|
DECLARE_DYNAMIC_CLASS(wxMDIParentFrame)
|
||||||
|
|
||||||
friend class wxMDIChildFrame;
|
friend class WXDLLEXPORT wxMDIChildFrame;
|
||||||
|
public:
|
||||||
public:
|
|
||||||
|
|
||||||
wxMDIParentFrame(void);
|
wxMDIParentFrame();
|
||||||
wxMDIParentFrame( wxWindow *parent,
|
inline wxMDIParentFrame(wxWindow *parent,
|
||||||
wxWindowID id, const wxString& title,
|
wxWindowID id,
|
||||||
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
const wxString& title,
|
||||||
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
const wxString& name = wxFrameNameStr );
|
const wxSize& size = wxDefaultSize,
|
||||||
~wxMDIParentFrame(void);
|
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, // Scrolling refers to client window
|
||||||
bool Create( wxWindow *parent,
|
const wxString& name = wxFrameNameStr)
|
||||||
wxWindowID id, const wxString& title,
|
{
|
||||||
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
Create(parent, id, title, pos, size, style, name);
|
||||||
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
|
}
|
||||||
const wxString& name = wxFrameNameStr );
|
|
||||||
|
|
||||||
|
~wxMDIParentFrame();
|
||||||
|
|
||||||
void GetClientSize(int *width, int *height) const;
|
bool Create(wxWindow *parent,
|
||||||
wxMDIChildFrame *GetActiveChild(void) const;
|
wxWindowID id,
|
||||||
|
const wxString& title,
|
||||||
wxMDIClientWindow *GetClientWindow(void) const;
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
virtual wxMDIClientWindow *OnCreateClient(void);
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
|
||||||
virtual void Cascade(void) {};
|
const wxString& name = wxFrameNameStr);
|
||||||
virtual void Tile(void) {};
|
|
||||||
virtual void ArrangeIcons(void) {};
|
|
||||||
virtual void ActivateNext(void);
|
|
||||||
virtual void ActivatePrevious(void);
|
|
||||||
|
|
||||||
void OnActivate( wxActivateEvent& event );
|
void OnSize(wxSizeEvent& event);
|
||||||
void OnSysColourChanged( wxSysColourChangedEvent& event );
|
void OnActivate(wxActivateEvent& event);
|
||||||
|
|
||||||
//private:
|
|
||||||
|
|
||||||
wxMDIChildFrame *m_currentChild;
|
|
||||||
|
|
||||||
void SetMDIMenuBar( wxMenuBar *menu_bar );
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
wxMDIClientWindow *m_clientWindow;
|
|
||||||
bool m_parentFrameActive;
|
|
||||||
wxMenuBar *m_mdiMenuBar;
|
|
||||||
|
|
||||||
DECLARE_EVENT_TABLE()
|
void SetMenuBar(wxMenuBar *menu_bar);
|
||||||
|
|
||||||
|
// Gets the size available for subwindows after menu size, toolbar size
|
||||||
|
// and status bar size have been subtracted. If you want to manage your own
|
||||||
|
// toolbar(s), don't call SetToolBar.
|
||||||
|
void GetClientSize(int *width, int *height) const;
|
||||||
|
|
||||||
|
// Get the active MDI child window (Windows only)
|
||||||
|
wxMDIChildFrame *GetActiveChild() const ;
|
||||||
|
|
||||||
|
// Get the client window
|
||||||
|
inline wxMDIClientWindow *GetClientWindow() const { return m_clientWindow; };
|
||||||
|
|
||||||
|
// Create the client window class (don't Create the window,
|
||||||
|
// just return a new class)
|
||||||
|
virtual wxMDIClientWindow *OnCreateClient() ;
|
||||||
|
|
||||||
|
// MDI operations
|
||||||
|
virtual void Cascade();
|
||||||
|
virtual void Tile();
|
||||||
|
virtual void ArrangeIcons();
|
||||||
|
virtual void ActivateNext();
|
||||||
|
virtual void ActivatePrevious();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
class WXDLLEXPORT wxMDIChildFrame: public wxFrame
|
||||||
// wxMDIChildFrame
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxMDIChildFrame: public wxFrame
|
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxMDIChildFrame)
|
DECLARE_DYNAMIC_CLASS(wxMDIChildFrame)
|
||||||
|
public:
|
||||||
public:
|
|
||||||
|
|
||||||
wxMDIChildFrame(void);
|
wxMDIChildFrame();
|
||||||
wxMDIChildFrame( wxMDIParentFrame *parent,
|
inline wxMDIChildFrame(wxMDIParentFrame *parent,
|
||||||
wxWindowID id, const wxString& title,
|
wxWindowID id,
|
||||||
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
const wxString& title,
|
||||||
long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr );
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
~wxMDIChildFrame(void);
|
const wxSize& size = wxDefaultSize,
|
||||||
bool Create( wxMDIParentFrame *parent,
|
long style = wxDEFAULT_FRAME_STYLE,
|
||||||
wxWindowID id, const wxString& title,
|
const wxString& name = wxFrameNameStr)
|
||||||
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
{
|
||||||
long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr );
|
Create(parent, id, title, pos, size, style, name);
|
||||||
|
}
|
||||||
virtual void SetMenuBar( wxMenuBar *menu_bar );
|
|
||||||
virtual wxMenuBar *GetMenuBar();
|
|
||||||
|
|
||||||
virtual void GetClientSize( int *width, int *height ) const;
|
~wxMDIChildFrame();
|
||||||
virtual void AddChild( wxWindow *child );
|
|
||||||
|
|
||||||
virtual void Activate(void);
|
bool Create(wxMDIParentFrame *parent,
|
||||||
|
wxWindowID id,
|
||||||
// no status bars
|
const wxString& title,
|
||||||
virtual wxStatusBar* CreateStatusBar( int WXUNUSED(number), long WXUNUSED(style),
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
wxWindowID WXUNUSED(id), const wxString& WXUNUSED(name) ) {return (wxStatusBar*)NULL; }
|
const wxSize& size = wxDefaultSize,
|
||||||
virtual wxStatusBar *GetStatusBar() { return (wxStatusBar*)NULL; }
|
long style = wxDEFAULT_FRAME_STYLE,
|
||||||
virtual void SetStatusText( const wxString &WXUNUSED(text), int WXUNUSED(number) ) {}
|
const wxString& name = wxFrameNameStr);
|
||||||
virtual void SetStatusWidths( int WXUNUSED(n), int *WXUNUSED(width) ) {}
|
|
||||||
|
|
||||||
// no size hints
|
// Set menu bar
|
||||||
virtual void SetSizeHints( int WXUNUSED(minW), int WXUNUSED(minH), int WXUNUSED(maxW),
|
void SetMenuBar(wxMenuBar *menu_bar);
|
||||||
int WXUNUSED(maxH), int WXUNUSED(incW) ) {}
|
void SetClientSize(int width, int height);
|
||||||
|
void GetPosition(int *x, int *y) const ;
|
||||||
// no toolbar bars
|
|
||||||
virtual wxToolBar* CreateToolBar( long WXUNUSED(style), wxWindowID WXUNUSED(id),
|
// MDI operations
|
||||||
const wxString& WXUNUSED(name) ) { return (wxToolBar*)NULL; }
|
virtual void Maximize();
|
||||||
virtual wxToolBar *GetToolBar() { return (wxToolBar*)NULL; }
|
virtual void Restore();
|
||||||
|
virtual void Activate();
|
||||||
// no icon
|
|
||||||
void SetIcon( const wxIcon &icon ) { m_icon = icon; }
|
|
||||||
|
|
||||||
// no title
|
|
||||||
void SetTitle( const wxString &title ) { m_title = title; }
|
|
||||||
wxString GetTitle() const { return m_title; }
|
|
||||||
|
|
||||||
// no maximize etc
|
|
||||||
virtual void Maximize(void) {}
|
|
||||||
virtual void Restore(void) {}
|
|
||||||
|
|
||||||
void OnActivate( wxActivateEvent &event );
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
wxMenuBar *m_menuBar;
|
|
||||||
|
|
||||||
DECLARE_EVENT_TABLE()
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
/* The client window is a child of the parent MDI frame, and itself
|
||||||
// wxMDIClientWindow
|
* contains the child MDI frames.
|
||||||
//-----------------------------------------------------------------------------
|
* However, you create the MDI children as children of the MDI parent:
|
||||||
|
* only in the implementation does the client window become the parent
|
||||||
|
* of the children. Phew! So the children are sort of 'adopted'...
|
||||||
|
*/
|
||||||
|
|
||||||
class wxMDIClientWindow: public wxWindow
|
class WXDLLEXPORT wxMDIClientWindow: public wxWindow
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxMDIClientWindow)
|
DECLARE_DYNAMIC_CLASS(wxMDIClientWindow)
|
||||||
|
public:
|
||||||
public:
|
|
||||||
|
wxMDIClientWindow() ;
|
||||||
wxMDIClientWindow(void);
|
inline wxMDIClientWindow(wxMDIParentFrame *parent, long style = 0)
|
||||||
wxMDIClientWindow( wxMDIParentFrame *parent, long style = 0 );
|
{
|
||||||
~wxMDIClientWindow(void);
|
CreateClient(parent, style);
|
||||||
virtual bool CreateClient( wxMDIParentFrame *parent, long style = wxVSCROLL | wxHSCROLL );
|
}
|
||||||
void AddChild( wxWindow *child );
|
|
||||||
|
~wxMDIClientWindow();
|
||||||
|
|
||||||
|
// Note: this is virtual, to allow overridden behaviour.
|
||||||
|
virtual bool CreateClient(wxMDIParentFrame *parent, long style = wxVSCROLL | wxHSCROLL);
|
||||||
|
|
||||||
|
// Explicitly call default scroll behaviour
|
||||||
|
void OnScroll(wxScrollEvent& event);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // __MDIH__
|
#endif
|
||||||
|
// _WX_MDI_H_
|
||||||
|
|||||||
@@ -1,155 +1,157 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: menu.h
|
// Name: menu.h
|
||||||
// Purpose:
|
// Purpose: wxMenu, wxMenuBar classes
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
// Licence: wxWindows licence
|
// Copyright: (c) AUTHOR
|
||||||
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_MENU_H_
|
||||||
#ifndef __GTKMENUH__
|
#define _WX_MENU_H_
|
||||||
#define __GTKMENUH__
|
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma interface
|
#pragma interface "menu.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/defs.h"
|
#include "wx/defs.h"
|
||||||
#include "wx/object.h"
|
#include "wx/event.h"
|
||||||
#include "wx/list.h"
|
|
||||||
#include "wx/window.h"
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
class WXDLLEXPORT wxMenuItem;
|
||||||
// classes
|
class WXDLLEXPORT wxMenuBar;
|
||||||
//-----------------------------------------------------------------------------
|
class WXDLLEXPORT wxMenu;
|
||||||
|
|
||||||
class wxMenuBar;
|
WXDLLEXPORT_DATA(extern const char*) wxEmptyString;
|
||||||
class wxMenuItem;
|
|
||||||
class wxMenu;
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// const
|
// Menu
|
||||||
//-----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
class WXDLLEXPORT wxMenu: public wxEvtHandler
|
||||||
#define ID_SEPARATOR (-1)
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// wxMenuBar
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxMenuBar: public wxWindow
|
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxMenuBar)
|
DECLARE_DYNAMIC_CLASS(wxMenu)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
wxMenuBar();
|
// ctor & dtor
|
||||||
void Append( wxMenu *menu, const wxString &title );
|
wxMenu(const wxString& title = wxEmptyString, const wxFunction func = NULL);
|
||||||
|
~wxMenu();
|
||||||
|
|
||||||
int FindMenuItem( const wxString &menuString, const wxString &itemString ) const;
|
// construct menu
|
||||||
wxMenuItem* FindMenuItemById( int id ) const;
|
// append items to the menu
|
||||||
|
// separator line
|
||||||
void Check( int id, bool check );
|
|
||||||
bool Checked( int id ) const;
|
|
||||||
void Enable( int id, bool enable );
|
|
||||||
bool Enabled( int id ) const;
|
|
||||||
inline bool IsEnabled(int Id) const { return Enabled(Id); };
|
|
||||||
inline bool IsChecked(int Id) const { return Checked(Id); };
|
|
||||||
|
|
||||||
int GetMenuCount() const { return m_menus.Number(); }
|
|
||||||
wxMenu *GetMenu(int n) const { return (wxMenu *)m_menus.Nth(n)->Data(); }
|
|
||||||
|
|
||||||
wxList m_menus;
|
|
||||||
};
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// wxMenu
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxMenuItem: public wxObject
|
|
||||||
{
|
|
||||||
DECLARE_DYNAMIC_CLASS(wxMenuItem)
|
|
||||||
|
|
||||||
public:
|
|
||||||
wxMenuItem();
|
|
||||||
|
|
||||||
// accessors
|
|
||||||
// id
|
|
||||||
void SetId(int id) { m_id = id; }
|
|
||||||
int GetId() const { return m_id; }
|
|
||||||
bool IsSeparator() const { return m_id == ID_SEPARATOR; }
|
|
||||||
|
|
||||||
// the item's text
|
|
||||||
void SetText(const wxString& str);
|
|
||||||
const wxString& GetText() const { return m_text; }
|
|
||||||
|
|
||||||
// what kind of menu item we are
|
|
||||||
void SetCheckable(bool checkable) { m_isCheckMenu = checkable; }
|
|
||||||
bool IsCheckable() const { return m_isCheckMenu; }
|
|
||||||
void SetSubMenu(wxMenu *menu) { m_subMenu = menu; }
|
|
||||||
wxMenu *GetSubMenu() const { return m_subMenu; }
|
|
||||||
bool IsSubMenu() const { return m_subMenu != NULL; }
|
|
||||||
|
|
||||||
// state
|
|
||||||
void Enable(bool enable = TRUE) { m_isEnabled = enable; }
|
|
||||||
bool IsEnabled() const { return m_isEnabled; }
|
|
||||||
void Check(bool check = TRUE);
|
|
||||||
bool IsChecked() const;
|
|
||||||
|
|
||||||
// help string (displayed in the status bar by default)
|
|
||||||
void SetHelpString(const wxString& str) { m_helpStr = str; }
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
int m_id;
|
|
||||||
wxString m_text;
|
|
||||||
bool m_isCheckMenu;
|
|
||||||
bool m_isChecked;
|
|
||||||
bool m_isEnabled;
|
|
||||||
wxMenu *m_subMenu;
|
|
||||||
wxString m_helpStr;
|
|
||||||
};
|
|
||||||
|
|
||||||
class wxMenu: public wxEvtHandler
|
|
||||||
{
|
|
||||||
DECLARE_DYNAMIC_CLASS(wxMenu)
|
|
||||||
|
|
||||||
public:
|
|
||||||
// construction
|
|
||||||
wxMenu( const wxString &title = "" );
|
|
||||||
|
|
||||||
// operations
|
|
||||||
// menu creation
|
|
||||||
void AppendSeparator();
|
void AppendSeparator();
|
||||||
void Append(int id, const wxString &item,
|
// normal item
|
||||||
const wxString &helpStr = "", bool checkable = FALSE);
|
void Append(int id, const wxString& Label, const wxString& helpString = wxEmptyString,
|
||||||
void Append(int id, const wxString &item,
|
bool checkable = FALSE);
|
||||||
wxMenu *subMenu, const wxString &helpStr = "" );
|
// a submenu
|
||||||
void Break() {};
|
void Append(int id, const wxString& Label, wxMenu *SubMenu,
|
||||||
|
const wxString& helpString = wxEmptyString);
|
||||||
|
// the most generic form (create wxMenuItem first and use it's functions)
|
||||||
|
void Append(wxMenuItem *pItem);
|
||||||
|
// insert a break in the menu
|
||||||
|
void Break();
|
||||||
|
// delete an item
|
||||||
|
void Delete(int id);
|
||||||
|
|
||||||
// find item by name/id
|
// menu item control
|
||||||
int FindItem( const wxString itemString ) const;
|
void Enable(int id, bool Flag);
|
||||||
wxMenuItem *FindItem(int id) const;
|
bool Enabled(int id) const;
|
||||||
|
inline bool IsEnabled(int id) const { return Enabled(id); };
|
||||||
|
void Check(int id, bool Flag);
|
||||||
|
bool Checked(int id) const;
|
||||||
|
inline bool IsChecked(int id) const { return IsChecked(id); };
|
||||||
|
|
||||||
// get/set item's state
|
// item properties
|
||||||
void Enable( int id, bool enable );
|
// title
|
||||||
bool IsEnabled( int id ) const;
|
void SetTitle(const wxString& label);
|
||||||
void Check( int id, bool check );
|
const wxString& GetTitle() const;
|
||||||
bool IsChecked( int id ) const;
|
// label
|
||||||
|
void SetLabel(int id, const wxString& label);
|
||||||
|
wxString GetLabel(int id) const;
|
||||||
|
// help string
|
||||||
|
virtual void SetHelpString(int id, const wxString& helpString);
|
||||||
|
virtual wxString GetHelpString(int id) const ;
|
||||||
|
|
||||||
void SetLabel( int id, const wxString &label );
|
// find item
|
||||||
|
// Finds the item id matching the given string, -1 if not found.
|
||||||
|
virtual int FindItem(const wxString& itemString) const ;
|
||||||
|
// Find wxMenuItem by ID, and item's menu too if itemMenu is !NULL.
|
||||||
|
wxMenuItem *FindItemForId(int itemId, wxMenu **itemMenu = NULL) const;
|
||||||
|
|
||||||
// accessors
|
void ProcessCommand(wxCommandEvent& event);
|
||||||
wxList& GetItems() { return m_items; }
|
inline void Callback(const wxFunction func) { m_callback = func; }
|
||||||
|
|
||||||
|
virtual void SetParent(wxEvtHandler *parent) { m_parent = parent; }
|
||||||
|
inline void SetEventHandler(wxEvtHandler *handler) { m_eventHandler = handler; }
|
||||||
|
inline wxEvtHandler *GetEventHandler() { return m_eventHandler; }
|
||||||
|
|
||||||
|
inline wxList& GetItems() const { return (wxList&) m_menuItems; }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void SetInvokingWindow( wxWindow *win );
|
wxFunction m_callback;
|
||||||
wxWindow *GetInvokingWindow();
|
|
||||||
|
|
||||||
wxString m_title;
|
int m_noItems;
|
||||||
wxList m_items;
|
wxString m_title;
|
||||||
wxWindow *m_invokingWindow;
|
wxMenuBar * m_menuBar;
|
||||||
|
wxList m_menuItems;
|
||||||
|
wxEvtHandler * m_parent;
|
||||||
|
wxEvtHandler * m_eventHandler;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // __GTKMENUH__
|
// ----------------------------------------------------------------------------
|
||||||
|
// Menu Bar (a la Windows)
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
class WXDLLEXPORT wxFrame;
|
||||||
|
class WXDLLEXPORT wxMenuBar: public wxEvtHandler
|
||||||
|
{
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxMenuBar)
|
||||||
|
|
||||||
|
wxMenuBar();
|
||||||
|
wxMenuBar(int n, wxMenu *menus[], const wxString titles[]);
|
||||||
|
~wxMenuBar();
|
||||||
|
|
||||||
|
void Append(wxMenu *menu, const wxString& title);
|
||||||
|
// Must only be used AFTER menu has been attached to frame,
|
||||||
|
// otherwise use individual menus to enable/disable items
|
||||||
|
void Enable(int Id, bool Flag);
|
||||||
|
bool Enabled(int Id) const ;
|
||||||
|
inline bool IsEnabled(int Id) const { return Enabled(Id); };
|
||||||
|
void EnableTop(int pos, bool Flag);
|
||||||
|
void Check(int id, bool Flag);
|
||||||
|
bool Checked(int id) const ;
|
||||||
|
inline bool IsChecked(int Id) const { return Checked(Id); };
|
||||||
|
void SetLabel(int id, const wxString& label) ;
|
||||||
|
wxString GetLabel(int id) const ;
|
||||||
|
void SetLabelTop(int pos, const wxString& label) ;
|
||||||
|
wxString GetLabelTop(int pos) const ;
|
||||||
|
virtual void Delete(wxMenu *menu, int index = 0); /* Menu not destroyed */
|
||||||
|
virtual bool OnAppend(wxMenu *menu, const char *title);
|
||||||
|
virtual bool OnDelete(wxMenu *menu, int index);
|
||||||
|
|
||||||
|
virtual void SetHelpString(int Id, const wxString& helpString);
|
||||||
|
virtual wxString GetHelpString(int Id) const ;
|
||||||
|
|
||||||
|
virtual int FindMenuItem(const wxString& menuString, const wxString& itemString) const ;
|
||||||
|
|
||||||
|
// Find wxMenuItem for item ID, and return item's
|
||||||
|
// menu too if itemMenu is non-NULL.
|
||||||
|
wxMenuItem *FindItemForId(int itemId, wxMenu **menuForItem = NULL) const ;
|
||||||
|
|
||||||
|
inline void SetEventHandler(wxEvtHandler *handler) { m_eventHandler = handler; }
|
||||||
|
inline wxEvtHandler *GetEventHandler() { return m_eventHandler; }
|
||||||
|
|
||||||
|
inline int GetMenuCount() const { return m_menuCount; }
|
||||||
|
inline wxMenu* GetMenu(int i) const { return m_menus[i]; }
|
||||||
|
|
||||||
|
public:
|
||||||
|
wxEvtHandler * m_eventHandler;
|
||||||
|
int m_menuCount;
|
||||||
|
wxMenu ** m_menus;
|
||||||
|
wxString * m_titles;
|
||||||
|
wxFrame * m_menuBarFrame;
|
||||||
|
/* TODO: data that represents the actual menubar when created.
|
||||||
|
*/
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // _WX_MENU_H_
|
||||||
|
|||||||
@@ -1,41 +1,44 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: notebook.h
|
// Name: notebook.h
|
||||||
// Purpose: wxNotebook class
|
// Purpose: MSW/GTK compatible notebook (a.k.a. property sheet)
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Modified by:
|
// Modified by:
|
||||||
// RCS-ID: $Id$
|
// RCS-ID: $Id$
|
||||||
// Copyright: (c) Julian Smart and Markus Holzem
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows license
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifndef __NOTEBOOKH__
|
#ifndef _WX_NOTEBOOK_H_
|
||||||
#define __NOTEBOOKH__
|
#define _WX_NOTEBOOK_H_
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma interface "notebook.h"
|
#pragma interface "notebook.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/defs.h"
|
// ----------------------------------------------------------------------------
|
||||||
#include "wx/object.h"
|
// headers
|
||||||
#include "wx/string.h"
|
// ----------------------------------------------------------------------------
|
||||||
#include "wx/control.h"
|
#include <wx/dynarray.h>
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// classes
|
// types
|
||||||
//-----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
class wxImageList;
|
// fwd declarations
|
||||||
class wxNotebook;
|
class WXDLLEXPORT wxImageList;
|
||||||
class wxNotebookPage;
|
class WXDLLEXPORT wxWindow;
|
||||||
|
|
||||||
|
// array of notebook pages
|
||||||
|
typedef wxWindow wxNotebookPage; // so far, any window can be a page
|
||||||
|
WX_DEFINE_ARRAY(wxNotebookPage *, wxArrayPages);
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// notebook events
|
// notebook events
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
class WXDLLEXPORT wxNotebookEvent : public wxCommandEvent
|
||||||
class wxNotebookEvent : public wxCommandEvent
|
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxNotebookEvent(wxEventType commandType = wxEVT_NULL, int id = 0,
|
wxNotebookEvent(wxEventType commandType = wxEVT_NULL, int id = 0,
|
||||||
int nSel = -1, int nOldSel = -1)
|
int nSel = -1, int nOldSel = -1)
|
||||||
: wxCommandEvent(commandType, id) { m_nSel = nSel; m_nOldSel = nOldSel; }
|
: wxCommandEvent(commandType, id) { m_nSel = nSel; m_nOldSel = nOldSel; }
|
||||||
|
|
||||||
@@ -50,10 +53,13 @@ private:
|
|||||||
DECLARE_DYNAMIC_CLASS(wxNotebookEvent)
|
DECLARE_DYNAMIC_CLASS(wxNotebookEvent)
|
||||||
};
|
};
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// wxNotebook
|
// wxNotebook
|
||||||
//-----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// @@@ this class should really derive from wxTabCtrl, but the interface is not
|
||||||
|
// exactly the same, so I can't do it right now and instead we reimplement
|
||||||
|
// part of wxTabCtrl here
|
||||||
class wxNotebook : public wxControl
|
class wxNotebook : public wxControl
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -63,14 +69,14 @@ public:
|
|||||||
wxNotebook();
|
wxNotebook();
|
||||||
// the same arguments as for wxControl (@@@ any special styles?)
|
// the same arguments as for wxControl (@@@ any special styles?)
|
||||||
wxNotebook(wxWindow *parent,
|
wxNotebook(wxWindow *parent,
|
||||||
wxWindowID id,
|
wxWindowID id,
|
||||||
const wxPoint& pos = wxDefaultPosition,
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
const wxSize& size = wxDefaultSize,
|
const wxSize& size = wxDefaultSize,
|
||||||
long style = 0,
|
long style = 0,
|
||||||
const wxString& name = "notebook");
|
const wxString& name = "notebook");
|
||||||
// Create() function
|
// Create() function
|
||||||
bool Create(wxWindow *parent,
|
bool Create(wxWindow *parent,
|
||||||
wxWindowID id,
|
wxWindowID id,
|
||||||
const wxPoint& pos = wxDefaultPosition,
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
const wxSize& size = wxDefaultSize,
|
const wxSize& size = wxDefaultSize,
|
||||||
long style = 0,
|
long style = 0,
|
||||||
@@ -90,7 +96,7 @@ public:
|
|||||||
// cycle thru the tabs
|
// cycle thru the tabs
|
||||||
void AdvanceSelection(bool bForward = TRUE);
|
void AdvanceSelection(bool bForward = TRUE);
|
||||||
// get the currently selected page
|
// get the currently selected page
|
||||||
int GetSelection() const;
|
int GetSelection() const { return m_nSelection; }
|
||||||
|
|
||||||
// set/get the title of a page
|
// set/get the title of a page
|
||||||
bool SetPageText(int nPage, const wxString& strText);
|
bool SetPageText(int nPage, const wxString& strText);
|
||||||
@@ -104,7 +110,7 @@ public:
|
|||||||
// associate image list with a control
|
// associate image list with a control
|
||||||
void SetImageList(wxImageList* imageList);
|
void SetImageList(wxImageList* imageList);
|
||||||
// get pointer (may be NULL) to the associated image list
|
// get pointer (may be NULL) to the associated image list
|
||||||
wxImageList* GetImageList() const { return m_imageList; }
|
wxImageList* GetImageList() const { return m_pImageList; }
|
||||||
|
|
||||||
// sets/returns item's image index in the current image list
|
// sets/returns item's image index in the current image list
|
||||||
int GetPageImage(int nPage) const;
|
int GetPageImage(int nPage) const;
|
||||||
@@ -128,30 +134,46 @@ public:
|
|||||||
bool DeleteAllPages();
|
bool DeleteAllPages();
|
||||||
// adds a new page to the notebook (it will be deleted ny the notebook,
|
// adds a new page to the notebook (it will be deleted ny the notebook,
|
||||||
// don't delete it yourself). If bSelect, this page becomes active.
|
// don't delete it yourself). If bSelect, this page becomes active.
|
||||||
bool AddPage(wxWindow *pPage,
|
bool AddPage(wxNotebookPage *pPage,
|
||||||
const wxString& strText,
|
const wxString& strText,
|
||||||
bool bSelect = FALSE,
|
bool bSelect = FALSE,
|
||||||
int imageId = -1);
|
int imageId = -1);
|
||||||
// @@@@ VZ: I don't know how to implement InsertPage()
|
// the same as AddPage(), but adds it at the specified position
|
||||||
|
bool InsertPage(int nPage,
|
||||||
|
wxNotebookPage *pPage,
|
||||||
|
const wxString& strText,
|
||||||
|
bool bSelect = FALSE,
|
||||||
|
int imageId = -1);
|
||||||
// get the panel which represents the given page
|
// get the panel which represents the given page
|
||||||
wxWindow *GetPage(int nPage) const;
|
wxNotebookPage *GetPage(int nPage) { return m_aPages[nPage]; }
|
||||||
|
|
||||||
// implementation
|
// callbacks
|
||||||
// --------------
|
// ---------
|
||||||
// base class virtuals
|
void OnSize(wxSizeEvent& event);
|
||||||
virtual void AddChild(wxWindow *child);
|
void OnSelChange(wxNotebookEvent& event);
|
||||||
virtual void SetConstraintSizes(bool recurse);
|
void OnSetFocus(wxFocusEvent& event);
|
||||||
virtual bool DoPhase(int phase);
|
void OnNavigationKey(wxNavigationKeyEvent& event);
|
||||||
|
|
||||||
|
// base class virtuals
|
||||||
|
// -------------------
|
||||||
|
virtual void Command(wxCommandEvent& event);
|
||||||
|
virtual void SetConstraintSizes(bool recurse = TRUE);
|
||||||
|
virtual bool DoPhase(int nPhase);
|
||||||
|
|
||||||
private:
|
protected:
|
||||||
// common part of all ctors
|
// common part of all ctors
|
||||||
void Init();
|
void Init();
|
||||||
|
|
||||||
wxImageList* m_imageList;
|
// helper functions
|
||||||
wxList m_pages;
|
void ChangePage(int nOldSel, int nSel); // change pages
|
||||||
|
|
||||||
|
wxImageList *m_pImageList; // we can have an associated image list
|
||||||
|
wxArrayPages m_aPages; // array of pages
|
||||||
|
|
||||||
|
int m_nSelection; // the current selection (-1 if none)
|
||||||
|
|
||||||
DECLARE_DYNAMIC_CLASS(wxNotebook)
|
DECLARE_DYNAMIC_CLASS(wxNotebook)
|
||||||
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -177,5 +199,4 @@ typedef void (wxEvtHandler::*wxNotebookEventFunction)(wxNotebookEvent&);
|
|||||||
NULL \
|
NULL \
|
||||||
},
|
},
|
||||||
|
|
||||||
#endif
|
#endif // _WX_NOTEBOOK_H_
|
||||||
// __NOTEBOOKH__
|
|
||||||
|
|||||||
@@ -1,60 +1,66 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: palette.h
|
// Name: palette.h
|
||||||
// Purpose:
|
// Purpose: wxPalette class
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_PALETTE_H_
|
||||||
#ifndef __GTKPALETTEH__
|
#define _WX_PALETTE_H_
|
||||||
#define __GTKPALETTEH__
|
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma interface
|
#pragma interface "palette.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/defs.h"
|
|
||||||
#include "wx/object.h"
|
|
||||||
#include "wx/gdiobj.h"
|
#include "wx/gdiobj.h"
|
||||||
#include "wx/gdicmn.h"
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
class WXDLLEXPORT wxPalette;
|
||||||
// classes
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxPalette;
|
class WXDLLEXPORT wxPaletteRefData: public wxGDIRefData
|
||||||
|
{
|
||||||
|
friend class WXDLLEXPORT wxPalette;
|
||||||
|
public:
|
||||||
|
wxPaletteRefData();
|
||||||
|
~wxPaletteRefData();
|
||||||
|
/* TODO: implementation
|
||||||
|
protected:
|
||||||
|
WXHPALETTE m_hPalette;
|
||||||
|
*/
|
||||||
|
};
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
#define M_PALETTEDATA ((wxPaletteRefData *)m_refData)
|
||||||
// wxPalette
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxPalette: public wxGDIObject
|
class WXDLLEXPORT wxPalette: public wxGDIObject
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxPalette)
|
DECLARE_DYNAMIC_CLASS(wxPalette)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
wxPalette();
|
||||||
wxPalette(void);
|
inline wxPalette(const wxPalette& palette) { Ref(palette); }
|
||||||
wxPalette( int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue );
|
inline wxPalette(const wxPalette* palette) { UnRef(); if (palette) Ref(*palette); }
|
||||||
wxPalette( const wxPalette& palette );
|
|
||||||
wxPalette( const wxPalette* palette );
|
|
||||||
~wxPalette(void);
|
|
||||||
wxPalette& operator = ( const wxPalette& palette );
|
|
||||||
bool operator == ( const wxPalette& palette );
|
|
||||||
bool operator != ( const wxPalette& palette );
|
|
||||||
bool Ok(void) const;
|
|
||||||
|
|
||||||
bool Create( int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
|
|
||||||
int GetPixel( const unsigned char red, const unsigned char green, const unsigned char blue ) const;
|
|
||||||
bool GetRGB( int pixel, unsigned char *red, unsigned char *green, unsigned char *blue ) const;
|
|
||||||
|
|
||||||
// no data
|
wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
|
||||||
|
~wxPalette();
|
||||||
|
bool Create(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
|
||||||
|
int GetPixel(const unsigned char red, const unsigned char green, const unsigned char blue) const;
|
||||||
|
bool GetRGB(int pixel, unsigned char *red, unsigned char *green, unsigned char *blue) const;
|
||||||
|
|
||||||
|
virtual bool Ok() const { return (m_refData != NULL) ; }
|
||||||
|
|
||||||
|
inline wxPalette& operator = (const wxPalette& palette) { if (*this == palette) return (*this); Ref(palette); return *this; }
|
||||||
|
inline bool operator == (const wxPalette& palette) { return m_refData == palette.m_refData; }
|
||||||
|
inline bool operator != (const wxPalette& palette) { return m_refData != palette.m_refData; }
|
||||||
|
|
||||||
|
virtual bool FreeResource(bool force = FALSE);
|
||||||
|
/* TODO: implementation
|
||||||
|
inline WXHPALETTE GetHPALETTE() const { return (M_PALETTEDATA ? M_PALETTEDATA->m_hPalette : 0); }
|
||||||
|
void SetHPALETTE(WXHPALETTE pal);
|
||||||
|
*/
|
||||||
};
|
};
|
||||||
|
|
||||||
#define wxColorMap wxPalette
|
#endif
|
||||||
#define wxColourMap wxPalette
|
// _WX_PALETTE_H_
|
||||||
|
|
||||||
#endif // __GTKPALETTEH__
|
|
||||||
|
|||||||
@@ -1,68 +1,102 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: pen.h
|
// Name: pen.h
|
||||||
// Purpose:
|
// Purpose: wxPen class
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_PEN_H_
|
||||||
#ifndef __GTKPENH__
|
#define _WX_PEN_H_
|
||||||
#define __GTKPENH__
|
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma interface
|
#pragma interface "pen.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/defs.h"
|
|
||||||
#include "wx/object.h"
|
|
||||||
#include "wx/string.h"
|
|
||||||
#include "wx/gdiobj.h"
|
#include "wx/gdiobj.h"
|
||||||
#include "wx/gdicmn.h"
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
typedef WXDWORD wxDash ;
|
||||||
// classes
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxPen;
|
class WXDLLEXPORT wxPen;
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
class WXDLLEXPORT wxPenRefData: public wxGDIRefData
|
||||||
// wxPen
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxPen: public wxGDIObject
|
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxPen)
|
friend class WXDLLEXPORT wxPen;
|
||||||
|
public:
|
||||||
|
wxPenRefData();
|
||||||
|
wxPenRefData(const wxPenRefData& data);
|
||||||
|
~wxPenRefData();
|
||||||
|
|
||||||
public:
|
protected:
|
||||||
|
int m_width;
|
||||||
wxPen(void);
|
int m_style;
|
||||||
wxPen( const wxColour &colour, int width, int style );
|
int m_join ;
|
||||||
wxPen( const wxString &colourName, int width, int style );
|
int m_cap ;
|
||||||
wxPen( const wxPen& pen );
|
wxBitmap m_stipple ;
|
||||||
wxPen( const wxPen* pen );
|
int m_nbDash ;
|
||||||
~wxPen(void);
|
wxDash * m_dash ;
|
||||||
wxPen& operator = ( const wxPen& pen );
|
wxColour m_colour;
|
||||||
bool operator == ( const wxPen& pen );
|
/* TODO: implementation
|
||||||
bool operator != ( const wxPen& pen );
|
WXHPEN m_hPen;
|
||||||
|
*/
|
||||||
void SetColour( const wxColour &colour );
|
|
||||||
void SetColour( const wxString &colourName );
|
|
||||||
void SetColour( int red, int green, int blue );
|
|
||||||
void SetCap( int capStyle );
|
|
||||||
void SetJoin( int joinStyle );
|
|
||||||
void SetStyle( int style );
|
|
||||||
void SetWidth( int width );
|
|
||||||
wxColour &GetColour(void) const;
|
|
||||||
int GetCap(void) const;
|
|
||||||
int GetJoin(void) const;
|
|
||||||
int GetStyle(void) const;
|
|
||||||
int GetWidth(void) const;
|
|
||||||
bool Ok(void) const;
|
|
||||||
|
|
||||||
// no data :-)
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // __GTKPENH__
|
#define M_PENDATA ((wxPenRefData *)m_refData)
|
||||||
|
|
||||||
|
// Pen
|
||||||
|
class WXDLLEXPORT wxPen: public wxGDIObject
|
||||||
|
{
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxPen)
|
||||||
|
public:
|
||||||
|
wxPen();
|
||||||
|
wxPen(const wxColour& col, int width, int style);
|
||||||
|
wxPen(const wxString& col, int width, int style);
|
||||||
|
wxPen(const wxBitmap& stipple, int width);
|
||||||
|
inline wxPen(const wxPen& pen) { Ref(pen); }
|
||||||
|
inline wxPen(const wxPen* pen) { if (pen) Ref(*pen); }
|
||||||
|
~wxPen();
|
||||||
|
|
||||||
|
inline wxPen& operator = (const wxPen& pen) { if (*this == pen) return (*this); Ref(pen); return *this; }
|
||||||
|
inline bool operator == (const wxPen& pen) { return m_refData == pen.m_refData; }
|
||||||
|
inline bool operator != (const wxPen& pen) { return m_refData != pen.m_refData; }
|
||||||
|
|
||||||
|
virtual bool Ok() const { return (m_refData != NULL) ; }
|
||||||
|
|
||||||
|
// Override in order to recreate the pen
|
||||||
|
void SetColour(const wxColour& col) ;
|
||||||
|
void SetColour(const wxString& col) ;
|
||||||
|
void SetColour(const unsigned char r, const unsigned char g, const unsigned char b) ;
|
||||||
|
|
||||||
|
void SetWidth(int width) ;
|
||||||
|
void SetStyle(int style) ;
|
||||||
|
void SetStipple(const wxBitmap& stipple) ;
|
||||||
|
void SetDashes(int nb_dashes, const wxDash *dash) ;
|
||||||
|
void SetJoin(int join) ;
|
||||||
|
void SetCap(int cap) ;
|
||||||
|
|
||||||
|
inline wxColour& GetColour() const { return (M_PENDATA ? M_PENDATA->m_colour : wxNullColour); };
|
||||||
|
inline int GetWidth() const { return (M_PENDATA ? M_PENDATA->m_width : 0); };
|
||||||
|
inline int GetStyle() const { return (M_PENDATA ? M_PENDATA->m_style : 0); };
|
||||||
|
inline int GetJoin() const { return (M_PENDATA ? M_PENDATA->m_join : 0); };
|
||||||
|
inline int GetCap() const { return (M_PENDATA ? M_PENDATA->m_cap : 0); };
|
||||||
|
inline int GetDashes(wxDash **ptr) const {
|
||||||
|
*ptr = (M_PENDATA ? M_PENDATA->m_dash : NULL); return (M_PENDATA ? M_PENDATA->m_nbDash : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
inline wxBitmap *GetStipple() const { return (M_PENDATA ? (& M_PENDATA->m_stipple) : NULL); };
|
||||||
|
|
||||||
|
// Implementation
|
||||||
|
|
||||||
|
// Useful helper: create the brush resource
|
||||||
|
void RealizeResource();
|
||||||
|
|
||||||
|
// When setting properties, we must make sure we're not changing
|
||||||
|
// another object
|
||||||
|
void Unshare();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
// _WX_PEN_H_
|
||||||
|
|||||||
@@ -1,80 +1,88 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: radiobox.h
|
// Name: radiobox.h
|
||||||
// Purpose:
|
// Purpose: wxRadioBox class
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_RADIOBOX_H_
|
||||||
#ifndef __GTKRADIOBOXH__
|
#define _WX_RADIOBOX_H_
|
||||||
#define __GTKRADIOBOXH__
|
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma interface
|
#pragma interface "radiobox.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/defs.h"
|
|
||||||
#include "wx/object.h"
|
|
||||||
#include "wx/list.h"
|
|
||||||
#include "wx/control.h"
|
#include "wx/control.h"
|
||||||
#include "wx/bitmap.h"
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
WXDLLEXPORT_DATA(extern const char*) wxRadioBoxNameStr;
|
||||||
// classes
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxRadioBox;
|
// List box item
|
||||||
|
class WXDLLEXPORT wxBitmap ;
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
class WXDLLEXPORT wxRadioBox: public wxControl
|
||||||
// global data
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
extern const char *wxRadioBoxNameStr;
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// wxRadioBox
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxRadioBox: public wxControl
|
|
||||||
{
|
{
|
||||||
|
|
||||||
DECLARE_DYNAMIC_CLASS(wxRadioBox)
|
DECLARE_DYNAMIC_CLASS(wxRadioBox)
|
||||||
|
public:
|
||||||
|
wxRadioBox();
|
||||||
|
|
||||||
|
inline wxRadioBox(wxWindow *parent, wxWindowID id, const wxString& title,
|
||||||
|
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||||
|
int n = 0, const wxString choices[] = NULL,
|
||||||
|
int majorDim = 0, long style = wxRA_HORIZONTAL,
|
||||||
|
const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr)
|
||||||
|
{
|
||||||
|
Create(parent, id, title, pos, size, n, choices, majorDim, style, val, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
~wxRadioBox();
|
||||||
|
|
||||||
|
bool Create(wxWindow *parent, wxWindowID id, const wxString& title,
|
||||||
|
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||||
|
int n = 0, const wxString choices[] = NULL,
|
||||||
|
int majorDim = 0, long style = wxRA_HORIZONTAL,
|
||||||
|
const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr);
|
||||||
|
|
||||||
|
int FindString(const wxString& s) const;
|
||||||
|
void SetSelection(int N);
|
||||||
|
int GetSelection() const;
|
||||||
|
wxString GetString(int N) const;
|
||||||
|
void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
|
||||||
|
void GetSize(int *x, int *y) const;
|
||||||
|
void GetPosition(int *x, int *y) const;
|
||||||
|
wxString GetLabel() const;
|
||||||
|
void SetLabel(const wxString& label);
|
||||||
|
void SetLabel(int item, const wxString& label) ;
|
||||||
|
wxString GetLabel(int item) const;
|
||||||
|
bool Show(bool show);
|
||||||
|
void SetFocus();
|
||||||
|
void Enable(bool enable);
|
||||||
|
void Enable(int item, bool enable);
|
||||||
|
void Show(int item, bool show) ;
|
||||||
|
inline void SetLabelFont(const wxFont& WXUNUSED(font)) {};
|
||||||
|
inline void SetButtonFont(const wxFont& font) { SetFont(font); }
|
||||||
|
|
||||||
|
virtual wxString GetStringSelection() const;
|
||||||
|
virtual bool SetStringSelection(const wxString& s);
|
||||||
|
inline virtual int Number() const { return m_noItems; } ;
|
||||||
|
void Command(wxCommandEvent& event);
|
||||||
|
|
||||||
public:
|
inline int GetNumberOfRowsOrCols() const { return m_noRowsOrCols; }
|
||||||
|
inline void SetNumberOfRowsOrCols(int n) { m_noRowsOrCols = n; }
|
||||||
wxRadioBox(void);
|
|
||||||
wxRadioBox( wxWindow *parent, wxWindowID id, const wxString& title,
|
protected:
|
||||||
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
|
/* TODO: implementation
|
||||||
int n = 0, const wxString choices[] = NULL,
|
WXHWND * m_radioButtons;
|
||||||
int majorDim = 0, long style = wxRA_HORIZONTAL,
|
*/
|
||||||
const wxString &name = wxRadioBoxNameStr );
|
int m_majorDim ;
|
||||||
bool Create( wxWindow *parent, wxWindowID id, const wxString& title,
|
int m_noItems;
|
||||||
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
|
int m_noRowsOrCols;
|
||||||
int n = 0, const wxString choices[] = NULL,
|
int m_selectedButton;
|
||||||
int majorDim = 0, long style = wxRA_HORIZONTAL,
|
|
||||||
const wxString &name = wxRadioBoxNameStr );
|
|
||||||
int FindString( const wxString& s) const;
|
|
||||||
void SetSelection( int n );
|
|
||||||
int GetSelection(void) const;
|
|
||||||
wxString GetString( int n ) const;
|
|
||||||
wxString GetLabel(void) const;
|
|
||||||
void SetLabel( const wxString& label );
|
|
||||||
void SetLabel( int item, const wxString& label );
|
|
||||||
void SetLabel( int item, wxBitmap *bitmap );
|
|
||||||
wxString GetLabel( int item ) const;
|
|
||||||
bool Show( bool show );
|
|
||||||
void Enable( bool enable );
|
|
||||||
void Enable( int item, bool enable );
|
|
||||||
void Show( int item, bool show );
|
|
||||||
virtual wxString GetStringSelection(void) const;
|
|
||||||
virtual bool SetStringSelection( const wxString& s );
|
|
||||||
virtual int Number(void) const;
|
|
||||||
int GetNumberOfRowsOrCols(void) const;
|
|
||||||
void SetNumberOfRowsOrCols( int n );
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // __GTKRADIOBOXH__
|
#endif
|
||||||
|
// _WX_RADIOBOX_H_
|
||||||
|
|||||||
@@ -1,31 +1,92 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: radiobut.h
|
// Name: radiobut.h
|
||||||
// Purpose:
|
// Purpose: wxRadioButton class
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
|
// Modified by:
|
||||||
// Created: 01/02/97
|
// Created: 01/02/97
|
||||||
// Id:
|
// RCS-ID: $Id$
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_RADIOBUT_H_
|
||||||
#ifndef __GTKRADIOBUTTONH__
|
#define _WX_RADIOBUT_H_
|
||||||
#define __GTKRADIOBUTTONH__
|
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma interface
|
#pragma interface "radiobut.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/defs.h"
|
|
||||||
#include "wx/object.h"
|
|
||||||
#include "wx/list.h"
|
|
||||||
#include "wx/control.h"
|
#include "wx/control.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
WXDLLEXPORT_DATA(extern const char*) wxRadioButtonNameStr;
|
||||||
// classes
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxRadioButton;
|
class WXDLLEXPORT wxRadioButton: public wxControl
|
||||||
|
{
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxRadioButton)
|
||||||
|
protected:
|
||||||
|
public:
|
||||||
|
inline wxRadioButton() {}
|
||||||
|
inline 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 = wxRadioButtonNameStr)
|
||||||
|
{
|
||||||
|
Create(parent, id, label, pos, size, style, validator, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
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 = wxRadioButtonNameStr);
|
||||||
|
|
||||||
#endif // __GTKRADIOBUTTONH__
|
virtual void SetLabel(const wxString& label);
|
||||||
|
virtual void SetValue(bool val);
|
||||||
|
virtual bool GetValue() const ;
|
||||||
|
|
||||||
|
void Command(wxCommandEvent& event);
|
||||||
|
virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
|
||||||
|
WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Not implemented
|
||||||
|
#if 0
|
||||||
|
class WXDLLEXPORT wxBitmap ;
|
||||||
|
|
||||||
|
WXDLLEXPORT_DATA(extern const char*) wxBitmapRadioButtonNameStr;
|
||||||
|
|
||||||
|
class WXDLLEXPORT wxBitmapRadioButton: public wxRadioButton
|
||||||
|
{
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxBitmapRadioButton)
|
||||||
|
protected:
|
||||||
|
wxBitmap *theButtonBitmap;
|
||||||
|
public:
|
||||||
|
inline wxBitmapRadioButton() { theButtonBitmap = NULL; }
|
||||||
|
inline 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_
|
||||||
|
|||||||
@@ -1,37 +1,29 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: region.h
|
// Name: region.h
|
||||||
// Purpose:
|
// Purpose: wxRegion class
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifndef __REGIONH__
|
#ifndef _WX_REGION_H_
|
||||||
#define __REGIONH__
|
#define _WX_REGION_H_
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma interface
|
#pragma interface "region.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/list.h"
|
#include "wx/list.h"
|
||||||
#include "wx/gdiobj.h"
|
#include "wx/gdiobj.h"
|
||||||
#include "wx/gdicmn.h"
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
class WXDLLEXPORT wxRect;
|
||||||
// classes
|
class WXDLLEXPORT wxPoint;
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxRegion;
|
enum wxRegionContain {
|
||||||
|
wxOutRegion = 0, wxPartRegion = 1, wxInRegion = 2
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// constants
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
enum wxRegionContain
|
|
||||||
{
|
|
||||||
wxOutRegion = 0, wxPartRegion = 1, wxInRegion = 2
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// So far, for internal use only
|
// So far, for internal use only
|
||||||
@@ -43,54 +35,106 @@ wxRGN_OR, // Creates the union of two combined regions.
|
|||||||
wxRGN_XOR // Creates the union of two combined regions except for any overlapping areas.
|
wxRGN_XOR // Creates the union of two combined regions except for any overlapping areas.
|
||||||
};
|
};
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
class WXDLLEXPORT wxRegion : public wxGDIObject {
|
||||||
// wxRegion
|
DECLARE_DYNAMIC_CLASS(wxRegion);
|
||||||
//-----------------------------------------------------------------------------
|
friend class WXDLLEXPORT wxRegionIterator;
|
||||||
|
public:
|
||||||
|
wxRegion(long x, long y, long w, long h);
|
||||||
|
wxRegion(const wxPoint& topLeft, const wxPoint& bottomRight);
|
||||||
|
wxRegion(const wxRect& rect);
|
||||||
|
|
||||||
class wxRegion : public wxGDIObject
|
/* TODO: implementation
|
||||||
{
|
wxRegion(WXHRGN hRegion); // Hangs on to this region
|
||||||
DECLARE_DYNAMIC_CLASS(wxRegion);
|
*/
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
wxRegion( long x, long y, long w, long h );
|
|
||||||
wxRegion( const wxPoint& topLeft, const wxPoint& bottomRight );
|
|
||||||
wxRegion( const wxRect& rect );
|
|
||||||
wxRegion(void);
|
|
||||||
~wxRegion(void);
|
|
||||||
|
|
||||||
inline wxRegion( const wxRegion& r )
|
wxRegion();
|
||||||
{ Ref(r); }
|
~wxRegion();
|
||||||
inline wxRegion& operator = ( const wxRegion& r )
|
|
||||||
{ Ref(r); return (*this); }
|
|
||||||
|
|
||||||
void Clear(void);
|
//# Copying
|
||||||
|
inline wxRegion(const wxRegion& r)
|
||||||
|
{ Ref(r); }
|
||||||
|
inline wxRegion& operator = (const wxRegion& r)
|
||||||
|
{ Ref(r); return (*this); }
|
||||||
|
|
||||||
bool Union( long x, long y, long width, long height );
|
//# Modify region
|
||||||
bool Union( const wxRect& rect );
|
// Clear current region
|
||||||
bool Union( const wxRegion& region );
|
void Clear();
|
||||||
|
|
||||||
bool Intersect( long x, long y, long width, long height );
|
// Union rectangle or region with this.
|
||||||
bool Intersect( const wxRect& rect );
|
inline bool Union(long x, long y, long width, long height) { return Combine(x, y, width, height, wxRGN_OR); }
|
||||||
bool Intersect( const wxRegion& region );
|
inline bool Union(const wxRect& rect) { return Combine(rect, wxRGN_OR); }
|
||||||
|
inline bool Union(const wxRegion& region) { return Combine(region, wxRGN_OR); }
|
||||||
|
|
||||||
bool Subtract( long x, long y, long width, long height );
|
// Intersect rectangle or region with this.
|
||||||
bool Subtract( const wxRect& rect );
|
inline bool Intersect(long x, long y, long width, long height) { return Combine(x, y, width, height, wxRGN_AND); }
|
||||||
bool Subtract( const wxRegion& region );
|
inline bool Intersect(const wxRect& rect) { return Combine(rect, wxRGN_AND); }
|
||||||
|
inline bool Intersect(const wxRegion& region) { return Combine(region, wxRGN_AND); }
|
||||||
|
|
||||||
bool Xor( long x, long y, long width, long height );
|
// Subtract rectangle or region from this:
|
||||||
bool Xor( const wxRect& rect );
|
// Combines the parts of 'this' that are not part of the second region.
|
||||||
bool Xor( const wxRegion& region );
|
inline bool Subtract(long x, long y, long width, long height) { return Combine(x, y, width, height, wxRGN_DIFF); }
|
||||||
|
inline bool Subtract(const wxRect& rect) { return Combine(rect, wxRGN_DIFF); }
|
||||||
|
inline bool Subtract(const wxRegion& region) { return Combine(region, wxRGN_DIFF); }
|
||||||
|
|
||||||
void GetBox( long& x, long& y, long&w, long &h ) const;
|
// XOR: the union of two combined regions except for any overlapping areas.
|
||||||
wxRect GetBox(void) const ;
|
inline bool Xor(long x, long y, long width, long height) { return Combine(x, y, width, height, wxRGN_XOR); }
|
||||||
|
inline bool Xor(const wxRect& rect) { return Combine(rect, wxRGN_XOR); }
|
||||||
|
inline bool Xor(const wxRegion& region) { return Combine(region, wxRGN_XOR); }
|
||||||
|
|
||||||
bool Empty(void) const;
|
//# Information on region
|
||||||
|
// Outer bounds of region
|
||||||
|
void GetBox(long& x, long& y, long&w, long &h) const;
|
||||||
|
wxRect GetBox() const ;
|
||||||
|
|
||||||
wxRegionContain Contains( long x, long y ) const;
|
// Is region empty?
|
||||||
wxRegionContain Contains( long x, long y, long w, long h ) const;
|
bool Empty() const;
|
||||||
|
inline bool IsEmpty() const { return Empty(); }
|
||||||
|
|
||||||
|
//# Tests
|
||||||
|
// Does the region contain the point (x,y)?
|
||||||
|
wxRegionContain Contains(long x, long y) const;
|
||||||
|
// Does the region contain the point pt?
|
||||||
|
wxRegionContain Contains(const wxPoint& pt) const;
|
||||||
|
// Does the region contain the rectangle (x, y, w, h)?
|
||||||
|
wxRegionContain Contains(long x, long y, long w, long h) const;
|
||||||
|
// Does the region contain the rectangle rect?
|
||||||
|
wxRegionContain Contains(const wxRect& rect) const;
|
||||||
|
|
||||||
|
// Internal
|
||||||
|
bool Combine(long x, long y, long width, long height, wxRegionOp op);
|
||||||
|
bool Combine(const wxRegion& region, wxRegionOp op);
|
||||||
|
bool Combine(const wxRect& rect, wxRegionOp op);
|
||||||
|
};
|
||||||
|
|
||||||
|
class WXDLLEXPORT wxRegionIterator : public wxObject {
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxRegionIterator);
|
||||||
|
public:
|
||||||
|
wxRegionIterator();
|
||||||
|
wxRegionIterator(const wxRegion& region);
|
||||||
|
~wxRegionIterator();
|
||||||
|
|
||||||
|
void Reset() { m_current = 0; }
|
||||||
|
void Reset(const wxRegion& region);
|
||||||
|
|
||||||
|
operator bool () const { return m_current < m_numRects; }
|
||||||
|
bool HaveRects() const { return m_current < m_numRects; }
|
||||||
|
|
||||||
|
void operator ++ ();
|
||||||
|
void operator ++ (int);
|
||||||
|
|
||||||
|
long GetX() const;
|
||||||
|
long GetY() const;
|
||||||
|
long GetW() const;
|
||||||
|
long GetWidth() const { return GetW(); }
|
||||||
|
long GetH() const;
|
||||||
|
long GetHeight() const { return GetH(); }
|
||||||
|
|
||||||
|
private:
|
||||||
|
long m_current;
|
||||||
|
long m_numRects;
|
||||||
|
wxRegion m_region;
|
||||||
|
wxRect* m_rects;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
// __REGIONH__
|
// _WX_REGION_H_
|
||||||
|
|||||||
@@ -1,78 +1,68 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: scrolbar.h
|
// Name: scrollbar.h
|
||||||
// Purpose:
|
// Purpose: wxScrollBar class
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_SCROLBAR_H_
|
||||||
#ifndef __GTKSCROLLBARH__
|
#define _WX_SCROLBAR_H_
|
||||||
#define __GTKSCROLLBARH__
|
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma interface
|
#pragma interface "scrolbar.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/defs.h"
|
|
||||||
#include "wx/object.h"
|
|
||||||
#include "wx/control.h"
|
#include "wx/control.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
WXDLLEXPORT_DATA(extern const char*) wxScrollBarNameStr;
|
||||||
// classes
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxScrollBar;
|
// Scrollbar item
|
||||||
|
class WXDLLEXPORT wxScrollBar: public wxControl
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// global data
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
extern const char *wxScrollBarNameStr;
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// wxScrollBar
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxScrollBar: public wxControl
|
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxScrollBar)
|
DECLARE_DYNAMIC_CLASS(wxScrollBar)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
inline wxScrollBar() { m_pageSize = 0; m_viewSize = 0; m_objectSize = 0; }
|
||||||
wxScrollBar(void) { };
|
~wxScrollBar();
|
||||||
wxScrollBar(wxWindow *parent, wxWindowID id,
|
|
||||||
|
inline wxScrollBar(wxWindow *parent, wxWindowID id,
|
||||||
const wxPoint& pos = wxDefaultPosition,
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
const wxSize& size = wxDefaultSize,
|
const wxSize& size = wxDefaultSize,
|
||||||
long style = wxSB_HORIZONTAL,
|
long style = wxSB_HORIZONTAL,
|
||||||
const wxString& name = wxScrollBarNameStr );
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
~wxScrollBar(void);
|
const wxString& name = wxScrollBarNameStr)
|
||||||
bool Create(wxWindow *parent, wxWindowID id,
|
{
|
||||||
|
Create(parent, id, pos, size, style, validator, name);
|
||||||
|
}
|
||||||
|
bool Create(wxWindow *parent, wxWindowID id,
|
||||||
const wxPoint& pos = wxDefaultPosition,
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
const wxSize& size = wxDefaultSize,
|
const wxSize& size = wxDefaultSize,
|
||||||
long style = wxSB_HORIZONTAL,
|
long style = wxSB_HORIZONTAL,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
const wxString& name = wxScrollBarNameStr);
|
const wxString& name = wxScrollBarNameStr);
|
||||||
int GetPosition(void) const;
|
|
||||||
int GetThumbSize() const;
|
|
||||||
int GetPageSize() const;
|
|
||||||
int GetRange() const;
|
|
||||||
virtual void SetPosition( int viewStart );
|
|
||||||
virtual void SetScrollbar( int position, int thumbSize, int range, int pageSize,
|
|
||||||
bool refresh = TRUE );
|
|
||||||
|
|
||||||
// Backward compatibility
|
int GetPosition() const ;
|
||||||
int GetValue(void) const;
|
inline int GetThumbSize() const { return m_pageSize; }
|
||||||
void SetValue( int viewStart );
|
inline int GetPageSize() const { return m_viewSize; }
|
||||||
void GetValues( int *viewStart, int *viewLength, int *objectLength, int *pageLength) const;
|
inline int GetRange() const { return m_objectSize; }
|
||||||
int GetViewLength() const;
|
|
||||||
int GetObjectLength() const;
|
|
||||||
void SetPageSize( int pageLength );
|
|
||||||
void SetObjectLength( int objectLength );
|
|
||||||
void SetViewLength( int viewLength );
|
|
||||||
|
|
||||||
|
virtual void SetPosition(int viewStart);
|
||||||
|
virtual void SetScrollbar(int position, int thumbSize, int range, int pageSize,
|
||||||
|
bool refresh = TRUE);
|
||||||
|
|
||||||
|
void Command(wxCommandEvent& event);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
int m_pageSize;
|
||||||
|
int m_viewSize;
|
||||||
|
int m_objectSize;
|
||||||
|
|
||||||
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
// __GTKSCROLLBARH__
|
// _WX_SCROLBAR_H_
|
||||||
|
|||||||
@@ -1,30 +1,119 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: settings.h
|
// Name: settings.h
|
||||||
// Purpose:
|
// Purpose: wxSystemSettings class
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_SETTINGS_H_
|
||||||
#ifndef __GTKSETTINGSH__
|
#define _WX_SETTINGS_H_
|
||||||
#define __GTKSETTINGSH__
|
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma interface
|
#pragma interface "settings.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/defs.h"
|
#include "wx/setup.h"
|
||||||
#include "wx/gdicmn.h"
|
|
||||||
#include "wx/pen.h"
|
#define wxSYS_WHITE_BRUSH 0
|
||||||
#include "wx/font.h"
|
#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 // Obsolete
|
||||||
|
#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_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
|
||||||
|
|
||||||
class WXDLLEXPORT wxSystemSettings: public wxObject
|
class WXDLLEXPORT wxSystemSettings: public wxObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
inline wxSystemSettings(void) {}
|
inline wxSystemSettings() {}
|
||||||
|
|
||||||
// Get a system colour
|
// Get a system colour
|
||||||
static wxColour GetSystemColour(int index);
|
static wxColour GetSystemColour(int index);
|
||||||
@@ -37,4 +126,4 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
// __GTKSETTINGSH__
|
// _WX_SETTINGS_H_
|
||||||
|
|||||||
@@ -1,86 +1,91 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: slider.h
|
// Name: slider.h
|
||||||
// Purpose:
|
// Purpose: wxSlider class
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_SLIDER_H_
|
||||||
#ifndef __GTKSLIDERH__
|
#define _WX_SLIDER_H_
|
||||||
#define __GTKSLIDERH__
|
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma interface
|
#pragma interface "slider.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/defs.h"
|
|
||||||
#include "wx/object.h"
|
|
||||||
#include "wx/list.h"
|
|
||||||
#include "wx/control.h"
|
#include "wx/control.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
WXDLLEXPORT_DATA(extern const char*) wxSliderNameStr;
|
||||||
// classes
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxSlider;
|
// Slider
|
||||||
|
class WXDLLEXPORT wxSlider: public wxControl
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// global data
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
extern const char *wxSliderNameStr;
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// wxSlider
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxSlider: public wxControl
|
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxSlider)
|
DECLARE_DYNAMIC_CLASS(wxSlider)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
wxSlider(void);
|
wxSlider();
|
||||||
wxSlider( wxWindow *parent, wxWindowID id,
|
|
||||||
|
inline wxSlider(wxWindow *parent, wxWindowID id,
|
||||||
int value, int minValue, int maxValue,
|
int value, int minValue, int maxValue,
|
||||||
const wxPoint& pos = wxDefaultPosition,
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
const wxSize& size = wxDefaultSize,
|
const wxSize& size = wxDefaultSize,
|
||||||
long style = wxSL_HORIZONTAL,
|
long style = wxSL_HORIZONTAL,
|
||||||
/* const wxValidator& validator = wxDefaultValidator, */
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
const wxString& name = wxSliderNameStr);
|
const wxString& name = wxSliderNameStr)
|
||||||
~wxSlider(void);
|
{
|
||||||
bool Create(wxWindow *parent, wxWindowID id,
|
Create(parent, id, value, minValue, maxValue, pos, size, style, validator, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
~wxSlider();
|
||||||
|
|
||||||
|
bool Create(wxWindow *parent, wxWindowID id,
|
||||||
int value, int minValue, int maxValue,
|
int value, int minValue, int maxValue,
|
||||||
const wxPoint& pos = wxDefaultPosition,
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
const wxSize& size = wxDefaultSize,
|
const wxSize& size = wxDefaultSize,
|
||||||
long style = wxSL_HORIZONTAL,
|
long style = wxSL_HORIZONTAL,
|
||||||
/* const wxValidator& validator = wxDefaultValidator, */
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
const wxString& name = wxSliderNameStr);
|
const wxString& name = wxSliderNameStr);
|
||||||
virtual int GetValue(void) const;
|
|
||||||
virtual void SetValue( int );
|
virtual int GetValue() const ;
|
||||||
void GetSize( int *x, int *y ) const;
|
virtual void SetValue(int);
|
||||||
void SetSize( int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO );
|
void GetSize(int *x, int *y) const ;
|
||||||
void GetPosition( int *x, int *y ) const;
|
void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
|
||||||
void SetRange( int minValue, int maxValue );
|
void GetPosition(int *x, int *y) const ;
|
||||||
int GetMin(void) const;
|
bool Show(bool show);
|
||||||
int GetMax(void) const;
|
|
||||||
void SetTickFreq( int n, int pos );
|
void SetRange(int minValue, int maxValue);
|
||||||
int GetTickFreq(void) const;
|
|
||||||
void SetPageSize( int pageSize );
|
inline int GetMin() const { return m_rangeMin; }
|
||||||
int GetPageSize(void) const;
|
inline int GetMax() const { return m_rangeMax; }
|
||||||
void ClearSel(void);
|
|
||||||
void ClearTicks(void);
|
// For trackbars only
|
||||||
void SetLineSize( int lineSize );
|
void SetTickFreq(int n, int pos);
|
||||||
int GetLineSize(void) const;
|
inline int GetTickFreq() const { return m_tickFreq; }
|
||||||
int GetSelEnd(void) const;
|
void SetPageSize(int pageSize);
|
||||||
int GetSelStart(void) const;
|
int GetPageSize() const ;
|
||||||
void SetSelection( int minPos, int maxPos );
|
void ClearSel() ;
|
||||||
void SetThumbLength( int len );
|
void ClearTicks() ;
|
||||||
int GetThumbLength(void) const;
|
void SetLineSize(int lineSize);
|
||||||
void SetTick( int tickPos );
|
int GetLineSize() const ;
|
||||||
|
int GetSelEnd() const ;
|
||||||
|
int GetSelStart() const ;
|
||||||
|
void SetSelection(int minPos, int maxPos);
|
||||||
|
void SetThumbLength(int len) ;
|
||||||
|
int GetThumbLength() const ;
|
||||||
|
void SetTick(int tickPos) ;
|
||||||
|
|
||||||
|
void Command(wxCommandEvent& event);
|
||||||
|
protected:
|
||||||
|
int m_rangeMin;
|
||||||
|
int m_rangeMax;
|
||||||
|
int m_pageSize;
|
||||||
|
int m_lineSize;
|
||||||
|
int m_tickFreq;
|
||||||
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // __GTKSLIDERH__
|
#endif
|
||||||
|
// _WX_SLIDER_H_
|
||||||
|
|||||||
@@ -1,60 +1,64 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: statbmp.h
|
// Name: statbmp.h
|
||||||
// Purpose:
|
// Purpose: wxStaticBitmap class
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_STATBMP_H_
|
||||||
#ifndef __GTKSTATICBITMAPH__
|
#define _WX_STATBMP_H_
|
||||||
#define __GTKSTATICBITMAPH__
|
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma interface
|
#pragma interface "statbmp.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/defs.h"
|
|
||||||
#include "wx/object.h"
|
|
||||||
#include "wx/control.h"
|
#include "wx/control.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
WXDLLEXPORT_DATA(extern const char*) wxStaticBitmapNameStr;
|
||||||
// classes
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxStaticBitmap;
|
class WXDLLEXPORT wxStaticBitmap: public wxControl
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// global data
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
extern const char* wxStaticBitmapNameStr;
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// wxStaticBitmap
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxStaticBitmap: public wxControl
|
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxStaticBitmap)
|
DECLARE_DYNAMIC_CLASS(wxStaticBitmap)
|
||||||
|
public:
|
||||||
public:
|
inline wxStaticBitmap() { }
|
||||||
|
|
||||||
wxStaticBitmap(void);
|
inline wxStaticBitmap(wxWindow *parent, wxWindowID id,
|
||||||
wxStaticBitmap( wxWindow *parent, wxWindowID id, const wxBitmap& label,
|
const wxBitmap& label,
|
||||||
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
long style = 0, const wxString& name = wxStaticBitmapNameStr );
|
const wxSize& size = wxDefaultSize,
|
||||||
bool Create( wxWindow *parent, wxWindowID id, const wxBitmap& label,
|
long style = 0,
|
||||||
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
const wxString& name = wxStaticBitmapNameStr)
|
||||||
long style = 0, const wxString& name = wxStaticBitmapNameStr);
|
{
|
||||||
virtual void SetBitmap( const wxBitmap& bitmap );
|
Create(parent, id, label, pos, size, style, name);
|
||||||
wxBitmap& GetBitmap(void) const { return (wxBitmap&)m_bitmap; }
|
}
|
||||||
|
|
||||||
|
bool Create(wxWindow *parent, wxWindowID id,
|
||||||
|
const wxBitmap& label,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = 0,
|
||||||
|
const wxString& name = wxStaticBitmapNameStr);
|
||||||
|
|
||||||
|
virtual void SetBitmap(const wxBitmap& bitmap);
|
||||||
|
|
||||||
|
virtual void Command(wxCommandEvent& WXUNUSED(event)) {};
|
||||||
|
virtual void ProcessCommand(wxCommandEvent& WXUNUSED(event)) {};
|
||||||
|
|
||||||
|
void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
|
||||||
|
|
||||||
|
inline wxBitmap& GetBitmap() const { return (wxBitmap&) m_messageBitmap; }
|
||||||
|
|
||||||
|
// overriden base class virtuals
|
||||||
|
virtual bool AcceptsFocus() const { return FALSE; }
|
||||||
|
|
||||||
|
protected:
|
||||||
|
wxBitmap m_messageBitmap;
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
wxBitmap m_bitmap;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // __GTKSTATICBITMAPH__
|
#endif
|
||||||
|
// _WX_STATBMP_H_
|
||||||
|
|||||||
@@ -1,55 +1,57 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: stabox.h
|
// Name: statbox.h
|
||||||
// Purpose:
|
// Purpose: wxStaticBox class
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_STATBOX_H_
|
||||||
#ifndef __GTKSTATICBOXH__
|
#define _WX_STATBOX_H_
|
||||||
#define __GTKSTATICBOXH__
|
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma interface
|
#pragma interface "statbox.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/defs.h"
|
|
||||||
#include "wx/object.h"
|
|
||||||
#include "wx/list.h"
|
|
||||||
#include "wx/control.h"
|
#include "wx/control.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
WXDLLEXPORT_DATA(extern const char*) wxStaticBoxNameStr;
|
||||||
// classes
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxStaticBox;
|
// Group box
|
||||||
|
class WXDLLEXPORT wxStaticBox: public wxControl
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// global data
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
extern const char *wxStaticBoxNameStr;
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// wxStaticBox
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxStaticBox: public wxControl
|
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxStaticBox)
|
DECLARE_DYNAMIC_CLASS(wxStaticBox)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
inline wxStaticBox() {}
|
||||||
|
inline wxStaticBox(wxWindow *parent, wxWindowID id,
|
||||||
|
const wxString& label,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = 0,
|
||||||
|
const wxString& name = wxStaticBoxNameStr)
|
||||||
|
{
|
||||||
|
Create(parent, id, label, pos, size, style, name);
|
||||||
|
}
|
||||||
|
|
||||||
wxStaticBox(void);
|
bool Create(wxWindow *parent, wxWindowID id,
|
||||||
wxStaticBox( wxWindow *parent, wxWindowID id, const wxString &label,
|
const wxString& label,
|
||||||
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
long style = 0, const wxString &name = wxStaticBoxNameStr );
|
const wxSize& size = wxDefaultSize,
|
||||||
bool Create( wxWindow *parent, wxWindowID id, const wxString &label,
|
long style = 0,
|
||||||
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
|
const wxString& name = wxStaticBoxNameStr);
|
||||||
long style = 0, const wxString &name = wxStaticBoxNameStr );
|
|
||||||
|
virtual void Command(wxCommandEvent& WXUNUSED(event)) {};
|
||||||
|
virtual void ProcessCommand(wxCommandEvent& WXUNUSED(event)) {};
|
||||||
|
|
||||||
|
void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
|
||||||
|
void SetLabel(const wxString& label);
|
||||||
|
|
||||||
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // __GTKSTATICBOXH__
|
#endif
|
||||||
|
// _WX_STATBOX_H_
|
||||||
|
|||||||
@@ -1,57 +1,56 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: stattext.h
|
// Name: stattext.h
|
||||||
// Purpose:
|
// Purpose: wxStaticText class
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_STATTEXT_H_
|
||||||
#ifndef __GTKSTATICTEXTH__
|
#define _WX_STATTEXT_H_
|
||||||
#define __GTKSTATICTEXTH__
|
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma interface
|
#pragma interface "stattext.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/defs.h"
|
|
||||||
#include "wx/object.h"
|
|
||||||
#include "wx/list.h"
|
|
||||||
#include "wx/control.h"
|
#include "wx/control.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
WXDLLEXPORT_DATA(extern const char*) wxStaticTextNameStr;
|
||||||
// classes
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxStaticText;
|
class WXDLLEXPORT wxStaticText: public wxControl
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// global data
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
extern const char *wxStaticTextNameStr;
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// wxStaticText
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxStaticText: public wxControl
|
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxStaticText)
|
DECLARE_DYNAMIC_CLASS(wxStaticText)
|
||||||
|
public:
|
||||||
|
inline wxStaticText() { }
|
||||||
|
|
||||||
public:
|
inline wxStaticText(wxWindow *parent, wxWindowID id,
|
||||||
|
const wxString& label,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = 0,
|
||||||
|
const wxString& name = wxStaticTextNameStr)
|
||||||
|
{
|
||||||
|
Create(parent, id, label, pos, size, style, name);
|
||||||
|
}
|
||||||
|
|
||||||
wxStaticText(void);
|
bool Create(wxWindow *parent, wxWindowID id,
|
||||||
wxStaticText( wxWindow *parent, wxWindowID id, const wxString &label,
|
const wxString& label,
|
||||||
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
long style = 0, const wxString &name = wxStaticTextNameStr );
|
const wxSize& size = wxDefaultSize,
|
||||||
bool Create( wxWindow *parent, wxWindowID id, const wxString &label,
|
long style = 0,
|
||||||
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
|
const wxString& name = wxStaticTextNameStr);
|
||||||
long style = 0, const wxString &name = wxStaticTextNameStr );
|
|
||||||
wxString GetLabel(void) const;
|
// accessors
|
||||||
void SetLabel( const wxString &label );
|
void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
|
||||||
|
void SetLabel(const wxString&);
|
||||||
|
|
||||||
|
// operations
|
||||||
|
virtual void Command(wxCommandEvent& WXUNUSED(event)) {};
|
||||||
|
virtual void ProcessCommand(wxCommandEvent& WXUNUSED(event)) {};
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // __GTKSTATICTEXTH__
|
#endif
|
||||||
|
// _WX_STATTEXT_H_
|
||||||
|
|||||||
@@ -1,24 +1,21 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: textctrl.h
|
// Name: textctrl.h
|
||||||
// Purpose:
|
// Purpose: wxTextCtrl class
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id: $Id$
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
// Licence: wxWindows licence
|
// Copyright: (c) AUTHOR
|
||||||
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_TEXTCTRL_H_
|
||||||
#ifndef __GTKTEXTCTRLH__
|
#define _WX_TEXTCTRL_H_
|
||||||
#define __GTKTEXTCTRLH__
|
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma interface
|
#pragma interface "textctrl.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/defs.h"
|
|
||||||
#include "wx/object.h"
|
|
||||||
#include "wx/string.h"
|
|
||||||
#include "wx/control.h"
|
#include "wx/control.h"
|
||||||
|
|
||||||
#if USE_IOSTREAMH
|
#if USE_IOSTREAMH
|
||||||
@@ -27,82 +24,116 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
WXDLLEXPORT_DATA(extern const char*) wxTextCtrlNameStr;
|
||||||
// classes
|
WXDLLEXPORT_DATA(extern const char*) wxEmptyString;
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxTextCtrl;
|
// Single-line text item
|
||||||
|
class WXDLLEXPORT wxTextCtrl: public wxControl
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
// TODO Some platforms/compilers don't like inheritance from streambuf.
|
||||||
// global data
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
extern const char *wxTextCtrlNameStr;
|
#if (defined(__BORLANDC__) && !defined(__WIN32__)) || defined(__MWERKS__)
|
||||||
|
#define NO_TEXT_WINDOW_STREAM
|
||||||
|
#endif
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
#ifndef NO_TEXT_WINDOW_STREAM
|
||||||
// wxTextCtrl
|
, public streambuf
|
||||||
//-----------------------------------------------------------------------------
|
#endif
|
||||||
|
|
||||||
class wxTextCtrl: public wxControl, public streambuf
|
|
||||||
{
|
{
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_DYNAMIC_CLASS(wxTextCtrl)
|
||||||
DECLARE_DYNAMIC_CLASS(wxTextCtrl);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
wxTextCtrl();
|
// creation
|
||||||
wxTextCtrl( wxWindow *parent, wxWindowID id, const wxString &value = "",
|
// --------
|
||||||
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
|
wxTextCtrl();
|
||||||
int style = 0, const wxString &name = wxTextCtrlNameStr );
|
inline wxTextCtrl(wxWindow *parent, wxWindowID id,
|
||||||
bool Create( wxWindow *parent, wxWindowID id, const wxString &value = "",
|
const wxString& value = wxEmptyString,
|
||||||
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
int style = 0, const wxString &name = wxTextCtrlNameStr );
|
const wxSize& size = wxDefaultSize, long style = 0,
|
||||||
wxString GetValue() const;
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
void SetValue( const wxString &value );
|
const wxString& name = wxTextCtrlNameStr)
|
||||||
void WriteText( const wxString &text );
|
#ifndef NO_TEXT_WINDOW_STREAM
|
||||||
|
:streambuf()
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
Create(parent, id, value, pos, size, style, validator, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Create(wxWindow *parent, wxWindowID id,
|
||||||
|
const wxString& value = wxEmptyString,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize, long style = 0,
|
||||||
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
|
const wxString& name = wxTextCtrlNameStr);
|
||||||
|
|
||||||
|
// accessors
|
||||||
|
// ---------
|
||||||
|
virtual wxString GetValue() const ;
|
||||||
|
virtual void SetValue(const wxString& value);
|
||||||
|
|
||||||
bool LoadFile( const wxString &file );
|
virtual int GetLineLength(long lineNo) const;
|
||||||
bool SaveFile( const wxString &file );
|
virtual wxString GetLineText(long lineNo) const;
|
||||||
bool IsModified() const { return m_modified; }
|
virtual int GetNumberOfLines() const;
|
||||||
void SetModified() { m_modified = TRUE; }
|
|
||||||
void DiscardEdits() { m_modified = FALSE; }
|
|
||||||
/*
|
|
||||||
wxString GetLineText( long lineNo ) const;
|
|
||||||
void OnDropFiles( wxDropFilesEvent &event );
|
|
||||||
long PositionToXY( long pos, long *x, long *y ) const;
|
|
||||||
long XYToPosition( long x, long y );
|
|
||||||
int GetNumberOfLines();
|
|
||||||
*/
|
|
||||||
virtual void SetInsertionPoint( long pos );
|
|
||||||
virtual void SetInsertionPointEnd();
|
|
||||||
virtual void SetEditable( bool editable );
|
|
||||||
virtual void SetSelection( long from, long to );
|
|
||||||
void ShowPosition( long pos );
|
|
||||||
virtual long GetInsertionPoint() const;
|
|
||||||
virtual long GetLastPosition() const;
|
|
||||||
virtual void Remove( long from, long to );
|
|
||||||
virtual void Replace( long from, long to, const wxString &value );
|
|
||||||
void Cut();
|
|
||||||
void Copy();
|
|
||||||
void Paste();
|
|
||||||
void Delete();
|
|
||||||
|
|
||||||
void OnChar( wxKeyEvent &event );
|
// operations
|
||||||
|
// ----------
|
||||||
|
virtual void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
|
||||||
|
|
||||||
|
// Clipboard operations
|
||||||
|
virtual void Copy();
|
||||||
|
virtual void Cut();
|
||||||
|
virtual void Paste();
|
||||||
|
|
||||||
|
virtual void SetInsertionPoint(long pos);
|
||||||
|
virtual void SetInsertionPointEnd();
|
||||||
|
virtual long GetInsertionPoint() const ;
|
||||||
|
virtual long GetLastPosition() const ;
|
||||||
|
virtual void Replace(long from, long to, const wxString& value);
|
||||||
|
virtual void Remove(long from, long to);
|
||||||
|
virtual void SetSelection(long from, long to);
|
||||||
|
virtual void SetEditable(bool editable);
|
||||||
|
|
||||||
|
// streambuf implementation
|
||||||
|
#ifndef NO_TEXT_WINDOW_STREAM
|
||||||
|
int overflow(int i);
|
||||||
|
int sync();
|
||||||
|
int underflow();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
wxTextCtrl& operator<<(const wxString& s);
|
||||||
|
wxTextCtrl& operator<<(int i);
|
||||||
|
wxTextCtrl& operator<<(long i);
|
||||||
|
wxTextCtrl& operator<<(float f);
|
||||||
|
wxTextCtrl& operator<<(double d);
|
||||||
|
wxTextCtrl& operator<<(const char c);
|
||||||
|
|
||||||
|
virtual bool LoadFile(const wxString& file);
|
||||||
|
virtual bool SaveFile(const wxString& file);
|
||||||
|
virtual void WriteText(const wxString& text);
|
||||||
|
virtual void DiscardEdits();
|
||||||
|
virtual bool IsModified() const;
|
||||||
|
|
||||||
|
virtual long XYToPosition(long x, long y) const ;
|
||||||
|
virtual void PositionToXY(long pos, long *x, long *y) const ;
|
||||||
|
virtual void ShowPosition(long pos);
|
||||||
|
virtual void Clear();
|
||||||
|
|
||||||
|
// callbacks
|
||||||
|
// ---------
|
||||||
|
void OnDropFiles(wxDropFilesEvent& event);
|
||||||
|
void OnChar(wxKeyEvent& event); // Process 'enter' if required
|
||||||
|
void OnEraseBackground(wxEraseEvent& event);
|
||||||
|
|
||||||
|
// Implementation
|
||||||
|
// --------------
|
||||||
|
virtual void Command(wxCommandEvent& event);
|
||||||
|
|
||||||
int overflow(int i);
|
protected:
|
||||||
int sync();
|
wxString m_fileName;
|
||||||
int underflow();
|
|
||||||
|
DECLARE_EVENT_TABLE()
|
||||||
wxTextCtrl& operator<<(const wxString& s);
|
|
||||||
wxTextCtrl& operator<<(int i);
|
|
||||||
wxTextCtrl& operator<<(long i);
|
|
||||||
wxTextCtrl& operator<<(float f);
|
|
||||||
wxTextCtrl& operator<<(double d);
|
|
||||||
wxTextCtrl& operator<<(const char c);
|
|
||||||
|
|
||||||
private:
|
|
||||||
bool m_modified;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // __GTKTEXTCTRLH__
|
#endif
|
||||||
|
// _WX_TEXTCTRL_H_
|
||||||
|
|
||||||
|
|||||||
@@ -1,52 +1,57 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: timer.h
|
// Name: timer.h
|
||||||
// Purpose:
|
// Purpose: wxTimer class
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_TIMER_H_
|
||||||
#ifndef __GTKTIMERH__
|
#define _WX_TIMER_H_
|
||||||
#define __GTKTIMERH__
|
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma interface
|
#pragma interface "timer.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/defs.h"
|
|
||||||
#include "wx/object.h"
|
#include "wx/object.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
class WXDLLEXPORT wxTimer: public wxObject
|
||||||
// derived classes
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxTimer;
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// wxTimer
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxTimer: public wxObject
|
|
||||||
{
|
{
|
||||||
DECLARE_DYNAMIC_CLASS(wxTimer)
|
DECLARE_DYNAMIC_CLASS(wxTimer)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
wxTimer();
|
||||||
|
~wxTimer();
|
||||||
|
virtual bool Start(int milliseconds = -1,bool one_shot = FALSE); // Start timer
|
||||||
|
virtual void Stop(); // Stop timer
|
||||||
|
virtual void Notify() = 0; // Override this member
|
||||||
|
inline int Interval() { return m_milli ; }; // Returns the current interval time (0 if stop)
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool m_oneShot ;
|
||||||
|
int m_milli ;
|
||||||
|
int m_lastMilli ;
|
||||||
|
long m_id;
|
||||||
|
|
||||||
wxTimer(void);
|
|
||||||
~wxTimer(void);
|
|
||||||
int Interval(void);
|
|
||||||
bool OneShot(void);
|
|
||||||
virtual void Notify(void);
|
|
||||||
void Start( int millisecs = -1, bool oneShot = FALSE );
|
|
||||||
void Stop(void);
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
int m_time;
|
|
||||||
bool m_oneShot;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // __GTKTIMERH__
|
/* Note: these are implemented in common/timercmn.cpp, so need to implement them separately.
|
||||||
|
* But you may need to modify timercmn.cpp.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Timer functions (milliseconds)
|
||||||
|
void WXDLLEXPORT wxStartTimer();
|
||||||
|
// Gets time since last wxStartTimer or wxGetElapsedTime
|
||||||
|
long WXDLLEXPORT wxGetElapsedTime(bool resetTimer = TRUE);
|
||||||
|
|
||||||
|
// EXPERIMENTAL: comment this out if it doesn't compile.
|
||||||
|
bool WXDLLEXPORT wxGetLocalTime(long *timeZone, int *dstObserved);
|
||||||
|
|
||||||
|
// Get number of seconds since 00:00:00 GMT, Jan 1st 1970.
|
||||||
|
long WXDLLEXPORT wxGetCurrentTime();
|
||||||
|
|
||||||
|
#endif
|
||||||
|
// _WX_TIMER_H_
|
||||||
|
|||||||
@@ -1,252 +1,547 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: window.h
|
// Name: window.h
|
||||||
// Purpose:
|
// Purpose: wxWindow class
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
// Licence: wxWindows licence
|
// Copyright: (c) AUTHOR
|
||||||
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _WX_WINDOW_H_
|
||||||
#ifndef __GTKWINDOWH__
|
#define _WX_WINDOW_H_
|
||||||
#define __GTKWINDOWH__
|
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma interface
|
#pragma interface "window.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/defs.h"
|
#include "wx/gdicmn.h"
|
||||||
#include "wx/object.h"
|
#include "wx/icon.h"
|
||||||
#include "wx/list.h"
|
|
||||||
#include "wx/event.h"
|
|
||||||
#include "wx/validate.h"
|
|
||||||
#include "wx/cursor.h"
|
#include "wx/cursor.h"
|
||||||
|
#include "wx/pen.h"
|
||||||
#include "wx/font.h"
|
#include "wx/font.h"
|
||||||
#include "wx/dc.h"
|
#include "wx/validate.h"
|
||||||
|
#include "wx/event.h"
|
||||||
|
#include "wx/string.h"
|
||||||
|
#include "wx/list.h"
|
||||||
#include "wx/region.h"
|
#include "wx/region.h"
|
||||||
#include "wx/dnd.h"
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
#define wxKEY_SHIFT 1
|
||||||
// global data
|
#define wxKEY_CTRL 2
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
extern const char *wxFrameNameStr;
|
/*
|
||||||
extern wxList wxTopLevelWindows;
|
* Base class for frame, panel, canvas, panel items, dialog box.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
/*
|
||||||
// classes
|
* Event handler: windows have themselves as their event handlers
|
||||||
//-----------------------------------------------------------------------------
|
* by default, but their event handlers could be set to another
|
||||||
|
* object entirely. This separation can reduce the amount of
|
||||||
|
* derivation required, and allow alteration of a window's functionality
|
||||||
|
* (e.g. by a resource editor that temporarily switches event handlers).
|
||||||
|
*/
|
||||||
|
|
||||||
class wxLayoutConstraints;
|
class WXDLLEXPORT wxWindow;
|
||||||
class wxSizer;
|
class WXDLLEXPORT wxEvent;
|
||||||
|
class WXDLLEXPORT wxCommandEvent;
|
||||||
|
class WXDLLEXPORT wxKeyEvent;
|
||||||
|
class WXDLLEXPORT wxControl;
|
||||||
|
class WXDLLEXPORT wxCursor;
|
||||||
|
class WXDLLEXPORT wxColourMap;
|
||||||
|
class WXDLLEXPORT wxFont;
|
||||||
|
class WXDLLEXPORT wxMenu;
|
||||||
|
class WXDLLEXPORT wxRectangle;
|
||||||
|
class WXDLLEXPORT wxBitmap;
|
||||||
|
class WXDLLEXPORT wxSizer;
|
||||||
|
class WXDLLEXPORT wxList;
|
||||||
|
class WXDLLEXPORT wxLayoutConstraints;
|
||||||
|
class WXDLLEXPORT wxMouseEvent;
|
||||||
|
class WXDLLEXPORT wxButton;
|
||||||
|
class WXDLLEXPORT wxColour;
|
||||||
|
class WXDLLEXPORT wxBrush;
|
||||||
|
class WXDLLEXPORT wxPen;
|
||||||
|
class WXDLLEXPORT wxIcon;
|
||||||
|
class WXDLLEXPORT wxDC;
|
||||||
|
class WXDLLEXPORT wxValidator;
|
||||||
|
|
||||||
class wxWindow;
|
#if USE_DRAG_AND_DROP
|
||||||
class wxCanvas;
|
class WXDLLEXPORT wxDropTarget;
|
||||||
|
#endif
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
#if USE_WX_RESOURCES
|
||||||
// global data
|
class WXDLLEXPORT wxResourceTable;
|
||||||
//-----------------------------------------------------------------------------
|
class WXDLLEXPORT wxItemResource;
|
||||||
|
#endif
|
||||||
|
|
||||||
extern const char *wxPanelNameStr;
|
WXDLLEXPORT_DATA(extern const char*) wxPanelNameStr;
|
||||||
extern const wxSize wxDefaultSize;
|
|
||||||
extern const wxPoint wxDefaultPosition;
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
WXDLLEXPORT_DATA(extern const wxSize) wxDefaultSize;
|
||||||
// wxWindow
|
WXDLLEXPORT_DATA(extern const wxPoint) wxDefaultPosition;
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxWindow: public wxEvtHandler
|
class WXDLLEXPORT wxWindow: public wxEvtHandler
|
||||||
{
|
{
|
||||||
|
DECLARE_ABSTRACT_CLASS(wxWindow)
|
||||||
|
|
||||||
|
friend class wxDC;
|
||||||
|
friend class wxPaintDC;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
wxWindow();
|
wxWindow();
|
||||||
wxWindow( wxWindow *parent, wxWindowID id,
|
inline wxWindow(wxWindow *parent, wxWindowID id,
|
||||||
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
long style = 0, const wxString &name = wxPanelNameStr );
|
const wxSize& size = wxDefaultSize,
|
||||||
bool Create( wxWindow *parent, wxWindowID id,
|
long style = 0,
|
||||||
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
|
const wxString& name = wxPanelNameStr)
|
||||||
long style = 0, const wxString &name = wxPanelNameStr );
|
{
|
||||||
|
m_children = new wxList;
|
||||||
|
Create(parent, id, pos, size, style, name);
|
||||||
|
}
|
||||||
|
|
||||||
virtual ~wxWindow();
|
virtual ~wxWindow();
|
||||||
bool Close( bool force = FALSE );
|
|
||||||
virtual bool Destroy();
|
|
||||||
virtual bool DestroyChildren();
|
|
||||||
|
|
||||||
virtual void PrepareDC( wxDC &dc );
|
bool Create(wxWindow *parent, wxWindowID id,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize,
|
||||||
|
long style = 0,
|
||||||
|
const wxString& name = wxPanelNameStr);
|
||||||
|
|
||||||
virtual void SetSize( int x, int y, int width, int height,
|
// Fit the window around the items
|
||||||
int sizeFlags = wxSIZE_AUTO );
|
|
||||||
virtual void SetSize( int width, int height );
|
|
||||||
virtual void Move( int x, int y );
|
|
||||||
virtual void GetSize( int *width, int *height ) const;
|
|
||||||
virtual void SetClientSize( int const width, int const height );
|
|
||||||
virtual void GetClientSize( int *width, int *height ) const;
|
|
||||||
virtual void GetPosition( int *x, int *y ) const;
|
|
||||||
virtual void Centre( int direction = wxHORIZONTAL );
|
|
||||||
virtual void Fit();
|
virtual void Fit();
|
||||||
|
|
||||||
void OnSize( wxSizeEvent &event );
|
// Show or hide the window
|
||||||
void OnIdle( wxIdleEvent& event );
|
virtual bool Show(bool show);
|
||||||
|
|
||||||
virtual bool Show( bool show );
|
// Is the window shown?
|
||||||
virtual void Enable( bool enable );
|
virtual bool IsShown() const;
|
||||||
virtual void MakeModal( bool modal );
|
|
||||||
virtual bool IsEnabled() const { return m_isEnabled; };
|
// Raise the window to the top of the Z order
|
||||||
|
virtual void Raise();
|
||||||
|
|
||||||
|
// Lower the window to the bottom of the Z order
|
||||||
|
virtual void Lower();
|
||||||
|
|
||||||
|
// Is the window enabled?
|
||||||
|
virtual bool IsEnabled() const;
|
||||||
|
|
||||||
|
// For compatibility
|
||||||
|
inline bool Enabled() const { return IsEnabled(); }
|
||||||
|
|
||||||
|
// Dialog support: override these and call
|
||||||
|
// base class members to add functionality
|
||||||
|
// that can't be done using validators.
|
||||||
|
|
||||||
|
// Transfer values to controls. If returns FALSE,
|
||||||
|
// it's an application error (pops up a dialog)
|
||||||
|
virtual bool TransferDataToWindow();
|
||||||
|
|
||||||
|
// Transfer values from controls. If returns FALSE,
|
||||||
|
// transfer failed: don't quit
|
||||||
|
virtual bool TransferDataFromWindow();
|
||||||
|
|
||||||
|
// Validate controls. If returns FALSE,
|
||||||
|
// validation failed: don't quit
|
||||||
|
virtual bool Validate();
|
||||||
|
|
||||||
|
// Return code for dialogs
|
||||||
|
inline void SetReturnCode(int retCode);
|
||||||
|
inline int GetReturnCode();
|
||||||
|
|
||||||
|
// Set the cursor
|
||||||
|
virtual void SetCursor(const wxCursor& cursor);
|
||||||
|
inline virtual wxCursor *GetCursor() const { return (wxCursor *)& m_windowCursor; };
|
||||||
|
|
||||||
|
// Get the window with the focus
|
||||||
|
static wxWindow *FindFocus();
|
||||||
|
|
||||||
|
// Get character size
|
||||||
|
virtual int GetCharHeight() const;
|
||||||
|
virtual int GetCharWidth() const;
|
||||||
|
|
||||||
|
// Get overall window size
|
||||||
|
virtual void GetSize(int *width, int *height) const;
|
||||||
|
|
||||||
|
// Get window position, relative to parent (or screen if no parent)
|
||||||
|
virtual void GetPosition(int *x, int *y) const;
|
||||||
|
|
||||||
|
// Get client (application-useable) size
|
||||||
|
virtual void GetClientSize(int *width, int *height) const;
|
||||||
|
|
||||||
|
// Set overall size and position
|
||||||
|
virtual void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
|
||||||
|
inline virtual void SetSize(int width, int height) { SetSize(-1, -1, width, height, wxSIZE_USE_EXISTING); }
|
||||||
|
inline virtual void Move(int x, int y) { SetSize(x, y, -1, -1, wxSIZE_USE_EXISTING); }
|
||||||
|
|
||||||
|
// Set client size
|
||||||
|
virtual void SetClientSize(int width, int size);
|
||||||
|
|
||||||
|
// Convert client to screen coordinates
|
||||||
|
virtual void ClientToScreen(int *x, int *y) const;
|
||||||
|
|
||||||
|
// Convert screen to client coordinates
|
||||||
|
virtual void ScreenToClient(int *x, int *y) const;
|
||||||
|
|
||||||
|
// Set the focus to this window
|
||||||
virtual void SetFocus();
|
virtual void SetFocus();
|
||||||
virtual bool OnClose();
|
|
||||||
|
|
||||||
virtual void AddChild( wxWindow *child );
|
// Capture/release mouse
|
||||||
wxList *GetChildren();
|
|
||||||
virtual void RemoveChild( wxWindow *child );
|
|
||||||
void SetReturnCode( int retCode );
|
|
||||||
int GetReturnCode();
|
|
||||||
wxWindow *GetParent();
|
|
||||||
|
|
||||||
wxEvtHandler *GetEventHandler();
|
|
||||||
void SetEventhandler( wxEvtHandler *handler );
|
|
||||||
|
|
||||||
virtual wxValidator *GetValidator();
|
|
||||||
virtual void SetValidator( wxValidator *validator );
|
|
||||||
|
|
||||||
bool IsBeingDeleted();
|
|
||||||
|
|
||||||
void SetId( wxWindowID id );
|
|
||||||
wxWindowID GetId();
|
|
||||||
|
|
||||||
void SetCursor( const wxCursor &cursor );
|
|
||||||
|
|
||||||
virtual void Refresh( bool eraseBackground = TRUE, const wxRect *rect = NULL );
|
|
||||||
virtual void Clear();
|
|
||||||
virtual bool IsExposed( long x, long y );
|
|
||||||
virtual bool IsExposed( long x, long y, long width, long height );
|
|
||||||
|
|
||||||
virtual wxColour GetBackgroundColour() const;
|
|
||||||
virtual void SetBackgroundColour( const wxColour &colour );
|
|
||||||
|
|
||||||
virtual void SetDefaultBackgroundColour( const wxColour& col )
|
|
||||||
{ m_defaultBackgroundColour = col; };
|
|
||||||
virtual wxColour GetDefaultBackgroundColour() const
|
|
||||||
{ return m_defaultBackgroundColour; };
|
|
||||||
virtual void SetDefaultForegroundColour( const wxColour& col )
|
|
||||||
{ m_defaultForegroundColour = col; };
|
|
||||||
virtual wxColour GetDefaultForegroundColour() const
|
|
||||||
{ return m_defaultForegroundColour; };
|
|
||||||
|
|
||||||
virtual void SetFont( const wxFont &font );
|
|
||||||
virtual wxFont *GetFont();
|
|
||||||
// For backward compatibility
|
|
||||||
inline virtual void SetButtonFont(const wxFont& font) { SetFont(font); }
|
|
||||||
inline virtual void SetLabelFont(const wxFont& font) { SetFont(font); }
|
|
||||||
inline virtual wxFont *GetLabelFont() { return GetFont(); };
|
|
||||||
inline virtual wxFont *GetButtonFont() { return GetFont(); };
|
|
||||||
virtual void SetWindowStyleFlag( long flag );
|
|
||||||
virtual long GetWindowStyleFlag() const;
|
|
||||||
virtual void CaptureMouse();
|
virtual void CaptureMouse();
|
||||||
virtual void ReleaseMouse();
|
virtual void ReleaseMouse();
|
||||||
virtual void SetTitle( const wxString &title );
|
|
||||||
virtual wxString GetTitle() const;
|
|
||||||
virtual void SetName( const wxString &name );
|
|
||||||
virtual wxString GetName() const;
|
|
||||||
virtual wxString GetLabel() const;
|
|
||||||
|
|
||||||
void OnSysColourChanged( wxSysColourChangedEvent &WXUNUSED(event) ) {};
|
// Enable or disable the window
|
||||||
|
virtual void Enable(bool enable);
|
||||||
|
|
||||||
virtual bool IsShown() const;
|
#if USE_DRAG_AND_DROP
|
||||||
virtual bool IsRetained();
|
// Associate a drop target with this window (if the window already had a drop
|
||||||
virtual wxWindow *FindWindow( long id );
|
// target, it's deleted!) and return the current drop target (may be NULL).
|
||||||
virtual wxWindow *FindWindow( const wxString& name );
|
void SetDropTarget(wxDropTarget *pDropTarget);
|
||||||
void AllowDoubleClick( bool WXUNUSED(allow) ) {};
|
wxDropTarget *GetDropTarget() const { return m_pDropTarget; }
|
||||||
void SetDoubleClick( bool WXUNUSED(allow) ) {};
|
#endif
|
||||||
virtual void ClientToScreen( int *x, int *y );
|
|
||||||
virtual void ScreenToClient( int *x, int *y );
|
|
||||||
|
|
||||||
virtual bool Validate();
|
// Accept files for dragging
|
||||||
virtual bool TransferDataToWindow();
|
virtual void DragAcceptFiles(bool accept);
|
||||||
virtual bool TransferDataFromWindow();
|
|
||||||
void OnInitDialog( wxInitDialogEvent &event );
|
|
||||||
virtual void InitDialog();
|
|
||||||
|
|
||||||
virtual void SetDropTarget( wxDropTarget *dropTarget );
|
// Update region access
|
||||||
virtual wxDropTarget *GetDropTarget() const;
|
virtual wxRegion GetUpdateRegion() const;
|
||||||
|
virtual bool IsExposed(int x, int y, int w, int h) const;
|
||||||
|
virtual bool IsExposed(const wxPoint& pt) const;
|
||||||
|
virtual bool IsExposed(const wxRect& rect) const;
|
||||||
|
|
||||||
|
// Set/get the window title
|
||||||
|
virtual inline void SetTitle(const wxString& WXUNUSED(title)) {};
|
||||||
|
inline virtual wxString GetTitle() const { return wxString(""); };
|
||||||
|
// Most windows have the concept of a label; for frames, this is the
|
||||||
|
// title; for items, this is the label or button text.
|
||||||
|
inline virtual wxString GetLabel() const { return GetTitle(); }
|
||||||
|
|
||||||
|
// Set/get the window name (used for resource setting in X)
|
||||||
|
inline virtual wxString GetName() const;
|
||||||
|
inline virtual void SetName(const wxString& name);
|
||||||
|
|
||||||
|
// Centre the window
|
||||||
|
virtual void Centre(int direction) ;
|
||||||
|
inline void Center(int direction = wxHORIZONTAL) { Centre(direction); }
|
||||||
|
|
||||||
|
// Popup a menu
|
||||||
|
virtual bool PopupMenu(wxMenu *menu, int x, int y);
|
||||||
|
|
||||||
|
// Send the window a refresh event
|
||||||
|
virtual void Refresh(bool eraseBack = TRUE, const wxRectangle *rect = NULL);
|
||||||
|
|
||||||
|
// New functions that will replace the above.
|
||||||
|
virtual void SetScrollbar(int orient, int pos, int thumbVisible,
|
||||||
|
int range, bool refresh = TRUE);
|
||||||
|
|
||||||
|
virtual void SetScrollPos(int orient, int pos, bool refresh = TRUE);
|
||||||
|
virtual int GetScrollPos(int orient) const;
|
||||||
|
virtual int GetScrollRange(int orient) const;
|
||||||
|
virtual int GetScrollThumb(int orient) const;
|
||||||
|
|
||||||
|
virtual void ScrollWindow(int dx, int dy, const wxRectangle *rect = NULL);
|
||||||
|
|
||||||
|
// Caret manipulation
|
||||||
|
virtual void CreateCaret(int w, int h);
|
||||||
|
virtual void CreateCaret(const wxBitmap *bitmap);
|
||||||
|
virtual void DestroyCaret();
|
||||||
|
virtual void ShowCaret(bool show);
|
||||||
|
virtual void SetCaretPos(int x, int y);
|
||||||
|
virtual void GetCaretPos(int *x, int *y) const;
|
||||||
|
|
||||||
|
// Tell window how much it can be sized
|
||||||
|
virtual void SetSizeHints(int minW = -1, int minH = -1, int maxW = -1, int maxH = -1, int incW = -1, int incH = -1);
|
||||||
|
|
||||||
|
// Set/get the window's identifier
|
||||||
|
inline int GetId() const;
|
||||||
|
inline void SetId(int id);
|
||||||
|
|
||||||
|
// Make the window modal (all other windows unresponsive)
|
||||||
|
virtual void MakeModal(bool modal);
|
||||||
|
|
||||||
|
// Get the private handle (platform-dependent)
|
||||||
|
inline void *GetHandle() const;
|
||||||
|
|
||||||
|
// Set/get the window's relatives
|
||||||
|
inline wxWindow *GetParent() const;
|
||||||
|
inline void SetParent(wxWindow *p) ;
|
||||||
|
inline wxWindow *GetGrandParent() const;
|
||||||
|
inline wxList *GetChildren() const;
|
||||||
|
|
||||||
|
// Set/get the window's font
|
||||||
|
virtual void SetFont(const wxFont& f);
|
||||||
|
inline virtual wxFont *GetFont() const;
|
||||||
|
|
||||||
|
// Set/get the window's validator
|
||||||
|
void SetValidator(const wxValidator& validator);
|
||||||
|
inline wxValidator *GetValidator() const;
|
||||||
|
|
||||||
|
// Set/get the window's style
|
||||||
|
inline void SetWindowStyleFlag(long flag);
|
||||||
|
inline long GetWindowStyleFlag() const;
|
||||||
|
|
||||||
|
// Set/get event handler
|
||||||
|
inline void SetEventHandler(wxEvtHandler *handler);
|
||||||
|
inline wxEvtHandler *GetEventHandler() const;
|
||||||
|
|
||||||
|
// Push/pop event handler (i.e. allow a chain of event handlers
|
||||||
|
// be searched)
|
||||||
|
void PushEventHandler(wxEvtHandler *handler) ;
|
||||||
|
wxEvtHandler *PopEventHandler(bool deleteHandler = FALSE) ;
|
||||||
|
|
||||||
public:
|
// Close the window by calling OnClose, posting a deletion
|
||||||
virtual void SetScrollbar( int orient, int pos, int thumbVisible,
|
virtual bool Close(bool force = FALSE);
|
||||||
int range, bool refresh = TRUE );
|
|
||||||
virtual void SetScrollPos( int orient, int pos, bool refresh = TRUE );
|
|
||||||
virtual int GetScrollPos( int orient ) const;
|
|
||||||
virtual int GetScrollThumb( int orient ) const;
|
|
||||||
virtual int GetScrollRange( int orient ) const;
|
|
||||||
virtual void ScrollWindow( int dx, int dy, const wxRect* rect = NULL );
|
|
||||||
|
|
||||||
// return FALSE from here if the window doesn't want the focus
|
// Destroy the window (delayed, if a managed window)
|
||||||
virtual bool AcceptsFocus() const;
|
virtual bool Destroy() ;
|
||||||
|
|
||||||
// update the UI state (called from OnIdle)
|
// Mode for telling default OnSize members to
|
||||||
|
// call Layout(), if not using Sizers, just top-down constraints
|
||||||
|
inline void SetAutoLayout(bool a);
|
||||||
|
inline bool GetAutoLayout() const;
|
||||||
|
|
||||||
|
// Set/get constraints
|
||||||
|
inline wxLayoutConstraints *GetConstraints() const;
|
||||||
|
void SetConstraints(wxLayoutConstraints *c);
|
||||||
|
|
||||||
|
// Set/get window background colour
|
||||||
|
inline virtual void SetBackgroundColour(const wxColour& col);
|
||||||
|
inline virtual wxColour GetBackgroundColour() const;
|
||||||
|
|
||||||
|
// Set/get window foreground colour
|
||||||
|
inline virtual void SetForegroundColour(const wxColour& col);
|
||||||
|
inline virtual wxColour GetForegroundColour() const;
|
||||||
|
|
||||||
|
// Set/get window default background colour (for children to inherit).
|
||||||
|
// NOTE: these may be removed in later revisions.
|
||||||
|
inline virtual void SetDefaultBackgroundColour(const wxColour& col);
|
||||||
|
inline virtual wxColour GetDefaultBackgroundColour(void) const;
|
||||||
|
|
||||||
|
// Set/get window default foreground colour (for children to inherit)
|
||||||
|
inline virtual void SetDefaultForegroundColour(const wxColour& col);
|
||||||
|
inline virtual wxColour GetDefaultForegroundColour(void) const;
|
||||||
|
|
||||||
|
// Get the default button, if there is one
|
||||||
|
inline virtual wxButton *GetDefaultItem() const;
|
||||||
|
inline virtual void SetDefaultItem(wxButton *but);
|
||||||
|
|
||||||
|
// Override to define new behaviour for default action (e.g. double clicking
|
||||||
|
// on a listbox)
|
||||||
|
virtual void OnDefaultAction(wxControl *initiatingItem);
|
||||||
|
|
||||||
|
// Resource loading
|
||||||
|
#if USE_WX_RESOURCES
|
||||||
|
virtual bool LoadFromResource(wxWindow *parent, const wxString& resourceName, const wxResourceTable *table = NULL);
|
||||||
|
virtual wxControl *CreateItem(const wxItemResource *childResource, const wxResourceTable *table = NULL);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Native resource loading
|
||||||
|
virtual bool LoadNativeDialog(wxWindow* parent, wxWindowID& id);
|
||||||
|
virtual bool LoadNativeDialog(wxWindow* parent, const wxString& name);
|
||||||
|
virtual wxWindow* GetWindowChild1(wxWindowID& id);
|
||||||
|
virtual wxWindow* GetWindowChild(wxWindowID& id);
|
||||||
|
|
||||||
|
virtual void GetTextExtent(const wxString& string, int *x, int *y,
|
||||||
|
int *descent = NULL,
|
||||||
|
int *externalLeading = NULL,
|
||||||
|
const wxFont *theFont = NULL, bool use16 = FALSE) const;
|
||||||
|
|
||||||
|
// Is the window retained?
|
||||||
|
inline bool IsRetained() const;
|
||||||
|
|
||||||
|
// Warp the pointer the given position
|
||||||
|
virtual void WarpPointer(int x_pos, int y_pos) ;
|
||||||
|
|
||||||
|
// Clear the window
|
||||||
|
virtual void Clear();
|
||||||
|
|
||||||
|
// Find a window by id or name
|
||||||
|
virtual wxWindow *FindWindow(long id);
|
||||||
|
virtual wxWindow *FindWindow(const wxString& name);
|
||||||
|
|
||||||
|
// Constraint operations
|
||||||
|
bool Layout();
|
||||||
|
void SetSizer(wxSizer *sizer); // Adds sizer child to this window
|
||||||
|
inline wxSizer *GetSizer() const ;
|
||||||
|
inline wxWindow *GetSizerParent() const ;
|
||||||
|
inline void SetSizerParent(wxWindow *win);
|
||||||
|
|
||||||
|
// Do Update UI processing for controls
|
||||||
void UpdateWindowUI();
|
void UpdateWindowUI();
|
||||||
|
|
||||||
|
void OnEraseBackground(wxEraseEvent& event);
|
||||||
|
void OnChar(wxKeyEvent& event);
|
||||||
|
void OnPaint(wxPaintEvent& event);
|
||||||
|
void OnIdle(wxIdleEvent& event);
|
||||||
|
|
||||||
|
// Does this window want to accept keyboard focus?
|
||||||
|
virtual bool AcceptsFocus() const;
|
||||||
|
|
||||||
|
public:
|
||||||
|
////////////////////////////////////////////////////////////////////////
|
||||||
|
//// IMPLEMENTATION
|
||||||
|
|
||||||
public: // cannot get private going yet
|
// For implementation purposes - sometimes decorations make the client area
|
||||||
|
// smaller
|
||||||
|
virtual wxPoint GetClientAreaOrigin() const;
|
||||||
|
|
||||||
|
// Makes an adjustment to the window position (for example, a frame that has
|
||||||
|
// a toolbar that it manages itself).
|
||||||
|
virtual void AdjustForParentClientOrigin(int& x, int& y, int sizeFlags);
|
||||||
|
|
||||||
wxWindow *m_parent;
|
// Executes the default message
|
||||||
wxList m_children;
|
virtual long Default();
|
||||||
int m_x,m_y;
|
|
||||||
int m_width,m_height;
|
|
||||||
int m_retCode;
|
|
||||||
wxEvtHandler *m_eventHandler;
|
|
||||||
wxValidator *m_windowValidator;
|
|
||||||
wxDropTarget *m_pDropTarget;
|
|
||||||
wxWindowID m_windowId;
|
|
||||||
wxCursor *m_cursor;
|
|
||||||
wxFont m_font;
|
|
||||||
wxColour m_backgroundColour;
|
|
||||||
wxColour m_defaultBackgroundColour;
|
|
||||||
wxColour m_foregroundColour ;
|
|
||||||
wxColour m_defaultForegroundColour;
|
|
||||||
wxRegion m_updateRegion;
|
|
||||||
long m_windowStyle;
|
|
||||||
bool m_isShown;
|
|
||||||
bool m_isEnabled;
|
|
||||||
wxString m_windowName;
|
|
||||||
|
|
||||||
|
/* TODO: you may need something like this
|
||||||
|
// Determine whether 3D effects are wanted
|
||||||
|
virtual WXDWORD Determine3DEffects(WXDWORD defaultBorderStyle, bool *want3D);
|
||||||
|
*/
|
||||||
|
|
||||||
public: // Layout section
|
virtual void AddChild(wxWindow *child); // Adds reference to the child object
|
||||||
|
virtual void RemoveChild(wxWindow *child); // Removes reference to child
|
||||||
|
// (but doesn't delete the child object)
|
||||||
|
virtual void DestroyChildren(); // Removes and destroys all children
|
||||||
|
|
||||||
wxLayoutConstraints * m_constraints;
|
// Constraint implementation
|
||||||
wxList * m_constraintsInvolvedIn;
|
|
||||||
wxSizer * m_windowSizer;
|
|
||||||
wxWindow * m_sizerParent;
|
|
||||||
bool m_autoLayout;
|
|
||||||
|
|
||||||
wxLayoutConstraints *GetConstraints() const;
|
|
||||||
void SetConstraints( wxLayoutConstraints *constraints );
|
|
||||||
void SetAutoLayout( bool autoLayout );
|
|
||||||
bool GetAutoLayout() const;
|
|
||||||
bool Layout();
|
|
||||||
void SetSizer( wxSizer *sizer );
|
|
||||||
wxSizer *GetSizer() const;
|
|
||||||
void SetSizerParent( wxWindow *win );
|
|
||||||
wxWindow *GetSizerParent() const;
|
|
||||||
void UnsetConstraints(wxLayoutConstraints *c);
|
void UnsetConstraints(wxLayoutConstraints *c);
|
||||||
inline wxList *GetConstraintsInvolvedIn() const ;
|
inline wxList *GetConstraintsInvolvedIn() const ;
|
||||||
|
// Back-pointer to other windows we're involved with, so if we delete
|
||||||
|
// this window, we must delete any constraints we're involved with.
|
||||||
void AddConstraintReference(wxWindow *otherWin);
|
void AddConstraintReference(wxWindow *otherWin);
|
||||||
void RemoveConstraintReference(wxWindow *otherWin);
|
void RemoveConstraintReference(wxWindow *otherWin);
|
||||||
void DeleteRelatedConstraints();
|
void DeleteRelatedConstraints();
|
||||||
|
|
||||||
virtual void ResetConstraints();
|
virtual void ResetConstraints();
|
||||||
virtual void SetConstraintSizes(bool recurse = TRUE);
|
virtual void SetConstraintSizes(bool recurse = TRUE);
|
||||||
virtual bool LayoutPhase1(int *noChanges);
|
virtual bool LayoutPhase1(int *noChanges);
|
||||||
virtual bool LayoutPhase2(int *noChanges);
|
virtual bool LayoutPhase2(int *noChanges);
|
||||||
virtual bool DoPhase(int);
|
virtual bool DoPhase(int);
|
||||||
|
// Transforms from sizer coordinate space to actual
|
||||||
|
// parent coordinate space
|
||||||
virtual void TransformSizerToActual(int *x, int *y) const ;
|
virtual void TransformSizerToActual(int *x, int *y) const ;
|
||||||
|
|
||||||
|
// Set size with transformation to actual coordinates if nec.
|
||||||
virtual void SizerSetSize(int x, int y, int w, int h);
|
virtual void SizerSetSize(int x, int y, int w, int h);
|
||||||
virtual void SizerMove(int x, int y);
|
virtual void SizerMove(int x, int y);
|
||||||
|
|
||||||
|
// Only set/get the size/position of the constraint (if any)
|
||||||
virtual void SetSizeConstraint(int x, int y, int w, int h);
|
virtual void SetSizeConstraint(int x, int y, int w, int h);
|
||||||
virtual void MoveConstraint(int x, int y);
|
virtual void MoveConstraint(int x, int y);
|
||||||
virtual void GetSizeConstraint(int *w, int *h) const ;
|
virtual void GetSizeConstraint(int *w, int *h) const ;
|
||||||
virtual void GetClientSizeConstraint(int *w, int *h) const ;
|
virtual void GetClientSizeConstraint(int *w, int *h) const ;
|
||||||
virtual void GetPositionConstraint(int *x, int *y) const ;
|
virtual void GetPositionConstraint(int *x, int *y) const ;
|
||||||
|
|
||||||
DECLARE_DYNAMIC_CLASS(wxWindow)
|
wxObject *GetChild(int number) const ;
|
||||||
DECLARE_EVENT_TABLE()
|
|
||||||
|
inline void SetShowing(bool show);
|
||||||
|
inline bool IsUserEnabled() const;
|
||||||
|
inline bool GetTransparentBackground() const ;
|
||||||
|
|
||||||
|
// Responds to colour changes: passes event on to children.
|
||||||
|
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
||||||
|
|
||||||
|
// Transfers data to any child controls
|
||||||
|
void OnInitDialog(wxInitDialogEvent& event);
|
||||||
|
|
||||||
|
// Sends an OnInitDialog event, which in turns transfers data to
|
||||||
|
// to the window via validators.
|
||||||
|
virtual void InitDialog();
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////
|
||||||
|
//// PROTECTED DATA
|
||||||
|
protected:
|
||||||
|
int m_windowId;
|
||||||
|
long m_windowStyle; // Store the window's style
|
||||||
|
wxEvtHandler * m_windowEventHandler; // Usually is 'this'
|
||||||
|
wxLayoutConstraints * m_constraints; // Constraints for this window
|
||||||
|
wxList * m_constraintsInvolvedIn; // List of constraints we're involved in
|
||||||
|
wxSizer * m_windowSizer; // Window's top-level sizer (if any)
|
||||||
|
wxWindow * m_sizerParent; // Window's parent sizer (if any)
|
||||||
|
bool m_autoLayout; // Whether to call Layout() in OnSize
|
||||||
|
wxWindow * m_windowParent; // Each window always knows its parent
|
||||||
|
wxValidator * m_windowValidator;
|
||||||
|
int m_minSizeX;
|
||||||
|
int m_minSizeY;
|
||||||
|
int m_maxSizeX;
|
||||||
|
int m_maxSizeY;
|
||||||
|
|
||||||
|
// Caret data
|
||||||
|
int m_caretWidth;
|
||||||
|
int m_caretHeight;
|
||||||
|
bool m_caretEnabled;
|
||||||
|
bool m_caretShown;
|
||||||
|
wxFont m_windowFont; // Window's font
|
||||||
|
wxCursor m_windowCursor; // Window's cursor
|
||||||
|
wxString m_windowName; // Window name
|
||||||
|
|
||||||
|
wxButton * m_defaultItem;
|
||||||
|
|
||||||
|
wxColour m_backgroundColour ;
|
||||||
|
wxColour m_foregroundColour ;
|
||||||
|
wxColour m_defaultBackgroundColour;
|
||||||
|
wxColour m_defaultForegroundColour;
|
||||||
|
|
||||||
|
#if USE_DRAG_AND_DROP
|
||||||
|
wxDropTarget *m_pDropTarget; // the current drop target or NULL
|
||||||
|
#endif //USE_DRAG_AND_DROP
|
||||||
|
|
||||||
|
public:
|
||||||
|
wxRegion m_updateRegion;
|
||||||
|
wxList * m_children; // Window's children
|
||||||
|
int m_returnCode;
|
||||||
|
|
||||||
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // __GTKWINDOWH__
|
////////////////////////////////////////////////////////////////////////
|
||||||
|
//// INLINES
|
||||||
|
|
||||||
|
inline void *wxWindow::GetHandle() const { return (void *)NULL; }
|
||||||
|
inline int wxWindow::GetId() const { return m_windowId; }
|
||||||
|
inline void wxWindow::SetId(int id) { m_windowId = id; }
|
||||||
|
inline wxWindow *wxWindow::GetParent() const { return m_windowParent; }
|
||||||
|
inline void wxWindow::SetParent(wxWindow *p) { m_windowParent = p; }
|
||||||
|
inline wxWindow *wxWindow::GetGrandParent() const { return (m_windowParent ? m_windowParent->m_windowParent : NULL); }
|
||||||
|
inline wxList *wxWindow::GetChildren() const { return m_children; }
|
||||||
|
inline wxFont *wxWindow::GetFont() const { return (wxFont *) & m_windowFont; }
|
||||||
|
inline wxString wxWindow::GetName() const { return m_windowName; }
|
||||||
|
inline void wxWindow::SetName(const wxString& name) { m_windowName = name; }
|
||||||
|
inline long wxWindow::GetWindowStyleFlag() const { return m_windowStyle; }
|
||||||
|
inline void wxWindow::SetWindowStyleFlag(long flag) { m_windowStyle = flag; }
|
||||||
|
inline void wxWindow::SetDoubleClick(bool flag) { m_doubleClickAllowed = flag; }
|
||||||
|
inline bool wxWindow::GetDoubleClick() const { return m_doubleClickAllowed; }
|
||||||
|
inline void wxWindow::SetEventHandler(wxEvtHandler *handler) { m_windowEventHandler = handler; }
|
||||||
|
inline wxEvtHandler *wxWindow::GetEventHandler() const { return m_windowEventHandler; }
|
||||||
|
inline void wxWindow::SetAutoLayout(bool a) { m_autoLayout = a; }
|
||||||
|
inline bool wxWindow::GetAutoLayout() const { return m_autoLayout; }
|
||||||
|
inline wxLayoutConstraints *wxWindow::GetConstraints() const { return m_constraints; }
|
||||||
|
inline void wxWindow::SetBackgroundColour(const wxColour& col) { m_backgroundColour = col; };
|
||||||
|
inline wxColour wxWindow::GetBackgroundColour() const { return m_backgroundColour; };
|
||||||
|
inline void wxWindow::SetForegroundColour(const wxColour& col) { m_foregroundColour = col; };
|
||||||
|
inline wxColour wxWindow::GetForegroundColour() const { return m_foregroundColour; };
|
||||||
|
inline void wxWindow::SetDefaultForegroundColour(const wxColour& col) { m_defaultForegroundColour = col; };
|
||||||
|
inline wxColour wxWindow::GetDefaultForegroundColour(void) const { return m_defaultForegroundColour; };
|
||||||
|
inline void wxWindow::SetDefaultBackgroundColour(const wxColour& col) { m_defaultBackgroundColour = col; };
|
||||||
|
inline wxColour wxWindow::GetDefaultBackgroundColour(void) const { return m_defaultBackgroundColour; };
|
||||||
|
|
||||||
|
inline wxButton *wxWindow::GetDefaultItem() const { return m_defaultItem; }
|
||||||
|
inline void wxWindow::SetDefaultItem(wxButton *but) { m_defaultItem = but; }
|
||||||
|
inline bool wxWindow::IsRetained() const { return ((m_windowStyle & wxRETAINED) == wxRETAINED); }
|
||||||
|
|
||||||
|
inline void wxWindow::SetShowing(bool show) { m_isShown = show; }
|
||||||
|
inline wxList *wxWindow::GetConstraintsInvolvedIn() const { return m_constraintsInvolvedIn; }
|
||||||
|
inline wxSizer *wxWindow::GetSizer() const { return m_windowSizer; }
|
||||||
|
inline wxWindow *wxWindow::GetSizerParent() const { return m_sizerParent; }
|
||||||
|
inline void wxWindow::SetSizerParent(wxWindow *win) { m_sizerParent = win; }
|
||||||
|
inline wxValidator *wxWindow::GetValidator() const { return m_windowValidator; }
|
||||||
|
inline bool wxWindow::IsUserEnabled() const { return m_winEnabled; }
|
||||||
|
inline bool wxWindow::GetTransparentBackground() const { return m_backgroundTransparent; }
|
||||||
|
inline void wxWindow::SetReturnCode(int retCode) { m_returnCode = retCode; }
|
||||||
|
inline int wxWindow::GetReturnCode() { return m_returnCode; }
|
||||||
|
|
||||||
|
// Get the active window.
|
||||||
|
wxWindow* WXDLLEXPORT wxGetActiveWindow();
|
||||||
|
|
||||||
|
WXDLLEXPORT_DATA(extern wxList) wxTopLevelWindows;
|
||||||
|
|
||||||
|
#endif
|
||||||
|
// _WX_WINDOW_H_
|
||||||
|
|||||||
525
src/qt/app.cpp
525
src/qt/app.cpp
@@ -1,10 +1,11 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: app.cpp
|
// Name: app.cpp
|
||||||
// Purpose:
|
// Purpose: wxApp
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@@ -12,223 +13,60 @@
|
|||||||
#pragma implementation "app.h"
|
#pragma implementation "app.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "wx/frame.h"
|
||||||
#include "wx/app.h"
|
#include "wx/app.h"
|
||||||
#include "wx/gdicmn.h"
|
|
||||||
#include "wx/utils.h"
|
#include "wx/utils.h"
|
||||||
#include "wx/postscrp.h"
|
#include "wx/gdicmn.h"
|
||||||
#include "wx/intl.h"
|
#include "wx/pen.h"
|
||||||
|
#include "wx/brush.h"
|
||||||
|
#include "wx/cursor.h"
|
||||||
|
#include "wx/icon.h"
|
||||||
|
#include "wx/palette.h"
|
||||||
|
#include "wx/dc.h"
|
||||||
|
#include "wx/dialog.h"
|
||||||
|
#include "wx/msgdlg.h"
|
||||||
#include "wx/log.h"
|
#include "wx/log.h"
|
||||||
#include "wx/memory.h"
|
#include "wx/module.h"
|
||||||
|
|
||||||
#include "unistd.h"
|
#if USE_WX_RESOURCES
|
||||||
|
#include "wx/resource.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
#include <string.h>
|
||||||
// global data
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
wxApp *wxTheApp = NULL;
|
|
||||||
wxAppInitializerFunction wxApp::m_appInitFn = (wxAppInitializerFunction) NULL;
|
|
||||||
|
|
||||||
|
#if defined(__WIN95__) && !defined(__GNUWIN32__)
|
||||||
|
extern char *wxBuffer;
|
||||||
extern wxList wxPendingDelete;
|
extern wxList wxPendingDelete;
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
wxApp *wxTheApp = NULL;
|
||||||
// local functions
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
extern void wxFlushResources(void);
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// global functions
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
void wxExit(void)
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
bool wxYield(void)
|
|
||||||
{
|
|
||||||
return TRUE;
|
|
||||||
};
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// wxApp
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxApp,wxEvtHandler)
|
|
||||||
|
|
||||||
|
#if !USE_SHARED_LIBRARY
|
||||||
|
IMPLEMENT_DYNAMIC_CLASS(wxApp, wxEvtHandler)
|
||||||
BEGIN_EVENT_TABLE(wxApp, wxEvtHandler)
|
BEGIN_EVENT_TABLE(wxApp, wxEvtHandler)
|
||||||
EVT_IDLE(wxApp::OnIdle)
|
EVT_IDLE(wxApp::OnIdle)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
wxApp::wxApp()
|
|
||||||
{
|
|
||||||
m_topWindow = NULL;
|
|
||||||
m_exitOnFrameDelete = TRUE;
|
|
||||||
};
|
|
||||||
|
|
||||||
wxApp::~wxApp(void)
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
bool wxApp::OnInit(void)
|
|
||||||
{
|
|
||||||
return TRUE;
|
|
||||||
};
|
|
||||||
|
|
||||||
bool wxApp::OnInitGui(void)
|
|
||||||
{
|
|
||||||
return TRUE;
|
|
||||||
};
|
|
||||||
|
|
||||||
int wxApp::OnRun(void)
|
|
||||||
{
|
|
||||||
return MainLoop();
|
|
||||||
};
|
|
||||||
|
|
||||||
bool wxApp::ProcessIdle(void)
|
|
||||||
{
|
|
||||||
wxIdleEvent event;
|
|
||||||
event.SetEventObject( this );
|
|
||||||
ProcessEvent( event );
|
|
||||||
|
|
||||||
return event.MoreRequested();
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxApp::OnIdle( wxIdleEvent &event )
|
|
||||||
{
|
|
||||||
static bool inOnIdle = FALSE;
|
|
||||||
|
|
||||||
// Avoid recursion (via ProcessEvent default case)
|
|
||||||
if (inOnIdle)
|
|
||||||
return;
|
|
||||||
|
|
||||||
inOnIdle = TRUE;
|
|
||||||
|
|
||||||
// 'Garbage' collection of windows deleted with Close().
|
|
||||||
DeletePendingObjects();
|
|
||||||
|
|
||||||
// flush the logged messages if any
|
|
||||||
wxLog *pLog = wxLog::GetActiveTarget();
|
|
||||||
if ( pLog != NULL && pLog->HasPendingMessages() )
|
|
||||||
pLog->Flush();
|
|
||||||
|
|
||||||
// Send OnIdle events to all windows
|
|
||||||
bool needMore = SendIdleEvents();
|
|
||||||
|
|
||||||
if (needMore)
|
|
||||||
event.RequestMore(TRUE);
|
|
||||||
|
|
||||||
inOnIdle = FALSE;
|
|
||||||
};
|
|
||||||
|
|
||||||
bool wxApp::SendIdleEvents(void)
|
|
||||||
{
|
|
||||||
bool needMore = FALSE;
|
|
||||||
wxNode* node = wxTopLevelWindows.First();
|
|
||||||
while (node)
|
|
||||||
{
|
|
||||||
wxWindow* win = (wxWindow*) node->Data();
|
|
||||||
if (SendIdleEvents(win))
|
|
||||||
needMore = TRUE;
|
|
||||||
|
|
||||||
node = node->Next();
|
|
||||||
}
|
|
||||||
return needMore;
|
|
||||||
};
|
|
||||||
|
|
||||||
bool wxApp::SendIdleEvents( wxWindow* win )
|
|
||||||
{
|
|
||||||
bool needMore = FALSE;
|
|
||||||
|
|
||||||
wxIdleEvent event;
|
|
||||||
event.SetEventObject(win);
|
|
||||||
win->ProcessEvent(event);
|
|
||||||
|
|
||||||
if (event.MoreRequested())
|
|
||||||
needMore = TRUE;
|
|
||||||
|
|
||||||
wxNode* node = win->GetChildren()->First();
|
|
||||||
while (node)
|
|
||||||
{
|
|
||||||
wxWindow* win = (wxWindow*) node->Data();
|
|
||||||
if (SendIdleEvents(win))
|
|
||||||
needMore = TRUE;
|
|
||||||
|
|
||||||
node = node->Next();
|
|
||||||
}
|
|
||||||
return needMore ;
|
|
||||||
};
|
|
||||||
|
|
||||||
int wxApp::OnExit(void)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
int wxApp::MainLoop(void)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxApp::ExitMainLoop(void)
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
bool wxApp::Initialized(void)
|
|
||||||
{
|
|
||||||
return m_initialized;
|
|
||||||
};
|
|
||||||
|
|
||||||
bool wxApp::Pending(void)
|
|
||||||
{
|
|
||||||
return FALSE;
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxApp::Dispatch(void)
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxApp::DeletePendingObjects(void)
|
|
||||||
{
|
|
||||||
wxNode *node = wxPendingDelete.First();
|
|
||||||
while (node)
|
|
||||||
{
|
|
||||||
wxObject *obj = (wxObject *)node->Data();
|
|
||||||
|
|
||||||
delete obj;
|
|
||||||
|
|
||||||
if (wxPendingDelete.Member(obj))
|
|
||||||
delete node;
|
|
||||||
|
|
||||||
node = wxPendingDelete.First();
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
wxWindow *wxApp::GetTopWindow(void)
|
|
||||||
{
|
|
||||||
if (m_topWindow) return m_topWindow;
|
|
||||||
wxNode *node = wxTopLevelWindows.First();
|
|
||||||
if (!node) return NULL;
|
|
||||||
return (wxWindow*)node->Data();
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxApp::SetTopWindow( wxWindow *win )
|
|
||||||
{
|
|
||||||
m_topWindow = win;
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxApp::CommonInit(void)
|
|
||||||
{
|
|
||||||
|
|
||||||
/*
|
|
||||||
#if USE_RESOURCES
|
|
||||||
(void) wxGetResource("wxWindows", "OsVersion", &wxOsVersion);
|
|
||||||
#endif
|
#endif
|
||||||
*/
|
|
||||||
|
long wxApp::sm_lastMessageTime = 0;
|
||||||
|
|
||||||
|
void wxApp::CommonInit()
|
||||||
|
{
|
||||||
|
#ifdef __WXMSW__
|
||||||
|
wxBuffer = new char[1500];
|
||||||
|
#else
|
||||||
|
wxBuffer = new char[BUFSIZ + 512];
|
||||||
|
#endif
|
||||||
|
|
||||||
|
wxClassInfo::InitializeClasses();
|
||||||
|
|
||||||
wxTheColourDatabase = new wxColourDatabase(wxKEY_STRING);
|
wxTheColourDatabase = new wxColourDatabase(wxKEY_STRING);
|
||||||
wxTheColourDatabase->Initialize();
|
wxTheColourDatabase->Initialize();
|
||||||
wxInitializeStockObjects();
|
wxInitializeStockObjects();
|
||||||
|
|
||||||
|
#if USE_WX_RESOURCES
|
||||||
|
wxInitializeResourceSystem();
|
||||||
|
#endif
|
||||||
|
|
||||||
// For PostScript printing
|
// For PostScript printing
|
||||||
#if USE_POSTSCRIPT
|
#if USE_POSTSCRIPT
|
||||||
wxInitializePrintSetupData();
|
wxInitializePrintSetupData();
|
||||||
@@ -236,36 +74,55 @@ void wxApp::CommonInit(void)
|
|||||||
wxThePrintPaperDatabase->CreateDatabase();
|
wxThePrintPaperDatabase->CreateDatabase();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
wxBitmap::InitStandardHandlers();
|
wxBitmap::InitStandardHandlers();
|
||||||
|
|
||||||
g_globalCursor = new wxCursor;
|
wxModule::RegisterModules();
|
||||||
*/
|
wxASSERT( wxModule::InitializeModules() == TRUE );
|
||||||
|
|
||||||
wxInitializeStockObjects();
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxApp::CommonCleanUp(void)
|
|
||||||
{
|
|
||||||
wxDeleteStockObjects();
|
|
||||||
|
|
||||||
wxFlushResources();
|
|
||||||
};
|
|
||||||
|
|
||||||
wxLog *wxApp::CreateLogTarget()
|
|
||||||
{
|
|
||||||
return new wxLogGui;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
void wxApp::CommonCleanUp()
|
||||||
// wxEntry
|
{
|
||||||
//-----------------------------------------------------------------------------
|
wxModule::CleanUpModules();
|
||||||
|
|
||||||
|
#if USE_WX_RESOURCES
|
||||||
|
wxCleanUpResourceSystem();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
wxDeleteStockObjects() ;
|
||||||
|
|
||||||
|
// Destroy all GDI lists, etc.
|
||||||
|
delete wxTheBrushList;
|
||||||
|
wxTheBrushList = NULL;
|
||||||
|
|
||||||
|
delete wxThePenList;
|
||||||
|
wxThePenList = NULL;
|
||||||
|
|
||||||
|
delete wxTheFontList;
|
||||||
|
wxTheFontList = NULL;
|
||||||
|
|
||||||
|
delete wxTheBitmapList;
|
||||||
|
wxTheBitmapList = NULL;
|
||||||
|
|
||||||
|
delete wxTheColourDatabase;
|
||||||
|
wxTheColourDatabase = NULL;
|
||||||
|
|
||||||
|
#if USE_POSTSCRIPT
|
||||||
|
wxInitializePrintSetupData(FALSE);
|
||||||
|
delete wxThePrintPaperDatabase;
|
||||||
|
wxThePrintPaperDatabase = NULL;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
wxBitmap::CleanUpHandlers();
|
||||||
|
|
||||||
|
delete[] wxBuffer;
|
||||||
|
wxBuffer = NULL;
|
||||||
|
|
||||||
|
// do it as the very last thing because everything else can log messages
|
||||||
|
delete wxLog::SetActiveTarget(NULL);
|
||||||
|
}
|
||||||
|
|
||||||
int wxEntry( int argc, char *argv[] )
|
int wxEntry( int argc, char *argv[] )
|
||||||
{
|
{
|
||||||
wxBuffer = new char[BUFSIZ + 512];
|
|
||||||
|
|
||||||
wxClassInfo::InitializeClasses();
|
wxClassInfo::InitializeClasses();
|
||||||
|
|
||||||
#if (WXDEBUG && USE_MEMORY_TRACING) || USE_DEBUG_CONTEXT
|
#if (WXDEBUG && USE_MEMORY_TRACING) || USE_DEBUG_CONTEXT
|
||||||
@@ -288,13 +145,7 @@ int wxEntry( int argc, char *argv[] )
|
|||||||
return 0;
|
return 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
wxAppInitializerFunction app_ini = wxApp::GetInitializerFunction();
|
wxTheApp = (* wxApp::GetInitializerFunction()) ();
|
||||||
|
|
||||||
wxObject *test_app = app_ini();
|
|
||||||
|
|
||||||
wxTheApp = (wxApp*) test_app;
|
|
||||||
|
|
||||||
// wxTheApp = (wxApp*)( app_ini() );
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!wxTheApp)
|
if (!wxTheApp)
|
||||||
@@ -303,15 +154,14 @@ int wxEntry( int argc, char *argv[] )
|
|||||||
return 0;
|
return 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
// printf( "Programmstart.\n" );
|
|
||||||
|
|
||||||
wxTheApp->argc = argc;
|
wxTheApp->argc = argc;
|
||||||
wxTheApp->argv = argv;
|
wxTheApp->argv = argv;
|
||||||
|
|
||||||
// Your init here !!!!
|
// TODO: your platform-specific initialization.
|
||||||
|
|
||||||
wxApp::CommonInit();
|
wxApp::CommonInit();
|
||||||
|
|
||||||
|
// GUI-specific initialization, such as creating an app context.
|
||||||
wxTheApp->OnInitGui();
|
wxTheApp->OnInitGui();
|
||||||
|
|
||||||
// Here frames insert themselves automatically
|
// Here frames insert themselves automatically
|
||||||
@@ -349,18 +199,197 @@ int wxEntry( int argc, char *argv[] )
|
|||||||
return retValue;
|
return retValue;
|
||||||
};
|
};
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
// Static member initialization
|
||||||
// main()
|
wxAppInitializerFunction wxApp::m_appInitFn = (wxAppInitializerFunction) NULL;
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
#if defined(AIX) || defined(AIX4) || defined(____HPUX__)
|
|
||||||
|
|
||||||
// main in IMPLEMENT_WX_MAIN in IMPLEMENT_APP in app.h
|
|
||||||
|
|
||||||
|
wxApp::wxApp()
|
||||||
|
{
|
||||||
|
m_topWindow = NULL;
|
||||||
|
wxTheApp = this;
|
||||||
|
m_className = "";
|
||||||
|
m_wantDebugOutput = TRUE ;
|
||||||
|
m_appName = "";
|
||||||
|
argc = 0;
|
||||||
|
argv = NULL;
|
||||||
|
#ifdef __WXMSW__
|
||||||
|
m_printMode = wxPRINT_WINDOWS;
|
||||||
#else
|
#else
|
||||||
|
m_printMode = wxPRINT_POSTSCRIPT;
|
||||||
int main(int argc, char *argv[]) { return wxEntry(argc, argv); }
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
m_exitOnFrameDelete = TRUE;
|
||||||
|
m_auto3D = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxApp::Initialized()
|
||||||
|
{
|
||||||
|
if (GetTopWindow())
|
||||||
|
return TRUE;
|
||||||
|
else
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
int wxApp::MainLoop()
|
||||||
|
{
|
||||||
|
m_keepGoing = TRUE;
|
||||||
|
|
||||||
|
/* TODO: implement your main loop here, calling ProcessIdle in idle time.
|
||||||
|
while (m_keepGoing)
|
||||||
|
{
|
||||||
|
while (!::PeekMessage(&s_currentMsg, 0, 0, 0, PM_NOREMOVE) &&
|
||||||
|
ProcessIdle()) {}
|
||||||
|
if (!DoMessage())
|
||||||
|
m_keepGoing = FALSE;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Returns TRUE if more time is needed.
|
||||||
|
bool wxApp::ProcessIdle()
|
||||||
|
{
|
||||||
|
wxIdleEvent event;
|
||||||
|
event.SetEventObject(this);
|
||||||
|
ProcessEvent(event);
|
||||||
|
|
||||||
|
return event.MoreRequested();
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxApp::ExitMainLoop()
|
||||||
|
{
|
||||||
|
m_keepGoing = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Is a message/event pending?
|
||||||
|
bool wxApp::Pending()
|
||||||
|
{
|
||||||
|
/* TODO.
|
||||||
|
*/
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Dispatch a message.
|
||||||
|
void wxApp::Dispatch()
|
||||||
|
{
|
||||||
|
/* TODO.
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxApp::OnIdle(wxIdleEvent& event)
|
||||||
|
{
|
||||||
|
static bool inOnIdle = FALSE;
|
||||||
|
|
||||||
|
// Avoid recursion (via ProcessEvent default case)
|
||||||
|
if (inOnIdle)
|
||||||
|
return;
|
||||||
|
|
||||||
|
inOnIdle = TRUE;
|
||||||
|
|
||||||
|
// 'Garbage' collection of windows deleted with Close().
|
||||||
|
DeletePendingObjects();
|
||||||
|
|
||||||
|
// flush the logged messages if any
|
||||||
|
wxLog *pLog = wxLog::GetActiveTarget();
|
||||||
|
if ( pLog != NULL && pLog->HasPendingMessages() )
|
||||||
|
pLog->Flush();
|
||||||
|
|
||||||
|
// Send OnIdle events to all windows
|
||||||
|
bool needMore = SendIdleEvents();
|
||||||
|
|
||||||
|
if (needMore)
|
||||||
|
event.RequestMore(TRUE);
|
||||||
|
|
||||||
|
inOnIdle = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Send idle event to all top-level windows
|
||||||
|
bool wxApp::SendIdleEvents()
|
||||||
|
{
|
||||||
|
bool needMore = FALSE;
|
||||||
|
wxNode* node = wxTopLevelWindows.First();
|
||||||
|
while (node)
|
||||||
|
{
|
||||||
|
wxWindow* win = (wxWindow*) node->Data();
|
||||||
|
if (SendIdleEvents(win))
|
||||||
|
needMore = TRUE;
|
||||||
|
|
||||||
|
node = node->Next();
|
||||||
|
}
|
||||||
|
return needMore;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Send idle event to window and all subwindows
|
||||||
|
bool wxApp::SendIdleEvents(wxWindow* win)
|
||||||
|
{
|
||||||
|
bool needMore = FALSE;
|
||||||
|
|
||||||
|
wxIdleEvent event;
|
||||||
|
event.SetEventObject(win);
|
||||||
|
win->ProcessEvent(event);
|
||||||
|
|
||||||
|
if (event.MoreRequested())
|
||||||
|
needMore = TRUE;
|
||||||
|
|
||||||
|
wxNode* node = win->GetChildren()->First();
|
||||||
|
while (node)
|
||||||
|
{
|
||||||
|
wxWindow* win = (wxWindow*) node->Data();
|
||||||
|
if (SendIdleEvents(win))
|
||||||
|
needMore = TRUE;
|
||||||
|
|
||||||
|
node = node->Next();
|
||||||
|
}
|
||||||
|
return needMore ;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxApp::DeletePendingObjects()
|
||||||
|
{
|
||||||
|
wxNode *node = wxPendingDelete.First();
|
||||||
|
while (node)
|
||||||
|
{
|
||||||
|
wxObject *obj = (wxObject *)node->Data();
|
||||||
|
|
||||||
|
delete obj;
|
||||||
|
|
||||||
|
if (wxPendingDelete.Member(obj))
|
||||||
|
delete node;
|
||||||
|
|
||||||
|
// Deleting one object may have deleted other pending
|
||||||
|
// objects, so start from beginning of list again.
|
||||||
|
node = wxPendingDelete.First();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
wxLog* wxApp::CreateLogTarget()
|
||||||
|
{
|
||||||
|
return new wxLogGui;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxWindow* wxApp::GetTopWindow() const
|
||||||
|
{
|
||||||
|
if (m_topWindow)
|
||||||
|
return m_topWindow;
|
||||||
|
else if (wxTopLevelWindows.Number() > 0)
|
||||||
|
return (wxWindow*) wxTopLevelWindows.First()->Data();
|
||||||
|
else
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxExit()
|
||||||
|
{
|
||||||
|
wxApp::CommonCleanUp();
|
||||||
|
/*
|
||||||
|
* TODO: Exit in some platform-specific way. Not recommended that the app calls this:
|
||||||
|
* only for emergencies.
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
// Yield to other processes
|
||||||
|
bool wxYield()
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* TODO
|
||||||
|
*/
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,237 +1,430 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: bitmap.cpp
|
// Name: bitmap.cpp
|
||||||
// Purpose:
|
// Purpose: wxBitmap
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
|
// Created: ??/??/98
|
||||||
// RCS-ID: $Id$
|
// RCS-ID: $Id$
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma implementation "bitmap.h"
|
#pragma implementation "bitmap.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "wx/setup.h"
|
||||||
|
#include "wx/utils.h"
|
||||||
|
#include "wx/palette.h"
|
||||||
#include "wx/bitmap.h"
|
#include "wx/bitmap.h"
|
||||||
|
#include "wx/icon.h"
|
||||||
|
#include "wx/log.h"
|
||||||
|
|
||||||
|
#if !USE_SHARED_LIBRARIES
|
||||||
|
IMPLEMENT_DYNAMIC_CLASS(wxBitmap, wxGDIObject)
|
||||||
|
IMPLEMENT_DYNAMIC_CLASS(wxMask, wxObject)
|
||||||
|
#endif
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
wxBitmapRefData::wxBitmapRefData()
|
||||||
// wxMask
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxMask,wxObject)
|
|
||||||
|
|
||||||
wxMask::wxMask(void)
|
|
||||||
{
|
{
|
||||||
};
|
m_ok = FALSE;
|
||||||
|
m_width = 0;
|
||||||
wxMask::wxMask( const wxBitmap& WXUNUSED(bitmap), const wxColour& WXUNUSED(colour) )
|
m_height = 0;
|
||||||
{
|
m_depth = 0;
|
||||||
};
|
m_quality = 0;
|
||||||
|
m_numColors = 0;
|
||||||
wxMask::wxMask( const wxBitmap& WXUNUSED(bitmap), int WXUNUSED(paletteIndex) )
|
m_bitmapMask = NULL;
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
wxMask::wxMask( const wxBitmap& WXUNUSED(bitmap) )
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
wxMask::~wxMask(void)
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// wxBitmap
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxBitmapRefData: public wxObjectRefData
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
wxBitmapRefData(void);
|
|
||||||
~wxBitmapRefData(void);
|
|
||||||
|
|
||||||
wxMask *m_mask;
|
|
||||||
int m_width;
|
|
||||||
int m_height;
|
|
||||||
int m_bpp;
|
|
||||||
wxPalette *m_palette;
|
|
||||||
};
|
|
||||||
|
|
||||||
wxBitmapRefData::wxBitmapRefData(void)
|
|
||||||
{
|
|
||||||
m_mask = NULL;
|
|
||||||
m_width = 0;
|
|
||||||
m_height = 0;
|
|
||||||
m_bpp = 0;
|
|
||||||
m_palette = NULL;
|
|
||||||
};
|
|
||||||
|
|
||||||
wxBitmapRefData::~wxBitmapRefData(void)
|
|
||||||
{
|
|
||||||
if (m_mask) delete m_mask;
|
|
||||||
if (m_palette) delete m_palette;
|
|
||||||
};
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
#define M_BMPDATA ((wxBitmapRefData *)m_refData)
|
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxBitmap,wxGDIObject)
|
|
||||||
|
|
||||||
wxBitmap::wxBitmap(void)
|
|
||||||
{
|
|
||||||
if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this);
|
|
||||||
};
|
|
||||||
|
|
||||||
wxBitmap::wxBitmap( int width, int height, int depth )
|
|
||||||
{
|
|
||||||
m_refData = new wxBitmapRefData();
|
|
||||||
M_BMPDATA->m_mask = NULL;
|
|
||||||
M_BMPDATA->m_width = width;
|
|
||||||
M_BMPDATA->m_height = height;
|
|
||||||
M_BMPDATA->m_bpp = depth;
|
|
||||||
|
|
||||||
if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this);
|
|
||||||
};
|
|
||||||
|
|
||||||
wxBitmap::wxBitmap( char **WXUNUSED(bits) )
|
|
||||||
{
|
|
||||||
m_refData = new wxBitmapRefData();
|
|
||||||
|
|
||||||
if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this);
|
|
||||||
};
|
|
||||||
|
|
||||||
wxBitmap::wxBitmap( const wxBitmap& bmp )
|
|
||||||
{
|
|
||||||
Ref( bmp );
|
|
||||||
|
|
||||||
if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this);
|
|
||||||
};
|
|
||||||
|
|
||||||
wxBitmap::wxBitmap( const wxBitmap* bmp )
|
|
||||||
{
|
|
||||||
if (bmp) Ref( *bmp );
|
|
||||||
|
|
||||||
if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this);
|
|
||||||
};
|
|
||||||
|
|
||||||
wxBitmap::wxBitmap( const wxString &filename, int type )
|
|
||||||
{
|
|
||||||
LoadFile( filename, type );
|
|
||||||
};
|
|
||||||
|
|
||||||
wxBitmap::wxBitmap( const char WXUNUSED(bits)[], int width, int height, int WXUNUSED(depth))
|
|
||||||
{
|
|
||||||
m_refData = new wxBitmapRefData();
|
|
||||||
|
|
||||||
M_BMPDATA->m_mask = NULL;
|
|
||||||
M_BMPDATA->m_width = width;
|
|
||||||
M_BMPDATA->m_height = height;
|
|
||||||
M_BMPDATA->m_bpp = 1;
|
|
||||||
|
|
||||||
if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
wxBitmap::~wxBitmap(void)
|
|
||||||
{
|
|
||||||
if (wxTheBitmapList) wxTheBitmapList->DeleteObject(this);
|
|
||||||
};
|
|
||||||
|
|
||||||
wxBitmap& wxBitmap::operator = ( const wxBitmap& bmp )
|
|
||||||
{
|
|
||||||
if (*this == bmp) return (*this);
|
|
||||||
Ref( bmp );
|
|
||||||
return *this;
|
|
||||||
};
|
|
||||||
|
|
||||||
bool wxBitmap::operator == ( const wxBitmap& bmp )
|
|
||||||
{
|
|
||||||
return m_refData == bmp.m_refData;
|
|
||||||
};
|
|
||||||
|
|
||||||
bool wxBitmap::operator != ( const wxBitmap& bmp )
|
|
||||||
{
|
|
||||||
return m_refData != bmp.m_refData;
|
|
||||||
};
|
|
||||||
|
|
||||||
bool wxBitmap::Ok(void) const
|
|
||||||
{
|
|
||||||
return m_refData != NULL;
|
|
||||||
};
|
|
||||||
|
|
||||||
int wxBitmap::GetHeight(void) const
|
|
||||||
{
|
|
||||||
if (!Ok()) return 0;
|
|
||||||
return M_BMPDATA->m_height;
|
|
||||||
};
|
|
||||||
|
|
||||||
int wxBitmap::GetWidth(void) const
|
wxBitmapRefData::~wxBitmapRefData()
|
||||||
{
|
{
|
||||||
if (!Ok()) return 0;
|
/*
|
||||||
return M_BMPDATA->m_width;
|
* TODO: delete the bitmap data here.
|
||||||
};
|
*/
|
||||||
|
|
||||||
int wxBitmap::GetDepth(void) const
|
if (m_bitmapMask)
|
||||||
{
|
delete m_bitmapMask;
|
||||||
if (!Ok()) return 0;
|
m_bitmapMask = NULL;
|
||||||
return M_BMPDATA->m_bpp;
|
}
|
||||||
};
|
|
||||||
|
|
||||||
void wxBitmap::SetHeight( int height )
|
wxList wxBitmap::sm_handlers;
|
||||||
{
|
|
||||||
if (!Ok()) return;
|
|
||||||
M_BMPDATA->m_height = height;
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxBitmap::SetWidth( int width )
|
wxBitmap::wxBitmap()
|
||||||
{
|
{
|
||||||
if (!Ok()) return;
|
m_refData = NULL;
|
||||||
M_BMPDATA->m_width = width;
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxBitmap::SetDepth( int depth )
|
if ( wxTheBitmapList )
|
||||||
{
|
wxTheBitmapList->AddBitmap(this);
|
||||||
if (!Ok()) return;
|
}
|
||||||
M_BMPDATA->m_bpp = depth;
|
|
||||||
};
|
|
||||||
|
|
||||||
wxMask *wxBitmap::GetMask(void) const
|
wxBitmap::~wxBitmap()
|
||||||
{
|
{
|
||||||
if (!Ok()) return NULL;
|
if (wxTheBitmapList)
|
||||||
|
wxTheBitmapList->DeleteObject(this);
|
||||||
return M_BMPDATA->m_mask;
|
}
|
||||||
};
|
|
||||||
|
|
||||||
void wxBitmap::SetMask( wxMask *mask )
|
wxBitmap::wxBitmap(const char bits[], int the_width, int the_height, int no_bits)
|
||||||
{
|
{
|
||||||
if (!Ok()) return;
|
m_refData = new wxBitmapRefData;
|
||||||
|
|
||||||
if (M_BMPDATA->m_mask) delete M_BMPDATA->m_mask;
|
|
||||||
M_BMPDATA->m_mask = mask;
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxBitmap::Resize( int WXUNUSED(height), int WXUNUSED(width) )
|
M_BITMAPDATA->m_width = the_width ;
|
||||||
{
|
M_BITMAPDATA->m_height = the_height ;
|
||||||
if (!Ok()) return;
|
M_BITMAPDATA->m_depth = no_bits ;
|
||||||
|
M_BITMAPDATA->m_numColors = 0;
|
||||||
};
|
|
||||||
|
|
||||||
bool wxBitmap::SaveFile( const wxString &WXUNUSED(name), int WXUNUSED(type),
|
/* TODO: create the bitmap from data */
|
||||||
wxPalette *WXUNUSED(palette) )
|
|
||||||
{
|
|
||||||
return FALSE;
|
|
||||||
};
|
|
||||||
|
|
||||||
bool wxBitmap::LoadFile( const wxString &WXUNUSED(name), int WXUNUSED(type) )
|
if ( wxTheBitmapList )
|
||||||
{
|
wxTheBitmapList->AddBitmap(this);
|
||||||
return FALSE;
|
}
|
||||||
};
|
|
||||||
|
|
||||||
wxPalette *wxBitmap::GetPalette(void) const
|
|
||||||
{
|
|
||||||
if (!Ok()) return NULL;
|
|
||||||
return M_BMPDATA->m_palette;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
wxBitmap::wxBitmap(int w, int h, int d)
|
||||||
|
{
|
||||||
|
(void)Create(w, h, d);
|
||||||
|
|
||||||
|
if ( wxTheBitmapList )
|
||||||
|
wxTheBitmapList->AddBitmap(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
wxBitmap::wxBitmap(void *data, long type, int width, int height, int depth)
|
||||||
|
{
|
||||||
|
(void) Create(data, type, width, height, depth);
|
||||||
|
|
||||||
|
if ( wxTheBitmapList )
|
||||||
|
wxTheBitmapList->AddBitmap(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
wxBitmap::wxBitmap(const wxString& filename, long type)
|
||||||
|
{
|
||||||
|
LoadFile(filename, (int)type);
|
||||||
|
|
||||||
|
if ( wxTheBitmapList )
|
||||||
|
wxTheBitmapList->AddBitmap(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* TODO: maybe allow creation from XPM
|
||||||
|
// Create from data
|
||||||
|
wxBitmap::wxBitmap(const char **data)
|
||||||
|
{
|
||||||
|
(void) Create((void *)data, wxBITMAP_TYPE_XPM_DATA, 0, 0, 0);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
bool wxBitmap::Create(int w, int h, int d)
|
||||||
|
{
|
||||||
|
UnRef();
|
||||||
|
|
||||||
|
m_refData = new wxBitmapRefData;
|
||||||
|
|
||||||
|
M_BITMAPDATA->m_width = w;
|
||||||
|
M_BITMAPDATA->m_height = h;
|
||||||
|
M_BITMAPDATA->m_depth = d;
|
||||||
|
|
||||||
|
/* TODO: create new bitmap */
|
||||||
|
|
||||||
|
return M_BITMAPDATA->m_ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxBitmap::LoadFile(const wxString& filename, long type)
|
||||||
|
{
|
||||||
|
UnRef();
|
||||||
|
|
||||||
|
m_refData = new wxBitmapRefData;
|
||||||
|
|
||||||
|
wxBitmapHandler *handler = FindHandler(type);
|
||||||
|
|
||||||
|
if ( handler == NULL ) {
|
||||||
|
wxLogWarning("no bitmap handler for type %d defined.", type);
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return handler->LoadFile(this, filename, type, -1, -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxBitmap::Create(void *data, long type, int width, int height, int depth)
|
||||||
|
{
|
||||||
|
UnRef();
|
||||||
|
|
||||||
|
m_refData = new wxBitmapRefData;
|
||||||
|
|
||||||
|
wxBitmapHandler *handler = FindHandler(type);
|
||||||
|
|
||||||
|
if ( handler == NULL ) {
|
||||||
|
wxLogWarning("no bitmap handler for type %d defined.", type);
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return handler->Create(this, data, type, width, height, depth);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxBitmap::SaveFile(const wxString& filename, int type, const wxPalette *palette)
|
||||||
|
{
|
||||||
|
wxBitmapHandler *handler = FindHandler(type);
|
||||||
|
|
||||||
|
if ( handler == NULL ) {
|
||||||
|
wxLogWarning("no bitmap handler for type %d defined.", type);
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return handler->SaveFile(this, filename, type, palette);
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxBitmap::SetWidth(int w)
|
||||||
|
{
|
||||||
|
if (!M_BITMAPDATA)
|
||||||
|
m_refData = new wxBitmapRefData;
|
||||||
|
|
||||||
|
M_BITMAPDATA->m_width = w;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxBitmap::SetHeight(int h)
|
||||||
|
{
|
||||||
|
if (!M_BITMAPDATA)
|
||||||
|
m_refData = new wxBitmapRefData;
|
||||||
|
|
||||||
|
M_BITMAPDATA->m_height = h;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxBitmap::SetDepth(int d)
|
||||||
|
{
|
||||||
|
if (!M_BITMAPDATA)
|
||||||
|
m_refData = new wxBitmapRefData;
|
||||||
|
|
||||||
|
M_BITMAPDATA->m_depth = d;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxBitmap::SetQuality(int q)
|
||||||
|
{
|
||||||
|
if (!M_BITMAPDATA)
|
||||||
|
m_refData = new wxBitmapRefData;
|
||||||
|
|
||||||
|
M_BITMAPDATA->m_quality = q;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxBitmap::SetOk(bool isOk)
|
||||||
|
{
|
||||||
|
if (!M_BITMAPDATA)
|
||||||
|
m_refData = new wxBitmapRefData;
|
||||||
|
|
||||||
|
M_BITMAPDATA->m_ok = isOk;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxBitmap::SetPalette(const wxPalette& palette)
|
||||||
|
{
|
||||||
|
if (!M_BITMAPDATA)
|
||||||
|
m_refData = new wxBitmapRefData;
|
||||||
|
|
||||||
|
M_BITMAPDATA->m_bitmapPalette = palette ;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxBitmap::SetMask(wxMask *mask)
|
||||||
|
{
|
||||||
|
if (!M_BITMAPDATA)
|
||||||
|
m_refData = new wxBitmapRefData;
|
||||||
|
|
||||||
|
M_BITMAPDATA->m_bitmapMask = mask ;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxBitmap::AddHandler(wxBitmapHandler *handler)
|
||||||
|
{
|
||||||
|
sm_handlers.Append(handler);
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxBitmap::InsertHandler(wxBitmapHandler *handler)
|
||||||
|
{
|
||||||
|
sm_handlers.Insert(handler);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxBitmap::RemoveHandler(const wxString& name)
|
||||||
|
{
|
||||||
|
wxBitmapHandler *handler = FindHandler(name);
|
||||||
|
if ( handler )
|
||||||
|
{
|
||||||
|
sm_handlers.DeleteObject(handler);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxBitmapHandler *wxBitmap::FindHandler(const wxString& name)
|
||||||
|
{
|
||||||
|
wxNode *node = sm_handlers.First();
|
||||||
|
while ( node )
|
||||||
|
{
|
||||||
|
wxBitmapHandler *handler = (wxBitmapHandler *)node->Data();
|
||||||
|
if ( handler->GetName() == name )
|
||||||
|
return handler;
|
||||||
|
node = node->Next();
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxBitmapHandler *wxBitmap::FindHandler(const wxString& extension, long bitmapType)
|
||||||
|
{
|
||||||
|
wxNode *node = sm_handlers.First();
|
||||||
|
while ( node )
|
||||||
|
{
|
||||||
|
wxBitmapHandler *handler = (wxBitmapHandler *)node->Data();
|
||||||
|
if ( handler->GetExtension() == extension &&
|
||||||
|
(bitmapType == -1 || handler->GetType() == bitmapType) )
|
||||||
|
return handler;
|
||||||
|
node = node->Next();
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxBitmapHandler *wxBitmap::FindHandler(long bitmapType)
|
||||||
|
{
|
||||||
|
wxNode *node = sm_handlers.First();
|
||||||
|
while ( node )
|
||||||
|
{
|
||||||
|
wxBitmapHandler *handler = (wxBitmapHandler *)node->Data();
|
||||||
|
if (handler->GetType() == bitmapType)
|
||||||
|
return handler;
|
||||||
|
node = node->Next();
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* wxMask
|
||||||
|
*/
|
||||||
|
|
||||||
|
wxMask::wxMask()
|
||||||
|
{
|
||||||
|
/* TODO
|
||||||
|
m_maskBitmap = 0;
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
// Construct a mask from a bitmap and a colour indicating
|
||||||
|
// the transparent area
|
||||||
|
wxMask::wxMask(const wxBitmap& bitmap, const wxColour& colour)
|
||||||
|
{
|
||||||
|
/* TODO
|
||||||
|
m_maskBitmap = 0;
|
||||||
|
*/
|
||||||
|
Create(bitmap, colour);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Construct a mask from a bitmap and a palette index indicating
|
||||||
|
// the transparent area
|
||||||
|
wxMask::wxMask(const wxBitmap& bitmap, int paletteIndex)
|
||||||
|
{
|
||||||
|
/* TODO
|
||||||
|
m_maskBitmap = 0;
|
||||||
|
*/
|
||||||
|
|
||||||
|
Create(bitmap, paletteIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Construct a mask from a mono bitmap (copies the bitmap).
|
||||||
|
wxMask::wxMask(const wxBitmap& bitmap)
|
||||||
|
{
|
||||||
|
/* TODO
|
||||||
|
m_maskBitmap = 0;
|
||||||
|
*/
|
||||||
|
|
||||||
|
Create(bitmap);
|
||||||
|
}
|
||||||
|
|
||||||
|
wxMask::~wxMask()
|
||||||
|
{
|
||||||
|
// TODO: delete mask bitmap
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create a mask from a mono bitmap (copies the bitmap).
|
||||||
|
bool wxMask::Create(const wxBitmap& bitmap)
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create a mask from a bitmap and a palette index indicating
|
||||||
|
// the transparent area
|
||||||
|
bool wxMask::Create(const wxBitmap& bitmap, int paletteIndex)
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create a mask from a bitmap and a colour indicating
|
||||||
|
// the transparent area
|
||||||
|
bool wxMask::Create(const wxBitmap& bitmap, const wxColour& colour)
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* wxBitmapHandler
|
||||||
|
*/
|
||||||
|
|
||||||
|
IMPLEMENT_DYNAMIC_CLASS(wxBitmapHandler, wxObject)
|
||||||
|
|
||||||
|
bool wxBitmapHandler::Create(wxBitmap *bitmap, void *data, long type, int width, int height, int depth)
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxBitmapHandler::LoadFile(wxBitmap *bitmap, const wxString& name, long type,
|
||||||
|
int desiredWidth, int desiredHeight)
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxBitmapHandler::SaveFile(wxBitmap *bitmap, const wxString& name, int type, const wxPalette *palette)
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Standard handlers
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* TODO: bitmap handlers, a bit like this:
|
||||||
|
class WXDLLEXPORT wxBMPResourceHandler: public wxBitmapHandler
|
||||||
|
{
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxBMPResourceHandler)
|
||||||
|
public:
|
||||||
|
inline wxBMPResourceHandler()
|
||||||
|
{
|
||||||
|
m_name = "Windows bitmap resource";
|
||||||
|
m_extension = "";
|
||||||
|
m_type = wxBITMAP_TYPE_BMP_RESOURCE;
|
||||||
|
};
|
||||||
|
|
||||||
|
virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, long flags,
|
||||||
|
int desiredWidth, int desiredHeight);
|
||||||
|
};
|
||||||
|
IMPLEMENT_DYNAMIC_CLASS(wxBMPResourceHandler, wxBitmapHandler)
|
||||||
|
*/
|
||||||
|
|
||||||
|
void wxBitmap::CleanUpHandlers()
|
||||||
|
{
|
||||||
|
wxNode *node = sm_handlers.First();
|
||||||
|
while ( node )
|
||||||
|
{
|
||||||
|
wxBitmapHandler *handler = (wxBitmapHandler *)node->Data();
|
||||||
|
wxNode *next = node->Next();
|
||||||
|
delete handler;
|
||||||
|
delete node;
|
||||||
|
node = next;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxBitmap::InitStandardHandlers()
|
||||||
|
{
|
||||||
|
/* TODO: initialize all standard bitmap or derive class handlers here.
|
||||||
|
AddHandler(new wxBMPResourceHandler);
|
||||||
|
AddHandler(new wxBMPFileHandler);
|
||||||
|
AddHandler(new wxXPMFileHandler);
|
||||||
|
AddHandler(new wxXPMDataHandler);
|
||||||
|
AddHandler(new wxICOResourceHandler);
|
||||||
|
AddHandler(new wxICOFileHandler);
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: bmpbuttn.cpp
|
// Name: bmpbuttn.cpp
|
||||||
// Purpose:
|
// Purpose: wxBitmapButton
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@@ -14,65 +15,51 @@
|
|||||||
|
|
||||||
#include "wx/bmpbuttn.h"
|
#include "wx/bmpbuttn.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
#if !USE_SHARED_LIBRARY
|
||||||
// classes
|
IMPLEMENT_DYNAMIC_CLASS(wxBitmapButton, wxButton)
|
||||||
//-----------------------------------------------------------------------------
|
#endif
|
||||||
|
|
||||||
class wxBitmapButton;
|
bool wxBitmapButton::Create(wxWindow *parent, wxWindowID id, const wxBitmap& bitmap,
|
||||||
|
const wxPoint& pos,
|
||||||
//-----------------------------------------------------------------------------
|
const wxSize& size, long style,
|
||||||
// wxBitmapButton
|
const wxValidator& validator,
|
||||||
//-----------------------------------------------------------------------------
|
const wxString& name)
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxBitmapButton,wxControl)
|
|
||||||
|
|
||||||
wxBitmapButton::wxBitmapButton(void)
|
|
||||||
{
|
{
|
||||||
};
|
m_buttonBitmap = bitmap;
|
||||||
|
SetName(name);
|
||||||
|
SetValidator(validator);
|
||||||
|
parent->AddChild(this);
|
||||||
|
|
||||||
wxBitmapButton::wxBitmapButton( wxWindow *parent, wxWindowID id, const wxBitmap &bitmap,
|
m_backgroundColour = parent->GetDefaultBackgroundColour() ;
|
||||||
const wxPoint &pos, const wxSize &size,
|
m_foregroundColour = parent->GetDefaultForegroundColour() ;
|
||||||
long style, const wxString &name )
|
m_windowStyle = style;
|
||||||
|
m_marginX = 0;
|
||||||
|
m_marginY = 0;
|
||||||
|
|
||||||
|
int x = pos.x;
|
||||||
|
int y = pos.y;
|
||||||
|
int width = size.x;
|
||||||
|
int height = size.y;
|
||||||
|
|
||||||
|
if (id == -1)
|
||||||
|
m_windowId = NewControlId();
|
||||||
|
else
|
||||||
|
m_windowId = id;
|
||||||
|
|
||||||
|
if ( width == -1 && bitmap.Ok())
|
||||||
|
width = bitmap.GetWidth() + 2*m_marginX;
|
||||||
|
|
||||||
|
if ( height == -1 && bitmap.Ok())
|
||||||
|
height = bitmap.GetHeight() + 2*m_marginY;
|
||||||
|
|
||||||
|
/* TODO: create bitmap button
|
||||||
|
*/
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxBitmapButton::SetBitmapLabel(const wxBitmap& bitmap)
|
||||||
{
|
{
|
||||||
Create( parent, id, bitmap, pos, size, style, name );
|
m_buttonBitmap = bitmap;
|
||||||
};
|
}
|
||||||
|
|
||||||
bool wxBitmapButton::Create( wxWindow *parent, wxWindowID id, const wxBitmap &bitmap,
|
|
||||||
const wxPoint &pos, const wxSize &size,
|
|
||||||
long style, const wxString &name )
|
|
||||||
{
|
|
||||||
m_needParent = TRUE;
|
|
||||||
|
|
||||||
wxSize newSize = size;
|
|
||||||
|
|
||||||
PreCreation( parent, id, pos, newSize, style, name );
|
|
||||||
|
|
||||||
m_bitmap = bitmap;
|
|
||||||
m_label = "";
|
|
||||||
|
|
||||||
|
|
||||||
if (newSize.x == -1) newSize.x = m_bitmap.GetHeight()+10;
|
|
||||||
if (newSize.y == -1) newSize.y = m_bitmap.GetWidth()+10;
|
|
||||||
SetSize( newSize.x, newSize.y );
|
|
||||||
|
|
||||||
|
|
||||||
PostCreation();
|
|
||||||
|
|
||||||
Show( TRUE );
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxBitmapButton::SetDefault(void)
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxBitmapButton::SetLabel( const wxString &label )
|
|
||||||
{
|
|
||||||
wxControl::SetLabel( label );
|
|
||||||
};
|
|
||||||
|
|
||||||
wxString wxBitmapButton::GetLabel(void) const
|
|
||||||
{
|
|
||||||
return wxControl::GetLabel();
|
|
||||||
};
|
|
||||||
|
|||||||
212
src/qt/brush.cpp
212
src/qt/brush.cpp
@@ -1,10 +1,11 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: brush.cpp
|
// Name: brush.cpp
|
||||||
// Purpose:
|
// Purpose: wxBrush
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@@ -12,121 +13,150 @@
|
|||||||
#pragma implementation "brush.h"
|
#pragma implementation "brush.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "wx/setup.h"
|
||||||
|
#include "wx/utils.h"
|
||||||
#include "wx/brush.h"
|
#include "wx/brush.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
#if !USE_SHARED_LIBRARIES
|
||||||
// wxBrush
|
IMPLEMENT_DYNAMIC_CLASS(wxBrush, wxGDIObject)
|
||||||
//-----------------------------------------------------------------------------
|
#endif
|
||||||
|
|
||||||
class wxBrushRefData: public wxObjectRefData
|
wxBrushRefData::wxBrushRefData()
|
||||||
{
|
{
|
||||||
public:
|
m_style = wxSOLID;
|
||||||
|
// TODO: null data
|
||||||
wxBrushRefData(void);
|
}
|
||||||
|
|
||||||
int m_style;
|
|
||||||
wxBitmap m_stipple;
|
|
||||||
wxColour m_colour;
|
|
||||||
};
|
|
||||||
|
|
||||||
wxBrushRefData::wxBrushRefData(void)
|
wxBrushRefData::wxBrushRefData(const wxBrushRefData& data)
|
||||||
{
|
{
|
||||||
m_style = 0;
|
m_style = data.m_style;
|
||||||
};
|
m_stipple = data.m_stipple;
|
||||||
|
m_colour = data.m_colour;
|
||||||
|
/* TODO: null data
|
||||||
|
m_hBrush = 0;
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
wxBrushRefData::~wxBrushRefData()
|
||||||
|
|
||||||
#define M_BRUSHDATA ((wxBrushRefData *)m_refData)
|
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxBrush,wxGDIObject)
|
|
||||||
|
|
||||||
wxBrush::wxBrush(void)
|
|
||||||
{
|
{
|
||||||
if (wxTheBrushList) wxTheBrushList->AddBrush( this );
|
// TODO: delete data
|
||||||
};
|
}
|
||||||
|
|
||||||
wxBrush::wxBrush( const wxColour &colour, int style )
|
// Brushes
|
||||||
|
wxBrush::wxBrush()
|
||||||
{
|
{
|
||||||
m_refData = new wxBrushRefData();
|
if ( wxTheBrushList )
|
||||||
M_BRUSHDATA->m_style = style;
|
wxTheBrushList->AddBrush(this);
|
||||||
M_BRUSHDATA->m_colour = colour;
|
}
|
||||||
|
|
||||||
if (wxTheBrushList) wxTheBrushList->AddBrush( this );
|
|
||||||
};
|
|
||||||
|
|
||||||
wxBrush::wxBrush( const wxString &colourName, int style )
|
wxBrush::~wxBrush()
|
||||||
{
|
{
|
||||||
m_refData = new wxBrushRefData();
|
if ( wxTheBrushList )
|
||||||
M_BRUSHDATA->m_style = style;
|
wxTheBrushList->RemoveBrush(this);
|
||||||
M_BRUSHDATA->m_colour = colourName;
|
}
|
||||||
|
|
||||||
if (wxTheBrushList) wxTheBrushList->AddBrush( this );
|
|
||||||
};
|
|
||||||
|
|
||||||
wxBrush::wxBrush( const wxBitmap &stippleBitmap )
|
wxBrush::wxBrush(const wxColour& col, int Style)
|
||||||
{
|
{
|
||||||
m_refData = new wxBrushRefData();
|
m_refData = new wxBrushRefData;
|
||||||
M_BRUSHDATA->m_style = wxSTIPPLE;
|
|
||||||
M_BRUSHDATA->m_colour = *wxBLACK;
|
|
||||||
M_BRUSHDATA->m_stipple = stippleBitmap;
|
|
||||||
|
|
||||||
if (wxTheBrushList) wxTheBrushList->AddBrush( this );
|
|
||||||
};
|
|
||||||
|
|
||||||
wxBrush::wxBrush( const wxBrush &brush )
|
M_BRUSHDATA->m_colour = col;
|
||||||
|
M_BRUSHDATA->m_style = Style;
|
||||||
|
|
||||||
|
RealizeResource();
|
||||||
|
|
||||||
|
if ( wxTheBrushList )
|
||||||
|
wxTheBrushList->AddBrush(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
wxBrush::wxBrush(const wxString& col, int Style)
|
||||||
{
|
{
|
||||||
Ref( brush );
|
m_refData = new wxBrushRefData;
|
||||||
|
|
||||||
if (wxTheBrushList) wxTheBrushList->AddBrush( this );
|
|
||||||
};
|
|
||||||
|
|
||||||
wxBrush::wxBrush( const wxBrush *brush )
|
// Implicit conversion from string to wxColour via colour database
|
||||||
|
M_BRUSHDATA->m_colour = col;
|
||||||
|
M_BRUSHDATA->m_style = Style;
|
||||||
|
|
||||||
|
RealizeResource();
|
||||||
|
|
||||||
|
if ( wxTheBrushList )
|
||||||
|
wxTheBrushList->AddBrush(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
wxBrush::wxBrush(const wxBitmap& stipple)
|
||||||
{
|
{
|
||||||
if (brush) Ref( *brush );
|
m_refData = new wxBrushRefData;
|
||||||
|
|
||||||
if (wxTheBrushList) wxTheBrushList->Append( this );
|
|
||||||
};
|
|
||||||
|
|
||||||
wxBrush::~wxBrush(void)
|
M_BRUSHDATA->m_style = wxSTIPPLE;
|
||||||
|
M_BRUSHDATA->m_stipple = stipple;
|
||||||
|
|
||||||
|
RealizeResource();
|
||||||
|
|
||||||
|
if ( wxTheBrushList )
|
||||||
|
wxTheBrushList->AddBrush(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxBrush::Unshare()
|
||||||
{
|
{
|
||||||
if (wxTheBrushList) wxTheBrushList->RemoveBrush( this );
|
// Don't change shared data
|
||||||
};
|
if (!m_refData)
|
||||||
|
{
|
||||||
|
m_refData = new wxBrushRefData();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
wxBrushRefData* ref = new wxBrushRefData(*(wxBrushRefData*)m_refData);
|
||||||
|
UnRef();
|
||||||
|
m_refData = ref;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
wxBrush& wxBrush::operator = ( const wxBrush& brush )
|
void wxBrush::SetColour(const wxColour& col)
|
||||||
{
|
{
|
||||||
if (*this == brush) return (*this);
|
Unshare();
|
||||||
Ref( brush );
|
|
||||||
return *this;
|
M_BRUSHDATA->m_colour = col;
|
||||||
};
|
|
||||||
|
RealizeResource();
|
||||||
bool wxBrush::operator == ( const wxBrush& brush )
|
}
|
||||||
|
|
||||||
|
void wxBrush::SetColour(const wxString& col)
|
||||||
{
|
{
|
||||||
return m_refData == brush.m_refData;
|
Unshare();
|
||||||
};
|
|
||||||
|
|
||||||
bool wxBrush::operator != ( const wxBrush& brush )
|
M_BRUSHDATA->m_colour = col;
|
||||||
|
|
||||||
|
RealizeResource();
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxBrush::SetColour(const unsigned char r, const unsigned char g, const unsigned char b)
|
||||||
{
|
{
|
||||||
return m_refData != brush.m_refData;
|
Unshare();
|
||||||
};
|
|
||||||
|
|
||||||
bool wxBrush::Ok(void) const
|
M_BRUSHDATA->m_colour.Set(r, g, b);
|
||||||
|
|
||||||
|
RealizeResource();
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxBrush::SetStyle(int Style)
|
||||||
{
|
{
|
||||||
return ((m_refData) && M_BRUSHDATA->m_colour.Ok());
|
Unshare();
|
||||||
};
|
|
||||||
|
|
||||||
int wxBrush::GetStyle(void) const
|
M_BRUSHDATA->m_style = Style;
|
||||||
|
|
||||||
|
RealizeResource();
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxBrush::SetStipple(const wxBitmap& Stipple)
|
||||||
{
|
{
|
||||||
return M_BRUSHDATA->m_style;
|
Unshare();
|
||||||
};
|
|
||||||
|
|
||||||
wxColour &wxBrush::GetColour(void) const
|
M_BRUSHDATA->m_stipple = Stipple;
|
||||||
|
|
||||||
|
RealizeResource();
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxBrush::RealizeResource()
|
||||||
{
|
{
|
||||||
return M_BRUSHDATA->m_colour;
|
// TODO: create the brush
|
||||||
};
|
}
|
||||||
|
|
||||||
wxBitmap *wxBrush::GetStipple(void) const
|
|
||||||
{
|
|
||||||
return &M_BRUSHDATA->m_stipple;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: button.cpp
|
// Name: button.cpp
|
||||||
// Purpose:
|
// Purpose: wxButton
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@@ -14,48 +15,61 @@
|
|||||||
|
|
||||||
#include "wx/button.h"
|
#include "wx/button.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
#if !USE_SHARED_LIBRARY
|
||||||
// classes
|
IMPLEMENT_DYNAMIC_CLASS(wxButton, wxControl)
|
||||||
//-----------------------------------------------------------------------------
|
#endif
|
||||||
|
|
||||||
class wxButton;
|
// Button
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
bool wxButton::Create(wxWindow *parent, wxWindowID id, const wxString& label,
|
||||||
// wxButton
|
const wxPoint& pos,
|
||||||
//-----------------------------------------------------------------------------
|
const wxSize& size, long style,
|
||||||
|
const wxValidator& validator,
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxButton,wxControl)
|
const wxString& name)
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
wxButton::wxButton(void)
|
|
||||||
{
|
{
|
||||||
};
|
SetName(name);
|
||||||
|
SetValidator(validator);
|
||||||
|
m_windowStyle = style;
|
||||||
|
|
||||||
wxButton::wxButton( wxWindow *parent, wxWindowID id, const wxString &label,
|
parent->AddChild((wxButton *)this);
|
||||||
const wxPoint &pos, const wxSize &size,
|
|
||||||
long style, const wxString &name )
|
|
||||||
{
|
|
||||||
Create( parent, id, label, pos, size, style, name );
|
|
||||||
};
|
|
||||||
|
|
||||||
bool wxButton::Create( wxWindow *parent, wxWindowID id, const wxString &label,
|
if (id == -1)
|
||||||
const wxPoint &pos, const wxSize &size,
|
m_windowId = NewControlId();
|
||||||
long style, const wxString &name )
|
else
|
||||||
{
|
m_windowId = id;
|
||||||
return TRUE;
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxButton::SetDefault(void)
|
// TODO: create button
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxButton::SetLabel( const wxString &label )
|
return FALSE;
|
||||||
{
|
}
|
||||||
wxControl::SetLabel( label );
|
|
||||||
};
|
|
||||||
|
|
||||||
wxString wxButton::GetLabel(void) const
|
void wxButton::SetSize(int x, int y, int width, int height, int sizeFlags)
|
||||||
{
|
{
|
||||||
return wxControl::GetLabel();
|
// TODO
|
||||||
};
|
}
|
||||||
|
|
||||||
|
void wxButton::SetDefault()
|
||||||
|
{
|
||||||
|
wxWindow *parent = (wxWindow *)GetParent();
|
||||||
|
if (parent)
|
||||||
|
parent->SetDefaultItem(this);
|
||||||
|
|
||||||
|
// TODO: make button the default
|
||||||
|
}
|
||||||
|
|
||||||
|
wxString wxButton::GetLabel() const
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
return wxString("");
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxButton::SetLabel(const wxString& label)
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxButton::Command (wxCommandEvent & event)
|
||||||
|
{
|
||||||
|
ProcessCommand (event);
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,50 +1,117 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: checkbox.cpp
|
// Name: checkbox.cpp
|
||||||
// Purpose:
|
// Purpose: wxCheckBox
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: 04/01/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma implementation "checkbox.h"
|
#pragma implementation "checkbox.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/checkbox.h"
|
#include "wx/checkbox.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
#if !USE_SHARED_LIBRARY
|
||||||
// wxCheckBox
|
IMPLEMENT_DYNAMIC_CLASS(wxCheckBox, wxControl)
|
||||||
//-----------------------------------------------------------------------------
|
IMPLEMENT_DYNAMIC_CLASS(wxBitmapCheckBox, wxCheckBox)
|
||||||
|
#endif
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxCheckBox,wxControl)
|
// Single check box item
|
||||||
|
bool wxCheckBox::Create(wxWindow *parent, wxWindowID id, const wxString& label,
|
||||||
wxCheckBox::wxCheckBox(void)
|
const wxPoint& pos,
|
||||||
|
const wxSize& size, long style,
|
||||||
|
const wxValidator& validator,
|
||||||
|
const wxString& name)
|
||||||
{
|
{
|
||||||
};
|
SetName(name);
|
||||||
|
SetValidator(validator);
|
||||||
|
m_windowStyle = style;
|
||||||
|
|
||||||
wxCheckBox::wxCheckBox( wxWindow *parent, wxWindowID id, const wxString &label,
|
if (parent) parent->AddChild(this);
|
||||||
const wxPoint &pos, const wxSize &size,
|
|
||||||
long style, const wxString &name )
|
if ( id == -1 )
|
||||||
|
m_windowId = NewControlId();
|
||||||
|
else
|
||||||
|
m_windowId = id;
|
||||||
|
|
||||||
|
// TODO: create checkbox
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxCheckBox::SetLabel(const wxString& label)
|
||||||
{
|
{
|
||||||
Create( parent, id, label, pos, size, style, name );
|
// TODO
|
||||||
};
|
}
|
||||||
|
|
||||||
bool wxCheckBox::Create( wxWindow *parent, wxWindowID id, const wxString &label,
|
void wxCheckBox::SetSize(int x, int y, int width, int height, int sizeFlags)
|
||||||
const wxPoint &pos, const wxSize &size,
|
|
||||||
long style, const wxString &name )
|
|
||||||
{
|
{
|
||||||
return TRUE;
|
// TODO
|
||||||
};
|
}
|
||||||
|
|
||||||
void wxCheckBox::SetValue( bool WXUNUSED(state) )
|
void wxCheckBox::SetValue(bool val)
|
||||||
{
|
{
|
||||||
};
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
bool wxCheckBox::GetValue(void) const
|
bool wxCheckBox::GetValue() const
|
||||||
{
|
{
|
||||||
return FALSE;
|
// TODO
|
||||||
};
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxCheckBox::Command (wxCommandEvent & event)
|
||||||
|
{
|
||||||
|
SetValue ((event.GetInt() != 0));
|
||||||
|
ProcessCommand (event);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Bitmap checkbox
|
||||||
|
bool wxBitmapCheckBox::Create(wxWindow *parent, wxWindowID id, const wxBitmap *label,
|
||||||
|
const wxPoint& pos,
|
||||||
|
const wxSize& size, long style,
|
||||||
|
const wxValidator& validator,
|
||||||
|
const wxString& name)
|
||||||
|
{
|
||||||
|
SetName(name);
|
||||||
|
SetValidator(validator);
|
||||||
|
m_windowStyle = style;
|
||||||
|
|
||||||
|
if (parent) parent->AddChild(this);
|
||||||
|
|
||||||
|
if ( id == -1 )
|
||||||
|
m_windowId = NewControlId();
|
||||||
|
else
|
||||||
|
m_windowId = id;
|
||||||
|
|
||||||
|
// TODO: Create the bitmap checkbox
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxBitmapCheckBox::SetLabel(const wxBitmap *bitmap)
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxBitmapCheckBox::SetSize(int x, int y, int width, int height, int sizeFlags)
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxBitmapCheckBox::SetValue(bool val)
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxBitmapCheckBox::GetValue() const
|
||||||
|
{
|
||||||
|
// TODOD
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,97 +1,119 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: choice.cpp
|
// Name: choice.cpp
|
||||||
// Purpose:
|
// Purpose: wxChoice
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma implementation "choice.h"
|
#pragma implementation "choice.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// For compilers that support precompilation, includes "wx.h".
|
||||||
#include "wx/choice.h"
|
#include "wx/choice.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
#if !USE_SHARED_LIBRARY
|
||||||
// wxChoice
|
IMPLEMENT_DYNAMIC_CLASS(wxChoice, wxControl)
|
||||||
//-----------------------------------------------------------------------------
|
#endif
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
bool wxChoice::Create(wxWindow *parent, wxWindowID id,
|
||||||
|
const wxPoint& pos,
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxChoice,wxControl)
|
const wxSize& size,
|
||||||
|
int n, const wxString choices[],
|
||||||
wxChoice::wxChoice(void)
|
long style,
|
||||||
|
const wxValidator& validator,
|
||||||
|
const wxString& name)
|
||||||
{
|
{
|
||||||
};
|
SetName(name);
|
||||||
|
SetValidator(validator);
|
||||||
|
m_noStrings = n;
|
||||||
|
m_windowStyle = style;
|
||||||
|
|
||||||
wxChoice::wxChoice( wxWindow *parent, wxWindowID id,
|
if (parent) parent->AddChild(this);
|
||||||
const wxPoint &pos, const wxSize &size,
|
|
||||||
int n, const wxString choices[],
|
|
||||||
long style, const wxString &name )
|
|
||||||
{
|
|
||||||
Create( parent, id, pos, size, n, choices, style, name );
|
|
||||||
};
|
|
||||||
|
|
||||||
bool wxChoice::Create( wxWindow *parent, wxWindowID id,
|
if ( id == -1 )
|
||||||
const wxPoint &pos, const wxSize &size,
|
m_windowId = (int)NewControlId();
|
||||||
int n, const wxString choices[],
|
else
|
||||||
long style, const wxString &name )
|
m_windowId = id;
|
||||||
{
|
|
||||||
return TRUE;
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxChoice::Append( const wxString &WXUNUSED(item) )
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxChoice::Clear(void)
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
int wxChoice::FindString( const wxString &WXUNUSED(string) ) const
|
// TODO: create choice control
|
||||||
{
|
return FALSE;
|
||||||
return -1;
|
}
|
||||||
};
|
|
||||||
|
|
||||||
int wxChoice::GetColumns(void) const
|
void wxChoice::Append(const wxString& item)
|
||||||
{
|
{
|
||||||
return 1;
|
// TODO
|
||||||
};
|
m_noStrings ++;
|
||||||
|
}
|
||||||
|
|
||||||
int wxChoice::GetSelection(void)
|
void wxChoice::Delete(int n)
|
||||||
{
|
{
|
||||||
return -1;
|
// TODO
|
||||||
};
|
m_noStrings --;
|
||||||
|
}
|
||||||
|
|
||||||
wxString wxChoice::GetString( int WXUNUSED(n) ) const
|
void wxChoice::Clear()
|
||||||
{
|
{
|
||||||
return "";
|
// TODO
|
||||||
};
|
m_noStrings = 0;
|
||||||
|
}
|
||||||
|
|
||||||
wxString wxChoice::GetStringSelection(void) const
|
int wxChoice::GetSelection() const
|
||||||
{
|
{
|
||||||
return "";
|
// TODO
|
||||||
};
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int wxChoice::Number(void) const
|
void wxChoice::SetSelection(int n)
|
||||||
{
|
{
|
||||||
return 0;
|
// TODO
|
||||||
};
|
}
|
||||||
|
|
||||||
void wxChoice::SetColumns( int WXUNUSED(n) )
|
int wxChoice::FindString(const wxString& s) const
|
||||||
{
|
{
|
||||||
};
|
// TODO
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
void wxChoice::SetSelection( int WXUNUSED(n) )
|
wxString wxChoice::GetString(int n) const
|
||||||
{
|
{
|
||||||
};
|
// TODO
|
||||||
|
return wxString("");
|
||||||
|
}
|
||||||
|
|
||||||
void wxChoice::SetStringSelection( const wxString &string )
|
void wxChoice::SetSize(int x, int y, int width, int height, int sizeFlags)
|
||||||
{
|
{
|
||||||
int n = FindString( string );
|
// TODO
|
||||||
if (n != -1) SetSelection( n );
|
}
|
||||||
};
|
|
||||||
|
wxString wxChoice::GetStringSelection () const
|
||||||
|
{
|
||||||
|
int sel = GetSelection ();
|
||||||
|
if (sel > -1)
|
||||||
|
return wxString(this->GetString (sel));
|
||||||
|
else
|
||||||
|
return wxString("");
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxChoice::SetStringSelection (const wxString& s)
|
||||||
|
{
|
||||||
|
int sel = FindString (s);
|
||||||
|
if (sel > -1)
|
||||||
|
{
|
||||||
|
SetSelection (sel);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxChoice::Command(wxCommandEvent & event)
|
||||||
|
{
|
||||||
|
SetSelection (event.GetInt());
|
||||||
|
ProcessCommand (event);
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,164 +1,126 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: colour.cpp
|
// Name: colour.cpp
|
||||||
// Purpose:
|
// Purpose: wxColour class
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma implementation "colour.h"
|
#pragma implementation "colour.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/gdicmn.h"
|
#include "wx/gdicmn.h"
|
||||||
|
#include "wx/colour.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
#if !USE_SHARED_LIBRARY
|
||||||
// wxColour
|
IMPLEMENT_DYNAMIC_CLASS(wxColour, wxObject)
|
||||||
//-----------------------------------------------------------------------------
|
#endif
|
||||||
|
|
||||||
class wxColourRefData: public wxObjectRefData
|
// Colour
|
||||||
|
|
||||||
|
wxColour::wxColour ()
|
||||||
{
|
{
|
||||||
public:
|
m_isInit = FALSE;
|
||||||
|
m_red = m_blue = m_green = 0;
|
||||||
wxColourRefData(void);
|
/* TODO
|
||||||
~wxColourRefData(void);
|
m_pixel = 0;
|
||||||
void FreeColour(void);
|
*/
|
||||||
|
}
|
||||||
bool m_hasPixel;
|
|
||||||
|
|
||||||
friend wxColour;
|
|
||||||
};
|
|
||||||
|
|
||||||
wxColourRefData::wxColourRefData(void)
|
wxColour::wxColour (unsigned char r, unsigned char g, unsigned char b)
|
||||||
{
|
{
|
||||||
m_hasPixel = FALSE;
|
m_red = r;
|
||||||
};
|
m_green = g;
|
||||||
|
m_blue = b;
|
||||||
|
m_isInit = TRUE;
|
||||||
|
/* TODO
|
||||||
|
m_pixel = PALETTERGB (m_red, m_green, m_blue);
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
wxColourRefData::~wxColourRefData(void)
|
wxColour::wxColour (const wxColour& col)
|
||||||
{
|
{
|
||||||
FreeColour();
|
m_red = col.m_red;
|
||||||
};
|
m_green = col.m_green;
|
||||||
|
m_blue = col.m_blue;
|
||||||
|
m_isInit = col.m_isInit;
|
||||||
|
/* TODO
|
||||||
|
m_pixel = col.m_pixel;
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
void wxColourRefData::FreeColour(void)
|
wxColour& wxColour::operator =(const wxColour& col)
|
||||||
{
|
{
|
||||||
};
|
m_red = col.m_red;
|
||||||
|
m_green = col.m_green;
|
||||||
|
m_blue = col.m_blue;
|
||||||
|
m_isInit = col.m_isInit;
|
||||||
|
/* TODO
|
||||||
|
m_pixel = col.m_pixel;
|
||||||
|
*/
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
wxColour::wxColour (const wxString& col)
|
||||||
|
|
||||||
#define M_COLDATA ((wxColourRefData *)m_refData)
|
|
||||||
|
|
||||||
#define SHIFT (8*(sizeof(short int)-sizeof(char)))
|
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxColour,wxGDIObject)
|
|
||||||
|
|
||||||
wxColour::wxColour(void)
|
|
||||||
{
|
{
|
||||||
};
|
wxColour *the_colour = wxTheColourDatabase->FindColour (col);
|
||||||
|
if (the_colour)
|
||||||
|
{
|
||||||
|
m_red = the_colour->Red ();
|
||||||
|
m_green = the_colour->Green ();
|
||||||
|
m_blue = the_colour->Blue ();
|
||||||
|
m_isInit = TRUE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_red = 0;
|
||||||
|
m_green = 0;
|
||||||
|
m_blue = 0;
|
||||||
|
m_isInit = FALSE;
|
||||||
|
}
|
||||||
|
/* TODO
|
||||||
|
m_pixel = PALETTERGB (m_red, m_green, m_blue);
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
wxColour::wxColour( char WXUNUSED(red), char WXUNUSED(green), char WXUNUSED(blue) )
|
wxColour::~wxColour ()
|
||||||
{
|
{
|
||||||
m_refData = new wxColourRefData();
|
}
|
||||||
};
|
|
||||||
|
wxColour& wxColour::operator = (const wxString& col)
|
||||||
wxColour::wxColour( const wxString &colourName )
|
|
||||||
{
|
{
|
||||||
wxNode *node = NULL;
|
wxColour *the_colour = wxTheColourDatabase->FindColour (col);
|
||||||
if ( (wxTheColourDatabase) && (node = wxTheColourDatabase->Find(colourName)) )
|
if (the_colour)
|
||||||
{
|
{
|
||||||
wxColour *col = (wxColour*)node->Data();
|
m_red = the_colour->Red ();
|
||||||
UnRef();
|
m_green = the_colour->Green ();
|
||||||
if (col) Ref( *col );
|
m_blue = the_colour->Blue ();
|
||||||
}
|
m_isInit = TRUE;
|
||||||
else
|
}
|
||||||
{
|
else
|
||||||
m_refData = new wxColourRefData();
|
{
|
||||||
};
|
m_red = 0;
|
||||||
};
|
m_green = 0;
|
||||||
|
m_blue = 0;
|
||||||
|
m_isInit = FALSE;
|
||||||
|
}
|
||||||
|
/* TODO
|
||||||
|
m_pixel = PALETTERGB (m_red, m_green, m_blue);
|
||||||
|
*/
|
||||||
|
return (*this);
|
||||||
|
}
|
||||||
|
|
||||||
wxColour::wxColour( const wxColour& col )
|
void wxColour::Set (unsigned char r, unsigned char g, unsigned char b)
|
||||||
{
|
|
||||||
Ref( col );
|
|
||||||
};
|
|
||||||
|
|
||||||
wxColour::wxColour( const wxColour* col )
|
|
||||||
{
|
|
||||||
if (col) Ref( *col );
|
|
||||||
};
|
|
||||||
|
|
||||||
wxColour::~wxColour(void)
|
|
||||||
{
|
{
|
||||||
};
|
m_red = r;
|
||||||
|
m_green = g;
|
||||||
wxColour& wxColour::operator = ( const wxColour& col )
|
m_blue = b;
|
||||||
{
|
m_isInit = TRUE;
|
||||||
if (*this == col) return (*this);
|
/* TODO
|
||||||
Ref( col );
|
m_pixel = PALETTERGB (m_red, m_green, m_blue);
|
||||||
return *this;
|
*/
|
||||||
};
|
}
|
||||||
|
|
||||||
wxColour& wxColour::operator = ( const wxString& colourName )
|
|
||||||
{
|
|
||||||
UnRef();
|
|
||||||
wxNode *node = NULL;
|
|
||||||
if ((wxTheColourDatabase) && (node = wxTheColourDatabase->Find(colourName)) )
|
|
||||||
{
|
|
||||||
wxColour *col = (wxColour*)node->Data();
|
|
||||||
if (col) Ref( *col );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_refData = new wxColourRefData();
|
|
||||||
};
|
|
||||||
return *this;
|
|
||||||
};
|
|
||||||
|
|
||||||
bool wxColour::operator == ( const wxColour& col )
|
|
||||||
{
|
|
||||||
return m_refData == col.m_refData;
|
|
||||||
};
|
|
||||||
|
|
||||||
bool wxColour::operator != ( const wxColour& col)
|
|
||||||
{
|
|
||||||
return m_refData != col.m_refData;
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxColour::Set( const unsigned char WXUNUSED(red), const unsigned char WXUNUSED(green),
|
|
||||||
const unsigned char WXUNUSED(blue) )
|
|
||||||
{
|
|
||||||
UnRef();
|
|
||||||
m_refData = new wxColourRefData();
|
|
||||||
};
|
|
||||||
|
|
||||||
unsigned char wxColour::Red(void) const
|
|
||||||
{
|
|
||||||
if (!Ok()) return 0;
|
|
||||||
return 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
unsigned char wxColour::Green(void) const
|
|
||||||
{
|
|
||||||
if (!Ok()) return 0;
|
|
||||||
return 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
unsigned char wxColour::Blue(void) const
|
|
||||||
{
|
|
||||||
if (!Ok()) return 0;
|
|
||||||
return 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
bool wxColour::Ok(void) const
|
|
||||||
{
|
|
||||||
return (m_refData);
|
|
||||||
return 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
int wxColour::GetPixel(void)
|
|
||||||
{
|
|
||||||
if (!Ok()) return 0;
|
|
||||||
return 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: combobox.cpp
|
// Name: combobox.cpp
|
||||||
// Purpose:
|
// Purpose: wxComboBox class
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@@ -14,136 +15,102 @@
|
|||||||
|
|
||||||
#include "wx/combobox.h"
|
#include "wx/combobox.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
#if !USE_SHARED_LIBRARY
|
||||||
// wxComboBox
|
IMPLEMENT_DYNAMIC_CLASS(wxComboBox, wxControl)
|
||||||
//-----------------------------------------------------------------------------
|
#endif
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
|
||||||
|
const wxString& value,
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxComboBox,wxControl)
|
const wxPoint& pos,
|
||||||
|
const wxSize& size,
|
||||||
bool wxComboBox::Create(wxWindow *parent, wxWindowID id, const wxString& value,
|
int n, const wxString choices[],
|
||||||
const wxPoint& pos, const wxSize& size, int n, const wxString choices[],
|
long style,
|
||||||
long style, const wxString& name )
|
const wxValidator& validator,
|
||||||
|
const wxString& name)
|
||||||
{
|
{
|
||||||
return TRUE;
|
SetName(name);
|
||||||
};
|
SetValidator(validator);
|
||||||
|
m_noStrings = n;
|
||||||
|
m_windowStyle = style;
|
||||||
|
|
||||||
void wxComboBox::Clear(void)
|
if (parent) parent->AddChild(this);
|
||||||
|
|
||||||
|
if ( id == -1 )
|
||||||
|
m_windowId = (int)NewControlId();
|
||||||
|
else
|
||||||
|
m_windowId = id;
|
||||||
|
|
||||||
|
// TODO: create combobox control
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxString wxComboBox::GetValue() const
|
||||||
{
|
{
|
||||||
};
|
// TODO
|
||||||
|
return wxString("");
|
||||||
|
}
|
||||||
|
|
||||||
void wxComboBox::Append( const wxString &item )
|
void wxComboBox::SetValue(const wxString& value)
|
||||||
{
|
{
|
||||||
Append( item, (char*)NULL );
|
// TODO
|
||||||
};
|
}
|
||||||
|
|
||||||
void wxComboBox::Append( const wxString &WXUNUSED(item), char *WXUNUSED(clientData) )
|
// Clipboard operations
|
||||||
|
void wxComboBox::Copy()
|
||||||
{
|
{
|
||||||
};
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
void wxComboBox::Delete( int WXUNUSED(n) )
|
void wxComboBox::Cut()
|
||||||
{
|
{
|
||||||
};
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
int wxComboBox::FindString( const wxString &WXUNUSED(item) )
|
void wxComboBox::Paste()
|
||||||
{
|
{
|
||||||
return -1;
|
// TODO
|
||||||
};
|
}
|
||||||
|
|
||||||
char* wxComboBox::GetClientData( int WXUNUSED(n) )
|
void wxComboBox::SetEditable(bool editable)
|
||||||
{
|
{
|
||||||
return (char*)NULL;
|
// TODO
|
||||||
};
|
}
|
||||||
|
|
||||||
void wxComboBox::SetClientData( int WXUNUSED(n), char *WXUNUSED(clientData) )
|
void wxComboBox::SetInsertionPoint(long pos)
|
||||||
{
|
{
|
||||||
};
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
int wxComboBox::GetSelection(void) const
|
void wxComboBox::SetInsertionPointEnd()
|
||||||
{
|
{
|
||||||
return -1;
|
// TODO
|
||||||
};
|
}
|
||||||
|
|
||||||
wxString wxComboBox::GetString( int WXUNUSED(n) ) const
|
long wxComboBox::GetInsertionPoint() const
|
||||||
{
|
{
|
||||||
return "";
|
// TODO
|
||||||
};
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
wxString wxComboBox::GetStringSelection(void) const
|
long wxComboBox::GetLastPosition() const
|
||||||
{
|
{
|
||||||
return "";
|
// TODO
|
||||||
};
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int wxComboBox::Number(void) const
|
void wxComboBox::Replace(long from, long to, const wxString& value)
|
||||||
{
|
{
|
||||||
return 0;
|
// TODO
|
||||||
};
|
}
|
||||||
|
|
||||||
void wxComboBox::SetSelection( int WXUNUSED(n) )
|
void wxComboBox::Remove(long from, long to)
|
||||||
{
|
{
|
||||||
};
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
void wxComboBox::SetStringSelection( const wxString &string )
|
void wxComboBox::SetSelection(long from, long to)
|
||||||
{
|
{
|
||||||
int res = FindString( string );
|
// TODO
|
||||||
if (res == -1) return;
|
}
|
||||||
SetSelection( res );
|
|
||||||
};
|
|
||||||
|
|
||||||
wxString wxComboBox::GetValue(void) const
|
|
||||||
{
|
|
||||||
return "";
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxComboBox::SetValue( const wxString& WXUNUSED(value) )
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxComboBox::Copy(void)
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxComboBox::Cut(void)
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxComboBox::Paste(void)
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxComboBox::SetInsertionPoint( long WXUNUSED(pos) )
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxComboBox::SetInsertionPointEnd(void)
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
long wxComboBox::GetInsertionPoint(void) const
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
long wxComboBox::GetLastPosition(void) const
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxComboBox::Replace( long WXUNUSED(from), long WXUNUSED(to), const wxString& WXUNUSED(value) )
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxComboBox::Remove(long WXUNUSED(from), long WXUNUSED(to) )
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxComboBox::SetSelection( long WXUNUSED(from), long WXUNUSED(to) )
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxComboBox::SetEditable( bool WXUNUSED(editable) )
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: control.cpp
|
// Name: control.cpp
|
||||||
// Purpose:
|
// Purpose: wxControl class
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
// Licence: wxWindows licence
|
// Copyright: (c) AUTHOR
|
||||||
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
@@ -14,46 +15,97 @@
|
|||||||
|
|
||||||
#include "wx/control.h"
|
#include "wx/control.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
#if !USE_SHARED_LIBRARY
|
||||||
// wxControl
|
IMPLEMENT_ABSTRACT_CLASS(wxControl, wxWindow)
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxControl,wxWindow)
|
BEGIN_EVENT_TABLE(wxControl, wxWindow)
|
||||||
|
END_EVENT_TABLE()
|
||||||
wxControl::wxControl(void)
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
wxControl::wxControl( wxWindow *parent, wxWindowID id,
|
|
||||||
const wxPoint &pos, const wxSize &size,
|
|
||||||
long style, const wxString &name ) :
|
|
||||||
wxWindow( parent, id, pos, size, style, name )
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxControl::Command( wxCommandEvent &WXUNUSED(event) )
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxControl::SetLabel( const wxString &label )
|
|
||||||
{
|
|
||||||
for ( const char *pc = label; *pc != '\0'; pc++ ) {
|
|
||||||
if ( *pc == '&' ) {
|
|
||||||
pc++; // skip it
|
|
||||||
#if 0 // it would be unused anyhow for now - kbd interface not done yet
|
|
||||||
if ( *pc != '&' )
|
|
||||||
m_chAccel = *pc;
|
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
|
|
||||||
m_label << *pc;
|
// Item members
|
||||||
}
|
wxControl::wxControl()
|
||||||
};
|
|
||||||
|
|
||||||
wxString wxControl::GetLabel(void) const
|
|
||||||
{
|
{
|
||||||
return m_label;
|
m_backgroundColour = *wxWHITE;
|
||||||
};
|
m_foregroundColour = *wxBLACK;
|
||||||
|
m_callback = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxControl::~wxControl()
|
||||||
|
{
|
||||||
|
// If we delete an item, we should initialize the parent panel,
|
||||||
|
// because it could now be invalid.
|
||||||
|
wxWindow *parent = (wxWindow *)GetParent();
|
||||||
|
if (parent)
|
||||||
|
{
|
||||||
|
if (parent->GetDefaultItem() == this)
|
||||||
|
parent->SetDefaultItem(NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxControl::SetLabel(const wxString& label)
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
wxString wxControl::GetLabel() const
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
return wxString("");
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Allocates control IDs within the appropriate range
|
||||||
|
*/
|
||||||
|
|
||||||
|
int NewControlId()
|
||||||
|
{
|
||||||
|
static int s_controlId = 0;
|
||||||
|
s_controlId ++;
|
||||||
|
return s_controlId;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxControl::ProcessCommand (wxCommandEvent & event)
|
||||||
|
{
|
||||||
|
// Tries:
|
||||||
|
// 1) A callback function (to become obsolete)
|
||||||
|
// 2) OnCommand, starting at this window and working up parent hierarchy
|
||||||
|
// 3) OnCommand then calls ProcessEvent to search the event tables.
|
||||||
|
if (m_callback)
|
||||||
|
{
|
||||||
|
(void) (*(m_callback)) (*this, event);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GetEventHandler()->OnCommand(*this, event);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxControl::SetClientSize (int width, int height)
|
||||||
|
{
|
||||||
|
SetSize (-1, -1, width, height);
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxControl::Centre (int direction)
|
||||||
|
{
|
||||||
|
int x, y, width, height, panel_width, panel_height, new_x, new_y;
|
||||||
|
|
||||||
|
wxWindow *parent = (wxWindow *) GetParent ();
|
||||||
|
if (!parent)
|
||||||
|
return;
|
||||||
|
|
||||||
|
parent->GetClientSize (&panel_width, &panel_height);
|
||||||
|
GetSize (&width, &height);
|
||||||
|
GetPosition (&x, &y);
|
||||||
|
|
||||||
|
new_x = x;
|
||||||
|
new_y = y;
|
||||||
|
|
||||||
|
if (direction & wxHORIZONTAL)
|
||||||
|
new_x = (int) ((panel_width - width) / 2);
|
||||||
|
|
||||||
|
if (direction & wxVERTICAL)
|
||||||
|
new_y = (int) ((panel_height - height) / 2);
|
||||||
|
|
||||||
|
SetSize (new_x, new_y, width, height);
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,120 +1,186 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: cursor.cpp
|
// Name: cursor.cpp
|
||||||
// Purpose:
|
// Purpose: wxCursor class
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma implementation "cursor.h"
|
#pragma implementation "cursor.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/cursor.h"
|
#include "wx/cursor.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
#if !USE_SHARED_LIBRARIES
|
||||||
// wxCursor
|
IMPLEMENT_DYNAMIC_CLASS(wxCursor, wxBitmap)
|
||||||
//-----------------------------------------------------------------------------
|
#endif
|
||||||
|
|
||||||
class wxCursorRefData: public wxObjectRefData
|
wxCursorRefData::wxCursorRefData()
|
||||||
{
|
{
|
||||||
public:
|
m_width = 32; m_height = 32;
|
||||||
|
|
||||||
wxCursorRefData(void);
|
|
||||||
~wxCursorRefData(void);
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
wxCursorRefData::wxCursorRefData(void)
|
/* TODO
|
||||||
|
m_hCursor = 0 ;
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
wxCursorRefData::~wxCursorRefData()
|
||||||
{
|
{
|
||||||
};
|
// TODO: destroy cursor
|
||||||
|
}
|
||||||
|
|
||||||
wxCursorRefData::~wxCursorRefData(void)
|
// Cursors
|
||||||
|
wxCursor::wxCursor()
|
||||||
{
|
{
|
||||||
};
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
wxCursor::wxCursor(const char WXUNUSED(bits)[], int WXUNUSED(width), int WXUNUSED(height),
|
||||||
|
int WXUNUSED(hotSpotX), int WXUNUSED(hotSpotY), const char WXUNUSED(maskBits)[])
|
||||||
#define M_CURSORDATA ((wxCursorRefData *)m_refData)
|
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxCursor,wxObject)
|
|
||||||
|
|
||||||
wxCursor::wxCursor(void)
|
|
||||||
{
|
{
|
||||||
};
|
}
|
||||||
|
|
||||||
wxCursor::wxCursor( int WXUNUSED(cursorId) )
|
wxCursor::wxCursor(const wxString& cursor_file, long flags, int hotSpotX, int hotSpotY)
|
||||||
{
|
{
|
||||||
m_refData = new wxCursorRefData();
|
m_refData = new wxIconRefData;
|
||||||
};
|
|
||||||
|
|
||||||
wxCursor::wxCursor( const wxCursor &cursor )
|
// TODO: create cursor from a file
|
||||||
|
}
|
||||||
|
|
||||||
|
// Cursors by stock number
|
||||||
|
wxCursor::wxCursor(int cursor_type)
|
||||||
{
|
{
|
||||||
Ref( cursor );
|
m_refData = new wxIconRefData;
|
||||||
};
|
|
||||||
|
|
||||||
wxCursor::wxCursor( const wxCursor *cursor )
|
/* TODO
|
||||||
|
switch (cursor_type)
|
||||||
|
{
|
||||||
|
case wxCURSOR_WAIT:
|
||||||
|
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_WAIT);
|
||||||
|
break;
|
||||||
|
case wxCURSOR_IBEAM:
|
||||||
|
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_IBEAM);
|
||||||
|
break;
|
||||||
|
case wxCURSOR_CROSS:
|
||||||
|
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_CROSS);
|
||||||
|
break;
|
||||||
|
case wxCURSOR_SIZENWSE:
|
||||||
|
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_SIZENWSE);
|
||||||
|
break;
|
||||||
|
case wxCURSOR_SIZENESW:
|
||||||
|
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_SIZENESW);
|
||||||
|
break;
|
||||||
|
case wxCURSOR_SIZEWE:
|
||||||
|
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_SIZEWE);
|
||||||
|
break;
|
||||||
|
case wxCURSOR_SIZENS:
|
||||||
|
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_SIZENS);
|
||||||
|
break;
|
||||||
|
case wxCURSOR_CHAR:
|
||||||
|
{
|
||||||
|
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_ARROW);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case wxCURSOR_HAND:
|
||||||
|
{
|
||||||
|
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), "wxCURSOR_HAND");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case wxCURSOR_BULLSEYE:
|
||||||
|
{
|
||||||
|
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), "wxCURSOR_BULLSEYE");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case wxCURSOR_PENCIL:
|
||||||
|
{
|
||||||
|
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), "wxCURSOR_PENCIL");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case wxCURSOR_MAGNIFIER:
|
||||||
|
{
|
||||||
|
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), "wxCURSOR_MAGNIFIER");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case wxCURSOR_NO_ENTRY:
|
||||||
|
{
|
||||||
|
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), "wxCURSOR_NO_ENTRY");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case wxCURSOR_LEFT_BUTTON:
|
||||||
|
{
|
||||||
|
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_ARROW);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case wxCURSOR_RIGHT_BUTTON:
|
||||||
|
{
|
||||||
|
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_ARROW);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case wxCURSOR_MIDDLE_BUTTON:
|
||||||
|
{
|
||||||
|
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_ARROW);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case wxCURSOR_SIZING:
|
||||||
|
{
|
||||||
|
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), "wxCURSOR_SIZING");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case wxCURSOR_WATCH:
|
||||||
|
{
|
||||||
|
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), "wxCURSOR_WATCH");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case wxCURSOR_SPRAYCAN:
|
||||||
|
{
|
||||||
|
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), "wxCURSOR_ROLLER");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case wxCURSOR_PAINT_BRUSH:
|
||||||
|
{
|
||||||
|
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), "wxCURSOR_PBRUSH");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case wxCURSOR_POINT_LEFT:
|
||||||
|
{
|
||||||
|
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), "wxCURSOR_PLEFT");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case wxCURSOR_POINT_RIGHT:
|
||||||
|
{
|
||||||
|
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), "wxCURSOR_PRIGHT");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case wxCURSOR_QUESTION_ARROW:
|
||||||
|
{
|
||||||
|
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), "wxCURSOR_QARROW");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case wxCURSOR_BLANK:
|
||||||
|
{
|
||||||
|
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), "wxCURSOR_BLANK");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
case wxCURSOR_ARROW:
|
||||||
|
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_ARROW);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
wxCursor::~wxCursor()
|
||||||
{
|
{
|
||||||
UnRef();
|
}
|
||||||
if (cursor) Ref( *cursor );
|
|
||||||
};
|
|
||||||
|
|
||||||
wxCursor::~wxCursor(void)
|
// Global cursor setting
|
||||||
|
void wxSetCursor(const wxCursor& cursor)
|
||||||
{
|
{
|
||||||
};
|
// TODO (optional on platforms with no global cursor)
|
||||||
|
}
|
||||||
wxCursor& wxCursor::operator = ( const wxCursor& cursor )
|
|
||||||
{
|
|
||||||
if (*this == cursor) return (*this);
|
|
||||||
Ref( cursor );
|
|
||||||
return *this;
|
|
||||||
};
|
|
||||||
|
|
||||||
bool wxCursor::operator == ( const wxCursor& cursor )
|
|
||||||
{
|
|
||||||
return m_refData == cursor.m_refData;
|
|
||||||
};
|
|
||||||
|
|
||||||
bool wxCursor::operator != ( const wxCursor& cursor )
|
|
||||||
{
|
|
||||||
return m_refData != cursor.m_refData;
|
|
||||||
};
|
|
||||||
|
|
||||||
bool wxCursor::Ok(void) const
|
|
||||||
{
|
|
||||||
return TRUE;
|
|
||||||
};
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// busy cursor routines
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
bool g_isBusy = FALSE;
|
|
||||||
|
|
||||||
void wxEndBusyCursor(void)
|
|
||||||
{
|
|
||||||
g_isBusy = FALSE;
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxBeginBusyCursor( wxCursor *WXUNUSED(cursor) )
|
|
||||||
{
|
|
||||||
g_isBusy = TRUE;
|
|
||||||
};
|
|
||||||
|
|
||||||
bool wxIsBusy(void)
|
|
||||||
{
|
|
||||||
return g_isBusy;
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxSetCursor( const wxCursor& cursor )
|
|
||||||
{
|
|
||||||
extern wxCursor *g_globalCursor;
|
|
||||||
if (g_globalCursor) (*g_globalCursor) = cursor;
|
|
||||||
|
|
||||||
if (cursor.Ok()) {};
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
600
src/qt/data.cpp
600
src/qt/data.cpp
@@ -1,32 +1,23 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: data.cpp
|
// Name: data.cpp
|
||||||
// Purpose:
|
// Purpose: Various data
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
// #pragma implementation
|
#pragma implementation
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/wx.h"
|
#include "wx/wx.h"
|
||||||
|
|
||||||
#define _MAXPATHLEN 500
|
#define _MAXPATHLEN 500
|
||||||
|
|
||||||
// Used for X resources
|
// Useful buffer, initialized in CommonInit
|
||||||
|
|
||||||
#include <X11/Xlib.h>
|
|
||||||
#include <X11/Xutil.h>
|
|
||||||
#include <X11/Xresource.h>
|
|
||||||
|
|
||||||
wxList wxResourceCache(wxKEY_STRING);
|
|
||||||
XrmDatabase wxResourceDatabase;
|
|
||||||
|
|
||||||
// Useful buffer, initialized in wxCommonInit
|
|
||||||
char *wxBuffer = NULL;
|
char *wxBuffer = NULL;
|
||||||
|
|
||||||
// Windows List
|
// Windows List
|
||||||
@@ -35,44 +26,23 @@ wxList wxTopLevelWindows;
|
|||||||
// List of windows pending deletion
|
// List of windows pending deletion
|
||||||
wxList wxPendingDelete;
|
wxList wxPendingDelete;
|
||||||
|
|
||||||
// Current cursor, in order to hang on to
|
|
||||||
// cursor handle when setting the cursor globally
|
|
||||||
wxCursor *g_globalCursor = NULL;
|
|
||||||
|
|
||||||
// Don't allow event propagation during drag
|
|
||||||
bool g_blockEventsOnDrag = FALSE;
|
|
||||||
|
|
||||||
// Message Strings for Internationalization
|
|
||||||
char **wx_msg_str = (char**)NULL;
|
|
||||||
|
|
||||||
// Custom OS version, as optionally placed in wx.ini/.wxrc
|
|
||||||
// Currently this can be Win95, Windows, Win32s, WinNT.
|
|
||||||
// For some systems, you can't tell until run-time what services you
|
|
||||||
// have. See wxGetOsVersion, which uses this string if present.
|
|
||||||
char *wxOsVersion = NULL;
|
|
||||||
|
|
||||||
// For printing several pages
|
|
||||||
int wxPageNumber;
|
int wxPageNumber;
|
||||||
wxPrintPaperDatabase* wxThePrintPaperDatabase = NULL;
|
|
||||||
|
|
||||||
// GDI Object Lists
|
// GDI Object Lists
|
||||||
wxBrushList *wxTheBrushList = NULL;
|
wxBrushList *wxTheBrushList = NULL;
|
||||||
wxPenList *wxThePenList = NULL;
|
wxPenList *wxThePenList = NULL;
|
||||||
wxFontList *wxTheFontList = NULL;
|
wxFontList *wxTheFontList = NULL;
|
||||||
wxColourDatabase *wxTheColourDatabase = NULL;
|
|
||||||
wxBitmapList *wxTheBitmapList = NULL;
|
wxBitmapList *wxTheBitmapList = NULL;
|
||||||
|
|
||||||
|
|
||||||
// X only font names
|
wxColourDatabase *wxTheColourDatabase = NULL;
|
||||||
// wxFontNameDirectory wxTheFontNameDirectory;
|
|
||||||
|
|
||||||
// Stock objects
|
// Stock objects
|
||||||
wxFont *wxNORMAL_FONT;
|
wxFont *wxNORMAL_FONT;
|
||||||
wxFont *wxSMALL_FONT;
|
wxFont *wxSMALL_FONT;
|
||||||
wxFont *wxITALIC_FONT;
|
wxFont *wxITALIC_FONT;
|
||||||
wxFont *wxSWISS_FONT;
|
wxFont *wxSWISS_FONT;
|
||||||
|
|
||||||
wxPen *wxRED_PEN;
|
wxPen *wxRED_PEN;
|
||||||
|
|
||||||
wxPen *wxCYAN_PEN;
|
wxPen *wxCYAN_PEN;
|
||||||
wxPen *wxGREEN_PEN;
|
wxPen *wxGREEN_PEN;
|
||||||
wxPen *wxBLACK_PEN;
|
wxPen *wxBLACK_PEN;
|
||||||
@@ -96,7 +66,6 @@ wxBrush *wxLIGHT_GREY_BRUSH;
|
|||||||
|
|
||||||
wxColour *wxBLACK;
|
wxColour *wxBLACK;
|
||||||
wxColour *wxWHITE;
|
wxColour *wxWHITE;
|
||||||
wxColour *wxGREY; // Robert Roebling
|
|
||||||
wxColour *wxRED;
|
wxColour *wxRED;
|
||||||
wxColour *wxBLUE;
|
wxColour *wxBLUE;
|
||||||
wxColour *wxGREEN;
|
wxColour *wxGREEN;
|
||||||
@@ -108,14 +77,15 @@ wxCursor *wxHOURGLASS_CURSOR = NULL;
|
|||||||
wxCursor *wxCROSS_CURSOR = NULL;
|
wxCursor *wxCROSS_CURSOR = NULL;
|
||||||
|
|
||||||
// 'Null' objects
|
// 'Null' objects
|
||||||
|
wxAcceleratorTable wxNullAcceleratorTable;
|
||||||
wxBitmap wxNullBitmap;
|
wxBitmap wxNullBitmap;
|
||||||
wxIcon wxNullIcon;
|
wxIcon wxNullIcon;
|
||||||
wxCursor wxNullCursor;
|
wxCursor wxNullCursor;
|
||||||
wxPen wxNullPen;
|
wxPen wxNullPen;
|
||||||
wxBrush wxNullBrush;
|
wxBrush wxNullBrush;
|
||||||
|
wxPalette wxNullPalette;
|
||||||
wxFont wxNullFont;
|
wxFont wxNullFont;
|
||||||
wxColour wxNullColour;
|
wxColour wxNullColour;
|
||||||
wxPalette wxNullPalette;
|
|
||||||
|
|
||||||
// Default window names
|
// Default window names
|
||||||
const char *wxButtonNameStr = "button";
|
const char *wxButtonNameStr = "button";
|
||||||
@@ -157,391 +127,10 @@ const char *wxFatalErrorStr = "wxWindows Fatal Error";
|
|||||||
const char *wxFloatToStringStr = "%.2f";
|
const char *wxFloatToStringStr = "%.2f";
|
||||||
const char *wxDoubleToStringStr = "%.2f";
|
const char *wxDoubleToStringStr = "%.2f";
|
||||||
|
|
||||||
#ifdef wx_msw
|
|
||||||
const char *wxUserResourceStr = "TEXT";
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#if USE_SHARED_LIBRARY
|
|
||||||
/*
|
|
||||||
* For wxWindows to be made into a dynamic library (e.g. Sun),
|
|
||||||
* all IMPLEMENT_... macros must be in one place.
|
|
||||||
* But normally, the definitions are in the appropriate places.
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Hand-coded IMPLEMENT... macro for wxObject (define static data)
|
|
||||||
wxClassInfo wxObject::classwxObject("wxObject", NULL, NULL, sizeof(wxObject), NULL);
|
|
||||||
wxClassInfo *wxClassInfo::first = NULL;
|
|
||||||
|
|
||||||
#include "wx/button.h"
|
|
||||||
#include "wx/bmpbuttn.h"
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxButton, wxControl)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxBitmapButton, wxButton)
|
|
||||||
|
|
||||||
#include "wx/checkbox.h"
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxCheckBox, wxControl)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxBitmapCheckBox, wxCheckBox)
|
|
||||||
|
|
||||||
#include "wx/choice.h"
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxChoice, wxControl)
|
|
||||||
|
|
||||||
#if USE_CLIPBOARD
|
|
||||||
#include "wx/clipbrd.h"
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxClipboard, wxObject)
|
|
||||||
IMPLEMENT_ABSTRACT_CLASS(wxClipboardClient, wxObject)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if USE_COMBOBOX
|
|
||||||
#include "wx/combobox.h"
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxComboBox, wxControl)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "wx/dc.h"
|
|
||||||
#include "wx/dcmemory.h"
|
|
||||||
#include "wx/dcclient.h"
|
|
||||||
#include "wx/dcscreen.h"
|
|
||||||
IMPLEMENT_ABSTRACT_CLASS(wxDC, wxObject)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxClientDC, wxDC)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxWindowDC, wxDC)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxPaintDC, wxDC)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxMemoryDC, wxDC)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxScreenDC, wxWindowDC)
|
|
||||||
|
|
||||||
#if defined(wx_msw)
|
|
||||||
#include "wx/dcprint.h"
|
|
||||||
IMPLEMENT_CLASS(wxPrinterDC, wxDC)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "wx/dialog.h"
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxDialog, wxWindow)
|
|
||||||
|
|
||||||
#include "wx/frame.h"
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxWindow)
|
|
||||||
|
|
||||||
#include "wx/mdi.h"
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxMDIParentFrame, wxFrame)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxMDIChildFrame, wxFrame)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxMDIClientWindow, wxWindow)
|
|
||||||
|
|
||||||
#include "wx/cmndata.h"
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxColourData, wxObject)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxFontData, wxObject)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxPrintData, wxObject)
|
|
||||||
|
|
||||||
#include "wx/colordlg.h"
|
|
||||||
#include "wx/fontdlg.h"
|
|
||||||
|
|
||||||
#if !defined(wx_msw) || USE_GENERIC_DIALOGS_IN_MSW
|
|
||||||
#include "wx/generic/colordlg.h"
|
|
||||||
#include "wx/generic/fontdlg.h"
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxGenericColourDialog, wxDialog)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxGenericFontDialog, wxDialog)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// X defines wxColourDialog to be wxGenericColourDialog
|
|
||||||
#ifndef wx_x
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxColourDialog, wxDialog)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxFontDialog, wxDialog)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "wx/gdicmn.h"
|
|
||||||
#include "wx/pen.h"
|
|
||||||
#include "wx/brush.h"
|
|
||||||
#include "wx/font.h"
|
|
||||||
#include "wx/palette.h"
|
|
||||||
#include "wx/icon.h"
|
|
||||||
#include "wx/cursor.h"
|
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxColour, wxObject)
|
|
||||||
IMPLEMENT_CLASS(wxColourDatabase, wxList)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxFontList, wxList)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxPenList, wxList)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxBrushList, wxList)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxBitmapList, wxList)
|
|
||||||
|
|
||||||
/*
|
|
||||||
#if (!USE_TYPEDEFS)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxPoint, wxObject)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxIntPoint, wxObject)
|
|
||||||
#endif
|
|
||||||
*/
|
|
||||||
|
|
||||||
#if defined(wx_x) || (defined(wx_msw) && USE_PORTABLE_FONTS_IN_MSW)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxFontNameDirectory, wxObject)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "wx/hash.h"
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxHashTable, wxObject)
|
|
||||||
|
|
||||||
#include "wx/help.h"
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxHelpInstance, wxClient)
|
|
||||||
IMPLEMENT_CLASS(wxHelpConnection, wxConnection)
|
|
||||||
|
|
||||||
#include "wx/list.h"
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxNode, wxObject)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxList, wxObject)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxStringList, wxList)
|
|
||||||
|
|
||||||
#if USE_PRINTING_ARCHITECTURE
|
|
||||||
#include "wx/print.h"
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxPrintDialog, wxDialog)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxPrinterBase, wxObject)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxPostScriptPrinter, wxPrinterBase)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxWindowsPrinter, wxPrinterBase)
|
|
||||||
IMPLEMENT_ABSTRACT_CLASS(wxPrintout, wxObject)
|
|
||||||
IMPLEMENT_CLASS(wxPreviewCanvas, wxWindow)
|
|
||||||
IMPLEMENT_CLASS(wxPreviewControlBar, wxWindow)
|
|
||||||
IMPLEMENT_CLASS(wxPreviewFrame, wxFrame)
|
|
||||||
IMPLEMENT_CLASS(wxPrintPreviewBase, wxObject)
|
|
||||||
IMPLEMENT_CLASS(wxPostScriptPrintPreview, wxPrintPreviewBase)
|
|
||||||
IMPLEMENT_CLASS(wxWindowsPrintPreview, wxPrintPreviewBase)
|
|
||||||
IMPLEMENT_CLASS(wxGenericPrintDialog, wxDialog)
|
|
||||||
IMPLEMENT_CLASS(wxGenericPrintSetupDialog, wxDialog)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if USE_POSTSCRIPT
|
#if USE_POSTSCRIPT
|
||||||
#include "wx/postscrp.h"
|
wxPrintPaperDatabase* wxThePrintPaperDatabase = NULL;
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxPostScriptDC, wxDC)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxPrintSetupData, wxObject)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxPageSetupData, wxObject)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxPrintPaperType, wxObject)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxPrintPaperDatabase, wxList)
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if USE_WX_RESOURCES
|
|
||||||
#include "wx/resource.h"
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxItemResource, wxObject)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxResourceTable, wxHashTable)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "wx/event.h"
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxEvtHandler, wxObject)
|
|
||||||
IMPLEMENT_ABSTRACT_CLASS(wxEvent, wxObject)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxCommandEvent, wxEvent)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxScrollEvent, wxCommandEvent)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxMouseEvent, wxEvent)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxKeyEvent, wxEvent)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxSizeEvent, wxEvent)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxPaintEvent, wxEvent)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxEraseEvent, wxEvent)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxMoveEvent, wxEvent)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxFocusEvent, wxEvent)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxCloseEvent, wxEvent)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxMenuEvent, wxEvent)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxJoystickEvent, wxEvent)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxDropFilesEvent, wxEvent)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxActivateEvent, wxEvent)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxInitDialogEvent, wxEvent)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxSysColourChangedEvent, wxEvent)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxIdleEvent, wxEvent)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxUpdateUIEvent, wxEvent)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxProcessEvent, wxEvent)
|
|
||||||
|
|
||||||
#include "wx/utils.h"
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxPathList, wxList)
|
|
||||||
|
|
||||||
// IMPLEMENT_DYNAMIC_CLASS(wxRect, wxObject)
|
|
||||||
|
|
||||||
#include "wx/process.h"
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxProcess, wxEvtHandler)
|
|
||||||
|
|
||||||
#if USE_TIMEDATE
|
|
||||||
#include "wx/date.h"
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxDate, wxObject)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if USE_DOC_VIEW_ARCHITECTURE
|
|
||||||
#include "wx/docview.h"
|
|
||||||
//IMPLEMENT_ABSTRACT_CLASS(wxDocItem, wxObject)
|
|
||||||
IMPLEMENT_ABSTRACT_CLASS(wxDocument, wxEvtHandler)
|
|
||||||
IMPLEMENT_ABSTRACT_CLASS(wxView, wxEvtHandler)
|
|
||||||
IMPLEMENT_ABSTRACT_CLASS(wxDocTemplate, wxObject)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxDocManager, wxEvtHandler)
|
|
||||||
IMPLEMENT_CLASS(wxDocChildFrame, wxFrame)
|
|
||||||
IMPLEMENT_CLASS(wxDocParentFrame, wxFrame)
|
|
||||||
#if USE_PRINTING_ARCHITECTURE
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxDocPrintout, wxPrintout)
|
|
||||||
#endif
|
|
||||||
IMPLEMENT_CLASS(wxCommand, wxObject)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxCommandProcessor, wxObject)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxFileHistory, wxObject)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if USE_CONSTRAINTS
|
|
||||||
#include "wx/layout.h"
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxIndividualLayoutConstraint, wxObject)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxLayoutConstraints, wxObject)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxSizer, wxObject)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxRowColSizer, wxSizer)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if USE_TOOLBAR
|
|
||||||
#include "wx/tbarbase.h"
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxToolBarTool, wxObject)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxToolBarBase, wxControl)
|
|
||||||
|
|
||||||
#include "wx/tbarsmpl.h"
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxToolBarSimple, wxToolBarBase)
|
|
||||||
|
|
||||||
#ifdef wx_msw
|
|
||||||
#include "wx/tbarmsw.h"
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxToolBarMSW, wxToolBarBase)
|
|
||||||
|
|
||||||
#include "wx/tbar95.h"
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxToolBar95, wxToolBarBase)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "wx/statusbr.h"
|
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxStatusBar, wxWindow)
|
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxStatusBar, wxWindow)
|
|
||||||
EVT_PAINT(wxStatusBar::OnPaint)
|
|
||||||
EVT_SYS_COLOUR_CHANGED(wxStatusBar::OnSysColourChanged)
|
|
||||||
END_EVENT_TABLE()
|
|
||||||
|
|
||||||
#if USE_TIMEDATE
|
|
||||||
#include "wx/time.h"
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxTime, wxObject)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !USE_GNU_WXSTRING
|
|
||||||
#include "wx/string.h"
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxString, wxObject)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef wx_motif
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxXColormap, wxObject)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxXFont, wxObject)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxXCursor, wxObject)
|
|
||||||
#endif
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxPalette, wxGDIObject)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxPen, wxGDIObject)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxBrush, wxGDIObject)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxIcon, wxBitmap)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxCursor, wxBitmap)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxBitmap, wxGDIObject)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxMask, wxObject)
|
|
||||||
|
|
||||||
// This will presumably be implemented on other platforms too
|
|
||||||
#ifdef wx_msw
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxBitmapHandler, wxObject)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxBMPResourceHandler, wxBitmapHandler)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxBMPFileHandler, wxBitmapHandler)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxXPMFileHandler, wxBitmapHandler)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxXPMDataHandler, wxBitmapHandler)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxICOFileHandler, wxBitmapHandler)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxICOResourceHandler, wxBitmapHandler)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "wx/statbox.h"
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxStaticBox, wxControl)
|
|
||||||
|
|
||||||
#if USE_IPC
|
|
||||||
#include "wx/dde.h"
|
|
||||||
IMPLEMENT_ABSTRACT_CLASS(wxDDEObject, wxObject)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxDDEServer, wxDDEObject)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxDDEClient, wxDDEObject)
|
|
||||||
IMPLEMENT_CLASS(wxDDEConnection, wxObject)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
IMPLEMENT_ABSTRACT_CLASS(wxControl, wxWindow)
|
|
||||||
|
|
||||||
#include "wx/listbox.h"
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxListBox, wxControl)
|
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxApp, wxEvtHandler)
|
|
||||||
|
|
||||||
#include "wx/menu.h"
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxMenu, wxWindow)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxMenuItem, wxObject)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxMenuBar, wxWindow)
|
|
||||||
|
|
||||||
#include "wx/stattext.h"
|
|
||||||
#include "wx/statbmp.h"
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxStaticText, wxControl)
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxStaticBitmap, wxControl)
|
|
||||||
|
|
||||||
#if USE_METAFILE
|
|
||||||
#include "wx/metafile.h"
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxMetaFile, wxObject)
|
|
||||||
IMPLEMENT_ABSTRACT_CLASS(wxMetaFileDC, wxDC)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "wx/radiobox.h"
|
|
||||||
#include "wx/radiobut.h"
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxRadioBox, wxControl)
|
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxRadioButton, wxControl)
|
|
||||||
// IMPLEMENT_DYNAMIC_CLASS(wxBitmapRadioButton, wxRadioButton)
|
|
||||||
|
|
||||||
#include "wx/scrolbar.h"
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxScrollBar, wxControl)
|
|
||||||
|
|
||||||
#if WXWIN_COMPATIBILITY
|
|
||||||
BEGIN_EVENT_TABLE(wxScrollBar, wxControl)
|
|
||||||
EVT_SCROLL(wxScrollBar::OnScroll)
|
|
||||||
END_EVENT_TABLE()
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "wx/slider.h"
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxSlider, wxControl)
|
|
||||||
|
|
||||||
#if WXWIN_COMPATIBILITY
|
|
||||||
BEGIN_EVENT_TABLE(wxSlider, wxControl)
|
|
||||||
EVT_SCROLL(wxSlider::OnScroll)
|
|
||||||
END_EVENT_TABLE()
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "wx/timer.h"
|
|
||||||
IMPLEMENT_ABSTRACT_CLASS(wxTimer, wxObject)
|
|
||||||
|
|
||||||
#include "wx/textctrl.h"
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxTextCtrl, wxControl)
|
|
||||||
|
|
||||||
#include "wx/window.h"
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxWindow, wxEvtHandler)
|
|
||||||
|
|
||||||
#include "wx/scrolwin.h"
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxScrolledWindow, wxWindow)
|
|
||||||
|
|
||||||
#include "wx/panel.h"
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxPanel, wxWindow)
|
|
||||||
|
|
||||||
#include "wx/msgbxdlg.h"
|
|
||||||
#include "wx/textdlg.h"
|
|
||||||
#include "wx/filedlg.h"
|
|
||||||
#include "wx/dirdlg.h"
|
|
||||||
#include "wx/choicdlg.h"
|
|
||||||
|
|
||||||
#if !defined(wx_msw) || USE_GENERIC_DIALOGS_IN_MSW
|
|
||||||
#include "wx/generic/msgdlgg.h"
|
|
||||||
IMPLEMENT_CLASS(wxGenericMessageDialog, wxDialog)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
IMPLEMENT_CLASS(wxTextEntryDialog, wxDialog)
|
|
||||||
IMPLEMENT_CLASS(wxSingleChoiceDialog, wxDialog)
|
|
||||||
IMPLEMENT_CLASS(wxFileDialog, wxDialog)
|
|
||||||
IMPLEMENT_CLASS(wxDirDialog, wxDialog)
|
|
||||||
|
|
||||||
#ifdef wx_msw
|
|
||||||
IMPLEMENT_CLASS(wxMessageDialog)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if USE_GAUGE
|
|
||||||
#ifdef wx_motif
|
|
||||||
#include "../../contrib/xmgauge/gauge.h"
|
|
||||||
#endif
|
|
||||||
#include "wx_gauge.h"
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxGauge, wxControl)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "wx/grid.h"
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxGenericGrid, wxPanel)
|
|
||||||
|
|
||||||
///// Event tables (also must be in one, statically-linked file for shared libraries)
|
///// Event tables (also must be in one, statically-linked file for shared libraries)
|
||||||
|
|
||||||
// This is the base, wxEvtHandler 'bootstrap' code which is expanded manually here
|
// This is the base, wxEvtHandler 'bootstrap' code which is expanded manually here
|
||||||
@@ -552,160 +141,5 @@ const wxEventTable wxEvtHandler::sm_eventTable =
|
|||||||
|
|
||||||
const wxEventTableEntry wxEvtHandler::sm_eventTableEntries[] = { { 0, 0, 0, NULL } };
|
const wxEventTableEntry wxEvtHandler::sm_eventTableEntries[] = { { 0, 0, 0, NULL } };
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxFrame, wxWindow)
|
|
||||||
EVT_ACTIVATE(wxFrame::OnActivate)
|
|
||||||
EVT_SIZE(wxFrame::OnSize)
|
|
||||||
EVT_MENU_HIGHLIGHT_ALL(wxFrame::OnMenuHighlight)
|
|
||||||
EVT_SYS_COLOUR_CHANGED(wxFrame::OnSysColourChanged)
|
|
||||||
EVT_IDLE(wxFrame::OnIdle)
|
|
||||||
EVT_CLOSE(wxFrame::OnCloseWindow)
|
|
||||||
END_EVENT_TABLE()
|
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxDialog, wxPanel)
|
|
||||||
EVT_BUTTON(wxID_OK, wxDialog::OnOK)
|
|
||||||
EVT_BUTTON(wxID_APPLY, wxDialog::OnApply)
|
|
||||||
EVT_BUTTON(wxID_CANCEL, wxDialog::OnCancel)
|
|
||||||
EVT_CHAR_HOOK(wxDialog::OnCharHook)
|
|
||||||
EVT_SYS_COLOUR_CHANGED(wxDialog::OnSysColourChanged)
|
|
||||||
EVT_CLOSE(wxDialog::OnCloseWindow)
|
|
||||||
END_EVENT_TABLE()
|
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxWindow, wxEvtHandler)
|
|
||||||
EVT_CHAR(wxWindow::OnChar)
|
|
||||||
EVT_SIZE(wxWindow::Size)
|
|
||||||
EVT_ERASE_BACKGROUND(wxWindow::OnEraseBackground)
|
|
||||||
EVT_SYS_COLOUR_CHANGED(wxWindow::OnSysColourChanged)
|
|
||||||
EVT_INIT_DIALOG(wxWindow::OnInitDialog)
|
|
||||||
EVT_IDLE(wxWindow::OnIdle)
|
|
||||||
END_EVENT_TABLE()
|
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxScrolledWindow, wxWindow)
|
|
||||||
EVT_SCROLL(wxScrolledWindow::OnScroll)
|
|
||||||
EVT_SIZE(wxScrolledWindow::OnSize)
|
|
||||||
END_EVENT_TABLE()
|
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxPanel, wxWindow)
|
|
||||||
EVT_SYS_COLOUR_CHANGED(wxPanel::OnSysColourChanged)
|
|
||||||
END_EVENT_TABLE()
|
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxTextCtrl, wxControl)
|
|
||||||
EVT_CHAR(wxTextCtrl::OnChar)
|
|
||||||
EVT_DROP_FILES(wxTextCtrl::OnDropFiles)
|
|
||||||
EVT_ERASE_BACKGROUND(wxTextCtrl::OnEraseBackground)
|
|
||||||
END_EVENT_TABLE()
|
|
||||||
|
|
||||||
#ifdef wx_msw
|
|
||||||
BEGIN_EVENT_TABLE(wxMDIParentWindow, wxFrame)
|
|
||||||
EVT_SIZE(wxMDIParentWindow::OnSize)
|
|
||||||
EVT_ACTIVATE(wxMDIParentWindow::OnActivate)
|
|
||||||
EVT_SYS_COLOUR_CHANGED(wxMDIParentWindow::OnSysColourChanged)
|
|
||||||
END_EVENT_TABLE()
|
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxMDIClientWindow, wxWindow)
|
|
||||||
EVT_SCROLL(wxMDIClientWindow::OnScroll)
|
|
||||||
END_EVENT_TABLE()
|
|
||||||
#endif
|
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxToolBarBase, wxControl)
|
|
||||||
EVT_SCROLL(wxToolBarBase::OnScroll)
|
|
||||||
EVT_SIZE(wxToolBarBase::OnSize)
|
|
||||||
EVT_IDLE(wxToolBarBase::OnIdle)
|
|
||||||
END_EVENT_TABLE()
|
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxToolBarSimple, wxToolBarBase)
|
|
||||||
EVT_SIZE(wxToolBarSimple::OnSize)
|
|
||||||
EVT_PAINT(wxToolBarSimple::OnPaint)
|
|
||||||
EVT_KILL_FOCUS(wxToolBarSimple::OnKillFocus)
|
|
||||||
EVT_MOUSE_EVENTS(wxToolBarSimple::OnMouseEvent)
|
|
||||||
END_EVENT_TABLE()
|
|
||||||
|
|
||||||
#ifdef wx_msw
|
|
||||||
BEGIN_EVENT_TABLE(wxToolBarMSW, wxToolBarBase)
|
|
||||||
EVT_SIZE(wxToolBarMSW::OnSize)
|
|
||||||
EVT_PAINT(wxToolBarMSW::OnPaint)
|
|
||||||
EVT_MOUSE_EVENTS(wxToolBarMSW::OnMouseEvent)
|
|
||||||
END_EVENT_TABLE()
|
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxToolBar95, wxToolBarBase)
|
|
||||||
EVT_SIZE(wxToolBar95::OnSize)
|
|
||||||
EVT_PAINT(wxToolBar95::OnPaint)
|
|
||||||
EVT_KILL_FOCUS(wxToolBar95::OnKillFocus)
|
|
||||||
EVT_MOUSE_EVENTS(wxToolBar95::OnMouseEvent)
|
|
||||||
EVT_SYS_COLOUR_CHANGED(wxToolBar95::OnSysColourChanged)
|
|
||||||
END_EVENT_TABLE()
|
|
||||||
#endif
|
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxGenericGrid, wxPanel)
|
|
||||||
EVT_SIZE(wxGenericGrid::OnSize)
|
|
||||||
EVT_PAINT(wxGenericGrid::OnPaint)
|
|
||||||
EVT_MOUSE_EVENTS(wxGenericGrid::OnMouseEvent)
|
|
||||||
EVT_TEXT(wxGRID_TEXT_CTRL, wxGenericGrid::OnText)
|
|
||||||
EVT_COMMAND_SCROLL(wxGRID_HSCROLL, wxGenericGrid::OnGridScroll)
|
|
||||||
EVT_COMMAND_SCROLL(wxGRID_VSCROLL, wxGenericGrid::OnGridScroll)
|
|
||||||
END_EVENT_TABLE()
|
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxControl, wxWindow)
|
|
||||||
EVT_ERASE_BACKGROUND(wxControl::OnEraseBackground)
|
|
||||||
END_EVENT_TABLE()
|
|
||||||
|
|
||||||
#if !defined(wx_msw) || USE_GENERIC_DIALOGS_IN_MSW
|
|
||||||
BEGIN_EVENT_TABLE(wxGenericMessageDialog, wxDialog)
|
|
||||||
EVT_BUTTON(wxID_YES, wxGenericMessageDialog::OnYes)
|
|
||||||
EVT_BUTTON(wxID_NO, wxGenericMessageDialog::OnNo)
|
|
||||||
EVT_BUTTON(wxID_CANCEL, wxGenericMessageDialog::OnCancel)
|
|
||||||
END_EVENT_TABLE()
|
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxGenericColourDialog, wxDialog)
|
|
||||||
EVT_BUTTON(wxID_ADD_CUSTOM, wxGenericColourDialog::OnAddCustom)
|
|
||||||
EVT_SLIDER(wxID_RED_SLIDER, wxGenericColourDialog::OnRedSlider)
|
|
||||||
EVT_SLIDER(wxID_GREEN_SLIDER, wxGenericColourDialog::OnGreenSlider)
|
|
||||||
EVT_SLIDER(wxID_BLUE_SLIDER, wxGenericColourDialog::OnBlueSlider)
|
|
||||||
EVT_PAINT(wxGenericColourDialog::OnPaint)
|
|
||||||
EVT_MOUSE_EVENTS(wxGenericColourDialog::OnMouseEvent)
|
|
||||||
END_EVENT_TABLE()
|
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxGenericFontDialog, wxDialog)
|
|
||||||
EVT_CHECKBOX(wxID_FONT_UNDERLINE, wxGenericFontDialog::OnChangeFont)
|
|
||||||
EVT_CHOICE(wxID_FONT_STYLE, wxGenericFontDialog::OnChangeFont)
|
|
||||||
EVT_CHOICE(wxID_FONT_WEIGHT, wxGenericFontDialog::OnChangeFont)
|
|
||||||
EVT_CHOICE(wxID_FONT_FAMILY, wxGenericFontDialog::OnChangeFont)
|
|
||||||
EVT_CHOICE(wxID_FONT_COLOUR, wxGenericFontDialog::OnChangeFont)
|
|
||||||
EVT_CHOICE(wxID_FONT_SIZE, wxGenericFontDialog::OnChangeFont)
|
|
||||||
EVT_PAINT(wxGenericFontDialog::OnPaint)
|
|
||||||
END_EVENT_TABLE()
|
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxGenericPrintDialog, wxDialog)
|
|
||||||
EVT_BUTTON(wxID_OK, wxGenericPrintDialog::OnOK)
|
|
||||||
EVT_BUTTON(wxPRINTID_SETUP, wxGenericPrintDialog::OnSetup)
|
|
||||||
EVT_RADIOBOX(wxPRINTID_RANGE, wxGenericPrintDialog::OnRange)
|
|
||||||
END_EVENT_TABLE()
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxTextEntryDialog, wxDialog)
|
|
||||||
EVT_BUTTON(wxID_OK, wxTextEntryDialog::OnOK)
|
|
||||||
END_EVENT_TABLE()
|
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxSingleChoiceDialog, wxDialog)
|
|
||||||
EVT_BUTTON(wxID_OK, wxSingleChoiceDialog::OnOK)
|
|
||||||
END_EVENT_TABLE()
|
|
||||||
|
|
||||||
#include "wx/prntbase.h"
|
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxPrintAbortDialog, wxDialog)
|
|
||||||
EVT_BUTTON(wxID_CANCEL, wxPrintAbortDialog::OnCancel)
|
|
||||||
END_EVENT_TABLE()
|
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxPreviewControlBar, wxWindow)
|
|
||||||
EVT_BUTTON(wxID_PREVIEW_CLOSE, wxPreviewControlBar::OnClose)
|
|
||||||
EVT_BUTTON(wxID_PREVIEW_PRINT, wxPreviewControlBar::OnPrint)
|
|
||||||
EVT_BUTTON(wxID_PREVIEW_PREVIOUS, wxPreviewControlBar::OnPrevious)
|
|
||||||
EVT_BUTTON(wxID_PREVIEW_NEXT, wxPreviewControlBar::OnNext)
|
|
||||||
EVT_CHOICE(wxID_PREVIEW_ZOOM, wxPreviewControlBar::OnZoom)
|
|
||||||
END_EVENT_TABLE()
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
const wxSize wxDefaultSize(-1, -1);
|
const wxSize wxDefaultSize(-1, -1);
|
||||||
const wxPoint wxDefaultPosition(-1, -1);
|
const wxPoint wxDefaultPosition(-1, -1);
|
||||||
|
|||||||
@@ -1,20 +1,24 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: dc.cpp
|
// Name: dc.cpp
|
||||||
// Purpose:
|
// Purpose: wxDC class
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
|
// Modified by:
|
||||||
// Created: 01/02/97
|
// Created: 01/02/97
|
||||||
// RCS-ID: $Id$
|
// RCS-ID: $Id$
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma implementation "dc.h"
|
#pragma implementation "dc.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/dc.h"
|
#include "wx/dc.h"
|
||||||
|
|
||||||
|
#if !USE_SHARED_LIBRARY
|
||||||
|
IMPLEMENT_ABSTRACT_CLASS(wxDC, wxObject)
|
||||||
|
#endif
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// constants
|
// constants
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@@ -87,12 +91,7 @@ wxDC::~wxDC(void)
|
|||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
void wxDC::DrawArc( long WXUNUSED(x1), long WXUNUSED(y1), long WXUNUSED(x2), long WXUNUSED(y2),
|
void wxDC::DrawIcon( const wxIcon &WXUNUSED(icon), long WXUNUSED(x), long WXUNUSED(y), bool WXUNUSED(useMask) )
|
||||||
double WXUNUSED(xc), double WXUNUSED(yc) )
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxDC::DrawIcon( const wxIcon &WXUNUSED(icon), long WXUNUSED(x), long WXUNUSED(y), bool WXUNUSED(useMask) )
|
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: dcclient.cpp
|
// Name: dcclient.cpp
|
||||||
// Purpose:
|
// Purpose: wxClientDC class
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
|
// Modified by:
|
||||||
// Created: 01/02/97
|
// Created: 01/02/97
|
||||||
// RCS-ID: $Id$
|
// RCS-ID: $Id$
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@@ -16,19 +17,6 @@
|
|||||||
#include "wx/dcmemory.h"
|
#include "wx/dcmemory.h"
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// local data
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
#include "bdiag.xbm"
|
|
||||||
#include "fdiag.xbm"
|
|
||||||
#include "cdiag.xbm"
|
|
||||||
#include "horiz.xbm"
|
|
||||||
#include "verti.xbm"
|
|
||||||
#include "cross.xbm"
|
|
||||||
#define num_hatches 6
|
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// constants
|
// constants
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@@ -39,7 +27,12 @@
|
|||||||
// wxPaintDC
|
// wxPaintDC
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxPaintDC,wxDC)
|
#if !USE_SHARED_LIBRARY
|
||||||
|
//IMPLEMENT_DYNAMIC_CLASS(wxClientDC, wxDC)
|
||||||
|
//IMPLEMENT_DYNAMIC_CLASS(wxWindowDC, wxDC)
|
||||||
|
IMPLEMENT_DYNAMIC_CLASS(wxPaintDC, wxDC)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
wxPaintDC::wxPaintDC(void)
|
wxPaintDC::wxPaintDC(void)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: dcmemory.cpp
|
// Name: dcmemory.cpp
|
||||||
// Purpose:
|
// Purpose: wxMemoryDC class
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
|
// Modified by:
|
||||||
// Created: 01/02/97
|
// Created: 01/02/97
|
||||||
// RCS-ID: $Id$
|
// RCS-ID: $Id$
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@@ -14,6 +15,10 @@
|
|||||||
|
|
||||||
#include "wx/dcmemory.h"
|
#include "wx/dcmemory.h"
|
||||||
|
|
||||||
|
#if !USE_SHARED_LIBRARY
|
||||||
|
IMPLEMENT_DYNAMIC_CLASS(wxMemoryDC, wxDC)
|
||||||
|
#endif
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// wxMemoryDC
|
// wxMemoryDC
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: dcscreen.cpp
|
// Name: dcscreen.cpp
|
||||||
// Purpose:
|
// Purpose: wxScreenDC class
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@@ -13,35 +14,19 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/dcscreen.h"
|
#include "wx/dcscreen.h"
|
||||||
#include "wx/window.h"
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
#if !USE_SHARED_LIBRARY
|
||||||
// wxScreenDC
|
IMPLEMENT_DYNAMIC_CLASS(wxScreenDC, wxPaintDC)
|
||||||
//-----------------------------------------------------------------------------
|
#endif
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxScreenDC,wxPaintDC)
|
// Create a DC representing the whole screen
|
||||||
|
wxScreenDC::wxScreenDC()
|
||||||
wxScreenDC::wxScreenDC(void)
|
|
||||||
{
|
{
|
||||||
m_ok = FALSE;
|
// TODO
|
||||||
};
|
}
|
||||||
|
|
||||||
wxScreenDC::~wxScreenDC(void)
|
wxScreenDC::~wxScreenDC()
|
||||||
{
|
{
|
||||||
EndDrawingOnTop();
|
// TODO
|
||||||
};
|
}
|
||||||
|
|
||||||
bool wxScreenDC::StartDrawingOnTop( wxWindow *WXUNUSED(window) )
|
|
||||||
{
|
|
||||||
return TRUE;
|
|
||||||
};
|
|
||||||
|
|
||||||
bool wxScreenDC::StartDrawingOnTop( wxRectangle *WXUNUSED(rect) )
|
|
||||||
{
|
|
||||||
return TRUE;
|
|
||||||
};
|
|
||||||
|
|
||||||
bool wxScreenDC::EndDrawingOnTop(void)
|
|
||||||
{
|
|
||||||
return TRUE;
|
|
||||||
};
|
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: dialog.cpp
|
// Name: dialog.cpp
|
||||||
// Purpose:
|
// Purpose: wxDialog class
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@@ -13,179 +14,281 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/dialog.h"
|
#include "wx/dialog.h"
|
||||||
|
#include "wx/utils.h"
|
||||||
#include "wx/frame.h"
|
#include "wx/frame.h"
|
||||||
#include "wx/app.h"
|
#include "wx/app.h"
|
||||||
|
#include "wx/settings.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
// Lists to keep track of windows, so we can disable/enable them
|
||||||
|
// for modal dialogs
|
||||||
|
wxList wxModalDialogs;
|
||||||
|
wxList wxModelessWindows; // Frames and modeless dialogs
|
||||||
extern wxList wxPendingDelete;
|
extern wxList wxPendingDelete;
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
#if !USE_SHARED_LIBRARY
|
||||||
// wxDialog
|
IMPLEMENT_DYNAMIC_CLASS(wxDialog, wxPanel)
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxDialog,wxWindow)
|
BEGIN_EVENT_TABLE(wxDialog, wxPanel)
|
||||||
EVT_BUTTON (wxID_OK, wxDialog::OnOk)
|
EVT_BUTTON(wxID_OK, wxDialog::OnOK)
|
||||||
EVT_BUTTON (wxID_CANCEL, wxDialog::OnCancel)
|
EVT_BUTTON(wxID_APPLY, wxDialog::OnApply)
|
||||||
EVT_BUTTON (wxID_APPLY, wxDialog::OnApply)
|
EVT_BUTTON(wxID_CANCEL, wxDialog::OnCancel)
|
||||||
EVT_CLOSE (wxDialog::OnCloseWindow)
|
EVT_CHAR_HOOK(wxDialog::OnCharHook)
|
||||||
|
EVT_SYS_COLOUR_CHANGED(wxDialog::OnSysColourChanged)
|
||||||
|
EVT_CLOSE(wxDialog::OnCloseWindow)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxDialog,wxWindow)
|
#endif
|
||||||
|
|
||||||
wxDialog::wxDialog(void)
|
wxDialog::wxDialog()
|
||||||
{
|
{
|
||||||
m_title = "";
|
SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE));
|
||||||
m_modalShowing = FALSE;
|
}
|
||||||
wxTopLevelWindows.Insert( this );
|
|
||||||
};
|
|
||||||
|
|
||||||
wxDialog::wxDialog( wxWindow *parent,
|
bool wxDialog::Create(wxWindow *parent, wxWindowID id,
|
||||||
wxWindowID id, const wxString &title,
|
const wxString& title,
|
||||||
const wxPoint &pos, const wxSize &size,
|
const wxPoint& pos,
|
||||||
long style, const wxString &name )
|
const wxSize& size,
|
||||||
|
long style,
|
||||||
|
const wxString& name)
|
||||||
{
|
{
|
||||||
m_modalShowing = FALSE;
|
m_windowStyle = style;
|
||||||
wxTopLevelWindows.Insert( this );
|
|
||||||
Create( parent, id, title, pos, size, style, name );
|
|
||||||
};
|
|
||||||
|
|
||||||
bool wxDialog::Create( wxWindow *parent,
|
SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE));
|
||||||
wxWindowID id, const wxString &title,
|
SetName(name);
|
||||||
const wxPoint &pos, const wxSize &size,
|
|
||||||
long style, const wxString &name )
|
if (!parent)
|
||||||
{
|
wxTopLevelWindows.Append(this);
|
||||||
return TRUE;
|
|
||||||
};
|
|
||||||
|
|
||||||
wxDialog::~wxDialog(void)
|
if (parent) parent->AddChild(this);
|
||||||
{
|
|
||||||
wxTopLevelWindows.DeleteObject( this );
|
|
||||||
if (wxTopLevelWindows.Number() == 0) wxTheApp->ExitMainLoop();
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxDialog::SetTitle(const wxString& title )
|
if ( id == -1 )
|
||||||
{
|
m_windowId = (int)NewControlId();
|
||||||
m_title = title;
|
|
||||||
};
|
|
||||||
|
|
||||||
wxString wxDialog::GetTitle(void) const
|
|
||||||
{
|
|
||||||
return (wxString&)m_title;
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxDialog::OnApply( wxCommandEvent &WXUNUSED(event) )
|
|
||||||
{
|
|
||||||
if (Validate()) TransferDataFromWindow();
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxDialog::OnCancel( wxCommandEvent &WXUNUSED(event) )
|
|
||||||
{
|
|
||||||
if (IsModal())
|
|
||||||
{
|
|
||||||
EndModal(wxID_CANCEL);
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
m_windowId = id;
|
||||||
SetReturnCode(wxID_CANCEL);
|
|
||||||
this->Show(FALSE);
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxDialog::OnOk( wxCommandEvent &WXUNUSED(event) )
|
// TODO: create dialog
|
||||||
{
|
|
||||||
if ( Validate() && TransferDataFromWindow())
|
|
||||||
{
|
|
||||||
if (IsModal())
|
|
||||||
{
|
|
||||||
EndModal(wxID_OK);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
SetReturnCode(wxID_OK);
|
|
||||||
this->Show(FALSE);
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxDialog::OnPaint( wxPaintEvent& WXUNUSED(event) )
|
|
||||||
{
|
|
||||||
// yes
|
|
||||||
};
|
|
||||||
|
|
||||||
bool wxDialog::OnClose(void)
|
|
||||||
{
|
|
||||||
static wxList closing;
|
|
||||||
|
|
||||||
if (closing.Member(this)) return FALSE; // no loops
|
|
||||||
|
|
||||||
closing.Append(this);
|
|
||||||
|
|
||||||
wxCommandEvent cancelEvent(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
|
|
||||||
cancelEvent.SetEventObject( this );
|
|
||||||
GetEventHandler()->ProcessEvent(cancelEvent);
|
|
||||||
closing.DeleteObject(this);
|
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxDialog::Destroy(void)
|
void wxDialog::SetModal(bool flag)
|
||||||
{
|
{
|
||||||
if (!wxPendingDelete.Member(this))
|
if ( flag )
|
||||||
wxPendingDelete.Append(this);
|
m_windowStyle |= wxDIALOG_MODAL ;
|
||||||
|
else
|
||||||
|
if ( m_windowStyle & wxDIALOG_MODAL )
|
||||||
|
m_windowStyle -= wxDIALOG_MODAL ;
|
||||||
|
|
||||||
|
wxModelessWindows.DeleteObject(this);
|
||||||
|
if (!flag)
|
||||||
|
wxModelessWindows.Append(this);
|
||||||
|
}
|
||||||
|
|
||||||
return TRUE;
|
wxDialog::~wxDialog()
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
wxTopLevelWindows.DeleteObject(this);
|
||||||
|
|
||||||
|
if ( (GetWindowStyleFlag() & wxDIALOG_MODAL) != wxDIALOG_MODAL )
|
||||||
|
wxModelessWindows.DeleteObject(this);
|
||||||
|
|
||||||
|
// If this is the last top-level window, exit.
|
||||||
|
if (wxTheApp && (wxTopLevelWindows.Number() == 0))
|
||||||
|
{
|
||||||
|
wxTheApp->SetTopWindow(NULL);
|
||||||
|
|
||||||
|
if (wxTheApp->GetExitOnFrameDelete())
|
||||||
|
{
|
||||||
|
// TODO: exit
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// By default, pressing escape cancels the dialog
|
||||||
|
void wxDialog::OnCharHook(wxKeyEvent& event)
|
||||||
|
{
|
||||||
|
if (GetHWND())
|
||||||
|
{
|
||||||
|
if (event.m_keyCode == WXK_ESCAPE)
|
||||||
|
{
|
||||||
|
// Behaviour changed in 2.0: we'll send a Cancel message
|
||||||
|
// to the dialog instead of Close.
|
||||||
|
wxCommandEvent cancelEvent(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
|
||||||
|
cancelEvent.SetEventObject( this );
|
||||||
|
GetEventHandler()->ProcessEvent(cancelEvent);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// We didn't process this event.
|
||||||
|
event.Skip();
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxDialog::Iconize(bool WXUNUSED(iconize))
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxDialog::IsIconized() const
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxDialog::SetClientSize(int width, int height)
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxDialog::GetPosition(int *x, int *y) const
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxDialog::Show(bool show)
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxDialog::SetTitle(const wxString& title)
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
wxString wxDialog::GetTitle() const
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
return wxString("");
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxDialog::Centre(int direction)
|
||||||
|
{
|
||||||
|
int x_offset,y_offset ;
|
||||||
|
int display_width, display_height;
|
||||||
|
int width, height, x, y;
|
||||||
|
wxFrame *frame ;
|
||||||
|
if (direction & wxCENTER_FRAME)
|
||||||
|
{
|
||||||
|
frame = (wxFrame*)GetParent() ;
|
||||||
|
if (frame)
|
||||||
|
{
|
||||||
|
frame->GetPosition(&x_offset,&y_offset) ;
|
||||||
|
frame->GetSize(&display_width,&display_height) ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
frame = NULL ;
|
||||||
|
|
||||||
|
if (frame==NULL)
|
||||||
|
{
|
||||||
|
wxDisplaySize(&display_width, &display_height);
|
||||||
|
x_offset = 0 ;
|
||||||
|
y_offset = 0 ;
|
||||||
|
}
|
||||||
|
|
||||||
|
GetSize(&width, &height);
|
||||||
|
GetPosition(&x, &y);
|
||||||
|
|
||||||
|
if (direction & wxHORIZONTAL)
|
||||||
|
x = (int)((display_width - width)/2);
|
||||||
|
if (direction & wxVERTICAL)
|
||||||
|
y = (int)((display_height - height)/2);
|
||||||
|
|
||||||
|
SetSize(x+x_offset, y+y_offset, width, height);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Replacement for Show(TRUE) for modal dialogs - returns return code
|
||||||
|
int wxDialog::ShowModal()
|
||||||
|
{
|
||||||
|
m_windowStyle |= wxDIALOG_MODAL;
|
||||||
|
// TODO: modal showing
|
||||||
|
Show(TRUE);
|
||||||
|
return GetReturnCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxDialog::EndModal(int retCode)
|
||||||
|
{
|
||||||
|
SetReturnCode(retCode);
|
||||||
|
// TODO modal un-showing
|
||||||
|
Show(FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Standard buttons
|
||||||
|
void wxDialog::OnOK(wxCommandEvent& event)
|
||||||
|
{
|
||||||
|
if ( Validate() && TransferDataFromWindow() )
|
||||||
|
{
|
||||||
|
if ( IsModal() )
|
||||||
|
EndModal(wxID_OK);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SetReturnCode(wxID_OK);
|
||||||
|
this->Show(FALSE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxDialog::OnApply(wxCommandEvent& event)
|
||||||
|
{
|
||||||
|
if (Validate())
|
||||||
|
TransferDataFromWindow();
|
||||||
|
// TODO probably need to disable the Apply button until things change again
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxDialog::OnCancel(wxCommandEvent& event)
|
||||||
|
{
|
||||||
|
if ( IsModal() )
|
||||||
|
EndModal(wxID_CANCEL);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SetReturnCode(wxID_CANCEL);
|
||||||
|
this->Show(FALSE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxDialog::OnClose()
|
||||||
|
{
|
||||||
|
// Behaviour changed in 2.0: we'll send a Cancel message by default,
|
||||||
|
// which may close the dialog.
|
||||||
|
// Check for looping if the Cancel event handler calls Close()
|
||||||
|
|
||||||
|
static wxList closing;
|
||||||
|
|
||||||
|
if ( closing.Member(this) )
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
closing.Append(this);
|
||||||
|
|
||||||
|
wxCommandEvent cancelEvent(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
|
||||||
|
cancelEvent.SetEventObject( this );
|
||||||
|
GetEventHandler()->ProcessEvent(cancelEvent);
|
||||||
|
|
||||||
|
closing.DeleteObject(this);
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDialog::OnCloseWindow(wxCloseEvent& event)
|
void wxDialog::OnCloseWindow(wxCloseEvent& event)
|
||||||
{
|
{
|
||||||
if (GetEventHandler()->OnClose() || event.GetForce())
|
// Compatibility
|
||||||
{
|
if ( GetEventHandler()->OnClose() || event.GetForce())
|
||||||
this->Destroy();
|
{
|
||||||
};
|
this->Destroy();
|
||||||
};
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool wxDialog::Show( bool show )
|
// Destroy the window (delayed, if a managed window)
|
||||||
|
bool wxDialog::Destroy()
|
||||||
{
|
{
|
||||||
if (!show && IsModal() && m_modalShowing)
|
if (!wxPendingDelete.Member(this))
|
||||||
{
|
wxPendingDelete.Append(this);
|
||||||
EndModal( wxID_CANCEL );
|
|
||||||
};
|
|
||||||
|
|
||||||
wxWindow::Show( show );
|
|
||||||
|
|
||||||
if (show) InitDialog();
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
};
|
}
|
||||||
|
|
||||||
int wxDialog::ShowModal(void)
|
void wxDialog::OnSysColourChanged(wxSysColourChangedEvent& event)
|
||||||
{
|
{
|
||||||
if (m_modalShowing) return GetReturnCode();
|
SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE));
|
||||||
|
Refresh();
|
||||||
Show( TRUE );
|
}
|
||||||
|
|
||||||
m_modalShowing = TRUE;
|
|
||||||
|
|
||||||
// grab here
|
|
||||||
// main here
|
|
||||||
// release here
|
|
||||||
|
|
||||||
return GetReturnCode();
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxDialog::EndModal( int retCode )
|
|
||||||
{
|
|
||||||
SetReturnCode( retCode );
|
|
||||||
|
|
||||||
if (!m_modalShowing) return;
|
|
||||||
m_modalShowing = FALSE;
|
|
||||||
|
|
||||||
// quit main
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxDialog::InitDialog(void)
|
|
||||||
{
|
|
||||||
wxWindow::InitDialog();
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: dnd.cpp
|
// Name: dnd.cpp
|
||||||
// Purpose: wxDropTarget class
|
// Purpose: wxDropTarget, wxDropSource, wxDataObject implementation
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Copyright: Robert Roebling
|
// Modified by:
|
||||||
// Licence: wxWindows license
|
// Created: ??/??/98
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) 1998 AUTHOR
|
||||||
|
// Licence: wxWindows licence
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
@@ -19,8 +22,6 @@
|
|||||||
// global
|
// global
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
extern bool g_blockEventsOnDrag;
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// wxDropTarget
|
// wxDropTarget
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -92,32 +93,41 @@ wxDataFormat wxFileDropTarget::GetFormat(size_t WXUNUSED(n)) const
|
|||||||
// wxDropSource
|
// wxDropSource
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
|
|
||||||
wxDropSource::wxDropSource( wxWindow *WXUNUSED(win) )
|
//-----------------------------------------------------------------------------
|
||||||
|
// drag request
|
||||||
|
|
||||||
|
wxDropSource::wxDropSource( wxWindow *win )
|
||||||
{
|
{
|
||||||
g_blockEventsOnDrag = TRUE;
|
// TODO
|
||||||
|
m_window = win;
|
||||||
|
m_data = NULL;
|
||||||
|
|
||||||
|
m_defaultCursor = wxCursor( wxCURSOR_NO_ENTRY );
|
||||||
|
m_goaheadCursor = wxCursor( wxCURSOR_HAND );
|
||||||
};
|
};
|
||||||
|
|
||||||
wxDropSource::wxDropSource( wxDataObject &data, wxWindow *WXUNUSED(win) )
|
wxDropSource::wxDropSource( wxDataObject &data, wxWindow *win )
|
||||||
{
|
{
|
||||||
g_blockEventsOnDrag = TRUE;
|
// TODO
|
||||||
|
m_window = win;
|
||||||
m_data = &data;
|
m_data = &data;
|
||||||
|
|
||||||
|
m_defaultCursor = wxCursor( wxCURSOR_NO_ENTRY );
|
||||||
|
m_goaheadCursor = wxCursor( wxCURSOR_HAND );
|
||||||
};
|
};
|
||||||
|
|
||||||
void wxDropSource::SetData( wxDataObject &data )
|
void wxDropSource::SetData( wxDataObject &data )
|
||||||
{
|
{
|
||||||
m_data = &data;
|
m_data = &data;
|
||||||
};
|
};
|
||||||
|
|
||||||
wxDropSource::~wxDropSource(void)
|
wxDropSource::~wxDropSource(void)
|
||||||
{
|
{
|
||||||
// if (m_data) delete m_data;
|
|
||||||
|
|
||||||
g_blockEventsOnDrag = FALSE;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
wxDropSource::DragResult wxDropSource::DoDragDrop( bool WXUNUSED(bAllowMove) )
|
wxDropSource::DragResult wxDropSource::DoDragDrop( bool WXUNUSED(bAllowMove) )
|
||||||
{
|
{
|
||||||
return Copy;
|
// TODO
|
||||||
|
return Error;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,125 +1,142 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: filedlg.cpp
|
// Name: filedlg.cpp
|
||||||
// Purpose:
|
// Purpose: wxFileDialog
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
// Licence: wxWindows licence
|
// Copyright: (c) AUTHOR
|
||||||
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma implementation "filedlg.h"
|
#pragma implementation "filedlg.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/filedlg.h"
|
#include "wx/defs.h"
|
||||||
#include "wx/utils.h"
|
#include "wx/utils.h"
|
||||||
#include "wx/intl.h"
|
#include "wx/dialog.h"
|
||||||
#include "wx/generic/msgdlgg.h"
|
#include "wx/filedlg.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
#if !USE_SHARED_LIBRARY
|
||||||
// wxFileDialog
|
IMPLEMENT_CLASS(wxFileDialog, wxDialog)
|
||||||
//-----------------------------------------------------------------------------
|
#endif
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxFileDialog,wxDialog)
|
|
||||||
|
|
||||||
wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& message,
|
|
||||||
const wxString& defaultDir, const wxString& defaultFileName,
|
|
||||||
const wxString& wildCard,
|
|
||||||
long style, const wxPoint& pos )
|
|
||||||
{
|
|
||||||
m_message = message;
|
|
||||||
m_path = "";
|
|
||||||
m_fileName = defaultFileName;
|
|
||||||
m_dir = defaultDir;
|
|
||||||
m_wildCard = wildCard;
|
|
||||||
m_dialogStyle = style;
|
|
||||||
m_filterIndex = 1;
|
|
||||||
|
|
||||||
m_path.Append(m_dir);
|
|
||||||
if(! m_path.IsEmpty() && m_path.Last()!='/') m_path.Append('/');
|
|
||||||
m_path.Append(m_fileName);
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
int wxFileDialog::ShowModal(void)
|
|
||||||
{
|
|
||||||
int ret = wxDialog::ShowModal();
|
|
||||||
|
|
||||||
if (ret == wxID_OK)
|
|
||||||
{
|
|
||||||
};
|
|
||||||
return ret;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
char *wxFileSelector(const char *title,
|
char *wxFileSelector(const char *title,
|
||||||
const char *defaultDir, const char *defaultFileName,
|
const char *defaultDir, const char *defaultFileName,
|
||||||
const char *defaultExtension, const char *filter, int flags,
|
const char *defaultExtension, const char *filter, int flags,
|
||||||
wxWindow *parent, int x, int y)
|
wxWindow *parent, int x, int y)
|
||||||
{
|
{
|
||||||
wxString filter2("");
|
// If there's a default extension specified but no filter, we create a suitable
|
||||||
if ( defaultExtension && !filter )
|
// filter.
|
||||||
filter2 = wxString("*.") + wxString(defaultExtension) ;
|
|
||||||
else if ( filter )
|
|
||||||
filter2 = filter;
|
|
||||||
|
|
||||||
wxString defaultDirString;
|
wxString filter2("");
|
||||||
if (defaultDir)
|
if ( defaultExtension && !filter )
|
||||||
defaultDirString = defaultDir;
|
filter2 = wxString("*.") + wxString(defaultExtension) ;
|
||||||
else
|
else if ( filter )
|
||||||
defaultDirString = "";
|
filter2 = filter;
|
||||||
|
|
||||||
wxString defaultFilenameString;
|
wxString defaultDirString;
|
||||||
if (defaultFileName)
|
if (defaultDir)
|
||||||
defaultFilenameString = defaultFileName;
|
defaultDirString = defaultDir;
|
||||||
else
|
else
|
||||||
defaultFilenameString = "";
|
defaultDirString = "";
|
||||||
|
|
||||||
wxFileDialog fileDialog(parent, title, defaultDirString, defaultFilenameString,
|
wxString defaultFilenameString;
|
||||||
filter2, flags, wxPoint(x, y));
|
if (defaultFileName)
|
||||||
|
defaultFilenameString = defaultFileName;
|
||||||
|
else
|
||||||
|
defaultFilenameString = "";
|
||||||
|
|
||||||
if ( fileDialog.ShowModal() == wxID_OK )
|
wxFileDialog fileDialog(parent, title, defaultDirString, defaultFilenameString, filter2, flags, wxPoint(x, y));
|
||||||
{
|
|
||||||
strcpy(wxBuffer, (const char *)fileDialog.GetPath());
|
|
||||||
return wxBuffer;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return NULL;
|
|
||||||
};
|
|
||||||
|
|
||||||
char* wxLoadFileSelector(const char *what, const char *extension, const char *default_name,
|
if ( fileDialog.ShowModal() == wxID_OK )
|
||||||
wxWindow *parent )
|
{
|
||||||
|
strcpy(wxBuffer, (const char *)fileDialog.GetPath());
|
||||||
|
return wxBuffer;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
char *wxFileSelectorEx(const char *title,
|
||||||
|
const char *defaultDir,
|
||||||
|
const char *defaultFileName,
|
||||||
|
int* defaultFilterIndex,
|
||||||
|
const char *filter,
|
||||||
|
int flags,
|
||||||
|
wxWindow* parent,
|
||||||
|
int x,
|
||||||
|
int y)
|
||||||
|
|
||||||
|
{
|
||||||
|
wxFileDialog fileDialog(parent, title ? title : "", defaultDir ? defaultDir : "",
|
||||||
|
defaultFileName ? defaultFileName : "", filter ? filter : "", flags, wxPoint(x, y));
|
||||||
|
|
||||||
|
if ( fileDialog.ShowModal() == wxID_OK )
|
||||||
|
{
|
||||||
|
*defaultFilterIndex = fileDialog.GetFilterIndex();
|
||||||
|
strcpy(wxBuffer, (const char *)fileDialog.GetPath());
|
||||||
|
return wxBuffer;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& message,
|
||||||
|
const wxString& defaultDir, const wxString& defaultFileName, const wxString& wildCard,
|
||||||
|
long style, const wxPoint& pos)
|
||||||
|
{
|
||||||
|
m_message = message;
|
||||||
|
m_dialogStyle = style;
|
||||||
|
m_parent = parent;
|
||||||
|
m_path = "";
|
||||||
|
m_fileName = defaultFileName;
|
||||||
|
m_dir = defaultDir;
|
||||||
|
m_wildCard = wildCard;
|
||||||
|
m_filterIndex = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int wxFileDialog::ShowModal()
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
wxID_CANCEL;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Generic file load/save dialog
|
||||||
|
static char *
|
||||||
|
wxDefaultFileSelector(bool load, const char *what, const char *extension, const char *default_name, wxWindow *parent)
|
||||||
{
|
{
|
||||||
char *ext = (char *)extension;
|
char *ext = (char *)extension;
|
||||||
|
|
||||||
char prompt[50];
|
char prompt[50];
|
||||||
wxString str = _("Load %s file");
|
wxString str;
|
||||||
sprintf(prompt, str, what);
|
if (load)
|
||||||
|
str = "Load %s file";
|
||||||
|
else
|
||||||
|
str = "Save %s file";
|
||||||
|
sprintf(prompt, wxGetTranslation(str), what);
|
||||||
|
|
||||||
if (*ext == '.') ext++;
|
if (*ext == '.') ext++;
|
||||||
char wild[60];
|
char wild[60];
|
||||||
sprintf(wild, "*.%s", ext);
|
sprintf(wild, "*.%s", ext);
|
||||||
|
|
||||||
return wxFileSelector (prompt, NULL, default_name, ext, wild, 0, parent);
|
return wxFileSelector (prompt, NULL, default_name, ext, wild, 0, parent);
|
||||||
};
|
}
|
||||||
|
|
||||||
char* wxSaveFileSelector(const char *what, const char *extension, const char *default_name,
|
// Generic file load dialog
|
||||||
wxWindow *parent )
|
char *
|
||||||
|
wxLoadFileSelector(const char *what, const char *extension, const char *default_name, wxWindow *parent)
|
||||||
{
|
{
|
||||||
char *ext = (char *)extension;
|
return wxDefaultFileSelector(TRUE, what, extension, default_name, parent);
|
||||||
|
}
|
||||||
char prompt[50];
|
|
||||||
wxString str = _("Save %s file");
|
|
||||||
sprintf(prompt, str, what);
|
|
||||||
|
|
||||||
if (*ext == '.') ext++;
|
|
||||||
char wild[60];
|
|
||||||
sprintf(wild, "*.%s", ext);
|
|
||||||
|
|
||||||
return wxFileSelector (prompt, NULL, default_name, ext, wild, 0, parent);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
// Generic file save dialog
|
||||||
|
char *
|
||||||
|
wxSaveFileSelector(const char *what, const char *extension, const char *default_name, wxWindow *parent)
|
||||||
|
{
|
||||||
|
return wxDefaultFileSelector(FALSE, what, extension, default_name, parent);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
370
src/qt/font.cpp
370
src/qt/font.cpp
@@ -1,10 +1,11 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: font.cpp
|
// Name: font.cpp
|
||||||
// Purpose:
|
// Purpose: wxFont class
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@@ -13,201 +14,228 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/font.h"
|
#include "wx/font.h"
|
||||||
#include "wx/utils.h"
|
|
||||||
#include <strings.h>
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// local data
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
static char *wx_font_family [] = {
|
|
||||||
"wxDEFAULT", "wxDECORATIVE", "wxMODERN", "wxROMAN", "wxSCRIPT",
|
|
||||||
"wxSWISS", "wxTELETYPE",
|
|
||||||
};
|
|
||||||
static char *wx_font_style [] = {
|
|
||||||
"wxDEFAULT", "wxNORMAL", "wxSLANT", "wxITALIC",
|
|
||||||
};
|
|
||||||
static char *wx_font_weight [] = {
|
|
||||||
"wxDEFAULT", "wxNORMAL", "wxBOLD", "wxLIGHT",
|
|
||||||
};
|
|
||||||
|
|
||||||
extern wxFontNameDirectory wxTheFontNameDirectory;
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// wxFont
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxFontRefData: public wxObjectRefData
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
wxFontRefData(void);
|
|
||||||
~wxFontRefData(void);
|
|
||||||
|
|
||||||
wxList m_scaled_xfonts;
|
|
||||||
int m_pointSize;
|
|
||||||
int m_family, m_style, m_weight;
|
|
||||||
bool m_underlined;
|
|
||||||
int m_fontId;
|
|
||||||
char* m_faceName;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
wxFontRefData::wxFontRefData(void) : m_scaled_xfonts(wxKEY_INTEGER)
|
|
||||||
{
|
|
||||||
m_pointSize = -1;
|
|
||||||
m_family = -1;
|
|
||||||
m_style = -1;
|
|
||||||
m_weight = -1;
|
|
||||||
m_underlined = FALSE;
|
|
||||||
m_fontId = 0;
|
|
||||||
m_faceName = NULL;
|
|
||||||
};
|
|
||||||
|
|
||||||
wxFontRefData::~wxFontRefData(void)
|
|
||||||
{
|
|
||||||
wxNode *node = m_scaled_xfonts.First();
|
|
||||||
while (node)
|
|
||||||
{
|
|
||||||
wxNode *next = node->Next();
|
|
||||||
node = next;
|
|
||||||
};
|
|
||||||
if (m_faceName)
|
|
||||||
{
|
|
||||||
delete m_faceName;
|
|
||||||
m_faceName = NULL;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
#define M_FONTDATA ((wxFontRefData *)m_refData)
|
|
||||||
|
|
||||||
|
#if !USE_SHARED_LIBRARIES
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject)
|
IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject)
|
||||||
|
#endif
|
||||||
|
|
||||||
wxFont::wxFont(void)
|
wxFontRefData::wxFontRefData()
|
||||||
{
|
{
|
||||||
if (wxTheFontList) wxTheFontList->Append( this );
|
m_style = 0;
|
||||||
};
|
m_pointSize = 0;
|
||||||
|
m_family = 0;
|
||||||
|
m_style = 0;
|
||||||
|
m_weight = 0;
|
||||||
|
m_underlined = 0;
|
||||||
|
m_faceName = "";
|
||||||
|
/* TODO
|
||||||
|
m_hFont = 0;
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
wxFont::wxFont( char *xFontName )
|
wxFontRefData::wxFontRefData(const wxFontRefData& data)
|
||||||
{
|
{
|
||||||
if (!xFontName) return;
|
m_style = data.m_style;
|
||||||
|
m_pointSize = data.m_pointSize;
|
||||||
m_refData = new wxFontRefData();
|
m_family = data.m_family;
|
||||||
|
m_style = data.m_style;
|
||||||
};
|
m_weight = data.m_weight;
|
||||||
|
m_underlined = data.m_underlined;
|
||||||
|
m_faceName = data.m_faceName;
|
||||||
|
/* TODO
|
||||||
|
m_hFont = 0;
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
wxFont::wxFont(int PointSize, int FontIdOrFamily, int Style, int Weight,
|
wxFontRefData::~wxFontRefData()
|
||||||
bool Underlined, const char* Face)
|
|
||||||
{
|
{
|
||||||
m_refData = new wxFontRefData();
|
// TODO: delete font data
|
||||||
|
}
|
||||||
|
|
||||||
if (wxTheFontList) wxTheFontList->Append( this );
|
wxFont::wxFont()
|
||||||
};
|
|
||||||
|
|
||||||
wxFont::wxFont(int PointSize, const char *Face, int Family, int Style,
|
|
||||||
int Weight, bool Underlined)
|
|
||||||
{
|
{
|
||||||
m_refData = new wxFontRefData();
|
if ( wxTheFontList )
|
||||||
|
wxTheFontList->Append(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
wxFont::wxFont(int pointSize, int family, int style, int weight, bool underlined, const wxString& faceName)
|
||||||
if (wxTheFontList) wxTheFontList->Append( this );
|
|
||||||
};
|
|
||||||
|
|
||||||
wxFont::wxFont( const wxFont& font )
|
|
||||||
{
|
|
||||||
Ref( font );
|
|
||||||
};
|
|
||||||
|
|
||||||
wxFont::wxFont( const wxFont* font )
|
|
||||||
{
|
|
||||||
UnRef();
|
|
||||||
if (font) Ref( *font );
|
|
||||||
};
|
|
||||||
|
|
||||||
wxFont::~wxFont(void)
|
|
||||||
{
|
{
|
||||||
if (wxTheFontList) wxTheFontList->DeleteObject( this );
|
Create(pointSize, family, style, weight, underlined, faceName);
|
||||||
};
|
|
||||||
|
|
||||||
wxFont& wxFont::operator = ( const wxFont& font )
|
if ( wxTheFontList )
|
||||||
{
|
wxTheFontList->Append(this);
|
||||||
if (*this == font) return (*this);
|
}
|
||||||
Ref( font );
|
|
||||||
return *this;
|
|
||||||
};
|
|
||||||
|
|
||||||
bool wxFont::operator == ( const wxFont& font )
|
bool wxFont::Create(int pointSize, int family, int style, int weight, bool underlined, const wxString& faceName)
|
||||||
{
|
|
||||||
return m_refData == font.m_refData;
|
|
||||||
};
|
|
||||||
|
|
||||||
bool wxFont::operator != ( const wxFont& font )
|
|
||||||
{
|
|
||||||
return m_refData != font.m_refData;
|
|
||||||
};
|
|
||||||
|
|
||||||
bool wxFont::Ok()
|
|
||||||
{
|
{
|
||||||
return (m_refData != NULL);
|
UnRef();
|
||||||
};
|
m_refData = new wxFontRefData;
|
||||||
|
|
||||||
int wxFont::GetPointSize(void) const
|
M_FONTDATA->m_family = family;
|
||||||
{
|
M_FONTDATA->m_style = style;
|
||||||
return M_FONTDATA->m_pointSize;
|
M_FONTDATA->m_weight = weight;
|
||||||
};
|
M_FONTDATA->m_pointSize = pointSize;
|
||||||
|
M_FONTDATA->m_underlined = underlined;
|
||||||
|
M_FONTDATA->m_faceName = faceName;
|
||||||
|
|
||||||
wxString wxFont::GetFaceString(void) const
|
RealizeResource();
|
||||||
{
|
|
||||||
return "";
|
|
||||||
};
|
|
||||||
|
|
||||||
wxString wxFont::GetFaceName(void) const
|
return TRUE;
|
||||||
{
|
}
|
||||||
return "";
|
|
||||||
};
|
|
||||||
|
|
||||||
int wxFont::GetFamily(void) const
|
wxFont::~wxFont()
|
||||||
{
|
{
|
||||||
return M_FONTDATA->m_family;
|
if (wxTheFontList)
|
||||||
};
|
wxTheFontList->DeleteObject(this);
|
||||||
|
}
|
||||||
|
|
||||||
wxString wxFont::GetFamilyString(void) const
|
bool wxFont::RealizeResource()
|
||||||
{
|
{
|
||||||
wxString s = wx_font_family[M_FONTDATA->m_family];
|
// TODO: create the font (if there is a native font object)
|
||||||
return s;
|
return FALSE;
|
||||||
};
|
}
|
||||||
|
|
||||||
int wxFont::GetFontId(void) const
|
void wxFont::Unshare()
|
||||||
{
|
{
|
||||||
return M_FONTDATA->m_fontId; // stub
|
// Don't change shared data
|
||||||
};
|
if (!m_refData)
|
||||||
|
{
|
||||||
|
m_refData = new wxFontRefData();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
wxFontRefData* ref = new wxFontRefData(*(wxFontRefData*)m_refData);
|
||||||
|
UnRef();
|
||||||
|
m_refData = ref;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int wxFont::GetStyle(void) const
|
void wxFont::SetPointSize(int pointSize)
|
||||||
{
|
{
|
||||||
return M_FONTDATA->m_style;
|
Unshare();
|
||||||
};
|
|
||||||
|
|
||||||
wxString wxFont::GetStyleString(void) const
|
M_FONTDATA->m_pointSize = pointSize;
|
||||||
{
|
|
||||||
wxString s = wx_font_style[M_FONTDATA->m_style];
|
|
||||||
return s;
|
|
||||||
};
|
|
||||||
|
|
||||||
int wxFont::GetWeight(void) const
|
RealizeResource();
|
||||||
{
|
}
|
||||||
return M_FONTDATA->m_weight;
|
|
||||||
};
|
|
||||||
|
|
||||||
wxString wxFont::GetWeightString(void) const
|
void wxFont::SetFamily(int family)
|
||||||
{
|
{
|
||||||
wxString s = wx_font_weight[M_FONTDATA->m_weight];
|
Unshare();
|
||||||
return s;
|
|
||||||
};
|
|
||||||
|
|
||||||
bool wxFont::GetUnderlined(void) const
|
M_FONTDATA->m_family = family;
|
||||||
|
|
||||||
|
RealizeResource();
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxFont::SetStyle(int style)
|
||||||
{
|
{
|
||||||
return M_FONTDATA->m_underlined;
|
Unshare();
|
||||||
};
|
|
||||||
|
M_FONTDATA->m_style = style;
|
||||||
|
|
||||||
|
RealizeResource();
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxFont::SetWeight(int weight)
|
||||||
|
{
|
||||||
|
Unshare();
|
||||||
|
|
||||||
|
M_FONTDATA->m_weight = weight;
|
||||||
|
|
||||||
|
RealizeResource();
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxFont::SetFaceName(const wxString& faceName)
|
||||||
|
{
|
||||||
|
Unshare();
|
||||||
|
|
||||||
|
M_FONTDATA->m_faceName = faceName;
|
||||||
|
|
||||||
|
RealizeResource();
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxFont::SetUnderlined(bool underlined)
|
||||||
|
{
|
||||||
|
Unshare();
|
||||||
|
|
||||||
|
M_FONTDATA->m_underlined = underlined;
|
||||||
|
|
||||||
|
RealizeResource();
|
||||||
|
}
|
||||||
|
|
||||||
|
wxString wxFont::GetFamilyString() const
|
||||||
|
{
|
||||||
|
wxString fam("");
|
||||||
|
switch (GetFamily())
|
||||||
|
{
|
||||||
|
case wxDECORATIVE:
|
||||||
|
fam = "wxDECORATIVE";
|
||||||
|
break;
|
||||||
|
case wxROMAN:
|
||||||
|
fam = "wxROMAN";
|
||||||
|
break;
|
||||||
|
case wxSCRIPT:
|
||||||
|
fam = "wxSCRIPT";
|
||||||
|
break;
|
||||||
|
case wxSWISS:
|
||||||
|
fam = "wxSWISS";
|
||||||
|
break;
|
||||||
|
case wxMODERN:
|
||||||
|
fam = "wxMODERN";
|
||||||
|
break;
|
||||||
|
case wxTELETYPE:
|
||||||
|
fam = "wxTELETYPE";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
fam = "wxDEFAULT";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return fam;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* New font system */
|
||||||
|
wxString wxFont::GetFaceName() const
|
||||||
|
{
|
||||||
|
wxString str("");
|
||||||
|
if (M_FONTDATA)
|
||||||
|
str = M_FONTDATA->m_faceName ;
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxString wxFont::GetStyleString() const
|
||||||
|
{
|
||||||
|
wxString styl("");
|
||||||
|
switch (GetStyle())
|
||||||
|
{
|
||||||
|
case wxITALIC:
|
||||||
|
styl = "wxITALIC";
|
||||||
|
break;
|
||||||
|
case wxSLANT:
|
||||||
|
styl = "wxSLANT";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
styl = "wxNORMAL";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return styl;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxString wxFont::GetWeightString() const
|
||||||
|
{
|
||||||
|
wxString w("");
|
||||||
|
switch (GetWeight())
|
||||||
|
{
|
||||||
|
case wxBOLD:
|
||||||
|
w = "wxBOLD";
|
||||||
|
break;
|
||||||
|
case wxLIGHT:
|
||||||
|
w = "wxLIGHT";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
w = "wxNORMAL";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return w;
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
676
src/qt/frame.cpp
676
src/qt/frame.cpp
@@ -1,10 +1,11 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: frame.cpp
|
// Name: frame.cpp
|
||||||
// Purpose:
|
// Purpose: wxFrame
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@@ -13,240 +14,533 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/frame.h"
|
#include "wx/frame.h"
|
||||||
#include "wx/dialog.h"
|
|
||||||
#include "wx/control.h"
|
|
||||||
#include "wx/app.h"
|
|
||||||
#include "wx/menu.h"
|
|
||||||
#include "wx/toolbar.h"
|
|
||||||
#include "wx/statusbr.h"
|
#include "wx/statusbr.h"
|
||||||
#include "wx/mdi.h"
|
#include "wx/toolbar.h"
|
||||||
|
#include "wx/menuitem.h"
|
||||||
|
|
||||||
const wxMENU_HEIGHT = 28;
|
extern wxList wxModelessWindows;
|
||||||
const wxSTATUS_HEIGHT = 25;
|
|
||||||
|
|
||||||
extern wxList wxTopLevelWindows;
|
|
||||||
extern wxList wxPendingDelete;
|
extern wxList wxPendingDelete;
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
#if !USE_SHARED_LIBRARY
|
||||||
// wxFrame
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxFrame, wxWindow)
|
BEGIN_EVENT_TABLE(wxFrame, wxWindow)
|
||||||
EVT_SIZE(wxFrame::OnSize)
|
EVT_SIZE(wxFrame::OnSize)
|
||||||
EVT_CLOSE(wxFrame::OnCloseWindow)
|
EVT_ACTIVATE(wxFrame::OnActivate)
|
||||||
|
EVT_MENU_HIGHLIGHT_ALL(wxFrame::OnMenuHighlight)
|
||||||
|
EVT_SYS_COLOUR_CHANGED(wxFrame::OnSysColourChanged)
|
||||||
EVT_IDLE(wxFrame::OnIdle)
|
EVT_IDLE(wxFrame::OnIdle)
|
||||||
|
EVT_CLOSE(wxFrame::OnCloseWindow)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxFrame,wxWindow)
|
IMPLEMENT_DYNAMIC_CLASS(wxFrame, wxWindow)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if USE_NATIVE_STATUSBAR
|
||||||
|
bool wxFrame::m_useNativeStatusBar = TRUE;
|
||||||
|
#else
|
||||||
|
bool wxFrame::m_useNativeStatusBar = FALSE;
|
||||||
|
#endif
|
||||||
|
|
||||||
wxFrame::wxFrame()
|
wxFrame::wxFrame()
|
||||||
{
|
{
|
||||||
wxTopLevelWindows.Insert( this );
|
m_frameToolBar = NULL ;
|
||||||
};
|
m_frameMenuBar = NULL;
|
||||||
|
m_frameStatusBar = NULL;
|
||||||
|
|
||||||
wxFrame::wxFrame( wxWindow *parent, wxWindowID id, const wxString &title,
|
m_windowParent = NULL;
|
||||||
const wxPoint &pos, const wxSize &size,
|
m_iconized = FALSE;
|
||||||
long style, const wxString &name )
|
}
|
||||||
|
|
||||||
|
bool wxFrame::Create(wxWindow *parent,
|
||||||
|
wxWindowID id,
|
||||||
|
const wxString& title,
|
||||||
|
const wxPoint& pos,
|
||||||
|
const wxSize& size,
|
||||||
|
long style,
|
||||||
|
const wxString& name)
|
||||||
{
|
{
|
||||||
Create( parent, id, title, pos, size, style, name );
|
if (!parent)
|
||||||
wxTopLevelWindows.Insert( this );
|
wxTopLevelWindows.Append(this);
|
||||||
};
|
|
||||||
|
|
||||||
bool wxFrame::Create( wxWindow *parent, wxWindowID id, const wxString &title,
|
SetName(name);
|
||||||
const wxPoint &pos, const wxSize &size,
|
m_windowStyle = style;
|
||||||
long style, const wxString &name )
|
m_frameMenuBar = NULL;
|
||||||
{
|
m_frameToolBar = NULL ;
|
||||||
m_title = title;
|
m_frameStatusBar = NULL;
|
||||||
|
|
||||||
return TRUE;
|
SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE));
|
||||||
};
|
|
||||||
|
if ( id > -1 )
|
||||||
|
m_windowId = id;
|
||||||
|
else
|
||||||
|
m_windowId = (int)NewControlId();
|
||||||
|
|
||||||
|
if (parent) parent->AddChild(this);
|
||||||
|
|
||||||
|
wxModelessWindows.Append(this);
|
||||||
|
|
||||||
|
// TODO: create frame.
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
wxFrame::~wxFrame()
|
wxFrame::~wxFrame()
|
||||||
{
|
{
|
||||||
if (m_frameMenuBar) delete m_frameMenuBar;
|
wxTopLevelWindows.DeleteObject(this);
|
||||||
if (m_frameStatusBar) delete m_frameStatusBar;
|
|
||||||
|
|
||||||
wxTopLevelWindows.DeleteObject( this );
|
if (m_frameStatusBar)
|
||||||
if (wxTopLevelWindows.Number() == 0) wxTheApp->ExitMainLoop();
|
delete m_frameStatusBar;
|
||||||
};
|
if (m_frameMenuBar)
|
||||||
|
delete m_frameMenuBar;
|
||||||
|
|
||||||
bool wxFrame::Show( bool show )
|
/* Check if it's the last top-level window */
|
||||||
{
|
|
||||||
if (show)
|
if (wxTheApp && (wxTopLevelWindows.Number() == 0))
|
||||||
{
|
{
|
||||||
wxSizeEvent event( wxSize(m_width,m_height), GetId() );
|
wxTheApp->SetTopWindow(NULL);
|
||||||
ProcessEvent( event );
|
|
||||||
};
|
|
||||||
return wxWindow::Show( show );
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxFrame::Enable( bool enable )
|
if (wxTheApp->GetExitOnFrameDelete())
|
||||||
{
|
{
|
||||||
wxWindow::Enable( enable );
|
// TODO signal to the app that we're going to close
|
||||||
};
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void wxFrame::OnCloseWindow( wxCloseEvent &event )
|
wxModelessWindows.DeleteObject(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get size *available for subwindows* i.e. excluding menu bar, toolbar etc.
|
||||||
|
void wxFrame::GetClientSize(int *x, int *y) const
|
||||||
{
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set the client size (i.e. leave the calculation of borders etc.
|
||||||
|
// to wxWindows)
|
||||||
|
void wxFrame::SetClientSize(int width, int height)
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxFrame::GetSize(int *width, int *height) const
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxFrame::GetPosition(int *x, int *y) const
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxFrame::SetSize(int x, int y, int width, int height, int sizeFlags)
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxFrame::Show(bool show)
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxFrame::Iconize(bool iconize)
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
// Equivalent to maximize/restore in Windows
|
||||||
|
void wxFrame::Maximize(bool maximize)
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxFrame::IsIconized() const
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxFrame::SetTitle(const wxString& title)
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
wxString wxFrame::GetTitle() const
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
return wxString("");
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxFrame::SetIcon(const wxIcon& icon)
|
||||||
|
{
|
||||||
|
m_icon = icon;
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxFrame::SetAcceleratorTable(const wxAcceleratorTable& accel)
|
||||||
|
{
|
||||||
|
m_acceleratorTable = accel;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxStatusBar *wxFrame::OnCreateStatusBar(int number, long style, wxWindowID id,
|
||||||
|
const wxString& name)
|
||||||
|
{
|
||||||
|
wxStatusBar *statusBar = NULL;
|
||||||
|
|
||||||
|
statusBar = new wxStatusBar(this, id, wxPoint(0, 0), wxSize(100, 20),
|
||||||
|
style, name);
|
||||||
|
|
||||||
|
// Set the height according to the font and the border size
|
||||||
|
wxClientDC dc(statusBar);
|
||||||
|
dc.SetFont(* statusBar->GetFont());
|
||||||
|
|
||||||
|
long x, y;
|
||||||
|
dc.GetTextExtent("X", &x, &y);
|
||||||
|
|
||||||
|
int height = (int)( (y * 1.1) + 2* statusBar->GetBorderY());
|
||||||
|
|
||||||
|
statusBar->SetSize(-1, -1, 100, height);
|
||||||
|
|
||||||
|
statusBar->SetFieldsCount(number);
|
||||||
|
return statusBar;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxStatusBar* wxFrame::CreateStatusBar(int number, long style, wxWindowID id,
|
||||||
|
const wxString& name)
|
||||||
|
{
|
||||||
|
// Calling CreateStatusBar twice is an error.
|
||||||
|
wxCHECK_MSG( m_frameStatusBar == NULL, FALSE,
|
||||||
|
"recreating status bar in wxFrame" );
|
||||||
|
|
||||||
|
m_frameStatusBar = OnCreateStatusBar(number, style, id,
|
||||||
|
name);
|
||||||
|
if ( m_frameStatusBar )
|
||||||
|
{
|
||||||
|
PositionStatusBar();
|
||||||
|
return m_frameStatusBar;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxFrame::SetStatusText(const wxString& text, int number)
|
||||||
|
{
|
||||||
|
wxCHECK_RET( m_frameStatusBar != NULL, "no statusbar to set text for" );
|
||||||
|
|
||||||
|
m_frameStatusBar->SetStatusText(text, number);
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxFrame::SetStatusWidths(int n, const int widths_field[])
|
||||||
|
{
|
||||||
|
wxCHECK_RET( m_frameStatusBar != NULL, "no statusbar to set widths for" );
|
||||||
|
|
||||||
|
m_frameStatusBar->SetStatusWidths(n, widths_field);
|
||||||
|
PositionStatusBar();
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxFrame::PositionStatusBar()
|
||||||
|
{
|
||||||
|
int w, h;
|
||||||
|
GetClientSize(&w, &h);
|
||||||
|
int sw, sh;
|
||||||
|
m_frameStatusBar->GetSize(&sw, &sh);
|
||||||
|
|
||||||
|
// Since we wish the status bar to be directly under the client area,
|
||||||
|
// we use the adjusted sizes without using wxSIZE_NO_ADJUSTMENTS.
|
||||||
|
m_frameStatusBar->SetSize(0, h, w, sh);
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxFrame::SetMenuBar(wxMenuBar *menuBar)
|
||||||
|
{
|
||||||
|
if (!menuBar)
|
||||||
|
{
|
||||||
|
m_frameMenuBar = NULL;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_frameMenuBar = menuBar;
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxFrame::Fit()
|
||||||
|
{
|
||||||
|
// Work out max. size
|
||||||
|
wxNode *node = GetChildren()->First();
|
||||||
|
int max_width = 0;
|
||||||
|
int max_height = 0;
|
||||||
|
while (node)
|
||||||
|
{
|
||||||
|
// Find a child that's a subwindow, but not a dialog box.
|
||||||
|
wxWindow *win = (wxWindow *)node->Data();
|
||||||
|
|
||||||
|
if (!win->IsKindOf(CLASSINFO(wxFrame)) &&
|
||||||
|
!win->IsKindOf(CLASSINFO(wxDialog)))
|
||||||
|
{
|
||||||
|
int width, height;
|
||||||
|
int x, y;
|
||||||
|
win->GetSize(&width, &height);
|
||||||
|
win->GetPosition(&x, &y);
|
||||||
|
|
||||||
|
if ((x + width) > max_width)
|
||||||
|
max_width = x + width;
|
||||||
|
if ((y + height) > max_height)
|
||||||
|
max_height = y + height;
|
||||||
|
}
|
||||||
|
node = node->Next();
|
||||||
|
}
|
||||||
|
SetClientSize(max_width, max_height);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Responds to colour changes, and passes event on to children.
|
||||||
|
void wxFrame::OnSysColourChanged(wxSysColourChangedEvent& event)
|
||||||
|
{
|
||||||
|
SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE));
|
||||||
|
Refresh();
|
||||||
|
|
||||||
|
if ( m_frameStatusBar )
|
||||||
|
{
|
||||||
|
wxSysColourChangedEvent event2;
|
||||||
|
event2.SetEventObject( m_frameStatusBar );
|
||||||
|
m_frameStatusBar->ProcessEvent(event2);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Propagate the event to the non-top-level children
|
||||||
|
wxWindow::OnSysColourChanged(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Default resizing behaviour - if only ONE subwindow,
|
||||||
|
// resize to client rectangle size
|
||||||
|
void wxFrame::OnSize(wxSizeEvent& event)
|
||||||
|
{
|
||||||
|
// if we're using constraints - do use them
|
||||||
|
#if USE_CONSTRAINTS
|
||||||
|
if ( GetAutoLayout() ) {
|
||||||
|
Layout();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// do we have _exactly_ one child?
|
||||||
|
wxWindow *child = NULL;
|
||||||
|
for ( wxNode *node = GetChildren()->First(); node; node = node->Next() )
|
||||||
|
{
|
||||||
|
wxWindow *win = (wxWindow *)node->Data();
|
||||||
|
if ( !win->IsKindOf(CLASSINFO(wxFrame)) &&
|
||||||
|
!win->IsKindOf(CLASSINFO(wxDialog)) &&
|
||||||
|
(win != GetStatusBar()) &&
|
||||||
|
(win != GetToolBar()) )
|
||||||
|
{
|
||||||
|
if ( child )
|
||||||
|
return; // it's our second subwindow - nothing to do
|
||||||
|
child = win;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( child ) {
|
||||||
|
// we have exactly one child - set it's size to fill the whole frame
|
||||||
|
int clientW, clientH;
|
||||||
|
GetClientSize(&clientW, &clientH);
|
||||||
|
|
||||||
|
int x = 0;
|
||||||
|
int y = 0;
|
||||||
|
|
||||||
|
child->SetSize(x, y, clientW, clientH);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Default activation behaviour - set the focus for the first child
|
||||||
|
// subwindow found.
|
||||||
|
void wxFrame::OnActivate(wxActivateEvent& event)
|
||||||
|
{
|
||||||
|
for(wxNode *node = GetChildren()->First(); node; node = node->Next())
|
||||||
|
{
|
||||||
|
// Find a child that's a subwindow, but not a dialog box.
|
||||||
|
wxWindow *child = (wxWindow *)node->Data();
|
||||||
|
if (!child->IsKindOf(CLASSINFO(wxFrame)) &&
|
||||||
|
!child->IsKindOf(CLASSINFO(wxDialog)))
|
||||||
|
{
|
||||||
|
#if WXDEBUG > 1
|
||||||
|
wxDebugMsg("wxFrame::OnActivate: about to set the child's focus.\n");
|
||||||
|
#endif
|
||||||
|
child->SetFocus();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// The default implementation for the close window event - calls
|
||||||
|
// OnClose for backward compatibility.
|
||||||
|
|
||||||
|
void wxFrame::OnCloseWindow(wxCloseEvent& event)
|
||||||
|
{
|
||||||
|
// Compatibility
|
||||||
if ( GetEventHandler()->OnClose() || event.GetForce())
|
if ( GetEventHandler()->OnClose() || event.GetForce())
|
||||||
{
|
{
|
||||||
this->Destroy();
|
this->Destroy();
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
|
bool wxFrame::OnClose()
|
||||||
|
{
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Destroy the window (delayed, if a managed window)
|
||||||
bool wxFrame::Destroy()
|
bool wxFrame::Destroy()
|
||||||
{
|
{
|
||||||
if (!wxPendingDelete.Member(this))
|
if (!wxPendingDelete.Member(this))
|
||||||
wxPendingDelete.Append(this);
|
wxPendingDelete.Append(this);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxFrame::GetClientSize( int *width, int *height ) const
|
// Default menu selection behaviour - display a help string
|
||||||
|
void wxFrame::OnMenuHighlight(wxMenuEvent& event)
|
||||||
{
|
{
|
||||||
wxWindow::GetClientSize( width, height );
|
if (GetStatusBar())
|
||||||
if (height)
|
|
||||||
{
|
{
|
||||||
if (m_frameMenuBar) (*height) -= wxMENU_HEIGHT;
|
if (event.GetMenuId() == -1)
|
||||||
if (m_frameStatusBar) (*height) -= wxSTATUS_HEIGHT;
|
SetStatusText("");
|
||||||
if (m_frameToolBar)
|
else
|
||||||
{
|
{
|
||||||
int y = 0;
|
wxMenuBar *menuBar = GetMenuBar();
|
||||||
m_frameToolBar->GetSize( NULL, &y );
|
if (menuBar)
|
||||||
(*height) -= y;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
void wxFrame::OnSize( wxSizeEvent &WXUNUSED(event) )
|
|
||||||
{
|
|
||||||
if ( GetAutoLayout() )
|
|
||||||
Layout();
|
|
||||||
else {
|
|
||||||
// no child: go out !
|
|
||||||
if (!GetChildren()->First())
|
|
||||||
return;
|
|
||||||
|
|
||||||
// do we have exactly one child?
|
|
||||||
wxWindow *child = NULL;
|
|
||||||
for(wxNode *node = GetChildren()->First(); node; node = node->Next())
|
|
||||||
{
|
|
||||||
wxWindow *win = (wxWindow *)node->Data();
|
|
||||||
if (!IS_KIND_OF(win,wxFrame) && !IS_KIND_OF(win,wxDialog)
|
|
||||||
#if 0 // not in m_children anyway
|
|
||||||
&& (win != m_frameMenuBar) &&
|
|
||||||
(win != m_frameToolBar) &&
|
|
||||||
(win != m_frameStatusBar)
|
|
||||||
#endif
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
if ( child ) // it's the second one: do nothing
|
wxString helpString(menuBar->GetHelpString(event.GetMenuId()));
|
||||||
return;
|
if (helpString != "")
|
||||||
|
SetStatusText(helpString);
|
||||||
child = win;
|
}
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
// yes: set it's size to fill all the frame
|
|
||||||
int client_x, client_y;
|
|
||||||
GetClientSize(&client_x, &client_y);
|
|
||||||
child->SetSize( 1, 1, client_x-2, client_y);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
static void SetInvokingWindow( wxMenu *menu, wxWindow *win )
|
|
||||||
{
|
|
||||||
menu->SetInvokingWindow( win );
|
|
||||||
wxNode *node = menu->m_items.First();
|
|
||||||
while (node)
|
|
||||||
{
|
|
||||||
wxMenuItem *menuitem = (wxMenuItem*)node->Data();
|
|
||||||
if (menuitem->IsSubMenu())
|
|
||||||
SetInvokingWindow( menuitem->GetSubMenu(), win );
|
|
||||||
node = node->Next();
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxFrame::SetMenuBar( wxMenuBar *menuBar )
|
|
||||||
{
|
|
||||||
m_frameMenuBar = menuBar;
|
|
||||||
|
|
||||||
if (m_frameMenuBar)
|
|
||||||
{
|
|
||||||
if (m_frameMenuBar->m_parent != this)
|
|
||||||
{
|
|
||||||
wxNode *node = m_frameMenuBar->m_menus.First();
|
|
||||||
while (node)
|
|
||||||
{
|
|
||||||
wxMenu *menu = (wxMenu*)node->Data();
|
|
||||||
SetInvokingWindow( menu, this );
|
|
||||||
node = node->Next();
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
wxMenuBar *wxFrame::GetMenuBar(void)
|
wxMenuBar *wxFrame::GetMenuBar() const
|
||||||
{
|
{
|
||||||
return m_frameMenuBar;
|
return m_frameMenuBar;
|
||||||
};
|
|
||||||
|
|
||||||
wxToolBar *wxFrame::CreateToolBar( long style , wxWindowID id, const wxString& name )
|
|
||||||
{
|
|
||||||
m_frameToolBar = new wxToolBar( this, id, wxDefaultPosition, wxDefaultSize, style, name );
|
|
||||||
|
|
||||||
return m_frameToolBar;
|
|
||||||
};
|
|
||||||
|
|
||||||
wxToolBar *wxFrame::GetToolBar(void)
|
|
||||||
{
|
|
||||||
return m_frameToolBar;
|
|
||||||
};
|
|
||||||
|
|
||||||
wxStatusBar* wxFrame::CreateStatusBar( int number, long style, wxWindowID id, const wxString& name )
|
|
||||||
{
|
|
||||||
if (m_frameStatusBar)
|
|
||||||
delete m_frameStatusBar;
|
|
||||||
|
|
||||||
m_frameStatusBar = new wxStatusBar( this, id, wxPoint(0,0), wxSize(100,20), style, name );
|
|
||||||
|
|
||||||
m_frameStatusBar->SetFieldsCount( number );
|
|
||||||
|
|
||||||
return m_frameStatusBar;
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxFrame::SetStatusText( const wxString &text, int number )
|
|
||||||
{
|
|
||||||
if (m_frameStatusBar) m_frameStatusBar->SetStatusText( text, number );
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxFrame::SetStatusWidths( int n, int *width )
|
|
||||||
{
|
|
||||||
if (m_frameStatusBar) m_frameStatusBar->SetStatusWidths( n, width );
|
|
||||||
};
|
|
||||||
|
|
||||||
wxStatusBar *wxFrame::GetStatusBar(void)
|
|
||||||
{
|
|
||||||
return m_frameStatusBar;
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxFrame::SetTitle( const wxString &title )
|
|
||||||
{
|
|
||||||
m_title = title;
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxFrame::SetSizeHints( int WXUNUSED(minW), int WXUNUSED(minH),
|
|
||||||
int WXUNUSED(maxW), int WXUNUSED(maxH), int WXUNUSED(incW) )
|
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxFrame::SetIcon( const wxIcon &icon )
|
void wxFrame::Centre(int direction)
|
||||||
{
|
{
|
||||||
m_icon = icon;
|
int display_width, display_height, width, height, x, y;
|
||||||
if (!icon.Ok()) return;
|
wxDisplaySize(&display_width, &display_height);
|
||||||
|
|
||||||
|
GetSize(&width, &height);
|
||||||
|
GetPosition(&x, &y);
|
||||||
|
|
||||||
|
if (direction & wxHORIZONTAL)
|
||||||
|
x = (int)((display_width - width)/2);
|
||||||
|
if (direction & wxVERTICAL)
|
||||||
|
y = (int)((display_height - height)/2);
|
||||||
|
|
||||||
|
SetSize(x, y, width, height);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Call this to simulate a menu command
|
||||||
|
void wxFrame::Command(int id)
|
||||||
|
{
|
||||||
|
ProcessCommand(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxFrame::ProcessCommand(int id)
|
||||||
|
{
|
||||||
|
wxCommandEvent commandEvent(wxEVENT_TYPE_MENU_COMMAND, id);
|
||||||
|
commandEvent.SetInt( id );
|
||||||
|
commandEvent.SetEventObject( this );
|
||||||
|
|
||||||
|
wxMenuBar *bar = GetMenuBar() ;
|
||||||
|
if (!bar)
|
||||||
|
return;
|
||||||
|
|
||||||
|
/* TODO: check the menu item if required
|
||||||
|
wxMenuItem *item = bar->FindItemForId(id) ;
|
||||||
|
if (item && item->IsCheckable())
|
||||||
|
{
|
||||||
|
bar->Check(id,!bar->Checked(id)) ;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
GetEventHandler()->ProcessEvent(commandEvent);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Checks if there is a toolbar, and returns the first free client position
|
||||||
|
wxPoint wxFrame::GetClientAreaOrigin() const
|
||||||
|
{
|
||||||
|
wxPoint pt(0, 0);
|
||||||
|
if (GetToolBar())
|
||||||
|
{
|
||||||
|
int w, h;
|
||||||
|
GetToolBar()->GetSize(& w, & h);
|
||||||
|
|
||||||
|
if (GetToolBar()->GetWindowStyleFlag() & wxTB_VERTICAL)
|
||||||
|
{
|
||||||
|
pt.x += w;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pt.y += h;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return pt;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxToolBar* wxFrame::CreateToolBar(long style, wxWindowID id, const wxString& name)
|
||||||
|
{
|
||||||
|
wxCHECK_MSG( m_frameToolBar == NULL, FALSE,
|
||||||
|
"recreating toolbar in wxFrame" );
|
||||||
|
|
||||||
|
wxToolBar* toolBar = OnCreateToolBar(style, id, name);
|
||||||
|
if (toolBar)
|
||||||
|
{
|
||||||
|
SetToolBar(toolBar);
|
||||||
|
PositionToolBar();
|
||||||
|
return toolBar;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
wxToolBar* wxFrame::OnCreateToolBar(long style, wxWindowID id, const wxString& name)
|
||||||
|
{
|
||||||
|
return new wxToolBar(this, id, wxDefaultPosition, wxDefaultSize, style, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxFrame::PositionToolBar()
|
||||||
|
{
|
||||||
|
int cw, ch;
|
||||||
|
|
||||||
|
// TODO: we actually need to use the low-level client size, before
|
||||||
|
// the toolbar/status bar were added.
|
||||||
|
// So DEFINITELY replace the line below with something appropriate.
|
||||||
|
|
||||||
|
wxCHECK_MSG( TRUE, FALSE,
|
||||||
|
"PositionToolBar not implemented properly, see frame.cpp" );
|
||||||
|
|
||||||
|
GetClientSize(& cw, &ch);
|
||||||
|
|
||||||
|
if ( GetStatusBar() )
|
||||||
|
{
|
||||||
|
int statusX, statusY;
|
||||||
|
GetStatusBar()->GetClientSize(&statusX, &statusY);
|
||||||
|
ch -= statusY;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (GetToolBar())
|
||||||
|
{
|
||||||
|
int tw, th;
|
||||||
|
GetToolBar()->GetSize(& tw, & th);
|
||||||
|
|
||||||
|
if (GetToolBar()->GetWindowStyleFlag() & wxTB_VERTICAL)
|
||||||
|
{
|
||||||
|
// Use the 'real' position. wxSIZE_NO_ADJUSTMENTS
|
||||||
|
// means, pretend we don't have toolbar/status bar, so we
|
||||||
|
// have the original client size.
|
||||||
|
GetToolBar()->SetSize(0, 0, tw, ch, wxSIZE_NO_ADJUSTMENTS);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Use the 'real' position
|
||||||
|
GetToolBar()->SetSize(0, 0, cw, th, wxSIZE_NO_ADJUSTMENTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
112
src/qt/gauge.cpp
112
src/qt/gauge.cpp
@@ -1,10 +1,11 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: gauge.cpp
|
// Name: gauge.cpp
|
||||||
// Purpose:
|
// Purpose: wxGauge class
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@@ -14,38 +15,91 @@
|
|||||||
|
|
||||||
#include "wx/gauge.h"
|
#include "wx/gauge.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
#if !USE_SHARED_LIBRARY
|
||||||
// wxGauge
|
IMPLEMENT_DYNAMIC_CLASS(wxGauge, wxControl)
|
||||||
//-----------------------------------------------------------------------------
|
#endif
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxGauge,wxControl)
|
bool wxGauge::Create(wxWindow *parent, wxWindowID id,
|
||||||
|
int range,
|
||||||
bool wxGauge::Create( wxWindow *parent, wxWindowID id, int range,
|
const wxPoint& pos,
|
||||||
const wxPoint& pos, const wxSize& size,
|
const wxSize& size,
|
||||||
long style, const wxString& name )
|
long style,
|
||||||
|
const wxValidator& validator,
|
||||||
|
const wxString& name)
|
||||||
{
|
{
|
||||||
return TRUE;
|
SetName(name);
|
||||||
};
|
SetValidator(validator);
|
||||||
|
m_rangeMax = range;
|
||||||
|
m_windowStyle = style;
|
||||||
|
|
||||||
void wxGauge::SetRange( int r )
|
if (parent) parent->AddChild(this);
|
||||||
|
|
||||||
|
if ( id == -1 )
|
||||||
|
m_windowId = (int)NewControlId();
|
||||||
|
else
|
||||||
|
m_windowId = id;
|
||||||
|
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxGauge::SetSize(int x, int y, int width, int height, int sizeFlags)
|
||||||
{
|
{
|
||||||
m_rangeMax = r;
|
// TODO
|
||||||
if (m_gaugePos > m_rangeMax) m_gaugePos = m_rangeMax;
|
}
|
||||||
};
|
|
||||||
|
|
||||||
void wxGauge::SetValue( int pos )
|
void wxGauge::SetShadowWidth(int w)
|
||||||
{
|
{
|
||||||
m_gaugePos = pos;
|
// TODO optional
|
||||||
if (m_gaugePos > m_rangeMax) m_gaugePos = m_rangeMax;
|
}
|
||||||
};
|
|
||||||
|
|
||||||
int wxGauge::GetRange(void) const
|
void wxGauge::SetBezelFace(int w)
|
||||||
{
|
{
|
||||||
return m_rangeMax;
|
// TODO optional
|
||||||
};
|
}
|
||||||
|
|
||||||
int wxGauge::GetValue(void) const
|
void wxGauge::SetRange(int r)
|
||||||
{
|
{
|
||||||
return m_gaugePos;
|
m_rangeMax = r;
|
||||||
};
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxGauge::SetValue(int pos)
|
||||||
|
{
|
||||||
|
m_gaugePos = pos;
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
int wxGauge::GetShadowWidth() const
|
||||||
|
{
|
||||||
|
// TODO optional
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int wxGauge::GetBezelFace() const
|
||||||
|
{
|
||||||
|
// TODO optional
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int wxGauge::GetRange() const
|
||||||
|
{
|
||||||
|
return m_rangeMax;
|
||||||
|
}
|
||||||
|
|
||||||
|
int wxGauge::GetValue() const
|
||||||
|
{
|
||||||
|
return m_gaugePos;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxGauge::SetForegroundColour(const wxColour& col)
|
||||||
|
{
|
||||||
|
m_foregroundColour = col ;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxGauge::SetBackgroundColour(const wxColour& col)
|
||||||
|
{
|
||||||
|
m_backgroundColour = col ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: gdiobj.cpp
|
// Name: gdiobj.cpp
|
||||||
// Purpose: wxGDIObject class
|
// Purpose: wxGDIObject class
|
||||||
// Author: Julian Smart
|
// Author: AUTHOR
|
||||||
// Modified by:
|
// Modified by:
|
||||||
// Created: 01/02/97
|
// Created: ??/??/98
|
||||||
// RCS-ID: $Id$
|
// RCS-ID: $Id$
|
||||||
// Copyright: (c) Julian Smart and Markus Holzem
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@@ -19,3 +19,4 @@
|
|||||||
IMPLEMENT_DYNAMIC_CLASS(wxGDIObject, wxObject)
|
IMPLEMENT_DYNAMIC_CLASS(wxGDIObject, wxObject)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// TODO: Nothing to do, unless you want to.
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: icon.cpp
|
// Name: icon.cpp
|
||||||
// Purpose:
|
// Purpose: wxIcon class
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@@ -14,14 +15,56 @@
|
|||||||
|
|
||||||
#include "wx/icon.h"
|
#include "wx/icon.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
#if !USE_SHARED_LIBRARIES
|
||||||
// wxIcon
|
IMPLEMENT_DYNAMIC_CLASS(wxIcon, wxBitmap)
|
||||||
//-----------------------------------------------------------------------------
|
#endif
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxIcon,wxBitmap)
|
/*
|
||||||
|
* Icons
|
||||||
|
*/
|
||||||
|
|
||||||
wxIcon::wxIcon( char **bits, int WXUNUSED(width), int WXUNUSED(height) ) :
|
|
||||||
wxBitmap( bits )
|
wxIconRefData::wxIconRefData()
|
||||||
{
|
{
|
||||||
};
|
// TODO: init icon handle
|
||||||
|
}
|
||||||
|
|
||||||
|
wxIconRefData::~wxIconRefData()
|
||||||
|
{
|
||||||
|
// TODO: destroy icon handle
|
||||||
|
}
|
||||||
|
|
||||||
|
wxIcon::wxIcon()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
wxIcon::wxIcon(const char WXUNUSED(bits)[], int WXUNUSED(width), int WXUNUSED(height))
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
wxIcon::wxIcon(const wxString& icon_file, long flags,
|
||||||
|
int desiredWidth, int desiredHeight)
|
||||||
|
|
||||||
|
{
|
||||||
|
LoadFile(icon_file, flags, desiredWidth, desiredHeight);
|
||||||
|
}
|
||||||
|
|
||||||
|
wxIcon::~wxIcon()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxIcon::LoadFile(const wxString& filename, long type,
|
||||||
|
int desiredWidth, int desiredHeight)
|
||||||
|
{
|
||||||
|
UnRef();
|
||||||
|
|
||||||
|
m_refData = new wxIconRefData;
|
||||||
|
|
||||||
|
wxBitmapHandler *handler = FindHandler(type);
|
||||||
|
|
||||||
|
if ( handler )
|
||||||
|
return handler->LoadFile(this, filename, type, desiredWidth, desiredHeight);
|
||||||
|
else
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,358 +1,279 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: joystick.cpp
|
// Name: joystick.cpp
|
||||||
// Purpose: wxJoystick class
|
// Purpose: wxJoystick class
|
||||||
// Author: Ported to Linux by Guilhem Lavaux
|
// Author: AUTHOR
|
||||||
// Modified by:
|
// Modified by:
|
||||||
// Created: 05/23/98
|
// Created: ??/??/98
|
||||||
// RCS-ID: $Id$
|
// RCS-ID: $Id$
|
||||||
// Copyright: (c) Guilhem Lavaux
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows license
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma implementation "joystick.h"
|
#pragma implementation "joystick.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <linux/joystick.h>
|
#include <wx/joystick.h>
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <sys/time.h>
|
|
||||||
#include <sys/ioctl.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#include "wx/event.h"
|
|
||||||
#include "wx/window.h"
|
|
||||||
#include "wx/gtk/joystick.h"
|
|
||||||
|
|
||||||
#define JOYSTICK_AXE_MAX 32767
|
|
||||||
#define JOYSTICK_AXE_MIN -32767
|
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxJoystick, wxObject)
|
IMPLEMENT_DYNAMIC_CLASS(wxJoystick, wxObject)
|
||||||
|
|
||||||
wxJoystick::wxJoystick(int joystick)
|
// Attributes
|
||||||
{
|
|
||||||
wxString dev_name;
|
|
||||||
// Assume it's the same device name on all Linux systems ...
|
|
||||||
dev_name.Printf("/dev/js%d", (joystick == wxJOYSTICK1) ? 0 : 1);
|
|
||||||
|
|
||||||
m_joystick = open(dev_name, O_RDWR);
|
|
||||||
m_lastposition = wxPoint(-1, -1);
|
|
||||||
for (int i=0;i<15;i++)
|
|
||||||
m_axe[i] = 0;
|
|
||||||
if (m_joystick != -1)
|
|
||||||
Create();
|
|
||||||
}
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Background thread
|
|
||||||
////////////////////////////////////////////////////////////////////////////
|
|
||||||
void *wxJoystick::Entry(void)
|
|
||||||
{
|
|
||||||
struct js_event j_evt;
|
|
||||||
wxJoystickEvent jwx_event;
|
|
||||||
fd_set read_fds;
|
|
||||||
struct timeval time_out = {0, 0};
|
|
||||||
|
|
||||||
FD_ZERO(&read_fds);
|
|
||||||
DeferDestroy(TRUE);
|
|
||||||
while (1) {
|
|
||||||
TestDestroy();
|
|
||||||
|
|
||||||
if (m_polling) {
|
|
||||||
FD_SET(m_joystick, &read_fds);
|
|
||||||
select(m_joystick+1, &read_fds, NULL, NULL, &time_out);
|
|
||||||
if (FD_ISSET(m_joystick, &read_fds))
|
|
||||||
read(m_joystick, &j_evt, sizeof(j_evt));
|
|
||||||
else
|
|
||||||
j_evt.type = 0;
|
|
||||||
} else {
|
|
||||||
read(m_joystick, &j_evt, sizeof(j_evt));
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((j_evt.type & JS_EVENT_AXIS) == JS_EVENT_AXIS) {
|
|
||||||
switch (j_evt.number) {
|
|
||||||
case 1:
|
|
||||||
m_lastposition.x = j_evt.value;
|
|
||||||
jwx_event.SetEventType(wxEVT_JOY_MOVE);
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
m_lastposition.y = j_evt.value;
|
|
||||||
jwx_event.SetEventType(wxEVT_JOY_MOVE);
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
m_axe[3] = j_evt.value;
|
|
||||||
jwx_event.SetEventType(wxEVT_JOY_ZMOVE);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
m_axe[j_evt.number] = j_evt.value;
|
|
||||||
jwx_event.SetEventType(wxEVT_JOY_MOVE);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
jwx_event.SetPosition(m_lastposition);
|
|
||||||
jwx_event.SetZPosition(m_axe[3]);
|
|
||||||
}
|
|
||||||
if ((j_evt.type & JS_EVENT_BUTTON) == JS_EVENT_BUTTON) {
|
|
||||||
register int mask = 1 << j_evt.number;
|
|
||||||
char button = m_buttons & mask;
|
|
||||||
|
|
||||||
m_buttons &= ~mask;
|
|
||||||
if (button) {
|
|
||||||
jwx_event.SetEventType(wxEVT_JOY_BUTTON_UP);
|
|
||||||
} else {
|
|
||||||
jwx_event.SetEventType(wxEVT_JOY_BUTTON_DOWN);
|
|
||||||
m_buttons |= mask;
|
|
||||||
}
|
|
||||||
|
|
||||||
jwx_event.SetButtonState(m_buttons);
|
|
||||||
jwx_event.SetButtonChange(j_evt.number);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (m_catchwin)
|
|
||||||
m_catchwin->ProcessEvent(jwx_event);
|
|
||||||
if (m_polling)
|
|
||||||
usleep(m_polling*1000);
|
|
||||||
}
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////
|
|
||||||
// State
|
|
||||||
////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
wxPoint wxJoystick::GetPosition(void) const
|
wxPoint wxJoystick::GetPosition() const
|
||||||
{
|
{
|
||||||
return m_lastposition;
|
// TODO
|
||||||
|
return wxPoint(0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxJoystick::GetZPosition(void) const
|
int wxJoystick::GetZPosition() const
|
||||||
{
|
{
|
||||||
return m_axe[3];
|
// TODO
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxJoystick::GetButtonState(void) const
|
int wxJoystick::GetButtonState() const
|
||||||
{
|
{
|
||||||
return m_buttons;
|
// TODO
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxJoystick::GetPOVPosition(void) const
|
int wxJoystick::GetPOVPosition() const
|
||||||
{
|
{
|
||||||
return 0;
|
// TODO
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxJoystick::GetPOVCTSPosition(void) const
|
int wxJoystick::GetPOVCTSPosition() const
|
||||||
{
|
{
|
||||||
return 0;
|
// TODO
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxJoystick::GetRudderPosition(void) const
|
int wxJoystick::GetRudderPosition() const
|
||||||
{
|
{
|
||||||
return m_axe[4];
|
// TODO
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxJoystick::GetUPosition(void) const
|
int wxJoystick::GetUPosition() const
|
||||||
{
|
{
|
||||||
return m_axe[5];
|
// TODO
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxJoystick::GetVPosition(void) const
|
int wxJoystick::GetVPosition() const
|
||||||
{
|
{
|
||||||
return m_axe[6];
|
// TODO
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxJoystick::GetMovementThreshold(void) const
|
int wxJoystick::GetMovementThreshold() const
|
||||||
{
|
{
|
||||||
return 0;
|
// TODO
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxJoystick::SetMovementThreshold(int threshold)
|
void wxJoystick::SetMovementThreshold(int threshold)
|
||||||
{
|
{
|
||||||
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Capabilities
|
// Capabilities
|
||||||
////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
bool wxJoystick::IsOk(void) const
|
bool wxJoystick::IsOk() const
|
||||||
{
|
{
|
||||||
return (m_joystick != -1);
|
// TODO
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxJoystick::GetNumberJoysticks(void) const
|
int wxJoystick::GetNumberJoysticks() const
|
||||||
{
|
{
|
||||||
wxString dev_name;
|
// TODO
|
||||||
int fd, j;
|
return 0;
|
||||||
|
|
||||||
for (j=0;j<2;j++) {
|
|
||||||
dev_name.Printf("/dev/js%d", j);
|
|
||||||
fd = open(dev_name, O_RDONLY);
|
|
||||||
if (fd == -1)
|
|
||||||
return j;
|
|
||||||
close(fd);
|
|
||||||
}
|
|
||||||
return j;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxJoystick::GetManufacturerId(void) const
|
int wxJoystick::GetManufacturerId() const
|
||||||
{
|
{
|
||||||
return 0;
|
// TODO
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxJoystick::GetProductId(void) const
|
int wxJoystick::GetProductId() const
|
||||||
{
|
{
|
||||||
return 0;
|
// TODO
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString wxJoystick::GetProductName(void) const
|
wxString wxJoystick::GetProductName() const
|
||||||
{
|
{
|
||||||
return "";
|
// TODO
|
||||||
|
return wxString("");
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxJoystick::GetXMin(void) const
|
int wxJoystick::GetXMin() const
|
||||||
{
|
{
|
||||||
return JOYSTICK_AXE_MAX;
|
// TODO
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxJoystick::GetYMin(void) const
|
int wxJoystick::GetYMin() const
|
||||||
{
|
{
|
||||||
return JOYSTICK_AXE_MAX;
|
// TODO
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxJoystick::GetZMin(void) const
|
int wxJoystick::GetZMin() const
|
||||||
{
|
{
|
||||||
return JOYSTICK_AXE_MAX;
|
// TODO
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxJoystick::GetXMax(void) const
|
int wxJoystick::GetXMax() const
|
||||||
{
|
{
|
||||||
return JOYSTICK_AXE_MAX;
|
// TODO
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxJoystick::GetYMax(void) const
|
int wxJoystick::GetYMax() const
|
||||||
{
|
{
|
||||||
return JOYSTICK_AXE_MAX;
|
// TODO
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxJoystick::GetZMax(void) const
|
int wxJoystick::GetZMax() const
|
||||||
{
|
{
|
||||||
return JOYSTICK_AXE_MAX;
|
// TODO
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxJoystick::GetNumberButtons(void) const
|
int wxJoystick::GetNumberButtons() const
|
||||||
{
|
{
|
||||||
int nb;
|
// TODO
|
||||||
|
return 0;
|
||||||
ioctl(m_joystick, JSIOCGBUTTONS, &nb);
|
|
||||||
|
|
||||||
return nb;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxJoystick::GetNumberAxes(void) const
|
int wxJoystick::GetNumberAxes() const
|
||||||
{
|
{
|
||||||
int nb;
|
// TODO
|
||||||
|
return 0;
|
||||||
ioctl(m_joystick, JSIOCGAXES, &nb);
|
|
||||||
|
|
||||||
return nb;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxJoystick::GetMaxButtons(void) const
|
int wxJoystick::GetMaxButtons() const
|
||||||
{
|
{
|
||||||
return 15; // internal
|
// TODO
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxJoystick::GetMaxAxes(void) const
|
int wxJoystick::GetMaxAxes() const
|
||||||
{
|
{
|
||||||
return 15; // internal
|
// TODO
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxJoystick::GetPollingMin(void) const
|
int wxJoystick::GetPollingMin() const
|
||||||
{
|
{
|
||||||
return -1;
|
// TODO
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxJoystick::GetPollingMax(void) const
|
int wxJoystick::GetPollingMax() const
|
||||||
{
|
{
|
||||||
return -1;
|
// TODO
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxJoystick::GetRudderMin(void) const
|
int wxJoystick::GetRudderMin() const
|
||||||
{
|
{
|
||||||
return JOYSTICK_AXE_MIN;
|
// TODO
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxJoystick::GetRudderMax(void) const
|
int wxJoystick::GetRudderMax() const
|
||||||
{
|
{
|
||||||
return JOYSTICK_AXE_MAX;
|
// TODO
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxJoystick::GetUMin(void) const
|
int wxJoystick::GetUMin() const
|
||||||
{
|
{
|
||||||
return JOYSTICK_AXE_MIN;
|
// TODO
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxJoystick::GetUMax(void) const
|
int wxJoystick::GetUMax() const
|
||||||
{
|
{
|
||||||
return JOYSTICK_AXE_MAX;
|
// TODO
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxJoystick::GetVMin(void) const
|
int wxJoystick::GetVMin() const
|
||||||
{
|
{
|
||||||
return JOYSTICK_AXE_MIN;
|
// TODO
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int wxJoystick::GetVMax(void) const
|
int wxJoystick::GetVMax() const
|
||||||
{
|
{
|
||||||
return JOYSTICK_AXE_MAX;
|
// TODO
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxJoystick::HasRudder(void) const
|
bool wxJoystick::HasRudder() const
|
||||||
{
|
{
|
||||||
return GetNumberAxes() >= 4;
|
// TODO
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxJoystick::HasZ(void) const
|
bool wxJoystick::HasZ() const
|
||||||
{
|
{
|
||||||
return GetNumberAxes() >= 3;
|
// TODO
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxJoystick::HasU(void) const
|
bool wxJoystick::HasU() const
|
||||||
{
|
{
|
||||||
return GetNumberAxes() >= 5;
|
// TODO
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxJoystick::HasV(void) const
|
bool wxJoystick::HasV() const
|
||||||
{
|
{
|
||||||
return GetNumberAxes() >= 6;
|
// TODO
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxJoystick::HasPOV(void) const
|
bool wxJoystick::HasPOV() const
|
||||||
{
|
{
|
||||||
return FALSE;
|
// TODO
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxJoystick::HasPOV4Dir(void) const
|
bool wxJoystick::HasPOV4Dir() const
|
||||||
{
|
{
|
||||||
return FALSE;
|
// TODO
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxJoystick::HasPOVCTS(void) const
|
bool wxJoystick::HasPOVCTS() const
|
||||||
{
|
{
|
||||||
return FALSE;
|
// TODO
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Operations
|
// Operations
|
||||||
////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
bool wxJoystick::SetCapture(wxWindow* win, int pollingFreq = 0)
|
bool wxJoystick::SetCapture(wxWindow* win, int pollingFreq)
|
||||||
{
|
{
|
||||||
m_catchwin = win;
|
// TODO
|
||||||
m_polling = pollingFreq;
|
return FALSE;
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxJoystick::ReleaseCapture(void)
|
bool wxJoystick::ReleaseCapture()
|
||||||
{
|
{
|
||||||
m_catchwin = NULL;
|
// TODO
|
||||||
m_polling = 0;
|
return FALSE;
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,137 +1,240 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: listbox.cpp
|
// Name: listbox.cpp
|
||||||
// Purpose:
|
// Purpose: wxListBox
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
// Licence: wxWindows licence
|
// Copyright: (c) AUTHOR
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
// Licence: wxWindows licence
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma implementation "listbox.h"
|
#pragma implementation "listbox.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/dynarray.h"
|
|
||||||
#include "wx/listbox.h"
|
#include "wx/listbox.h"
|
||||||
#include "wx/utils.h"
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
#include "wx/dynarray.h"
|
||||||
// wxListBox
|
#include "wx/log.h"
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
|
#if !USE_SHARED_LIBRARY
|
||||||
|
IMPLEMENT_DYNAMIC_CLASS(wxListBox, wxControl)
|
||||||
|
#endif
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxListBox,wxControl)
|
// ============================================================================
|
||||||
|
// list box control implementation
|
||||||
|
// ============================================================================
|
||||||
|
|
||||||
wxListBox::wxListBox(void)
|
// Listbox item
|
||||||
|
wxListBox::wxListBox()
|
||||||
{
|
{
|
||||||
};
|
m_noItems = 0;
|
||||||
|
m_selected = 0;
|
||||||
|
}
|
||||||
|
|
||||||
wxListBox::wxListBox( wxWindow *parent, wxWindowID id,
|
bool wxListBox::Create(wxWindow *parent, wxWindowID id,
|
||||||
const wxPoint &pos, const wxSize &size,
|
const wxPoint& pos,
|
||||||
int n, const wxString choices[],
|
const wxSize& size,
|
||||||
long style, const wxString &name )
|
int n, const wxString choices[],
|
||||||
|
long style,
|
||||||
|
const wxValidator& validator,
|
||||||
|
const wxString& name)
|
||||||
{
|
{
|
||||||
Create( parent, id, pos, size, n, choices, style, name );
|
m_noItems = n;
|
||||||
};
|
m_selected = 0;
|
||||||
|
|
||||||
bool wxListBox::Create( wxWindow *parent, wxWindowID id,
|
SetName(name);
|
||||||
const wxPoint &pos, const wxSize &size,
|
SetValidator(validator);
|
||||||
int n, const wxString choices[],
|
|
||||||
long style, const wxString &name )
|
|
||||||
{
|
|
||||||
return TRUE;
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxListBox::Append( const wxString &item )
|
if (parent) parent->AddChild(this);
|
||||||
{
|
|
||||||
Append( item, (char*)NULL );
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxListBox::Append( const wxString &WXUNUSED(item), char *WXUNUSED(clientData) )
|
wxSystemSettings settings;
|
||||||
{
|
SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_WINDOW));
|
||||||
};
|
|
||||||
|
|
||||||
void wxListBox::Clear(void)
|
m_windowId = ( id == -1 ) ? (int)NewControlId() : id;
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxListBox::Delete( int WXUNUSED(n) )
|
// TODO create listbox
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxListBox::Deselect( int WXUNUSED(n) )
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
int wxListBox::FindString( const wxString &WXUNUSED(item) ) const
|
|
||||||
{
|
|
||||||
return -1;
|
|
||||||
};
|
|
||||||
|
|
||||||
char *wxListBox::GetClientData( int WXUNUSED(n) ) const
|
|
||||||
{
|
|
||||||
return (char*)NULL;
|
|
||||||
};
|
|
||||||
|
|
||||||
int wxListBox::GetSelection(void) const
|
|
||||||
{
|
|
||||||
return -1;
|
|
||||||
};
|
|
||||||
|
|
||||||
int wxListBox::GetSelections( wxArrayInt& WXUNUSED(aSelections) ) const
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
wxString wxListBox::GetString( int WXUNUSED(n) ) const
|
|
||||||
{
|
|
||||||
return "";
|
|
||||||
};
|
|
||||||
|
|
||||||
wxString wxListBox::GetStringSelection(void) const
|
|
||||||
{
|
|
||||||
return "";
|
|
||||||
};
|
|
||||||
|
|
||||||
int wxListBox::Number(void)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
bool wxListBox::Selected( int WXUNUSED(n) )
|
|
||||||
{
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
};
|
}
|
||||||
|
|
||||||
void wxListBox::Set( int WXUNUSED(n), const wxString *WXUNUSED(choices) )
|
wxListBox::~wxListBox()
|
||||||
{
|
{
|
||||||
};
|
}
|
||||||
|
|
||||||
void wxListBox::SetClientData( int WXUNUSED(n), char *WXUNUSED(clientData) )
|
void wxListBox::SetupColours()
|
||||||
{
|
{
|
||||||
};
|
SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_WINDOW));
|
||||||
|
}
|
||||||
|
|
||||||
void wxListBox::SetFirstItem( int WXUNUSED(n) )
|
void wxListBox::SetFirstItem(int N)
|
||||||
{
|
{
|
||||||
};
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
void wxListBox::SetFirstItem( const wxString &WXUNUSED(item) )
|
void wxListBox::SetFirstItem(const wxString& s)
|
||||||
{
|
{
|
||||||
};
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
void wxListBox::SetSelection( int WXUNUSED(n), bool WXUNUSED(select) )
|
void wxListBox::Delete(int N)
|
||||||
{
|
{
|
||||||
};
|
m_noItems --;
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
void wxListBox::SetString( int WXUNUSED(n), const wxString &WXUNUSED(string) )
|
void wxListBox::Append(const wxString& item)
|
||||||
{
|
{
|
||||||
};
|
m_noItems ++;
|
||||||
|
|
||||||
void wxListBox::SetStringSelection( const wxString &WXUNUSED(string), bool WXUNUSED(select) )
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxListBox::Append(const wxString& item, char *Client_data)
|
||||||
{
|
{
|
||||||
};
|
m_noItems ++;
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxListBox::Set(int n, const wxString *choices, char** clientData)
|
||||||
|
{
|
||||||
|
m_noItems = n;
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
int wxListBox::FindString(const wxString& s) const
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxListBox::Clear()
|
||||||
|
{
|
||||||
|
m_noItems = 0;
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxListBox::SetSelection(int N, bool select)
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxListBox::Selected(int N) const
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxListBox::Deselect(int N)
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
char *wxListBox::GetClientData(int N) const
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
return (char *)NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxListBox::SetClientData(int N, char *Client_data)
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
// Return number of selections and an array of selected integers
|
||||||
|
int wxListBox::GetSelections(wxArrayInt& aSelections) const
|
||||||
|
{
|
||||||
|
aSelections.Empty();
|
||||||
|
|
||||||
|
/* TODO
|
||||||
|
if ((m_windowStyle & wxLB_MULTIPLE) || (m_windowStyle & wxLB_EXTENDED))
|
||||||
|
{
|
||||||
|
int no_sel = ??
|
||||||
|
for ( int n = 0; n < no_sel; n++ )
|
||||||
|
aSelections.Add(??);
|
||||||
|
|
||||||
|
return no_sel;
|
||||||
|
}
|
||||||
|
else // single-selection listbox
|
||||||
|
{
|
||||||
|
aSelections.Add(??);
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get single selection, for single choice list items
|
||||||
|
int wxListBox::GetSelection() const
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Find string for position
|
||||||
|
wxString wxListBox::GetString(int N) const
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
return wxString("");
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxListBox::SetSize(int x, int y, int width, int height, int sizeFlags)
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxListBox::InsertItems(int nItems, const wxString items[], int pos)
|
||||||
|
{
|
||||||
|
m_noItems += nItems;
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxListBox::SetString(int N, const wxString& s)
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
int wxListBox::Number () const
|
||||||
|
{
|
||||||
|
return m_noItems;
|
||||||
|
}
|
||||||
|
|
||||||
|
// For single selection items only
|
||||||
|
wxString wxListBox::GetStringSelection () const
|
||||||
|
{
|
||||||
|
int sel = GetSelection ();
|
||||||
|
if (sel > -1)
|
||||||
|
return this->GetString (sel);
|
||||||
|
else
|
||||||
|
return wxString("");
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxListBox::SetStringSelection (const wxString& s, bool flag)
|
||||||
|
{
|
||||||
|
int sel = FindString (s);
|
||||||
|
if (sel > -1)
|
||||||
|
{
|
||||||
|
SetSelection (sel, flag);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxListBox::Command (wxCommandEvent & event)
|
||||||
|
{
|
||||||
|
if (event.m_extraLong)
|
||||||
|
SetSelection (event.m_commandInt);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Deselect (event.m_commandInt);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ProcessCommand (event);
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
398
src/qt/mdi.cpp
398
src/qt/mdi.cpp
@@ -1,10 +1,11 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: mdi.cpp
|
// Name: mdi.cpp
|
||||||
// Purpose:
|
// Purpose: MDI classes
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@@ -13,217 +14,250 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/mdi.h"
|
#include "wx/mdi.h"
|
||||||
#include "wx/dialog.h"
|
|
||||||
#include "wx/menu.h"
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
extern wxList wxModelessWindows;
|
||||||
|
|
||||||
extern wxList wxPendingDelete;
|
#if !USE_SHARED_LIBRARY
|
||||||
|
IMPLEMENT_DYNAMIC_CLASS(wxMDIParentFrame, wxFrame)
|
||||||
//-----------------------------------------------------------------------------
|
IMPLEMENT_DYNAMIC_CLASS(wxMDIChildFrame, wxFrame)
|
||||||
// wxMDIParentFrame
|
IMPLEMENT_DYNAMIC_CLASS(wxMDIClientWindow, wxWindow)
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxMDIParentFrame,wxFrame)
|
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxMDIParentFrame, wxFrame)
|
BEGIN_EVENT_TABLE(wxMDIParentFrame, wxFrame)
|
||||||
|
EVT_SIZE(wxMDIParentFrame::OnSize)
|
||||||
|
EVT_ACTIVATE(wxMDIParentFrame::OnActivate)
|
||||||
|
EVT_SYS_COLOUR_CHANGED(wxMDIParentFrame::OnSysColourChanged)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
wxMDIParentFrame::wxMDIParentFrame(void)
|
BEGIN_EVENT_TABLE(wxMDIClientWindow, wxWindow)
|
||||||
{
|
EVT_SCROLL(wxMDIClientWindow::OnScroll)
|
||||||
m_clientWindow = NULL;
|
|
||||||
m_currentChild = NULL;
|
|
||||||
m_parentFrameActive = TRUE;
|
|
||||||
};
|
|
||||||
|
|
||||||
wxMDIParentFrame::wxMDIParentFrame( wxWindow *parent,
|
|
||||||
wxWindowID id, const wxString& title,
|
|
||||||
const wxPoint& pos, const wxSize& size,
|
|
||||||
long style, const wxString& name )
|
|
||||||
{
|
|
||||||
m_clientWindow = NULL;
|
|
||||||
m_currentChild = NULL;
|
|
||||||
m_parentFrameActive = TRUE;
|
|
||||||
Create( parent, id, title, pos, size, style, name );
|
|
||||||
};
|
|
||||||
|
|
||||||
wxMDIParentFrame::~wxMDIParentFrame(void)
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
bool wxMDIParentFrame::Create( wxWindow *parent,
|
|
||||||
wxWindowID id, const wxString& title,
|
|
||||||
const wxPoint& pos, const wxSize& size,
|
|
||||||
long style, const wxString& name )
|
|
||||||
{
|
|
||||||
wxFrame::Create( parent, id, title, pos, size, style, name );
|
|
||||||
|
|
||||||
OnCreateClient();
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxMDIParentFrame::GetClientSize(int *width, int *height ) const
|
|
||||||
{
|
|
||||||
wxFrame::GetClientSize( width, height );
|
|
||||||
};
|
|
||||||
|
|
||||||
wxMDIChildFrame *wxMDIParentFrame::GetActiveChild(void) const
|
|
||||||
{
|
|
||||||
return m_currentChild;
|
|
||||||
};
|
|
||||||
|
|
||||||
wxMDIClientWindow *wxMDIParentFrame::GetClientWindow(void) const
|
|
||||||
{
|
|
||||||
return m_clientWindow;
|
|
||||||
};
|
|
||||||
|
|
||||||
wxMDIClientWindow *wxMDIParentFrame::OnCreateClient(void)
|
|
||||||
{
|
|
||||||
m_clientWindow = new wxMDIClientWindow( this );
|
|
||||||
return m_clientWindow;
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxMDIParentFrame::ActivateNext(void)
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxMDIParentFrame::ActivatePrevious(void)
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxMDIParentFrame::OnActivate( wxActivateEvent& WXUNUSED(event) )
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxMDIParentFrame::OnSysColourChanged( wxSysColourChangedEvent& WXUNUSED(event) )
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// wxMDIChildFrame
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxMDIChildFrame,wxFrame)
|
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxMDIChildFrame, wxFrame)
|
|
||||||
EVT_ACTIVATE(wxMDIChildFrame::OnActivate)
|
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
wxMDIChildFrame::wxMDIChildFrame(void)
|
#endif
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
wxMDIChildFrame::wxMDIChildFrame( wxMDIParentFrame *parent,
|
// Parent frame
|
||||||
wxWindowID id, const wxString& title,
|
|
||||||
const wxPoint& WXUNUSED(pos), const wxSize& size,
|
|
||||||
long style, const wxString& name )
|
|
||||||
{
|
|
||||||
Create( parent, id, title, wxDefaultPosition, size, style, name );
|
|
||||||
};
|
|
||||||
|
|
||||||
wxMDIChildFrame::~wxMDIChildFrame(void)
|
wxMDIParentFrame::wxMDIParentFrame()
|
||||||
{
|
{
|
||||||
};
|
|
||||||
|
|
||||||
bool wxMDIChildFrame::Create( wxMDIParentFrame *parent,
|
|
||||||
wxWindowID id, const wxString& title,
|
|
||||||
const wxPoint& WXUNUSED(pos), const wxSize& size,
|
|
||||||
long style, const wxString& name )
|
|
||||||
{
|
|
||||||
m_title = title;
|
|
||||||
return wxWindow::Create( parent->GetClientWindow(), id, wxDefaultPosition, size, style, name );
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxMDIChildFrame::GetClientSize( int *width, int *height ) const
|
|
||||||
{
|
|
||||||
wxWindow::GetClientSize( width, height );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxMDIChildFrame::AddChild( wxWindow *child )
|
bool wxMDIParentFrame::Create(wxWindow *parent,
|
||||||
|
wxWindowID id,
|
||||||
|
const wxString& title,
|
||||||
|
const wxPoint& pos,
|
||||||
|
const wxSize& size,
|
||||||
|
long style,
|
||||||
|
const wxString& name)
|
||||||
{
|
{
|
||||||
wxWindow::AddChild( child );
|
if (!parent)
|
||||||
}
|
wxTopLevelWindows.Append(this);
|
||||||
|
|
||||||
static void SetInvokingWindow( wxMenu *menu, wxWindow *win )
|
|
||||||
{
|
|
||||||
menu->SetInvokingWindow( win );
|
|
||||||
wxNode *node = menu->m_items.First();
|
|
||||||
while (node)
|
|
||||||
{
|
|
||||||
wxMenuItem *menuitem = (wxMenuItem*)node->Data();
|
|
||||||
if (menuitem->IsSubMenu())
|
|
||||||
SetInvokingWindow( menuitem->GetSubMenu(), win );
|
|
||||||
node = node->Next();
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxMDIChildFrame::SetMenuBar( wxMenuBar *menu_bar )
|
SetName(name);
|
||||||
|
m_windowStyle = style;
|
||||||
|
|
||||||
|
if (parent) parent->AddChild(this);
|
||||||
|
|
||||||
|
if ( id > -1 )
|
||||||
|
m_windowId = id;
|
||||||
|
else
|
||||||
|
m_windowId = (int)NewControlId();
|
||||||
|
|
||||||
|
// TODO: create MDI parent frame
|
||||||
|
|
||||||
|
wxModelessWindows.Append(this);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxMDIParentFrame::~wxMDIParentFrame()
|
||||||
{
|
{
|
||||||
m_menuBar = menu_bar;
|
}
|
||||||
|
|
||||||
if (m_menuBar)
|
// Get size *available for subwindows* i.e. excluding menu bar.
|
||||||
{
|
void wxMDIParentFrame::GetClientSize(int *x, int *y) const
|
||||||
wxMDIParentFrame *mdi_frame = (wxMDIParentFrame*)m_parent->m_parent;
|
{
|
||||||
|
// TODO
|
||||||
if (m_menuBar->m_parent != this)
|
}
|
||||||
|
|
||||||
|
void wxMDIParentFrame::SetMenuBar(wxMenuBar *menu_bar)
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
if (!menu_bar)
|
||||||
{
|
{
|
||||||
wxNode *node = m_menuBar->m_menus.First();
|
m_frameMenuBar = NULL;
|
||||||
while (node)
|
return;
|
||||||
{
|
|
||||||
wxMenu *menu = (wxMenu*)node->Data();
|
|
||||||
SetInvokingWindow( menu, this );
|
|
||||||
node = node->Next();
|
|
||||||
};
|
|
||||||
|
|
||||||
m_menuBar->m_parent = mdi_frame;
|
|
||||||
}
|
}
|
||||||
mdi_frame->SetMDIMenuBar( m_menuBar );
|
|
||||||
|
if (menu_bar->m_menuBarFrame)
|
||||||
|
return;
|
||||||
|
|
||||||
}
|
m_frameMenuBar = menu_bar;
|
||||||
};
|
}
|
||||||
|
|
||||||
wxMenuBar *wxMDIChildFrame::GetMenuBar()
|
void wxMDIParentFrame::OnSize(wxSizeEvent& event)
|
||||||
{
|
{
|
||||||
return m_menuBar;
|
#if USE_CONSTRAINTS
|
||||||
};
|
if (GetAutoLayout())
|
||||||
|
Layout();
|
||||||
|
#endif
|
||||||
|
int x = 0;
|
||||||
|
int y = 0;
|
||||||
|
int width, height;
|
||||||
|
GetClientSize(&width, &height);
|
||||||
|
|
||||||
void wxMDIChildFrame::Activate(void)
|
if ( GetClientWindow() )
|
||||||
|
GetClientWindow()->SetSize(x, y, width, height);
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxMDIParentFrame::OnActivate(wxActivateEvent& event)
|
||||||
{
|
{
|
||||||
};
|
// Do nothing
|
||||||
|
}
|
||||||
|
|
||||||
void wxMDIChildFrame::OnActivate( wxActivateEvent &WXUNUSED(event) )
|
// Returns the active MDI child window
|
||||||
|
wxMDIChildFrame *wxMDIParentFrame::GetActiveChild() const
|
||||||
{
|
{
|
||||||
};
|
// TODO
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
// Create the client window class (don't Create the window,
|
||||||
// wxMDIClientWindow
|
// just return a new class)
|
||||||
//-----------------------------------------------------------------------------
|
wxMDIClientWindow *wxMDIParentFrame::OnCreateClient()
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxMDIClientWindow,wxWindow)
|
|
||||||
|
|
||||||
wxMDIClientWindow::wxMDIClientWindow(void)
|
|
||||||
{
|
{
|
||||||
};
|
return new wxMDIClientWindow ;
|
||||||
|
}
|
||||||
|
|
||||||
wxMDIClientWindow::wxMDIClientWindow( wxMDIParentFrame *parent, long style )
|
// Responds to colour changes, and passes event on to children.
|
||||||
|
void wxMDIParentFrame::OnSysColourChanged(wxSysColourChangedEvent& event)
|
||||||
{
|
{
|
||||||
CreateClient( parent, style );
|
// TODO
|
||||||
};
|
|
||||||
|
|
||||||
wxMDIClientWindow::~wxMDIClientWindow(void)
|
// Propagate the event to the non-top-level children
|
||||||
|
wxFrame::OnSysColourChanged(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
// MDI operations
|
||||||
|
void wxMDIParentFrame::Cascade()
|
||||||
{
|
{
|
||||||
};
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
bool wxMDIClientWindow::CreateClient( wxMDIParentFrame *WXUNUSED(parent), long WXUNUSED(style) )
|
void wxMDIParentFrame::Tile()
|
||||||
{
|
{
|
||||||
return TRUE;
|
// TODO
|
||||||
};
|
}
|
||||||
|
|
||||||
void wxMDIClientWindow::AddChild( wxWindow *WXUNUSED(child) )
|
void wxMDIParentFrame::ArrangeIcons()
|
||||||
{
|
{
|
||||||
};
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxMDIParentFrame::ActivateNext()
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxMDIParentFrame::ActivatePrevious()
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
// Child frame
|
||||||
|
|
||||||
|
wxMDIChildFrame::wxMDIChildFrame()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxMDIChildFrame::Create(wxMDIParentFrame *parent,
|
||||||
|
wxWindowID id,
|
||||||
|
const wxString& title,
|
||||||
|
const wxPoint& pos,
|
||||||
|
const wxSize& size,
|
||||||
|
long style,
|
||||||
|
const wxString& name)
|
||||||
|
{
|
||||||
|
SetName(name);
|
||||||
|
|
||||||
|
if ( id > -1 )
|
||||||
|
m_windowId = id;
|
||||||
|
else
|
||||||
|
m_windowId = (int)NewControlId();
|
||||||
|
|
||||||
|
if (parent) parent->AddChild(this);
|
||||||
|
|
||||||
|
// TODO: create child frame
|
||||||
|
|
||||||
|
wxModelessWindows.Append(this);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxMDIChildFrame::~wxMDIChildFrame()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set the client size (i.e. leave the calculation of borders etc.
|
||||||
|
// to wxWindows)
|
||||||
|
void wxMDIChildFrame::SetClientSize(int width, int height)
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxMDIChildFrame::GetPosition(int *x, int *y) const
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxMDIChildFrame::SetMenuBar(wxMenuBar *menu_bar)
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
if (!menu_bar)
|
||||||
|
{
|
||||||
|
m_frameMenuBar = NULL;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (menu_bar->m_menuBarFrame)
|
||||||
|
return;
|
||||||
|
m_frameMenuBar = menu_bar;
|
||||||
|
}
|
||||||
|
|
||||||
|
// MDI operations
|
||||||
|
void wxMDIChildFrame::Maximize()
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxMDIChildFrame::Restore()
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxMDIChildFrame::Activate()
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
// Client window
|
||||||
|
|
||||||
|
wxMDIClientWindow::wxMDIClientWindow()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
wxMDIClientWindow::~wxMDIClientWindow()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxMDIClientWindow::CreateClient(wxMDIParentFrame *parent, long style)
|
||||||
|
{
|
||||||
|
// TODO create client window
|
||||||
|
m_backgroundColour = wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE);
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Explicitly call default scroll behaviour
|
||||||
|
void wxMDIClientWindow::OnScroll(wxScrollEvent& event)
|
||||||
|
{
|
||||||
|
Default(); // Default processing
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
779
src/qt/menu.cpp
779
src/qt/menu.cpp
@@ -1,293 +1,568 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: menu.cpp
|
// Name: menu.cpp
|
||||||
// Purpose:
|
// Purpose: wxMenu, wxMenuBar, wxMenuItem
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id: $Id$
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
// Licence: wxWindows licence
|
// Copyright: (c) AUTHOR
|
||||||
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// headers & declarations
|
||||||
|
// ============================================================================
|
||||||
|
|
||||||
|
// wxWindows headers
|
||||||
|
// -----------------
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma implementation "menu.h"
|
#pragma implementation "menu.h"
|
||||||
|
#pragma implementation "menuitem.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/menu.h"
|
#include "wx/menu.h"
|
||||||
|
#include "wx/menuitem.h"
|
||||||
#include "wx/log.h"
|
#include "wx/log.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
// other standard headers
|
||||||
// wxMenuBar
|
// ----------------------
|
||||||
//-----------------------------------------------------------------------------
|
#include <string.h>
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxMenuBar,wxWindow)
|
#if !USE_SHARED_LIBRARY
|
||||||
|
IMPLEMENT_DYNAMIC_CLASS(wxMenu, wxEvtHandler)
|
||||||
|
IMPLEMENT_DYNAMIC_CLASS(wxMenuBar, wxEvtHandler)
|
||||||
|
#endif
|
||||||
|
|
||||||
wxMenuBar::wxMenuBar()
|
// ============================================================================
|
||||||
|
// implementation
|
||||||
|
// ============================================================================
|
||||||
|
|
||||||
|
// Menus
|
||||||
|
|
||||||
|
// Construct a menu with optional title (then use append)
|
||||||
|
wxMenu::wxMenu(const wxString& title, const wxFunction func)
|
||||||
{
|
{
|
||||||
};
|
m_title = title;
|
||||||
|
m_parent = NULL;
|
||||||
|
m_eventHandler = this;
|
||||||
|
m_noItems = 0;
|
||||||
|
m_menuBar = NULL;
|
||||||
|
if (m_title != "")
|
||||||
|
{
|
||||||
|
Append(-2, m_title) ;
|
||||||
|
AppendSeparator() ;
|
||||||
|
}
|
||||||
|
|
||||||
void wxMenuBar::Append( wxMenu *menu, const wxString &title )
|
Callback(func);
|
||||||
{
|
|
||||||
m_menus.Append( menu );
|
|
||||||
menu->m_title = title; // ??????
|
|
||||||
|
|
||||||
int pos;
|
// TODO create menu
|
||||||
do {
|
|
||||||
pos = menu->m_title.First( '&' );
|
|
||||||
if (pos != -1) menu->m_title.Remove( pos, 1 );
|
|
||||||
} while (pos != -1);
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
static int FindMenuItemRecursive( const wxMenu *menu, const wxString &menuString, const wxString &itemString )
|
|
||||||
{
|
|
||||||
if (menu->m_title == menuString)
|
|
||||||
{
|
|
||||||
int res = menu->FindItem( itemString );
|
|
||||||
if (res != -1) return res;
|
|
||||||
};
|
|
||||||
wxNode *node = menu->m_items.First();
|
|
||||||
while (node)
|
|
||||||
{
|
|
||||||
wxMenuItem *item = (wxMenuItem*)node->Data();
|
|
||||||
if (item->IsSubMenu())
|
|
||||||
return FindMenuItemRecursive(item->GetSubMenu(), menuString, itemString);
|
|
||||||
node = node->Next();
|
|
||||||
};
|
|
||||||
return -1;
|
|
||||||
};
|
|
||||||
|
|
||||||
int wxMenuBar::FindMenuItem( const wxString &menuString, const wxString &itemString ) const
|
|
||||||
{
|
|
||||||
wxNode *node = m_menus.First();
|
|
||||||
while (node)
|
|
||||||
{
|
|
||||||
wxMenu *menu = (wxMenu*)node->Data();
|
|
||||||
int res = FindMenuItemRecursive( menu, menuString, itemString);
|
|
||||||
if (res != -1) return res;
|
|
||||||
node = node->Next();
|
|
||||||
};
|
|
||||||
return -1;
|
|
||||||
};
|
|
||||||
|
|
||||||
// Find a wxMenuItem using its id. Recurses down into sub-menus
|
|
||||||
static wxMenuItem* FindMenuItemByIdRecursive(const wxMenu* menu, int id)
|
|
||||||
{
|
|
||||||
wxMenuItem* result = menu->FindItem(id);
|
|
||||||
|
|
||||||
wxNode *node = menu->m_items.First();
|
|
||||||
while ( node && result == NULL ) {
|
|
||||||
wxMenuItem *item = (wxMenuItem*)node->Data();
|
|
||||||
if ( item->IsSubMenu() )
|
|
||||||
result = FindMenuItemByIdRecursive( item->GetSubMenu(), id );
|
|
||||||
node = node->Next();
|
|
||||||
};
|
|
||||||
|
|
||||||
return result;
|
|
||||||
};
|
|
||||||
|
|
||||||
wxMenuItem* wxMenuBar::FindMenuItemById( int id ) const
|
|
||||||
{
|
|
||||||
wxMenuItem* result = 0;
|
|
||||||
wxNode *node = m_menus.First();
|
|
||||||
while (node && result == 0)
|
|
||||||
{
|
|
||||||
wxMenu *menu = (wxMenu*)node->Data();
|
|
||||||
result = FindMenuItemByIdRecursive( menu, id );
|
|
||||||
node = node->Next();
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxMenuBar::Check( int id, bool check )
|
// The wxWindow destructor will take care of deleting the submenus.
|
||||||
|
wxMenu::~wxMenu()
|
||||||
{
|
{
|
||||||
wxMenuItem* item = FindMenuItemById( id );
|
// TODO destroy menu and children
|
||||||
if (item) item->Check(check);
|
|
||||||
};
|
|
||||||
|
|
||||||
bool wxMenuBar::Checked( int id ) const
|
wxNode *node = m_menuItems.First();
|
||||||
{
|
while (node)
|
||||||
wxMenuItem* item = FindMenuItemById( id );
|
{
|
||||||
if (item) return item->IsChecked();
|
wxMenuItem *item = (wxMenuItem *)node->Data();
|
||||||
return FALSE;
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxMenuBar::Enable( int id, bool enable )
|
// Delete child menus.
|
||||||
{
|
// Beware: they must not be appended to children list!!!
|
||||||
wxMenuItem* item = FindMenuItemById( id );
|
// (because order of delete is significant)
|
||||||
if (item) item->Enable(enable);
|
if (item->GetSubMenu())
|
||||||
};
|
item->DeleteSubMenu();
|
||||||
|
|
||||||
bool wxMenuBar::Enabled( int id ) const
|
wxNode *next = node->Next();
|
||||||
{
|
delete item;
|
||||||
wxMenuItem* item = FindMenuItemById( id );
|
delete node;
|
||||||
if (item) return item->IsEnabled();
|
node = next;
|
||||||
return FALSE;
|
}
|
||||||
};
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// wxMenu
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxMenuItem,wxObject)
|
|
||||||
|
|
||||||
wxMenuItem::wxMenuItem()
|
|
||||||
{
|
|
||||||
m_id = ID_SEPARATOR;
|
|
||||||
m_isCheckMenu = FALSE;
|
|
||||||
m_isChecked = FALSE;
|
|
||||||
m_isEnabled = TRUE;
|
|
||||||
m_subMenu = NULL;
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxMenuItem::SetText(const wxString& str)
|
|
||||||
{
|
|
||||||
for ( const char *pc = str; *pc != '\0'; pc++ ) {
|
|
||||||
if ( *pc == '&' )
|
|
||||||
pc++; // skip it
|
|
||||||
|
|
||||||
m_text << *pc;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxMenuItem::Check( bool check )
|
void wxMenu::Break()
|
||||||
{
|
{
|
||||||
wxCHECK_RET( IsCheckable(), "can't check uncheckable item!" )
|
// TODO
|
||||||
|
|
||||||
m_isChecked = check;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxMenuItem::IsChecked() const
|
// function appends a new item or submenu to the menu
|
||||||
|
void wxMenu::Append(wxMenuItem *pItem)
|
||||||
{
|
{
|
||||||
wxCHECK( IsCheckable(), FALSE ); // can't get state of uncheckable item!
|
// TODO
|
||||||
|
|
||||||
return FALSE;
|
wxCHECK_RET( pItem != NULL, "can't append NULL item to the menu" );
|
||||||
|
|
||||||
|
m_menuItems.Append(pItem);
|
||||||
|
|
||||||
|
m_noItems++;
|
||||||
}
|
}
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxMenu,wxEvtHandler)
|
|
||||||
|
|
||||||
wxMenu::wxMenu( const wxString &title )
|
|
||||||
{
|
|
||||||
m_title = title;
|
|
||||||
m_items.DeleteContents( TRUE );
|
|
||||||
m_invokingWindow = NULL;
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxMenu::AppendSeparator()
|
void wxMenu::AppendSeparator()
|
||||||
{
|
{
|
||||||
wxMenuItem *mitem = new wxMenuItem();
|
// TODO
|
||||||
mitem->SetId(ID_SEPARATOR);
|
Append(new wxMenuItem(this, ID_SEPARATOR));
|
||||||
|
|
||||||
m_items.Append( mitem );
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxMenu::Append( int id, const wxString &item, const wxString &helpStr, bool checkable )
|
|
||||||
{
|
|
||||||
wxMenuItem *mitem = new wxMenuItem();
|
|
||||||
mitem->SetId(id);
|
|
||||||
mitem->SetText(item);
|
|
||||||
mitem->SetHelpString(helpStr);
|
|
||||||
mitem->SetCheckable(checkable);
|
|
||||||
|
|
||||||
m_items.Append( mitem );
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxMenu::Append( int id, const wxString &text, wxMenu *subMenu, const wxString &helpStr )
|
|
||||||
{
|
|
||||||
wxMenuItem *mitem = new wxMenuItem();
|
|
||||||
mitem->SetId(id);
|
|
||||||
mitem->SetText(text);
|
|
||||||
mitem->SetHelpString(helpStr);
|
|
||||||
mitem->SetSubMenu(subMenu);
|
|
||||||
|
|
||||||
m_items.Append( mitem );
|
|
||||||
};
|
|
||||||
|
|
||||||
int wxMenu::FindItem( const wxString itemString ) const
|
|
||||||
{
|
|
||||||
wxString s( itemString );
|
|
||||||
|
|
||||||
int pos;
|
|
||||||
do {
|
|
||||||
pos = s.First( '&' );
|
|
||||||
if (pos != -1) s.Remove( pos, 1 );
|
|
||||||
} while (pos != -1);
|
|
||||||
|
|
||||||
wxNode *node = m_items.First();
|
|
||||||
while (node)
|
|
||||||
{
|
|
||||||
wxMenuItem *item = (wxMenuItem*)node->Data();
|
|
||||||
if (item->GetText() == s)
|
|
||||||
return item->GetId();
|
|
||||||
node = node->Next();
|
|
||||||
};
|
|
||||||
|
|
||||||
return -1;
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxMenu::Enable( int id, bool enable )
|
|
||||||
{
|
|
||||||
wxMenuItem *item = FindItem(id);
|
|
||||||
if ( item )
|
|
||||||
item->Enable(enable);
|
|
||||||
};
|
|
||||||
|
|
||||||
bool wxMenu::IsEnabled( int id ) const
|
|
||||||
{
|
|
||||||
wxMenuItem *item = FindItem(id);
|
|
||||||
if ( item )
|
|
||||||
return item->IsEnabled();
|
|
||||||
else
|
|
||||||
return FALSE;
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxMenu::Check( int id, bool enable )
|
|
||||||
{
|
|
||||||
wxMenuItem *item = FindItem(id);
|
|
||||||
if ( item )
|
|
||||||
item->Check(enable);
|
|
||||||
};
|
|
||||||
|
|
||||||
bool wxMenu::IsChecked( int id ) const
|
|
||||||
{
|
|
||||||
wxMenuItem *item = FindItem(id);
|
|
||||||
if ( item )
|
|
||||||
return item->IsChecked();
|
|
||||||
else
|
|
||||||
return FALSE;
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxMenu::SetLabel( int id, const wxString &label )
|
|
||||||
{
|
|
||||||
wxMenuItem *item = FindItem(id);
|
|
||||||
if ( item )
|
|
||||||
item->SetText(label);
|
|
||||||
};
|
|
||||||
|
|
||||||
wxMenuItem *wxMenu::FindItem(int id) const
|
|
||||||
{
|
|
||||||
wxNode *node = m_items.First();
|
|
||||||
while (node) {
|
|
||||||
wxMenuItem *item = (wxMenuItem*)node->Data();
|
|
||||||
if ( item->GetId() == id )
|
|
||||||
return item;
|
|
||||||
node = node->Next();
|
|
||||||
};
|
|
||||||
|
|
||||||
wxLogDebug("wxMenu::FindItem: item %d not found.", id);
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxMenu::SetInvokingWindow( wxWindow *win )
|
// Pullright item
|
||||||
|
void wxMenu::Append(int Id, const wxString& label, wxMenu *SubMenu,
|
||||||
|
const wxString& helpString)
|
||||||
{
|
{
|
||||||
m_invokingWindow = win;
|
Append(new wxMenuItem(this, Id, label, helpString, FALSE, SubMenu));
|
||||||
};
|
}
|
||||||
|
|
||||||
wxWindow *wxMenu::GetInvokingWindow()
|
// Ordinary menu item
|
||||||
|
void wxMenu::Append(int Id, const wxString& label,
|
||||||
|
const wxString& helpString, bool checkable)
|
||||||
{
|
{
|
||||||
return m_invokingWindow;
|
// 'checkable' parameter is useless for Windows.
|
||||||
};
|
Append(new wxMenuItem(this, Id, label, helpString, checkable));
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxMenu::Delete(int id)
|
||||||
|
{
|
||||||
|
wxNode *node;
|
||||||
|
wxMenuItem *item;
|
||||||
|
int pos;
|
||||||
|
|
||||||
|
for (pos = 0, node = m_menuItems.First(); node; node = node->Next(), pos++) {
|
||||||
|
item = (wxMenuItem *)node->Data();
|
||||||
|
if (item->GetId() == id)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!node)
|
||||||
|
return;
|
||||||
|
|
||||||
|
m_menuItems.DeleteNode(node);
|
||||||
|
delete item;
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxMenu::Enable(int Id, bool Flag)
|
||||||
|
{
|
||||||
|
wxMenuItem *item = FindItemForId(Id);
|
||||||
|
wxCHECK_RET( item != NULL, "can't enable non-existing menu item" );
|
||||||
|
|
||||||
|
item->Enable(Flag);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxMenu::Enabled(int Id) const
|
||||||
|
{
|
||||||
|
wxMenuItem *item = FindItemForId(Id);
|
||||||
|
wxCHECK( item != NULL, FALSE );
|
||||||
|
|
||||||
|
return item->IsEnabled();
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxMenu::Check(int Id, bool Flag)
|
||||||
|
{
|
||||||
|
wxMenuItem *item = FindItemForId(Id);
|
||||||
|
wxCHECK_RET( item != NULL, "can't get status of non-existing menu item" );
|
||||||
|
|
||||||
|
item->Check(Flag);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxMenu::Checked(int Id) const
|
||||||
|
{
|
||||||
|
wxMenuItem *item = FindItemForId(Id);
|
||||||
|
wxCHECK( item != NULL, FALSE );
|
||||||
|
|
||||||
|
return item->IsChecked();
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxMenu::SetTitle(const wxString& label)
|
||||||
|
{
|
||||||
|
m_title = label ;
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
const wxString& wxMenu::GetTitle() const
|
||||||
|
{
|
||||||
|
return m_title;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxMenu::SetLabel(int id, const wxString& label)
|
||||||
|
{
|
||||||
|
wxMenuItem *item = FindItemForId(id) ;
|
||||||
|
if (item==NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (item->GetSubMenu()==NULL)
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
item->SetName(label);
|
||||||
|
}
|
||||||
|
|
||||||
|
wxString wxMenu::GetLabel(int Id) const
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
return wxString("") ;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Finds the item id matching the given string, -1 if not found.
|
||||||
|
int wxMenu::FindItem (const wxString& itemString) const
|
||||||
|
{
|
||||||
|
char buf1[200];
|
||||||
|
char buf2[200];
|
||||||
|
wxStripMenuCodes ((char *)(const char *)itemString, buf1);
|
||||||
|
|
||||||
|
for (wxNode * node = m_menuItems.First (); node; node = node->Next ())
|
||||||
|
{
|
||||||
|
wxMenuItem *item = (wxMenuItem *) node->Data ();
|
||||||
|
if (item->GetSubMenu())
|
||||||
|
{
|
||||||
|
int ans = item->GetSubMenu()->FindItem(itemString);
|
||||||
|
if (ans > -1)
|
||||||
|
return ans;
|
||||||
|
}
|
||||||
|
if ( !item->IsSeparator() )
|
||||||
|
{
|
||||||
|
wxStripMenuCodes((char *)item->GetName().c_str(), buf2);
|
||||||
|
if (strcmp(buf1, buf2) == 0)
|
||||||
|
return item->GetId();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxMenuItem *wxMenu::FindItemForId(int itemId, wxMenu ** itemMenu) const
|
||||||
|
{
|
||||||
|
if (itemMenu)
|
||||||
|
*itemMenu = NULL;
|
||||||
|
for (wxNode * node = m_menuItems.First (); node; node = node->Next ())
|
||||||
|
{
|
||||||
|
wxMenuItem *item = (wxMenuItem *) node->Data ();
|
||||||
|
|
||||||
|
if (item->GetId() == itemId)
|
||||||
|
{
|
||||||
|
if (itemMenu)
|
||||||
|
*itemMenu = (wxMenu *) this;
|
||||||
|
return item;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (item->GetSubMenu())
|
||||||
|
{
|
||||||
|
wxMenuItem *ans = item->GetSubMenu()->FindItemForId (itemId, itemMenu);
|
||||||
|
if (ans)
|
||||||
|
return ans;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (itemMenu)
|
||||||
|
*itemMenu = NULL;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxMenu::SetHelpString(int itemId, const wxString& helpString)
|
||||||
|
{
|
||||||
|
wxMenuItem *item = FindItemForId (itemId);
|
||||||
|
if (item)
|
||||||
|
item->SetHelp(helpString);
|
||||||
|
}
|
||||||
|
|
||||||
|
wxString wxMenu::GetHelpString (int itemId) const
|
||||||
|
{
|
||||||
|
wxMenuItem *item = FindItemForId (itemId);
|
||||||
|
wxString str("");
|
||||||
|
return (item == NULL) ? str : item->GetHelp();
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxMenu::ProcessCommand(wxCommandEvent & event)
|
||||||
|
{
|
||||||
|
bool processed = FALSE;
|
||||||
|
|
||||||
|
// Try a callback
|
||||||
|
if (m_callback)
|
||||||
|
{
|
||||||
|
(void) (*(m_callback)) (*this, event);
|
||||||
|
processed = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Try the menu's event handler
|
||||||
|
if ( !processed && GetEventHandler())
|
||||||
|
{
|
||||||
|
processed = GetEventHandler()->ProcessEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Try the window the menu was popped up from (and up
|
||||||
|
// through the hierarchy)
|
||||||
|
if ( !processed && GetInvokingWindow())
|
||||||
|
processed = GetInvokingWindow()->ProcessEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxWindow::PopupMenu(wxMenu *menu, int x, int y)
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Menu Bar
|
||||||
|
wxMenuBar::wxMenuBar()
|
||||||
|
{
|
||||||
|
m_eventHandler = this;
|
||||||
|
m_menuCount = 0;
|
||||||
|
m_menus = NULL;
|
||||||
|
m_titles = NULL;
|
||||||
|
m_menuBarFrame = NULL;
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
wxMenuBar::wxMenuBar(int n, wxMenu *Mmnus[], const wxString titles[])
|
||||||
|
{
|
||||||
|
m_eventHandler = this;
|
||||||
|
m_menuCount = n;
|
||||||
|
m_menus = menus;
|
||||||
|
m_titles = new wxString[n];
|
||||||
|
int i;
|
||||||
|
for ( i = 0; i < n; i++ )
|
||||||
|
m_titles[i] = titles[i];
|
||||||
|
m_menuBarFrame = NULL;
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
wxMenuBar::~wxMenuBar()
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
for (i = 0; i < m_menuCount; i++)
|
||||||
|
{
|
||||||
|
delete m_menus[i];
|
||||||
|
}
|
||||||
|
delete[] m_menus;
|
||||||
|
delete[] m_titles;
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
// Must only be used AFTER menu has been attached to frame,
|
||||||
|
// otherwise use individual menus to enable/disable items
|
||||||
|
void wxMenuBar::Enable(int id, bool flag)
|
||||||
|
{
|
||||||
|
wxMenu *itemMenu = NULL;
|
||||||
|
wxMenuItem *item = FindItemForId(id, &itemMenu) ;
|
||||||
|
if (!item)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxMenuBar::EnableTop(int pos, bool flag)
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
// Must only be used AFTER menu has been attached to frame,
|
||||||
|
// otherwise use individual menus
|
||||||
|
void wxMenuBar::Check(int id, bool flag)
|
||||||
|
{
|
||||||
|
wxMenu *itemMenu = NULL;
|
||||||
|
wxMenuItem *item = FindItemForId(id, &itemMenu) ;
|
||||||
|
if (!item)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!item->IsCheckable())
|
||||||
|
return ;
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxMenuBar::Checked(int id) const
|
||||||
|
{
|
||||||
|
wxMenu *itemMenu = NULL;
|
||||||
|
wxMenuItem *item = FindItemForId(id, &itemMenu) ;
|
||||||
|
if (!item)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxMenuBar::Enabled(int id) const
|
||||||
|
{
|
||||||
|
wxMenu *itemMenu = NULL;
|
||||||
|
wxMenuItem *item = FindItemForId(id, &itemMenu) ;
|
||||||
|
if (!item)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
return FALSE ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void wxMenuBar::SetLabel(int id, const wxString& label)
|
||||||
|
{
|
||||||
|
wxMenu *itemMenu = NULL;
|
||||||
|
wxMenuItem *item = FindItemForId(id, &itemMenu) ;
|
||||||
|
|
||||||
|
if (!item)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
wxString wxMenuBar::GetLabel(int id) const
|
||||||
|
{
|
||||||
|
wxMenu *itemMenu = NULL;
|
||||||
|
wxMenuItem *item = FindItemForId(id, &itemMenu) ;
|
||||||
|
|
||||||
|
if (!item)
|
||||||
|
return wxString("");
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
return wxString("") ;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxMenuBar::SetLabelTop(int pos, const wxString& label)
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
wxString wxMenuBar::GetLabelTop(int pos) const
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
return wxString("");
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxMenuBar::OnDelete(wxMenu *a_menu, int pos)
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxMenuBar::OnAppend(wxMenu *a_menu, const char *title)
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxMenuBar::Append (wxMenu * menu, const wxString& title)
|
||||||
|
{
|
||||||
|
if (!OnAppend(menu, title))
|
||||||
|
return;
|
||||||
|
|
||||||
|
m_menuCount ++;
|
||||||
|
wxMenu **new_menus = new wxMenu *[m_menuCount];
|
||||||
|
wxString *new_titles = new wxString[m_menuCount];
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; i < m_menuCount - 1; i++)
|
||||||
|
{
|
||||||
|
new_menus[i] = m_menus[i];
|
||||||
|
m_menus[i] = NULL;
|
||||||
|
new_titles[i] = m_titles[i];
|
||||||
|
m_titles[i] = "";
|
||||||
|
}
|
||||||
|
if (m_menus)
|
||||||
|
{
|
||||||
|
delete[]m_menus;
|
||||||
|
delete[]m_titles;
|
||||||
|
}
|
||||||
|
m_menus = new_menus;
|
||||||
|
m_titles = new_titles;
|
||||||
|
|
||||||
|
m_menus[m_menuCount - 1] = (wxMenu *)menu;
|
||||||
|
m_titles[m_menuCount - 1] = title;
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxMenuBar::Delete(wxMenu * menu, int i)
|
||||||
|
{
|
||||||
|
int j;
|
||||||
|
int ii = (int) i;
|
||||||
|
|
||||||
|
if (menu != 0)
|
||||||
|
{
|
||||||
|
for (ii = 0; ii < m_menuCount; ii++)
|
||||||
|
{
|
||||||
|
if (m_menus[ii] == menu)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (ii >= m_menuCount)
|
||||||
|
return;
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
if (ii < 0 || ii >= m_menuCount)
|
||||||
|
return;
|
||||||
|
menu = m_menus[ii];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!OnDelete(menu, ii))
|
||||||
|
return;
|
||||||
|
|
||||||
|
menu->SetParent(NULL);
|
||||||
|
|
||||||
|
-- m_menuCount;
|
||||||
|
for (j = ii; j < m_menuCount; j++)
|
||||||
|
{
|
||||||
|
m_menus[j] = m_menus[j + 1];
|
||||||
|
m_titles[j] = m_titles[j + 1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Find the menu menuString, item itemString, and return the item id.
|
||||||
|
// Returns -1 if none found.
|
||||||
|
int wxMenuBar::FindMenuItem (const wxString& menuString, const wxString& itemString) const
|
||||||
|
{
|
||||||
|
char buf1[200];
|
||||||
|
char buf2[200];
|
||||||
|
wxStripMenuCodes ((char *)(const char *)menuString, buf1);
|
||||||
|
int i;
|
||||||
|
for (i = 0; i < m_menuCount; i++)
|
||||||
|
{
|
||||||
|
wxStripMenuCodes ((char *)(const char *)m_titles[i], buf2);
|
||||||
|
if (strcmp (buf1, buf2) == 0)
|
||||||
|
return m_menus[i]->FindItem (itemString);
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxMenuItem *wxMenuBar::FindItemForId (int Id, wxMenu ** itemMenu) const
|
||||||
|
{
|
||||||
|
if (itemMenu)
|
||||||
|
*itemMenu = NULL;
|
||||||
|
|
||||||
|
wxMenuItem *item = NULL;
|
||||||
|
int i;
|
||||||
|
for (i = 0; i < m_menuCount; i++)
|
||||||
|
if ((item = m_menus[i]->FindItemForId (Id, itemMenu)))
|
||||||
|
return item;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxMenuBar::SetHelpString (int Id, const wxString& helpString)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
for (i = 0; i < m_menuCount; i++)
|
||||||
|
{
|
||||||
|
if (m_menus[i]->FindItemForId (Id))
|
||||||
|
{
|
||||||
|
m_menus[i]->SetHelpString (Id, helpString);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
wxString wxMenuBar::GetHelpString (int Id) const
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
for (i = 0; i < m_menuCount; i++)
|
||||||
|
{
|
||||||
|
if (m_menus[i]->FindItemForId (Id))
|
||||||
|
eturn wxString(m_menus[i]->GetHelpString (Id));
|
||||||
|
}
|
||||||
|
return wxString("");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,185 +1,371 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: notebook.cpp
|
// Name: notebook.cpp
|
||||||
// Purpose:
|
// Purpose: implementation of wxNotebook
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// declarations
|
||||||
|
// ============================================================================
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// headers
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma implementation "notebook.h"
|
#pragma implementation "notebook.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/notebook.h"
|
#include <wx/string.h>
|
||||||
#include "wx/panel.h"
|
#include <wx/log.h>
|
||||||
#include "wx/utils.h"
|
#include <wx/imaglist.h>
|
||||||
#include "wx/imaglist.h"
|
#include <wx/notebook.h>
|
||||||
#include "wx/log.h"
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// wxNotebookPage
|
// macros
|
||||||
//-----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
class wxNotebookPage: public wxObject
|
// check that the page index is valid
|
||||||
{
|
#define IS_VALID_PAGE(nPage) (((nPage) >= 0) && ((nPage) < GetPageCount()))
|
||||||
public:
|
|
||||||
wxNotebookPage()
|
|
||||||
{
|
|
||||||
m_id = -1;
|
|
||||||
m_text = "";
|
|
||||||
m_image = -1;
|
|
||||||
m_page = NULL;
|
|
||||||
m_client = NULL;
|
|
||||||
m_parent = NULL;
|
|
||||||
};
|
|
||||||
|
|
||||||
//private:
|
// ----------------------------------------------------------------------------
|
||||||
int m_id;
|
// event table
|
||||||
wxString m_text;
|
// ----------------------------------------------------------------------------
|
||||||
int m_image;
|
|
||||||
wxWindow *m_client;
|
|
||||||
};
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
#if !USE_SHARED_LIBRARIES
|
||||||
// wxNotebook
|
BEGIN_EVENT_TABLE(wxNotebook, wxControl)
|
||||||
//-----------------------------------------------------------------------------
|
EVT_NOTEBOOK_PAGE_CHANGED(-1, wxNotebook::OnSelChange)
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxNotebook,wxControl)
|
EVT_SIZE(wxNotebook::OnSize)
|
||||||
|
EVT_SET_FOCUS(wxNotebook::OnSetFocus)
|
||||||
|
EVT_NAVIGATION_KEY(wxNotebook::OnNavigationKey)
|
||||||
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
|
IMPLEMENT_DYNAMIC_CLASS(wxNotebook, wxControl)
|
||||||
|
IMPLEMENT_DYNAMIC_CLASS(wxNotebookEvent, wxCommandEvent)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
// implementation
|
||||||
|
// ============================================================================
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// wxNotebook construction
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// common part of all ctors
|
||||||
void wxNotebook::Init()
|
void wxNotebook::Init()
|
||||||
{
|
{
|
||||||
m_imageList = NULL;
|
m_pImageList = NULL;
|
||||||
m_pages.DeleteContents( TRUE );
|
m_nSelection = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// default for dynamic class
|
||||||
wxNotebook::wxNotebook()
|
wxNotebook::wxNotebook()
|
||||||
{
|
{
|
||||||
Init();
|
Init();
|
||||||
};
|
}
|
||||||
|
|
||||||
wxNotebook::wxNotebook( wxWindow *parent, wxWindowID id,
|
// the same arguments as for wxControl
|
||||||
const wxPoint& pos, const wxSize& size,
|
wxNotebook::wxNotebook(wxWindow *parent,
|
||||||
long style, const wxString& name )
|
wxWindowID id,
|
||||||
|
const wxPoint& pos,
|
||||||
|
const wxSize& size,
|
||||||
|
long style,
|
||||||
|
const wxString& name)
|
||||||
{
|
{
|
||||||
Init();
|
Init();
|
||||||
Create( parent, id, pos, size, style, name );
|
|
||||||
};
|
|
||||||
|
|
||||||
|
Create(parent, id, pos, size, style, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create() function
|
||||||
|
bool wxNotebook::Create(wxWindow *parent,
|
||||||
|
wxWindowID id,
|
||||||
|
const wxPoint& pos,
|
||||||
|
const wxSize& size,
|
||||||
|
long style,
|
||||||
|
const wxString& name)
|
||||||
|
{
|
||||||
|
// base init
|
||||||
|
SetName(name);
|
||||||
|
SetParent(parent);
|
||||||
|
|
||||||
|
m_windowId = id == -1 ? NewControlId() : id;
|
||||||
|
|
||||||
|
// colors and font
|
||||||
|
m_backgroundColour = wxColour(GetSysColor(COLOR_BTNFACE));
|
||||||
|
m_foregroundColour = *wxBLACK ;
|
||||||
|
|
||||||
|
// style
|
||||||
|
m_windowStyle = style;
|
||||||
|
|
||||||
|
if ( parent != NULL )
|
||||||
|
parent->AddChild(this);
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// dtor
|
||||||
wxNotebook::~wxNotebook()
|
wxNotebook::~wxNotebook()
|
||||||
{
|
{
|
||||||
DeleteAllPages();
|
}
|
||||||
};
|
|
||||||
|
|
||||||
bool wxNotebook::Create(wxWindow *parent, wxWindowID id,
|
|
||||||
const wxPoint& pos, const wxSize& size,
|
|
||||||
long style, const wxString& name )
|
|
||||||
{
|
|
||||||
PreCreation( parent, id, pos, size, style, name );
|
|
||||||
|
|
||||||
PostCreation();
|
|
||||||
|
|
||||||
Show( TRUE );
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
};
|
|
||||||
|
|
||||||
int wxNotebook::GetSelection() const
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// wxNotebook accessors
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
int wxNotebook::GetPageCount() const
|
int wxNotebook::GetPageCount() const
|
||||||
{
|
{
|
||||||
};
|
return m_aPages.Count();
|
||||||
|
}
|
||||||
|
|
||||||
int wxNotebook::GetRowCount() const
|
int wxNotebook::GetRowCount() const
|
||||||
{
|
{
|
||||||
};
|
// TODO
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
wxString wxNotebook::GetPageText( int page ) const
|
int wxNotebook::SetSelection(int nPage)
|
||||||
{
|
{
|
||||||
};
|
wxASSERT( IS_VALID_PAGE(nPage) );
|
||||||
|
|
||||||
int wxNotebook::GetPageImage( int page ) const
|
ChangePage(m_nSelection, nPage);
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
wxNotebookPage* wxNotebook::GetNotebookPage(int page) const
|
// TODO
|
||||||
{
|
return 0;
|
||||||
return NULL;
|
}
|
||||||
};
|
|
||||||
|
|
||||||
int wxNotebook::SetSelection( int page )
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxNotebook::AdvanceSelection(bool bForward)
|
void wxNotebook::AdvanceSelection(bool bForward)
|
||||||
{
|
{
|
||||||
|
int nSel = GetSelection();
|
||||||
|
int nMax = GetPageCount() - 1;
|
||||||
|
if ( bForward )
|
||||||
|
SetSelection(nSel == nMax ? 0 : nSel + 1);
|
||||||
|
else
|
||||||
|
SetSelection(nSel == 0 ? nMax : nSel - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxNotebook::SetImageList( wxImageList* imageList )
|
bool wxNotebook::SetPageText(int nPage, const wxString& strText)
|
||||||
{
|
{
|
||||||
m_imageList = imageList;
|
wxASSERT( IS_VALID_PAGE(nPage) );
|
||||||
};
|
|
||||||
|
|
||||||
bool wxNotebook::SetPageText( int page, const wxString &text )
|
// TODO
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxString wxNotebook::GetPageText(int nPage) const
|
||||||
{
|
{
|
||||||
return TRUE;
|
wxASSERT( IS_VALID_PAGE(nPage) );
|
||||||
};
|
|
||||||
|
|
||||||
bool wxNotebook::SetPageImage( int page, int image )
|
// TODO
|
||||||
|
return wxString("");
|
||||||
|
}
|
||||||
|
|
||||||
|
int wxNotebook::GetPageImage(int nPage) const
|
||||||
{
|
{
|
||||||
return TRUE;
|
wxASSERT( IS_VALID_PAGE(nPage) );
|
||||||
};
|
|
||||||
|
|
||||||
void wxNotebook::SetPageSize( const wxSize &WXUNUSED(size) )
|
// TODO
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxNotebook::SetPageImage(int nPage, int nImage)
|
||||||
{
|
{
|
||||||
};
|
wxASSERT( IS_VALID_PAGE(nPage) );
|
||||||
|
|
||||||
void wxNotebook::SetPadding( const wxSize &WXUNUSED(padding) )
|
// TODO
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxNotebook::SetImageList(wxImageList* imageList)
|
||||||
|
{
|
||||||
|
m_pImageList = imageList;
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// wxNotebook operations
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// remove one page from the notebook
|
||||||
|
bool wxNotebook::DeletePage(int nPage)
|
||||||
{
|
{
|
||||||
};
|
wxCHECK( IS_VALID_PAGE(nPage), FALSE );
|
||||||
|
|
||||||
|
// TODO: delete native widget page
|
||||||
|
|
||||||
|
delete m_aPages[nPage];
|
||||||
|
m_aPages.Remove(nPage);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// remove all pages
|
||||||
bool wxNotebook::DeleteAllPages()
|
bool wxNotebook::DeleteAllPages()
|
||||||
{
|
{
|
||||||
return TRUE;
|
// TODO: delete native widget pages
|
||||||
};
|
|
||||||
|
|
||||||
bool wxNotebook::DeletePage( int page )
|
int nPageCount = GetPageCount();
|
||||||
{
|
int nPage;
|
||||||
return TRUE;
|
for ( nPage = 0; nPage < nPageCount; nPage++ )
|
||||||
};
|
delete m_aPages[nPage];
|
||||||
|
|
||||||
bool wxNotebook::AddPage(wxWindow* win, const wxString& text,
|
m_aPages.Clear();
|
||||||
bool bSelect, int imageId)
|
|
||||||
{
|
|
||||||
return TRUE;
|
|
||||||
};
|
|
||||||
|
|
||||||
wxWindow *wxNotebook::GetPage( int page ) const
|
return TRUE;
|
||||||
{
|
}
|
||||||
return NULL;
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxNotebook::AddChild( wxWindow *win )
|
// add a page to the notebook
|
||||||
|
bool wxNotebook::AddPage(wxNotebookPage *pPage,
|
||||||
|
const wxString& strText,
|
||||||
|
bool bSelect,
|
||||||
|
int imageId)
|
||||||
{
|
{
|
||||||
};
|
return InsertPage(GetPageCount(), pPage, strText, bSelect, imageId);
|
||||||
|
}
|
||||||
|
|
||||||
|
// same as AddPage() but does it at given position
|
||||||
|
bool wxNotebook::InsertPage(int nPage,
|
||||||
|
wxNotebookPage *pPage,
|
||||||
|
const wxString& strText,
|
||||||
|
bool bSelect,
|
||||||
|
int imageId)
|
||||||
|
{
|
||||||
|
wxASSERT( pPage != NULL );
|
||||||
|
wxCHECK( IS_VALID_PAGE(nPage) || nPage == GetPageCount(), FALSE );
|
||||||
|
|
||||||
|
// TODO: insert native widget page
|
||||||
|
|
||||||
|
// save the pointer to the page
|
||||||
|
m_aPages.Insert(pPage, nPage);
|
||||||
|
|
||||||
|
// some page must be selected: either this one or the first one if there is
|
||||||
|
// still no selection
|
||||||
|
if ( bSelect )
|
||||||
|
m_nSelection = nPage;
|
||||||
|
else if ( m_nSelection == -1 )
|
||||||
|
m_nSelection = 0;
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// wxNotebook callbacks
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// @@@ OnSize() is used for setting the font when it's called for the first
|
||||||
|
// time because doing it in ::Create() doesn't work (for unknown reasons)
|
||||||
|
void wxNotebook::OnSize(wxSizeEvent& event)
|
||||||
|
{
|
||||||
|
static bool s_bFirstTime = TRUE;
|
||||||
|
if ( s_bFirstTime ) {
|
||||||
|
// TODO: any first-time-size processing.
|
||||||
|
s_bFirstTime = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: all this may or may not be necessary for your platform
|
||||||
|
|
||||||
|
// emulate page change (it's esp. important to do it first time because
|
||||||
|
// otherwise our page would stay invisible)
|
||||||
|
int nSel = m_nSelection;
|
||||||
|
m_nSelection = -1;
|
||||||
|
SetSelection(nSel);
|
||||||
|
|
||||||
|
// fit the notebook page to the tab control's display area
|
||||||
|
int w, hl
|
||||||
|
GetSize(&w, &h);
|
||||||
|
|
||||||
|
uint nCount = m_aPages.Count();
|
||||||
|
for ( uint nPage = 0; nPage < nCount; nPage++ ) {
|
||||||
|
wxNotebookPage *pPage = m_aPages[nPage];
|
||||||
|
pPage->SetSize(0, 0, w, h);
|
||||||
|
if ( pPage->GetAutoLayout() )
|
||||||
|
pPage->Layout();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Processing continues to next OnSize
|
||||||
|
event.Skip();
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxNotebook::OnSelChange(wxNotebookEvent& event)
|
||||||
|
{
|
||||||
|
// is it our tab control?
|
||||||
|
if ( event.GetEventObject() == this )
|
||||||
|
ChangePage(event.GetOldSelection(), event.GetSelection());
|
||||||
|
|
||||||
|
// we want to give others a chance to process this message as well
|
||||||
|
event.Skip();
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxNotebook::OnSetFocus(wxFocusEvent& event)
|
||||||
|
{
|
||||||
|
// set focus to the currently selected page if any
|
||||||
|
if ( m_nSelection != -1 )
|
||||||
|
m_aPages[m_nSelection]->SetFocus();
|
||||||
|
|
||||||
|
event.Skip();
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxNotebook::OnNavigationKey(wxNavigationKeyEvent& event)
|
||||||
|
{
|
||||||
|
if ( event.IsWindowChange() ) {
|
||||||
|
// change pages
|
||||||
|
AdvanceSelection(event.GetDirection());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// pass to the parent
|
||||||
|
if ( GetParent() ) {
|
||||||
|
event.SetCurrentFocus(this);
|
||||||
|
GetParent()->ProcessEvent(event);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// wxNotebook base class virtuals
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
// override these 2 functions to do nothing: everything is done in OnSize
|
// override these 2 functions to do nothing: everything is done in OnSize
|
||||||
void wxNotebook::SetConstraintSizes( bool WXUNUSED(recurse) )
|
|
||||||
|
void wxNotebook::SetConstraintSizes(bool /* recurse */)
|
||||||
{
|
{
|
||||||
// don't set the sizes of the pages - their correct size is not yet known
|
// don't set the sizes of the pages - their correct size is not yet known
|
||||||
wxControl::SetConstraintSizes(FALSE);
|
wxControl::SetConstraintSizes(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxNotebook::DoPhase( int WXUNUSED(nPhase) )
|
bool wxNotebook::DoPhase(int /* nPhase */)
|
||||||
{
|
{
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
void wxNotebook::Command(wxCommandEvent& event)
|
||||||
// wxNotebookEvent
|
{
|
||||||
//-----------------------------------------------------------------------------
|
wxFAIL_MSG("wxNotebook::Command not implemented");
|
||||||
|
}
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// wxNotebook helper functions
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// hide the currently active panel and show the new one
|
||||||
|
void wxNotebook::ChangePage(int nOldSel, int nSel)
|
||||||
|
{
|
||||||
|
wxASSERT( nOldSel != nSel ); // impossible
|
||||||
|
|
||||||
|
if ( nOldSel != -1 ) {
|
||||||
|
m_aPages[nOldSel]->Show(FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
wxNotebookPage *pPage = m_aPages[nSel];
|
||||||
|
pPage->Show(TRUE);
|
||||||
|
pPage->SetFocus();
|
||||||
|
|
||||||
|
m_nSelection = nSel;
|
||||||
|
}
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxNotebookEvent, wxCommandEvent)
|
|
||||||
|
|||||||
@@ -1,103 +1,91 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: palette.cpp
|
// Name: palette.cpp
|
||||||
// Purpose:
|
// Purpose: wxPalette
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma implementation "palette.h"
|
#pragma implementation "palette.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/palette.h"
|
#include "wx/palette.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
#if !USE_SHARED_LIBRARIES
|
||||||
// wxPalette
|
IMPLEMENT_DYNAMIC_CLASS(wxPalette, wxGDIObject)
|
||||||
//-----------------------------------------------------------------------------
|
#endif
|
||||||
|
|
||||||
class wxPaletteRefData: public wxObjectRefData
|
/*
|
||||||
|
* Palette
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
wxPaletteRefData::wxPaletteRefData()
|
||||||
{
|
{
|
||||||
public:
|
// TODO
|
||||||
|
}
|
||||||
wxPaletteRefData(void);
|
|
||||||
~wxPaletteRefData(void);
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
wxPaletteRefData::wxPaletteRefData(void)
|
wxPaletteRefData::~wxPaletteRefData()
|
||||||
{
|
{
|
||||||
};
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
wxPaletteRefData::~wxPaletteRefData(void)
|
wxPalette::wxPalette()
|
||||||
{
|
{
|
||||||
};
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
wxPalette::wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue)
|
||||||
|
|
||||||
#define M_PALETTEDATA ((wxPaletteRefData *)m_refData)
|
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxPalette,wxGDIObject)
|
|
||||||
|
|
||||||
wxPalette::wxPalette(void)
|
|
||||||
{
|
{
|
||||||
};
|
Create(n, red, green, blue);
|
||||||
|
}
|
||||||
|
|
||||||
wxPalette::wxPalette( int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue )
|
wxPalette::~wxPalette()
|
||||||
{
|
{
|
||||||
m_refData = new wxPaletteRefData();
|
}
|
||||||
Create( n, red, green, blue );
|
|
||||||
};
|
|
||||||
|
|
||||||
wxPalette::wxPalette( const wxPalette& palette )
|
bool wxPalette::FreeResource(bool force)
|
||||||
{
|
{
|
||||||
Ref( palette );
|
if ( M_PALETTEDATA && M_PALETTEDATA->m_hPalette)
|
||||||
};
|
{
|
||||||
|
DeleteObject((HPALETTE)M_PALETTEDATA->m_hPalette);
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
wxPalette::wxPalette( const wxPalette* palette )
|
bool wxPalette::Create(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue)
|
||||||
{
|
{
|
||||||
UnRef();
|
UnRef();
|
||||||
if (palette) Ref( *palette );
|
|
||||||
};
|
|
||||||
|
|
||||||
wxPalette::~wxPalette(void)
|
m_refData = new wxPaletteRefData;
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
int wxPalette::GetPixel(const unsigned char red, const unsigned char green, const unsigned char blue) const
|
||||||
{
|
{
|
||||||
};
|
if ( !m_refData )
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
wxPalette& wxPalette::operator = ( const wxPalette& palette )
|
// TODO
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxPalette::GetRGB(int index, unsigned char *red, unsigned char *green, unsigned char *blue) const
|
||||||
{
|
{
|
||||||
if (*this == palette) return (*this);
|
if ( !m_refData )
|
||||||
Ref( palette );
|
return FALSE;
|
||||||
return *this;
|
|
||||||
};
|
|
||||||
|
|
||||||
bool wxPalette::operator == ( const wxPalette& palette )
|
if (index < 0 || index > 255)
|
||||||
{
|
return FALSE;
|
||||||
return m_refData == palette.m_refData;
|
|
||||||
};
|
|
||||||
|
|
||||||
bool wxPalette::operator != ( const wxPalette& palette )
|
// TODO
|
||||||
{
|
return FALSE;
|
||||||
return m_refData != palette.m_refData;
|
}
|
||||||
};
|
|
||||||
|
|
||||||
bool wxPalette::Ok(void) const
|
|
||||||
{
|
|
||||||
return (m_refData);
|
|
||||||
};
|
|
||||||
|
|
||||||
bool wxPalette::Create( int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue)
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
int wxPalette::GetPixel( const unsigned char red, const unsigned char green, const unsigned char blue ) const
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
bool wxPalette::GetRGB( int pixel, unsigned char *red, unsigned char *green, unsigned char *blue ) const
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|||||||
365
src/qt/pen.cpp
365
src/qt/pen.cpp
@@ -1,204 +1,229 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: pen.cpp
|
// Name: pen.cpp
|
||||||
// Purpose:
|
// Purpose: wxPen
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma implementation "pen.h"
|
#pragma implementation "pen.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "wx/setup.h"
|
||||||
|
#include "wx/utils.h"
|
||||||
#include "wx/pen.h"
|
#include "wx/pen.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
#if !USE_SHARED_LIBRARIES
|
||||||
// wxPen
|
IMPLEMENT_DYNAMIC_CLASS(wxPen, wxGDIObject)
|
||||||
//-----------------------------------------------------------------------------
|
#endif
|
||||||
|
|
||||||
class wxPenRefData: public wxObjectRefData
|
wxPenRefData::wxPenRefData()
|
||||||
{
|
{
|
||||||
public:
|
m_style = wxSOLID;
|
||||||
|
m_width = 1;
|
||||||
|
m_join = wxJOIN_ROUND ;
|
||||||
|
m_cap = wxCAP_ROUND ;
|
||||||
|
m_nbDash = 0 ;
|
||||||
|
m_dash = 0 ;
|
||||||
|
/* TODO: null data
|
||||||
|
m_hPen = 0;
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
wxPenRefData::wxPenRefData(const wxPenRefData& data)
|
||||||
|
{
|
||||||
|
m_style = data.m_style;
|
||||||
|
m_width = data.m_width;
|
||||||
|
m_join = data.m_join;
|
||||||
|
m_cap = data.m_cap;
|
||||||
|
m_nbDash = data.m_nbDash;
|
||||||
|
m_dash = data.m_dash;
|
||||||
|
m_colour = data.m_colour;
|
||||||
|
/* TODO: null data
|
||||||
|
m_hPen = 0;
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
wxPenRefData::~wxPenRefData()
|
||||||
|
{
|
||||||
|
// TODO: delete data
|
||||||
|
}
|
||||||
|
|
||||||
|
// Pens
|
||||||
|
|
||||||
|
wxPen::wxPen()
|
||||||
|
{
|
||||||
|
if ( wxThePenList )
|
||||||
|
wxThePenList->AddPen(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
wxPen::~wxPen()
|
||||||
|
{
|
||||||
|
if (wxThePenList)
|
||||||
|
wxThePenList->RemovePen(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Should implement Create
|
||||||
|
wxPen::wxPen(const wxColour& col, int Width, int Style)
|
||||||
|
{
|
||||||
|
m_refData = new wxPenRefData;
|
||||||
|
|
||||||
|
M_PENDATA->m_colour = col;
|
||||||
|
M_PENDATA->m_width = Width;
|
||||||
|
M_PENDATA->m_style = Style;
|
||||||
|
M_PENDATA->m_join = wxJOIN_ROUND ;
|
||||||
|
M_PENDATA->m_cap = wxCAP_ROUND ;
|
||||||
|
M_PENDATA->m_nbDash = 0 ;
|
||||||
|
M_PENDATA->m_dash = 0 ;
|
||||||
|
|
||||||
|
RealizeResource();
|
||||||
|
|
||||||
|
if ( wxThePenList )
|
||||||
|
wxThePenList->AddPen(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
wxPen::wxPen(const wxBitmap& stipple, int Width)
|
||||||
|
{
|
||||||
|
m_refData = new wxPenRefData;
|
||||||
|
|
||||||
|
M_PENDATA->m_stipple = stipple;
|
||||||
|
M_PENDATA->m_width = Width;
|
||||||
|
M_PENDATA->m_style = wxSTIPPLE;
|
||||||
|
M_PENDATA->m_join = wxJOIN_ROUND ;
|
||||||
|
M_PENDATA->m_cap = wxCAP_ROUND ;
|
||||||
|
M_PENDATA->m_nbDash = 0 ;
|
||||||
|
M_PENDATA->m_dash = 0 ;
|
||||||
|
|
||||||
|
RealizeResource();
|
||||||
|
|
||||||
|
if ( wxThePenList )
|
||||||
|
wxThePenList->AddPen(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
wxPen::wxPen(const wxString& col, int Width, int Style)
|
||||||
|
{
|
||||||
|
m_refData = new wxPenRefData;
|
||||||
|
|
||||||
|
M_PENDATA->m_colour = col;
|
||||||
|
M_PENDATA->m_width = Width;
|
||||||
|
M_PENDATA->m_style = Style;
|
||||||
|
M_PENDATA->m_join = wxJOIN_ROUND ;
|
||||||
|
M_PENDATA->m_cap = wxCAP_ROUND ;
|
||||||
|
M_PENDATA->m_nbDash = 0 ;
|
||||||
|
M_PENDATA->m_dash = 0 ;
|
||||||
|
|
||||||
|
RealizeResource();
|
||||||
|
|
||||||
|
if ( wxThePenList )
|
||||||
|
wxThePenList->AddPen(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxPen::Unshare()
|
||||||
|
{
|
||||||
|
// Don't change shared data
|
||||||
|
if (!m_refData)
|
||||||
|
{
|
||||||
|
m_refData = new wxPenRefData();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
wxPenRefData* ref = new wxPenRefData(*(wxPenRefData*)m_refData);
|
||||||
|
UnRef();
|
||||||
|
m_refData = ref;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxPen::SetColour(const wxColour& col)
|
||||||
|
{
|
||||||
|
Unshare();
|
||||||
|
|
||||||
|
M_PENDATA->m_colour = col;
|
||||||
|
|
||||||
wxPenRefData(void);
|
RealizeResource();
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxPen::SetColour(const wxString& col)
|
||||||
|
{
|
||||||
|
Unshare();
|
||||||
|
|
||||||
|
M_PENDATA->m_colour = col;
|
||||||
|
|
||||||
int m_width;
|
RealizeResource();
|
||||||
int m_style;
|
}
|
||||||
int m_joinStyle;
|
|
||||||
int m_capStyle;
|
|
||||||
wxColour m_colour;
|
|
||||||
};
|
|
||||||
|
|
||||||
wxPenRefData::wxPenRefData(void)
|
void wxPen::SetColour(const unsigned char r, const unsigned char g, const unsigned char b)
|
||||||
{
|
{
|
||||||
m_width = 1;
|
Unshare();
|
||||||
m_style = wxSOLID;
|
|
||||||
m_joinStyle = wxJOIN_ROUND;
|
|
||||||
m_capStyle = wxCAP_ROUND;
|
|
||||||
};
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
M_PENDATA->m_colour.Set(r, g, b);
|
||||||
|
|
||||||
|
RealizeResource();
|
||||||
|
}
|
||||||
|
|
||||||
#define M_PENDATA ((wxPenRefData *)m_refData)
|
void wxPen::SetWidth(int Width)
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxPen,wxGDIObject)
|
|
||||||
|
|
||||||
wxPen::wxPen(void)
|
|
||||||
{
|
{
|
||||||
if (wxThePenList) wxThePenList->AddPen( this );
|
Unshare();
|
||||||
};
|
|
||||||
|
|
||||||
wxPen::wxPen( const wxColour &colour, int width, int style )
|
M_PENDATA->m_width = Width;
|
||||||
|
|
||||||
|
RealizeResource();
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxPen::SetStyle(int Style)
|
||||||
{
|
{
|
||||||
m_refData = new wxPenRefData();
|
Unshare();
|
||||||
M_PENDATA->m_width = width;
|
|
||||||
M_PENDATA->m_style = style;
|
|
||||||
M_PENDATA->m_colour = colour;
|
|
||||||
if (wxThePenList) wxThePenList->AddPen( this );
|
|
||||||
};
|
|
||||||
|
|
||||||
wxPen::wxPen( const wxString &colourName, int width, int style )
|
M_PENDATA->m_style = Style;
|
||||||
|
|
||||||
|
RealizeResource();
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxPen::SetStipple(const wxBitmap& Stipple)
|
||||||
{
|
{
|
||||||
m_refData = new wxPenRefData();
|
Unshare();
|
||||||
M_PENDATA->m_width = width;
|
|
||||||
M_PENDATA->m_style = style;
|
|
||||||
M_PENDATA->m_colour = colourName;
|
|
||||||
if (wxThePenList) wxThePenList->AddPen( this );
|
|
||||||
};
|
|
||||||
|
|
||||||
wxPen::wxPen( const wxPen& pen )
|
M_PENDATA->m_stipple = Stipple;
|
||||||
|
M_PENDATA->m_style = wxSTIPPLE;
|
||||||
|
|
||||||
|
RealizeResource();
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxPen::SetDashes(int nb_dashes, const wxDash *Dash)
|
||||||
{
|
{
|
||||||
Ref( pen );
|
Unshare();
|
||||||
if (wxThePenList) wxThePenList->AddPen( this );
|
|
||||||
};
|
|
||||||
|
|
||||||
wxPen::wxPen( const wxPen* pen )
|
M_PENDATA->m_nbDash = nb_dashes;
|
||||||
|
M_PENDATA->m_dash = (wxDash *)Dash;
|
||||||
|
|
||||||
|
RealizeResource();
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxPen::SetJoin(int Join)
|
||||||
{
|
{
|
||||||
UnRef();
|
Unshare();
|
||||||
if (pen) Ref( *pen );
|
|
||||||
if (wxThePenList) wxThePenList->AddPen( this );
|
|
||||||
};
|
|
||||||
|
|
||||||
wxPen::~wxPen(void)
|
M_PENDATA->m_join = Join;
|
||||||
|
|
||||||
|
RealizeResource();
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxPen::SetCap(int Cap)
|
||||||
{
|
{
|
||||||
if (wxThePenList) wxThePenList->RemovePen( this );
|
Unshare();
|
||||||
};
|
|
||||||
|
|
||||||
wxPen& wxPen::operator = ( const wxPen& pen )
|
M_PENDATA->m_cap = Cap;
|
||||||
|
|
||||||
|
RealizeResource();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxPen::RealizeResource()
|
||||||
{
|
{
|
||||||
if (*this == pen) return (*this);
|
// TODO: create actual pen
|
||||||
Ref( pen );
|
return FALSE;
|
||||||
return *this;
|
}
|
||||||
};
|
|
||||||
|
|
||||||
bool wxPen::operator == ( const wxPen& pen )
|
|
||||||
{
|
|
||||||
return m_refData == pen.m_refData;
|
|
||||||
};
|
|
||||||
|
|
||||||
bool wxPen::operator != ( const wxPen& pen )
|
|
||||||
{
|
|
||||||
return m_refData != pen.m_refData;
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxPen::SetColour( const wxColour &colour )
|
|
||||||
{
|
|
||||||
if (!m_refData)
|
|
||||||
m_refData = new wxPenRefData();
|
|
||||||
|
|
||||||
M_PENDATA->m_colour = colour;
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxPen::SetColour( const wxString &colourName )
|
|
||||||
{
|
|
||||||
if (!m_refData)
|
|
||||||
m_refData = new wxPenRefData();
|
|
||||||
|
|
||||||
M_PENDATA->m_colour = colourName;
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxPen::SetColour( int red, int green, int blue )
|
|
||||||
{
|
|
||||||
if (!m_refData)
|
|
||||||
m_refData = new wxPenRefData();
|
|
||||||
|
|
||||||
M_PENDATA->m_colour.Set( red, green, blue );
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxPen::SetCap( int capStyle )
|
|
||||||
{
|
|
||||||
if (!m_refData)
|
|
||||||
m_refData = new wxPenRefData();
|
|
||||||
|
|
||||||
M_PENDATA->m_capStyle = capStyle;
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxPen::SetJoin( int joinStyle )
|
|
||||||
{
|
|
||||||
if (!m_refData)
|
|
||||||
m_refData = new wxPenRefData();
|
|
||||||
|
|
||||||
M_PENDATA->m_joinStyle = joinStyle;
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxPen::SetStyle( int style )
|
|
||||||
{
|
|
||||||
if (!m_refData)
|
|
||||||
m_refData = new wxPenRefData();
|
|
||||||
|
|
||||||
M_PENDATA->m_style = style;
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxPen::SetWidth( int width )
|
|
||||||
{
|
|
||||||
if (!m_refData)
|
|
||||||
m_refData = new wxPenRefData();
|
|
||||||
|
|
||||||
M_PENDATA->m_width = width;
|
|
||||||
};
|
|
||||||
|
|
||||||
int wxPen::GetCap(void) const
|
|
||||||
{
|
|
||||||
return M_PENDATA->m_capStyle;
|
|
||||||
};
|
|
||||||
|
|
||||||
int wxPen::GetJoin(void) const
|
|
||||||
{
|
|
||||||
if (!m_refData)
|
|
||||||
return 0;
|
|
||||||
else
|
|
||||||
return M_PENDATA->m_joinStyle;
|
|
||||||
};
|
|
||||||
|
|
||||||
int wxPen::GetStyle(void) const
|
|
||||||
{
|
|
||||||
if (!m_refData)
|
|
||||||
return 0;
|
|
||||||
else
|
|
||||||
return M_PENDATA->m_style;
|
|
||||||
};
|
|
||||||
|
|
||||||
int wxPen::GetWidth(void) const
|
|
||||||
{
|
|
||||||
if (!m_refData)
|
|
||||||
return 0;
|
|
||||||
else
|
|
||||||
return M_PENDATA->m_width;
|
|
||||||
};
|
|
||||||
|
|
||||||
wxColour &wxPen::GetColour(void) const
|
|
||||||
{
|
|
||||||
if (!m_refData)
|
|
||||||
return wxNullColour;
|
|
||||||
else
|
|
||||||
return M_PENDATA->m_colour;
|
|
||||||
};
|
|
||||||
|
|
||||||
bool wxPen::Ok(void) const
|
|
||||||
{
|
|
||||||
return (m_refData);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,133 +1,194 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: radiobox.cpp
|
// Name: radiobox.cpp
|
||||||
// Purpose:
|
// Purpose: wxRadioBox
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma implementation "radiobox.h"
|
#pragma implementation "radiobox.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/radiobox.h"
|
#include "wx/radiobox.h"
|
||||||
#include "wx/dialog.h"
|
|
||||||
#include "wx/frame.h"
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
#if !USE_SHARED_LIBRARY
|
||||||
// data
|
IMPLEMENT_DYNAMIC_CLASS(wxRadioBox, wxControl)
|
||||||
//-----------------------------------------------------------------------------
|
#endif
|
||||||
|
|
||||||
extern bool g_blockEventsOnDrag;
|
// Radio box item
|
||||||
|
wxRadioBox::wxRadioBox()
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxRadioBox,wxControl)
|
|
||||||
|
|
||||||
wxRadioBox::wxRadioBox(void)
|
|
||||||
{
|
{
|
||||||
};
|
m_selectedButton = -1;
|
||||||
|
m_noItems = 0;
|
||||||
|
m_noRowsOrCols = 0;
|
||||||
|
m_majorDim = 0 ;
|
||||||
|
}
|
||||||
|
|
||||||
wxRadioBox::wxRadioBox( wxWindow *parent, wxWindowID id, const wxString& title,
|
bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& title,
|
||||||
const wxPoint &pos, const wxSize &size,
|
const wxPoint& pos, const wxSize& size,
|
||||||
int n, const wxString choices[],
|
int n, const wxString choices[],
|
||||||
int majorDim, long style,
|
int majorDim, long style,
|
||||||
const wxString &name )
|
const wxValidator& val, const wxString& name)
|
||||||
{
|
{
|
||||||
Create( parent, id, title, pos, size, n, choices, majorDim, style, name );
|
m_selectedButton = -1;
|
||||||
};
|
m_noItems = n;
|
||||||
|
|
||||||
bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title,
|
SetName(name);
|
||||||
const wxPoint &pos, const wxSize &size,
|
SetValidator(val);
|
||||||
int n, const wxString choices[],
|
|
||||||
int WXUNUSED(majorDim), long style,
|
parent->AddChild(this);
|
||||||
const wxString &name )
|
|
||||||
|
m_windowStyle = (long&)style;
|
||||||
|
|
||||||
|
if (id == -1)
|
||||||
|
m_windowId = NewControlId();
|
||||||
|
else
|
||||||
|
m_windowId = id;
|
||||||
|
|
||||||
|
m_noRowsOrCols = majorDim;
|
||||||
|
|
||||||
|
if (majorDim==0)
|
||||||
|
m_majorDim = n ;
|
||||||
|
else
|
||||||
|
m_majorDim = majorDim ;
|
||||||
|
|
||||||
|
|
||||||
|
// TODO create radiobox
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
wxRadioBox::~wxRadioBox()
|
||||||
{
|
{
|
||||||
return TRUE;
|
// TODO
|
||||||
};
|
}
|
||||||
|
|
||||||
bool wxRadioBox::Show( bool show )
|
wxString wxRadioBox::GetLabel(int item) const
|
||||||
{
|
{
|
||||||
wxWindow::Show( show );
|
// TODO
|
||||||
return TRUE;
|
return wxString("");
|
||||||
};
|
}
|
||||||
|
|
||||||
int wxRadioBox::FindString( const wxString &s ) const
|
void wxRadioBox::SetLabel(int item, const wxString& label)
|
||||||
{
|
{
|
||||||
return -1;
|
// TODO
|
||||||
};
|
}
|
||||||
|
|
||||||
void wxRadioBox::SetSelection( int n )
|
int wxRadioBox::FindString(const wxString& s) const
|
||||||
{
|
{
|
||||||
};
|
// TODO
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
int wxRadioBox::GetSelection(void) const
|
void wxRadioBox::SetSelection(int n)
|
||||||
{
|
{
|
||||||
return -1;
|
if ((n < 0) || (n >= m_noItems))
|
||||||
};
|
return;
|
||||||
|
// TODO
|
||||||
|
|
||||||
wxString wxRadioBox::GetString( int n ) const
|
m_selectedButton = n;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get single selection, for single choice list items
|
||||||
|
int wxRadioBox::GetSelection() const
|
||||||
{
|
{
|
||||||
};
|
return m_selectedButton;
|
||||||
|
}
|
||||||
|
|
||||||
wxString wxRadioBox::GetLabel(void) const
|
// Find string for position
|
||||||
|
wxString wxRadioBox::GetString(int n) const
|
||||||
{
|
{
|
||||||
return wxControl::GetLabel();
|
// TODO
|
||||||
};
|
return wxString("");
|
||||||
|
}
|
||||||
|
|
||||||
void wxRadioBox::SetLabel( const wxString& WXUNUSED(label) )
|
void wxRadioBox::SetSize(int x, int y, int width, int height, int sizeFlags)
|
||||||
{
|
{
|
||||||
};
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
void wxRadioBox::SetLabel( int WXUNUSED(item), const wxString& WXUNUSED(label) )
|
void wxRadioBox::GetSize(int *width, int *height) const
|
||||||
{
|
{
|
||||||
};
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
void wxRadioBox::SetLabel( int WXUNUSED(item), wxBitmap *WXUNUSED(bitmap) )
|
void wxRadioBox::GetPosition(int *x, int *y) const
|
||||||
{
|
{
|
||||||
};
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
wxString wxRadioBox::GetLabel( int WXUNUSED(item) ) const
|
wxString wxRadioBox::GetLabel() const
|
||||||
{
|
{
|
||||||
return "";
|
// TODO
|
||||||
};
|
return wxString("");
|
||||||
|
}
|
||||||
|
|
||||||
void wxRadioBox::Enable( bool WXUNUSED(enable) )
|
void wxRadioBox::SetLabel(const wxString& label)
|
||||||
{
|
{
|
||||||
};
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
void wxRadioBox::Enable( int WXUNUSED(item), bool WXUNUSED(enable) )
|
void wxRadioBox::SetFocus()
|
||||||
{
|
{
|
||||||
};
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
void wxRadioBox::Show( int WXUNUSED(item), bool WXUNUSED(show) )
|
bool wxRadioBox::Show(bool show)
|
||||||
{
|
{
|
||||||
};
|
// TODO
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
wxString wxRadioBox::GetStringSelection(void) const
|
// Enable a specific button
|
||||||
|
void wxRadioBox::Enable(int item, bool enable)
|
||||||
{
|
{
|
||||||
return "";
|
// TODO
|
||||||
};
|
}
|
||||||
|
|
||||||
bool wxRadioBox::SetStringSelection( const wxString&s )
|
// Enable all controls
|
||||||
|
void wxRadioBox::Enable(bool enable)
|
||||||
{
|
{
|
||||||
return TRUE;
|
wxControl::Enable(enable);
|
||||||
};
|
|
||||||
|
|
||||||
int wxRadioBox::Number(void) const
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
// Show a specific button
|
||||||
|
void wxRadioBox::Show(int item, bool show)
|
||||||
{
|
{
|
||||||
return 0;
|
// TODO
|
||||||
};
|
}
|
||||||
|
|
||||||
int wxRadioBox::GetNumberOfRowsOrCols(void) const
|
// For single selection items only
|
||||||
|
wxString wxRadioBox::GetStringSelection () const
|
||||||
{
|
{
|
||||||
return 1;
|
int sel = GetSelection ();
|
||||||
};
|
if (sel > -1)
|
||||||
|
return this->GetString (sel);
|
||||||
|
else
|
||||||
|
return wxString("");
|
||||||
|
}
|
||||||
|
|
||||||
void wxRadioBox::SetNumberOfRowsOrCols( int WXUNUSED(n) )
|
bool wxRadioBox::SetStringSelection (const wxString& s)
|
||||||
{
|
{
|
||||||
};
|
int sel = FindString (s);
|
||||||
|
if (sel > -1)
|
||||||
|
{
|
||||||
|
SetSelection (sel);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxRadioBox::Command (wxCommandEvent & event)
|
||||||
|
{
|
||||||
|
SetSelection (event.m_commandInt);
|
||||||
|
ProcessCommand (event);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,17 +1,68 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: radiobut.cpp
|
// Name: radiobut.cpp
|
||||||
// Purpose:
|
// Purpose: wxRadioButton
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma implementation "radiobut.h"
|
#pragma implementation "radiobut.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/radiobut.h"
|
#include "wx/radiobut.h"
|
||||||
|
|
||||||
|
#if !USE_SHARED_LIBRARY
|
||||||
|
IMPLEMENT_DYNAMIC_CLASS(wxRadioButton, wxControl)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
bool wxRadioButton::Create(wxWindow *parent, wxWindowID id,
|
||||||
|
const wxString& label,
|
||||||
|
const wxPoint& pos,
|
||||||
|
const wxSize& size, long style,
|
||||||
|
const wxValidator& validator,
|
||||||
|
const wxString& name)
|
||||||
|
{
|
||||||
|
SetName(name);
|
||||||
|
SetValidator(validator);
|
||||||
|
|
||||||
|
if (parent) parent->AddChild(this);
|
||||||
|
|
||||||
|
if ( id == -1 )
|
||||||
|
m_windowId = (int)NewControlId();
|
||||||
|
else
|
||||||
|
m_windowId = id;
|
||||||
|
|
||||||
|
m_windowStyle = style ;
|
||||||
|
|
||||||
|
// TODO create radiobutton
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxRadioButton::SetLabel(const wxString& label)
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxRadioButton::SetValue(bool value)
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get single selection, for single choice list items
|
||||||
|
bool wxRadioButton::GetValue() const
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxRadioButton::Command (wxCommandEvent & event)
|
||||||
|
{
|
||||||
|
SetValue ( (event.m_commandInt != 0) );
|
||||||
|
ProcessCommand (event);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,163 +1,373 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: region.cpp
|
// File: region.cpp
|
||||||
// Purpose:
|
// Purpose: Region class
|
||||||
// Author: Robert Roebling
|
// Author: Markus Holzem/Julian Smart/AUTHOR
|
||||||
// Created: 01/02/98
|
// Created: Fri Oct 24 10:46:34 MET 1997
|
||||||
// Id:
|
// RCS-ID: $Id$
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// Copyright: (c) 1997 Markus Holzem/Julian Smart/AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma implementation "region.h"
|
#pragma implementation "region.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/region.h"
|
#include "wx/wxprec.h"
|
||||||
|
|
||||||
|
#ifdef __BORLANDC__
|
||||||
|
#pragma hdrstop
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "wx/msw/region.h"
|
||||||
|
#include "wx/gdicmn.h"
|
||||||
|
|
||||||
|
#include <windows.h>
|
||||||
|
|
||||||
|
#if !USE_SHARED_LIBRARY
|
||||||
|
IMPLEMENT_DYNAMIC_CLASS(wxRegion, wxGDIObject)
|
||||||
|
IMPLEMENT_DYNAMIC_CLASS(wxRegionIterator, wxObject)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// wxRegionRefData implementation
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class WXDLLEXPORT wxRegionRefData : public wxGDIRefData {
|
||||||
|
public:
|
||||||
|
wxRegionRefData()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
wxRegionRefData(const wxRegionRefData& data)
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
~wxRegionRefData()
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
HRGN m_region;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// wxRegion
|
// wxRegion
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
class wxRegionRefData: public wxObjectRefData
|
/*!
|
||||||
|
* Create an empty region.
|
||||||
|
*/
|
||||||
|
wxRegion::wxRegion()
|
||||||
{
|
{
|
||||||
public:
|
m_refData = new wxRegionRefData;
|
||||||
|
// TODO create empty region
|
||||||
wxRegionRefData(void);
|
}
|
||||||
~wxRegionRefData(void);
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
};
|
wxRegion::wxRegion(long x, long y, long w, long h)
|
||||||
|
|
||||||
wxRegionRefData::wxRegionRefData(void)
|
|
||||||
{
|
{
|
||||||
};
|
m_refData = new wxRegionRefData;
|
||||||
|
// TODO create rect region
|
||||||
|
}
|
||||||
|
|
||||||
wxRegionRefData::~wxRegionRefData(void)
|
wxRegion::wxRegion(const wxPoint& topLeft, const wxPoint& bottomRight)
|
||||||
{
|
{
|
||||||
};
|
m_refData = new wxRegionRefData;
|
||||||
|
// TODO create rect region
|
||||||
|
}
|
||||||
|
|
||||||
|
wxRegion::wxRegion(const wxRect& rect)
|
||||||
|
{
|
||||||
|
m_refData = new wxRegionRefData;
|
||||||
|
// TODO create rect region
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* Destroy the region.
|
||||||
|
*/
|
||||||
|
wxRegion::~wxRegion()
|
||||||
|
{
|
||||||
|
// m_refData unrefed in ~wxObject
|
||||||
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
//# Modify region
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
#define M_REGIONDATA ((wxRegionRefData *)m_refData)
|
//! Clear current region
|
||||||
|
void wxRegion::Clear()
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxRegion,wxGDIObject);
|
|
||||||
|
|
||||||
wxRegion::wxRegion( long x, long y, long w, long h )
|
|
||||||
{
|
{
|
||||||
m_refData = new wxRegionRefData();
|
UnRef();
|
||||||
};
|
}
|
||||||
|
|
||||||
wxRegion::wxRegion( const wxPoint& topLeft, const wxPoint& bottomRight )
|
//! Combine rectangle (x, y, w, h) with this.
|
||||||
|
bool wxRegion::Combine(long x, long y, long width, long height, wxRegionOp op)
|
||||||
{
|
{
|
||||||
m_refData = new wxRegionRefData();
|
// Don't change shared data
|
||||||
};
|
if (!m_refData) {
|
||||||
|
m_refData = new wxRegionRefData();
|
||||||
|
} else if (m_refData->GetRefCount() > 1) {
|
||||||
|
wxRegionRefData* ref = (wxRegionRefData*)m_refData;
|
||||||
|
UnRef();
|
||||||
|
m_refData = new wxRegionRefData(*ref);
|
||||||
|
}
|
||||||
|
// If ref count is 1, that means it's 'ours' anyway so no action.
|
||||||
|
|
||||||
wxRegion::wxRegion( const wxRect& rect )
|
// TODO create rect region
|
||||||
|
|
||||||
|
int mode = 0; // TODO platform-specific code
|
||||||
|
switch (op)
|
||||||
|
{
|
||||||
|
case wxRGN_AND:
|
||||||
|
// TODO
|
||||||
|
break ;
|
||||||
|
case wxRGN_OR:
|
||||||
|
// TODO
|
||||||
|
break ;
|
||||||
|
case wxRGN_XOR:
|
||||||
|
// TODO
|
||||||
|
break ;
|
||||||
|
case wxRGN_DIFF:
|
||||||
|
// TODO
|
||||||
|
break ;
|
||||||
|
case wxRGN_COPY:
|
||||||
|
default:
|
||||||
|
// TODO
|
||||||
|
break ;
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO do combine region
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
//! Union /e region with this.
|
||||||
|
bool wxRegion::Combine(const wxRegion& region, wxRegionOp op)
|
||||||
{
|
{
|
||||||
m_refData = new wxRegionRefData();
|
if (region.Empty())
|
||||||
};
|
return FALSE;
|
||||||
|
|
||||||
wxRegion::wxRegion(void)
|
// Don't change shared data
|
||||||
|
if (!m_refData) {
|
||||||
|
m_refData = new wxRegionRefData();
|
||||||
|
} else if (m_refData->GetRefCount() > 1) {
|
||||||
|
wxRegionRefData* ref = (wxRegionRefData*)m_refData;
|
||||||
|
UnRef();
|
||||||
|
m_refData = new wxRegionRefData(*ref);
|
||||||
|
}
|
||||||
|
|
||||||
|
int mode = 0; // TODO platform-specific code
|
||||||
|
switch (op)
|
||||||
|
{
|
||||||
|
case wxRGN_AND:
|
||||||
|
// TODO
|
||||||
|
break ;
|
||||||
|
case wxRGN_OR:
|
||||||
|
// TODO
|
||||||
|
break ;
|
||||||
|
case wxRGN_XOR:
|
||||||
|
// TODO
|
||||||
|
break ;
|
||||||
|
case wxRGN_DIFF:
|
||||||
|
// TODO
|
||||||
|
break ;
|
||||||
|
case wxRGN_COPY:
|
||||||
|
default:
|
||||||
|
// TODO
|
||||||
|
break ;
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO combine region
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxRegion::Combine(const wxRect& rect, wxRegionOp op)
|
||||||
{
|
{
|
||||||
m_refData = new wxRegionRefData();
|
return Combine(rect.GetLeft(), rect.GetTop(), rect.GetWidth(), rect.GetHeight(), op);
|
||||||
};
|
}
|
||||||
|
|
||||||
wxRegion::~wxRegion(void)
|
//-----------------------------------------------------------------------------
|
||||||
|
//# Information on region
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// Outer bounds of region
|
||||||
|
void wxRegion::GetBox(long& x, long& y, long&w, long &h) const
|
||||||
{
|
{
|
||||||
};
|
if (m_refData) {
|
||||||
|
// TODO get box
|
||||||
|
} else {
|
||||||
|
x = y = w = h = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void wxRegion::Clear(void)
|
wxRect wxRegion::GetBox() const
|
||||||
{
|
{
|
||||||
UnRef();
|
long x, y, w, h;
|
||||||
m_refData = new wxRegionRefData();
|
GetBox(x, y, w, h);
|
||||||
};
|
return wxRect(x, y, w, h);
|
||||||
|
}
|
||||||
|
|
||||||
bool wxRegion::Union( long x, long y, long width, long height )
|
// Is region empty?
|
||||||
|
bool wxRegion::Empty() const
|
||||||
{
|
{
|
||||||
return TRUE;
|
// TODO
|
||||||
};
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
bool wxRegion::Union( const wxRect& rect )
|
//-----------------------------------------------------------------------------
|
||||||
|
//# Tests
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// Does the region contain the point (x,y)?
|
||||||
|
wxRegionContain wxRegion::Contains(long x, long y) const
|
||||||
{
|
{
|
||||||
return TRUE;
|
if (!m_refData)
|
||||||
};
|
return wxOutRegion;
|
||||||
|
|
||||||
bool wxRegion::Union( const wxRegion& region )
|
// TODO. Return wxInRegion if within region.
|
||||||
|
if (0)
|
||||||
|
return wxInRegion;
|
||||||
|
return wxOutRegion;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Does the region contain the point pt?
|
||||||
|
wxRegionContain wxRegion::Contains(const wxPoint& pt) const
|
||||||
{
|
{
|
||||||
return TRUE;
|
if (!m_refData)
|
||||||
};
|
return wxOutRegion;
|
||||||
|
|
||||||
bool wxRegion::Intersect( long x, long y, long width, long height )
|
// TODO. Return wxInRegion if within region.
|
||||||
|
if (0)
|
||||||
|
return wxInRegion;
|
||||||
|
else
|
||||||
|
return wxOutRegion;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Does the region contain the rectangle (x, y, w, h)?
|
||||||
|
wxRegionContain wxRegion::Contains(long x, long y, long w, long h) const
|
||||||
{
|
{
|
||||||
return TRUE;
|
if (!m_refData)
|
||||||
};
|
return wxOutRegion;
|
||||||
|
|
||||||
bool wxRegion::Intersect( const wxRect& rect )
|
// TODO. Return wxInRegion if within region.
|
||||||
|
if (0)
|
||||||
|
return wxInRegion;
|
||||||
|
else
|
||||||
|
return wxOutRegion;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Does the region contain the rectangle rect
|
||||||
|
wxRegionContain wxRegion::Contains(const wxRect& rect) const
|
||||||
{
|
{
|
||||||
return TRUE;
|
if (!m_refData)
|
||||||
};
|
return wxOutRegion;
|
||||||
|
|
||||||
bool wxRegion::Intersect( const wxRegion& region )
|
long x, y, w, h;
|
||||||
|
x = rect.x;
|
||||||
|
y = rect.y;
|
||||||
|
w = rect.GetWidth();
|
||||||
|
h = rect.GetHeight();
|
||||||
|
return Contains(x, y, w, h);
|
||||||
|
}
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
// //
|
||||||
|
// wxRegionIterator //
|
||||||
|
// //
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* Initialize empty iterator
|
||||||
|
*/
|
||||||
|
wxRegionIterator::wxRegionIterator() : m_current(0), m_numRects(0), m_rects(NULL)
|
||||||
{
|
{
|
||||||
return TRUE;
|
}
|
||||||
};
|
|
||||||
|
|
||||||
bool wxRegion::Subtract( long x, long y, long width, long height )
|
wxRegionIterator::~wxRegionIterator()
|
||||||
{
|
{
|
||||||
return TRUE;
|
if (m_rects)
|
||||||
};
|
delete[] m_rects;
|
||||||
|
}
|
||||||
|
|
||||||
bool wxRegion::Subtract( const wxRect& rect )
|
/*!
|
||||||
|
* Initialize iterator for region
|
||||||
|
*/
|
||||||
|
wxRegionIterator::wxRegionIterator(const wxRegion& region)
|
||||||
{
|
{
|
||||||
return TRUE;
|
m_rects = NULL;
|
||||||
};
|
|
||||||
|
|
||||||
bool wxRegion::Subtract( const wxRegion& region )
|
Reset(region);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* Reset iterator for a new /e region.
|
||||||
|
*/
|
||||||
|
void wxRegionIterator::Reset(const wxRegion& region)
|
||||||
{
|
{
|
||||||
return TRUE;
|
m_current = 0;
|
||||||
};
|
m_region = region;
|
||||||
|
|
||||||
bool wxRegion::Xor( long x, long y, long width, long height )
|
if (m_rects)
|
||||||
|
delete[] m_rects;
|
||||||
|
|
||||||
|
m_rects = NULL;
|
||||||
|
|
||||||
|
if (m_region.Empty())
|
||||||
|
m_numRects = 0;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// TODO create m_rects and fill with rectangles for this region
|
||||||
|
m_numRects = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* Increment iterator. The rectangle returned is the one after the
|
||||||
|
* incrementation.
|
||||||
|
*/
|
||||||
|
void wxRegionIterator::operator ++ ()
|
||||||
{
|
{
|
||||||
return TRUE;
|
if (m_current < m_numRects)
|
||||||
};
|
++m_current;
|
||||||
|
}
|
||||||
|
|
||||||
bool wxRegion::Xor( const wxRect& rect )
|
/*!
|
||||||
|
* Increment iterator. The rectangle returned is the one before the
|
||||||
|
* incrementation.
|
||||||
|
*/
|
||||||
|
void wxRegionIterator::operator ++ (int)
|
||||||
{
|
{
|
||||||
return TRUE;
|
if (m_current < m_numRects)
|
||||||
};
|
++m_current;
|
||||||
|
}
|
||||||
|
|
||||||
bool wxRegion::Xor( const wxRegion& region )
|
long wxRegionIterator::GetX() const
|
||||||
{
|
{
|
||||||
return TRUE;
|
if (m_current < m_numRects)
|
||||||
};
|
return m_rects[m_current].x;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
void wxRegion::GetBox( long& x, long& y, long&w, long &h ) const
|
long wxRegionIterator::GetY() const
|
||||||
{
|
{
|
||||||
x = 0;
|
if (m_current < m_numRects)
|
||||||
y = 0;
|
return m_rects[m_current].y;
|
||||||
w = -1;
|
return 0;
|
||||||
h = -1;
|
}
|
||||||
};
|
|
||||||
|
|
||||||
wxRect wxRegion::GetBox(void) const
|
long wxRegionIterator::GetW() const
|
||||||
{
|
{
|
||||||
return wxRect( 0, 0, -1, -1 );
|
if (m_current < m_numRects)
|
||||||
};
|
return m_rects[m_current].width ;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
bool wxRegion::Empty(void) const
|
long wxRegionIterator::GetH() const
|
||||||
{
|
{
|
||||||
};
|
if (m_current < m_numRects)
|
||||||
|
return m_rects[m_current].height;
|
||||||
wxRegionContain wxRegion::Contains( long x, long y ) const
|
return 0;
|
||||||
{
|
}
|
||||||
return wxOutRegion;
|
|
||||||
};
|
|
||||||
|
|
||||||
wxRegionContain wxRegion::Contains( long x, long y, long w, long h ) const
|
|
||||||
{
|
|
||||||
return wxOutRegion;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,102 +1,78 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: scrolbar.cpp
|
// Name: scrolbar.cpp
|
||||||
// Purpose:
|
// Purpose: wxScrollBar
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma implementation "scrolbar.h"
|
#pragma implementation "scrolbar.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/scrolbar.h"
|
#include "wx/scrolbar.h"
|
||||||
#include "wx/utils.h"
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
#if !USE_SHARED_LIBRARY
|
||||||
// wxScrollBar
|
IMPLEMENT_DYNAMIC_CLASS(wxScrollBar, wxControl)
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxScrollBar,wxControl)
|
#endif
|
||||||
|
|
||||||
wxScrollBar::wxScrollBar(wxWindow *parent, wxWindowID id,
|
|
||||||
const wxPoint& pos, const wxSize& size,
|
|
||||||
long style, const wxString& name )
|
|
||||||
{
|
|
||||||
Create( parent, id, pos, size, style, name );
|
|
||||||
};
|
|
||||||
|
|
||||||
wxScrollBar::~wxScrollBar(void)
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
|
// Scrollbar
|
||||||
bool wxScrollBar::Create(wxWindow *parent, wxWindowID id,
|
bool wxScrollBar::Create(wxWindow *parent, wxWindowID id,
|
||||||
const wxPoint& pos, const wxSize& size,
|
const wxPoint& pos,
|
||||||
long style, const wxString& name )
|
const wxSize& size, long style,
|
||||||
|
const wxValidator& validator,
|
||||||
|
const wxString& name)
|
||||||
{
|
{
|
||||||
return TRUE;
|
if (!parent)
|
||||||
};
|
return FALSE;
|
||||||
|
parent->AddChild(this);
|
||||||
|
SetName(name);
|
||||||
|
SetValidator(validator);
|
||||||
|
|
||||||
|
m_windowStyle = style;
|
||||||
|
|
||||||
int wxScrollBar::GetPosition(void) const
|
if ( id == -1 )
|
||||||
|
m_windowId = (int)NewControlId();
|
||||||
|
else
|
||||||
|
m_windowId = id;
|
||||||
|
|
||||||
|
// TODO create scrollbar
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxScrollBar::~wxScrollBar()
|
||||||
{
|
{
|
||||||
};
|
}
|
||||||
|
|
||||||
int wxScrollBar::GetThumbSize() const
|
void wxScrollBar::SetPosition(int viewStart)
|
||||||
{
|
{
|
||||||
};
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
int wxScrollBar::GetPageSize() const
|
int wxScrollBar::GetPosition() const
|
||||||
{
|
{
|
||||||
};
|
// TODO
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int wxScrollBar::GetRange() const
|
void wxScrollBar::SetScrollbar(int position, int thumbSize, int range, int pageSize,
|
||||||
|
bool refresh)
|
||||||
{
|
{
|
||||||
};
|
m_viewSize = pageSize;
|
||||||
|
m_pageSize = thumbSize;
|
||||||
|
m_objectSize = range;
|
||||||
|
|
||||||
void wxScrollBar::SetPosition( int viewStart )
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void wxScrollBar::Command(wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
};
|
SetValue(event.m_commandInt);
|
||||||
|
ProcessCommand(event);
|
||||||
void wxScrollBar::SetScrollbar( int position, int thumbSize, int range, int pageSize,
|
}
|
||||||
bool WXUNUSED(refresh) )
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
// Backward compatibility
|
|
||||||
int wxScrollBar::GetValue(void) const
|
|
||||||
{
|
|
||||||
return GetPosition();
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxScrollBar::SetValue( int viewStart )
|
|
||||||
{
|
|
||||||
SetPosition( viewStart );
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxScrollBar::GetValues( int *viewStart, int *viewLength, int *objectLength, int *pageLength ) const
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
int wxScrollBar::GetViewLength() const
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
int wxScrollBar::GetObjectLength() const
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxScrollBar::SetPageSize( int pageLength )
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxScrollBar::SetObjectLength( int objectLength )
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxScrollBar::SetViewLength( int viewLength )
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,144 +1,151 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: settings.cpp
|
// Name: settings.cpp
|
||||||
// Purpose:
|
// Purpose: wxSettings
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma implementation "settings.h"
|
#pragma implementation "settings.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/settings.h"
|
#include "wx/settings.h"
|
||||||
|
|
||||||
/*
|
wxColour wxSystemSettings::GetSystemColour(int index)
|
||||||
#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_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
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define SHIFT (8*(sizeof(short int)-sizeof(char)))
|
|
||||||
|
|
||||||
wxColour *g_systemBtnFaceColour = NULL;
|
|
||||||
wxColour *g_systemBtnShadowColour = NULL;
|
|
||||||
wxColour *g_systemBtnHighlightColour = NULL;
|
|
||||||
wxColour *g_systemHighlightColour = NULL;
|
|
||||||
|
|
||||||
wxColour wxSystemSettings::GetSystemColour( int index )
|
|
||||||
{
|
{
|
||||||
switch (index)
|
// TODO
|
||||||
{
|
return col;
|
||||||
case wxSYS_COLOUR_SCROLLBAR:
|
}
|
||||||
case wxSYS_COLOUR_BACKGROUND:
|
|
||||||
case wxSYS_COLOUR_ACTIVECAPTION:
|
|
||||||
case wxSYS_COLOUR_INACTIVECAPTION:
|
|
||||||
case wxSYS_COLOUR_MENU:
|
|
||||||
case wxSYS_COLOUR_WINDOW:
|
|
||||||
case wxSYS_COLOUR_WINDOWFRAME:
|
|
||||||
case wxSYS_COLOUR_ACTIVEBORDER:
|
|
||||||
case wxSYS_COLOUR_INACTIVEBORDER:
|
|
||||||
case wxSYS_COLOUR_BTNFACE:
|
|
||||||
{
|
|
||||||
return *g_systemBtnFaceColour;
|
|
||||||
};
|
|
||||||
case wxSYS_COLOUR_BTNSHADOW:
|
|
||||||
{
|
|
||||||
return *g_systemBtnShadowColour;
|
|
||||||
};
|
|
||||||
case wxSYS_COLOUR_GRAYTEXT:
|
|
||||||
case wxSYS_COLOUR_BTNHIGHLIGHT:
|
|
||||||
{
|
|
||||||
return *g_systemBtnHighlightColour;
|
|
||||||
};
|
|
||||||
case wxSYS_COLOUR_HIGHLIGHT:
|
|
||||||
{
|
|
||||||
return *g_systemHighlightColour;
|
|
||||||
};
|
|
||||||
case wxSYS_COLOUR_MENUTEXT:
|
|
||||||
case wxSYS_COLOUR_WINDOWTEXT:
|
|
||||||
case wxSYS_COLOUR_CAPTIONTEXT:
|
|
||||||
case wxSYS_COLOUR_INACTIVECAPTIONTEXT:
|
|
||||||
case wxSYS_COLOUR_INFOTEXT:
|
|
||||||
{
|
|
||||||
return *wxBLACK;
|
|
||||||
};
|
|
||||||
case wxSYS_COLOUR_HIGHLIGHTTEXT:
|
|
||||||
{
|
|
||||||
return *wxWHITE;
|
|
||||||
};
|
|
||||||
case wxSYS_COLOUR_INFOBK:
|
|
||||||
case wxSYS_COLOUR_APPWORKSPACE:
|
|
||||||
{
|
|
||||||
return *wxWHITE; // ?
|
|
||||||
};
|
|
||||||
};
|
|
||||||
return *wxWHITE;
|
|
||||||
};
|
|
||||||
|
|
||||||
wxFont *g_systemFont = NULL;
|
wxFont wxSystemSettings::GetSystemFont(int index)
|
||||||
|
|
||||||
wxFont wxSystemSettings::GetSystemFont( int index )
|
|
||||||
{
|
{
|
||||||
switch (index)
|
// TODO
|
||||||
{
|
return wxFont;
|
||||||
case wxSYS_OEM_FIXED_FONT:
|
}
|
||||||
case wxSYS_ANSI_FIXED_FONT:
|
|
||||||
case wxSYS_SYSTEM_FIXED_FONT:
|
|
||||||
{
|
|
||||||
return *wxNORMAL_FONT;
|
|
||||||
};
|
|
||||||
case wxSYS_ANSI_VAR_FONT:
|
|
||||||
case wxSYS_SYSTEM_FONT:
|
|
||||||
case wxSYS_DEVICE_DEFAULT_FONT:
|
|
||||||
case wxSYS_DEFAULT_GUI_FONT:
|
|
||||||
{
|
|
||||||
return *g_systemFont;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
return wxNullFont;
|
|
||||||
};
|
|
||||||
|
|
||||||
int wxSystemSettings::GetSystemMetric( int index )
|
// Get a system metric, e.g. scrollbar size
|
||||||
|
int wxSystemSettings::GetSystemMetric(int index)
|
||||||
{
|
{
|
||||||
switch (index)
|
switch ( index)
|
||||||
{
|
{
|
||||||
case wxSYS_SCREEN_X: return 0;
|
case wxSYS_MOUSE_BUTTONS:
|
||||||
case wxSYS_SCREEN_Y: return 0;
|
// TODO
|
||||||
};
|
return 0;
|
||||||
return 0;
|
case wxSYS_BORDER_X:
|
||||||
};
|
// TODO
|
||||||
|
return 0;
|
||||||
|
case wxSYS_BORDER_Y:
|
||||||
|
// TODO
|
||||||
|
return 0;
|
||||||
|
case wxSYS_CURSOR_X:
|
||||||
|
// TODO
|
||||||
|
return 0;
|
||||||
|
case wxSYS_CURSOR_Y:
|
||||||
|
// TODO
|
||||||
|
return 0;
|
||||||
|
case wxSYS_DCLICK_X:
|
||||||
|
// TODO
|
||||||
|
return 0;
|
||||||
|
case wxSYS_DCLICK_Y:
|
||||||
|
// TODO
|
||||||
|
return 0;
|
||||||
|
case wxSYS_DRAG_X:
|
||||||
|
// TODO
|
||||||
|
return 0;
|
||||||
|
case wxSYS_DRAG_Y:
|
||||||
|
// TODO
|
||||||
|
return 0;
|
||||||
|
case wxSYS_EDGE_X:
|
||||||
|
// TODO
|
||||||
|
return 0;
|
||||||
|
case wxSYS_EDGE_Y:
|
||||||
|
// TODO
|
||||||
|
return 0;
|
||||||
|
case wxSYS_HSCROLL_ARROW_X:
|
||||||
|
// TODO
|
||||||
|
return 0;
|
||||||
|
case wxSYS_HSCROLL_ARROW_Y:
|
||||||
|
// TODO
|
||||||
|
return 0;
|
||||||
|
case wxSYS_HTHUMB_X:
|
||||||
|
// TODO
|
||||||
|
return 0;
|
||||||
|
case wxSYS_ICON_X:
|
||||||
|
// TODO
|
||||||
|
return 0;
|
||||||
|
case wxSYS_ICON_Y:
|
||||||
|
// TODO
|
||||||
|
return 0;
|
||||||
|
case wxSYS_ICONSPACING_X:
|
||||||
|
// TODO
|
||||||
|
return 0;
|
||||||
|
case wxSYS_ICONSPACING_Y:
|
||||||
|
// TODO
|
||||||
|
return 0;
|
||||||
|
case wxSYS_WINDOWMIN_X:
|
||||||
|
// TODO
|
||||||
|
return 0;
|
||||||
|
case wxSYS_WINDOWMIN_Y:
|
||||||
|
// TODO
|
||||||
|
return 0;
|
||||||
|
case wxSYS_SCREEN_X:
|
||||||
|
// TODO
|
||||||
|
return 0;
|
||||||
|
case wxSYS_SCREEN_Y:
|
||||||
|
// TODO
|
||||||
|
return 0;
|
||||||
|
case wxSYS_FRAMESIZE_X:
|
||||||
|
// TODO
|
||||||
|
return 0;
|
||||||
|
case wxSYS_FRAMESIZE_Y:
|
||||||
|
// TODO
|
||||||
|
return 0;
|
||||||
|
case wxSYS_SMALLICON_X:
|
||||||
|
// TODO
|
||||||
|
return 0;
|
||||||
|
case wxSYS_SMALLICON_Y:
|
||||||
|
// TODO
|
||||||
|
return 0;
|
||||||
|
case wxSYS_HSCROLL_Y:
|
||||||
|
// TODO
|
||||||
|
return 0;
|
||||||
|
case wxSYS_VSCROLL_X:
|
||||||
|
// TODO
|
||||||
|
return 0;
|
||||||
|
case wxSYS_VSCROLL_ARROW_X:
|
||||||
|
// TODO
|
||||||
|
return 0;
|
||||||
|
case wxSYS_VSCROLL_ARROW_Y:
|
||||||
|
// TODO
|
||||||
|
return 0;
|
||||||
|
case wxSYS_VTHUMB_Y:
|
||||||
|
// TODO
|
||||||
|
return 0;
|
||||||
|
case wxSYS_CAPTION_Y:
|
||||||
|
// TODO
|
||||||
|
return 0;
|
||||||
|
case wxSYS_MENU_Y:
|
||||||
|
// TODO
|
||||||
|
return 0;
|
||||||
|
case wxSYS_NETWORK_PRESENT:
|
||||||
|
// TODO
|
||||||
|
return 0;
|
||||||
|
case wxSYS_PENWINDOWS_PRESENT:
|
||||||
|
// TODO
|
||||||
|
return 0;
|
||||||
|
case wxSYS_SHOW_SOUNDS:
|
||||||
|
// TODO
|
||||||
|
return 0;
|
||||||
|
case wxSYS_SWAP_BUTTONS:
|
||||||
|
// TODO
|
||||||
|
return 0;
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,147 +1,185 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: slider.cpp
|
// Name: slider.cpp
|
||||||
// Purpose:
|
// Purpose: wxSlider
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma implementation "slider.h"
|
#pragma implementation "slider.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/slider.h"
|
#include "wx/msw/slider.h"
|
||||||
#include "wx/utils.h"
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
#if !USE_SHARED_LIBRARY
|
||||||
// wxSlider
|
IMPLEMENT_DYNAMIC_CLASS(wxSlider, wxControl)
|
||||||
//-----------------------------------------------------------------------------
|
#endif
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxSlider,wxControl)
|
// Slider
|
||||||
|
wxSlider::wxSlider()
|
||||||
wxSlider::wxSlider(void)
|
|
||||||
{
|
{
|
||||||
};
|
m_pageSize = 1;
|
||||||
|
m_lineSize = 1;
|
||||||
wxSlider::wxSlider( wxWindow *parent, wxWindowID id,
|
m_rangeMax = 0;
|
||||||
int value, int minValue, int maxValue,
|
m_rangeMin = 0;
|
||||||
const wxPoint& pos, const wxSize& size,
|
m_tickFreq = 0;
|
||||||
long style,
|
}
|
||||||
/* const wxValidator& validator = wxDefaultValidator, */
|
|
||||||
const wxString& name )
|
|
||||||
{
|
|
||||||
Create( parent, id, value, minValue, maxValue,
|
|
||||||
pos, size, style, name );
|
|
||||||
};
|
|
||||||
|
|
||||||
wxSlider::~wxSlider(void)
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
bool wxSlider::Create(wxWindow *parent, wxWindowID id,
|
bool wxSlider::Create(wxWindow *parent, wxWindowID id,
|
||||||
int value, int minValue, int maxValue,
|
int value, int minValue, int maxValue,
|
||||||
const wxPoint& pos, const wxSize& size,
|
const wxPoint& pos,
|
||||||
long style,
|
const wxSize& size, long style,
|
||||||
/* const wxValidator& validator = wxDefaultValidator, */
|
const wxValidator& validator,
|
||||||
const wxString& name )
|
const wxString& name)
|
||||||
{
|
{
|
||||||
return TRUE;
|
SetName(name);
|
||||||
};
|
SetValidator(validator);
|
||||||
|
|
||||||
int wxSlider::GetValue(void) const
|
if (parent) parent->AddChild(this);
|
||||||
|
|
||||||
|
m_lineSize = 1;
|
||||||
|
m_windowStyle = style;
|
||||||
|
m_tickFreq = 0;
|
||||||
|
|
||||||
|
if ( id == -1 )
|
||||||
|
m_windowId = (int)NewControlId();
|
||||||
|
else
|
||||||
|
m_windowId = id;
|
||||||
|
|
||||||
|
m_rangeMax = maxValue;
|
||||||
|
m_rangeMin = minValue;
|
||||||
|
|
||||||
|
m_pageSize = (int)((maxValue-minValue)/10);
|
||||||
|
|
||||||
|
// TODO create slider
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxSlider::~wxSlider()
|
||||||
{
|
{
|
||||||
};
|
}
|
||||||
|
|
||||||
void wxSlider::SetValue( int value )
|
int wxSlider::GetValue() const
|
||||||
{
|
{
|
||||||
};
|
// TODO
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
void wxSlider::SetRange( int minValue, int maxValue )
|
void wxSlider::SetValue(int value)
|
||||||
{
|
{
|
||||||
};
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
int wxSlider::GetMin(void) const
|
void wxSlider::GetSize(int *width, int *height) const
|
||||||
{
|
{
|
||||||
};
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
int wxSlider::GetMax(void) const
|
void wxSlider::GetPosition(int *x, int *y) const
|
||||||
{
|
{
|
||||||
};
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
void wxSlider::SetPageSize( int pageSize )
|
void wxSlider::SetSize(int x, int y, int width, int height, int sizeFlags)
|
||||||
{
|
{
|
||||||
};
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
int wxSlider::GetPageSize(void) const
|
void wxSlider::SetRange(int minValue, int maxValue)
|
||||||
{
|
{
|
||||||
};
|
m_rangeMin = minValue;
|
||||||
|
m_rangeMax = maxValue;
|
||||||
|
|
||||||
void wxSlider::SetThumbLength( int len )
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
// For trackbars only
|
||||||
|
void wxSlider::SetTickFreq(int n, int pos)
|
||||||
{
|
{
|
||||||
};
|
// TODO
|
||||||
|
m_tickFreq = n;
|
||||||
|
}
|
||||||
|
|
||||||
int wxSlider::GetThumbLength(void) const
|
void wxSlider::SetPageSize(int pageSize)
|
||||||
{
|
{
|
||||||
};
|
// TODO
|
||||||
|
m_pageSize = pageSize;
|
||||||
|
}
|
||||||
|
|
||||||
void wxSlider::SetLineSize( int WXUNUSED(lineSize) )
|
int wxSlider::GetPageSize() const
|
||||||
{
|
{
|
||||||
};
|
return m_pageSize;
|
||||||
|
}
|
||||||
|
|
||||||
int wxSlider::GetLineSize(void) const
|
void wxSlider::ClearSel()
|
||||||
{
|
{
|
||||||
};
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
void wxSlider::GetSize( int *x, int *y ) const
|
void wxSlider::ClearTicks()
|
||||||
{
|
{
|
||||||
wxWindow::GetSize( x, y );
|
// TODO
|
||||||
};
|
}
|
||||||
|
|
||||||
void wxSlider::SetSize( int x, int y, int width, int height, int sizeFlags )
|
void wxSlider::SetLineSize(int lineSize)
|
||||||
{
|
{
|
||||||
wxWindow::SetSize( x, y, width, height, sizeFlags );
|
m_lineSize = lineSize;
|
||||||
};
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
void wxSlider::GetPosition( int *x, int *y ) const
|
int wxSlider::GetLineSize() const
|
||||||
{
|
{
|
||||||
wxWindow::GetPosition( x, y );
|
// TODO
|
||||||
};
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
void wxSlider::SetTick( int WXUNUSED(tickPos) )
|
int wxSlider::GetSelEnd() const
|
||||||
{
|
{
|
||||||
};
|
// TODO
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
void wxSlider::SetTickFreq( int WXUNUSED(n), int WXUNUSED(pos) )
|
int wxSlider::GetSelStart() const
|
||||||
{
|
{
|
||||||
};
|
// TODO
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int wxSlider::GetTickFreq(void) const
|
void wxSlider::SetSelection(int minPos, int maxPos)
|
||||||
{
|
{
|
||||||
return 0;
|
// TODO
|
||||||
};
|
}
|
||||||
|
|
||||||
void wxSlider::ClearTicks(void)
|
void wxSlider::SetThumbLength(int len)
|
||||||
{
|
{
|
||||||
};
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
void wxSlider::SetSelection( int WXUNUSED(minPos), int WXUNUSED(maxPos) )
|
int wxSlider::GetThumbLength() const
|
||||||
{
|
{
|
||||||
};
|
// TODO
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int wxSlider::GetSelEnd(void) const
|
void wxSlider::SetTick(int tickPos)
|
||||||
{
|
{
|
||||||
return 0;
|
// TODO
|
||||||
};
|
}
|
||||||
|
|
||||||
int wxSlider::GetSelStart(void) const
|
void wxSlider::Command (wxCommandEvent & event)
|
||||||
{
|
{
|
||||||
return 0;
|
SetValue (event.GetInt());
|
||||||
};
|
ProcessCommand (event);
|
||||||
|
}
|
||||||
|
|
||||||
void wxSlider::ClearSel(void)
|
bool wxSlider::Show(bool show)
|
||||||
{
|
{
|
||||||
};
|
// TODO
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: statbmp.cpp
|
// Name: statbmp.cpp
|
||||||
// Purpose:
|
// Purpose: wxStaticBitmap
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@@ -14,31 +15,45 @@
|
|||||||
|
|
||||||
#include "wx/statbmp.h"
|
#include "wx/statbmp.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
#if !USE_SHARED_LIBRARY
|
||||||
// wxStaticBitmap
|
IMPLEMENT_DYNAMIC_CLASS(wxStaticBitmap, wxControl)
|
||||||
//-----------------------------------------------------------------------------
|
#endif
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxStaticBitmap,wxControl)
|
/*
|
||||||
|
* wxStaticBitmap
|
||||||
|
*/
|
||||||
|
|
||||||
wxStaticBitmap::wxStaticBitmap(void)
|
bool wxStaticBitmap::Create(wxWindow *parent, wxWindowID id,
|
||||||
|
const wxBitmap& bitmap,
|
||||||
|
const wxPoint& pos,
|
||||||
|
const wxSize& size,
|
||||||
|
long style,
|
||||||
|
const wxString& name)
|
||||||
{
|
{
|
||||||
};
|
m_messageBitmap = bitmap;
|
||||||
|
SetName(name);
|
||||||
|
if (parent) parent->AddChild(this);
|
||||||
|
|
||||||
wxStaticBitmap::wxStaticBitmap( wxWindow *parent, wxWindowID id, const wxBitmap &bitmap,
|
if ( id == -1 )
|
||||||
const wxPoint &pos, const wxSize &size,
|
m_windowId = (int)NewControlId();
|
||||||
long style, const wxString &name )
|
else
|
||||||
|
m_windowId = id;
|
||||||
|
|
||||||
|
m_windowStyle = style;
|
||||||
|
|
||||||
|
// TODO: create static bitmap control
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxStaticBitmap::SetSize(int x, int y, int width, int height, int sizeFlags)
|
||||||
{
|
{
|
||||||
Create( parent, id, bitmap, pos, size, style, name );
|
// TODO
|
||||||
};
|
}
|
||||||
|
|
||||||
bool wxStaticBitmap::Create( wxWindow *parent, wxWindowID id, const wxBitmap &bitmap,
|
void wxStaticBitmap::SetBitmap(const wxBitmap& bitmap)
|
||||||
const wxPoint &pos, const wxSize &size,
|
|
||||||
long style, const wxString &name )
|
|
||||||
{
|
{
|
||||||
return TRUE;
|
m_messageBitmap = bitmap;
|
||||||
};
|
|
||||||
|
|
||||||
void wxStaticBitmap::SetBitmap( const wxBitmap &bitmap )
|
// TODO: redraw bitmap
|
||||||
{
|
}
|
||||||
};
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: statbox.cpp
|
// Name: statbox.cpp
|
||||||
// Purpose:
|
// Purpose: wxStaticBox
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
// Licence: wxWindows licence
|
// Copyright: (c) AUTHOR
|
||||||
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
@@ -14,25 +15,48 @@
|
|||||||
|
|
||||||
#include "wx/statbox.h"
|
#include "wx/statbox.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
#if !USE_SHARED_LIBRARY
|
||||||
// wxStaticBox
|
IMPLEMENT_DYNAMIC_CLASS(wxStaticBox, wxControl)
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxStaticBox,wxControl)
|
BEGIN_EVENT_TABLE(wxStaticBox, wxControl)
|
||||||
|
EVT_ERASE_BACKGROUND(wxStaticBox::OnEraseBackground)
|
||||||
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
wxStaticBox::wxStaticBox(void)
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Static box
|
||||||
|
*/
|
||||||
|
|
||||||
|
bool wxStaticBox::Create(wxWindow *parent, wxWindowID id,
|
||||||
|
const wxString& label,
|
||||||
|
const wxPoint& pos,
|
||||||
|
const wxSize& size,
|
||||||
|
long style,
|
||||||
|
const wxString& name)
|
||||||
{
|
{
|
||||||
};
|
SetName(name);
|
||||||
|
|
||||||
wxStaticBox::wxStaticBox( wxWindow *parent, wxWindowID id, const wxString &label,
|
if (parent) parent->AddChild(this);
|
||||||
const wxPoint &pos, const wxSize &size,
|
|
||||||
long style, const wxString &name )
|
|
||||||
{
|
|
||||||
Create( parent, id, label, pos, size, style, name );
|
|
||||||
};
|
|
||||||
|
|
||||||
bool wxStaticBox::Create( wxWindow *parent, wxWindowID id, const wxString &label,
|
if ( id == -1 )
|
||||||
const wxPoint &pos, const wxSize &size,
|
m_windowId = (int)NewControlId();
|
||||||
long style, const wxString &name )
|
else
|
||||||
|
m_windowId = id;
|
||||||
|
|
||||||
|
m_windowStyle = style;
|
||||||
|
|
||||||
|
// TODO: create static box
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxStaticBox::SetLabel(const wxString& label)
|
||||||
{
|
{
|
||||||
};
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxStaticBox::SetSize(int x, int y, int width, int height, int sizeFlags)
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,49 +1,211 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: stattext.cpp
|
// Name: stattext.cpp
|
||||||
// Purpose:
|
// Purpose: wxStaticText
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: 04/01/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma implementation "stattext.h"
|
#pragma implementation "stattext.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// For compilers that support precompilation, includes "wx.h".
|
||||||
|
#include "wx/wxprec.h"
|
||||||
|
|
||||||
|
#ifdef __BORLANDC__
|
||||||
|
#pragma hdrstop
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WX_PRECOMP
|
||||||
|
#include "wx/app.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "wx/stattext.h"
|
#include "wx/stattext.h"
|
||||||
|
#include "wx/msw/private.h"
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
#if !USE_SHARED_LIBRARY
|
||||||
// wxStaticText
|
IMPLEMENT_DYNAMIC_CLASS(wxStaticText, wxControl)
|
||||||
//-----------------------------------------------------------------------------
|
#endif
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxStaticText,wxControl)
|
bool wxStaticText::Create(wxWindow *parent, wxWindowID id,
|
||||||
|
const wxString& label,
|
||||||
wxStaticText::wxStaticText(void)
|
const wxPoint& pos,
|
||||||
|
const wxSize& size,
|
||||||
|
long style,
|
||||||
|
const wxString& name)
|
||||||
{
|
{
|
||||||
};
|
SetName(name);
|
||||||
|
if (parent) parent->AddChild(this);
|
||||||
|
|
||||||
wxStaticText::wxStaticText( wxWindow *parent, wxWindowID id, const wxString &label,
|
SetBackgroundColour(parent->GetDefaultBackgroundColour()) ;
|
||||||
const wxPoint &pos, const wxSize &size,
|
SetForegroundColour(parent->GetDefaultForegroundColour()) ;
|
||||||
long style, const wxString &name )
|
|
||||||
{
|
|
||||||
Create( parent, id, label, pos, size, style, name );
|
|
||||||
};
|
|
||||||
|
|
||||||
bool wxStaticText::Create( wxWindow *parent, wxWindowID id, const wxString &label,
|
if ( id == -1 )
|
||||||
const wxPoint &pos, const wxSize &size,
|
m_windowId = (int)NewControlId();
|
||||||
long style, const wxString &name )
|
else
|
||||||
{
|
m_windowId = id;
|
||||||
|
|
||||||
|
int x = pos.x;
|
||||||
|
int y = pos.y;
|
||||||
|
int width = size.x;
|
||||||
|
int height = size.y;
|
||||||
|
|
||||||
|
m_windowStyle = style;
|
||||||
|
|
||||||
|
long msStyle = WS_CHILD|WS_VISIBLE;
|
||||||
|
if (m_windowStyle & wxALIGN_CENTRE)
|
||||||
|
msStyle |= SS_CENTER;
|
||||||
|
else if (m_windowStyle & wxALIGN_RIGHT)
|
||||||
|
msStyle |= SS_RIGHT;
|
||||||
|
else
|
||||||
|
msStyle |= SS_LEFT;
|
||||||
|
|
||||||
|
// Even with extended styles, need to combine with WS_BORDER
|
||||||
|
// for them to look right.
|
||||||
|
if ((m_windowStyle & wxSIMPLE_BORDER) || (m_windowStyle & wxRAISED_BORDER) ||
|
||||||
|
(m_windowStyle & wxSUNKEN_BORDER) || (m_windowStyle & wxDOUBLE_BORDER))
|
||||||
|
msStyle |= WS_BORDER;
|
||||||
|
|
||||||
|
HWND static_item = CreateWindowEx(MakeExtendedStyle(m_windowStyle), "STATIC", (const char *)label,
|
||||||
|
msStyle,
|
||||||
|
0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)m_windowId,
|
||||||
|
wxGetInstance(), NULL);
|
||||||
|
|
||||||
|
#if CTL3D
|
||||||
|
/*
|
||||||
|
if (!(GetParent()->GetWindowStyleFlag() & wxUSER_COLOURS))
|
||||||
|
Ctl3dSubclassCtl(static_item);
|
||||||
|
*/
|
||||||
|
#endif
|
||||||
|
|
||||||
|
m_hWnd = (WXHWND)static_item;
|
||||||
|
|
||||||
|
SubclassWin((WXHWND)static_item);
|
||||||
|
|
||||||
|
SetFont(* parent->GetFont());
|
||||||
|
SetSize(x, y, width, height);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
};
|
}
|
||||||
|
|
||||||
wxString wxStaticText::GetLabel(void) const
|
void wxStaticText::SetSize(int x, int y, int width, int height, int sizeFlags)
|
||||||
{
|
{
|
||||||
};
|
int currentX, currentY;
|
||||||
|
GetPosition(¤tX, ¤tY);
|
||||||
|
int x1 = x;
|
||||||
|
int y1 = y;
|
||||||
|
|
||||||
void wxStaticText::SetLabel( const wxString &label )
|
if (x == -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE))
|
||||||
|
x1 = currentX;
|
||||||
|
if (y == -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE))
|
||||||
|
y1 = currentY;
|
||||||
|
|
||||||
|
AdjustForParentClientOrigin(x1, y1, sizeFlags);
|
||||||
|
|
||||||
|
int actualWidth = width;
|
||||||
|
int actualHeight = height;
|
||||||
|
|
||||||
|
char buf[300];
|
||||||
|
int current_width;
|
||||||
|
int cyf;
|
||||||
|
|
||||||
|
::GetWindowText((HWND) GetHWND(), buf, 300);
|
||||||
|
GetTextExtent(buf, ¤t_width, &cyf, NULL, NULL,GetFont());
|
||||||
|
|
||||||
|
int ww, hh;
|
||||||
|
GetSize(&ww, &hh);
|
||||||
|
|
||||||
|
// If we're prepared to use the existing width, then...
|
||||||
|
if (width == -1 && ((sizeFlags & wxSIZE_AUTO_WIDTH) != wxSIZE_AUTO_WIDTH))
|
||||||
|
actualWidth = ww;
|
||||||
|
else if (width == -1)
|
||||||
|
{
|
||||||
|
int cx;
|
||||||
|
int cy;
|
||||||
|
wxGetCharSize(GetHWND(), &cx, &cy,GetFont());
|
||||||
|
actualWidth = (int)(current_width + cx) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If we're prepared to use the existing height, then...
|
||||||
|
if (height == -1 && ((sizeFlags & wxSIZE_AUTO_HEIGHT) != wxSIZE_AUTO_HEIGHT))
|
||||||
|
actualHeight = hh;
|
||||||
|
else if (height == -1)
|
||||||
|
{
|
||||||
|
actualHeight = (int)(cyf) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
MoveWindow((HWND) GetHWND(), x1, y1, actualWidth, actualHeight, TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxStaticText::SetLabel(const wxString& label)
|
||||||
{
|
{
|
||||||
wxControl::SetLabel(label);
|
int w, h;
|
||||||
};
|
RECT rect;
|
||||||
|
|
||||||
|
wxWindow *parent = GetParent();
|
||||||
|
GetWindowRect((HWND) GetHWND(), &rect);
|
||||||
|
|
||||||
|
// Since we now have the absolute screen coords,
|
||||||
|
// if there's a parent we must subtract its top left corner
|
||||||
|
POINT point;
|
||||||
|
point.x = rect.left;
|
||||||
|
point.y = rect.top;
|
||||||
|
if (parent)
|
||||||
|
{
|
||||||
|
::ScreenToClient((HWND) parent->GetHWND(), &point);
|
||||||
|
}
|
||||||
|
|
||||||
|
GetTextExtent(label, &w, &h, NULL, NULL, GetFont());
|
||||||
|
MoveWindow((HWND) GetHWND(), point.x, point.y, (int)(w + 10), (int)h,
|
||||||
|
TRUE);
|
||||||
|
SetWindowText((HWND) GetHWND(), (const char *)label);
|
||||||
|
}
|
||||||
|
|
||||||
|
WXHBRUSH wxStaticText::OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
|
||||||
|
WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
#if CTL3D
|
||||||
|
if ( m_useCtl3D )
|
||||||
|
{
|
||||||
|
HBRUSH hbrush = Ctl3dCtlColorEx(message, wParam, lParam);
|
||||||
|
|
||||||
|
if (hbrush != (HBRUSH) 0)
|
||||||
|
return hbrush;
|
||||||
|
else
|
||||||
|
return (HBRUSH)MSWDefWindowProc(message, wParam, lParam);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (GetParent()->GetTransparentBackground())
|
||||||
|
SetBkMode((HDC) pDC, TRANSPARENT);
|
||||||
|
else
|
||||||
|
SetBkMode((HDC) pDC, OPAQUE);
|
||||||
|
|
||||||
|
::SetBkColor((HDC) pDC, RGB(GetBackgroundColour().Red(), GetBackgroundColour().Green(), GetBackgroundColour().Blue()));
|
||||||
|
::SetTextColor((HDC) pDC, RGB(GetForegroundColour().Red(), GetForegroundColour().Green(), GetForegroundColour().Blue()));
|
||||||
|
|
||||||
|
wxBrush *backgroundBrush = wxTheBrushList->FindOrCreateBrush(GetBackgroundColour(), wxSOLID);
|
||||||
|
|
||||||
|
// Note that this will be cleaned up in wxApp::OnIdle, if backgroundBrush
|
||||||
|
// has a zero usage count.
|
||||||
|
// backgroundBrush->RealizeResource();
|
||||||
|
return (WXHBRUSH) backgroundBrush->GetResourceHandle();
|
||||||
|
}
|
||||||
|
|
||||||
|
long wxStaticText::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
|
||||||
|
{
|
||||||
|
// Ensure that static items get messages. Some controls don't like this
|
||||||
|
// message to be intercepted (e.g. RichEdit), hence the tests.
|
||||||
|
if (nMsg == WM_NCHITTEST)
|
||||||
|
return (long)HTCLIENT;
|
||||||
|
|
||||||
|
return wxWindow::MSWWindowProc(nMsg, wParam, lParam);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,173 +1,374 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: textctrl.cpp
|
// Name: textctrl.cpp
|
||||||
// Purpose:
|
// Purpose: wxTextCtrl
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
// Licence: wxWindows licence
|
// Copyright: (c) AUTHOR
|
||||||
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma implementation "textctrl.h"
|
#pragma implementation "textctrl.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <fstream.h>
|
||||||
|
|
||||||
#include "wx/textctrl.h"
|
#include "wx/textctrl.h"
|
||||||
#include "wx/utils.h"
|
#include "wx/settings.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
#if defined(__BORLANDC__) && !defined(__WIN32__)
|
||||||
// wxTextCtrl
|
#include <alloc.h>
|
||||||
//-----------------------------------------------------------------------------
|
#else
|
||||||
|
#ifndef __GNUWIN32__
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxTextCtrl,wxControl)
|
#include <malloc.h>
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !USE_SHARED_LIBRARY
|
||||||
|
IMPLEMENT_DYNAMIC_CLASS(wxTextCtrl, wxControl)
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxTextCtrl, wxControl)
|
BEGIN_EVENT_TABLE(wxTextCtrl, wxControl)
|
||||||
// EVT_CHAR(wxTextCtrl::OnChar)
|
EVT_CHAR(wxTextCtrl::OnChar)
|
||||||
|
EVT_DROP_FILES(wxTextCtrl::OnDropFiles)
|
||||||
|
EVT_ERASE_BACKGROUND(wxTextCtrl::OnEraseBackground)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
#endif
|
||||||
|
|
||||||
wxTextCtrl::wxTextCtrl(void) : streambuf()
|
// Text item
|
||||||
|
wxTextCtrl::wxTextCtrl()
|
||||||
|
#ifndef NO_TEXT_WINDOW_STREAM
|
||||||
|
:streambuf()
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
if( allocate() )
|
m_fileName = "";
|
||||||
setp(base(),ebuf());
|
}
|
||||||
|
|
||||||
m_modified = FALSE;
|
bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id,
|
||||||
};
|
const wxString& value,
|
||||||
|
const wxPoint& pos,
|
||||||
wxTextCtrl::wxTextCtrl( wxWindow *parent, wxWindowID id, const wxString &value,
|
const wxSize& size, long style,
|
||||||
const wxPoint &pos, const wxSize &size,
|
const wxValidator& validator,
|
||||||
int style, const wxString &name ) : streambuf()
|
const wxString& name)
|
||||||
{
|
{
|
||||||
if( allocate() )
|
m_fileName = "";
|
||||||
setp(base(),ebuf());
|
SetName(name);
|
||||||
|
SetValidator(validator);
|
||||||
|
if (parent) parent->AddChild(this);
|
||||||
|
|
||||||
m_modified = FALSE;
|
m_windowStyle = style;
|
||||||
Create( parent, id, value, pos, size, style, name );
|
|
||||||
};
|
|
||||||
|
|
||||||
bool wxTextCtrl::Create( wxWindow *parent, wxWindowID id, const wxString &value,
|
if ( id == -1 )
|
||||||
const wxPoint &pos, const wxSize &size,
|
m_windowId = (int)NewControlId();
|
||||||
int style, const wxString &name )
|
else
|
||||||
|
m_windowId = id;
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxString wxTextCtrl::GetValue() const
|
||||||
{
|
{
|
||||||
return TRUE;
|
// TODO
|
||||||
};
|
return wxString("");
|
||||||
|
}
|
||||||
|
|
||||||
wxString wxTextCtrl::GetValue(void) const
|
void wxTextCtrl::SetValue(const wxString& value)
|
||||||
{
|
{
|
||||||
return tmp;
|
// TODO
|
||||||
};
|
}
|
||||||
|
|
||||||
void wxTextCtrl::SetValue( const wxString &value )
|
void wxTextCtrl::SetSize(int x, int y, int width, int height, int sizeFlags)
|
||||||
{
|
{
|
||||||
};
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
void wxTextCtrl::WriteText( const wxString &text )
|
// Clipboard operations
|
||||||
|
void wxTextCtrl::Copy()
|
||||||
{
|
{
|
||||||
};
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
bool wxTextCtrl::LoadFile( const wxString &WXUNUSED(file) )
|
void wxTextCtrl::Cut()
|
||||||
{
|
{
|
||||||
return FALSE;
|
// TODO
|
||||||
};
|
}
|
||||||
|
|
||||||
bool wxTextCtrl::SaveFile( const wxString &WXUNUSED(file) )
|
void wxTextCtrl::Paste()
|
||||||
{
|
{
|
||||||
return FALSE;
|
// TODO
|
||||||
};
|
}
|
||||||
|
|
||||||
|
void wxTextCtrl::SetEditable(bool editable)
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxTextCtrl::SetInsertionPoint(long pos)
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxTextCtrl::SetInsertionPointEnd()
|
||||||
|
{
|
||||||
|
long pos = GetLastPosition();
|
||||||
|
SetInsertionPoint(pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
long wxTextCtrl::GetInsertionPoint() const
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
long wxTextCtrl::GetLastPosition() const
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxTextCtrl::Replace(long from, long to, const wxString& value)
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxTextCtrl::Remove(long from, long to)
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxTextCtrl::SetSelection(long from, long to)
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxTextCtrl::LoadFile(const wxString& file)
|
||||||
|
{
|
||||||
|
if (!wxFileExists(file))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
m_fileName = file;
|
||||||
|
|
||||||
|
Clear();
|
||||||
|
|
||||||
|
ifstream input((char*) (const char*) file, ios::nocreate | ios::in);
|
||||||
|
|
||||||
|
if (!input.bad())
|
||||||
|
{
|
||||||
|
struct stat stat_buf;
|
||||||
|
if (stat(file, &stat_buf) < 0)
|
||||||
|
return FALSE;
|
||||||
|
// This may need to be a bigger buffer than the file size suggests,
|
||||||
|
// if it's a UNIX file. Give it an extra 1000 just in case.
|
||||||
|
char *tmp_buffer = (char*)malloc((size_t)(stat_buf.st_size+1+1000));
|
||||||
|
long no_lines = 0;
|
||||||
|
long pos = 0;
|
||||||
|
while (!input.eof() && input.peek() != EOF)
|
||||||
|
{
|
||||||
|
input.getline(wxBuffer, 500);
|
||||||
|
int len = strlen(wxBuffer);
|
||||||
|
wxBuffer[len] = 13;
|
||||||
|
wxBuffer[len+1] = 10;
|
||||||
|
wxBuffer[len+2] = 0;
|
||||||
|
strcpy(tmp_buffer+pos, wxBuffer);
|
||||||
|
pos += strlen(wxBuffer);
|
||||||
|
no_lines++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO add line
|
||||||
|
|
||||||
|
free(tmp_buffer);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If file is null, try saved file name first
|
||||||
|
// Returns TRUE if succeeds.
|
||||||
|
bool wxTextCtrl::SaveFile(const wxString& file)
|
||||||
|
{
|
||||||
|
wxString theFile(file);
|
||||||
|
if (theFile == "")
|
||||||
|
theFile = m_fileName;
|
||||||
|
if (theFile == "")
|
||||||
|
return FALSE;
|
||||||
|
m_fileName = theFile;
|
||||||
|
|
||||||
|
ofstream output((char*) (const char*) theFile);
|
||||||
|
if (output.bad())
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
// TODO get and save text
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxTextCtrl::WriteText(const wxString& text)
|
||||||
|
{
|
||||||
|
// TODO write text to control
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxTextCtrl::Clear()
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxTextCtrl::IsModified() const
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Makes 'unmodified'
|
||||||
|
void wxTextCtrl::DiscardEdits()
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
int wxTextCtrl::GetNumberOfLines() const
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
long wxTextCtrl::XYToPosition(long x, long y) const
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxTextCtrl::PositionToXY(long pos, long *x, long *y) const
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxTextCtrl::ShowPosition(long pos)
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
int wxTextCtrl::GetLineLength(long lineNo) const
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxString wxTextCtrl::GetLineText(long lineNo) const
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
return wxString("");
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
wxString wxTextCtrl::GetLineText( long lineNo ) const
|
* Text item
|
||||||
|
*/
|
||||||
|
|
||||||
|
void wxTextCtrl::Command(wxCommandEvent & event)
|
||||||
{
|
{
|
||||||
};
|
SetValue (event.GetString());
|
||||||
|
ProcessCommand (event);
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxTextCtrl::OnDropFiles(wxDropFilesEvent& event)
|
||||||
void wxTextCtrl::OnDropFiles( wxDropFilesEvent &event )
|
|
||||||
{
|
{
|
||||||
};
|
// By default, load the first file into the text window.
|
||||||
|
if (event.GetNumberOfFiles() > 0)
|
||||||
|
{
|
||||||
|
LoadFile(event.GetFiles()[0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
long wxTextCtrl::PositionToXY( long pos, long *x, long *y ) const
|
// The streambuf code was partly taken from chapter 3 by Jerry Schwarz of
|
||||||
{
|
// AT&T's "C++ Lanuage System Release 3.0 Library Manual" - Stein Somers
|
||||||
};
|
|
||||||
|
|
||||||
long wxTextCtrl::XYToPosition( long x, long y )
|
//=========================================================================
|
||||||
|
// Called then the buffer is full (gcc 2.6.3)
|
||||||
|
// or when "endl" is output (Borland 4.5)
|
||||||
|
//=========================================================================
|
||||||
|
// Class declaration using multiple inheritance doesn't work properly for
|
||||||
|
// Borland. See note in wb_text.h.
|
||||||
|
#ifndef NO_TEXT_WINDOW_STREAM
|
||||||
|
int wxTextCtrl::overflow(int c)
|
||||||
{
|
{
|
||||||
};
|
// Make sure there is a holding area
|
||||||
|
if ( allocate()==EOF )
|
||||||
|
{
|
||||||
|
wxError("Streambuf allocation failed","Internal error");
|
||||||
|
return EOF;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Verify that there are no characters in get area
|
||||||
|
if ( gptr() && gptr() < egptr() )
|
||||||
|
{
|
||||||
|
wxError("Who's trespassing my get area?","Internal error");
|
||||||
|
return EOF;
|
||||||
|
}
|
||||||
|
|
||||||
int wxTextCtrl::GetNumberOfLines(void)
|
// Reset get area
|
||||||
{
|
setg(0,0,0);
|
||||||
};
|
|
||||||
|
|
||||||
*/
|
// Make sure there is a put area
|
||||||
void wxTextCtrl::SetInsertionPoint( long pos )
|
if ( ! pptr() )
|
||||||
{
|
{
|
||||||
};
|
/* This doesn't seem to be fatal so comment out error message */
|
||||||
|
// wxError("Put area not opened","Internal error");
|
||||||
|
setp( base(), base() );
|
||||||
|
}
|
||||||
|
|
||||||
void wxTextCtrl::SetInsertionPointEnd(void)
|
// Determine how many characters have been inserted but no consumed
|
||||||
{
|
int plen = pptr() - pbase();
|
||||||
};
|
|
||||||
|
|
||||||
void wxTextCtrl::SetEditable( bool editable )
|
// Now Jerry relies on the fact that the buffer is at least 2 chars
|
||||||
{
|
// long, but the holding area "may be as small as 1" ???
|
||||||
};
|
// And we need an additional \0, so let's keep this inefficient but
|
||||||
|
// safe copy.
|
||||||
|
|
||||||
void wxTextCtrl::SetSelection( long from, long to )
|
// If c!=EOF, it is a character that must also be comsumed
|
||||||
{
|
int xtra = c==EOF? 0 : 1;
|
||||||
};
|
|
||||||
|
|
||||||
void wxTextCtrl::ShowPosition( long WXUNUSED(pos) )
|
// Write temporary C-string to wxTextWindow
|
||||||
{
|
{
|
||||||
};
|
char *txt = new char[plen+xtra+1];
|
||||||
|
memcpy(txt, pbase(), plen);
|
||||||
|
txt[plen] = (char)c; // append c
|
||||||
|
txt[plen+xtra] = '\0'; // append '\0' or overwrite c
|
||||||
|
// If the put area already contained \0, output will be truncated there
|
||||||
|
WriteText(txt);
|
||||||
|
delete[] txt;
|
||||||
|
}
|
||||||
|
|
||||||
long wxTextCtrl::GetInsertionPoint(void) const
|
// Reset put area
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
long wxTextCtrl::GetLastPosition(void) const
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxTextCtrl::Remove( long from, long to )
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxTextCtrl::Replace( long from, long to, const wxString &value )
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxTextCtrl::Cut(void)
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxTextCtrl::Copy(void)
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxTextCtrl::Paste(void)
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxTextCtrl::Delete(void)
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxTextCtrl::OnChar( wxKeyEvent &WXUNUSED(event) )
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
int wxTextCtrl::overflow( int WXUNUSED(c) )
|
|
||||||
{
|
|
||||||
int len = pptr() - pbase();
|
|
||||||
char *txt = new char[len+1];
|
|
||||||
strncpy(txt, pbase(), len);
|
|
||||||
txt[len] = '\0';
|
|
||||||
(*this) << txt;
|
|
||||||
setp(pbase(), epptr());
|
setp(pbase(), epptr());
|
||||||
delete[] txt;
|
|
||||||
return EOF;
|
|
||||||
};
|
|
||||||
|
|
||||||
int wxTextCtrl::sync(void)
|
#if defined(__WATCOMC__)
|
||||||
|
return __NOT_EOF;
|
||||||
|
#elif defined(zapeof) // HP-UX (all cfront based?)
|
||||||
|
return zapeof(c);
|
||||||
|
#else
|
||||||
|
return c!=EOF ? c : 0; // this should make everybody happy
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
//=========================================================================
|
||||||
|
// called then "endl" is output (gcc) or then explicit sync is done (Borland)
|
||||||
|
//=========================================================================
|
||||||
|
int wxTextCtrl::sync()
|
||||||
{
|
{
|
||||||
|
// Verify that there are no characters in get area
|
||||||
|
if ( gptr() && gptr() < egptr() )
|
||||||
|
{
|
||||||
|
wxError("Who's trespassing my get area?","Internal error");
|
||||||
|
return EOF;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( pptr() && pptr() > pbase() ) return overflow(EOF);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
/* OLD CODE
|
||||||
int len = pptr() - pbase();
|
int len = pptr() - pbase();
|
||||||
char *txt = new char[len+1];
|
char *txt = new char[len+1];
|
||||||
strncpy(txt, pbase(), len);
|
strncpy(txt, pbase(), len);
|
||||||
@@ -176,60 +377,63 @@ int wxTextCtrl::sync(void)
|
|||||||
setp(pbase(), epptr());
|
setp(pbase(), epptr());
|
||||||
delete[] txt;
|
delete[] txt;
|
||||||
return 0;
|
return 0;
|
||||||
};
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
int wxTextCtrl::underflow(void)
|
//=========================================================================
|
||||||
|
// Should not be called by a "ostream". Used by a "istream"
|
||||||
|
//=========================================================================
|
||||||
|
int wxTextCtrl::underflow()
|
||||||
{
|
{
|
||||||
return EOF;
|
return EOF;
|
||||||
};
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
wxTextCtrl& wxTextCtrl::operator<<(const wxString& s)
|
wxTextCtrl& wxTextCtrl::operator<<(const wxString& s)
|
||||||
{
|
{
|
||||||
WriteText(s);
|
WriteText(s);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxTextCtrl& wxTextCtrl::operator<<(float f)
|
wxTextCtrl& wxTextCtrl::operator<<(float f)
|
||||||
{
|
{
|
||||||
static char buf[100];
|
wxString str;
|
||||||
sprintf(buf, "%.2f", f);
|
str.Printf("%.2f", f);
|
||||||
WriteText(buf);
|
WriteText(str);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxTextCtrl& wxTextCtrl::operator<<(double d)
|
wxTextCtrl& wxTextCtrl::operator<<(double d)
|
||||||
{
|
{
|
||||||
static char buf[100];
|
wxString str;
|
||||||
sprintf(buf, "%.2f", d);
|
str.Printf("%.2f", d);
|
||||||
WriteText(buf);
|
WriteText(str);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxTextCtrl& wxTextCtrl::operator<<(int i)
|
wxTextCtrl& wxTextCtrl::operator<<(int i)
|
||||||
{
|
{
|
||||||
static char buf[100];
|
wxString str;
|
||||||
sprintf(buf, "%i", i);
|
str.Printf("%d", i);
|
||||||
WriteText(buf);
|
WriteText(str);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxTextCtrl& wxTextCtrl::operator<<(long i)
|
wxTextCtrl& wxTextCtrl::operator<<(long i)
|
||||||
{
|
{
|
||||||
static char buf[100];
|
wxString str;
|
||||||
sprintf(buf, "%ld", i);
|
str.Printf("%ld", i);
|
||||||
WriteText(buf);
|
WriteText(str);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxTextCtrl& wxTextCtrl::operator<<(const char c)
|
wxTextCtrl& wxTextCtrl::operator<<(const char c)
|
||||||
{
|
{
|
||||||
char buf[2];
|
char buf[2];
|
||||||
|
|
||||||
buf[0] = c;
|
buf[0] = c;
|
||||||
buf[1] = 0;
|
buf[1] = 0;
|
||||||
WriteText(buf);
|
WriteText(buf);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,66 +1,56 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: timer.cpp
|
// Name: timer.cpp
|
||||||
// Purpose:
|
// Purpose: wxTimer implementation
|
||||||
// Author: Robert Roebling
|
// Author: AUTHOR
|
||||||
// Created: 01/02/97
|
// Modified by:
|
||||||
// Id:
|
// Created: ??/??/98
|
||||||
// Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) AUTHOR
|
||||||
// Licence: wxWindows licence
|
// Licence: wxWindows licence
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma implementation "timer.h"
|
#pragma implementation "timer.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/timer.h"
|
#include "wx/timer.h"
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
#if !USE_SHARED_LIBRARY
|
||||||
// wxTimer
|
IMPLEMENT_ABSTRACT_CLASS(wxTimer, wxObject)
|
||||||
//-----------------------------------------------------------------------------
|
#endif
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxTimer,wxObject)
|
wxTimer::wxTimer()
|
||||||
|
|
||||||
gint timeout_callback( gpointer data )
|
|
||||||
{
|
{
|
||||||
wxTimer *timer = (wxTimer*)data;
|
m_milli = 0 ;
|
||||||
timer->Notify();
|
m_lastMilli = -1 ;
|
||||||
if (timer->OneShot()) timer->Stop();
|
m_id = 0;
|
||||||
return TRUE;
|
m_oneShot = FALSE;
|
||||||
};
|
}
|
||||||
|
|
||||||
wxTimer::wxTimer(void)
|
wxTimer::~wxTimer()
|
||||||
{
|
{
|
||||||
m_time = 1000;
|
Stop();
|
||||||
m_oneShot = FALSE;
|
}
|
||||||
};
|
|
||||||
|
|
||||||
wxTimer::~wxTimer(void)
|
bool wxTimer::Start(int milliseconds,bool mode)
|
||||||
{
|
{
|
||||||
Stop();
|
m_oneShot = mode ;
|
||||||
};
|
if (m_milliseconds < 0)
|
||||||
|
m_milliseconds = lastMilli;
|
||||||
|
|
||||||
int wxTimer::Interval(void)
|
if (m_milliseconds <= 0)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
m_lastMilli = m_milli = m_milliseconds;
|
||||||
|
|
||||||
|
// TODO: set the timer going.
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxTimer::Stop()
|
||||||
{
|
{
|
||||||
return m_time;
|
m_id = 0 ;
|
||||||
};
|
m_milli = 0 ;
|
||||||
|
}
|
||||||
|
|
||||||
bool wxTimer::OneShot(void)
|
|
||||||
{
|
|
||||||
return m_oneShot;
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxTimer::Notify(void)
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxTimer::Start( int millisecs, bool oneShot )
|
|
||||||
{
|
|
||||||
if (millisecs != -1) m_time = millisecs;
|
|
||||||
m_oneShot = oneShot;
|
|
||||||
};
|
|
||||||
|
|
||||||
void wxTimer::Stop(void)
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|||||||
1431
src/qt/window.cpp
1431
src/qt/window.cpp
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user