Index: VerpakkingsDefinitie/Main.pas =================================================================== diff -u -r546 -r547 --- VerpakkingsDefinitie/Main.pas (.../Main.pas) (revision 546) +++ VerpakkingsDefinitie/Main.pas (.../Main.pas) (revision 547) @@ -3,22 +3,66 @@ interface uses - Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, - Vcl.Controls, Vcl.Forms, Vcl.Dialogs; + Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, + System.Classes, Vcl.Graphics, + Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ExtCtrls, + Subscherm, LoginScherm, + ApplicationContext; +const + FORMLOGINID = 1; + type - TfrmMain = class(TForm) + TFormMain = class(TForm) + PanelMain: TPanel; + + procedure FormCreate(Sender: TObject); + procedure NavigeerNaar(schermId: Integer); private - { Private declarations } + fAppContext: TApplicationContext; + fHuidigScherm: TForm; public { Public declarations } end; var - frmMain: TfrmMain; + FormMain: TFormMain; implementation {$R *.dfm} +procedure TFormMain.FormCreate(Sender: TObject); +begin + fAppContext := TApplicationContext.Create(); + // TODO Wat doet dit in de originele applicatie?: fUiContext.ImagesScherm := TImagesScherm.Create(self); + // TODO kijken of "VerwerkParamStrings;" nodig is + + PanelMain := TPanel.Create(Self); + PanelMain.Parent := Self; + PanelMain.Align := alClient; + + Self.NavigeerNaar(FORMLOGINID); +end; + + // TODO afmeld optie toevoegen + +procedure TFormMain.NavigeerNaar(schermId: Integer); +begin + Application.ProcessMessages; // Interrupts the execution of an application so that it can process the message queue. + + // Volgende subscherm laden in panel + begin + fHuidigScherm.Free; + case schermId of + FORMLOGINID: + fHuidigScherm := TFormLogin.Create(PanelMain, fAppContext); + end; + + fHuidigScherm.Parent := PanelMain; + fHuidigScherm.Align := alClient; + fHuidigScherm.Show; + end; +end; + end.