Recent

Author Topic: lclintf.caret not shown in Linux  (Read 5636 times)

Martin V

  • Full Member
  • ***
  • Posts: 139
lclintf.caret not shown in Linux
« on: June 14, 2010, 09:19:07 am »
Hello,

has anyone successfully used the lclintf caret implementation in Linux? (A caret is a blinking cursor.) A simple test program based on a simple form with two buttons for creating and destroying a caret is this:

Code: [Select]
procedure TForm1.Button1Click(Sender: TObject);
begin
  lclintf.CreateCaret(Handle,0,15,5);
  lclintf.SetCaretPosEx(Handle,150,100);
  // alternatively  lclintf.SetCaretPos (150,100);
  lclintf.ShowCaret(Handle);
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  lclintf.HideCaret(Handle);
  lclintf.DestroyCaret(Handle);
end;

In Win32, the code works fine, in MacOSX, it also works, but in Linux (Ubuntu), the caret is not shown.

P.S. In MacOSX, it seems that the Y coordinate in SetCaretPos has to be ClientHeight-Y, I will report that in the bugtracker.

Martin

Martin V

  • Full Member
  • ***
  • Posts: 139
Re: lclintf.caret not shown in Linux
« Reply #1 on: June 18, 2010, 12:34:37 am »
I have reported the bug in the bugtracker now and will report the results here later.

Martin

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2590
Re: lclintf.caret not shown in Linux
« Reply #2 on: June 21, 2010, 01:29:06 am »
The caret is a special "thing" on gtk and needs to be handled on a per widget basis. So it won't set a caret on any random widget.
(since a form doesn't have a caret natively, chances are low that it will be implemented, unless somebody provides a patch)
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

Martin V

  • Full Member
  • ***
  • Posts: 139
Re: lclintf.caret not shown in Linux
« Reply #3 on: June 22, 2010, 02:27:05 am »
Hello,

I got feedback (bugtracker 0016746) and the result is, that in gtk2 the Caret does not accept a tForm where it resides. A tCustomControl with Align := alClient fills the whole form client area and this object can store the Caret which works fine there.

The Y coordinate problem was a false alarm, I had an additional conversion in my program which produced the false Y values.

Martin

 

TinyPortal © 2005-2018