User forums > General (but related to Code::Blocks)

Strange cursor position with wx3.0.2 (scintilla)

<< < (3/7) > >>

oBFusCATed:
No time at the moment. I'm concentrated on fixing all the asserts that come up with wx30.

headkase:

--- Quote from: jens on December 20, 2015, 07:37:55 pm ---
--- Quote from: oBFusCATed on December 20, 2015, 05:45:27 pm ---Morten: Please try wx3.0 or wx-master branch, if possible. The reported problem is with wx3.0.2.

--- End quote ---
The thread-title is soewhat misleading in this case.

--- End quote ---

Please feel free to split the thread - a simple observation on my part spawned an entire new branch.  ;)

mageia:
yes,wx3.02 the cursor is weird,select text hilight area is not what i select,also is because get the wrong cursor position?

ollydbg:

--- Quote from: MortenMacFly on December 20, 2015, 08:25:02 pm ---
--- Quote from: oBFusCATed on December 20, 2015, 05:45:27 pm ---Morten: Please try wx3.0 or wx-master branch, if possible. The reported problem is with wx3.0.2.

--- End quote ---
Yes, on wx3.0.2 it shows the effect. However, we should not seriously try to fix it in trunk. Instead, we should focus and fix the scintilla branch. I am still trying to get it working but so far I didn't have enough time to finish. We lack behind many versions already and there have been massive fundamental changes in the architecture of scintilla. So give it a try, if you like:
https://svn.code.sf.net/p/codeblocks/code/branches/scintilla_3_6_x

--- End quote ---
A patch to fix the build error:

--- Code: --- src/CodeBlocks_wx30.cbp | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/src/CodeBlocks_wx30.cbp b/src/CodeBlocks_wx30.cbp
index 263249e..d98b603 100644
--- a/src/CodeBlocks_wx30.cbp
+++ b/src/CodeBlocks_wx30.cbp
@@ -3416,6 +3416,9 @@
  <Unit filename="sdk/wxscintilla/src/scintilla/lexers/LexBasic.cxx">
  <Option target="scintilla" />
  </Unit>
+ <Unit filename="sdk/wxscintilla/src/scintilla/lexers/LexBatch.cxx">
+ <Option target="scintilla" />
+ </Unit>
  <Unit filename="sdk/wxscintilla/src/scintilla/lexers/LexBibTeX.cxx">
  <Option target="scintilla" />
  </Unit>
@@ -3461,6 +3464,9 @@
  <Unit filename="sdk/wxscintilla/src/scintilla/lexers/LexDMIS.cxx">
  <Option target="scintilla" />
  </Unit>
+ <Unit filename="sdk/wxscintilla/src/scintilla/lexers/LexDiff.cxx">
+ <Option target="scintilla" />
+ </Unit>
  <Unit filename="sdk/wxscintilla/src/scintilla/lexers/LexECL.cxx">
  <Option target="scintilla" />
  </Unit>
@@ -3473,6 +3479,9 @@
  <Unit filename="sdk/wxscintilla/src/scintilla/lexers/LexErlang.cxx">
  <Option target="scintilla" />
  </Unit>
+ <Unit filename="sdk/wxscintilla/src/scintilla/lexers/LexErrorList.cxx">
+ <Option target="scintilla" />
+ </Unit>
  <Unit filename="sdk/wxscintilla/src/scintilla/lexers/LexFlagship.cxx">
  <Option target="scintilla" />
  </Unit>
@@ -3530,6 +3539,9 @@
  <Unit filename="sdk/wxscintilla/src/scintilla/lexers/LexMagik.cxx">
  <Option target="scintilla" />
  </Unit>
+ <Unit filename="sdk/wxscintilla/src/scintilla/lexers/LexMake.cxx">
+ <Option target="scintilla" />
+ </Unit>
  <Unit filename="sdk/wxscintilla/src/scintilla/lexers/LexMarkdown.cxx">
  <Option target="scintilla" />
  </Unit>
@@ -3551,13 +3563,13 @@
  <Unit filename="sdk/wxscintilla/src/scintilla/lexers/LexNsis.cxx">
  <Option target="scintilla" />
  </Unit>
- <Unit filename="sdk/wxscintilla/src/scintilla/lexers/LexOScript.cxx">
+ <Unit filename="sdk/wxscintilla/src/scintilla/lexers/LexNull.cxx">
  <Option target="scintilla" />
  </Unit>
- <Unit filename="sdk/wxscintilla/src/scintilla/lexers/LexOpal.cxx">
+ <Unit filename="sdk/wxscintilla/src/scintilla/lexers/LexOScript.cxx">
  <Option target="scintilla" />
  </Unit>
- <Unit filename="sdk/wxscintilla/src/scintilla/lexers/LexOthers.cxx">
+ <Unit filename="sdk/wxscintilla/src/scintilla/lexers/LexOpal.cxx">
  <Option target="scintilla" />
  </Unit>
  <Unit filename="sdk/wxscintilla/src/scintilla/lexers/LexPB.cxx">
@@ -3590,6 +3602,9 @@
  <Unit filename="sdk/wxscintilla/src/scintilla/lexers/LexProgress.cxx">
  <Option target="scintilla" />
  </Unit>
+ <Unit filename="sdk/wxscintilla/src/scintilla/lexers/LexProps.cxx">
+ <Option target="scintilla" />
+ </Unit>
  <Unit filename="sdk/wxscintilla/src/scintilla/lexers/LexPython.cxx">
  <Option target="scintilla" />
  </Unit>

--- End code ---

ollydbg:
When debug the scintilla branch with wx 3.02 under windows, I noticed that when an editor opened by the statement:


--- Code: ---m_pControl->InsertText(0, enc.GetWxStr());

--- End code ---


--- Code: --- case SCI_INSERTTEXT: {
if (lParam == 0)
return 0;
int insertPos = static_cast<int>(wParam);
if (static_cast<int>(wParam) == -1)
insertPos = CurrentPosition();
int newCurrent = CurrentPosition();
char *sz = CharPtrFromSPtr(lParam);
const int lengthInserted = pdoc->InsertString(insertPos, sz, istrlen(sz));
if (newCurrent > insertPos)
newCurrent += lengthInserted;
SetEmptySelection(newCurrent);
return 0;
}

--- End code ---
And I see that the null terminated string is needed, but when debugging, I see we pass a string with out the null at the end.
This gives the screen shot:

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version