GetLineMarksManager should be public? |
Post Reply |
Author | |
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
Posted: 11 May 2007 at 3:43pm |
Hi,
I was trying to implement a "Remove all breakpoints"-function. This was my first attempt:
for (int i = 1; i <= GetEditCtrl().GetRowCount(); i++)
GetEditCtrl().DeleteBreakpoint(i); However, that yields a crash in CArray due to an index value of -1. I think this is a bug:
void CXTPSyntaxEditLineMarksManager::CLineMarksList::Remove(const int nKey)
{ int nIndex = FindIndex(nKey); // BUG? if (nKey >= 0) if (nIndex >= 0) // This seems more logical :)
...
} Wouldn't it be better if GetLineMarksManager() was public or at least protected? In this case, it seems hard to fix the above without recompiling the source code. Calling HasRowMark(...) before the deletion solves it, but then you need to redraw the line marks. You cannot do this with RedrawLineMarks() since it is protected. Anyway, this is how I solved it:
for (int i = 1; i <= GetEditCtrl().GetRowCount(); i++)
{ if (GetEditCtrl().HasRowMark(i, xtpEditLMT_Breakpoint)) GetEditCtrl().DeleteBreakpoint(i); } GetEditCtrl().Invalidate(); |
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
Noticed another problem. The constructor of CXTPSyntaxEditPaintManager is protected. Hence, it is impossible to change the coloring of the syntax edit. For instance, I want to override CXTPSyntaxEditPaintManager::DrawLineMark. A possible solution is to make the constructor public and then add a CXTPSyntaxEditPaintManager-pointer in the edit control. Then you could add a method such as this:GetEditCtrl().SetSyntaxEditPaintManager(new CMySyntaxPaintMgr());
If the pointer is not set, then you call XTPSyntaxEditPaintManager() to get the default coloring.
|
|
kstowell
Admin Group Joined: 25 January 2003 Location: MIchigan, USA Status: Offline Points: 496 |
Post Options
Thanks(0)
|
Thanks for your suggestions, we are looking into the problems and should have them corrected with the next product release.
Cheers, |
|
Kirk Stowell, President and CEO
CODEJOCK SOFTWARE SOLUTIONS< |
|
AndreiM
Moderator Group Joined: 18 August 2007 Status: Offline Points: 132 |
Post Options
Thanks(0)
|
These changes will be included to 11.2.1 release:
1. FIXED
2. GetLineMarksManager() will be public.
3. The constructor of CXTPSyntaxEditPaintManager will be public, DrawLineMark will be virtual.
Get/SetPaintManaget methods will be added. |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |