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++ » [solved] Next CodeEditor misery: selecting highlighted text colors does not work
[solved] Next CodeEditor misery: selecting highlighted text colors does not work [message #46443] Wed, 11 May 2016 13:09 Go to next message
cbpporter is currently offline  cbpporter
Messages: 1401
Registered: September 2007
Ultimate Contributor
I have an IDE inspired syntax highlight colors dialog and I'm using a straightforward colors table of ints to store the index of the colors I want to edit.

I'm using basically the same code from ide/Setup.cpp:

for(int i = 0; i < colors.GetCount(); i++) {
			int j = colors[i];
			editor.SetHlStyle(j, hlt.hlstyle.Get(i, 1), hlt.hlstyle.Get(i, 2),
			                     hlt.hlstyle.Get(i, 3), hlt.hlstyle.Get(i, 4));
			//if (i == 2 || i == 3)
			//	editor.SetColor(i, hlt.hlstyle.Get(i, 1));
		}


All colors work except for index 2 and 3, which are the selected text ink and paper. Even setting them directly with a hardcoded value does not work for me and they are always white on blue.

Uncommenting the two commented lines as a hack works, but this causes the lower portion of CodeEditor, the region under the text, to be highlighted as selected.

I'll continue to investigate this very strange issue.

PS: I found a bunch of bugs with using underlined styles with highlighting. I'll see if I can find some fixes.

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

Report message to a moderator

Re: Next CodeEditor misery: selecting highlighted text colors does not work [message #46454 is a reply to message #46443] Thu, 12 May 2016 11:10 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1401
Registered: September 2007
Ultimate Contributor
Still investigating, but created a test case using 9394. I can't run it with the latest U++ because of the C++11 stuff.

editor1.SetHlStyle(HighlightSetup::INK_SELECTED, Red);


This is the problematic line. Colors for selected text doesn't work.

  • Attachment: testce.zip
    (Size: 1.75KB, Downloaded 184 times)
Re: Next CodeEditor misery: selecting highlighted text colors does not work [message #46667 is a reply to message #46454] Mon, 27 June 2016 17:31 Go to previous message
cbpporter is currently offline  cbpporter
Messages: 1401
Registered: September 2007
Ultimate Contributor
Issue solved.

The problem was that CodeEditor needs to re-highlight the entire text in order for this change to take effect. Somehow the other option changes were triggering a re-highlight or something similar, but not the selected text. Not 100% sure what the real problem was, but calling Highlight after setting all the styles fixed this.
Previous Topic: Global namespace object's properties
Next Topic: Questions about CodeEditor
Goto Forum:
  


Current Time: Thu Mar 28 10:26:44 CET 2024

Total time taken to generate the page: 0.01593 seconds