unit Main; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ExtCtrls, ApplicationContext; const NAVHOME = 0; NAVLOGIN = 1; NAVZOEKPRODUCTEN = 2; type TFormMain = class(TForm) PanelMain: TPanel; procedure FormCreate(Sender: TObject); procedure NavigeerNaar(schermId: Integer); private fAppContext: TApplicationContext; fHuidigScherm: TForm; public { Public declarations } end; var FormMain: TFormMain; implementation uses Subscherm, LogInScherm, ZoekProductenScherm; {$R *.dfm} procedure TFormMain.FormCreate(Sender: TObject); begin fAppContext := TApplicationContext.Create(); { TODO -cMain: Wat doet dit in de originele applicatie?: fUiContext.ImagesScherm := TImagesScherm.Create(self); } { TODO -cMain: Kijken of "VerwerkParamStrings;" nodig is } { TODO -cNavigatie : 'Scherm' creëren vanuit code. Tweede 'scherm' maken met twee secties (30%-70%). } PanelMain := TPanel.Create(Self); PanelMain.Parent := Self; PanelMain.Align := alClient; Self.NavigeerNaar(NAVLOGIN); end; // { TODO -cMain: 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 fHuidigScherm.Free; case schermId of NAVHOME: fHuidigScherm := TFormZoekProducten.Create(PanelMain, Self, fAppContext); NAVLOGIN: fHuidigScherm := TFormLogin.Create(PanelMain, Self, fAppContext); NAVZOEKPRODUCTEN: fHuidigScherm := TFormZoekProducten.Create(PanelMain, Self, fAppContext); end; fHuidigScherm.Parent := PanelMain; fHuidigScherm.Align := alClient; fHuidigScherm.Show; end; end.