gtk: only ownerdraw lists receive OnDrawItem (bug #910), windows: enable listbox with color in objectinspector

git-svn-id: trunk@8137 -
This commit is contained in:
jesus 2005-11-11 21:54:34 +00:00
parent e763403d49
commit e69285d376
2 changed files with 11 additions and 0 deletions

View File

@ -741,6 +741,7 @@ begin
Enabled:=false;
SetBounds(0,-30,80,25); // hidden
Parent:=Self;
Style := csOwnerDrawFixed;
OnMouseDown := @ValueControlMouseDown;
OnMouseMove := @ValueControlMouseMove;
OnDblClick := @ValueEditDblClick;

View File

@ -72,6 +72,16 @@ begin
if LCLList=nil then
RaiseException('gtkListItemDrawAfterCB LCLList=nil');
if [csDestroying,csLoading]*LCLList.Owner.ComponentState<>[] then exit;
// only owner draw lists are interested in drawing items themselves.
//if not (csDesigning in LCLList.Owner.ComponentState) then begin
if LclList.Owner is TCustomListbox then
if TCustomListbox(LCLList.Owner).Style = lbStandard then
exit;
if LclList.Owner is TCustomCombobox then
if TCustomCombobox(LclList.Owner).Style < csOwnerDrawFixed then
exit;
//end;
// get itemindex and area
ItemIndex:=g_list_index(GtkList^.children,Data);