О!!! Спасибо! Шорошая идея!
А то в голову ничего не приходило.
Я чуть подправил... Вообще сказка!
code_31136.txt
------------ Дoбавленo в 01.22:
Вот, теперь с прогрессбарами!
Спасибо Tadу за пример.
Add(Memory,4469469,392,175)
{
}
Add(DirTools,7458426,343,175)
{
Point(doGetSize)
link(onOK,4469469:doValue,[])
}
Add(MainForm,16270488,63,280)
{
Width=443
Height=219
Caption="Пример использования Zipper"
}
Add(Button,1861068,218,189)
{
Left=10
Top=10
Width=70
Caption="Add to zipp"
link(onClick,5980988:doBrowse,[])
}
Add(FileSearch,16491530,568,217)
{
Include=2
TimeType=1
link(onSearch,6428996:doValue,[])
link(onEndSearch,10187245:doEvent1,[])
link(Dir,12208418:Var3,[(581,197)])
}
Add(Browse,5980988,260,189)
{
NewStyle=0
NewDirButton=1
link(onBrowse,12243830:doEvent1,[])
}
Add(ZLIB,5968653,784,217)
{
link(onStream,12280889:doCopy,[])
link(Stream,11495013:Stream,[(790,205)(777,205)(777,264)(748,264)])
}
Add(FileStream,11495013,742,217)
{
link(onLoad,5968653:doCompress,[])
}
Add(MultiElementEx,994934,868,168)
{
link(SourceStr,5236639:Var,[])
link(Str1,11161724:Var,[])
}
BEGIN_SDK
Add(EditMultiEx,1011609,21,21)
{
WorkCount=#6:doExec|
EventCount=#7:onMatch|
VarCount=#5:Match|
DataCount=#9:SourceStr|4:Str1|
Width=223
link(Match,5965753:GetData,[(27,183)(62,183)])
}
Add(RE_Search,14450217,98,112)
{
link(onMatch,636958:doEvent1,[])
link(SourceStr,1011609:SourceStr,[(104,66)(27,66)])
link(Expression,4976728:GetData,[])
}
Add(EventFromData,4976728,105,56)
{
link(onEvent,15764446:doString,[])
}
Add(FormatStr,15764446,147,56)
{
DataCount=1
Mask="%1.*"
link(onFString,4976728:doData,[(191,62)(191,50)(93,50)(93,62)])
link(Str1,1011609:Str1,[(153,38)(34,38)])
}
Add(EventFromData,5965753,56,112)
{
link(onEvent,14450217:doExec,[])
}
Add(Hub,636958,140,112)
{
link(onEvent1,5965753:doData,[(166,118)(166,106)(44,106)(44,118)])
link(onEvent2,1011609:onMatch,[(199,125)(199,27)])
}
END_SDK
Add(Hub,1366088,717,217)
{
OutCount=3
link(onEvent1,11495013:doOpen,[])
link(onEvent2,11495013:doClose,[])
link(onEvent3,11759996:doCalc,[(738,237)(738,327)(539,327)(539,293)])
}
Add(Memory,6428996,674,217)
{
link(onData,1366088:doEvent1,[])
}
Add(StreamPack,3237414,868,217)
{
DataCount=#8:NameFile|8:DataFile|
link(onPack,2876206:doCopyFromStream,[])
link(NameFile,994934:Match,[])
link(DataFile,12280889:Stream,[(881,205)(914,205)(914,261)(832,261)])
}
Add(LineBreak,13180867,674,259)
{
Caption="Fpath"
Type=1
link(Data,6428996:Value,[])
Primary=[5236639,194,-140]
}
Add(MemoryStream,12280889,826,217)
{
link(onCopy,3237414:doPack,[])
}
Add(LineBreak,7342614,484,257)
{
Caption="FoldName"
Type=1
link(Data,7065955:Part,[])
Primary=[11161724,391,-117]
}
Add(Hub,11380366,456,210)
{
link(onEvent1,7065955:doPart,[])
link(onEvent2,16594024:doStart,[])
}
Add(FilePartElm,7065955,484,210)
{
Point(Part)
link(FileName,12208418:Var2,[])
}
Add(FileStream,2876206,959,203)
{
FileName="C:ase.zipp"
Mode=2
AutoCopy=0
Point(doCopyFromStream)
link(FileName,10760551:Var,[])
}
Add(LineBreak,4420424,917,210)
{
Caption="End"
link(Out,2876206:doClose,[])
Primary=[6514509,-282,14]
}
Add(Hub,10187245,609,224)
{
link(onEvent1,6514509:In,[])
link(onEvent2,4072426:doMessage,[(672,237)(672,286)])
}
Add(Message,4072426,679,280)
{
Message="File compression is completed"
Icon=4
}
Add(Button,1463565,238,420)
{
Left=10
Top=100
Width=70
Caption="Extract zipp"
link(onClick,6722781:doBrowse,[])
}
Add(Browse,6722781,281,420)
{
Title="Select Folder to Extract"
NewStyle=0
link(onBrowse,10065406:doEvent1,[])
}
Add(Memory,4721377,352,427)
{
link(onData,3554236:doExecute,[])
}
Add(ODialog,3554236,392,427)
{
Filter="ZIPP|*.zipp"
Title="Select ZIPP File"
link(onExecute,9752543:doEvent1,[])
}
Add(FileStream,12778949,602,434)
{
link(onLoad,7828414:doRepeat,[(646,440)(646,482)(585,482)(585,524)])
link(FileName,12019923:Value,[(608,425)(516,425)(516,479)(482,479)])
}
Add(Repeat,7828414,609,518)
{
Type=5
link(onRepeat,11372427:doEvent1,[])
link(Op1,13725612:Var2,[])
link(Op2,13885113:Var2,[])
}
Add(StreamUnPack,5252390,692,518)
{
DataCount=#8:NameFile|8:DataFile|
link(onUnPack,13696628:doDeCompress,[])
link(Stream,12778949:Stream,[(698,487)(608,487)])
}
Add(ZLIB,13696628,741,511)
{
link(onStream,12816954:doCopyFromStream,[])
link(Stream,5252390:DataFile,[(747,504)(731,504)(731,561)(705,561)])
}
Add(FileStream,12816954,783,497)
{
Mode=1
AutoCopy=0
Point(doCopyFromStream)
link(FileName,5419735:GetData,[])
}
Add(MultiElementEx,5419735,783,455)
{
link(Str1,9209623:Var,[])
link(Str2,6911328:Var,[])
}
BEGIN_SDK
Add(EditMultiEx,2399231,21,21)
{
VarCount=#7:GetData|
DataCount=#4:Str1|4:Str2|
Width=244
Height=95
link(GetData,4980486:GetData,[(27,98)(55,98)])
}
Add(EventFromData,4980486,49,49)
{
link(onEvent,7751430:doString,[])
}
Add(FormatStr,7751430,91,49)
{
Mask="%1\%2"
link(onFString,11645887:doEvent1,[])
link(Str1,2399231:Str1,[(97,35)(27,35)])
link(Str2,2399231:Str2,[(104,35)(34,35)])
}
Add(FilePartElm,3100597,162,49)
{
Mode=0
Point(Part)
link(onPart,4811673:doDir,[])
}
Add(Dir,4811673,203,49)
{
}
Add(Hub,11645887,133,49)
{
link(onEvent1,3100597:doPart,[])
link(onEvent2,4980486:doData,[(153,62)(153,42)(37,42)(37,55)])
}
END_SDK
Add(LineBreak,7121387,692,567)
{
Caption="ExtFile"
Type=1
link(Data,5252390:NameFile,[])
Primary=[6911328,98,-139]
}
Add(LineBreak,8307470,352,469)
{
Caption="ExtFolder"
Type=1
link(Data,4721377:Value,[])
Primary=[9209623,431,-62]
}
Add(Message,8861939,658,448)
{
Message="Extract the files completed"
Icon=4
}
Add(Thread,16594024,525,217)
{
FastStop=0
link(onExec,16491530:doSearch,[])
}
Add(Memory,7465874,357,203)
{
link(onData,9020048:doOpenDialog,[])
}
Add(Thread,3319701,525,434)
{
FastStop=0
link(onExec,613065:doEvent1,[])
}
Add(Memory,12019923,476,434)
{
link(onData,3319701:doStart,[])
}
Add(Hub,613065,567,434)
{
OutCount=3
link(onEvent1,12778949:doOpen,[])
link(onEvent2,12778949:doClose,[])
link(onEvent3,8861939:doMessage,[])
}
Add(Edit,8699611,343,133)
{
Left=85
Top=10
Width=335
Enabled=1
}
Add(Edit,5965130,473,392)
{
Left=85
Top=100
Width=335
Enabled=1
}
Add(Edit,6007289,353,384)
{
Left=85
Top=125
Width=335
Enabled=1
}
Add(Label,15288312,112,364)
{
Left=15
Top=130
Width=65
Caption="Extract folder"
}
Add(Edit,15052504,492,158)
{
Left=85
Top=35
Width=335
Enabled=1
}
Add(Label,12768681,110,283)
{
Left=15
Top=40
Width=65
Caption="Zipp file"
}
Add(VisualShape,2891269,112,322)
{
Left=10
Top=90
Width=410
Height=5
ShapeType=5
}
Add(Hub,12243830,301,189)
{
OutCount=3
link(onEvent1,8699611:doText,[(326,195)(326,139)])
link(onEvent2,7458426:doGetSize,[])
link(onEvent3,7465874:doValue,[])
}
Add(MultiElementEx,9020048,408,203)
{
@Hint=#26:Выбор файла для сохранения|
link(onEvent2,15052504:doText,[(464,209)(464,164)])
link(onSelectFile,11380366:doEvent1,[])
AddHint(-72,106,166,13,@Hint)
}
BEGIN_SDK
Add(EditMultiEx,12351079,21,35)
{
WorkCount=#45:doOpenDialog=Отрывает диалог сохранения файла|
EventCount=#8:onEvent2|56:onSelectFile=Событие после выбора и проверки имени файла|
Width=433
Height=116
link(doOpenDialog,12776169:doPart,[(49,41)(49,104)])
}
Add(SDialog,12729386,147,98)
{
Filter="Аривы .zipp|*.zipp"
FileName=""
Point(FileName)
link(onExecute,8895739:doEvent1,[])
}
Add(FormatStr,753480,104,98)
{
DataCount=1
Mask="%1.zipp"
Point(FString)
link(onFString,12729386:doExecute,[])
}
Add(GlobalVar,7281363,218,105)
{
Name="file"
Data=String()
link(onValue,8038178:doFileExists,[])
}
Add(FileTools,8038178,266,84)
{
link(onEnd,12229368:doCompare,[])
link(FileName,13304793:Var,[])
}
Add(If_else,12229368,308,84)
{
Op2=Integer(1)
link(onTrue,8038178:doDelete,[(352,90)(352,74)(254,74)(254,104)])
link(onFalse,12351079:onSelectFile,[(397,97)(397,48)])
}
Add(GlobalVar,13304793,266,56)
{
Name="file"
Data=String()
}
Add(FilePartElm,12776169,63,98)
{
Point(Part)
link(onPart,753480:doString,[])
}
Add(Hub,8895739,189,98)
{
link(onEvent1,12351079:onEvent2,[(212,104)(212,41)])
link(onEvent2,7281363:doValue,[])
}
END_SDK
Add(GetDataEx,12208418,484,192)
{
Angle=3
link(Data,7465874:Value,[(448,197)(448,244)(363,244)])
}
Add(Hub,10065406,322,420)
{
link(onEvent1,6007289:doText,[(344,426)(344,390)])
link(onEvent2,4721377:doValue,[])
}
Add(Hub,9752543,434,427)
{
OutCount=3
link(onEvent1,5965130:doText,[(453,433)(453,398)])
link(onEvent2,12019923:doValue,[])
}
Add(GlobalVar,10760551,959,175)
{
Name="file"
Data=String()
}
Add(InfoTip,15198662,168,70)
{
Info=#6:Сжатие|
Font=[Times New Roman,16,0,0,204]
Width=869
Height=270
}
Add(InfoTip,4810532,168,350)
{
Info=#10:Извлечение|
Font=[Times New Roman,16,0,0,204]
Width=869
Height=319
}
Add(GetDataEx,13725612,609,496)
{
link(Data,12778949:Size,[])
}
Add(GetDataEx,13885113,616,496)
{
link(Data,12778949:Position,[])
}
Add(Hub,11372427,657,518)
{
link(onEvent1,5252390:doUnPack,[])
link(onEvent2,9656414:doCalc,[(681,531)(681,581)(625,581)(625,601)])
}
Add(ProgressBarRush,6140632,693,595)
{
Left=10
Top=155
Width=410
ColorFrom=65280
ColorTo=8421376
GradientStyle=1
Frame=0
}
Add(MathParse,9656414,637,595)
{
MathStr="(%2/%1)*100"
link(onResult,6140632:doPosition,[])
link(X1,13725612:Var1,[(643,565)(602,565)(602,501)])
link(X2,13885113:Var3,[(650,501)])
}
Add(ProgressBarRush,378188,616,287)
{
Left=10
Top=65
Width=410
WinStyle=2
ColorFrom=65280
ColorTo=8421376
GradientStyle=1
Frame=0
}
Add(MathParse,11759996,568,287)
{
MathStr="(%2/%1)*100+%0"
link(onResult,378188:doPosition,[])
link(X1,4469469:Value,[(574,275)(398,275)])
link(X2,16491530:Size,[])
}
Add(StyleXP,12677429,63,322)
{
}