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

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, 'Download File' ).SetPosition( 383, 182 );
  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( 417, 306 );
    Result.Form.Font.FontHeight := 13;
    Result.Form.Font.FontName := 'Tahoma';

    Result.SaveDlg := NewOpenSaveDialog( 'Save downloaded file ...', '', [ OSHideReadonly, OSOverwritePrompt ] );
      Result.SaveDlg.OpenDialog := FALSE;
   {$IFDEF USE_NAMES}
    Result.SaveDlg.SetName( Result.Form, 'SaveDlg' ); 
   {$ENDIF}
  Result.Form.Add2AutoFree( Result.SaveDlg );

    Result.DL := NewHTTPDownload;
    Result.DL.UsePreconfigProxy:= true; 
   {$IFDEF USE_NAMES}
    Result.DL.SetName( Result.Form, 'DL' ); 
   {$ENDIF}
  Result.Form.Add2AutoFree( Result.DL );
      Result.DL.OnDownload := Result.DLDownload;
      Result.DL.OnProgress := Result.DLProgress;
      Result.DL.OnHeaderReceived := Result.DLHeaderReceived;
      Result.DL.OnError := Result.DLError;
    // Result.Label1.TabOrder = -1
    Result.Label1 := NewLabel( Result.Form, 'Resource:' ).SetPosition( 8, 12 ).SetSize( 57, 17 );
   {$IFDEF USE_NAMES}
    Result.Label1.SetName( Result.Form, 'Label1' ); 
   {$ENDIF}
   {$IFDEF UNICODE_CTRLS}
   Result.Label1.SetUnicode(TRUE);
   {$ENDIF UNICODE_CTRLS}
    // Result.Label2.TabOrder = -1
    Result.Label2 := NewLabel( Result.Form, 'Parse HTTP headers list received from server' ).SetPosition( 112, 252 ).SetSize( 225, 17 );
   {$IFDEF USE_NAMES}
    Result.Label2.SetName( Result.Form, 'Label2' ); 
   {$ENDIF}
   {$IFDEF UNICODE_CTRLS}
   Result.Label2.SetUnicode(TRUE);
   {$ENDIF UNICODE_CTRLS}
    // Result.EditBox1.TabOrder = 0
    Result.EditBox1 := NewEditBox( Result.Form, [  ] ).SetPosition( 64, 8 ).SetSize( 265, 0 );
   {$IFDEF USE_NAMES}
    Result.EditBox1.SetName( Result.Form, 'EditBox1' ); 
   {$ENDIF}
    {$IFNDEF UNICODE_CTRLS}Result.EditBox1.SetUnicode( TRUE );{$ENDIF}
    Result.EditBox1.Text := 'http://kolnmck.ru/files/280/kol_mck.7z';
    // Result.Button1.TabOrder = 1
    Result.Button1 := NewButton( Result.Form, 'Get' ).SetPosition( 336, 7 ).SetSize( 73, 0 );
   {$IFDEF USE_NAMES}
    Result.Button1.SetName( Result.Form, 'Button1' ); 
   {$ENDIF}
   {$IFDEF UNICODE_CTRLS}
   Result.Button1.SetUnicode(TRUE);
   {$ENDIF UNICODE_CTRLS}
    // Result.ListBox.TabOrder = 2
    Result.ListBox := NewListBox( Result.Form, [ loNoExtendSel, loNoIntegralHeight, loNoSel ] ).SetPosition( 8, 40 ).SetSize( 401, 201 );
   {$IFDEF USE_NAMES}
    Result.ListBox.SetName( Result.Form, 'ListBox' ); 
   {$ENDIF}
   {$IFDEF UNICODE_CTRLS}
   Result.ListBox.SetUnicode(TRUE);
   {$ENDIF UNICODE_CTRLS}
    Result.ListBox.Color := TColor(clWindow);
    Result.ListBox.CurIndex := 0;
    // Result.ProgressBar.TabOrder = 3
    Result.ProgressBar := NewProgressBar( Result.Form ).SetPosition( 8, 280 ).SetSize( 399, 0 );
   {$IFDEF USE_NAMES}
    Result.ProgressBar.SetName( Result.Form, 'ProgressBar' ); 
   {$ENDIF}
   {$IFDEF UNICODE_CTRLS}
   Result.ProgressBar.SetUnicode(TRUE);
   {$ENDIF UNICODE_CTRLS}
    // Result.Button2.TabOrder = 4
    Result.Button2 := NewButton( Result.Form, 'Parse headers' ).SetPosition( 8, 248 ).SetSize( 97, 0 );
   {$IFDEF USE_NAMES}
    Result.Button2.SetName( Result.Form, 'Button2' ); 
   {$ENDIF}
   {$IFDEF UNICODE_CTRLS}
   Result.Button2.SetUnicode(TRUE);
   {$ENDIF UNICODE_CTRLS}
    Result.Button2.Enabled := False;
      Result.SaveDlg.WndOwner := Result.Form.GetWindowHandle;
    Result.EditBox1.Color := TColor(clWindow);
      Result.Button1.OnClick := Result.Button1Click;
    {$IFDEF OVERRIDE_SCROLLBARS}
    OverrideScrollbars( Result.ListBox);
    {$ENDIF OVERRIDE_SCROLLBARS}
      Result.Button2.OnClick := Result.Button2Click;
    Result.Form.CenterOnParent.CanResize := False;
    Result.Form.Perform( WM_INITMENU, 0, 0 );

end;

