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 » U++ Library support » RichText,QTF,RTF... » compilation problem in reference/Display
compilation problem in reference/Display [message #3936] Mon, 10 July 2006 09:47 Go to next message
forlano is currently offline  forlano
Messages: 1062
Registered: March 2006
Location: Italy
Experienced Contributor
Hello,

I wanted to run the package Reference/Display (606-dev3) but I got the following error:

C:\upp\reference\Display\Display.cpp(10) : error C2248: 'Draw::GetTextSize' : cannot access private member declar
ed in class 'Draw'
C:\upp\uppsrc\Draw/Draw.h(807) : see declaration of 'Draw::GetTextSize'
C:\upp\uppsrc\Draw/Draw.h(390) : see declaration of 'Draw'

perhaps the interface now changed.

Luigi
Re: compilation problem in reference/Display [message #3938 is a reply to message #3936] Mon, 10 July 2006 10:44 Go to previous message
mirek is currently offline  mirek
Messages: 11993
Registered: November 2005
Ultimate Member
Yes, sorry.

#include "CtrlLib/CtrlLib.h"

struct FontFaceDisplay : Display {
	virtual void Paint(Draw& w, const Rect& r, const Value& q,
		               Color ink, Color paper, dword style) const
	{
		Font fnt = Font(q, r.Height() - 2);
		String txt = Font::GetFaceName(q);
		w.DrawRect(r, paper);
		w.DrawText(r.left + 2, r.top + (r.Height() - GetTextSize(txt, fnt).cy) / 2, txt, fnt, ink); // <- Change is here - "w." no more needed
	}
};

struct MyApp : TopWindow {
	DropList dl;
	
	MyApp()
	{
		Add(dl.HSizePos().TopPos(5, Ctrl::STDSIZE));
		dl.SetDisplay(Single<FontFaceDisplay>());
		for(int i = 0; i < Font::GetFaceCount(); i++)
			dl.Add(i);
		SetRect(0, 0, 200, 70);
	}
};

GUI_APP_MAIN
{
	MyApp().Run();
}

Previous Topic: Is there a qtf page-break?
Next Topic: QTF Table row height
Goto Forum:
  


Current Time: Fri Aug 23 07:05:04 CEST 2019

Total time taken to generate the page: 0.01280 seconds