Вверх ↑
Ответов: 824
Рейтинг: 138
#1: 2014-08-10 19:47:55 ЛС | профиль | цитата
Странненько как-то схемка скопировалась....
------------ Дoбавленo в 19.47:
Add(MainForm,9527681,189,98)
{
Width=413
Height=148
Caption="MAU Database Backup"
BorderStyle=1
link(onCreate,6193362:doData,[])
}
Add(InlineCode,11032646,294,315)
{
@Hint=#2:7я|45:Извлечение файлов из архива в указаную папку |
WorkPoints=#35:doExtract=Извлекает файлы из архива|23:doCreate=Сжатие в архив|
EventPoints=#41:onFinish=Событие после окончания операции|10:onProgress|13:onProgressMax|
DataPoints=#22:SourseFile=Файл архива|25:DestPatch=Путь извлечения|27:OutFile=Файл для сохранения|6:CLevel|7:CMethod|0:|
Code=#15:unit HiAsmUnit;|0:|9:interface|0:|41:uses kol,Share,Debug, sevenzip, Messages;|0:|4:type|28: THiAsmClass = class(TDebug)|10: private|0:|9: public|9: //Data|24: SourseFile:THI_Event;|23: DestPatch:THI_Event;|21: OutFile:THI_Event;|20: CLevel:THI_Event;|21: CMethod:THI_Event;|10: //Event|22: onFinish:THI_Event;|24: onProgress:THI_Event;|27: onProgressMax:THI_Event;|11: //doWork|52: procedure doExtract(var _Data:TData; Index:Word);|51: procedure doCreate(var _Data:TData; Index:Word);|96:// function ProgressCallback(sender: Pointer; total: boolean; value: int64): HRESULT; stdcall;|5: end;|1: |14:implementation|0:|15:var sf: String;|11:dp: String;|12:ouf: String;|0:|0:|132:function ProgressCallback(sender: Pointer; total: boolean; value: int64): HRESULT; stdcall; //Функция вывода данных на прогресс-бар|6: begin|17: if total then|61: _hi_onEvent(THiAsmClass(sender).onProgressMax, value) else|54: _hi_onEvent(THiAsmClass(sender).onProgress, value);|19: Result := S_OK;|5: end;|0:|72:procedure THiAsmClass.doExtract; //Извлечение файла в указанный каталог|5:begin|34:sf:= ReadString(_Data,SourseFile);|33:dp:= ReadString(_Data,DestPatch);|0:|40:with CreateInArchive(CLSID_CFormat7z) do|6: begin|16: OpenFile(sf);|47: SetProgressCallback(Self, ProgressCallback);|17: ExtractTo(dp);|5: end;|25:_hi_OnEvent(onFinish,');|4:end;|0:|48:procedure THiAsmClass.doCreate; //Сжатие файла|4:var |20:Arch: I7zOutArchive;|26:Met: T7zCompressionMethod;|7: begin|36: sf:= ReadString(_Data,SourseFile);|34: ouf:= ReadString(_Data,OutFile);|60:// Met:= T7zCompressionMethod(ReadInteger(_Data, CMethod));|43: Arch:= CreateOutArchive(CLSID_CFormat7z);|9: begin|43: Arch.AddFile(sf, ExtractFileName(sf));|59: SetCompressionLevel(Arch, ReadInteger(_Data, CLevel));|34: //SetMultiThreading(Arch, 4);|54: Arch.SetProgressCallback(Self, ProgressCallback);|28: Arch.SaveToFile(ouf)|11: end;|19: Arch:= nil; |27:_hi_OnEvent(onFinish, ');|5:end;|1:|4:end.|
link(onFinish,8851918:doMessage,[])
link(onProgress,13568845:doCalc,[])
link(onProgressMax,2380161:doValue,[])
link(SourseFile,3866846:Text,[(300,285)(153,285)])
link(OutFile,16636503:Var2,[])
link(CLevel,5252122:Index,[])
}
Add(StyleXP,4230452,49,130)
{
}
Add(Label,12171220,125,179)
{
Left=10
Top=34
Width=92
Height=17
Caption="Сhoose Out File"
}
Add(Edit,5273902,308,182)
{
Left=100
Top=30
Width=270
Text=""
ReadOnly=0
}
Add(Thread,49940,238,322)
{
Delay=1
FastStop=0
link(onExec,11032646:doCreate,[])
}
Add(MultiElementEx,8162144,147,315)
{
link(onEvent1,16052644:doWork1,[(200,321)])
link(onEvent2,16052644:doWork2,[])
link(FileName,16636503:Var1,[(153,292)])
}
BEGIN_SDK
Add(EditMultiEx,14924651,21,21)
{
WorkCount=#12:doFileExists|
EventCount=#8:onEvent1|8:onEvent2|
DataCount=#8:FileName|
Width=174
Height=81
link(doFileExists,7893840:doFileExists,[(32,27)(32,76)])
}
Add(FileTools,7893840,49,49)
{
DelToRecycle=1
link(onEnd,3472324:doEvent,[])
link(FileName,14924651:FileName,[(55,33)(27,33)])
}
Add(IndexToChanel,3472324,91,49)
{
link(onEvent1,14924651:onEvent1,[(130,55)(130,27)])
link(onEvent2,9272160:doEvent1,[])
}
Add(Hub,9272160,133,56)
{
link(onEvent1,7893840:doDelete,[(158,62)(158,41)(39,41)(39,69)])
link(onEvent2,14924651:onEvent2,[(165,69)(165,34)])
}
END_SDK
Add(MathParse,13568845,399,322)
{
MathStr="trunc((%1/%2)*100) "
link(onResult,4774259:doPosition,[])
link(X2,2380161:Value,[(412,313)(391,313)(391,369)(356,369)])
}
Add(HubEx,16052644,196,322)
{
link(onEvent,49940:doStart,[])
}
Add(ComboBox,5252122,301,70)
{
@Group=80480160
Left=100
Top=55
Width=95
Height=21
Strings=#5:Store|7:Fastest|5:Faste|6:Normal|7:Maximum|5:Ultra|
Text=""
ReadOnly=0
Point(Index)
Point(doSelect)
}
Add(Label,10069394,299,20)
{
@Group=80480160
Left=10
Top=60
Width=79
Height=17
Caption="Compress Level"
}
Add(Label,7778279,49,182)
{
Left=10
Top=10
Width=71
Height=17
Caption="Сhoose In File"
}
Add(Button,12779734,176,182)
{
Left=370
Top=30
Width=25
Caption="..."
link(onClick,12843300:doExecute,[])
}
Add(Button,9444944,56,315)
{
Left=280
Top=54
Width=115
Height=23
Caption="Start"
link(onClick,8162144:doFileExists,[])
}
Add(DoData,6193362,245,112)
{
Data=Integer(3)
link(onEventData,5252122:doSelect,[])
}
Add(ProgressBarRush,4774259,448,322)
{
Left=10
Top=85
Width=385
Point(doMax)
}
Add(Memory,2380161,350,329)
{
}
Add(SDialog,12843300,259,182)
{
Filter="7 zip|*.7z"
FileName=""
Point(doFileName)
link(onExecute,5273902:doText,[])
}
Add(Edit,3866846,147,228)
{
Left=100
Top=5
Width=270
Text=""
link(onChange,4826214:doPart,[])
}
Add(Button,10710181,48,228)
{
Left=370
Top=5
Width=25
Caption="..."
link(onClick,14577979:doExecute,[])
}
Add(ODialog,14577979,98,228)
{
link(onExecute,3866846:doText,[])
}
Add(FilePartElm,4826214,196,228)
{
Mode=2
Point(Part)
link(onPart,12843300:doFileName,[(235,234)(235,195)])
}
Add(GetDataEx,16636503,308,287)
{
link(Data,5273902:Text,[])
}
Add(Message,8851918,504,315)
{
Message="Finish"
}

карма: 1

0