33interface
44
55uses
6- System.SysUtils, System.Classes, JS, Web, WEBLib.Graphics, WEBLib.Controls,
7- WEBLib.Forms, WEBLib.Dialogs, Vcl.Controls, Vcl.StdCtrls, WEBLib.StdCtrls,
6+ System.SysUtils,
7+ System.Classes,
8+ JS,
9+ Web,
10+ WEBLib.Graphics,
11+ WEBLib.Controls,
12+ WEBLib.Forms,
13+ WEBLib.Dialogs,
14+ Vcl.Controls,
15+ Vcl.StdCtrls,
16+ WEBLib.StdCtrls,
817 Main.View ;
918
1019type
1120 TLoginView = class (TWebForm)
1221 WebLabel1: TWebLabel;
1322 edtLogin: TWebEdit;
1423 edtSenha: TWebEdit;
15- WebButton1 : TWebButton;
24+ btnEntrar : TWebButton;
1625 ckLembrarMe: TWebCheckBox;
17- procedure WebButton1Click (Sender: TObject);
26+ procedure btnEntrarClick (Sender: TObject);
27+ procedure WebFormShow (Sender: TObject);
28+ procedure edtLoginKeyPress (Sender: TObject; var Key: Char);
29+ procedure edtSenhaKeyPress (Sender: TObject; var Key: Char);
30+ procedure WebFormCreate (Sender: TObject);
1831 private
19- { Private declarations }
32+
2033 public
21- { Public declarations }
34+
2235 end ;
2336
2437var
@@ -28,7 +41,30 @@ implementation
2841
2942{ $R *.dfm}
3043
31- procedure TLoginView.WebButton1Click (Sender: TObject);
44+ procedure TLoginView.WebFormCreate (Sender: TObject);
45+ begin
46+ Application.ThemeColor := clGrayText;
47+ Application.Themed := True;
48+ end ;
49+
50+ procedure TLoginView.WebFormShow (Sender: TObject);
51+ begin
52+ edtLogin.SetFocus;
53+ end ;
54+
55+ procedure TLoginView.edtLoginKeyPress (Sender: TObject; var Key: Char);
56+ begin
57+ if Key = #13 then
58+ edtSenha.SetFocus;
59+ end ;
60+
61+ procedure TLoginView.edtSenhaKeyPress (Sender: TObject; var Key: Char);
62+ begin
63+ if Key = #13 then
64+ btnEntrar.Click;
65+ end ;
66+
67+ procedure TLoginView.btnEntrarClick (Sender: TObject);
3268begin
3369 if edtLogin.Text <> ' admin' then
3470 begin
0 commit comments