Index: PlanScan/Main.dfm =================================================================== diff -u -r349 -r350 --- PlanScan/Main.dfm (.../Main.dfm) (revision 349) +++ PlanScan/Main.dfm (.../Main.dfm) (revision 350) @@ -37,7 +37,7 @@ ExplicitLeft = 8 ExplicitTop = 73 ExplicitHeight = 41 - object Panel2: TPanel + object pnlNaam: TPanel Left = 0 Top = 0 Width = 185 @@ -47,6 +47,37 @@ Color = 1513421 ParentBackground = False TabOrder = 0 + object lblInitialen: TLabel + Left = 20 + Top = 53 + Width = 146 + Height = 39 + Alignment = taCenter + AutoSize = False + Caption = 'lblInitialen' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -32 + Font.Name = 'Tahoma' + Font.Style = [] + ParentFont = False + end + object lblUitloggen: TLabel + Left = 58 + Top = 98 + Width = 68 + Height = 19 + Alignment = taCenter + AutoSize = False + Caption = 'Uitloggen' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWhite + Font.Height = -16 + Font.Name = 'Tahoma' + Font.Style = [] + ParentFont = False + OnClick = lblUitloggenClick + end end object pnlKnoppen: TPanel Left = 0 @@ -77,6 +108,7 @@ Top = 0 Width = 513 Height = 408 + ActivePage = tsDnaCodes Align = alClient TabOrder = 0 object tsDnaCodes: TTabSheet Index: PlanScan/Main.pas =================================================================== diff -u -r349 -r350 --- PlanScan/Main.pas (.../Main.pas) (revision 349) +++ PlanScan/Main.pas (.../Main.pas) (revision 350) @@ -14,19 +14,23 @@ CacheQuery1: TCacheQuery; frmDnaCodes: TfrmDnaCodes; pnlLinks: TPanel; - Panel2: TPanel; + pnlNaam: TPanel; pnlKnoppen: TPanel; pnlFrames: TPanel; frmGebruikers: TfrmGebruikers; pcFrames: TPageControl; tsDnaCodes: TTabSheet; tsGebruikers: TTabSheet; + lblInitialen: TLabel; + lblUitloggen: TLabel; procedure tsGebruikersShow(Sender: TObject); procedure FormCreate(Sender: TObject); procedure FormShow(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); + procedure lblUitloggenClick(Sender: TObject); private fUiContext: TUiContext; + procedure HuidigeGebruikerAfmelden(); public property UiContext: TUiContext Read fUiContext Write fUiContext; end; @@ -66,6 +70,7 @@ end else begin UiContext.Initialen := fLoginScherm.edtInitialen.Text; UiContext.LoginCode := fLoginScherm.edtLoginCode.Text; + lblInitialen.Caption := UiContext.Initialen; Self.Caption := 'PlanScan '+UiContext.Initialen; pcFrames.ActivePageIndex := 0; end; @@ -82,11 +87,24 @@ fLoginScherm.Free; end; -procedure TfmMain.FormClose(Sender: TObject; var Action: TCloseAction); +procedure TfmMain.HuidigeGebruikerAfmelden; begin TAgent.Create(UiContext).GebruikerAfmelden(UiContext.Initialen, UiContext.LoginCode); + UiContext.Initialen := ''; + UiContext.LoginCode := ''; + lblInitialen.Caption := ''; end; +procedure TfmMain.lblUitloggenClick(Sender: TObject); +begin + HuidigeGebruikerAfmelden(); +end; + +procedure TfmMain.FormClose(Sender: TObject; var Action: TCloseAction); +begin + HuidigeGebruikerAfmelden(); +end; + procedure TfmMain.tsGebruikersShow(Sender: TObject); begin UiContext.LoginCode := '1513';