unit Main; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ExtCtrls, Subscherm, LoginScherm, ZoekProductenScherm, ApplicationContext; const FORMLOGINID = 1; FORMZOEKPRODUCTENID = 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 {$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); FORMZOEKPRODUCTENID: fHuidigScherm := TFormZoekProducten.Create(PanelMain, fAppContext); end; fHuidigScherm.Parent := PanelMain; fHuidigScherm.Align := alClient; fHuidigScherm.Show; end; end; end.