Category : Pascal Source Code
Archive   : BLRPLT.ZIP
Filename : TESTDLG.DAT

 
Output of file : TESTDLG.DAT contained in archive : BLRPLT.ZIP
{Substitutions and fills
Area Fills, must be in position 1
@ZZ0 Transfer Rec
@ZZ1 TransferRec load
@ZZ2 List Stuff
@ZZ3 FreeMultiSelRec
@ZZ4 Optional Xfer code
x@ZZ5 Possible include file
x@ZZ6 Possible const def

Substitutions
@XX0 Dialog's Pointer (as PMyDialog)
@XX2 Resource Filename
@XX4 Program name
@XX5 Transfer Rec type name
@XX7 Unit Name
}
@ZZ9
program @XX4;

{$R @XX2}
uses
@XX7, WinTypes, WinProcs, WinDos,
{$ifdef VER70}
Objects, OWindows, ODialogs, Strings, OStdDlgs, OStdWnds;
{$else}
WObjects, Strings, StdDlgs, StdWnds;
{$endif}

const
cm_Dialog = 102;

type
TMyApp = object(TApplication)
procedure InitInstance; virtual;
procedure InitMainWindow; virtual;
end;

PMyWindow = ^TMyWindow;
TMyWindow = object(TWindow)
@ZZ0
@ZZ2
List : TStrCollection;
@ZZ2

constructor Init(ATitle : PChar);
destructor Done; virtual;
Procedure cmDialog(var Msg : TMessage); virtual cm_First + cm_Dialog;
end;

{-------TMyWindow.Init}
constructor TMyWindow.Init(ATitle : PChar);
var
AMenu : hMenu;
begin
TWindow.Init(Nil, ATitle);

AMenu := CreateMenu; {make a menu}
AppendMenu(AMenu, mf_String, cm_Exit, 'E&xit');
AppendMenu(AMenu, mf_String, cm_Dialog, '&Dialog');
with Attr do
begin
Style := ws_OverlappedWindow;
Menu := AMenu;
end;

@ZZ2
List.Init(5,5); {some items for the listbox}
List.Insert(StrNew('Item 0'));
List.Insert(StrNew('Item 1'));
List.Insert(StrNew('Item 2'));
List.Insert(StrNew('Item 3'));
List.Insert(StrNew('Item 4'));
List.Insert(StrNew('Item 5'));
List.Insert(StrNew('Item 6'));
List.Insert(StrNew('Item 7'));
List.Insert(StrNew('Item 8'));
List.Insert(StrNew('Item 9'));
@ZZ2
@ZZ1
end;

{----------------TMyWindow.Done}
destructor TMyWindow.Done;
begin
@ZZ2
List.Done;
@ZZ2
@ZZ3
TWindow.Done;
end;

{-----------------TMyWindow.cmDialog}
Procedure TMyWindow.cmDialog(var Msg : TMessage);
var
Dlg : @XX0;
begin
Dlg := New(@XX0, Init(@Self));
@ZZ4
Dlg^.TransferBuffer := @Xfer;
@ZZ4
if Application^.ExecDialog(Dlg) = idOK then
@ZZ4
with Xfer do
@ZZ4
begin
{Do something with results}
end;
end;

{------TMyApp.InitMainWindow}
procedure TMyApp.InitMainWindow;
begin
MainWindow := New(PMyWindow, Init('Test The Dialog'));
end;

{------TMyApp.InitInstance}
procedure TMyApp.InitInstance;
begin
TApplication.InitInstance;
hAccTable := 0;
end;

var
App : TMyApp;
begin
App.Init('MyWindow');
App.Run;
App.Done;
end.


  3 Responses to “Category : Pascal Source Code
Archive   : BLRPLT.ZIP
Filename : TESTDLG.DAT

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/