Recent

Author Topic: LCL carbon widgets (bug or features?)  (Read 6451 times)

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
LCL carbon widgets (bug or features?)
« on: December 12, 2007, 05:30:23 pm »
Hello,

I'm writing both LCL based and native Carbon based MacOS applications using Lazarus. You guys're really cool to make such things cross-platform!

Anyway, here're the a few quetsions:
1. I can't paste a text into Memo, though it's done correctly for Edit! should i simply update carbon widget set?
(unfortunatelly, i don't have much time to look at the sources myself, so i simply 'emulate' the paste, by writing proper OnKeyUp event)
2. Does carbon widget set use HIView compositing engine, that is recommended by Apple for UI creation!

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: LCL carbon widgets (bug or features?)
« Reply #1 on: December 12, 2007, 06:32:07 pm »
Quote from: "skalogryyz"
1. I can't paste a text into Memo, though it's done correctly for Edit! should i simply update carbon widget set?
(unfortunatelly, i don't have much time to look at the sources myself, so i simply 'emulate' the paste, by writing proper OnKeyUp event)
2. Does carbon widget set use HIView compositing engine, that is recommended by Apple for UI creation!


Make sure you have the latest (this week) Carbon widgetset!

Take a look at the Carbon widgetset code: Lots of references to HIView.

Thanks.

-Phil

Tombo

  • New Member
  • *
  • Posts: 21
Re: LCL carbon widgets (bug or features?)
« Reply #2 on: December 12, 2007, 07:53:57 pm »
Quote from: "skalogryyz"
Hello,

I1. I can't paste a text into Memo, though it's done correctly for Edit! should i simply update carbon widget set?
(unfortunatelly, i don't have much time to look at the sources myself, so i simply 'emulate' the paste, by writing proper OnKeyUp event)


Memo is implemented via MLTE HITextView and I did not find a way how to enable paste commands. If you know how to do it, please let me know.

Quote from: "skalogryyz"
2. Does carbon widget set use HIView compositing engine, that is recommended by Apple for UI creation!


Yes, I hope. It is set as option bit in window creation.

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: LCL carbon widgets (bug or features?)
« Reply #3 on: December 13, 2007, 01:04:24 pm »
Thanks for the quick response

Quote from: "Tombo"

Memo is implemented via MLTE HITextView and I did not find a way how to enable paste commands. If you know how to do it, please let me know.


this code creates a HIViewText and adds it to the main window. (The window is created using Nib service, not LCL). copy/paste commands are working by default.  
Is it possible that LCL somehow blocks Paste events? (kEventServicePaste)
 :?
Code: [Select]

var
  cg : HIRect;
  hi  : HIViewRef;
begin
  cg.origin.x := 10;
  cg.origin.y := 200;
  cg.size.width := 300;
  cg.size.height := 200;
  HITextViewCreate(@cg, 0, 0, hitxt);
  HIViewAddSubview(mainwnd.ClientRef, hitxt);
  HIViewSetVisible(hitxt, true);
end;

another interesting thing, is that Memo.PasteFromClipboard works perfectly, event better than original carbon.
I can't paste text from native MacOS applications to X11 Lazarus (i think i've seen the solution for this is given somethere in the Lazarus wiki).
But .PasteFromClipboard clearly understands the X11 clipboard.

anyway, the correct answer lies somethere in the carbon widgetset sources. And downloading newer version!
Thanks! Gone studing and updating.

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
LCL carbon widgets (bug or features?)
« Reply #4 on: December 18, 2007, 01:06:21 pm »
carbon widgets seem to act, as expected in MacOS;

i mean, that MouseMove event is not called for some carbon-based controls (like Memo) then left moust button is down.
it's quite predictable, due to win32 incompatible mouse tracking mechanism.

it's not a problem, but can break cross-platform sometimes.
is there any way to solve it?

 

TinyPortal © 2005-2018