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 » Newbie corner » GridCtrl + rich texts
Re: GridCtrl + rich texts [message #50396 is a reply to message #50395] Mon, 15 October 2018 11:43 Go to previous messageGo to previous message
deep is currently offline  deep
Messages: 263
Registered: July 2011
Location: Bangalore
Experienced Member
Hi
I have done this. Which is working for me for GridCtrl.

It is not elegant but working.

Color in QFT must be given as "[@(nn.nn.nn) " or "[$(nn.nn.nn) "

class Gridqtfdisplay : public GridDisplay
{

	public:
		virtual void Paint ( Draw& w, int x, int y, int cx, int cy, const Value& val, dword style,
				Color& fg, Color& bg, Font& fnt, bool found, int fs, int fe )
		{
			String s;
			s = val;
			RegExp r1 ( "(\\[([\\@\\$])\\((\\d+)\\.(\\d+)\\.(\\d+)\\))", RegExp::UNICODE );

			while ( r1.GlobalMatch ( s ) )
			{

				if ( r1[1] == "@" )
					fg = Color ( StrInt ( r1[2] ), StrInt ( r1[3] ), StrInt ( r1[4] ) );

				if ( r1[1] == "$" )
					bg = Color ( StrInt ( r1[2] ), StrInt ( r1[3] ), StrInt ( r1[4] ) );
			}

			QTFDisplay().Paint ( w, RectC ( x, y, cx, cy ), val, fg, bg, style );
		}
};


Warm Regards

Deepak
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: MoveableAndDeepCopyOption inherite to use a VectorMap ?
Next Topic: Adjusting the Z order of a dialog window?
Goto Forum:
  


Current Time: Thu Apr 25 23:43:14 CEST 2024

Total time taken to generate the page: 0.04060 seconds