{ KOL MCK } // Do not remove this line!
const Col1 = 0;
const Col2 = 1;
const Col3 = 2;
const Col4 = 3;

procedure NewForm1( var Result: PForm1; AParent: PControl );
begin

  {$IFDEF KOLCLASSES}
  Result := PForm1.Create;
  {$ELSE OBJECTS}
  New( Result, Create );
  {$ENDIF KOL CLASSES/OBJECTS}
  Result.Form := NewForm( AParent, 'TKOLCryptedDBF Demo' ).SetPosition( 332, 141 );
  Applet :=  Result.Form;
  Result.Form.Add2AutoFree( Result );
{$IFDEF UNICODE_CTRLS}
     Result.Form.SetUnicode(TRUE);
{$ENDIF UNICODE_CTRLS}
   {$IFDEF USE_NAMES}
    Result.Form.SetName( Applet, 'Form1' );
   {$ENDIF}
    Result.Form.Style := Result.Form.Style and not WS_MAXIMIZEBOX;
    Result.Form.SetClientSize( 444, 333 );
    Result.Form.Font.FontHeight := 13;
    Result.Form.Font.FontName := 'Tahoma';
      Result.Form.OnShow := Result.KOLForm_Show;

    Result.OSD := NewOpenSaveDialog( '', '', [ OSHideReadonly, OSOverwritePrompt, OSPathMustExist ] );
      Result.OSD.Filter := 'Crypted DBF (*.db)|*.db';
      Result.OSD.OpenDialog := FALSE;
   {$IFDEF USE_NAMES}
    Result.OSD.SetName( Result.Form, 'OSD' ); 
   {$ENDIF}
  Result.Form.Add2AutoFree( Result.OSD );
    // Result.Label2.TabOrder = -1
    Result.Label2 := NewLabel( Result.Form, 'TKOLCryptedDBF component demo © 2008 - Danger  (danger@artline.kz)' ).SetPosition( 16, 312 ).SetSize( 361, 17 );
   {$IFDEF USE_NAMES}
    Result.Label2.SetName( Result.Form, 'Label2' ); 
   {$ENDIF}
   {$IFDEF UNICODE_CTRLS}
   Result.Label2.SetUnicode(TRUE);
   {$ENDIF UNICODE_CTRLS}
    Result.Label2.Enabled := False;
    // Result.Button1.TabOrder = 1
    Result.Button1 := NewButton( Result.Form, 'Создать новую БД' ).SetPosition( 8, 272 ).SetSize( 137, 0 );
   {$IFDEF USE_NAMES}
    Result.Button1.SetName( Result.Form, 'Button1' ); 
   {$ENDIF}
   {$IFDEF UNICODE_CTRLS}
   Result.Button1.SetUnicode(TRUE);
   {$ENDIF UNICODE_CTRLS}
    // Result.Button2.TabOrder = 2
    Result.Button2 := NewButton( Result.Form, 'Сохранить' ).SetPosition( 336, 272 ).SetSize( 97, 0 );
   {$IFDEF USE_NAMES}
    Result.Button2.SetName( Result.Form, 'Button2' ); 
   {$ENDIF}
   {$IFDEF UNICODE_CTRLS}
   Result.Button2.SetUnicode(TRUE);
   {$ENDIF UNICODE_CTRLS}
    // Result.Button3.TabOrder = 3
    Result.Button3 := NewButton( Result.Form, 'Загрузить' ).SetPosition( 232, 272 ).SetSize( 97, 0 );
   {$IFDEF USE_NAMES}
    Result.Button3.SetName( Result.Form, 'Button3' ); 
   {$ENDIF}
   {$IFDEF UNICODE_CTRLS}
   Result.Button3.SetUnicode(TRUE);
   {$ENDIF UNICODE_CTRLS}
    // Result.GroupBox1.TabOrder = 4
    Result.GroupBox1 := NewGroupBox( Result.Form, '' ).SetPosition( 4, -2 ).SetSize( 437, 267 );
   {$IFDEF USE_NAMES}
    Result.GroupBox1.SetName( Result.Form, 'GroupBox1' ); 
   {$ENDIF}
   {$IFDEF UNICODE_CTRLS}
   Result.GroupBox1.SetUnicode(TRUE);
   {$ENDIF UNICODE_CTRLS}
    Result.GroupBox1.TabStop := FALSE;
    // Result.Label1.TabOrder = -1
      Result.Label1 := NewLabel( Result.GroupBox1, 'Вы можете редактировать содержимое ячейки, дважды щелкнув на ней.' ).SetPosition( 8, 245 ).SetSize( 385, 18 );
   {$IFDEF USE_NAMES}
      Result.Label1.SetName( Result.Form, 'Label1' ); 
   {$ENDIF}
   {$IFDEF UNICODE_CTRLS}
   Result.Label1.SetUnicode(TRUE);
   {$ENDIF UNICODE_CTRLS}
    // Result.DBFList.TabOrder = 0
      Result.DBFList := NewEcmListEdit( Result.GroupBox1, lvsDetail, [ lvoHideSel, lvoGridLines, lvoRowSelect, lvoOwnerDrawFixed ], nil, nil, nil ).SetPosition( 8, 16 ).SetSize( 417, 217 );
   {$IFDEF USE_NAMES}
      Result.DBFList.SetName( Result.Form, 'DBFList' ); 
   {$ENDIF}
   {$IFDEF UNICODE_CTRLS}
   Result.DBFList.SetUnicode(TRUE);
   {$ENDIF UNICODE_CTRLS}
    Result.DBFList.Color := clWindow;
      Result.DBFList.LVColAdd( 'Column 1', taLeft, 100);
      Result.DBFList.LVColAdd( 'Column 2', taLeft, 100);
      Result.DBFList.LVColAdd( 'Column 3', taLeft, 100);
      Result.DBFList.LVColAdd( 'Column 4', taLeft, 100);
      Result.OSD.WndOwner := Result.Form.GetWindowHandle;
      Result.Button2.OnClick := Result.Button2Click;
      Result.Button3.OnClick := Result.Button3Click;
      Result.Button1.OnClick := Result.Button1Click;
    Result.Form.CenterOnParent.CanResize := False;

end;

