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 » Community » U++ community news and announcements » EditField highlighting/visual improvements
EditField highlighting/visual improvements [message #39551] Fri, 29 March 2013 09:42
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
EditField::ShowSpaces displays faint blue dots to indicate spaces.

EditField::Hightlight structure now has 'Color underline' field.

Callback EditField::WhenHighlight allows to add highlighting to EditField.

Example adding spell-checking to EditField:

void DoSpellCheck(Vector<EditField::Highlight>& hl, EditField *ef)
{
	WString s = ef->GetText();
	int i = 0;
	while(i < hl.GetCount()) {
		while(i < hl.GetCount() && s[i] == ' ')
			i++;
		bool wrd = true;
		int ii = i;
		WString w;
		while(i < hl.GetCount() && s[i] != ' ') {
			if(IsLetter(s[i]))
				w.Cat(s[i]);
			else
				wrd = false;
			i++;
		}
		if(wrd && w.GetCount() > 1 && !SpellWord(w, LNG_('E','N','U','S')))
			while(ii < i)
				hl[ii++].underline = LtRed();
	}
}

void SpellChecked(EditField& s)
{
	s.WhenHighlight = callback1(DoSpellCheck, &s);
}

Previous Topic: GLCtrl implemented for Gtk backend
Next Topic: InVector commited
Goto Forum:
  


Current Time: Fri Mar 29 14:17:30 CET 2024

Total time taken to generate the page: 0.01007 seconds