Category : Pascal Source Code
Archive   : TABTEXT.ZIP
Filename : TABTEXT.PAS

 
Output of file : TABTEXT.PAS contained in archive : TABTEXT.ZIP

{************************************************}
{ }
{ Turbo Pascal for Windows }
{ Demo program }
{ Copyright (c) 1991 by Borland International }
{ }
{************************************************}

program TabText;

uses WinTypes, WinProcs, OWindows, Strings;

type
TMyApplication = object(TApplication)
procedure InitMainWindow; virtual;
end;

type
PMyWindow = ^TMyWindow;
TMyWindow = object(TWindow)
procedure Paint(PaintDC: HDC; var PaintInfo: TPaintStruct);virtual;
end;

{--------------------------------------------------}
{ TMyWindow's method implementations: }
{--------------------------------------------------}
procedure TMyWindow.Paint(PaintDC: HDC; var PaintInfo: TPaintStruct);
const
Tabs: array[0..2] of Word = (50, 400 , 550);

var
S: array[0..100] of Char;
XPos: Integer;
YPos: Integer;

begin
XPos := 10;
YPos := 100;
StrCopy(S, 'Sambo'#9'Michael'#9'Rupert'#9'Susan');
TabbedTextOut(PaintDC, XPos, YPos, S, Strlen(S), 3, Tabs, XPos);
end;

{--------------------------------------------------}
{ TMyApplication's method implementations: }
{--------------------------------------------------}

procedure TMyApplication.InitMainWindow;
begin
MainWindow := New(PMyWindow, Init(nil, 'Sample ObjectWindows Program'));
end;

{--------------------------------------------------}
{ Main program: }
{--------------------------------------------------}

var
MyApp: TMyApplication;

begin
MyApp.Init('MyProgram');
MyApp.Run;
MyApp.Done;
end.