| Потоки | - LZH |
LZH
Краткое описание
Компонент предназначен для сжатия и декодирования потока данных по алгоритму LZH
Параметры
Методы
События
Свойства
Данные
Пример
Пример использования компонента LZH для сжатия/восстановления файлов
Пример использования компонента LZH для сжатия/восстановления потока данных
Add(MainForm,11110781,448,133)
{
Left=300
Top=200
Width=153
Height=93
Font=[Arial,8,0,0,204]
Caption="LZH File"
BorderStyle=3
}
Add(Button,10125888,105,77)
{
Left=10
Top=10
Font=[Arial,8,1,0,204]
TabOrder=-1
Caption="Pack"
link(onClick,1096359:doEvent1,[])
AddHint(-65,38,40,13,Caption)
}
Add(Button,6333852,105,140)
{
Left=80
Top=10
Font=[Arial,8,1,0,204]
TabOrder=-1
Caption="Unpack"
link(onClick,5168960:doEvent1,[])
AddHint(-65,35,53,13,Caption)
}
Add(ODialog,1914952,203,77)
{
FileName=""
link(onExecute,10416334:doValue,[])
}
Add(Memory,11596301,399,77)
{
}
Add(SDialog,16264439,350,77)
{
FileName=""
link(onExecute,11596301:doValue,[])
}
Add(Hub,1185699,350,154)
{
link(onEvent1,13703545:doStop,[(375,160)(375,146)])
link(onEvent2,6925404:doString,[(375,167)(375,280)(285,280)(285,251)])
}
Add(Message,8664802,399,245)
{
Caption="Done!!!"
}
Add(ProgressBar,11003155,399,196)
{
Top=41
Width=147
Align=4
Ctl3D=0
WinStyle=2
Smooth=1
ProgressColor=7554575
Point(doMax)
}
Add(FormatStr,6925404,301,245)
{
DataCount=1
Mask="File size is %1 bytes"
link(onFString,8664802:doMessage,[])
link(Str1,11453931:DestSize,[])
}
Add(Message,8038993,448,210)
{
Message="Невозможно создать файл"
Caption="Error"
Icon=1
}
Add(TimeCounter,13703545,399,133)
{
link(onStop,11110781:doCaption,[(439,146)(439,139)])
}
Add(Hub,1096359,154,77)
{
link(onEvent1,7999595:doWork2,[])
link(onEvent2,1934272:doStart,[(193,90)(193,139)])
}
Add(Hub,5168960,154,140)
{
link(onEvent1,7999595:doWork3,[(186,146)])
link(onEvent2,13232037:doStart,[(186,153)(186,209)])
}
Add(HubEx,7999595,182,77)
{
link(onEvent,1914952:doExecute,[])
}
Add(Thread,1934272,210,133)
{
Delay=0
FastStop=0
link(onExec,4009044:doEvent1,[])
}
Add(Thread,13232037,210,203)
{
Delay=0
FastStop=0
link(onExec,2659492:doEvent1,[])
}
Add(Hub,4009044,252,133)
{
link(onEvent1,15631013:doWork2,[])
link(onEvent2,11453931:doPackFile,[(284,146)(284,209)])
}
Add(Hub,2659492,252,203)
{
link(onEvent1,15631013:doWork3,[(277,209)])
link(onEvent2,11453931:doUnpackFile,[])
}
Add(HubEx,15631013,273,133)
{
link(onEvent,13703545:doStart,[])
}
Add(LZH,11453931,301,189)
{
ProgressInterval=1000
Point(DestSize)
Point(onProgress)
Point(onProgressMax)
Point(onPackUnpackError)
Point(FileName)
Point(NewFileName)
Point(doPackFile)
Point(doUnpackFile)
Point(onPackUnpackFile)
link(onProgress,11003155:doPosition,[])
link(onProgressMax,11003155:doMax,[])
link(onPackUnpackError,8038993:doMessage,[])
link(FileName,10416334:Value,[(314,125)(258,125)])
link(NewFileName,11596301:Value,[(321,125)(405,125)])
link(onPackUnpackFile,1185699:doEvent1,[(341,223)(341,160)])
}
Add(Memory,10416334,252,77)
{
link(onData,6782497:doData,[])
}
Add(DoData,6782497,301,77)
{
link(onEventData,16264439:doExecute,[])
}
Add(MainForm,11110781,497,133)
{
Left=300
Top=200
Width=153
Height=93
Font=[Arial,8,0,0,204]
Caption="LZH Stream"
BorderStyle=3
}
Add(Button,10125888,105,77)
{
Left=10
Top=10
Font=[Arial,8,1,0,204]
TabOrder=-1
Caption="Pack"
link(onClick,1096359:doEvent1,[])
AddHint(-66,38,40,13,Caption)
}
Add(Button,6333852,105,140)
{
Left=80
Top=10
Font=[Arial,8,1,0,204]
TabOrder=-1
Caption="Unpack"
link(onClick,5168960:doEvent1,[])
AddHint(-66,40,53,13,Caption)
}
Add(ODialog,1914952,210,77)
{
FileName=""
link(onExecute,12259100:doOpen,[])
}
Add(FileStream,12259100,301,77)
{
link(onLoad,16264439:doExecute,[])
}
Add(Memory,11596301,392,77)
{
}
Add(SDialog,16264439,343,77)
{
FileName=""
link(onExecute,11596301:doValue,[])
}
Add(FileStream,13389639,392,140)
{
Mode=1
AutoCopy=0
Point(doCopyFromStream)
link(FileName,11596301:Value,[])
}
Add(Hub,1185699,350,154)
{
OutCount=4
link(onEvent1,13389639:doCopyFromStream,[])
link(onEvent2,13703545:doStop,[(433,167)(433,146)])
link(onEvent3,12259100:doClose,[(376,174)(376,132)(289,132)(289,90)])
link(onEvent4,6925404:doString,[(376,181)(376,283)(285,283)(285,251)])
}
Add(Message,8664802,392,245)
{
Caption="Done!!!"
}
Add(ProgressBar,11003155,392,196)
{
Top=41
Width=147
Align=4
Ctl3D=0
WinStyle=2
Smooth=1
ProgressColor=7554575
Point(doMax)
}
Add(FormatStr,6925404,301,245)
{
DataCount=1
Mask="File size is %1 bytes"
link(onFString,8664802:doMessage,[])
link(Str1,11453931:DestSize,[])
}
Add(Message,8038993,448,210)
{
Message="Невозможно создать файл"
Caption="Error"
Icon=1
}
Add(TimeCounter,13703545,448,133)
{
link(onStop,11110781:doCaption,[(488,146)(488,139)])
}
Add(Hub,1096359,154,77)
{
link(onEvent1,7999595:doWork2,[])
link(onEvent2,1934272:doStart,[(193,90)(193,139)])
}
Add(Hub,5168960,154,140)
{
link(onEvent1,7999595:doWork3,[(186,146)])
link(onEvent2,13232037:doStart,[(186,153)(186,195)])
}
Add(HubEx,7999595,182,77)
{
link(onEvent,1914952:doExecute,[])
}
Add(Thread,1934272,210,133)
{
Delay=0
FastStop=0
link(onExec,4009044:doEvent1,[])
}
Add(Thread,13232037,210,189)
{
Delay=0
FastStop=0
link(onExec,2659492:doEvent1,[])
}
Add(Hub,4009044,252,133)
{
link(onEvent1,15631013:doWork2,[])
link(onEvent2,11453931:doCompress,[(284,146)(284,195)])
}
Add(Hub,2659492,252,189)
{
link(onEvent1,15631013:doWork3,[(277,195)])
link(onEvent2,11453931:doDeCompress,[])
}
Add(HubEx,15631013,273,133)
{
link(onEvent,13703545:doStart,[])
}
Add(LZH,11453931,301,189)
{
Point(DestSize)
Point(onProgress)
Point(onProgressMax)
Point(onPackUnpackError)
link(onStream,1185699:doEvent1,[(341,195)(341,160)])
link(Stream,12259100:Stream,[])
link(onProgress,11003155:doPosition,[])
link(onProgressMax,11003155:doMax,[])
link(onPackUnpackError,8038993:doMessage,[])
}
Замечания
Обновление элемента: [svn]LZH.pas[/svn]
BB-code статьи для вставки
Всего комментариев: 0
(комментарии к статье еще не добавлены)