Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ TheIDE » U++ TheIDE: CodeEditor, Assist++, Topic++ » A small issue with CodeEditor
A small issue with CodeEditor [message #46056] Thu, 25 February 2016 13:55 Go to next message
cbpporter is currently offline  cbpporter
Messages: 1401
Registered: September 2007
Ultimate Contributor
Just adding a CodeEditor to a window and setting line numbers and edit marks to true makes the edit mark be displayed over the line numbers.

This happens in all samples, except TheIDE, which somehow fixes this. I was not yet able to track down the issue but I'm investigating it.

I attached a simple test case. Just type something in the editor and the blue mark will be placed upon the "1" in line 1.
  • Attachment: testce.zip
    (Size: 1.42KB, Downloaded 224 times)
Re: A small issue with CodeEditor [message #46062 is a reply to message #46056] Fri, 26 February 2016 14:06 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1401
Registered: September 2007
Ultimate Contributor
OK, this is very weird. Te out of the box EditorBar positioning is not the way it appears in TheIDE and based on the code I don't know how it could.

But here is what I found to work really good:
if(line_numbers && i < editor->GetLineCount()) {
			String n = AsString((i + 1) % 1000000);
			Font fnt = editor->GetFont();
			Size tsz = GetTextSize(n, fnt);
			w.DrawText(sz.cx + 1 + CodeEditorImg::Breakpoint().GetWidth() - Zx(4 + 12) - tsz.cx - annotations, y + (fy - tsz.cy) / 2, n, fnt, Brown);
		}


The DrawText line is the only one I changed.

I still have this weird empty line at the end of the CodeEditor, like in the attached image.

index.php?t=getfile&id=4948&private=0
  • Attachment: ce.png
    (Size: 56.82KB, Downloaded 579 times)
Re: A small issue with CodeEditor [message #46063 is a reply to message #46062] Fri, 26 February 2016 14:53 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1401
Registered: September 2007
Ultimate Contributor
Also, could we get this added to TabBar?

void AddFrameToScroolBar(CtrlFrame& fr) 				{ sc.AddFrame(fr); }


I need to add frames to that little scrollbar.
Re: A small issue with CodeEditor [message #46065 is a reply to message #46063] Fri, 26 February 2016 21:49 Go to previous messageGo to next message
Klugier is currently offline  Klugier
Messages: 1075
Registered: September 2012
Location: Poland, Kraków
Senior Contributor
Hello cppborder,

I think we also put breakpoint in the wrong place. Please notice that it overlaps age information. In addition client programmer should have ability to turn off annotations and breakpoints.

For the firs issue I posted diff that adds age_width parameter to EditorBar and use it in draw method and size synchronization.

EDIT: DIFF deleted due to destroying annotations.

Sincerely,
Klugier


U++ - one framework to rule them all.

[Updated on: Sat, 27 February 2016 14:16]

Report message to a moderator

Re: A small issue with CodeEditor [message #46066 is a reply to message #46065] Sat, 27 February 2016 03:01 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1401
Registered: September 2007
Ultimate Contributor
Hi Klugier,

I noticed that too, but I think it is perfectly fine for breakpoints to overlap the age block. Breakpoints are transitory and usually don't hang around a lot, that's why I didn't feel like having them overlay is a problem.

Aren't annotations off until you add them?

Right now I'm working on a mini code outline, like in Sublime text on the right in the image: http://www.tecmint.com/wp-content/uploads/2013/09/Sublime-Te xt-3.png
Re: A small issue with CodeEditor [message #46067 is a reply to message #46066] Sat, 27 February 2016 20:53 Go to previous messageGo to next message
Klugier is currently offline  Klugier
Messages: 1075
Registered: September 2012
Location: Poland, Kraków
Senior Contributor
Hello cbpporter,

OK. Breakpoint can stay as it is, but we should have option to disable it. I think for app that only allows editing code this function is not necessary. So we should introduce function like "DebugerInterface(bool b);". What do you think?

Quote:

Aren't annotations off until you add them?

Right, annotations size is set by default to zero (look at EditorBar constructor). If you want to enable it you will probably need to use following method of EditorBar (CodeEditor/EditorBar.cpp):
void EditorBar::Annotations(int width)
{
	annotations = width;
	SyncSize();
}


Quote:

Right now I'm working on a mini code outline, like in Sublime text on the right in the image: http://www.tecmint.com/wp-content/uploads/2013/09/Sublime-Te xt-3.png

I wish we have separate code editor app outside TheIDE - maybe "U++ Edit" Smile. Please notice that U++ code editor is super fast. In my opinion it works better than other tools like notepad++.

Sincerely,
Klugier


U++ - one framework to rule them all.

[Updated on: Sat, 27 February 2016 20:54]

Report message to a moderator

Re: A small issue with CodeEditor [message #46090 is a reply to message #46067] Thu, 03 March 2016 10:43 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1401
Registered: September 2007
Ultimate Contributor
I did some progress with the preview but won't have time to finish it this release, so I'll hit it up again for next release.

As for breakpoints, if CodeEditor is wished to have the breakpoints optional, I can update the bar drawing to take this into account and post the code.
Re: A small issue with CodeEditor [message #46109 is a reply to message #46056] Tue, 08 March 2016 16:30 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1401
Registered: September 2007
Ultimate Contributor
How about this?
  • Attachment: ce1.png
    (Size: 53.63KB, Downloaded 259 times)
Re: A small issue with CodeEditor [message #46110 is a reply to message #46056] Tue, 08 March 2016 16:31 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1401
Registered: September 2007
Ultimate Contributor
One image per post limit!
  • Attachment: ce2.png
    (Size: 48.65KB, Downloaded 231 times)
Re: A small issue with CodeEditor [message #46111 is a reply to message #46056] Tue, 08 March 2016 16:32 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1401
Registered: September 2007
Ultimate Contributor
And you can only post once 45 seconds? Do we get so many floods?

  • Attachment: ce3.png
    (Size: 48.48KB, Downloaded 235 times)

[Updated on: Tue, 03 January 2017 11:51]

Report message to a moderator

Re: A small issue with CodeEditor [message #46112 is a reply to message #46056] Tue, 08 March 2016 16:34 Go to previous message
cbpporter is currently offline  cbpporter
Messages: 1401
Registered: September 2007
Ultimate Contributor
Last one!
  • Attachment: ce4.png
    (Size: 48.42KB, Downloaded 239 times)
Previous Topic: [FIXED] the menu Assist/THISBACKs.. (Alt + T) does not work
Next Topic: Crash TheIde when #include line is empty
Goto Forum:
  


Current Time: Thu Mar 28 11:45:34 CET 2024

Total time taken to generate the page: 0.01317 seconds