From a469cde1b7f926d23c271ae40b54fdcb716bf3db Mon Sep 17 00:00:00 2001 From: lazarus Date: Sat, 9 Feb 2002 01:47:11 +0000 Subject: [PATCH] MG: MoveWindowOrgEx, Splitted FWinControls/FControls, TControl drawing, Better DesignerDrawing, ... git-svn-id: trunk@871 - --- lcl/interfaces/gtk/gtkproc.inc | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/lcl/interfaces/gtk/gtkproc.inc b/lcl/interfaces/gtk/gtkproc.inc index fd0555caf3..6d47e70a11 100644 --- a/lcl/interfaces/gtk/gtkproc.inc +++ b/lcl/interfaces/gtk/gtkproc.inc @@ -208,6 +208,7 @@ begin //GC := gdk_gc_new(Drawable); GC := gdk_gc_new_with_values(Drawable, @GCValues, 3 { $3FF}); end; + Origin := SourceDC^.Origin; PenPos := SourceDC^.PenPos; CurrentBitmap := SourceDC^.CurrentBitmap; CurrentFont := SourceDC^.CurrentFont; @@ -216,24 +217,34 @@ begin CurrentTextColor := SourceDC^.CurrentTextColor; CurrentBackColor := SourceDC^.CurrentBackColor; ClipRegion := SourceDC^.ClipRegion; - {DeleteObject(ClipRegion); - ClipRegion := 0; - If SourceDC^.ClipRegion <> 0 then - SelectClipRGN(hDC(DestinationDC), SourceDC^.ClipRegion);} SavedContext := nil; end; end; Assert(False, Format('Trace:< [CopyDCData] DestDC:0x%x, SourceDC:0x%x --> %d', [Integer(DestinationDC), Integer(SourceDC), Integer(Result)])); end; +{------------------------------------------------------------------------------ + Procedure SelectGDIRegion(const DC: HDC); + + Applies the current clipping region of the DC (DeviceContext) to the + gc (GDK Graphic context - pgdkGC) + ------------------------------------------------------------------------------} Procedure SelectGDIRegion(const DC: HDC); +var + Region: PGdiObject; begin with PDeviceContext(DC)^ do begin gdk_gc_set_clip_region(gc, nil); gdk_gc_set_clip_rectangle (gc, nil); - If ClipRegion <> 0 then + If ClipRegion <> 0 then begin + Region:=PGDIObject(ClipRegion); + if (Origin.X<>0) or (Origin.X<>0) then + gdk_region_offset(Region^.GDIRegionObject,Origin.X,Origin.Y); gdk_gc_set_clip_region(gc, PGDIObject(ClipRegion)^.GDIRegionObject); + if (Origin.X<>0) or (Origin.X<>0) then + gdk_region_offset(Region^.GDIRegionObject,-Origin.X,-Origin.Y); + end; end; end; @@ -2622,6 +2633,9 @@ end; { ============================================================================= $Log$ + Revision 1.80 2002/08/30 12:32:23 lazarus + MG: MoveWindowOrgEx, Splitted FWinControls/FControls, TControl drawing, Better DesignerDrawing, ... + Revision 1.79 2002/08/29 00:07:02 lazarus MG: fixed TComboBox and InvalidateControl