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++ Widgets - General questions or Mixed problems » up & down within ColumnList moves focus out
up & down within ColumnList moves focus out [message #23607] Wed, 04 November 2009 09:51 Go to next message
bonami is currently offline  bonami
Messages: 186
Registered: June 2007
Location: Beijing
Experienced Member
1. i built the attached program on chinese winXP, using GCC. and it runs well on chi.XP. but the exe file on english winXP (a nLite version) shows the ColumnList only with a couple of pixels (as shown in attachment).

2. suggestion,
within a ColumnList, pressing direction keys should move among its items, instead of changing focus to other controls.
  • Attachment: ez.zip
    (Size: 7.59KB, Downloaded 324 times)

[Updated on: Tue, 10 November 2009 07:05]

Report message to a moderator

Re: up & down within ColumnList moves focus out [message #23694 is a reply to message #23607] Sun, 15 November 2009 14:18 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
I am confused. The attached sources produce empty ColumnList. What should I look for?
Re: up & down within ColumnList moves focus out [message #23748 is a reply to message #23694] Thu, 19 November 2009 10:29 Go to previous messageGo to next message
bonami is currently offline  bonami
Messages: 186
Registered: June 2007
Location: Beijing
Experienced Member
1. attached ezcomm\columnlist.jpg shows that the columnlist has nearly no size. if you see a real EMPTY columnlist, which means it has space but without contents, the application is running right. that right situation differs from my attached photo.
2. suggestion as i said.
Re: up & down within ColumnList moves focus out [message #23774 is a reply to message #23748] Fri, 20 November 2009 14:25 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
bonami wrote on Thu, 19 November 2009 04:29

1. attached ezcomm\columnlist.jpg shows that the columnlist has nearly no size. if you see a real EMPTY columnlist, which means it has space but without contents, the application is running right. that right situation differs from my attached photo.
2. suggestion as i said.


I see. So it is about wrong size?

Mirek
Re: up & down within ColumnList moves focus out [message #23800 is a reply to message #23774] Mon, 23 November 2009 02:21 Go to previous messageGo to next message
bonami is currently offline  bonami
Messages: 186
Registered: June 2007
Location: Beijing
Experienced Member
yes, it seems to have wrong size (height). but i'm not sure wheteher it is a common effect on other machine (if systems are same) or something wrong with my own environment.
Re: up & down within ColumnList moves focus out [message #23805 is a reply to message #23800] Mon, 23 November 2009 11:09 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Try NoRoundSize.

I have tried in all platforms, not reproduced. However, ColumnList by default reduces the size of view to match the height of items (which is usually the height of default font).

I guess that can be the problem, although it is trange that your default font would be so big...

Mirek
Re: up & down within ColumnList moves focus out [message #23807 is a reply to message #23805] Mon, 23 November 2009 11:13 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
We can test:

Quote:


int ColumnList::RoundedCy()
{
if (mode != MODE_LIST)
return GetRect().GetHeight();
Rect r = GetRect();
Rect rr = r;
frame->FrameLayout(r);
DDUMP(cy);
DDUMP(r.Height());
DDUMP(rr.Height());
return (cy ? r.Height() / cy * cy : 0) + rr.Height() - r.Height();
}



(run in fault case and post here what is in the log please).

Mirek
Re: up & down within ColumnList moves focus out [message #23813 is a reply to message #23807] Tue, 24 November 2009 03:43 Go to previous messageGo to next message
bonami is currently offline  bonami
Messages: 186
Registered: June 2007
Location: Beijing
Experienced Member
NoRoundSize() works.
but adding items shows nothing. i changed my constructor to
ezcommwin() { 	Add(cl.LeftPos(10, 100).TopPos(30, 80)); cl.Add("item", true); cl.Add("itemmm", false); cl.NoRoundSize(); }
the log you requested (no adding items or NoRoundSize() as above, only cl.LeftPos.TopPos) is,
cy = 0
r.Height() = 0
rr.Height() = 0
cy = 0
r.Height() = 0
rr.Height() = 0
cy = 0
r.Height() = 0
rr.Height() = 0
cy = 0
r.Height() = 76
rr.Height() = 80
cy = 0
r.Height() = 76
rr.Height() = 80
cy = 0
r.Height() = 76
rr.Height() = 80
cy = 0
r.Height() = 76
rr.Height() = 80
cy = 0
r.Height() = 76
rr.Height() = 80
Re: up & down within ColumnList moves focus out [message #23818 is a reply to message #23813] Tue, 24 November 2009 14:52 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
bonami wrote on Mon, 23 November 2009 21:43

NoRoundSize() works.
but adding items shows nothing. i changed my constructor to
ezcommwin() { 	Add(cl.LeftPos(10, 100).TopPos(30, 80)); cl.Add("item", true); cl.Add("itemmm", false); cl.NoRoundSize(); }
the log you requested (no adding items or NoRoundSize() as above, only cl.LeftPos.TopPos) is,
cy = 0
r.Height() = 0
rr.Height() = 0
cy = 0
r.Height() = 0
rr.Height() = 0
cy = 0
r.Height() = 0
rr.Height() = 0
cy = 0
r.Height() = 76
rr.Height() = 80
cy = 0
r.Height() = 76
rr.Height() = 80
cy = 0
r.Height() = 76
rr.Height() = 80
cy = 0
r.Height() = 76
rr.Height() = 80
cy = 0
r.Height() = 76
rr.Height() = 80


INTERESTING.

Try

DDUMP(Draw::GetStdFontCy());

(it is enough to put it to GUI_APP_MAIN once).

Something is very strange, cy is only assigned in ColumnList contructor to GetStdFontCy value, which is standard font height...

Mirek
Re: up & down within ColumnList moves focus out [message #23824 is a reply to message #23818] Wed, 25 November 2009 02:46 Go to previous messageGo to next message
bonami is currently offline  bonami
Messages: 186
Registered: June 2007
Location: Beijing
Experienced Member
Draw::GetStdFontCy() = 0

Mirek, if this is my own system's fault, maybe there is no need to further investigate on it. It's a stripped system, thus not so trustable.
Re: up & down within ColumnList moves focus out [message #23832 is a reply to message #23824] Wed, 25 November 2009 11:39 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
bonami wrote on Tue, 24 November 2009 20:46

Draw::GetStdFontCy() = 0

Mirek, if this is my own system's fault, maybe there is no need to further investigate on it. It's a stripped system, thus not so trustable.


That might be a reason, but not excuse Smile

U++ should work even on stripped system.

The query for system font is in Draw/FontWin32:

void GetStdFontSys(String& name, int& height)
{
#ifdef PLATFORM_WINCE
	name = "Arial";
	height = 10;
#else
	NONCLIENTMETRICS ncm;
	ncm.cbSize = sizeof(ncm);
	::SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(ncm), &ncm, 0);
	name = FromSystemCharset(ncm.lfMenuFont.lfFaceName);
	height = abs((int)ncm.lfMenuFont.lfHeight);
#endif
}


put logs there:

void GetStdFontSys(String& name, int& height)
{
#ifdef PLATFORM_WINCE
	name = "Arial";
	height = 10;
#else
	NONCLIENTMETRICS ncm;
	ncm.cbSize = sizeof(ncm);
	::SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(ncm), &ncm, 0);
	name = FromSystemCharset(ncm.lfMenuFont.lfFaceName);
	height = abs((int)ncm.lfMenuFont.lfHeight);
DDUMP(name);
DDUMP(height);
#endif
}


and/or perhaps try

void GetStdFontSys(String& name, int& height)
{
#ifdef PLATFORM_WINCE
	name = "Arial";
	height = 10;
#else
	NONCLIENTMETRICS ncm;
	ncm.cbSize = sizeof(ncm);
	::SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(ncm), &ncm, 0);
	name = FromSystemCharset(ncm.lfMenuFont.lfFaceName);
	height = abs((int)ncm.lfMenuFont.lfHeight);
        if(height == 0) {
             name = "Arial";
             height = 10;
        }
#endif
}


Mirek
Re: up & down within ColumnList moves focus out [message #23842 is a reply to message #23832] Thu, 26 November 2009 05:00 Go to previous messageGo to next message
bonami is currently offline  bonami
Messages: 186
Registered: June 2007
Location: Beijing
Experienced Member
i added your DDUMP code and put more like below,
int  Font::FindFaceNameIndex(const String& name) {
	if(name == "STDFONT")
		return 0;
	for(int i = 1; i < GetFaceCount(); i++)
		if(GetFaceName(i) == name)
			return i;
	String n = Filter(name, FontFilter);
DDUMP(n);
	for(int i = 1; i < GetFaceCount(); i++)
	{
DDUMP(GetFaceName(i));
		if(Filter(GetFaceName(i), FontFilter) == n)
			return i;
			}
	return 0;
}

result is,
name = Segoe UI
height = 15
n = segoeui
GetFaceName(i) = Times New Roman
GetFaceName(i) = Arial
GetFaceName(i) = Courier New
GetFaceName(i) = Symbol
GetFaceName(i) = Wingdings
GetFaceName(i) = Tahoma
GetFaceName(i) = System
GetFaceName(i) = Terminal
GetFaceName(i) = Fixedsys
GetFaceName(i) = Roman
GetFaceName(i) = Script
GetFaceName(i) = Modern
GetFaceName(i) = Small Fonts
GetFaceName(i) = MS Serif
GetFaceName(i) = WST_Czec
GetFaceName(i) = WST_Engl
GetFaceName(i) = WST_Fren
GetFaceName(i) = WST_Germ
GetFaceName(i) = WST_Ital
GetFaceName(i) = WST_Span
GetFaceName(i) = WST_Swed
GetFaceName(i) = Courier
GetFaceName(i) = MS Sans Serif
GetFaceName(i) = Marlett
GetFaceName(i) = Lucida Console
GetFaceName(i) = Lucida Sans Unicode
GetFaceName(i) = Verdana
GetFaceName(i) = Arial Black
GetFaceName(i) = Comic Sans MS
GetFaceName(i) = Impact
GetFaceName(i) = Georgia
GetFaceName(i) = Franklin Gothic Medium
GetFaceName(i) = Palatino Linotype
GetFaceName(i) = Trebuchet MS
GetFaceName(i) = Webdings
GetFaceName(i) = Estrangelo Edessa
GetFaceName(i) = Gautami
GetFaceName(i) = Latha
GetFaceName(i) = Mangal
GetFaceName(i) = MV Boli
GetFaceName(i) = Raavi
GetFaceName(i) = Shruti
GetFaceName(i) = Tunga
GetFaceName(i) = Sylfaen
GetFaceName(i) = Microsoft Sans Serif
Re: up & down within ColumnList moves focus out [message #23869 is a reply to message #23842] Sun, 29 November 2009 23:23 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
How about this:

void Font::SyncStdFont()
{
	DrawLock __;
	StdFontSize = Size(AStdFont.GetAveWidth(), AStdFont().Bold().GetCy());
        DDUMP(AStdFont().GetCy());
        DDUMP(AStdFont().Bold().GetCy());
}


?
Re: up & down within ColumnList moves focus out [message #23875 is a reply to message #23869] Mon, 30 November 2009 06:43 Go to previous messageGo to next message
bonami is currently offline  bonami
Messages: 186
Registered: June 2007
Location: Beijing
Experienced Member
what's more strange is, it's not happening today.
i added your code and both is 20. i suspected there is something right, so i restored all files but the problem is gone, that's to say, the size shown on screen is right. i'll try this later to see if the problem happens again.
as i can see, according to my former GetFaceName() output in Font::FindFaceNameIndex(), q is 0 in Font::InitStdFont(), so SyncStdFont() is never evoked. isn't this sth. wrong?
Re: up & down within ColumnList moves focus out [message #23884 is a reply to message #23875] Mon, 30 November 2009 21:32 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
bonami wrote on Mon, 30 November 2009 00:43

what's more strange is, it's not happening today.
i added your code and both is 20. i suspected there is something right, so i restored all files but the problem is gone, that's to say, the size shown on screen is right. i'll try this later to see if the problem happens again.
as i can see, according to my former GetFaceName() output in Font::FindFaceNameIndex(), q is 0 in Font::InitStdFont(), so SyncStdFont() is never evoked. isn't this sth. wrong?


Well, now the problem is obvious. The system is set to use Segoe UI font, but it is not in the list of available fonts!

Mirek

Previous Topic: Paint outside Ctrl Rect
Next Topic: UPP app -> Ext EXE (send email) wrong charset
Goto Forum:
  


Current Time: Thu Mar 28 13:32:43 CET 2024

Total time taken to generate the page: 0.00977 seconds