type
ISkinListBox =
interface
['
{38EF3B4F-86A1-45D0-A7F3-4E45E125979D}']
function GetHandle: hWnd;
property Handle: hWnd
read GetHandle;
procedure SetFont(nPointSize: Integer; FontName: PAnsiChar; AktForecolor: COLORREF;
InAktForecolor: COLORREF; Shadow: Boolean; SOffset: Integer; ShadowColor: COLORREF);
function GetDrawStyle: Integer;
property DrawStyle: Integer
read GetDrawStyle;
function GetTop: Integer;
property Top: Integer
read GetTop;
function ListGetText(hList: HWND; Item: Integer): PAnsiChar;
function ListAdd(hList: HWND; Tmp:
string): Integer;
function ListGetCurSel(hList: HWND): Integer;
function ListFindString(hList: HWND; Tmp:
string): Integer;
procedure ListSelectPlus(hList: HWND; nSelected: Integer);
procedure ListDelete(hList: HWND; nIndex: Integer);
procedure ListDeleteAll(hList: HWND);
function ListCount(hList: HWND): Integer;
function ListGetTopIndex(hList: HWND): Integer;
procedure ListSetTopIndex(hList: HWND; nTopIndex: Integer);
function ListGetSel(hList: HWND; nSelected: Integer): Bool;
function GetItemHeight(hList: HWND; ItemHeigh: Integer): Integer;
end;
TSkinListBox =
class(TInterfacedObject, ISkinListBox)
private
LStyle: DWORD;
FHOwner: HWND;
FHandle: HWND;
FEnumProcInst: Pointer;
ImgIcon: Cardinal;
ImgIconH: Cardinal;
ImgIconW: Cardinal;
function MakeProcInstance(M: TMethod): Pointer;
procedure SetCTLFont(hCtL: HWND; Font: hFont);
procedure SubClass(WinHandle: HWND; wProc: Integer);
procedure UnSubClass(WinHandle: HWND);
function GetHandle: hWnd;
public
property Handle: HWND
Read FHandle;
function GetDrawStyle: Integer;
property DrawStyle: Integer
read GetDrawStyle;
function GetTop: Integer;
property Top: Integer
read GetTop;
procedure SetFont(nPointSize: Integer; FontName: PAnsiChar; AktForecolor: COLORREF;
InAktForecolor: COLORREF; Shadow: Boolean; SOffset: Integer; ShadowColor: COLORREF);
function ListBoxProc(WinHandle: HWND; Msg: UINT; wP: WParam; lP: LParam): LRESULT;
stdcall;
procedure DrawItem(WinHandle: HWND;
Dc: Hdc;
Index: Integer;Rect: TRect; Selected: Bool);
procedure ListSetTopIndex(hList: HWND; nTopIndex: Integer);
function ListGetTopIndex(hList: HWND): Integer;
function ListGetSel(hList: HWND; nSelected: Integer): Bool;
function GetItemHeight(hList: HWND; ItemHeigh: Integer): Integer;
function ListCount(hList: HWND): Integer;
procedure ListDeleteAll(hList: HWND);
procedure ListDelete(hList: HWND; nIndex: Integer);
procedure ListSelectPlus(hList: HWND; nSelected: Integer);
function ListFindString(hList: HWND; Tmp:
string): Integer;
function ListGetCurSel(hList: HWND): Integer;
function ListAdd(hList: HWND; Tmp:
string): Integer;
function ListGetText(hList: HWND; Item: Integer): PAnsiChar;
constructor Create(hOwner: HWND; FullpathImageName:
string; x, y, xW, yH,
ListID: integer; Visible: Boolean; ItemHeight: Integer; BackColor: COLORREF);
destructor Destroy;
override;
end;
PLB_TYPE = ^TLB_TYPE;
TLB_TYPE =
record
AktForecolor : COLORREF;
InAktForecolor : COLORREF;
Backcolor : COLORREF;
Shadow : Boolean;
ShadowColor : COLORREF;
ShadowOffset : Integer;
ForeColorSelected : COLORREF;
BackColorSelected : COLORREF;
PointSize : Integer;
DrawStyle : Integer;
BorderStyle : Integer;
Icon :
string;
ItemHeight : Integer;
Handle : HWND;
Left : Integer;
Top : Integer;
Width : Integer;
Height : Integer;
Font : HFONT;
end;
var
ListBoxType: TLB_TYPE;