0

When I push button or key i modyfy a text inside wxTextCtrl. For example I read line and meyby modyfing it or put it on the bottom of text.

How propertly read ascii text from current position and modyfing it not using disc.

How determining which line i must read trought GetLineText(nr). where i can find this nr?

  • what version of wx? OS/toolkit? Did you look at the samples/docs? – Igor Nov 04 '17 at 17:43
  • @Igor I'm using last version on Mac , Linux and Windows. Yes, I look sample. But on sample no exist any example of this. Only read/insert on whole document. Not specyfic line. How determining which line I am? – Marek Kaski Nov 04 '17 at 18:30
  • how read m_curCol ? – Marek Kaski Nov 04 '17 at 21:28
  • did you try GetInsertionPoint()? It is available for wxTextCtrl. The documentation gives the sample code on using the function. – Igor Nov 04 '17 at 22:49
  • yes, not working long line, column, pos = GetInsertionPoint(); PositionToXY(pos, &column, &line); wxPrintf(wxT("%ld(%ld,%ld)/%d: [%s]\n"),pos,line,column, GetNumberOfLines(),GetLineText(line)); I get >7(140732714745280,4513249792)/5: [] – Marek Kaski Nov 06 '17 at 13:31
  • how long is the big line? 100 chars? 1000 chars? Where is the cursor at the time of the call? At the end? Middle? Do you have a sample or a patch to the text sample? Can you upload it here so I can test it? Thx. – Igor Nov 06 '17 at 14:20
  • I have only 4 chars in one line. This is whole document in example. And this is show GetInsertionPoint() – Marek Kaski Nov 06 '17 at 18:13
  • `text` sample has a demo on how to use the `GetInsertionPoint()`. Does it work for you? If not - which OS is failing? In a sample you just press F1 and the message box will display the info. Please try all 3 major platforms with the sample and report back. Thx. – Igor Nov 06 '17 at 18:33
  • use vmachine why You ask me if You not belive me? – Marek Kaski Nov 08 '17 at 11:42

1 Answers1

1

m_curCol is private, You dont using it.

GetInsertionPoint() is usefull but not working on MacOsX now. Meybe in future.

Marko Lustro
  • 173
  • 1
  • 10
  • documentation doesn't mention anything about OSX restrictions. Which version of the library you are using? – Igor Nov 06 '17 at 18:34
  • @Igor PositionToXY() always returns FALSE on wxMac at least in 2.4.2. This function is not implemented on that platform. PositionToXY()/XYToPosition() also is not implemented on wxMac 2.6.3 and 2.8.0 https://wiki.wxwidgets.org/WxTextCtrl – Marko Lustro Nov 07 '17 at 15:00
  • I checked the HEAD docs. But yes - you are correct. There was a recent patch applied with the proper implementation. It will probably be backported to 3.0 by the time it will be 3.0.3. – Igor Nov 07 '17 at 15:34