{ KOL MCK } // Do not remove this line!
{$DEFINE KOL_MCK}
unit Unit2;

interface

{$IF Defined(KOL_MCK)}
uses Windows, Messages, KOL {$IF Defined(KOL_MCK)}{$ELSE}, mirror, Classes, Controls, mckCtrls, mckObjs, Graphics {$IFEND (place your units here->)};
{$ELSE}
{$I uses.inc}
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs;
{$IFEND}

type
  {$IF Defined(KOL_MCK)}
  {$I MCKfakeClasses.inc}
  {$IFDEF KOLCLASSES} {$I TForm2class.inc} {$ELSE OBJECTS} PForm2 = ^TForm2; {$ENDIF CLASSES/OBJECTS}
  {$IFDEF KOLCLASSES}{$I TForm2.inc}{$ELSE} TForm2 = object(TObj) {$ENDIF}
    Form: PControl;
  {$ELSE not_KOL_MCK}
  TForm2 = class(TForm)
  {$IFEND KOL_MCK}
    KOLForm_: TKOLForm;
    Button1: TKOLButton;
    GroupBox1: TKOLGroupBox;
    Label1: TKOLLabel;
    PassdBox: TKOLEditBox;
    procedure KOLForm_Show(Sender: PObj);
    procedure Button1Click(Sender: PObj);
    procedure PassdBoxKeyChar(Sender: PControl; var Key: KOLChar;
      Shift: Cardinal);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form2 {$IFDEF KOL_MCK} : PForm2 {$ELSE} : TForm2 {$ENDIF} ;

{$IFDEF KOL_MCK}
procedure NewForm2( var Result: PForm2; AParent: PControl );
{$ENDIF}

implementation
uses Unit1;

{$IF Defined(KOL_MCK)}{$ELSE}{$R *.DFM}{$IFEND}

{$IFDEF KOL_MCK}
{$I Unit2_1.inc}
{$ENDIF}

//-----------------------------------------------------
procedure TForm2.KOLForm_Show(Sender: PObj);
begin
 PassdBox.Focused:= true;
end;

//-----------------------------------------------------
procedure TForm2.Button1Click(Sender: PObj);
begin
 if ( PassdBox.Text = '' ) then
  MessageBox( Form.Handle, 'Пароль не может быть пустым!', 'Ошибка', MB_ICONEXCLAMATION )
 else
 begin
  strPassword:= PassdBox.Text;
  Form.Close;
 end;
end;

//-----------------------------------------------------
procedure TForm2.PassdBoxKeyChar(Sender: PControl; var Key: KOLChar;
  Shift: Cardinal);
begin
 if ( Key = #13 {ENTER} ) then Button1.Click;
end;

//-----------------------------------------------------

end.
 


