Reformatted Motif headers; added __WXX11__ symbol support to common headers;

added place-holding src/x11 and include/wx/x11 files.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14015 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2002-02-05 16:34:33 +00:00
parent a4e17da546
commit 83df96d63a
162 changed files with 22793 additions and 2176 deletions

View File

@@ -75,7 +75,7 @@ public:
bool operator!=(const wxAcceleratorEntry& entry) const bool operator!=(const wxAcceleratorEntry& entry) const
{ return !(*this == entry); } { return !(*this == entry); }
#ifdef __WXMOTIF__ #if defined(__WXMOTIF__) || defined(__WXX11__)
// Implementation use only // Implementation use only
bool MatchesEvent(const wxKeyEvent& event) const ; bool MatchesEvent(const wxKeyEvent& event) const ;
#endif #endif
@@ -105,6 +105,8 @@ private:
#include "wx/motif/accel.h" #include "wx/motif/accel.h"
#elif defined(__WXGTK__) #elif defined(__WXGTK__)
#include "wx/gtk/accel.h" #include "wx/gtk/accel.h"
#elif defined(__WXX11__)
#include "wx/x11/accel.h"
#elif defined(__WXMAC__) #elif defined(__WXMAC__)
#include "wx/mac/accel.h" #include "wx/mac/accel.h"
#elif defined(__WXPM__) #elif defined(__WXPM__)

View File

@@ -375,6 +375,8 @@ protected:
#include "wx/mgl/app.h" #include "wx/mgl/app.h"
#elif defined(__WXGTK__) #elif defined(__WXGTK__)
#include "wx/gtk/app.h" #include "wx/gtk/app.h"
#elif defined(__WXX11__)
#include "wx/x11/app.h"
#elif defined(__WXMAC__) #elif defined(__WXMAC__)
#include "wx/mac/app.h" #include "wx/mac/app.h"
#elif defined(__WXPM__) #elif defined(__WXPM__)

View File

@@ -159,6 +159,8 @@ protected:
#include "wx/motif/bitmap.h" #include "wx/motif/bitmap.h"
#elif defined(__WXGTK__) #elif defined(__WXGTK__)
#include "wx/gtk/bitmap.h" #include "wx/gtk/bitmap.h"
#elif defined(__WXX11__)
#include "wx/x11/bitmap.h"
#elif defined(__WXMGL__) #elif defined(__WXMGL__)
#include "wx/mgl/bitmap.h" #include "wx/mgl/bitmap.h"
#elif defined(__WXMAC__) #elif defined(__WXMAC__)

View File

@@ -7,6 +7,8 @@
#include "wx/motif/brush.h" #include "wx/motif/brush.h"
#elif defined(__WXGTK__) #elif defined(__WXGTK__)
#include "wx/gtk/brush.h" #include "wx/gtk/brush.h"
#elif defined(__WXX11__)
#include "wx/x11/brush.h"
#elif defined(__WXMGL__) #elif defined(__WXMGL__)
#include "wx/mgl/brush.h" #include "wx/mgl/brush.h"
#elif defined(__WXMAC__) #elif defined(__WXMAC__)

View File

@@ -88,6 +88,8 @@ public:
#include "wx/motif/clipbrd.h" #include "wx/motif/clipbrd.h"
#elif defined(__WXGTK__) #elif defined(__WXGTK__)
#include "wx/gtk/clipbrd.h" #include "wx/gtk/clipbrd.h"
#elif defined(__WXX11__)
#include "wx/x11/clipbrd.h"
#elif defined(__WXMGL__) #elif defined(__WXMGL__)
#include "wx/mgl/clipbrd.h" #include "wx/mgl/clipbrd.h"
#elif defined(__WXMAC__) #elif defined(__WXMAC__)

View File

@@ -9,6 +9,8 @@
#include "wx/gtk/colour.h" #include "wx/gtk/colour.h"
#elif defined(__WXMGL__) #elif defined(__WXMGL__)
#include "wx/mgl/colour.h" #include "wx/mgl/colour.h"
#elif defined(__WXX11__)
#include "wx/x11/colour.h"
#elif defined(__WXMAC__) #elif defined(__WXMAC__)
#include "wx/mac/colour.h" #include "wx/mac/colour.h"
#elif defined(__WXPM__) #elif defined(__WXPM__)

View File

@@ -7,6 +7,8 @@
#include "wx/motif/cursor.h" #include "wx/motif/cursor.h"
#elif defined(__WXGTK__) #elif defined(__WXGTK__)
#include "wx/gtk/cursor.h" #include "wx/gtk/cursor.h"
#elif defined(__WXX11__)
#include "wx/x11/cursor.h"
#elif defined(__WXMGL__) #elif defined(__WXMGL__)
#include "wx/mgl/cursor.h" #include "wx/mgl/cursor.h"
#elif defined(__WXMAC__) #elif defined(__WXMAC__)

View File

@@ -79,6 +79,8 @@ public:
#include "wx/motif/dataform.h" #include "wx/motif/dataform.h"
#elif defined(__WXGTK__) #elif defined(__WXGTK__)
#include "wx/gtk/dataform.h" #include "wx/gtk/dataform.h"
#elif defined(__WXX11__)
#include "wx/x11/dataform.h"
#elif defined(__WXMAC__) #elif defined(__WXMAC__)
#include "wx/mac/dataform.h" #include "wx/mac/dataform.h"
#elif defined(__WXPM__) #elif defined(__WXPM__)

View File

@@ -758,6 +758,8 @@ private:
#include "wx/motif/dc.h" #include "wx/motif/dc.h"
#elif defined(__WXGTK__) #elif defined(__WXGTK__)
#include "wx/gtk/dc.h" #include "wx/gtk/dc.h"
#elif defined(__WXX11__)
#include "wx/x11/dc.h"
#elif defined(__WXMGL__) #elif defined(__WXMGL__)
#include "wx/mgl/dc.h" #include "wx/mgl/dc.h"
#elif defined(__WXMAC__) #elif defined(__WXMAC__)

View File

@@ -7,6 +7,8 @@
#include "wx/motif/dcclient.h" #include "wx/motif/dcclient.h"
#elif defined(__WXGTK__) #elif defined(__WXGTK__)
#include "wx/gtk/dcclient.h" #include "wx/gtk/dcclient.h"
#elif defined(__WXX11__)
#include "wx/x11/dcclient.h"
#elif defined(__WXMGL__) #elif defined(__WXMGL__)
#include "wx/mgl/dcclient.h" #include "wx/mgl/dcclient.h"
#elif defined(__WXMAC__) #elif defined(__WXMAC__)

View File

@@ -7,6 +7,8 @@
#include "wx/motif/dcmemory.h" #include "wx/motif/dcmemory.h"
#elif defined(__WXGTK__) #elif defined(__WXGTK__)
#include "wx/gtk/dcmemory.h" #include "wx/gtk/dcmemory.h"
#elif defined(__WXX11__)
#include "wx/x11/dcmemory.h"
#elif defined(__WXMGL__) #elif defined(__WXMGL__)
#include "wx/mgl/dcmemory.h" #include "wx/mgl/dcmemory.h"
#elif defined(__WXMAC__) #elif defined(__WXMAC__)

View File

@@ -7,6 +7,8 @@
#include "wx/motif/dcscreen.h" #include "wx/motif/dcscreen.h"
#elif defined(__WXGTK__) #elif defined(__WXGTK__)
#include "wx/gtk/dcscreen.h" #include "wx/gtk/dcscreen.h"
#elif defined(__WXX11__)
#include "wx/x11/dcscreen.h"
#elif defined(__WXMGL__) #elif defined(__WXMGL__)
#include "wx/mgl/dcscreen.h" #include "wx/mgl/dcscreen.h"
#elif defined(__WXMAC__) #elif defined(__WXMAC__)

View File

@@ -27,7 +27,7 @@
#error "Target can't be both X and Windows" #error "Target can't be both X and Windows"
#elif !defined(__WXMOTIF__) && !defined(__WXMSW__) && !defined(__WXGTK__) && \ #elif !defined(__WXMOTIF__) && !defined(__WXMSW__) && !defined(__WXGTK__) && \
!defined(__WXPM__) && !defined(__WXMAC__) && !defined(__X__) && \ !defined(__WXPM__) && !defined(__WXMAC__) && !defined(__X__) && \
!defined(__WXMGL__) && wxUSE_GUI !defined(__WXMGL__) && !defined(__WXX11__) && wxUSE_GUI
#ifdef __UNIX__ #ifdef __UNIX__
#error "No Target! You should use wx-config program for compilation flags!" #error "No Target! You should use wx-config program for compilation flags!"
#else // !Unix #else // !Unix
@@ -424,6 +424,7 @@ enum
wxGEOS, // GEOS wxGEOS, // GEOS
wxOS2_PM, // OS/2 Workplace wxOS2_PM, // OS/2 Workplace
wxWINDOWS, // Windows or WfW wxWINDOWS, // Windows or WfW
wxMICROWINDOWS, // MicroWindows
wxPENWINDOWS, // Windows for Pen Computing wxPENWINDOWS, // Windows for Pen Computing
wxWINDOWS_NT, // Windows NT wxWINDOWS_NT, // Windows NT
wxWIN32S, // Windows 32S API wxWIN32S, // Windows 32S API
@@ -435,7 +436,8 @@ enum
wxMGL_OS2, // MGL on OS/2 wxMGL_OS2, // MGL on OS/2
wxMGL_DOS, // MGL on MS-DOS wxMGL_DOS, // MGL on MS-DOS
wxWINDOWS_OS2, // Native OS/2 PM wxWINDOWS_OS2, // Native OS/2 PM
wxUNIX // wxBase under Unix wxUNIX, // wxBase under Unix
wxX11 // Plain X11 and Universal widgets
}; };
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -1852,7 +1854,7 @@ typedef WXRESULT (_System *WXFARPROC)(WXHWND, WXMSGID, WXWPARAM, WXLPARAM);
#endif //__WXPM__ #endif //__WXPM__
#ifdef __WXMOTIF__ #if defined(__WXMOTIF__) || defined(__WXX11__)
/* Stand-ins for X/Xt/Motif types */ /* Stand-ins for X/Xt/Motif types */
typedef void* WXWindow; typedef void* WXWindow;
typedef void* WXWidget; typedef void* WXWidget;

View File

@@ -21,6 +21,8 @@ WXDLLEXPORT_DATA(extern const wxChar*) wxEmptyString;
#include "wx/generic/dirdlgg.h" #include "wx/generic/dirdlgg.h"
#elif defined(__WXGTK__) #elif defined(__WXGTK__)
#include "wx/generic/dirdlgg.h" #include "wx/generic/dirdlgg.h"
#elif defined(__WXX11__)
#include "wx/generic/dirdlgg.h"
#elif defined(__WXMGL__) #elif defined(__WXMGL__)
#include "wx/generic/dirdlgg.h" #include "wx/generic/dirdlgg.h"
#elif defined(__WXMAC__) #elif defined(__WXMAC__)

View File

@@ -187,6 +187,8 @@ protected:
#include "wx/msw/ole/droptgt.h" #include "wx/msw/ole/droptgt.h"
#elif defined(__WXMOTIF__) #elif defined(__WXMOTIF__)
#include "wx/motif/dnd.h" #include "wx/motif/dnd.h"
#elif defined(__WXX11__)
#include "wx/x11/dnd.h"
#elif defined(__WXGTK__) #elif defined(__WXGTK__)
#include "wx/gtk/dnd.h" #include "wx/gtk/dnd.h"
#elif defined(__WXMAC__) #elif defined(__WXMAC__)

View File

@@ -22,6 +22,11 @@
#define wxDragImage wxGenericDragImage #define wxDragImage wxGenericDragImage
#define sm_classwxDragImage sm_classwxGenericDragImage #define sm_classwxDragImage sm_classwxGenericDragImage
#elif defined(__WXX11__)
#include "wx/generic/dragimgg.h"
#define wxDragImage wxGenericDragImage
#define sm_classwxDragImage sm_classwxGenericDragImage
#elif defined(__WXMAC__) #elif defined(__WXMAC__)
#include "wx/generic/dragimgg.h" #include "wx/generic/dragimgg.h"
#define wxDragImage wxGenericDragImage #define wxDragImage wxGenericDragImage

View File

@@ -20,6 +20,8 @@ enum
#include "wx/motif/filedlg.h" #include "wx/motif/filedlg.h"
#elif defined(__WXGTK__) #elif defined(__WXGTK__)
#include "wx/generic/filedlgg.h" #include "wx/generic/filedlgg.h"
#elif defined(__WXX11__)
#include "wx/generic/filedlg.h"
#elif defined(__WXMGL__) #elif defined(__WXMGL__)
#include "wx/generic/filedlgg.h" #include "wx/generic/filedlgg.h"
#elif defined(__WXMAC__) #elif defined(__WXMAC__)

View File

@@ -166,6 +166,8 @@ private:
#include "wx/motif/font.h" #include "wx/motif/font.h"
#elif defined(__WXGTK__) #elif defined(__WXGTK__)
#include "wx/gtk/font.h" #include "wx/gtk/font.h"
#elif defined(__WXX11__)
#include "wx/x11/font.h"
#elif defined(__WXMGL__) #elif defined(__WXMGL__)
#include "wx/mgl/font.h" #include "wx/mgl/font.h"
#elif defined(__WXMAC__) #elif defined(__WXMAC__)

View File

@@ -166,6 +166,9 @@ enum wxStockCursor
#elif defined(__WXMOTIF__) #elif defined(__WXMOTIF__)
// Initialize from an included XPM // Initialize from an included XPM
#define wxICON(X) wxIcon( X##_xpm ) #define wxICON(X) wxIcon( X##_xpm )
#elif defined(__WXX11__)
// Initialize from an included XPM
#define wxICON(X) wxIcon( X##_xpm )
#else #else
// This will usually mean something on any platform // This will usually mean something on any platform
#define wxICON(X) wxIcon("" #X "") #define wxICON(X) wxIcon("" #X "")
@@ -177,7 +180,7 @@ enum wxStockCursor
#if defined(__WXMSW__) || defined(__WXPM__) #if defined(__WXMSW__) || defined(__WXPM__)
#define wxBITMAP(name) wxBitmap(#name, wxBITMAP_TYPE_RESOURCE) #define wxBITMAP(name) wxBitmap(#name, wxBITMAP_TYPE_RESOURCE)
#elif defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXMAC__) || defined(__WXMGL__) #elif defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXX11__) || defined(__WXMAC__) || defined(__WXMGL__)
// Initialize from an included XPM // Initialize from an included XPM
#define wxBITMAP(name) wxBitmap( (const char**) name##_xpm ) #define wxBITMAP(name) wxBitmap( (const char**) name##_xpm )
#else // other platforms #else // other platforms
@@ -213,8 +216,7 @@ public:
wxSize operator+(const wxSize& sz) { return wxSize(x + sz.x, y + sz.y); } wxSize operator+(const wxSize& sz) { return wxSize(x + sz.x, y + sz.y); }
wxSize operator-(const wxSize& sz) { return wxSize(x - sz.x, y - sz.y); } wxSize operator-(const wxSize& sz) { return wxSize(x - sz.x, y - sz.y); }
// accessors // accessors void Set(int xx, int yy) { x = xx; y = yy; }
void Set(int xx, int yy) { x = xx; y = yy; }
void SetWidth(int w) { x = w; } void SetWidth(int w) { x = w; }
void SetHeight(int h) { y = h; } void SetHeight(int h) { y = h; }

View File

@@ -7,6 +7,8 @@
#include "wx/motif/gdiobj.h" #include "wx/motif/gdiobj.h"
#elif defined(__WXGTK__) #elif defined(__WXGTK__)
#include "wx/gtk/gdiobj.h" #include "wx/gtk/gdiobj.h"
#elif defined(__WXX11__)
#include "wx/x11/gdiobj.h"
#elif defined(__WXMGL__) #elif defined(__WXMGL__)
#include "wx/mgl/gdiobj.h" #include "wx/mgl/gdiobj.h"
#elif defined(__WXMAC__) #elif defined(__WXMAC__)

View File

@@ -11,6 +11,8 @@
#include "wx/motif/glcanvas.h" #include "wx/motif/glcanvas.h"
#elif defined(__WXGTK__) #elif defined(__WXGTK__)
#include "wx/gtk/glcanvas.h" #include "wx/gtk/glcanvas.h"
#elif defined(__WXX11__)
#include "wx/x11/glcanvas.h"
#elif defined(__WXMAC__) #elif defined(__WXMAC__)
#include "wx/mac/glcanvas.h" #include "wx/mac/glcanvas.h"
#elif defined(__WXPM__) #elif defined(__WXPM__)

View File

@@ -13,6 +13,8 @@
#include "wx/motif/icon.h" #include "wx/motif/icon.h"
#elif defined(__WXGTK__) #elif defined(__WXGTK__)
#include "wx/gtk/icon.h" #include "wx/gtk/icon.h"
#elif defined(__WXX11__)
#include "wx/x11/icon.h"
#elif defined(__WXMGL__) #elif defined(__WXMGL__)
#include "wx/mgl/icon.h" #include "wx/mgl/icon.h"
#elif defined(__WXMAC__) #elif defined(__WXMAC__)

View File

@@ -9,6 +9,8 @@
#include "wx/motif/joystick.h" #include "wx/motif/joystick.h"
#elif defined(__WXGTK__) #elif defined(__WXGTK__)
#include "wx/gtk/joystick.h" #include "wx/gtk/joystick.h"
#elif defined(__WXX11__)
#include "wx/x11/joystick.h"
#elif defined(__WXMAC__) #elif defined(__WXMAC__)
#include "wx/mac/joystick.h" #include "wx/mac/joystick.h"
#elif defined(__WXPM__) #elif defined(__WXPM__)

View File

@@ -7,6 +7,8 @@
#include "wx/motif/mdi.h" #include "wx/motif/mdi.h"
#elif defined(__WXGTK__) #elif defined(__WXGTK__)
#include "wx/gtk/mdi.h" #include "wx/gtk/mdi.h"
#elif defined(__WXX11__)
#include "wx/x11/mdi.h"
#elif defined(__WXMAC__) #elif defined(__WXMAC__)
#include "wx/mac/mdi.h" #include "wx/mac/mdi.h"
#elif defined(__WXPM__) #elif defined(__WXPM__)

View File

@@ -7,6 +7,8 @@
#include "wx/motif/minifram.h" #include "wx/motif/minifram.h"
#elif defined(__WXGTK__) #elif defined(__WXGTK__)
#include "wx/gtk/minifram.h" #include "wx/gtk/minifram.h"
#elif defined(__WXX11__)
#include "wx/x11/minifram.h"
#elif defined(__WXMAC__) #elif defined(__WXMAC__)
#include "wx/mac/minifram.h" #include "wx/mac/minifram.h"
#elif defined(__WXPM__) #elif defined(__WXPM__)

View File

@@ -20,76 +20,27 @@
#include "wx/string.h" #include "wx/string.h"
#include "wx/event.h" #include "wx/event.h"
class WXDLLEXPORT wxAcceleratorTable;
#if 0
// Hold Ctrl key down
#define wxACCEL_ALT 0x01
// Hold Ctrl key down
#define wxACCEL_CTRL 0x02
// Hold Shift key down
#define wxACCEL_SHIFT 0x04
// Hold no key down
#define wxACCEL_NORMAL 0x00
class WXDLLEXPORT wxAcceleratorEntry
{
public:
wxAcceleratorEntry(const wxAcceleratorEntry& entry)
{
m_flags = entry.m_flags; m_keyCode = entry.m_keyCode; m_command = entry.m_command;
}
wxAcceleratorEntry(int flags = 0, int keyCode = 0, int cmd = 0)
{
m_flags = flags; m_keyCode = keyCode; m_command = cmd;
}
void Set(int flags, int keyCode, int cmd)
{ m_flags = flags; m_keyCode = keyCode; m_command = cmd; }
int GetFlags() const { return m_flags; }
int GetKeyCode() const { return m_keyCode; }
int GetCommand() const { return m_command; }
void operator = (const wxAcceleratorEntry& entry)
{
m_flags = entry.m_flags; m_keyCode = entry.m_keyCode; m_command = entry.m_command;
}
// Implementation use only
bool MatchesEvent(const wxKeyEvent& event) const;
public:
int m_flags;
int m_keyCode; // ASCII or virtual keycode
int m_command; // Command id to generate
};
#endif
class WXDLLEXPORT wxAcceleratorTable: public wxObject class WXDLLEXPORT wxAcceleratorTable: public wxObject
{ {
DECLARE_DYNAMIC_CLASS(wxAcceleratorTable) DECLARE_DYNAMIC_CLASS(wxAcceleratorTable)
public: public:
wxAcceleratorTable(); wxAcceleratorTable();
wxAcceleratorTable(const wxString& resource); // Load from .rc resource wxAcceleratorTable(const wxString& resource); // Load from .rc resource
wxAcceleratorTable(int n, wxAcceleratorEntry entries[]); // Load from array wxAcceleratorTable(int n, wxAcceleratorEntry entries[]); // Load from array
// Copy constructors // Copy constructors
wxAcceleratorTable(const wxAcceleratorTable& accel) { Ref(accel); } wxAcceleratorTable(const wxAcceleratorTable& accel) { Ref(accel); }
wxAcceleratorTable(const wxAcceleratorTable* accel) { if (accel) Ref(*accel); } wxAcceleratorTable(const wxAcceleratorTable* accel) { if (accel) Ref(*accel); }
~wxAcceleratorTable(); ~wxAcceleratorTable();
wxAcceleratorTable& operator = (const wxAcceleratorTable& accel) { if (*this == accel) return (*this); Ref(accel); return *this; } wxAcceleratorTable& operator = (const wxAcceleratorTable& accel) { if (*this == accel) return (*this); Ref(accel); return *this; }
bool operator == (const wxAcceleratorTable& accel) { return m_refData == accel.m_refData; } bool operator == (const wxAcceleratorTable& accel) { return m_refData == accel.m_refData; }
bool operator != (const wxAcceleratorTable& accel) { return m_refData != accel.m_refData; } bool operator != (const wxAcceleratorTable& accel) { return m_refData != accel.m_refData; }
bool Ok() const; bool Ok() const;
// Implementation only // Implementation only
int GetCount() const; int GetCount() const;
wxAcceleratorEntry* GetEntries() const; wxAcceleratorEntry* GetEntries() const;
}; };
@@ -97,4 +48,4 @@ public:
WXDLLEXPORT_DATA(extern wxAcceleratorTable) wxNullAcceleratorTable; WXDLLEXPORT_DATA(extern wxAcceleratorTable) wxNullAcceleratorTable;
#endif #endif
// _WX_ACCEL_H_ // _WX_ACCEL_H_

View File

@@ -13,7 +13,7 @@
#define _WX_APP_H_ #define _WX_APP_H_
#ifdef __GNUG__ #ifdef __GNUG__
#pragma interface "app.h" #pragma interface "app.h"
#endif #endif
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -39,93 +39,93 @@ class WXDLLEXPORT wxLog;
class WXDLLEXPORT wxApp : public wxAppBase class WXDLLEXPORT wxApp : public wxAppBase
{ {
DECLARE_DYNAMIC_CLASS(wxApp) DECLARE_DYNAMIC_CLASS(wxApp)
public: public:
wxApp(); wxApp();
~wxApp() {} ~wxApp() {}
// override base class (pure) virtuals // override base class (pure) virtuals
// ----------------------------------- // -----------------------------------
virtual int MainLoop(); virtual int MainLoop();
virtual void ExitMainLoop(); virtual void ExitMainLoop();
virtual bool Initialized(); virtual bool Initialized();
virtual bool Pending(); virtual bool Pending();
virtual void Dispatch(); virtual void Dispatch();
virtual bool Yield(bool onlyIfNeeded = FALSE); virtual bool Yield(bool onlyIfNeeded = FALSE);
virtual bool OnInitGui(); virtual bool OnInitGui();
virtual wxIcon GetStdIcon(int which) const; virtual wxIcon GetStdIcon(int which) const;
// implementation from now on // implementation from now on
// -------------------------- // --------------------------
void OnIdle(wxIdleEvent& event); void OnIdle(wxIdleEvent& event);
// Send idle event to all top-level windows. // Send idle event to all top-level windows.
// Returns TRUE if more idle time is requested. // Returns TRUE if more idle time is requested.
bool SendIdleEvents(); bool SendIdleEvents();
// Send idle event to window and all subwindows // Send idle event to window and all subwindows
// Returns TRUE if more idle time is requested. // Returns TRUE if more idle time is requested.
bool SendIdleEvents(wxWindow* win); bool SendIdleEvents(wxWindow* win);
// Motif implementation. // Motif implementation.
// Processes an X event. // Processes an X event.
virtual void ProcessXEvent(WXEvent* event); virtual void ProcessXEvent(WXEvent* event);
// Returns TRUE if an accelerator has been processed // Returns TRUE if an accelerator has been processed
virtual bool CheckForAccelerator(WXEvent* event); virtual bool CheckForAccelerator(WXEvent* event);
// Returns TRUE if a key down event has been processed // Returns TRUE if a key down event has been processed
virtual bool CheckForKeyDown(WXEvent* event); virtual bool CheckForKeyDown(WXEvent* event);
// Returns TRUE if a key up event has been processed // Returns TRUE if a key up event has been processed
virtual bool CheckForKeyUp(WXEvent* event); virtual bool CheckForKeyUp(WXEvent* event);
protected: protected:
bool m_showOnInit; bool m_showOnInit;
public: public:
// Implementation // Implementation
static bool Initialize(); static bool Initialize();
static void CleanUp(); static void CleanUp();
void DeletePendingObjects(); void DeletePendingObjects();
bool ProcessIdle(); bool ProcessIdle();
// Motif-specific // Motif-specific
WXAppContext GetAppContext() const { return m_appContext; } WXAppContext GetAppContext() const { return m_appContext; }
WXWidget GetTopLevelWidget() const { return m_topLevelWidget; } WXWidget GetTopLevelWidget() const { return m_topLevelWidget; }
WXColormap GetMainColormap(WXDisplay* display); WXColormap GetMainColormap(WXDisplay* display);
WXDisplay* GetInitialDisplay() const { return m_initialDisplay; } WXDisplay* GetInitialDisplay() const { return m_initialDisplay; }
long GetMaxRequestSize() const { return m_maxRequestSize; } long GetMaxRequestSize() const { return m_maxRequestSize; }
// This handler is called when a property change event occurs // This handler is called when a property change event occurs
virtual void HandlePropertyChange(WXEvent *event); virtual void HandlePropertyChange(WXEvent *event);
public: public:
static long sm_lastMessageTime; static long sm_lastMessageTime;
int m_nCmdShow; int m_nCmdShow;
protected: protected:
bool m_keepGoing; bool m_keepGoing;
// Motif-specific // Motif-specific
WXAppContext m_appContext; WXAppContext m_appContext;
WXWidget m_topLevelWidget; WXWidget m_topLevelWidget;
WXColormap m_mainColormap; WXColormap m_mainColormap;
WXDisplay* m_initialDisplay; WXDisplay* m_initialDisplay;
long m_maxRequestSize; long m_maxRequestSize;
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };
int WXDLLEXPORT wxEntry( int argc, char *argv[] ); int WXDLLEXPORT wxEntry( int argc, char *argv[] );
#endif #endif
// _WX_APP_H_ // _WX_APP_H_

View File

@@ -33,33 +33,33 @@ class WXDLLEXPORT wxImage;
// transparently. // transparently.
class WXDLLEXPORT wxMask: public wxObject class WXDLLEXPORT 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 // Construct a mask from a bitmap and a colour indicating
// the transparent area // the transparent area
wxMask(const wxBitmap& bitmap, const wxColour& colour); wxMask(const wxBitmap& bitmap, const wxColour& colour);
// Construct a mask from a bitmap and a palette index indicating // Construct a mask from a bitmap and a palette index indicating
// the transparent area // the transparent area
wxMask(const wxBitmap& bitmap, int paletteIndex); wxMask(const wxBitmap& bitmap, int paletteIndex);
// Construct a mask from a mono bitmap (copies the bitmap). // Construct a mask from a mono bitmap (copies the bitmap).
wxMask(const wxBitmap& bitmap); wxMask(const wxBitmap& bitmap);
~wxMask(); ~wxMask();
bool Create(const wxBitmap& bitmap, const wxColour& colour); bool Create(const wxBitmap& bitmap, const wxColour& colour);
bool Create(const wxBitmap& bitmap, int paletteIndex); bool Create(const wxBitmap& bitmap, int paletteIndex);
bool Create(const wxBitmap& bitmap); bool Create(const wxBitmap& bitmap);
WXPixmap GetPixmap() const { return m_pixmap; } WXPixmap GetPixmap() const { return m_pixmap; }
void SetPixmap(WXPixmap pixmap) { m_pixmap = pixmap; } void SetPixmap(WXPixmap pixmap) { m_pixmap = pixmap; }
protected: protected:
WXPixmap m_pixmap; WXPixmap m_pixmap;
}; };
class WXDLLEXPORT wxBitmapRefData: public wxGDIRefData class WXDLLEXPORT wxBitmapRefData: public wxGDIRefData
@@ -70,153 +70,153 @@ class WXDLLEXPORT wxBitmapRefData: public wxGDIRefData
public: public:
wxBitmapRefData(); wxBitmapRefData();
~wxBitmapRefData(); ~wxBitmapRefData();
public: public:
int m_width; int m_width;
int m_height; int m_height;
int m_depth; int m_depth;
bool m_ok; bool m_ok;
int m_numColors; int m_numColors;
wxPalette m_bitmapPalette; wxPalette m_bitmapPalette;
int m_quality; int m_quality;
wxMask * m_bitmapMask; // Optional mask wxMask * m_bitmapMask; // Optional mask
// Motif implementation // Motif implementation
public: public:
WXPixmap m_pixmap; WXPixmap m_pixmap;
WXDisplay* m_display; WXDisplay* m_display;
bool m_freePixmap; bool m_freePixmap;
unsigned long* m_freeColors; unsigned long* m_freeColors;
long m_freeColorsCount; long m_freeColorsCount;
// These 5 variables are for wxControl // These 5 variables are for wxControl
WXPixmap m_insensPixmap ; WXPixmap m_insensPixmap ;
WXPixmap m_labelPixmap ; WXPixmap m_labelPixmap ;
WXPixmap m_armPixmap ; WXPixmap m_armPixmap ;
WXImage* m_image ; WXImage* m_image ;
WXImage* m_insensImage ; WXImage* m_insensImage ;
}; };
#define M_BITMAPDATA ((wxBitmapRefData *)m_refData) #define M_BITMAPDATA ((wxBitmapRefData *)m_refData)
class WXDLLEXPORT wxBitmapHandler: public wxObject class WXDLLEXPORT wxBitmapHandler: public wxObject
{ {
DECLARE_DYNAMIC_CLASS(wxBitmapHandler) DECLARE_DYNAMIC_CLASS(wxBitmapHandler)
public: public:
wxBitmapHandler() { m_name = ""; m_extension = ""; m_type = 0; }; 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 Create(wxBitmap *bitmap, void *data, long flags, int width, int height, int depth = 1);
virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, long flags, virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, long flags,
int desiredWidth, int desiredHeight); int desiredWidth, int desiredHeight);
virtual bool SaveFile(wxBitmap *bitmap, const wxString& name, int type, const wxPalette *palette = NULL); virtual bool SaveFile(wxBitmap *bitmap, const wxString& name, int type, const wxPalette *palette = NULL);
void SetName(const wxString& name) { m_name = name; } void SetName(const wxString& name) { m_name = name; }
void SetExtension(const wxString& ext) { m_extension = ext; } void SetExtension(const wxString& ext) { m_extension = ext; }
void SetType(long type) { m_type = type; } void SetType(long type) { m_type = type; }
wxString GetName() const { return m_name; } wxString GetName() const { return m_name; }
wxString GetExtension() const { return m_extension; } wxString GetExtension() const { return m_extension; }
long GetType() const { return m_type; } long GetType() const { return m_type; }
protected: protected:
wxString m_name; wxString m_name;
wxString m_extension; wxString m_extension;
long m_type; long m_type;
}; };
#define M_BITMAPHANDLERDATA ((wxBitmapRefData *)bitmap->GetRefData()) #define M_BITMAPHANDLERDATA ((wxBitmapRefData *)bitmap->GetRefData())
class WXDLLEXPORT wxBitmap: public wxGDIObject class WXDLLEXPORT wxBitmap: public wxGDIObject
{ {
DECLARE_DYNAMIC_CLASS(wxBitmap) DECLARE_DYNAMIC_CLASS(wxBitmap)
friend class WXDLLEXPORT wxBitmapHandler; friend class WXDLLEXPORT wxBitmapHandler;
public:
wxBitmap(); // Platform-specific
// Copy constructors
wxBitmap(const wxBitmap& bitmap)
{ Ref(bitmap); }
// Initialize with raw XBM data
wxBitmap(const char bits[], int width, int height, int depth = 1);
// from XPM
wxBitmap(const char **data) { (void)CreateFromXpm(data); }
wxBitmap(char **data) { (void)CreateFromXpm((const char **)data); }
// Initialize with XPM data -- deprecated
wxBitmap(char **data, wxControl* control);
// Load a file or resource
wxBitmap(const wxString& name, long type = wxBITMAP_TYPE_XPM);
// Constructor for generalised creation from data
wxBitmap(void *data, long type, int width, int height, int depth = 1);
// If depth is omitted, will create a bitmap compatible with the display
wxBitmap(int width, int height, int depth = -1);
// Convert from wxImage:
wxBitmap(const wxImage& image, int depth = -1) { (void)CreateFromImage(image, depth); }
~wxBitmap();
virtual bool Create(int width, int height, int depth = -1);
virtual bool Create(void *data, long type, int width, int height, int depth = 1);
wxBitmap GetSubBitmap( const wxRect& rect ) const;
virtual bool LoadFile(const wxString& name, long type = wxBITMAP_TYPE_XPM);
virtual bool SaveFile(const wxString& name, int type, const wxPalette *cmap = NULL);
wxImage ConvertToImage() const;
bool Ok() const { return (M_BITMAPDATA && M_BITMAPDATA->m_ok); }
int GetWidth() const { return (M_BITMAPDATA ? M_BITMAPDATA->m_width : 0); }
int GetHeight() const { return (M_BITMAPDATA ? M_BITMAPDATA->m_height : 0); }
int GetDepth() const { return (M_BITMAPDATA ? M_BITMAPDATA->m_depth : 0); }
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);
wxPalette* GetPalette() const { return (M_BITMAPDATA ? (& M_BITMAPDATA->m_bitmapPalette) : (wxPalette*) NULL); }
void SetPalette(const wxPalette& palette);
wxMask *GetMask() const { return (M_BITMAPDATA ? M_BITMAPDATA->m_bitmapMask : (wxMask*) NULL); }
void SetMask(wxMask *mask) ;
wxBitmap& operator = (const wxBitmap& bitmap) { if (*this == bitmap) return (*this); Ref(bitmap); return *this; }
bool operator == (const wxBitmap& bitmap) const { return m_refData == bitmap.m_refData; }
bool operator != (const wxBitmap& bitmap) const { return m_refData != bitmap.m_refData; }
// Format handling
static 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();
// Motif implementation
public: public:
WXDisplay* GetDisplay() const { return M_BITMAPDATA->m_display; } wxBitmap(); // Platform-specific
WXPixmap GetPixmap() const { return (WXPixmap) M_BITMAPDATA->m_pixmap; }
virtual WXPixmap GetLabelPixmap(WXWidget w) ; // Copy constructors
virtual WXPixmap GetArmPixmap(WXWidget w) ; wxBitmap(const wxBitmap& bitmap)
virtual WXPixmap GetInsensPixmap(WXWidget w = (WXWidget) 0) ; { Ref(bitmap); }
void SetPixmapNull() { M_BITMAPDATA->m_pixmap = 0; }
// Initialize with raw XBM data
wxBitmap(const char bits[], int width, int height, int depth = 1);
// from XPM
wxBitmap(const char **data) { (void)CreateFromXpm(data); }
wxBitmap(char **data) { (void)CreateFromXpm((const char **)data); }
// Initialize with XPM data -- deprecated
wxBitmap(char **data, wxControl* control);
// Load a file or resource
wxBitmap(const wxString& name, long type = wxBITMAP_TYPE_XPM);
// Constructor for generalised creation from data
wxBitmap(void *data, long type, int width, int height, int depth = 1);
// If depth is omitted, will create a bitmap compatible with the display
wxBitmap(int width, int height, int depth = -1);
// Convert from wxImage:
wxBitmap(const wxImage& image, int depth = -1) { (void)CreateFromImage(image, depth); }
~wxBitmap();
virtual bool Create(int width, int height, int depth = -1);
virtual bool Create(void *data, long type, int width, int height, int depth = 1);
wxBitmap GetSubBitmap( const wxRect& rect ) const;
virtual bool LoadFile(const wxString& name, long type = wxBITMAP_TYPE_XPM);
virtual bool SaveFile(const wxString& name, int type, const wxPalette *cmap = NULL);
wxImage ConvertToImage() const;
bool Ok() const { return (M_BITMAPDATA && M_BITMAPDATA->m_ok); }
int GetWidth() const { return (M_BITMAPDATA ? M_BITMAPDATA->m_width : 0); }
int GetHeight() const { return (M_BITMAPDATA ? M_BITMAPDATA->m_height : 0); }
int GetDepth() const { return (M_BITMAPDATA ? M_BITMAPDATA->m_depth : 0); }
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);
wxPalette* GetPalette() const { return (M_BITMAPDATA ? (& M_BITMAPDATA->m_bitmapPalette) : (wxPalette*) NULL); }
void SetPalette(const wxPalette& palette);
wxMask *GetMask() const { return (M_BITMAPDATA ? M_BITMAPDATA->m_bitmapMask : (wxMask*) NULL); }
void SetMask(wxMask *mask) ;
wxBitmap& operator = (const wxBitmap& bitmap) { if (*this == bitmap) return (*this); Ref(bitmap); return *this; }
bool operator == (const wxBitmap& bitmap) const { return m_refData == bitmap.m_refData; }
bool operator != (const wxBitmap& bitmap) const { return m_refData != bitmap.m_refData; }
// Format handling
static 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();
// Motif implementation
public:
WXDisplay* GetDisplay() const { return M_BITMAPDATA->m_display; }
WXPixmap GetPixmap() const { return (WXPixmap) M_BITMAPDATA->m_pixmap; }
virtual WXPixmap GetLabelPixmap(WXWidget w) ;
virtual WXPixmap GetArmPixmap(WXWidget w) ;
virtual WXPixmap GetInsensPixmap(WXWidget w = (WXWidget) 0) ;
void SetPixmapNull() { M_BITMAPDATA->m_pixmap = 0; }
protected: protected:
static wxList sm_handlers; static wxList sm_handlers;
protected: protected:
bool CreateFromXpm(const char **bits); bool CreateFromXpm(const char **bits);
bool CreateFromImage(const wxImage& image, int depth); bool CreateFromImage(const wxImage& image, int depth);
@@ -227,4 +227,4 @@ protected:
wxBitmap wxCreateMaskedBitmap(const wxBitmap& bitmap, wxColour& colour); wxBitmap wxCreateMaskedBitmap(const wxBitmap& bitmap, wxColour& colour);
#endif #endif
// _WX_BITMAP_H_ // _WX_BITMAP_H_

View File

@@ -24,70 +24,70 @@ WXDLLEXPORT_DATA(extern const char*) wxButtonNameStr;
class WXDLLEXPORT wxBitmapButton: public wxButton class WXDLLEXPORT wxBitmapButton: public wxButton
{ {
DECLARE_DYNAMIC_CLASS(wxBitmapButton) DECLARE_DYNAMIC_CLASS(wxBitmapButton)
public: public:
wxBitmapButton(); wxBitmapButton();
~wxBitmapButton(); ~wxBitmapButton();
inline wxBitmapButton(wxWindow *parent, wxWindowID id, const wxBitmap& bitmap, inline wxBitmapButton(wxWindow *parent, wxWindowID id, const wxBitmap& bitmap,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = wxBU_AUTODRAW, const wxSize& size = wxDefaultSize, long style = wxBU_AUTODRAW,
const wxValidator& validator = wxDefaultValidator, const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxButtonNameStr) const wxString& name = wxButtonNameStr)
{ {
Create(parent, id, bitmap, pos, size, style, validator, name); Create(parent, id, bitmap, pos, size, style, validator, name);
} }
bool Create(wxWindow *parent, wxWindowID id, const wxBitmap& bitmap, bool Create(wxWindow *parent, wxWindowID id, const wxBitmap& bitmap,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = wxBU_AUTODRAW, const wxSize& size = wxDefaultSize, long style = wxBU_AUTODRAW,
const wxValidator& validator = wxDefaultValidator, const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxButtonNameStr); const wxString& name = wxButtonNameStr);
virtual void SetLabel(const wxBitmap& bitmap) virtual void SetLabel(const wxBitmap& bitmap)
{ {
SetBitmapLabel(bitmap); SetBitmapLabel(bitmap);
} }
virtual void SetLabel(const wxString& label) virtual void SetLabel(const wxString& label)
{ {
wxControl::SetLabel(label); wxControl::SetLabel(label);
} }
virtual void SetBitmapLabel(const wxBitmap& bitmap); virtual void SetBitmapLabel(const wxBitmap& bitmap);
inline wxBitmap& GetBitmapLabel() const { return (wxBitmap&) m_buttonBitmap; } inline wxBitmap& GetBitmapLabel() const { return (wxBitmap&) m_buttonBitmap; }
inline wxBitmap& GetBitmapSelected() const { return (wxBitmap&) m_buttonBitmapSelected; } inline wxBitmap& GetBitmapSelected() const { return (wxBitmap&) m_buttonBitmapSelected; }
inline wxBitmap& GetBitmapFocus() const { return (wxBitmap&) m_buttonBitmapFocus; } inline wxBitmap& GetBitmapFocus() const { return (wxBitmap&) m_buttonBitmapFocus; }
inline wxBitmap& GetBitmapDisabled() const { return (wxBitmap&) m_buttonBitmapDisabled; } inline wxBitmap& GetBitmapDisabled() const { return (wxBitmap&) m_buttonBitmapDisabled; }
void SetBitmapSelected(const wxBitmap& sel); void SetBitmapSelected(const wxBitmap& sel);
void SetBitmapFocus(const wxBitmap& focus); void SetBitmapFocus(const wxBitmap& focus);
void SetBitmapDisabled(const wxBitmap& disabled); void SetBitmapDisabled(const wxBitmap& disabled);
inline void SetMargins(int x, int y) { m_marginX = x; m_marginY = y; } inline void SetMargins(int x, int y) { m_marginX = x; m_marginY = y; }
inline int GetMarginX() { return m_marginX; } inline int GetMarginX() { return m_marginX; }
inline int GetMarginY() { return m_marginY; } inline int GetMarginY() { return m_marginY; }
// Implementation // Implementation
void DoSetBitmap(); void DoSetBitmap();
virtual void ChangeBackgroundColour(); virtual void ChangeBackgroundColour();
protected: protected:
wxBitmap m_buttonBitmapFocus; wxBitmap m_buttonBitmapFocus;
wxBitmap m_buttonBitmap; wxBitmap m_buttonBitmap;
wxBitmap m_buttonBitmapOriginal; // May be different from m_buttonBitmap wxBitmap m_buttonBitmapOriginal; // May be different from m_buttonBitmap
// if m_buttonBitmap has been changed // if m_buttonBitmap has been changed
// to reflect button background colour // to reflect button background colour
wxBitmap m_buttonBitmapSelected; wxBitmap m_buttonBitmapSelected;
wxBitmap m_buttonBitmapSelectedOriginal; wxBitmap m_buttonBitmapSelectedOriginal;
wxBitmap m_buttonBitmapDisabled; wxBitmap m_buttonBitmapDisabled;
wxBitmap m_buttonBitmapDisabledOriginal; wxBitmap m_buttonBitmapDisabledOriginal;
int m_marginX; int m_marginX;
int m_marginY; int m_marginY;
WXPixmap m_insensPixmap; WXPixmap m_insensPixmap;
}; };
#endif #endif
// _WX_BMPBUTTN_H_ // _WX_BMPBUTTN_H_

View File

@@ -29,7 +29,7 @@ public:
wxBrushRefData(); wxBrushRefData();
wxBrushRefData(const wxBrushRefData& data); wxBrushRefData(const wxBrushRefData& data);
~wxBrushRefData(); ~wxBrushRefData();
protected: protected:
int m_style; int m_style;
wxBitmap m_stipple ; wxBitmap m_stipple ;
@@ -41,39 +41,39 @@ protected:
// Brush // Brush
class WXDLLEXPORT wxBrush: public wxGDIObject class WXDLLEXPORT wxBrush: public wxGDIObject
{ {
DECLARE_DYNAMIC_CLASS(wxBrush) DECLARE_DYNAMIC_CLASS(wxBrush)
public: public:
wxBrush(); wxBrush();
wxBrush(const wxColour& col, int style); wxBrush(const wxColour& col, int style);
wxBrush(const wxBitmap& stipple); wxBrush(const wxBitmap& stipple);
inline wxBrush(const wxBrush& brush) { Ref(brush); } inline wxBrush(const wxBrush& brush) { Ref(brush); }
~wxBrush(); ~wxBrush();
virtual void SetColour(const wxColour& col) ; virtual void SetColour(const wxColour& col) ;
virtual void SetColour(unsigned char r, unsigned char g, unsigned char b) ; virtual void SetColour(unsigned char r, unsigned char g, unsigned char b) ;
virtual void SetStyle(int style) ; virtual void SetStyle(int style) ;
virtual void SetStipple(const wxBitmap& stipple) ; virtual void SetStipple(const wxBitmap& stipple) ;
inline wxBrush& operator = (const wxBrush& brush) { if (*this == brush) return (*this); Ref(brush); return *this; } inline wxBrush& operator = (const wxBrush& brush) { if (*this == brush) return (*this); Ref(brush); return *this; }
inline bool operator == (const wxBrush& brush) const { return m_refData == brush.m_refData; } inline bool operator == (const wxBrush& brush) const { return m_refData == brush.m_refData; }
inline bool operator != (const wxBrush& brush) const { return m_refData != brush.m_refData; } inline bool operator != (const wxBrush& brush) const { return m_refData != brush.m_refData; }
inline wxColour& GetColour() const { return (M_BRUSHDATA ? M_BRUSHDATA->m_colour : wxNullColour); }; 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 int GetStyle() const { return (M_BRUSHDATA ? M_BRUSHDATA->m_style : 0); };
inline wxBitmap *GetStipple() const { return (M_BRUSHDATA ? & M_BRUSHDATA->m_stipple : 0); }; inline wxBitmap *GetStipple() const { return (M_BRUSHDATA ? & M_BRUSHDATA->m_stipple : 0); };
virtual bool Ok() const { return (m_refData != NULL) ; } virtual bool Ok() const { return (m_refData != NULL) ; }
// Implementation // Implementation
// Useful helper: create the brush resource // Useful helper: create the brush resource
bool RealizeResource(); bool RealizeResource();
// When setting properties, we must make sure we're not changing // When setting properties, we must make sure we're not changing
// another object // another object
void Unshare(); void Unshare();
}; };
#endif #endif
// _WX_BRUSH_H_ // _WX_BRUSH_H_

View File

@@ -13,7 +13,7 @@
#define _WX_BUTTON_H_ #define _WX_BUTTON_H_
#ifdef __GNUG__ #ifdef __GNUG__
#pragma interface "button.h" #pragma interface "button.h"
#endif #endif
#include "wx/control.h" #include "wx/control.h"
@@ -25,29 +25,29 @@ WXDLLEXPORT_DATA(extern const char*) wxButtonNameStr;
class WXDLLEXPORT wxButton: public wxControl class WXDLLEXPORT wxButton: public wxControl
{ {
DECLARE_DYNAMIC_CLASS(wxButton) DECLARE_DYNAMIC_CLASS(wxButton)
public: public:
wxButton() { } wxButton() { }
wxButton(wxWindow *parent, wxButton(wxWindow *parent,
wxWindowID id, wxWindowID id,
const wxString& label, const wxString& label,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0, const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator, const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxButtonNameStr) const wxString& name = wxButtonNameStr)
{ {
Create(parent, id, label, pos, size, style, validator, name); Create(parent, id, label, pos, size, style, validator, name);
} }
bool Create(wxWindow *parent, wxWindowID id, const wxString& label, bool Create(wxWindow *parent, wxWindowID id, const wxString& label,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0, const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator, const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxButtonNameStr); const wxString& name = wxButtonNameStr);
virtual void SetDefault(); virtual void SetDefault();
virtual void Command(wxCommandEvent& event); virtual void Command(wxCommandEvent& event);
static wxSize GetDefaultSize(); static wxSize GetDefaultSize();
// Implementation // Implementation
@@ -57,4 +57,4 @@ public:
}; };
#endif #endif
// _WX_BUTTON_H_ // _WX_BUTTON_H_

View File

@@ -24,68 +24,68 @@ WXDLLEXPORT_DATA(extern const char*) wxCheckBoxNameStr;
class WXDLLEXPORT wxBitmap; class WXDLLEXPORT wxBitmap;
class WXDLLEXPORT wxCheckBox: public wxControl class WXDLLEXPORT wxCheckBox: public wxControl
{ {
DECLARE_DYNAMIC_CLASS(wxCheckBox) DECLARE_DYNAMIC_CLASS(wxCheckBox)
public: public:
inline wxCheckBox() { } inline wxCheckBox() { }
inline wxCheckBox(wxWindow *parent, wxWindowID id, const wxString& label, inline wxCheckBox(wxWindow *parent, wxWindowID id, const wxString& label,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0, const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator, const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxCheckBoxNameStr) const wxString& name = wxCheckBoxNameStr)
{ {
Create(parent, id, label, pos, size, style, validator, name); Create(parent, id, label, pos, size, style, validator, name);
} }
bool Create(wxWindow *parent, wxWindowID id, const wxString& label, bool Create(wxWindow *parent, wxWindowID id, const wxString& label,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0, const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator, const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxCheckBoxNameStr); const wxString& name = wxCheckBoxNameStr);
virtual void SetValue(bool); virtual void SetValue(bool);
virtual bool GetValue() const ; virtual bool GetValue() const ;
virtual void Command(wxCommandEvent& event); virtual void Command(wxCommandEvent& event);
// Implementation // Implementation
virtual void ChangeFont(bool keepOriginalSize = TRUE); virtual void ChangeFont(bool keepOriginalSize = TRUE);
virtual void ChangeBackgroundColour(); virtual void ChangeBackgroundColour();
virtual void ChangeForegroundColour(); virtual void ChangeForegroundColour();
}; };
class WXDLLEXPORT wxBitmapCheckBox: public wxCheckBox class WXDLLEXPORT wxBitmapCheckBox: public wxCheckBox
{ {
DECLARE_DYNAMIC_CLASS(wxBitmapCheckBox) DECLARE_DYNAMIC_CLASS(wxBitmapCheckBox)
public: public:
int checkWidth; int checkWidth;
int checkHeight; int checkHeight;
inline wxBitmapCheckBox() { checkWidth = -1; checkHeight = -1; } inline wxBitmapCheckBox() { checkWidth = -1; checkHeight = -1; }
inline wxBitmapCheckBox(wxWindow *parent, wxWindowID id, const wxBitmap *label, inline wxBitmapCheckBox(wxWindow *parent, wxWindowID id, const wxBitmap *label,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0, const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator, const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxCheckBoxNameStr) const wxString& name = wxCheckBoxNameStr)
{ {
Create(parent, id, label, pos, size, style, validator, name); Create(parent, id, label, pos, size, style, validator, name);
} }
bool Create(wxWindow *parent, wxWindowID id, const wxBitmap *bitmap, bool Create(wxWindow *parent, wxWindowID id, const wxBitmap *bitmap,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0, const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator, const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxCheckBoxNameStr); const wxString& name = wxCheckBoxNameStr);
virtual void SetValue(bool value); virtual void SetValue(bool value);
virtual bool GetValue() const; virtual bool GetValue() const;
virtual void SetLabel(const wxBitmap& bitmap); virtual void SetLabel(const wxBitmap& bitmap);
virtual void SetLabel(const wxString& label) { wxControl::SetLabel(label); }; virtual void SetLabel(const wxString& label) { wxControl::SetLabel(label); };
protected: protected:
virtual void DoSetSize(int x, int y, virtual void DoSetSize(int x, int y,
int width, int height, int width, int height,
int sizeFlags = wxSIZE_AUTO); int sizeFlags = wxSIZE_AUTO);
}; };
#endif #endif
// _WX_CHECKBOX_H_ // _WX_CHECKBOX_H_

View File

@@ -14,34 +14,34 @@
#define _WX_CHECKLST_H_ #define _WX_CHECKLST_H_
#ifdef __GNUG__ #ifdef __GNUG__
#pragma interface "checklst.h" #pragma interface "checklst.h"
#endif #endif
#include "wx/listbox.h" #include "wx/listbox.h"
class wxCheckListBox : public wxListBox class wxCheckListBox : public wxListBox
{ {
DECLARE_DYNAMIC_CLASS(wxCheckListBox) DECLARE_DYNAMIC_CLASS(wxCheckListBox)
public: public:
// ctors // ctors
wxCheckListBox(); wxCheckListBox();
wxCheckListBox(wxWindow *parent, wxWindowID id, wxCheckListBox(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
int nStrings = 0, int nStrings = 0,
const wxString choices[] = NULL, const wxString choices[] = NULL,
long style = 0, long style = 0,
const wxValidator& validator = wxDefaultValidator, const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr); const wxString& name = wxListBoxNameStr);
// items may be checked // items may be checked
bool IsChecked(size_t uiIndex) const; bool IsChecked(size_t uiIndex) const;
void Check(size_t uiIndex, bool bCheck = TRUE); void Check(size_t uiIndex, bool bCheck = TRUE);
private: private:
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };
#endif #endif
// _WX_CHECKLST_H_ // _WX_CHECKLST_H_

View File

@@ -24,30 +24,30 @@ WXDLLEXPORT_DATA(extern const char*) wxChoiceNameStr;
class WXDLLEXPORT wxChoice: public wxControlWithItems class WXDLLEXPORT wxChoice: public wxControlWithItems
{ {
DECLARE_DYNAMIC_CLASS(wxChoice) DECLARE_DYNAMIC_CLASS(wxChoice)
public: public:
wxChoice(); wxChoice();
~wxChoice(); ~wxChoice();
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, long style = 0,
const wxValidator& validator = wxDefaultValidator, const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxChoiceNameStr) const wxString& name = wxChoiceNameStr)
{ {
Create(parent, id, pos, size, n, choices, style, validator, name); Create(parent, id, pos, size, n, choices, style, validator, name);
} }
bool Create(wxWindow *parent, wxWindowID id, bool Create(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, long style = 0,
const wxValidator& validator = wxDefaultValidator, const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxChoiceNameStr); const wxString& name = wxChoiceNameStr);
// Virtual functions required by wxControlWithItems. // Virtual functions required by wxControlWithItems.
// They are not all implemented yet :-( // They are not all implemented yet :-(
virtual int GetCount() const; virtual int GetCount() const;
@@ -61,7 +61,7 @@ public:
virtual wxClientData* DoGetItemClientObject(int n) const; virtual wxClientData* DoGetItemClientObject(int n) const;
virtual void Select(int n); virtual void Select(int n);
virtual void SetString(int n, const wxString& s); virtual void SetString(int n, const wxString& s);
// Original API // Original API
virtual void Append(const wxString& item); virtual void Append(const wxString& item);
virtual void Delete(int n); virtual void Delete(int n);
@@ -70,25 +70,25 @@ public:
virtual void SetSelection(int n); virtual void SetSelection(int n);
virtual int FindString(const wxString& s) const; virtual int FindString(const wxString& s) const;
virtual wxString GetString(int n) const ; virtual wxString GetString(int n) const ;
virtual wxString GetStringSelection() const ; virtual wxString GetStringSelection() const ;
virtual bool SetStringSelection(const wxString& sel); virtual bool SetStringSelection(const wxString& sel);
virtual int Number() const { return m_noStrings; } virtual int Number() const { return m_noStrings; }
virtual void Command(wxCommandEvent& event); virtual void Command(wxCommandEvent& event);
virtual void SetColumns(int n = 1 ); virtual void SetColumns(int n = 1 );
virtual int GetColumns() const ; virtual int GetColumns() const ;
void SetFocus(); void SetFocus();
// Implementation // Implementation
virtual void ChangeFont(bool keepOriginalSize = TRUE); virtual void ChangeFont(bool keepOriginalSize = TRUE);
virtual void ChangeBackgroundColour(); virtual void ChangeBackgroundColour();
virtual void ChangeForegroundColour(); virtual void ChangeForegroundColour();
WXWidget GetTopWidget() const { return m_formWidget; } WXWidget GetTopWidget() const { return m_formWidget; }
WXWidget GetMainWidget() const { return m_buttonWidget; } WXWidget GetMainWidget() const { return m_buttonWidget; }
protected: protected:
int m_noStrings; int m_noStrings;
WXWidget m_menuWidget; WXWidget m_menuWidget;
@@ -97,12 +97,11 @@ protected:
WXWidget m_formWidget; WXWidget m_formWidget;
wxStringList m_stringList; wxStringList m_stringList;
wxList m_clientList; // contains the client data for the items wxList m_clientList; // contains the client data for the items
virtual void DoSetSize(int x, int y, virtual void DoSetSize(int x, int y,
int width, int height, int width, int height,
int sizeFlags = wxSIZE_AUTO); int sizeFlags = wxSIZE_AUTO);
}; };
#endif #endif
// _WX_CHOICE_H_ // _WX_CHOICE_H_

View File

@@ -13,7 +13,7 @@
#define _WX_CLIPBRD_H_ #define _WX_CLIPBRD_H_
#ifdef __GNUG__ #ifdef __GNUG__
#pragma interface "clipbrd.h" #pragma interface "clipbrd.h"
#endif #endif
#if wxUSE_CLIPBOARD #if wxUSE_CLIPBOARD
@@ -40,40 +40,40 @@ class wxClipboard : public wxClipboardBase
public: public:
wxClipboard(); wxClipboard();
~wxClipboard(); ~wxClipboard();
// open the clipboard before SetData() and GetData() // open the clipboard before SetData() and GetData()
virtual bool Open(); virtual bool Open();
// close the clipboard after SetData() and GetData() // close the clipboard after SetData() and GetData()
virtual void Close(); virtual void Close();
// opened? // opened?
virtual bool IsOpened() const { return m_open; } virtual bool IsOpened() const { return m_open; }
// replaces the data on the clipboard with data // replaces the data on the clipboard with data
virtual bool SetData( wxDataObject *data ); virtual bool SetData( wxDataObject *data );
// adds data to the clipboard // adds data to the clipboard
virtual bool AddData( wxDataObject *data ); virtual bool AddData( wxDataObject *data );
// format available on the clipboard ? // format available on the clipboard ?
virtual bool IsSupported( const wxDataFormat& format ); virtual bool IsSupported( const wxDataFormat& format );
// fill data with data on the clipboard (if available) // fill data with data on the clipboard (if available)
virtual bool GetData( wxDataObject& data ); virtual bool GetData( wxDataObject& data );
// clears wxTheClipboard and the system's clipboard if possible // clears wxTheClipboard and the system's clipboard if possible
virtual void Clear(); virtual void Clear();
virtual void UsePrimarySelection(bool primary = TRUE) virtual void UsePrimarySelection(bool primary = TRUE)
{ m_usePrimary = primary; } { m_usePrimary = primary; }
// implementation from now on // implementation from now on
bool m_open; bool m_open;
wxList m_data; wxList m_data;
bool m_usePrimary; bool m_usePrimary;
private: private:
DECLARE_DYNAMIC_CLASS(wxClipboard) DECLARE_DYNAMIC_CLASS(wxClipboard)
}; };
@@ -81,4 +81,4 @@ private:
#endif // wxUSE_CLIPBOARD #endif // wxUSE_CLIPBOARD
#endif #endif
// _WX_CLIPBRD_H_ // _WX_CLIPBRD_H_

View File

@@ -22,25 +22,25 @@
#include "wx/cmndata.h" #include "wx/cmndata.h"
/* /*
* Platform-specific colour dialog implementation * Platform-specific colour dialog implementation
*/ */
class WXDLLEXPORT wxColourDialog: public wxDialog class WXDLLEXPORT wxColourDialog: public wxDialog
{ {
DECLARE_DYNAMIC_CLASS(wxColourDialog) DECLARE_DYNAMIC_CLASS(wxColourDialog)
public: public:
wxColourDialog(); wxColourDialog();
wxColourDialog(wxWindow *parent, wxColourData *data = NULL); wxColourDialog(wxWindow *parent, wxColourData *data = NULL);
bool Create(wxWindow *parent, wxColourData *data = NULL); bool Create(wxWindow *parent, wxColourData *data = NULL);
int ShowModal(); int ShowModal();
wxColourData& GetColourData() { return m_colourData; } wxColourData& GetColourData() { return m_colourData; }
protected: protected:
wxColourData m_colourData; wxColourData m_colourData;
wxWindow* m_dialogParent; wxWindow* m_dialogParent;
}; };
#endif #endif
// _WX_COLORDLG_H_ // _WX_COLORDLG_H_

View File

@@ -22,71 +22,71 @@
// Colour // Colour
class WXDLLEXPORT wxColour : public wxObject class WXDLLEXPORT wxColour : public wxObject
{ {
DECLARE_DYNAMIC_CLASS(wxColour) DECLARE_DYNAMIC_CLASS(wxColour)
public: public:
// ctors // ctors
// default // default
wxColour(); wxColour();
// from RGB // from RGB
wxColour( unsigned char red, unsigned char green, unsigned char blue ); wxColour( unsigned char red, unsigned char green, unsigned char blue );
wxColour( unsigned long colRGB ) { Set(colRGB); } wxColour( unsigned long colRGB ) { Set(colRGB); }
// implicit conversion from the colour name // implicit conversion from the colour name
wxColour( const wxString &colourName ) { InitFromName(colourName); } wxColour( const wxString &colourName ) { InitFromName(colourName); }
wxColour( const char *colourName ) { InitFromName(colourName); } wxColour( const char *colourName ) { InitFromName(colourName); }
// copy ctors and assignment operators // copy ctors and assignment operators
wxColour( const wxColour& col ); wxColour( const wxColour& col );
wxColour& operator = ( const wxColour& col ); wxColour& operator = ( const wxColour& col );
// dtor // dtor
~wxColour(); ~wxColour();
// Set() functions // Set() functions
void Set( unsigned char red, unsigned char green, unsigned char blue ); void Set( unsigned char red, unsigned char green, unsigned char blue );
void Set( unsigned long colRGB ) void Set( unsigned long colRGB )
{ {
// we don't need to know sizeof(long) here because we assume that the three // 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 // least significant bytes contain the R, G and B values
Set((unsigned char)colRGB, Set((unsigned char)colRGB,
(unsigned char)(colRGB >> 8), (unsigned char)(colRGB >> 8),
(unsigned char)(colRGB >> 16)); (unsigned char)(colRGB >> 16));
} }
// accessors // accessors
bool Ok() const {return m_isInit; } bool Ok() const {return m_isInit; }
unsigned char Red() const { return m_red; } unsigned char Red() const { return m_red; }
unsigned char Green() const { return m_green; } unsigned char Green() const { return m_green; }
unsigned char Blue() const { return m_blue; } unsigned char Blue() const { return m_blue; }
int GetPixel() const { return m_pixel; }; int GetPixel() const { return m_pixel; };
void SetPixel(int pixel) { m_pixel = pixel; m_isInit = TRUE; }; void SetPixel(int pixel) { m_pixel = pixel; m_isInit = TRUE; };
inline bool operator == (const wxColour& colour) const { return (m_red == colour.m_red && m_green == colour.m_green && m_blue == colour.m_blue); } inline bool operator == (const wxColour& colour) const { return (m_red == colour.m_red && m_green == colour.m_green && m_blue == colour.m_blue); }
inline bool operator != (const wxColour& colour) const { return (!(m_red == colour.m_red && m_green == colour.m_green && m_blue == colour.m_blue)); } inline bool operator != (const wxColour& colour) const { return (!(m_red == colour.m_red && m_green == colour.m_green && m_blue == colour.m_blue)); }
// Allocate a colour, or nearest colour, using the given display. // Allocate a colour, or nearest colour, using the given display.
// If realloc is TRUE, ignore the existing pixel, otherwise just return // If realloc is TRUE, ignore the existing pixel, otherwise just return
// the existing one. // the existing one.
// Returns the allocated pixel. // Returns the allocated pixel.
// TODO: can this handle mono displays? If not, we should have an extra // TODO: can this handle mono displays? If not, we should have an extra
// flag to specify whether this should be black or white by default. // flag to specify whether this should be black or white by default.
int AllocColour(WXDisplay* display, bool realloc = FALSE); int AllocColour(WXDisplay* display, bool realloc = FALSE);
void InitFromName(const wxString& col); void InitFromName(const wxString& col);
private: private:
bool m_isInit; bool m_isInit;
unsigned char m_red; unsigned char m_red;
unsigned char m_blue; unsigned char m_blue;
unsigned char m_green; unsigned char m_green;
public: public:
int m_pixel; int m_pixel;
}; };
#endif #endif
// _WX_COLOUR_H_ // _WX_COLOUR_H_

View File

@@ -25,32 +25,32 @@ WXDLLEXPORT_DATA(extern const char*) wxEmptyString;
class WXDLLEXPORT wxComboBox: public wxChoice class WXDLLEXPORT wxComboBox: public wxChoice
{ {
DECLARE_DYNAMIC_CLASS(wxComboBox) DECLARE_DYNAMIC_CLASS(wxComboBox)
public: public:
inline wxComboBox() {} inline wxComboBox() {}
~wxComboBox(); ~wxComboBox();
inline wxComboBox(wxWindow *parent, wxWindowID id, inline wxComboBox(wxWindow *parent, wxWindowID id,
const wxString& value = wxEmptyString, const wxString& value = wxEmptyString,
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, long style = 0,
const wxValidator& validator = wxDefaultValidator, const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxComboBoxNameStr) const wxString& name = wxComboBoxNameStr)
{ {
Create(parent, id, value, pos, size, n, choices, style, validator, name); Create(parent, id, value, pos, size, n, choices, style, validator, name);
} }
bool Create(wxWindow *parent, wxWindowID id, bool Create(wxWindow *parent, wxWindowID id,
const wxString& value = wxEmptyString, const wxString& value = wxEmptyString,
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, long style = 0,
const wxValidator& validator = wxDefaultValidator, const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxComboBoxNameStr); const wxString& name = wxComboBoxNameStr);
// List functions // List functions
virtual void Append(const wxString& item); virtual void Append(const wxString& item);
virtual void Delete(int n); virtual void Delete(int n);
@@ -62,11 +62,11 @@ public:
virtual wxString GetStringSelection() const ; virtual wxString GetStringSelection() const ;
virtual bool SetStringSelection(const wxString& sel); virtual bool SetStringSelection(const wxString& sel);
virtual inline int Number() const { return m_noStrings; } virtual inline int Number() const { return m_noStrings; }
// Text field functions // Text field functions
virtual wxString GetValue() const ; virtual wxString GetValue() const ;
virtual void SetValue(const wxString& value); virtual void SetValue(const wxString& value);
// Clipboard operations // Clipboard operations
virtual void Copy(); virtual void Copy();
virtual void Cut(); virtual void Cut();
@@ -79,19 +79,19 @@ public:
virtual void Remove(long from, long to); virtual void Remove(long from, long to);
virtual void SetSelection(long from, long to); virtual void SetSelection(long from, long to);
virtual void SetEditable(bool editable); virtual void SetEditable(bool editable);
// Implementation // Implementation
virtual void ChangeFont(bool keepOriginalSize = TRUE); virtual void ChangeFont(bool keepOriginalSize = TRUE);
virtual void ChangeBackgroundColour(); virtual void ChangeBackgroundColour();
virtual void ChangeForegroundColour(); virtual void ChangeForegroundColour();
WXWidget GetTopWidget() const { return m_mainWidget; } WXWidget GetTopWidget() const { return m_mainWidget; }
WXWidget GetMainWidget() const { return m_mainWidget; } WXWidget GetMainWidget() const { return m_mainWidget; }
protected: protected:
virtual void DoSetSize(int x, int y, virtual void DoSetSize(int x, int y,
int width, int height, int width, int height,
int sizeFlags = wxSIZE_AUTO); int sizeFlags = wxSIZE_AUTO);
}; };
#endif #endif
// _WX_COMBOBOX_H_ // _WX_COMBOBOX_H_

View File

@@ -26,54 +26,54 @@
class WXDLLEXPORT wxControl: public wxControlBase class WXDLLEXPORT wxControl: public wxControlBase
{ {
DECLARE_ABSTRACT_CLASS(wxControl) DECLARE_ABSTRACT_CLASS(wxControl)
public: public:
wxControl(); wxControl();
wxControl( wxWindow *parent, wxControl( 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 wxValidator& validator = wxDefaultValidator, const wxValidator& validator = wxDefaultValidator,
const wxString &name = wxControlNameStr ) const wxString &name = wxControlNameStr )
{ {
Create(parent, id, pos, size, style, validator, name); Create(parent, id, pos, size, style, validator, name);
} }
bool Create(wxWindow *parent, wxWindowID id, bool Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0, const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator, const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxControlNameStr); const wxString& name = wxControlNameStr);
// simulates the event, returns TRUE if the event was processed // simulates the event, returns TRUE if the event was processed
virtual void Command(wxCommandEvent& WXUNUSED(event)) { } virtual void Command(wxCommandEvent& WXUNUSED(event)) { }
// calls the callback and appropriate event handlers, returns TRUE if // calls the callback and appropriate event handlers, returns TRUE if
// event was processed // event was processed
virtual bool ProcessCommand(wxCommandEvent& event); virtual bool ProcessCommand(wxCommandEvent& event);
virtual void SetLabel(const wxString& label); virtual void SetLabel(const wxString& label);
virtual wxString GetLabel() const ; virtual wxString GetLabel() const ;
#if WXWIN_COMPATIBILITY #if WXWIN_COMPATIBILITY
void Callback(const wxFunction function) { m_callback = function; }; // Adds callback void Callback(const wxFunction function) { m_callback = function; }; // Adds callback
wxFunction GetCallback() { return m_callback; } wxFunction GetCallback() { return m_callback; }
#endif // WXWIN_COMPATIBILITY #endif // WXWIN_COMPATIBILITY
bool InSetValue() const { return m_inSetValue; } bool InSetValue() const { return m_inSetValue; }
protected: protected:
#if WXWIN_COMPATIBILITY #if WXWIN_COMPATIBILITY
wxFunction m_callback; // Callback associated with the window wxFunction m_callback; // Callback associated with the window
#endif // WXWIN_COMPATIBILITY #endif // WXWIN_COMPATIBILITY
bool m_inSetValue; // Motif: prevent callbacks being called while bool m_inSetValue; // Motif: prevent callbacks being called while
// in SetValue // in SetValue
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };
#endif #endif
// _WX_CONTROL_H_ // _WX_CONTROL_H_

View File

@@ -19,15 +19,15 @@
#include "wx/bitmap.h" #include "wx/bitmap.h"
/* Cursor for one display, so we can choose the correct one for /* Cursor for one display, so we can choose the correct one for
* the current display. * the current display.
*/ */
class wxXCursor : public wxObject class wxXCursor : public wxObject
{ {
DECLARE_DYNAMIC_CLASS(wxXCursor) DECLARE_DYNAMIC_CLASS(wxXCursor)
public: public:
WXDisplay* m_display; WXDisplay* m_display;
WXCursor m_cursor; WXCursor m_cursor;
}; };
class WXDLLEXPORT wxCursorRefData: public wxBitmapRefData class WXDLLEXPORT wxCursorRefData: public wxBitmapRefData
@@ -37,7 +37,7 @@ class WXDLLEXPORT wxCursorRefData: public wxBitmapRefData
public: public:
wxCursorRefData(); wxCursorRefData();
~wxCursorRefData(); ~wxCursorRefData();
wxList m_cursors; // wxXCursor objects, one per display wxList m_cursors; // wxXCursor objects, one per display
wxStockCursor m_cursorId; // wxWindows standard cursor id wxStockCursor m_cursorId; // wxWindows standard cursor id
}; };
@@ -48,37 +48,37 @@ public:
// Cursor // Cursor
class WXDLLEXPORT wxCursor: public wxBitmap class WXDLLEXPORT wxCursor: public wxBitmap
{ {
DECLARE_DYNAMIC_CLASS(wxCursor) DECLARE_DYNAMIC_CLASS(wxCursor)
public: public:
wxCursor(); wxCursor();
// Copy constructors // Copy constructors
wxCursor(const wxCursor& cursor) { Ref(cursor); } wxCursor(const wxCursor& cursor) { Ref(cursor); }
wxCursor(const char bits[], int width, int height, int hotSpotX = -1, int hotSpotY = -1, wxCursor(const char bits[], int width, int height, int hotSpotX = -1, int hotSpotY = -1,
const char maskBits[] = NULL); const char maskBits[] = NULL);
wxCursor(const wxString& name, long flags = wxBITMAP_TYPE_XBM, wxCursor(const wxString& name, long flags = wxBITMAP_TYPE_XBM,
int hotSpotX = 0, int hotSpotY = 0); int hotSpotX = 0, int hotSpotY = 0);
wxCursor(wxStockCursor id); wxCursor(wxStockCursor id);
~wxCursor(); ~wxCursor();
virtual bool Ok() const { return ((m_refData != NULL) && M_CURSORDATA->m_ok); } virtual bool Ok() const { return ((m_refData != NULL) && M_CURSORDATA->m_ok); }
wxCursor& operator = (const wxCursor& cursor) { if (*this == cursor) return (*this); Ref(cursor); return *this; } wxCursor& operator = (const wxCursor& cursor) { if (*this == cursor) return (*this); Ref(cursor); return *this; }
bool operator == (const wxCursor& cursor) const { return m_refData == cursor.m_refData; } bool operator == (const wxCursor& cursor) const { return m_refData == cursor.m_refData; }
bool operator != (const wxCursor& cursor) const { return m_refData != cursor.m_refData; } bool operator != (const wxCursor& cursor) const { return m_refData != cursor.m_refData; }
// Motif-specific. // Motif-specific.
// Create/get a cursor for the current display // Create/get a cursor for the current display
WXCursor GetXCursor(WXDisplay* display) ; WXCursor GetXCursor(WXDisplay* display) ;
// Make a cursor from standard id // Make a cursor from standard id
WXCursor MakeCursor(WXDisplay* display, wxStockCursor id); WXCursor MakeCursor(WXDisplay* display, wxStockCursor id);
}; };
extern WXDLLEXPORT void wxSetCursor(const wxCursor& cursor); extern WXDLLEXPORT void wxSetCursor(const wxCursor& cursor);
#endif #endif
// _WX_CURSOR_H_ // _WX_CURSOR_H_

View File

@@ -17,46 +17,46 @@ class wxDataFormat
public: public:
// the clipboard formats under Xt are Atoms // the clipboard formats under Xt are Atoms
typedef Atom NativeFormat; typedef Atom NativeFormat;
wxDataFormat(); wxDataFormat();
wxDataFormat( wxDataFormatId type ); wxDataFormat( wxDataFormatId type );
wxDataFormat( const wxString &id ); wxDataFormat( const wxString &id );
wxDataFormat( const wxChar *id ); wxDataFormat( const wxChar *id );
wxDataFormat( NativeFormat format ); wxDataFormat( NativeFormat format );
wxDataFormat& operator=(NativeFormat format) wxDataFormat& operator=(NativeFormat format)
{ SetId(format); return *this; } { SetId(format); return *this; }
// comparison (must have both versions) // comparison (must have both versions)
bool operator==(NativeFormat format) const bool operator==(NativeFormat format) const
{ return m_format == (NativeFormat)format; } { return m_format == (NativeFormat)format; }
bool operator!=(NativeFormat format) const bool operator!=(NativeFormat format) const
{ return m_format != (NativeFormat)format; } { return m_format != (NativeFormat)format; }
bool operator==(wxDataFormatId format) const bool operator==(wxDataFormatId format) const
{ return m_type == (wxDataFormatId)format; } { return m_type == (wxDataFormatId)format; }
bool operator!=(wxDataFormatId format) const bool operator!=(wxDataFormatId format) const
{ return m_type != (wxDataFormatId)format; } { return m_type != (wxDataFormatId)format; }
// explicit and implicit conversions to NativeFormat which is one of // explicit and implicit conversions to NativeFormat which is one of
// standard data types (implicit conversion is useful for preserving the // standard data types (implicit conversion is useful for preserving the
// compatibility with old code) // compatibility with old code)
NativeFormat GetFormatId() const { return m_format; } NativeFormat GetFormatId() const { return m_format; }
operator NativeFormat() const { return m_format; } operator NativeFormat() const { return m_format; }
void SetId( NativeFormat format ); void SetId( NativeFormat format );
// string ids are used for custom types - this SetId() must be used for // string ids are used for custom types - this SetId() must be used for
// application-specific formats // application-specific formats
wxString GetId() const; wxString GetId() const;
void SetId( const wxChar *id ); void SetId( const wxChar *id );
// implementation // implementation
wxDataFormatId GetType() const; wxDataFormatId GetType() const;
private: private:
wxDataFormatId m_type; wxDataFormatId m_type;
NativeFormat m_format; NativeFormat m_format;
void PrepareFormats(); void PrepareFormats();
void SetType( wxDataFormatId type ); void SetType( wxDataFormatId type );
}; };

View File

@@ -11,7 +11,7 @@
#define _WX_MOTIF_DATAOBJ_H_ #define _WX_MOTIF_DATAOBJ_H_
#ifdef __GNUG__ #ifdef __GNUG__
#pragma interface "dataobj.h" #pragma interface "dataobj.h"
#endif #endif
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -20,7 +20,7 @@
class wxDataObject : public wxDataObjectBase class wxDataObject : public wxDataObjectBase
{ {
public: public:
#ifdef __DARWIN__ #ifdef __DARWIN__
~wxDataObject() { } ~wxDataObject() { }
#endif #endif

View File

@@ -13,7 +13,7 @@
#define _WX_DC_H_ #define _WX_DC_H_
#ifdef __GNUG__ #ifdef __GNUG__
#pragma interface "dc.h" #pragma interface "dc.h"
#endif #endif
#include "wx/pen.h" #include "wx/pen.h"
@@ -27,14 +27,14 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#ifndef MM_TEXT #ifndef MM_TEXT
#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
#define MM_POINTS 6 #define MM_POINTS 6
#define MM_METRIC 7 #define MM_METRIC 7
#endif #endif
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@@ -44,38 +44,38 @@
class WXDLLEXPORT wxDC : public wxDCBase class WXDLLEXPORT wxDC : public wxDCBase
{ {
DECLARE_DYNAMIC_CLASS(wxDC) DECLARE_DYNAMIC_CLASS(wxDC)
public: public:
wxDC(); wxDC();
~wxDC() { } ~wxDC() { }
// implement base class pure virtuals // implement base class pure virtuals
// ---------------------------------- // ----------------------------------
virtual void DestroyClippingRegion(); virtual void DestroyClippingRegion();
virtual wxSize GetPPI() const; virtual wxSize GetPPI() const;
virtual void SetMapMode(int mode); virtual void SetMapMode(int mode);
virtual void SetUserScale(double x, double y); virtual void SetUserScale(double x, double y);
virtual void SetLogicalScale(double x, double y); virtual void SetLogicalScale(double x, double y);
virtual void SetLogicalOrigin(wxCoord x, wxCoord y); virtual void SetLogicalOrigin(wxCoord x, wxCoord y);
virtual void SetDeviceOrigin(wxCoord x, wxCoord y); virtual void SetDeviceOrigin(wxCoord x, wxCoord y);
virtual void SetAxisOrientation(bool xLeftRight, bool yBottomUp); virtual void SetAxisOrientation(bool xLeftRight, bool yBottomUp);
protected: protected:
virtual void DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y); virtual void DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y);
virtual void DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y, virtual void DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y,
bool useMask = FALSE); bool useMask = FALSE);
virtual void DoSetClippingRegion(wxCoord x, wxCoord y, virtual void DoSetClippingRegion(wxCoord x, wxCoord y,
wxCoord width, wxCoord height); wxCoord width, wxCoord height);
virtual void DoGetSize(int *width, int *height) const; virtual void DoGetSize(int *width, int *height) const;
virtual void DoGetSizeMM(int* width, int* height) const; virtual void DoGetSizeMM(int* width, int* height) const;
public: public:
void ComputeScaleAndOrigin(); void ComputeScaleAndOrigin();
wxCoord XDEV2LOG(wxCoord x) const wxCoord XDEV2LOG(wxCoord x) const
{ {
wxCoord new_x = x - m_deviceOriginX; wxCoord new_x = x - m_deviceOriginX;
@@ -154,15 +154,15 @@ public:
else else
return (wxCoord)((double)(y) * m_scaleY - 0.5); return (wxCoord)((double)(y) * m_scaleY - 0.5);
} }
public: public:
// not sure what for, but what is a mm on a screen you don't know the size of? // not sure what for, but what is a mm on a screen you don't know the size of?
double m_mm_to_pix_x,m_mm_to_pix_y; double m_mm_to_pix_x,m_mm_to_pix_y;
// recompute scale? // recompute scale?
bool m_needComputeScaleX, m_needComputeScaleY; bool m_needComputeScaleX, m_needComputeScaleY;
}; };
#endif #endif
// _WX_DC_H_ // _WX_DC_H_

View File

@@ -13,7 +13,7 @@
#define _WX_DCCLIENT_H_ #define _WX_DCCLIENT_H_
#ifdef __GNUG__ #ifdef __GNUG__
#pragma interface "dcclient.h" #pragma interface "dcclient.h"
#endif #endif
#include "wx/dc.h" #include "wx/dc.h"
@@ -35,21 +35,21 @@ class WXDLLEXPORT wxWindow;
class WXDLLEXPORT wxWindowDC : public wxDC class WXDLLEXPORT wxWindowDC : public wxDC
{ {
DECLARE_DYNAMIC_CLASS(wxWindowDC) DECLARE_DYNAMIC_CLASS(wxWindowDC)
public: public:
wxWindowDC(); wxWindowDC();
wxWindowDC( wxWindow *win ); wxWindowDC( wxWindow *win );
~wxWindowDC(); ~wxWindowDC();
// TODO this function is Motif-only for now - should it go into base class? // TODO this function is Motif-only for now - should it go into base class?
void Clear(const wxRect& rect); void Clear(const wxRect& rect);
// implement base class pure virtuals // implement base class pure virtuals
// ---------------------------------- // ----------------------------------
virtual void Clear(); virtual void Clear();
virtual void SetFont(const wxFont& font); virtual void SetFont(const wxFont& font);
virtual void SetPen(const wxPen& pen); virtual void SetPen(const wxPen& pen);
virtual void SetBrush(const wxBrush& brush); virtual void SetBrush(const wxBrush& brush);
@@ -57,78 +57,78 @@ public:
virtual void SetBackgroundMode(int mode); virtual void SetBackgroundMode(int mode);
virtual void SetPalette(const wxPalette& palette); virtual void SetPalette(const wxPalette& palette);
virtual void SetLogicalFunction( int function ); virtual void SetLogicalFunction( int function );
virtual void SetTextForeground(const wxColour& colour); virtual void SetTextForeground(const wxColour& colour);
virtual void SetTextBackground(const wxColour& colour); virtual void SetTextBackground(const wxColour& colour);
virtual wxCoord GetCharHeight() const; virtual wxCoord GetCharHeight() const;
virtual wxCoord GetCharWidth() const; virtual wxCoord GetCharWidth() const;
virtual void DoGetTextExtent(const wxString& string, virtual void DoGetTextExtent(const wxString& string,
wxCoord *x, wxCoord *y, wxCoord *x, wxCoord *y,
wxCoord *descent = NULL, wxCoord *descent = NULL,
wxCoord *externalLeading = NULL, wxCoord *externalLeading = NULL,
wxFont *theFont = NULL) const; wxFont *theFont = NULL) const;
virtual bool CanDrawBitmap() const; virtual bool CanDrawBitmap() const;
virtual bool CanGetTextExtent() const; virtual bool CanGetTextExtent() const;
virtual int GetDepth() const; virtual int GetDepth() const;
virtual wxSize GetPPI() const; virtual wxSize GetPPI() const;
virtual void DestroyClippingRegion(); virtual void DestroyClippingRegion();
// Helper function for setting clipping // Helper function for setting clipping
void SetDCClipping(); void SetDCClipping();
// implementation from now on // implementation from now on
// -------------------------- // --------------------------
WXGC GetGC() const { return m_gc; } WXGC GetGC() const { return m_gc; }
WXGC GetBackingGC() const { return m_gcBacking; } WXGC GetBackingGC() const { return m_gcBacking; }
WXDisplay* GetDisplay() const { return m_display; } WXDisplay* GetDisplay() const { return m_display; }
bool GetAutoSetting() const { return m_autoSetting; } bool GetAutoSetting() const { return m_autoSetting; }
void SetAutoSetting(bool flag) { m_autoSetting = flag; } void SetAutoSetting(bool flag) { m_autoSetting = flag; }
protected: protected:
virtual void DoFloodFill(wxCoord x, wxCoord y, const wxColour& col, virtual void DoFloodFill(wxCoord x, wxCoord y, const wxColour& col,
int style = wxFLOOD_SURFACE); int style = wxFLOOD_SURFACE);
virtual bool DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const; virtual bool DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const;
virtual void DoDrawPoint(wxCoord x, wxCoord y); virtual void DoDrawPoint(wxCoord x, wxCoord y);
virtual void DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2); virtual void DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2);
virtual void DoDrawArc(wxCoord x1, wxCoord y1, virtual void DoDrawArc(wxCoord x1, wxCoord y1,
wxCoord x2, wxCoord y2, wxCoord x2, wxCoord y2,
wxCoord xc, wxCoord yc); wxCoord xc, wxCoord yc);
virtual void DoDrawEllipticArc(wxCoord x, wxCoord y, wxCoord w, wxCoord h, virtual void DoDrawEllipticArc(wxCoord x, wxCoord y, wxCoord w, wxCoord h,
double sa, double ea); double sa, double ea);
virtual void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height); virtual void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
virtual void DoDrawRoundedRectangle(wxCoord x, wxCoord y, virtual void DoDrawRoundedRectangle(wxCoord x, wxCoord y,
wxCoord width, wxCoord height, wxCoord width, wxCoord height,
double radius); double radius);
virtual void DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height); virtual void DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
virtual void DoCrossHair(wxCoord x, wxCoord y); virtual void DoCrossHair(wxCoord x, wxCoord y);
virtual void DoDrawText(const wxString& text, wxCoord x, wxCoord y); virtual void DoDrawText(const wxString& text, wxCoord x, wxCoord y);
virtual void DoDrawRotatedText(const wxString &text, wxCoord x, wxCoord y, double angle); virtual void DoDrawRotatedText(const wxString &text, wxCoord x, wxCoord y, double angle);
virtual bool DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, virtual bool DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
wxDC *source, wxCoord xsrc, wxCoord ysrc, wxDC *source, wxCoord xsrc, wxCoord ysrc,
int rop = wxCOPY, bool useMask = FALSE, wxCoord xsrcMask = -1, wxCoord ysrcMask = -1); int rop = wxCOPY, bool useMask = FALSE, wxCoord xsrcMask = -1, wxCoord ysrcMask = -1);
virtual void DoSetClippingRegionAsRegion(const wxRegion& region); virtual void DoSetClippingRegionAsRegion(const wxRegion& region);
virtual void DoSetClippingRegion(wxCoord x, wxCoord y, virtual void DoSetClippingRegion(wxCoord x, wxCoord y,
wxCoord width, wxCoord height); wxCoord width, wxCoord height);
virtual void DoDrawLines(int n, wxPoint points[], virtual void DoDrawLines(int n, wxPoint points[],
wxCoord xoffset, wxCoord yoffset); wxCoord xoffset, wxCoord yoffset);
virtual void DoDrawPolygon(int n, wxPoint points[], virtual void DoDrawPolygon(int n, wxPoint points[],
wxCoord xoffset, wxCoord yoffset, wxCoord xoffset, wxCoord yoffset,
int fillStyle = wxODDEVEN_RULE); int fillStyle = wxODDEVEN_RULE);
WXGC m_gc; WXGC m_gc;
WXGC m_gcBacking; WXGC m_gcBacking;
WXDisplay* m_display; WXDisplay* m_display;
@@ -136,7 +136,7 @@ protected:
WXRegion m_currentRegion; // Current clipping region (incl. paint clip region) WXRegion m_currentRegion; // Current clipping region (incl. paint clip region)
WXRegion m_userRegion; // User-defined clipping region WXRegion m_userRegion; // User-defined clipping region
WXPixmap m_pixmap; // Pixmap for drawing on WXPixmap m_pixmap; // Pixmap for drawing on
// Not sure if we'll need all of these // Not sure if we'll need all of these
int m_backgroundPixel; int m_backgroundPixel;
wxColour m_currentColour; wxColour m_currentColour;
@@ -156,22 +156,22 @@ protected:
class WXDLLEXPORT wxPaintDC: public wxWindowDC class WXDLLEXPORT wxPaintDC: public wxWindowDC
{ {
DECLARE_DYNAMIC_CLASS(wxPaintDC) DECLARE_DYNAMIC_CLASS(wxPaintDC)
public: public:
wxPaintDC() { } wxPaintDC() { }
wxPaintDC(wxWindow* win); wxPaintDC(wxWindow* win);
~wxPaintDC(); ~wxPaintDC();
}; };
class WXDLLEXPORT wxClientDC: public wxWindowDC class WXDLLEXPORT wxClientDC: public wxWindowDC
{ {
DECLARE_DYNAMIC_CLASS(wxClientDC) DECLARE_DYNAMIC_CLASS(wxClientDC)
public: public:
wxClientDC() { } wxClientDC() { }
wxClientDC(wxWindow* win) : wxWindowDC(win) { } wxClientDC(wxWindow* win) : wxWindowDC(win) { }
}; };
#endif #endif
// _WX_DCCLIENT_H_ // _WX_DCCLIENT_H_

View File

@@ -13,31 +13,31 @@
#define _WX_DCMEMORY_H_ #define _WX_DCMEMORY_H_
#ifdef __GNUG__ #ifdef __GNUG__
#pragma interface "dcmemory.h" #pragma interface "dcmemory.h"
#endif #endif
#include "wx/dcclient.h" #include "wx/dcclient.h"
class wxMemoryDC : public wxWindowDC class wxMemoryDC : public wxWindowDC
{ {
DECLARE_DYNAMIC_CLASS(wxMemoryDC) DECLARE_DYNAMIC_CLASS(wxMemoryDC)
public: public:
wxMemoryDC(); wxMemoryDC();
wxMemoryDC( wxDC *dc ); // Create compatible DC wxMemoryDC( wxDC *dc ); // Create compatible DC
~wxMemoryDC(); ~wxMemoryDC();
virtual void SelectObject( const wxBitmap& bitmap ); virtual void SelectObject( const wxBitmap& bitmap );
void DoGetSize( int *width, int *height ) const; void DoGetSize( int *width, int *height ) const;
wxBitmap& GetBitmap() const { return (wxBitmap&) m_bitmap; } wxBitmap& GetBitmap() const { return (wxBitmap&) m_bitmap; }
private: private:
friend class wxPaintDC; friend class wxPaintDC;
wxBitmap m_bitmap; wxBitmap m_bitmap;
}; };
#endif #endif
// _WX_DCMEMORY_H_ // _WX_DCMEMORY_H_

View File

@@ -20,15 +20,15 @@
class WXDLLEXPORT wxPrinterDC: public wxDC class WXDLLEXPORT wxPrinterDC: public wxDC
{ {
public: public:
DECLARE_CLASS(wxPrinterDC) DECLARE_CLASS(wxPrinterDC)
// Create a printer DC // Create a printer DC
wxPrinterDC(const wxString& driver, const wxString& device, const wxString& output, bool interactive = TRUE, int orientation = wxPORTRAIT); wxPrinterDC(const wxString& driver, const wxString& device, const wxString& output, bool interactive = TRUE, int orientation = wxPORTRAIT);
~wxPrinterDC(); ~wxPrinterDC();
}; };
#endif #endif
// _WX_DCPRINT_H_ // _WX_DCPRINT_H_

View File

@@ -20,29 +20,29 @@
class WXDLLEXPORT wxScreenDC: public wxWindowDC class WXDLLEXPORT wxScreenDC: public wxWindowDC
{ {
DECLARE_DYNAMIC_CLASS(wxScreenDC) DECLARE_DYNAMIC_CLASS(wxScreenDC)
public: public:
// Create a DC representing the whole screen // Create a DC representing the whole screen
wxScreenDC(); wxScreenDC();
~wxScreenDC(); ~wxScreenDC();
// Compatibility with X's requirements for // Compatibility with X's requirements for
// drawing on top of all windows // drawing on top of all windows
static bool StartDrawingOnTop(wxWindow* window); static bool StartDrawingOnTop(wxWindow* window);
static bool StartDrawingOnTop(wxRect* rect = NULL); static bool StartDrawingOnTop(wxRect* rect = NULL);
static bool EndDrawingOnTop(); static bool EndDrawingOnTop();
private: private:
static WXWindow sm_overlayWindow; static WXWindow sm_overlayWindow;
// If we have started transparent drawing at a non-(0,0) point // If we have started transparent drawing at a non-(0,0) point
// then we will have to adjust the device origin in the // then we will have to adjust the device origin in the
// constructor. // constructor.
static int sm_overlayWindowX; static int sm_overlayWindowX;
static int sm_overlayWindowY; static int sm_overlayWindowY;
}; };
#endif #endif
// _WX_DCSCREEN_H_ // _WX_DCSCREEN_H_

View File

@@ -13,7 +13,7 @@
#define _WX_DIALOG_H_ #define _WX_DIALOG_H_
#ifdef __GNUG__ #ifdef __GNUG__
#pragma interface "dialog.h" #pragma interface "dialog.h"
#endif #endif
WXDLLEXPORT_DATA(extern const char*) wxDialogNameStr; WXDLLEXPORT_DATA(extern const char*) wxDialogNameStr;
@@ -21,85 +21,85 @@ WXDLLEXPORT_DATA(extern const char*) wxDialogNameStr;
// Dialog boxes // Dialog boxes
class WXDLLEXPORT wxDialog : public wxDialogBase class WXDLLEXPORT wxDialog : public wxDialogBase
{ {
DECLARE_DYNAMIC_CLASS(wxDialog) DECLARE_DYNAMIC_CLASS(wxDialog)
public: public:
wxDialog(); wxDialog();
// Constructor with a modal flag, but no window id - the old convention // Constructor with a modal flag, but no window id - the old convention
wxDialog(wxWindow *parent, wxDialog(wxWindow *parent,
const wxString& title, bool modal, const wxString& title, bool modal,
int x = -1, int y= -1, int width = 500, int height = 500, int x = -1, int y= -1, int width = 500, int height = 500,
long style = wxDEFAULT_DIALOG_STYLE, long style = wxDEFAULT_DIALOG_STYLE,
const wxString& name = wxDialogNameStr) const wxString& name = wxDialogNameStr)
{ {
long modalStyle = modal ? wxDIALOG_MODAL : wxDIALOG_MODELESS ; long modalStyle = modal ? wxDIALOG_MODAL : wxDIALOG_MODELESS ;
Create(parent, -1, title, wxPoint(x, y), wxSize(width, height), style|modalStyle, name); Create(parent, -1, title, wxPoint(x, y), wxSize(width, height), style|modalStyle, name);
} }
// Constructor with no modal flag - the new convention. // Constructor with no modal flag - the new convention.
wxDialog(wxWindow *parent, wxWindowID id, wxDialog(wxWindow *parent, wxWindowID id,
const wxString& title, const wxString& title,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_DIALOG_STYLE, long style = wxDEFAULT_DIALOG_STYLE,
const wxString& name = wxDialogNameStr) const wxString& name = wxDialogNameStr)
{ {
Create(parent, id, title, pos, size, style, name); Create(parent, id, title, pos, size, style, name);
} }
bool Create(wxWindow *parent, wxWindowID id, bool Create(wxWindow *parent, wxWindowID id,
const wxString& title, // bool modal = FALSE, // TODO make this a window style? const wxString& title, // bool modal = FALSE, // TODO make this a window style?
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_DIALOG_STYLE, long style = wxDEFAULT_DIALOG_STYLE,
const wxString& name = wxDialogNameStr); const wxString& name = wxDialogNameStr);
~wxDialog(); ~wxDialog();
virtual bool Destroy(); virtual bool Destroy();
bool Show(bool show); bool Show(bool show);
void Iconize(bool iconize); void Iconize(bool iconize);
void Raise(); void Raise();
void Lower(); void Lower();
virtual bool IsIconized() const; virtual bool IsIconized() const;
virtual bool IsTopLevel() const { return TRUE; } virtual bool IsTopLevel() const { return TRUE; }
void SetTitle(const wxString& title); void SetTitle(const wxString& title);
wxString GetTitle() const ; wxString GetTitle() const ;
void SetModal(bool flag); void SetModal(bool flag);
virtual bool IsModal() const virtual bool IsModal() const
{ return ((GetWindowStyleFlag() & wxDIALOG_MODAL) == wxDIALOG_MODAL); } { return ((GetWindowStyleFlag() & wxDIALOG_MODAL) == wxDIALOG_MODAL); }
virtual int ShowModal(); virtual int ShowModal();
virtual void EndModal(int retCode); virtual void EndModal(int retCode);
// Implementation // Implementation
virtual void ChangeFont(bool keepOriginalSize = TRUE); virtual void ChangeFont(bool keepOriginalSize = TRUE);
virtual void ChangeBackgroundColour(); virtual void ChangeBackgroundColour();
virtual void ChangeForegroundColour(); virtual void ChangeForegroundColour();
inline WXWidget GetTopWidget() const { return m_mainWidget; } inline WXWidget GetTopWidget() const { return m_mainWidget; }
inline WXWidget GetClientWidget() const { return m_mainWidget; } inline WXWidget GetClientWidget() const { return m_mainWidget; }
// Standard buttons // Standard buttons
void OnOK(wxCommandEvent& event); void OnOK(wxCommandEvent& event);
void OnApply(wxCommandEvent& event); void OnApply(wxCommandEvent& event);
void OnCancel(wxCommandEvent& event); void OnCancel(wxCommandEvent& event);
void OnPaint(wxPaintEvent &event); void OnPaint(wxPaintEvent &event);
// Responds to colour changes // Responds to colour changes
void OnSysColourChanged(wxSysColourChangedEvent& event); void OnSysColourChanged(wxSysColourChangedEvent& event);
// bool OnClose(); // bool OnClose();
void OnCharHook(wxKeyEvent& event); void OnCharHook(wxKeyEvent& event);
void OnCloseWindow(wxCloseEvent& event); void OnCloseWindow(wxCloseEvent& event);
// Responds to size changes // Responds to size changes
void OnSize(wxSizeEvent& event); void OnSize(wxSizeEvent& event);
@@ -107,17 +107,17 @@ public:
//// Motif-specific //// Motif-specific
bool m_modalShowing; bool m_modalShowing;
wxString m_dialogTitle; wxString m_dialogTitle;
protected: protected:
virtual void DoSetSize(int x, int y, virtual void DoSetSize(int x, int y,
int width, int height, int width, int height,
int sizeFlags = wxSIZE_AUTO); int sizeFlags = wxSIZE_AUTO);
virtual void DoSetClientSize(int width, int height); virtual void DoSetClientSize(int width, int height);
private: private:
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };
#endif #endif
// _WX_DIALOG_H_ // _WX_DIALOG_H_

View File

@@ -22,22 +22,22 @@ WXDLLEXPORT_DATA(extern const char*) wxFileSelectorPromptStr;
class WXDLLEXPORT wxDirDialog: public wxDialog class WXDLLEXPORT wxDirDialog: public wxDialog
{ {
DECLARE_DYNAMIC_CLASS(wxDirDialog) DECLARE_DYNAMIC_CLASS(wxDirDialog)
public: public:
wxDirDialog(wxWindow *parent, const wxString& message = wxFileSelectorPromptStr, wxDirDialog(wxWindow *parent, const wxString& message = wxFileSelectorPromptStr,
const wxString& defaultPath = "", const wxString& defaultPath = "",
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; }
inline void SetPath(const wxString& path) { m_path = path; } inline void SetPath(const wxString& path) { m_path = path; }
inline void SetStyle(long style) { m_dialogStyle = style; } inline void SetStyle(long style) { m_dialogStyle = style; }
inline wxString GetMessage() const { return m_message; } inline wxString GetMessage() const { return m_message; }
inline wxString GetPath() const { return m_path; } inline wxString GetPath() const { return m_path; }
inline long GetStyle() const { return m_dialogStyle; } inline long GetStyle() const { return m_dialogStyle; }
int ShowModal(); int ShowModal();
protected: protected:
wxString m_message; wxString m_message;
long m_dialogStyle; long m_dialogStyle;
@@ -46,4 +46,4 @@ protected:
}; };
#endif #endif
// _WX_DIRDLG_H_ // _WX_DIRDLG_H_

View File

@@ -43,21 +43,21 @@ class WXDLLEXPORT wxDropSource;
class WXDLLEXPORT wxDropTarget: public wxObject class WXDLLEXPORT wxDropTarget: public wxObject
{ {
public: public:
wxDropTarget(); wxDropTarget();
~wxDropTarget(); ~wxDropTarget();
virtual void OnEnter() { } virtual void OnEnter() { }
virtual void OnLeave() { } virtual void OnLeave() { }
virtual bool OnDrop( long x, long y, const void *data, size_t size ) = 0; virtual bool OnDrop( long x, long y, const void *data, size_t size ) = 0;
// Override these to indicate what kind of data you support: // Override these to indicate what kind of data you support:
virtual size_t GetFormatCount() const = 0; virtual size_t GetFormatCount() const = 0;
virtual wxDataFormat GetFormat(size_t n) const = 0; virtual wxDataFormat GetFormat(size_t n) const = 0;
// implementation // implementation
}; };
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
@@ -66,14 +66,14 @@ class WXDLLEXPORT wxDropTarget: public wxObject
class WXDLLEXPORT wxTextDropTarget: public wxDropTarget class WXDLLEXPORT wxTextDropTarget: public wxDropTarget
{ {
public: public:
wxTextDropTarget() {}; wxTextDropTarget() {};
virtual bool OnDrop( long x, long y, const void *data, size_t size ); virtual bool OnDrop( long x, long y, const void *data, size_t size );
virtual bool OnDropText( long x, long y, const char *psz ); virtual bool OnDropText( long x, long y, const char *psz );
protected: protected:
virtual size_t GetFormatCount() const; virtual size_t GetFormatCount() const;
virtual wxDataFormat GetFormat(size_t n) const; virtual wxDataFormat GetFormat(size_t n) const;
}; };
@@ -85,27 +85,27 @@ class WXDLLEXPORT wxTextDropTarget: public wxDropTarget
class WXDLLEXPORT wxPrivateDropTarget: public wxDropTarget class WXDLLEXPORT wxPrivateDropTarget: public wxDropTarget
{ {
public: public:
wxPrivateDropTarget();
// you have to override OnDrop to get at the data
// the string ID identifies the format of clipboard or DnD data. a word wxPrivateDropTarget();
// processor would e.g. add a wxTextDataObject and a wxPrivateDataObject
// to the clipboard - the latter with the Id "WXWORD_FORMAT".
void SetId( const wxString& id ) // you have to override OnDrop to get at the data
{ m_id = id; }
// the string ID identifies the format of clipboard or DnD data. a word
// processor would e.g. add a wxTextDataObject and a wxPrivateDataObject
// to the clipboard - the latter with the Id "WXWORD_FORMAT".
void SetId( const wxString& id )
{ m_id = id; }
wxString GetId()
{ return m_id; }
wxString GetId()
{ return m_id; }
private: private:
virtual size_t GetFormatCount() const;
virtual wxDataFormat GetFormat(size_t n) const;
wxString m_id; virtual size_t GetFormatCount() const;
virtual wxDataFormat GetFormat(size_t n) const;
wxString m_id;
}; };
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -114,16 +114,16 @@ private:
class WXDLLEXPORT wxFileDropTarget: public wxDropTarget class WXDLLEXPORT wxFileDropTarget: public wxDropTarget
{ {
public: public:
wxFileDropTarget() {}; wxFileDropTarget() {};
virtual bool OnDrop( long x, long y, const void *data, size_t size ); virtual bool OnDrop( long x, long y, const void *data, size_t size );
virtual bool OnDropFiles( long x, long y, virtual bool OnDropFiles( long x, long y,
size_t nFiles, const char * const aszFiles[] ); size_t nFiles, const char * const aszFiles[] );
protected: protected:
virtual size_t GetFormatCount() const; virtual size_t GetFormatCount() const;
virtual wxDataFormat GetFormat(size_t n) const; virtual wxDataFormat GetFormat(size_t n) const;
}; };
@@ -134,17 +134,17 @@ class WXDLLEXPORT wxFileDropTarget: public wxDropTarget
enum wxDragResult enum wxDragResult
{ {
wxDragError, // error prevented the d&d operation from completing wxDragError, // error prevented the d&d operation from completing
wxDragNone, // drag target didn't accept the data wxDragNone, // drag target didn't accept the data
wxDragCopy, // the data was successfully copied wxDragCopy, // the data was successfully copied
wxDragMove, // the data was successfully moved wxDragMove, // the data was successfully moved
wxDragCancel // the operation was cancelled by user (not an error) wxDragCancel // the operation was cancelled by user (not an error)
}; };
class WXDLLEXPORT wxDropSource: public wxObject class WXDLLEXPORT wxDropSource: public wxObject
{ {
public: public:
wxDropSource( wxWindow *win ); wxDropSource( wxWindow *win );
wxDropSource( wxDataObject &data, wxWindow *win ); wxDropSource( wxDataObject &data, wxWindow *win );
@@ -154,12 +154,12 @@ class WXDLLEXPORT wxDropSource: public wxObject
wxDragResult DoDragDrop( bool bAllowMove = FALSE ); wxDragResult DoDragDrop( bool bAllowMove = FALSE );
virtual bool GiveFeedback( wxDragResult WXUNUSED(effect), bool WXUNUSED(bScrolling) ) { return TRUE; }; virtual bool GiveFeedback( wxDragResult WXUNUSED(effect), bool WXUNUSED(bScrolling) ) { return TRUE; };
// implementation // implementation
#if 0 #if 0
void RegisterWindow(void); void RegisterWindow(void);
void UnregisterWindow(void); void UnregisterWindow(void);
wxWindow *m_window; wxWindow *m_window;
wxDragResult m_retValue; wxDragResult m_retValue;
wxDataObject *m_data; wxDataObject *m_data;
@@ -171,8 +171,8 @@ class WXDLLEXPORT wxDropSource: public wxObject
#endif #endif
// wxUSE_DRAG_AND_DROP // wxUSE_DRAG_AND_DROP
#endif #endif
//_WX_DND_H_ //_WX_DND_H_

View File

@@ -19,15 +19,15 @@
#include "wx/dialog.h" #include "wx/dialog.h"
/* /*
* File selector * File selector
*/ */
WXDLLEXPORT_DATA(extern const char*) wxFileSelectorPromptStr; WXDLLEXPORT_DATA(extern const char*) wxFileSelectorPromptStr;
WXDLLEXPORT_DATA(extern const char*) wxFileSelectorDefaultWildcardStr; WXDLLEXPORT_DATA(extern const char*) wxFileSelectorDefaultWildcardStr;
class WXDLLEXPORT wxFileDialog: public wxDialog class WXDLLEXPORT wxFileDialog: public wxDialog
{ {
DECLARE_DYNAMIC_CLASS(wxFileDialog) DECLARE_DYNAMIC_CLASS(wxFileDialog)
public: public:
wxString m_message; wxString m_message;
long m_dialogStyle; long m_dialogStyle;
@@ -37,17 +37,17 @@ public:
wxString m_fileName; wxString m_fileName;
wxString m_wildCard; wxString m_wildCard;
int m_filterIndex; int m_filterIndex;
// For Motif // For Motif
wxPoint m_pos; wxPoint m_pos;
static wxString m_fileSelectorAnswer; static wxString m_fileSelectorAnswer;
static bool m_fileSelectorReturned; static bool m_fileSelectorReturned;
public: public:
wxFileDialog(wxWindow *parent, const wxString& message = wxFileSelectorPromptStr, wxFileDialog(wxWindow *parent, const wxString& message = wxFileSelectorPromptStr,
const wxString& defaultDir = "", const wxString& defaultFile = "", const wxString& wildCard = wxFileSelectorDefaultWildcardStr, const wxString& defaultDir = "", const wxString& defaultFile = "", 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; }
inline void SetPath(const wxString& path) { m_path = path; } inline void SetPath(const wxString& path) { m_path = path; }
inline void SetDirectory(const wxString& dir) { m_dir = dir; } inline void SetDirectory(const wxString& dir) { m_dir = dir; }
@@ -55,18 +55,18 @@ public:
inline void SetWildcard(const wxString& wildCard) { m_wildCard = wildCard; } inline void SetWildcard(const wxString& wildCard) { m_wildCard = wildCard; }
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() const { return m_message; } inline wxString GetMessage() const { return m_message; }
inline wxString GetPath() const { return m_path; } inline wxString GetPath() const { return m_path; }
inline void GetPaths(wxArrayString& a) { a.Empty(); a.Add(m_path); } inline void GetPaths(wxArrayString& a) { a.Empty(); a.Add(m_path); }
inline wxString GetDirectory() const { return m_dir; } inline wxString GetDirectory() const { return m_dir; }
inline wxString GetFilename() const { return m_fileName; } inline wxString GetFilename() const { return m_fileName; }
inline void GetFilenames(wxArrayString& a) { a.Empty(); inline void GetFilenames(wxArrayString& a) { a.Empty();
a.Add( m_fileName); } a.Add( m_fileName); }
inline wxString GetWildcard() const { return m_wildCard; } inline wxString GetWildcard() const { return m_wildCard; }
inline long GetStyle() const { return m_dialogStyle; } inline long GetStyle() const { return m_dialogStyle; }
inline int GetFilterIndex() const { return m_filterIndex ; } inline int GetFilterIndex() const { return m_filterIndex ; }
int ShowModal(); int ShowModal();
}; };
@@ -78,15 +78,15 @@ public:
// File selector - backward compatibility // File selector - backward compatibility
WXDLLEXPORT wxString wxFileSelector(const char *message = wxFileSelectorPromptStr, const char *default_path = NULL, WXDLLEXPORT wxString wxFileSelector(const char *message = wxFileSelectorPromptStr, const char *default_path = NULL,
const char *default_filename = NULL, const char *default_extension = NULL, const char *default_filename = NULL, const char *default_extension = NULL,
const char *wildcard = wxFileSelectorDefaultWildcardStr, int flags = 0, const char *wildcard = wxFileSelectorDefaultWildcardStr, int flags = 0,
wxWindow *parent = NULL, int x = -1, int y = -1); wxWindow *parent = NULL, int x = -1, int y = -1);
// An extended version of wxFileSelector // An extended version of wxFileSelector
WXDLLEXPORT wxString wxFileSelectorEx(const char *message = wxFileSelectorPromptStr, const char *default_path = NULL, WXDLLEXPORT wxString wxFileSelectorEx(const char *message = wxFileSelectorPromptStr, const char *default_path = NULL,
const char *default_filename = NULL, int *indexDefaultExtension = NULL, const char *default_filename = NULL, int *indexDefaultExtension = NULL,
const char *wildcard = wxFileSelectorDefaultWildcardStr, int flags = 0, const char *wildcard = wxFileSelectorDefaultWildcardStr, int flags = 0,
wxWindow *parent = NULL, int x = -1, int y = -1); wxWindow *parent = NULL, int x = -1, int y = -1);
// Generic file load dialog // Generic file load dialog
WXDLLEXPORT wxString wxLoadFileSelector(const char *what, const char *extension, const char *default_name = NULL, wxWindow *parent = NULL); WXDLLEXPORT wxString wxLoadFileSelector(const char *what, const char *extension, const char *default_name = NULL, wxWindow *parent = NULL);
@@ -95,4 +95,4 @@ WXDLLEXPORT wxString wxLoadFileSelector(const char *what, const char *extension,
WXDLLEXPORT wxString wxSaveFileSelector(const char *what, const char *extension, const char *default_name = NULL, wxWindow *parent = NULL); WXDLLEXPORT wxString wxSaveFileSelector(const char *what, const char *extension, const char *default_name = NULL, wxWindow *parent = NULL);
#endif #endif
// _WX_FILEDLG_H_ // _WX_FILEDLG_H_

View File

@@ -13,7 +13,7 @@
#define _WX_FONT_H_ #define _WX_FONT_H_
#ifdef __GNUG__ #ifdef __GNUG__
#pragma interface "font.h" #pragma interface "font.h"
#endif #endif
class wxXFont; class wxXFont;
@@ -25,40 +25,40 @@ public:
// ctors and such // ctors and such
wxFont() { Init(); } wxFont() { Init(); }
wxFont(const wxFont& font) { Init(); Ref(font); } wxFont(const wxFont& font) { Init(); Ref(font); }
wxFont(int size, wxFont(int size,
int family, int family,
int style, int style,
int weight, int weight,
bool underlined = FALSE, bool underlined = FALSE,
const wxString& face = wxEmptyString, const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT) wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
{ {
Init(); Init();
(void)Create(size, family, style, weight, underlined, face, encoding); (void)Create(size, family, style, weight, underlined, face, encoding);
} }
wxFont(const wxNativeFontInfo& info); wxFont(const wxNativeFontInfo& info);
bool Create(int size, bool Create(int size,
int family, int family,
int style, int style,
int weight, int weight,
bool underlined = FALSE, bool underlined = FALSE,
const wxString& face = wxEmptyString, const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT); wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
// wxMOTIF-specific // wxMOTIF-specific
bool Create(const wxString& fontname, bool Create(const wxString& fontname,
wxFontEncoding fontenc = wxFONTENCODING_DEFAULT); wxFontEncoding fontenc = wxFONTENCODING_DEFAULT);
bool Create(const wxNativeFontInfo& fontinfo); bool Create(const wxNativeFontInfo& fontinfo);
virtual ~wxFont(); virtual ~wxFont();
// assignment // assignment
wxFont& operator=(const wxFont& font); wxFont& operator=(const wxFont& font);
// implement base class pure virtuals // implement base class pure virtuals
virtual int GetPointSize() const; virtual int GetPointSize() const;
virtual int GetFamily() const; virtual int GetFamily() const;
@@ -79,39 +79,39 @@ public:
virtual void SetNativeFontInfo( const wxNativeFontInfo& info ); virtual void SetNativeFontInfo( const wxNativeFontInfo& info );
// Implementation // Implementation
// Find an existing, or create a new, XFontStruct // Find an existing, or create a new, XFontStruct
// based on this wxFont and the given scale. Append the // based on this wxFont and the given scale. Append the
// font to list in the private data for future reference. // font to list in the private data for future reference.
// TODO This is a fairly basic implementation, that doesn't // TODO This is a fairly basic implementation, that doesn't
// allow for different facenames, and also doesn't do a mapping // allow for different facenames, and also doesn't do a mapping
// between 'standard' facenames (e.g. Arial, Helvetica, Times Roman etc.) // between 'standard' facenames (e.g. Arial, Helvetica, Times Roman etc.)
// and the fonts that are available on a particular system. // and the fonts that are available on a particular system.
// Maybe we need to scan the user's machine to build up a profile // Maybe we need to scan the user's machine to build up a profile
// of the fonts and a mapping file. // of the fonts and a mapping file.
// Return font struct, and optionally the Motif font list // Return font struct, and optionally the Motif font list
wxXFont *GetInternalFont(double scale = 1.0, wxXFont *GetInternalFont(double scale = 1.0,
WXDisplay* display = NULL) const; WXDisplay* display = NULL) const;
// These two are helper functions for convenient access of the above. // These two are helper functions for convenient access of the above.
WXFontStructPtr GetFontStruct(double scale = 1.0, WXFontStructPtr GetFontStruct(double scale = 1.0,
WXDisplay* display = NULL) const; WXDisplay* display = NULL) const;
WXFontList GetFontList(double scale = 1.0, WXFontList GetFontList(double scale = 1.0,
WXDisplay* display = NULL) const; WXDisplay* display = NULL) const;
protected: protected:
// common part of all ctors // common part of all ctors
void Init(); void Init();
// VZ: IMHO, we don't need it at all... // VZ: IMHO, we don't need it at all...
bool RealizeResource() { return TRUE; } bool RealizeResource() { return TRUE; }
void Unshare(); void Unshare();
private: private:
DECLARE_DYNAMIC_CLASS(wxFont) DECLARE_DYNAMIC_CLASS(wxFont)
}; };
#endif #endif
// _WX_FONT_H_ // _WX_FONT_H_

View File

@@ -21,26 +21,26 @@
#include "wx/cmndata.h" #include "wx/cmndata.h"
/* /*
* Font dialog * Font dialog
*/ */
class WXDLLEXPORT wxFontDialog: public wxDialog class WXDLLEXPORT wxFontDialog: public wxDialog
{ {
DECLARE_DYNAMIC_CLASS(wxFontDialog) DECLARE_DYNAMIC_CLASS(wxFontDialog)
public: public:
wxFontDialog(); wxFontDialog();
wxFontDialog(wxWindow *parent, wxFontData *data = NULL); wxFontDialog(wxWindow *parent, wxFontData *data = NULL);
bool Create(wxWindow *parent, wxFontData *data = NULL); bool Create(wxWindow *parent, wxFontData *data = NULL);
int ShowModal(); int ShowModal();
wxFontData& GetFontData() { return m_fontData; } wxFontData& GetFontData() { return m_fontData; }
protected: protected:
wxWindow* m_dialogParent; wxWindow* m_dialogParent;
wxFontData m_fontData; wxFontData m_fontData;
}; };
#endif #endif
// _WX_FONTDLG_H_ // _WX_FONTDLG_H_

View File

@@ -13,7 +13,7 @@
#define _WX_MOTIF_FRAME_H_ #define _WX_MOTIF_FRAME_H_
#ifdef __GNUG__ #ifdef __GNUG__
#pragma interface "frame.h" #pragma interface "frame.h"
#endif #endif
class WXDLLEXPORT wxFrame : public wxFrameBase class WXDLLEXPORT wxFrame : public wxFrameBase
@@ -21,72 +21,72 @@ class WXDLLEXPORT wxFrame : public wxFrameBase
public: public:
wxFrame() { Init(); } wxFrame() { Init(); }
wxFrame(wxWindow *parent, wxFrame(wxWindow *parent,
wxWindowID id, wxWindowID id,
const wxString& title, const wxString& title,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE, long style = wxDEFAULT_FRAME_STYLE,
const wxString& name = wxFrameNameStr) const wxString& name = wxFrameNameStr)
{ {
Init(); Init();
Create(parent, id, title, pos, size, style, name); Create(parent, id, title, pos, size, style, name);
} }
bool Create(wxWindow *parent, bool Create(wxWindow *parent,
wxWindowID id, wxWindowID id,
const wxString& title, const wxString& title,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE, long style = wxDEFAULT_FRAME_STYLE,
const wxString& name = wxFrameNameStr); const wxString& name = wxFrameNameStr);
virtual ~wxFrame(); virtual ~wxFrame();
virtual bool Show(bool show = TRUE); virtual bool Show(bool show = TRUE);
// Set menu bar // Set menu bar
void SetMenuBar(wxMenuBar *menu_bar); void SetMenuBar(wxMenuBar *menu_bar);
// Set title // Set title
void SetTitle(const wxString& title); void SetTitle(const wxString& title);
wxString GetTitle() const { return m_title; } wxString GetTitle() const { return m_title; }
// Set icon // Set icon
virtual void SetIcon(const wxIcon& icon); virtual void SetIcon(const wxIcon& icon);
#if wxUSE_STATUSBAR #if wxUSE_STATUSBAR
virtual void PositionStatusBar(); virtual void PositionStatusBar();
#endif // wxUSE_STATUSBAR #endif // wxUSE_STATUSBAR
// Create toolbar // Create toolbar
#if wxUSE_TOOLBAR #if wxUSE_TOOLBAR
virtual wxToolBar* CreateToolBar(long style = wxNO_BORDER|wxTB_HORIZONTAL, wxWindowID id = -1, const wxString& name = wxToolBarNameStr); virtual wxToolBar* CreateToolBar(long style = wxNO_BORDER|wxTB_HORIZONTAL, wxWindowID id = -1, const wxString& name = wxToolBarNameStr);
virtual void PositionToolBar(); virtual void PositionToolBar();
#endif // wxUSE_TOOLBAR #endif // wxUSE_TOOLBAR
// Iconize // Iconize
virtual void Iconize(bool iconize); virtual void Iconize(bool iconize);
virtual bool IsIconized() const; virtual bool IsIconized() const;
// Is the frame maximized? Returns FALSE under Motif (but TRUE for // Is the frame maximized? Returns FALSE under Motif (but TRUE for
// wxMDIChildFrame due to the tabbed implementation). // wxMDIChildFrame due to the tabbed implementation).
virtual bool IsMaximized() const; virtual bool IsMaximized() const;
virtual void Maximize(bool maximize); virtual void Maximize(bool maximize);
virtual void Raise(); virtual void Raise();
virtual void Lower(); virtual void Lower();
virtual void Restore(); virtual void Restore();
// Implementation only from now on // Implementation only from now on
// ------------------------------- // -------------------------------
void OnSysColourChanged(wxSysColourChangedEvent& event); void OnSysColourChanged(wxSysColourChangedEvent& event);
void OnActivate(wxActivateEvent& event); void OnActivate(wxActivateEvent& event);
virtual void ChangeFont(bool keepOriginalSize = TRUE); virtual void ChangeFont(bool keepOriginalSize = TRUE);
virtual void ChangeBackgroundColour(); virtual void ChangeBackgroundColour();
virtual void ChangeForegroundColour(); virtual void ChangeForegroundColour();
@@ -95,19 +95,19 @@ public:
WXWidget GetWorkAreaWidget() const { return m_workArea; } WXWidget GetWorkAreaWidget() const { return m_workArea; }
WXWidget GetClientAreaWidget() const { return m_clientArea; } WXWidget GetClientAreaWidget() const { return m_clientArea; }
WXWidget GetTopWidget() const { return m_frameShell; } WXWidget GetTopWidget() const { return m_frameShell; }
virtual WXWidget GetMainWidget() const { return m_frameWidget; } virtual WXWidget GetMainWidget() const { return m_frameWidget; }
// The widget that can have children on it // The widget that can have children on it
WXWidget GetClientWidget() const; WXWidget GetClientWidget() const;
bool GetVisibleStatus() const { return m_visibleStatus; } bool GetVisibleStatus() const { return m_visibleStatus; }
bool PreResize(); bool PreResize();
protected: protected:
// common part of all ctors // common part of all ctors
void Init(); void Init();
//// Motif-specific //// Motif-specific
WXWidget m_frameShell; WXWidget m_frameShell;
WXWidget m_frameWidget; WXWidget m_frameWidget;
@@ -116,19 +116,19 @@ protected:
wxString m_title; wxString m_title;
bool m_visibleStatus; bool m_visibleStatus;
bool m_iconized; bool m_iconized;
virtual void DoGetClientSize(int *width, int *height) const; virtual void DoGetClientSize(int *width, int *height) const;
virtual void DoGetSize(int *width, int *height) const; virtual void DoGetSize(int *width, int *height) const;
virtual void DoGetPosition(int *x, int *y) const; virtual void DoGetPosition(int *x, int *y) const;
virtual void DoSetSize(int x, int y, virtual void DoSetSize(int x, int y,
int width, int height, int width, int height,
int sizeFlags = wxSIZE_AUTO); int sizeFlags = wxSIZE_AUTO);
virtual void DoSetClientSize(int width, int height); virtual void DoSetClientSize(int width, int height);
private: private:
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
DECLARE_DYNAMIC_CLASS(wxFrame) DECLARE_DYNAMIC_CLASS(wxFrame)
}; };
#endif #endif
// _WX_MOTIF_FRAME_H_ // _WX_MOTIF_FRAME_H_

View File

@@ -24,50 +24,50 @@ WXDLLEXPORT_DATA(extern const char*) wxGaugeNameStr;
class WXDLLEXPORT wxGauge : public wxControl class WXDLLEXPORT wxGauge : public wxControl
{ {
DECLARE_DYNAMIC_CLASS(wxGauge) DECLARE_DYNAMIC_CLASS(wxGauge)
public: public:
inline wxGauge() { m_rangeMax = 0; m_gaugePos = 0; } inline wxGauge() { m_rangeMax = 0; m_gaugePos = 0; }
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 wxValidator& validator = wxDefaultValidator,
const wxString& name = wxGaugeNameStr) const wxString& name = wxGaugeNameStr)
{ {
Create(parent, id, range, pos, size, style, validator, 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 wxValidator& validator = wxDefaultValidator, const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxGaugeNameStr); const wxString& name = wxGaugeNameStr);
void SetShadowWidth(int w); void SetShadowWidth(int w);
void SetBezelFace(int w); void SetBezelFace(int w);
void SetRange(int r); void SetRange(int r);
void SetValue(int pos); void SetValue(int pos);
int GetShadowWidth() const ; int GetShadowWidth() const ;
int GetBezelFace() const ; int GetBezelFace() const ;
int GetRange() const ; int GetRange() const ;
int GetValue() const ; int GetValue() const ;
virtual void Command(wxCommandEvent& WXUNUSED(event)) {} ; virtual void Command(wxCommandEvent& WXUNUSED(event)) {} ;
// Implementation // Implementation
virtual void ChangeFont(bool keepOriginalSize = TRUE); virtual void ChangeFont(bool keepOriginalSize = TRUE);
virtual void ChangeBackgroundColour(); virtual void ChangeBackgroundColour();
virtual void ChangeForegroundColour(); virtual void ChangeForegroundColour();
protected: protected:
int m_rangeMax; int m_rangeMax;
int m_gaugePos; int m_gaugePos;
}; };
#endif #endif
// _WX_GAUGE_H_ // _WX_GAUGE_H_

View File

@@ -21,28 +21,28 @@
class WXDLLEXPORT wxGDIRefData: public wxObjectRefData { class WXDLLEXPORT wxGDIRefData: public wxObjectRefData {
public: public:
inline wxGDIRefData() inline wxGDIRefData()
{ {
} }
}; };
#define M_GDIDATA ((wxGDIRefData *)m_refData) #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() { m_visible = FALSE; }; inline wxGDIObject() { m_visible = FALSE; };
inline ~wxGDIObject() {}; inline ~wxGDIObject() {};
inline bool IsNull() const { return (m_refData == 0); } inline bool IsNull() const { return (m_refData == 0); }
virtual bool GetVisible() { return m_visible; } virtual bool GetVisible() { return m_visible; }
virtual void SetVisible(bool v) { m_visible = v; } virtual void SetVisible(bool v) { m_visible = v; }
protected: protected:
bool m_visible; // Can a pointer to this object be safely taken? bool m_visible; // Can a pointer to this object be safely taken?
// - only if created within FindOrCreate... // - only if created within FindOrCreate...
}; };
#endif #endif
// _WX_GDIOBJ_H_ // _WX_GDIOBJ_H_

View File

@@ -29,22 +29,22 @@
enum enum
{ {
WX_GL_RGBA=1, /* use true color palette */ WX_GL_RGBA=1, /* use true color palette */
WX_GL_BUFFER_SIZE, /* bits for buffer if not WX_GL_RGBA */ WX_GL_BUFFER_SIZE, /* bits for buffer if not WX_GL_RGBA */
WX_GL_LEVEL, /* 0 for main buffer, >0 for overlay, <0 for underlay */ WX_GL_LEVEL, /* 0 for main buffer, >0 for overlay, <0 for underlay */
WX_GL_DOUBLEBUFFER, /* use doublebuffer */ WX_GL_DOUBLEBUFFER, /* use doublebuffer */
WX_GL_STEREO, /* use stereoscopic display */ WX_GL_STEREO, /* use stereoscopic display */
WX_GL_AUX_BUFFERS, /* number of auxiliary buffers */ WX_GL_AUX_BUFFERS, /* number of auxiliary buffers */
WX_GL_MIN_RED, /* use red buffer with most bits (> MIN_RED bits) */ WX_GL_MIN_RED, /* use red buffer with most bits (> MIN_RED bits) */
WX_GL_MIN_GREEN, /* use green buffer with most bits (> MIN_GREEN bits) */ WX_GL_MIN_GREEN, /* use green buffer with most bits (> MIN_GREEN bits) */
WX_GL_MIN_BLUE, /* use blue buffer with most bits (> MIN_BLUE bits) */ WX_GL_MIN_BLUE, /* use blue buffer with most bits (> MIN_BLUE bits) */
WX_GL_MIN_ALPHA, /* use blue buffer with most bits (> MIN_ALPHA bits) */ WX_GL_MIN_ALPHA, /* use blue buffer with most bits (> MIN_ALPHA bits) */
WX_GL_DEPTH_SIZE, /* bits for Z-buffer (0,16,32) */ WX_GL_DEPTH_SIZE, /* bits for Z-buffer (0,16,32) */
WX_GL_STENCIL_SIZE, /* bits for stencil buffer */ WX_GL_STENCIL_SIZE, /* bits for stencil buffer */
WX_GL_MIN_ACCUM_RED, /* use red accum buffer with most bits (> MIN_ACCUM_RED bits) */ WX_GL_MIN_ACCUM_RED, /* use red accum buffer with most bits (> MIN_ACCUM_RED bits) */
WX_GL_MIN_ACCUM_GREEN, /* use green buffer with most bits (> MIN_ACCUM_GREEN bits) */ WX_GL_MIN_ACCUM_GREEN, /* use green buffer with most bits (> MIN_ACCUM_GREEN bits) */
WX_GL_MIN_ACCUM_BLUE, /* use blue buffer with most bits (> MIN_ACCUM_BLUE bits) */ WX_GL_MIN_ACCUM_BLUE, /* use blue buffer with most bits (> MIN_ACCUM_BLUE bits) */
WX_GL_MIN_ACCUM_ALPHA /* use blue buffer with most bits (> MIN_ACCUM_ALPHA bits) */ WX_GL_MIN_ACCUM_ALPHA /* use blue buffer with most bits (> MIN_ACCUM_ALPHA bits) */
}; };
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
@@ -56,33 +56,33 @@ class WXDLLEXPORT wxGLContext: public wxObject
{ {
public: public:
wxGLContext( bool isRGB, wxWindow *win, wxGLContext( bool isRGB, wxWindow *win,
const wxPalette& palette = wxNullPalette ); const wxPalette& palette = wxNullPalette );
wxGLContext( bool WXUNUSED(isRGB), wxWindow *win, wxGLContext( bool WXUNUSED(isRGB), wxWindow *win,
const wxPalette& WXUNUSED(palette), const wxPalette& WXUNUSED(palette),
const wxGLContext *other /* for sharing display lists */ const wxGLContext *other /* for sharing display lists */
); );
~wxGLContext(); ~wxGLContext();
void SetCurrent(); void SetCurrent();
void SetColour(const char *colour); void SetColour(const char *colour);
void SwapBuffers(); void SwapBuffers();
void SetupPixelFormat(); void SetupPixelFormat();
void SetupPalette(const wxPalette& palette); void SetupPalette(const wxPalette& palette);
wxPalette CreateDefaultPalette(); wxPalette CreateDefaultPalette();
inline wxPalette* GetPalette() const { return (wxPalette*) & m_palette; } inline wxPalette* GetPalette() const { return (wxPalette*) & m_palette; }
inline wxWindow* GetWindow() const { return m_window; } inline wxWindow* GetWindow() const { return m_window; }
// inline GtkWidget* GetWidget() const { return m_widget; } // inline GtkWidget* GetWidget() const { return m_widget; }
inline GLXContext GetContext() const { return m_glContext; } inline GLXContext GetContext() const { return m_glContext; }
public: public:
GLXContext m_glContext; GLXContext m_glContext;
// GtkWidget *m_widget; // GtkWidget *m_widget;
wxPalette m_palette; wxPalette m_palette;
wxWindow* m_window; wxWindow* m_window;
DECLARE_CLASS(wxGLContext) DECLARE_CLASS(wxGLContext)
}; };
@@ -90,72 +90,72 @@ public:
class WXDLLEXPORT wxGLCanvas: public wxScrolledWindow class WXDLLEXPORT wxGLCanvas: public wxScrolledWindow
{ {
public: public:
inline wxGLCanvas() { inline wxGLCanvas() {
m_glContext = (wxGLContext*) NULL; m_glContext = (wxGLContext*) NULL;
m_sharedContext = (wxGLContext*) NULL; m_sharedContext = (wxGLContext*) NULL;
// m_glWidget = (GtkWidget*) NULL; // m_glWidget = (GtkWidget*) NULL;
m_vi = (void*) NULL; m_vi = (void*) NULL;
// m_exposed = FALSE; // m_exposed = FALSE;
} }
wxGLCanvas( wxWindow *parent, wxWindowID id = -1, wxGLCanvas( wxWindow *parent, wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = 0, const wxString& name = "GLCanvas", long style = 0, const wxString& name = "GLCanvas",
int *attribList = (int*) NULL, int *attribList = (int*) NULL,
const wxPalette& palette = wxNullPalette ); const wxPalette& palette = wxNullPalette );
wxGLCanvas( wxWindow *parent, const wxGLContext *shared = (wxGLContext *)NULL, wxGLCanvas( wxWindow *parent, const wxGLContext *shared = (wxGLContext *)NULL,
wxWindowID id = -1, wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = 0, const wxString& name = "GLCanvas", long style = 0, const wxString& name = "GLCanvas",
int *attribList = (int*) NULL, int *attribList = (int*) NULL,
const wxPalette& palette = wxNullPalette ); const wxPalette& palette = wxNullPalette );
wxGLCanvas( wxWindow *parent, const wxGLCanvas *shared = (wxGLCanvas *)NULL, wxGLCanvas( wxWindow *parent, const wxGLCanvas *shared = (wxGLCanvas *)NULL,
wxWindowID id = -1, wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = 0, const wxString& name = "GLCanvas", long style = 0, const wxString& name = "GLCanvas",
int *attribList = (int*) NULL, int *attribList = (int*) NULL,
const wxPalette& palette = wxNullPalette ); const wxPalette& palette = wxNullPalette );
bool Create( wxWindow *parent, bool Create( wxWindow *parent,
const wxGLContext *shared = (wxGLContext*)NULL, const wxGLContext *shared = (wxGLContext*)NULL,
const wxGLCanvas *shared_context_of = (wxGLCanvas*)NULL, const wxGLCanvas *shared_context_of = (wxGLCanvas*)NULL,
wxWindowID id = -1, wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = 0, const wxString& name = "GLCanvas", long style = 0, const wxString& name = "GLCanvas",
int *attribList = (int*) NULL, int *attribList = (int*) NULL,
const wxPalette& palette = wxNullPalette ); const wxPalette& palette = wxNullPalette );
~wxGLCanvas(); ~wxGLCanvas();
void SetCurrent(); void SetCurrent();
void SetColour(const char *colour); void SetColour(const char *colour);
void SwapBuffers(); void SwapBuffers();
// void OnSize(wxSizeEvent& event); // void OnSize(wxSizeEvent& event);
// void OnInternalIdle(); // void OnInternalIdle();
inline wxGLContext* GetContext() const { return m_glContext; } inline wxGLContext* GetContext() const { return m_glContext; }
// implementation // implementation
wxGLContext *m_glContext, wxGLContext *m_glContext,
*m_sharedContext; *m_sharedContext;
wxGLCanvas *m_sharedContextOf; wxGLCanvas *m_sharedContextOf;
void *m_vi; void *m_vi;
// GtkWidget *m_glWidget; // GtkWidget *m_glWidget;
// bool m_exposed; // bool m_exposed;
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
DECLARE_CLASS(wxGLCanvas) DECLARE_CLASS(wxGLCanvas)
}; };
#endif #endif
// wxUSE_GLCANVAS // wxUSE_GLCANVAS
#endif #endif
// _WX_GLCANVAS_H_ // _WX_GLCANVAS_H_

View File

@@ -23,30 +23,30 @@
class WXDLLEXPORT wxXXXXHelpController: public wxHelpControllerBase class WXDLLEXPORT wxXXXXHelpController: public wxHelpControllerBase
{ {
DECLARE_CLASS(wxXXXXHelpController) DECLARE_CLASS(wxXXXXHelpController)
public: public:
wxXXXXHelpController(); wxXXXXHelpController();
~wxXXXXHelpController(); ~wxXXXXHelpController();
// Must call this to set the filename and server name // Must call this to set the filename and server name
virtual bool Initialize(const wxString& file); virtual bool Initialize(const wxString& file);
// If file is "", reloads file given in Initialize // If file is "", reloads file given in Initialize
virtual bool LoadFile(const wxString& file = ""); virtual bool LoadFile(const wxString& file = "");
virtual bool DisplayContents(); virtual bool DisplayContents();
virtual bool DisplaySection(int sectionNo); virtual bool DisplaySection(int sectionNo);
virtual bool DisplayBlock(long blockNo); virtual bool DisplayBlock(long blockNo);
virtual bool KeywordSearch(const wxString& k); virtual bool KeywordSearch(const wxString& k);
virtual bool Quit(); virtual bool Quit();
virtual void OnQuit(); virtual void OnQuit();
inline wxString GetHelpFile() const { return m_helpFile; } inline wxString GetHelpFile() const { return m_helpFile; }
protected: protected:
wxString m_helpFile; wxString m_helpFile;
}; };
#endif #endif
// _WX_HELPXXXX_H_ // _WX_HELPXXXX_H_

View File

@@ -18,52 +18,40 @@
#include "wx/bitmap.h" #include "wx/bitmap.h"
/*
// Same as for wxBitmap
class WXDLLEXPORT wxIconRefData: public wxBitmapRefData
{
friend class WXDLLEXPORT wxBitmap;
friend class WXDLLEXPORT wxIcon;
public:
wxIconRefData();
~wxIconRefData();
};
*/
#define M_ICONDATA ((wxBitmapRefData *)m_refData) #define M_ICONDATA ((wxBitmapRefData *)m_refData)
#define M_ICONHANDLERDATA ((wxBitmapRefData *)bitmap->GetRefData()) #define M_ICONHANDLERDATA ((wxBitmapRefData *)bitmap->GetRefData())
// Icon // Icon
class WXDLLEXPORT wxIcon: public wxBitmap class WXDLLEXPORT wxIcon: public wxBitmap
{ {
DECLARE_DYNAMIC_CLASS(wxIcon) DECLARE_DYNAMIC_CLASS(wxIcon)
public: public:
wxIcon(); wxIcon();
// Copy constructors // Copy constructors
inline wxIcon(const wxIcon& icon) { Ref(icon); } inline wxIcon(const wxIcon& icon) { Ref(icon); }
// Initialize with XBM data // Initialize with XBM data
wxIcon(const char bits[], int width, int height); wxIcon(const char bits[], int width, int height);
// Initialize with XPM data // Initialize with XPM data
wxIcon(const char **data); wxIcon(const char **data);
wxIcon(char **data); wxIcon(char **data);
wxIcon(const wxString& name, long flags = wxBITMAP_TYPE_XPM, wxIcon(const wxString& name, long flags = wxBITMAP_TYPE_XPM,
int desiredWidth = -1, int desiredHeight = -1); int desiredWidth = -1, int desiredHeight = -1);
~wxIcon(); ~wxIcon();
bool LoadFile(const wxString& name, long flags = wxBITMAP_TYPE_XPM, bool LoadFile(const wxString& name, long flags = wxBITMAP_TYPE_XPM,
int desiredWidth = -1, int desiredHeight = -1); 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) const { return m_refData == icon.m_refData; } inline bool operator == (const wxIcon& icon) const { return m_refData == icon.m_refData; }
inline bool operator != (const wxIcon& icon) const { return m_refData != icon.m_refData; } inline bool operator != (const wxIcon& icon) const { return m_refData != icon.m_refData; }
virtual bool Ok() const { return ((m_refData != NULL) && (M_ICONDATA->m_ok)); } virtual bool Ok() const { return ((m_refData != NULL) && (M_ICONDATA->m_ok)); }
}; };
#endif #endif
// _WX_ICON_H_ // _WX_ICON_H_

View File

@@ -20,74 +20,74 @@
class WXDLLEXPORT wxJoystick: public wxObject class WXDLLEXPORT wxJoystick: public wxObject
{ {
DECLARE_DYNAMIC_CLASS(wxJoystick) DECLARE_DYNAMIC_CLASS(wxJoystick)
public: public:
/* /*
* Public interface * Public interface
*/ */
wxJoystick(int joystick = wxJOYSTICK1) { m_joystick = joystick; }; wxJoystick(int joystick = wxJOYSTICK1) { m_joystick = joystick; };
// Attributes // Attributes
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
wxPoint GetPosition() const; wxPoint GetPosition() const;
int GetZPosition() const; int GetZPosition() const;
int GetButtonState() const; int GetButtonState() const;
int GetPOVPosition() const; int GetPOVPosition() const;
int GetPOVCTSPosition() const; int GetPOVCTSPosition() const;
int GetRudderPosition() const; int GetRudderPosition() const;
int GetUPosition() const; int GetUPosition() const;
int GetVPosition() const; int GetVPosition() const;
int GetMovementThreshold() const; int GetMovementThreshold() const;
void SetMovementThreshold(int threshold) ; void SetMovementThreshold(int threshold) ;
// Capabilities // Capabilities
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
bool IsOk() const; // Checks that the joystick is functioning bool IsOk() const; // Checks that the joystick is functioning
int GetNumberJoysticks() const ; int GetNumberJoysticks() const ;
int GetManufacturerId() const ; int GetManufacturerId() const ;
int GetProductId() const ; int GetProductId() const ;
wxString GetProductName() const ; wxString GetProductName() const ;
int GetXMin() const; int GetXMin() const;
int GetYMin() const; int GetYMin() const;
int GetZMin() const; int GetZMin() const;
int GetXMax() const; int GetXMax() const;
int GetYMax() const; int GetYMax() const;
int GetZMax() const; int GetZMax() const;
int GetNumberButtons() const; int GetNumberButtons() const;
int GetNumberAxes() const; int GetNumberAxes() const;
int GetMaxButtons() const; int GetMaxButtons() const;
int GetMaxAxes() const; int GetMaxAxes() const;
int GetPollingMin() const; int GetPollingMin() const;
int GetPollingMax() const; int GetPollingMax() const;
int GetRudderMin() const; int GetRudderMin() const;
int GetRudderMax() const; int GetRudderMax() const;
int GetUMin() const; int GetUMin() const;
int GetUMax() const; int GetUMax() const;
int GetVMin() const; int GetVMin() const;
int GetVMax() const; int GetVMax() const;
bool HasRudder() const; bool HasRudder() const;
bool HasZ() const; bool HasZ() const;
bool HasU() const; bool HasU() const;
bool HasV() const; bool HasV() const;
bool HasPOV() const; bool HasPOV() const;
bool HasPOV4Dir() const; bool HasPOV4Dir() const;
bool HasPOVCTS() const; bool HasPOVCTS() const;
// Operations // Operations
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
// 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(); bool ReleaseCapture();
protected: protected:
int m_joystick; int m_joystick;
}; };
#endif #endif
// _WX_JOYSTICK_H_ // _WX_JOYSTICK_H_

View File

@@ -28,32 +28,32 @@ WXDLLEXPORT_DATA(extern const char*) wxEmptyString;
// List box item // List box item
class WXDLLEXPORT wxListBox: public wxListBoxBase class WXDLLEXPORT wxListBox: public wxListBoxBase
{ {
DECLARE_DYNAMIC_CLASS(wxListBox) DECLARE_DYNAMIC_CLASS(wxListBox)
public: public:
wxListBox(); wxListBox();
wxListBox(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, long style = 0,
const wxValidator& validator = wxDefaultValidator, const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr): const wxString& name = wxListBoxNameStr):
m_clientDataList(wxKEY_INTEGER) m_clientDataList(wxKEY_INTEGER)
{ {
Create(parent, id, pos, size, n, choices, style, validator, name); Create(parent, id, pos, size, n, choices, style, validator, name);
} }
bool Create(wxWindow *parent, wxWindowID id, bool Create(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, long style = 0,
const wxValidator& validator = wxDefaultValidator, const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxListBoxNameStr); const wxString& name = wxListBoxNameStr);
~wxListBox(); ~wxListBox();
// Virtual functions required by wxControlWithItems. // Virtual functions required by wxControlWithItems.
// They are not all implemented yet :-( // They are not all implemented yet :-(
virtual int GetCount() const; virtual int GetCount() const;
@@ -66,16 +66,16 @@ public:
virtual void DoSetItemClientObject(int n, wxClientData* clientData); virtual void DoSetItemClientObject(int n, wxClientData* clientData);
virtual wxClientData* DoGetItemClientObject(int n) const; virtual wxClientData* DoGetItemClientObject(int n) const;
virtual void Select(int n); virtual void Select(int n);
virtual void Append(const wxString& item); virtual void Append(const wxString& item);
virtual void Append(const wxString& item, void *clientData); virtual void Append(const wxString& item, void *clientData);
virtual void Set(int n, const wxString* choices, void **clientData = NULL); virtual void Set(int n, const wxString* choices, void **clientData = NULL);
virtual int FindString(const wxString& s) const ; virtual int FindString(const wxString& s) const ;
virtual void Clear(); virtual void Clear();
virtual void SetSelection(int n, bool select = TRUE); virtual void SetSelection(int n, bool select = TRUE);
virtual void Deselect(int n); virtual void Deselect(int n);
// For single choice list item only // For single choice list item only
virtual int GetSelection() const ; virtual int GetSelection() const ;
virtual void Delete(int n); virtual void Delete(int n);
@@ -84,42 +84,42 @@ public:
virtual void SetClientData(int n, void *clientData); virtual void SetClientData(int n, void *clientData);
virtual void SetClientData( void *data ) { wxWindow::SetClientData(data); } virtual void SetClientData( void *data ) { wxWindow::SetClientData(data); }
virtual void SetString(int n, const wxString& s); virtual void SetString(int n, const wxString& s);
// For single or multiple choice list item // For single or multiple choice list item
virtual int GetSelections(wxArrayInt& aSelections) const; virtual int GetSelections(wxArrayInt& aSelections) const;
virtual bool IsSelected(int n) const ; virtual bool IsSelected(int n) const ;
virtual wxString GetString(int n) const ; virtual wxString GetString(int n) const ;
// Set the specified item at the first visible item // Set the specified item at the first visible item
// or scroll to max range. // or scroll to max range.
virtual void SetFirstItem(int n) ; virtual void SetFirstItem(int n) ;
virtual void SetFirstItem(const wxString& s) ; virtual void SetFirstItem(const wxString& s) ;
virtual void InsertItems(int nItems, const wxString items[], int pos); virtual void InsertItems(int nItems, const wxString items[], int pos);
virtual wxString GetStringSelection() const ; virtual wxString GetStringSelection() const ;
virtual bool SetStringSelection(const wxString& s, bool flag = TRUE); virtual bool SetStringSelection(const wxString& s, bool flag = TRUE);
virtual int Number() const ; virtual int Number() const ;
void Command(wxCommandEvent& event); void Command(wxCommandEvent& event);
// Implementation // Implementation
virtual void ChangeFont(bool keepOriginalSize = TRUE); virtual void ChangeFont(bool keepOriginalSize = TRUE);
virtual void ChangeBackgroundColour(); virtual void ChangeBackgroundColour();
virtual void ChangeForegroundColour(); virtual void ChangeForegroundColour();
WXWidget GetTopWidget() const; WXWidget GetTopWidget() const;
protected: protected:
int m_noItems; int m_noItems;
int m_selected; int m_selected;
// List mapping positions->client data // List mapping positions->client data
wxList m_clientDataList; wxList m_clientDataList;
virtual void DoSetSize(int x, int y, virtual void DoSetSize(int x, int y,
int width, int height, int width, int height,
int sizeFlags = wxSIZE_AUTO); int sizeFlags = wxSIZE_AUTO);
}; };
#endif #endif
// _WX_LISTBOX_H_ // _WX_LISTBOX_H_

View File

@@ -35,131 +35,131 @@ class WXDLLEXPORT wxMDIChildFrame;
class WXDLLEXPORT wxMDIParentFrame: public wxFrame class WXDLLEXPORT wxMDIParentFrame: public wxFrame
{ {
DECLARE_DYNAMIC_CLASS(wxMDIParentFrame) DECLARE_DYNAMIC_CLASS(wxMDIParentFrame)
friend class WXDLLEXPORT wxMDIChildFrame; friend class WXDLLEXPORT wxMDIChildFrame;
public: public:
wxMDIParentFrame(); wxMDIParentFrame();
inline wxMDIParentFrame(wxWindow *parent, inline wxMDIParentFrame(wxWindow *parent,
wxWindowID id, wxWindowID id,
const wxString& title, const wxString& title,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, // Scrolling refers to client window long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, // Scrolling refers to client window
const wxString& name = wxFrameNameStr) const wxString& name = wxFrameNameStr)
{ {
Create(parent, id, title, pos, size, style, name); Create(parent, id, title, pos, size, style, name);
} }
~wxMDIParentFrame(); ~wxMDIParentFrame();
bool Create(wxWindow *parent, bool Create(wxWindow *parent,
wxWindowID id, wxWindowID id,
const wxString& title, const wxString& title,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
const wxString& name = wxFrameNameStr); const wxString& name = wxFrameNameStr);
void OnSize(wxSizeEvent& event); void OnSize(wxSizeEvent& event);
void OnActivate(wxActivateEvent& event); void OnActivate(wxActivateEvent& event);
void OnSysColourChanged(wxSysColourChangedEvent& event); void OnSysColourChanged(wxSysColourChangedEvent& event);
void OnMenuHighlight(wxMenuEvent& event); void OnMenuHighlight(wxMenuEvent& event);
void SetMenuBar(wxMenuBar *menu_bar); void SetMenuBar(wxMenuBar *menu_bar);
// Get the active MDI child window // Get the active MDI child window
wxMDIChildFrame *GetActiveChild() const ; wxMDIChildFrame *GetActiveChild() const ;
// Get the client window // Get the client window
wxMDIClientWindow *GetClientWindow() const { return m_clientWindow; }; wxMDIClientWindow *GetClientWindow() const { return m_clientWindow; };
// Create the client window class (don't Create the window, // Create the client window class (don't Create the window,
// just return a new class) // just return a new class)
virtual wxMDIClientWindow *OnCreateClient() ; virtual wxMDIClientWindow *OnCreateClient() ;
// MDI operations // MDI operations
virtual void Cascade(); virtual void Cascade();
virtual void Tile(); virtual void Tile();
virtual void ArrangeIcons(); virtual void ArrangeIcons();
virtual void ActivateNext(); virtual void ActivateNext();
virtual void ActivatePrevious(); virtual void ActivatePrevious();
// Implementation // Implementation
// Set the active child // Set the active child
inline void SetActiveChild(wxMDIChildFrame* child) { m_activeChild = child; } inline void SetActiveChild(wxMDIChildFrame* child) { m_activeChild = child; }
// Set the child's menubar into the parent frame // Set the child's menubar into the parent frame
void SetChildMenuBar(wxMDIChildFrame* frame); void SetChildMenuBar(wxMDIChildFrame* frame);
inline wxMenuBar* GetActiveMenuBar() const { return m_activeMenuBar; } inline wxMenuBar* GetActiveMenuBar() const { return m_activeMenuBar; }
// Redirect events to active child first // Redirect events to active child first
virtual bool ProcessEvent(wxEvent& event); virtual bool ProcessEvent(wxEvent& event);
protected: protected:
virtual void DoSetSize(int x, int y, virtual void DoSetSize(int x, int y,
int width, int height, int width, int height,
int sizeFlags = wxSIZE_AUTO); int sizeFlags = wxSIZE_AUTO);
virtual void DoSetClientSize(int width, int height); virtual void DoSetClientSize(int width, int height);
// Gets the size available for subwindows after menu size, toolbar size // 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 // and status bar size have been subtracted. If you want to manage your own
// toolbar(s), don't call SetToolBar. // toolbar(s), don't call SetToolBar.
void DoGetClientSize(int *width, int *height) const; void DoGetClientSize(int *width, int *height) const;
protected: protected:
wxMDIClientWindow* m_clientWindow; wxMDIClientWindow* m_clientWindow;
wxMDIChildFrame* m_activeChild; wxMDIChildFrame* m_activeChild;
wxMenuBar* m_activeMenuBar; wxMenuBar* m_activeMenuBar;
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };
class WXDLLEXPORT wxMDIChildFrame: public wxFrame class WXDLLEXPORT wxMDIChildFrame: public wxFrame
{ {
DECLARE_DYNAMIC_CLASS(wxMDIChildFrame) DECLARE_DYNAMIC_CLASS(wxMDIChildFrame)
public: public:
wxMDIChildFrame(); wxMDIChildFrame();
wxMDIChildFrame(wxMDIParentFrame *parent, wxMDIChildFrame(wxMDIParentFrame *parent,
wxWindowID id, wxWindowID id,
const wxString& title, const wxString& title,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE, long style = wxDEFAULT_FRAME_STYLE,
const wxString& name = wxFrameNameStr) const wxString& name = wxFrameNameStr)
{ {
Create(parent, id, title, pos, size, style, name); Create(parent, id, title, pos, size, style, name);
} }
~wxMDIChildFrame(); ~wxMDIChildFrame();
bool Create(wxMDIParentFrame *parent, bool Create(wxMDIParentFrame *parent,
wxWindowID id, wxWindowID id,
const wxString& title, const wxString& title,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE, long style = wxDEFAULT_FRAME_STYLE,
const wxString& name = wxFrameNameStr); const wxString& name = wxFrameNameStr);
// Set menu bar // Set menu bar
void SetMenuBar(wxMenuBar *menu_bar); void SetMenuBar(wxMenuBar *menu_bar);
void SetTitle(const wxString& title); void SetTitle(const wxString& title);
// Set icon // Set icon
virtual void SetIcon(const wxIcon& icon); virtual void SetIcon(const wxIcon& icon);
// Override wxFrame operations // Override wxFrame operations
void CaptureMouse(); void CaptureMouse();
void ReleaseMouse(); void ReleaseMouse();
void Raise(); void Raise();
void Lower(void); void Lower(void);
void SetSizeHints(int minW = -1, int minH = -1, int maxW = -1, int maxH = -1, int incW = -1, int incH = -1); void SetSizeHints(int minW = -1, int minH = -1, int maxW = -1, int maxH = -1, int incW = -1, int incH = -1);
// MDI operations // MDI operations
virtual void Maximize(); virtual void Maximize();
virtual void Maximize(bool WXUNUSED(maximize)) { }; virtual void Maximize(bool WXUNUSED(maximize)) { };
@@ -168,83 +168,83 @@ public:
virtual void Restore(); virtual void Restore();
virtual void Activate(); virtual void Activate();
virtual bool IsIconized() const ; virtual bool IsIconized() const ;
virtual bool IsTopLevel() const { return FALSE; } virtual bool IsTopLevel() const { return FALSE; }
// Is the frame maximized? Returns TRUE for // Is the frame maximized? Returns TRUE for
// wxMDIChildFrame due to the tabbed implementation. // wxMDIChildFrame due to the tabbed implementation.
virtual bool IsMaximized(void) const ; virtual bool IsMaximized(void) const ;
bool Show(bool show); bool Show(bool show);
WXWidget GetMainWidget() const { return m_mainWidget; }; WXWidget GetMainWidget() const { return m_mainWidget; };
WXWidget GetTopWidget() const { return m_mainWidget; }; WXWidget GetTopWidget() const { return m_mainWidget; };
WXWidget GetClientWidget() const { return m_mainWidget; }; WXWidget GetClientWidget() const { return m_mainWidget; };
/* /*
virtual void OnRaise(); virtual void OnRaise();
virtual void OnLower(); virtual void OnLower();
*/ */
void SetMDIParentFrame(wxMDIParentFrame* parentFrame) { m_mdiParentFrame = parentFrame; } void SetMDIParentFrame(wxMDIParentFrame* parentFrame) { m_mdiParentFrame = parentFrame; }
wxMDIParentFrame* GetMDIParentFrame() const { return m_mdiParentFrame; } wxMDIParentFrame* GetMDIParentFrame() const { return m_mdiParentFrame; }
protected: protected:
wxMDIParentFrame* m_mdiParentFrame; wxMDIParentFrame* m_mdiParentFrame;
virtual void DoSetSize(int x, int y, virtual void DoSetSize(int x, int y,
int width, int height, int width, int height,
int sizeFlags = wxSIZE_AUTO); int sizeFlags = wxSIZE_AUTO);
virtual void DoSetClientSize(int width, int height); virtual void DoSetClientSize(int width, int height);
void DoGetClientSize(int *width, int *height) const; void DoGetClientSize(int *width, int *height) const;
void DoGetSize(int *width, int *height) const; void DoGetSize(int *width, int *height) const;
void DoGetPosition(int *x, int *y) const ; void DoGetPosition(int *x, int *y) const ;
}; };
/* The client window is a child of the parent MDI frame, and itself /* The client window is a child of the parent MDI frame, and itself
* contains the child MDI frames. * contains the child MDI frames.
* However, you create the MDI children as children of the MDI parent: * However, you create the MDI children as children of the MDI parent:
* only in the implementation does the client window become the parent * only in the implementation does the client window become the parent
* of the children. Phew! So the children are sort of 'adopted'... * of the children. Phew! So the children are sort of 'adopted'...
*/ */
class WXDLLEXPORT wxMDIClientWindow: public wxNotebook class WXDLLEXPORT wxMDIClientWindow: public wxNotebook
{ {
DECLARE_DYNAMIC_CLASS(wxMDIClientWindow) DECLARE_DYNAMIC_CLASS(wxMDIClientWindow)
public: public:
wxMDIClientWindow() ; wxMDIClientWindow() ;
wxMDIClientWindow(wxMDIParentFrame *parent, long style = 0) wxMDIClientWindow(wxMDIParentFrame *parent, long style = 0)
{ {
CreateClient(parent, style); CreateClient(parent, style);
} }
~wxMDIClientWindow(); ~wxMDIClientWindow();
// Note: this is virtual, to allow overridden behaviour. // Note: this is virtual, to allow overridden behaviour.
virtual bool CreateClient(wxMDIParentFrame *parent, long style = wxVSCROLL | wxHSCROLL); virtual bool CreateClient(wxMDIParentFrame *parent, long style = wxVSCROLL | wxHSCROLL);
// Explicitly call default scroll behaviour // Explicitly call default scroll behaviour
void OnScroll(wxScrollEvent& event); void OnScroll(wxScrollEvent& event);
// Implementation // Implementation
void OnPageChanged(wxNotebookEvent& event); void OnPageChanged(wxNotebookEvent& event);
protected: protected:
virtual void DoSetSize(int x, int y, virtual void DoSetSize(int x, int y,
int width, int height, int width, int height,
int sizeFlags = wxSIZE_AUTO); int sizeFlags = wxSIZE_AUTO);
virtual void DoSetClientSize(int width, int height); virtual void DoSetClientSize(int width, int height);
void DoGetClientSize(int *width, int *height) const; void DoGetClientSize(int *width, int *height) const;
void DoGetSize(int *width, int *height) const ; void DoGetSize(int *width, int *height) const ;
void DoGetPosition(int *x, int *y) const ; void DoGetPosition(int *x, int *y) const ;
private: private:
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };
#endif #endif
// _WX_MDI_H_ // _WX_MDI_H_

View File

@@ -13,7 +13,7 @@
#define _WX_MOTIF_MENU_H_ #define _WX_MOTIF_MENU_H_
#ifdef __GNUG__ #ifdef __GNUG__
#pragma interface "menu.h" #pragma interface "menu.h"
#endif #endif
#include "wx/colour.h" #include "wx/colour.h"
@@ -31,69 +31,69 @@ public:
// ctors & dtor // ctors & dtor
wxMenu(const wxString& title, long style = 0) wxMenu(const wxString& title, long style = 0)
: wxMenuBase(title, style) { Init(); } : wxMenuBase(title, style) { Init(); }
wxMenu(long style = 0) : wxMenuBase(style) { Init(); } wxMenu(long style = 0) : wxMenuBase(style) { Init(); }
virtual ~wxMenu(); virtual ~wxMenu();
// implement base class virtuals // implement base class virtuals
virtual bool DoAppend(wxMenuItem *item); virtual bool DoAppend(wxMenuItem *item);
virtual bool DoInsert(size_t pos, wxMenuItem *item); virtual bool DoInsert(size_t pos, wxMenuItem *item);
virtual wxMenuItem *DoRemove(wxMenuItem *item); virtual wxMenuItem *DoRemove(wxMenuItem *item);
virtual void Break(); virtual void Break();
virtual void SetTitle(const wxString& title); virtual void SetTitle(const wxString& title);
bool ProcessCommand(wxCommandEvent& event); bool ProcessCommand(wxCommandEvent& event);
wxMenu(const wxString& title, const wxFunction func) wxMenu(const wxString& title, const wxFunction func)
: wxMenuBase(title) : wxMenuBase(title)
{ {
Init(); Init();
Callback(func); Callback(func);
} }
//// Motif-specific //// Motif-specific
WXWidget GetButtonWidget() const { return m_buttonWidget; } WXWidget GetButtonWidget() const { return m_buttonWidget; }
void SetButtonWidget(WXWidget buttonWidget) { m_buttonWidget = buttonWidget; } void SetButtonWidget(WXWidget buttonWidget) { m_buttonWidget = buttonWidget; }
WXWidget GetMainWidget() const { return m_menuWidget; } WXWidget GetMainWidget() const { return m_menuWidget; }
int GetId() const { return m_menuId; } int GetId() const { return m_menuId; }
void SetId(int id) { m_menuId = id; } void SetId(int id) { m_menuId = id; }
void SetMenuBar(wxMenuBar* menuBar) { m_menuBar = menuBar; } void SetMenuBar(wxMenuBar* menuBar) { m_menuBar = menuBar; }
wxMenuBar* GetMenuBar() const { return m_menuBar; } wxMenuBar* GetMenuBar() const { return m_menuBar; }
void CreatePopup(WXWidget logicalParent, int x, int y); void CreatePopup(WXWidget logicalParent, int x, int y);
void DestroyPopup(); void DestroyPopup();
void ShowPopup(int x, int y); void ShowPopup(int x, int y);
void HidePopup(); void HidePopup();
WXWidget CreateMenu(wxMenuBar *menuBar, WXWidget parent, wxMenu *topMenu, WXWidget CreateMenu(wxMenuBar *menuBar, WXWidget parent, wxMenu *topMenu,
const wxString& title = wxEmptyString, const wxString& title = wxEmptyString,
bool isPulldown = FALSE); bool isPulldown = FALSE);
// For popups, need to destroy, then recreate menu for a different (or // For popups, need to destroy, then recreate menu for a different (or
// possibly same) window, since the parent may change. // possibly same) window, since the parent may change.
void DestroyMenu(bool full); void DestroyMenu(bool full);
WXWidget FindMenuItem(int id, wxMenuItem **it = NULL) const; WXWidget FindMenuItem(int id, wxMenuItem **it = NULL) const;
const wxColour& GetBackgroundColour() const { return m_backgroundColour; } const wxColour& GetBackgroundColour() const { return m_backgroundColour; }
const wxColour& GetForegroundColour() const { return m_foregroundColour; } const wxColour& GetForegroundColour() const { return m_foregroundColour; }
const wxFont& GetFont() const { return m_font; } const wxFont& GetFont() const { return m_font; }
void SetBackgroundColour(const wxColour& colour); void SetBackgroundColour(const wxColour& colour);
void SetForegroundColour(const wxColour& colour); void SetForegroundColour(const wxColour& colour);
void SetFont(const wxFont& colour); void SetFont(const wxFont& colour);
void ChangeFont(bool keepOriginalSize = FALSE); void ChangeFont(bool keepOriginalSize = FALSE);
WXWidget GetHandle() const { return m_menuWidget; } WXWidget GetHandle() const { return m_menuWidget; }
bool IsTearOff() const { return (m_style & wxMENU_TEAROFF) != 0; } bool IsTearOff() const { return (m_style & wxMENU_TEAROFF) != 0; }
public: public:
// Motif-specific data // Motif-specific data
int m_numColumns; int m_numColumns;
@@ -106,11 +106,11 @@ public:
wxColour m_foregroundColour; wxColour m_foregroundColour;
wxColour m_backgroundColour; wxColour m_backgroundColour;
wxFont m_font; wxFont m_font;
private: private:
// common code for both constructors: // common code for both constructors:
void Init(); void Init();
DECLARE_DYNAMIC_CLASS(wxMenu) DECLARE_DYNAMIC_CLASS(wxMenu)
}; };
@@ -125,59 +125,59 @@ public:
wxMenuBar(long WXUNUSED(style)) { Init(); } wxMenuBar(long WXUNUSED(style)) { Init(); }
wxMenuBar(int n, wxMenu *menus[], const wxString titles[]); wxMenuBar(int n, wxMenu *menus[], const wxString titles[]);
virtual ~wxMenuBar(); virtual ~wxMenuBar();
// implement base class (pure) virtuals // implement base class (pure) virtuals
// ------------------------------------ // ------------------------------------
virtual bool Append( wxMenu *menu, const wxString &title ); virtual bool Append( wxMenu *menu, const wxString &title );
virtual bool Insert(size_t pos, wxMenu *menu, const wxString& title); virtual bool Insert(size_t pos, wxMenu *menu, const wxString& title);
virtual wxMenu *Replace(size_t pos, wxMenu *menu, const wxString& title); virtual wxMenu *Replace(size_t pos, wxMenu *menu, const wxString& title);
virtual wxMenu *Remove(size_t pos); virtual wxMenu *Remove(size_t pos);
virtual int FindMenuItem(const wxString& menuString, virtual int FindMenuItem(const wxString& menuString,
const wxString& itemString) const; const wxString& itemString) const;
virtual wxMenuItem* FindItem( int id, wxMenu **menu = NULL ) const; virtual wxMenuItem* FindItem( int id, wxMenu **menu = NULL ) const;
virtual void EnableTop( size_t pos, bool flag ); virtual void EnableTop( size_t pos, bool flag );
virtual void SetLabelTop( size_t pos, const wxString& label ); virtual void SetLabelTop( size_t pos, const wxString& label );
virtual wxString GetLabelTop( size_t pos ) const; virtual wxString GetLabelTop( size_t pos ) const;
// implementation only from now on // implementation only from now on
// ------------------------------- // -------------------------------
wxFrame* GetMenuBarFrame() const { return m_menuBarFrame; } wxFrame* GetMenuBarFrame() const { return m_menuBarFrame; }
void SetMenuBarFrame(wxFrame* frame) { m_menuBarFrame = frame; } void SetMenuBarFrame(wxFrame* frame) { m_menuBarFrame = frame; }
WXWidget GetMainWidget() const { return m_mainWidget; } WXWidget GetMainWidget() const { return m_mainWidget; }
void SetMainWidget(WXWidget widget) { m_mainWidget = widget; } void SetMainWidget(WXWidget widget) { m_mainWidget = widget; }
// Create menubar // Create menubar
bool CreateMenuBar(wxFrame* frame); bool CreateMenuBar(wxFrame* frame);
// Destroy menubar, but keep data structures intact so we can recreate it. // Destroy menubar, but keep data structures intact so we can recreate it.
bool DestroyMenuBar(); bool DestroyMenuBar();
const wxColour& GetBackgroundColour() const { return m_backgroundColour; } const wxColour& GetBackgroundColour() const { return m_backgroundColour; }
const wxColour& GetForegroundColour() const { return m_foregroundColour; } const wxColour& GetForegroundColour() const { return m_foregroundColour; }
const wxFont& GetFont() const { return m_font; } const wxFont& GetFont() const { return m_font; }
virtual bool SetBackgroundColour(const wxColour& colour); virtual bool SetBackgroundColour(const wxColour& colour);
virtual bool SetForegroundColour(const wxColour& colour); virtual bool SetForegroundColour(const wxColour& colour);
virtual bool SetFont(const wxFont& colour); virtual bool SetFont(const wxFont& colour);
void ChangeFont(bool keepOriginalSize = FALSE); void ChangeFont(bool keepOriginalSize = FALSE);
public: public:
// common part of all ctors // common part of all ctors
void Init(); void Init();
wxArrayString m_titles; wxArrayString m_titles;
wxFrame *m_menuBarFrame; wxFrame *m_menuBarFrame;
WXWidget m_mainWidget; WXWidget m_mainWidget;
wxColour m_foregroundColour; wxColour m_foregroundColour;
wxColour m_backgroundColour; wxColour m_backgroundColour;
wxFont m_font; wxFont m_font;
DECLARE_DYNAMIC_CLASS(wxMenuBar) DECLARE_DYNAMIC_CLASS(wxMenuBar)
}; };

View File

@@ -13,7 +13,7 @@
#define _WX_MOTIF_MENUITEM_H #define _WX_MOTIF_MENUITEM_H
#ifdef __GNUG__ #ifdef __GNUG__
#pragma interface "menuitem.h" #pragma interface "menuitem.h"
#endif #endif
#include "wx/bitmap.h" #include "wx/bitmap.h"
@@ -29,44 +29,44 @@ class wxMenuItem : public wxMenuItemBase
public: public:
// ctor & dtor // ctor & dtor
wxMenuItem(wxMenu *parentMenu = (wxMenu *)NULL, wxMenuItem(wxMenu *parentMenu = (wxMenu *)NULL,
int id = wxID_SEPARATOR, int id = wxID_SEPARATOR,
const wxString& text = wxEmptyString, const wxString& text = wxEmptyString,
const wxString& help = wxEmptyString, const wxString& help = wxEmptyString,
bool isCheckable = FALSE, bool isCheckable = FALSE,
wxMenu *subMenu = (wxMenu *)NULL); wxMenu *subMenu = (wxMenu *)NULL);
~wxMenuItem(); ~wxMenuItem();
// accessors (some more are inherited from wxOwnerDrawn or are below) // accessors (some more are inherited from wxOwnerDrawn or are below)
virtual void SetText(const wxString& label); virtual void SetText(const wxString& label);
virtual void Enable(bool enable = TRUE); virtual void Enable(bool enable = TRUE);
virtual void Check(bool check = TRUE); virtual void Check(bool check = TRUE);
// included SetBitmap and GetBitmap as copied from the GTK include file // included SetBitmap and GetBitmap as copied from the GTK include file
// I'm not sure if this works but it silences the linker in the // I'm not sure if this works but it silences the linker in the
// menu sample. // menu sample.
// JJ // JJ
virtual void SetBitmap(const wxBitmap& bitmap) { m_bitmap = bitmap; } virtual void SetBitmap(const wxBitmap& bitmap) { m_bitmap = bitmap; }
virtual const wxBitmap& GetBitmap() const { return m_bitmap; } virtual const wxBitmap& GetBitmap() const { return m_bitmap; }
void DeleteSubMenu(); void DeleteSubMenu();
// implementation from now on // implementation from now on
void CreateItem (WXWidget menu, wxMenuBar * menuBar, wxMenu * topMenu); void CreateItem (WXWidget menu, wxMenuBar * menuBar, wxMenu * topMenu);
void DestroyItem(bool full); void DestroyItem(bool full);
WXWidget GetButtonWidget() const { return m_buttonWidget; } WXWidget GetButtonWidget() const { return m_buttonWidget; }
wxMenuBar* GetMenuBar() const { return m_menuBar; } wxMenuBar* GetMenuBar() const { return m_menuBar; }
void SetMenuBar(wxMenuBar* menuBar) { m_menuBar = menuBar; } void SetMenuBar(wxMenuBar* menuBar) { m_menuBar = menuBar; }
wxMenu* GetTopMenu() const { return m_topMenu; } wxMenu* GetTopMenu() const { return m_topMenu; }
void SetTopMenu(wxMenu* menu) { m_topMenu = menu; } void SetTopMenu(wxMenu* menu) { m_topMenu = menu; }
private: private:
WXWidget m_buttonWidget; WXWidget m_buttonWidget;
wxMenuBar* m_menuBar; wxMenuBar* m_menuBar;
wxMenu* m_topMenu; // Top-level menu e.g. popup-menu wxMenu* m_topMenu; // Top-level menu e.g. popup-menu
wxBitmap m_bitmap; // Bitmap for menuitem, if any wxBitmap m_bitmap; // Bitmap for menuitem, if any
DECLARE_DYNAMIC_CLASS(wxMenuItem) DECLARE_DYNAMIC_CLASS(wxMenuItem)
}; };

View File

@@ -11,7 +11,6 @@
// Licence: wxWindows licence // Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#ifndef _WX_METAFIILE_H_ #ifndef _WX_METAFIILE_H_
#define _WX_METAFIILE_H_ #define _WX_METAFIILE_H_
@@ -22,74 +21,67 @@
#include "wx/setup.h" #include "wx/setup.h"
/* /*
* Metafile and metafile device context classes - work in Windows 3.1 only * Metafile and metafile device context classes - work in Windows 3.1 only
* *
*/ */
class WXDLLEXPORT wxDC; class WXDLLEXPORT wxDC;
class WXDLLEXPORT wxMetaFile: public wxObject class WXDLLEXPORT wxMetaFile: public wxObject
{ {
DECLARE_DYNAMIC_CLASS(wxMetaFile) DECLARE_DYNAMIC_CLASS(wxMetaFile)
public: public:
wxMetaFile(const wxString& file = ""); wxMetaFile(const wxString& file = "");
~wxMetaFile(); ~wxMetaFile();
// After this is called, the metafile cannot be used for anything // After this is called, the metafile cannot be used for anything
// since it is now owned by the clipboard. // since it is now owned by the clipboard.
virtual bool SetClipboard(int width = 0, int height = 0); virtual bool SetClipboard(int width = 0, int height = 0);
virtual bool Play(wxDC *dc); virtual bool Play(wxDC *dc);
// TODO // TODO
inline bool Ok() { return FALSE; }; inline bool Ok() { return FALSE; };
/* TODO: Implementation
inline WXHANDLE GetHMETAFILE() { return m_metaFile; }
inline void SetHMETAFILE(WXHANDLE mf) { m_metaFile = mf; }
protected:
WXHANDLE m_metaFile;
*/
}; };
class WXDLLEXPORT wxMetaFileDC: public wxDC class WXDLLEXPORT wxMetaFileDC: public wxDC
{ {
DECLARE_DYNAMIC_CLASS(wxMetaFileDC) DECLARE_DYNAMIC_CLASS(wxMetaFileDC)
public: public:
// Don't supply origin and extent // Don't supply origin and extent
// Supply them to wxMakeMetaFilePlaceable instead. // Supply them to wxMakeMetaFilePlaceable instead.
wxMetaFileDC(const wxString& file = ""); wxMetaFileDC(const wxString& file = "");
// Supply origin and extent (recommended). // Supply origin and extent (recommended).
// Then don't need to supply them to wxMakeMetaFilePlaceable. // Then don't need to supply them to wxMakeMetaFilePlaceable.
wxMetaFileDC(const wxString& file, int xext, int yext, int xorg, int yorg); wxMetaFileDC(const wxString& file, int xext, int yext, int xorg, int yorg);
~wxMetaFileDC(); ~wxMetaFileDC();
// Should be called at end of drawing // Should be called at end of drawing
virtual wxMetaFile *Close(); virtual wxMetaFile *Close();
virtual void SetMapMode(int mode); virtual void SetMapMode(int mode);
virtual void GetTextExtent(const wxString& string, float *x, float *y, virtual void GetTextExtent(const wxString& string, float *x, float *y,
float *descent = NULL, float *externalLeading = NULL, float *descent = NULL, float *externalLeading = NULL,
wxFont *theFont = NULL, bool use16bit = FALSE); wxFont *theFont = NULL, bool use16bit = FALSE);
// Implementation // Implementation
inline wxMetaFile *GetMetaFile() { return m_metaFile; } inline wxMetaFile *GetMetaFile() { return m_metaFile; }
inline void SetMetaFile(wxMetaFile *mf) { m_metaFile = mf; } inline void SetMetaFile(wxMetaFile *mf) { m_metaFile = mf; }
inline int GetWindowsMappingMode() { return m_windowsMappingMode; } inline int GetWindowsMappingMode() { return m_windowsMappingMode; }
inline void SetWindowsMappingMode(int mm) { m_windowsMappingMode = mm; } inline void SetWindowsMappingMode(int mm) { m_windowsMappingMode = mm; }
protected: protected:
int m_windowsMappingMode; int m_windowsMappingMode;
wxMetaFile *m_metaFile; wxMetaFile *m_metaFile;
}; };
/* /*
* Pass filename of existing non-placeable metafile, and bounding box. * Pass filename of existing non-placeable metafile, and bounding box.
* Adds a placeable metafile header, sets the mapping mode to anisotropic, * Adds a placeable metafile header, sets the mapping mode to anisotropic,
* and sets the window origin and extent to mimic the wxMM_TEXT mapping mode. * and sets the window origin and extent to mimic the wxMM_TEXT mapping mode.
* *
*/ */
// No origin or extent // No origin or extent
bool WXDLLEXPORT wxMakeMetaFilePlaceable(const wxString& filename, float scale = 1.0); bool WXDLLEXPORT wxMakeMetaFilePlaceable(const wxString& filename, float scale = 1.0);
@@ -98,4 +90,4 @@ bool WXDLLEXPORT wxMakeMetaFilePlaceable(const wxString& filename, float scale =
bool WXDLLEXPORT wxMakeMetaFilePlaceable(const wxString& filename, int x1, int y1, int x2, int y2, float scale = 1.0, bool useOriginAndExtent = TRUE); bool WXDLLEXPORT wxMakeMetaFilePlaceable(const wxString& filename, int x1, int y1, int x2, int y2, float scale = 1.0, bool useOriginAndExtent = TRUE);
#endif #endif
// _WX_METAFIILE_H_ // _WX_METAFIILE_H_

View File

@@ -21,26 +21,26 @@
#include "wx/frame.h" #include "wx/frame.h"
class WXDLLEXPORT wxMiniFrame: public wxFrame { class WXDLLEXPORT wxMiniFrame: public wxFrame {
DECLARE_DYNAMIC_CLASS(wxMiniFrame) DECLARE_DYNAMIC_CLASS(wxMiniFrame)
public: public:
inline wxMiniFrame() {} inline wxMiniFrame() {}
inline wxMiniFrame(wxWindow *parent, inline wxMiniFrame(wxWindow *parent,
wxWindowID id, wxWindowID id,
const wxString& title, const wxString& title,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE|wxTINY_CAPTION_HORIZ, long style = wxDEFAULT_FRAME_STYLE|wxTINY_CAPTION_HORIZ,
const wxString& name = wxFrameNameStr) const wxString& name = wxFrameNameStr)
{ {
// Use wxFrame constructor in absence of more specific code. // Use wxFrame constructor in absence of more specific code.
Create(parent, id, title, pos, size, style, name); Create(parent, id, title, pos, size, style, name);
} }
~wxMiniFrame() {} ~wxMiniFrame() {}
protected: protected:
}; };
#endif #endif
// _WX_MINIFRAM_H_ // _WX_MINIFRAM_H_

View File

@@ -29,20 +29,20 @@ WXDLLEXPORT_DATA(extern const char*) wxMessageBoxCaptionStr;
class WXDLLEXPORT wxMessageDialog: public wxDialog class WXDLLEXPORT wxMessageDialog: public wxDialog
{ {
DECLARE_DYNAMIC_CLASS(wxMessageDialog) DECLARE_DYNAMIC_CLASS(wxMessageDialog)
public: public:
wxMessageDialog(wxWindow *parent, wxMessageDialog(wxWindow *parent,
const wxString& message, const wxString& message,
const wxString& caption = wxMessageBoxCaptionStr, const wxString& caption = wxMessageBoxCaptionStr,
long style = wxOK | wxCENTRE, long style = wxOK | wxCENTRE,
const wxPoint& pos = wxDefaultPosition); const wxPoint& pos = wxDefaultPosition);
int ShowModal(); int ShowModal();
// implementation only from now on // implementation only from now on
// called by the Motif callback // called by the Motif callback
void SetResult(long result) { m_result = result; } void SetResult(long result) { m_result = result; }
protected: protected:
wxString m_caption; wxString m_caption;
wxString m_message; wxString m_message;
@@ -52,4 +52,4 @@ protected:
}; };
#endif #endif
// _WX_MSGBOXDLG_H_ // _WX_MSGBOXDLG_H_

View File

@@ -24,11 +24,11 @@ class WXDLLEXPORT wxPalette;
// Palette for one display // Palette for one display
class wxXPalette : public wxObject class wxXPalette : public wxObject
{ {
DECLARE_DYNAMIC_CLASS(wxXPalette) DECLARE_DYNAMIC_CLASS(wxXPalette)
public: public:
wxXPalette(); wxXPalette();
WXDisplay* m_display; WXDisplay* m_display;
int m_pix_array_n; int m_pix_array_n;
unsigned long* m_pix_array; unsigned long* m_pix_array;
@@ -42,7 +42,7 @@ class WXDLLEXPORT wxPaletteRefData: public wxGDIRefData
public: public:
wxPaletteRefData(); wxPaletteRefData();
~wxPaletteRefData(); ~wxPaletteRefData();
protected: protected:
wxList m_palettes; wxList m_palettes;
}; };
@@ -51,31 +51,31 @@ protected:
class WXDLLEXPORT wxPalette: public wxGDIObject class WXDLLEXPORT wxPalette: public wxGDIObject
{ {
DECLARE_DYNAMIC_CLASS(wxPalette) DECLARE_DYNAMIC_CLASS(wxPalette)
public: public:
wxPalette(); wxPalette();
wxPalette(const wxPalette& palette) { Ref(palette); } wxPalette(const wxPalette& palette) { Ref(palette); }
wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue); wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
~wxPalette(); ~wxPalette();
bool Create(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue); 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; 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; bool GetRGB(int pixel, unsigned char *red, unsigned char *green, unsigned char *blue) const;
virtual bool Ok() const { return (m_refData != NULL) ; } virtual bool Ok() const { return (m_refData != NULL) ; }
wxPalette& operator = (const wxPalette& palette) { if (*this == palette) return (*this); Ref(palette); return *this; } wxPalette& operator = (const wxPalette& palette) { if (*this == palette) return (*this); Ref(palette); return *this; }
bool operator == (const wxPalette& palette) const { return m_refData == palette.m_refData; } bool operator == (const wxPalette& palette) const { return m_refData == palette.m_refData; }
bool operator != (const wxPalette& palette) const { return m_refData != palette.m_refData; } bool operator != (const wxPalette& palette) const { return m_refData != palette.m_refData; }
// Motif-specific // Motif-specific
WXColormap GetXColormap(WXDisplay* display = NULL) const; WXColormap GetXColormap(WXDisplay* display = NULL) const;
bool TransferBitmap(void *data, int depth, int size); bool TransferBitmap(void *data, int depth, int size);
bool TransferBitmap8(unsigned char *data, unsigned long size, void *dest, unsigned int bpp); bool TransferBitmap8(unsigned char *data, unsigned long size, void *dest, unsigned int bpp);
unsigned long *GetXPixArray(WXDisplay* display, int *pix_array_n); unsigned long *GetXPixArray(WXDisplay* display, int *pix_array_n);
void PutXColormap(WXDisplay* display, WXColormap cmap, bool destroyable); void PutXColormap(WXDisplay* display, WXColormap cmap, bool destroyable);
}; };
#endif #endif
// _WX_PALETTE_H_ // _WX_PALETTE_H_

View File

@@ -31,16 +31,16 @@ public:
wxPenRefData(); wxPenRefData();
wxPenRefData(const wxPenRefData& data); wxPenRefData(const wxPenRefData& data);
~wxPenRefData(); ~wxPenRefData();
protected: protected:
int m_width; int m_width;
int m_style; int m_style;
int m_join ; int m_join ;
int m_cap ; int m_cap ;
wxBitmap m_stipple ; wxBitmap m_stipple ;
int m_nbDash ; int m_nbDash ;
wxMOTIFDash *m_dash ; wxMOTIFDash *m_dash ;
wxColour m_colour; wxColour m_colour;
}; };
#define M_PENDATA ((wxPenRefData *)m_refData) #define M_PENDATA ((wxPenRefData *)m_refData)
@@ -48,55 +48,55 @@ protected:
// Pen // Pen
class WXDLLEXPORT wxPen: public wxGDIObject class WXDLLEXPORT wxPen: public wxGDIObject
{ {
DECLARE_DYNAMIC_CLASS(wxPen) DECLARE_DYNAMIC_CLASS(wxPen)
public: public:
wxPen(); wxPen();
wxPen(const wxColour& col, int width, int style); wxPen(const wxColour& col, int width, int style);
wxPen(const wxBitmap& stipple, int width); wxPen(const wxBitmap& stipple, int width);
inline wxPen(const wxPen& pen) { Ref(pen); } inline wxPen(const wxPen& pen) { Ref(pen); }
~wxPen(); ~wxPen();
inline wxPen& operator = (const wxPen& pen) { if (*this == pen) return (*this); Ref(pen); return *this; } inline wxPen& operator = (const wxPen& pen) { if (*this == pen) return (*this); Ref(pen); return *this; }
inline bool operator == (const wxPen& pen) const { return m_refData == pen.m_refData; } inline bool operator == (const wxPen& pen) const { return m_refData == pen.m_refData; }
inline bool operator != (const wxPen& pen) const { return m_refData != pen.m_refData; } inline bool operator != (const wxPen& pen) const { return m_refData != pen.m_refData; }
virtual bool Ok() const { return (m_refData != NULL) ; } virtual bool Ok() const { return (m_refData != NULL) ; }
// Override in order to recreate the pen // Override in order to recreate the pen
void SetColour(const wxColour& col) ; void SetColour(const wxColour& col) ;
void SetColour(unsigned char r, unsigned char g, unsigned char b) ; void SetColour(unsigned char r, unsigned char g, unsigned char b) ;
void SetWidth(int width) ; void SetWidth(int width) ;
void SetStyle(int style) ; void SetStyle(int style) ;
void SetStipple(const wxBitmap& stipple) ; void SetStipple(const wxBitmap& stipple) ;
void SetDashes(int nb_dashes, const wxDash *dash) ; void SetDashes(int nb_dashes, const wxDash *dash) ;
void SetJoin(int join) ; void SetJoin(int join) ;
void SetCap(int cap) ; void SetCap(int cap) ;
inline wxColour& GetColour() const { return (M_PENDATA ? M_PENDATA->m_colour : wxNullColour); }; 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 GetWidth() const { return (M_PENDATA ? M_PENDATA->m_width : 0); };
inline int GetStyle() const { return (M_PENDATA ? M_PENDATA->m_style : 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 GetJoin() const { return (M_PENDATA ? M_PENDATA->m_join : 0); };
inline int GetCap() const { return (M_PENDATA ? M_PENDATA->m_cap : 0); }; inline int GetCap() const { return (M_PENDATA ? M_PENDATA->m_cap : 0); };
inline int GetDashes(wxDash **ptr) const inline int GetDashes(wxDash **ptr) const
{ {
*ptr = (M_PENDATA ? (wxDash*)M_PENDATA->m_dash : (wxDash*) NULL); *ptr = (M_PENDATA ? (wxDash*)M_PENDATA->m_dash : (wxDash*) NULL);
return (M_PENDATA ? M_PENDATA->m_nbDash : 0); return (M_PENDATA ? M_PENDATA->m_nbDash : 0);
} }
inline int GetDashCount() const { return (M_PENDATA->m_nbDash); } inline int GetDashCount() const { return (M_PENDATA->m_nbDash); }
inline wxDash* GetDash() const { return (wxDash*)M_PENDATA->m_dash; } inline wxDash* GetDash() const { return (wxDash*)M_PENDATA->m_dash; }
inline wxBitmap *GetStipple() const { return (M_PENDATA ? (& M_PENDATA->m_stipple) : (wxBitmap*) NULL); }; inline wxBitmap *GetStipple() const { return (M_PENDATA ? (& M_PENDATA->m_stipple) : (wxBitmap*) NULL); };
// Implementation // Implementation
// Useful helper: create the brush resource // Useful helper: create the brush resource
bool RealizeResource(); bool RealizeResource();
// When setting properties, we must make sure we're not changing // When setting properties, we must make sure we're not changing
// another object // another object
void Unshare(); void Unshare();
}; };
#endif #endif
// _WX_PEN_H_ // _WX_PEN_H_

View File

@@ -19,38 +19,38 @@
#include "wx/prntbase.h" #include "wx/prntbase.h"
/* /*
* Represents the printer: manages printing a wxPrintout object * Represents the printer: manages printing a wxPrintout object
*/ */
class WXDLLEXPORT wxPrinter: public wxPrinterBase class WXDLLEXPORT wxPrinter: public wxPrinterBase
{ {
DECLARE_DYNAMIC_CLASS(wxPrinter) DECLARE_DYNAMIC_CLASS(wxPrinter)
public: public:
wxPrinter(wxPrintData *data = NULL); wxPrinter(wxPrintData *data = NULL);
~wxPrinter(); ~wxPrinter();
virtual bool Print(wxWindow *parent, wxPrintout *printout, bool prompt = TRUE); virtual bool Print(wxWindow *parent, wxPrintout *printout, bool prompt = TRUE);
virtual bool PrintDialog(wxWindow *parent); virtual bool PrintDialog(wxWindow *parent);
virtual bool Setup(wxWindow *parent); virtual bool Setup(wxWindow *parent);
}; };
/* /*
* wxPrintPreview * wxPrintPreview
* Programmer creates an object of this class to preview a wxPrintout. * Programmer creates an object of this class to preview a wxPrintout.
*/ */
class WXDLLEXPORT wxPrintPreview: public wxPrintPreviewBase class WXDLLEXPORT wxPrintPreview: public wxPrintPreviewBase
{ {
DECLARE_CLASS(wxPrintPreview) DECLARE_CLASS(wxPrintPreview)
public: public:
wxPrintPreview(wxPrintout *printout, wxPrintout *printoutForPrinting = NULL, wxPrintData *data = NULL); wxPrintPreview(wxPrintout *printout, wxPrintout *printoutForPrinting = NULL, wxPrintData *data = NULL);
~wxPrintPreview(); ~wxPrintPreview();
virtual bool Print(bool interactive); virtual bool Print(bool interactive);
virtual void DetermineScaling(); virtual void DetermineScaling();
}; };
#endif #endif
// _WX_PRINT_H_ // _WX_PRINT_H_

View File

@@ -22,49 +22,49 @@
#include "wx/cmndata.h" #include "wx/cmndata.h"
/* /*
* wxPrinterDialog * wxPrinterDialog
* The common dialog for printing. * The common dialog for printing.
*/ */
class WXDLLEXPORT wxDC; class WXDLLEXPORT wxDC;
class WXDLLEXPORT wxPrintDialog: public wxDialog class WXDLLEXPORT wxPrintDialog: public wxDialog
{ {
DECLARE_DYNAMIC_CLASS(wxPrintDialog) DECLARE_DYNAMIC_CLASS(wxPrintDialog)
public: public:
wxPrintDialog(); wxPrintDialog();
wxPrintDialog(wxWindow *parent, wxPrintData* data = NULL); wxPrintDialog(wxWindow *parent, wxPrintData* data = NULL);
~wxPrintDialog(); ~wxPrintDialog();
bool Create(wxWindow *parent, wxPrintData* data = NULL); bool Create(wxWindow *parent, wxPrintData* data = NULL);
virtual int ShowModal(); virtual int ShowModal();
inline wxPrintData& GetPrintData() { return m_printData; } inline wxPrintData& GetPrintData() { return m_printData; }
virtual wxDC *GetPrintDC(); virtual wxDC *GetPrintDC();
private: private:
wxPrintData m_printData; wxPrintData m_printData;
wxDC* m_printerDC; wxDC* m_printerDC;
wxWindow* m_dialogParent; wxWindow* m_dialogParent;
}; };
class WXDLLEXPORT wxPageSetupDialog: public wxDialog class WXDLLEXPORT wxPageSetupDialog: public wxDialog
{ {
DECLARE_DYNAMIC_CLASS(wxPageSetupDialog) DECLARE_DYNAMIC_CLASS(wxPageSetupDialog)
private: private:
wxPageSetupData m_pageSetupData; wxPageSetupData m_pageSetupData;
wxWindow* m_dialogParent; wxWindow* m_dialogParent;
public: public:
wxPageSetupDialog(); wxPageSetupDialog();
wxPageSetupDialog(wxWindow *parent, wxPageSetupData *data = NULL); wxPageSetupDialog(wxWindow *parent, wxPageSetupData *data = NULL);
~wxPageSetupDialog(); ~wxPageSetupDialog();
bool Create(wxWindow *parent, wxPageSetupData *data = NULL); bool Create(wxWindow *parent, wxPageSetupData *data = NULL);
virtual int ShowModal(); virtual int ShowModal();
inline wxPageSetupData& GetPageSetupData() { return m_pageSetupData; } inline wxPageSetupData& GetPageSetupData() { return m_pageSetupData; }
}; };
#endif #endif
// _WX_PRINTDLG_H_ // _WX_PRINTDLG_H_

View File

@@ -90,15 +90,15 @@ public:
wxXmString(const wxString& str) wxXmString(const wxString& str)
{ {
m_string = XmStringCreateLtoR((char *)str.c_str(), m_string = XmStringCreateLtoR((char *)str.c_str(),
XmSTRING_DEFAULT_CHARSET); XmSTRING_DEFAULT_CHARSET);
} }
~wxXmString() { XmStringFree(m_string); } ~wxXmString() { XmStringFree(m_string); }
// semi-implicit conversion to XmString (shouldn't rely on implicit // semi-implicit conversion to XmString (shouldn't rely on implicit
// conversion because many of Motif functions are macros) // conversion because many of Motif functions are macros)
XmString operator()() const { return m_string; } XmString operator()() const { return m_string; }
private: private:
XmString m_string; XmString m_string;
}; };
@@ -117,4 +117,4 @@ private:
extern "C" XtAppContext wxGetAppContext(); extern "C" XtAppContext wxGetAppContext();
#endif #endif
// _WX_PRIVATE_H_ // _WX_PRIVATE_H_

View File

@@ -25,33 +25,33 @@ class WXDLLEXPORT wxBitmap ;
class WXDLLEXPORT wxRadioBox : public wxControl class WXDLLEXPORT wxRadioBox : public wxControl
{ {
DECLARE_DYNAMIC_CLASS(wxRadioBox) DECLARE_DYNAMIC_CLASS(wxRadioBox)
public: public:
wxRadioBox(); wxRadioBox();
wxRadioBox(wxWindow *parent, wxWindowID id, const wxString& title, wxRadioBox(wxWindow *parent, wxWindowID id, const wxString& title,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
int n = 0, const wxString choices[] = NULL, int n = 0, const wxString choices[] = NULL,
int majorDim = 0, long style = wxRA_HORIZONTAL, int majorDim = 0, long style = wxRA_HORIZONTAL,
const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr) const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr)
{ {
Create(parent, id, title, pos, size, n, choices, majorDim, style, val, name); Create(parent, id, title, pos, size, n, choices, majorDim, style, val, name);
} }
~wxRadioBox(); ~wxRadioBox();
bool Create(wxWindow *parent, wxWindowID id, const wxString& title, bool Create(wxWindow *parent, wxWindowID id, const wxString& title,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
int n = 0, const wxString choices[] = NULL, int n = 0, const wxString choices[] = NULL,
int majorDim = 0, long style = wxRA_HORIZONTAL, int majorDim = 0, long style = wxRA_HORIZONTAL,
const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr); const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr);
int FindString(const wxString& s) const; int FindString(const wxString& s) const;
void SetSelection(int N); void SetSelection(int N);
int GetSelection() const; int GetSelection() const;
wxString GetString(int N) const; wxString GetString(int N) const;
void SetLabel(const wxString& label) { wxControl::SetLabel(label); }; void SetLabel(const wxString& label) { wxControl::SetLabel(label); };
void SetLabel(int item, const wxString& label) ; void SetLabel(int item, const wxString& label) ;
wxString GetLabel(int item) const; wxString GetLabel(int item) const;
@@ -60,15 +60,15 @@ public:
void Enable(int item, bool enable); void Enable(int item, bool enable);
void Show(int item, bool show) ; void Show(int item, bool show) ;
bool Show(bool show) ; bool Show(bool show) ;
virtual wxString GetStringSelection() const; virtual wxString GetStringSelection() const;
virtual bool SetStringSelection(const wxString& s); virtual bool SetStringSelection(const wxString& s);
virtual int GetCount() const { return m_noItems; } ; virtual int GetCount() const { return m_noItems; } ;
void Command(wxCommandEvent& event); void Command(wxCommandEvent& event);
int GetNumberOfRowsOrCols() const { return m_noRowsOrCols; } int GetNumberOfRowsOrCols() const { return m_noRowsOrCols; }
void SetNumberOfRowsOrCols(int n) { m_noRowsOrCols = n; } void SetNumberOfRowsOrCols(int n) { m_noRowsOrCols = n; }
// Implementation // Implementation
virtual void ChangeFont(bool keepOriginalSize = TRUE); virtual void ChangeFont(bool keepOriginalSize = TRUE);
virtual void ChangeBackgroundColour(); virtual void ChangeBackgroundColour();
@@ -78,23 +78,23 @@ public:
WXWidget GetFrameWidget() const { return m_frameWidget; } WXWidget GetFrameWidget() const { return m_frameWidget; }
inline WXWidget* GetRadioButtons() const { return m_radioButtons; } inline WXWidget* GetRadioButtons() const { return m_radioButtons; }
inline void SetSel(int i) { m_selectedButton = i; } inline void SetSel(int i) { m_selectedButton = i; }
protected: protected:
int m_majorDim ; int m_majorDim ;
int m_noItems; int m_noItems;
int m_noRowsOrCols; int m_noRowsOrCols;
int m_selectedButton; int m_selectedButton;
WXWidget m_formWidget; WXWidget m_formWidget;
WXWidget m_labelWidget; WXWidget m_labelWidget;
WXWidget m_frameWidget; WXWidget m_frameWidget;
WXWidget* m_radioButtons; WXWidget* m_radioButtons;
wxString* m_radioButtonLabels; wxString* m_radioButtonLabels;
virtual void DoSetSize(int x, int y, virtual void DoSetSize(int x, int y,
int width, int height, int width, int height,
int sizeFlags = wxSIZE_AUTO); int sizeFlags = wxSIZE_AUTO);
}; };
#endif #endif
// _WX_RADIOBOX_H_ // _WX_RADIOBOX_H_

View File

@@ -27,28 +27,28 @@ protected:
public: public:
wxRadioButton(); wxRadioButton();
inline wxRadioButton(wxWindow *parent, wxWindowID id, inline wxRadioButton(wxWindow *parent, wxWindowID id,
const wxString& label, const wxString& label,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0, const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator, const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxRadioButtonNameStr) const wxString& name = wxRadioButtonNameStr)
{ {
Create(parent, id, label, pos, size, style, validator, name); Create(parent, id, label, pos, size, style, validator, name);
} }
bool Create(wxWindow *parent, wxWindowID id, bool Create(wxWindow *parent, wxWindowID id,
const wxString& label, const wxString& label,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0, const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator, const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxRadioButtonNameStr); const wxString& name = wxRadioButtonNameStr);
virtual void SetValue(bool val); virtual void SetValue(bool val);
virtual bool GetValue() const ; virtual bool GetValue() const ;
void Command(wxCommandEvent& event); void Command(wxCommandEvent& event);
// Implementation // Implementation
virtual void ChangeFont(bool keepOriginalSize = TRUE); virtual void ChangeFont(bool keepOriginalSize = TRUE);
virtual void ChangeBackgroundColour(); virtual void ChangeBackgroundColour();
virtual void ChangeForegroundColour(); virtual void ChangeForegroundColour();
@@ -62,33 +62,33 @@ WXDLLEXPORT_DATA(extern const char*) wxBitmapRadioButtonNameStr;
class WXDLLEXPORT wxBitmapRadioButton: public wxRadioButton class WXDLLEXPORT wxBitmapRadioButton: public wxRadioButton
{ {
DECLARE_DYNAMIC_CLASS(wxBitmapRadioButton) DECLARE_DYNAMIC_CLASS(wxBitmapRadioButton)
protected: protected:
wxBitmap *theButtonBitmap; wxBitmap *theButtonBitmap;
public: public:
inline wxBitmapRadioButton() { theButtonBitmap = NULL; } inline wxBitmapRadioButton() { theButtonBitmap = NULL; }
inline wxBitmapRadioButton(wxWindow *parent, wxWindowID id, inline wxBitmapRadioButton(wxWindow *parent, wxWindowID id,
const wxBitmap *label, const wxBitmap *label,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0, const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator, const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxBitmapRadioButtonNameStr) const wxString& name = wxBitmapRadioButtonNameStr)
{ {
Create(parent, id, label, pos, size, style, validator, name); Create(parent, id, label, pos, size, style, validator, name);
} }
bool Create(wxWindow *parent, wxWindowID id, bool Create(wxWindow *parent, wxWindowID id,
const wxBitmap *label, const wxBitmap *label,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0, const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator, const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxBitmapRadioButtonNameStr); const wxString& name = wxBitmapRadioButtonNameStr);
virtual void SetLabel(const wxBitmap *label); virtual void SetLabel(const wxBitmap *label);
virtual void SetValue(bool val) ; virtual void SetValue(bool val) ;
virtual bool GetValue() const ; virtual bool GetValue() const ;
}; };
#endif #endif
#endif #endif
// _WX_RADIOBUT_H_ // _WX_RADIOBUT_H_

View File

@@ -28,91 +28,91 @@ WX_DECLARE_LIST(wxRect, wxRectList);
enum wxRegionContain { enum wxRegionContain {
wxOutRegion = 0, wxPartRegion = 1, wxInRegion = 2 wxOutRegion = 0, wxPartRegion = 1, wxInRegion = 2
}; };
// So far, for internal use only // So far, for internal use only
enum wxRegionOp { enum wxRegionOp {
wxRGN_AND, // Creates the intersection of the two combined regions. wxRGN_AND, // Creates the intersection of the two combined regions.
wxRGN_COPY, // Creates a copy of the region identified by hrgnSrc1. wxRGN_COPY, // Creates a copy of the region identified by hrgnSrc1.
wxRGN_DIFF, // Combines the parts of hrgnSrc1 that are not part of hrgnSrc2. wxRGN_DIFF, // Combines the parts of hrgnSrc1 that are not part of hrgnSrc2.
wxRGN_OR, // Creates the union of two combined regions. 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 { class WXDLLEXPORT wxRegion : public wxGDIObject {
DECLARE_DYNAMIC_CLASS(wxRegion) DECLARE_DYNAMIC_CLASS(wxRegion)
friend class WXDLLEXPORT wxRegionIterator; friend class WXDLLEXPORT wxRegionIterator;
public: public:
wxRegion(wxCoord x, wxCoord y, wxCoord w, wxCoord h); wxRegion(wxCoord x, wxCoord y, wxCoord w, wxCoord h);
wxRegion(const wxPoint& topLeft, const wxPoint& bottomRight); wxRegion(const wxPoint& topLeft, const wxPoint& bottomRight);
wxRegion(const wxRect& rect); wxRegion(const wxRect& rect);
wxRegion(); wxRegion();
~wxRegion(); ~wxRegion();
//# Copying //# Copying
inline wxRegion(const wxRegion& r) inline wxRegion(const wxRegion& r)
{ Ref(r); } { Ref(r); }
inline wxRegion& operator = (const wxRegion& r) inline wxRegion& operator = (const wxRegion& r)
{ Ref(r); return (*this); } { Ref(r); return (*this); }
//# Modify region //# Modify region
// Clear current region // Clear current region
void Clear(); void Clear();
// Union rectangle or region with this. // Union rectangle or region with this.
inline bool Union(wxCoord x, wxCoord y, wxCoord width, wxCoord height) { return Combine(x, y, width, height, wxRGN_OR); } inline bool Union(wxCoord x, wxCoord y, wxCoord width, wxCoord height) { return Combine(x, y, width, height, wxRGN_OR); }
inline bool Union(const wxRect& rect) { return Combine(rect, wxRGN_OR); } inline bool Union(const wxRect& rect) { return Combine(rect, wxRGN_OR); }
inline bool Union(const wxRegion& region) { return Combine(region, wxRGN_OR); } inline bool Union(const wxRegion& region) { return Combine(region, wxRGN_OR); }
// Intersect rectangle or region with this. // Intersect rectangle or region with this.
inline bool Intersect(wxCoord x, wxCoord y, wxCoord width, wxCoord height) { return Combine(x, y, width, height, wxRGN_AND); } inline bool Intersect(wxCoord x, wxCoord y, wxCoord width, wxCoord height) { return Combine(x, y, width, height, wxRGN_AND); }
inline bool Intersect(const wxRect& rect) { return Combine(rect, wxRGN_AND); } inline bool Intersect(const wxRect& rect) { return Combine(rect, wxRGN_AND); }
inline bool Intersect(const wxRegion& region) { return Combine(region, wxRGN_AND); } inline bool Intersect(const wxRegion& region) { return Combine(region, wxRGN_AND); }
// Subtract rectangle or region from this: // Subtract rectangle or region from this:
// Combines the parts of 'this' that are not part of the second region. // Combines the parts of 'this' that are not part of the second region.
inline bool Subtract(wxCoord x, wxCoord y, wxCoord width, wxCoord height) { return Combine(x, y, width, height, wxRGN_DIFF); } inline bool Subtract(wxCoord x, wxCoord y, wxCoord width, wxCoord height) { return Combine(x, y, width, height, wxRGN_DIFF); }
inline bool Subtract(const wxRect& rect) { return Combine(rect, wxRGN_DIFF); } inline bool Subtract(const wxRect& rect) { return Combine(rect, wxRGN_DIFF); }
inline bool Subtract(const wxRegion& region) { return Combine(region, wxRGN_DIFF); } inline bool Subtract(const wxRegion& region) { return Combine(region, wxRGN_DIFF); }
// XOR: the union of two combined regions except for any overlapping areas. // XOR: the union of two combined regions except for any overlapping areas.
inline bool Xor(wxCoord x, wxCoord y, wxCoord width, wxCoord height) { return Combine(x, y, width, height, wxRGN_XOR); } inline bool Xor(wxCoord x, wxCoord y, wxCoord width, wxCoord height) { return Combine(x, y, width, height, wxRGN_XOR); }
inline bool Xor(const wxRect& rect) { return Combine(rect, wxRGN_XOR); } inline bool Xor(const wxRect& rect) { return Combine(rect, wxRGN_XOR); }
inline bool Xor(const wxRegion& region) { return Combine(region, wxRGN_XOR); } inline bool Xor(const wxRegion& region) { return Combine(region, wxRGN_XOR); }
//# Information on region //# Information on region
// Outer bounds of region // Outer bounds of region
void GetBox(wxCoord& x, wxCoord& y, wxCoord&w, wxCoord &h) const; void GetBox(wxCoord& x, wxCoord& y, wxCoord&w, wxCoord &h) const;
wxRect GetBox() const ; wxRect GetBox() const ;
// Is region empty? // Is region empty?
bool Empty() const; bool Empty() const;
inline bool IsEmpty() const { return Empty(); } inline bool IsEmpty() const { return Empty(); }
bool Ok() const { return (m_refData != NULL) ; } bool Ok() const { return (m_refData != NULL) ; }
//# Tests //# Tests
// Does the region contain the point (x,y)? // Does the region contain the point (x,y)?
wxRegionContain Contains(wxCoord x, wxCoord y) const; wxRegionContain Contains(wxCoord x, wxCoord y) const;
// Does the region contain the point pt? // Does the region contain the point pt?
wxRegionContain Contains(const wxPoint& pt) const; wxRegionContain Contains(const wxPoint& pt) const;
// Does the region contain the rectangle (x, y, w, h)? // Does the region contain the rectangle (x, y, w, h)?
wxRegionContain Contains(wxCoord x, wxCoord y, wxCoord w, wxCoord h) const; wxRegionContain Contains(wxCoord x, wxCoord y, wxCoord w, wxCoord h) const;
// Does the region contain the rectangle rect? // Does the region contain the rectangle rect?
wxRegionContain Contains(const wxRect& rect) const; wxRegionContain Contains(const wxRect& rect) const;
// Internal // Internal
bool Combine(wxCoord x, wxCoord y, wxCoord width, wxCoord height, wxRegionOp op); bool Combine(wxCoord x, wxCoord y, wxCoord width, wxCoord height, wxRegionOp op);
bool Combine(const wxRegion& region, wxRegionOp op); bool Combine(const wxRegion& region, wxRegionOp op);
bool Combine(const wxRect& rect, wxRegionOp op); bool Combine(const wxRect& rect, wxRegionOp op);
// Get the internal Region handle // Get the internal Region handle
WXRegion GetXRegion() const; WXRegion GetXRegion() const;
// 'Naughty' functions that allow wxWindows to use a list of rects // 'Naughty' functions that allow wxWindows to use a list of rects
// instead of the region, in certain circumstances (e.g. when // instead of the region, in certain circumstances (e.g. when
// making a region out of the update rectangles). // making a region out of the update rectangles).
// These are used by wxPaintDC::wxPaintDC and wxRegionIterator::Reset. // These are used by wxPaintDC::wxPaintDC and wxRegionIterator::Reset.
bool UsingRects() const; bool UsingRects() const;
wxRect* GetRects(); wxRect* GetRects();
int GetRectCount() const; int GetRectCount() const;
@@ -123,33 +123,33 @@ public:
class WXDLLEXPORT wxRegionIterator : public wxObject { class WXDLLEXPORT wxRegionIterator : public wxObject {
DECLARE_DYNAMIC_CLASS(wxRegionIterator) DECLARE_DYNAMIC_CLASS(wxRegionIterator)
public: public:
wxRegionIterator(); wxRegionIterator();
wxRegionIterator(const wxRegion& region); wxRegionIterator(const wxRegion& region);
~wxRegionIterator(); ~wxRegionIterator();
void Reset() { m_current = 0; } void Reset() { m_current = 0; }
void Reset(const wxRegion& region); void Reset(const wxRegion& region);
operator bool () const { return m_current < m_numRects; } operator bool () const { return m_current < m_numRects; }
bool HaveRects() const { return m_current < m_numRects; } bool HaveRects() const { return m_current < m_numRects; }
void operator ++ (); void operator ++ ();
void operator ++ (int); void operator ++ (int);
wxCoord GetX() const; wxCoord GetX() const;
wxCoord GetY() const; wxCoord GetY() const;
wxCoord GetW() const; wxCoord GetW() const;
wxCoord GetWidth() const { return GetW(); } wxCoord GetWidth() const { return GetW(); }
wxCoord GetH() const; wxCoord GetH() const;
wxCoord GetHeight() const { return GetH(); } wxCoord GetHeight() const { return GetH(); }
wxRect GetRect() const { return wxRect(GetX(), GetY(), GetWidth(), GetHeight()); } wxRect GetRect() const { return wxRect(GetX(), GetY(), GetWidth(), GetHeight()); }
private: private:
size_t m_current; size_t m_current;
size_t m_numRects; size_t m_numRects;
wxRegion m_region; wxRegion m_region;
wxRect* m_rects; wxRect* m_rects;
}; };
#endif #endif
// _WX_REGION_H_ // _WX_REGION_H_

View File

@@ -23,51 +23,49 @@ WXDLLEXPORT_DATA(extern const char*) wxScrollBarNameStr;
// Scrollbar item // Scrollbar item
class WXDLLEXPORT wxScrollBar: public wxControl class WXDLLEXPORT wxScrollBar: public wxControl
{ {
DECLARE_DYNAMIC_CLASS(wxScrollBar) DECLARE_DYNAMIC_CLASS(wxScrollBar)
public: public:
inline wxScrollBar() { m_pageSize = 0; m_viewSize = 0; m_objectSize = 0; } inline wxScrollBar() { m_pageSize = 0; m_viewSize = 0; m_objectSize = 0; }
~wxScrollBar(); ~wxScrollBar();
inline 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 wxValidator& validator = wxDefaultValidator, const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxScrollBarNameStr) const wxString& name = wxScrollBarNameStr)
{ {
Create(parent, id, pos, size, style, validator, name); Create(parent, id, pos, size, style, validator, name);
} }
bool Create(wxWindow *parent, wxWindowID id, 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 wxValidator& validator = wxDefaultValidator,
const wxString& name = wxScrollBarNameStr); const wxString& name = wxScrollBarNameStr);
int GetThumbPosition() const ; int GetThumbPosition() const ;
inline int GetThumbSize() const { return m_pageSize; } inline int GetThumbSize() const { return m_pageSize; }
inline int GetPageSize() const { return m_viewSize; } inline int GetPageSize() const { return m_viewSize; }
inline int GetRange() const { return m_objectSize; } inline int GetRange() const { return m_objectSize; }
virtual void SetThumbPosition(int viewStart); virtual void SetThumbPosition(int viewStart);
virtual void SetScrollbar(int position, int thumbSize, int range, int pageSize, virtual void SetScrollbar(int position, int thumbSize, int range, int pageSize,
bool refresh = TRUE); bool refresh = TRUE);
void Command(wxCommandEvent& event); void Command(wxCommandEvent& event);
// Implementation // Implementation
virtual void ChangeFont(bool keepOriginalSize = TRUE); virtual void ChangeFont(bool keepOriginalSize = TRUE);
virtual void ChangeBackgroundColour(); virtual void ChangeBackgroundColour();
virtual void ChangeForegroundColour(); virtual void ChangeForegroundColour();
protected: protected:
int m_pageSize; int m_pageSize;
int m_viewSize; int m_viewSize;
int m_objectSize; int m_objectSize;
// DECLARE_EVENT_TABLE()
}; };
#endif #endif
// _WX_SCROLBAR_H_ // _WX_SCROLBAR_H_

View File

@@ -23,42 +23,42 @@ WXDLLEXPORT_DATA(extern const char*) wxSliderNameStr;
// Slider // Slider
class WXDLLEXPORT wxSlider: public wxControl class WXDLLEXPORT wxSlider: public wxControl
{ {
DECLARE_DYNAMIC_CLASS(wxSlider) DECLARE_DYNAMIC_CLASS(wxSlider)
public: public:
wxSlider(); wxSlider();
wxSlider(wxWindow *parent, wxWindowID id, 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)
{ {
Create(parent, id, value, minValue, maxValue, pos, size, style, validator, name); Create(parent, id, value, minValue, maxValue, pos, size, style, validator, name);
} }
~wxSlider(); ~wxSlider();
bool Create(wxWindow *parent, wxWindowID id, 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() const ; virtual int GetValue() const ;
virtual void SetValue(int); virtual void SetValue(int);
void GetSize(int *x, int *y) const ; void GetSize(int *x, int *y) const ;
void SetRange(int minValue, int maxValue); void SetRange(int minValue, int maxValue);
inline int GetMin() const { return m_rangeMin; } inline int GetMin() const { return m_rangeMin; }
inline int GetMax() const { return m_rangeMax; } inline int GetMax() const { return m_rangeMax; }
// For trackbars only // For trackbars only
void SetTickFreq(int n, int pos); void SetTickFreq(int n, int pos);
inline int GetTickFreq() const { return m_tickFreq; } inline int GetTickFreq() const { return m_tickFreq; }
@@ -74,28 +74,28 @@ public:
void SetThumbLength(int len) ; void SetThumbLength(int len) ;
int GetThumbLength() const ; int GetThumbLength() const ;
void SetTick(int tickPos) ; void SetTick(int tickPos) ;
void Command(wxCommandEvent& event); void Command(wxCommandEvent& event);
// Implementation // Implementation
virtual void ChangeFont(bool keepOriginalSize = TRUE); virtual void ChangeFont(bool keepOriginalSize = TRUE);
virtual void ChangeBackgroundColour(); virtual void ChangeBackgroundColour();
virtual void ChangeForegroundColour(); virtual void ChangeForegroundColour();
protected: protected:
int m_rangeMin; int m_rangeMin;
int m_rangeMax; int m_rangeMax;
int m_pageSize; int m_pageSize;
int m_lineSize; int m_lineSize;
int m_tickFreq; int m_tickFreq;
virtual void DoSetSize(int x, int y, virtual void DoSetSize(int x, int y,
int width, int height, int width, int height,
int sizeFlags = wxSIZE_AUTO); int sizeFlags = wxSIZE_AUTO);
private: private:
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };
#endif #endif
// _WX_SLIDER_H_ // _WX_SLIDER_H_

View File

@@ -13,54 +13,53 @@
#define _WX_SPINBUTT_H_ #define _WX_SPINBUTT_H_
#ifdef __GNUG__ #ifdef __GNUG__
#pragma interface "spinbutt.h" #pragma interface "spinbutt.h"
#endif #endif
class WXDLLEXPORT wxSpinButton : public wxSpinButtonBase class WXDLLEXPORT wxSpinButton : public wxSpinButtonBase
{ {
DECLARE_DYNAMIC_CLASS(wxSpinButton) DECLARE_DYNAMIC_CLASS(wxSpinButton)
public: public:
wxSpinButton() { } wxSpinButton() { }
wxSpinButton(wxWindow *parent, wxSpinButton(wxWindow *parent,
wxWindowID id = -1, wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = wxSP_VERTICAL, long style = wxSP_VERTICAL,
const wxString& name = "wxSpinButton") const wxString& name = "wxSpinButton")
{ {
Create(parent, id, pos, size, style, name); Create(parent, id, pos, size, style, name);
} }
~wxSpinButton(); ~wxSpinButton();
bool Create(wxWindow *parent, bool Create(wxWindow *parent,
wxWindowID id = -1, wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = wxSP_VERTICAL, long style = wxSP_VERTICAL,
const wxString& name = "wxSpinButton"); const wxString& name = "wxSpinButton");
// accessors // accessors
int GetValue() const; int GetValue() const;
int GetMin() const { return m_min; } int GetMin() const { return m_min; }
int GetMax() const { return m_max; } int GetMax() const { return m_max; }
// operations // operations
void SetValue(int val); void SetValue(int val);
void SetRange(int minVal, int maxVal); void SetRange(int minVal, int maxVal);
// Implementation // Implementation
virtual void Command(wxCommandEvent& event) { (void)ProcessCommand(event); }; virtual void Command(wxCommandEvent& event) { (void)ProcessCommand(event); };
virtual void ChangeFont(bool keepOriginalSize = TRUE); virtual void ChangeFont(bool keepOriginalSize = TRUE);
virtual void ChangeBackgroundColour(); virtual void ChangeBackgroundColour();
virtual void ChangeForegroundColour(); virtual void ChangeForegroundColour();
protected: protected:
int m_min; int m_min;
int m_max; int m_max;
}; };
#endif #endif
// _WX_SPINBUTT_H_ // _WX_SPINBUTT_H_

View File

@@ -23,62 +23,62 @@ WXDLLEXPORT_DATA(extern const char*) wxStaticBitmapNameStr;
class WXDLLEXPORT wxStaticBitmap : public wxControl class WXDLLEXPORT wxStaticBitmap : public wxControl
{ {
DECLARE_DYNAMIC_CLASS(wxStaticBitmap) DECLARE_DYNAMIC_CLASS(wxStaticBitmap)
public: public:
wxStaticBitmap() { } wxStaticBitmap() { }
~wxStaticBitmap(); ~wxStaticBitmap();
wxStaticBitmap(wxWindow *parent, wxWindowID id, wxStaticBitmap(wxWindow *parent, wxWindowID id,
const wxBitmap& label, const wxBitmap& 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 = wxStaticBitmapNameStr) const wxString& name = wxStaticBitmapNameStr)
{ {
Create(parent, id, label, pos, size, style, name); Create(parent, id, label, pos, size, style, name);
} }
bool Create(wxWindow *parent, wxWindowID id, bool Create(wxWindow *parent, wxWindowID id,
const wxBitmap& label, const wxBitmap& 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 = wxStaticBitmapNameStr); const wxString& name = wxStaticBitmapNameStr);
virtual void SetBitmap(const wxBitmap& bitmap); virtual void SetBitmap(const wxBitmap& bitmap);
virtual bool ProcessCommand(wxCommandEvent& WXUNUSED(event)) virtual bool ProcessCommand(wxCommandEvent& WXUNUSED(event))
{ {
return FALSE; return FALSE;
} }
wxBitmap& GetBitmap() const { return (wxBitmap&) m_messageBitmap; } wxBitmap& GetBitmap() const { return (wxBitmap&) m_messageBitmap; }
// for compatibility with wxMSW // for compatibility with wxMSW
const wxIcon& GetIcon() const const wxIcon& GetIcon() const
{ {
// don't use wxDynamicCast, icons and bitmaps are really the same thing // don't use wxDynamicCast, icons and bitmaps are really the same thing
return (const wxIcon &)m_messageBitmap; return (const wxIcon &)m_messageBitmap;
} }
// for compatibility with wxMSW // for compatibility with wxMSW
void SetIcon(const wxIcon& icon) void SetIcon(const wxIcon& icon)
{ {
SetBitmap( icon ); SetBitmap( icon );
} }
// overriden base class virtuals // overriden base class virtuals
virtual bool AcceptsFocus() const { return FALSE; } virtual bool AcceptsFocus() const { return FALSE; }
// Implementation // Implementation
virtual void ChangeFont(bool keepOriginalSize = TRUE); virtual void ChangeFont(bool keepOriginalSize = TRUE);
virtual void ChangeBackgroundColour(); virtual void ChangeBackgroundColour();
virtual void ChangeForegroundColour(); virtual void ChangeForegroundColour();
protected: protected:
wxBitmap m_messageBitmap; wxBitmap m_messageBitmap;
}; };
#endif #endif
// _WX_STATBMP_H_ // _WX_STATBMP_H_

View File

@@ -23,55 +23,55 @@ WXDLLEXPORT_DATA(extern const char*) wxStaticBoxNameStr;
// Group box // Group box
class WXDLLEXPORT wxStaticBox: public wxControl class WXDLLEXPORT wxStaticBox: public wxControl
{ {
DECLARE_DYNAMIC_CLASS(wxStaticBox) DECLARE_DYNAMIC_CLASS(wxStaticBox)
public: public:
wxStaticBox(); wxStaticBox();
wxStaticBox(wxWindow *parent, wxWindowID id, wxStaticBox(wxWindow *parent, wxWindowID id,
const wxString& label, 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 = wxStaticBoxNameStr) const wxString& name = wxStaticBoxNameStr)
{ {
Create(parent, id, label, pos, size, style, name); Create(parent, id, label, pos, size, style, name);
} }
~wxStaticBox(); ~wxStaticBox();
bool Create(wxWindow *parent, wxWindowID id, bool Create(wxWindow *parent, wxWindowID id,
const wxString& label, 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 = wxStaticBoxNameStr); const wxString& name = wxStaticBoxNameStr);
virtual bool ProcessCommand(wxCommandEvent& WXUNUSED(event)) virtual bool ProcessCommand(wxCommandEvent& WXUNUSED(event))
{ {
return FALSE; return FALSE;
} }
void SetLabel(const wxString& label); void SetLabel(const wxString& label);
wxString GetLabel() const; wxString GetLabel() const;
// Implementation // Implementation
virtual void ChangeFont(bool keepOriginalSize = TRUE); virtual void ChangeFont(bool keepOriginalSize = TRUE);
virtual void ChangeBackgroundColour(); virtual void ChangeBackgroundColour();
virtual void ChangeForegroundColour(); virtual void ChangeForegroundColour();
WXWidget GetTopWidget() const { return m_formWidget; } WXWidget GetTopWidget() const { return m_formWidget; }
WXWidget GetLabelWidget() const { return m_labelWidget; } WXWidget GetLabelWidget() const { return m_labelWidget; }
protected: protected:
// Motif-specific // Motif-specific
WXWidget m_formWidget; WXWidget m_formWidget;
WXWidget m_labelWidget; WXWidget m_labelWidget;
virtual void DoSetSize(int x, int y, virtual void DoSetSize(int x, int y,
int width, int height, int width, int height,
int sizeFlags = wxSIZE_AUTO); int sizeFlags = wxSIZE_AUTO);
private: private:
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };
#endif #endif
// _WX_STATBOX_H_ // _WX_STATBOX_H_

View File

@@ -23,40 +23,40 @@ WXDLLEXPORT_DATA(extern const char*) wxStaticTextNameStr;
class WXDLLEXPORT wxStaticText: public wxControl class WXDLLEXPORT wxStaticText: public wxControl
{ {
DECLARE_DYNAMIC_CLASS(wxStaticText) DECLARE_DYNAMIC_CLASS(wxStaticText)
public: public:
wxStaticText() { } wxStaticText() { }
wxStaticText(wxWindow *parent, wxWindowID id, wxStaticText(wxWindow *parent, wxWindowID id,
const wxString& label, 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 = wxStaticTextNameStr) const wxString& name = wxStaticTextNameStr)
{ {
Create(parent, id, label, pos, size, style, name); Create(parent, id, label, pos, size, style, name);
} }
bool Create(wxWindow *parent, wxWindowID id, bool Create(wxWindow *parent, wxWindowID id,
const wxString& label, 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 = wxStaticTextNameStr); const wxString& name = wxStaticTextNameStr);
// implementation // implementation
// -------------- // --------------
// operations // operations
virtual bool ProcessCommand(wxCommandEvent& WXUNUSED(event)) virtual bool ProcessCommand(wxCommandEvent& WXUNUSED(event))
{ {
return FALSE; return FALSE;
} }
virtual void ChangeFont(bool keepOriginalSize = TRUE); virtual void ChangeFont(bool keepOriginalSize = TRUE);
virtual void ChangeBackgroundColour(); virtual void ChangeBackgroundColour();
virtual void ChangeForegroundColour(); virtual void ChangeForegroundColour();
}; };
#endif #endif
// _WX_STATTEXT_H_ // _WX_STATTEXT_H_

View File

@@ -19,8 +19,8 @@
class wxImageList; class wxImageList;
/* /*
* Flags returned by HitTest * Flags returned by HitTest
*/ */
#define wxTAB_HITTEST_NOWHERE 1 #define wxTAB_HITTEST_NOWHERE 1
#define wxTAB_HITTEST_ONICON 2 #define wxTAB_HITTEST_ONICON 2
@@ -29,110 +29,110 @@ class wxImageList;
class WXDLLEXPORT wxTabCtrl: public wxControl class WXDLLEXPORT wxTabCtrl: public wxControl
{ {
DECLARE_DYNAMIC_CLASS(wxTabCtrl) DECLARE_DYNAMIC_CLASS(wxTabCtrl)
public: public:
/* /*
* Public interface * Public interface
*/ */
wxTabCtrl(); wxTabCtrl();
inline wxTabCtrl(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, inline wxTabCtrl(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
long style = 0, const wxString& name = "tabCtrl") long style = 0, const wxString& name = "tabCtrl")
{ {
Create(parent, id, pos, size, style, name); Create(parent, id, pos, size, style, name);
} }
~wxTabCtrl(); ~wxTabCtrl();
// Accessors // Accessors
// Get the selection // Get the selection
int GetSelection() const; int GetSelection() const;
// Get the tab with the current keyboard focus // Get the tab with the current keyboard focus
int GetCurFocus() const; int GetCurFocus() const;
// Get the associated image list // Get the associated image list
wxImageList* GetImageList() const; wxImageList* GetImageList() const;
// Get the number of items // Get the number of items
int GetItemCount() const; int GetItemCount() const;
// Get the rect corresponding to the tab // Get the rect corresponding to the tab
bool GetItemRect(int item, wxRect& rect) const; bool GetItemRect(int item, wxRect& rect) const;
// Get the number of rows // Get the number of rows
int GetRowCount() const; int GetRowCount() const;
// Get the item text // Get the item text
wxString GetItemText(int item) const ; wxString GetItemText(int item) const ;
// Get the item image // Get the item image
int GetItemImage(int item) const; int GetItemImage(int item) const;
// Get the item data // Get the item data
void* GetItemData(int item) const; void* GetItemData(int item) const;
// Set the selection // Set the selection
int SetSelection(int item); int SetSelection(int item);
// Set the image list // Set the image list
void SetImageList(wxImageList* imageList); void SetImageList(wxImageList* imageList);
// Set the text for an item // Set the text for an item
bool SetItemText(int item, const wxString& text); bool SetItemText(int item, const wxString& text);
// Set the image for an item // Set the image for an item
bool SetItemImage(int item, int image); bool SetItemImage(int item, int image);
// Set the data for an item // Set the data for an item
bool SetItemData(int item, void* data); bool SetItemData(int item, void* data);
// Set the size for a fixed-width tab control // Set the size for a fixed-width tab control
void SetItemSize(const wxSize& size); void SetItemSize(const wxSize& size);
// Set the padding between tabs // Set the padding between tabs
void SetPadding(const wxSize& padding); void SetPadding(const wxSize& padding);
// Operations // Operations
bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
long style = 0, const wxString& name = "tabCtrl"); long style = 0, const wxString& name = "tabCtrl");
// Delete all items // Delete all items
bool DeleteAllItems(); bool DeleteAllItems();
// Delete an item // Delete an item
bool DeleteItem(int item); bool DeleteItem(int item);
// Hit test // Hit test
int HitTest(const wxPoint& pt, long& flags); int HitTest(const wxPoint& pt, long& flags);
// Insert an item // Insert an item
bool InsertItem(int item, const wxString& text, int imageId = -1, void* data = NULL); bool InsertItem(int item, const wxString& text, int imageId = -1, void* data = NULL);
void Command(wxCommandEvent& event); void Command(wxCommandEvent& event);
protected: protected:
wxImageList* m_imageList; wxImageList* m_imageList;
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };
class WXDLLEXPORT wxTabEvent: public wxCommandEvent class WXDLLEXPORT wxTabEvent: public wxCommandEvent
{ {
DECLARE_DYNAMIC_CLASS(wxTabEvent) DECLARE_DYNAMIC_CLASS(wxTabEvent)
public: public:
wxTabEvent(wxEventType commandType = wxEVT_NULL, int id = 0); wxTabEvent(wxEventType commandType = wxEVT_NULL, int id = 0);
}; };
typedef void (wxEvtHandler::*wxTabEventFunction)(wxTabEvent&); typedef void (wxEvtHandler::*wxTabEventFunction)(wxTabEvent&);
#define EVT_TAB_SEL_CHANGED(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_COMMAND_TAB_SEL_CHANGED, \ #define EVT_TAB_SEL_CHANGED(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_COMMAND_TAB_SEL_CHANGED, \
id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTabEventFunction) & fn, NULL ), id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTabEventFunction) & fn, NULL ),
#define EVT_TAB_SEL_CHANGING(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_COMMAND_TAB_SEL_CHANGING, \ #define EVT_TAB_SEL_CHANGING(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_COMMAND_TAB_SEL_CHANGING, \
id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTabEventFunction) & fn, NULL ), id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTabEventFunction) & fn, NULL ),
#endif #endif
// _WX_TABCTRL_H_ // _WX_TABCTRL_H_

View File

@@ -23,16 +23,16 @@
class wxTaskBarIcon: public wxObject class wxTaskBarIcon: public wxObject
{ {
public: public:
wxTaskBarIcon(); wxTaskBarIcon();
virtual ~wxTaskBarIcon(); virtual ~wxTaskBarIcon();
// Accessors // Accessors
// Operations // Operations
bool SetIcon(const wxIcon& icon, const wxString& tooltip = ""); bool SetIcon(const wxIcon& icon, const wxString& tooltip = "");
bool RemoveIcon(); bool RemoveIcon();
// Overridables // Overridables
virtual void OnMouseMove(); virtual void OnMouseMove();
virtual void OnLButtonDown(); virtual void OnLButtonDown();
virtual void OnLButtonUp(); virtual void OnLButtonUp();
@@ -40,10 +40,10 @@ public:
virtual void OnRButtonUp(); virtual void OnRButtonUp();
virtual void OnLButtonDClick(); virtual void OnLButtonDClick();
virtual void OnRButtonDClick(); virtual void OnRButtonDClick();
// Data members // Data members
protected: protected:
}; };
#endif #endif
// _WX_TASKBAR_H_ // _WX_TASKBAR_H_

View File

@@ -13,7 +13,7 @@
#define _WX_TEXTCTRL_H_ #define _WX_TEXTCTRL_H_
#ifdef __GNUG__ #ifdef __GNUG__
#pragma interface "textctrl.h" #pragma interface "textctrl.h"
#endif #endif
WXDLLEXPORT_DATA(extern const char*) wxTextCtrlNameStr; WXDLLEXPORT_DATA(extern const char*) wxTextCtrlNameStr;
@@ -23,42 +23,42 @@ WXDLLEXPORT_DATA(extern const char*) wxEmptyString;
class WXDLLEXPORT wxTextCtrl : public wxTextCtrlBase class WXDLLEXPORT wxTextCtrl : public wxTextCtrlBase
{ {
DECLARE_DYNAMIC_CLASS(wxTextCtrl) DECLARE_DYNAMIC_CLASS(wxTextCtrl)
public: public:
// creation // creation
// -------- // --------
wxTextCtrl(); wxTextCtrl();
wxTextCtrl(wxWindow *parent, wxTextCtrl(wxWindow *parent,
wxWindowID id, wxWindowID id,
const wxString& value = wxEmptyString, const wxString& value = wxEmptyString,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = 0, long style = 0,
const wxValidator& validator = wxDefaultValidator, const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxTextCtrlNameStr) const wxString& name = wxTextCtrlNameStr)
{ {
Create(parent, id, value, pos, size, style, validator, name); Create(parent, id, value, pos, size, style, validator, name);
} }
bool Create(wxWindow *parent, wxWindowID id, bool Create(wxWindow *parent, wxWindowID id,
const wxString& value = wxEmptyString, const wxString& value = wxEmptyString,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0, const wxSize& size = wxDefaultSize, long style = 0,
const wxValidator& validator = wxDefaultValidator, const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxTextCtrlNameStr); const wxString& name = wxTextCtrlNameStr);
// accessors // accessors
// --------- // ---------
virtual wxString GetValue() const; virtual wxString GetValue() const;
virtual void SetValue(const wxString& value); virtual void SetValue(const wxString& value);
virtual int GetLineLength(long lineNo) const; virtual int GetLineLength(long lineNo) const;
virtual wxString GetLineText(long lineNo) const; virtual wxString GetLineText(long lineNo) const;
virtual int GetNumberOfLines() const; virtual int GetNumberOfLines() const;
// operations // operations
// ---------- // ----------
// Clipboard operations // Clipboard operations
virtual void Copy(); virtual void Copy();
virtual void Cut(); virtual void Cut();
@@ -66,14 +66,14 @@ public:
virtual bool CanCopy() const; virtual bool CanCopy() const;
virtual bool CanCut() const; virtual bool CanCut() const;
virtual bool CanPaste() const; virtual bool CanPaste() const;
// Undo/redo // Undo/redo
virtual void Undo(); virtual void Undo();
virtual void Redo(); virtual void Redo();
virtual bool CanUndo() const; virtual bool CanUndo() const;
virtual bool CanRedo() const; virtual bool CanRedo() const;
virtual void SetInsertionPoint(long pos); virtual void SetInsertionPoint(long pos);
virtual void SetInsertionPointEnd(); virtual void SetInsertionPointEnd();
virtual long GetInsertionPoint() const; virtual long GetInsertionPoint() const;
@@ -86,39 +86,39 @@ public:
// selection. // selection.
virtual void GetSelection(long* from, long* to) const; virtual void GetSelection(long* from, long* to) const;
virtual bool IsEditable() const ; virtual bool IsEditable() const ;
virtual bool LoadFile(const wxString& file); virtual bool LoadFile(const wxString& file);
virtual bool SaveFile(const wxString& file); virtual bool SaveFile(const wxString& file);
virtual void WriteText(const wxString& text); virtual void WriteText(const wxString& text);
virtual void AppendText(const wxString& text); virtual void AppendText(const wxString& text);
virtual void DiscardEdits(); virtual void DiscardEdits();
virtual bool IsModified() const; virtual bool IsModified() const;
virtual long XYToPosition(long x, long y) const; virtual long XYToPosition(long x, long y) const;
virtual bool PositionToXY(long pos, long *x, long *y) const; virtual bool PositionToXY(long pos, long *x, long *y) const;
virtual void ShowPosition(long pos); virtual void ShowPosition(long pos);
virtual void Clear(); virtual void Clear();
// callbacks // callbacks
// --------- // ---------
void OnDropFiles(wxDropFilesEvent& event); void OnDropFiles(wxDropFilesEvent& event);
void OnChar(wxKeyEvent& event); void OnChar(wxKeyEvent& event);
// void OnEraseBackground(wxEraseEvent& event); // void OnEraseBackground(wxEraseEvent& event);
void OnCut(wxCommandEvent& event); void OnCut(wxCommandEvent& event);
void OnCopy(wxCommandEvent& event); void OnCopy(wxCommandEvent& event);
void OnPaste(wxCommandEvent& event); void OnPaste(wxCommandEvent& event);
void OnUndo(wxCommandEvent& event); void OnUndo(wxCommandEvent& event);
void OnRedo(wxCommandEvent& event); void OnRedo(wxCommandEvent& event);
void OnUpdateCut(wxUpdateUIEvent& event); void OnUpdateCut(wxUpdateUIEvent& event);
void OnUpdateCopy(wxUpdateUIEvent& event); void OnUpdateCopy(wxUpdateUIEvent& event);
void OnUpdatePaste(wxUpdateUIEvent& event); void OnUpdatePaste(wxUpdateUIEvent& event);
void OnUpdateUndo(wxUpdateUIEvent& event); void OnUpdateUndo(wxUpdateUIEvent& event);
void OnUpdateRedo(wxUpdateUIEvent& event); void OnUpdateRedo(wxUpdateUIEvent& event);
virtual void Command(wxCommandEvent& event); virtual void Command(wxCommandEvent& event);
// implementation from here to the end // implementation from here to the end
// ----------------------------------- // -----------------------------------
virtual void ChangeFont(bool keepOriginalSize = TRUE); virtual void ChangeFont(bool keepOriginalSize = TRUE);
@@ -126,26 +126,26 @@ public:
virtual void ChangeForegroundColour(); virtual void ChangeForegroundColour();
void SetModified(bool mod) { m_modified = mod; } void SetModified(bool mod) { m_modified = mod; }
virtual WXWidget GetTopWidget() const; virtual WXWidget GetTopWidget() const;
// send the CHAR and TEXT_UPDATED events // send the CHAR and TEXT_UPDATED events
void DoSendEvents(void /* XmTextVerifyCallbackStruct */ *cbs, void DoSendEvents(void /* XmTextVerifyCallbackStruct */ *cbs,
long keycode); long keycode);
protected: protected:
wxString m_fileName; wxString m_fileName;
public: public:
// Motif-specific // Motif-specific
void* m_tempCallbackStruct; void* m_tempCallbackStruct;
bool m_modified; bool m_modified;
wxString m_value; // Required for password text controls wxString m_value; // Required for password text controls
// Did we call wxTextCtrl::OnChar? If so, generate a command event. // Did we call wxTextCtrl::OnChar? If so, generate a command event.
bool m_processedDefault; bool m_processedDefault;
private: private:
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };
#endif #endif
// _WX_TEXTCTRL_H_ // _WX_TEXTCTRL_H_

View File

@@ -13,32 +13,32 @@
#define _WX_TIMER_H_ #define _WX_TIMER_H_
#ifdef __GNUG__ #ifdef __GNUG__
#pragma interface "timer.h" #pragma interface "timer.h"
#endif #endif
class WXDLLEXPORT wxTimer : public wxTimerBase class WXDLLEXPORT wxTimer : public wxTimerBase
{ {
friend void wxTimerCallback(wxTimer * timer); friend void wxTimerCallback(wxTimer * timer);
public: public:
wxTimer() { Init(); } wxTimer() { Init(); }
wxTimer(wxEvtHandler *owner, int id = -1) : wxTimerBase(owner, id) wxTimer(wxEvtHandler *owner, int id = -1) : wxTimerBase(owner, id)
{ Init(); } { Init(); }
~wxTimer(); ~wxTimer();
virtual bool Start(int milliseconds = -1, bool oneShot = FALSE); virtual bool Start(int milliseconds = -1, bool oneShot = FALSE);
virtual void Stop(); virtual void Stop();
virtual bool IsRunning() const { return m_id != 0; } virtual bool IsRunning() const { return m_id != 0; }
protected: protected:
void Init(); void Init();
long m_id; long m_id;
private: private:
DECLARE_DYNAMIC_CLASS(wxTimer) DECLARE_DYNAMIC_CLASS(wxTimer)
}; };
#endif #endif
// _WX_TIMER_H_ // _WX_TIMER_H_

View File

@@ -13,7 +13,7 @@
#define _WX_TOOLBAR_H_ #define _WX_TOOLBAR_H_
#ifdef __GNUG__ #ifdef __GNUG__
#pragma interface "toolbar.h" #pragma interface "toolbar.h"
#endif #endif
class WXDLLEXPORT wxToolBar : public wxToolBarBase class WXDLLEXPORT wxToolBar : public wxToolBarBase
@@ -21,62 +21,62 @@ class WXDLLEXPORT wxToolBar : public wxToolBarBase
public: public:
// ctors and dtor // ctors and dtor
wxToolBar() { Init(); } wxToolBar() { Init(); }
wxToolBar(wxWindow *parent, wxToolBar(wxWindow *parent,
wxWindowID id, wxWindowID id,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = wxNO_BORDER | wxTB_HORIZONTAL, long style = wxNO_BORDER | wxTB_HORIZONTAL,
const wxString& name = wxToolBarNameStr) const wxString& name = wxToolBarNameStr)
{ {
Init(); Init();
Create(parent, id, pos, size, style, name); Create(parent, id, pos, size, style, name);
} }
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 = wxNO_BORDER | wxTB_HORIZONTAL, long style = wxNO_BORDER | wxTB_HORIZONTAL,
const wxString& name = wxToolBarNameStr); const wxString& name = wxToolBarNameStr);
virtual ~wxToolBar(); virtual ~wxToolBar();
// override/implement base class virtuals // override/implement base class virtuals
virtual wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y) const; virtual wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y) const;
virtual bool Realize(); virtual bool Realize();
// implementation from now on // implementation from now on
// find tool by widget // find tool by widget
wxToolBarToolBase *FindToolByWidget(WXWidget w) const; wxToolBarToolBase *FindToolByWidget(WXWidget w) const;
protected: protected:
// common part of all ctors // common part of all ctors
void Init(); void Init();
// implement base class pure virtuals // implement base class pure virtuals
virtual bool DoInsertTool(size_t pos, wxToolBarToolBase *tool); virtual bool DoInsertTool(size_t pos, wxToolBarToolBase *tool);
virtual bool DoDeleteTool(size_t pos, wxToolBarToolBase *tool); virtual bool DoDeleteTool(size_t pos, wxToolBarToolBase *tool);
virtual void DoEnableTool(wxToolBarToolBase *tool, bool enable); virtual void DoEnableTool(wxToolBarToolBase *tool, bool enable);
virtual void DoToggleTool(wxToolBarToolBase *tool, bool toggle); virtual void DoToggleTool(wxToolBarToolBase *tool, bool toggle);
virtual void DoSetToggle(wxToolBarToolBase *tool, bool toggle); virtual void DoSetToggle(wxToolBarToolBase *tool, bool toggle);
virtual wxToolBarToolBase *CreateTool(int id, virtual wxToolBarToolBase *CreateTool(int id,
const wxBitmap& bitmap1, const wxBitmap& bitmap1,
const wxBitmap& bitmap2, const wxBitmap& bitmap2,
bool toggle, bool toggle,
wxObject *clientData, wxObject *clientData,
const wxString& shortHelpString, const wxString& shortHelpString,
const wxString& longHelpString); const wxString& longHelpString);
virtual wxToolBarToolBase *CreateTool(wxControl *control); virtual wxToolBarToolBase *CreateTool(wxControl *control);
private: private:
DECLARE_DYNAMIC_CLASS(wxToolBar) DECLARE_DYNAMIC_CLASS(wxToolBar)
}; };
#endif #endif
// _WX_TOOLBAR_H_ // _WX_TOOLBAR_H_

View File

@@ -22,23 +22,23 @@
class wxWave : public wxObject class wxWave : public wxObject
{ {
public: public:
wxWave(); wxWave();
wxWave(const wxString& fileName, bool isResource = FALSE); wxWave(const wxString& fileName, bool isResource = FALSE);
~wxWave(); ~wxWave();
public: public:
bool Create(const wxString& fileName, bool isResource = FALSE); bool Create(const wxString& fileName, bool isResource = FALSE);
bool IsOk() const { return (m_waveData ? TRUE : FALSE); }; bool IsOk() const { return (m_waveData ? TRUE : FALSE); };
bool Play(bool async = TRUE, bool looped = FALSE) const; bool Play(bool async = TRUE, bool looped = FALSE) const;
protected: protected:
bool Free(); bool Free();
private: private:
char* m_waveData; char* m_waveData;
int m_waveLength; int m_waveLength;
bool m_isResource; bool m_isResource;
}; };
#endif #endif
// _WX_WAVE_H_ // _WX_WAVE_H_

View File

@@ -13,7 +13,7 @@
#define _WX_WINDOW_H_ #define _WX_WINDOW_H_
#ifdef __GNUG__ #ifdef __GNUG__
#pragma interface "window.h" #pragma interface "window.h"
#endif #endif
#include "wx/region.h" #include "wx/region.h"
@@ -24,93 +24,93 @@
class wxWindow : public wxWindowBase class wxWindow : public wxWindowBase
{ {
friend class WXDLLEXPORT wxDC; friend class WXDLLEXPORT wxDC;
friend class WXDLLEXPORT wxWindowDC; friend class WXDLLEXPORT wxWindowDC;
public: public:
wxWindow() { Init(); } wxWindow() { Init(); }
wxWindow(wxWindow *parent, wxWindow(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 = wxPanelNameStr) const wxString& name = wxPanelNameStr)
{ {
Init(); Init();
Create(parent, id, pos, size, style, name); Create(parent, id, pos, size, style, name);
} }
virtual ~wxWindow(); virtual ~wxWindow();
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,
const wxString& name = wxPanelNameStr); const wxString& name = wxPanelNameStr);
// implement base class pure virtuals // implement base class pure virtuals
virtual void SetTitle( const wxString& title); virtual void SetTitle( const wxString& title);
virtual wxString GetTitle() const; virtual wxString GetTitle() const;
virtual void Raise(); virtual void Raise();
virtual void Lower(); virtual void Lower();
virtual bool Show( bool show = TRUE ); virtual bool Show( bool show = TRUE );
virtual bool Enable( bool enable = TRUE ); virtual bool Enable( bool enable = TRUE );
virtual void SetFocus(); virtual void SetFocus();
virtual void WarpPointer(int x, int y); virtual void WarpPointer(int x, int y);
virtual void Refresh( bool eraseBackground = TRUE, virtual void Refresh( bool eraseBackground = TRUE,
const wxRect *rect = (const wxRect *) NULL ); const wxRect *rect = (const wxRect *) NULL );
virtual void Clear(); virtual void Clear();
virtual bool SetBackgroundColour( const wxColour &colour ); virtual bool SetBackgroundColour( const wxColour &colour );
virtual bool SetForegroundColour( const wxColour &colour ); virtual bool SetForegroundColour( const wxColour &colour );
virtual bool SetCursor( const wxCursor &cursor ); virtual bool SetCursor( const wxCursor &cursor );
virtual bool SetFont( const wxFont &font ); virtual bool SetFont( const wxFont &font );
virtual int GetCharHeight() const; virtual int GetCharHeight() const;
virtual int GetCharWidth() const; virtual int GetCharWidth() const;
virtual void GetTextExtent(const wxString& string, virtual void GetTextExtent(const wxString& string,
int *x, int *y, int *x, int *y,
int *descent = (int *) NULL, int *descent = (int *) NULL,
int *externalLeading = (int *) NULL, int *externalLeading = (int *) NULL,
const wxFont *theFont = (const wxFont *) NULL) const wxFont *theFont = (const wxFont *) NULL)
const; const;
virtual void SetScrollbar( int orient, int pos, int thumbVisible, virtual void SetScrollbar( int orient, int pos, int thumbVisible,
int range, bool refresh = TRUE ); int range, bool refresh = TRUE );
virtual void SetScrollPos( int orient, int pos, bool refresh = TRUE ); virtual void SetScrollPos( int orient, int pos, bool refresh = TRUE );
virtual int GetScrollPos( int orient ) const; virtual int GetScrollPos( int orient ) const;
virtual int GetScrollThumb( int orient ) const; virtual int GetScrollThumb( int orient ) const;
virtual int GetScrollRange( int orient ) const; virtual int GetScrollRange( int orient ) const;
virtual void ScrollWindow( int dx, int dy, virtual void ScrollWindow( int dx, int dy,
const wxRect* rect = (wxRect *) NULL ); const wxRect* rect = (wxRect *) NULL );
virtual void SetSizeHints(int minW, int minH, virtual void SetSizeHints(int minW, int minH,
int maxW = -1, int maxH = -1, int maxW = -1, int maxH = -1,
int incW = -1, int incH = -1); int incW = -1, int incH = -1);
#if wxUSE_DRAG_AND_DROP #if wxUSE_DRAG_AND_DROP
virtual void SetDropTarget( wxDropTarget *dropTarget ); virtual void SetDropTarget( wxDropTarget *dropTarget );
#endif // wxUSE_DRAG_AND_DROP #endif // wxUSE_DRAG_AND_DROP
// Accept files for dragging // Accept files for dragging
virtual void DragAcceptFiles(bool accept); virtual void DragAcceptFiles(bool accept);
// Get the unique identifier of a window // Get the unique identifier of a window
virtual WXWidget GetHandle() const { return GetMainWidget(); } virtual WXWidget GetHandle() const { return GetMainWidget(); }
// implementation from now on // implementation from now on
// -------------------------- // --------------------------
// accessors // accessors
// --------- // ---------
// Get main widget for this window, e.g. a text widget // Get main widget for this window, e.g. a text widget
virtual WXWidget GetMainWidget() const; virtual WXWidget GetMainWidget() const;
// Get the widget that corresponds to the label (for font setting, label setting etc.) // Get the widget that corresponds to the label (for font setting, label setting etc.)
@@ -122,83 +122,83 @@ public:
// multi-line text widget. Top means, top in the window hierarchy that // multi-line text widget. Top means, top in the window hierarchy that
// implements this window. // implements this window.
virtual WXWidget GetTopWidget() const; virtual WXWidget GetTopWidget() const;
// Get the underlying X window and display // Get the underlying X window and display
WXWindow GetXWindow() const; WXWindow GetXWindow() const;
WXDisplay *GetXDisplay() const; WXDisplay *GetXDisplay() const;
// called from Motif callbacks - and should only be called from there // called from Motif callbacks - and should only be called from there
void SetButton1(bool pressed) { m_button1Pressed = pressed; } void SetButton1(bool pressed) { m_button1Pressed = pressed; }
void SetButton2(bool pressed) { m_button2Pressed = pressed; } void SetButton2(bool pressed) { m_button2Pressed = pressed; }
void SetButton3(bool pressed) { m_button3Pressed = pressed; } void SetButton3(bool pressed) { m_button3Pressed = pressed; }
void SetLastClick(int button, long timestamp) void SetLastClick(int button, long timestamp)
{ m_lastButton = button; m_lastTS = timestamp; } { m_lastButton = button; m_lastTS = timestamp; }
int GetLastClickedButton() const { return m_lastButton; } int GetLastClickedButton() const { return m_lastButton; }
long GetLastClickTime() const { return m_lastTS; } long GetLastClickTime() const { return m_lastTS; }
// Gives window a chance to do something in response to a size message, e.g. // Gives window a chance to do something in response to a size message, e.g.
// arrange status bar, toolbar etc. // arrange status bar, toolbar etc.
virtual bool PreResize(); virtual bool PreResize();
// Generates a paint event // Generates a paint event
virtual void DoPaint(); virtual void DoPaint();
// update rectangle/region manipulation // update rectangle/region manipulation
// (for wxWindowDC and Motif callbacks only) // (for wxWindowDC and Motif callbacks only)
// ----------------------------------------- // -----------------------------------------
// read/write access to the update rect list // read/write access to the update rect list
const wxRectList& GetUpdateRects() const { return m_updateRects; } const wxRectList& GetUpdateRects() const { return m_updateRects; }
// Adds a recangle to the updates list // Adds a recangle to the updates list
void AddUpdateRect(int x, int y, int w, int h) void AddUpdateRect(int x, int y, int w, int h)
{ m_updateRects.Append(new wxRect(x, y, w, h)); } { m_updateRects.Append(new wxRect(x, y, w, h)); }
// Empties the m_updateRects list // Empties the m_updateRects list
void ClearUpdateRects(); void ClearUpdateRects();
void ClearUpdateRegion() { m_updateRegion.Clear(); } void ClearUpdateRegion() { m_updateRegion.Clear(); }
void SetUpdateRegion(const wxRegion& region) { m_updateRegion = region; } void SetUpdateRegion(const wxRegion& region) { m_updateRegion = region; }
// sets the fore/background colour for the given widget // sets the fore/background colour for the given widget
static void DoChangeForegroundColour(WXWidget widget, wxColour& foregroundColour); static void DoChangeForegroundColour(WXWidget widget, wxColour& foregroundColour);
static void DoChangeBackgroundColour(WXWidget widget, wxColour& backgroundColour, bool changeArmColour = FALSE); static void DoChangeBackgroundColour(WXWidget widget, wxColour& backgroundColour, bool changeArmColour = FALSE);
// For implementation purposes - sometimes decorations make the client area // For implementation purposes - sometimes decorations make the client area
// smaller // smaller
virtual wxPoint GetClientAreaOrigin() const; virtual wxPoint GetClientAreaOrigin() const;
protected: protected:
// event handlers (not virtual by design) // event handlers (not virtual by design)
void OnIdle(wxIdleEvent& event); void OnIdle(wxIdleEvent& event);
// Makes an adjustment to the window position (for example, a frame that has // Makes an adjustment to the window position (for example, a frame that has
// a toolbar that it manages itself). // a toolbar that it manages itself).
virtual void AdjustForParentClientOrigin(int& x, int& y, int sizeFlags); virtual void AdjustForParentClientOrigin(int& x, int& y, int sizeFlags);
wxWindow *GetChild(int number) const wxWindow *GetChild(int number) const
{ return GetChildren().Item(number)->GetData(); } { return GetChildren().Item(number)->GetData(); }
// Responds to colour changes: passes event on to children. // Responds to colour changes: passes event on to children.
void OnSysColourChanged(wxSysColourChangedEvent& event); void OnSysColourChanged(wxSysColourChangedEvent& event);
// Motif-specific // Motif-specific
// CanvasXXXSiize functions // CanvasXXXSiize functions
void CanvasGetSize(int* width, int* height) const; // If have drawing area void CanvasGetSize(int* width, int* height) const; // If have drawing area
void CanvasGetClientSize(int *width, int *height) const; void CanvasGetClientSize(int *width, int *height) const;
void CanvasGetPosition(int *x, int *y) const; // If have drawing area void CanvasGetPosition(int *x, int *y) const; // If have drawing area
void CanvasSetClientSize(int width, int size); void CanvasSetClientSize(int width, int size);
void CanvasSetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); void CanvasSetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
void SetMainWidget(WXWidget w) { m_mainWidget = w; } void SetMainWidget(WXWidget w) { m_mainWidget = w; }
bool CanAddEventHandler() const { return m_canAddEventHandler; } bool CanAddEventHandler() const { return m_canAddEventHandler; }
void SetCanAddEventHandler(bool flag) { m_canAddEventHandler = flag; } void SetCanAddEventHandler(bool flag) { m_canAddEventHandler = flag; }
public: public:
WXPixmap GetBackingPixmap() const { return m_backingPixmap; } WXPixmap GetBackingPixmap() const { return m_backingPixmap; }
void SetBackingPixmap(WXPixmap pixmap) { m_backingPixmap = pixmap; } void SetBackingPixmap(WXPixmap pixmap) { m_backingPixmap = pixmap; }
@@ -206,22 +206,22 @@ public:
int GetPixmapHeight() const { return m_pixmapHeight; } int GetPixmapHeight() const { return m_pixmapHeight; }
void SetPixmapWidth(int w) { m_pixmapWidth = w; } void SetPixmapWidth(int w) { m_pixmapWidth = w; }
void SetPixmapHeight(int h) { m_pixmapHeight = h; } void SetPixmapHeight(int h) { m_pixmapHeight = h; }
// Change properties // Change properties
virtual void ChangeFont(bool keepOriginalSize = TRUE); // Change to the current font (often overridden) virtual void ChangeFont(bool keepOriginalSize = TRUE); // Change to the current font (often overridden)
// Change background and foreground colour using current background colour // Change background and foreground colour using current background colour
// setting (Motif generates foreground based on background) // setting (Motif generates foreground based on background)
virtual void ChangeBackgroundColour(); virtual void ChangeBackgroundColour();
// Change foreground colour using current foreground colour setting // Change foreground colour using current foreground colour setting
virtual void ChangeForegroundColour(); virtual void ChangeForegroundColour();
protected: protected:
// Adds the widget to the hash table and adds event handlers. // Adds the widget to the hash table and adds event handlers.
bool AttachWidget(wxWindow* parent, WXWidget mainWidget, bool AttachWidget(wxWindow* parent, WXWidget mainWidget,
WXWidget formWidget, int x, int y, int width, int height); WXWidget formWidget, int x, int y, int width, int height);
bool DetachWidget(WXWidget widget); bool DetachWidget(WXWidget widget);
// How to implement accelerators. If we find a key event, translate to // How to implement accelerators. If we find a key event, translate to
// wxWindows wxKeyEvent form. Find a widget for the window. Now find a // wxWindows wxKeyEvent form. Find a widget for the window. Now find a
// wxWindow for the widget. If there isn't one, go up the widget hierarchy // wxWindow for the widget. If there isn't one, go up the widget hierarchy
@@ -240,22 +240,22 @@ public:
protected: protected:
// unmanage and destroy an X widget f it's !NULL (passing NULL is ok) // unmanage and destroy an X widget f it's !NULL (passing NULL is ok)
void UnmanageAndDestroy(WXWidget widget); void UnmanageAndDestroy(WXWidget widget);
// map or unmap an X widget (passing NULL is ok), returns TRUE if widget was // map or unmap an X widget (passing NULL is ok), returns TRUE if widget was
// mapped/unmapped // mapped/unmapped
bool MapOrUnmap(WXWidget widget, bool map); bool MapOrUnmap(WXWidget widget, bool map);
// scrolling stuff // scrolling stuff
// --------------- // ---------------
// create/destroy window scrollbars // create/destroy window scrollbars
void CreateScrollbar(wxOrientation orientation); void CreateScrollbar(wxOrientation orientation);
void DestroyScrollbar(wxOrientation orientation); void DestroyScrollbar(wxOrientation orientation);
// get either hor or vert scrollbar widget // get either hor or vert scrollbar widget
WXWidget GetScrollbar(wxOrientation orient) const WXWidget GetScrollbar(wxOrientation orient) const
{ return orient == wxHORIZONTAL ? m_hScrollBar : m_vScrollBar; } { return orient == wxHORIZONTAL ? m_hScrollBar : m_vScrollBar; }
// set the scroll pos // set the scroll pos
void SetInternalScrollPos(wxOrientation orient, int pos) void SetInternalScrollPos(wxOrientation orient, int pos)
{ {
@@ -264,23 +264,23 @@ protected:
else else
m_scrollPosY = pos; m_scrollPosY = pos;
} }
// Motif-specific flags // Motif-specific flags
// -------------------- // --------------------
bool m_needsRefresh:1; // repaint backing store? bool m_needsRefresh:1; // repaint backing store?
bool m_canAddEventHandler:1; // ??? bool m_canAddEventHandler:1; // ???
bool m_button1Pressed:1; bool m_button1Pressed:1;
bool m_button2Pressed:1; bool m_button2Pressed:1;
bool m_button3Pressed:1; bool m_button3Pressed:1;
// For double-click detection // For double-click detection
long m_lastTS; // last timestamp long m_lastTS; // last timestamp
int m_lastButton; // last pressed button int m_lastButton; // last pressed button
// List of wxRects representing damaged region // List of wxRects representing damaged region
wxRectList m_updateRects; wxRectList m_updateRects;
protected: protected:
WXWidget m_mainWidget; WXWidget m_mainWidget;
WXWidget m_hScrollBar; WXWidget m_hScrollBar;
@@ -296,12 +296,12 @@ protected:
int m_pixmapHeight; int m_pixmapHeight;
int m_pixmapOffsetX; int m_pixmapOffsetX;
int m_pixmapOffsetY; int m_pixmapOffsetY;
// Store the last scroll pos, since in wxWin the pos isn't set automatically // Store the last scroll pos, since in wxWin the pos isn't set automatically
// by system // by system
int m_scrollPosX; int m_scrollPosX;
int m_scrollPosY; int m_scrollPosY;
// implement the base class pure virtuals // implement the base class pure virtuals
virtual void DoClientToScreen( int *x, int *y ) const; virtual void DoClientToScreen( int *x, int *y ) const;
virtual void DoScreenToClient( int *x, int *y ) const; virtual void DoScreenToClient( int *x, int *y ) const;
@@ -309,23 +309,23 @@ protected:
virtual void DoGetSize( int *width, int *height ) const; virtual void DoGetSize( int *width, int *height ) const;
virtual void DoGetClientSize( int *width, int *height ) const; virtual void DoGetClientSize( int *width, int *height ) const;
virtual void DoSetSize(int x, int y, virtual void DoSetSize(int x, int y,
int width, int height, int width, int height,
int sizeFlags = wxSIZE_AUTO); int sizeFlags = wxSIZE_AUTO);
virtual void DoSetClientSize(int width, int height); virtual void DoSetClientSize(int width, int height);
virtual void DoMoveWindow(int x, int y, int width, int height); virtual void DoMoveWindow(int x, int y, int width, int height);
virtual bool DoPopupMenu(wxMenu *menu, int x, int y); virtual bool DoPopupMenu(wxMenu *menu, int x, int y);
virtual void DoCaptureMouse(); virtual void DoCaptureMouse();
virtual void DoReleaseMouse(); virtual void DoReleaseMouse();
#if wxUSE_TOOLTIPS #if wxUSE_TOOLTIPS
virtual void DoSetToolTip( wxToolTip *tip ); virtual void DoSetToolTip( wxToolTip *tip );
#endif // wxUSE_TOOLTIPS #endif // wxUSE_TOOLTIPS
private: private:
// common part of all ctors // common part of all ctors
void Init(); void Init();
DECLARE_DYNAMIC_CLASS(wxWindow) DECLARE_DYNAMIC_CLASS(wxWindow)
DECLARE_NO_COPY_CLASS(wxWindow) DECLARE_NO_COPY_CLASS(wxWindow)
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
@@ -345,14 +345,14 @@ private:
class WXDLLEXPORT wxNoOptimize class WXDLLEXPORT wxNoOptimize
{ {
public: public:
wxNoOptimize() { ms_count++; } wxNoOptimize() { ms_count++; }
~wxNoOptimize() { ms_count--; } ~wxNoOptimize() { ms_count--; }
static bool CanOptimize() { return ms_count == 0; } static bool CanOptimize() { return ms_count == 0; }
protected: protected:
static int ms_count; static int ms_count;
}; };
#endif #endif
// _WX_WINDOW_H_ // _WX_WINDOW_H_

View File

@@ -12,6 +12,8 @@
#include "wx/motif/palette.h" #include "wx/motif/palette.h"
#elif defined(__WXGTK__) #elif defined(__WXGTK__)
#include "wx/generic/paletteg.h" #include "wx/generic/paletteg.h"
#elif defined(__WXX11__)
#include "wx/x11/palette.h"
#elif defined(__WXMGL__) #elif defined(__WXMGL__)
#include "wx/mgl/palette.h" #include "wx/mgl/palette.h"
#elif defined(__WXMAC__) #elif defined(__WXMAC__)

View File

@@ -7,6 +7,8 @@
#include "wx/motif/pen.h" #include "wx/motif/pen.h"
#elif defined(__WXGTK__) #elif defined(__WXGTK__)
#include "wx/gtk/pen.h" #include "wx/gtk/pen.h"
#elif defined(__WXX11__)
#include "wx/x11/pen.h"
#elif defined(__WXMGL__) #elif defined(__WXMGL__)
#include "wx/mgl/pen.h" #include "wx/mgl/pen.h"
#elif defined(__WXMAC__) #elif defined(__WXMAC__)

View File

@@ -55,6 +55,8 @@ public:
#include "wx/os2/popupwin.h" #include "wx/os2/popupwin.h"
#elif __WXGTK__ #elif __WXGTK__
#include "wx/gtk/popupwin.h" #include "wx/gtk/popupwin.h"
#ifdef __WXX11__
#include "wx/x11/popupwin.h"
#elif __WXMGL__ #elif __WXMGL__
#include "wx/mgl/popupwin.h" #include "wx/mgl/popupwin.h"
#else #else

View File

@@ -7,6 +7,8 @@
#include "wx/generic/prntdlgg.h" #include "wx/generic/prntdlgg.h"
#elif defined(__WXGTK__) #elif defined(__WXGTK__)
#include "wx/generic/prntdlgg.h" #include "wx/generic/prntdlgg.h"
#elif defined(__WXX11__)
#include "wx/generic/prntdlgg.h"
#elif defined(__WXMAC__) #elif defined(__WXMAC__)
#include "wx/mac/printdlg.h" #include "wx/mac/printdlg.h"
#elif defined(__WXPM__) #elif defined(__WXPM__)

View File

@@ -7,6 +7,8 @@
#include "wx/motif/region.h" #include "wx/motif/region.h"
#elif defined(__WXGTK__) #elif defined(__WXGTK__)
#include "wx/gtk/region.h" #include "wx/gtk/region.h"
#elif defined(__WXX11__)
#include "wx/x11/region.h"
#elif defined(__WXMGL__) #elif defined(__WXMGL__)
#include "wx/mgl/region.h" #include "wx/mgl/region.h"
#elif defined(__WXMAC__) #elif defined(__WXMAC__)

View File

@@ -107,6 +107,8 @@ protected:
#include "wx/motif/timer.h" #include "wx/motif/timer.h"
#elif defined(__WXGTK__) #elif defined(__WXGTK__)
#include "wx/gtk/timer.h" #include "wx/gtk/timer.h"
#elif defined(__WXX11__)
#include "wx/x11/timer.h"
#elif defined(__WXMGL__) #elif defined(__WXMGL__)
#include "wx/mgl/timer.h" #include "wx/mgl/timer.h"
#elif defined(__WXMAC__) #elif defined(__WXMAC__)

View File

@@ -43,6 +43,8 @@
#include "wx/motif/toolbar.h" #include "wx/motif/toolbar.h"
#elif defined(__WXGTK__) #elif defined(__WXGTK__)
#include "wx/gtk/tbargtk.h" #include "wx/gtk/tbargtk.h"
#elif defined(__WXX11__)
#include "wx/x11/toolbar.h"
#elif defined(__WXMAC__) #elif defined(__WXMAC__)
#include "wx/mac/toolbar.h" #include "wx/mac/toolbar.h"
#elif defined(__WXPM__) #elif defined(__WXPM__)

View File

@@ -158,6 +158,9 @@ protected:
#elif defined(__WXGTK__) #elif defined(__WXGTK__)
#include "wx/gtk/toplevel.h" #include "wx/gtk/toplevel.h"
#define wxTopLevelWindowNative wxTopLevelWindowGTK #define wxTopLevelWindowNative wxTopLevelWindowGTK
#elif defined(__WXX11__)
#include "wx/x11/toplevel.h"
#define wxTopLevelWindowNative wxTopLevelWindowX11
#elif defined(__WXMGL__) #elif defined(__WXMGL__)
#include "wx/mgl/toplevel.h" #include "wx/mgl/toplevel.h"
#define wxTopLevelWindowNative wxTopLevelWindowMGL #define wxTopLevelWindowNative wxTopLevelWindowMGL

View File

@@ -977,6 +977,14 @@ private:
#define sm_classwxWindowGTK sm_classwxWindow #define sm_classwxWindowGTK sm_classwxWindow
#endif // wxUniv #endif // wxUniv
#include "wx/gtk/window.h" #include "wx/gtk/window.h"
#elif defined(__WXX11__)
#ifdef __WXUNIVERSAL__
#define wxWindowNative wxWindowX11
#else // !wxUniv
#define wxWindowX11 wxWindow
#define sm_classwxWindowX11 sm_classwxWindow
#endif // wxUniv
#include "wx/x11/window.h"
#elif defined(__WXMGL__) #elif defined(__WXMGL__)
#ifdef __WXUNIVERSAL__ #ifdef __WXUNIVERSAL__
#define wxWindowNative wxWindowMGL #define wxWindowNative wxWindowMGL

51
include/wx/x11/accel.h Normal file
View File

@@ -0,0 +1,51 @@
/////////////////////////////////////////////////////////////////////////////
// Name: accel.h
// Purpose: wxAcceleratorTable class
// Author: Julian Smart
// Modified by:
// Created: 17/09/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_ACCEL_H_
#define _WX_ACCEL_H_
#ifdef __GNUG__
#pragma interface "accel.h"
#endif
#include "wx/object.h"
#include "wx/string.h"
#include "wx/event.h"
class WXDLLEXPORT wxAcceleratorTable: public wxObject
{
DECLARE_DYNAMIC_CLASS(wxAcceleratorTable)
public:
wxAcceleratorTable();
wxAcceleratorTable(const wxString& resource); // Load from .rc resource
wxAcceleratorTable(int n, wxAcceleratorEntry entries[]); // Load from array
// Copy constructors
wxAcceleratorTable(const wxAcceleratorTable& accel) { Ref(accel); }
wxAcceleratorTable(const wxAcceleratorTable* accel) { if (accel) Ref(*accel); }
~wxAcceleratorTable();
wxAcceleratorTable& operator = (const wxAcceleratorTable& accel) { if (*this == accel) return (*this); Ref(accel); return *this; }
bool operator == (const wxAcceleratorTable& accel) { return m_refData == accel.m_refData; }
bool operator != (const wxAcceleratorTable& accel) { return m_refData != accel.m_refData; }
bool Ok() const;
// Implementation only
int GetCount() const;
wxAcceleratorEntry* GetEntries() const;
};
WXDLLEXPORT_DATA(extern wxAcceleratorTable) wxNullAcceleratorTable;
#endif
// _WX_ACCEL_H_

131
include/wx/x11/app.h Normal file
View File

@@ -0,0 +1,131 @@
/////////////////////////////////////////////////////////////////////////////
// Name: app.h
// Purpose: wxApp class
// Author: Julian Smart
// Modified by:
// Created: 17/09/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_APP_H_
#define _WX_APP_H_
#ifdef __GNUG__
#pragma interface "app.h"
#endif
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#include "wx/gdicmn.h"
#include "wx/event.h"
// ----------------------------------------------------------------------------
// forward declarations
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxFrame;
class WXDLLEXPORT wxWindow;
class WXDLLEXPORT wxApp;
class WXDLLEXPORT wxKeyEvent;
class WXDLLEXPORT wxLog;
// ----------------------------------------------------------------------------
// the wxApp class for Motif - see wxAppBase for more details
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxApp : public wxAppBase
{
DECLARE_DYNAMIC_CLASS(wxApp)
public:
wxApp();
~wxApp() {}
// override base class (pure) virtuals
// -----------------------------------
virtual int MainLoop();
virtual void ExitMainLoop();
virtual bool Initialized();
virtual bool Pending();
virtual void Dispatch();
virtual bool Yield(bool onlyIfNeeded = FALSE);
virtual bool OnInitGui();
virtual wxIcon GetStdIcon(int which) const;
// implementation from now on
// --------------------------
void OnIdle(wxIdleEvent& event);
// 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);
// Motif implementation.
// Processes an X event.
virtual void ProcessXEvent(WXEvent* event);
// Returns TRUE if an accelerator has been processed
virtual bool CheckForAccelerator(WXEvent* event);
// Returns TRUE if a key down event has been processed
virtual bool CheckForKeyDown(WXEvent* event);
// Returns TRUE if a key up event has been processed
virtual bool CheckForKeyUp(WXEvent* event);
protected:
bool m_showOnInit;
public:
// Implementation
static bool Initialize();
static void CleanUp();
void DeletePendingObjects();
bool ProcessIdle();
// Motif-specific
WXAppContext GetAppContext() const { return m_appContext; }
WXWidget GetTopLevelWidget() const { return m_topLevelWidget; }
WXColormap GetMainColormap(WXDisplay* display);
WXDisplay* GetInitialDisplay() const { return m_initialDisplay; }
long GetMaxRequestSize() const { return m_maxRequestSize; }
// This handler is called when a property change event occurs
virtual void HandlePropertyChange(WXEvent *event);
public:
static long sm_lastMessageTime;
int m_nCmdShow;
protected:
bool m_keepGoing;
// Motif-specific
WXAppContext m_appContext;
WXWidget m_topLevelWidget;
WXColormap m_mainColormap;
WXDisplay* m_initialDisplay;
long m_maxRequestSize;
DECLARE_EVENT_TABLE()
};
int WXDLLEXPORT wxEntry( int argc, char *argv[] );
#endif
// _WX_APP_H_

230
include/wx/x11/bitmap.h Normal file
View File

@@ -0,0 +1,230 @@
/////////////////////////////////////////////////////////////////////////////
// Name: bitmap.h
// Purpose: wxBitmap class
// Author: Julian Smart
// Modified by:
// Created: 17/09/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_BITMAP_H_
#define _WX_BITMAP_H_
#ifdef __GNUG__
#pragma interface "bitmap.h"
#endif
#include "wx/gdiobj.h"
#include "wx/gdicmn.h"
#include "wx/palette.h"
// Bitmap
class WXDLLEXPORT wxDC;
class WXDLLEXPORT wxControl;
class WXDLLEXPORT wxBitmap;
class WXDLLEXPORT wxBitmapHandler;
class WXDLLEXPORT wxIcon;
class WXDLLEXPORT wxCursor;
class WXDLLEXPORT wxImage;
// A mask is a mono bitmap used for drawing bitmaps
// transparently.
class WXDLLEXPORT wxMask: public wxObject
{
DECLARE_DYNAMIC_CLASS(wxMask)
public:
wxMask();
// Construct a mask from a bitmap and a colour indicating
// the transparent area
wxMask(const wxBitmap& bitmap, const wxColour& colour);
// Construct a mask from a bitmap and a palette index indicating
// the transparent area
wxMask(const wxBitmap& bitmap, int paletteIndex);
// Construct a mask from a mono bitmap (copies the bitmap).
wxMask(const wxBitmap& bitmap);
~wxMask();
bool Create(const wxBitmap& bitmap, const wxColour& colour);
bool Create(const wxBitmap& bitmap, int paletteIndex);
bool Create(const wxBitmap& bitmap);
WXPixmap GetPixmap() const { return m_pixmap; }
void SetPixmap(WXPixmap pixmap) { m_pixmap = pixmap; }
protected:
WXPixmap m_pixmap;
};
class WXDLLEXPORT wxBitmapRefData: public wxGDIRefData
{
friend class WXDLLEXPORT wxBitmap;
friend class WXDLLEXPORT wxIcon;
friend class WXDLLEXPORT wxCursor;
public:
wxBitmapRefData();
~wxBitmapRefData();
public:
int m_width;
int m_height;
int m_depth;
bool m_ok;
int m_numColors;
wxPalette m_bitmapPalette;
int m_quality;
wxMask * m_bitmapMask; // Optional mask
// Motif implementation
public:
WXPixmap m_pixmap;
WXDisplay* m_display;
bool m_freePixmap;
unsigned long* m_freeColors;
long m_freeColorsCount;
// These 5 variables are for wxControl
WXPixmap m_insensPixmap ;
WXPixmap m_labelPixmap ;
WXPixmap m_armPixmap ;
WXImage* m_image ;
WXImage* m_insensImage ;
};
#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);
void SetName(const wxString& name) { m_name = name; }
void SetExtension(const wxString& ext) { m_extension = ext; }
void SetType(long type) { m_type = type; }
wxString GetName() const { return m_name; }
wxString GetExtension() const { return m_extension; }
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)
friend class WXDLLEXPORT wxBitmapHandler;
public:
wxBitmap(); // Platform-specific
// Copy constructors
wxBitmap(const wxBitmap& bitmap)
{ Ref(bitmap); }
// Initialize with raw XBM data
wxBitmap(const char bits[], int width, int height, int depth = 1);
// from XPM
wxBitmap(const char **data) { (void)CreateFromXpm(data); }
wxBitmap(char **data) { (void)CreateFromXpm((const char **)data); }
// Initialize with XPM data -- deprecated
wxBitmap(char **data, wxControl* control);
// Load a file or resource
wxBitmap(const wxString& name, long type = wxBITMAP_TYPE_XPM);
// Constructor for generalised creation from data
wxBitmap(void *data, long type, int width, int height, int depth = 1);
// If depth is omitted, will create a bitmap compatible with the display
wxBitmap(int width, int height, int depth = -1);
// Convert from wxImage:
wxBitmap(const wxImage& image, int depth = -1) { (void)CreateFromImage(image, depth); }
~wxBitmap();
virtual bool Create(int width, int height, int depth = -1);
virtual bool Create(void *data, long type, int width, int height, int depth = 1);
wxBitmap GetSubBitmap( const wxRect& rect ) const;
virtual bool LoadFile(const wxString& name, long type = wxBITMAP_TYPE_XPM);
virtual bool SaveFile(const wxString& name, int type, const wxPalette *cmap = NULL);
wxImage ConvertToImage() const;
bool Ok() const { return (M_BITMAPDATA && M_BITMAPDATA->m_ok); }
int GetWidth() const { return (M_BITMAPDATA ? M_BITMAPDATA->m_width : 0); }
int GetHeight() const { return (M_BITMAPDATA ? M_BITMAPDATA->m_height : 0); }
int GetDepth() const { return (M_BITMAPDATA ? M_BITMAPDATA->m_depth : 0); }
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);
wxPalette* GetPalette() const { return (M_BITMAPDATA ? (& M_BITMAPDATA->m_bitmapPalette) : (wxPalette*) NULL); }
void SetPalette(const wxPalette& palette);
wxMask *GetMask() const { return (M_BITMAPDATA ? M_BITMAPDATA->m_bitmapMask : (wxMask*) NULL); }
void SetMask(wxMask *mask) ;
wxBitmap& operator = (const wxBitmap& bitmap) { if (*this == bitmap) return (*this); Ref(bitmap); return *this; }
bool operator == (const wxBitmap& bitmap) const { return m_refData == bitmap.m_refData; }
bool operator != (const wxBitmap& bitmap) const { return m_refData != bitmap.m_refData; }
// Format handling
static 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();
// Motif implementation
public:
WXDisplay* GetDisplay() const { return M_BITMAPDATA->m_display; }
WXPixmap GetPixmap() const { return (WXPixmap) M_BITMAPDATA->m_pixmap; }
virtual WXPixmap GetLabelPixmap(WXWidget w) ;
virtual WXPixmap GetArmPixmap(WXWidget w) ;
virtual WXPixmap GetInsensPixmap(WXWidget w = (WXWidget) 0) ;
void SetPixmapNull() { M_BITMAPDATA->m_pixmap = 0; }
protected:
static wxList sm_handlers;
protected:
bool CreateFromXpm(const char **bits);
bool CreateFromImage(const wxImage& image, int depth);
};
// Creates a bitmap with transparent areas drawn in
// the given colour.
wxBitmap wxCreateMaskedBitmap(const wxBitmap& bitmap, wxColour& colour);
#endif
// _WX_BITMAP_H_

Some files were not shown because too many files have changed in this diff Show More