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

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, 'MainForm' ).SetPosition( 503, 115 );
      Result.KOLForm_BeforeCreateWindow( Result );
  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( 535, 571 );
    Result.Form.Color := $D1BEAF;
    Result.Form.Font.FontHeight := 13;
    Result.Form.Font.FontName := 'Tahoma';
      Result.Form.OnClose := Result.KOLForm_Close;
      Result.Form.OnShow := Result.KOLForm_Show;

    Result.ExportSaveDlg := NewOpenSaveDialog( 'Экспорт в файл', '', [ OSHideReadonly, OSOverwritePrompt, OSPathMustExist ] );
      Result.ExportSaveDlg.Filter := 'Файлы HTML (*.html)|*.html;*.htm';
      Result.ExportSaveDlg.OpenDialog := FALSE;
   {$IFDEF USE_NAMES}
    Result.ExportSaveDlg.SetName( Result.Form, 'ExportSaveDlg' ); 
   {$ENDIF}
  Result.Form.Add2AutoFree( Result.ExportSaveDlg );
    // Result.Bkgnd.TabOrder = 1
    Result.Bkgnd  :=  PGRushControl( NewGRushPanel(Result.Form).SetAlign ( caClient ) );
   {$IFDEF USE_NAMES}
    Result.Bkgnd.SetName( Result.Form, 'Bkgnd' ); 
   {$ENDIF}
    // Result.Tabs.TabOrder = 0
      Result.Tabs := PSATabs( NewSATabs( Result.Bkgnd ).SetAlign ( caTop ).SetSize( 0, 24 ));
   {$IFDEF USE_NAMES}
      Result.Tabs.SetName( Result.Form, 'Tabs' ); 
   {$ENDIF}
      Result.Tabs.Items.Text:=  'Фильмы'+#13+#10+'Диски'+#13+#10;
      Result.Tabs.BackgroundColor:= clWhite;
      Result.Tabs.BorderColor:= $C1A893;
      Result.Tabs.TabColor:= $C6DBE3;
      Result.Tabs.TextColor:= clWhite;
      Result.Tabs.ActiveTabColor:= clWhite;
      Result.Tabs.ActiveTabTopBorderColor:= $2D89E6;
      Result.Tabs.ActiveTabTextColor:= clBlack;
      Result.Tabs.DisBorderColor:= clInactiveBorder;
      Result.Tabs.DisBackgroundColor:= clBtnFace;
      Result.Tabs.DisTabColor:= clBtnFace;
      Result.Tabs.DisActiveTabColor:= clBtnFace;
      Result.Tabs.DisTextColor:= clInactiveCaption;
      Result.Tabs.DisActiveTabTextColor:= clInactiveCaption;
      Result.Tabs.ActiveTab:= 0;
    // Result.Bkgnd_1.TabOrder = 2
      Result.Bkgnd_1  :=  PGRushControl( NewGRushPanel(Result.Bkgnd).SetAlign ( caClient ) );
   {$IFDEF USE_NAMES}
      Result.Bkgnd_1.SetName( Result.Form, 'Bkgnd_1' ); 
   {$ENDIF}
    // Result.SB_Panel.TabOrder = 0
        Result.SB_Panel  :=  PGRushControl( NewGRushPanel(Result.Bkgnd_1).SetPosition( 6, 414 ).SetSize( 516, 77 ) );
   {$IFDEF USE_NAMES}
        Result.SB_Panel.SetName( Result.Form, 'SB_Panel' ); 
   {$ENDIF}
    // Result.lblNote.TabOrder = -1
          Result.lblNote := NewLabel( Result.SB_Panel, 'Вы можете отфильтровать записи по нескольким критериям. Для сброса параметров нажмите кнопку "Сброс фильтра".' ).SetPosition( 40, 40 ).SetSize( 329, 31 ).MakeWordWrap;
   {$IFDEF USE_NAMES}
          Result.lblNote.SetName( Result.Form, 'lblNote' ); 
   {$ENDIF}
   {$IFDEF UNICODE_CTRLS}
   Result.lblNote.SetUnicode(TRUE);
   {$ENDIF UNICODE_CTRLS}
          Result.lblNote.Transparent := True;
    // Result.GPanel_Genre.TabOrder = 0
          Result.GPanel_Genre  :=  PGRushControl( NewGRushPanel(Result.SB_Panel).SetPosition( 249, 8 ).SetSize( 105, 21 ) );
   {$IFDEF USE_NAMES}
          Result.GPanel_Genre.SetName( Result.Form, 'GPanel_Genre' ); 
   {$ENDIF}
    // Result.edtFGenre.TabOrder = 0
            Result.edtFGenre := NewEditBox( Result.GPanel_Genre, [  ] ).SetAlign ( caClient );
   {$IFDEF USE_NAMES}
            Result.edtFGenre.SetName( Result.Form, 'edtFGenre' ); 
   {$ENDIF}
            Result.edtFGenre.Tag := 11;
            Result.edtFGenre.HasBorder := FALSE;
    {$IFNDEF UNICODE_CTRLS}Result.edtFGenre.SetUnicode( TRUE );{$ENDIF}
    // Result.GPanel_Location.TabOrder = 0
          Result.GPanel_Location  :=  PGRushControl( NewGRushPanel(Result.SB_Panel).SetPosition( 359, 8 ).SetSize( 148, 21 ) );
   {$IFDEF USE_NAMES}
          Result.GPanel_Location.SetName( Result.Form, 'GPanel_Location' ); 
   {$ENDIF}
    // Result.edtFLocation.TabOrder = 0
            Result.edtFLocation := NewEditBox( Result.GPanel_Location, [  ] ).SetAlign ( caClient );
   {$IFDEF USE_NAMES}
            Result.edtFLocation.SetName( Result.Form, 'edtFLocation' ); 
   {$ENDIF}
            Result.edtFLocation.Tag := 12;
            Result.edtFLocation.HasBorder := FALSE;
    {$IFNDEF UNICODE_CTRLS}Result.edtFLocation.SetUnicode( TRUE );{$ENDIF}
    // Result.GPanel_Name.TabOrder = 0
          Result.GPanel_Name  :=  PGRushControl( NewGRushPanel(Result.SB_Panel).SetPosition( 8, 8 ).SetSize( 237, 21 ) );
   {$IFDEF USE_NAMES}
          Result.GPanel_Name.SetName( Result.Form, 'GPanel_Name' ); 
   {$ENDIF}
    // Result.edtFName.TabOrder = 0
            Result.edtFName := NewEditBox( Result.GPanel_Name, [  ] ).SetAlign ( caClient );
   {$IFDEF USE_NAMES}
            Result.edtFName.SetName( Result.Form, 'edtFName' ); 
   {$ENDIF}
            Result.edtFName.Tag := 10;
            Result.edtFName.HasBorder := FALSE;
    {$IFNDEF UNICODE_CTRLS}Result.edtFName.SetUnicode( TRUE );{$ENDIF}
    // Result.NoFilterBtn.TabOrder = 1
          Result.NoFilterBtn  :=  PGRushControl( NewGRushButton(Result.SB_Panel, 'Сброс фильтра').SetPosition( 376, 37 ).SetSize( 129, 32 ) );
   {$IFDEF USE_NAMES}
          Result.NoFilterBtn.SetName( Result.Form, 'NoFilterBtn' ); 
   {$ENDIF}
          Result.NoFilterBtn.Transparent := True;
          Result.NoFilterBtn.Over_ShadowOffset := 0;
          Result.NoFilterBtn.All_Spacing := 1;
          Result.NoFilterBtn.All_UpdateSpeed := usImmediately;
    // Result.PBox.TabOrder = 2
          Result.PBox := NewPaintBox( Result.SB_Panel ).SetPosition( 8, 44 ).SetSize( 24, 24 );
   {$IFDEF USE_NAMES}
          Result.PBox.SetName( Result.Form, 'PBox' ); 
   {$ENDIF}
   {$IFDEF UNICODE_CTRLS}
   Result.PBox.SetUnicode(TRUE);
   {$ENDIF UNICODE_CTRLS}
          Result.PBox.Transparent := True;
    // Result.Films.TabOrder = 1
        Result.Films := NewEcmListEdit( Result.Bkgnd_1, lvsDetail, [ lvoHideSel, lvoGridLines, lvoRowSelect, lvoOwnerDrawFixed ], nil, nil, nil ).SetLVItemHeight(18).SetPosition( 6, 6 ).SetSize( 515, 403 );
   {$IFDEF USE_NAMES}
        Result.Films.SetName( Result.Form, 'Films' ); 
   {$ENDIF}
   {$IFDEF UNICODE_CTRLS}
   Result.Films.SetUnicode(TRUE);
   {$ENDIF UNICODE_CTRLS}
        Result.Films.DoubleBuffered := True;
    Result.Films.Color := clWindow;
    // Result.Disks.TabOrder = 2
        Result.Disks := PmdvXLGrid( NewmdvXLGrid( Result.Bkgnd_1, 3, 0, gsStandard, [ xlgRowsSelect, xlgDrawFocusSelected, xlgColSizing ] ).SetPosition( 6, 29 ).SetSize( 515, 364 )).SetColsWidths([ 
      114, 255, 125 ]).SetDefRowHeights( 18 );
        Result.Disks.TitleColWidth:= 0;
        Result.Disks.TitleRowHeight:= 0;
        Result.Disks.TitleColButton:= True;
        Result.Disks.IndentLeft:= 6;
   {$IFDEF USE_NAMES}
        Result.Disks.SetName( Result.Form, 'Disks' ); 
   {$ENDIF}
        Result.Disks.HasBorder := FALSE;
    Result.Disks.TitleFont.FontHeight := 8;
        Result.Disks.DoubleBuffered := True;
    // Result.DisksHeader.TabOrder = 3
        Result.DisksHeader := NewEcmListEdit( Result.Bkgnd_1, lvsDetail, [ lvoHideSel, lvoOwnerDrawFixed ], nil, nil, nil ).SetPosition( 6, 6 ).SetSize( 515, 25 );
   {$IFDEF USE_NAMES}
        Result.DisksHeader.SetName( Result.Form, 'DisksHeader' ); 
   {$ENDIF}
   {$IFDEF UNICODE_CTRLS}
   Result.DisksHeader.SetUnicode(TRUE);
   {$ENDIF UNICODE_CTRLS}
    Result.DisksHeader.Color := clWindow;
        Result.DisksHeader.LVColAdd( 'Диск', taLeft, 113);
        Result.DisksHeader.LVColAdd( 'Фильм', taLeft, 255);
        Result.DisksHeader.LVColAdd( 'Жанр', taLeft, 124);
    // Result.TB_Panel.TabOrder = 3
    Result.TB_Panel  :=  PGRushControl( NewGRushPanel(Result.Form).SetAlign ( caTop ).SetSize( 0, 39 ) );
   {$IFDEF USE_NAMES}
    Result.TB_Panel.SetName( Result.Form, 'TB_Panel' ); 
   {$ENDIF}
    Result.TB_Panel.Border := 3;
    // Result.LS_splitter.TabOrder = 0
      Result.LS_splitter  :=  PGRushControl( NewGRushSplitter(Result.TB_Panel, 0, 0).SetAlign ( caLeft ) );
   {$IFDEF USE_NAMES}
      Result.LS_splitter.SetName( Result.Form, 'LS_splitter' ); 
   {$ENDIF}
      Result.LS_splitter.Enabled := False;
      Result.LS_splitter.Transparent := True;
    // Result.RefreshBtn.TabOrder = 0
      Result.RefreshBtn  :=  PGRushControl( NewGRushButton(Result.TB_Panel, 'Обновить').SetPosition( 8, 3 ).SetSize( 86, 32 ) );
   {$IFDEF USE_NAMES}
      Result.RefreshBtn.SetName( Result.Form, 'RefreshBtn' ); 
   {$ENDIF}
      Result.RefreshBtn.Transparent := True;
      Result.RefreshBtn.Over_ShadowOffset := 0;
      Result.RefreshBtn.All_Spacing := 1;
      Result.RefreshBtn.All_DrawFocusRect := FALSE;
      Result.RefreshBtn.All_UpdateSpeed := usImmediately;
    // Result.UpdateBtn.TabOrder = 2
      Result.UpdateBtn  :=  PGRushControl( NewGRushButton(Result.TB_Panel, 'Скачать').SetPosition( 96, 3 ).SetSize( 86, 32 ) );
   {$IFDEF USE_NAMES}
      Result.UpdateBtn.SetName( Result.Form, 'UpdateBtn' ); 
   {$ENDIF}
      Result.UpdateBtn.Transparent := True;
      Result.UpdateBtn.Dis_ColorText := 8421504;
      Result.UpdateBtn.Dis_BorderWidth := 1;
      Result.UpdateBtn.Over_ShadowOffset := 0;
      Result.UpdateBtn.Dis_ShadowOffset := 0;
      Result.UpdateBtn.All_DrawFocusRect := FALSE;
      Result.UpdateBtn.All_UpdateSpeed := usImmediately;
    // Result.AboutBtn.TabOrder = 3
      Result.AboutBtn  :=  PGRushControl( NewGRushButton(Result.TB_Panel, 'Инфо').SetPosition( 358, 3 ).SetSize( 84, 32 ) );
   {$IFDEF USE_NAMES}
      Result.AboutBtn.SetName( Result.Form, 'AboutBtn' ); 
   {$ENDIF}
      Result.AboutBtn.Transparent := True;
      Result.AboutBtn.Over_ShadowOffset := 0;
      Result.AboutBtn.All_DrawFocusRect := FALSE;
      Result.AboutBtn.All_UpdateSpeed := usImmediately;
    // Result.ReportBtn.TabOrder = 3
      Result.ReportBtn  :=  PGRushControl( NewGRushButton(Result.TB_Panel, 'Печать').SetPosition( 272, 3 ).SetSize( 84, 32 ) );
   {$IFDEF USE_NAMES}
      Result.ReportBtn.SetName( Result.Form, 'ReportBtn' ); 
   {$ENDIF}
      Result.ReportBtn.Transparent := True;
      Result.ReportBtn.Over_ShadowOffset := 0;
      Result.ReportBtn.All_DrawFocusRect := FALSE;
      Result.ReportBtn.All_UpdateSpeed := usImmediately;
    // Result.CloseBtn.TabOrder = 4
      Result.CloseBtn  :=  PGRushControl( NewGRushButton(Result.TB_Panel, 'Выход').SetPosition( 444, 3 ).SetSize( 84, 32 ) );
   {$IFDEF USE_NAMES}
      Result.CloseBtn.SetName( Result.Form, 'CloseBtn' ); 
   {$ENDIF}
      Result.CloseBtn.Transparent := True;
      Result.CloseBtn.Over_ShadowOffset := 0;
      Result.CloseBtn.All_DrawFocusRect := FALSE;
      Result.CloseBtn.All_UpdateSpeed := usImmediately;
    // Result.ExportBtn.TabOrder = 4
      Result.ExportBtn  :=  PGRushControl( NewGRushButton(Result.TB_Panel, 'Экспорт').SetPosition( 184, 3 ).SetSize( 86, 32 ) );
   {$IFDEF USE_NAMES}
      Result.ExportBtn.SetName( Result.Form, 'ExportBtn' ); 
   {$ENDIF}
      Result.ExportBtn.Transparent := True;
      Result.ExportBtn.Over_ShadowOffset := 0;
      Result.ExportBtn.All_DrawFocusRect := FALSE;
      Result.ExportBtn.All_UpdateSpeed := usImmediately;
      Result.ExportSaveDlg.WndOwner := Result.Form.GetWindowHandle;
      Result.UpdateBtn.OnClick := Result.UpdateBtnClick;
      Result.AboutBtn.OnClick := Result.AboutBtnClick;
      Result.CloseBtn.OnClick := Result.CloseBtnClick;
      Result.RefreshBtn.OnClick := Result.RefreshBtnClick;
      Result.ReportBtn.OnClick := Result.ReportBtnClick;
      Result.ExportBtn.OnClick := Result.ExportBtnClick;
      Result.Tabs.OnPageChanging := Result.TabsPageChanged;
    Result.edtFGenre.Color := clWindow;
      Result.edtFGenre.OnKeyChar := Result.edt_Char;
      Result.edtFGenre.OnChange := Result.edt_Change;
    Result.edtFLocation.Color := clWindow;
      Result.edtFLocation.OnKeyChar := Result.edt_Char;
      Result.edtFLocation.OnChange := Result.edt_Change;
      Result.NoFilterBtn.OnClick := Result.NoFilterBtnClick;
      Result.PBox.OnPaint := Result.PBoxPaint;
      Result.Films.OnResize := Result.FilmsResize;
      PEcmListEdit(Result.Films.CustomObj).OnCreateEdit := Result.FilmsCreateEdit;
      PEcmListEdit(Result.Films.CustomObj).OnDrawCell := Result.FilmsDrawCell;
      Result.Disks.OnDrawCell := Result.DisksDrawCell;
    Result.edtFName.Color := clWindow;
      Result.edtFName.OnKeyChar := Result.edt_Char;
      Result.edtFName.OnChange := Result.edt_Change;
    Result.Form.CenterOnParent;
    Result.KOLForm_FormCreate( Result );

end;

