Browse Source

* TTab.DataSize function was missing

pierre 23 years ago
parent
commit
668ec7c398
2 changed files with 52 additions and 0 deletions
  1. 26 0
      fv/tabs.pas
  2. 26 0
      fvision/tabs.pas

+ 26 - 0
fv/tabs.pas

@@ -35,6 +35,7 @@ type
       procedure   HandleEvent(var Event: TEvent); virtual;
       function    GetPalette: PPalette; virtual;
       procedure   Draw; virtual;
+      function    DataSize: sw_word;virtual;
       procedure   SetData(var Rec);virtual;
       procedure   GetData(var Rec);virtual;
       procedure   SetState(AState: Word; Enable: Boolean); virtual;
@@ -433,6 +434,31 @@ begin
 end;
 
 
+function TTab.DataSize: sw_word;
+var
+  I: Sw_Word;
+  PT : PTabDef;
+  PI : PTabItem;
+begin
+  I := 0;
+  PT:=TabDefs;
+  while (PT<>nil) do
+   begin
+     PI:=PT^.Items;
+     while (PI<>nil) do
+      begin
+        if PI^.View<>nil then
+         begin
+           Inc(I, PI^.View^.DataSize);
+         end;
+        PI:=PI^.Next;
+      end;
+     PT:=PT^.Next;
+   end;
+  DataSize:=i;
+end;
+
+
 procedure TTab.GetData(var Rec);
 type
   Bytes = array[0..65534] of Byte;

+ 26 - 0
fvision/tabs.pas

@@ -35,6 +35,7 @@ type
       procedure   HandleEvent(var Event: TEvent); virtual;
       function    GetPalette: PPalette; virtual;
       procedure   Draw; virtual;
+      function    DataSize: sw_word;virtual;
       procedure   SetData(var Rec);virtual;
       procedure   GetData(var Rec);virtual;
       procedure   SetState(AState: Word; Enable: Boolean); virtual;
@@ -433,6 +434,31 @@ begin
 end;
 
 
+function TTab.DataSize: sw_word;
+var
+  I: Sw_Word;
+  PT : PTabDef;
+  PI : PTabItem;
+begin
+  I := 0;
+  PT:=TabDefs;
+  while (PT<>nil) do
+   begin
+     PI:=PT^.Items;
+     while (PI<>nil) do
+      begin
+        if PI^.View<>nil then
+         begin
+           Inc(I, PI^.View^.DataSize);
+         end;
+        PI:=PI^.Next;
+      end;
+     PT:=PT^.Next;
+   end;
+  DataSize:=i;
+end;
+
+
 procedure TTab.GetData(var Rec);
 type
   Bytes = array[0..65534] of Byte;