mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 09:59:23 +02:00
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:
parent
e763403d49
commit
e69285d376
@ -741,6 +741,7 @@ begin
|
|||||||
Enabled:=false;
|
Enabled:=false;
|
||||||
SetBounds(0,-30,80,25); // hidden
|
SetBounds(0,-30,80,25); // hidden
|
||||||
Parent:=Self;
|
Parent:=Self;
|
||||||
|
Style := csOwnerDrawFixed;
|
||||||
OnMouseDown := @ValueControlMouseDown;
|
OnMouseDown := @ValueControlMouseDown;
|
||||||
OnMouseMove := @ValueControlMouseMove;
|
OnMouseMove := @ValueControlMouseMove;
|
||||||
OnDblClick := @ValueEditDblClick;
|
OnDblClick := @ValueEditDblClick;
|
||||||
|
@ -72,6 +72,16 @@ begin
|
|||||||
if LCLList=nil then
|
if LCLList=nil then
|
||||||
RaiseException('gtkListItemDrawAfterCB LCLList=nil');
|
RaiseException('gtkListItemDrawAfterCB LCLList=nil');
|
||||||
if [csDestroying,csLoading]*LCLList.Owner.ComponentState<>[] then exit;
|
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
|
// get itemindex and area
|
||||||
ItemIndex:=g_list_index(GtkList^.children,Data);
|
ItemIndex:=g_list_index(GtkList^.children,Data);
|
||||||
|
Loading…
Reference in New Issue
Block a user