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 #36982 is a reply to message #36973] Fri, 03 August 2012 21:39 Go to previous messageGo to previous message
Sender Ghost is currently offline  Sender Ghost
Messages: 301
Registered: November 2008
Senior Member
Hello, Matteo.
idkfa46 wrote on Thu, 02 August 2012 14:29

Is it possibile to active QTF format inside GridCtrl grid?

Yes, it's possible to create special GridQTFDisplay class (inherited from GridDisplay), which uses QTFDisplay Paint function.

index.php?t=getfile&id=3823&private=0

#include <GridCtrl/GridCtrl.h>
#include <RichText/RichText.h>

using namespace Upp;

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)
	{
		QTFDisplay().Paint(w, RectC(x, y, cx, cy), val, fg, bg, style);
	}
};

class App : public TopWindow {
public:
	typedef App CLASSNAME;
	App();

	GridCtrl list;
};

App::App()
{
	Title("GridCtrl with QTF Display");
	Sizeable().Zoomable();
	const Size sz(480, 320);
	SetRect(sz); SetMinSize(sz);

	list.Chameleon();
	list.AddColumn("x", 10);
	list.AddColumn("y", 10);
	list.AddColumn("Equation", 50).SetDisplay(Single<GridQTFDisplay>()).HeaderAlignCenter();
	list.AddColumn("Equal");

	for (int i = 0, x = 1, y = 2; i <= 10; ++i, ++x, ++y)
		list.Add(x, y, Format("[= [1 (x + y)][` %d][1  = %d][` %d]]", i, x + y, i),
			pow(double(x + y), i));

	Add(list.VSizePosZ(4, 4).HSizePosZ(4, 4));
}

GUI_APP_MAIN
{
	App app;
	app.Run();
}

[Updated on: Fri, 03 August 2012 23:16]

Report message to a moderator

 
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 20:02:12 CEST 2024

Total time taken to generate the page: 0.03597 seconds