⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 unitmain.pas

📁 East make Tray Icon in delphi
💻 PAS
📖 第 1 页 / 共 3 页
字号:
      begin
        compUsedSL.commaText := IniFile.ReadString(allDemoFrms[i], 'compsUsed', '');

        for j := 0 to compUsedSL.count -1 do
        begin
          aTabSheet := getTabsSheetByCaption(IniFileCompsUsed.ReadString(compUsedSL[j], 'Tab', ''));

          if aTabSheet = nil then
             aTabSheet := createTabSheet(IniFileCompsUsed.ReadString(compUsedSL[j], 'Tab', ''));

          // check if for that comp a ImgBtn already created
          found := false;
          for k := 0 to aTabSheet.ControlCount -1  do
            if aTabSheet.Controls[k].Name = compUsedSL[j] then
            begin
              aTabSheet.Controls[k].Hint := aTabSheet.Controls[k].Hint + ',' + allDemoFrms[i];
              found := true;
            end;
          if found = false then
          begin
            aJvBitBtn := TJvBitBtn.Create(Self);
            aJvBitBtn.Parent := Self;
            aJvBitBtn.Name := compUsedSL[j];
            aJvBitBtn.Left := aTabSheet.Tag;
            aTabSheet.Tag := aTabSheet.Tag + 30;
            aJvBitBtn.Top := 2;
            aJvBitBtn.Width := 25;
            aJvBitBtn.Height := 25;
            aJvBitBtn.ShowHint := false;
            aJvBitBtn.OnClick := CompClick;
            aFileName := gBitmapFilePath + 'T' + compUsedSL[j] + '.BMP';
            if not FileExists(AFileName) and (aTabSheet.Caption <> 'none') then
              MessageDlg('File "' + AFileName + '" for BitMap not found!', mtError, [mbOk], 0)
            else if (aTabSheet.Caption <> 'none') then
              aJvBitBtn.Glyph.LoadFromFile(AFileName);
            aJvBitBtn.Hint  := allDemoFrms[i];
            aJvBitBtn.caption := '';
            aJvBitBtn.Parent := aTabSheet;

            JvListBoxDemosCompNameSorted.items.add(compUsedSL[j]);
          end;
        end;
      end;
    end;
  finally
    IniFile.Free;
    IniFileCompsUsed.Free;
    allDemoFrms.Free;
    compUsedSL.Free;
  end;
end;

procedure TMainform.FormDestroy(Sender: TObject);
var
  I: integer;
begin
  for I := 1 to MAX_FORMS do
    if (TheFormArray[I] <> nil) then
      TheFormArray[I].Free;
end;

procedure TMainform.CreateDemoForm(const ID: integer; ShowForm: Boolean);
begin
  // free the last Demo Form
  if (TheFormArray[FormID] <> nil) then
    FreeAndNil(TheFormArray[FormID]);

  case ID of

     1 : TheFormArray[ID] := TJvFormsFrm.Create(nil);
     2 : TheFormArray[ID] := TJvDialogs.Create(nil);
     3 : TheFormArray[ID] := TGLDemoFrm.Create(nil);
     4 : TheFormArray[ID] := TJvLabelsFrm.Create(nil);
     5 : TheFormArray[ID] := TRaHtHintsMainForm.Create(nil);
     6 : TheFormArray[ID] := TJvZoomMainForm.Create(nil);
     7 : TheFormArray[ID] := TJvEdits.Create(nil);
     8 : TheFormArray[ID] := TSearchingFormMain.Create(nil);
     9 : TheFormArray[ID] := TJvPanelsFrm.Create(nil);
    10 : TheFormArray[ID] := TfglXMLSerializerDemo.Create(nil);
    11 : TheFormArray[ID] := TJvSearchFileMainForm.Create(nil);
    12 : TheFormArray[ID] := TJvDateTimeFrm.Create(nil);
    13 : TheFormArray[ID] := TJvChoosersFrm.Create(nil);
    14 : TheFormArray[ID] := TJvControls.Create(nil);
    15 : TheFormArray[ID] := TJvAniMainForm.Create(nil);
//    16 : TheFormArray[ID] := TJvMousePositionnerMainForm.Create(nil);
    17 : TheFormArray[ID] := TJvDataEmbeddedMainForm.Create(nil);
    18 : TheFormArray[ID] := TBmpAnimMainForm.Create(nil);
    19 : TheFormArray[ID] := TArrowButtonMainForm.Create(nil);
    20 : TheFormArray[ID] := TJvClipboardViewerMainForm.Create(nil);
    21 : TheFormArray[ID] := TJvBrowseFolderMainForm.Create(nil);
    22 : TheFormArray[ID] := TInstallLabelMainForm.Create(nil);
    24 : TheFormArray[ID] := TJvLogFileMainForm.Create(nil);
    25 : TheFormArray[ID] := TOLBarMainForm.Create(nil);
    27 : TheFormArray[ID] := TChangeNotificationMainForm.Create(nil);
    28 : TheFormArray[ID] := TCreateProcessExampleMainForm.Create(nil);
    29 : TheFormArray[ID] := TJvNTEventLogMainForm.Create(nil);
    30 : TheFormArray[ID] := TJvAppHotKeyDemoMainForm.Create(nil);
    31 : TheFormArray[ID] := TJvWindowsTitleMainForm.Create(nil);
//    32 : TheFormArray[ID] := TJvSpecialProgressMainForm.Create(nil);
    33 : TheFormArray[ID] := TJvColorComboDemoMainForm.Create(nil);
    34 : TheFormArray[ID] := TContentScrollerMainForm.Create(nil);
    35 : TheFormArray[ID] := TMailExampleMainForm.Create(nil);
    36 : TheFormArray[ID] := TJvTreeViewAsMenuMainForm.Create(nil);
    37 : TheFormArray[ID] := TListCombMainForm.Create(nil);
    38 : TheFormArray[ID] := TJvDBDateTimePickerMainForm.Create(nil);
    39 : TheFormArray[ID] := TJvInspectorDBDemoMainForm.Create(nil);
    40 : TheFormArray[ID] := TJvMruListMainForm.Create(nil);
    41 : TheFormArray[ID] := TFileListBoxMainForm.Create(nil);
    42 : TheFormArray[ID] := TJvButtons.Create(nil);
    43 : TheFormArray[ID] := TJvBalloonHintMainForm.Create(nil);
    44 : TheFormArray[ID] := TDSADialogsMainForm.Create(nil);
    45 : TheFormArray[ID] := TfrmMessageDlgEditor.Create(nil);
    46 : TheFormArray[ID] := TJvHTMLParserMainForm.Create(nil);
    47 : TheFormArray[ID] := TJvLinkLabelMainForm.Create(nil);
    48 : TheFormArray[ID] := TJvScreenCaptureMainForm.Create(nil);
    49 : TheFormArray[ID] := TJvShellHookDemoMainForm.Create(nil);
    50 : TheFormArray[ID] := TJvShFileOperationMainForm.Create(nil);
    51 : TheFormArray[ID] := TJvSystemPopupMainForm.Create(nil);
    52 : TheFormArray[ID] := TJvSystemPopup2MainForm.Create(nil);
    53 : TheFormArray[ID] := TJvThumbnailMainForm.Create(nil);
//    54 : TheFormArray[ID] := TJvTranslatorMainForm.Create(nil);
//    55 : TheFormArray[ID] := TJvWndProcHookDemoMainForm.Create(nil);
//    56 : TheFormArray[ID] := TJvWndProcHookDemoMainForm.Create(nil);
    57 : TheFormArray[ID] := TRegTVMainForm.Create(nil);
    58 : TheFormArray[ID] := TRunDll32MainForm.Create(nil);
    59 : TheFormArray[ID] := TJvScrollingWindowMainForm.Create(nil);
    60 : TheFormArray[ID] := TTimelineMainForm.Create(nil);
    61 : TheFormArray[ID] := TTipOfDayMainForm.Create(nil);
    62 : TheFormArray[ID] := TTMTimeLineMainForm.Create(nil);
    63 : TheFormArray[ID] := TTransBtnFormMain.Create(nil);
    64 : TheFormArray[ID] := TJvZLibMultipleMainForm.Create(nil);
    65 : TheFormArray[ID] := TWelcomeForm.Create(nil);
    66 : TheFormArray[ID] := TOtherMainForm.Create(nil);
    67 : TheFormArray[ID] := TProfiler32MainForm.Create(nil);
    68 : TheFormArray[ID] := TFindReplaceMainForm.Create(nil);
    69 : TheFormArray[ID] := TJvPlaylistMainForm.Create(nil);
//    70 : TheFormArray[ID] := TImageWindowMainForm.Create(nil);
    71 : TheFormArray[ID] := TRessourcesForm.Create(nil);
    72 : TheFormArray[ID] := TConsoleExampleMainForm.Create(nil);
    73 : TheFormArray[ID] := TJvAppStorageBaseMainFrm.Create(nil);
    74 : TheFormArray[ID] := TJvAppStorageSelListMainfrm.Create(nil);
    75 : TheFormArray[ID] := TJvAppStorageSubStorageMainForm.Create(nil);
    76 : TheFormArray[ID] := TJvAviCapDemoFrm.Create(nil);
    77 : TheFormArray[ID] := TJvBackgroundDemoFrm.Create(nil);
    78 : begin
           TheFormArray[ID] := TMDIMainForm.Create(nil);
          // TMDIMainForm.Create(Application)
          //  TBkgndImageSettings.Create(Application);
           // TMDIChildForm.Create(Application);
         end;
    79 : TheFormArray[ID] := TJvBehaviorLblMainFrm.Create(nil);
    80 : TheFormArray[ID] := TSimpleMainForm.Create(nil);
    81 : TheFormArray[ID] := TfrmInspector.Create(nil);
    82 : TheFormArray[ID] := TLEDDemoMain.Create(nil);
    83 : TheFormArray[ID] := TStarfieldMainForm.Create(nil);
    84 : TheFormArray[ID] := TJvCharMapMainFrm.Create(nil);
    85 : TheFormArray[ID] := TJvChartDemoForm.Create(nil);
    86 : TheFormArray[ID] := TJvCheckBoxRadioBtnFrm.Create(nil);
    87 : TheFormArray[ID] := TfrmCheckTVDemo.Create(nil);
    88 : TheFormArray[ID] := TControlsExampleMainForm.Create(nil);
    89 : TheFormArray[ID] := TCsvDataSourceForm.Create(nil);
    90 : TheFormArray[ID] := TJvID3v1MainForm.Create(nil);
    91 : TheFormArray[ID] := TJvID3v2MainForm.Create(nil);
    92 : TheFormArray[ID] := TJvHiddenGemsForm.Create(nil);
    93 : TheFormArray[ID] := TJvComboListBoxDemoFrm.Create(nil);
    94 : TheFormArray[ID] := TJvComputerInfoExDemoFrm.Create(nil);
    95 : TheFormArray[ID] := TJvDBActionMainFrm.Create(nil);
    96 : TheFormArray[ID] := TJvDBFindEditDemoFrm.Create(nil);
    97 : TheFormArray[ID] := TJvDBGridExportDemoMainFrm.Create(nil);
    98 : TheFormArray[ID] := TJvDBHTLabelDemoMainFrm.Create(nil);
    99 : TheFormArray[ID] := TJvDBImageDemoMainFrm.Create(nil);
    100: TheFormArray[ID] := TJvDbMaskEditDemoFrm.Create(nil);
    101: TheFormArray[ID] := TJvDBSearchDemoMainFrm.Create(nil);
    102: TheFormArray[ID] := TJvDesktopAlertDemoFrm.Create(nil);
    103: TheFormArray[ID] := TWebMapperDemoMainFrm.Create(nil);
    104: TheFormArray[ID] := TUseCaseDemoMainFrm.Create(nil);
    105: TheFormArray[ID] := TDependencyWalkerDemoMainFrm.Create(nil);
    106: TheFormArray[ID] := TJvDialogsDemoFrm.Create(nil);
    107: TheFormArray[ID] := TJvDomainUpDownDemoMainFrm.Create(nil);
    108: TheFormArray[ID] := TJvDotNetDemoMainFrm.Create(nil);
    109: TheFormArray[ID] := TJvErrorIndicatorMainDemoFrm.Create(nil);
    110: TheFormArray[ID] := TJvFooterAndGroupHeaderDemoFrm.Create(nil);
    111: TheFormArray[ID] := TJvFullColorCircleDlgMainFrm.Create(nil);
    112: TheFormArray[ID] := TJvFullColorDialogMainFrm.Create(nil);
    113: TheFormArray[ID] := TEditorMainForm.Create(nil);
    114: TheFormArray[ID] := TAnimatorForm.Create(nil);
    115: TheFormArray[ID] := TJvMouseGestureDemoMainFrm.Create(nil);
    116: TheFormArray[ID] := TJvNavPaneDemoMainFrm.Create(nil);
    117: TheFormArray[ID] := TfBouncingBalls.Create(nil);
    118: TheFormArray[ID] := TfrmDiningPhilosophers.Create(nil);
//    107: TheFormArray[ID] := .Create(nil);
//    107: TheFormArray[ID] := .Create(nil);
//    107: TheFormArray[ID] := .Create(nil);
  else
    TheFormArray[ID] := tfrEmpty.create(nil);
  end;

  //Execute the forms appearance only if they need to be shown
  if ShowForm then
  begin
    // embed the form in JvCaptionPanel1
    TheFormArray[ID].Parent := JvCaptionPanel1;
    TheFormArray[ID].BorderStyle :=  bsNone;
    TheFormArray[ID].Scaled := false;
    TheFormArray[ID].Visible := true;
    TheFormArray[ID].left := 0;
    TheFormArray[ID].top  := 25;

    //take the with, heigth and caption from the form
    JvCaptionPanel1.width  := TheFormArray[ID].Width + 5;
    JvCaptionPanel1.height := TheFormArray[ID].height + 30;
    JvCaptionPanel1.Caption:= TheFormArray[ID].Caption;

    // check if the form has a MainMenu and plug it in
    {$IFDEF COMPILER6_UP}
    if TheFormArray[ID].Menu <> nil then
    begin
       TheToolBar := TJvToolBar.Create(TheFormArray[ID]);
       TheToolBar.Parent := TheFormArray[ID];
       TheToolBar.Menu := TheFormArray[ID].Menu;
       TheToolBar.Flat := true;
    end;
    {$ENDIF COMPILER6_UP}
  end;
  //save the last form ID
  FormID := ID;
end;

procedure TMainform.FormShow(Sender: TObject);
var
  IniFile: TIniFile;
  IniFileName : string;
begin

  IniFileName := ExtractFilePath(Application.ExeName) + 'data\JvMegaDemoConfig.ini';
  if not FileExists(IniFileName) then
  begin
    MessageDlg(
      'JVCL MegaDemo Configuration File ''' + IniFileName + ''' not found!'#13+
      'Programm will be aborted!', mtError, [mbOK], 0);
    exit;
  end;

  IniFile := TIniFile.Create(IniFileName);
  gBitmapFilePath := IniFile.ReadString('Main', 'BitmapFilePath', '');

  if FileExists(ExtractFilePath(Application.ExeName) + 'Help\JVCL3.HLP') then
    Application.HelpFile := ExtractFilePath(Application.ExeName) + 'Help\JVCL3.HLP'
  else
    Application.HelpFile := IniFile.ReadString('Main', 'HelpFile', '');

  if not FileExists(Application.HelpFile) then
    if MessageDlg(
      'JVCL MegaDemo Help File ''' + Application.HelpFile + ''' was not found!'#13+
      'Do you want to open the config file?', mtConfirmation, [mbYes, mbNo], 0) = mrYes then
        ShellExecute(0, nil, PChar('"' + IniFile.FileName + '"'), nil, nil, SW_SHOWNORMAL);

  FreeAndNil(IniFile);

  //Show the Welcome-Frame
  CreateDemoForm(65);

  ReadAllDemosFromIni;
end;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -