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 |
|
deep
Messages: 263 Registered: July 2011 Location: Bangalore
|
Experienced Member |
|
|
Sender Ghost wrote on Sat, 04 August 2012 01:09Hello, Matteo.
idkfa46 wrote on Thu, 02 August 2012 14:29Is 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.
#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
|
|
|
|
|
GridCtrl + rich texts
By: idkfa46 on Thu, 02 August 2012 14:29
|
|
|
Re: GridCtrl + rich texts
By: Didier on Fri, 03 August 2012 18:19
|
|
|
Re: GridCtrl + rich texts
|
|
|
Re: GridCtrl + rich texts
By: koldo on Sat, 04 August 2012 15:38
|
|
|
Re: GridCtrl + rich texts
By: forlano on Sun, 05 August 2012 12:32
|
|
|
Re: GridCtrl + rich texts
|
|
|
Re: GridCtrl + rich texts -- Array Control
By: deep on Sun, 14 October 2018 10:19
|
|
|
Re: GridCtrl + rich texts
By: deep on Sun, 14 October 2018 13:34
|
|
|
Re: GridCtrl + rich texts
By: deep on Mon, 15 October 2018 11:43
|
|
|
Re: GridCtrl + rich texts
By: idkfa46 on Sun, 05 August 2012 00:38
|
|
|
Re: GridCtrl + rich texts
|
|
|
Re: GridCtrl + rich texts
By: idkfa46 on Sun, 05 August 2012 16:23
|
|
|
Re: GridCtrl + rich texts
By: Didier on Sun, 05 August 2012 20:49
|
|
|
Re: GridCtrl + rich texts
|
|
|
Re: GridCtrl + rich texts
By: forlano on Thu, 09 August 2012 13:48
|
|
|
Re: GridCtrl + rich texts
|
|
|
Re: GridCtrl + rich texts
By: forlano on Thu, 09 August 2012 19:17
|
|
|
Re: GridCtrl + rich texts
|
|
|
Re: GridCtrl + rich texts
By: forlano on Thu, 09 August 2012 22:09
|
Goto Forum:
Current Time: Sat Apr 20 16:52:08 CEST 2024
Total time taken to generate the page: 0.02094 seconds
|