New wxDC hierarchy

wxTE_PASWORD


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1092 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
1998-12-01 12:55:09 +00:00
parent 5b6ec9803a
commit ec758a20a2
16 changed files with 752 additions and 608 deletions

View File

@@ -22,24 +22,23 @@
// classes // classes
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
class wxWindowDC;
class wxPaintDC; class wxPaintDC;
typedef wxPaintDC wxClientDC; class wxClientDC;
typedef wxPaintDC wxWindowDC;
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// wxPaintDC // wxWindowDC
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
class wxPaintDC: public wxDC class wxWindowDC: public wxDC
{ {
DECLARE_DYNAMIC_CLASS(wxPaintDC) DECLARE_DYNAMIC_CLASS(wxWindowDC)
public: public:
wxWindowDC(void);
wxWindowDC( wxWindow *win );
wxPaintDC(void); ~wxWindowDC(void);
wxPaintDC( wxWindow *win );
~wxPaintDC(void);
virtual void FloodFill( long x1, long y1, wxColour *col, int style=wxFLOOD_SURFACE ); virtual void FloodFill( long x1, long y1, wxColour *col, int style=wxFLOOD_SURFACE );
virtual bool GetPixel( long x1, long y1, wxColour *col ) const; virtual bool GetPixel( long x1, long y1, wxColour *col ) const;
@@ -91,7 +90,7 @@ class wxPaintDC: public wxDC
virtual void DrawSpline( wxList *points ); virtual void DrawSpline( wxList *points );
public: // shouldn't be public // implementation
GdkWindow *m_window; GdkWindow *m_window;
GdkGC *m_penGC; GdkGC *m_penGC;
@@ -106,4 +105,31 @@ class wxPaintDC: public wxDC
GdkWindow *GetWindow(void); GdkWindow *GetWindow(void);
}; };
//-----------------------------------------------------------------------------
// wxPaintDC
//-----------------------------------------------------------------------------
class wxPaintDC : public wxWindowDC
{
DECLARE_DYNAMIC_CLASS(wxPaintDC)
public:
wxPaintDC(void);
wxPaintDC( wxWindow *win );
};
//-----------------------------------------------------------------------------
// wxClientDC
//-----------------------------------------------------------------------------
class wxClientDC : public wxWindowDC
{
DECLARE_DYNAMIC_CLASS(wxClientDC)
public:
wxClientDC(void);
wxClientDC( wxWindow *win );
};
#endif // __GTKDCCLIENTH__ #endif // __GTKDCCLIENTH__

View File

@@ -28,19 +28,19 @@ class wxMemoryDC;
// wxMemoryDC // wxMemoryDC
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
class wxMemoryDC: public wxPaintDC class wxMemoryDC: public wxWindowDC
{ {
DECLARE_DYNAMIC_CLASS(wxMemoryDC) DECLARE_DYNAMIC_CLASS(wxMemoryDC)
public: public:
wxMemoryDC(void); wxMemoryDC(void);
wxMemoryDC( wxDC *dc ); // Create compatible DC wxMemoryDC( wxDC *dc ); // Create compatible DC
~wxMemoryDC(void); ~wxMemoryDC(void);
virtual void SelectObject( const wxBitmap& bitmap ); virtual void SelectObject( const wxBitmap& bitmap );
void GetSize( int *width, int *height ) const; void GetSize( int *width, int *height ) const;
private: // implementation
friend wxPaintDC;
wxBitmap m_selected; wxBitmap m_selected;
}; };

View File

@@ -26,7 +26,7 @@ class wxScreenDC: public wxPaintDC
{ {
DECLARE_DYNAMIC_CLASS(wxScreenDC) DECLARE_DYNAMIC_CLASS(wxScreenDC)
public: public:
wxScreenDC(void); wxScreenDC(void);
~wxScreenDC(void); ~wxScreenDC(void);

View File

@@ -22,24 +22,23 @@
// classes // classes
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
class wxWindowDC;
class wxPaintDC; class wxPaintDC;
typedef wxPaintDC wxClientDC; class wxClientDC;
typedef wxPaintDC wxWindowDC;
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// wxPaintDC // wxWindowDC
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
class wxPaintDC: public wxDC class wxWindowDC: public wxDC
{ {
DECLARE_DYNAMIC_CLASS(wxPaintDC) DECLARE_DYNAMIC_CLASS(wxWindowDC)
public: public:
wxWindowDC(void);
wxWindowDC( wxWindow *win );
wxPaintDC(void); ~wxWindowDC(void);
wxPaintDC( wxWindow *win );
~wxPaintDC(void);
virtual void FloodFill( long x1, long y1, wxColour *col, int style=wxFLOOD_SURFACE ); virtual void FloodFill( long x1, long y1, wxColour *col, int style=wxFLOOD_SURFACE );
virtual bool GetPixel( long x1, long y1, wxColour *col ) const; virtual bool GetPixel( long x1, long y1, wxColour *col ) const;
@@ -91,7 +90,7 @@ class wxPaintDC: public wxDC
virtual void DrawSpline( wxList *points ); virtual void DrawSpline( wxList *points );
public: // shouldn't be public // implementation
GdkWindow *m_window; GdkWindow *m_window;
GdkGC *m_penGC; GdkGC *m_penGC;
@@ -106,4 +105,31 @@ class wxPaintDC: public wxDC
GdkWindow *GetWindow(void); GdkWindow *GetWindow(void);
}; };
//-----------------------------------------------------------------------------
// wxPaintDC
//-----------------------------------------------------------------------------
class wxPaintDC : public wxWindowDC
{
DECLARE_DYNAMIC_CLASS(wxPaintDC)
public:
wxPaintDC(void);
wxPaintDC( wxWindow *win );
};
//-----------------------------------------------------------------------------
// wxClientDC
//-----------------------------------------------------------------------------
class wxClientDC : public wxWindowDC
{
DECLARE_DYNAMIC_CLASS(wxClientDC)
public:
wxClientDC(void);
wxClientDC( wxWindow *win );
};
#endif // __GTKDCCLIENTH__ #endif // __GTKDCCLIENTH__

View File

@@ -28,19 +28,19 @@ class wxMemoryDC;
// wxMemoryDC // wxMemoryDC
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
class wxMemoryDC: public wxPaintDC class wxMemoryDC: public wxWindowDC
{ {
DECLARE_DYNAMIC_CLASS(wxMemoryDC) DECLARE_DYNAMIC_CLASS(wxMemoryDC)
public: public:
wxMemoryDC(void); wxMemoryDC(void);
wxMemoryDC( wxDC *dc ); // Create compatible DC wxMemoryDC( wxDC *dc ); // Create compatible DC
~wxMemoryDC(void); ~wxMemoryDC(void);
virtual void SelectObject( const wxBitmap& bitmap ); virtual void SelectObject( const wxBitmap& bitmap );
void GetSize( int *width, int *height ) const; void GetSize( int *width, int *height ) const;
private: // implementation
friend wxPaintDC;
wxBitmap m_selected; wxBitmap m_selected;
}; };

View File

@@ -26,7 +26,7 @@ class wxScreenDC: public wxPaintDC
{ {
DECLARE_DYNAMIC_CLASS(wxScreenDC) DECLARE_DYNAMIC_CLASS(wxScreenDC)
public: public:
wxScreenDC(void); wxScreenDC(void);
~wxScreenDC(void); ~wxScreenDC(void);

View File

@@ -21,7 +21,7 @@
class wxAccelRefData: public wxObjectRefData class wxAccelRefData: public wxObjectRefData
{ {
public: public:
wxAccelRefData(void); wxAccelRefData(void);
@@ -46,6 +46,7 @@ wxAcceleratorTable::wxAcceleratorTable()
wxAcceleratorTable::wxAcceleratorTable( int n, wxAcceleratorEntry entries[] ) wxAcceleratorTable::wxAcceleratorTable( int n, wxAcceleratorEntry entries[] )
{ {
m_refData = new wxAccelRefData(); m_refData = new wxAccelRefData();
for (int i = 0; i < n; i++) for (int i = 0; i < n; i++)
{ {
int flag = entries[i].GetFlags(); int flag = entries[i].GetFlags();
@@ -77,7 +78,9 @@ int wxAcceleratorTable::GetCommand( wxKeyEvent &event )
(((entry->GetFlags() & wxACCEL_CTRL) == 0) || event.ControlDown()) && (((entry->GetFlags() & wxACCEL_CTRL) == 0) || event.ControlDown()) &&
(((entry->GetFlags() & wxACCEL_SHIFT) == 0) || event.ShiftDown()) && (((entry->GetFlags() & wxACCEL_SHIFT) == 0) || event.ShiftDown()) &&
(((entry->GetFlags() & wxACCEL_ALT) == 0) || event.AltDown() || event.MetaDown())) (((entry->GetFlags() & wxACCEL_ALT) == 0) || event.AltDown() || event.MetaDown()))
{
return entry->GetCommand(); return entry->GetCommand();
}
node = node->Next(); node = node->Next();
} }

View File

@@ -193,7 +193,7 @@ void wxApp::OnIdle( wxIdleEvent &event )
// flush the logged messages if any // flush the logged messages if any
wxLog *pLog = wxLog::GetActiveTarget(); wxLog *pLog = wxLog::GetActiveTarget();
if ( pLog != NULL && pLog->HasPendingMessages() ) if (pLog != NULL && pLog->HasPendingMessages())
pLog->Flush(); pLog->Flush();
// Send OnIdle events to all windows // Send OnIdle events to all windows
@@ -208,13 +208,13 @@ void wxApp::OnIdle( wxIdleEvent &event )
bool wxApp::SendIdleEvents(void) bool wxApp::SendIdleEvents(void)
{ {
bool needMore = FALSE; bool needMore = FALSE;
wxNode* node = wxTopLevelWindows.First(); wxNode* node = wxTopLevelWindows.First();
while (node) while (node)
{ {
wxWindow* win = (wxWindow*) node->Data(); wxWindow* win = (wxWindow*) node->Data();
if (SendIdleEvents(win)) if (SendIdleEvents(win))
needMore = TRUE; needMore = TRUE;
node = node->Next(); node = node->Next();
} }
return needMore; return needMore;
@@ -450,7 +450,8 @@ int wxEntry( int argc, char *argv[] )
wxApp::CommonCleanUp(); wxApp::CommonCleanUp();
wxDELETE(wxTheApp); delete wxTheApp;
wxTheApp = (wxApp*) NULL;
wxClassInfo::CleanUpClasses(); wxClassInfo::CleanUpClasses();
@@ -471,7 +472,6 @@ int wxEntry( int argc, char *argv[] )
wxLog *oldLog = wxLog::SetActiveTarget( NULL ); wxLog *oldLog = wxLog::SetActiveTarget( NULL );
if (oldLog) delete oldLog; if (oldLog) delete oldLog;
return retValue; return retValue;
} }

View File

@@ -79,12 +79,12 @@ void gdk_draw_bitmap (GdkDrawable *drawable,
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// wxPaintDC // wxWindowDC
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
IMPLEMENT_DYNAMIC_CLASS(wxPaintDC,wxDC) IMPLEMENT_DYNAMIC_CLASS(wxWindowDC,wxDC)
wxPaintDC::wxPaintDC(void) wxWindowDC::wxWindowDC(void)
{ {
m_penGC = (GdkGC *) NULL; m_penGC = (GdkGC *) NULL;
m_brushGC = (GdkGC *) NULL; m_brushGC = (GdkGC *) NULL;
@@ -94,7 +94,7 @@ wxPaintDC::wxPaintDC(void)
m_isMemDC = FALSE; m_isMemDC = FALSE;
} }
wxPaintDC::wxPaintDC( wxWindow *window ) wxWindowDC::wxWindowDC( wxWindow *window )
{ {
m_penGC = (GdkGC *) NULL; m_penGC = (GdkGC *) NULL;
m_brushGC = (GdkGC *) NULL; m_brushGC = (GdkGC *) NULL;
@@ -125,24 +125,24 @@ wxPaintDC::wxPaintDC( wxWindow *window )
gdk_gc_set_clip_region( m_bgGC, update.GetRegion() ); gdk_gc_set_clip_region( m_bgGC, update.GetRegion() );
} }
wxPaintDC::~wxPaintDC(void) wxWindowDC::~wxWindowDC(void)
{ {
Destroy(); Destroy();
} }
void wxPaintDC::FloodFill( long WXUNUSED(x1), long WXUNUSED(y1), void wxWindowDC::FloodFill( long WXUNUSED(x1), long WXUNUSED(y1),
wxColour *WXUNUSED(col), int WXUNUSED(style) ) wxColour *WXUNUSED(col), int WXUNUSED(style) )
{ {
wxFAIL_MSG( "wxPaintDC::FloodFill not implemented" ); wxFAIL_MSG( "wxWindowDC::FloodFill not implemented" );
} }
bool wxPaintDC::GetPixel( long WXUNUSED(x1), long WXUNUSED(y1), wxColour *WXUNUSED(col) ) const bool wxWindowDC::GetPixel( long WXUNUSED(x1), long WXUNUSED(y1), wxColour *WXUNUSED(col) ) const
{ {
wxFAIL_MSG( "wxPaintDC::GetPixel not implemented" ); wxFAIL_MSG( "wxWindowDC::GetPixel not implemented" );
return FALSE; return FALSE;
} }
void wxPaintDC::DrawLine( long x1, long y1, long x2, long y2 ) void wxWindowDC::DrawLine( long x1, long y1, long x2, long y2 )
{ {
if (!Ok()) return; if (!Ok()) return;
@@ -156,7 +156,7 @@ void wxPaintDC::DrawLine( long x1, long y1, long x2, long y2 )
CalcBoundingBox(x2, y2); CalcBoundingBox(x2, y2);
} }
void wxPaintDC::CrossHair( long x, long y ) void wxWindowDC::CrossHair( long x, long y )
{ {
if (!Ok()) return; if (!Ok()) return;
@@ -172,7 +172,7 @@ void wxPaintDC::CrossHair( long x, long y )
} }
} }
void wxPaintDC::DrawArc( long x1, long y1, long x2, long y2, double xc, double yc ) void wxWindowDC::DrawArc( long x1, long y1, long x2, long y2, double xc, double yc )
{ {
if (!Ok()) return; if (!Ok()) return;
@@ -222,7 +222,7 @@ void wxPaintDC::DrawArc( long x1, long y1, long x2, long y2, double xc, double y
CalcBoundingBox (x2, y2); CalcBoundingBox (x2, y2);
} }
void wxPaintDC::DrawEllipticArc( long x, long y, long width, long height, double sa, double ea ) void wxWindowDC::DrawEllipticArc( long x, long y, long width, long height, double sa, double ea )
{ {
if (!Ok()) return; if (!Ok()) return;
@@ -247,7 +247,7 @@ void wxPaintDC::DrawEllipticArc( long x, long y, long width, long height, double
CalcBoundingBox (x + width, y + height); CalcBoundingBox (x + width, y + height);
} }
void wxPaintDC::DrawPoint( long x, long y ) void wxWindowDC::DrawPoint( long x, long y )
{ {
if (!Ok()) return; if (!Ok()) return;
@@ -257,7 +257,7 @@ void wxPaintDC::DrawPoint( long x, long y )
CalcBoundingBox (x, y); CalcBoundingBox (x, y);
} }
void wxPaintDC::DrawLines( int n, wxPoint points[], long xoffset, long yoffset ) void wxWindowDC::DrawLines( int n, wxPoint points[], long xoffset, long yoffset )
{ {
if (!Ok()) return; if (!Ok()) return;
@@ -278,7 +278,7 @@ void wxPaintDC::DrawLines( int n, wxPoint points[], long xoffset, long yoffset )
} }
} }
void wxPaintDC::DrawLines( wxList *points, long xoffset, long yoffset ) void wxWindowDC::DrawLines( wxList *points, long xoffset, long yoffset )
{ {
if (!Ok()) return; if (!Ok()) return;
@@ -305,7 +305,7 @@ void wxPaintDC::DrawLines( wxList *points, long xoffset, long yoffset )
} }
} }
void wxPaintDC::DrawPolygon( int n, wxPoint points[], long xoffset, long yoffset, int WXUNUSED(fillStyle) ) void wxWindowDC::DrawPolygon( int n, wxPoint points[], long xoffset, long yoffset, int WXUNUSED(fillStyle) )
{ {
if (!Ok()) return; if (!Ok()) return;
@@ -339,7 +339,7 @@ void wxPaintDC::DrawPolygon( int n, wxPoint points[], long xoffset, long yoffset
delete[] gdkpoints; delete[] gdkpoints;
} }
void wxPaintDC::DrawPolygon( wxList *lines, long xoffset, long yoffset, int WXUNUSED(fillStyle)) void wxWindowDC::DrawPolygon( wxList *lines, long xoffset, long yoffset, int WXUNUSED(fillStyle))
{ {
if (!Ok()) return; if (!Ok()) return;
@@ -380,7 +380,7 @@ void wxPaintDC::DrawPolygon( wxList *lines, long xoffset, long yoffset, int WXUN
delete[] gdkpoints; delete[] gdkpoints;
} }
void wxPaintDC::DrawRectangle( long x, long y, long width, long height ) void wxWindowDC::DrawRectangle( long x, long y, long width, long height )
{ {
if (!Ok()) return; if (!Ok()) return;
@@ -406,7 +406,7 @@ void wxPaintDC::DrawRectangle( long x, long y, long width, long height )
CalcBoundingBox( x + width, y + height ); CalcBoundingBox( x + width, y + height );
} }
void wxPaintDC::DrawRoundedRectangle( long x, long y, long width, long height, double radius ) void wxWindowDC::DrawRoundedRectangle( long x, long y, long width, long height, double radius )
{ {
if (!Ok()) return; if (!Ok()) return;
@@ -475,7 +475,7 @@ void wxPaintDC::DrawRoundedRectangle( long x, long y, long width, long height, d
CalcBoundingBox( x + width, y + height ); CalcBoundingBox( x + width, y + height );
} }
void wxPaintDC::DrawEllipse( long x, long y, long width, long height ) void wxWindowDC::DrawEllipse( long x, long y, long width, long height )
{ {
if (!Ok()) return; if (!Ok()) return;
@@ -498,12 +498,12 @@ void wxPaintDC::DrawEllipse( long x, long y, long width, long height )
CalcBoundingBox( x + width, y + height ); CalcBoundingBox( x + width, y + height );
} }
bool wxPaintDC::CanDrawBitmap(void) const bool wxWindowDC::CanDrawBitmap(void) const
{ {
return TRUE; return TRUE;
} }
void wxPaintDC::DrawIcon( const wxIcon &icon, long x, long y, bool useMask ) void wxWindowDC::DrawIcon( const wxIcon &icon, long x, long y, bool useMask )
{ {
if (!Ok()) return; if (!Ok()) return;
@@ -536,7 +536,7 @@ void wxPaintDC::DrawIcon( const wxIcon &icon, long x, long y, bool useMask )
CalcBoundingBox( x + width, y + height ); CalcBoundingBox( x + width, y + height );
} }
bool wxPaintDC::Blit( long xdest, long ydest, long width, long height, bool wxWindowDC::Blit( long xdest, long ydest, long width, long height,
wxDC *source, long xsrc, long ysrc, int WXUNUSED(logical_func), bool useMask ) wxDC *source, long xsrc, long ysrc, int WXUNUSED(logical_func), bool useMask )
{ {
if (!Ok()) return FALSE; if (!Ok()) return FALSE;
@@ -633,7 +633,7 @@ bool wxPaintDC::Blit( long xdest, long ydest, long width, long height,
return TRUE; return TRUE;
} }
void wxPaintDC::DrawText( const wxString &text, long x, long y, bool WXUNUSED(use16) ) void wxWindowDC::DrawText( const wxString &text, long x, long y, bool WXUNUSED(use16) )
{ {
if (!Ok()) return; if (!Ok()) return;
@@ -670,12 +670,12 @@ void wxPaintDC::DrawText( const wxString &text, long x, long y, bool WXUNUSED(us
CalcBoundingBox (x, y); CalcBoundingBox (x, y);
} }
bool wxPaintDC::CanGetTextExtent(void) const bool wxWindowDC::CanGetTextExtent(void) const
{ {
return TRUE; return TRUE;
} }
void wxPaintDC::GetTextExtent( const wxString &string, long *width, long *height, void wxWindowDC::GetTextExtent( const wxString &string, long *width, long *height,
long *descent, long *externalLeading, long *descent, long *externalLeading,
wxFont *theFont, bool WXUNUSED(use16) ) wxFont *theFont, bool WXUNUSED(use16) )
{ {
@@ -691,7 +691,7 @@ void wxPaintDC::GetTextExtent( const wxString &string, long *width, long *height
if (externalLeading) (*externalLeading) = 0; // ?? if (externalLeading) (*externalLeading) = 0; // ??
} }
long wxPaintDC::GetCharWidth(void) long wxWindowDC::GetCharWidth(void)
{ {
if (!Ok()) return 0; if (!Ok()) return 0;
@@ -699,7 +699,7 @@ long wxPaintDC::GetCharWidth(void)
return long(gdk_string_width( font, "H" ) / m_scaleX); return long(gdk_string_width( font, "H" ) / m_scaleX);
} }
long wxPaintDC::GetCharHeight(void) long wxWindowDC::GetCharHeight(void)
{ {
if (!Ok()) return 0; if (!Ok()) return 0;
@@ -707,7 +707,7 @@ long wxPaintDC::GetCharHeight(void)
return long((font->ascent + font->descent) / m_scaleY); return long((font->ascent + font->descent) / m_scaleY);
} }
void wxPaintDC::Clear(void) void wxWindowDC::Clear(void)
{ {
if (!Ok()) return; if (!Ok()) return;
@@ -723,14 +723,14 @@ void wxPaintDC::Clear(void)
} }
} }
void wxPaintDC::SetFont( const wxFont &font ) void wxWindowDC::SetFont( const wxFont &font )
{ {
if (!Ok()) return; if (!Ok()) return;
m_font = font; m_font = font;
} }
void wxPaintDC::SetPen( const wxPen &pen ) void wxWindowDC::SetPen( const wxPen &pen )
{ {
if (!Ok()) return; if (!Ok()) return;
@@ -786,7 +786,7 @@ void wxPaintDC::SetPen( const wxPen &pen )
gdk_gc_set_foreground( m_penGC, m_pen.GetColour().GetColor() ); gdk_gc_set_foreground( m_penGC, m_pen.GetColour().GetColor() );
} }
void wxPaintDC::SetBrush( const wxBrush &brush ) void wxWindowDC::SetBrush( const wxBrush &brush )
{ {
if (!Ok()) return; if (!Ok()) return;
@@ -825,7 +825,7 @@ void wxPaintDC::SetBrush( const wxBrush &brush )
// CMB 21/7/98: Added SetBackground. Sets background brush // CMB 21/7/98: Added SetBackground. Sets background brush
// for Clear() and bg colour for shapes filled with cross-hatch brush // for Clear() and bg colour for shapes filled with cross-hatch brush
void wxPaintDC::SetBackground( const wxBrush &brush ) void wxWindowDC::SetBackground( const wxBrush &brush )
{ {
if (!Ok()) return; if (!Ok()) return;
@@ -865,7 +865,7 @@ void wxPaintDC::SetBackground( const wxBrush &brush )
} }
} }
void wxPaintDC::SetLogicalFunction( int function ) void wxWindowDC::SetLogicalFunction( int function )
{ {
if (m_logicalFunction == function) return; if (m_logicalFunction == function) return;
GdkFunction mode = GDK_COPY; GdkFunction mode = GDK_COPY;
@@ -881,7 +881,7 @@ void wxPaintDC::SetLogicalFunction( int function )
gdk_gc_set_function( m_textGC, mode ); gdk_gc_set_function( m_textGC, mode );
} }
void wxPaintDC::SetTextForeground( const wxColour &col ) void wxWindowDC::SetTextForeground( const wxColour &col )
{ {
if (!Ok()) return; if (!Ok()) return;
@@ -894,7 +894,7 @@ void wxPaintDC::SetTextForeground( const wxColour &col )
gdk_gc_set_foreground( m_textGC, m_textForegroundColour.GetColor() ); gdk_gc_set_foreground( m_textGC, m_textForegroundColour.GetColor() );
} }
void wxPaintDC::SetTextBackground( const wxColour &col ) void wxWindowDC::SetTextBackground( const wxColour &col )
{ {
if (!Ok()) return; if (!Ok()) return;
@@ -907,7 +907,7 @@ void wxPaintDC::SetTextBackground( const wxColour &col )
gdk_gc_set_background( m_textGC, m_textBackgroundColour.GetColor() ); gdk_gc_set_background( m_textGC, m_textBackgroundColour.GetColor() );
} }
void wxPaintDC::SetBackgroundMode( int mode ) void wxWindowDC::SetBackgroundMode( int mode )
{ {
m_backgroundMode = mode; m_backgroundMode = mode;
@@ -920,11 +920,11 @@ void wxPaintDC::SetBackgroundMode( int mode )
} }
} }
void wxPaintDC::SetPalette( const wxPalette& WXUNUSED(palette) ) void wxWindowDC::SetPalette( const wxPalette& WXUNUSED(palette) )
{ {
} }
void wxPaintDC::SetClippingRegion( long x, long y, long width, long height ) void wxWindowDC::SetClippingRegion( long x, long y, long width, long height )
{ {
wxDC::SetClippingRegion( x, y, width, height ); wxDC::SetClippingRegion( x, y, width, height );
@@ -939,7 +939,7 @@ void wxPaintDC::SetClippingRegion( long x, long y, long width, long height )
gdk_gc_set_clip_rectangle( m_bgGC, &rect ); gdk_gc_set_clip_rectangle( m_bgGC, &rect );
} }
void wxPaintDC::DestroyClippingRegion(void) void wxWindowDC::DestroyClippingRegion(void)
{ {
wxDC::DestroyClippingRegion(); wxDC::DestroyClippingRegion();
@@ -949,7 +949,7 @@ void wxPaintDC::DestroyClippingRegion(void)
gdk_gc_set_clip_rectangle( m_bgGC, (GdkRectangle *) NULL ); gdk_gc_set_clip_rectangle( m_bgGC, (GdkRectangle *) NULL );
} }
void wxPaintDC::SetUpDC(void) void wxWindowDC::SetUpDC(void)
{ {
Destroy(); Destroy();
m_ok = TRUE; m_ok = TRUE;
@@ -994,7 +994,7 @@ void wxPaintDC::SetUpDC(void)
} }
} }
void wxPaintDC::Destroy(void) void wxWindowDC::Destroy(void)
{ {
if (m_penGC) gdk_gc_unref( m_penGC ); if (m_penGC) gdk_gc_unref( m_penGC );
m_penGC = (GdkGC*) NULL; m_penGC = (GdkGC*) NULL;
@@ -1006,7 +1006,7 @@ void wxPaintDC::Destroy(void)
m_bgGC = (GdkGC*) NULL; m_bgGC = (GdkGC*) NULL;
} }
GdkWindow *wxPaintDC::GetWindow(void) GdkWindow *wxWindowDC::GetWindow(void)
{ {
return m_window; return m_window;
} }
@@ -1126,7 +1126,7 @@ static void wx_spline_draw_point_array(wxDC *dc)
} }
} }
void wxPaintDC::DrawSpline( wxList *points ) void wxWindowDC::DrawSpline( wxList *points )
{ {
wxPoint *p; wxPoint *p;
double cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4; double cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4;
@@ -1175,3 +1175,37 @@ void wxPaintDC::DrawSpline( wxList *points )
wx_spline_draw_point_array( this ); wx_spline_draw_point_array( this );
} }
//-----------------------------------------------------------------------------
// wxPaintDC
//-----------------------------------------------------------------------------
IMPLEMENT_DYNAMIC_CLASS(wxPaintDC,wxWindowDC)
wxPaintDC::wxPaintDC(void)
: wxWindowDC()
{
}
wxPaintDC::wxPaintDC( wxWindow *win )
: wxWindowDC( win )
{
}
//-----------------------------------------------------------------------------
// wxClientDC
//-----------------------------------------------------------------------------
IMPLEMENT_DYNAMIC_CLASS(wxClientDC,wxWindowDC)
wxClientDC::wxClientDC(void)
: wxWindowDC()
{
}
wxClientDC::wxClientDC( wxWindow *win )
: wxWindowDC( win )
{
}

View File

@@ -17,16 +17,17 @@
// wxMemoryDC // wxMemoryDC
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
IMPLEMENT_DYNAMIC_CLASS(wxMemoryDC,wxPaintDC) IMPLEMENT_DYNAMIC_CLASS(wxMemoryDC,wxWindowDC)
wxMemoryDC::wxMemoryDC(void) : wxPaintDC() wxMemoryDC::wxMemoryDC(void) : wxWindowDC()
{ {
m_ok = FALSE; m_ok = FALSE;
m_cmap = gtk_widget_get_default_colormap(); m_cmap = gtk_widget_get_default_colormap();
} }
wxMemoryDC::wxMemoryDC( wxDC *WXUNUSED(dc) ) : wxPaintDC() wxMemoryDC::wxMemoryDC( wxDC *WXUNUSED(dc) )
: wxWindowDC()
{ {
m_ok = FALSE; m_ok = FALSE;

View File

@@ -71,8 +71,8 @@ bool wxTextCtrl::Create( wxWindow *parent, wxWindowID id, const wxString &value,
SetValidator( validator ); SetValidator( validator );
bool bMultiLine = (style & wxTE_MULTILINE) != 0; bool multi_line = (style & wxTE_MULTILINE) != 0;
if ( bMultiLine ) if ( multi_line )
{ {
// a multi-line edit control: create a vertical scrollbar by default and // a multi-line edit control: create a vertical scrollbar by default and
// horizontal if requested // horizontal if requested
@@ -125,7 +125,7 @@ bool wxTextCtrl::Create( wxWindow *parent, wxWindowID id, const wxString &value,
PostCreation(); PostCreation();
if (bMultiLine) if (multi_line)
{ {
gtk_widget_realize(m_text); gtk_widget_realize(m_text);
gtk_widget_show(m_text); gtk_widget_show(m_text);
@@ -143,12 +143,20 @@ bool wxTextCtrl::Create( wxWindow *parent, wxWindowID id, const wxString &value,
SetInsertionPointEnd(); SetInsertionPointEnd();
} }
if (style & wxTE_PASSWORD)
{
if (!multi_line)
gtk_entry_set_visibility( GTK_ENTRY(m_text), FALSE );
}
if (style & wxTE_READONLY) if (style & wxTE_READONLY)
{ {
if (!multi_line)
gtk_entry_set_editable( GTK_ENTRY(m_text), FALSE );
} }
else else
{ {
if (bMultiLine) if (multi_line)
gtk_text_set_editable( GTK_TEXT(m_text), 1 ); gtk_text_set_editable( GTK_TEXT(m_text), 1 );
} }

View File

@@ -21,7 +21,7 @@
class wxAccelRefData: public wxObjectRefData class wxAccelRefData: public wxObjectRefData
{ {
public: public:
wxAccelRefData(void); wxAccelRefData(void);
@@ -46,6 +46,7 @@ wxAcceleratorTable::wxAcceleratorTable()
wxAcceleratorTable::wxAcceleratorTable( int n, wxAcceleratorEntry entries[] ) wxAcceleratorTable::wxAcceleratorTable( int n, wxAcceleratorEntry entries[] )
{ {
m_refData = new wxAccelRefData(); m_refData = new wxAccelRefData();
for (int i = 0; i < n; i++) for (int i = 0; i < n; i++)
{ {
int flag = entries[i].GetFlags(); int flag = entries[i].GetFlags();
@@ -77,7 +78,9 @@ int wxAcceleratorTable::GetCommand( wxKeyEvent &event )
(((entry->GetFlags() & wxACCEL_CTRL) == 0) || event.ControlDown()) && (((entry->GetFlags() & wxACCEL_CTRL) == 0) || event.ControlDown()) &&
(((entry->GetFlags() & wxACCEL_SHIFT) == 0) || event.ShiftDown()) && (((entry->GetFlags() & wxACCEL_SHIFT) == 0) || event.ShiftDown()) &&
(((entry->GetFlags() & wxACCEL_ALT) == 0) || event.AltDown() || event.MetaDown())) (((entry->GetFlags() & wxACCEL_ALT) == 0) || event.AltDown() || event.MetaDown()))
{
return entry->GetCommand(); return entry->GetCommand();
}
node = node->Next(); node = node->Next();
} }

View File

@@ -193,7 +193,7 @@ void wxApp::OnIdle( wxIdleEvent &event )
// flush the logged messages if any // flush the logged messages if any
wxLog *pLog = wxLog::GetActiveTarget(); wxLog *pLog = wxLog::GetActiveTarget();
if ( pLog != NULL && pLog->HasPendingMessages() ) if (pLog != NULL && pLog->HasPendingMessages())
pLog->Flush(); pLog->Flush();
// Send OnIdle events to all windows // Send OnIdle events to all windows
@@ -208,13 +208,13 @@ void wxApp::OnIdle( wxIdleEvent &event )
bool wxApp::SendIdleEvents(void) bool wxApp::SendIdleEvents(void)
{ {
bool needMore = FALSE; bool needMore = FALSE;
wxNode* node = wxTopLevelWindows.First(); wxNode* node = wxTopLevelWindows.First();
while (node) while (node)
{ {
wxWindow* win = (wxWindow*) node->Data(); wxWindow* win = (wxWindow*) node->Data();
if (SendIdleEvents(win)) if (SendIdleEvents(win))
needMore = TRUE; needMore = TRUE;
node = node->Next(); node = node->Next();
} }
return needMore; return needMore;
@@ -450,7 +450,8 @@ int wxEntry( int argc, char *argv[] )
wxApp::CommonCleanUp(); wxApp::CommonCleanUp();
wxDELETE(wxTheApp); delete wxTheApp;
wxTheApp = (wxApp*) NULL;
wxClassInfo::CleanUpClasses(); wxClassInfo::CleanUpClasses();
@@ -471,7 +472,6 @@ int wxEntry( int argc, char *argv[] )
wxLog *oldLog = wxLog::SetActiveTarget( NULL ); wxLog *oldLog = wxLog::SetActiveTarget( NULL );
if (oldLog) delete oldLog; if (oldLog) delete oldLog;
return retValue; return retValue;
} }

View File

@@ -79,12 +79,12 @@ void gdk_draw_bitmap (GdkDrawable *drawable,
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// wxPaintDC // wxWindowDC
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
IMPLEMENT_DYNAMIC_CLASS(wxPaintDC,wxDC) IMPLEMENT_DYNAMIC_CLASS(wxWindowDC,wxDC)
wxPaintDC::wxPaintDC(void) wxWindowDC::wxWindowDC(void)
{ {
m_penGC = (GdkGC *) NULL; m_penGC = (GdkGC *) NULL;
m_brushGC = (GdkGC *) NULL; m_brushGC = (GdkGC *) NULL;
@@ -94,7 +94,7 @@ wxPaintDC::wxPaintDC(void)
m_isMemDC = FALSE; m_isMemDC = FALSE;
} }
wxPaintDC::wxPaintDC( wxWindow *window ) wxWindowDC::wxWindowDC( wxWindow *window )
{ {
m_penGC = (GdkGC *) NULL; m_penGC = (GdkGC *) NULL;
m_brushGC = (GdkGC *) NULL; m_brushGC = (GdkGC *) NULL;
@@ -125,24 +125,24 @@ wxPaintDC::wxPaintDC( wxWindow *window )
gdk_gc_set_clip_region( m_bgGC, update.GetRegion() ); gdk_gc_set_clip_region( m_bgGC, update.GetRegion() );
} }
wxPaintDC::~wxPaintDC(void) wxWindowDC::~wxWindowDC(void)
{ {
Destroy(); Destroy();
} }
void wxPaintDC::FloodFill( long WXUNUSED(x1), long WXUNUSED(y1), void wxWindowDC::FloodFill( long WXUNUSED(x1), long WXUNUSED(y1),
wxColour *WXUNUSED(col), int WXUNUSED(style) ) wxColour *WXUNUSED(col), int WXUNUSED(style) )
{ {
wxFAIL_MSG( "wxPaintDC::FloodFill not implemented" ); wxFAIL_MSG( "wxWindowDC::FloodFill not implemented" );
} }
bool wxPaintDC::GetPixel( long WXUNUSED(x1), long WXUNUSED(y1), wxColour *WXUNUSED(col) ) const bool wxWindowDC::GetPixel( long WXUNUSED(x1), long WXUNUSED(y1), wxColour *WXUNUSED(col) ) const
{ {
wxFAIL_MSG( "wxPaintDC::GetPixel not implemented" ); wxFAIL_MSG( "wxWindowDC::GetPixel not implemented" );
return FALSE; return FALSE;
} }
void wxPaintDC::DrawLine( long x1, long y1, long x2, long y2 ) void wxWindowDC::DrawLine( long x1, long y1, long x2, long y2 )
{ {
if (!Ok()) return; if (!Ok()) return;
@@ -156,7 +156,7 @@ void wxPaintDC::DrawLine( long x1, long y1, long x2, long y2 )
CalcBoundingBox(x2, y2); CalcBoundingBox(x2, y2);
} }
void wxPaintDC::CrossHair( long x, long y ) void wxWindowDC::CrossHair( long x, long y )
{ {
if (!Ok()) return; if (!Ok()) return;
@@ -172,7 +172,7 @@ void wxPaintDC::CrossHair( long x, long y )
} }
} }
void wxPaintDC::DrawArc( long x1, long y1, long x2, long y2, double xc, double yc ) void wxWindowDC::DrawArc( long x1, long y1, long x2, long y2, double xc, double yc )
{ {
if (!Ok()) return; if (!Ok()) return;
@@ -222,7 +222,7 @@ void wxPaintDC::DrawArc( long x1, long y1, long x2, long y2, double xc, double y
CalcBoundingBox (x2, y2); CalcBoundingBox (x2, y2);
} }
void wxPaintDC::DrawEllipticArc( long x, long y, long width, long height, double sa, double ea ) void wxWindowDC::DrawEllipticArc( long x, long y, long width, long height, double sa, double ea )
{ {
if (!Ok()) return; if (!Ok()) return;
@@ -247,7 +247,7 @@ void wxPaintDC::DrawEllipticArc( long x, long y, long width, long height, double
CalcBoundingBox (x + width, y + height); CalcBoundingBox (x + width, y + height);
} }
void wxPaintDC::DrawPoint( long x, long y ) void wxWindowDC::DrawPoint( long x, long y )
{ {
if (!Ok()) return; if (!Ok()) return;
@@ -257,7 +257,7 @@ void wxPaintDC::DrawPoint( long x, long y )
CalcBoundingBox (x, y); CalcBoundingBox (x, y);
} }
void wxPaintDC::DrawLines( int n, wxPoint points[], long xoffset, long yoffset ) void wxWindowDC::DrawLines( int n, wxPoint points[], long xoffset, long yoffset )
{ {
if (!Ok()) return; if (!Ok()) return;
@@ -278,7 +278,7 @@ void wxPaintDC::DrawLines( int n, wxPoint points[], long xoffset, long yoffset )
} }
} }
void wxPaintDC::DrawLines( wxList *points, long xoffset, long yoffset ) void wxWindowDC::DrawLines( wxList *points, long xoffset, long yoffset )
{ {
if (!Ok()) return; if (!Ok()) return;
@@ -305,7 +305,7 @@ void wxPaintDC::DrawLines( wxList *points, long xoffset, long yoffset )
} }
} }
void wxPaintDC::DrawPolygon( int n, wxPoint points[], long xoffset, long yoffset, int WXUNUSED(fillStyle) ) void wxWindowDC::DrawPolygon( int n, wxPoint points[], long xoffset, long yoffset, int WXUNUSED(fillStyle) )
{ {
if (!Ok()) return; if (!Ok()) return;
@@ -339,7 +339,7 @@ void wxPaintDC::DrawPolygon( int n, wxPoint points[], long xoffset, long yoffset
delete[] gdkpoints; delete[] gdkpoints;
} }
void wxPaintDC::DrawPolygon( wxList *lines, long xoffset, long yoffset, int WXUNUSED(fillStyle)) void wxWindowDC::DrawPolygon( wxList *lines, long xoffset, long yoffset, int WXUNUSED(fillStyle))
{ {
if (!Ok()) return; if (!Ok()) return;
@@ -380,7 +380,7 @@ void wxPaintDC::DrawPolygon( wxList *lines, long xoffset, long yoffset, int WXUN
delete[] gdkpoints; delete[] gdkpoints;
} }
void wxPaintDC::DrawRectangle( long x, long y, long width, long height ) void wxWindowDC::DrawRectangle( long x, long y, long width, long height )
{ {
if (!Ok()) return; if (!Ok()) return;
@@ -406,7 +406,7 @@ void wxPaintDC::DrawRectangle( long x, long y, long width, long height )
CalcBoundingBox( x + width, y + height ); CalcBoundingBox( x + width, y + height );
} }
void wxPaintDC::DrawRoundedRectangle( long x, long y, long width, long height, double radius ) void wxWindowDC::DrawRoundedRectangle( long x, long y, long width, long height, double radius )
{ {
if (!Ok()) return; if (!Ok()) return;
@@ -475,7 +475,7 @@ void wxPaintDC::DrawRoundedRectangle( long x, long y, long width, long height, d
CalcBoundingBox( x + width, y + height ); CalcBoundingBox( x + width, y + height );
} }
void wxPaintDC::DrawEllipse( long x, long y, long width, long height ) void wxWindowDC::DrawEllipse( long x, long y, long width, long height )
{ {
if (!Ok()) return; if (!Ok()) return;
@@ -498,12 +498,12 @@ void wxPaintDC::DrawEllipse( long x, long y, long width, long height )
CalcBoundingBox( x + width, y + height ); CalcBoundingBox( x + width, y + height );
} }
bool wxPaintDC::CanDrawBitmap(void) const bool wxWindowDC::CanDrawBitmap(void) const
{ {
return TRUE; return TRUE;
} }
void wxPaintDC::DrawIcon( const wxIcon &icon, long x, long y, bool useMask ) void wxWindowDC::DrawIcon( const wxIcon &icon, long x, long y, bool useMask )
{ {
if (!Ok()) return; if (!Ok()) return;
@@ -536,7 +536,7 @@ void wxPaintDC::DrawIcon( const wxIcon &icon, long x, long y, bool useMask )
CalcBoundingBox( x + width, y + height ); CalcBoundingBox( x + width, y + height );
} }
bool wxPaintDC::Blit( long xdest, long ydest, long width, long height, bool wxWindowDC::Blit( long xdest, long ydest, long width, long height,
wxDC *source, long xsrc, long ysrc, int WXUNUSED(logical_func), bool useMask ) wxDC *source, long xsrc, long ysrc, int WXUNUSED(logical_func), bool useMask )
{ {
if (!Ok()) return FALSE; if (!Ok()) return FALSE;
@@ -633,7 +633,7 @@ bool wxPaintDC::Blit( long xdest, long ydest, long width, long height,
return TRUE; return TRUE;
} }
void wxPaintDC::DrawText( const wxString &text, long x, long y, bool WXUNUSED(use16) ) void wxWindowDC::DrawText( const wxString &text, long x, long y, bool WXUNUSED(use16) )
{ {
if (!Ok()) return; if (!Ok()) return;
@@ -670,12 +670,12 @@ void wxPaintDC::DrawText( const wxString &text, long x, long y, bool WXUNUSED(us
CalcBoundingBox (x, y); CalcBoundingBox (x, y);
} }
bool wxPaintDC::CanGetTextExtent(void) const bool wxWindowDC::CanGetTextExtent(void) const
{ {
return TRUE; return TRUE;
} }
void wxPaintDC::GetTextExtent( const wxString &string, long *width, long *height, void wxWindowDC::GetTextExtent( const wxString &string, long *width, long *height,
long *descent, long *externalLeading, long *descent, long *externalLeading,
wxFont *theFont, bool WXUNUSED(use16) ) wxFont *theFont, bool WXUNUSED(use16) )
{ {
@@ -691,7 +691,7 @@ void wxPaintDC::GetTextExtent( const wxString &string, long *width, long *height
if (externalLeading) (*externalLeading) = 0; // ?? if (externalLeading) (*externalLeading) = 0; // ??
} }
long wxPaintDC::GetCharWidth(void) long wxWindowDC::GetCharWidth(void)
{ {
if (!Ok()) return 0; if (!Ok()) return 0;
@@ -699,7 +699,7 @@ long wxPaintDC::GetCharWidth(void)
return long(gdk_string_width( font, "H" ) / m_scaleX); return long(gdk_string_width( font, "H" ) / m_scaleX);
} }
long wxPaintDC::GetCharHeight(void) long wxWindowDC::GetCharHeight(void)
{ {
if (!Ok()) return 0; if (!Ok()) return 0;
@@ -707,7 +707,7 @@ long wxPaintDC::GetCharHeight(void)
return long((font->ascent + font->descent) / m_scaleY); return long((font->ascent + font->descent) / m_scaleY);
} }
void wxPaintDC::Clear(void) void wxWindowDC::Clear(void)
{ {
if (!Ok()) return; if (!Ok()) return;
@@ -723,14 +723,14 @@ void wxPaintDC::Clear(void)
} }
} }
void wxPaintDC::SetFont( const wxFont &font ) void wxWindowDC::SetFont( const wxFont &font )
{ {
if (!Ok()) return; if (!Ok()) return;
m_font = font; m_font = font;
} }
void wxPaintDC::SetPen( const wxPen &pen ) void wxWindowDC::SetPen( const wxPen &pen )
{ {
if (!Ok()) return; if (!Ok()) return;
@@ -786,7 +786,7 @@ void wxPaintDC::SetPen( const wxPen &pen )
gdk_gc_set_foreground( m_penGC, m_pen.GetColour().GetColor() ); gdk_gc_set_foreground( m_penGC, m_pen.GetColour().GetColor() );
} }
void wxPaintDC::SetBrush( const wxBrush &brush ) void wxWindowDC::SetBrush( const wxBrush &brush )
{ {
if (!Ok()) return; if (!Ok()) return;
@@ -825,7 +825,7 @@ void wxPaintDC::SetBrush( const wxBrush &brush )
// CMB 21/7/98: Added SetBackground. Sets background brush // CMB 21/7/98: Added SetBackground. Sets background brush
// for Clear() and bg colour for shapes filled with cross-hatch brush // for Clear() and bg colour for shapes filled with cross-hatch brush
void wxPaintDC::SetBackground( const wxBrush &brush ) void wxWindowDC::SetBackground( const wxBrush &brush )
{ {
if (!Ok()) return; if (!Ok()) return;
@@ -865,7 +865,7 @@ void wxPaintDC::SetBackground( const wxBrush &brush )
} }
} }
void wxPaintDC::SetLogicalFunction( int function ) void wxWindowDC::SetLogicalFunction( int function )
{ {
if (m_logicalFunction == function) return; if (m_logicalFunction == function) return;
GdkFunction mode = GDK_COPY; GdkFunction mode = GDK_COPY;
@@ -881,7 +881,7 @@ void wxPaintDC::SetLogicalFunction( int function )
gdk_gc_set_function( m_textGC, mode ); gdk_gc_set_function( m_textGC, mode );
} }
void wxPaintDC::SetTextForeground( const wxColour &col ) void wxWindowDC::SetTextForeground( const wxColour &col )
{ {
if (!Ok()) return; if (!Ok()) return;
@@ -894,7 +894,7 @@ void wxPaintDC::SetTextForeground( const wxColour &col )
gdk_gc_set_foreground( m_textGC, m_textForegroundColour.GetColor() ); gdk_gc_set_foreground( m_textGC, m_textForegroundColour.GetColor() );
} }
void wxPaintDC::SetTextBackground( const wxColour &col ) void wxWindowDC::SetTextBackground( const wxColour &col )
{ {
if (!Ok()) return; if (!Ok()) return;
@@ -907,7 +907,7 @@ void wxPaintDC::SetTextBackground( const wxColour &col )
gdk_gc_set_background( m_textGC, m_textBackgroundColour.GetColor() ); gdk_gc_set_background( m_textGC, m_textBackgroundColour.GetColor() );
} }
void wxPaintDC::SetBackgroundMode( int mode ) void wxWindowDC::SetBackgroundMode( int mode )
{ {
m_backgroundMode = mode; m_backgroundMode = mode;
@@ -920,11 +920,11 @@ void wxPaintDC::SetBackgroundMode( int mode )
} }
} }
void wxPaintDC::SetPalette( const wxPalette& WXUNUSED(palette) ) void wxWindowDC::SetPalette( const wxPalette& WXUNUSED(palette) )
{ {
} }
void wxPaintDC::SetClippingRegion( long x, long y, long width, long height ) void wxWindowDC::SetClippingRegion( long x, long y, long width, long height )
{ {
wxDC::SetClippingRegion( x, y, width, height ); wxDC::SetClippingRegion( x, y, width, height );
@@ -939,7 +939,7 @@ void wxPaintDC::SetClippingRegion( long x, long y, long width, long height )
gdk_gc_set_clip_rectangle( m_bgGC, &rect ); gdk_gc_set_clip_rectangle( m_bgGC, &rect );
} }
void wxPaintDC::DestroyClippingRegion(void) void wxWindowDC::DestroyClippingRegion(void)
{ {
wxDC::DestroyClippingRegion(); wxDC::DestroyClippingRegion();
@@ -949,7 +949,7 @@ void wxPaintDC::DestroyClippingRegion(void)
gdk_gc_set_clip_rectangle( m_bgGC, (GdkRectangle *) NULL ); gdk_gc_set_clip_rectangle( m_bgGC, (GdkRectangle *) NULL );
} }
void wxPaintDC::SetUpDC(void) void wxWindowDC::SetUpDC(void)
{ {
Destroy(); Destroy();
m_ok = TRUE; m_ok = TRUE;
@@ -994,7 +994,7 @@ void wxPaintDC::SetUpDC(void)
} }
} }
void wxPaintDC::Destroy(void) void wxWindowDC::Destroy(void)
{ {
if (m_penGC) gdk_gc_unref( m_penGC ); if (m_penGC) gdk_gc_unref( m_penGC );
m_penGC = (GdkGC*) NULL; m_penGC = (GdkGC*) NULL;
@@ -1006,7 +1006,7 @@ void wxPaintDC::Destroy(void)
m_bgGC = (GdkGC*) NULL; m_bgGC = (GdkGC*) NULL;
} }
GdkWindow *wxPaintDC::GetWindow(void) GdkWindow *wxWindowDC::GetWindow(void)
{ {
return m_window; return m_window;
} }
@@ -1126,7 +1126,7 @@ static void wx_spline_draw_point_array(wxDC *dc)
} }
} }
void wxPaintDC::DrawSpline( wxList *points ) void wxWindowDC::DrawSpline( wxList *points )
{ {
wxPoint *p; wxPoint *p;
double cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4; double cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4;
@@ -1175,3 +1175,37 @@ void wxPaintDC::DrawSpline( wxList *points )
wx_spline_draw_point_array( this ); wx_spline_draw_point_array( this );
} }
//-----------------------------------------------------------------------------
// wxPaintDC
//-----------------------------------------------------------------------------
IMPLEMENT_DYNAMIC_CLASS(wxPaintDC,wxWindowDC)
wxPaintDC::wxPaintDC(void)
: wxWindowDC()
{
}
wxPaintDC::wxPaintDC( wxWindow *win )
: wxWindowDC( win )
{
}
//-----------------------------------------------------------------------------
// wxClientDC
//-----------------------------------------------------------------------------
IMPLEMENT_DYNAMIC_CLASS(wxClientDC,wxWindowDC)
wxClientDC::wxClientDC(void)
: wxWindowDC()
{
}
wxClientDC::wxClientDC( wxWindow *win )
: wxWindowDC( win )
{
}

View File

@@ -17,16 +17,17 @@
// wxMemoryDC // wxMemoryDC
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
IMPLEMENT_DYNAMIC_CLASS(wxMemoryDC,wxPaintDC) IMPLEMENT_DYNAMIC_CLASS(wxMemoryDC,wxWindowDC)
wxMemoryDC::wxMemoryDC(void) : wxPaintDC() wxMemoryDC::wxMemoryDC(void) : wxWindowDC()
{ {
m_ok = FALSE; m_ok = FALSE;
m_cmap = gtk_widget_get_default_colormap(); m_cmap = gtk_widget_get_default_colormap();
} }
wxMemoryDC::wxMemoryDC( wxDC *WXUNUSED(dc) ) : wxPaintDC() wxMemoryDC::wxMemoryDC( wxDC *WXUNUSED(dc) )
: wxWindowDC()
{ {
m_ok = FALSE; m_ok = FALSE;

View File

@@ -71,8 +71,8 @@ bool wxTextCtrl::Create( wxWindow *parent, wxWindowID id, const wxString &value,
SetValidator( validator ); SetValidator( validator );
bool bMultiLine = (style & wxTE_MULTILINE) != 0; bool multi_line = (style & wxTE_MULTILINE) != 0;
if ( bMultiLine ) if ( multi_line )
{ {
// a multi-line edit control: create a vertical scrollbar by default and // a multi-line edit control: create a vertical scrollbar by default and
// horizontal if requested // horizontal if requested
@@ -125,7 +125,7 @@ bool wxTextCtrl::Create( wxWindow *parent, wxWindowID id, const wxString &value,
PostCreation(); PostCreation();
if (bMultiLine) if (multi_line)
{ {
gtk_widget_realize(m_text); gtk_widget_realize(m_text);
gtk_widget_show(m_text); gtk_widget_show(m_text);
@@ -143,12 +143,20 @@ bool wxTextCtrl::Create( wxWindow *parent, wxWindowID id, const wxString &value,
SetInsertionPointEnd(); SetInsertionPointEnd();
} }
if (style & wxTE_PASSWORD)
{
if (!multi_line)
gtk_entry_set_visibility( GTK_ENTRY(m_text), FALSE );
}
if (style & wxTE_READONLY) if (style & wxTE_READONLY)
{ {
if (!multi_line)
gtk_entry_set_editable( GTK_ENTRY(m_text), FALSE );
} }
else else
{ {
if (bMultiLine) if (multi_line)
gtk_text_set_editable( GTK_TEXT(m_text), 1 ); gtk_text_set_editable( GTK_TEXT(m_text), 1 );
} }