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... » RichEdit Questions
Re: RichEdit Questions [message #2606 is a reply to message #2536] Tue, 18 April 2006 22:52 Go to previous messageGo to previous message
mentaltruckdriver is currently offline  mentaltruckdriver
Messages: 14
Registered: March 2006
Promising Member
I was testing the code that you posted in the uWord example

#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() - w.GetTextSize(txt, fnt).cy) / 2, txt, fnt, ink);
	}
};

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();
}


However no matter what I do I keep getting errors when I compile. How would I incorporate this into either the UWord.cpp OR (even better) incorporate this into the line of code in RichEdit's Editor.cpp where it says:

RichEdit& RichEdit::FontFaces(const Vector<int>& ff)
{
	face.ClearList();
	for(int i = 0; i < ff.GetCount(); i++)
		face.Add(ff[i]);
	return *this;
}


Thanks for all your help so far.
 
Read Message icon5.gif
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: QTF Justification
Next Topic: Is there a qtf page-break?
Goto Forum:
  


Current Time: Tue Jun 18 12:21:09 CEST 2024

Total time taken to generate the page: 0.03006 seconds