SetInsertionPoint() does not funzion  [SOLVED]

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Berico3
Earned a small fee
Earned a small fee
Posts: 15
Joined: Mon Sep 17, 2007 5:43 am
Location: Italy

SetInsertionPoint() does not funzion  [SOLVED]

Postby Berico3 » Tue Feb 14, 2012 1:24 pm

Hello everyone,
I'm using the libraries wx2.8 on WindowsXP debian6.0 on linux, in a wxTextCtrl flag MULTYLINE I have to move inside the box and I thought of using SetInsertionPoint ().
Once completed, however, does not give me no errors, but the insertion point of the text does not move, still at the beginning of the first line, thus:

Code: Select all

wxTextCtrl *testo = new  wxTextCtrl(this, TESTO, _T(""),  wxDefaultPosition, wxDefaultSize,wxTE_MULTILINE );
testo -> SetInsertionPoint(100);
testo -> WriteText(_T("Test"));

It is I who is wrong?
Thanks to those who respond
OS: Windows XP Pro & Debiam Linux COMPILER: MingW, Version: wxWidgets 2.8.0, IDE: wx-Devcpp

PB
Part Of The Furniture
Part Of The Furniture
Posts: 1584
Joined: Sun Jan 03, 2010 5:45 pm

Re: SetInsertionPoint() does not funzion

Postby PB » Tue Feb 14, 2012 1:41 pm

I believe that the insertion point can not be greater than the value returned by wxTextCtrl::GetLastPosition(), which in your case is 0 ( testo is empty).

Berico3
Earned a small fee
Earned a small fee
Posts: 15
Joined: Mon Sep 17, 2007 5:43 am
Location: Italy

Re: SetInsertionPoint() does not funzion

Postby Berico3 » Tue Feb 14, 2012 3:55 pm

thanks PB,
I had already made ​​some tests, but did not work.
After your answer I tried again, obviously I was wrong.
SetInsertionPoint can only move inside the text buffer.
OS: Windows XP Pro & Debiam Linux COMPILER: MingW, Version: wxWidgets 2.8.0, IDE: wx-Devcpp


Return to “C++ Development”

Who is online

Users browsing this forum: No registered users and 7 guests