3.05
git-svn-id: https://svn.code.sf.net/p/kolmck/code@102 91bb2d04-0c0c-4d2d-88a5-bbb6f4c1fa07
This commit is contained in:
50
KOL.pas
50
KOL.pas
@@ -14,7 +14,7 @@
|
|||||||
Key Objects Library (C) 2000 by Kladov Vladimir.
|
Key Objects Library (C) 2000 by Kladov Vladimir.
|
||||||
|
|
||||||
****************************************************************
|
****************************************************************
|
||||||
* VERSION 3.04+5
|
* VERSION 3.05
|
||||||
****************************************************************
|
****************************************************************
|
||||||
|
|
||||||
K.O.L. - is a set of objects to create small programs
|
K.O.L. - is a set of objects to create small programs
|
||||||
@@ -7323,7 +7323,6 @@ type
|
|||||||
{* |<#listbox>
|
{* |<#listbox>
|
||||||
|<#combo>
|
|<#combo>
|
||||||
|<#listview>
|
|<#listview>
|
||||||
|<#treeview>
|
|
||||||
Only listed controls. }
|
Only listed controls. }
|
||||||
procedure Clear;
|
procedure Clear;
|
||||||
{* Clears object content. Has different sense for different controls.
|
{* Clears object content. Has different sense for different controls.
|
||||||
@@ -11485,7 +11484,7 @@ function AnsiCompareStr(const S1, S2: KOLString): Integer;
|
|||||||
function _AnsiCompareStr(S1, S2: PKOLChar): Integer;
|
function _AnsiCompareStr(S1, S2: PKOLChar): Integer;
|
||||||
{* The same, but for PChar ANSI strings }
|
{* The same, but for PChar ANSI strings }
|
||||||
function AnsiCompareStrNoCase(const S1, S2: KOLString): Integer;
|
function AnsiCompareStrNoCase(const S1, S2: KOLString): Integer;
|
||||||
{* AnsiCompareStr compares S1 to S2, with case-sensitivity. The compare
|
{* AnsiCompareStrNoCase compares S1 to S2, without case-sensitivity. The compare
|
||||||
operation is controlled by the current Windows locale. The return value
|
operation is controlled by the current Windows locale. The return value
|
||||||
is the same as for CompareStr. }
|
is the same as for CompareStr. }
|
||||||
function _AnsiCompareStrNoCase(S1, S2: PKOLChar): Integer;
|
function _AnsiCompareStrNoCase(S1, S2: PKOLChar): Integer;
|
||||||
@@ -22134,8 +22133,8 @@ end;
|
|||||||
function CompareAnsiRecNoCase( R: PSortAnsiRec; const e1, e2: Integer ): Integer;
|
function CompareAnsiRecNoCase( R: PSortAnsiRec; const e1, e2: Integer ): Integer;
|
||||||
begin
|
begin
|
||||||
Result := _AnsiCompareStrNoCaseA_Slow(
|
Result := _AnsiCompareStrNoCaseA_Slow(
|
||||||
R.A[AnsiChar(e1)],
|
R.A[AnsiChar(e1)] + 1,
|
||||||
R.A[AnsiChar(e2)]
|
R.A[AnsiChar(e2)] + 1
|
||||||
);
|
);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@@ -22207,14 +22206,16 @@ end;
|
|||||||
function _AnsiCompareStrNoCaseA_Fast(S1, S2: PAnsiChar): Integer;
|
function _AnsiCompareStrNoCaseA_Fast(S1, S2: PAnsiChar): Integer;
|
||||||
var c: AnsiChar;
|
var c: AnsiChar;
|
||||||
R: TSortAnsiRec;
|
R: TSortAnsiRec;
|
||||||
Buf: array[ 0..511 ] of AnsiChar;
|
Buf: array[ 0..767 ] of AnsiChar;
|
||||||
P: PAnsiChar;
|
P: PAnsiChar;
|
||||||
begin
|
begin
|
||||||
P := @Buf[0];
|
P := @Buf[0];
|
||||||
for c := Low(c) to High(c) do
|
for c := Low(c) to High(c) do
|
||||||
begin
|
begin
|
||||||
P^ := c;
|
|
||||||
R.A[c] := P;
|
R.A[c] := P;
|
||||||
|
P^ := c;
|
||||||
|
inc( P );
|
||||||
|
P^ := AnsiLowerCase( c )[1];
|
||||||
inc( P );
|
inc( P );
|
||||||
P^ := #0;
|
P^ := #0;
|
||||||
inc( P );
|
inc( P );
|
||||||
@@ -25519,6 +25520,8 @@ begin
|
|||||||
inc( S1 );
|
inc( S1 );
|
||||||
inc( S2 );
|
inc( S2 );
|
||||||
end;
|
end;
|
||||||
|
if Result = 0 then
|
||||||
|
Result := _AnsiCompareStr( Item1.cFileName, Item2.cFileName );
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
@@ -25532,6 +25535,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
{$ELSE not UNICODE_CTRLS}
|
{$ELSE not UNICODE_CTRLS}
|
||||||
Result := _AnsiCompareStrNoCaseA( S1, S2 );
|
Result := _AnsiCompareStrNoCaseA( S1, S2 );
|
||||||
|
if Result = 0 then
|
||||||
|
Result := _AnsiCompareStr( S1, S2 );
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@@ -61791,37 +61796,6 @@ begin
|
|||||||
begin
|
begin
|
||||||
FindBtn( VK_RETURN, @DFLT_BTN, TRUE );
|
FindBtn( VK_RETURN, @DFLT_BTN, TRUE );
|
||||||
FindBtn( VK_ESCAPE, @CNCL_BTN, FALSE );
|
FindBtn( VK_ESCAPE, @CNCL_BTN, FALSE );
|
||||||
(*
|
|
||||||
dfltBtn := Pointer( F.PropInt[ @DFLT_BTN ] ); // .DF.fDefaultBtnCtl;
|
|
||||||
cnclBtn := Pointer( F.PropInt[ @CNCL_BTN ] ); //.DF.fCancelBtnCtl;
|
|
||||||
if (Msg.wParam = VK_RETURN) and
|
|
||||||
(dfltBtn <> nil) and
|
|
||||||
dfltBtn.ToBeVisible and
|
|
||||||
dfltBtn.Enabled and
|
|
||||||
( (F.DF.fCurrentControl=nil) or
|
|
||||||
({$IFDEF USE_FLAGS} not(G6_CancelBtn in F.DF.fCurrentControl.fFlagsG6)
|
|
||||||
{$ELSE} not F.DF.fCurrentControl.fCancelBtn {$ENDIF} and
|
|
||||||
{$IFDEF USE_FLAGS} not(G5_IgnoreDefault in F.DF.fCurrentControl.fFlagsG5)
|
|
||||||
{$ELSE} not F.DF.fCurrentControl.fIgnoreDefault {$ENDIF})
|
|
||||||
or (F.DF.fCurrentControl = dfltBtn)
|
|
||||||
) then
|
|
||||||
Btn := dfltBtn
|
|
||||||
else
|
|
||||||
if (Msg.wParam = VK_ESCAPE) and
|
|
||||||
(cnclBtn <> nil) and
|
|
||||||
cnclBtn.ToBeVisible and
|
|
||||||
cnclBtn.Enabled then
|
|
||||||
Btn := cnclBtn
|
|
||||||
else
|
|
||||||
if (Msg.wParam = VK_RETURN) and
|
|
||||||
(F.DF.fAllBtnReturnClick or DF.fAllBtnReturnClick)
|
|
||||||
and (F.ActiveControl <> nil) and
|
|
||||||
(F.ActiveControl.ToBeVisible) and
|
|
||||||
{$IFDEF USE_FLAGS} (G5_IsButton in F.ActiveControl.fFlagsG5)
|
|
||||||
{$ELSE} (F.ActiveControl.IsButton) {$ENDIF}
|
|
||||||
and (F.ActiveControl.Count = 0) then
|
|
||||||
Btn := F.ActiveControl;
|
|
||||||
*)
|
|
||||||
if Btn <> nil then
|
if Btn <> nil then
|
||||||
begin
|
begin
|
||||||
if Msg.message = WM_KEYDOWN then
|
if Msg.message = WM_KEYDOWN then
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// KOL_ASM.inc ()to be inlude in KOL.pas)
|
// KOL_ASM.inc ()to be inlude in KOL.pas)
|
||||||
// v 3.04+
|
// v 3.05
|
||||||
|
|
||||||
function MsgBox( const S: KOLString; Flags: DWORD ): DWORD;
|
function MsgBox( const S: KOLString; Flags: DWORD ): DWORD;
|
||||||
asm
|
asm
|
||||||
|
50
KOLadd.pas
50
KOLadd.pas
@@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
//[VERSION]
|
//[VERSION]
|
||||||
****************************************************************
|
****************************************************************
|
||||||
* VERSION 3.04+
|
* VERSION 3.05
|
||||||
****************************************************************
|
****************************************************************
|
||||||
//[END OF VERSION]
|
//[END OF VERSION]
|
||||||
|
|
||||||
@@ -1274,8 +1274,20 @@ end;
|
|||||||
{$IFDEF ASM_VERSION}
|
{$IFDEF ASM_VERSION}
|
||||||
procedure TBits.SetBit(Idx: Integer; const Value: Boolean);
|
procedure TBits.SetBit(Idx: Integer; const Value: Boolean);
|
||||||
asm
|
asm
|
||||||
|
PUSH EBX
|
||||||
|
XCHG EBX, EAX
|
||||||
|
CMP EDX, [EBX].fCount
|
||||||
|
JL @@2
|
||||||
|
|
||||||
|
LEA EAX, [EDX+32]
|
||||||
|
SHR EAX, 5
|
||||||
|
|
||||||
PUSH ECX
|
PUSH ECX
|
||||||
MOV ECX, [EAX].fList
|
MOV ECX, [EBX].fList
|
||||||
|
CMP [ECX].TBitsList.fCount, EAX
|
||||||
|
JGE @@1
|
||||||
|
|
||||||
|
MOV [ECX].TBitsList.fCount, EAX
|
||||||
MOV ECX, [ECX].TBitsList.fCapacity
|
MOV ECX, [ECX].TBitsList.fCapacity
|
||||||
SHL ECX, 5
|
SHL ECX, 5
|
||||||
CMP EDX, ECX
|
CMP EDX, ECX
|
||||||
@@ -1289,14 +1301,9 @@ asm
|
|||||||
POP EDX
|
POP EDX
|
||||||
|
|
||||||
@@1:
|
@@1:
|
||||||
CMP EDX, [EAX].FCount
|
|
||||||
JL @@2
|
|
||||||
INC EDX
|
|
||||||
MOV [EAX].fCount, EDX
|
|
||||||
DEC EDX
|
|
||||||
@@2:
|
|
||||||
POP ECX
|
POP ECX
|
||||||
MOV EAX, [EAX].fList
|
@@2:
|
||||||
|
MOV EAX, [EBX].fList
|
||||||
MOV EAX, [EAX].TBitsList.fItems
|
MOV EAX, [EAX].TBitsList.fItems
|
||||||
SHR ECX, 1
|
SHR ECX, 1
|
||||||
JC @@2set
|
JC @@2set
|
||||||
@@ -1305,26 +1312,29 @@ asm
|
|||||||
@@2set:
|
@@2set:
|
||||||
BTS [EAX], EDX
|
BTS [EAX], EDX
|
||||||
@@exit:
|
@@exit:
|
||||||
|
POP EBX
|
||||||
end;
|
end;
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
procedure TBits.SetBit(Idx: Integer; const Value: Boolean);
|
procedure TBits.SetBit(Idx: Integer; const Value: Boolean);
|
||||||
var Msk: DWORD;
|
var Msk: DWORD;
|
||||||
MinListCount: Integer;
|
MinListCount: Integer;
|
||||||
begin
|
begin
|
||||||
if Idx >= Capacity then
|
|
||||||
Capacity := Idx + 1;
|
|
||||||
Msk := 1 shl (Idx and $1F);
|
|
||||||
if Value then
|
|
||||||
PBitsList( fList ).fItems[ Idx shr 5 ] := Pointer(
|
|
||||||
DWORD(PBitsList( fList ).Items[ Idx shr 5 ]) or Msk)
|
|
||||||
else
|
|
||||||
PBitsList( fList ).fItems[ Idx shr 5 ] := Pointer(
|
|
||||||
DWORD(PBitsList( fList ).Items[ Idx shr 5 ]) and not Msk);
|
|
||||||
if Idx >= fCount then
|
|
||||||
fCount := Idx + 1;
|
|
||||||
MinListCount := (Idx + 31) shr 5 + 1;
|
MinListCount := (Idx + 31) shr 5 + 1;
|
||||||
if PBitsList( fList ).fCount < MinListCount then
|
if PBitsList( fList ).fCount < MinListCount then
|
||||||
|
begin
|
||||||
PBitsList( fList ).fCount := MinListCount;
|
PBitsList( fList ).fCount := MinListCount;
|
||||||
|
if Idx >= Capacity then
|
||||||
|
Capacity := Idx + 1;
|
||||||
|
end;
|
||||||
|
Msk := 1 shl (Idx and $1F);
|
||||||
|
if Value then
|
||||||
|
PBitsList( fList ).fItems[ Idx shr 5 ] := Pointer(
|
||||||
|
DWORD(PBitsList( fList ).Items[ Idx shr 5 ]) or Msk)
|
||||||
|
else
|
||||||
|
PBitsList( fList ).fItems[ Idx shr 5 ] := Pointer(
|
||||||
|
DWORD(PBitsList( fList ).Items[ Idx shr 5 ]) and not Msk);
|
||||||
|
if Idx >= fCount then
|
||||||
|
fCount := Idx + 1;
|
||||||
end;
|
end;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user