1. Analyze This

Can someone explain to me why the list box on a bound/shrouded program is
a difference vertical length than when not bound/shrouded? When bound it
contains 11 rows of items and not bound it has 10 rows of items. Here's the
statement which creates the list box. Using win32 by the way.

constant    idList = create(List,"",Main,4,cy*19-tint(cy/2),
                           cx*80+4,cy*10,WS_SCROLLBARS)


The 'cy*10' should set the number of rows to 10 which it does when not 
bound. 'cy' is the vertical height of a character as returned by the
function getFontSize.

setFont(Screen, "Courier New", fs, Normal)
    charSize = getFontSize(Screen)

    cx = charSize[1]
    cy = charSize[2]


new topic     » topic index » view message » categorize

2. Re: Analyze This

George Walters wrote:
> 
> Can someone explain to me why the list box on a bound/shrouded program is
> a difference vertical length than when not bound/shrouded? When bound it
> contains 11 rows of items and not bound it has 10 rows of items.

Is the list box taller or are the items smaller?
Is the 11th row partially or fully displayed?
What are the contents of charsize in bounded and interpreted modes? Just ? it.
Are there any other size changes you noticed?

> Here's the
> statement which creates the list box. Using win32 by the way.
> 
> }}}
<eucode>
> constant    idList = create(List,"",Main,4,cy*19-tint(cy/2),
>                            cx*80+4,cy*10,WS_SCROLLBARS)
> </eucode>
{{{

> 
> The 'cy*10' should set the number of rows to 10 which it does when not 
> bound. 'cy' is the vertical height of a character as returned by the
> function getFontSize.
> 
> }}}
<eucode>
>     setFont(Screen, "Courier New", fs, Normal)
>     charSize = getFontSize(Screen)
> 
>     cx = charSize[1]
>     cy = charSize[2]
> 
> </eucode>
{{{



CChris

new topic     » goto parent     » topic index » view message » categorize

3. Re: Analyze This

Chris, the entire screen is identical except for the vertical length of the
list box. The font seems to be identical in the list box from both, bound 
and not bound. The rows in the list box are whole and not clipped. Windows
has always adjusted the list box to a whole number of rows if you happened
to choose the vertical size incorrectly.

cx and cy are identical, bound and not bound, (10,20)

It would seem to me that bound and not bound should always produce the same
screen, which they do on most screens except for several examples which I
have that contain list boxes.

BTW I'm running EU 2.4 and win32lib 59.1 and XP 2nd SP, but I don't think that
should make
a difference.

new topic     » goto parent     » topic index » view message » categorize

4. Re: Analyze This

George Walters wrote:
> 
> Chris, the entire screen is identical except for the vertical length of the
> list box. The font seems to be identical in the list box from both, bound 
> and not bound. The rows in the list box are whole and not clipped. Windows
> has always adjusted the list box to a whole number of rows if you happened
> to choose the vertical size incorrectly.
> 
> cx and cy are identical, bound and not bound, (10,20)
> 
> It would seem to me that bound and not bound should always produce the same
> screen, which they do on most screens except for several examples which I
> have that contain list boxes.

Could you post a minimal example program that displays this behavior?

Matt

new topic     » goto parent     » topic index » view message » categorize

5. Re: Analyze This

I've tried to do this Matt. The code below does create different list boxes
bound/shroud and not bound/shroud on my computer. The bound/shroud is longer.

include win32lib.ew
global integer sx, sy, maxX, maxY, fs, cx, cy, sw, sh,
	heightHorScroll,widthVertScroll,widthFrame
global sequence charSize, fontType

global function ceil(object a)
	return floor(a) + 1
end function

global function tint(object a)
	return floor(a)
end function

    fontType = "Courier New"
    maxX = getSystemMetrics(SM_CXFULLSCREEN)
    maxY = getSystemMetrics(SM_CYFULLSCREEN)
    heightHorScroll = getSystemMetrics(SM_CYHSCROLL)
    widthVertScroll = getSystemMetrics(SM_CXVSCROLL)
    widthFrame = getSystemMetrics(SM_CXFIXEDFRAME)

    -- Scale font size to match screen resolution
    if maxX > 1200 then
    	fs = 14
    elsif maxX > 1000 then
    	fs = 12
    elsif maxX > 800 then
        fs = 11 -- font size
    elsif maxX > 640 then
        fs = 9
    else
    	fs = 8
    end if

    setFont(Screen, fontType, fs, Normal)
    charSize = getFontSize(Screen)

    cx = charSize[1]
    cy = charSize[2]
    
    sw = cx * 82 --+ 20
    sh = cy * 33 --+ 10

    sx = ceil((maxX - sw)/2)
    sy = ceil((maxY - sh)/2)
        
constant Main = create(Window,"ARE020-Cash Receipts Entry",
                       0,sx,sy+10,sw,sh,0)

constant    idList =
create(List,"",Main,4,cy*19-tint(cy/2),cx*80+4,cy*10,WS_SCROLLBARS)

WinMain(Main,Normal)    


new topic     » goto parent     » topic index » view message » categorize

6. Re: Analyze This

George Walters wrote:
> I've tried to do this Matt. The code below does create different list boxes
> bound/shroud and not bound/shroud on my computer. The bound/shroud is longer.

I don't know the answer, but I wonder if it has something
to do with "Windows subsystem version" being different
when you bind vs running the interpreter normally.

http://www.openeuphoria.org/cgi-bin/esearch.exu?fromMonth=1&fromYear=7&toMonth=1&toYear=7&postedBy=rds&keywords=windows+gui+poke+exw.exe+subsystem

Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com

new topic     » goto parent     » topic index » view message » categorize

7. Re: Analyze This

George Walters wrote:
> 
> I've tried to do this Matt. The code below does create different list boxes
> bound/shroud and not bound/shroud on my computer. The bound/shroud is longer.
> 

Using the svn head version of euphoria, and win32lib v0.60.6, I can't 
reproduce.  Since you're using old binaries and win32lib, this will 
probably be difficult to track down, and since it appears to be solved
by later versions...

Matt

new topic     » goto parent     » topic index » view message » categorize

8. Re: Analyze This

I don't know what this means but it sounds reasonable.

new topic     » goto parent     » topic index » view message » categorize

9. Re: Analyze This

I guess I'll have to just find them and work around it. The only real issue
is sometimes when this happens, the list box will expand under some buttons
that are at the bottom of the screen. I don't know this until it's bound then
installed at a customer site. It just looks funky.

new topic     » goto parent     » topic index » view message » categorize

10. Re: Analyze This

George Walters wrote:
> 
> I don't know what this means but it sounds reasonable.

Some people drive me nuts by replying "thanks" and quoting all 900+ lines of the
original post. You go the other way. I suspect that you need to be told that *THE
PERSON YOU JUST TALKED TO* has *NO IDEA* you were talking to them.

Regards,
Pete

new topic     » goto parent     » topic index » view message » categorize

11. Re: Analyze This

Continueing on this thread. I've discovered that win32lib getFontSize is wrong
..at least in my opinion. Look at this link which has a drawing of characters.

http://msdn2.microsoft.com/en-us/library/ms534015.aspx

Then look at the winlib32 code below. "tmInternalLeading" is actually added
twice
for the character heigth. I think that "tmInternalLeading" should be removed
from the char heigth. I've rem'd it out and my list boxes have the correct
height
since I'm sizing them by character heights. If I'm wrong please explain.

global function getFontSize( integer id )

    -- get metrics for current font

    integer width, height, maxwidth
    atom tm

    -- text metric structure
    tm  = w32acquire_mem(0, SIZEOF_TEXTMETRIC )

    -- get the metrics of the font (queryFont will prepend the DC)
    if not queryFont( id, xGetTextMetrics, {tm} ) then
        warnErr( Err_GETFONTSIZE )
    end if

    -- assign values
    width   = w32fetch(tm,tmAveCharWidth)
    maxwidth   = w32fetch(tm,tmMaxCharWidth)
    height  = w32fetch(tm,tmHeight) +
                w32fetch(tm,tmInternalLeading) + <----------- remove this 
                w32fetch(tm,tmExternalLeading)

    -- release
    w32release_mem( tm )

    -- return results
    return { width, height, maxwidth }

end function



George Walters wrote:
> 
> Can someone explain to me why the list box on a bound/shrouded program is
> a difference vertical length than when not bound/shrouded? When bound it
> contains 11 rows of items and not bound it has 10 rows of items. Here's the
> statement which creates the list box. Using win32 by the way.
> 
> }}}
<eucode>
> constant    idList = create(List,"",Main,4,cy*19-tint(cy/2),
>                            cx*80+4,cy*10,WS_SCROLLBARS)
> </eucode>
{{{

> 
> The 'cy*10' should set the number of rows to 10 which it does when not 
> bound. 'cy' is the vertical height of a character as returned by the
> function getFontSize.
> 
> }}}
<eucode>
>     setFont(Screen, "Courier New", fs, Normal)
>     charSize = getFontSize(Screen)
> 
>     cx = charSize[1]
>     cy = charSize[2]
> 
> </eucode>
{{{

new topic     » goto parent     » topic index » view message » categorize

12. Re: Analyze This

You're right Pete. I'm so used to email I forget to click the quote text button.
My irritant is that their response is at the end of the 900 lines of code 
instead of at the front and I have to go searching for what they said. So click
the quote text button **FIRST** then start typing.

Pete Lomax wrote:
> 
> George Walters wrote:
> > 
> > I don't know what this means but it sounds reasonable.
> 
> Some people drive me nuts by replying "thanks" and quoting all 900+ lines of
> the original post. You go the other way. I suspect that you need to be told
> that *THE PERSON YOU JUST TALKED TO* has *NO IDEA* you were talking to them.
> 
> Regards,
> Pete

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu