From 0f9b11b13857a59912eaf3de1dcd76ffe39e467b Mon Sep 17 00:00:00 2001 From: dkolmck Date: Wed, 2 Nov 2011 16:34:07 +0000 Subject: [PATCH] 3.15 git-svn-id: https://svn.code.sf.net/p/kolmck/code@108 91bb2d04-0c0c-4d2d-88a5-bbb6f4c1fa07 --- KOL.pas | 20 ++++++++++++++------ MCKfakeClasses.inc | 1 + delphicommctrl.inc | 7 +++++++ mirror.pas | 41 +++++++++++++++++++++++++++++++++++------ 4 files changed, 57 insertions(+), 12 deletions(-) diff --git a/KOL.pas b/KOL.pas index 92dc8bf..77c9f41 100644 --- a/KOL.pas +++ b/KOL.pas @@ -14,7 +14,7 @@ Key Objects Library (C) 2000 by Vladimir Kladov. **************************************************************** -* VERSION 3.1415926535897 +* VERSION 3.15 **************************************************************** K.O.L. - is a set of objects and functions to create small programs @@ -11558,6 +11558,8 @@ var _AnsiCompareStrNoCaseA: function(S1, S2: PAnsiChar): Integer = {* The same, but for PChar ANSI strings } function AnsiCompareTextA( const S1, S2: AnsiString ): Integer; {* } +function CompareAnsiCase( const S1, S2: PAnsiChar ): Integer; +function CompareAnsiNoCase( const S1, S2: PAnsiChar ): Integer; {$IFDEF WIN} {$IFNDEF _FPC} @@ -12434,6 +12436,8 @@ procedure SortArray( const Data: Pointer; const uNElem: Dword; dwords (or integers or pointers occupying for 4 bytes for each item. } {$ENDIF} +procedure SwapStrListExItems( const Sender: Pointer; const e1, e2: DWORD ); + procedure SwapListItems( const L: Pointer; const e1, e2: DWORD ); {* Use this function as the last parameter for SortData call when a PList object is sorting. SwapListItems just exchanges two items of the list. } @@ -14268,7 +14272,7 @@ function CrackStack_MapInFile( const MapFileName: KOLString; Max_length: Integer //......... these declarations are here to stop hints from Delphi5 while compiling MCK: function CallTControlCreateWindow( Ctl: PControl ): Boolean; function DumpWindowed( c: PControl ): PControl; -function WndProcAppAsm( Self_: PControl; var Msg: TMsg; var Rslt: Integer ): Boolean; forward; +function WndProcAppAsm( Self_: PControl; var Msg: TMsg; var Rslt: Integer ): Boolean; //22{$IFDEF ASM_VERSION} const ButtonClass: array[ 0..6 ] of KOLChar = ( 'B','U','T','T','O','N',#0 ); //22{$ENDIF ASM_VERSION} @@ -14801,6 +14805,8 @@ asm TEST EAX, EAX JNZ @@exit MOV EAX, offset[EmptyString] + //LEA EAX, [EmptyString] + //MOV EAX, [EmptyString] @@exit: end; @@ -25464,14 +25470,15 @@ var h12, hAM: Boolean; function GetMonth( const fmt: KOLString; var S: PKOLChar ): Integer; var SD: TSystemTime; M: Integer; - C, MonthStr: KOLString; + MonthStr: KOLString; begin GetSystemTime( SD ); + SD.wDay := 1; for M := 1 to 12 do begin SD.wMonth := M; - C := SystemDate2Str( SD, LOCALE_USER_DEFAULT, dfLongDate, PKOLChar( fmt + '/dd/yyyy/' ) ); - MonthStr := Parse( C, '/' ); + MonthStr := SystemDate2Str( SD, LOCALE_USER_DEFAULT, dfLongDate, PKOLChar( fmt {+ '/dd/yyyy/'} ) ); + //MonthStr := Parse( C, '/' ); //++ -- by GMax if AnsiCompareStrNoCase( MonthStr, Copy( S, 1, Length( MonthStr ) ) ) = 0 then begin Inc( S, Length( MonthStr ) ); @@ -32644,7 +32651,8 @@ begin Form := Form.Parent; Form := Form.ParentForm; if (Form <> nil) and (Form.MDIClient <> nil) then - Result := TranslateMDISysAccel( Form.MDIClient.fHandle, Msg ); + Result := TranslateMDISysAccel( Form.MDIClient.fHandle, + Windows.TMsg(Msg) ); end; end; end; diff --git a/MCKfakeClasses.inc b/MCKfakeClasses.inc index b2677a9..5483d42 100644 --- a/MCKfakeClasses.inc +++ b/MCKfakeClasses.inc @@ -26,6 +26,7 @@ TKOLMDIClient = PControl; TKOLMDIChild = Pointer; TKOLService = Pointer; + TBringFront = Pointer; TKOLButton = PControl; TKOLLabel = PControl; diff --git a/delphicommctrl.inc b/delphicommctrl.inc index f063225..c7fa1bc 100644 --- a/delphicommctrl.inc +++ b/delphicommctrl.inc @@ -3,6 +3,12 @@ -- included in KOL.pas -- *******************************************************************************} +{$IFNDEF FPC} +{$IFNDEF TMSG_WINDOWS} + {$DEFINE TMSG_DECODED} +{$ENDIF} +{$ENDIF} +{$IFDEF TMSG_DECODED} {$I MsgDecode.pas} type TMsg = packed record @@ -20,6 +26,7 @@ type end; tagMSG = TMsg; +{$ENDIF TMSG_DECODED} //////////////////////////////////////////////////////////////////////////// diff --git a/mirror.pas b/mirror.pas index e04f4e5..fa402b0 100644 --- a/mirror.pas +++ b/mirror.pas @@ -2290,6 +2290,7 @@ type // // Функция, которая инициализацию части свойств выполняет в виде // последовательности вызовов "прозрачных" методов (см. описание KOL) + function ParentBorder: Integer; function GenerateTransparentInits: String; virtual; function P_GenerateTransparentInits: String; virtual; @@ -5413,7 +5414,9 @@ begin S := S + '.MouseTransparent'; if LikeSpeedButton then S := S + '.LikeSpeedButton'; - if Border <> DefaultBorder then + if (Border <> DefaultBorder) or + (Border = DefaultBorder) and + (ParentBorder >= 0) and (ParentBorder <> Border) then S := S + '.SetBorder( ' + IntToStr( Border ) + ')'; Result := Trim( S ); @@ -10479,6 +10482,23 @@ begin Result := 2; end; +function TKOLCustomControl.ParentBorder: Integer; +var C: TWinControl; +begin + Result := -1; + C := Parent; + if C <> nil then + begin + if C is TKOLCustomControl then + Result := (C as TKOLCustomControl).Border + else if C is TCustomForm then + begin + if ParentKOLForm <> nil then + Result := ParentKOLForm.Border; + end; + end; +end; + { TKOLApplet } procedure TKOLApplet.AssignEvents(SL: TStringList; const AName: String); @@ -11918,7 +11938,7 @@ end; // настроенный в design-time на форме MCK-проекта. Устанавливаются все публичные // свойства, отличающиеся своим значением от тех, которые назначаются по умолчанию // в конструкторе объекта. -procedure ConstructComponent( SL: TStringList; C: TComponent ); +function ConstructComponent( SL: TStringList; C: TComponent ): Boolean; var Props, PropsD: PPropList; NProps, NPropsD, I, J: Integer; PropName, PropValue, PropValueD: String; @@ -11932,6 +11952,7 @@ begin DB 'ConstructComponent', 0 @@e_signature: end; + Result := FALSE; //SL.Add( ' Result.' + C.Name + ' := ' + C.ClassName + '.Create( nil );' ); if C is TOleControl then SL.Add( ' Result.' + C.Name + @@ -11942,6 +11963,11 @@ begin try try NProps := GetPropList( C.ClassInfo, tkAny, Props ); + for I := 0 to NProps-1 do + begin + if Props[I].Name = 'NotConstruct_KOLMCK' then + Exit; {>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>} + end; SL.Add( ' //-- found ' + IntToStr( NProps ) + ' published props' ); if NProps > 0 then BEGIN @@ -11995,11 +12021,13 @@ begin END; finally FreeMem( Props ); + FreeMem( PropsD ); D.Free; end; except SL.Add( ' //-----^------Exception while getting properties of ' + C.Name ); end; + Result := TRUE; end; procedure TKOLForm.GenerateChildren( SL: TStringList; OfParent: TComponent; const OfParentName: String; const Prefix: String; @@ -12658,9 +12686,10 @@ begin if TComponent( oc[ I ] ) is TComponent then // ай-я-яй! begin SL.Add( '' ); - ConstructComponent( SL, oc[ I ] ); - GenerateAdd2AutoFree( SL, 'Result.' + TComponent( oc[ I ] ).Name + '.Free', - FALSE, 'Add2AutoFreeEx', nil ); + if ConstructComponent( SL, oc[ I ] ) then + GenerateAdd2AutoFree( SL, 'Result.' + + TComponent( oc[ I ] ).Name + '.Free', + FALSE, 'Add2AutoFreeEx', nil ); end; end; @@ -15276,7 +15305,7 @@ begin end; end; - if Border <> 2 then + if (Border <> 2) then if FormCompact then begin if Border = 1 then