[Lazarus] Can someone with commit privileges submit this fix?

John Stoneham captnjameskirk at gmail.com
Thu Feb 24 15:01:00 CET 2011


On Thu, Feb 24, 2011 at 7:38 AM, Marc Weustink <marc.weustink at cuperus.nl>wrote:

> zeljko wrote:
>
>> On Thursday 24 of February 2011 06:25:08 John Stoneham wrote:
>>
>>  procedure TOICustomPropertyGrid.ValueComboBoxMouseUp(Sender: TObject;
>>>   Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
>>> begin
>>>   if (Button=mbLeft) then begin
>>>     if (Shift=[ssCtrl,ssLeft]) then
>>>       DoCallEdit(oiqeShowValue)
>>>     {$IFNDEF LCLCarbon}
>>>     else if (FFirstClickTime<>0) and (Now-FFirstClickTime<(1/86400*0.4))
>>> then
>>>       ValueEditDblClick(Sender);
>>>     {$ENDIF}
>>>   end;
>>> end;
>>>
>>
>> No, there shouldn't be any LCLXXX ifdef inside LCL or IDE , there must be
>> other way to fix this.
>>
>
> The question is, why is this code there in the first place. It looks like a
> LCL workaround for a missing dblckick event.
>

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.


>
> IMO, the ifndeffed code should be removed and it should be handled in the
> dblclick event handler. The broken platforms should be fixed.
>
>
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.


-- 
John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20110224/235a312a/attachment-0003.html>


More information about the Lazarus mailing list