On Thu, Feb 24, 2011 at 7:38 AM, Marc Weustink <span dir="ltr"><<a href="mailto:marc.weustink@cuperus.nl">marc.weustink@cuperus.nl</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">zeljko wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Thursday 24 of February 2011 06:25:08 John Stoneham wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
procedure TOICustomPropertyGrid.ValueComboBoxMouseUp(Sender: TObject;<br>
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);<br>
begin<br>
if (Button=mbLeft) then begin<br>
if (Shift=[ssCtrl,ssLeft]) then<br>
DoCallEdit(oiqeShowValue)<br>
{$IFNDEF LCLCarbon}<br>
else if (FFirstClickTime<>0) and (Now-FFirstClickTime<(1/86400*0.4))<br>
then<br>
ValueEditDblClick(Sender);<br>
{$ENDIF}<br>
end;<br>
end;<br>
</blockquote>
<br>
No, there shouldn't be any LCLXXX ifdef inside LCL or IDE , there must be<br>
other way to fix this.<br>
</blockquote>
<br></div>
The question is, why is this code there in the first place. It looks like a LCL workaround for a missing dblckick event.<br></blockquote><div><br></div><div>I've tracked down where that code was added, and it was submitted as a patch to fix bug 15956 (where double-clicking on a property when the object inspector didn't have focus would still increment the property). I will have to say, though, that this really doesn't sound like a bug to me. If a window doesn't have focus, the first click gives it focus and that sounds like normal behavior. So it seems this patch is trying to add a custom even handler to get a convenience feature. I believe it works as intended for gtk2 and perhaps qt, but not carbon -- in fact it totally breaks the object inspector under carbon.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
IMO, the ifndeffed code should be removed and it should be handled in the dblclick event handler. The broken platforms should be fixed.<br><font class="Apple-style-span" color="#888888"><br></font></blockquote></div><div>
<br></div><div>Agreed. I believe the patch added to fix bug 15956 in revision 26493 should be completely removed and any code added to implement the behavior mentioned above should be done in the event handlers. There are a couple of places in objectinspector.pp where a value is assigned to FFirstClickTime, but that variable is only used in the code I ifndeffed out, so those should be removed as well. Basically, everything added by the patch for bug 15956 should be removed.</div>
<div><br></div><br>-- <br>John<br>