root / Client / UfrmEditAccount.pas @ 0:95bd93c28625
History | View | Annotate | Download (2.1 kB)
| 1 | (*
|
|---|---|
| 2 | * CDDL HEADER START |
| 3 | * |
| 4 | * The contents of this file are subject to the terms of the |
| 5 | * Common Development and Distribution License, Version 1.0 only |
| 6 | * (the "License"). You may not use this file except in compliance |
| 7 | * with the License. |
| 8 | * |
| 9 | * You can obtain a copy of the license at |
| 10 | * http://www.opensource.org/licenses/cddl1.php. |
| 11 | * See the License for the specific language governing permissions |
| 12 | * and limitations under the License. |
| 13 | * |
| 14 | * When distributing Covered Code, include this CDDL HEADER in each |
| 15 | * file and include the License file at |
| 16 | * http://www.opensource.org/licenses/cddl1.php. If applicable, |
| 17 | * add the following below this CDDL HEADER, with the fields enclosed |
| 18 | * by brackets "[]" replaced with your own identifying * information: |
| 19 | * Portions Copyright [yyyy] [name of copyright owner] |
| 20 | * |
| 21 | * CDDL HEADER END |
| 22 | * |
| 23 | * |
| 24 | * Portions Copyright 2007 Andreas Schneider |
| 25 | *) |
| 26 | unit UfrmEditAccount;
|
| 27 | |
| 28 | {$mode objfpc}{$H+} |
| 29 | |
| 30 | interface
|
| 31 | |
| 32 | uses
|
| 33 | Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls, |
| 34 | UEnums; |
| 35 | |
| 36 | type
|
| 37 | |
| 38 | { TfrmEditAccount }
|
| 39 | |
| 40 | TfrmEditAccount = class(TForm)
|
| 41 | btnOK: TButton; |
| 42 | btnCancel: TButton; |
| 43 | cbAccessLevel: TComboBox; |
| 44 | edUsername: TEdit; |
| 45 | edPassword: TEdit; |
| 46 | lblUsername: TLabel; |
| 47 | lblPassword: TLabel; |
| 48 | lblAccessLevel: TLabel; |
| 49 | lblPasswordHint: TLabel; |
| 50 | public
|
| 51 | function GetAccessLevel: TAccessLevel;
|
| 52 | procedure SetAccessLevel(AAccessLevel: TAccessLevel);
|
| 53 | end;
|
| 54 | |
| 55 | var
|
| 56 | frmEditAccount: TfrmEditAccount; |
| 57 | |
| 58 | implementation
|
| 59 | |
| 60 | { TfrmEditAccount }
|
| 61 | |
| 62 | function TfrmEditAccount.GetAccessLevel: TAccessLevel;
|
| 63 | begin
|
| 64 | case cbAccessLevel.ItemIndex of |
| 65 | 0: Result := alNone;
|
| 66 | 1: Result := alView;
|
| 67 | 2: Result := alNormal;
|
| 68 | 3: Result := alAdministrator;
|
| 69 | end;
|
| 70 | end;
|
| 71 | |
| 72 | procedure TfrmEditAccount.SetAccessLevel(AAccessLevel: TAccessLevel);
|
| 73 | begin
|
| 74 | case AAccessLevel of |
| 75 | alNone: cbAccessLevel.ItemIndex := 0;
|
| 76 | alView: cbAccessLevel.ItemIndex := 1;
|
| 77 | alNormal: cbAccessLevel.ItemIndex := 2;
|
| 78 | alAdministrator: cbAccessLevel.ItemIndex := 3;
|
| 79 | end;
|
| 80 | end;
|
| 81 | |
| 82 | initialization
|
| 83 | {$I UfrmEditAccount.lrs}
|
| 84 | |
| 85 | end.
|
| 86 |