mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 06:59:14 +02:00
TComboBox and TListBox accelerated and now supports objects
git-svn-id: trunk@3647 -
This commit is contained in:
parent
1b360dd18f
commit
c8d91f88a4
@ -29,7 +29,6 @@
|
|||||||
procedure TCustomComboBox.CreateHandle;
|
procedure TCustomComboBox.CreateHandle;
|
||||||
var
|
var
|
||||||
NewStrings: TStrings;
|
NewStrings: TStrings;
|
||||||
OldText: string;
|
|
||||||
begin
|
begin
|
||||||
inherited CreateHandle;
|
inherited CreateHandle;
|
||||||
|
|
||||||
@ -37,9 +36,7 @@ begin
|
|||||||
NewStrings:= TStrings(Pointer(CNSendMessage(LM_GETITEMS, Self, nil)));
|
NewStrings:= TStrings(Pointer(CNSendMessage(LM_GETITEMS, Self, nil)));
|
||||||
// then delete internal list
|
// then delete internal list
|
||||||
if (FItems<>NewStrings) and (FItems<>nil) then begin
|
if (FItems<>NewStrings) and (FItems<>nil) then begin
|
||||||
OldText:=Text;
|
|
||||||
NewStrings.Assign(FItems);
|
NewStrings.Assign(FItems);
|
||||||
Text:=OldText;
|
|
||||||
FItems.Free;
|
FItems.Free;
|
||||||
end;
|
end;
|
||||||
// and use the interface based list
|
// and use the interface based list
|
||||||
@ -727,6 +724,9 @@ end;
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.23 2002/11/17 11:10:04 mattias
|
||||||
|
TComboBox and TListBox accelerated and now supports objects
|
||||||
|
|
||||||
Revision 1.22 2002/11/17 00:18:11 mattias
|
Revision 1.22 2002/11/17 00:18:11 mattias
|
||||||
fixed combobox createhandle
|
fixed combobox createhandle
|
||||||
|
|
||||||
|
@ -18,35 +18,47 @@
|
|||||||
*****************************************************************************
|
*****************************************************************************
|
||||||
}
|
}
|
||||||
|
|
||||||
{$IFOPT H+}
|
|
||||||
{$DEFINE H_PLUS}
|
|
||||||
{$ELSE}
|
|
||||||
{$H+}
|
|
||||||
{$ENDIF}
|
|
||||||
type
|
type
|
||||||
|
TGtkListStringsState = (glsItemCacheNeedsUpdate);
|
||||||
|
TGtkListStringsStates = set of TGtkListStringsState;
|
||||||
|
|
||||||
|
PPGtkListItem = ^PGtkListItem;
|
||||||
|
|
||||||
TGtkListStringList = class(TStrings)
|
TGtkListStringList = class(TStrings)
|
||||||
private
|
private
|
||||||
FGtkList : PGtkList;
|
FGtkList : PGtkList;
|
||||||
FOwner: TWinControl;
|
FOwner: TWinControl;
|
||||||
FSorted : boolean;
|
FSorted : boolean;
|
||||||
|
FStates: TGtkListStringsStates;
|
||||||
|
FCachedCount: integer;
|
||||||
|
FCachedItems: PPGtkListItem;
|
||||||
|
FUpdateCount: integer;
|
||||||
protected
|
protected
|
||||||
function Get(Index : Integer) : string; override;
|
|
||||||
function GetCount : integer; override;
|
function GetCount : integer; override;
|
||||||
|
function Get(Index : Integer) : string; override;
|
||||||
|
function GetObject(Index: Integer): TObject; override;
|
||||||
|
procedure PutObject(Index: Integer; AnObject: TObject); override;
|
||||||
procedure SetSorted(Val : boolean); virtual;
|
procedure SetSorted(Val : boolean); virtual;
|
||||||
procedure ConnectItemCallbacks(Index: integer);
|
procedure ConnectItemCallbacks(Index: integer);
|
||||||
procedure ConnectItemCallbacks(Li: PGtkListItem); virtual;
|
procedure ConnectItemCallbacks(Li: PGtkListItem); virtual;
|
||||||
procedure ConnectAllCallbacks; virtual;
|
procedure ConnectAllCallbacks; virtual;
|
||||||
procedure RemoveItemCallbacks(Index: integer); virtual;
|
procedure RemoveItemCallbacks(Index: integer); virtual;
|
||||||
procedure RemoveAllCallbacks; virtual;
|
procedure RemoveAllCallbacks; virtual;
|
||||||
|
procedure UpdateItemCache;
|
||||||
public
|
public
|
||||||
constructor Create(List : PGtkList; TheOwner: TWinControl);
|
constructor Create(List : PGtkList; TheOwner: TWinControl);
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
|
function Add(const S: string): Integer; override;
|
||||||
procedure Assign(Source : TPersistent); override;
|
procedure Assign(Source : TPersistent); override;
|
||||||
procedure Clear; override;
|
procedure Clear; override;
|
||||||
procedure Delete(Index : integer); override;
|
procedure Delete(Index : integer); override;
|
||||||
|
function IndexOf(const S: string): Integer; override;
|
||||||
procedure Insert(Index : integer; const S: string); override;
|
procedure Insert(Index : integer; const S: string); override;
|
||||||
procedure Sort; virtual;
|
procedure Sort; virtual;
|
||||||
|
function IsEqual(List: TStrings): boolean;
|
||||||
|
procedure BeginUpdate;
|
||||||
|
procedure EndUpdate;
|
||||||
|
public
|
||||||
property Sorted : boolean read FSorted write SetSorted;
|
property Sorted : boolean read FSorted write SetSorted;
|
||||||
property Owner: TWinControl read FOwner;
|
property Owner: TWinControl read FOwner;
|
||||||
end;
|
end;
|
||||||
@ -71,15 +83,12 @@ type
|
|||||||
property Sorted : boolean read FSorted write SetSorted;
|
property Sorted : boolean read FSorted write SetSorted;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{$IFDEF H_PLUS}
|
|
||||||
{$UNDEF H_PLUS}
|
|
||||||
{$ELSE}
|
|
||||||
{$H-}
|
|
||||||
{$ENDIF}
|
|
||||||
|
|
||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.6 2002/11/17 11:10:04 mattias
|
||||||
|
TComboBox and TListBox accelerated and now supports objects
|
||||||
|
|
||||||
Revision 1.5 2002/10/04 14:24:15 lazarus
|
Revision 1.5 2002/10/04 14:24:15 lazarus
|
||||||
MG: added DrawItem to TComboBox/TListBox
|
MG: added DrawItem to TComboBox/TListBox
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user