Browse Source

+ unicode fixes

git-svn-id: branches/unicodekvm@48642 -
nickysn 4 years ago
parent
commit
d96b84cf1f
1 changed files with 16 additions and 8 deletions
  1. 16 8
      packages/fv/src/dialogs.inc

+ 16 - 8
packages/fv/src/dialogs.inc

@@ -3269,7 +3269,7 @@ END;
 {--THistoryViewer-----------------------------------------------------------}
 {--THistoryViewer-----------------------------------------------------------}
 {  GetText -> Platforms DOS/DPMI/WIN/NT/OS2 - Updated 26Oct99 LdB           }
 {  GetText -> Platforms DOS/DPMI/WIN/NT/OS2 - Updated 26Oct99 LdB           }
 {---------------------------------------------------------------------------}
 {---------------------------------------------------------------------------}
-FUNCTION THistoryViewer.GetText (Item: Sw_Integer; MaxLen: Sw_Integer): String;
+FUNCTION THistoryViewer.GetText (Item: Sw_Integer; MaxLen: Sw_Integer): Sw_String;
 BEGIN
 BEGIN
    GetText := HistoryStr(HistoryId, Item);            { Return history string }
    GetText := HistoryStr(HistoryId, Item);            { Return history string }
 END;
 END;
@@ -3310,7 +3310,7 @@ END;
 {--THistoryWindow-----------------------------------------------------------}
 {--THistoryWindow-----------------------------------------------------------}
 {  GetSelection -> Platforms DOS/DPMI/WIN/NT/OS2 - Updated 26Oct99 LdB      }
 {  GetSelection -> Platforms DOS/DPMI/WIN/NT/OS2 - Updated 26Oct99 LdB      }
 {---------------------------------------------------------------------------}
 {---------------------------------------------------------------------------}
-FUNCTION THistoryWindow.GetSelection: String;
+FUNCTION THistoryWindow.GetSelection: Sw_String;
 BEGIN
 BEGIN
    If (Viewer = Nil) Then GetSelection := '' Else     { Return empty string }
    If (Viewer = Nil) Then GetSelection := '' Else     { Return empty string }
      GetSelection := Viewer^.GetText(Viewer^.Focused,
      GetSelection := Viewer^.GetText(Viewer^.Focused,
@@ -3399,7 +3399,7 @@ END;
 {--THistory-----------------------------------------------------------------}
 {--THistory-----------------------------------------------------------------}
 {  RecordHistory -> Platforms DOS/DPMI/WIN/NT/OS2 - Updated 26Oct99 LdB     }
 {  RecordHistory -> Platforms DOS/DPMI/WIN/NT/OS2 - Updated 26Oct99 LdB     }
 {---------------------------------------------------------------------------}
 {---------------------------------------------------------------------------}
-PROCEDURE THistory.RecordHistory (CONST S: String);
+PROCEDURE THistory.RecordHistory (CONST S: Sw_String);
 BEGIN
 BEGIN
    HistoryAdd(HistoryId, S);                          { Add to history }
    HistoryAdd(HistoryId, S);                          { Add to history }
 END;
 END;
@@ -3430,7 +3430,7 @@ BEGIN
        ClearEvent(Event);                             { Event was handled }
        ClearEvent(Event);                             { Event was handled }
        Exit;                                          { Now exit }
        Exit;                                          { Now exit }
       End;
       End;
-     RecordHistory(Link^.Data^);                      { Record current data }
+     RecordHistory(Link^.Data Sw_PString_DeRef);      { Record current data }
      Link^.GetBounds(R);                              { Get view bounds }
      Link^.GetBounds(R);                              { Get view bounds }
      Dec(R.A.X);                                      { One char in from us }
      Dec(R.A.X);                                      { One char in from us }
      Inc(R.B.X);                                      { One char short of us }
      Inc(R.B.X);                                      { One char short of us }
@@ -3446,7 +3446,7 @@ BEGIN
          Rslt := HistoryWindow^.GetSelection;         { Get history selection }
          Rslt := HistoryWindow^.GetSelection;         { Get history selection }
          If Length(Rslt) > Link^.MaxLen Then
          If Length(Rslt) > Link^.MaxLen Then
             SetLength(Rslt, Link^.MaxLen);            { Hold new length }
             SetLength(Rslt, Link^.MaxLen);            { Hold new length }
-         Link^.Data^ := Rslt;                         { Hold new selection }
+         Link^.Data Sw_PString_DeRef := Rslt;         { Hold new selection }
          Link^.SelectAll(True);                       { Select all string }
          Link^.SelectAll(True);                       { Select all string }
          Link^.DrawView;                              { Redraw link view }
          Link^.DrawView;                              { Redraw link view }
        End;
        End;
@@ -3457,7 +3457,7 @@ BEGIN
      If ((Event.Command = cmReleasedFocus) AND
      If ((Event.Command = cmReleasedFocus) AND
      (Event.InfoPtr = Link)) OR
      (Event.InfoPtr = Link)) OR
      (Event.Command = cmRecordHistory) Then           { Record command }
      (Event.Command = cmRecordHistory) Then           { Record command }
-       RecordHistory(Link^.Data^);                    { Record the history }
+       RecordHistory(Link^.Data Sw_PString_DeRef);    { Record the history }
 END;
 END;
 
 
 {****************************************************************************}
 {****************************************************************************}
@@ -3553,10 +3553,14 @@ var
   LocalRec: TBrowseInputLineRec absolute Rec;
   LocalRec: TBrowseInputLineRec absolute Rec;
 begin
 begin
   if (Validator = nil) or
   if (Validator = nil) or
-    (Validator^.Transfer(Data^,@LocalRec.Text, vtGetData) = 0) then
+    (Validator^.Transfer(Data Sw_PString_DeRef,@LocalRec.Text, vtGetData) = 0) then
   begin
   begin
+{$ifdef FV_UNICODE}
+    LocalRec.Text := Data;
+{$else FV_UNICODE}
     FillChar(LocalRec.Text, DataSize, #0);
     FillChar(LocalRec.Text, DataSize, #0);
     Move(Data^, LocalRec.Text, Length(Data^) + 1);
     Move(Data^, LocalRec.Text, Length(Data^) + 1);
+{$endif FV_UNICODE}
   end;
   end;
   LocalRec.History := History;
   LocalRec.History := History;
 end;
 end;
@@ -3569,8 +3573,12 @@ var
   LocalRec: TBrowseInputLineRec absolute Rec;
   LocalRec: TBrowseInputLineRec absolute Rec;
 begin
 begin
   if (Validator = nil) or
   if (Validator = nil) or
-    (Validator^.Transfer(Data^, @LocalRec.Text, vtSetData) = 0) then
+    (Validator^.Transfer(Data Sw_PString_DeRef, @LocalRec.Text, vtSetData) = 0) then
+{$ifdef FV_UNICODE}
+    Data := LocalRec.Text;
+{$else FV_UNICODE}
     Move(LocalRec.Text, Data^[0], MaxLen + 1);
     Move(LocalRec.Text, Data^[0], MaxLen + 1);
+{$endif FV_UNICODE}
   History := LocalRec.History;
   History := LocalRec.History;
   SelectAll(True);
   SelectAll(True);
 end;
 end;