[DEVELOPMENT ENVIRONMENT]

* BUG: Correctly initialize the "Show Tooltip" option when displaying the 
  preferences dialog.

[GB.QT.EXT]
* BUG: Editor.PosToColumn() correctly detects if the position if after the 
  end of the line now.


git-svn-id: svn://localhost/gambas/trunk@2281 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
Benoît Minisini 2009-08-28 15:12:22 +00:00
parent ccf2a2c99f
commit 5995c33772
2 changed files with 5 additions and 3 deletions

View file

@ -76,6 +76,7 @@ Public Sub _new()
[cmbFoldProc, "/Editor/Fold", 0],
[txtRecent, "/Recent/Max", Project.DEFAULT_MAX_RECENT],
[cmbOutput, "/QuietExternalCommands", 0],
[cmbTooltip, "/ShowTooltip", 0],
[cmbIntegratedHelp, "/PropertyHelp", 1],
[cmbMinimize, "/MinimizeOnRun", 0],
[cmbUpperCaseKeywords, "/Editor/KeywordsUseUpperCase", 0]]

View file

@ -1427,8 +1427,6 @@ int GEditor::posToColumn(int y, int px)
if (px < margin || px >= visibleWidth())
_posOutside = true;
else
_posOutside = false;
if (len == 0)
return 0;
@ -1462,6 +1460,7 @@ int GEditor::posToColumn(int y, int px)
break;
}
_posOutside = d > len;
return d;
}
@ -1485,15 +1484,17 @@ int GEditor::posToLine(int py)
bool GEditor::posToCursor(int px, int py, int *y, int *x)
{
int nx, ny;
bool outside;
ny = posToLine(py);
outside = _posOutside;
nx = posToColumn(ny, px);
nx = QMAX(0, QMIN(nx, lineLength(ny)));
*y = ny;
*x = nx;
return _posOutside;
return outside || _posOutside;
}
void GEditor::cursorToPos(int y, int x, int *px, int *py)