From 809934d22ad2e97d67655ecb4b06b29b5d2a361d Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Wed, 23 Feb 2000 17:47:43 +0000 Subject: [PATCH] #ifdeffed new paint clipping :-( Moved replacement code to printing preview canvas where its effect was particularly useful. Completed GC pooling. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6240 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/prntbase.cpp | 5 ++ src/generic/listctrl.cpp | 6 +- src/gtk/dcclient.cpp | 163 ++++++++++++++++++++++----------------- src/gtk/dcmemory.cpp | 4 +- src/gtk/window.cpp | 4 +- src/gtk1/dcclient.cpp | 163 ++++++++++++++++++++++----------------- src/gtk1/dcmemory.cpp | 4 +- src/gtk1/window.cpp | 4 +- 8 files changed, 200 insertions(+), 153 deletions(-) diff --git a/src/common/prntbase.cpp b/src/common/prntbase.cpp index 8ca74fb4d8..6709e37217 100644 --- a/src/common/prntbase.cpp +++ b/src/common/prntbase.cpp @@ -195,6 +195,11 @@ void wxPreviewCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) wxPaintDC dc(this); PrepareDC( dc ); +#ifdef __WXGTK__ + if (!GetUpdateRegion().IsEmpty()) + dc.SetClippingRegion( GetUpdateRegion() ); +#endif + if (m_printPreview) { m_printPreview->PaintPage(this, dc); diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index 2e67abdff1..c5a1e76d04 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -187,7 +187,7 @@ public: ~wxListHeaderWindow(); wxListHeaderWindow( wxWindow *win, wxWindowID id, wxListMainWindow *owner, const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, - long style = 0, const wxString &name = "columntitles" ); + long style = 0, const wxString &name = "wxlistctrlcolumntitles" ); void DoDrawRect( wxDC *dc, int x, int y, int w, int h ); void OnPaint( wxPaintEvent &event ); void DrawCurrent(); @@ -233,7 +233,7 @@ public: const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, int style = 0, const wxValidator& validator = wxDefaultValidator, - const wxString &name = "wxListTextCtrlText" ); + const wxString &name = "listctrltextctrl" ); void OnChar( wxKeyEvent &event ); void OnKillFocus( wxFocusEvent &event ); @@ -281,7 +281,7 @@ public: wxListMainWindow(); wxListMainWindow( wxWindow *parent, wxWindowID id, const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, - long style = 0, const wxString &name = "listctrl" ); + long style = 0, const wxString &name = "listctrlmainwindow" ); ~wxListMainWindow(); void RefreshLine( wxListLineData *line ); void OnPaint( wxPaintEvent &event ); diff --git a/src/gtk/dcclient.cpp b/src/gtk/dcclient.cpp index 45ce6c6dc5..8c72dd103b 100644 --- a/src/gtk/dcclient.cpp +++ b/src/gtk/dcclient.cpp @@ -23,6 +23,12 @@ #include #include +//----------------------------------------------------------------------------- +// local defines +//----------------------------------------------------------------------------- + +#define USE_PAINT_REGION 0 + //----------------------------------------------------------------------------- // local data //----------------------------------------------------------------------------- @@ -250,6 +256,86 @@ wxWindowDC::~wxWindowDC() Destroy(); } +void wxWindowDC::SetUpDC() +{ + m_ok = TRUE; + + wxASSERT_MSG( !m_penGC, wxT("GCs already created") ); + + if (m_isMemDC && (((wxMemoryDC*)this)->m_selected.GetDepth() == 1)) + { + m_penGC = wxGetPoolGC( m_window, wxPEN_MONO ); + m_brushGC = wxGetPoolGC( m_window, wxBRUSH_MONO ); + m_textGC = wxGetPoolGC( m_window, wxTEXT_MONO ); + m_bgGC = wxGetPoolGC( m_window, wxBG_MONO ); + } + else + { + m_penGC = wxGetPoolGC( m_window, wxPEN_COLOUR ); + m_brushGC = wxGetPoolGC( m_window, wxBRUSH_COLOUR ); + m_textGC = wxGetPoolGC( m_window, wxTEXT_COLOUR ); + m_bgGC = wxGetPoolGC( m_window, wxBG_COLOUR ); + } + + /* background colour */ + m_backgroundBrush = *wxWHITE_BRUSH; + m_backgroundBrush.GetColour().CalcPixel( m_cmap ); + GdkColor *bg_col = m_backgroundBrush.GetColour().GetColor(); + + /* m_textGC */ + m_textForegroundColour.CalcPixel( m_cmap ); + gdk_gc_set_foreground( m_textGC, m_textForegroundColour.GetColor() ); + + m_textBackgroundColour.CalcPixel( m_cmap ); + gdk_gc_set_background( m_textGC, m_textBackgroundColour.GetColor() ); + + gdk_gc_set_fill( m_textGC, GDK_SOLID ); + + /* m_penGC */ + m_pen.GetColour().CalcPixel( m_cmap ); + gdk_gc_set_foreground( m_penGC, m_pen.GetColour().GetColor() ); + gdk_gc_set_background( m_penGC, bg_col ); + + gdk_gc_set_line_attributes( m_penGC, 0, GDK_LINE_SOLID, GDK_CAP_NOT_LAST, GDK_JOIN_ROUND ); + + + /* m_brushGC */ + m_brush.GetColour().CalcPixel( m_cmap ); + gdk_gc_set_foreground( m_brushGC, m_brush.GetColour().GetColor() ); + gdk_gc_set_background( m_brushGC, bg_col ); + + gdk_gc_set_fill( m_brushGC, GDK_SOLID ); + + + /* m_bgGC */ + gdk_gc_set_background( m_bgGC, bg_col ); + gdk_gc_set_foreground( m_bgGC, bg_col ); + + gdk_gc_set_fill( m_bgGC, GDK_SOLID ); + + /* ROPs */ + gdk_gc_set_function( m_textGC, GDK_COPY ); + gdk_gc_set_function( m_brushGC, GDK_COPY ); + gdk_gc_set_function( m_penGC, GDK_COPY ); + + /* clipping */ + gdk_gc_set_clip_rectangle( m_penGC, (GdkRectangle *) NULL ); + gdk_gc_set_clip_rectangle( m_brushGC, (GdkRectangle *) NULL ); + gdk_gc_set_clip_rectangle( m_textGC, (GdkRectangle *) NULL ); + gdk_gc_set_clip_rectangle( m_bgGC, (GdkRectangle *) NULL ); + + if (!hatch_bitmap) + { + hatch_bitmap = hatches; + hatch_bitmap[0] = gdk_bitmap_create_from_data( (GdkWindow *) NULL, bdiag_bits, bdiag_width, bdiag_height ); + hatch_bitmap[1] = gdk_bitmap_create_from_data( (GdkWindow *) NULL, cdiag_bits, cdiag_width, cdiag_height ); + hatch_bitmap[2] = gdk_bitmap_create_from_data( (GdkWindow *) NULL, fdiag_bits, fdiag_width, fdiag_height ); + hatch_bitmap[3] = gdk_bitmap_create_from_data( (GdkWindow *) NULL, cross_bits, cross_width, cross_height ); + hatch_bitmap[4] = gdk_bitmap_create_from_data( (GdkWindow *) NULL, horiz_bits, horiz_width, horiz_height ); + hatch_bitmap[5] = gdk_bitmap_create_from_data( (GdkWindow *) NULL, verti_bits, verti_width, verti_height ); + } +} + void wxWindowDC::DoFloodFill( wxCoord WXUNUSED(x), wxCoord WXUNUSED(y), const wxColour &WXUNUSED(col), int WXUNUSED(style) ) { @@ -1539,8 +1625,10 @@ void wxWindowDC::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoo m_currentClippingRegion.Clear(); m_currentClippingRegion.Union( rect ); +#if USE_PAINT_REGION if (!m_paintClippingRegion.IsEmpty()) m_currentClippingRegion.Intersect( m_paintClippingRegion ); +#endif gdk_gc_set_clip_region( m_penGC, m_currentClippingRegion.GetRegion() ); gdk_gc_set_clip_region( m_brushGC, m_currentClippingRegion.GetRegion() ); @@ -1567,8 +1655,10 @@ void wxWindowDC::DoSetClippingRegionAsRegion( const wxRegion ®ion ) m_currentClippingRegion.Clear(); m_currentClippingRegion.Union( region ); +#if USE_PAINT_REGION if (!m_paintClippingRegion.IsEmpty()) m_currentClippingRegion.Intersect( m_paintClippingRegion ); +#endif gdk_gc_set_clip_region( m_penGC, m_currentClippingRegion.GetRegion() ); gdk_gc_set_clip_region( m_brushGC, m_currentClippingRegion.GetRegion() ); @@ -1605,77 +1695,6 @@ void wxWindowDC::DestroyClippingRegion() } } -void wxWindowDC::SetUpDC() -{ - m_ok = TRUE; - - if (!m_penGC) - { - m_penGC = wxGetPoolGC( m_window, wxPEN_COLOUR ); - m_brushGC = wxGetPoolGC( m_window, wxBRUSH_COLOUR ); - m_textGC = wxGetPoolGC( m_window, wxTEXT_COLOUR ); - m_bgGC = wxGetPoolGC( m_window, wxBG_COLOUR ); - } - - /* background colour */ - m_backgroundBrush = *wxWHITE_BRUSH; - m_backgroundBrush.GetColour().CalcPixel( m_cmap ); - GdkColor *bg_col = m_backgroundBrush.GetColour().GetColor(); - - /* m_textGC */ - m_textForegroundColour.CalcPixel( m_cmap ); - gdk_gc_set_foreground( m_textGC, m_textForegroundColour.GetColor() ); - - m_textBackgroundColour.CalcPixel( m_cmap ); - gdk_gc_set_background( m_textGC, m_textBackgroundColour.GetColor() ); - - gdk_gc_set_fill( m_textGC, GDK_SOLID ); - - /* m_penGC */ - m_pen.GetColour().CalcPixel( m_cmap ); - gdk_gc_set_foreground( m_penGC, m_pen.GetColour().GetColor() ); - gdk_gc_set_background( m_penGC, bg_col ); - - gdk_gc_set_line_attributes( m_penGC, 0, GDK_LINE_SOLID, GDK_CAP_NOT_LAST, GDK_JOIN_ROUND ); - - - /* m_brushGC */ - m_brush.GetColour().CalcPixel( m_cmap ); - gdk_gc_set_foreground( m_brushGC, m_brush.GetColour().GetColor() ); - gdk_gc_set_background( m_brushGC, bg_col ); - - gdk_gc_set_fill( m_brushGC, GDK_SOLID ); - - - /* m_bgGC */ - gdk_gc_set_background( m_bgGC, bg_col ); - gdk_gc_set_foreground( m_bgGC, bg_col ); - - gdk_gc_set_fill( m_bgGC, GDK_SOLID ); - - /* ROPs */ - gdk_gc_set_function( m_textGC, GDK_COPY ); - gdk_gc_set_function( m_brushGC, GDK_COPY ); - gdk_gc_set_function( m_penGC, GDK_COPY ); - - /* clipping */ - gdk_gc_set_clip_rectangle( m_penGC, (GdkRectangle *) NULL ); - gdk_gc_set_clip_rectangle( m_brushGC, (GdkRectangle *) NULL ); - gdk_gc_set_clip_rectangle( m_textGC, (GdkRectangle *) NULL ); - gdk_gc_set_clip_rectangle( m_bgGC, (GdkRectangle *) NULL ); - - if (!hatch_bitmap) - { - hatch_bitmap = hatches; - hatch_bitmap[0] = gdk_bitmap_create_from_data( (GdkWindow *) NULL, bdiag_bits, bdiag_width, bdiag_height ); - hatch_bitmap[1] = gdk_bitmap_create_from_data( (GdkWindow *) NULL, cdiag_bits, cdiag_width, cdiag_height ); - hatch_bitmap[2] = gdk_bitmap_create_from_data( (GdkWindow *) NULL, fdiag_bits, fdiag_width, fdiag_height ); - hatch_bitmap[3] = gdk_bitmap_create_from_data( (GdkWindow *) NULL, cross_bits, cross_width, cross_height ); - hatch_bitmap[4] = gdk_bitmap_create_from_data( (GdkWindow *) NULL, horiz_bits, horiz_width, horiz_height ); - hatch_bitmap[5] = gdk_bitmap_create_from_data( (GdkWindow *) NULL, verti_bits, verti_width, verti_height ); - } -} - void wxWindowDC::Destroy() { if (m_penGC) wxFreePoolGC( m_penGC ); @@ -1905,6 +1924,7 @@ wxPaintDC::wxPaintDC() wxPaintDC::wxPaintDC( wxWindow *win ) : wxWindowDC( win ) { +#if USE_PAINT_REGION if (!win->GetUpdateRegion().IsEmpty()) { m_paintClippingRegion = win->GetUpdateRegion(); @@ -1915,6 +1935,7 @@ wxPaintDC::wxPaintDC( wxWindow *win ) gdk_gc_set_clip_region( m_textGC, m_paintClippingRegion.GetRegion() ); gdk_gc_set_clip_region( m_bgGC, m_paintClippingRegion.GetRegion() ); } +#endif } //----------------------------------------------------------------------------- diff --git a/src/gtk/dcmemory.cpp b/src/gtk/dcmemory.cpp index 95bf5b9a8a..a1e0c24452 100644 --- a/src/gtk/dcmemory.cpp +++ b/src/gtk/dcmemory.cpp @@ -56,9 +56,9 @@ void wxMemoryDC::SelectObject( const wxBitmap& bitmap ) m_window = m_selected.GetBitmap(); } - SetUpDC(); - m_isMemDC = TRUE; + + SetUpDC(); } else { diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index 6dea5fdd64..befad324ff 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -613,7 +613,7 @@ static void gtk_window_expose_callback( GtkWidget *WXUNUSED(widget), GdkEventExp DEBUG_MAIN_THREAD /* - if (win->GetName() == wxT("columntitles")) + if (win->GetName() == wxT("grid window")) { wxPrintf( wxT("OnExpose from ") ); if (win->GetClassInfo() && win->GetClassInfo()->GetClassName()) @@ -664,7 +664,7 @@ static void gtk_window_draw_callback( GtkWidget *WXUNUSED(widget), return; /* - if (win->GetName() == wxT("columntitles")) + if (win->GetName() == wxT("grid window")) { wxPrintf( wxT("OnDraw from ") ); if (win->GetClassInfo() && win->GetClassInfo()->GetClassName()) diff --git a/src/gtk1/dcclient.cpp b/src/gtk1/dcclient.cpp index 45ce6c6dc5..8c72dd103b 100644 --- a/src/gtk1/dcclient.cpp +++ b/src/gtk1/dcclient.cpp @@ -23,6 +23,12 @@ #include #include +//----------------------------------------------------------------------------- +// local defines +//----------------------------------------------------------------------------- + +#define USE_PAINT_REGION 0 + //----------------------------------------------------------------------------- // local data //----------------------------------------------------------------------------- @@ -250,6 +256,86 @@ wxWindowDC::~wxWindowDC() Destroy(); } +void wxWindowDC::SetUpDC() +{ + m_ok = TRUE; + + wxASSERT_MSG( !m_penGC, wxT("GCs already created") ); + + if (m_isMemDC && (((wxMemoryDC*)this)->m_selected.GetDepth() == 1)) + { + m_penGC = wxGetPoolGC( m_window, wxPEN_MONO ); + m_brushGC = wxGetPoolGC( m_window, wxBRUSH_MONO ); + m_textGC = wxGetPoolGC( m_window, wxTEXT_MONO ); + m_bgGC = wxGetPoolGC( m_window, wxBG_MONO ); + } + else + { + m_penGC = wxGetPoolGC( m_window, wxPEN_COLOUR ); + m_brushGC = wxGetPoolGC( m_window, wxBRUSH_COLOUR ); + m_textGC = wxGetPoolGC( m_window, wxTEXT_COLOUR ); + m_bgGC = wxGetPoolGC( m_window, wxBG_COLOUR ); + } + + /* background colour */ + m_backgroundBrush = *wxWHITE_BRUSH; + m_backgroundBrush.GetColour().CalcPixel( m_cmap ); + GdkColor *bg_col = m_backgroundBrush.GetColour().GetColor(); + + /* m_textGC */ + m_textForegroundColour.CalcPixel( m_cmap ); + gdk_gc_set_foreground( m_textGC, m_textForegroundColour.GetColor() ); + + m_textBackgroundColour.CalcPixel( m_cmap ); + gdk_gc_set_background( m_textGC, m_textBackgroundColour.GetColor() ); + + gdk_gc_set_fill( m_textGC, GDK_SOLID ); + + /* m_penGC */ + m_pen.GetColour().CalcPixel( m_cmap ); + gdk_gc_set_foreground( m_penGC, m_pen.GetColour().GetColor() ); + gdk_gc_set_background( m_penGC, bg_col ); + + gdk_gc_set_line_attributes( m_penGC, 0, GDK_LINE_SOLID, GDK_CAP_NOT_LAST, GDK_JOIN_ROUND ); + + + /* m_brushGC */ + m_brush.GetColour().CalcPixel( m_cmap ); + gdk_gc_set_foreground( m_brushGC, m_brush.GetColour().GetColor() ); + gdk_gc_set_background( m_brushGC, bg_col ); + + gdk_gc_set_fill( m_brushGC, GDK_SOLID ); + + + /* m_bgGC */ + gdk_gc_set_background( m_bgGC, bg_col ); + gdk_gc_set_foreground( m_bgGC, bg_col ); + + gdk_gc_set_fill( m_bgGC, GDK_SOLID ); + + /* ROPs */ + gdk_gc_set_function( m_textGC, GDK_COPY ); + gdk_gc_set_function( m_brushGC, GDK_COPY ); + gdk_gc_set_function( m_penGC, GDK_COPY ); + + /* clipping */ + gdk_gc_set_clip_rectangle( m_penGC, (GdkRectangle *) NULL ); + gdk_gc_set_clip_rectangle( m_brushGC, (GdkRectangle *) NULL ); + gdk_gc_set_clip_rectangle( m_textGC, (GdkRectangle *) NULL ); + gdk_gc_set_clip_rectangle( m_bgGC, (GdkRectangle *) NULL ); + + if (!hatch_bitmap) + { + hatch_bitmap = hatches; + hatch_bitmap[0] = gdk_bitmap_create_from_data( (GdkWindow *) NULL, bdiag_bits, bdiag_width, bdiag_height ); + hatch_bitmap[1] = gdk_bitmap_create_from_data( (GdkWindow *) NULL, cdiag_bits, cdiag_width, cdiag_height ); + hatch_bitmap[2] = gdk_bitmap_create_from_data( (GdkWindow *) NULL, fdiag_bits, fdiag_width, fdiag_height ); + hatch_bitmap[3] = gdk_bitmap_create_from_data( (GdkWindow *) NULL, cross_bits, cross_width, cross_height ); + hatch_bitmap[4] = gdk_bitmap_create_from_data( (GdkWindow *) NULL, horiz_bits, horiz_width, horiz_height ); + hatch_bitmap[5] = gdk_bitmap_create_from_data( (GdkWindow *) NULL, verti_bits, verti_width, verti_height ); + } +} + void wxWindowDC::DoFloodFill( wxCoord WXUNUSED(x), wxCoord WXUNUSED(y), const wxColour &WXUNUSED(col), int WXUNUSED(style) ) { @@ -1539,8 +1625,10 @@ void wxWindowDC::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoo m_currentClippingRegion.Clear(); m_currentClippingRegion.Union( rect ); +#if USE_PAINT_REGION if (!m_paintClippingRegion.IsEmpty()) m_currentClippingRegion.Intersect( m_paintClippingRegion ); +#endif gdk_gc_set_clip_region( m_penGC, m_currentClippingRegion.GetRegion() ); gdk_gc_set_clip_region( m_brushGC, m_currentClippingRegion.GetRegion() ); @@ -1567,8 +1655,10 @@ void wxWindowDC::DoSetClippingRegionAsRegion( const wxRegion ®ion ) m_currentClippingRegion.Clear(); m_currentClippingRegion.Union( region ); +#if USE_PAINT_REGION if (!m_paintClippingRegion.IsEmpty()) m_currentClippingRegion.Intersect( m_paintClippingRegion ); +#endif gdk_gc_set_clip_region( m_penGC, m_currentClippingRegion.GetRegion() ); gdk_gc_set_clip_region( m_brushGC, m_currentClippingRegion.GetRegion() ); @@ -1605,77 +1695,6 @@ void wxWindowDC::DestroyClippingRegion() } } -void wxWindowDC::SetUpDC() -{ - m_ok = TRUE; - - if (!m_penGC) - { - m_penGC = wxGetPoolGC( m_window, wxPEN_COLOUR ); - m_brushGC = wxGetPoolGC( m_window, wxBRUSH_COLOUR ); - m_textGC = wxGetPoolGC( m_window, wxTEXT_COLOUR ); - m_bgGC = wxGetPoolGC( m_window, wxBG_COLOUR ); - } - - /* background colour */ - m_backgroundBrush = *wxWHITE_BRUSH; - m_backgroundBrush.GetColour().CalcPixel( m_cmap ); - GdkColor *bg_col = m_backgroundBrush.GetColour().GetColor(); - - /* m_textGC */ - m_textForegroundColour.CalcPixel( m_cmap ); - gdk_gc_set_foreground( m_textGC, m_textForegroundColour.GetColor() ); - - m_textBackgroundColour.CalcPixel( m_cmap ); - gdk_gc_set_background( m_textGC, m_textBackgroundColour.GetColor() ); - - gdk_gc_set_fill( m_textGC, GDK_SOLID ); - - /* m_penGC */ - m_pen.GetColour().CalcPixel( m_cmap ); - gdk_gc_set_foreground( m_penGC, m_pen.GetColour().GetColor() ); - gdk_gc_set_background( m_penGC, bg_col ); - - gdk_gc_set_line_attributes( m_penGC, 0, GDK_LINE_SOLID, GDK_CAP_NOT_LAST, GDK_JOIN_ROUND ); - - - /* m_brushGC */ - m_brush.GetColour().CalcPixel( m_cmap ); - gdk_gc_set_foreground( m_brushGC, m_brush.GetColour().GetColor() ); - gdk_gc_set_background( m_brushGC, bg_col ); - - gdk_gc_set_fill( m_brushGC, GDK_SOLID ); - - - /* m_bgGC */ - gdk_gc_set_background( m_bgGC, bg_col ); - gdk_gc_set_foreground( m_bgGC, bg_col ); - - gdk_gc_set_fill( m_bgGC, GDK_SOLID ); - - /* ROPs */ - gdk_gc_set_function( m_textGC, GDK_COPY ); - gdk_gc_set_function( m_brushGC, GDK_COPY ); - gdk_gc_set_function( m_penGC, GDK_COPY ); - - /* clipping */ - gdk_gc_set_clip_rectangle( m_penGC, (GdkRectangle *) NULL ); - gdk_gc_set_clip_rectangle( m_brushGC, (GdkRectangle *) NULL ); - gdk_gc_set_clip_rectangle( m_textGC, (GdkRectangle *) NULL ); - gdk_gc_set_clip_rectangle( m_bgGC, (GdkRectangle *) NULL ); - - if (!hatch_bitmap) - { - hatch_bitmap = hatches; - hatch_bitmap[0] = gdk_bitmap_create_from_data( (GdkWindow *) NULL, bdiag_bits, bdiag_width, bdiag_height ); - hatch_bitmap[1] = gdk_bitmap_create_from_data( (GdkWindow *) NULL, cdiag_bits, cdiag_width, cdiag_height ); - hatch_bitmap[2] = gdk_bitmap_create_from_data( (GdkWindow *) NULL, fdiag_bits, fdiag_width, fdiag_height ); - hatch_bitmap[3] = gdk_bitmap_create_from_data( (GdkWindow *) NULL, cross_bits, cross_width, cross_height ); - hatch_bitmap[4] = gdk_bitmap_create_from_data( (GdkWindow *) NULL, horiz_bits, horiz_width, horiz_height ); - hatch_bitmap[5] = gdk_bitmap_create_from_data( (GdkWindow *) NULL, verti_bits, verti_width, verti_height ); - } -} - void wxWindowDC::Destroy() { if (m_penGC) wxFreePoolGC( m_penGC ); @@ -1905,6 +1924,7 @@ wxPaintDC::wxPaintDC() wxPaintDC::wxPaintDC( wxWindow *win ) : wxWindowDC( win ) { +#if USE_PAINT_REGION if (!win->GetUpdateRegion().IsEmpty()) { m_paintClippingRegion = win->GetUpdateRegion(); @@ -1915,6 +1935,7 @@ wxPaintDC::wxPaintDC( wxWindow *win ) gdk_gc_set_clip_region( m_textGC, m_paintClippingRegion.GetRegion() ); gdk_gc_set_clip_region( m_bgGC, m_paintClippingRegion.GetRegion() ); } +#endif } //----------------------------------------------------------------------------- diff --git a/src/gtk1/dcmemory.cpp b/src/gtk1/dcmemory.cpp index 95bf5b9a8a..a1e0c24452 100644 --- a/src/gtk1/dcmemory.cpp +++ b/src/gtk1/dcmemory.cpp @@ -56,9 +56,9 @@ void wxMemoryDC::SelectObject( const wxBitmap& bitmap ) m_window = m_selected.GetBitmap(); } - SetUpDC(); - m_isMemDC = TRUE; + + SetUpDC(); } else { diff --git a/src/gtk1/window.cpp b/src/gtk1/window.cpp index 6dea5fdd64..befad324ff 100644 --- a/src/gtk1/window.cpp +++ b/src/gtk1/window.cpp @@ -613,7 +613,7 @@ static void gtk_window_expose_callback( GtkWidget *WXUNUSED(widget), GdkEventExp DEBUG_MAIN_THREAD /* - if (win->GetName() == wxT("columntitles")) + if (win->GetName() == wxT("grid window")) { wxPrintf( wxT("OnExpose from ") ); if (win->GetClassInfo() && win->GetClassInfo()->GetClassName()) @@ -664,7 +664,7 @@ static void gtk_window_draw_callback( GtkWidget *WXUNUSED(widget), return; /* - if (win->GetName() == wxT("columntitles")) + if (win->GetName() == wxT("grid window")) { wxPrintf( wxT("OnDraw from ") ); if (win->GetClassInfo() && win->GetClassInfo()->GetClassName()) -- 2.45.2