Browse Source

* fix UseFixedFont related code

pierre 23 years ago
parent
commit
e1ebb04b9b
4 changed files with 40 additions and 24 deletions
  1. 8 3
      fv/menus.pas
  2. 12 9
      fv/views.pas
  3. 8 3
      fvision/menus.pas
  4. 12 9
      fvision/views.pas

+ 8 - 3
fv/menus.pas

@@ -1112,6 +1112,8 @@ BEGIN
            Begin
              CreateBorder(NormalLine);
              Index:=2;
+             If UseFixedFont then
+               MoveChar(B, ' ', Color, Size.X-4);    { Clear buffer }
            End
          Else
            Begin
@@ -1122,14 +1124,14 @@ BEGIN
          MoveCStr(B[Index], S, Color);                { Transfer string }
          If (P^.Command <> 0) AND(P^.Param <> Nil)
          Then Begin
-           if TextModeGFV then
+           if TextModeGFV or UseFixedFont then
             MoveCStr(B[Size.X - 3 - Length(P^.Param^)], P^.Param^, Color)  { Add param chars }
            else
             S := S + ' - ' + P^.Param^;                { Add to string }
          End;
          If (OldItem = Nil) OR (OldItem = P) OR
          (Current = P) Then Begin                     { We need to fix draw }
-           If TextModeGFV then
+           If TextModeGFV or UseFixedFont then
              WriteBuf(0, Y, Size.X, 1, B)             { Write the whole line }
            Else
              WriteBuf(2, Y, CStrLen(S), 1, B);          { Write the line }
@@ -1740,7 +1742,10 @@ END;
 END.
 {
  $Log$
- Revision 1.11  2002-05-21 10:53:25  pierre
+ Revision 1.12  2002-05-29 19:36:52  pierre
+  * fix UseFixedFont related code
+
+ Revision 1.11  2002/05/21 10:53:25  pierre
   * fix graphical separation lines
 
  Revision 1.10  2001/08/05 21:49:56  pierre

+ 12 - 9
fv/views.pas

@@ -1584,7 +1584,7 @@ BEGIN
 {$endif}
     Begin   { Check enough memory }
      GetMem(Ca, SizeOf(TComplexArea));                { Allocate memory }
-     GetViewSettings(ViewPort, TextModeGFV);          { Fetch view port }
+     GetViewSettings(ViewPort, TextModeGFV or UseFixedFont);          { Fetch view port }
      Ca^.X1 := ViewPort.X1;                           { Hold current X1 }
      Ca^.Y1 := ViewPort.Y1;                           { Hold current Y1 }
      Ca^.X2 := ViewPort.X2;                           { Hold current X2 }
@@ -1607,7 +1607,7 @@ BEGIN
          Then Y2 := P^.RawOrigin.Y + P^.RawSize.Y;    { Y maximum contain }
        P := P^.Owner;                                 { Move to owners owner }
      End;
-     If TextModeGFV then Begin
+     If TextModeGFV or UseFixedFont then Begin
        X1 := X1 div SysFontWidth;
        X2 := (X2 +SysFontWidth - 1) div SysFontWidth;
        Y1 := Y1 div SysFontHeight;
@@ -1625,7 +1625,7 @@ BEGIN
        If (Y2 > ViewPort.Y2) Then Y2 := ViewPort.Y2;  { Adjust y2 to locked }
      End;
 
-     SetViewPort(X1, Y1, X2, Y2, ClipOn, TextModeGFV);{ Set new clip limits }
+     SetViewPort(X1, Y1, X2, Y2, ClipOn, TextModeGFV or UseFixedFont);{ Set new clip limits }
    End;
 END;
 
@@ -1642,7 +1642,7 @@ BEGIN
        Bc := GetColor(1) AND $F0 SHR 4 Else           { Select back colour }
        Bc := GetColor(4) AND $F0 SHR 4;               { Disabled back colour }
      GetViewSettings(ViewPort, TextModeGFV);          { Get view settings }
-     If (TextModeGFV <> True) Then Begin            { GRAPHICS MODE GFV }
+     If not TextModeGFV and not UseFixedFont Then Begin            { GRAPHICS MODE GFV }
        If (ViewPort.X1 <= RawOrigin.X) Then X1 := 0     { Right to left edge }
          Else X1 := ViewPort.X1-RawOrigin.X;            { Offset from left }
        If (ViewPort.Y1 <= RawOrigin.Y) Then Y1 := 0     { Right to top edge }
@@ -1692,7 +1692,7 @@ BEGIN
    If (P <> Nil) Then Begin                           { Valid complex area }
      HoldLimit := P^.NextArea;                        { Move to prior area }
      SetViewPort(P^.X1, P^.Y1, P^.X2, P^.Y2, ClipOn,
-       TextModeGFV);                                  { Restore clip limits }
+       TextModeGFV or UseFixedFont);                                  { Restore clip limits }
      FreeMem(P, SizeOf(TComplexArea));                { Release memory }
    End;
 END;
@@ -4674,7 +4674,7 @@ BEGIN
        X := RawOrigin.X + Abs(X);
        Y := RawOrigin.Y + Abs(Y);
      End;
-     If TextModeGFV then Begin
+     If TextModeGFV or UseFixedFont then Begin
        X := X DIV SysFontWidth;
        Y := Y DIV SysFontHeight;
      End;
@@ -4723,7 +4723,7 @@ BEGIN
        X := RawOrigin.X + Abs(X);
        Y := RawOrigin.Y + Abs(Y);
      End;
-     If TextModeGFV then Begin
+     If TextModeGFV or UseFixedFont then Begin
        X := X DIV SysFontWidth;
        Y := Y DIV SysFontHeight;
      End;
@@ -4977,7 +4977,7 @@ BEGIN
      End;
 {$endif DEBUG}
   { Direct wrong method }
-  GetViewSettings(ViewPort, TextModeGFV);          { Get set viewport }
+  GetViewSettings(ViewPort, TextModeGFV or UseFixedFont);          { Get set viewport }
   { Pedestrian character method }
   { Must be in area }
   If (X+L<ViewPort.X1) OR (Y<ViewPort.Y1) OR
@@ -5570,7 +5570,10 @@ END.
 
 {
  $Log$
- Revision 1.25  2002-05-28 19:15:16  pierre
+ Revision 1.26  2002-05-29 19:36:52  pierre
+  * fix UseFixedFont related code
+
+ Revision 1.25  2002/05/28 19:15:16  pierre
   * adapt to new GraphUpdateScreen function
 
  Revision 1.24  2002/05/25 23:30:47  pierre

+ 8 - 3
fvision/menus.pas

@@ -1112,6 +1112,8 @@ BEGIN
            Begin
              CreateBorder(NormalLine);
              Index:=2;
+             If UseFixedFont then
+               MoveChar(B, ' ', Color, Size.X-4);    { Clear buffer }
            End
          Else
            Begin
@@ -1122,14 +1124,14 @@ BEGIN
          MoveCStr(B[Index], S, Color);                { Transfer string }
          If (P^.Command <> 0) AND(P^.Param <> Nil)
          Then Begin
-           if TextModeGFV then
+           if TextModeGFV or UseFixedFont then
             MoveCStr(B[Size.X - 3 - Length(P^.Param^)], P^.Param^, Color)  { Add param chars }
            else
             S := S + ' - ' + P^.Param^;                { Add to string }
          End;
          If (OldItem = Nil) OR (OldItem = P) OR
          (Current = P) Then Begin                     { We need to fix draw }
-           If TextModeGFV then
+           If TextModeGFV or UseFixedFont then
              WriteBuf(0, Y, Size.X, 1, B)             { Write the whole line }
            Else
              WriteBuf(2, Y, CStrLen(S), 1, B);          { Write the line }
@@ -1740,7 +1742,10 @@ END;
 END.
 {
  $Log$
- Revision 1.11  2002-05-21 10:53:25  pierre
+ Revision 1.12  2002-05-29 19:36:52  pierre
+  * fix UseFixedFont related code
+
+ Revision 1.11  2002/05/21 10:53:25  pierre
   * fix graphical separation lines
 
  Revision 1.10  2001/08/05 21:49:56  pierre

+ 12 - 9
fvision/views.pas

@@ -1584,7 +1584,7 @@ BEGIN
 {$endif}
     Begin   { Check enough memory }
      GetMem(Ca, SizeOf(TComplexArea));                { Allocate memory }
-     GetViewSettings(ViewPort, TextModeGFV);          { Fetch view port }
+     GetViewSettings(ViewPort, TextModeGFV or UseFixedFont);          { Fetch view port }
      Ca^.X1 := ViewPort.X1;                           { Hold current X1 }
      Ca^.Y1 := ViewPort.Y1;                           { Hold current Y1 }
      Ca^.X2 := ViewPort.X2;                           { Hold current X2 }
@@ -1607,7 +1607,7 @@ BEGIN
          Then Y2 := P^.RawOrigin.Y + P^.RawSize.Y;    { Y maximum contain }
        P := P^.Owner;                                 { Move to owners owner }
      End;
-     If TextModeGFV then Begin
+     If TextModeGFV or UseFixedFont then Begin
        X1 := X1 div SysFontWidth;
        X2 := (X2 +SysFontWidth - 1) div SysFontWidth;
        Y1 := Y1 div SysFontHeight;
@@ -1625,7 +1625,7 @@ BEGIN
        If (Y2 > ViewPort.Y2) Then Y2 := ViewPort.Y2;  { Adjust y2 to locked }
      End;
 
-     SetViewPort(X1, Y1, X2, Y2, ClipOn, TextModeGFV);{ Set new clip limits }
+     SetViewPort(X1, Y1, X2, Y2, ClipOn, TextModeGFV or UseFixedFont);{ Set new clip limits }
    End;
 END;
 
@@ -1642,7 +1642,7 @@ BEGIN
        Bc := GetColor(1) AND $F0 SHR 4 Else           { Select back colour }
        Bc := GetColor(4) AND $F0 SHR 4;               { Disabled back colour }
      GetViewSettings(ViewPort, TextModeGFV);          { Get view settings }
-     If (TextModeGFV <> True) Then Begin            { GRAPHICS MODE GFV }
+     If not TextModeGFV and not UseFixedFont Then Begin            { GRAPHICS MODE GFV }
        If (ViewPort.X1 <= RawOrigin.X) Then X1 := 0     { Right to left edge }
          Else X1 := ViewPort.X1-RawOrigin.X;            { Offset from left }
        If (ViewPort.Y1 <= RawOrigin.Y) Then Y1 := 0     { Right to top edge }
@@ -1692,7 +1692,7 @@ BEGIN
    If (P <> Nil) Then Begin                           { Valid complex area }
      HoldLimit := P^.NextArea;                        { Move to prior area }
      SetViewPort(P^.X1, P^.Y1, P^.X2, P^.Y2, ClipOn,
-       TextModeGFV);                                  { Restore clip limits }
+       TextModeGFV or UseFixedFont);                                  { Restore clip limits }
      FreeMem(P, SizeOf(TComplexArea));                { Release memory }
    End;
 END;
@@ -4674,7 +4674,7 @@ BEGIN
        X := RawOrigin.X + Abs(X);
        Y := RawOrigin.Y + Abs(Y);
      End;
-     If TextModeGFV then Begin
+     If TextModeGFV or UseFixedFont then Begin
        X := X DIV SysFontWidth;
        Y := Y DIV SysFontHeight;
      End;
@@ -4723,7 +4723,7 @@ BEGIN
        X := RawOrigin.X + Abs(X);
        Y := RawOrigin.Y + Abs(Y);
      End;
-     If TextModeGFV then Begin
+     If TextModeGFV or UseFixedFont then Begin
        X := X DIV SysFontWidth;
        Y := Y DIV SysFontHeight;
      End;
@@ -4977,7 +4977,7 @@ BEGIN
      End;
 {$endif DEBUG}
   { Direct wrong method }
-  GetViewSettings(ViewPort, TextModeGFV);          { Get set viewport }
+  GetViewSettings(ViewPort, TextModeGFV or UseFixedFont);          { Get set viewport }
   { Pedestrian character method }
   { Must be in area }
   If (X+L<ViewPort.X1) OR (Y<ViewPort.Y1) OR
@@ -5570,7 +5570,10 @@ END.
 
 {
  $Log$
- Revision 1.25  2002-05-28 19:15:16  pierre
+ Revision 1.26  2002-05-29 19:36:52  pierre
+  * fix UseFixedFont related code
+
+ Revision 1.25  2002/05/28 19:15:16  pierre
   * adapt to new GraphUpdateScreen function
 
  Revision 1.24  2002/05/25 23:30:47  pierre