Home » Community » Newbie corner » Clipped text in theIDE
Clipped text in theIDE [message #25222] |
Sun, 14 February 2010 22:00  |
nlneilson
Messages: 644 Registered: January 2010 Location: U.S. California. Mojave &...
|
Contributor |
|
|
I have used Upp on another computer, excellent program.
I tried installing this on a notebook that I usually take with me
using Upp 1824, 1952 and now 2061.
The text in theIDE is clipped in one column.
The left of the image is when choosing an app to work on
and the right is in the code editor.

Also the "Assembly" column that usually has examples, MyApps,
reference, tutorial and uppsrc is blank.
In some respects it is similar to this post but my problem is with the theIDE rather than an app made with upp.
http://www.ultimatepp.org/forum/index.php?t=msg&goto=252 21&#msg_25221
Can I change something to correct this?
Toshiba Satellite L25, Win XP, ATI video, 2 GB mem
edit: Clicking Setup->Environment->Font none of the text boxes can be expanded to set the font or size. The box to change from debug to release cannot be expanded. I have not found any box similar to this that can be expanded.
theIDE works just fine on another computer.
[Updated on: Mon, 15 February 2010 02:10] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
Re: Clipped text in theIDE [message #25384 is a reply to message #25382] |
Sat, 20 February 2010 16:13   |
|
You theide run from under wine?
I have the same effect began after theide switched to Painter.
SergeyNikitin<U++>( linux, wine )
{
under( Ubuntu || Debian || Raspbian );
}
|
|
|
Re: Clipped text in theIDE [message #25388 is a reply to message #25222] |
Sat, 20 February 2010 23:19   |
nlneilson
Messages: 644 Registered: January 2010 Location: U.S. California. Mojave &...
|
Contributor |
|
|
I have run this with two computers with Win XP.
One has this problem.
On Win Vista and Win7 the file chooser is OK, I have not tried theIDE on either of those two.
I have Ubuntu 9.10 but have not booted into that to try it yet, I will see if it will run under wine.
When did they switch theIDE to Painter?
edit: I tried my Upp app with Ubuntu/wine and it has the same problem with the text/expand box. This is on the same computer that it runs OK on with Win XP. I did not try theIDE as it would probably have the same problem.
edit: I was very pleased that the app .exe made with Upp will run under Linux with wine.
-
Attachment: Distance.exe
(Size: 1.11MB, Downloaded 255 times)
[Updated on: Sun, 21 February 2010 05:50] Report message to a moderator
|
|
|
Re: Clipped text in theIDE [message #25407 is a reply to message #25388] |
Mon, 22 February 2010 09:57   |
 |
mirek
Messages: 14255 Registered: November 2005
|
Ultimate Member |
|
|
Sorry for the delay.
If you can can simulate the problem with some small code (e.g. just invoking FileSel, if there is a problem too), please try these (in CtrlLib/FileList.cpp):
void FileList::Paint(Draw& w, const Rect& r, const Value& q,
Color ink, Color paper, dword style) const
{
const File& m = ValueTo<File>(q);
bool dark = Grayscale(paper) < 150;
w.DrawRect(r, paper);
int x = r.left + 2;
w.DrawImage(x, r.top + (r.Height() - m.icon.GetSize().cy) / 2, m.icon);
x += iconwidth;
x += 2;
FontInfo fi = m.font.Info();
DDUMP(fi.GetHeight());
DDUMP(fi.GetFont());
DDUMP(r.Height());
DDUMP((r.Height() - fi.GetHeight()) / 2);
DrawFileName(w, x, r.top + (r.Height() - fi.GetHeight()) / 2,
r.right - x - 2, r.Height(), WString(m.name), m.isdir, m.font,
dark ? SColorHighlightText : m.ink,
dark ? SColorHighlightText : m.extink,
WString(m.desc), m.descfont, justname, m.underline);
}
and post here a resulting log (if it is too long, I believe only the first four DUMPs will be enough).
Mirek
|
|
|
Re: Clipped text in theIDE [message #25419 is a reply to message #25407] |
Mon, 22 February 2010 14:37   |
nlneilson
Messages: 644 Registered: January 2010 Location: U.S. California. Mojave &...
|
Contributor |
|
|
Thanks Mirek, that is a fast response.
I replaced the code in FileList.cpp with the code you have posted.
I tried this in debug on the Win XP I can run theIDE on.
Attached is the .log file.
It seems that a text box with a pull down or with an icon may be the problem. Why the "Assembly" column is blank when picking a package in theIDE is strange, there is no pull down or icon in that column.
-
Attachment: Distance.log
(Size: 21.57KB, Downloaded 252 times)
[Updated on: Mon, 22 February 2010 15:03] Report message to a moderator
|
|
|
|
Re: Clipped text in theIDE [message #25429 is a reply to message #25428] |
Tue, 23 February 2010 05:47   |
nlneilson
Messages: 644 Registered: January 2010 Location: U.S. California. Mojave &...
|
Contributor |
|
|
After a few hours of tinkering, deleting the upp directory and re installing I was able to get theIDE to compile something on the computer with the text problem. The problem there was even though MSC9 was the only box checked on the install MSC8 showed in the theIDE and there was no way of changing it as none of the pull downs worked and in Setup un-selecting MSC8 did not work. Even now with the MSC9 in Setup MSC8 is still marked, but at least for the build choice it shows "MSC9 Debug".
When opening theIDE the only directory, and it cannot be changed, is "examples". I copied the TextProblem directory into examples and was able to pull it up, compile and run it.
The text and pull down problem running it from theIDE or the .exe is still the same.
I don't know if the .log from this computer will show anything different.
[Updated on: Tue, 23 February 2010 05:49] Report message to a moderator
|
|
|
Re: Clipped text in theIDE [message #25432 is a reply to message #25429] |
Tue, 23 February 2010 10:57   |
 |
mirek
Messages: 14255 Registered: November 2005
|
Ultimate Member |
|
|
OK, these numbers seem OK. Let us try this:
void MultiButton::Paint(Draw& w)
{
Size sz = GetSize();
int border, lx, rx;
bool frm = Metrics(border, lx, rx);
int mst = ChState(MAIN);
if(frm)
ChPaint(w, sz, style->edge[style->activeedge ? mst : 0]);
bool left = false;
bool right = false;
for(int i = 0; i < button.GetCount(); i++) {
SubButton& b = button[i];
int st = ChState(i);
int x = 0, cx = 0;
GetPos(b, lx, rx, x, cx);
bool dopaint = true;
Value v = b.left ? left ? style->lmiddle[st] : style->left[st]
: right ? style->rmiddle[st] : style->right[st];
if(ComplexFrame())
ChPaint(w, x, border, cx, sz.cy - 2 * border, style->simple[st]);
else
if(frm) {
if(IsTrivial() && style->usetrivial)
dopaint = false;
ChPaint(w, x, border, cx, sz.cy - 2 * border,
dopaint ? v : style->trivial[st]);
}
else {
w.Clip(x, 0, cx, sz.cy);
ChPaint(w, sz, style->look[Frame() ? mst : st]);
if(IsNull(v) || !Frame()) {
if((!IsTrivial() || style->trivialsep) && IsEnabled()) {
if(b.left) {
if(left)
ChPaint(w, x, style->sepm, 1, sz.cy - 2 * style->sepm, style->sep1);
ChPaint(w, x + cx - 1, style->sepm, 1, sz.cy - 2 * style->sepm, style->sep2);
}
else {
ChPaint(w, x, style->sepm, 1, sz.cy - 2 * style->sepm, style->sep1);
if(right)
ChPaint(w, x + cx - 1, style->sepm, 1, sz.cy - 2 * style->sepm, style->sep2);
}
}
}
else
ChPaint(w, x, 0, cx, sz.cy, v);
w.End();
}
if(dopaint) {
Size tsz = GetTextSize(b.label, StdFont());
Image m = tsz.cx > 0 ? b.img : (Image)Nvl(b.img, CtrlsImg::DA());
Size isz = m.GetSize();
Point p = (st == CTRL_PRESSED) * style->pressoffset;
p.x += x + (cx - isz.cx - tsz.cx - (tsz.cx > 0 && isz.cx > 0 ? LB_IMAGE : 0)) / 2;
p.y += (sz.cy - isz.cy) / 2;
if(b.left) {
if(!left) p.x += style->loff;
}
else
if(!right) p.x += style->roff;
if(b.monoimg || IsNull(b.img))
w.DrawImage(p.x, p.y, m, frm ? style->fmonocolor[st] : style->monocolor[st]);
else
w.DrawImage(p.x, p.y, m);
DDUMP(tsz);
DDUMP(isz);
DDUMP(sz);
DDUMP((sz.cy - tsz.cy) / 2);
if(tsz.cx > 0) {
if(isz.cx > 0)
p.x += isz.cx + LB_IMAGE;
w.DrawText(p.x, (sz.cy - tsz.cy) / 2, b.label);
}
}
(b.left ? left : right) = true;
}
Rect r, cr;
Color text = SColorLabel();
Color paper = Null;
if(ComplexFrame()) {
cr = GetSize();
cr.left = lx;
cr.right = rx;
r = cr;
paper = HasFocus() ? SColorHighlight() : SColorPaper();
if(HasFocus())
text = SColorHighlightText();
w.DrawRect(r, paper);
}
else
if(frm) {
Rect m = style->margin;
r = Rect(max(lx, m.left), m.top, min(rx, sz.cx - m.right), sz.cy - m.bottom);
Color paper;
if(mst == CTRL_HOT && !IsTrivial())
paper = Blend(SColorHighlight, SColorPaper, 235);
else
if(mst == CTRL_PRESSED && !IsTrivial())
paper = Blend(SColorHighlight, SColorFace, 235);
else
if(HasFocus()) {
paper = SColorHighlight();
text = SColorHighlightText();
}
else
paper = SColorPaper();
w.DrawRect(r, paper);
cr = r;
}
else {
w.Clip(lx, 0, rx - lx, sz.cy);
ChPaint(w, sz, style->look[mst]);
Rect m = style->margin;
r = Rect(max(lx, m.left), m.top, min(rx, sz.cx - m.right), sz.cy - m.bottom);
if(!IsTrivial() || style->trivialsep) {
if(left) {
r.left++;
if(IsEnabled())
ChPaint(w, lx, style->sepm, 1, sz.cy - 2 * style->sepm, style->sep1);
}
if(right) {
if(IsEnabled())
ChPaint(w, rx - 1, style->sepm, 1, sz.cy - 2 * style->sepm, style->sep2);
r.right--;
}
}
w.End();
cr = r;
}
cr.left++;
Rect clr = cr;
if(!IsNull(valuecy)) {
cr.top += (cr.GetHeight() - valuecy + 1) / 2;
cr.bottom = cr.top + valuecy;
}
Value v = convert->Format(value);
bool f = HasFocus() && !push && frm;
if(cr.left < cr.right && display) {
w.Clip(clr);
display->Paint(w, cr, v,
IsShowEnabled() ? text : SColorDisabled,
paper, f ? Display::CURSOR : Display::FOCUS|Display::CURSOR);
w.End();
}
if(!frm && HasFocus())
DrawFocus(w, r);
}
(It is in CtrlLib/MultiButton.cpp).
Mirek
|
|
|
|
|
|
Re: Clipped text in theIDE [message #25443 is a reply to message #25440] |
Wed, 24 February 2010 08:33   |
 |
mirek
Messages: 14255 Registered: November 2005
|
Ultimate Member |
|
|
nlneilson wrote on Tue, 23 February 2010 17:44 | My delay, sorry.
I was not sure where to put DDUMP(Draw::GetStdFontCy()); so I tried it under "app().Run();" and the last line of the
void Open() and app()
{code]
* C:\upp\out\MSC9.Debug.Debug_full.Gui\TextProblem.exe 23.02.2010 14:31:06, user: Neil
Draw::GetStdFontCy() = 0
|
OK, this is our problem.... It should have been something like 16.
Quote: |
edit: Removing the DDUMP from Open() and app() the red line is still through Open()void
I don't know which clues are relevant.
|
Do not worry about red line, it should be there (marks virtual function).
Also, those DDUMPs do not alter the behaviour of program, this are just debugging LOGs.
OK, lets continue our remote debugging process, in Draw/FontWin32.cpp:
void GetStdFontSys(String& name, int& height)
{
#ifdef PLATFORM_WINCE
name = "Arial";
height = 10;
#else
NONCLIENTMETRICS ncm;
ncm.cbSize = sizeof(ncm);
bool b = ::SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(ncm), &ncm, 0);
name = FromSystemCharset(ncm.lfMenuFont.lfFaceName);
height = abs((int)ncm.lfMenuFont.lfHeight);
DDUMP(b);
DDUMP(name);
DDUMP(height);
#endif
}
Hm, now googling the issue, there seems to be a hint so that you can try this patch:
void GetStdFontSys(String& name, int& height)
{
#ifdef PLATFORM_WINCE
name = "Arial";
height = 10;
#else
NONCLIENTMETRICS ncm;
ncm.cbSize = sizeof(ncm);
if(!::SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(ncm), &ncm, 0))
::SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(ncm) - sizeof(int), &ncm, 0);
name = FromSystemCharset(ncm.lfMenuFont.lfFaceName);
height = abs((int)ncm.lfMenuFont.lfHeight);
#endif
}
Mirek
[Updated on: Wed, 24 February 2010 08:33] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Tue Apr 29 11:16:30 CEST 2025
Total time taken to generate the page: 0.00438 seconds
|