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

📄 list.dpr

📁 一个基于不需引擎的文件管理系统,使用了许多界面比较好的控件
💻 DPR
字号:
library List;

{ Important note about DLL memory management: ShareMem must be the
  first unit in your library's USES clause AND your project's (select
  Project-View Source) USES clause if your DLL exports any procedures or
  functions that pass strings as parameters or function results. This
  applies to all strings passed to and from your DLL--even those that
  are nested in records and classes. ShareMem is the interface unit to
  the BORLNDMM.DLL shared memory manager, which must be deployed along
  with your DLL. To avoid using BORLNDMM.DLL, pass string information
  using PChar or ShortString parameters. }

uses
  SysUtils,
  Classes,
  forms,
  windows,
  StdCtrls,
  Controls,
  uIHintInf,
  uDllfrmList,
  Dialogs,
  Variants,
  uListBoxfrm in 'uListBoxfrm.pas' {ListBoxfrm},
  uExpMgr in 'uExpMgr.pas',
  uSecPlugInf in 'SecPlug_In_Module\uSecPlugInf.pas';

{$R *.res}

var
  OldApp:TApplication;
  OldScr:TScreen;
  OldHint:THintWindowClass;
  OldDllfrmList:TDllfrmList;

procedure LibraryProc(Reason: Integer);
begin
  if Reason = DLL_PROCESS_DETACH then
  begin
    Screen:=OldScr;
    Application:=OldApp;
    HintWindowClass:=OldHint;
    DllfrmList:=OldDllfrmList;
  end;
end;

procedure ShowListfrm(index:integer;OprList:IOprList;FoldersID:integer);stdcall;
var
  i,idx:integer;
  frm:TListBoxfrm;
begin
  Application:=OprList.Application;
  Screen:=OprList.Screen;
  DllfrmList:=OprList.DllfrmList;
  HintWindowClass:=OprList.HintWindow;
  idx:=-1;
  for i:=0 to DllfrmList.DllList.Count-1 do
  begin
    if TListBoxfrm(DllfrmList.DllList[i]).ID=index+FoldersID then
    begin
      idx:=i;
      break;
    end;
  end;
  if idx=-1 then
  begin
    frm:=TListBoxfrm.Create(Application);
    frm.ID:=index+FoldersID;
    frm.DllType:=alist;
    DllfrmList.DllList.Add(frm);

    case index of
      0:
      begin
        frm.ExpMgr:=TExpFolderMgr.create(frm.ListWindow,nil,nil,OprList);
        frm.ExpMgr.ThefrmType:=fmFolder;
        frm.ExpMgr.Params:=VarArrayOf([FoldersID]);
        frm.imAdd.DropdownCombo:=true;
        frm.AddSubMenu;  
      end;
      -1:
      begin
        frm.ExpMgr:=TExpPDAMgr.create(frm.ListWindow,frm.PopMenu,frm.SpTBXToolbar1,OprList);
        frm.ExpMgr.ThefrmType:=fmPDA;
        frm.ExpMgr.Params:='';
        OprList.LargeImageList:=frm.ImageList3;
      end;
      -2:
      begin
        frm.ExpMgr:=TExpTaskMgr.create(frm.ListWindow,frm.PopMenu,frm.SpTBXToolbar1,OprList);
        frm.ExpMgr.ThefrmType:=fmTask;
        frm.ExpMgr.Params:='';
      end;
      -3:
      begin
        frm.ExpMgr:=TExpCustomMgr.create(frm.ListWindow,frm.PopMenu,frm.SpTBXToolbar1,OprList);
        frm.ExpMgr.ThefrmType:=fmWebLink;
        frm.ExpMgr.Params:='';
      end;
      -4:
      begin
        frm.ExpMgr:=TExpCustomMgr.create(frm.ListWindow,frm.PopMenu,frm.SpTBXToolbar1,OprList);
        frm.ExpMgr.ThefrmType:=fmMp3;
        frm.ExpMgr.Params:='';
      end;
      -5:
      begin
        frm.ExpMgr:=TExpCustomMgr.create(frm.ListWindow,frm.PopMenu,frm.SpTBXToolbar1,OprList);
        frm.ExpMgr.ThefrmType:=fmImage;
        frm.ExpMgr.Params:='';
      end;
      -6:
      begin
        frm.ExpMgr:=TExpLinkManMgr.create(frm.ListWindow,frm.PopMenu,frm.SpTBXToolbar1,OprList);
        frm.ExpMgr.ThefrmType:=fmLinkMan;
      end;
    end;

    frm.InitData;
  end
  else
  begin
    frm:=TListBoxfrm(DllfrmList.DllList.Items[idx]);
  end;
  {if (index=0) and (idx<>-1) then
  begin
    if frm.ExpMgr<>nil then
    begin
      frm.ExpMgr.Params:=VarArrayOf([FoldersID]);
      frm.ExpMgr.RefreshList;
    end;
  end;}
  frm.Show;
  frm.AfterInitData;
end;

procedure Refreshfrm(AfrmType:integer;ACaption:Pchar;UpDateCaption:Boolean;Index,ParentIndex:integer);stdcall;
var
  i:integer;
begin
  for i:=0 to DllfrmList.DllList.Count-1 do
  begin
    if TListBoxfrm(DllfrmList.DllList.Items[i]).ExpMgr.ThefrmType=frmType(AfrmType) then
    begin
      if (Index=TListBoxfrm(DllfrmList.DllList.Items[i]).ID) or
        (ParentIndex=TListBoxfrm(DllfrmList.DllList.Items[i]).ID) then
      begin
        TListBoxfrm(DllfrmList.DllList.Items[i]).ListWindow.OnCompare:=nil;
        TListBoxfrm(DllfrmList.DllList.Items[i]).ExpMgr.RefreshList;
        TListBoxfrm(DllfrmList.DllList.Items[i]).ListWindow.OnCompare:=TListBoxfrm(DllfrmList.DllList.Items[i]).ListWindowCompare;
      end;

      if UpDateCaption and
        (Index=TListBoxfrm(DllfrmList.DllList.Items[i]).ID) then
      begin
        TListBoxfrm(DllfrmList.DllList.Items[i]).Caption:=strpas(ACaption);
      end;
    end;
  end;
end;

procedure Closefrm(IDs:array of integer);stdcall;
var
  i,j:integer;
begin
  for i:=low(IDs) to high(IDs) do
    for j:=DllfrmList.DllList.Count-1 downto 0 do
    begin
      if TListBoxfrm(DllfrmList.DllList.Items[j]).ID=IDs[i] then
      begin
        TListBoxfrm(DllfrmList.DllList.Items[j]).Close;
      end;
    end;
end;

procedure CreatePlugBtn(const AFrm:TForm;const ASecPlug:ISecPlug);stdcall;
var
  FFrm:TListBoxFrm;
begin
  FFrm:=TListBoxFrm(AFrm);
  FFrm.CreatePlugBtn(ASecPlug);
end;

procedure DeletePlugBtn(const AFrm:TForm;const AName:widestring);stdcall;
var
  FFrm:TListBoxFrm;
begin
  FFrm:=TListBoxFrm(AFrm);
  FFrm.DeletePlugBtn(AName); 
end;

exports
  ShowListfrm,
  Refreshfrm,
  Closefrm,
  CreatePlugBtn,
  DeletePlugBtn;

begin
  OldApp:=Application;
  OldScr:=Screen;
  OldHint:=HintWindowClass;
  OldDllfrmList:=DllfrmList;
  DLLProc:=@LibraryProc;
end.

⌨️ 快捷键说明

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