Hi
 its problem with modal forms,
 when I want to show modal, erase, show modal again, and paint rectangle

 attached patch repaint this

Darek

Index: interfaces/gtk/gtkproc.inc
===================================================================
--- interfaces/gtk/gtkproc.inc  (wersja 9371)
+++ interfaces/gtk/gtkproc.inc  (kopia robocza)
@@ -3911,14 +3911,13 @@
   if AWidget <> nil
   then begin
     MainWidget := GetMainWidget(AWidget);
-    if MainWidget = nil then MainWidget := AWidget;
     Result := gtk_object_get_data(MainWidget, 'widgetinfo');
     if (Result = nil) and ACreate
     then begin
       Result := CreateWidgetInfo(MainWidget);
       // use the main widget as default
       Result^.CoreWidget := PGtkWidget(MainWidget);
-    end;  
+    end;
   end
   else Result := nil;
 end;
Index: graphics.pp
===================================================================
--- graphics.pp (wersja 9371)
+++ graphics.pp (kopia robocza)
@@ -923,6 +923,7 @@
     procedure SetHandle(NewHandle: HDC); virtual;
     procedure SetInternalPenPos(const Value: TPoint); virtual;
     Procedure SetPixel(X,Y: Integer; Value: TColor); virtual;
+    procedure freehandle;virtual;
   public
     constructor Create;
     destructor Destroy; override;
Index: controls.pp
===================================================================
--- controls.pp (wersja 9371)
+++ controls.pp (kopia robocza)
@@ -243,10 +243,11 @@
     procedure CreateFont; override;
   protected
     procedure CreateHandle; override;
+
   public
     constructor Create;
     destructor Destroy; override;
-    procedure FreeHandle;
+    procedure FreeHandle;override;
     property Control: TControl read FControl write SetControl;
   end;
   
Index: include/controlcanvas.inc
===================================================================
--- include/controlcanvas.inc   (wersja 9371)
+++ include/controlcanvas.inc   (kopia robocza)
@@ -102,9 +102,9 @@
  
------------------------------------------------------------------------------}
 procedure TControlCanvas.FreeHandle;
 begin
+  inherited;
   if FDeviceContext <> 0 then
   begin
-    Handle := 0;
     ReleaseDC(FWindowHandle, FDeviceContext);
     FDeviceContext := 0;
   end;
Index: include/canvas.inc
===================================================================
--- include/canvas.inc  (wersja 9371)
+++ include/canvas.inc  (kopia robocza)
@@ -1367,7 +1367,7 @@
  
------------------------------------------------------------------------------}
 procedure TCanvas.DeselectHandles;
 begin
-  //debugln('TCanvas.DeselectHandles ',ClassName,' Self=',DbgS(Self),' 
Handle=',DbgS(FHandle),8),' 
FSavedBrushHandle=',DbgS(Cardinal(FSavedBrushHandle));
+  //debugln('TCanvas.DeselectHandles ',ClassName,' Self=',DbgS(Self),' 
Handle=',DbgS(FHandle),' FSavedBrushHandle=',DbgS(Cardinal(FSavedBrushHandle)));
   if (FHandle<>0) then begin
     // select default sub handles in the device context without deleting owns
     if FSavedBrushHandle<>0 then begin
@@ -1397,6 +1397,10 @@
 begin
 // Plain canvas does nothing
 end;
+procedure TCanvas.FreeHandle;
+begin
+  handle:=0;
+end;
 
 {------------------------------------------------------------------------------
   Method:   TCanvas.RequiredState
Index: include/scrollingwincontrol.inc
===================================================================
--- include/scrollingwincontrol.inc     (wersja 9371)
+++ include/scrollingwincontrol.inc     (kopia robocza)
@@ -124,7 +124,7 @@
 begin
   inherited DestroyWnd;
   if Canvas<>nil then
-    Canvas.Handle:=0;
+    Canvas.freeHandle;
 end;
 
 Function TScrollingWinControl.StoreScrollBars : Boolean;

Reply via email to