Recent

Author Topic: If you're using nightlies or svn, here is a patch to fix the Object Inspector  (Read 4018 times)

obijohn

  • New member
  • *
  • Posts: 9
This has been bugging me for a while (pardon the pun). A patch to implement double-click behavior in the Object Inspector when another window has focus actually broke single-clicking on a Property with OS X/Carbon. When clicking on a Property, the value will unintentionally increment. This makes it virtually unusable to me, when designing an interface. The culprit is this procedure:
Code: [Select]
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)
    else if (FFirstClickTime<>0) and (Now-FFirstClickTime<(1/86400*0.4)) then
      ValueEditDblClick(Sender);
  end;
end;

The problem is that with Carbon the else if always gets called, sending a double-click even when a single-click is intended. So I put the else if inside a {$IFNDEF LCLCarbon} block, and now it works properly.

Please note: this is most likely a temporary fix. When I submitted this to the mailing list a couple of weeks ago, there was some talk that simply conditionally compiling around these two lines is probably not the best fix for this issue, as there is probably something wrong in the Carbon interface internals somewhere. However, until a better solution is found, this works and makes the Object Inspector actually usable again.

Also note that I had to rename the .patch extension to .txt in order to attach it here, but it is still a patch file.

That still leaves the "hidden buttons" bug to get fixed before the Object Inspector is truly working on Carbon again. But we're getting closer.

kamischi

  • Full Member
  • ***
  • Posts: 177
for what version is that?
fpc 2.6.4, lazarus 1.4.0, Mac OS X, fink

obijohn

  • New member
  • *
  • Posts: 9
for what version is that?

Svn trunk, beginning July of last year, and the new fixes_9_30 branch.

 

TinyPortal © 2005-2018