MG: started customdrawitem

git-svn-id: trunk@3454 -
This commit is contained in:
lazarus 2002-10-03 18:04:46 +00:00
parent 8c3b47842e
commit acd0679554
5 changed files with 38 additions and 23 deletions

View File

@ -21,9 +21,6 @@
ToDo:
- TCustomComboBox has a bug: it can not store objects
- TCustomComboBox don't know custom draw yet
- combobox can't sort (exception)
- backgroundcolor=clNone
- a lot more ... see XXX
@ -45,6 +42,9 @@ type
TObjectInspector = class;
{ TOIOptions }
TOIOptions = class
private
FCustomXMLCfg: TXMLConfig;
@ -95,6 +95,9 @@ type
TOIPropertyGrid = class;
{ TOIPropertyGridRow }
TOIPropertyGridRow = class
private
FTop:integer;

View File

@ -70,12 +70,12 @@ end;
{------------------------------------------------------------------------------
procedure TCustomComboBox.DrawItem(Index: Integer; Rect: TRect;
State: TCustomDrawItemState);
State: TOwnerDrawState);
------------------------------------------------------------------------------}
procedure TCustomComboBox.DrawItem(Index: Integer; Rect: TRect;
State: TCustomDrawItemState);
State: TOwnerDrawState);
begin
//TControlCanvas(FCanvas).UpdateTextFlags;
if Assigned(FOnDrawItem) then
@ -654,10 +654,9 @@ end;
------------------------------------------------------------------------------}
Procedure TCustomComboBox.CNDrawItems(var TheMessage : TLMDrawItems);
//var
//State: TOwnerDrawState;
// State: TOwnerDrawState;
begin
{with Message.DrawItemStruct^ do
{with TheMessage.DrawItemStruct^ do
begin
State := TOwnerDrawState(LongRec(itemState).Lo);
if itemState and ODS_COMBOBOXEDIT <> 0 then
@ -728,6 +727,9 @@ end;
{
$Log$
Revision 1.17 2002/10/03 18:04:46 lazarus
MG: started customdrawitem
Revision 1.16 2002/10/03 14:47:30 lazarus
MG: added TComboBox.OnPopup+OnCloseUp+ItemWidth

View File

@ -664,10 +664,10 @@ type
ctlType: UINT;
ctlID : UINT;
itemID : UINT;
itemAction : UINT;
itemState : UINT;
itemAction : UINT;
itemState : UINT;
hwndItem: HWND;
_hDc: HDC;
_hDC: HDC;
rcItem: TRect;
itemData : DWord;
end;
@ -1579,6 +1579,9 @@ end.
{
$Log$
Revision 1.18 2002/10/03 18:04:46 lazarus
MG: started customdrawitem
Revision 1.17 2002/09/27 20:52:22 lazarus
MWE: Applied patch from "Andrew Johnson" <aj_genius@hotmail.com>

View File

@ -372,7 +372,7 @@ type
Msg : Cardinal;
CursorWnd : HWND;
HitText : Word;
MOuseMsg : Word;
MouseMsg : Word;
Result : Longint;
end;
@ -381,7 +381,7 @@ type
TLMCanvasCreate = Record
pparent : Pointer;
pCanvas : Pointer;
end;
end;
pTLMCanvasCreate = ^TLMCanvasCreate;
@ -871,6 +871,9 @@ end.
{
$Log$
Revision 1.34 2002/10/03 18:04:46 lazarus
MG: started customdrawitem
Revision 1.33 2002/10/03 14:47:29 lazarus
MG: added TComboBox.OnPopup+OnCloseUp+ItemWidth

View File

@ -168,13 +168,14 @@ type
TComboBoxStyle = (csDropDown, csSimple, csDropDownList, csOwnerDrawFixed,
csOwnerDrawVariable);
TCustomDrawItemState = (
cdiSelected, cdiGrayed, cdiDisabled, cdiChecked,
cdiFocused, cdiDefault, cdiHotLight, cdiInactive, cdiNoAccel,
cdiNoFocusRect, cdiComboBoxEdit);
TCustomDrawItemEvent = procedure(Control: TWinControl; Index: Integer;
Rect: TRect; State: TCustomDrawItemState) of object;
TOwnerDrawStateType = (
odSelected, odGrayed, odDisabled, odChecked,
odFocused, odDefault, odHotLight, odInactive, odNoAccel,
odNoFocusRect, odReserved1, odReserved2, odComboBoxEdit);
TOwnerDrawState = set of TOwnerDrawStateType;
TDrawItemEvent = procedure(Control: TWinControl; Index: Integer;
Rect: TRect; State: TOwnerDrawState) of object;
TMeasureItemEvent = procedure(Control: TWinControl; Index: Integer;
var Height: Integer) of object;
@ -191,7 +192,7 @@ type
fMaxLength: integer;
FOnChange : TNotifyEvent;
FOnCloseUp: TNotifyEvent;
FOnDrawItem: TCustomDrawItemEvent;
FOnDrawItem: TDrawItemEvent;
FOnDropDown: TNotifyEvent;
FOnMeasureItem: TMeasureItemEvent;
FOnSelect: TNotifyEvent;
@ -209,7 +210,7 @@ type
procedure CreateHandle; override;
procedure DestroyHandle; override;
procedure DrawItem(Index: Integer; Rect: TRect;
State: TCustomDrawItemState); virtual;
State: TOwnerDrawState); virtual;
procedure DoChange(var msg); message LM_CHANGED;
procedure Change; dynamic;
procedure Loaded; override;
@ -247,7 +248,7 @@ type
property MaxLength: integer read GetMaxLength write SetMaxLength default 0;
property OnChange: TNotifyEvent read FOnChange write FOnChange;
property OnCloseUp: TNotifyEvent read FOnCloseUp write FOnCloseUp;
property OnDrawItem: TCustomDrawItemEvent read FOnDrawItem write FOnDrawItem;
property OnDrawItem: TDrawItemEvent read FOnDrawItem write FOnDrawItem;
property OnDropDown: TNotifyEvent read FOnDropDown write FOnDropDown;
property OnMeasureItem: TMeasureItemEvent
read FOnMeasureItem write FOnMeasureItem;
@ -1315,6 +1316,9 @@ end.
{ =============================================================================
$Log$
Revision 1.52 2002/10/03 18:04:46 lazarus
MG: started customdrawitem
Revision 1.51 2002/10/03 14:47:30 lazarus
MG: added TComboBox.OnPopup+OnCloseUp+ItemWidth