wxDC::GetSize() should work now in wxGTK
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8655 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -134,7 +134,6 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
// base class pure virtuals implemented here
|
// base class pure virtuals implemented here
|
||||||
virtual void DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
|
virtual void DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
|
||||||
virtual void DoGetSize(int *width, int *height) const;
|
|
||||||
virtual void DoGetSizeMM(int* width, int* height) const;
|
virtual void DoGetSizeMM(int* width, int* height) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@@ -40,7 +40,8 @@ public:
|
|||||||
virtual bool CanDrawBitmap() const { return TRUE; }
|
virtual bool CanDrawBitmap() const { return TRUE; }
|
||||||
virtual bool CanGetTextExtent() const { return TRUE; }
|
virtual bool CanGetTextExtent() const { return TRUE; }
|
||||||
|
|
||||||
//protected:
|
protected:
|
||||||
|
virtual void DoGetSize(int *width, int *height) const;
|
||||||
virtual void DoFloodFill( wxCoord x, wxCoord y, const wxColour& col, int style=wxFLOOD_SURFACE );
|
virtual void DoFloodFill( wxCoord x, wxCoord y, const wxColour& col, int style=wxFLOOD_SURFACE );
|
||||||
virtual bool DoGetPixel( wxCoord x1, wxCoord y1, wxColour *col ) const;
|
virtual bool DoGetPixel( wxCoord x1, wxCoord y1, wxColour *col ) const;
|
||||||
|
|
||||||
@@ -78,6 +79,8 @@ public:
|
|||||||
wxCoord *descent = (wxCoord *) NULL,
|
wxCoord *descent = (wxCoord *) NULL,
|
||||||
wxCoord *externalLeading = (wxCoord *) NULL,
|
wxCoord *externalLeading = (wxCoord *) NULL,
|
||||||
wxFont *theFont = (wxFont *) NULL) const;
|
wxFont *theFont = (wxFont *) NULL) const;
|
||||||
|
|
||||||
|
public:
|
||||||
virtual wxCoord GetCharWidth() const;
|
virtual wxCoord GetCharWidth() const;
|
||||||
virtual wxCoord GetCharHeight() const;
|
virtual wxCoord GetCharHeight() const;
|
||||||
|
|
||||||
@@ -134,20 +137,6 @@ private:
|
|||||||
DECLARE_DYNAMIC_CLASS(wxWindowDC)
|
DECLARE_DYNAMIC_CLASS(wxWindowDC)
|
||||||
};
|
};
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// wxPaintDC
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxPaintDC : public wxWindowDC
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
wxPaintDC();
|
|
||||||
wxPaintDC( wxWindow *win );
|
|
||||||
|
|
||||||
private:
|
|
||||||
DECLARE_DYNAMIC_CLASS(wxPaintDC)
|
|
||||||
};
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// wxClientDC
|
// wxClientDC
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@@ -155,11 +144,25 @@ private:
|
|||||||
class wxClientDC : public wxWindowDC
|
class wxClientDC : public wxWindowDC
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxClientDC();
|
wxClientDC() { }
|
||||||
wxClientDC( wxWindow *win );
|
wxClientDC( wxWindow *win );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DECLARE_DYNAMIC_CLASS(wxClientDC)
|
DECLARE_DYNAMIC_CLASS(wxClientDC)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// wxPaintDC
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class wxPaintDC : public wxClientDC
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxPaintDC() { }
|
||||||
|
wxPaintDC( wxWindow *win );
|
||||||
|
|
||||||
|
private:
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxPaintDC)
|
||||||
|
};
|
||||||
|
|
||||||
#endif // __GTKDCCLIENTH__
|
#endif // __GTKDCCLIENTH__
|
||||||
|
@@ -22,22 +22,25 @@ class wxScreenDC;
|
|||||||
// wxScreenDC
|
// wxScreenDC
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
class wxScreenDC: public wxPaintDC
|
class wxScreenDC : public wxPaintDC
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxScreenDC();
|
wxScreenDC();
|
||||||
~wxScreenDC();
|
virtual ~wxScreenDC();
|
||||||
|
|
||||||
static bool StartDrawingOnTop( wxWindow *window );
|
static bool StartDrawingOnTop( wxWindow *window );
|
||||||
static bool StartDrawingOnTop( wxRect *rect = (wxRect *) NULL );
|
static bool StartDrawingOnTop( wxRect *rect = (wxRect *) NULL );
|
||||||
static bool EndDrawingOnTop();
|
static bool EndDrawingOnTop();
|
||||||
|
|
||||||
// implementation
|
// implementation
|
||||||
|
|
||||||
static GdkWindow *sm_overlayWindow;
|
static GdkWindow *sm_overlayWindow;
|
||||||
static int sm_overlayWindowX;
|
static int sm_overlayWindowX;
|
||||||
static int sm_overlayWindowY;
|
static int sm_overlayWindowY;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void DoGetSize(int *width, int *height) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DECLARE_DYNAMIC_CLASS(wxScreenDC)
|
DECLARE_DYNAMIC_CLASS(wxScreenDC)
|
||||||
};
|
};
|
||||||
|
@@ -134,7 +134,6 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
// base class pure virtuals implemented here
|
// base class pure virtuals implemented here
|
||||||
virtual void DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
|
virtual void DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
|
||||||
virtual void DoGetSize(int *width, int *height) const;
|
|
||||||
virtual void DoGetSizeMM(int* width, int* height) const;
|
virtual void DoGetSizeMM(int* width, int* height) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@@ -40,7 +40,8 @@ public:
|
|||||||
virtual bool CanDrawBitmap() const { return TRUE; }
|
virtual bool CanDrawBitmap() const { return TRUE; }
|
||||||
virtual bool CanGetTextExtent() const { return TRUE; }
|
virtual bool CanGetTextExtent() const { return TRUE; }
|
||||||
|
|
||||||
//protected:
|
protected:
|
||||||
|
virtual void DoGetSize(int *width, int *height) const;
|
||||||
virtual void DoFloodFill( wxCoord x, wxCoord y, const wxColour& col, int style=wxFLOOD_SURFACE );
|
virtual void DoFloodFill( wxCoord x, wxCoord y, const wxColour& col, int style=wxFLOOD_SURFACE );
|
||||||
virtual bool DoGetPixel( wxCoord x1, wxCoord y1, wxColour *col ) const;
|
virtual bool DoGetPixel( wxCoord x1, wxCoord y1, wxColour *col ) const;
|
||||||
|
|
||||||
@@ -78,6 +79,8 @@ public:
|
|||||||
wxCoord *descent = (wxCoord *) NULL,
|
wxCoord *descent = (wxCoord *) NULL,
|
||||||
wxCoord *externalLeading = (wxCoord *) NULL,
|
wxCoord *externalLeading = (wxCoord *) NULL,
|
||||||
wxFont *theFont = (wxFont *) NULL) const;
|
wxFont *theFont = (wxFont *) NULL) const;
|
||||||
|
|
||||||
|
public:
|
||||||
virtual wxCoord GetCharWidth() const;
|
virtual wxCoord GetCharWidth() const;
|
||||||
virtual wxCoord GetCharHeight() const;
|
virtual wxCoord GetCharHeight() const;
|
||||||
|
|
||||||
@@ -134,20 +137,6 @@ private:
|
|||||||
DECLARE_DYNAMIC_CLASS(wxWindowDC)
|
DECLARE_DYNAMIC_CLASS(wxWindowDC)
|
||||||
};
|
};
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// wxPaintDC
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
class wxPaintDC : public wxWindowDC
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
wxPaintDC();
|
|
||||||
wxPaintDC( wxWindow *win );
|
|
||||||
|
|
||||||
private:
|
|
||||||
DECLARE_DYNAMIC_CLASS(wxPaintDC)
|
|
||||||
};
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// wxClientDC
|
// wxClientDC
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@@ -155,11 +144,25 @@ private:
|
|||||||
class wxClientDC : public wxWindowDC
|
class wxClientDC : public wxWindowDC
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxClientDC();
|
wxClientDC() { }
|
||||||
wxClientDC( wxWindow *win );
|
wxClientDC( wxWindow *win );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DECLARE_DYNAMIC_CLASS(wxClientDC)
|
DECLARE_DYNAMIC_CLASS(wxClientDC)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// wxPaintDC
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class wxPaintDC : public wxClientDC
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
wxPaintDC() { }
|
||||||
|
wxPaintDC( wxWindow *win );
|
||||||
|
|
||||||
|
private:
|
||||||
|
DECLARE_DYNAMIC_CLASS(wxPaintDC)
|
||||||
|
};
|
||||||
|
|
||||||
#endif // __GTKDCCLIENTH__
|
#endif // __GTKDCCLIENTH__
|
||||||
|
@@ -22,22 +22,25 @@ class wxScreenDC;
|
|||||||
// wxScreenDC
|
// wxScreenDC
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
class wxScreenDC: public wxPaintDC
|
class wxScreenDC : public wxPaintDC
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxScreenDC();
|
wxScreenDC();
|
||||||
~wxScreenDC();
|
virtual ~wxScreenDC();
|
||||||
|
|
||||||
static bool StartDrawingOnTop( wxWindow *window );
|
static bool StartDrawingOnTop( wxWindow *window );
|
||||||
static bool StartDrawingOnTop( wxRect *rect = (wxRect *) NULL );
|
static bool StartDrawingOnTop( wxRect *rect = (wxRect *) NULL );
|
||||||
static bool EndDrawingOnTop();
|
static bool EndDrawingOnTop();
|
||||||
|
|
||||||
// implementation
|
// implementation
|
||||||
|
|
||||||
static GdkWindow *sm_overlayWindow;
|
static GdkWindow *sm_overlayWindow;
|
||||||
static int sm_overlayWindowX;
|
static int sm_overlayWindowX;
|
||||||
static int sm_overlayWindowY;
|
static int sm_overlayWindowY;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void DoGetSize(int *width, int *height) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DECLARE_DYNAMIC_CLASS(wxScreenDC)
|
DECLARE_DYNAMIC_CLASS(wxScreenDC)
|
||||||
};
|
};
|
||||||
|
@@ -69,12 +69,6 @@ void wxDC::DestroyClippingRegion()
|
|||||||
// get DC capabilities
|
// get DC capabilities
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
void wxDC::DoGetSize( int* width, int* height ) const
|
|
||||||
{
|
|
||||||
if (width) *width = m_maxX-m_minX;
|
|
||||||
if (height) *height = m_maxY-m_minY;
|
|
||||||
}
|
|
||||||
|
|
||||||
void wxDC::DoGetSizeMM( int* width, int* height ) const
|
void wxDC::DoGetSizeMM( int* width, int* height ) const
|
||||||
{
|
{
|
||||||
int w = 0;
|
int w = 0;
|
||||||
|
@@ -393,6 +393,13 @@ void wxWindowDC::SetUpDC()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wxWindowDC::DoGetSize( int* width, int* height ) const
|
||||||
|
{
|
||||||
|
wxCHECK_RET( m_owner, _T("GetSize() doesn't work without window") );
|
||||||
|
|
||||||
|
m_owner->GetSize(width, height);
|
||||||
|
}
|
||||||
|
|
||||||
void wxWindowDC::DoFloodFill( wxCoord WXUNUSED(x), wxCoord WXUNUSED(y),
|
void wxWindowDC::DoFloodFill( wxCoord WXUNUSED(x), wxCoord WXUNUSED(y),
|
||||||
const wxColour &WXUNUSED(col), int WXUNUSED(style) )
|
const wxColour &WXUNUSED(col), int WXUNUSED(style) )
|
||||||
{
|
{
|
||||||
|
@@ -101,3 +101,7 @@ bool wxScreenDC::EndDrawingOnTop()
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wxScreenDC::DoGetSize(int *width, int *height) const
|
||||||
|
{
|
||||||
|
wxDisplaySize(width, height);
|
||||||
|
}
|
||||||
|
@@ -69,12 +69,6 @@ void wxDC::DestroyClippingRegion()
|
|||||||
// get DC capabilities
|
// get DC capabilities
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
void wxDC::DoGetSize( int* width, int* height ) const
|
|
||||||
{
|
|
||||||
if (width) *width = m_maxX-m_minX;
|
|
||||||
if (height) *height = m_maxY-m_minY;
|
|
||||||
}
|
|
||||||
|
|
||||||
void wxDC::DoGetSizeMM( int* width, int* height ) const
|
void wxDC::DoGetSizeMM( int* width, int* height ) const
|
||||||
{
|
{
|
||||||
int w = 0;
|
int w = 0;
|
||||||
|
@@ -393,6 +393,13 @@ void wxWindowDC::SetUpDC()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wxWindowDC::DoGetSize( int* width, int* height ) const
|
||||||
|
{
|
||||||
|
wxCHECK_RET( m_owner, _T("GetSize() doesn't work without window") );
|
||||||
|
|
||||||
|
m_owner->GetSize(width, height);
|
||||||
|
}
|
||||||
|
|
||||||
void wxWindowDC::DoFloodFill( wxCoord WXUNUSED(x), wxCoord WXUNUSED(y),
|
void wxWindowDC::DoFloodFill( wxCoord WXUNUSED(x), wxCoord WXUNUSED(y),
|
||||||
const wxColour &WXUNUSED(col), int WXUNUSED(style) )
|
const wxColour &WXUNUSED(col), int WXUNUSED(style) )
|
||||||
{
|
{
|
||||||
|
@@ -101,3 +101,7 @@ bool wxScreenDC::EndDrawingOnTop()
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wxScreenDC::DoGetSize(int *width, int *height) const
|
||||||
|
{
|
||||||
|
wxDisplaySize(width, height);
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user