You've already forked lazarus-ccr
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8112 8e941d3f-bd1b-0410-a28a-d453659cc2b4
71 lines
1.2 KiB
ObjectPascal
71 lines
1.2 KiB
ObjectPascal
unit Main;
|
|
|
|
{$mode objfpc}{$H+}
|
|
|
|
interface
|
|
|
|
uses
|
|
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, CaptchaCtrl;
|
|
|
|
type
|
|
|
|
{ TForm1 }
|
|
|
|
TForm1 = class(TForm)
|
|
btnVerify: TButton;
|
|
btnRetry: TButton;
|
|
Captcha1: TCaptchaLabel;
|
|
edCaptcha: TEdit;
|
|
GroupBox1: TGroupBox;
|
|
procedure btnRetryClick(Sender: TObject);
|
|
procedure btnVerifyClick(Sender: TObject);
|
|
procedure FormActivate(Sender: TObject);
|
|
procedure FormCreate(Sender: TObject);
|
|
private
|
|
|
|
public
|
|
|
|
end;
|
|
|
|
var
|
|
Form1: TForm1;
|
|
|
|
implementation
|
|
|
|
{$R *.lfm}
|
|
|
|
{ TForm1 }
|
|
|
|
procedure TForm1.btnRetryClick(Sender: TObject);
|
|
begin
|
|
Captcha1.NewCaptcha;
|
|
edCaptcha.Clear;
|
|
end;
|
|
|
|
procedure TForm1.btnVerifyClick(Sender: TObject);
|
|
begin
|
|
if edCaptcha.Text = '' then
|
|
ShowMessage('No CAPTCHA code entered.')
|
|
else
|
|
if Captcha1.Verify(edCaptcha.Text) then
|
|
ShowMessage('Input accepted.')
|
|
else
|
|
ShowMessage('Sorry. Your input does not match.' + LineEnding +
|
|
'The correct value would have been: ' + Captcha1.Text);
|
|
end;
|
|
|
|
procedure TForm1.FormActivate(Sender: TObject);
|
|
begin
|
|
Constraints.MinHeight := Height;
|
|
Constraints.MaxHeight := Height;
|
|
end;
|
|
|
|
procedure TForm1.FormCreate(Sender: TObject);
|
|
begin
|
|
Randomize;
|
|
cInputQueryEditSizePercents := 0;
|
|
end;
|
|
|
|
end.
|
|
|