[Padre-dev] changing the caret

Heiko Jansen heiko_jansen at web.de
Sun Nov 16 02:52:09 PST 2008


> -----Ursprüngliche Nachricht-----
> Von: "Gabor Szabo" <szabgab at gmail.com>
> Gesendet: 15.11.08 18:51:47
> An: "Padre development discussion list" <padre-dev at perlide.org>
> Betreff: [Padre-dev] changing the caret


> Heiko or anyone else,
> 
> do you know how could I change the caret to be a full square on
> the current character?

I know how one would be supposed to do that:
$editor->SetCaretStyle(<int style>) with style = 0 (invisible), = 1 (line) 
and = 2 (block).

Unfortunately this is a feature introduced in Scintilla 1.74 so it's not 
yet available through released versions of wxWidgets.

Best you can do now is change the thickness of the line caret from 
the default 1px to (at most) 3px using
$editor->SetCaretWidth(<int pixel>)

Apart from wxStyledTextCtrl:

There is also a sample app "caret" in the wxWidgets distribution 
which shows a block caret.
But I don't really understand how one would integrate that in an app.
And it doesn't seem sensible to me to micro-manage the caret 
ourselves.

And one should be able to do 
wxCaret = wxWindow::GetCaret
wxCaret::SetSize(x, y)
However, in a (really short) short test I only got an undefined value back 
from GetCaret() when invoked on an editor. But I may have done 
something wrong.

hth
Heiko
_______________________________________________________________________
Jetzt neu! Schützen Sie Ihren PC mit McAfee und WEB.DE. 30 Tage
kostenlos testen. http://www.pc-sicherheit.web.de/startseite/?mc=022220



More information about the Padre-dev mailing list