|
{$R StPApp.RES}
{$I StPApp.INC}
type
TStundenplanApplication
= object( TApplication
)
procedure
InitMainWindow;
virtual;
end;
PStundenplanWindow
= ^TStundenplanWindow;
TStundenplanWindow
= object( TWindow
)
DateiName : array[0..255] of Char;
Plan
: Pointer;
constructor
Init(AParent: PWindowsObject; ATitle: PChar);
destructor
Done; virtual;
function
CanClose; virtual;
procedure
CMBeenden (var Msg:TMessage);
virtual
cm_First + cm_DateiBeenden;
procedure
CMDateiOeffnen(var Msg:TMessage); virtual cm_First + cm_DateiOeffnen;
end;
destructor TStundenplanWindow.Done;
begin
{ TWindow.Done; }
{ bei TPW 1.0 / TPW 1.5 }
inherited Done;
end;
function TStundenplanWindow.CanClose: Boolean;
var Msg: TMessage;
begin
CanClose:=False;
CanClose:=BWCCMessageBox(HWindow, 'Das Programm wirklich
beenden?',
'Hinweis', mb_IconQuestion + mb_YesNo + mb_DefButton2) = idYes;
end;
procedure TStundenplanWindow.CMBeenden(var Msg: TMessage);
begin
CloseWindow;
end;
procedure TStundenplanWindow.CMDateiOeffnen(var Msg: TMessage);
var Datei: array[0..255] of Char;
f: file;
Num: Integer;
begin
StrCopy(Datei, '*.pln');
if Application^.ExecDialog(New(PFileDialog,
Init(@Self,
PChar(sd_FileOpen), Datei))) =
id_OK then
begin
StrCopy(DateiName,
Datei);
if
Plan <> nil then FreeMem(Plan, 550);
GetMem(Plan,
550);
FillChar(Plan^,
550, 0);
Assign(f,
StrPas(DateiName));
{$I-}
Reset(f, 1); {$I+}
if
IOResult
= 0 then
begin
BlockRead(f, Plan^, 550, Num);
Close(f);
end;
{
HeadLine; }
{ wird später aktiviert }
end;
SetMenu(HWindow, LoadMenu(HInstance,
MakeIntResource(men_HauptMenue)));
{
CMStundenplanAendern(Msg); }
{ wird später aktiviert }
end;
|