From: Julian Smart Date: Sun, 9 Aug 1998 16:31:10 +0000 (+0000) Subject: Stub header changes. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/5e25ba908f6a9e03f131e8ce9df19558c3e09a35?ds=sidebyside;hp=93cf77c076b699e8e0b3b0049bd4f80de15997dd Stub header changes. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@488 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/stubs/accel.h b/include/wx/stubs/accel.h index 3b8d3379f9..27ed68439e 100644 --- a/include/wx/stubs/accel.h +++ b/include/wx/stubs/accel.h @@ -68,10 +68,6 @@ public: inline bool operator != (const wxAcceleratorTable& accel) { return m_refData != accel.m_refData; } bool Ok() const; -/* TODO: Accessors for your GUI - void SetHACCEL(WXHACCEL hAccel); - WXHACCEL GetHACCEL() const; -*/ }; WXDLLEXPORT_DATA(extern wxAcceleratorTable) wxNullAcceleratorTable; diff --git a/include/wx/stubs/app.h b/include/wx/stubs/app.h index 2eafa1f15f..cb50ba9c9e 100644 --- a/include/wx/stubs/app.h +++ b/include/wx/stubs/app.h @@ -131,7 +131,6 @@ public: // Implementation static void CommonInit(); - static void CleanUp(); static void CommonCleanUp(); void DeletePendingObjects(); bool ProcessIdle(); @@ -146,8 +145,8 @@ protected: DECLARE_EVENT_TABLE() }; -// TODO: add platform-specific arguments, e.g. int argc, char* argv[] -int WXDLLEXPORT wxEntry(); +// TODO: add platform-specific arguments +int WXDLLEXPORT wxEntry( int argc, char *argv[] ); #endif // _WX_APP_H_ diff --git a/include/wx/stubs/bitmap.h b/include/wx/stubs/bitmap.h index f01c6a2de3..195944f835 100644 --- a/include/wx/stubs/bitmap.h +++ b/include/wx/stubs/bitmap.h @@ -109,6 +109,7 @@ protected: wxString m_extension; long m_type; }; + #define M_BITMAPHANDLERDATA ((wxBitmapRefData *)bitmap->GetRefData()) class WXDLLEXPORT wxBitmap: public wxGDIObject diff --git a/include/wx/stubs/brush.h b/include/wx/stubs/brush.h index cdedb4045e..2475bd0b24 100644 --- a/include/wx/stubs/brush.h +++ b/include/wx/stubs/brush.h @@ -27,6 +27,7 @@ class WXDLLEXPORT wxBrushRefData: public wxGDIRefData friend class WXDLLEXPORT wxBrush; public: wxBrushRefData(); + wxBrushRefData(const wxBrushRefData& data); ~wxBrushRefData(); protected: @@ -57,7 +58,7 @@ public: virtual void SetColour(const wxColour& col) ; virtual void SetColour(const wxString& col) ; - virtual void SetColour(const unsigned char r, const unsigned char g, const unsigned char b) ; + virtual void SetColour(unsigned char r, unsigned char g, unsigned char b) ; virtual void SetStyle(int style) ; virtual void SetStipple(const wxBitmap& stipple) ; @@ -70,6 +71,15 @@ public: inline wxBitmap *GetStipple() const { return (M_BRUSHDATA ? & M_BRUSHDATA->m_stipple : 0); }; virtual bool Ok() const { return (m_refData != NULL) ; } + +// Implementation + + // Useful helper: create the brush resource + void RealizeResource(); + + // When setting properties, we must make sure we're not changing + // another object + void Unshare(); }; #endif diff --git a/include/wx/stubs/checklst.h b/include/wx/stubs/checklst.h index fb623cec0f..b0fc0a2978 100644 --- a/include/wx/stubs/checklst.h +++ b/include/wx/stubs/checklst.h @@ -19,8 +19,6 @@ typedef unsigned int uint; -class wxCheckListBoxItem; // fwd decl, define in checklst.cpp - class wxCheckListBox : public wxListBox { DECLARE_DYNAMIC_CLASS(wxCheckListBox) @@ -43,18 +41,6 @@ public: // accessors uint GetItemHeight() const { return m_nItemHeight; } -protected: - // we create our items ourselves and they have non-standard size, - // so we need to override these functions - virtual wxOwnerDrawn *CreateItem(uint n); - - // pressing space or clicking the check box toggles the item - void OnChar(wxKeyEvent& event); - void OnLeftClick(wxMouseEvent& event); - -private: - uint m_nItemHeight; // height of checklistbox items (the same for all) - DECLARE_EVENT_TABLE() }; diff --git a/include/wx/stubs/clipbrd.h b/include/wx/stubs/clipbrd.h index 3b1c5957b5..697dc9d939 100644 --- a/include/wx/stubs/clipbrd.h +++ b/include/wx/stubs/clipbrd.h @@ -98,7 +98,7 @@ class WXDLLEXPORT wxClipboard : public wxObject void WXDLLEXPORT wxInitClipboard(); /* The clipboard */ -extern wxClipboard* WXDLLEXPORT wxTheClipboard; +WXDLLEXPORT_DATA(extern wxClipboard*) wxTheClipboard; #endif // _WX_CLIPBRD_H_ diff --git a/include/wx/stubs/colordlg.h b/include/wx/stubs/colordlg.h index 7e2e8f60f4..556c2f316e 100644 --- a/include/wx/stubs/colordlg.h +++ b/include/wx/stubs/colordlg.h @@ -1,6 +1,7 @@ ///////////////////////////////////////////////////////////////////////////// // Name: colordlg.h -// Purpose: wxColourDialog class +// Purpose: wxColourDialog class. Use generic version if no +// platform-specific implementation. // Author: AUTHOR // Modified by: // Created: ??/??/98 diff --git a/include/wx/stubs/colour.h b/include/wx/stubs/colour.h index 19c7cd9ee0..e8fca8e3b4 100644 --- a/include/wx/stubs/colour.h +++ b/include/wx/stubs/colour.h @@ -22,7 +22,7 @@ class WXDLLEXPORT wxColour: public wxObject DECLARE_DYNAMIC_CLASS(wxColour) public: wxColour(); - wxColour(const unsigned char r, const unsigned char g, const unsigned char b); + wxColour(unsigned char r, unsigned char g, unsigned char b); wxColour(unsigned long colRGB) { Set(colRGB); } wxColour(const wxColour& col); wxColour(const wxString& col); diff --git a/include/wx/stubs/cursor.h b/include/wx/stubs/cursor.h index 5484414e7b..9cf490cdc6 100644 --- a/include/wx/stubs/cursor.h +++ b/include/wx/stubs/cursor.h @@ -69,5 +69,7 @@ public: */ }; +extern WXDLLEXPORT void wxSetCursor(const wxCursor& cursor); + #endif // _WX_CURSOR_H_ diff --git a/include/wx/stubs/dc.h b/include/wx/stubs/dc.h index 65743ae368..eb10154ab9 100644 --- a/include/wx/stubs/dc.h +++ b/include/wx/stubs/dc.h @@ -22,272 +22,353 @@ #include "wx/font.h" #include "wx/gdicmn.h" +//----------------------------------------------------------------------------- +// constants +//----------------------------------------------------------------------------- + +#define MM_TEXT 0 +#define MM_ISOTROPIC 1 +#define MM_ANISOTROPIC 2 +#define MM_LOMETRIC 3 +#define MM_HIMETRIC 4 +#define MM_TWIPS 5 +#define MM_POINTS 6 +#define MM_METRIC 7 + +//----------------------------------------------------------------------------- +// global variables +//----------------------------------------------------------------------------- + +extern int wxPageNumber; + +//----------------------------------------------------------------------------- +// wxDC +//----------------------------------------------------------------------------- + class WXDLLEXPORT wxDC: public wxObject { -DECLARE_ABSTRACT_CLASS(wxDC) -public: - wxDC(); - ~wxDC(); - - // Compatibility (obsolete) - inline void wxDC::BeginDrawing() {} - inline void wxDC::EndDrawing() {} - - virtual void FloodFill(long x1, long y1, const wxColour& col, int style=wxFLOOD_SURFACE) ; - inline void FloodFill(const wxPoint& pt, const wxColour& col, int style=wxFLOOD_SURFACE) - { - FloodFill(pt.x, pt.y, col, style); - } - - virtual bool GetPixel(long x1, long y1, wxColour *col) const ; - inline bool GetPixel(const wxPoint& pt, wxColour *col) const - { - return GetPixel(pt.x, pt.y, col); - } - - virtual void DrawLine(long x1, long y1, long x2, long y2); - inline void DrawLine(const wxPoint& pt1, const wxPoint& pt2) - { - DrawLine(pt1.x, pt1.y, pt2.x, pt2.y); - } - - virtual void CrossHair(long x, long y) ; - virtual void CrossHair(const wxPoint& pt) - { - CrossHair(pt.x, pt.y); - } - - virtual void DrawArc(long x1,long y1,long x2,long y2,double xc, double yc); - inline void DrawArc(const wxPoint& pt1, const wxPoint& pt2, double xc, double yc) - { - DrawArc(pt1.x, pt1.y, pt2.x, pt2.y, xc, yc); - } - - virtual void DrawEllipticArc (long x, long y, long w, long h, double sa, double ea); - virtual void DrawEllipticArc (const wxPoint& pt, const wxSize& sz, double sa, double ea) - { - DrawEllipticArc(pt.x, pt.y, sz.x, sz.y, sa, ea); - } - - virtual void DrawPoint(long x, long y); - inline void DrawPoint(const wxPoint& pt) - { - DrawPoint(pt.x, pt.y); - } - - virtual void DrawLines(int n, wxPoint points[], long xoffset = 0, long yoffset = 0); - - virtual void DrawPolygon(int n, wxPoint points[], long xoffset = 0, long yoffset = 0, int fillStyle=wxODDEVEN_RULE); - - virtual void DrawRectangle(long x, long y, long width, long height); - inline void DrawRectangle(const wxPoint& pt, const wxSize& sz) - { - DrawRectangle(pt.x, pt.y, sz.x, sz.y); - } - inline void DrawRectangle(const wxRect& rect) - { - DrawRectangle(rect.x, rect.y, rect.width, rect.height); - } - - virtual void DrawRoundedRectangle(long x, long y, long width, long height, double radius = 20.0); - inline void DrawRoundedRectangle(const wxPoint& pt, const wxSize& sz, double radius = 20.0) - { - DrawRoundedRectangle(pt.x, pt.y, sz.x, sz.y, radius); - } - inline void DrawRoundedRectangle(const wxRect& rect, double radius = 20.0) - { - DrawRoundedRectangle(rect.x, rect.y, rect.width, rect.height, radius); - } - - virtual void DrawEllipse(long x, long y, long width, long height); - inline void DrawEllipse(const wxPoint& pt, const wxSize& sz) - { - DrawEllipse(pt.x, pt.y, sz.x, sz.y); - } - inline void DrawEllipse(const wxRect& rect) - { - DrawEllipse(rect.x, rect.y, rect.width, rect.height); - } - - virtual void DrawIcon(const wxIcon& icon, long x, long y); - inline void DrawIcon(const wxIcon& icon, const wxPoint& pt) - { - DrawIcon(icon, pt.x, pt.y); - } - - inline void DrawPoint(wxPoint& point) { DrawPoint(point.x, point.y); } - virtual void DrawLines(wxList *list, long xoffset = 0, long yoffset = 0); - virtual void DrawPolygon(wxList *list, long xoffset = 0, long yoffset = 0, int fillStyle=wxODDEVEN_RULE); - - virtual void DrawText(const wxString& text, long x, long y, bool use16bit = FALSE); - inline void DrawText(const wxString& text, const wxPoint& pt, bool use16bit = FALSE) - { - DrawText(text, pt.x, pt.y, use16bit); - } - - virtual bool Blit(long xdest, long ydest, long width, long height, - wxDC *source, long xsrc, long ysrc, int rop = wxCOPY, bool useMask = FALSE); - inline bool Blit(const wxPoint& destPt, const wxSize& sz, + DECLARE_ABSTRACT_CLASS(wxDC) + + public: + + wxDC(void); + ~wxDC(void); + + void BeginDrawing(void) {}; + void EndDrawing(void) {}; + + virtual bool Ok(void) const { return m_ok; }; + + virtual void FloodFill( long x1, long y1, wxColour *col, int style=wxFLOOD_SURFACE ) = 0; + inline void FloodFill(const wxPoint& pt, const wxColour& col, int style=wxFLOOD_SURFACE) + { + FloodFill(pt.x, pt.y, col, style); + } + virtual bool GetPixel( long x1, long y1, wxColour *col ) const = 0; + inline bool GetPixel(const wxPoint& pt, wxColour *col) const + { + return GetPixel(pt.x, pt.y, col); + } + + virtual void DrawLine( long x1, long y1, long x2, long y2 ) = 0; + inline void DrawLine(const wxPoint& pt1, const wxPoint& pt2) + { + DrawLine(pt1.x, pt1.y, pt2.x, pt2.y); + } + + virtual void CrossHair( long x, long y ) = 0; + inline void CrossHair(const wxPoint& pt) + { + CrossHair(pt.x, pt.y); + } + + virtual void DrawArc( long x1, long y1, long x2, long y2, double xc, double yc ) = 0; + inline void DrawArc(const wxPoint& pt1, const wxPoint& pt2, double xc, double yc) + { + DrawArc(pt1.x, pt1.y, pt2.x, pt2.y, xc, yc); + } + + virtual void DrawEllipticArc( long x, long y, long width, long height, double sa, double ea ) = 0; + virtual void DrawEllipticArc (const wxPoint& pt, const wxSize& sz, double sa, double ea) + { + DrawEllipticArc(pt.x, pt.y, sz.x, sz.y, sa, ea); + } + + virtual void DrawPoint( long x, long y ) = 0; + virtual void DrawPoint( wxPoint& point ); + + virtual void DrawLines( int n, wxPoint points[], long xoffset = 0, long yoffset = 0 ) = 0; + virtual void DrawLines( wxList *points, long xoffset = 0, long yoffset = 0 ); + virtual void DrawPolygon( int n, wxPoint points[], long xoffset = 0, long yoffset = 0, + int fillStyle=wxODDEVEN_RULE ) = 0; + virtual void DrawPolygon( wxList *lines, long xoffset = 0, long yoffset = 0, + int fillStyle=wxODDEVEN_RULE ); + + virtual void DrawRectangle( long x, long y, long width, long height ) = 0; + inline void DrawRectangle(const wxPoint& pt, const wxSize& sz) + { + DrawRectangle(pt.x, pt.y, sz.x, sz.y); + } + inline void DrawRectangle(const wxRect& rect) + { + DrawRectangle(rect.x, rect.y, rect.width, rect.height); + } + virtual void DrawRoundedRectangle( long x, long y, long width, long height, double radius = 20.0 ) = 0; + inline void DrawRoundedRectangle(const wxPoint& pt, const wxSize& sz, double radius = 20.0) + { + DrawRoundedRectangle(pt.x, pt.y, sz.x, sz.y, radius); + } + inline void DrawRoundedRectangle(const wxRect& rect, double radius = 20.0) + { + DrawRoundedRectangle(rect.x, rect.y, rect.width, rect.height, radius); + } + + virtual void DrawEllipse( long x, long y, long width, long height ) = 0; + inline void DrawEllipse(const wxPoint& pt, const wxSize& sz) + { + DrawEllipse(pt.x, pt.y, sz.x, sz.y); + } + inline void DrawEllipse(const wxRect& rect) + { + DrawEllipse(rect.x, rect.y, rect.width, rect.height); + } + + virtual void DrawIcon(const wxIcon& icon, long x, long y) = 0; + + virtual void DrawSpline( long x1, long y1, long x2, long y2, long x3, long y3 ); + virtual void DrawSpline( wxList *points ); + virtual void DrawSpline( int n, wxPoint points[] ); + + virtual bool CanDrawBitmap(void) const = 0; + + virtual void DrawIcon( const wxIcon &icon, long x, long y, bool useMask=FALSE ); + inline void DrawIcon(const wxIcon& icon, const wxPoint& pt) + { + DrawIcon(icon, pt.x, pt.y); + } + + // TODO DrawBitmap is not always the same as DrawIcon, especially if bitmaps and + // icons are implemented differently. + void DrawBitmap( const wxBitmap &bmp, long x, long y, bool useMask=FALSE ) + { DrawIcon( *((wxIcon*)(&bmp)), x, y, useMask ); } + + virtual bool Blit( long xdest, long ydest, long width, long height, + wxDC *source, long xsrc, long ysrc, int logical_func = wxCOPY, bool useMask=FALSE ) = 0; + inline bool Blit(const wxPoint& destPt, const wxSize& sz, wxDC *source, const wxPoint& srcPt, int rop = wxCOPY, bool useMask = FALSE) - { - return Blit(destPt.x, destPt.y, sz.x, sz.y, source, srcPt.x, srcPt.y, rop, useMask); - } - -#if USE_SPLINES - // Splines - // 3-point spline - virtual void DrawSpline(long x1, long y1, long x2, long y2, long x3, long y3); - // Any number of control points - a list of pointers to wxPoints - virtual void DrawSpline(wxList *points); - virtual void DrawSpline(int n, wxPoint points[]); -#endif - virtual void Clear(); - virtual void SetFont(const wxFont& font); - virtual void SetPen(const wxPen& pen); - virtual void SetBrush(const wxBrush& brush); - virtual void SetLogicalFunction(int function); - virtual void SetBackground(const wxBrush& brush); - virtual void SetBackgroundMode(int mode); - - virtual void SetClippingRegion(long x, long y, long width, long height); - inline void SetClippingRegion(const wxPoint& pt, const wxSize& sz) - { - SetClippingRegion(pt.x, pt.y, sz.x, sz.y); - } - inline void SetClippingRegion(const wxRect& rect) - { - SetClippingRegion(rect.x, rect.y, rect.width, rect.height); - } - - virtual void SetPalette(const wxPalette& palette); - virtual void DestroyClippingRegion(); - virtual long GetCharHeight() const; - virtual long GetCharWidth() const; - virtual void GetTextExtent(const wxString& string, long *x, long *y, + { + return Blit(destPt.x, destPt.y, sz.x, sz.y, source, srcPt.x, srcPt.y, rop, useMask); + } + + virtual void DrawText( const wxString &text, long x, long y, bool use16 = FALSE ) = 0; + inline void DrawText(const wxString& text, const wxPoint& pt, bool use16bit = FALSE) + { + DrawText(text, pt.x, pt.y, use16bit); + } + + virtual bool CanGetTextExtent(void) const = 0; + virtual void GetTextExtent( const wxString &string, long *width, long *height, long *descent = NULL, long *externalLeading = NULL, - wxFont *theFont = NULL, bool use16bit = FALSE) const; - - // Size in device units - virtual void GetSize(int* width, int* height) const; - inline wxSize GetSize() const { int w, h; GetSize(&w, &h); return wxSize(w, h); } - - // Size in mm - virtual void GetSizeMM(long* width, long* height) const ; - - virtual bool StartDoc(const wxString& message); - virtual void EndDoc(); - virtual void StartPage(); - virtual void EndPage(); - virtual void SetMapMode(int mode); - virtual void SetUserScale(double x, double y); - virtual void SetSystemScale(double x, double y); - virtual void SetLogicalOrigin(long x, long y); - virtual void SetDeviceOrigin(long x, long y); - virtual void SetAxisOrientation(bool xLeftRight, bool yBottomUp); - - // This group of functions does actual conversion - // of the input, as you'd expect. - - long DeviceToLogicalX(long x) const; - long DeviceToLogicalY(long y) const; - long DeviceToLogicalXRel(long x) const; - long DeviceToLogicalYRel(long y) const; - long LogicalToDeviceX(long x) const; - long LogicalToDeviceY(long y) const; - long LogicalToDeviceXRel(long x) const; - long LogicalToDeviceYRel(long y) const; - - virtual bool CanDrawBitmap() const; - virtual bool CanGetTextExtent() const; - - virtual void SetTextForeground(const wxColour& colour); - virtual void SetTextBackground(const wxColour& colour); - inline virtual bool Ok() const {return m_ok;}; - inline virtual int GetMapMode() const {return m_mappingMode;}; - - inline virtual wxBrush *GetBackground() const { return (wxBrush*) &m_backgroundBrush ;} - inline virtual wxBrush *GetBrush() const { return (wxBrush*) &m_brush ;} - inline virtual wxFont *GetFont() const { return (wxFont*) &m_font ;} - inline virtual int GetLogicalFunction() const { return m_logicalFunction ;} - inline virtual wxPen *GetPen() const { return (wxPen*) &m_pen ;} - inline virtual wxColour&GetTextBackground() const { return (wxColour&) m_textBackgroundColour ;} - inline virtual wxColour&GetTextForeground() const { return (wxColour&) m_textForegroundColour ;} - - virtual void SetLogicalScale(double x, double y); - virtual inline void GetUserScale(double* x, double *y) const { *x = m_userScaleX; *y = m_userScaleY; } - virtual void CalcBoundingBox(long x, long y); - // Get the final bounding box of the PostScript or Metafile picture. - virtual inline long MinX() const { return m_minX; } - virtual inline long MaxX() const { return m_maxX; } - virtual inline long MinY() const { return m_minY; } - virtual inline long MaxY() const { return m_maxY; } - - // Sometimes we need to override optimization, e.g. - // if other software is drawing onto our surface and we - // can't be sure of who's done what. - virtual inline void SetOptimization(bool WXUNUSED(opt)) { } - virtual inline bool GetOptimization() { return FALSE; } - - virtual void GetClippingBox(long *x,long *y,long *w,long *h) const ; - inline void GetClippingBox(wxRect& rect) const - { - long x, y, w, h; - GetClippingBox(&x, &y, &w, &h); rect.x = x; rect.y = y; rect.width = w; rect.height = h; - } - - inline wxWindow *GetWindow() const { return m_canvas; } - inline void SetWindow(wxWindow *win) { m_canvas = win; } - -protected: - bool m_colour; - bool m_ok; - bool m_clipping; - bool m_isInteractive; - - // Coordinate system variables - long m_logicalOriginX; - long m_logicalOriginY; - - long m_deviceOriginX; - long m_deviceOriginY; - - double m_logicalScaleX; - double m_logicalScaleY; - - double m_userScaleX; - double m_userScaleY; - - int m_signX; // Used by SetAxisOrientation() to - int m_signY; // invert the axes - - int m_mappingMode; - - long m_minX; // bounding box - long m_minY; - long m_maxX; - long m_maxY; - - int m_logicalFunction; - int m_backgroundMode; - - wxPen m_pen; - wxBrush m_brush; - wxBrush m_backgroundBrush; - wxColour m_textForegroundColour; - wxColour m_textBackgroundColour; - wxFont m_font; - wxPalette m_palette; - int m_clipX1; - int m_clipY1; - int m_clipX2; - int m_clipY2; - double m_systemScaleX; - double m_systemScaleY; - - wxWindow * m_canvas; - wxBitmap m_selectedBitmap; - wxString m_filename; - + wxFont *theFont = NULL, bool use16 = FALSE ) = 0; + virtual long GetCharWidth(void) = 0; + virtual long GetCharHeight(void) = 0; + + virtual void Clear(void) = 0; + + virtual void SetFont( const wxFont &font ) = 0; + virtual wxFont *GetFont(void) const { return &m_font; }; + + virtual void SetPen( const wxPen &pen ) = 0; + virtual wxPen *GetPen(void) const { return &m_pen; }; + + virtual void SetBrush( const wxBrush &brush ) = 0; + virtual wxBrush *GetBrush(void) const { return &m_brush; }; + + virtual void SetBackground( const wxBrush &brush ) = 0; + virtual wxBrush *GetBackground(void) const { return &m_backgroundBrush; }; + + virtual void SetLogicalFunction( int function ) = 0; + virtual int GetLogicalFunction(void) const { return m_logicalFunction; }; + + virtual void SetTextForeground( const wxColour &col ); + virtual void SetTextBackground( const wxColour &col ); + virtual wxColour& GetTextBackground(void) const { return (wxColour&)m_textBackgroundColour; }; + virtual wxColour& GetTextForeground(void) const { return (wxColour&)m_textForegroundColour; }; + + virtual void SetBackgroundMode( int mode ) = 0; + virtual int GetBackgroundMode(void) const { return m_backgroundMode; }; + + virtual void SetPalette( const wxPalette& palette ) = 0; + void SetColourMap( const wxPalette& palette ) { SetPalette(palette); }; + + // the first two must be overridden and called + virtual void SetClippingRegion( long x, long y, long width, long height ); + virtual void DestroyClippingRegion(void); + virtual void GetClippingBox( long *x, long *y, long *width, long *height ) const; + + virtual inline long MinX(void) const { return m_minX; } + virtual inline long MaxX(void) const { return m_maxX; } + virtual inline long MinY(void) const { return m_minY; } + virtual inline long MaxY(void) const { return m_maxY; } + + virtual void GetSize( int* width, int* height ) const; + inline wxSize GetSize(void) const { int w, h; GetSize(&w, &h); return wxSize(w, h); } + virtual void GetSizeMM( long* width, long* height ) const; + + virtual bool StartDoc( const wxString& WXUNUSED(message) ) { return TRUE; }; + virtual void EndDoc(void) {}; + virtual void StartPage(void) {}; + virtual void EndPage(void) {}; + + virtual void SetMapMode( int mode ); + virtual int GetMapMode(void) const { return m_mappingMode; }; + + virtual void SetUserScale( double x, double y ); + virtual void GetUserScale( double *x, double *y ); + virtual void SetLogicalScale( double x, double y ); + virtual void GetLogicalScale( double *x, double *y ); + + virtual void SetLogicalOrigin( long x, long y ); + virtual void GetLogicalOrigin( long *x, long *y ); + virtual void SetDeviceOrigin( long x, long y ); + virtual void GetDeviceOrigin( long *x, long *y ); + virtual void SetInternalDeviceOrigin( long x, long y ); + virtual void GetInternalDeviceOrigin( long *x, long *y ); + + virtual void SetAxisOrientation( bool xLeftRight, bool yBottomUp ); + + virtual void SetOptimization( bool WXUNUSED(optimize) ) {}; + virtual bool GetOptimization(void) { return m_optimize; }; + + virtual long DeviceToLogicalX(long x) const; + virtual long DeviceToLogicalY(long y) const; + virtual long DeviceToLogicalXRel(long x) const; + virtual long DeviceToLogicalYRel(long y) const; + virtual long LogicalToDeviceX(long x) const; + virtual long LogicalToDeviceY(long y) const; + virtual long LogicalToDeviceXRel(long x) const; + virtual long LogicalToDeviceYRel(long y) const; + + public: + + void CalcBoundingBox( long x, long y ); + void ComputeScaleAndOrigin(void); + + long XDEV2LOG(long x) const + { + long new_x = x - m_deviceOriginX; + if (new_x > 0) + return (long)((double)(new_x) / m_scaleX + 0.5) * m_signX + m_logicalOriginX; + else + return (long)((double)(new_x) / m_scaleX - 0.5) * m_signX + m_logicalOriginX; + } + long XDEV2LOGREL(long x) const + { + if (x > 0) + return (long)((double)(x) / m_scaleX + 0.5); + else + return (long)((double)(x) / m_scaleX - 0.5); + } + long YDEV2LOG(long y) const + { + long new_y = y - m_deviceOriginY; + if (new_y > 0) + return (long)((double)(new_y) / m_scaleY + 0.5) * m_signY + m_logicalOriginY; + else + return (long)((double)(new_y) / m_scaleY - 0.5) * m_signY + m_logicalOriginY; + } + long YDEV2LOGREL(long y) const + { + if (y > 0) + return (long)((double)(y) / m_scaleY + 0.5); + else + return (long)((double)(y) / m_scaleY - 0.5); + } + long XLOG2DEV(long x) const + { + long new_x = x - m_logicalOriginX; + if (new_x > 0) + return (long)((double)(new_x) * m_scaleX + 0.5) * m_signX + m_deviceOriginX; + else + return (long)((double)(new_x) * m_scaleX - 0.5) * m_signX + m_deviceOriginX; + } + long XLOG2DEVREL(long x) const + { + if (x > 0) + return (long)((double)(x) * m_scaleX + 0.5); + else + return (long)((double)(x) * m_scaleX - 0.5); + } + long YLOG2DEV(long y) const + { + long new_y = y - m_logicalOriginY; + if (new_y > 0) + return (long)((double)(new_y) * m_scaleY + 0.5) * m_signY + m_deviceOriginY; + else + return (long)((double)(new_y) * m_scaleY - 0.5) * m_signY + m_deviceOriginY; + } + long YLOG2DEVREL(long y) const + { + if (y > 0) + return (long)((double)(y) * m_scaleY + 0.5); + else + return (long)((double)(y) * m_scaleY - 0.5); + } + + virtual void DrawOpenSpline( wxList *points ) = 0; + + public: + + bool m_ok; + bool m_colour; + + // not sure, what these mean + bool m_clipping; // Is clipping on right now ? + bool m_isInteractive; // Is GetPixel possible ? + bool m_autoSetting; // wxMSW only ? + bool m_dontDelete; // wxMSW only ? + bool m_optimize; // wxMSW only ? + wxString m_filename; // Not sure where this belongs. + + wxPen m_pen; + wxBrush m_brush; + wxBrush m_backgroundBrush; + wxColour m_textForegroundColour; + wxColour m_textBackgroundColour; + wxFont m_font; + + int m_logicalFunction; + int m_backgroundMode; + int m_textAlignment; // gone in wxWin 2.0 ? + + int m_mappingMode; + + // not sure what for, but what is a mm on a screen you don't know the size of? + double m_mm_to_pix_x,m_mm_to_pix_y; + + long m_internalDeviceOriginX,m_internalDeviceOriginY; // If un-scrolled is non-zero or + // d.o. changes with scrolling. + // Set using SetInternalDeviceOrigin(). + + long m_externalDeviceOriginX,m_externalDeviceOriginY; // To be set by external classes + // such as wxScrolledWindow + // using SetDeviceOrigin() + + long m_deviceOriginX,m_deviceOriginY; // Sum of the two above. + + long m_logicalOriginX,m_logicalOriginY; // User defined. + + double m_scaleX,m_scaleY; + double m_logicalScaleX,m_logicalScaleY; + double m_userScaleX,m_userScaleY; + long m_signX,m_signY; + + bool m_needComputeScaleX,m_needComputeScaleY; // not yet used + + float m_scaleFactor; // wxPSDC wants to have this. Will disappear. + + long m_clipX1,m_clipY1,m_clipX2,m_clipY2; + long m_minX,m_maxX,m_minY,m_maxY; }; #endif diff --git a/include/wx/stubs/dcclient.h b/include/wx/stubs/dcclient.h index 3265026677..828a507d75 100644 --- a/include/wx/stubs/dcclient.h +++ b/include/wx/stubs/dcclient.h @@ -1,6 +1,6 @@ ///////////////////////////////////////////////////////////////////////////// // Name: dcclient.h -// Purpose: wxClientDC class +// Purpose: wxClientDC, wxPaintDC and wxWindowDC classes // Author: AUTHOR // Modified by: // Created: ??/??/98 @@ -18,43 +18,82 @@ #include "wx/dc.h" -class WXDLLEXPORT wxClientDC: public wxDC -{ - DECLARE_DYNAMIC_CLASS(wxClientDC) - - public: - wxClientDC(); +//----------------------------------------------------------------------------- +// classes +//----------------------------------------------------------------------------- - // Create a DC corresponding to a canvas - wxClientDC(wxWindow *win); +class WXDLLEXPORT wxPaintDC; - ~wxClientDC(); -}; - -class WXDLLEXPORT wxWindowDC: public wxDC -{ - DECLARE_DYNAMIC_CLASS(wxWindowDC) +// Under Windows, wxClientDC, wxPaintDC and wxWindowDC are implemented differently. +// On many platforms, however, they will be the same. - public: - wxWindowDC(); +typedef wxPaintDC wxClientDC; +typedef wxPaintDC wxWindowDC; - // Create a DC corresponding to a canvas - wxWindowDC(wxWindow *win); - - ~wxWindowDC(); -}; +//----------------------------------------------------------------------------- +// wxPaintDC +//----------------------------------------------------------------------------- class WXDLLEXPORT wxPaintDC: public wxDC { DECLARE_DYNAMIC_CLASS(wxPaintDC) - public: - wxPaintDC(); - - // Create a DC corresponding to a canvas - wxPaintDC(wxWindow *win); - - ~wxPaintDC(); + public: + + wxPaintDC(void); + wxPaintDC( wxWindow *win ); + + ~wxPaintDC(void); + + virtual void FloodFill( long x1, long y1, wxColour *col, int style=wxFLOOD_SURFACE ); + virtual bool GetPixel( long x1, long y1, wxColour *col ) const; + + virtual void DrawLine( long x1, long y1, long x2, long y2 ); + virtual void CrossHair( long x, long y ); + virtual void DrawArc( long x1, long y1, long x2, long y2, double xc, double yc ); + virtual void DrawEllipticArc( long x, long y, long width, long height, double sa, double ea ); + virtual void DrawPoint( long x, long y ); + + virtual void DrawLines( int n, wxPoint points[], long xoffset = 0, long yoffset = 0 ); + virtual void DrawLines( wxList *points, long xoffset = 0, long yoffset = 0 ); + virtual void DrawPolygon( int n, wxPoint points[], long xoffset = 0, long yoffset = 0, + int fillStyle=wxODDEVEN_RULE ); + virtual void DrawPolygon( wxList *lines, long xoffset = 0, long yoffset = 0, + int fillStyle=wxODDEVEN_RULE ); + + virtual void DrawRectangle( long x, long y, long width, long height ); + virtual void DrawRoundedRectangle( long x, long y, long width, long height, double radius = 20.0 ); + virtual void DrawEllipse( long x, long y, long width, long height ); + + virtual bool CanDrawBitmap(void) const; + virtual void DrawIcon( const wxIcon &icon, long x, long y, bool useMask=FALSE ); + virtual bool Blit( long xdest, long ydest, long width, long height, + wxDC *source, long xsrc, long ysrc, int logical_func = wxCOPY, bool useMask=FALSE ); + + virtual void DrawText( const wxString &text, long x, long y, bool use16 = FALSE ); + virtual bool CanGetTextExtent(void) const; + virtual void GetTextExtent( const wxString &string, long *width, long *height, + long *descent = NULL, long *externalLeading = NULL, + wxFont *theFont = NULL, bool use16 = FALSE ); + virtual long GetCharWidth(void); + virtual long GetCharHeight(void); + + virtual void Clear(void); + + virtual void SetFont( const wxFont &font ); + virtual void SetPen( const wxPen &pen ); + virtual void SetBrush( const wxBrush &brush ); + virtual void SetBackground( const wxBrush &brush ); + virtual void SetLogicalFunction( int function ); + virtual void SetTextForeground( const wxColour &col ); + virtual void SetTextBackground( const wxColour &col ); + virtual void SetBackgroundMode( int mode ); + virtual void SetPalette( const wxPalette& palette ); + + virtual void SetClippingRegion( long x, long y, long width, long height ); + virtual void DestroyClippingRegion(void); + + virtual void DrawOpenSpline( wxList *points ); }; #endif diff --git a/include/wx/stubs/dcmemory.h b/include/wx/stubs/dcmemory.h index dfcd7adda4..c6c5737642 100644 --- a/include/wx/stubs/dcmemory.h +++ b/include/wx/stubs/dcmemory.h @@ -18,17 +18,20 @@ #include "wx/dcclient.h" -class WXDLLEXPORT wxMemoryDC: public wxDC +class WXDLLEXPORT wxMemoryDC: public wxPaintDC { DECLARE_DYNAMIC_CLASS(wxMemoryDC) - public: - wxMemoryDC(); - wxMemoryDC(wxDC *dc); // Create compatible DC + public: + wxMemoryDC(void); + wxMemoryDC( wxDC *dc ); // Create compatible DC + ~wxMemoryDC(void); + virtual void SelectObject( const wxBitmap& bitmap ); + void GetSize( int *width, int *height ) const; - ~wxMemoryDC(); - virtual void SelectObject(const wxBitmap& bitmap); - virtual void GetSize(int* width, int* height) const; + private: + friend wxPaintDC; + wxBitmap m_selected; }; #endif diff --git a/include/wx/stubs/dcscreen.h b/include/wx/stubs/dcscreen.h index 78ded86d8a..12d4996e70 100644 --- a/include/wx/stubs/dcscreen.h +++ b/include/wx/stubs/dcscreen.h @@ -16,9 +16,9 @@ #pragma interface "dcscreen.h" #endif -#include "wx/dc.h" +#include "wx/dcclient.h" -class WXDLLEXPORT wxScreenDC: public wxDC +class WXDLLEXPORT wxScreenDC: public wxPaintDC { DECLARE_DYNAMIC_CLASS(wxScreenDC) diff --git a/include/wx/stubs/dialog.h b/include/wx/stubs/dialog.h index 678ba2518d..ebd7bff2a8 100644 --- a/include/wx/stubs/dialog.h +++ b/include/wx/stubs/dialog.h @@ -60,11 +60,9 @@ public: ~wxDialog(); virtual bool Destroy(); - void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); void SetClientSize(int width, int height); void GetPosition(int *x, int *y) const; bool Show(bool show); - bool IsShown() const ; void Iconize(bool iconize); virtual bool IsIconized() const; @@ -75,7 +73,6 @@ public: bool OnClose(); void OnCharHook(wxKeyEvent& event); - void OnPaint(wxPaintEvent& event); void OnCloseWindow(wxCloseEvent& event); void SetModal(bool flag); diff --git a/include/wx/stubs/font.h b/include/wx/stubs/font.h index 4241a37393..2079f2d0f0 100644 --- a/include/wx/stubs/font.h +++ b/include/wx/stubs/font.h @@ -29,7 +29,6 @@ public: protected: int m_pointSize; int m_family; - int m_fontId; int m_style; int m_weight; bool m_underlined; @@ -49,19 +48,18 @@ class WXDLLEXPORT wxFont: public wxGDIObject DECLARE_DYNAMIC_CLASS(wxFont) public: wxFont(); - wxFont(int PointSize, int Family, int Style, int Weight, bool underlined = FALSE, const wxString& Face = wxEmptyString); + wxFont(int pointSize, int family, int style, int weight, bool underlined = FALSE, const wxString& faceName = wxEmptyString); inline wxFont(const wxFont& font) { Ref(font); } - inline wxFont(const wxFont* font) { /* UnRef(); */ if (font) Ref(*font); } + inline wxFont(const wxFont* font) { if (font) Ref(*font); } ~wxFont(); - bool Create(int PointSize, int Family, int Style, int Weight, bool underlined = FALSE, const wxString& Face = wxEmptyString); + bool Create(int pointSize, int family, int style, int weight, bool underlined = FALSE, const wxString& faceName = wxEmptyString); virtual bool Ok() const { return (m_refData != NULL) ; } inline int GetPointSize() const { return M_FONTDATA->m_pointSize; } inline int GetFamily() const { return M_FONTDATA->m_family; } - inline int GetFontId() const { return M_FONTDATA->m_fontId; } /* New font system */ inline int GetStyle() const { return M_FONTDATA->m_style; } inline int GetWeight() const { return M_FONTDATA->m_weight; } wxString GetFamilyString() const ; @@ -80,6 +78,10 @@ public: inline wxFont& operator = (const wxFont& font) { if (*this == font) return (*this); Ref(font); return *this; } inline bool operator == (const wxFont& font) { return m_refData == font.m_refData; } inline bool operator != (const wxFont& font) { return m_refData != font.m_refData; } + + // Implementation +protected: + void Unshare(); }; #endif diff --git a/include/wx/stubs/fontdlg.h b/include/wx/stubs/fontdlg.h index 943a06f767..39da6fd967 100644 --- a/include/wx/stubs/fontdlg.h +++ b/include/wx/stubs/fontdlg.h @@ -1,6 +1,7 @@ ///////////////////////////////////////////////////////////////////////////// // Name: fontdlg.h -// Purpose: wxFontDialog class +// Purpose: wxFontDialog class. Use generic version if no +// platform-specific implementation. // Author: AUTHOR // Modified by: // Created: ??/??/98 diff --git a/include/wx/stubs/imaglist.h b/include/wx/stubs/imaglist.h index 52784ddd4b..7e66ffb36a 100644 --- a/include/wx/stubs/imaglist.h +++ b/include/wx/stubs/imaglist.h @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // Name: imaglist.h -// Purpose: wxImageList class +// Purpose: wxImageList class. Note: if your GUI doesn't have +// an image list equivalent, you can use the generic class +// in src/generic. // Author: AUTHOR // Modified by: // Created: ??/??/98 diff --git a/include/wx/stubs/listctrl.h b/include/wx/stubs/listctrl.h index 76a6433e0e..e8f26286d8 100644 --- a/include/wx/stubs/listctrl.h +++ b/include/wx/stubs/listctrl.h @@ -189,10 +189,6 @@ class WXDLLEXPORT wxListCtrl: public wxControl // Attributes //////////////////////////////////////////////////////////////////////////// - // Sets the background colour (GetBackgroundColour already implicit in - // wxWindow class) - void SetBackgroundColour(const wxColour& col); - // Gets information about this column bool GetColumn(int col, wxListItem& item) const; diff --git a/include/wx/stubs/menu.h b/include/wx/stubs/menu.h index f663631da5..1654602141 100644 --- a/include/wx/stubs/menu.h +++ b/include/wx/stubs/menu.h @@ -52,7 +52,7 @@ public: // insert a break in the menu void Break(); // delete an item - void Delete(int id); /* If it's a submenu, menu is not destroyed. VZ: why? */ + void Delete(int id); // menu item control void Enable(int id, bool Flag); @@ -74,7 +74,7 @@ public: virtual wxString GetHelpString(int id) const ; // find item - // Finds the item id matching the given string, NOT_FOUND if not found. + // Finds the item id matching the given string, -1 if not found. virtual int FindItem(const wxString& itemString) const ; // Find wxMenuItem by ID, and item's menu too if itemMenu is !NULL. wxMenuItem *FindItemForId(int itemId, wxMenu **itemMenu = NULL) const; @@ -93,7 +93,6 @@ public: int m_noItems; wxString m_title; - wxMenu * m_topLevelMenu; wxMenuBar * m_menuBar; wxList m_menuItems; wxEvtHandler * m_parent; diff --git a/include/wx/stubs/minifram.h b/include/wx/stubs/minifram.h index 12f485097b..8f1644d558 100644 --- a/include/wx/stubs/minifram.h +++ b/include/wx/stubs/minifram.h @@ -34,10 +34,11 @@ public: long style = wxDEFAULT_FRAME_STYLE|wxTINY_CAPTION_HORIZ, const wxString& name = wxFrameNameStr) { + // Use wxFrame constructor in absence of more specific code. Create(parent, id, title, pos, size, style, name); } - ~wxMiniFrame(); + ~wxMiniFrame() {} protected: }; diff --git a/include/wx/stubs/msgdlg.h b/include/wx/stubs/msgdlg.h index d885345dfb..58fa8e51ae 100644 --- a/include/wx/stubs/msgdlg.h +++ b/include/wx/stubs/msgdlg.h @@ -1,6 +1,7 @@ ///////////////////////////////////////////////////////////////////////////// // Name: msgdlg.h -// Purpose: wxMessageDialog class +// Purpose: wxMessageDialog class. Use generic version if no +// platform-specific implementation. // Author: AUTHOR // Modified by: // Created: ??/??/98 diff --git a/include/wx/stubs/pen.h b/include/wx/stubs/pen.h index 74e961c1d3..0e23c99daf 100644 --- a/include/wx/stubs/pen.h +++ b/include/wx/stubs/pen.h @@ -27,6 +27,7 @@ class WXDLLEXPORT wxPenRefData: public wxGDIRefData friend class WXDLLEXPORT wxPen; public: wxPenRefData(); + wxPenRefData(const wxPenRefData& data); ~wxPenRefData(); protected: @@ -86,6 +87,15 @@ public: } inline wxBitmap *GetStipple() const { return (M_PENDATA ? (& M_PENDATA->m_stipple) : NULL); }; + +// Implementation + + // Useful helper: create the brush resource + void RealizeResource(); + + // When setting properties, we must make sure we're not changing + // another object + void Unshare(); }; #endif diff --git a/include/wx/stubs/printdlg.h b/include/wx/stubs/printdlg.h index d6ee60ff46..cda8c08232 100644 --- a/include/wx/stubs/printdlg.h +++ b/include/wx/stubs/printdlg.h @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // Name: printdlg.h -// Purpose: wxPrintDialog, wxPageSetupDialog classes +// Purpose: wxPrintDialog, wxPageSetupDialog classes. +// Use generic, PostScript version if no +// platform-specific implementation. // Author: AUTHOR // Modified by: // Created: ??/??/98 diff --git a/include/wx/stubs/radiobox.h b/include/wx/stubs/radiobox.h index d70548dfa3..cb7c5ba405 100644 --- a/include/wx/stubs/radiobox.h +++ b/include/wx/stubs/radiobox.h @@ -56,7 +56,6 @@ public: wxString GetLabel() const; void SetLabel(const wxString& label); void SetLabel(int item, const wxString& label) ; - void SetLabel(int item, wxBitmap *bitmap) ; wxString GetLabel(int item) const; bool Show(bool show); void SetFocus(); @@ -79,9 +78,6 @@ protected: WXHWND * m_radioButtons; */ int m_majorDim ; - int * m_radioWidth ; // for bitmaps (not implemented) - int * m_radioHeight ; - int m_noItems; int m_noRowsOrCols; int m_selectedButton; diff --git a/include/wx/stubs/statbrxx.h b/include/wx/stubs/statbrxx.h deleted file mode 100644 index 75005057f5..0000000000 --- a/include/wx/stubs/statbrxx.h +++ /dev/null @@ -1,48 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// Name: msw/statbrxx.h -// Purpose: native implementation of wxStatusBar. Optional. -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 -// RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_STATBRXX_H -#define _WX_STATBRXX_H - -#ifdef __GNUG__ -#pragma interface "statbrxx.h" -#endif - -class WXDLLEXPORT wxStatusBarXX : public wxStatusBar -{ - DECLARE_DYNAMIC_CLASS(wxStatusBarXX); - -public: - // ctors - wxStatusBarXX(); - wxStatusBarXX(wxWindow *parent, wxWindowID id = -1, long style = wxST_SIZEGRIP); - - // create status line - bool Create(wxWindow *parent, wxWindowID id = -1, long style = wxST_SIZEGRIP); - - // a status line can have several (<256) fields numbered from 0 - virtual void SetFieldsCount(int number = 1, const int widths[] = NULL); - - // each field of status line has it's own text - virtual void SetStatusText(const wxString& text, int number = 0); - virtual wxString GetStatusText(int number = 0) const; - - // set status line fields' widths - virtual void SetStatusWidths(int n, const int widths_field[]); - - // we're going to process WM_SIZE (of the parent window) - void OnSize(wxSizeEvent& event); - - DECLARE_EVENT_TABLE() -}; - -#endif - // _WX_STATBRXX_H \ No newline at end of file diff --git a/include/wx/stubs/statusbr.h b/include/wx/stubs/statusbr.h new file mode 100644 index 0000000000..c0f83a26d0 --- /dev/null +++ b/include/wx/stubs/statusbr.h @@ -0,0 +1,50 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: statusbr.h +// Purpose: native implementation of wxStatusBar. Optional; can use generic +// version instead. +// Author: AUTHOR +// Modified by: +// Created: ??/??/98 +// RCS-ID: $Id$ +// Copyright: (c) AUTHOR +// Licence: wxWindows licence +/////////////////////////////////////////////////////////////////////////////// + +#ifndef _WX_STATBAR_H_ +#define _WX_STATBAR_H_ + +#ifdef __GNUG__ +#pragma interface "statbar.h" +#endif + +#include "wx/generic/statusbr.h" + +class WXDLLEXPORT wxStatusBarXX : public wxStatusBar +{ + DECLARE_DYNAMIC_CLASS(wxStatusBarXX); + +public: + // ctors + wxStatusBarXX(); + wxStatusBarXX(wxWindow *parent, wxWindowID id = -1, long style = wxST_SIZEGRIP); + + // create status line + bool Create(wxWindow *parent, wxWindowID id = -1, long style = wxST_SIZEGRIP); + + // a status line can have several (<256) fields numbered from 0 + virtual void SetFieldsCount(int number = 1, const int widths[] = NULL); + + // each field of status line has its own text + virtual void SetStatusText(const wxString& text, int number = 0); + virtual wxString GetStatusText(int number = 0) const; + + // set status line fields' widths + virtual void SetStatusWidths(int n, const int widths_field[]); + + void OnSize(wxSizeEvent& event); + + DECLARE_EVENT_TABLE() +}; + +#endif + // _WX_STATBAR_H_ \ No newline at end of file diff --git a/include/wx/stubs/taskbar.h b/include/wx/stubs/taskbar.h index 7dad1538e1..7f4a36b8b4 100644 --- a/include/wx/stubs/taskbar.h +++ b/include/wx/stubs/taskbar.h @@ -27,11 +27,6 @@ public: virtual ~wxTaskBarIcon(); // Accessors -/* TODO: implementation - inline WXHWND GetHWND() const { return m_hWnd; } - inline bool IsOK() const { return (m_hWnd != 0) ; } - inline bool IsIconInstalled() const { return m_iconAdded; } -*/ // Operations bool SetIcon(const wxIcon& icon, const wxString& tooltip = ""); @@ -46,26 +41,8 @@ public: virtual void OnLButtonDClick(); virtual void OnRButtonDClick(); -/* TODO -// Implementation - static wxTaskBarIcon* FindObjectForHWND(WXHWND hWnd); - static void AddObject(wxTaskBarIcon* obj); - static void RemoveObject(wxTaskBarIcon* obj); - static bool RegisterWindowClass(); - static WXHWND CreateTaskBarWindow(); - long WindowProc( WXHWND hWnd, unsigned int msg, unsigned int wParam, long lParam ); -*/ - // Data members protected: -/* TODO: implementation - WXHWND m_hWnd; - static bool sm_registeredClass; - static unsigned int sm_taskbarMsg; - static wxList sm_taskBarIcons; -*/ - - bool m_iconAdded; }; #endif diff --git a/include/wx/stubs/textctrl.h b/include/wx/stubs/textctrl.h index a4efeba67c..7c3d7b1ac2 100644 --- a/include/wx/stubs/textctrl.h +++ b/include/wx/stubs/textctrl.h @@ -30,9 +30,7 @@ WXDLLEXPORT_DATA(extern const char*) wxEmptyString; // Single-line text item class WXDLLEXPORT wxTextCtrl: public wxControl -// 16-bit Borland 4.0 doesn't seem to allow multiple inheritance with wxWindow and streambuf: -// it complains about deriving a huge class from the huge class streambuf. !! -// Also, can't use streambuf if making or using a DLL :-( +// TODO Some platforms/compilers don't like inheritance from streambuf. #if (defined(__BORLANDC__) && !defined(__WIN32__)) || defined(__MWERKS__) #define NO_TEXT_WINDOW_STREAM @@ -132,7 +130,7 @@ public: virtual void Command(wxCommandEvent& event); protected: - wxString fileName; + wxString m_fileName; DECLARE_EVENT_TABLE() }; diff --git a/include/wx/stubs/toolbar.h b/include/wx/stubs/toolbar.h index 68ad607708..e42c5827ef 100644 --- a/include/wx/stubs/toolbar.h +++ b/include/wx/stubs/toolbar.h @@ -59,14 +59,13 @@ class WXDLLEXPORT wxToolBar: public wxToolBarBase wxSize GetToolSize() const; wxSize GetMaxSize() const; - void GetSize(int *w, int *y) const; - // Add all the buttons: required for Win. + // Add all the buttons virtual bool CreateTools(); - virtual void SetRows(int nRows); virtual void Layout() {} - // The post-tool-addition call + // The post-tool-addition call. TODO: do here whatever's + // necessary for completing the toolbar construction. bool Realize() { return CreateTools(); }; protected: diff --git a/include/wx/stubs/window.h b/include/wx/stubs/window.h index 28c3441317..c024635909 100644 --- a/include/wx/stubs/window.h +++ b/include/wx/stubs/window.h @@ -67,7 +67,7 @@ class WXDLLEXPORT wxDC; class WXDLLEXPORT wxValidator; #if USE_DRAG_AND_DROP -class wxDropTarget; +class WXDLLEXPORT wxDropTarget; #endif #if USE_WX_RESOURCES @@ -311,6 +311,15 @@ public: inline virtual void SetForegroundColour(const wxColour& col); inline virtual wxColour GetForegroundColour() const; + // Set/get window default background colour (for children to inherit). + // NOTE: these may be removed in later revisions. + inline virtual void SetDefaultBackgroundColour(const wxColour& col); + inline virtual wxColour GetDefaultBackgroundColour(void) const; + + // Set/get window default foreground colour (for children to inherit) + inline virtual void SetDefaultForegroundColour(const wxColour& col); + inline virtual wxColour GetDefaultForegroundColour(void) const; + // Get the default button, if there is one inline virtual wxButton *GetDefaultItem() const; inline virtual void SetDefaultItem(wxButton *but); @@ -382,11 +391,6 @@ public: // Executes the default message virtual long Default(); -/* TODO: implement your own data access - virtual WXHWND GetHWND() const ; - virtual void SetHWND(WXHWND hWnd); -*/ - /* TODO: you may need something like this // Determine whether 3D effects are wanted virtual WXDWORD Determine3DEffects(WXDWORD defaultBorderStyle, bool *want3D); @@ -455,8 +459,6 @@ protected: bool m_autoLayout; // Whether to call Layout() in OnSize wxWindow * m_windowParent; // Each window always knows its parent wxValidator * m_windowValidator; - bool m_inOnSize; // Protection against OnSize reentry - bool m_winEnabled; int m_minSizeX; int m_minSizeY; int m_maxSizeX; @@ -468,7 +470,6 @@ protected: bool m_caretEnabled; bool m_caretShown; wxFont m_windowFont; // Window's font - bool m_isShown; wxCursor m_windowCursor; // Window's cursor wxString m_windowName; // Window name @@ -476,31 +477,14 @@ protected: wxColour m_backgroundColour ; wxColour m_foregroundColour ; - bool m_backgroundTransparent; - - int m_xThumbSize; - int m_yThumbSize; - - float m_lastXPos; - float m_lastYPos; - int m_lastEvent; - - bool m_mouseInWindow; + wxColour m_defaultBackgroundColour; + wxColour m_defaultForegroundColour; #if USE_DRAG_AND_DROP wxDropTarget *m_pDropTarget; // the current drop target or NULL #endif //USE_DRAG_AND_DROP public: -/* TODO: implementation of window handle, note of last message, etc. - WXHWND m_hWnd; // MS Windows window handle - WXUINT m_lastMsg; - WXWPARAM m_lastWParam; - WXLPARAM m_lastLParam; - WXHMENU m_hMenu; // Menu, if any - -*/ - wxRegion m_updateRegion; wxList * m_children; // Window's children int m_returnCode; @@ -534,6 +518,10 @@ inline void wxWindow::SetBackgroundColour(const wxColour& col) { m_backgroundCol inline wxColour wxWindow::GetBackgroundColour() const { return m_backgroundColour; }; inline void wxWindow::SetForegroundColour(const wxColour& col) { m_foregroundColour = col; }; inline wxColour wxWindow::GetForegroundColour() const { return m_foregroundColour; }; +inline void wxWindow::SetDefaultForegroundColour(const wxColour& col) { m_defaultForegroundColour = col; }; +inline wxColour wxWindow::GetDefaultForegroundColour(void) const { return m_defaultForegroundColour; }; +inline void wxWindow::SetDefaultBackgroundColour(const wxColour& col) { m_defaultBackgroundColour = col; }; +inline wxColour wxWindow::GetDefaultBackgroundColour(void) const { return m_defaultBackgroundColour; }; inline wxButton *wxWindow::GetDefaultItem() const { return m_defaultItem; } inline void wxWindow::SetDefaultItem(wxButton *but) { m_defaultItem = but; }