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 #50395 is a reply to message #36982] Sun, 14 October 2018 13:34 Go to previous messageGo to previous message
deep is currently offline  deep
Messages: 263
Registered: July 2011
Location: Bangalore
Experienced Member
Sender Ghost wrote on Sat, 04 August 2012 01:09
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();
}


In this example also QTF color not working. All other attributes working.
[@G ...] and [$Y ...]




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: Sat Apr 20 16:52:08 CEST 2024

Total time taken to generate the page: 0.02094 seconds