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 » U++ Library : Other (not classified elsewhere) » different compiler produces different look? [SOLVED]
BugFixedDead.gif  different compiler produces different look? [SOLVED] [message #5913] Tue, 24 October 2006 17:26 Go to next message
forlano is currently offline  forlano
Messages: 1185
Registered: March 2006
Location: Italy
Senior Contributor
Hello,

this is what I see with MSC8

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

and this is what I see with mingw

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

I used Display to set the appearence of some columns. The same program show differently the same Courier font depending by the compiler. Is this normal?

Luigi


struct FontDisplay : Display {
	virtual void Paint(Draw& w, const Rect& r, const Value& q,
		               Color ink, Color paper, dword style) const
	{		
		Font fnt = Courier(14); //Font(q, r.Height() - 2);
		String txt = AsString(q);
	 	w.DrawRect(r, paper);
		w.DrawText(r.left + 2, r.top + (r.Height() - GetTextSize(txt, fnt).cy) / 2, txt, fnt, ink); 
		//w.DrawText(r.left + 2+1, r.top + (r.Height() - GetTextSize(txt, fnt).cy) / 2, txt, fnt, ink); 
	}
};

[Updated on: Wed, 25 October 2006 15:43]

Report message to a moderator

Re: different compiler produces different look? [message #5914 is a reply to message #5913] Wed, 25 October 2006 02:50 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Definitely a bug, either in U++ or your code, most likely uninitialized variable somewhere.

Can you create a simple testcase package?

Mirek
Re: different compiler produces different look? [message #5925 is a reply to message #5914] Wed, 25 October 2006 14:19 Go to previous messageGo to next message
forlano is currently offline  forlano
Messages: 1185
Registered: March 2006
Location: Italy
Senior Contributor
luzr wrote on Wed, 25 October 2006 02:50

Definitely a bug, either in U++ or your code, most likely uninitialized variable somewhere.

Can you create a simple testcase package?

Mirek


OK.
Luigi
Re: different compiler produces different look? [message #5933 is a reply to message #5914] Wed, 25 October 2006 14:53 Go to previous messageGo to next message
forlano is currently offline  forlano
Messages: 1185
Registered: March 2006
Location: Italy
Senior Contributor
luzr wrote on Wed, 25 October 2006 02:50

Definitely a bug, either in U++ or your code, most likely uninitialized variable somewhere.

Can you create a simple testcase package?

Mirek


After some investigation I discovered what may be a problem in my app.
I've one arrayctrl that uses Display in a file
struct FontDisplay : Display {
	virtual void Paint(Draw& w, const Rect& r, const Value& q,
		               Color ink, Color paper, dword style) const
	{	Font fnt = Courier(13).Bold(); //Font(q, r.Height() - 2);
		String txt = AsString(q);
	 	w.DrawRect(r, paper);
		w.DrawText(r.left + 2, r.top + (r.Height() - GetTextSize(txt, fnt).cy) / 2, txt, fnt, ink);
	}
};


Then in another file another arrayctrl use the almost identical Display

struct FontDisplay : Display {
	virtual void Paint(Draw& w, const Rect& r, const Value& q,
		               Color ink, Color paper, dword style) const
	{		
		Font fnt = Courier(14); //Font(q, r.Height() - 2);
		String txt = AsString(q);
	 	w.DrawRect(r, paper);
		w.DrawText(r.left + 2, r.top + (r.Height() - GetTextSize(txt, fnt).cy) / 2, txt, fnt, ink); 
	}
};

It seems that the two Display collides in some manner. In fact if I remove one of them the look is the same with both compiler. Otherwise it is different: With MSC8 both have BOLD font; with Mingw both haven't the BOLD font.
Have I use only one Display?

Is this explanation enough to let you to understand the problem? Otherwise I try to do the package.

Luigi
Re: different compiler produces different look? [message #5939 is a reply to message #5933] Wed, 25 October 2006 15:07 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
forlano wrote on Wed, 25 October 2006 08:53

luzr wrote on Wed, 25 October 2006 02:50

Definitely a bug, either in U++ or your code, most likely uninitialized variable somewhere.

Can you create a simple testcase package?

Mirek


After some investigation I discovered what may be a problem in my app.
I've one arrayctrl that uses Display in a file
struct FontDisplay : Display {
	virtual void Paint(Draw& w, const Rect& r, const Value& q,
		               Color ink, Color paper, dword style) const
	{	Font fnt = Courier(13).Bold(); //Font(q, r.Height() - 2);
		String txt = AsString(q);
	 	w.DrawRect(r, paper);
		w.DrawText(r.left + 2, r.top + (r.Height() - GetTextSize(txt, fnt).cy) / 2, txt, fnt, ink);
	}
};


Then in another file another arrayctrl use the almost identical Display

struct FontDisplay : Display {
	virtual void Paint(Draw& w, const Rect& r, const Value& q,
		               Color ink, Color paper, dword style) const
	{		
		Font fnt = Courier(14); //Font(q, r.Height() - 2);
		String txt = AsString(q);
	 	w.DrawRect(r, paper);
		w.DrawText(r.left + 2, r.top + (r.Height() - GetTextSize(txt, fnt).cy) / 2, txt, fnt, ink); 
	}
};

It seems that the two Display collides in some manner. In fact if I remove one of them the look is the same with both compiler. Otherwise it is different: With MSC8 both have BOLD font; with Mingw both haven't the BOLD font.
Have I use only one Display?

Is this explanation enough to let you to understand the problem? Otherwise I try to do the package.

Luigi



Definitely, this is the problem. Actually, this is rather a problem in C++ build process (non-U++ related). You simply cannot have to different classes with the same name. Surprisingly, there is some problem detecting this situation in linker (I am not quite sure why, Tom know that Smile.

Moral of the story: Class name clash is problem.

Mirek
Re: different compiler produces different look? [message #5941 is a reply to message #5939] Wed, 25 October 2006 15:42 Go to previous message
forlano is currently offline  forlano
Messages: 1185
Registered: March 2006
Location: Italy
Senior Contributor
luzr wrote on Wed, 25 October 2006 15:07


Definitely, this is the problem. Actually, this is rather a problem in C++ build process (non-U++ related). You simply cannot have to different classes with the same name. Surprisingly, there is some problem detecting this situation in linker (I am not quite sure why, Tom know that Smile.

Moral of the story: Class name clash is problem.

Mirek


OK. Simply renaming one class fixed the problem. I believed that the name "FontDisplay" was same special U++ reserved name to do this special task ...

Thanks a lot.
Luigi
Previous Topic: Export U++ project to Visual Studio
Next Topic: Topic and tpp files: are they compiled?
Goto Forum:
  


Current Time: Mon Apr 29 00:54:17 CEST 2024

Total time taken to generate the page: 0.02639 seconds