+ use Sw_String in unit menus/umenus to reduce the number of ifdefs

git-svn-id: branches/unicodekvm@48602 -
This commit is contained in:
nickysn 2021-02-10 14:03:08 +00:00
parent ddde3628ba
commit 5dae243ffd
2 changed files with 11 additions and 39 deletions

View File

@ -232,6 +232,7 @@ begin
AddInclude('platform.inc'); AddInclude('platform.inc');
AddUnit('drivers'); AddUnit('drivers');
AddUnit('views'); AddUnit('views');
AddUnit('fvcommon');
AddUnit('fvconsts'); AddUnit('fvconsts');
end; end;
T:=P.Targets.AddUnit('umenus.pas'); T:=P.Targets.AddUnit('umenus.pas');
@ -241,6 +242,7 @@ begin
AddInclude('platform.inc'); AddInclude('platform.inc');
AddUnit('udrivers'); AddUnit('udrivers');
AddUnit('uviews'); AddUnit('uviews');
AddUnit('ufvcommon');
AddUnit('fvconsts'); AddUnit('fvconsts');
end; end;
T:=P.Targets.AddUnit('msgbox.pas'); T:=P.Targets.AddUnit('msgbox.pas');

View File

@ -76,9 +76,9 @@ USES
{$ENDIF} {$ENDIF}
{$ifdef FV_UNICODE} {$ifdef FV_UNICODE}
objects, udrivers, uviews, fvconsts; { GFV standard units } objects, udrivers, uviews, UFVCommon, fvconsts; { GFV standard units }
{$else FV_UNICODE} {$else FV_UNICODE}
objects, drivers, views, fvconsts; { GFV standard units } objects, drivers, views, fvcommon, fvconsts; { GFV standard units }
{$endif FV_UNICODE} {$endif FV_UNICODE}
{***************************************************************************} {***************************************************************************}
@ -258,11 +258,7 @@ TYPE
CONSTRUCTOR Load (Var S: TStream); CONSTRUCTOR Load (Var S: TStream);
DESTRUCTOR Done; Virtual; DESTRUCTOR Done; Virtual;
FUNCTION GetPalette: PPalette; Virtual; FUNCTION GetPalette: PPalette; Virtual;
{$ifdef FV_UNICODE} FUNCTION Hint (AHelpCtx: Word): Sw_String; Virtual;
FUNCTION Hint (AHelpCtx: Word): UnicodeString; Virtual;
{$else FV_UNICODE}
FUNCTION Hint (AHelpCtx: Word): String; Virtual;
{$endif FV_UNICODE}
PROCEDURE Draw; Virtual; PROCEDURE Draw; Virtual;
PROCEDURE Update; Virtual; PROCEDURE Update; Virtual;
PROCEDURE Store (Var S: TStream); PROCEDURE Store (Var S: TStream);
@ -344,13 +340,8 @@ with the given parameter values (using NewStr to allocate the Text).
An error in creating will return a nil pointer. An error in creating will return a nil pointer.
15May98 LdB 15May98 LdB
---------------------------------------------------------------------} ---------------------------------------------------------------------}
{$ifdef FV_UNICODE} FUNCTION NewStatusKey (AText: Sw_String; AKeyCode: Word; ACommand: Word;
FUNCTION NewStatusKey (AText: UnicodeString; AKeyCode: Word; ACommand: Word;
ANext: PStatusItem): PStatusItem; ANext: PStatusItem): PStatusItem;
{$else FV_UNICODE}
FUNCTION NewStatusKey (AText: String; AKeyCode: Word; ACommand: Word;
ANext: PStatusItem): PStatusItem;
{$endif FV_UNICODE}
{+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++} {+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++}
{ OBJECT REGISTER ROUTINES } { OBJECT REGISTER ROUTINES }
@ -1052,11 +1043,7 @@ END;
CONSTRUCTOR TMenuBox.Init (Var Bounds: TRect; AMenu: PMenu; CONSTRUCTOR TMenuBox.Init (Var Bounds: TRect; AMenu: PMenu;
AParentMenu: PMenuView); AParentMenu: PMenuView);
VAR W, H, L: SmallInt; P: PMenuItem; R: TRect; VAR W, H, L: SmallInt; P: PMenuItem; R: TRect;
{$ifdef FV_UNICODE} S: Sw_String;
S: UnicodeString;
{$else FV_UNICODE}
S: String;
{$endif FV_UNICODE}
BEGIN BEGIN
W := 0; { Clear initial width } W := 0; { Clear initial width }
H := 2; { Set initial height } H := 2; { Set initial height }
@ -1102,11 +1089,7 @@ END;
PROCEDURE TMenuBox.Draw; PROCEDURE TMenuBox.Draw;
VAR CNormal, CSelect, CSelectDisabled, CDisabled, Color: Word; Index, Y: SmallInt; VAR CNormal, CSelect, CSelectDisabled, CDisabled, Color: Word; Index, Y: SmallInt;
P: PMenuItem; B: TDrawBuffer; P: PMenuItem; B: TDrawBuffer;
{$ifdef FV_UNICODE} S: SW_String;
S: UnicodeString;
{$else FV_UNICODE}
S: String;
{$endif FV_UNICODE}
Type Type
FrameLineType = (UpperLine,NormalLine,SeparationLine,LowerLine); FrameLineType = (UpperLine,NormalLine,SeparationLine,LowerLine);
{$ifdef FV_UNICODE} {$ifdef FV_UNICODE}
@ -1382,11 +1365,7 @@ END;
{--TStatusLine--------------------------------------------------------------} {--TStatusLine--------------------------------------------------------------}
{ Hint -> Platforms DOS/DPMI/WIN/NT/OS2 - Updated 11May98 LdB } { Hint -> Platforms DOS/DPMI/WIN/NT/OS2 - Updated 11May98 LdB }
{---------------------------------------------------------------------------} {---------------------------------------------------------------------------}
{$ifdef FV_UNICODE} FUNCTION TStatusLine.Hint (AHelpCtx: Word): Sw_String;
FUNCTION TStatusLine.Hint (AHelpCtx: Word): UnicodeString;
{$else FV_UNICODE}
FUNCTION TStatusLine.Hint (AHelpCtx: Word): String;
{$endif FV_UNICODE}
BEGIN BEGIN
Hint := ''; { Return nothing } Hint := ''; { Return nothing }
END; END;
@ -1562,11 +1541,7 @@ END;
PROCEDURE TStatusLine.DrawSelect (Selected: PStatusItem); PROCEDURE TStatusLine.DrawSelect (Selected: PStatusItem);
VAR I, L: SmallInt; Color, CSelect, CNormal, CSelDisabled, CNormDisabled: Word; VAR I, L: SmallInt; Color, CSelect, CNormal, CSelDisabled, CNormDisabled: Word;
B: TDrawBuffer; T: PStatusItem; B: TDrawBuffer; T: PStatusItem;
{$ifdef FV_UNICODE} HintBuf: Sw_String;
HintBuf: UnicodeString;
{$else FV_UNICODE}
HintBuf: String;
{$endif FV_UNICODE}
BEGIN BEGIN
CNormal := GetColor($0301); { Normal colour } CNormal := GetColor($0301); { Normal colour }
CSelect := GetColor($0604); { Select colour } CSelect := GetColor($0604); { Select colour }
@ -1773,13 +1748,8 @@ END;
{---------------------------------------------------------------------------} {---------------------------------------------------------------------------}
{ NewStatusKey -> Platforms DOS/DPMI/WIN/NT/OS2 - Updated 15May98 LdB } { NewStatusKey -> Platforms DOS/DPMI/WIN/NT/OS2 - Updated 15May98 LdB }
{---------------------------------------------------------------------------} {---------------------------------------------------------------------------}
{$ifdef FV_UNICODE} FUNCTION NewStatusKey (AText: Sw_String; AKeyCode: Word; ACommand: Word;
FUNCTION NewStatusKey (AText: UnicodeString; AKeyCode: Word; ACommand: Word;
ANext: PStatusItem): PStatusItem; ANext: PStatusItem): PStatusItem;
{$else FV_UNICODE}
FUNCTION NewStatusKey (AText: String; AKeyCode: Word; ACommand: Word;
ANext: PStatusItem): PStatusItem;
{$endif FV_UNICODE}
VAR T: PStatusItem; VAR T: PStatusItem;
BEGIN BEGIN
New(T); { Allocate memory } New(T); { Allocate memory }