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,58 +20,9 @@
#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
@@ -89,7 +40,7 @@ public:
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,7 +39,7 @@ 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();
@@ -127,5 +127,5 @@ protected:
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
@@ -72,150 +72,150 @@ public:
~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: public:
wxBitmap(); // Platform-specific wxBitmap(); // Platform-specific
// Copy constructors // Copy constructors
wxBitmap(const wxBitmap& bitmap) wxBitmap(const wxBitmap& bitmap)
{ Ref(bitmap); } { Ref(bitmap); }
// Initialize with raw XBM data // Initialize with raw XBM data
wxBitmap(const char bits[], int width, int height, int depth = 1); wxBitmap(const char bits[], int width, int height, int depth = 1);
// from XPM // from XPM
wxBitmap(const char **data) { (void)CreateFromXpm(data); } wxBitmap(const char **data) { (void)CreateFromXpm(data); }
wxBitmap(char **data) { (void)CreateFromXpm((const char **)data); } wxBitmap(char **data) { (void)CreateFromXpm((const char **)data); }
// Initialize with XPM data -- deprecated // Initialize with XPM data -- deprecated
wxBitmap(char **data, wxControl* control); wxBitmap(char **data, wxControl* control);
// Load a file or resource // Load a file or resource
wxBitmap(const wxString& name, long type = wxBITMAP_TYPE_XPM); wxBitmap(const wxString& name, long type = wxBITMAP_TYPE_XPM);
// Constructor for generalised creation from data // Constructor for generalised creation from data
wxBitmap(void *data, long type, int width, int height, int depth = 1); wxBitmap(void *data, long type, int width, int height, int depth = 1);
// If depth is omitted, will create a bitmap compatible with the display // If depth is omitted, will create a bitmap compatible with the display
wxBitmap(int width, int height, int depth = -1); wxBitmap(int width, int height, int depth = -1);
// Convert from wxImage: // Convert from wxImage:
wxBitmap(const wxImage& image, int depth = -1) { (void)CreateFromImage(image, depth); } wxBitmap(const wxImage& image, int depth = -1) { (void)CreateFromImage(image, depth); }
~wxBitmap(); ~wxBitmap();
virtual bool Create(int width, int height, int depth = -1); virtual bool Create(int width, int height, int depth = -1);
virtual bool Create(void *data, long type, 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; wxBitmap GetSubBitmap( const wxRect& rect ) const;
virtual bool LoadFile(const wxString& name, long type = wxBITMAP_TYPE_XPM); virtual bool LoadFile(const wxString& name, long type = wxBITMAP_TYPE_XPM);
virtual bool SaveFile(const wxString& name, int type, const wxPalette *cmap = NULL); virtual bool SaveFile(const wxString& name, int type, const wxPalette *cmap = NULL);
wxImage ConvertToImage() const; wxImage ConvertToImage() const;
bool Ok() const { return (M_BITMAPDATA && M_BITMAPDATA->m_ok); } bool Ok() const { return (M_BITMAPDATA && M_BITMAPDATA->m_ok); }
int GetWidth() const { return (M_BITMAPDATA ? M_BITMAPDATA->m_width : 0); } int GetWidth() const { return (M_BITMAPDATA ? M_BITMAPDATA->m_width : 0); }
int GetHeight() const { return (M_BITMAPDATA ? M_BITMAPDATA->m_height : 0); } int GetHeight() const { return (M_BITMAPDATA ? M_BITMAPDATA->m_height : 0); }
int GetDepth() const { return (M_BITMAPDATA ? M_BITMAPDATA->m_depth : 0); } int GetDepth() const { return (M_BITMAPDATA ? M_BITMAPDATA->m_depth : 0); }
int GetQuality() const { return (M_BITMAPDATA ? M_BITMAPDATA->m_quality : 0); } int GetQuality() const { return (M_BITMAPDATA ? M_BITMAPDATA->m_quality : 0); }
void SetWidth(int w); void SetWidth(int w);
void SetHeight(int h); void SetHeight(int h);
void SetDepth(int d); void SetDepth(int d);
void SetQuality(int q); void SetQuality(int q);
void SetOk(bool isOk); void SetOk(bool isOk);
wxPalette* GetPalette() const { return (M_BITMAPDATA ? (& M_BITMAPDATA->m_bitmapPalette) : (wxPalette*) NULL); } wxPalette* GetPalette() const { return (M_BITMAPDATA ? (& M_BITMAPDATA->m_bitmapPalette) : (wxPalette*) NULL); }
void SetPalette(const wxPalette& palette); void SetPalette(const wxPalette& palette);
wxMask *GetMask() const { return (M_BITMAPDATA ? M_BITMAPDATA->m_bitmapMask : (wxMask*) NULL); } wxMask *GetMask() const { return (M_BITMAPDATA ? M_BITMAPDATA->m_bitmapMask : (wxMask*) NULL); }
void SetMask(wxMask *mask) ; void SetMask(wxMask *mask) ;
wxBitmap& operator = (const wxBitmap& bitmap) { if (*this == bitmap) return (*this); Ref(bitmap); return *this; } 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; }
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 // Format handling
static wxList& GetHandlers() { return sm_handlers; } static wxList& GetHandlers() { return sm_handlers; }
static void AddHandler(wxBitmapHandler *handler); static void AddHandler(wxBitmapHandler *handler);
static void InsertHandler(wxBitmapHandler *handler); static void InsertHandler(wxBitmapHandler *handler);
static bool RemoveHandler(const wxString& name); static bool RemoveHandler(const wxString& name);
static wxBitmapHandler *FindHandler(const wxString& name); static wxBitmapHandler *FindHandler(const wxString& name);
static wxBitmapHandler *FindHandler(const wxString& extension, long bitmapType); static wxBitmapHandler *FindHandler(const wxString& extension, long bitmapType);
static wxBitmapHandler *FindHandler(long bitmapType); static wxBitmapHandler *FindHandler(long bitmapType);
static void InitStandardHandlers(); static void InitStandardHandlers();
static void CleanUpHandlers(); static void CleanUpHandlers();
// Motif implementation // Motif implementation
public: public:
WXDisplay* GetDisplay() const { return M_BITMAPDATA->m_display; } WXDisplay* GetDisplay() const { return M_BITMAPDATA->m_display; }
WXPixmap GetPixmap() const { return (WXPixmap) M_BITMAPDATA->m_pixmap; } WXPixmap GetPixmap() const { return (WXPixmap) M_BITMAPDATA->m_pixmap; }
virtual WXPixmap GetLabelPixmap(WXWidget w) ; virtual WXPixmap GetLabelPixmap(WXWidget w) ;
virtual WXPixmap GetArmPixmap(WXWidget w) ; virtual WXPixmap GetArmPixmap(WXWidget w) ;
virtual WXPixmap GetInsensPixmap(WXWidget w = (WXWidget) 0) ; virtual WXPixmap GetInsensPixmap(WXWidget w = (WXWidget) 0) ;
void SetPixmapNull() { M_BITMAPDATA->m_pixmap = 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);
@@ -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

@@ -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"
@@ -29,21 +29,21 @@ class WXDLLEXPORT wxButton: public wxControl
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);
@@ -57,4 +57,4 @@ public:
}; };
#endif #endif
// _WX_BUTTON_H_ // _WX_BUTTON_H_

View File

@@ -24,32 +24,32 @@ 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
@@ -62,19 +62,19 @@ public:
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;
@@ -84,8 +84,8 @@ public:
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,26 +14,26 @@
#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;
@@ -44,4 +44,4 @@ private:
}; };
#endif #endif
// _WX_CHECKLST_H_ // _WX_CHECKLST_H_

View File

@@ -30,23 +30,23 @@ public:
~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 :-(
@@ -98,11 +98,10 @@ protected:
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
@@ -66,7 +66,7 @@ public:
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
@@ -81,4 +81,4 @@ private:
#endif // wxUSE_CLIPBOARD #endif // wxUSE_CLIPBOARD
#endif #endif
// _WX_CLIPBRD_H_ // _WX_CLIPBRD_H_

View File

@@ -22,12 +22,12 @@
#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);
@@ -43,4 +43,4 @@ protected:
}; };
#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

@@ -31,25 +31,25 @@ public:
~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);
@@ -89,9 +89,9 @@ public:
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

@@ -30,21 +30,21 @@ class WXDLLEXPORT wxControl: public wxControlBase
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)) { }
@@ -70,10 +70,10 @@ protected:
#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
@@ -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

@@ -25,17 +25,17 @@ public:
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

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
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@@ -66,10 +66,10 @@ public:
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;
@@ -165,4 +165,4 @@ public:
}; };
#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"
@@ -64,10 +64,10 @@ public:
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;
@@ -91,7 +91,7 @@ public:
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;
@@ -99,15 +99,15 @@ protected:
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);
@@ -116,18 +116,18 @@ protected:
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;
@@ -174,4 +174,4 @@ public:
}; };
#endif #endif
// _WX_DCCLIENT_H_ // _WX_DCCLIENT_H_

View File

@@ -13,14 +13,14 @@
#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();
@@ -40,4 +40,4 @@ private:
}; };
#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,17 +21,17 @@ 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);
@@ -39,21 +39,21 @@ public:
// 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();
@@ -74,7 +74,7 @@ public:
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);
@@ -110,8 +110,8 @@ public:
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);
@@ -120,4 +120,4 @@ private:
}; };
#endif #endif
// _WX_DIALOG_H_ // _WX_DIALOG_H_

View File

@@ -22,7 +22,7 @@ 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 = "",
@@ -46,4 +46,4 @@ protected:
}; };
#endif #endif
// _WX_DIRDLG_H_ // _WX_DIRDLG_H_

View File

@@ -43,7 +43,7 @@ class WXDLLEXPORT wxDropSource;
class WXDLLEXPORT wxDropTarget: public wxObject class WXDLLEXPORT wxDropTarget: public wxObject
{ {
public: public:
wxDropTarget(); wxDropTarget();
~wxDropTarget(); ~wxDropTarget();
@@ -57,7 +57,7 @@ class WXDLLEXPORT wxDropTarget: public wxObject
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,13 +66,13 @@ 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;
@@ -86,26 +86,26 @@ class WXDLLEXPORT wxPrivateDropTarget: public wxDropTarget
{ {
public: public:
wxPrivateDropTarget(); wxPrivateDropTarget();
// you have to override OnDrop to get at the data // you have to override OnDrop to get at the data
// the string ID identifies the format of clipboard or DnD data. a word // the string ID identifies the format of clipboard or DnD data. a word
// processor would e.g. add a wxTextDataObject and a wxPrivateDataObject // processor would e.g. add a wxTextDataObject and a wxPrivateDataObject
// to the clipboard - the latter with the Id "WXWORD_FORMAT". // to the clipboard - the latter with the Id "WXWORD_FORMAT".
void SetId( const wxString& id ) void SetId( const wxString& id )
{ m_id = id; } { m_id = id; }
wxString GetId() wxString GetId()
{ return m_id; } { return m_id; }
private: private:
virtual size_t GetFormatCount() const; virtual size_t GetFormatCount() const;
virtual wxDataFormat GetFormat(size_t n) const; virtual wxDataFormat GetFormat(size_t n) const;
wxString m_id; wxString m_id;
}; };
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -114,15 +114,15 @@ 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,16 +134,16 @@ 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 );
@@ -155,7 +155,7 @@ class WXDLLEXPORT wxDropSource: public wxObject
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);
@@ -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;
@@ -62,7 +62,7 @@ public:
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 ; }
@@ -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;
@@ -27,12 +27,12 @@ public:
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();
@@ -42,16 +42,16 @@ public:
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();
@@ -93,13 +93,13 @@ public:
// 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
@@ -114,4 +114,4 @@ private:
}; };
#endif #endif
// _WX_FONT_H_ // _WX_FONT_H_

View File

@@ -21,12 +21,12 @@
#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);
@@ -42,5 +42,5 @@ protected:
}; };
#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,12 +21,12 @@ 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();
@@ -34,12 +34,12 @@ public:
} }
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();
@@ -121,14 +121,14 @@ protected:
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

@@ -29,23 +29,23 @@ 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);
@@ -70,4 +70,4 @@ protected:
}; };
#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,11 +56,11 @@ 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();
@@ -77,11 +77,11 @@ public:
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,27 +90,27 @@ 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,
@@ -118,44 +118,44 @@ public:
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,29 +28,29 @@ 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();
@@ -117,9 +117,9 @@ protected:
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,103 +35,103 @@ 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);
} }
@@ -139,12 +139,12 @@ public:
~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);
@@ -182,9 +182,9 @@ public:
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; }
@@ -193,8 +193,8 @@ 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;
@@ -203,15 +203,15 @@ protected:
}; };
/* 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() ;
@@ -233,8 +233,8 @@ public:
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;
@@ -247,4 +247,4 @@ private:
}; };
#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"
@@ -73,8 +73,8 @@ public:
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.
@@ -135,7 +135,7 @@ public:
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 );

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,21 +29,21 @@ 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; }

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

@@ -22,25 +22,25 @@
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

@@ -32,15 +32,15 @@ class WXDLLEXPORT wxMessageDialog: public wxDialog
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:
@@ -52,4 +52,4 @@ protected:
}; };
#endif #endif
// _WX_MSGBOXDLG_H_ // _WX_MSGBOXDLG_H_

View File

@@ -24,7 +24,7 @@ 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();
@@ -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

@@ -33,14 +33,14 @@ public:
~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,7 +90,7 @@ 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); }
@@ -117,4 +117,4 @@ private:
extern "C" XtAppContext wxGetAppContext(); extern "C" XtAppContext wxGetAppContext();
#endif #endif
// _WX_PRIVATE_H_ // _WX_PRIVATE_H_

View File

@@ -25,16 +25,16 @@ 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);
} }
@@ -42,10 +42,10 @@ public:
~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);
@@ -92,9 +92,9 @@ protected:
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,18 +23,18 @@ 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);
} }
@@ -42,12 +42,12 @@ public:
~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);
@@ -90,12 +90,12 @@ protected:
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,7 +13,7 @@
#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
@@ -24,23 +24,22 @@ 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;
@@ -63,4 +62,4 @@ protected:
}; };
#endif #endif
// _WX_SPINBUTT_H_ // _WX_SPINBUTT_H_

View File

@@ -23,28 +23,28 @@ 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);
@@ -81,4 +81,4 @@ protected:
}; };
#endif #endif
// _WX_STATBMP_H_ // _WX_STATBMP_H_

View File

@@ -23,27 +23,27 @@ 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))
{ {
@@ -66,12 +66,12 @@ protected:
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

@@ -28,21 +28,21 @@ 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
// -------------- // --------------
@@ -59,4 +59,4 @@ public:
}; };
#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,22 +29,22 @@ 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;
@@ -94,10 +94,10 @@ class WXDLLEXPORT wxTabCtrl: public wxControl
// 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();
@@ -116,23 +116,23 @@ class WXDLLEXPORT wxTabCtrl: public wxControl
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();
@@ -41,9 +41,9 @@ public:
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;
@@ -29,23 +29,23 @@ public:
// -------- // --------
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
// --------- // ---------
@@ -129,7 +129,7 @@ public:
// 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;
@@ -148,4 +148,4 @@ private:
}; };
#endif #endif
// _WX_TEXTCTRL_H_ // _WX_TEXTCTRL_H_

View File

@@ -13,17 +13,17 @@
#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);
@@ -41,4 +41,4 @@ private:
}; };
#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
@@ -23,11 +23,11 @@ public:
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();
@@ -35,11 +35,11 @@ public:
} }
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();
@@ -66,12 +66,12 @@ protected:
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:
@@ -79,4 +79,4 @@ private:
}; };
#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,18 +24,18 @@
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);
@@ -44,11 +44,11 @@ public:
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);
@@ -65,7 +65,7 @@ public:
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 );
@@ -77,24 +77,24 @@ public:
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
@@ -134,7 +134,7 @@ public:
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; }
@@ -155,7 +155,7 @@ public:
// 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();
@@ -180,14 +180,14 @@ protected:
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
@@ -219,7 +219,7 @@ public:
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
@@ -254,7 +254,7 @@ protected:
// 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)
@@ -309,8 +309,8 @@ 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);
@@ -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