git-svn-id: https://svn.code.sf.net/p/kolmck/code@104 91bb2d04-0c0c-4d2d-88a5-bbb6f4c1fa07
This commit is contained in:
dkolmck 2011-02-19 19:22:48 +00:00
parent f06b874897
commit 1a8264f100
6 changed files with 3384 additions and 2305 deletions

4622
KOL.pas

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
//------------------------------------------------------------------------------
// KOL_ASM.inc ()to be inlude in KOL.pas)
// v 3.08
// KOL_ASM.inc (to inlude in KOL.pas)
// v 3.1415
function MsgBox( const S: KOLString; Flags: DWORD ): DWORD;
asm
@ -677,7 +677,7 @@ asm
XOR EAX, EAX
end;
procedure Run( var AppletWnd: PControl );
procedure Run( var AppletCtl: PControl );
asm
CMP EAX, 0
JZ @@exit
@ -3301,6 +3301,12 @@ asm
MOV [EBX].TControl.PP.fControlClick, offset[ClickRadio]
TEST ESI, ESI
JZ @@exit
{$IFDEF USE_FLAGS}
BTS DWORD PTR [ESI].TControl.fFlagsG1, 1 shl G1_HasRadio
JNZ @@exit
MOV EAX, EBX
CALL TControl.SetRadioChecked
{$ELSE}
MOV ECX, [EBX].TControl.fMenu
PUSH ECX
MOV EDX, offset[RADIO_LAST]
@ -3318,6 +3324,7 @@ asm
CALL TControl.Set_Prop_Int
MOV EAX, EBX
CALL TControl.SetRadioChecked
{$ENDIF}
@@exit: XCHG EAX, EBX
POP ESI
POP EBX
@ -8601,60 +8608,72 @@ const tk_Tab = 1;
tk_UD = 4;
tk_PuPd= 8;
asm
PUSH EBX
XCHG EBX, EAX
PUSH ESI
MOV ESI, offset[@@data]
PUSH EAX
MOV AH, 9
@@loop:
LODSB
CMP DL, AL
JE @@1
LODSB
CMP DL, AL
JE @@2
ADD AH, AH
JNB @@loop
POP EAX
@@exit0:
XOR EAX, EAX
JMP @@exit
@@loop:
LODSW
TEST EAX, EAX
JZ @@exit_false
@@data:
DB -1, VK_TAB, VK_LEFT, VK_RIGHT, VK_UP, VK_DOWN, VK_PRIOR, VK_NEXT
CMP AL, DL
JNZ @@loop
@@1:
OR EDX, -1
JMP @@3
@@2:
XOR EDX, EDX
TEST AH, 1
JZ @@3
PUSH ECX
PUSH EAX
PUSH VK_SHIFT
CALL GetKeyState
CWDE
XCHG EDX, EAX
POP EAX
POP ECX
@@3:
POP ESI
MOV AL, AH
{$IFDEF PARANOIA} DB $24, 1 {$ELSE} AND AL, 1 {$ENDIF}
TEST byte ptr [ESI].TControl.fLookTabKeys, AL
JZ @@exit0
TEST [EBX].TControl.fLookTabKeys, AH
JZ @@exit_false
TEST CL, CL
JNZ @@exit
JNZ @@exit_true
MOV DH, AH
PUSH EDX
MOV EAX, ESI
CALL TControl.ParentForm
XCHG EAX, EBX
CALL TControl.ParentForm
XCHG ESI, EAX
POP EAX
CMP AL, 9
JNZ @@test_flag
PUSH EAX
PUSH VK_SHIFT
CALL GetKeyState
POP EDX
AND AH, $80
OR AH, DH
@@test_flag:
{XOR EDX, EDX
INC EDX
ADD AH, AH
JNC @@tabul_1
NEG EDX
@@tabul_1:} //AH<80 //AH>=80
ADD AH, AH // //
SBB EDX, EDX //EDX=0 //EDX=-1
ADD EDX, EDX // 0 // -2
INC EDX // 1 // -1
XCHG EAX, ESI
CALL Tabulate2Next
@@exit:
@@exit_true:
MOV AL, 1
POP ESI
POP EBX
RET
@@data:
DB VK_TAB, tk_Tab, VK_LEFT, tk_LR or $80, VK_RIGHT, tk_LR
DB VK_UP, tk_UD or $80, VK_DOWN, tk_UD
DB VK_PRIOR, tk_PuPd or $80, VK_NEXT, tk_PuPd, 0, 0
@@exit_false:
XOR EAX, EAX
POP ESI
POP EBX
RET
end;
function TControl.Tabulate: PControl;
@ -8875,30 +8894,21 @@ end;
procedure TControl.SetVerticalAlign(const Value: TVerticalAlign);
asm
PUSH EBX
MOVZX EBX, DL
MOV [EAX].fVerticalAlign, BL
MOVZX EDX, DL
MOV [EAX].fVerticalAlign, DL
{$IFDEF COMMANDACTIONS_OBJ}
MOV ECX, [EAX].fCommandActions
MOV ECX, dword ptr [ECX].TCommandActionsObj.bVertAlignCenter
MOVZX ECX, byte ptr [ECX+EDX].TCommandActionsObj.bVertAlignTop
{$ELSE}
MOV ECX, dword ptr [EAX].fCommandActions.bVertAlignCenter
MOVZX ECX, byte ptr [EAX+EDX].fCommandActions.bVertAlignTop
{$ENDIF}
OR CH, CL
SHR ECX, 8
OR CL, CH
NOT ECX
SHL ECX, 8
MOV EDX, [EAX].fStyle
AND DH, CL
AND DH, $F3
OR EDX, ECX
{$IFDEF COMMANDACTIONS_OBJ}
MOV ECX, [EAX].fCommandActions
OR DH, [ECX+EBX].TCommandActionsObj.bVertAlignCenter
{$ELSE}
OR DH, [EAX+EBX].fCommandActions.bVertAlignCenter
{$ENDIF}
POP EBX
CALL SetStyle
end;
@ -13928,18 +13938,19 @@ asm
{$ELSE}
MOV [EAX].TControl.fWordWrap, 1
{$ENDIF}
AND byte ptr[EAX].TControl.fStyle.f0_Style, not SS_LEFTNOWORDWRAP
MOV EDX, [EAX].TControl.fStyle
{$IFDEF USE_FLAGS}
TEST [EAX].TControl.fFlagsG5, 1 shl G5_IsButton
{$ELSE}
CMP [EAX].TControl.fIsButton, 0
{$ENDIF}
JZ @@1
OR [EAX].TControl.fStyle.f1_Style, $20 // BS_MULTILINE >> 8
JNZ @@1
AND DL, not SS_LEFTNOWORDWRAP
@@1:
OR DH, $20 or SS_LEFTNOWORDWRAP // BS_MULTILINE >> 8
@@2:
PUSH EAX
MOV EDX, [EAX].TControl.fStyle
CALL TControl.SetStyle
POP EAX
end;
@ -14077,9 +14088,8 @@ asm
CALL TControl.FormGetIntParam
POP ECX
PUSH EAX
LEA ECX, [ECX].TControl.DF.FormCurrentParent
MOV EAX, [ECX]
MOV EDX, [ECX+4]
MOV EAX, [ECX].TControl.DF.FormCurrentParent
MOV EDX, [ECX].TControl.FormString
POP ECX
CALL NewLabelEffect
end;
@ -14292,7 +14302,7 @@ procedure FormSetBrushBitmap( Form: PControl );
asm
PUSH EDI
MOV EDI, EAX
CALL TControl.ParentForm
CALL TControl.FormParentForm
PUSH EAX
CALL ParentForm_PCharParam
@ -14523,7 +14533,7 @@ end;
procedure FormSetCaption( Form: PControl );
asm
PUSH EAX
CALL TControl.ParentForm
CALL TControl.FormParentForm
PUSH EAX
CALL TControl.FormGetStrParam
POP EAX
@ -14686,7 +14696,7 @@ asm
PUSH ECX
CALL ParentForm_StrParam
MOV EAX, EDI
CALL TControl.ParentForm
CALL TControl.FormParentForm
MOV EDX, [EAX].TControl.FormString
XOR ECX, ECX
MOV CL, taLeft
@ -14730,7 +14740,7 @@ end;
procedure FormSetDateTimeFormat( Form: PControl );
asm
PUSH EAX
CALL TControl.ParentForm
CALL TControl.FormParentForm
PUSH EAX
CALL TControl.FormGetStrParam
POP EAX
@ -14782,14 +14792,14 @@ end;
procedure FormLastCreatedChildAsNewCurrentParent( Form: PControl );
asm
PUSH EAX
CALL TControl.ParentForm
CALL TControl.FormParentForm
POP [EAX].TControl.DF.FormCurrentParent
end;
procedure FormSetTabpageAsParent( Form: PControl );
asm
PUSH EAX
CALL TControl.ParentForm
CALL TControl.FormParentForm
CALL ParentForm_IntParamAsm
POP ECX
PUSH EAX
@ -14797,11 +14807,12 @@ asm
CALL TControl.GetPages
POP EDX
MOV [EDX].TControl.DF.FormCurrentParent, EAX
MOV [EDX].TControl.DF.FormLastCreatedChild, EAX
end;
procedure FormSetCurCtl( Form: PControl );
asm
CALL TControl.ParentForm
CALL TControl.FormParentForm
CALL ParentForm_IntParamAsm
MOV ECX, [EAX].TControl.DF.FormAddress
MOV ECX, [ECX + EDX*4]
@ -14819,7 +14830,7 @@ asm
PUSH EDI
MOV EDI, EAX
PUSH ESI
CALL TControl.ParentForm
CALL TControl.FormParentForm
MOV ESI, EAX
PUSH [ESI].TControl.DF.FormObj
CALL ParentForm_IntParamAsm
@ -14837,7 +14848,7 @@ asm
PUSH EDI
MOV EDI, EAX
PUSH ESI
CALL TControl.ParentForm
CALL TControl.FormParentForm
MOV ESI, EAX
PUSH [ESI].TControl.DF.FormObj
CALL ParentForm_IntParamAsm

View File

@ -178,6 +178,8 @@ type
starting at index ToIdx. }
procedure InstallBits( FromIdx, N: Integer; Value: Boolean );
{* Sets new Value for all bits in range [ FromIdx, FromIdx+Count-1 ]. }
function CountTrueBits: Integer;
{* Returns count of bits equal to TRUE. }
end;
//[END OF TBits DEFINITION]
@ -1095,6 +1097,45 @@ begin
end;
//[destructor TBits.Destroy]
var Counts: array[ 0..255 ] of Integer;
function TBits.CountTrueBits: Integer;
var I, j, N: Integer;
D: DWORD;
begin
Result := 0;
if Counts[255] = 0 then
begin
for I := 0 to 255 do
begin
N := I;
j := 0;
while N <> 0 do
begin
if N and 1 <> 0 then
inc( j );
N := N shr 1;
end;
Counts[I] := j;
end;
end;
for I := 0 to PBitsList( fList ).fCount-1 do
begin
D := DWORD( PBitsList( fList ).fItems[ I ] );
if D = $FFFFFFFF then
inc( Result, 32 )
else
begin
inc( Result, Counts[ D and $FF ] );
D := D shr 8;
inc( Result, Counts[ D and $FF ] );
D := D shr 8;
inc( Result, Counts[ D and $FF ] );
D := D shr 8;
inc( Result, Counts[ D ] );
end;
end;
end;
destructor TBits.Destroy;
begin
fList.Free;
@ -1204,6 +1245,7 @@ begin
end
else
begin
Result := PBitsList( fList ).fCount * 32;
for I := 0 to PBitsList( fList ).fCount-1 do
begin
D := DWORD( PBitsList( fList ).fItems[ I ] );

View File

@ -753,11 +753,13 @@ type
FOptions: TKOLMemoOptions;
FLines: TStrings;
FEdTransparent: Boolean;
FUnicode: Boolean;
procedure SetOptions(const Value: TKOLMemoOptions);
function GetCaption: String;
procedure SetText(const Value: TStrings);
function GetText: TStrings;
procedure SetEdTransparent(const Value: Boolean);
procedure SetUnicode(const Value: Boolean);
protected
function TabStopByDefault: Boolean; override;
procedure FirstCreate; override;
@ -808,6 +810,7 @@ type
property EditTabChar;
property Brush;
property OverrideScrollbars;
property Unicode: Boolean read FUnicode write SetUnicode;
end;
@ -956,7 +959,8 @@ type
FItems: TStrings;
FCurIndex: Integer;
FCount: Integer;
fLBItemHeight: Integer; {+ecm}
fLBItemHeight: Integer;
FAlwaysAssignItems: Boolean; {+ecm}
procedure SetLBItemHeight(const Value: Integer); {+ecm}
procedure SetOptions(const Value: TKOLListboxOptions);
procedure SetItems(const Value: TStrings);
@ -964,6 +968,7 @@ type
function GetCaption: String;
procedure SetCount(Value: Integer);
procedure UpdateItems;
procedure SetAlwaysAssignItems(const Value: Boolean);
protected
function TabStopByDefault: Boolean; override;
procedure FirstCreate; override;
@ -1013,6 +1018,7 @@ type
property Brush;
property LBItemHeight: Integer read fLBItemHeight write SetLBItemHeight; {+ecm}
property OverrideScrollbars;
property AlwaysAssignItems: Boolean read FAlwaysAssignItems write SetAlwaysAssignItems;
end;
@ -1034,12 +1040,14 @@ type
FItems: TStrings;
FCurIndex: Integer;
FDroppedWidth: Integer;
fCBItemHeight: Integer; {+ecm}
fCBItemHeight: Integer;
FAlwaysAssignItems: Boolean; {+ecm}
procedure SetCBItemHeight(const Value: Integer); {+ecm}
procedure SetOptions(const Value: TKOLComboOptions);
procedure SetCurIndex(const Value: Integer);
procedure SetItems(const Value: TStrings);
procedure SetDroppedWidth(const Value: Integer);
procedure SetAlwaysAssignItems(const Value: Boolean);
protected
function TabStopByDefault: Boolean; override;
procedure FirstCreate; override;
@ -1049,6 +1057,7 @@ type
procedure P_SetupFirst( SL: TStringList; const AName, AParent, Prefix: String ); override;
function DefaultColor: TColor; override;
function DefaultInitialColor: TColor; override;
procedure SetAlign(const Value: TKOLAlign); override;
public
procedure Paint; override;
function WYSIWIGPaintImplemented: Boolean; override;
@ -1089,6 +1098,7 @@ type
property autoSize;
property Brush;
property CBItemHeight: Integer read fCBItemHeight write SetCBItemHeight; {+ecm}
property AlwaysAssignItems: Boolean read FAlwaysAssignItems write SetAlwaysAssignItems;
end;
@ -1149,6 +1159,9 @@ type
procedure Paint; override;
function WYSIWIGPaintImplemented: Boolean; override;
function NoDrawFrame: Boolean; override;
function SupportsFormCompact: Boolean; override;
procedure SetupConstruct_Compact; override;
procedure SetupLast( SL: TStringList; const AName, AParent, Prefix: String ); override;
public
function Pcode_Generate: Boolean; override;
constructor Create( AOwner: TComponent ); override;
@ -1454,6 +1467,7 @@ type
procedure SetupFirst( SL: TStringList; const AName, AParent, Prefix: String ); override;
procedure P_SetupFirst( SL: TStringList; const AName, AParent, Prefix: String ); override;
function DefaultColor: TColor; override;
procedure SetupLast( SL: TStringList; const AName, AParent, Prefix: String ); override;
public
procedure CreateKOLControl(Recreating: boolean); override;
function NoDrawFrame: Boolean; override;
@ -1533,6 +1547,7 @@ type
FradioGroup: Integer;
FimgIndex: Integer;
Faction: TKOLAction;
FCheckable: Boolean;
procedure Setcaption(const Value: String);
procedure Setdropdown(const Value: Boolean);
procedure Setenabled(const Value: Boolean);
@ -1546,6 +1561,7 @@ type
procedure SetradioGroup(const Value: Integer);
procedure SetimgIndex(const Value: Integer);
procedure Setaction(const Value: TKOLAction);
procedure SetCheckable(const Value: Boolean);
protected
procedure Change;
procedure SetName( const NewName: TComponentName ); override;
@ -1588,6 +1604,7 @@ type
property separator: Boolean read Fseparator write Setseparator;
property dropdown: Boolean read Fdropdown write Setdropdown;
property checked: Boolean read Fchecked write Setchecked;
property Checkable: Boolean read FCheckable write SetCheckable;
property radioGroup: Integer read FradioGroup write SetradioGroup;
property picture: TPicture read Fpicture write Setpicture;
property sysimg: TSystemToolbarImage read Fsysimg write Setsysimg;
@ -2707,12 +2724,16 @@ end;
procedure TKOLButton.SetupConstruct_Compact;
var KF: TKOLForm;
C: String;
begin
inherited;
KF := ParentKOLForm;
if KF = nil then Exit;
KF.FormAddAlphabet( 'FormNewButton', TRUE, TRUE );
KF.FormAddStrParameter( Caption );
C := Caption;
if not KF.AssignTextToControls then
C := '';
KF.FormAddStrParameter( C );
end;
procedure TKOLButton.SetupFirst(SL: TStringList; const AName, AParent,
@ -2834,17 +2855,18 @@ begin
DB 'TKOLButton.SetupParams', 0
@@e_signature:
end;
if action = nil then
C := StringConstant('Caption', Caption)
if (action = nil) and
(ParentKOLForm <> nil) and ParentKOLForm.AssignTextToControls then
C := StringConstant('Caption', Caption)
else
C := '''''';
C := '''''';
{$IFDEF _D2009orHigher}
if C <> '''''' then
begin
C2 := '';
for i := 2 to Length(C) - 1 do C2 := C2 + '#'+int2str(ord(C[i]));
C := C2;
end;
if C <> '''''' then
begin
C2 := '';
for i := 2 to Length(C) - 1 do C2 := C2 + '#'+int2str(ord(C[i]));
C := C2;
end;
{$ENDIF}
Result := AParent + ', ' + C;
end;
@ -2909,7 +2931,11 @@ begin
@@e_signature:
end;
if (Value = vaBottom) and Windowed and not( csLoading in ComponentState ) then
Result := vaCenter
begin
Result := vaCenter;
if not (csLoading in ComponentState) then
ShowMessage( 'Windowed Label can not be aligned bottom !' );
end
else
Result := Value;
end;
@ -3085,12 +3111,16 @@ end;
procedure TKOLLabel.SetupConstruct_Compact;
var KF: TKOLForm;
C: String;
begin
inherited;
KF := ParentKOLForm;
if KF = nil then Exit;
KF.FormAddAlphabet( 'FormNewLabel', TRUE, TRUE );
KF.FormAddStrParameter( Caption );
C := Caption;
if not KF.AssignTextToControls then
C := '';
KF.FormAddStrParameter( C );
end;
procedure TKOLLabel.SetupFirst(SL: TStringList; const AName, AParent,
@ -3129,14 +3159,17 @@ begin
DB 'TKOLLabel.SetupParams', 0
@@e_signature:
end;
C := StringConstant('Caption', Caption);
if (ParentKOLForm <> nil) and ParentKOLForm.AssignTextToControls then
C := StringConstant('Caption', Caption)
else
C := '''''';
{$IFDEF _D2009orHigher}
if C <> '''''' then
begin
C2 := '';
for i := 2 to Length(C) - 1 do C2 := C2 + '#'+int2str(ord(C[i]));
C := C2;
end;
if C <> '''''' then
begin
C2 := '';
for i := 2 to Length(C) - 1 do C2 := C2 + '#'+int2str(ord(C[i]));
C := C2;
end;
{$ENDIF}
Result := AParent + ', ' + C;
end;
@ -3513,7 +3546,7 @@ begin
if Parent is TKOLTabControl then
Exit; // this is not a panel, but a tab page on tab control.
KF := ParentKOLForm;
if Caption <> '' then
if (Caption <> '') and (KF <> nil) and KF.AssignTextToControls then
begin
if (KF <> nil) and KF.FormCompact then
begin
@ -3577,10 +3610,13 @@ begin
DB 'TKOLPanel.Set_VA', 0
@@e_signature:
end;
if Value = vaBottom then
inherited VerticalAlign := vaCenter
else
inherited VerticalAlign := Value;
if Value = vaBottom then
begin
if not (csLoading in ComponentState) then
ShowMessage( 'Panel text can not be aligned bottom !' );
inherited VerticalAlign := vaCenter
end else
inherited VerticalAlign := Value;
end;
function TKOLPanel.SupportsFormCompact: Boolean;
@ -4235,12 +4271,16 @@ end;
procedure TKOLBitBtn.SetupConstruct_Compact;
var KF: TKOLForm;
C: String;
begin
inherited;
KF := ParentKOLForm;
if KF = nil then Exit;
KF.FormAddAlphabet( 'FormNewBitBtn', TRUE, TRUE );
KF.FormAddStrParameter( Caption );
C := Caption;
if not KF.AssignTextToControls then
C := '';
KF.FormAddStrParameter( C );
KF.FormAddNumParameter( OptionsAsInteger );
KF.FormAddNumParameter( Integer( GlyphLayout ) );
if (GlyphBitmap <> nil) and
@ -4388,17 +4428,18 @@ begin
else
U := IntToStr( ImageIndex );
end;
if action = nil then
C := StringConstant('Caption', Caption)
if (action = nil) and
(ParentKOLForm <> nil) and ParentKOLForm.AssignTextToControls then
C := StringConstant('Caption', Caption)
else
C := '''''';
C := '''''';
{$IFDEF _D2009orHigher}
if C <> '''''' then
begin
C2 := '';
for i := 2 to Length(C) - 1 do C2 := C2 + '#'+int2str(ord(C[i]));
C := C2;
end;
begin
C2 := '';
for i := 2 to Length(C) - 1 do C2 := C2 + '#'+int2str(ord(C[i]));
C := C2;
end;
{$ENDIF}
Result := AParent + ', ' + C + ', ' +
BitBtnOptions( Options ) + ', ' +
@ -4997,12 +5038,16 @@ end;
procedure TKOLGroupBox.SetupConstruct_Compact;
var KF: TKOLForm;
C: String;
begin
inherited;
KF := ParentKOLForm;
if KF = nil then Exit;
KF.FormAddAlphabet( 'FormNewGroupBox', TRUE, TRUE );
KF.FormAddStrParameter( Caption );
C := Caption;
if not KF.AssignTextToControls then
C := '';
KF.FormAddStrParameter( C );
end;
procedure TKOLGroupBox.SetupFirst(SL: TStringList; const AName, AParent,
@ -5036,14 +5081,17 @@ begin
DB 'TKOLGroupBox.SetupParams', 0
@@e_signature:
end;
C := StringConstant('Caption', Caption);
if (ParentKOLForm <> nil) and ParentKOLForm.AssignTextToControls then
C := StringConstant('Caption', Caption)
else
C := '''''';
{$IFDEF _D2009orHigher}
if C <> '''''' then
begin
C2 := '';
for i := 2 to Length(C) - 1 do C2 := C2 + '#'+int2str(ord(C[i]));
C := C2;
end;
if C <> '''''' then
begin
C2 := '';
for i := 2 to Length(C) - 1 do C2 := C2 + '#'+int2str(ord(C[i]));
C := C2;
end;
{$ENDIF}
Result := AParent + ', ' + C;
end;
@ -5201,12 +5249,16 @@ end;
procedure TKOLCheckBox.SetupConstruct_Compact;
var KF: TKOLForm;
C: String;
begin
inherited;
KF := ParentKOLForm;
if KF = nil then Exit;
KF.FormAddAlphabet( 'FormNewCheckBox', TRUE, TRUE );
KF.FormAddStrParameter( Caption );
C := Caption;
if not KF.AssignTextToControls then
C := '';
KF.FormAddStrParameter( C );
end;
procedure TKOLCheckBox.SetupFirst(SL: TStringList; const AName, AParent,
@ -5244,17 +5296,17 @@ begin
DB 'TKOLCheckBox.SetupParams', 0
@@e_signature:
end;
if action = nil then
C := StringConstant('Caption', Caption)
if (action = nil) and (ParentKOLForm <> nil) and ParentKOLForm.AssignTextToControls then
C := StringConstant('Caption', Caption)
else
C := '''''';
C := '''''';
{$IFDEF _D2009orHigher}
if C <> '''''' then
begin
C2 := '';
for i := 2 to Length(C) - 1 do C2 := C2 + '#'+int2str(ord(C[i]));
C := C2;
end;
if C <> '''''' then
begin
C2 := '';
for i := 2 to Length(C) - 1 do C2 := C2 + '#'+int2str(ord(C[i]));
C := C2;
end;
{$ENDIF}
Result := AParent + ', ' + C;
end;
@ -5362,14 +5414,10 @@ begin
@@e_signature:
end;
nparams := 2;
{if action = nil then
C := StringConstant('Caption',Caption)
if (action = nil) and (ParentKOLForm <> nil) and ParentKOLForm.AssignTextToControls then
Result := P_StringConstant('Caption',Caption)
else
C := '''''';}
if action = nil then
Result := P_StringConstant('Caption',Caption)
else
Result := ' LoadAnsiStr #0 ';
Result := ' LoadAnsiStr #0 ';
//Result := AParent + ', ' + C;
{P} Result := Result +
//'LoadSELF AddWord_LoadRef ##T' + ParentKOLForm.FormName + '.' +
@ -5414,12 +5462,16 @@ end;
procedure TKOLRadioBox.SetupConstruct_Compact;
var KF: TKOLForm;
C: String;
begin
inherited;
KF := ParentKOLForm;
if KF = nil then Exit;
KF.FormAddAlphabet( 'FormNewRadioBox', TRUE, TRUE );
KF.FormAddStrParameter( Caption );
C := Caption;
if not KF.AssignTextToControls then
C := '';
KF.FormAddStrParameter( C );
end;
procedure TKOLRadioBox.SetupLast(SL: TStringList; const AName, AParent,
@ -5458,7 +5510,7 @@ begin
DB 'TKOLRadioBox.SetupParams', 0
@@e_signature:
end;
if action = nil then
if (action = nil) and (ParentKOLForm <> nil) and ParentKOLForm.AssignTextToControls then
C := StringConstant('Caption', Caption)
else
C := '''''';
@ -5767,7 +5819,7 @@ begin
end;
inherited;
KF := ParentKOLForm;
if Text <> '' then
if (Text <> '') and ((KF = nil) or KF.AssignTextToControls) then
if (KF <> nil) and KF.FormCompact then
begin
KF.FormAddCtlCommand( Name, 'FormSetCaption' );
@ -5819,6 +5871,10 @@ end;
procedure TKOLEditBox.SetupSetUnicode;
begin
///
if Unicode then
begin
SL.Add(' {$IFNDEF UNICODE_CTRLS}' + AName + '.SetUnicode( TRUE );{$ENDIF}' );
end;
end;
procedure TKOLEditBox.SetupTextAlign(SL: TStrings; const AName: String);
@ -5826,10 +5882,6 @@ begin
inherited;
if TextAlign <> taLeft then
GenerateTextAlign( SL, AName );
if Unicode then
begin
SL.Add(' {$IFNDEF UNICODE_CTRLS}' + AName + '.SetUnicode( TRUE );{$ENDIF}' );
end;
end;
function TKOLEditBox.SupportsFormCompact: Boolean;
@ -6108,6 +6160,13 @@ begin
RecreateWnd;
end;
procedure TKOLMemo.SetUnicode(const Value: Boolean);
begin
if Funicode = Value then Exit;
FUnicode := Value;
Change;
end;
function TKOLMemo.SetupColorFirst: Boolean;
begin
Result := FALSE;
@ -6159,13 +6218,15 @@ begin
end;
inherited;
KF := ParentKOLForm;
if FLines.Text <> '' then
if (FLines.Text <> '') and (Kf <> nil) and KF.AssignTextToControls then
begin
if (KF <> nil) and KF.FormCompact then
begin
KF.FormAddCtlCommand( Name, 'FormSetCaption' );
KF.FormAddStrParameter( FLines.Text );
end else
AddLongTextField( SL, Prefix + AName + '.Text := ', FLines.Text, ';', ' + ' );
end;
if Transparent then
if (KF <> nil) and KF.FormCompact then
@ -6215,6 +6276,9 @@ end;
procedure TKOLMemo.SetupSetUnicode(SL: TStringList; const AName: String);
begin
//
if Unicode then
SL.Add( ' {$IFNDEF UNICODE_CTRLS}' + AName +
'.SetUnicode( TRUE );{$ENDIF}' );
end;
procedure TKOLMemo.SetupTextAlign(SL: TStrings; const AName: String);
@ -6222,8 +6286,6 @@ begin
inherited;
if TextAlign <> taLeft then
GenerateTextAlign( SL, AName );
SL.Add(' {$IFNDEF UNICODE_CTRLS}' + AName +
'.SetUnicode( TRUE );{$ENDIF}' );
end;
function TKOLMemo.SupportsFormCompact: Boolean;
@ -6465,6 +6527,13 @@ begin
// òî÷íî ñîîòâåòñòâóþò KOL.TListOptions
end;
procedure TKOLListBox.SetAlwaysAssignItems(const Value: Boolean);
begin
if FAlwaysAssignItems = Value then Exit;
FAlwaysAssignItems := Value;
Change;
end;
procedure TKOLListBox.SetCount(Value: Integer);
begin
asm
@ -6546,6 +6615,8 @@ var
{$IFDEF _D2009orHigher}
C, C2: WideString;
j : integer;
{$ELSE}
C: String;
{$ENDIF}
I: Integer;
KF: TKOLForm;
@ -6558,26 +6629,36 @@ begin
end;
inherited;
KF := ParentKOLForm;
if FItems.Text <> '' then
if FItems.Text <> '' then
begin
if (KF <> nil) and KF.FormCompact then
begin
KF.FormAddCtlCommand( Name, 'FormSetListItems' );
KF.FormAddNumParameter( FItems.Count );
for I := 0 to FItems.Count-1 do
KF.FormAddStrParameter( FItems[I] );
if (KF <> nil) and KF.AssignTextToControls or AlwaysAssignItems then
KF.FormAddStrParameter( FItems[I] )
else
KF.FormAddStrParameter( '' );
end else
for I := 0 to FItems.Count - 1 do
begin
{$IFDEF _D2009orHigher}
C := StringConstant( 'Item' + IntToStr( I ), FItems[ I ] );
if (KF <> nil) and KF.AssignTextToControls then
C := StringConstant( 'Item' + IntToStr( I ), FItems[ I ] )
else
C := '''''';
C2 := '';
for j := 2 to Length(C)-1 do C2 := C2 + '#'+int2str(ord(C[j]));
C := C2;
SL.Add( Prefix + AName + '.Items[ ' + IntToStr( I ) + ' ] := ' + C + ';' );
{$ELSE}
if (KF <> nil) and KF.AssignTextToControls or AlwaysAssignItems then
C := StringConstant( 'Item' + IntToStr( I ), FItems[ I ] )
else
C := '''''';
SL.Add( Prefix + AName + '.Items[ ' + IntToStr( I ) + ' ] := ' +
StringConstant( 'Item' + IntToStr( I ), FItems[ I ] ) + ';' );
C + ';' );
{$ENDIF}
end;
end;
@ -6875,6 +6956,22 @@ begin
#13#10' C1';
end;
procedure TKOLComboBox.SetAlign(const Value: TKOLAlign);
begin
inherited;
if Value in [ caLeft, caRight, caClient ] then
if not (csLoading in ComponentState) then
ShowMessage( 'Aligning combobox to left, right or client ' +
'can get undesirable results at run time!' );
end;
procedure TKOLComboBox.SetAlwaysAssignItems(const Value: Boolean);
begin
if FAlwaysAssignItems = Value then Exit;
FAlwaysAssignItems := Value;
Change;
end;
procedure TKOLComboBox.SetCBItemHeight(const Value: Integer);
begin
if fCBItemHeight <> Value then
@ -6952,7 +7049,9 @@ procedure TKOLComboBox.SetupFirst(SL: TStringList; const AName, AParent,
var
{$IFDEF _D2009orHigher}
C, C2: WideString;
j : integer;
j : integer;
{$ELSE}
C: String;
{$ENDIF}
I: Integer;
KF: TKOLForm;
@ -6965,26 +7064,36 @@ begin
end;
inherited;
KF := ParentKOLForm;
if FItems.Text <> '' then
if FItems.Text <> '' then
begin
if (KF <> nil) and KF.FormCompact then
begin
KF.FormAddCtlCommand( Name, 'FormSetListItems' );
KF.FormAddNumParameter( FItems.Count );
for I := 0 to FItems.Count-1 do
KF.FormAddStrParameter( FItems[I] );
if (KF <> nil) and KF.AssignTextToControls or AlwaysAssignItems then
KF.FormAddStrParameter( FItems[I] )
else
KF.FormAddStrParameter( '' );
end else
for I := 0 to FItems.Count - 1 do
begin
{$IFDEF _D2009orHigher}
C := StringConstant( 'Item' + IntToStr( I ), FItems[ I ] );
if (KF <> nil) and KF.AssignTextToControls or AlwaysAssignItems then
C := StringConstant( 'Item' + IntToStr( I ), FItems[ I ] )
else
C := '''''';
C2 := '';
for j := 2 to Length(C)-1 do C2 := C2 + '#'+int2str(ord(C[j]));
C := C2;
SL.Add( Prefix + AName + '.Items[ ' + IntToStr( I ) + ' ] := ' + C + ';' );
{$ELSE}
if (KF <> nil) and KF.AssignTextToControls then
C := StringConstant( 'Item' + IntToStr( I ), FItems[ I ] )
else
C := '''''';
SL.Add( Prefix + AName + '.Items[ ' + IntToStr( I ) + ' ] := ' +
StringConstant( 'Item' + IntToStr( I ), FItems[ I ] ) + ';' );
C + ';' );
{$ENDIF}
end;
end;
@ -7167,35 +7276,15 @@ begin
DB 'TKOLGradientPanel.P_SetupParams', 0
@@e_signature:
end;
(*
nparams := 3;
Result := '';
//Result := AParent + ', ' + Color2Str( FColor1 ) + ', ' + Color2Str( FColor2 );
if TypeName <> 'GradientPanel' then
begin
//Result := Result + ', ' + GradientStyles[ gradientStyle ] + ', ' +
// GradientLayouts[ GradientLayout ];
{P}Result := ' L(' + IntToStr( Integer( GradientLayout ) ) + ')' +
' L(' + IntToStr( Integer( GradientStyle ) ) + ')';
nparams := 5;
end;
Result := Result + ' L(' + IntToStr( FColor2 ) + ')' +
' L($' + IntToHex( FColor1, 6 ) + ')' +
' LoadSELF AddWord_LoadRef ##T' + ParentKOLForm.FormName + '.' +
Remove_Result_dot( AParent );
*)
nparams := 3;
Result := '';
if EdgeStyle <> esLowered then
{P}Result := ' L( ' + IntToStr( Integer( EdgeStyle ) ) + ')';
//Result := AParent + ', ' + IntToStr( MinSizePrev ) + ', ' + IntToStr( MinSizeNext );
{P}Result := Result +
' L( ' + IntToStr( MinSizeNext ) + ')' +
#13#10' L( ' + IntToStr( MinSizePrev ) + ') ' +
#13#10' LoadSELF AddWord_LoadRef ##T' + ParentKOLForm.FormName + '.' +
Remove_Result_dot( AParent );
//if EdgeStyle <> esLowered then ^
// Result := Result + ', ' + Styles[ EdgeStyle ]; |
end;
procedure TKOLSplitter.SetEdgeStyle(const Value: TEdgeStyle);
@ -7708,6 +7797,8 @@ var I: Integer;
{$IFDEF _D2009orHigher}
C, C2: WideString;
j : integer;
{$ELSE}
C: String;
{$ENDIF}
begin
asm
@ -7783,7 +7874,10 @@ begin
W := -W;
begin
{$IFDEF _D2009orHigher}
C := StringConstant( 'Column' + IntToStr( I ) + 'Caption', Col.Caption );
if (KF <> nil) and KF.AssignTextToControls then
C := StringConstant( 'Column' + IntToStr( I ) + 'Caption', Col.Caption )
else
C := '''''';
if C <> '''''' then
begin
C2 := '';
@ -7795,9 +7889,13 @@ begin
C + ', ' +
TextAligns[ Col.TextAlign ] + ', ' + IntToStr( W ) + ');' );
{$ELSE}
if (KF <> nil) and KF.AssignTextToControls then
C := Col.Caption
else
C := '';
SL.Add( Prefix + AName + '.LVColAdd' + '( ' +
StringConstant( 'Column' + IntToStr( I ) + 'Caption',
Col.Caption ) + ', ' +
C ) + ', ' +
TextAligns[ Col.TextAlign ] + ', ' + IntToStr( W ) + ');' );
{$ENDIF}
if Col.LVColImage >= 0 then
@ -7843,6 +7941,18 @@ begin
KF.FormAddNumParameter( LVCount );
end else
SL.Add( Prefix + AName + '.LVCount := ' + IntToStr( LVCount ) + ';' );
if (KF <> nil) and KF.FormCompact then
begin
if ImageListNormal <> nil then
SL.Add( ' Result.' + Name + '.ImageListNormal := ' +
'Result.' + ImageListNormal.Name + ';' );
if ImageListSmall <> nil then
SL.Add( ' Result.' + Name + '.ImageListSmall := ' +
'Result.' + ImageListSmall.Name + ';' );
if ImageListState <> nil then
SL.Add( ' Result.' + Name + '.ImageListState := ' +
'Result.' + ImageListState.Name + ';' );
end;
end;
function TKOLListView.SetupParams( const AName, AParent: TDelphiString ): TDelphiString;
@ -8585,6 +8695,23 @@ begin
SL.Add( Prefix + AName + '.TVIndent := ' + IntToStr( TVIndent ) + ';' );
end;
procedure TKOLTreeView.SetupLast(SL: TStringList; const AName, AParent,
Prefix: String);
var KF: TKOLForm;
begin
inherited;
KF := ParentKOLForm;
if (KF <> nil) and KF.FormCompact then
begin
if ImageListNormal <> nil then
SL.Add( ' Result.' + Name + '.ImageListNormal := ' +
'Result.' + ImageListNormal.Name + ';' );
if ImageListState <> nil then
SL.Add( ' Result.' + Name + '.ImageListState := ' +
'Result.' + ImageListState.Name + ';' );
end;
end;
function TKOLTreeView.SetupParams( const AName, AParent: TDelphiString ): TDelphiString;
var O, ILNr, ILSt: String;
begin
@ -8970,7 +9097,6 @@ begin
@@e_signature:
end;
nparams := 2;
//Result := AParent + ', [ ' + S + ' ]';
EO := [ KOL.eoMultiline ];
if eo_NoHScroll in Options then EO := EO + [ KOL.eoNoHScroll ];
if eo_NoVScroll in Options then EO := EO + [ KOL.eoNoVScroll ];
@ -9275,13 +9401,15 @@ begin
else
SL.Add( Prefix + AName + '.MaxTextSize := ' + IntToStr( MaxTextSize ) + ';' );
if FLines.Text <> '' then
if (FLines.Text <> '') and (KF <> nil) and KF.AssignTextToControls then
begin
if (KF <> nil) and KF.FormCompact then
begin
KF.FormAddCtlCommand( Name, 'FormSetCaption' );
KF.FormAddStrParameter( FLines.Text );
end else
AddLongTextField( SL, Prefix + AName + '.Text := ', FLines.Text, ';', ' + ' );
end;
if RE_AutoKeybdSet then
if (KF <> nil) and KF.FormCompact then
@ -10722,6 +10850,7 @@ end;
procedure TKOLTabControl.SetupConstruct_Compact;
var KF: TKOLForm;
i: Integer;
C: String;
begin
inherited;
{$IFDEF _D4orHigher}
@ -10730,7 +10859,12 @@ begin
KF.FormAddAlphabet( 'FormNewTabControl', TRUE, TRUE );
KF.FormAddNumParameter( Count );
for i := 0 to Count-1 do
KF.FormAddStrParameter( Pages[i].Caption );
begin
C := Pages[i].Caption;
if not KF.AssignTextToControls then
C := '';
KF.FormAddStrParameter( C );
end;
KF.FormAddNumParameter( PByte( @ Options )^ );
KF.FormAddNumParameter( ImageList1stIdx );
{$ELSE}
@ -10793,6 +10927,7 @@ end;
function TKOLTabControl.SetupParams( const AName, AParent: TDelphiString ): TDelphiString;
var O, IL: String;
I: Integer;
KF: TKOLForm;
{$IFDEF _D2009orHigher}
C, C2, S: WideString;
j : integer;
@ -10807,18 +10942,22 @@ begin
@@e_signature:
end;
S := '';
KF := ParentKOLForm;
for I := 0 to Count - 1 do
begin
if S <> '' then
S := S + ', ';
C := StringConstant('Page' + IntToStr( I ) + 'Caption', Pages[ I ].Caption);
if (KF <> nil) and KF.AssignTextToControls then
C := StringConstant('Page' + IntToStr( I ) + 'Caption', Pages[ I ].Caption)
else
C := '''''';
{$IFDEF _D2009orHigher}
if C <> '''''' then
begin
begin
C2 := '';
for j := 2 to Length(C) - 1 do C2 := C2 + '#'+int2str(ord(C[j]));
C := C2;
end;
end;
{$ENDIF}
S := S + C;
@ -13737,7 +13876,7 @@ begin
s := '-'
else
begin
if noTextLabels then
if noTextLabels or not KF.AssignTextToControls then
B := ' '
else
B := Bt.Fcaption;
@ -13881,19 +14020,20 @@ begin
end
else
begin
if noTextLabels then
B := ' '
if noTextLabels or
(ParentKOLForm = nil) or not ParentKOLForm.AssignTextToControls then
B := ' '
else
begin
{$IFDEF _D2009orHigher}
C2 := '';
C := Bt.Fcaption;
for Z := 1 to Length(C) do C2 := C2 + '#'+int2str(ord(C[Z]));
B := C2;
{$ELSE}
B := Bt.Fcaption;
{$ENDIF}
end;
begin
{$IFDEF _D2009orHigher}
C2 := '';
C := Bt.Fcaption;
for Z := 1 to Length(C) do C2 := C2 + '#'+int2str(ord(C[Z]));
B := C2;
{$ELSE}
B := Bt.Fcaption;
{$ENDIF}
end;
S := '';
if Bt.radioGroup <> 0 then
begin
@ -14309,8 +14449,11 @@ begin
TMP:=TBitMap.Create;
TMP.Width:=ImageListNormal.ImgWidth;
TMP.Height:=ImageListNormal.ImgHeight;
TMP.Canvas.CopyRect(Rect(0,0,ImageListNormal.ImgWidth,ImageListNormal.ImgHeight),ImageListNormal.Bitmap.Canvas,Rect(ImageListNormal.ImgWidth*(CurIndex),0,ImageListNormal.ImgWidth*(CurIndex+1),ImageListNormal.ImgHeight));
TMP.Canvas.CopyRect( Rect(0,0,ImageListNormal.ImgWidth,ImageListNormal.ImgHeight),
ImageListNormal.Bitmap.Canvas,
Rect( ImageListNormal.ImgWidth*(CurIndex),0,
ImageListNormal.ImgWidth*(CurIndex+1),
ImageListNormal.ImgHeight));
{$IFNDEF _D2}
TMP.Transparent:=True;
TMP.TransparentColor:=ImageListNormal.TransparentColor;
@ -14457,8 +14600,23 @@ begin
DoAutoSize;
end;
procedure TKOLImageShow.SetupConstruct_Compact;
var KF: TKOLForm;
begin
inherited;
KF := ParentKOLForm;
if KF = nil then Exit;
KF.FormAddAlphabet( 'FormNewImageShow', TRUE, TRUE );
if CurIndex <> 0 then
begin
KF.FormAddCtlCommand( Name, 'FormSetCurIdx' );
KF.FormAddNumParameter( CurIndex );
end;
end;
procedure TKOLImageShow.SetupFirst(SL: TStringList; const AName, AParent,
Prefix: String);
var KF: TKOLForm;
begin
asm
jmp @@e_signature
@ -14467,8 +14625,23 @@ begin
@@e_signature:
end;
inherited;
KF := ParentKOLForm;
if (KF <> nil) and KF.FormCompact then Exit; {>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>}
if CurIndex <> 0 then
SL.Add( Prefix + AName + '.CurIndex := ' + IntToStr( CurIndex ) + ';' );
SL.Add( Prefix + AName + '.CurIndex := ' + IntToStr( CurIndex ) + '; {SetupFirst}' );
end;
procedure TKOLImageShow.SetupLast(SL: TStringList; const AName, AParent,
Prefix: String);
var KF: TKOLForm;
begin
inherited;
KF := ParentKOLForm;
if KF = nil then Exit;
if not KF.FormCompact then Exit;
if ImageListNormal <> nil then
SL.Add( ' Result.' + Name + '.ImageListNormal := ' +
'Result.' + ImageListNormal.Name + ';' );
end;
function TKOLImageShow.SetupParams( const AName, AParent: TDelphiString ): TDelphiString;
@ -14480,17 +14653,23 @@ begin
@@e_signature:
end;
Result := AParent + ', ';
if ImageListNormal <> nil then
if (ImageListNormal <> nil) and
(ParentKOLForm <> nil) and not ParentKOLForm.FormCompact then
begin
if ImageListNormal.ParentFORM.Name = ParentForm.Name then
Result := Result + 'Result.' + ImageListNormal.Name
else Result := Result + ImageListNormal.ParentFORM.Name +'.'+ ImageListNormal.Name;
if ImageListNormal.ParentKOLForm = ParentKOLForm then
Result := Result + 'Result.' + ImageListNormal.Name
else Result := Result + ImageListNormal.ParentFORM.Name +'.'+ ImageListNormal.Name;
end
else
Result := Result + 'nil';
Result := Result + ', ' + IntToStr( CurIndex );
end;
function TKOLImageShow.SupportsFormCompact: Boolean;
begin
Result := TRUE;
end;
function TKOLImageShow.WYSIWIGPaintImplemented: Boolean;
begin
Result := TRUE;
@ -14676,20 +14855,24 @@ end;
procedure TKOLLabelEffect.SetupConstruct_Compact;
var KF: TKOLForm;
C: String;
begin
////inherited;
KF := ParentKOLForm;
if KF = nil then Exit;
KF.FormAddCtlParameter( Name );
KF.FormCurrentCtlForTransparentCalls := Name;
KF.FormAddAlphabet( 'FormNewLabelEffect', TRUE, TRUE );
KF.FormAddStrParameter( Caption );
C := Caption;
if not KF.AssignTextToControls then
C := '';
KF.FormAddStrParameter( C );
KF.FormAddNumParameter( ShadowDeep );
end;
procedure TKOLLabelEffect.SetupFirst(SL: TStringList; const AName, AParent,
Prefix: String);
var KF: TKOLForm;
C: DWORD;
begin
asm
jmp @@e_signature
@ -14703,7 +14886,14 @@ begin
if (KF <> nil) and KF.FormCompact then
begin
KF.FormAddCtlCommand( Name, 'FormSetColor2' );
KF.FormAddNumParameter( (Color2 shl 1) or (Color2 shr 31) );
C := Color2;
if C and $FF000000 = $FF000000 then
C := C and $FFFFFF or $80000000;
C := (C shl 1) or (C shr 31);
RptDetailed( 'Prepare FormSetColor parameter, src color =$' +
Int2Hex( Color2, 2 ) + ', coded color =$' +
Int2Hex( C, 2 ), CYAN );
KF.FormAddNumParameter( C );
end else
SL.Add( Prefix + AName + '.Color2 := TColor(' + Color2Str( Color2 ) + ');' );
@ -14731,7 +14921,10 @@ begin
DB 'TKOLLabelEffect.SetupParams', 0
@@e_signature:
end;
C := StringConstant('Caption', Caption );
if (ParentKOLForm <> nil) and ParentKOLForm.AssignTextToControls then
C := StringConstant('Caption', Caption )
else
C := '''''';
{$IFDEF _D2009orHigher}
if C <> '''''' then
begin
@ -15664,6 +15857,11 @@ begin
Change;
end;
procedure TKOLToolbarButton.SetCheckable(const Value: Boolean);
begin
ShowMessage( 'Jus change property radioGroup!' )
end;
procedure TKOLToolbarButton.Setchecked(const Value: Boolean);
begin
asm

View File

@ -2371,7 +2371,10 @@ begin
S := Trim( Copy( S, 2, MaxInt ) );
end;
C := StringConstant( 'Title', Title );
if (ParentKOLForm <> nil) and ParentKOLForm.AssignTextToControls then
C := StringConstant( 'Title', Title )
else
C := '''''';
{$IFDEF _D2009orHigher}
C2 := '';
for i := 2 to Length(C) - 1 do C2 := C2 + '#'+IntToStr(ord(C[i]));
@ -2382,7 +2385,7 @@ begin
+ ', ' + StringConstant( 'InitialDir', InitialDir ) + ', [ ' + S + ' ] );' );
GenerateTag( SL, AName, Prefix );
if Filter <> '' then
if (Filter <> '') and (ParentKOLForm <> nil) and ParentKOLForm.AssignTextToControls then
SL.Add( Prefix + ' ' + AName + '.Filter := ' + StringConstant( 'Filter', Filter ) + ';' );
if not OpenDialog then
SL.Add( Prefix + ' ' + AName + '.OpenDialog := FALSE;' );
@ -2718,32 +2721,34 @@ begin
if S[ 1 ] = ',' then
S := Trim( Copy( S, 2, MaxInt ) );
end;
if AltDialog then
if AltDialog then
begin
SL.Add( Prefix + AName + ' := NewOpenDirDialogEx;' );
if Title <> '' then
begin
C := StringConstant( 'Title', Title );
{$IFDEF _D2009orHigher}
C2 := '';
for i := 2 to Length(C) - 1 do C2 := C2 + '#'+IntToStr(ord(C[i]));
C := C2;
{$ENDIF}
if C = '' then C := '''''';
SL.Add( Prefix + AName + '.Title := ' + C + ';' );
end;
end
else
begin
C := StringConstant( 'Title', Title );
{$IFDEF _D2009orHigher}
C2 := '';
for i := 2 to Length(C) - 1 do C2 := C2 + '#'+IntToStr(ord(C[i]));
C := C2;
{$ENDIF}
if C = '' then C := '''''';
SL.Add( Prefix + AName + ' := NewOpenDirDialog( ' + C + ', [ ' + S + ' ] );' );
end;
SL.Add( Prefix + AName + ' := NewOpenDirDialogEx;' );
if (Title <> '') and (ParentKOLForm <> nil) and ParentKOLForm.AssignTextToControls then
begin
C := StringConstant( 'Title', Title );
{$IFDEF _D2009orHigher}
C2 := '';
for i := 2 to Length(C) - 1 do C2 := C2 + '#'+IntToStr(ord(C[i]));
C := C2;
{$ENDIF}
if C = '' then C := '''''';
SL.Add( Prefix + AName + '.Title := ' + C + ';' );
end;
end else
begin
if (ParentKOLForm <> nil) and ParentKOLForm.AssignTextToControls then
C := StringConstant( 'Title', Title )
else
C := '''''';
{$IFDEF _D2009orHigher}
C2 := '';
for i := 2 to Length(C) - 1 do C2 := C2 + '#'+IntToStr(ord(C[i]));
C := C2;
{$ENDIF}
if C = '' then C := '''''';
SL.Add( Prefix + AName + ' := NewOpenDirDialog( ' + C + ', [ ' + S + ' ] );' );
end;
GenerateTag( SL, AName, Prefix );
if InitialPath <> '' then

View File

@ -19,7 +19,7 @@ mmmmm mmmmm mmmmm cccccccccccc kkkkk kkkkk
Key Objects Library (C) 1999 by Kladov Vladimir.
KOL Mirror Classes Kit (C) 2000 by Kladov Vladimir.
********************************************************
* VERSION 3.04
* VERSION 3.14
********************************************************
}
unit mirror;
@ -246,6 +246,7 @@ type
FReportDetailed: Boolean;
FGeneratePCode: Boolean;
FDefaultFont: TKOLFont;
FFormCompactDisabled: Boolean;
function GetProjectName: String;
procedure SetProjectDest(const Value: String);
@ -280,6 +281,7 @@ type
function getNewIf: Boolean;
procedure setNewIf(const Value: Boolean);
procedure SetDefaultFont(const Value: TKOLFont);
procedure SetFormCompactDisabled(const Value: Boolean);
protected
FLocked: Boolean;
FNewIF: Boolean;
@ -383,6 +385,7 @@ type
property GeneratePCode: Boolean read FGeneratePCode write SetGeneratePCode;
property NewIF: Boolean read getNewIf write setNewIf;
property DefaultFont: TKOLFont read FDefaultFont write SetDefaultFont;
property FormCompactDisabled: Boolean read FFormCompactDisabled write SetFormCompactDisabled;
end;
TKOLProjectBuilder = class( TComponentEditor )
@ -768,6 +771,9 @@ type
FGenerateCtlNames: Boolean;
FUnicode: Boolean;
FOverrideScrollbars: Boolean;
fAssignTextToControls: Boolean;
FAssignTabOrders: Boolean;
fFormCurrentParent: String;
function GetFormUnit: KOLString;
procedure SetFormMain(const Value: Boolean);
procedure SetFormUnit(const Value: KOLString);
@ -860,6 +866,10 @@ type
procedure SetUnicode(const Value: Boolean);
procedure SetOverrideScrollbars(const Value: Boolean);
procedure Set_Bounds(const Value: TFormBounds);
procedure SetAssignTextToControls(const Value: Boolean);
procedure SetAssignTabOrders(const Value: Boolean);
function GetFormCompact: Boolean;
procedure SetFormCurrentParent(const Value: String);
protected
fUniqueID: Integer;
FLocked: Boolean;
@ -1126,13 +1136,13 @@ type
FFormCtlParams: TStringList;
public
FormCurrentCtlForTransparentCalls: String;
FormCurrentParent: String;
FormCurrentParentCtl: TKOLCustomControl;
FormIndexFlush: Integer;
FormFlushedUntil: Integer;
FormFunArrayIdx: Integer;
FormControlsList: TStringList;
IsFormFlushing: Boolean;
property FormCurrentParent: String read fFormCurrentParent write SetFormCurrentParent;
function FormIndexOfControl( const CtlName: String ): Integer;
function EncodeFormNumParameter( I: Integer ): String;
function FormAddAlphabet( const funname: String; creates_ctrl, add_call: Boolean ): Integer;
@ -1145,10 +1155,13 @@ type
procedure DoFlushFormCompact( Sender: TObject );
procedure GenerateTransparentInits_Compact; virtual;
published
property FormCompact: Boolean read FFormCompact write SetFormCompact;
property FormCompact: Boolean read GetFormCompact write SetFormCompact;
property GenerateCtlNames: Boolean read FGenerateCtlNames write SetGenerateCtlNames;
property Unicode: Boolean read FUnicode write SetUnicode;
property OverrideScrollbars: Boolean read FOverrideScrollbars write SetOverrideScrollbars;
property AssignTextToControls: Boolean read fAssignTextToControls
write SetAssignTextToControls default TRUE;
property AssignTabOrders: Boolean read FAssignTabOrders write SetAssignTabOrders;
end;
@ -1521,7 +1534,7 @@ type
property SubItems[ Idx: Integer ]: TKOLMenuItem read GetSubItems;
procedure MoveUp;
procedure MoveDown;
procedure SetupTemplate( SL: TStringList; FirstItem: Boolean );
procedure SetupTemplate( SL: TStringList; FirstItem: Boolean; KF: TKOLForm );
function P_SetupTemplate( SL: TStringList; DoAdd: Boolean ): Integer;
procedure SetupAttributes( SL: TStringList; const MenuName: String );
procedure P_SetupAttributes( SL: TStringList; const MenuName: String );
@ -1938,7 +1951,7 @@ type
FAnchorRight: Boolean;
FAnchorBottom: Boolean;
FpopupMenu: TKOLPopupMenu;
procedure SetAlign(const Value: TKOLAlign);
procedure SetAlign(const Value: TKOLAlign); virtual;
procedure SetClsStyle(const Value: DWORD);
procedure SetExStyle(const Value: DWORD);
@ -2519,6 +2532,7 @@ type
procedure Generate_SetSize_Compact; virtual;
procedure GenerateVerticalAlign( SL: TStrings; const AName: String );
procedure GenerateTextAlign( SL: TStrings; const AName: String );
function DefaultBorder: Integer; virtual;
end;
TKOLControl = class( TKOLCustomControl )
@ -5397,6 +5411,8 @@ begin
S := S + '.MouseTransparent';
if LikeSpeedButton then
S := S + '.LikeSpeedButton';
if Border <> DefaultBorder then
S := S + '.SetBorder( ' + IntToStr( Border ) + ')';
Result := Trim( S );
LogOK;
@ -7853,6 +7869,7 @@ end;
procedure TKOLCustomControl.SetupColor(SL: TStrings; const AName: String);
var KF: TKOLForm;
C: DWORD;
begin
asm
jmp @@e_signature
@ -7874,7 +7891,14 @@ begin
if (KF <> nil) and KF.FormCompact then
begin
KF.FormAddCtlCommand( Name, 'FormSetColor' );
KF.FormAddNumParameter( (Color shl 1) or (Color shr 31) );
C := Color;
if C and $FF000000 = $FF000000 then
C := C and $FFFFFF or $80000000;
C := (C shl 1) or (C shr 31);
RptDetailed( 'Prepare FormSetColor parameter, src color =$' +
Int2Hex( Color, 2 ) + ', coded color =$' +
Int2Hex( C, 2 ), CYAN );
KF.FormAddNumParameter( C );
//SL.Add( '//Color = ' + IntToStr( Color ) );
end else
SL.Add( ' ' + AName + '.Color := TColor(' + Color2Str( Color ) + ');' );
@ -7996,7 +8020,10 @@ begin
KF.FormAddNumParameter( Border );
end;
end else
SL.Add( Prefix + AName + '.Border := ' + IntToStr( Border ) + ';' );
begin
//SL.Add( Prefix + AName + '.Border := ' + IntToStr( Border ) + ';' );
//--- moved to GenerateTransparentInits
end;
if MarginTop <> DefaultMarginTop then
if CompactCode then
@ -8137,7 +8164,7 @@ begin
SL.Add( Prefix + AName + '.IgnoreDefault := ' + BoolVals[ IgnoreDefault ] + ';' );
//Rpt( '-------- FHint = ' + FHint );
if (Trim( FHint ) <> '') and (Faction = nil) then
if (Trim( FHint ) <> '') and (Faction = nil) and KF.AssignTextToControls then
begin
if (ParentKOLForm <> nil) and ParentKOLForm.ShowHint then
begin
@ -8227,9 +8254,9 @@ begin
if fDefaultBtn then
if (KF <> nil) and KF.FormCompact then
begin
KF.FormAddCtlCommand( Name, 'TControl.SetDefaultBtn' );
KF.FormAddCtlCommand( Name, 'FormSetDefaultBtn' );
KF.FormAddNumParameter( 13 );
KF.FormAddNumParameter( 1 );
//KF.FormAddNumParameter( 1 );
// param = 1
end else
SL.Add( Prefix + AName + '.DefaultBtn := TRUE;' );
@ -8237,9 +8264,9 @@ begin
if fCancelBtn then
if (KF <> nil) and KF.FormCompact then
begin
KF.FormAddCtlCommand( Name, 'TControl.SetDefaultBtn' );
KF.FormAddCtlCommand( Name, 'FormSetDefaultBtn' );
KF.FormAddNumParameter( 27 );
KF.FormAddNumParameter( 1 );
//KF.FormAddNumParameter( 1 );
// param = 1
end else
SL.Add( Prefix + AName + '.CancelBtn := TRUE;' );
@ -8251,17 +8278,13 @@ begin
Integer( AnchorTop ) shl 1 +
Integer( AnchorRight ) shl 2 +
Integer( AnchorBottom ) shl 3;
if (i = 1) or (i = 2) or (i = 4) or (i = 8) then
KF.FormAddCtlCommand( Name, 'TControl.SetAnchor' );
CASE i OF
1: KF.FormAddNumParameter( ANCHOR_LEFT );
2: KF.FormAddNumParameter( ANCHOR_TOP );
4: KF.FormAddNumParameter( ANCHOR_RIGHT );
8: KF.FormAddNumParameter( ANCHOR_BOTTOM );
if i = 1 then
KF.FormAddCtlCommand( Name, 'TControl.SetAnchor' )
else
begin
KF.FormAddCtlCommand( Name, 'FormSetAnchor' );
KF.FormAddNumParameter( i );
END;
end;
end else
SL.Add( Prefix + AName + '.Anchor(' +
BoolVals[ AnchorLeft ] + ', ' +
@ -9716,7 +9739,7 @@ begin
{P}SL.Add( ' C1 AddWord_StoreB ##TControl_.FIgnoreDefault' );
end;
//Rpt( '-------- FHint = ' + FHint );
if (Trim( FHint ) <> '') and (Faction = nil) then
if (Trim( FHint ) <> '') and (Faction = nil) then
begin
if (ParentKOLForm <> nil) and ParentKOLForm.ShowHint then
begin
@ -10445,10 +10468,15 @@ begin
Rpt( 'TabOrder = ' + IntToStr( FTabOrder ) +
', Creation order = ' + IntToStr( Integer( fCreationOrder ) ),
YELLOW );
if TabOrder <> fCreationOrder then
if (TabOrder <> fCreationOrder) and ParentKOLForm.AssignTabOrders then
SL.Add( ' ' + AName + '.TabOrder := ' + IntToStr( TabOrder ) + ';' );
end;
function TKOLCustomControl.DefaultBorder: Integer;
begin
Result := 2;
end;
{ TKOLApplet }
procedure TKOLApplet.AssignEvents(SL: TStringList; const AName: String);
@ -11510,6 +11538,7 @@ begin
Log( '?13 TKOLForm.Create' );
if not (csLoading in ComponentState) then
FRealignTimer.Enabled := TRUE;
fAssignTextToControls := TRUE;
Log( '?14 TKOLForm.Create' );
LogOK;
finally
@ -12014,23 +12043,35 @@ begin
begin
if KC.Parent is TCustomForm then
begin
Rpt( 'searching parent form to set as FormCurrentParent', WHITE );
while FormCurrentParentCtl <> nil do
if (FormCurrentParentCtl <> nil) and
((FormCurrentParentCtl.Parent <> nil)
and not (FormCurrentParentCtl.Parent is TCustomForm))
or FormFlushedCompact then
begin
FormAddCtlCommand( '', 'FormSetUpperParent' );
if (FormCurrentParentCtl.Parent is TCustomForm) then
FormAddCtlCommand( '', 'FormSetCurCtl' );
FormAddNumParameter( 0 );
FormAddCtlCommand( '', 'FormLastCreatedChildAsNewCurrentParent' );
FormCurrentParentCtl := nil;
FormCurrentParent := '';
end else
begin
Rpt( 'searching parent form to set as FormCurrentParent', WHITE );
while FormCurrentParentCtl <> nil do
begin
FormCurrentParentCtl := nil;
FormCurrentParent := '';
end
else
begin
FormCurrentParentCtl := (FormCurrentParentCtl.Parent as TKOLControl);
FormCurrentParent := FormCurrentParentCtl.Name;
FormAddCtlCommand( '', 'FormSetUpperParent' );
if (FormCurrentParentCtl.Parent is TCustomForm) then
begin
FormCurrentParentCtl := nil;
FormCurrentParent := '';
end
else
begin
FormCurrentParentCtl := (FormCurrentParentCtl.Parent as TKOLControl);
FormCurrentParent := FormCurrentParentCtl.Name;
end;
end;
end;
end
else
end else
if (KC.Parent is TKOLTabPage) and (KC.Parent.Parent is TKOLTabControl) then
begin
if FormCurrentParent <> KC.Parent.Name then
@ -12055,12 +12096,19 @@ begin
FormCurrentParent := KC.Parent.Name;
FormCurrentParentCtl := KC.Parent as TKOLCustomControl;
end;
end
else
if KC.Parent <> FormCurrentParentCtl then
end else
if (KC.Parent <> FormCurrentParentCtl) or FormFlushedCompact then
begin
Rpt( 'searching parent control to set as FormCurrentParent', WHITE );
Rpt( KC.Parent.Name, WHITE );
if FormFlushedCompact then
begin
FormAddCtlCommand( '', 'FormSetCurCtl' );
FormAddNumParameter( FormIndexOfControl( KC.Parent.Name ) );
FormAddCtlCommand( '', 'FormLastCreatedChildAsNewCurrentParent' );
FormCurrentParentCtl := KC.Parent as TKOLCustomControl;
FormCurrentParent := KC.Parent.Name;
end else
while (KC.Parent <> FormCurrentParentCtl) and
(FormCurrentParentCtl <> nil) do
begin
@ -12748,6 +12796,10 @@ begin
// ãäå: alphabet - ìàññèâ óêàçàòåëåé íà èñïîëüçîâàííûå ôóíêöèè,
// commands&parameters - ñòðîêà ñ êîìàíäàìè è ïàðàìåòðàìè
// äëÿ èíòåðïðåòàöèè â âûçîâàõ FormExecuteCommands( ... )
if FFormAlphabet <> nil then
RptDetailed( 'FormCompact = ' + Int2Str( Integer( FormCompact ) ) +
' FormAlphabet.Count = ' + Int2Str( FFormAlphabet.Count ),
WHITE or LIGHT );
if FormCompact and (FFormAlphabet.Count > 0) then
begin
FA := TStringList.Create;
@ -15902,7 +15954,10 @@ begin
try
{$IFDEF _D2009orHigher}
C := StringConstant( 'Caption', Caption );
if AssignTextToControls then
C := StringConstant( 'Caption', Caption )
else
C := '''''';
if C <> '''''' then
begin
C2 := '';
@ -15910,7 +15965,10 @@ begin
C := C2;
end;
{$ELSE}
C := StringConstant( 'Caption', Caption );
if AssignTextToControls then
C := StringConstant( 'Caption', Caption )
else
C := '''''';
{$ENDIF}
if FormCompact then
begin
@ -18384,77 +18442,72 @@ begin
end;
function TKOLForm.EncodeFormNumParameter(I: Integer): String;
var //II: Integer;
b: Byte;
Buffer: array[ 0..4 ] of Byte;
k, j: Integer;
var b: Byte;
Buffer: array[ 0..7 ] of Byte;
k, j, II: Integer;
Sign: Boolean;
begin
//II := I;
k := 0;
if I = 0 then
begin
k := 1;
Buffer[0] := 0;
end
else
begin
Sign := FALSE;
if I < 0 then
II := I;
TRY
k := 0;
if I = 0 then
begin
I := -I;
Sign := TRUE;
end;
while I <> 0 do
k := 1;
Buffer[0] := 0;
end
else
begin
if k = 0 then
Sign := FALSE;
if I < 0 then
begin
b := I shl 2;
if Sign then
b := b or 2;
I := I shr 6;
end
else
begin
b := I shl 1;
I := I shr 7;
I := -I;
Sign := TRUE;
end;
while TRUE do
begin
if k = 0 then
begin
b := I shl 2;
if Sign then
b := b or 2;
I := I shr 6;
Buffer[k] := b;
inc( k );
if I = 0 then break;
end else
if I and not $7F = 0 then
begin
b := I shl 1;
//I := DWORD( I ) shr 7;
Buffer[k] := b;
inc( k );
break;
end else
begin
b := I shl 1;
I := DWORD( I ) shr 7;
Buffer[k] := b;
inc( k );
continue;
end;
end;
Buffer[k] := b;
inc( k );
end;
end;
Result := ''; // '+{' + Format( '%03d', [ II ] ) + '}';
for j := k-1 downto 0 do
begin
b := Buffer[j];
if j > 0 then
b := b or 1;
Result := Result + '#$' + Int2Hex( b, 2 );
end;
{
Result := '';
if I < 0 then
II := (Int64( -I ) shl 1) or 1
else
//if I > 0 then
II := Int64( I ) shl 1;
if II = 0 then
begin
Result := Result + '#$00';
end
else
while II <> 0 do
begin
b := II and $7F;
II := II shr 7;
if II <> 0 then
b := b or $80;
Result := Result + '#$' + Int2Hex( b, 2 );
end;
}
Result := '';
for j := k-1 downto 0 do
begin
b := Buffer[j];
if j > 0 then
b := b or 1;
Result := Result + '#$' + Int2Hex( b, 2 );
end;
EXCEPT on E: Exception do
begin
RptDetailed( 'exception ' + E.Message + #13#10 +
'(in EncodeFormNumParameter I = ' + IntToStr( II ) + ')',
RED );
end;
END;
end;
function TKOLForm.FormIndexOfControl(const CtlName: String): Integer;
@ -18498,6 +18551,34 @@ begin
FOverrideScrollbars := Value;
end;
procedure TKOLForm.SetAssignTextToControls(const Value: Boolean);
begin
if fAssignTextToControls = Value then Exit;
fAssignTextToControls := Value;
Change( Self );
end;
procedure TKOLForm.SetAssignTabOrders(const Value: Boolean);
begin
if FAssignTabOrders = Value then Exit;
FAssignTabOrders := Value;
Change( Self );
end;
function TKOLForm.GetFormCompact: Boolean;
begin
Result := FFormCompact;
if (KOLProject <> nil) and KOLProject.FormCompactDisabled then
Result := FALSE;
end;
procedure TKOLForm.SetFormCurrentParent(const Value: String);
begin
Rpt( 'FormCurrentParent set to ' + Value + ' (was: ' + fFormCurrentParent + ')',
CYAN );
fFormCurrentParent := Value;
end;
{ TKOLProject }
procedure TKOLProject.AfterGenerateDPR(const SL: TStringList; var Updated: Boolean);
@ -20358,6 +20439,7 @@ procedure TKOLProject.SetGeneratePCode(const Value: Boolean);
begin
FGeneratePCode := Value;
Change;
ChangeAllForms;
end;
procedure TKOLProject.SetHelpFile(const Value: String);
@ -20368,6 +20450,7 @@ begin
FHelpFile := Value;
Change;
ChangeAllForms;
LogOK;
FINALLY
@ -20622,6 +20705,7 @@ begin
TRY
FShowHint := Value;
Change;
ChangeAllForms;
LogOK;
FINALLY
Log( '<-TKOLProject.SetShowHint' );
@ -20641,6 +20725,7 @@ begin
TRY
FSupportAnsiMnemonics := Value;
Change;
ChangeAllForms;
LogOK;
FINALLY
Log( '<-TKOLProject.SetSupportAnsiMnemonics' );
@ -20828,6 +20913,15 @@ begin
if FDefaultFont.Equal2( Value ) then Exit;
FDefaultFont.Assign( Value );
Change;
ChangeAllForms;
end;
procedure TKOLProject.SetFormCompactDisabled(const Value: Boolean);
begin
if FFormCompactDisabled = Value then Exit;
FFormCompactDisabled := Value;
Change;
ChangeAllForms;
end;
{ TFormBounds }
@ -21619,6 +21713,7 @@ begin
if KF = nil then Exit;
if (Name <> '') and KF.GenerateCtlNames then
begin
RptDetailed( 'KF=' + KF.Name + ' ----- GenerateCtlNames = TRUE', WHITE or LIGHT );
if AParent <> 'nil' then
SL.Add(Format( '%s%s.SetName( Result.Form, ''%s'' ); ', [Prefix, AName, Name]))
else
@ -23029,11 +23124,15 @@ begin
@@e_signature:
end;
S := GenerateTransparentInits;
SL.Add( ' Result.Form := NewPanel( AParent, ' + EdgeStyles[ edgeStyle ] + ' )' +
'.MarkPanelAsForm' +
S + ';' );
SL.Add( ' Result.Form.DF.FormAddress := @ Result.Form;' );
if Caption <> '' then
SL.Add( ' Result.Form.Caption := ' + StringConstant( 'Caption', Caption ) + ';' );
if AssignTextToControls then
SL.Add( ' Result.Form.Caption := ' + StringConstant( 'Caption', Caption ) + ';' );
if FormCompact then
SL.Add( ' //--< place to call FormCreateParameters >--//' );
end;
function TKOLFrame.GenerateTransparentInits: String;
@ -23884,7 +23983,7 @@ begin
for I := 0 to FItems.Count - 1 do
begin
MI := FItems[ I ];
MI.SetupTemplate( SL, I = 0 );
MI.SetupTemplate( SL, I = 0, ParentKOLForm );
end;
S := ''''' ], ' + OnMenuItemMethodName( FALSE ) + ' );';
if FItems.Count <> 0 then
@ -24895,7 +24994,7 @@ begin
end;
end;
procedure TKOLMenuItem.SetupTemplate(SL: TStringList; FirstItem: Boolean);
procedure TKOLMenuItem.SetupTemplate(SL: TStringList; FirstItem: Boolean; KF: TKOLForm);
procedure Add2SL( const S: TDelphiString );
begin
if Length( SL[ SL.Count - 1 ] + S ) > 64 then
@ -24925,6 +25024,8 @@ begin
else
begin
U := Caption;
if (KF <> nil) and not KF.AssignTextToControls then
U := '';
{$IFDEF _D2009orHigher}
C2 := '';
for j := 1 to Length(U) do C2 := C2 + '#'+IntToStr(ord(U[j]));
@ -24953,7 +25054,8 @@ begin
S := '+' + S;
end;
if Accelerator.Key <> vkNotPresent then
if MenuComponent.showshortcuts and (Faction = nil) then
if MenuComponent.showshortcuts and (Faction = nil)
and (KF <> nil) and KF.AssignTextToControls then
{$IFDEF _D2009orHigher}
U := U + '''' + #9 + Accelerator.AsText + '''';
{$ELSE}
@ -25003,7 +25105,7 @@ begin
for I := 0 to Count - 1 do
begin
MI := FSubItems[ I ];
MI.SetupTemplate( SL, False );
MI.SetupTemplate( SL, False, KF );
end;
Add2SL( ', '')''' );
end;
@ -26884,6 +26986,7 @@ var RsrcName: String;
Updated: Boolean;
KF: TKOLForm;
i: Integer;
C: DWORD;
begin
if FOwner = nil then Exit;
if FOwner is TKOLForm then
@ -26896,7 +26999,14 @@ begin
if KF.FormCompact then
begin
KF.FormAddCtlCommand( 'Form', 'FormSetColor' );
KF.FormAddNumParameter( (KF.Color shl 1) or (KF.Color shr 31) );
C := KF.Color;
if C and $FF000000 = $FF000000 then
C := C and $FFFFFF or $80000000;
C := (C shl 1) or (C shr 31);
RptDetailed( 'Prepare FormSetColor parameter, src color =$' +
Int2Hex( KF.Color, 2 ) + ', coded color =$' +
Int2Hex( C, 2 ), CYAN );
KF.FormAddNumParameter( C );
end
else
SL.Add( ' ' + AName + '.Color := TColor(' + Color2Str( KF.Color ) + ');' );
@ -26944,7 +27054,14 @@ begin
begin
KF.FormAddCtlCommand( (FOwner as TKOLCustomControl).Name, 'FormSetColor' );
i := (FOwner as TKOLCustomControl).Color;
KF.FormAddNumParameter( (i shl 1) or (i shr 31) );
C := i;
if C and $FF000000 = $FF000000 then
C := C and $FFFFFF or $80000000;
C := (C shl 1) or (C shr 31);
RptDetailed( 'Prepare FormSetColor parameter, src color =$' +
Int2Hex( i, 2 ) + ', coded color =$' +
Int2Hex( C, 2 ), CYAN );
KF.FormAddNumParameter( C );
end
else
SL.Add( ' ' + AName + '.Color := TColor(' + Color2Str( (FOwner as TKOLCustomControl).Color ) + ');' );