* some corrections for linux

This commit is contained in:
pierre 2001-05-04 08:42:54 +00:00
parent 495c9648fa
commit 76b93862cf
11 changed files with 162 additions and 62 deletions

View File

@ -814,7 +814,7 @@ BEGIN
CreateWindowNow(swp_Show); { Create app window }
{$ENDIF}
{$ENDIF}
{$IFNDEF OS_DOS} { WIN/NT/OS2 CODE }
{$IFNDEF NO_WINDOW} { WIN/NT/OS2 CODE }
AppWindow := HWindow; { Set app window handle }
Size.X := ScreenWidth; { Set x size value }
Size.Y := ScreenHeight; { Set y size value }
@ -845,7 +845,7 @@ BEGIN
For I := 0 To 15 Do DeleteObject(ColBrush[I]); { Delete brushes }
For I := 0 To 15 Do DeleteObject(ColPen[I]); { Delete pens }
{$ENDIF}
{$IFNDEF OS_DOS} { WIN/NT/OS2 CODE }
{$IFNDEF NO_WINDOW} { WIN/NT/OS2 CODE }
AppWindow := 0; { Zero app window handle }
{$ENDIF}
END;
@ -1325,7 +1325,10 @@ END;
END.
{
$Log$
Revision 1.5 2001-05-03 22:32:52 pierre
Revision 1.6 2001-05-04 08:42:54 pierre
* some corrections for linux
Revision 1.5 2001/05/03 22:32:52 pierre
new bunch of changes, displays something for dos at least
Revision 1.4 2001/04/10 21:57:55 pierre

View File

@ -262,7 +262,7 @@ TYPE
{ TCluster OBJECT - CLUSTER ANCESTOR OBJECT }
{---------------------------------------------------------------------------}
TYPE
{$IFNDEF OS_DOS} { WIN/NT/OS2 CODE }
{$IFNDEF NO_WINDOW} { WIN/NT/OS2 CODE }
TWndArray = Array [0..32000] Of HWnd; { Window handle array }
PWndArray = ^TWndArray; { Ptr to handle array }
{$ENDIF}
@ -273,7 +273,7 @@ TYPE
Value : LongInt; { Bit value }
EnableMask: LongInt; { Mask enable bits }
Strings : TStringCollection; { String collection }
{$IFNDEF OS_DOS} { WIN/NT/OS2 DATA }
{$IFNDEF NO_WINDOW} { WIN/NT/OS2 DATA }
WndHandles: PWndArray; { Window handle array }
{$ENDIF}
CONSTRUCTOR Init (Var Bounds: TRect; AStrings: PSItem);
@ -703,6 +703,7 @@ USES HistList; { Standard GFV unit }
{ LEFT AND RIGHT ARROW CHARACTER CONSTANTS }
{---------------------------------------------------------------------------}
{$IFDEF OS_DOS} CONST LeftArr = #17; RightArr = #16; {$ENDIF}
{$IFDEF OS_LINUX} CONST LeftArr = #17; RightArr = #16; {$ENDIF}
{$IFDEF OS_WINDOWS} CONST LeftArr = #$AB; RightArr = #$BB; {$ENDIF}
{$IFDEF OS_OS2} CONST LeftArr = #17; RightArr = #16; {$ENDIF}
@ -738,6 +739,7 @@ BEGIN
{$IFDEF BIT_32} { 32 BIT CODE }
LongInt(P) := GetProp(Wnd, ViewPtr); { Fetch cluster ptr }
{$ENDIF}
{$ifndef NO_WINDOW}
If (P <> Nil) AND (P^.WndHandles <> Nil) { Cluster/handles valid }
Then Begin
If (P^.State AND sfFocused = 0) Then { We have not focus }
@ -760,6 +762,7 @@ BEGIN
P^.DrawView; { Redraw partial view }
End;
End;
{$endif NO_WINDOW}
End;
End Else
TvClusterMsgHandler := TvViewMsgHandler(Wnd,
@ -1833,7 +1836,7 @@ END;
{---------------------------------------------------------------------------}
PROCEDURE TCluster.DrawFocus;
BEGIN
{$IFNDEF OS_DOS} { WIN/NT/OS2 CODE }
{$IFNDEF NO_WINDOW} { WIN/NT/OS2 CODE }
If (WndHandles <> Nil) Then { Valid window handles }
If (State AND sfFocused <> 0) Then Begin { View is focused }
If (Sel >= 0) AND (Sel < Strings.Count) Then
@ -1891,7 +1894,7 @@ VAR I, J, K, Cur, Col: Integer; CNorm, CSel, CDis, Color: Word; B: TDrawBuffer;
Tb, SCOff: Byte;
{$IFNDEF OS_DOS} S: String; P: PString; Q: PChar; {$ENDIF}
BEGIN
{$IFDEF OS_DOS} { DOS/DPMI CODE }
{$IFDEF NO_WINDOW} { DOS/DPMI CODE }
CNorm := GetColor($0301); { Normal colour }
CSel := GetColor($0402); { Selected colour }
CDis := GetColor($0505); { Disabled colour }
@ -3216,7 +3219,10 @@ END;
END.
{
$Log$
Revision 1.4 2001-05-03 22:32:52 pierre
Revision 1.5 2001-05-04 08:42:54 pierre
* some corrections for linux
Revision 1.4 2001/05/03 22:32:52 pierre
new bunch of changes, displays something for dos at least
Revision 1.3 2001/04/10 21:29:55 pierre

View File

@ -128,7 +128,11 @@ USES
{$ENDIF}
{$IFDEF OS_LINUX}
unix,
{$ifdef VER1_0}
linux,
{$else}
unix,
{$endif}
{$DEFINE Use_API}
{$ENDIF}
@ -3015,7 +3019,10 @@ BEGIN
END.
{
$Log$
Revision 1.5 2001-05-03 22:32:52 pierre
Revision 1.6 2001-05-04 08:42:55 pierre
* some corrections for linux
Revision 1.5 2001/05/03 22:32:52 pierre
new bunch of changes, displays something for dos at least
Revision 1.4 2001/04/10 21:57:55 pierre

View File

@ -171,6 +171,10 @@ PROCEDURE SecondsToTime (Sd: LongInt; Var Hour24, Minute, Second: Word);
{$ENDIF}
{$ifdef OS_LINUX}
USES Dos;
{$endif OS_LINUX}
{***************************************************************************}
{ INTERFACE ROUTINES }
{***************************************************************************}
@ -298,6 +302,11 @@ BEGIN
DosSetDateTime(DT); { Set the time }
END;
{$ENDIF}
{$ifdef OS_LINUX}
BEGIN
{settime is dummy in Linux}
END;
{$endif OS_LINUX}
{---------------------------------------------------------------------------}
{ GetTime -> Platforms DOS/DPMI/WIN/NT/OS2 - Updated 06Nov97 LdB }
@ -400,6 +409,11 @@ BEGIN
Sec100 := DT.Hundredths; { Transfer hundredths }
END;
{$ENDIF}
{$ifdef OS_LINUX}
BEGIN
Dos.GetTime(Hour,Minute,Second,Sec100);
END;
{$endif OS_LINUX}
{---------------------------------------------------------------------------}
{ MinutesToTime -> Platforms DOS/DPMI/WIN/NT/OS2 - Updated 19Jun97 LdB }
@ -424,8 +438,11 @@ END.
{
$Log$
Revision 1.2 2000-08-24 12:00:22 marco
Revision 1.3 2001-05-04 08:42:56 pierre
* some corrections for linux
Revision 1.2 2000/08/24 12:00:22 marco
* CVS log and ID tags
}
}

View File

@ -419,7 +419,7 @@ TYPE
Client : HWnd; { Client handle }
Ps : HPs; { Paint structure }
{$ENDIF}
{$IFNDEF OS_DOS} { WIN/NT/OS2 DATA ONLY }
{$IFNDEF NO_WINDOW} { WIN/NT/OS2 DATA ONLY }
FrameSize: Integer; { Frame size (X) }
CaptSize : Integer; { Caption size (Y) }
HWindow : HWnd; { Window handle }
@ -1769,7 +1769,7 @@ END;
{---------------------------------------------------------------------------}
FUNCTION TView.TextWidth (Txt: String): Integer;
VAR I: Integer; S: String;
{$IFNDEF OS_DOS} P: Pointer; Wnd: HWnd; {$ENDIF}
{$IFNDEF NO_WINDOW} P: Pointer; Wnd: HWnd; {$ENDIF}
{$IFDEF OS_WINDOWS} ODc: HDc; M: TSize; {$ENDIF}
{$IFDEF OS_OS2} OPs: HPs; Pt: Array [0..3] Of PointL; {$ENDIF}
BEGIN
@ -5449,9 +5449,9 @@ END;
{ GraphLine -> Platforms DOS/DPMI/WIN/NT/OS2 - Updated 22Sep99 LdB }
{---------------------------------------------------------------------------}
PROCEDURE TView.GraphLine (X1, Y1, X2, Y2: Integer; Colour: Byte);
VAR {$IFDEF OS_DOS} ViewPort: ViewPortType; {$ENDIF} { DOS/DPMI VARIABLES }
{$IFDEF OS_WINDOWS} I: Word; ODc: hDc; {$ENDIF} { WIN/NT VARIABLES }
{$IFDEF OS_OS2} I: LongInt; Lp: PointL; OPs: HPs; {$ENDIF}{ OS2 VARIABLES }
{$IFDEF OS_DOS} VAR ViewPort: ViewPortType; {$ENDIF} { DOS/DPMI VARIABLES }
{$IFDEF OS_WINDOWS}VAR I: Word; ODc: hDc; {$ENDIF} { WIN/NT VARIABLES }
{$IFDEF OS_OS2}VAR I: LongInt; Lp: PointL; OPs: HPs; {$ENDIF}{ OS2 VARIABLES }
BEGIN
{$IFDEF OS_DOS} { DOS/DPMI CODE }
GetViewSettings(ViewPort, TextModeGFV); { Get viewport settings }
@ -5522,9 +5522,9 @@ BEGIN
END;
PROCEDURE TView.GraphRectangle (X1, Y1, X2, Y2: Integer; Colour: Byte);
VAR {$IFDEF OS_DOS} ViewPort: ViewPortType; {$ENDIF}
{$IFDEF OS_WINDOWS} I: Word; ODc: hDc; {$ENDIF}
{$IFDEF OS_OS2} Lp: PointL; OPs: HPs; {$ENDIF}
{$IFDEF OS_DOS}VAR ViewPort: ViewPortType; {$ENDIF}
{$IFDEF OS_WINDOWS}VAR I: Word; ODc: hDc; {$ENDIF}
{$IFDEF OS_OS2}VAR Lp: PointL; OPs: HPs; {$ENDIF}
BEGIN
{$IFDEF OS_DOS} { DOS/DPMI CODE }
If (TextModeGFV <> TRUE) Then Begin { GRAPHICS MODE GFV }
@ -5807,8 +5807,15 @@ BEGIN
then begin
P := @TDrawBuffer(Buf); { Set draw buffer ptr }
L := 0; { Set buffer position }
X := X + Origin.X;
Y := Y + Origin.Y;
If (X >= 0) AND (Y >= 0) AND ((GOptions and (goGraphical or goGraphView))=0) Then Begin
X := RawOrigin.X+X*FontWidth; { X position }
Y := RawOrigin.Y+Y*FontHeight; { Y position }
End Else Begin
X := RawOrigin.X + Abs(X);
Y := RawOrigin.Y + Abs(Y);
End;
X := X DIV SysFontWidth;
Y := Y DIV SysFontHeight;
For J := 1 To H Do Begin { For each line }
K := X; { Reset x position }
For I := 0 To (W-1) Do Begin { For each character }
@ -5908,8 +5915,15 @@ BEGIN
{$ifdef Use_API}
then begin
P := @TDrawBuffer(Buf); { Set draw buffer ptr }
X := X + Origin.X;
Y := Y + Origin.Y;
If (X >= 0) AND (Y >= 0) AND ((GOptions and (goGraphical or goGraphView))=0) Then Begin
X := RawOrigin.X+X*FontWidth; { X position }
Y := RawOrigin.Y+Y*FontHeight; { Y position }
End Else Begin
X := RawOrigin.X + Abs(X);
Y := RawOrigin.Y + Abs(Y);
End;
X := X DIV SysFontWidth;
Y := Y DIV SysFontHeight;
For J := 1 To H Do Begin { For each line }
K := X; { Reset x position }
For I := 0 To (W-1) Do Begin { For each character }
@ -6047,7 +6061,7 @@ BEGIN
{$IFDEF Use_API}
If (X >= 0) AND (Y >= 0) Then Begin
If (X >= 0) AND (Y >= 0) AND ((GOptions and goGraphView)=0) Then Begin
X := RawOrigin.X+X*FontWidth; { X position }
Y := RawOrigin.Y+Y*FontHeight; { Y position }
End Else Begin
@ -6058,7 +6072,7 @@ BEGIN
Tiy := Y DIV SysFontHeight;
For Ti := 1 To length(Str) Do Begin
VideoBuf^[((Tiy * Drivers.ScreenWidth)+Tix)] := (GetColor(Color) shl 8) or Ord(Str[Ti]);
Tix := Tix + SysFontWidth;
Inc(Tix);
end;
UpdateScreen(false);
{$ELSE not Use_API}
@ -6180,7 +6194,7 @@ BEGIN
Fc := Col AND $0F; { Foreground colour }
Bc := Col AND $F0 SHR 4; { Background colour }
FillChar(S[1], 255, C); { Fill the string }
If (X >= 0) AND (Y >= 0) Then Begin
If (X >= 0) AND (Y >= 0) AND ((GOptions and (goGraphical or goGraphView))=0) Then Begin
X := RawOrigin.X+X*FontWidth; { X position }
Y := RawOrigin.Y+Y*FontHeight; { Y position }
End Else Begin
@ -6784,7 +6798,10 @@ END.
{
$Log$
Revision 1.5 2001-05-03 22:32:52 pierre
Revision 1.6 2001-05-04 08:42:56 pierre
* some corrections for linux
Revision 1.5 2001/05/03 22:32:52 pierre
new bunch of changes, displays something for dos at least
Revision 1.4 2001/04/10 21:57:56 pierre

View File

@ -814,7 +814,7 @@ BEGIN
CreateWindowNow(swp_Show); { Create app window }
{$ENDIF}
{$ENDIF}
{$IFNDEF OS_DOS} { WIN/NT/OS2 CODE }
{$IFNDEF NO_WINDOW} { WIN/NT/OS2 CODE }
AppWindow := HWindow; { Set app window handle }
Size.X := ScreenWidth; { Set x size value }
Size.Y := ScreenHeight; { Set y size value }
@ -845,7 +845,7 @@ BEGIN
For I := 0 To 15 Do DeleteObject(ColBrush[I]); { Delete brushes }
For I := 0 To 15 Do DeleteObject(ColPen[I]); { Delete pens }
{$ENDIF}
{$IFNDEF OS_DOS} { WIN/NT/OS2 CODE }
{$IFNDEF NO_WINDOW} { WIN/NT/OS2 CODE }
AppWindow := 0; { Zero app window handle }
{$ENDIF}
END;
@ -1325,7 +1325,10 @@ END;
END.
{
$Log$
Revision 1.5 2001-05-03 22:32:52 pierre
Revision 1.6 2001-05-04 08:42:54 pierre
* some corrections for linux
Revision 1.5 2001/05/03 22:32:52 pierre
new bunch of changes, displays something for dos at least
Revision 1.4 2001/04/10 21:57:55 pierre

View File

@ -262,7 +262,7 @@ TYPE
{ TCluster OBJECT - CLUSTER ANCESTOR OBJECT }
{---------------------------------------------------------------------------}
TYPE
{$IFNDEF OS_DOS} { WIN/NT/OS2 CODE }
{$IFNDEF NO_WINDOW} { WIN/NT/OS2 CODE }
TWndArray = Array [0..32000] Of HWnd; { Window handle array }
PWndArray = ^TWndArray; { Ptr to handle array }
{$ENDIF}
@ -273,7 +273,7 @@ TYPE
Value : LongInt; { Bit value }
EnableMask: LongInt; { Mask enable bits }
Strings : TStringCollection; { String collection }
{$IFNDEF OS_DOS} { WIN/NT/OS2 DATA }
{$IFNDEF NO_WINDOW} { WIN/NT/OS2 DATA }
WndHandles: PWndArray; { Window handle array }
{$ENDIF}
CONSTRUCTOR Init (Var Bounds: TRect; AStrings: PSItem);
@ -703,6 +703,7 @@ USES HistList; { Standard GFV unit }
{ LEFT AND RIGHT ARROW CHARACTER CONSTANTS }
{---------------------------------------------------------------------------}
{$IFDEF OS_DOS} CONST LeftArr = #17; RightArr = #16; {$ENDIF}
{$IFDEF OS_LINUX} CONST LeftArr = #17; RightArr = #16; {$ENDIF}
{$IFDEF OS_WINDOWS} CONST LeftArr = #$AB; RightArr = #$BB; {$ENDIF}
{$IFDEF OS_OS2} CONST LeftArr = #17; RightArr = #16; {$ENDIF}
@ -738,6 +739,7 @@ BEGIN
{$IFDEF BIT_32} { 32 BIT CODE }
LongInt(P) := GetProp(Wnd, ViewPtr); { Fetch cluster ptr }
{$ENDIF}
{$ifndef NO_WINDOW}
If (P <> Nil) AND (P^.WndHandles <> Nil) { Cluster/handles valid }
Then Begin
If (P^.State AND sfFocused = 0) Then { We have not focus }
@ -760,6 +762,7 @@ BEGIN
P^.DrawView; { Redraw partial view }
End;
End;
{$endif NO_WINDOW}
End;
End Else
TvClusterMsgHandler := TvViewMsgHandler(Wnd,
@ -1833,7 +1836,7 @@ END;
{---------------------------------------------------------------------------}
PROCEDURE TCluster.DrawFocus;
BEGIN
{$IFNDEF OS_DOS} { WIN/NT/OS2 CODE }
{$IFNDEF NO_WINDOW} { WIN/NT/OS2 CODE }
If (WndHandles <> Nil) Then { Valid window handles }
If (State AND sfFocused <> 0) Then Begin { View is focused }
If (Sel >= 0) AND (Sel < Strings.Count) Then
@ -1891,7 +1894,7 @@ VAR I, J, K, Cur, Col: Integer; CNorm, CSel, CDis, Color: Word; B: TDrawBuffer;
Tb, SCOff: Byte;
{$IFNDEF OS_DOS} S: String; P: PString; Q: PChar; {$ENDIF}
BEGIN
{$IFDEF OS_DOS} { DOS/DPMI CODE }
{$IFDEF NO_WINDOW} { DOS/DPMI CODE }
CNorm := GetColor($0301); { Normal colour }
CSel := GetColor($0402); { Selected colour }
CDis := GetColor($0505); { Disabled colour }
@ -3216,7 +3219,10 @@ END;
END.
{
$Log$
Revision 1.4 2001-05-03 22:32:52 pierre
Revision 1.5 2001-05-04 08:42:54 pierre
* some corrections for linux
Revision 1.4 2001/05/03 22:32:52 pierre
new bunch of changes, displays something for dos at least
Revision 1.3 2001/04/10 21:29:55 pierre

View File

@ -128,7 +128,11 @@ USES
{$ENDIF}
{$IFDEF OS_LINUX}
unix,
{$ifdef VER1_0}
linux,
{$else}
unix,
{$endif}
{$DEFINE Use_API}
{$ENDIF}
@ -3015,7 +3019,10 @@ BEGIN
END.
{
$Log$
Revision 1.5 2001-05-03 22:32:52 pierre
Revision 1.6 2001-05-04 08:42:55 pierre
* some corrections for linux
Revision 1.5 2001/05/03 22:32:52 pierre
new bunch of changes, displays something for dos at least
Revision 1.4 2001/04/10 21:57:55 pierre

View File

@ -33,8 +33,7 @@ PROGRAM TestApp;
{ ****************************** END REMARK *** Leon de Boer, 06Nov99 * }
{$I Platform.inc}
USES
USES
{$IFDEF OS_OS2} Os2Def, os2PmApi, Drivers, {$ENDIF}
Objects, Views, Menus, Dialogs, App, { Standard GFV units }
Gadgets;
@ -156,7 +155,6 @@ BEGIN
MyApp.Init; { Initialize app }
{$IFDEF OS_WINDOWS}
{ Create a basic window with static text and radio }
{ buttons. The buttons should be orange and white }
R.Assign(5, 1, 35, 16); { Assign area }
@ -229,7 +227,6 @@ BEGIN
Desktop^.Insert(P); { Insert dialog }
End;
MyApp.Run; { Run the app }
{$ENDIF}
{$IFDEF OS_OS2}
while (MyApp.EndState = 0)
AND WinGetMsg(Anchor, Message, 0, 0, 0) Do Begin
@ -247,8 +244,11 @@ END.
{
$Log$
Revision 1.2 2000-08-24 12:00:22 marco
Revision 1.3 2001-05-04 08:42:55 pierre
* some corrections for linux
Revision 1.2 2000/08/24 12:00:22 marco
* CVS log and ID tags
}
}

View File

@ -171,6 +171,10 @@ PROCEDURE SecondsToTime (Sd: LongInt; Var Hour24, Minute, Second: Word);
{$ENDIF}
{$ifdef OS_LINUX}
USES Dos;
{$endif OS_LINUX}
{***************************************************************************}
{ INTERFACE ROUTINES }
{***************************************************************************}
@ -298,6 +302,11 @@ BEGIN
DosSetDateTime(DT); { Set the time }
END;
{$ENDIF}
{$ifdef OS_LINUX}
BEGIN
{settime is dummy in Linux}
END;
{$endif OS_LINUX}
{---------------------------------------------------------------------------}
{ GetTime -> Platforms DOS/DPMI/WIN/NT/OS2 - Updated 06Nov97 LdB }
@ -400,6 +409,11 @@ BEGIN
Sec100 := DT.Hundredths; { Transfer hundredths }
END;
{$ENDIF}
{$ifdef OS_LINUX}
BEGIN
Dos.GetTime(Hour,Minute,Second,Sec100);
END;
{$endif OS_LINUX}
{---------------------------------------------------------------------------}
{ MinutesToTime -> Platforms DOS/DPMI/WIN/NT/OS2 - Updated 19Jun97 LdB }
@ -424,8 +438,11 @@ END.
{
$Log$
Revision 1.2 2000-08-24 12:00:22 marco
Revision 1.3 2001-05-04 08:42:56 pierre
* some corrections for linux
Revision 1.2 2000/08/24 12:00:22 marco
* CVS log and ID tags
}
}

View File

@ -419,7 +419,7 @@ TYPE
Client : HWnd; { Client handle }
Ps : HPs; { Paint structure }
{$ENDIF}
{$IFNDEF OS_DOS} { WIN/NT/OS2 DATA ONLY }
{$IFNDEF NO_WINDOW} { WIN/NT/OS2 DATA ONLY }
FrameSize: Integer; { Frame size (X) }
CaptSize : Integer; { Caption size (Y) }
HWindow : HWnd; { Window handle }
@ -1769,7 +1769,7 @@ END;
{---------------------------------------------------------------------------}
FUNCTION TView.TextWidth (Txt: String): Integer;
VAR I: Integer; S: String;
{$IFNDEF OS_DOS} P: Pointer; Wnd: HWnd; {$ENDIF}
{$IFNDEF NO_WINDOW} P: Pointer; Wnd: HWnd; {$ENDIF}
{$IFDEF OS_WINDOWS} ODc: HDc; M: TSize; {$ENDIF}
{$IFDEF OS_OS2} OPs: HPs; Pt: Array [0..3] Of PointL; {$ENDIF}
BEGIN
@ -5449,9 +5449,9 @@ END;
{ GraphLine -> Platforms DOS/DPMI/WIN/NT/OS2 - Updated 22Sep99 LdB }
{---------------------------------------------------------------------------}
PROCEDURE TView.GraphLine (X1, Y1, X2, Y2: Integer; Colour: Byte);
VAR {$IFDEF OS_DOS} ViewPort: ViewPortType; {$ENDIF} { DOS/DPMI VARIABLES }
{$IFDEF OS_WINDOWS} I: Word; ODc: hDc; {$ENDIF} { WIN/NT VARIABLES }
{$IFDEF OS_OS2} I: LongInt; Lp: PointL; OPs: HPs; {$ENDIF}{ OS2 VARIABLES }
{$IFDEF OS_DOS} VAR ViewPort: ViewPortType; {$ENDIF} { DOS/DPMI VARIABLES }
{$IFDEF OS_WINDOWS}VAR I: Word; ODc: hDc; {$ENDIF} { WIN/NT VARIABLES }
{$IFDEF OS_OS2}VAR I: LongInt; Lp: PointL; OPs: HPs; {$ENDIF}{ OS2 VARIABLES }
BEGIN
{$IFDEF OS_DOS} { DOS/DPMI CODE }
GetViewSettings(ViewPort, TextModeGFV); { Get viewport settings }
@ -5522,9 +5522,9 @@ BEGIN
END;
PROCEDURE TView.GraphRectangle (X1, Y1, X2, Y2: Integer; Colour: Byte);
VAR {$IFDEF OS_DOS} ViewPort: ViewPortType; {$ENDIF}
{$IFDEF OS_WINDOWS} I: Word; ODc: hDc; {$ENDIF}
{$IFDEF OS_OS2} Lp: PointL; OPs: HPs; {$ENDIF}
{$IFDEF OS_DOS}VAR ViewPort: ViewPortType; {$ENDIF}
{$IFDEF OS_WINDOWS}VAR I: Word; ODc: hDc; {$ENDIF}
{$IFDEF OS_OS2}VAR Lp: PointL; OPs: HPs; {$ENDIF}
BEGIN
{$IFDEF OS_DOS} { DOS/DPMI CODE }
If (TextModeGFV <> TRUE) Then Begin { GRAPHICS MODE GFV }
@ -5807,8 +5807,15 @@ BEGIN
then begin
P := @TDrawBuffer(Buf); { Set draw buffer ptr }
L := 0; { Set buffer position }
X := X + Origin.X;
Y := Y + Origin.Y;
If (X >= 0) AND (Y >= 0) AND ((GOptions and (goGraphical or goGraphView))=0) Then Begin
X := RawOrigin.X+X*FontWidth; { X position }
Y := RawOrigin.Y+Y*FontHeight; { Y position }
End Else Begin
X := RawOrigin.X + Abs(X);
Y := RawOrigin.Y + Abs(Y);
End;
X := X DIV SysFontWidth;
Y := Y DIV SysFontHeight;
For J := 1 To H Do Begin { For each line }
K := X; { Reset x position }
For I := 0 To (W-1) Do Begin { For each character }
@ -5908,8 +5915,15 @@ BEGIN
{$ifdef Use_API}
then begin
P := @TDrawBuffer(Buf); { Set draw buffer ptr }
X := X + Origin.X;
Y := Y + Origin.Y;
If (X >= 0) AND (Y >= 0) AND ((GOptions and (goGraphical or goGraphView))=0) Then Begin
X := RawOrigin.X+X*FontWidth; { X position }
Y := RawOrigin.Y+Y*FontHeight; { Y position }
End Else Begin
X := RawOrigin.X + Abs(X);
Y := RawOrigin.Y + Abs(Y);
End;
X := X DIV SysFontWidth;
Y := Y DIV SysFontHeight;
For J := 1 To H Do Begin { For each line }
K := X; { Reset x position }
For I := 0 To (W-1) Do Begin { For each character }
@ -6047,7 +6061,7 @@ BEGIN
{$IFDEF Use_API}
If (X >= 0) AND (Y >= 0) Then Begin
If (X >= 0) AND (Y >= 0) AND ((GOptions and goGraphView)=0) Then Begin
X := RawOrigin.X+X*FontWidth; { X position }
Y := RawOrigin.Y+Y*FontHeight; { Y position }
End Else Begin
@ -6058,7 +6072,7 @@ BEGIN
Tiy := Y DIV SysFontHeight;
For Ti := 1 To length(Str) Do Begin
VideoBuf^[((Tiy * Drivers.ScreenWidth)+Tix)] := (GetColor(Color) shl 8) or Ord(Str[Ti]);
Tix := Tix + SysFontWidth;
Inc(Tix);
end;
UpdateScreen(false);
{$ELSE not Use_API}
@ -6180,7 +6194,7 @@ BEGIN
Fc := Col AND $0F; { Foreground colour }
Bc := Col AND $F0 SHR 4; { Background colour }
FillChar(S[1], 255, C); { Fill the string }
If (X >= 0) AND (Y >= 0) Then Begin
If (X >= 0) AND (Y >= 0) AND ((GOptions and (goGraphical or goGraphView))=0) Then Begin
X := RawOrigin.X+X*FontWidth; { X position }
Y := RawOrigin.Y+Y*FontHeight; { Y position }
End Else Begin
@ -6784,7 +6798,10 @@ END.
{
$Log$
Revision 1.5 2001-05-03 22:32:52 pierre
Revision 1.6 2001-05-04 08:42:56 pierre
* some corrections for linux
Revision 1.5 2001/05/03 22:32:52 pierre
new bunch of changes, displays something for dos at least
Revision 1.4 2001/04/10 21:57:56 pierre