{ KOL MCK } // Do not remove this line!

procedure NewMainForm( var Result: PMainForm; AParent: PControl );
begin

  {$IFDEF KOLCLASSES}
  Result := PMainForm.Create;
  {$ELSE OBJECTS}
  New( Result, Create );
  {$ENDIF KOL CLASSES/OBJECTS}
  Result.Form := NewForm( AParent, 'KOL ThreadTimer Demo' ).SetPosition( 241, 261 );
  Applet :=  Result.Form;
  Result.Form.Add2AutoFree( Result );
{$IFDEF UNICODE_CTRLS}
     Result.Form.SetUnicode(TRUE);
{$ENDIF UNICODE_CTRLS}
   {$IFDEF USE_NAMES}
    Result.Form.SetName( Applet, 'MainForm' );
   {$ENDIF}
    Result.Form.Style := Result.Form.Style and not WS_MAXIMIZEBOX;
    Result.Form.SetClientSize( 578, 159 );
      Result.Form.OnClose := Result.KOLForm1Close;
      Result.Form.OnDestroy := Result.KOLForm1Destroy;

    Result.Timer2 := NewTimer( 200 );
   {$IFDEF USE_NAMES}
    Result.Timer2.SetName( Result.Form, 'Timer2' ); 
   {$ENDIF}
  Result.Form.Add2AutoFree( Result.Timer2 );
      Result.Timer2.OnTimer := Result.Timer2Timer;
    // Result.ProgressBar1.TabOrder = 0
    Result.ProgressBar1 := NewProgressBar( Result.Form ).SetPosition( 16, 24 ).SetSize( 553, 0 );
   {$IFDEF USE_NAMES}
    Result.ProgressBar1.SetName( Result.Form, 'ProgressBar1' ); 
   {$ENDIF}
   {$IFDEF UNICODE_CTRLS}
   Result.ProgressBar1.SetUnicode(TRUE);
   {$ENDIF UNICODE_CTRLS}
    // Result.ProgressBar2.TabOrder = 0
    Result.ProgressBar2 := NewProgressBar( Result.Form ).SetPosition( 16, 81 ).SetSize( 553, 0 );
   {$IFDEF USE_NAMES}
    Result.ProgressBar2.SetName( Result.Form, 'ProgressBar2' ); 
   {$ENDIF}
   {$IFDEF UNICODE_CTRLS}
   Result.ProgressBar2.SetUnicode(TRUE);
   {$ENDIF UNICODE_CTRLS}
    // Result.Button1.TabOrder = 1
    Result.Button1 := NewButton( Result.Form, 'Close' ).SetPosition( 504, 120 );
   {$IFDEF USE_NAMES}
    Result.Button1.SetName( Result.Form, 'Button1' ); 
   {$ENDIF}
   {$IFDEF UNICODE_CTRLS}
   Result.Button1.SetUnicode(TRUE);
   {$ENDIF UNICODE_CTRLS}
    // Result.CheckBox1.TabOrder = 2
    Result.CheckBox1 := NewCheckBox( Result.Form, 'ThreadTimer Enable' ).SetPosition( 32, 48 ).AutoSize( TRUE );
   {$IFDEF USE_NAMES}
    Result.CheckBox1.SetName( Result.Form, 'CheckBox1' ); 
   {$ENDIF}
   {$IFDEF UNICODE_CTRLS}
   Result.CheckBox1.SetUnicode(TRUE);
   {$ENDIF UNICODE_CTRLS}
    // Result.CheckBox2.TabOrder = 2
    Result.CheckBox2 := NewCheckBox( Result.Form, 'Timer Enable' ).SetPosition( 32, 108 ).AutoSize( TRUE );
   {$IFDEF USE_NAMES}
    Result.CheckBox2.SetName( Result.Form, 'CheckBox2' ); 
   {$ENDIF}
   {$IFDEF UNICODE_CTRLS}
   Result.CheckBox2.SetUnicode(TRUE);
   {$ENDIF UNICODE_CTRLS}
      Result.CheckBox1.OnClick := Result.CheckBox1Click;
      Result.CheckBox2.OnClick := Result.CheckBox2Click;
      Result.Button1.OnClick := Result.Button1Click;
    Result.Form.CenterOnParent.CanResize := False;
    Result.Form.Perform( WM_INITMENU, 0, 0 );
    Result.KOLForm1FormCreate( Result );

end;

