亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? compmain.pas

?? 一個delphi下使用的壓縮組件 TCompress Component Set V8
?? PAS
?? 第 1 頁 / 共 2 頁
字號:
(*
  CompDemo for TCompress Component Set

  See Thread-safe code example in CompressFilesViaThread

  You are free to amend, adjust, improve, update, borrow, alter and play
  with this demonstration program at will.

  However, if you redistribute the unregistered TCompress components, please be
  sure to include ALL the files that came with it (incl. Compress.hlp, Readme.txt
  and the ORIGINAL COMPDEMO source).  Thanks.

  Hint: To find the code which makes use of the TCompress components, search
  for Compress1, CDBImage1 and CDBMemo1 references...  At some point, you may
  also want to modify this demo to play with the Key, TargetPath and
  MakeDirectories properties of the TCompress component (all new in V2.5), or
  to experiment with the CompressStreamToArchive method (new in V3.0) of which
  a sample is given in SaveDirectToArchive.

  Enjoy.
*)

unit Compmain;

interface

uses
  SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  Forms, Dialogs, StdCtrls, DB, DBTables, DBCtrls, ExtCtrls, Buttons, FileCtrl, Mask,
  Compress, CompCtrl
{$IFDEF CLR}
  , System.ComponentModel, System.Threading
{$ENDIF}
  ;


type
  TForm1 = class(TForm)
    Panel2: TPanel;
    Shape1: TShape;
    DBText1: TDBText;
    Image1: TImage;
    Memo1: TMemo;
    Memo2: TMemo;
    DBNavigator1: TDBNavigator;
    CMethod: TRadioGroup;
    GroupBox1: TGroupBox;
    FL: TFileListBox;
    DL: TDirectoryListBox;
    DCB: TDriveComboBox;
    Memo3: TMemo;
    ArchiveGroup: TGroupBox;
    ArchiveLabel: TLabel;
    Label2: TLabel;
    archivefile: TEdit;
    ListBox1: TListBox;
    Memo4: TMemo;
    Fishname: TDBEdit;
    Memo5: TMemo;
    Memo6: TMemo;
    Button1: TButton;
    Panel1: TPanel;
    Bevel1: TBevel;
    Time: TLabel;
    Percentage: TLabel;
    TimeLabel: TLabel;
    Label7: TLabel;
    Trashcan: TImage;
    Button2: TButton;
    CDBImage1: TCDBImage;
    CDBMemo1: TCDBMemo;
    Button3: TButton;
    Table1: TTable;
    Table1SpeciesNo: TFloatField;
    Table1Category: TStringField;
    Table1Common_Name: TStringField;
    Table1SpeciesName: TStringField;
    Table1Lengthcm: TFloatField;
    Table1Length_In: TFloatField;
    CDBImage1Graphic: TCGraphicField;
    CDBMemo1Notes: TCMemoField;
    DataSource1: TDataSource;
    Compress1: TCompress;
    procedure CompressOneFile(var fname: String);
    procedure ResetFileInfo;
    function GetDir: string;
    function GetDummyFilename(generatefrom: string; ext: string): string;
    procedure handleDropField(Source: TObject; archivetoo: Boolean);
    procedure SaveDirectToArchive(Source: TField; filename: string);
    procedure CompressFiles;
    function getCompressionMethod: TCompressionMethod;
    procedure showInfo(comp: TCompress);
    procedure FormCreate(Sender: TObject);
    procedure showfiles;
    procedure ExpandDelete(Operation: TCProcessMode; All: Boolean);
    procedure archivefileChange(Sender: TObject);
    procedure CMethodClick(Sender: TObject);
    procedure DLDragOver(Sender, Source: TObject; X, Y: Integer;
      State: TDragState; var Accept: Boolean);
    procedure CDBImage1DragOver(Sender, Source: TObject; X, Y: Integer;
      State: TDragState; var Accept: Boolean);
    procedure CDBImage1DragDrop(Sender, Source: TObject; X, Y: Integer);
    procedure CDBMemo1DragOver(Sender, Source: TObject; X, Y: Integer;
      State: TDragState; var Accept: Boolean);
    procedure CDBMemo1DragDrop(Sender, Source: TObject; X, Y: Integer);
    procedure CDBImage1MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure CDBMemo1MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure archivefileDragOver(Sender, Source: TObject; X, Y: Integer;
      State: TDragState; var Accept: Boolean);
    procedure archivefileDragDrop(Sender, Source: TObject; X, Y: Integer);
    procedure DLDragDrop(Sender, Source: TObject; X, Y: Integer);
    procedure TrashcanDragDrop(Sender, Source: TObject; X, Y: Integer);
    procedure FormDestroy(Sender: TObject);
    procedure ListBox1Click(Sender: TObject);
    procedure Table1AfterPost(DataSet: TDataset);
    procedure Button1Click(Sender: TObject);
    procedure FLClick(Sender: TObject);
    procedure Compress1CheckFile(var filepath: String;
      mode: TCProcessMode);
    procedure Panel1Click(Sender: TObject);
    procedure FormClick(Sender: TObject);
    procedure GroupBox1Click(Sender: TObject);
    procedure TrashcanDragOver(Sender, Source: TObject; X, Y: Integer;
      State: TDragState; var Accept: Boolean);
    procedure Button2Click(Sender: TObject);
    procedure Compress1ShowProgress(var PercentageDone: Longint);
    procedure Button3Click(Sender: TObject);
    procedure disabledragMode;
    procedure enabledragMode;
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

var FileList: TStringList; { holds information about our archive files }
    saveCompressionMethod: Integer; { see ListBox1.click }

const ShowFileInfoColor :Tcolor = clGray; { see Listbox1.click }

{ Example of accessing the TCompress performance properties }
procedure Tform1.showinfo(comp: TCompress);
begin
   ResetFileInfo;
   Time.caption:=Format('%-5.1fsecs',[Comp.CompressionTime/1000.0]{[f]});
   Percentage.caption:=IntToStr(Comp.CompressedPercentage)+'%';
end;

{ Example of a progress event (new in TCompress 2.0) }
procedure TForm1.Compress1ShowProgress(var PercentageDone: Longint);
begin
   Percentage.caption:=IntToStr(PercentageDone)+'%';
   Application.ProcessMessages;
  { you may have *other* uses for this every-8K-read event...  In fact, in V2.5
    if you set PercentageDone to -1, it will cause compression to end at the
    point reached. If so, delete from the archive the compressed file
    which was created before the abort  }
end;

{ Example of getting a list of files in a multi-file archive }
procedure TForm1.showfiles;
begin
  listbox1.clear;
  Compress1.FreeFileList(FileList); { clear list and free any file information objects in it }
  if not FileExists(archivefile.Text) then exit;
  Compress1.ScanCompressedFile(ArchiveFile.Text,Filelist);
  ListBox1.Items.addStrings(FileList); { and File info objects are
                            there too -- see ListBox1Click and FormDestroy }
end;

{ Example of expanding/deleting one or more files from a multi-file archive }
procedure TForm1.ExpandDelete(Operation: TCProcessMode; All: Boolean);
var s: Tstringlist;
  count: Integer;
begin
  if (All and (Listbox1.Items.count > 0)) or (Listbox1.selcount>0) then { something is... }
  begin
     s:=Tstringlist.create;
     try
        if All then
           s.addStrings(ListBox1.Items)
        else
           for count :=0 to Listbox1.ITems.count-1 do
            if Listbox1.selected[count] then
              s.add(Listbox1.items[count]);
        if Operation=cmExpand then { expand }
          compress1.expandfiles(ArchiveFile.Text,s)
        else
          compress1.deletefiles(ArchiveFile.Text,s);
        showinfo(Compress1);
        showfiles; { also clears selections... }
     finally
        s.free;
        Screen.Cursor := crDefault;
     end;
  end;
end;

{ Example of compressing a SINGLE file into an archive }
procedure TForm1.CompressOneFile(var fname: String);
begin
  disableDragMode;
  try
    Compress1.CompressFile(ArchiveFile.Text,fname,getCompressionMethod);
    showInfo(Compress1);
    showfiles;
  finally
    Screen.Cursor := crDefault;
    enableDragMode;
  end;
  SysUtils.DeleteFile(fname); { because for this example we're creating TEMP files only... }
end;


{ Example of compressing MULTIPLE files into an archive }
{ V4.0: For CompressFiles(only) we're also showing how
  to create a thread (and a new instance of the component) to do the
  addition.
}

procedure CompressFilesViaThread;
var s: Tstringlist;
    Count: Integer;
    tc: TCompress;
begin
  with Form1 do
  if FL.selcount>0 then { something is... }
  begin
    s:=TStringlist.Create;
    try
      disableDragMode;
      for count :=0 to FL.Items.count-1 do
        if FL.selected[count] then
          s.add(FL.items[count]);
       tc := TCompress.create(nil);
       with tc do
       begin
         RegName := Compress1.RegName; { in case you've set these }
         RegNumber := Compress1.RegNumber;
         Key := Compress1.Key;
         OnShowProgress := Compress1.OnShowProgress;
         CompressFiles(ArchiveFile.Text,s,getCompressionMethod);
         showInfo(tc);
         free;
       end;
       showfiles;
    finally;
       s.free;
       Screen.Cursor := crDefault;
       enableDragMode;
    end;
  end;
end;

procedure TForm1.CompressFiles;
var
{$IFDEF CLR}
  aThread: System.Threading.Thread;
{$ELSE}
  threadid: Cardinal;
{$ENDIF}
begin
{$IFDEF CLR}
  aThread := System.Threading.Thread.Create(CompressFilesViaThread);
  aThread.Start;
{$ELSE}
  IsMultiThread := true;
  CreateThread(nil, 8192, @CompressFilesViaThread, nil, 0, threadID);
{$ENDIF}
end;

{ Examples of setting/loading/shifting image blobs }
procedure TForm1.CDBImage1DragDrop(Sender, Source: TObject; X, Y: Integer);
var filepath: String;
    isCenterImage: Boolean;
begin
   if Source=Sender then exit; { nowt to do }
   isCenterImage := (Sender=Image1) or (Sender=Memo1);
   if (Sender is TCDBImage) and (not Table1.active) then
   begin
     showmessage('Can''t do this unless table has been opened...');
     exit;
   end;

  Screen.Cursor:= crHourGlass;
  if (Source = Image1) and (Sender is TCDBImage) then
  begin
     Table1.edit;
     CDBImage1.picture.bitmap.Assign(Image1.Picture.bitmap)
  end
  else if (Source is TCDBImage) and isCenterImage then
     Image1.picture.bitmap.Assign(CDBImage1.Picture.Bitmap)
  else
  begin   { Have we got an image? }
     filepath := '';
     if (Source is TListBox) and (Listbox1.selcount = 1) then
      filepath:=ListBox1.Items[Listbox1.ItemIndex] { archive list }
     else if (Source is TFileListBox) and (FL.selcount=1) then
        filepath:=FL.Items[FL.ItemIndex]; { file list }
     if LowerCase(ExtractFileExt(filepath))<>'.bmp' then
     begin
        MessageBeep(1);
        showmessage('Must be a .BMP file...')
     end else begin                             { ok, here we go... }
        if Source is TListBox then { must first extract file... }
        begin { Note: see ARC2BLOB.PAS and ARC2MEM.PAS for three FASTER ways
                        of going about this (no expanded file needed) }
          try
            Compress1.ExpandFile(filepath,ArchiveFile.Text);
          finally
            Screen.cursor := crDefault; { as our OnCheckFile sets it on }
          end;
          if filepath='' then exit; { was skipped on confirmation }
        end;
        Screen.Cursor:= crHourGlass;
        if isCenterImage then
           Image1.Picture.Bitmap.LoadFromfile(filepath)
        else begin
           Table1.edit;
           CDBImage1.Picture.Bitmap.LoadFromFile(filepath);
        end
     end; { else }
  end;
  if not Image1.Picture.Bitmap.Empty then
  begin
   Memo1.visible := False; { got a piccy showing... }
   image1.visible := True;
  end;
  Screen.Cursor:= crDefault;
end;

{ Examples of setting/loading/shifting CDBMemo blobs }
procedure TForm1.CDBMemo1DragDrop(Sender, Source: TObject; X, Y: Integer);
var filepath: String;
begin
  if Source=Sender then exit; { nowt to do }
  filepath := ''; { in case fails }
  if (Source is TListBox) and (Listbox1.selcount = 1) then
   filepath:=ListBox1.Items[Listbox1.ItemIndex] { archive list }
  else if (Source is TFileListBox) and (FL.selcount=1) then
     filepath:=FL.Items[FL.ItemIndex]; { file list }
  if LowerCase(ExtractFileExt(filepath))<>'.txt' then
  begin
    MessageBeep(1);
    showmessage('Must be a .TXT file...')
  end else begin                             { ok, here we go... }
    if Source is TListBox then { must first extract file... }
    begin { Note: see ARC2BLOB.PAS and ARC2MEM.PAS for three FASTER ways
                       of going about this (no expanded file needed) }
      try
        Compress1.ExpandFile(filepath,ArchiveFile.Text);
      finally
        Screen.cursor := crDefault; { as our OnCheckFile sets it on }
      end;
      if filepath='' then exit; { was skipped on confirmation }
    end;
    Screen.Cursor:= crHourGlass;
    Table1.edit;
    CDBMemo1.Lines.LoadfromFile(filepath)
  end;
  Screen.Cursor:= crDefault;
end;

procedure TForm1.CDBMemo1DragOver(Sender, Source: TObject; X, Y: Integer;
  State: TDragState; var Accept: Boolean);
begin
  accept := (Source is TFileListBox) or (Source is TListBox) or (Source is TCDBMemo);
end;

procedure TForm1.CDBImage1DragOver(Sender, Source: TObject; X, Y: Integer;
  State: TDragState; var Accept: Boolean);
begin
  accept := (Source=Image1) or (Source is TCDBImage) or
     (Source is TFileListBox) or (Source is TListBox);
end;

{ Refreshing a CDBImage so it will be compressed (assuming previously uncompressed) }
procedure TForm1.CDBImage1MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
  if Button=mbRight then { ok, refresh our field }
  begin
     CDBImage1.CopyToClipBoard;
     CDBImage1.PasteFromClipBoard;
     Table1.post;
  end;
end;

procedure TForm1.CDBMemo1MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
  if Button=mbRight then { ok, refresh our field }
  begin
     CDBMemo1.Lines[0]:=CDBMemo1.Lines[0]; { setting .Modified doesn't do it... }
     Table1.post;
  end;

end;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
97超碰欧美中文字幕| 国产精品入口麻豆九色| 国产视频一区二区三区在线观看| 亚洲精品免费一二三区| 国产一区二区在线观看视频| 欧美在线观看你懂的| 欧美激情一区不卡| 韩国精品在线观看| 欧美老肥妇做.爰bbww| 国产精品动漫网站| 国产成人免费视频网站| 欧美一区二区三区白人 | 色综合天天综合网天天看片| 欧美videossexotv100| 亚洲成人激情社区| 欧美亚洲一区二区在线观看| 国产精品欧美久久久久无广告| 国产一区二区在线影院| 欧美刺激脚交jootjob| 蜜桃视频在线一区| 日韩欧美国产一二三区| 日韩精品一级二级| 欧美视频一二三区| 亚洲国产裸拍裸体视频在线观看乱了 | 亚洲高清免费在线| 91在线国内视频| 亚洲视频 欧洲视频| 成人激情小说网站| 国产精品久久久久久久久久久免费看| 国产精品一区二区视频| 久久综合九色综合97婷婷| 久久国产欧美日韩精品| 日韩欧美一二三| 久久66热偷产精品| 久久久欧美精品sm网站| 国产高清视频一区| 国产精品你懂的| 色88888久久久久久影院野外| 一区二区三区免费看视频| 欧美三级视频在线观看| 日韩综合一区二区| 欧美一区二区三区免费大片| 麻豆精品新av中文字幕| 久久久综合九色合综国产精品| 国产成人免费在线视频| 亚洲视频免费观看| 在线播放一区二区三区| 韩国av一区二区| 中文字幕中文字幕中文字幕亚洲无线| 91蜜桃传媒精品久久久一区二区 | 国产精品美女久久久久久久久 | 在线看一区二区| 日本91福利区| 欧美激情资源网| 欧美午夜精品一区二区蜜桃| 麻豆免费看一区二区三区| 欧美国产日产图区| 欧美日韩视频在线一区二区| 韩国av一区二区三区| 亚洲日穴在线视频| 欧美不卡视频一区| 91麻豆蜜桃一区二区三区| 日韩成人免费看| 国产精品免费免费| 欧美高清视频一二三区| 国产91高潮流白浆在线麻豆 | 欧美精品乱码久久久久久| 国模娜娜一区二区三区| 亚洲欧美激情插| 久久品道一品道久久精品| 在线视频中文字幕一区二区| 国内一区二区视频| 亚洲国产va精品久久久不卡综合| 欧美变态tickling挠脚心| 色婷婷久久综合| 韩国精品主播一区二区在线观看 | 一级做a爱片久久| 国产亚洲精品bt天堂精选| 欧美日韩一区二区三区高清| 国产在线精品一区二区夜色| 亚洲制服丝袜在线| 国产精品乱人伦一区二区| 777午夜精品视频在线播放| 不卡的电影网站| 国产一区 二区 三区一级| 午夜精品国产更新| 亚洲乱码精品一二三四区日韩在线| 日韩欧美一区电影| 欧美变态凌虐bdsm| 欧美日韩精品福利| 色综合天天综合网天天看片| 国产精品18久久久久久久久| 免费的国产精品| 五月婷婷欧美视频| 亚洲国产一区二区在线播放| 17c精品麻豆一区二区免费| 久久亚洲综合色| 日韩西西人体444www| 欧美日韩精品三区| 在线免费观看一区| 91蜜桃婷婷狠狠久久综合9色| 成人免费看片app下载| 国产毛片一区二区| 国产成人aaaa| 国产成人8x视频一区二区| 国产精品99久| 丁香天五香天堂综合| 国产一区二区电影| 国产真实乱偷精品视频免| 国精品**一区二区三区在线蜜桃| 免费的国产精品| 久久国产福利国产秒拍| 免费高清不卡av| 国模娜娜一区二区三区| 国产露脸91国语对白| 福利一区福利二区| 成人av综合一区| av亚洲精华国产精华| a4yy欧美一区二区三区| 99精品视频在线播放观看| 色呦呦日韩精品| 欧美日韩一级二级| 日韩一级成人av| 国产午夜久久久久| 中文字幕中文字幕一区| 亚洲乱码国产乱码精品精小说 | 蜜臀av性久久久久蜜臀aⅴ四虎| 免费高清视频精品| 国产精品亚洲成人| av一区二区三区四区| 在线一区二区三区四区五区| 欧美日韩精品一区二区天天拍小说| 欧美剧情电影在线观看完整版免费励志电影 | 久久久久久日产精品| 欧美国产日产图区| 亚洲午夜在线观看视频在线| 日韩电影在线一区| 丁香激情综合国产| 欧美日韩在线综合| www久久精品| 中文字幕一区二区三区av| 亚洲mv大片欧洲mv大片精品| 国产麻豆9l精品三级站| 91免费在线视频观看| 51久久夜色精品国产麻豆| 国产日韩av一区二区| 亚洲一区二区三区在线| 久久精品久久99精品久久| 99免费精品在线观看| 7777精品伊人久久久大香线蕉的| 亚洲精品一区二区三区香蕉| 亚洲女人的天堂| 久久精品国产精品亚洲精品| 99re这里只有精品6| 欧美一区二区三区的| 一色屋精品亚洲香蕉网站| 青青草精品视频| 91在线视频官网| 久久久综合视频| 日韩成人精品在线| 99久久精品免费看| 精品国产伦一区二区三区观看方式 | 国产日韩精品一区| 日韩在线一区二区| 色哟哟亚洲精品| 国产婷婷色一区二区三区四区| 一区二区三区精品久久久| 国产乱子伦视频一区二区三区 | 国产成人高清视频| 欧美精品第1页| 亚洲三级在线看| 国产**成人网毛片九色| 欧美精品v日韩精品v韩国精品v| 国产精品久久午夜| 国产老妇另类xxxxx| 欧美一级一区二区| 偷拍与自拍一区| 欧美怡红院视频| 日韩码欧中文字| 菠萝蜜视频在线观看一区| 久久久午夜精品理论片中文字幕| 青青草原综合久久大伊人精品优势 | 91亚洲精品一区二区乱码| 精品国产乱码久久久久久1区2区 | 99国产精品久| 国产精品午夜春色av| 国产寡妇亲子伦一区二区| 欧美成人伊人久久综合网| 日韩vs国产vs欧美| 欧美日韩亚洲综合在线| 亚洲一区二区3| 在线免费不卡电影| 一区二区三区欧美在线观看| 色综合久久久久久久久| 亚洲欧洲韩国日本视频| 成人18视频日本| 亚洲色图制服丝袜| 色偷偷久久一区二区三区| 国产精品麻豆一区二区| av在线不卡免费看|