Home » U++ Library support » U++ Library : Other (not classified elsewhere) » different compiler produces different look? [SOLVED]
different compiler produces different look? [SOLVED] [message #5913] |
Tue, 24 October 2006 17:26 |
|
forlano
Messages: 1185 Registered: March 2006 Location: Italy
|
Senior Contributor |
|
|
Hello,
this is what I see with MSC8
and this is what I see with mingw
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 #5933 is a reply to message #5914] |
Wed, 25 October 2006 14:53 |
|
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 |
|
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 .
Moral of the story: Class name clash is problem.
Mirek
|
|
|
|
Goto Forum:
Current Time: Mon Apr 29 06:30:26 CEST 2024
Total time taken to generate the page: 1.07826 seconds
|