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 » Community » Newbie corner » Clipped text in theIDE
Clipped text in theIDE [message #25222] Sun, 14 February 2010 22:00 Go to next message
nlneilson is currently offline  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.

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

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 #25226 is a reply to message #25222] Mon, 15 February 2010 08:05 Go to previous messageGo to next message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
I had the same view on my HP TC4400 with windows XP. Do you have by any chance some "homebrew" dll installed related to winXP custom themes?
Re: Clipped text in theIDE [message #25227 is a reply to message #25226] Mon, 15 February 2010 08:08 Go to previous messageGo to next message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
What happens & Can u change ide skins?
Re: Clipped text in theIDE [message #25228 is a reply to message #25227] Mon, 15 February 2010 08:11 Go to previous messageGo to next message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
might be related to this:
http://www.ultimatepp.org/forum/index.php?t=msg&th=4977& amp;start=0&
Re: Clipped text in theIDE [message #25233 is a reply to message #25222] Mon, 15 February 2010 11:59 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Hm, this looks like XP says that the standard font height is zero, for some reason...

Would you mind to compile theide with some LOGs so that we can check that?
Re: Clipped text in theIDE [message #25244 is a reply to message #25233] Mon, 15 February 2010 13:44 Go to previous messageGo to next message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
luzr wrote on Mon, 15 February 2010 10:59

Hm, this looks like XP says that the standard font height is zero, for some reason...

Would you mind to compile theide with some LOGs so that we can check that?


Unfortunately, I cant help with this case because I installed Windows 7.
Re: Clipped text in theIDE [message #25255 is a reply to message #25244] Mon, 15 February 2010 20:23 Go to previous messageGo to next message
nlneilson is currently offline  nlneilson
Messages: 644
Registered: January 2010
Location: U.S. California. Mojave &...
Contributor
fudadmin: I have no custom themes that I am aware of, just XP with sp3. How do you change theIDE skins, with the text and text box problems I can't even change the text size?

The computer it runs OK on is also XP.

It is a problem with only a few columns and the text box expansion. The rest looks OK but theIDE is not usable as it is.

"Hm, this looks like XP says that the standard font height is zero, for some reason... "
If this was the case wouldn't all the text be this way rather than just a few coulumns? And this would not explain why the text boxes will not expand.

Is the text for these columns specified differently than for the other columns?

I don't know how to compile theIDE.
Re: Clipped text in theIDE [message #25263 is a reply to message #25255] Mon, 15 February 2010 22:50 Go to previous messageGo to next message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
Quote:

How do you change theIDE skins, with the text and text box problems I can't even change the text size?

Just a guess - maybe to change WinXp theme to a classical one first and then check ide?

Quote:

I don't know how to compile theIDE.

in uppsrc (similarly as MyApps) open a package "ide", and then compile as you compile your packages... if that helps. Smile
Re: Clipped text in theIDE [message #25382 is a reply to message #25222] Sat, 20 February 2010 11:05 Go to previous messageGo to next message
nlneilson is currently offline  nlneilson
Messages: 644
Registered: January 2010
Location: U.S. California. Mojave &...
Contributor
Themes made no difference.

The Upp GUI app has a similar problem with the file chooser.


index.php?t=getfile&id=2316&private=0
Re: Clipped text in theIDE [message #25384 is a reply to message #25382] Sat, 20 February 2010 16:13 Go to previous messageGo to next message
sergeynikitin is currently offline  sergeynikitin
Messages: 748
Registered: January 2008
Location: Moscow, Russia
Contributor

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 Go to previous messageGo to next message
nlneilson is currently offline  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 202 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 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
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 Go to previous messageGo to next message
nlneilson is currently offline  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 202 times)

[Updated on: Mon, 22 February 2010 15:03]

Report message to a moderator

Re: Clipped text in theIDE [message #25428 is a reply to message #25419] Tue, 23 February 2010 04:23 Go to previous messageGo to next message
nlneilson is currently offline  nlneilson
Messages: 644
Registered: January 2010
Location: U.S. California. Mojave &...
Contributor
Here is a small app that just opens a file chooser and the .log file.
#include <CtrlLib/CtrlLib.h>

using namespace Upp;

struct app : TopWindow {
	typedef app CLASSNAME;
	Button button;

	void Open() { 
		FileSel fn; 
		fn.AllFilesType();
		if(fn.ExecuteOpen()){ // file chooser 
		}
	}

	app() {
		Title("TextProblem");
		NoCenter();
                LeftPosZ(4, 245).TopPosZ(50, 86);
		Add(button.LeftPos(10, 100).TopPos(10, 30));
		button.SetLabel("Open File");
		button <<= THISBACK(Open);
	}
};

GUI_APP_MAIN{
	app().Run();
}

Re: Clipped text in theIDE [message #25429 is a reply to message #25428] Tue, 23 February 2010 05:47 Go to previous messageGo to next message
nlneilson is currently offline  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 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
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 #25435 is a reply to message #25432] Tue, 23 February 2010 13:46 Go to previous messageGo to next message
nlneilson is currently offline  nlneilson
Messages: 644
Registered: January 2010
Location: U.S. California. Mojave &...
Contributor
The text problem is the same with the change to CtrlLib/MultiButton.cpp

The changes to CtrlLib/FileList.cpp are still there but the .log file is much smaller.

* C:\upp\out\MSC9.Debug.Debug_full.Gui\TextProblem.exe 23.02.2010 04:20:31, user: Neil

fi.GetHeight() = 15
fi.GetFont() = <STDFONT:12 Bold>
r.Height() = 16
(r.Height() - fi.GetHeight()) / 2 = 0
fi.GetHeight() = 15
fi.GetFont() = <STDFONT:12 Bold>
r.Height() = 16
(r.Height() - fi.GetHeight()) / 2 = 0
fi.GetHeight() = 15
fi.GetFont() = <STDFONT:12 Bold>
r.Height() = 16
(r.Height() - fi.GetHeight()) / 2 = 0
Re: Clipped text in theIDE [message #25436 is a reply to message #25435] Tue, 23 February 2010 15:46 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Well, these DUMPs were not supposed to fix it, just investigate...

Anyway, something quick and simple:

Put:

DDUMP(Draw::GetStdFontCy())

into GUI_APP_MAIN of your test application please..

Mirek
Re: Clipped text in theIDE [message #25440 is a reply to message #25436] Tue, 23 February 2010 23:44 Go to previous messageGo to next message
nlneilson is currently offline  nlneilson
Messages: 644
Registered: January 2010
Location: U.S. California. Mojave &...
Contributor
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
fi.GetHeight() = 15
fi.GetFont() = <STDFONT:12 Bold>
r.Height() = 16
(r.Height() - fi.GetHeight()) / 2 = 0
fi.GetHeight() = 15
fi.GetFont() = <STDFONT:12 Bold>
r.Height() = 16
(r.Height() - fi.GetHeight()) / 2 = 0
fi.GetHeight() = 15
fi.GetFont() = <STDFONT:12 Bold>
r.Height() = 16
(r.Height() - fi.GetHeight()) / 2 = 0
[/code]

There was something in theIDE I had not noticed before. A red line through Open()void in the second column.

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

edit: Removing the DDUMP from Open() and app() the red line is still through Open()void
I don't know which clues are relevant.
  • Attachment: Clip04.jpg
    (Size: 7.37KB, Downloaded 644 times)

[Updated on: Wed, 24 February 2010 00:04]

Report message to a moderator

Re: Clipped text in theIDE [message #25443 is a reply to message #25440] Wed, 24 February 2010 08:33 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13975
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

Previous Topic: fail to install, 2070, 2081, 2112
Next Topic: Questions about VectorMap
Goto Forum:
  


Current Time: Fri Mar 29 01:38:05 CET 2024

Total time taken to generate the page: 0.01352 seconds