diff --git a/Addons/CplxMath.pas b/Addons/CplxMath.pas new file mode 100644 index 0000000..7cd180a --- /dev/null +++ b/Addons/CplxMath.pas @@ -0,0 +1,278 @@ +unit CplxMath; +{* This unit contains functins for working with complex numbers. To use with + KOL library and its kolmath.pas unit instead of standard math.pas, define + synmbol KOL in project options, or uncomment its definition below. } + +interface + +//{$DEFINE KOL} + +{$IFNDEF KOL} + {$IFDEF KOL_MCK} + {$DEFINE KOL} + {$ENDIF} +{$ENDIF} + +uses {$IFDEF KOL} kolmath, kol {$ELSE} math, sysutils {$ENDIF}; + +type + {$IFDEF CPLX_EXTENDED} + Double = Extended; + {$ENDIF} + + Complex = record Re, Im: double end; + {* } + + function CfromReIm( Re, Im: Double ): Complex; + {* Re + i * Im } + + function Cadd( const X, Y: Complex ): Complex; + {* X + Y } + + function Cneg( const X: Complex ): Complex; + {* -X } + + function Csub( const X, Y: Complex ): Complex; + {* X - Y } + + function Cmul( const X, Y: Complex ): Complex; + {* X * Y } + + function CmulD( const X: Complex; D: Double ): Complex; + {* X * D } + + function CmulI( const X: Complex ): Complex; + {* i * X } + + function Cdiv( const X, Y: Complex ): Complex; + {* X / Y } + + function Cmod( const X: Complex ): Double; + {* Q( X.Re^2 + X.Im^2 ) } + + function Carg( const X: Complex ): Double; + {* arctg( X.Im / X.Re ) } + + function CfromModArg( R, Arg: Double ): Complex; + {* R * ( cos Arg + i * sin Arg ) } + + function Cpow( const X: Complex; Pow: Double ): Complex; + {* X ^ Pow } + + function Cpower( const X, Pow: Complex ): Complex; + {* X ^ Pow } + + function CIntPower( const X: Complex; Pow: Integer ): Complex; + {* X ^ Pow} + + function Csqrt( const X: Complex ): Complex; + {* Q( X ) } + + function Cexp( const X: Complex ): Complex; + {* exp( X ) } + + function Cln( const X: Complex ): Complex; + {* ln( X ) } + + function Ccos( const X: Complex ): Complex; + {* cos( X ) } + + function Csin( const X: Complex ): Complex; + {* sin( X ) } + + function C2Str( const X: Complex ): String; + {* } + + function C2StrEx( const X: Complex ): String; + {* experimental } + +implementation + + function CfromReIm( Re, Im: Double ): Complex; + begin + Result.Re := Re; + Result.Im := Im; + end; + + function Cadd( const X, Y: Complex ): Complex; + begin + Result.Re := X.Re + Y.Re; + Result.Im := X.Im + Y.Im; + end; + + function Cneg( const X: Complex ): Complex; + begin + Result.Re := -X.Re; + Result.Im := -X.Im; + end; + + function Csub( const X, Y: Complex ): Complex; + begin + Result := Cadd( X, Cneg( Y ) ); + end; + + function Cmul( const X, Y: Complex ): Complex; + begin + Result.Re := X.Re * Y.Re - X.Im * Y.Im; + Result.Im := X.Re * Y.Im + X.Im * Y.Re; + end; + + function CmulD( const X: Complex; D: Double ): Complex; + begin + Result.Re := X.Re * D; + Result.Im := X.Im * D; + end; + + function CmulI( const X: Complex ): Complex; + begin + Result.Re := -X.Im; + Result.Im := X.Re; + end; + + function Cdiv( const X, Y: Complex ): Complex; + var Z: Double; + begin + Z := 1.0 / ( Y.Re * Y.Re + Y.Im * Y.Im ); + Result.Re := (X.Re * Y.Re + X.Im * Y.Im ) * Z; + Result.Im := (X.Im * Y.Re - X.Re * Y.Im ) * Z; + end; + + function Cmod( const X: Complex ): Double; + begin + Result := sqrt( X.Re * X.Re + X.Im * X.Im ); + end; + + function Carg( const X: Complex ): Double; + begin + Result := ArcTan2( X.Im, X.Re ); + end; + + function CfromModArg( R, Arg: Double ): Complex; + begin + Result.Re := R * cos( Arg ); + Result.Im := R * sin( Arg ); + end; + + function Cpow( const X: Complex; Pow: Double ): Complex; + var R, A: Double; + begin + R := power( Cmod( X ), Pow ); + A := Pow * Carg( X ); + Result := CfromModArg( R, A ); + end; + + function Cpower( const X, Pow: Complex ): Complex; + begin + Result := Cexp( Cmul( X, Cln( Pow ) ) ); + end; + + function CIntPower( const X: Complex; Pow: Integer ): Complex; + begin + if (Pow < 0) or (Pow > 100) then Result := Cpow( X, Pow ) + else if Pow = 0 then + begin + Result.Re := 1; + Result.Im := 0; + end + else + begin + Result := X; + while Pow > 1 do + begin + Result := Cmul( Result, X ); + dec( Pow ); + end; + end; + end; + + function Csqrt( const X: Complex ): Complex; + begin + Result := Cpow( X, 0.5 ); + end; + + function Cexp( const X: Complex ): Complex; + var Z: Double; + begin + Z := exp( X.Re ); + Result.Re := Z * cos( X.Im ); + Result.Im := Z * sin( X.Im ); + end; + + function Cln( const X: Complex ): Complex; + begin + Result := CfromModArg( ln( Cmod( X ) ), Carg( X ) ); + end; + + function Ccos( const X: Complex ): Complex; + begin + Result := CmulI( X ); + Result := CmulD( Cadd( Cexp( Result ), Cexp( Cneg( Result ) ) ), + 0.5 ); + end; + + function Csin( const X: Complex ): Complex; + begin + Result := CmulI( X ); + Result := CmulD( Csub( Cexp(Result), Cexp( Cneg(Result) ) ), + 0.5 ); + end; + + {$IFDEF KOL} + function Abs( X: Double ): Double; + begin + Result := EAbs( X ); + end; + {$ENDIF} + + {$IFNDEF KOL} + function Double2Str( D: Double ): String; + begin + Result := DoubleToStr( D ); + end; + {$ENDIF} + + function C2Str( const X: Complex ): String; + begin + if Abs( X.Im ) < 1e-307 then + begin + Result := Double2Str( X.Re ); + end + else + begin + Result := ''; + if Abs( X.Re ) > 1e-307 then + begin + Result := Double2Str( X.Re ); + if X.Im > 0.0 then + Result := Result + ' + '; + end; + if X.Im < 0.0 then + Result := Result + '- i * ' + Double2Str( -X.Im ) + else + Result := Result + 'i * ' + Double2Str( X.Im ); + end; + end; + + function C2StrEx( const X: Complex ): String; + begin + if Abs( X.Im ) < 1e-307 then + begin + Result := Double2StrEx( X.Re ); + end + else + begin + Result := ''; + if Abs( X.Re ) > 1e-307 then + begin + Result := Double2StrEx( X.Re ); + if X.Im > 0.0 then + Result := Result + ' + '; + end; + if X.Im < 0.0 then + Result := Result + '- i * ' + Double2StrEx( -X.Im ) + else + Result := Result + 'i * ' + Double2StrEx( X.Im ); + end; + end; + +end. diff --git a/Addons/addons.dpk b/Addons/addons.dpk new file mode 100644 index 0000000..83448ff --- /dev/null +++ b/Addons/addons.dpk @@ -0,0 +1,94 @@ +package ADDONS; + +{$R *.res} +{$R 'mckCCtrls.dcr'} +{$R 'mckHTTPDownload.dcr'} +{$R 'mckQProgBar.dcr'} +{$ALIGN 1} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO ON} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST OFF} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'KOLADDONS7'} +{$DESIGNONLY} +{$IMPLICITBUILD ON} + +requires + rtl, + vcl, + vclactnband, + vclx, + MirrorKOLPackageD7; + +contains + KOLCCtrls in 'KOLCCtrls.pas', + mckCCtrls in 'mckCCtrls.pas', + KOLHashs in 'KOLHashs.PAS', + mckHashs in 'mckHashs.pas', + KOLFontEditor in 'KOLFontEditor.pas', + KOLmhxp in 'KOLmhxp.pas', + MCKMHXP in 'MCKMHXP.pas', + mckTCPSocket in 'mckTCPSocket.pas', + mckSocket in 'mckSocket.pas', + mckListEdit in 'mckListEdit.pas', + KOLSocket in 'KOLSocket.pas', + Objects in 'Objects.pas', + kolTCPSocket in 'kolTCPSocket.pas', + mckCProgBar in 'mckCProgBar.pas', + mckRarInfoBar in 'mckRarInfoBar.pas', + mckRarProgBar in 'mckRarProgBar.pas', + mckHTTP in 'mckHTTP.pas', + mckRAS in 'mckRAS.pas', + KOLRas in 'KOLRas.pas', + RAS in 'RAS.pas', + UStr in 'UStr.pas', + UWrd in 'UWrd.pas', + KOLHTTP in 'KOLHTTP.pas', + mckEcmListEdit in 'mckEcmListEdit.pas', + KOLEcmListEdit in 'KOLEcmListEdit.pas', + mckBlockCipher in 'mckBlockCipher.pas', + KOLBlockCipher in 'KOLBlockCipher.pas', + KOLQProgBar in 'KOLQProgBar.pas', + mckQProgBar in 'mckQProgBar.pas', + MCKPrintDialogs in 'MCKPrintDialogs.pas', + MCKPageSetup in 'MCKPageSetup.pas', + KOLReport in 'KOLReport.pas', + MCKReport in 'MCKReport.pas', + KOLHTTPDownload in 'KOLHTTPDownload.pas', + mckHTTPDownload in 'mckHTTPDownload.pas', + KOLPageSetupDialog in 'KOLPageSetupDialog.pas', + KOLPrintCommon in 'KOLPrintCommon.pas', + KOLPrintDialogs in 'KOLPrintDialogs.pas', + KOLPrinters in 'KOLPrinters.pas', + mckXPMenus in 'mckXPMenus.pas', + XPMenus in 'XPMenus.pas', + MCKGRushSplitterEditor in 'MCKGRushSplitterEditor.pas', + MCKGRushButtonEditor in 'MCKGRushButtonEditor.pas', + MCKGRushCheckBoxEditor in 'MCKGRushCheckBoxEditor.pas', + MCKGRushControls in 'MCKGRushControls.pas', + MCKGRushImageCollectionEditor in 'MCKGRushImageCollectionEditor.pas', + MCKGRushPanelEditor in 'MCKGRushPanelEditor.pas', + MCKGRushProgressBarEditor in 'MCKGRushProgressBarEditor.pas', + MCKGRushRadioBoxEditor in 'MCKGRushRadioBoxEditor.pas', + tinyPNG in 'tinyPNG.pas', + tinyJPGGIFBMP in 'tinyJPGGIFBMP.pas', + MZLib in 'MZLib.pas', + KOLGRushControls in 'KOLGRushControls.pas'; + +end. diff --git a/Addons/addons.res b/Addons/addons.res new file mode 100644 index 0000000..fa40de9 Binary files /dev/null and b/Addons/addons.res differ diff --git a/Addons/addons2006.bdsproj b/Addons/addons2006.bdsproj new file mode 100644 index 0000000..1313979 --- /dev/null +++ b/Addons/addons2006.bdsproj @@ -0,0 +1,173 @@ +п»ї + + + + + + + + + + + addons2006.dpk + + + 7.0 + + + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + True + True + True + + + + 0 + 0 + False + 1 + False + False + False + 16384 + 1048576 + 4194304 + KOLAddons2006 + + + + D2006 + + + + + + + False + + + + + + False + + + True + False + + + True + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1049 + 1251 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + Borland User Components + Borland Sample Components + + + diff --git a/Addons/addons2006.dpk b/Addons/addons2006.dpk new file mode 100644 index 0000000..fcb8f42 --- /dev/null +++ b/Addons/addons2006.dpk @@ -0,0 +1,96 @@ +package addons2006; + +{$R *.res} +{$R 'mckCCtrls.dcr'} +{$R 'mckHTTPDownload.dcr'} +{$R 'mckQProgBar.dcr'} +{$ALIGN 1} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO ON} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST OFF} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DESCRIPTION 'KOLAddons2006'} +{$DESIGNONLY} +{$IMPLICITBUILD ON} + +requires + rtl, + vcl, + vclactnband, + vclx, + KOLMCK10, + xmlrtl, + designide; + +contains + KOLCCtrls in 'KOLCCtrls.pas', + mckCCtrls in 'mckCCtrls.pas', + KOLHashs in 'KOLHashs.PAS', + mckHashs in 'mckHashs.pas', + KOLFontEditor in 'KOLFontEditor.pas', + KOLmhxp in 'KOLmhxp.pas', + MCKMHXP in 'MCKMHXP.pas', + mckTCPSocket in 'mckTCPSocket.pas', + mckSocket in 'mckSocket.pas', + mckListEdit in 'mckListEdit.pas', + KOLSocket in 'KOLSocket.pas', + Objects in 'Objects.pas', + kolTCPSocket in 'kolTCPSocket.pas', + mckCProgBar in 'mckCProgBar.pas', + mckRarInfoBar in 'mckRarInfoBar.pas', + mckRarProgBar in 'mckRarProgBar.pas', + mckHTTP in 'mckHTTP.pas', + mckRAS in 'mckRAS.pas', + KOLRas in 'KOLRas.pas', + RAS in 'RAS.pas', + UStr in 'UStr.pas', + UWrd in 'UWrd.pas', + KOLHTTP in 'KOLHTTP.pas', + mckEcmListEdit in 'mckEcmListEdit.pas', + KOLEcmListEdit in 'KOLEcmListEdit.pas', + mckBlockCipher in 'mckBlockCipher.pas', + KOLBlockCipher in 'KOLBlockCipher.pas', + KOLQProgBar in 'KOLQProgBar.pas', + mckQProgBar in 'mckQProgBar.pas', + MCKPrintDialogs in 'MCKPrintDialogs.pas', + MCKPageSetup in 'MCKPageSetup.pas', + KOLReport in 'KOLReport.pas', + MCKReport in 'MCKReport.pas', + KOLHTTPDownload in 'KOLHTTPDownload.pas', + mckHTTPDownload in 'mckHTTPDownload.pas', + KOLPageSetupDialog in 'KOLPageSetupDialog.pas', + KOLPrintCommon in 'KOLPrintCommon.pas', + KOLPrintDialogs in 'KOLPrintDialogs.pas', + KOLPrinters in 'KOLPrinters.pas', + mckXPMenus in 'mckXPMenus.pas', + XPMenus in 'XPMenus.pas', + MCKGRushSplitterEditor in 'MCKGRushSplitterEditor.pas', + MCKGRushButtonEditor in 'MCKGRushButtonEditor.pas', + MCKGRushCheckBoxEditor in 'MCKGRushCheckBoxEditor.pas', + MCKGRushControls in 'MCKGRushControls.pas', + MCKGRushImageCollectionEditor in 'MCKGRushImageCollectionEditor.pas', + MCKGRushPanelEditor in 'MCKGRushPanelEditor.pas', + MCKGRushProgressBarEditor in 'MCKGRushProgressBarEditor.pas', + MCKGRushRadioBoxEditor in 'MCKGRushRadioBoxEditor.pas', + tinyPNG in 'tinyPNG.pas', + tinyJPGGIFBMP in 'tinyJPGGIFBMP.pas', + MZLib in 'MZLib.pas', + KOLGRushControls in 'KOLGRushControls.pas'; + +end. diff --git a/Addons/addons2006.res b/Addons/addons2006.res new file mode 100644 index 0000000..653aa54 Binary files /dev/null and b/Addons/addons2006.res differ diff --git a/Addons/addons_whatsnew.txt b/Addons/addons_whatsnew.txt new file mode 100644 index 0000000..3e83938 --- /dev/null +++ b/Addons/addons_whatsnew.txt @@ -0,0 +1,21 @@ +------------------------------------------------------------------- +6.08.09 +------------------------------------------------------------------- + +Первая ревизия %) + +в состав включены: + + MCK.KOLFontEditor (с ним гораздо удобнее менять шрифт в редакторе форм) + + KOLCryptoLib (генераторы хешей перенесены в файлая kol(mck)Hashs) + + TKOLTrackBar (исправлена ошибка: не вызывалось событие OnScroll) (KOL(MCK)CCtrls) + + Набор SPC контролов (перенесен в KOL(MCK)CCtrls) + + MHXP Компонент (создание манифеста) + + Несколько компонентов для работы с сокетами + + TKOLListEdit (listview с возможностью редактирования) + + TKOLEcmListEdit (см. выше, но лучше имхо, потом оставлю что-то одно) + + TRarInfoBar\Progress (прогресс бар похожие на те, что в винраре) + + пара компонентов для работы с http + + XPMenu (менюшки в стиле ХР или скорее в стиле офиса ХР) + + несколько компонентов для "работы с принтером", создания репортов + + GRUSH Controls (см. GRushControls#README#RUS#.txt), так же включен ToGrush (см. в KOL описание директивы USE_GRUSH) + + JpegObj\KOLGif\KOLPcx и т.д (не имеют зеркал) \ No newline at end of file