Browse Source

Removed Visible property

michael 24 years ago
parent
commit
902514047d
1 changed files with 10 additions and 18 deletions
  1. 10 18
      docs/gtk5ex/blocks.pp

+ 10 - 18
docs/gtk5ex/blocks.pp

@@ -44,7 +44,6 @@ type
     FDrawPixMap : PgdkPixmap;
     FDrawPixMap : PgdkPixmap;
     FPixMap : PgdkPixMap;
     FPixMap : PgdkPixMap;
     FBitMap : PGdkBitMap;
     FBitMap : PGdkBitMap;
-    FVisible : Boolean;
   Protected
   Protected
     Procedure CreateSpriteFromData(SpriteData : PPGchar);
     Procedure CreateSpriteFromData(SpriteData : PPGchar);
     Procedure CreatePixMap; Virtual; Abstract; 
     Procedure CreatePixMap; Virtual; Abstract; 
@@ -55,7 +54,6 @@ type
     Function GetChangeRect (Var Rect : TGDkRectAngle) : Boolean;
     Function GetChangeRect (Var Rect : TGDkRectAngle) : Boolean;
     Property PixMap : PgdkPixMap Read FPixMap;
     Property PixMap : PgdkPixMap Read FPixMap;
     Property BitMap : PGdkBitMap Read FBitMap; 
     Property BitMap : PGdkBitMap Read FBitMap; 
-    Property Visible : Boolean Read FVisible Write FVisible;
   end;
   end;
 
 
   TPad = Class (TSprite)
   TPad = Class (TSprite)
@@ -378,7 +376,6 @@ Constructor TSprite.Create(DrawingArea: PGtkWidget);
 begin
 begin
   Inherited Create;
   Inherited Create;
   FDrawingArea:=DrawingArea;
   FDrawingArea:=DrawingArea;
-  Visible:=False;
 end;
 end;
 
 
 Procedure TSprite.CreateSpriteFromData(SpriteData : PPGChar);
 Procedure TSprite.CreateSpriteFromData(SpriteData : PPGChar);
@@ -396,19 +393,16 @@ Var
   gc : PGDKGc;
   gc : PGDKGc;
   
   
 begin
 begin
-  if Visible then
-    begin
-    if FPixMap=Nil then
-      CreatePixMap;    
-    gc:=gtk_widget_get_style(FDrawingArea)^.fg_gc[GTK_STATE_NORMAL];
-    gdk_gc_set_clip_origin(gc,Left,Top);
-    gdk_gc_set_clip_mask(gc,FBitmap);
-    if FDrawPixMap<>Nil then
-      gdk_draw_pixmap(FDrawPixMap,gc,FPixMap,0,0,Left,Top,Width,Height)
-    else
-      gdk_draw_pixmap(FDrawPixMap{FDrawingArea^.window},gc,FPixMap,0,0,Left,Top,Width,Height);
-    gdk_gc_set_clip_mask(gc,Nil);  
-    end;
+  if FPixMap=Nil then
+    CreatePixMap;    
+  gc:=gtk_widget_get_style(FDrawingArea)^.fg_gc[GTK_STATE_NORMAL];
+  gdk_gc_set_clip_origin(gc,Left,Top);
+  gdk_gc_set_clip_mask(gc,FBitmap);
+  if FDrawPixMap<>Nil then
+    gdk_draw_pixmap(FDrawPixMap,gc,FPixMap,0,0,Left,Top,Width,Height)
+  else
+    gdk_draw_pixmap(FDrawPixMap{FDrawingArea^.window},gc,FPixMap,0,0,Left,Top,Width,Height);
+  gdk_gc_set_clip_mask(gc,Nil);  
 end;
 end;
 
 
 Function TSprite.GetChangeRect (Var Rect : TGDkRectAngle) : Boolean;
 Function TSprite.GetChangeRect (Var Rect : TGDkRectAngle) : Boolean;
@@ -462,7 +456,6 @@ begin
   Inherited Create(DrawingArea);
   Inherited Create(DrawingArea);
   FSpeed:=6;
   FSpeed:=6;
   FSlope:=50;
   FSlope:=50;
-  Visible:=True;
 end;
 end;
 
 
 Procedure TPad.CreatePixMap; 
 Procedure TPad.CreatePixMap; 
@@ -549,7 +542,6 @@ begin
   FCurrentSpeedY:=-100;
   FCurrentSpeedY:=-100;
   FCurrentSpeedX:=0;
   FCurrentSpeedX:=0;
   FSpeedFactor:=10;
   FSpeedFactor:=10;
-  Visible:=True;
 end;
 end;
 
 
 Procedure TBall.CreatePixMap; 
 Procedure TBall.CreatePixMap;