Browse Source

- reduced number of ifdefs by using sw_string in unit views/uviews

git-svn-id: branches/unicodekvm@48601 -
nickysn 4 years ago
parent
commit
ddde3628ba
1 changed files with 8 additions and 34 deletions
  1. 8 34
      packages/fv/src/views.inc

+ 8 - 34
packages/fv/src/views.inc

@@ -371,13 +371,8 @@ TYPE
       FUNCTION GetColor (Color: Word): Word;
       FUNCTION GetColor (Color: Word): Word;
       FUNCTION Valid (Command: Word): Boolean; Virtual;
       FUNCTION Valid (Command: Word): Boolean; Virtual;
       FUNCTION GetState (AState: Word): Boolean;
       FUNCTION GetState (AState: Word): Boolean;
-{$ifdef FV_UNICODE}
-      FUNCTION TextWidth (const Txt: UnicodeString): Sw_Integer;
-      FUNCTION CTextWidth (const Txt: UnicodeString): Sw_Integer;
-{$else FV_UNICODE}
-      FUNCTION TextWidth (const Txt: String): Sw_Integer;
-      FUNCTION CTextWidth (const Txt: String): Sw_Integer;
-{$endif FV_UNICODE}
+      FUNCTION TextWidth (const Txt: Sw_String): Sw_Integer;
+      FUNCTION CTextWidth (const Txt: Sw_String): Sw_Integer;
       FUNCTION MouseInView (Point: TPoint): Boolean;
       FUNCTION MouseInView (Point: TPoint): Boolean;
       FUNCTION CommandEnabled (Command: Word): Boolean;
       FUNCTION CommandEnabled (Command: Word): Boolean;
       FUNCTION OverLapsArea (X1, Y1, X2, Y2: Sw_Integer): Boolean;
       FUNCTION OverLapsArea (X1, Y1, X2, Y2: Sw_Integer): Boolean;
@@ -431,12 +426,11 @@ TYPE
       PROCEDURE WriteLine (X, Y, W, H: Sw_Integer; Var Buf);
       PROCEDURE WriteLine (X, Y, W, H: Sw_Integer; Var Buf);
       PROCEDURE MakeLocal (Source: TPoint; Var Dest: TPoint);
       PROCEDURE MakeLocal (Source: TPoint; Var Dest: TPoint);
       PROCEDURE MakeGlobal (Source: TPoint; Var Dest: TPoint);
       PROCEDURE MakeGlobal (Source: TPoint; Var Dest: TPoint);
+      PROCEDURE WriteStr (X, Y: Sw_Integer; Str: Sw_String; Color: Byte);
 {$ifdef FV_UNICODE}
 {$ifdef FV_UNICODE}
-      PROCEDURE WriteStr (X, Y: Sw_Integer; Str: UnicodeString; Color: Byte);
       PROCEDURE WriteChar (X, Y: Sw_Integer; C: UnicodeString; Color: Byte;
       PROCEDURE WriteChar (X, Y: Sw_Integer; C: UnicodeString; Color: Byte;
         Count: Sw_Integer);
         Count: Sw_Integer);
 {$else FV_UNICODE}
 {$else FV_UNICODE}
-      PROCEDURE WriteStr (X, Y: Sw_Integer; Str: String; Color: Byte);
       PROCEDURE WriteChar (X, Y: Sw_Integer; C: Char; Color: Byte;
       PROCEDURE WriteChar (X, Y: Sw_Integer; C: Char; Color: Byte;
         Count: Sw_Integer);
         Count: Sw_Integer);
 {$endif FV_UNICODE}
 {$endif FV_UNICODE}
@@ -620,11 +614,7 @@ TYPE
       CONSTRUCTOR Load (Var S: TStream);
       CONSTRUCTOR Load (Var S: TStream);
       FUNCTION GetPalette: PPalette; Virtual;
       FUNCTION GetPalette: PPalette; Virtual;
       FUNCTION IsSelected (Item: Sw_Integer): Boolean; Virtual;
       FUNCTION IsSelected (Item: Sw_Integer): Boolean; Virtual;
-{$ifdef FV_UNICODE}
-      FUNCTION GetText (Item: Sw_Integer; MaxLen: Sw_Integer): UnicodeString; Virtual;
-{$else FV_UNICODE}
-      FUNCTION GetText (Item: Sw_Integer; MaxLen: Sw_Integer): String; Virtual;
-{$endif FV_UNICODE}
+      FUNCTION GetText (Item: Sw_Integer; MaxLen: Sw_Integer): Sw_String; Virtual;
       PROCEDURE Draw; Virtual;
       PROCEDURE Draw; Virtual;
       PROCEDURE FocusItem (Item: Sw_Integer); Virtual;
       PROCEDURE FocusItem (Item: Sw_Integer); Virtual;
       PROCEDURE SetTopItem (Item: Sw_Integer);
       PROCEDURE SetTopItem (Item: Sw_Integer);
@@ -3603,11 +3593,7 @@ END;
 {--TListViewer--------------------------------------------------------------}
 {--TListViewer--------------------------------------------------------------}
 {  GetText -> Platforms DOS/DPMI/WIN/NT/OS2 - Updated 28May98 LdB           }
 {  GetText -> Platforms DOS/DPMI/WIN/NT/OS2 - Updated 28May98 LdB           }
 {---------------------------------------------------------------------------}
 {---------------------------------------------------------------------------}
-{$ifdef FV_UNICODE}
-FUNCTION TListViewer.GetText (Item: Sw_Integer; MaxLen: Sw_Integer): UnicodeString;
-{$else FV_UNICODE}
-FUNCTION TListViewer.GetText (Item: Sw_Integer; MaxLen: Sw_Integer): String;
-{$endif FV_UNICODE}
+FUNCTION TListViewer.GetText (Item: Sw_Integer; MaxLen: Sw_Integer): Sw_String;
 BEGIN                                                 { Abstract method }
 BEGIN                                                 { Abstract method }
    GetText := '';                                     { Return empty }
    GetText := '';                                     { Return empty }
 END;
 END;
@@ -3618,11 +3604,7 @@ END;
 PROCEDURE TListViewer.Draw;
 PROCEDURE TListViewer.Draw;
 VAR  I, J, ColWidth, Item, Indent, CurCol: Sw_Integer;
 VAR  I, J, ColWidth, Item, Indent, CurCol: Sw_Integer;
      Color: Word; SCOff: Byte;
      Color: Word; SCOff: Byte;
-{$ifdef FV_UNICODE}
-     Text: UnicodeString;
-{$else FV_UNICODE}
-     Text: String;
-{$endif FV_UNICODE}
+     Text: Sw_String;
      B: TDrawBuffer;
      B: TDrawBuffer;
 BEGIN
 BEGIN
    ColWidth := Size.X DIV NumCols + 1;                { Calc column width }
    ColWidth := Size.X DIV NumCols + 1;                { Calc column width }
@@ -3967,11 +3949,7 @@ END;
 {  Modified 31may2002 PM  (No number included anymore)                      }
 {  Modified 31may2002 PM  (No number included anymore)                      }
 {---------------------------------------------------------------------------}
 {---------------------------------------------------------------------------}
 FUNCTION TWindow.GetTitle (MaxSize: Sw_Integer): TTitleStr;
 FUNCTION TWindow.GetTitle (MaxSize: Sw_Integer): TTitleStr;
-{$ifdef FV_UNICODE}
-VAR S: UnicodeString;
-{$else FV_UNICODE}
-VAR S: String;
-{$endif FV_UNICODE}
+VAR S: Sw_String;
 BEGIN
 BEGIN
 {$ifdef FV_UNICODE}
 {$ifdef FV_UNICODE}
    S:=Title;
    S:=Title;
@@ -4545,11 +4523,7 @@ begin
 end;
 end;
 
 
 
 
-{$ifdef FV_UNICODE}
-procedure TView.WriteStr(X, Y: Sw_Integer; Str: UnicodeString; Color: Byte);
-{$else FV_UNICODE}
-procedure TView.WriteStr(X, Y: Sw_Integer; Str: String; Color: Byte);
-{$endif FV_UNICODE}
+procedure TView.WriteStr(X, Y: Sw_Integer; Str: Sw_String; Color: Byte);
 var
 var
   l,i : Sw_word;
   l,i : Sw_word;
   B : TDrawBuffer;
   B : TDrawBuffer;