* update
git-svn-id: https://svn.code.sf.net/p/kolmck/code@167 91bb2d04-0c0c-4d2d-88a5-bbb6f4c1fa07
This commit is contained in:
@ -530,11 +530,7 @@ begin
|
|||||||
if (Msg.message = WM_HSCROLL) or (Msg.message = WM_VSCROLL) then
|
if (Msg.message = WM_HSCROLL) or (Msg.message = WM_VSCROLL) then
|
||||||
if (Msg.lParam <> 0) then
|
if (Msg.lParam <> 0) then
|
||||||
begin
|
begin
|
||||||
{$IFDEF USE_PROP}
|
|
||||||
Trackbar := Pointer( GetProp( Msg.lParam, ID_SELF ) );
|
|
||||||
{$ELSE}
|
|
||||||
Trackbar := Pointer( GetWindowLongPtr( Msg.lParam, GWLP_USERDATA ) );
|
Trackbar := Pointer( GetWindowLongPtr( Msg.lParam, GWLP_USERDATA ) );
|
||||||
{$ENDIF}
|
|
||||||
if Trackbar <> nil then
|
if Trackbar <> nil then
|
||||||
begin
|
begin
|
||||||
D := Trackbar.CustomData;
|
D := Trackbar.CustomData;
|
||||||
|
@ -815,7 +815,7 @@ begin
|
|||||||
if Result.ComClass = ComClass then Exit;
|
if Result.ComClass = ComClass then Exit;
|
||||||
Result := Result.FNext;
|
Result := Result.FNext;
|
||||||
end;
|
end;
|
||||||
raise EOleError.CreateResFmt(e_Ole, Integer( @SObjectFactoryMissing ), [ComClass.ClassName]);
|
raise EOleError.CreateFmt(e_Ole, SObjectFactoryMissing, [ComClass.ClassName]);
|
||||||
finally
|
finally
|
||||||
FLock.EndRead;
|
FLock.EndRead;
|
||||||
end;
|
end;
|
||||||
@ -1246,7 +1246,7 @@ var
|
|||||||
ClassName, Description: WideString;
|
ClassName, Description: WideString;
|
||||||
begin
|
begin
|
||||||
if ComServer.TypeLib.GetTypeInfoOfGUID(ClassID, FClassInfo) <> S_OK then
|
if ComServer.TypeLib.GetTypeInfoOfGUID(ClassID, FClassInfo) <> S_OK then
|
||||||
raise EOleError.CreateResFmt(e_Ole, Integer(@STypeInfoMissing), [TypedComClass.ClassName]);
|
raise EOleError.CreateFmt(e_Ole, STypeInfoMissing, [TypedComClass.ClassName]);
|
||||||
OleCheck(FClassInfo.GetDocumentation(MEMBERID_NIL, @ClassName,
|
OleCheck(FClassInfo.GetDocumentation(MEMBERID_NIL, @ClassName,
|
||||||
@Description, nil, nil));
|
@Description, nil, nil));
|
||||||
inherited Create(ComServer, TypedComClass, ClassID,
|
inherited Create(ComServer, TypedComClass, ClassID,
|
||||||
@ -1382,13 +1382,12 @@ begin
|
|||||||
inherited Create(ComServer, AutoClass, ClassID, Instancing, ThreadingModel);
|
inherited Create(ComServer, AutoClass, ClassID, Instancing, ThreadingModel);
|
||||||
FDispTypeInfo := GetInterfaceTypeInfo(IMPLTYPEFLAG_FDEFAULT);
|
FDispTypeInfo := GetInterfaceTypeInfo(IMPLTYPEFLAG_FDEFAULT);
|
||||||
if FDispTypeInfo = nil then
|
if FDispTypeInfo = nil then
|
||||||
raise EOleError.CreateResFmt(e_Ole, Integer(@SBadTypeInfo), [AutoClass.ClassName]);
|
raise EOleError.CreateFmt(e_Ole, SBadTypeInfo, [AutoClass.ClassName]);
|
||||||
OleCheck(FDispTypeInfo.GetTypeAttr(TypeAttr));
|
OleCheck(FDispTypeInfo.GetTypeAttr(TypeAttr));
|
||||||
FDispIntfEntry := GetIntfEntry(TypeAttr^.guid);
|
FDispIntfEntry := GetIntfEntry(TypeAttr^.guid);
|
||||||
FDispTypeInfo.ReleaseTypeAttr(TypeAttr);
|
FDispTypeInfo.ReleaseTypeAttr(TypeAttr);
|
||||||
if FDispIntfEntry = nil then
|
if FDispIntfEntry = nil then
|
||||||
raise EOleError.CreateResFmt(e_Ole, Integer(@SDispIntfMissing),
|
raise EOleError.CreateFmt(e_Ole, SDispIntfMissing, [AutoClass.ClassName]);
|
||||||
[AutoClass.ClassName]);
|
|
||||||
FErrorIID := FDispIntfEntry^.IID;
|
FErrorIID := FDispIntfEntry^.IID;
|
||||||
FEventTypeInfo := GetInterfaceTypeInfo(IMPLTYPEFLAG_FDEFAULT or
|
FEventTypeInfo := GetInterfaceTypeInfo(IMPLTYPEFLAG_FDEFAULT or
|
||||||
IMPLTYPEFLAG_FSOURCE);
|
IMPLTYPEFLAG_FSOURCE);
|
||||||
@ -1588,8 +1587,7 @@ begin
|
|||||||
PKOLChar(Value), Length(Value) + 1);
|
PKOLChar(Value), Length(Value) + 1);
|
||||||
RegCloseKey(Handle);
|
RegCloseKey(Handle);
|
||||||
end;
|
end;
|
||||||
if Status <> 0 then raise EOleRegistrationError.CreateResFmt(e_Registry,
|
if Status <> 0 then raise EOleRegistrationError.CreateFmt(e_Registry, SCreateRegKeyError, [nil]);
|
||||||
Integer(@SCreateRegKeyError), [ nil ] );
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ Delete registry key }
|
{ Delete registry key }
|
||||||
@ -1638,7 +1636,7 @@ var
|
|||||||
LocalMachine: array [0..MAX_COMPUTERNAME_LENGTH] of KOLchar;
|
LocalMachine: array [0..MAX_COMPUTERNAME_LENGTH] of KOLchar;
|
||||||
begin
|
begin
|
||||||
if @CoCreateInstanceEx = nil then
|
if @CoCreateInstanceEx = nil then
|
||||||
raise Exception.CreateResFmt(e_Com, Integer(@SDCOMNotInstalled), [nil]);
|
raise Exception.CreateFmt(e_Com, SDCOMNotInstalled, [nil]);
|
||||||
FillChar(ServerInfo, sizeof(ServerInfo), 0);
|
FillChar(ServerInfo, sizeof(ServerInfo), 0);
|
||||||
ServerInfo.pwszName := PWideChar(MachineName);
|
ServerInfo.pwszName := PWideChar(MachineName);
|
||||||
IID_IUnknown := IUnknown;
|
IID_IUnknown := IUnknown;
|
||||||
@ -1935,7 +1933,7 @@ procedure GetIDsOfNames(const Dispatch: IDispatch; Names: PChar;
|
|||||||
|
|
||||||
procedure RaiseNameException;
|
procedure RaiseNameException;
|
||||||
begin
|
begin
|
||||||
raise EOleError.CreateResFmt(e_Com, Integer( @SNoMethod ), [Names]);
|
raise EOleError.CreateFmt(e_Com, SNoMethod, [Names]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
type
|
type
|
||||||
@ -1993,7 +1991,7 @@ procedure VarDispInvoke(Result: PVariant; const Instance: Variant;
|
|||||||
|
|
||||||
procedure RaiseException;
|
procedure RaiseException;
|
||||||
begin
|
begin
|
||||||
raise EOleError.CreateResFmt(e_Com, Integer( @SVarNotObject ), [ nil ] );
|
raise EOleError.CreateFmt(e_Com, SVarNotObject, [ nil ] );
|
||||||
end;
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
|
@ -109,7 +109,7 @@ begin
|
|||||||
end; // with
|
end; // with
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function FontDialogHook(Wnd: HWnd; Msg: UINT; WParam: WPARAM; LParam: LPARAM): UINT; stdcall;
|
function FontDialogHook(Wnd: HWnd; Msg: UINT; WParam: WPARAM; LParam: LPARAM): UINT_PTR; stdcall;
|
||||||
var
|
var
|
||||||
_Self : TKOLFontProperty;
|
_Self : TKOLFontProperty;
|
||||||
R, R2, SR : TRect;
|
R, R2, SR : TRect;
|
||||||
|
@ -303,11 +303,50 @@ function count_1_bits_in_byte( x: Byte ): Byte;
|
|||||||
function count_1_bits_in_dword( x: Integer ): Integer;
|
function count_1_bits_in_dword( x: Integer ): Integer;
|
||||||
{* ������������ ����� ��������� ����� � 32-������ }
|
{* ������������ ����� ��������� ����� � 32-������ }
|
||||||
|
|
||||||
|
{ Round to a specific digit or power of ten }
|
||||||
|
{ ADigit has a valid range of 37 to -37. Here are some valid examples
|
||||||
|
of ADigit values...
|
||||||
|
3 = 10^3 = 1000 = thousand's place
|
||||||
|
2 = 10^2 = 100 = hundred's place
|
||||||
|
1 = 10^1 = 10 = ten's place
|
||||||
|
-1 = 10^-1 = 1/10 = tenth's place
|
||||||
|
-2 = 10^-2 = 1/100 = hundredth's place
|
||||||
|
-3 = 10^-3 = 1/1000 = thousandth's place }
|
||||||
|
|
||||||
|
type
|
||||||
|
TRoundToRange = -37..37;
|
||||||
|
|
||||||
|
function RoundTo(const AValue: Double; const ADigit: TRoundToRange): Double;
|
||||||
|
|
||||||
|
{ This variation of the RoundTo function follows the asymmetric arithmetic
|
||||||
|
rounding algorithm (if Frac(X) < .5 then return X else return X + 1). This
|
||||||
|
function defaults to rounding to the hundredth's place (cents). }
|
||||||
|
|
||||||
|
function SimpleRoundTo(const AValue: Double; const ADigit: TRoundToRange = -2): Double;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses SysConst;
|
uses SysConst;
|
||||||
|
|
||||||
|
function RoundTo(const AValue: Double; const ADigit: TRoundToRange): Double;
|
||||||
|
var
|
||||||
|
LFactor: Double;
|
||||||
|
begin
|
||||||
|
LFactor := IntPower(10, ADigit);
|
||||||
|
Result := Round(AValue / LFactor) * LFactor;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function SimpleRoundTo(const AValue: Double; const ADigit: TRoundToRange = -2): Double;
|
||||||
|
var
|
||||||
|
LFactor: Double;
|
||||||
|
begin
|
||||||
|
LFactor := IntPower(10, ADigit);
|
||||||
|
if AValue < 0 then
|
||||||
|
Result := Trunc((AValue / LFactor) - 0.5) * LFactor
|
||||||
|
else
|
||||||
|
Result := Trunc((AValue / LFactor) + 0.5) * LFactor;
|
||||||
|
end;
|
||||||
|
|
||||||
function EAbs( D: Double ): Double;
|
function EAbs( D: Double ): Double;
|
||||||
begin
|
begin
|
||||||
Result := D;
|
Result := D;
|
||||||
|
@ -2602,9 +2602,6 @@ var
|
|||||||
{$IFDEF ASM_VERSION}
|
{$IFDEF ASM_VERSION}
|
||||||
Src, Dst: PByte;
|
Src, Dst: PByte;
|
||||||
CntBytes: Integer;
|
CntBytes: Integer;
|
||||||
{$IFDEF SMALLEST_CODE}
|
|
||||||
Src2: PByte;
|
|
||||||
{$ENDIF}
|
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
{$IFDEF PAS_PNG}
|
{$IFDEF PAS_PNG}
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
|
@ -192,33 +192,22 @@ function BZDecompressBuf(const InBuf: Pointer; InBytes: Integer;
|
|||||||
function BZCompressStream(inStream, outStream: PStream; BlockSize100k: TBlockSize100k = 5): Integer;
|
function BZCompressStream(inStream, outStream: PStream; BlockSize100k: TBlockSize100k = 5): Integer;
|
||||||
function BZDecompressStream(inStream, outStream: PStream): Integer;
|
function BZDecompressStream(inStream, outStream: PStream): Integer;
|
||||||
|
|
||||||
|
|
||||||
{** deflate routines ********************************************************}
|
{** deflate routines ********************************************************}
|
||||||
|
|
||||||
function deflateInit_(var strm: TZStreamRec; level: Integer; version: PChar;
|
function deflateInit_(var strm: TZStreamRec; level: Integer; version: PChar;
|
||||||
recsize: Integer): Integer; external;
|
recsize: Integer): Integer; external;
|
||||||
|
|
||||||
function DeflateInit2_(var strm: TZStreamRec; level: integer; method: integer; windowBits: integer;
|
function DeflateInit2_(var strm: TZStreamRec; level: integer; method: integer; windowBits: integer;
|
||||||
memLevel: integer; strategy: integer; version: PChar; recsize: integer): integer; external;
|
memLevel: integer; strategy: integer; version: PChar; recsize: integer): integer; external;
|
||||||
|
function deflate(var strm: TZStreamRec; flush: Integer): Integer; external;
|
||||||
function deflate(var strm: TZStreamRec; flush: Integer): Integer;
|
|
||||||
external;
|
|
||||||
|
|
||||||
function deflateEnd(var strm: TZStreamRec): Integer; external;
|
function deflateEnd(var strm: TZStreamRec): Integer; external;
|
||||||
|
|
||||||
{** inflate routines ********************************************************}
|
{** inflate routines ********************************************************}
|
||||||
|
|
||||||
function inflateInit_(var strm: TZStreamRec; version: PChar;
|
function inflateInit_(var strm: TZStreamRec; version: PChar; recsize: Integer): Integer; external;
|
||||||
recsize: Integer): Integer; external;
|
|
||||||
|
|
||||||
function inflateInit2_(var strm: TZStreamRec; windowBits: integer;
|
function inflateInit2_(var strm: TZStreamRec; windowBits: integer;
|
||||||
version: PChar; recsize: integer): integer; external;
|
version: PChar; recsize: integer): integer; external;
|
||||||
|
function inflate(var strm: TZStreamRec; flush: Integer): Integer; external;
|
||||||
function inflate(var strm: TZStreamRec; flush: Integer): Integer;
|
|
||||||
external;
|
|
||||||
|
|
||||||
function inflateEnd(var strm: TZStreamRec): Integer; external;
|
function inflateEnd(var strm: TZStreamRec): Integer; external;
|
||||||
|
|
||||||
function inflateReset(var strm: TZStreamRec): Integer; external;
|
function inflateReset(var strm: TZStreamRec): Integer; external;
|
||||||
|
|
||||||
const
|
const
|
||||||
|
@ -8,8 +8,6 @@
|
|||||||
{ E-mail : alex@diploms.com }
|
{ E-mail : alex@diploms.com }
|
||||||
{ �������� �� ������ ������ RyMenu ������� ��������� (skitl@mail.ru). }
|
{ �������� �� ������ ������ RyMenu ������� ��������� (skitl@mail.ru). }
|
||||||
{***********************************************************************}
|
{***********************************************************************}
|
||||||
{$DEFINE USE_AUTOFREE4CONTROLS}
|
|
||||||
|
|
||||||
unit XPMenus;
|
unit XPMenus;
|
||||||
|
|
||||||
interface
|
interface
|
||||||
@ -173,9 +171,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
PXPControl( AParent).fMenuObj := Result;
|
PXPControl( AParent).fMenuObj := Result;
|
||||||
AParent.AttachProc(WndProcMenu );
|
AParent.AttachProc(WndProcMenu );
|
||||||
{$IFDEF USE_AUTOFREE4CONTROLS} //dufa
|
|
||||||
AParent.Add2AutoFree( Result );
|
AParent.Add2AutoFree( Result );
|
||||||
{$ENDIF}
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -5,49 +5,35 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
Windows, KOL, Classes, Messages, Forms, SysUtils, mirror,
|
Windows, KOL, Classes, Messages, Forms, SysUtils, mirror,
|
||||||
mckCtrls, Graphics, KOLEcmListEdit,
|
mckCtrls, Graphics, KOLEcmListEdit, DesignIntf, DesignEditors, DesignConst, mckLVColumnsEditor;
|
||||||
//////////////////////////////////////////////////
|
|
||||||
{$IFDEF _D6orHigher} //
|
|
||||||
DesignIntf, DesignEditors, DesignConst, //
|
|
||||||
Variants, //
|
|
||||||
{$ELSE} //
|
|
||||||
//////////////////////////////////////////////////
|
|
||||||
DsgnIntf,
|
|
||||||
//////////////////////////////////////////////////////////
|
|
||||||
{$ENDIF} //
|
|
||||||
|
|
||||||
mckLVColumnsEditor;
|
|
||||||
|
|
||||||
type
|
type
|
||||||
// TOnEditText = procedure (Sender: PControl; ACol, ARow: Integer; var Value: String) of object;
|
|
||||||
|
|
||||||
TKOLEcmListEdit = class(TKOLListView)
|
TKOLEcmListEdit = class(TKOLListView)
|
||||||
private
|
protected
|
||||||
fDrawForbidden: TOnDrawItem;
|
fDrawForbidden: TOnDrawItem;
|
||||||
fListData: boolean;
|
fListData: Boolean;
|
||||||
fOnGetText: TOnEditText;
|
fOnGetText: TOnEditText;
|
||||||
fOnPutText: TOnEditText;
|
fOnPutText: TOnEditText;
|
||||||
fOnEndEdit: TOnEndEdit;
|
fOnEndEdit: TOnEndEdit;
|
||||||
fOnColAdjust: TOnColAdjust;
|
fOnCellAdjust: TOnCellAdjust;
|
||||||
fOnEditChar: TOnEditChar;
|
fOnEditChar: TOnEditChar;
|
||||||
fOnCreateEdit: TOnCreateEdit;
|
fOnCreateEdit: TOnCreateEdit;
|
||||||
fLimStyle: TKOLListViewStyle;
|
fLimStyle: TKOLListViewStyle;
|
||||||
fOnDrawCell: TOnDrawCell;
|
fOnDrawCell: TOnDrawCell;
|
||||||
procedure SetOnGetText(const Value: TOnEditText);
|
procedure SetOnGetText(const Value: TOnEditText);
|
||||||
procedure SetOnPutText(const Value: TOnEditText);
|
procedure SetOnPutText(const Value: TOnEditText);
|
||||||
procedure SetOnEndEdit(const Value: TOnEndEdit);
|
procedure SetOnEndEdit(const Value: TOnEndEdit);
|
||||||
procedure SetOnColAdjust(const Value: TOnColAdjust);
|
procedure SetOnCellAdjust(const Value: TOnCellAdjust);
|
||||||
procedure SetOnEditChar(const Value: TOnEditChar);
|
procedure SetOnEditChar(const Value: TOnEditChar);
|
||||||
procedure SetOnCreateEdit(const Value: TOnCreateEdit);
|
procedure SetOnCreateEdit(const Value: TOnCreateEdit);
|
||||||
procedure SetLimStyle(const Value: TKOLListViewStyle);
|
procedure SetLimStyle(const Value: TKOLListViewStyle);
|
||||||
procedure SetOnDrawCell(const Value: TOnDrawCell);
|
procedure SetOnDrawCell(const Value: TOnDrawCell);
|
||||||
protected
|
|
||||||
function AdditionalUnits: string; override;
|
function AdditionalUnits: string; override;
|
||||||
procedure SetupFirst( SL: TStringList; const AName, AParent, Prefix: String ); override;
|
procedure SetupFirst( SL: TStringList; const AName, AParent, Prefix: String ); override;
|
||||||
procedure SetupLast( SL: TStringList; const AName, AParent, Prefix: String ); override;
|
procedure SetupLast(SL: TStringList; const AName, AParent, Prefix: String); override;
|
||||||
procedure AssignEvents( SL: TStringList; const AName: String ); override;
|
procedure AssignEvents( SL: TStringList; const AName: String ); override;
|
||||||
function SetupParams( const AName, AParent: TDelphiString ): TDelphiString; override;
|
function SetupParams( const AName, AParent: TDelphiString ): TDelphiString; override;
|
||||||
function GetCaption: string;
|
function GetCaption: string;
|
||||||
function GetStyle: TKOLListViewStyle;
|
function GetStyle: TKOLListViewStyle;
|
||||||
function GetOptions: TKOLListViewOptions;
|
function GetOptions: TKOLListViewOptions;
|
||||||
procedure SetOptions(v: TKOLListViewOptions);
|
procedure SetOptions(v: TKOLListViewOptions);
|
||||||
@ -62,7 +48,7 @@ type
|
|||||||
property OnGetEditText: TOnEditText read fOnGetText write SetOnGetText;
|
property OnGetEditText: TOnEditText read fOnGetText write SetOnGetText;
|
||||||
property OnPutEditText: TOnEditText read fOnPutText write SetOnPutText;
|
property OnPutEditText: TOnEditText read fOnPutText write SetOnPutText;
|
||||||
property OnStopEdit: TOnEndEdit read fOnEndEdit write SetOnEndEdit;
|
property OnStopEdit: TOnEndEdit read fOnEndEdit write SetOnEndEdit;
|
||||||
property OnColAdjust: TOnColAdjust read fOnColAdjust write SetOnColAdjust;
|
property OnCellAdjust: TOnCellAdjust read fOnCellAdjust write SetOnCellAdjust;
|
||||||
property OnEditChar: TOnEditChar read fOnEditChar write SetOnEditChar;
|
property OnEditChar: TOnEditChar read fOnEditChar write SetOnEditChar;
|
||||||
property OnCreateEdit: TOnCreateEdit read fOnCreateEdit write SetOnCreateEdit;
|
property OnCreateEdit: TOnCreateEdit read fOnCreateEdit write SetOnCreateEdit;
|
||||||
property OnDrawCell: TOnDrawCell read FOnDrawCell write SetOnDrawCell;
|
property OnDrawCell: TOnDrawCell read FOnDrawCell write SetOnDrawCell;
|
||||||
@ -73,63 +59,68 @@ type
|
|||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
//{$R EcmListEdit.dcr}
|
|
||||||
|
|
||||||
constructor TKOLEcmListEdit.Create;
|
constructor TKOLEcmListEdit.Create;
|
||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
inherited Style := lvsDetail;
|
inherited Style := lvsDetail;
|
||||||
inherited Options := [{lvoRowSelect,}lvoHideSel,lvoGridLines,lvoOwnerDrawFixed];
|
inherited Options := [{lvoRowSelect,}lvoHideSel, lvoGridLines, lvoOwnerDrawFixed];
|
||||||
// Font.FontCharset := 204;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
function TKOLEcmListEdit.AdditionalUnits;
|
function TKOLEcmListEdit.AdditionalUnits;
|
||||||
begin
|
begin
|
||||||
Result := ', KOLEcmListEdit';
|
Result := ', KOLEcmListEdit';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TKOLEcmListEdit.SetupFirst;
|
procedure TKOLEcmListEdit.SetupFirst;
|
||||||
begin
|
begin
|
||||||
// if @fOnGetText <> nil then
|
|
||||||
// SL.Add( ' PEcmListEdit(' + AName + '.CustomObj).OnGetEditText := Result.' +
|
|
||||||
inherited;
|
inherited;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TKOLEcmListEdit.SetupLast;
|
procedure TKOLEcmListEdit.SetupLast(SL: TStringList; const AName, AParent, Prefix: String);
|
||||||
begin
|
begin
|
||||||
inherited AssignEvents(SL, AName);
|
inherited;
|
||||||
if @fOnGetText <> nil then
|
// inherited AssignEvents(SL, AName);
|
||||||
SL.Add( ' PEcmListEdit(' + AName + '.CustomObj).OnGetEditText := Result.' +
|
//
|
||||||
ParentForm.MethodName( @OnGetEditText ) + ';' );
|
// DoAssignEvents(SL, 'PEcmListEdit(' + AName + '.CustomObj)',
|
||||||
if @fOnPutText <> nil then
|
// ['OnGetEditText', 'OnPutEditText', 'OnStopEdit', 'OnCellAdjust', 'OnEditChar', 'OnCreateEdit', 'OnDrawCell'],
|
||||||
SL.Add( ' PEcmListEdit(' + AName + '.CustomObj).OnPutEditText := Result.' +
|
// [@OnGetEditText, @OnPutEditText, @OnStopEdit, @fOnCellAdjust, @OnEditChar, @OnCreateEdit, @OnDrawCell]);
|
||||||
ParentForm.MethodName( @OnPutEditText ) + ';' );
|
|
||||||
if @fOnEndEdit <> nil then
|
// if Assigned(fOnGetText) then begin
|
||||||
SL.Add( ' PEcmListEdit(' + AName + '.CustomObj).OnStopEdit := Result.' +
|
// SL.Add( ' PEcmListEdit(' + AName + '.CustomObj).OnGetEditText := Result.' +
|
||||||
ParentForm.MethodName( @OnStopEdit ) + ';' );
|
// ParentForm.MethodName(@OnGetEditText) + ';' );
|
||||||
if @fOnColAdjust <> nil then
|
// end;
|
||||||
SL.Add( ' PEcmListEdit(' + AName + '.CustomObj).OnColAdjust := Result.' +
|
// if @fOnPutText <> nil then
|
||||||
ParentForm.MethodName( @OnColAdjust ) + ';' );
|
// SL.Add( ' PEcmListEdit(' + AName + '.CustomObj).OnPutEditText := Result.' +
|
||||||
if @fOnEditChar <> nil then
|
// ParentForm.MethodName( @OnPutEditText ) + ';' );
|
||||||
SL.Add( ' PEcmListEdit(' + AName + '.CustomObj).OnEditChar := Result.' +
|
// if @fOnEndEdit <> nil then
|
||||||
ParentForm.MethodName( @OnEditChar ) + ';' );
|
// SL.Add( ' PEcmListEdit(' + AName + '.CustomObj).OnStopEdit := Result.' +
|
||||||
if @fOnCreateEdit <> nil then
|
// ParentForm.MethodName( @OnStopEdit ) + ';' );
|
||||||
SL.Add( ' PEcmListEdit(' + AName + '.CustomObj).OnCreateEdit := Result.' +
|
// if @fOnCellAdjust <> nil then
|
||||||
ParentForm.MethodName( @OnCreateEdit ) + ';' );
|
// SL.Add( ' PEcmListEdit(' + AName + '.CustomObj).OnCellAdjust := Result.' +
|
||||||
if @fOnDrawCell <> nil then
|
// ParentForm.MethodName( @fOnCellAdjust ) + ';' );
|
||||||
SL.Add( ' PEcmListEdit(' + AName + '.CustomObj).OnDrawCell := Result.' +
|
// if @fOnEditChar <> nil then
|
||||||
ParentForm.MethodName( @OnDrawCell ) + ';' );
|
// SL.Add( ' PEcmListEdit(' + AName + '.CustomObj).OnEditChar := Result.' +
|
||||||
|
// ParentForm.MethodName( @OnEditChar ) + ';' );
|
||||||
|
// if @fOnCreateEdit <> nil then
|
||||||
|
// SL.Add( ' PEcmListEdit(' + AName + '.CustomObj).OnCreateEdit := Result.' +
|
||||||
|
// ParentForm.MethodName( @OnCreateEdit ) + ';' );
|
||||||
|
// if (@fOnDrawCell <> nil) then
|
||||||
|
// SL.Add( ' PEcmListEdit(' + AName + '.CustomObj).OnDrawCell := Result.' +
|
||||||
|
// ParentForm.MethodName( @OnDrawCell ) + ';' );
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TKOLEcmListEdit.AssignEvents;
|
procedure TKOLEcmListEdit.AssignEvents;
|
||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
|
|
||||||
|
DoAssignEvents(SL, 'PEcmListEdit(' + AName + '.CustomObj)',
|
||||||
|
['OnGetEditText', 'OnPutEditText', 'OnStopEdit', 'OnCellAdjust', 'OnEditChar', 'OnCreateEdit', 'OnDrawCell'],
|
||||||
|
[@OnGetEditText, @OnPutEditText, @OnStopEdit, @fOnCellAdjust, @OnEditChar, @OnCreateEdit, @OnDrawCell]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TKOLEcmListEdit.GetCaption;
|
function TKOLEcmListEdit.GetCaption;
|
||||||
begin
|
begin
|
||||||
Result := inherited Caption;
|
Result := inherited Caption;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TKOLEcmListEdit.GetStyle;
|
function TKOLEcmListEdit.GetStyle;
|
||||||
@ -140,12 +131,12 @@ end;
|
|||||||
|
|
||||||
function TKOLEcmListEdit.GetOptions;
|
function TKOLEcmListEdit.GetOptions;
|
||||||
begin
|
begin
|
||||||
Result := inherited Options;
|
Result := inherited Options;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TKOLEcmListEdit.SetOptions;
|
procedure TKOLEcmListEdit.SetOptions;
|
||||||
begin
|
begin
|
||||||
inherited Options := v + [{lvoRowSelect,}lvoHideSel,lvoOwnerDrawFixed];
|
inherited Options := v + [{lvoRowSelect,}lvoHideSel,lvoOwnerDrawFixed];
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure Register;
|
procedure Register;
|
||||||
@ -161,7 +152,7 @@ end;
|
|||||||
|
|
||||||
procedure TKOLEcmListEdit.SetOnGetText(const Value: TOnEditText);
|
procedure TKOLEcmListEdit.SetOnGetText(const Value: TOnEditText);
|
||||||
begin
|
begin
|
||||||
if @fOnGetText <> @Value then begin
|
if (@fOnGetText <> @Value) then begin
|
||||||
fOnGetText := Value;
|
fOnGetText := Value;
|
||||||
Change();
|
Change();
|
||||||
end;
|
end;
|
||||||
@ -169,7 +160,7 @@ end;
|
|||||||
|
|
||||||
procedure TKOLEcmListEdit.SetOnPutText(const Value: TOnEditText);
|
procedure TKOLEcmListEdit.SetOnPutText(const Value: TOnEditText);
|
||||||
begin
|
begin
|
||||||
if @fOnPutText <> @Value then begin
|
if (@fOnPutText <> @Value) then begin
|
||||||
fOnPutText := Value;
|
fOnPutText := Value;
|
||||||
Change();
|
Change();
|
||||||
end;
|
end;
|
||||||
@ -177,25 +168,25 @@ end;
|
|||||||
|
|
||||||
procedure TKOLEcmListEdit.SetOnEndEdit(const Value: TOnEndEdit);
|
procedure TKOLEcmListEdit.SetOnEndEdit(const Value: TOnEndEdit);
|
||||||
begin
|
begin
|
||||||
if @fOnEndEdit <> @Value then begin
|
if (@fOnEndEdit <> @Value) then begin
|
||||||
fOnEndEdit := Value;
|
fOnEndEdit := Value;
|
||||||
Change();
|
Change();
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TKOLEcmListEdit.SetOnColAdjust(const Value: TOnColAdjust);
|
procedure TKOLEcmListEdit.SetOnCellAdjust(const Value: TOnCellAdjust);
|
||||||
begin
|
begin
|
||||||
if @fOnColAdjust <> @Value then begin
|
if (@fOnCellAdjust <> @Value) then begin
|
||||||
fOnColAdjust := Value;
|
fOnCellAdjust := Value;
|
||||||
Change;
|
Change;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TKOLEcmListEdit.SetOnEditChar(const Value: TOnEditChar);
|
procedure TKOLEcmListEdit.SetOnEditChar(const Value: TOnEditChar);
|
||||||
begin
|
begin
|
||||||
if @fOnEditChar <> @Value then begin
|
if (@fOnEditChar <> @Value) then begin
|
||||||
fOnEditChar := Value;
|
fOnEditChar := Value;
|
||||||
Change();
|
Change;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -203,7 +194,7 @@ procedure TKOLEcmListEdit.SetOnDrawCell(const Value: TOnDrawCell);
|
|||||||
begin
|
begin
|
||||||
if @FOnDrawCell <> @Value then begin
|
if @FOnDrawCell <> @Value then begin
|
||||||
FOnDrawCell:= Value;
|
FOnDrawCell:= Value;
|
||||||
Change();
|
Change;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -214,13 +205,12 @@ end;
|
|||||||
|
|
||||||
procedure TKOLEcmListEdit.SetOnCreateEdit(const Value: TOnCreateEdit);
|
procedure TKOLEcmListEdit.SetOnCreateEdit(const Value: TOnCreateEdit);
|
||||||
begin
|
begin
|
||||||
if @fOnCreateEdit <> @Value then begin
|
if (@fOnCreateEdit <> @Value) then begin
|
||||||
fOnCreateEdit := Value;
|
fOnCreateEdit := Value;
|
||||||
Change();
|
Change;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure TKOLEcmListEdit.SetLimStyle(const Value: TKOLListViewStyle);
|
procedure TKOLEcmListEdit.SetLimStyle(const Value: TKOLListViewStyle);
|
||||||
begin
|
begin
|
||||||
if (Value <> fLimStyle) and ((Value = lvsDetail) or (Value = lvsDetailNoHeader)) then begin
|
if (Value <> fLimStyle) and ((Value = lvsDetail) or (Value = lvsDetailNoHeader)) then begin
|
||||||
|
@ -167,7 +167,7 @@ begin
|
|||||||
MI.SetupTemplate( SL, I = 0, ParentKOLForm );
|
MI.SetupTemplate( SL, I = 0, ParentKOLForm );
|
||||||
end;
|
end;
|
||||||
|
|
||||||
S := ''''' ], ' + OnMenuItemMethodName(False) + ', false );';
|
S := ''''' ], ' + OnMenuItemMethodName() + ', false );';
|
||||||
if Count <> 0 then
|
if Count <> 0 then
|
||||||
S := ', ' + S;
|
S := ', ' + S;
|
||||||
if Length( S ) + Length( SL[ SL.Count - 1 ] ) > 64 then
|
if Length( S ) + Length( SL[ SL.Count - 1 ] ) > 64 then
|
||||||
@ -297,7 +297,7 @@ begin
|
|||||||
MI.SetupTemplate( SL, I = 0, ParentKOLForm );
|
MI.SetupTemplate( SL, I = 0, ParentKOLForm );
|
||||||
end;
|
end;
|
||||||
|
|
||||||
S := ''''' ], ' + OnMenuItemMethodName(False) + ', true );';
|
S := ''''' ], ' + OnMenuItemMethodName() + ', true );';
|
||||||
if Count <> 0 then
|
if Count <> 0 then
|
||||||
S := ', ' + S;
|
S := ', ' + S;
|
||||||
if Length( S ) + Length( SL[ SL.Count - 1 ] ) > 64 then
|
if Length( S ) + Length( SL[ SL.Count - 1 ] ) > 64 then
|
||||||
|
@ -42,8 +42,8 @@ end;
|
|||||||
procedure tinyLoadJPGGIFBMPFile(var TargetBitmap: PBitMap; FileName: String);
|
procedure tinyLoadJPGGIFBMPFile(var TargetBitmap: PBitMap; FileName: String);
|
||||||
var
|
var
|
||||||
Stream: IStream;
|
Stream: IStream;
|
||||||
Picta: IPicture;
|
Picta: IPicture;
|
||||||
hh: THandle;
|
hh: OLE_HANDLE;
|
||||||
asm
|
asm
|
||||||
//[ebx] = PBitmap;
|
//[ebx] = PBitmap;
|
||||||
//edi = FileName;
|
//edi = FileName;
|
||||||
@ -110,8 +110,8 @@ end;
|
|||||||
procedure tinyLoadJPGGIFBMPMemory(var TargetBitmap: PBitMap; Ptr: HGlobal; Size: DWORD);
|
procedure tinyLoadJPGGIFBMPMemory(var TargetBitmap: PBitMap; Ptr: HGlobal; Size: DWORD);
|
||||||
var
|
var
|
||||||
Stream: IStream;
|
Stream: IStream;
|
||||||
Picta: IPicture;
|
Picta: IPicture;
|
||||||
hh: THandle;
|
hh: OLE_HANDLE;
|
||||||
begin
|
begin
|
||||||
TargetBitmap := nil;
|
TargetBitmap := nil;
|
||||||
if CreateStreamOnHGlobal(ptr, TRUE, Stream) <> S_OK then
|
if CreateStreamOnHGlobal(ptr, TRUE, Stream) <> S_OK then
|
||||||
@ -142,7 +142,7 @@ end;
|
|||||||
|
|
||||||
procedure tinyLoadJPGGIFBMPString(const s: String; out TargetBitmap: PBitMap);
|
procedure tinyLoadJPGGIFBMPString(const s: String; out TargetBitmap: PBitMap);
|
||||||
var
|
var
|
||||||
hh: DWORD;
|
hh: OLE_HANDLE;
|
||||||
hPtr: DWORD;
|
hPtr: DWORD;
|
||||||
len: Integer;
|
len: Integer;
|
||||||
Stream: IStream;
|
Stream: IStream;
|
||||||
|
Reference in New Issue
Block a user