1. RE: XControls

I noticed that too and couldnt use it (it crashed) so i had to change 
this in manage_now():

    -- Rect = { 0, Rect[3] - Rect[1], Rect[6] + Rect[2] }
    Rect = { 0, Rect[3] - Rect[1], Rect[4] - Rect[2] } 

Derek Parnell wrote:
> 
> 
> to Don Philips:
> 
> I've downloaded xControls to see how it runs with the 
> soon-to-be-released win32lib. Everything seems to be going fine except=
 
> that you are using getClientRect() and expecting a 6-element sequence to=
 
> be returned. But the getClientRect() in win32lib has only ever returned=
 
> a 4-element sequence. What am I missing here?
> 
> 
> -- 
> Derek
> 
> 
>

new topic     » topic index » view message » categorize

2. RE: XControls

> to Don Philips:
> 
> I've downloaded xControls to see how it runs with the 
> soon-to-be-released win32lib. Everything seems to be going fine except 
> that you are using getClientRect() and expecting a 6-element sequence to 
> be returned. But the getClientRect() in win32lib has only ever returned 
> a 4-element sequence. What am I missing here?
> 
> 
> -- 
> Derek

You know Derek, I am not really positive I can answer your question with 
any certainty.

I do know for a fact that (in the very least) that your last Win32Lib 
version did indeed return a six element sequence.  I am not positive 
about any previous version before this however.  I am sure that if I was 
wrong people would have complained about the code not working before 
this.

Its been awile before I looked at that particular piece of code, but if 
memory serves it went like this...

If the window was a child located at 0, 0 with a width height of 50 each 
then the sequence would be: { 0, 0, 50, 50, 50, 50 }.

But if the child window was not started at 0, 0 it was slightly 
different.  If (for example) it started at 20, 20 and w/h was 50 each it 
would return { 20, 20, 70, 70, 50, 50 }.

The first four numbers were the absolute window coordinates and numbers 
5 and 6 respectively were the width and height (as I recall).

I knew from you pre-sending me the beta that this was broken/ removed.  
I probably shouldnt have used them to begin with but I just couldnt help 
myself =)  The fix was/ is quite easy so I was not worried about it at 
the moment.  I am waiting for the official new release before I make any 
fixes or changes to the code.

Cheers!  Don


Oh yes, btw... Nexus 2.4 is coming, ohh yeah its coming...

I am thinking perhaps I will submit a beta as such for testing before I 
put too much more work into it.  Its so far, very interesting... 
collapsable procedures/ functions if then etc, procedure and function 
visual horizontal line markers (think VB) and other such goodies...

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

3. RE: XControls

> >Oh yes, btw... Nexus 2.4 is coming, ohh yeah its coming...
> >  
> >
> Well, don't tease! Let's have a look-see!
> 
> I use UltraEdit right now, and the Editor in the IDE... but I'm always 
> looking for something better, and I've always wanted collapseable code 
> sections.

Well I wasnt going to post it *quite* yet, but what the heck.  I just 
submitted it about 3 minutes ago.  I already gave one warning, but here 
it is again.  It should be bug free up to this point (I do a heck alot 
to try and break my code), but some things I just havnt gotten around to 
coding yet...

So a couple of the toolbar buttons do nothing (like print, execute, 
configure), and I have not had the time to create some of the dialogs so 
there is no way in this version to change the word lists or the colors.  
Still it is usable and functional.  Coments of course (or bugs) are 
welcome...

Don

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

4. RE: XControls

Don Phillips wrote:
> 
> 
> > to Don Philips:
> > 
> > I've downloaded xControls to see how it runs with the 
> > soon-to-be-released win32lib. Everything seems to be going fine except 
> > that you are using getClientRect() and expecting a 6-element sequence to 
> > 
> > be returned. But the getClientRect() in win32lib has only ever returned 
> > a 4-element sequence. What am I missing here?
> > 
> > 
> > -- 
> > Derek
> 
> You know Derek, I am not really positive I can answer your question with 
> 
> any certainty.
> 
> I do know for a fact that (in the very least) that your last Win32Lib 
> version did indeed return a six element sequence.  I am not positive 
> about any previous version before this however.  I am sure that if I was 
> 
> wrong people would have complained about the code not working before 
> this.
> 
> Its been awile before I looked at that particular piece of code, but if 
> memory serves it went like this...
> 
> If the window was a child located at 0, 0 with a width height of 50 each 
> 
> then the sequence would be: { 0, 0, 50, 50, 50, 50 }.
> 
> But if the child window was not started at 0, 0 it was slightly 
> different.  If (for example) it started at 20, 20 and w/h was 50 each it 
> 
> would return { 20, 20, 70, 70, 50, 50 }.
> 
> The first four numbers were the absolute window coordinates and numbers 
> 5 and 6 respectively were the width and height (as I recall).
> 
> I knew from you pre-sending me the beta that this was broken/ removed.  
> I probably shouldnt have used them to begin with but I just couldnt help 
> 
> myself =)  The fix was/ is quite easy so I was not worried about it at 
> the moment.  I am waiting for the official new release before I make any 
> 
> fixes or changes to the code.
> 


In an old version of win32lib, getClientRect does in fact return 6 
elements:

global function getClientRect( integer id )

    -- returns rectangle of the client area, accounting for
    -- the toolbar and status bar.
    
    integer x, y, cx, cy, toolbar, statusbar  
    atom ptrRect, hdc
    sequence rect, size

    rect = repeat( 0, 6 )

    if id = Screen
     or
       id = Printer
    then

        hdc = getDC( id )
        
        -- screen size
        --rect[1] = 0
        --rect[2] = 0
        rect[3] = w32Func( xGetDeviceCaps, {hdc, HORZRES} )
        rect[4] = w32Func( xGetDeviceCaps, {hdc, VERTRES} )
    
        releaseDC( id )
    else
             
        -- Allocate a rectangle structure
        ptrRect = acquire_mem( 0, SIZEOF_RECT )
    
        -- get client rectangle size
        if not w32Func( xGetClientRect, {getHandle(id), ptrRect} ) then
            warnErr( Err_GCRGETCLIENTRECT )
        end if
        rect[1..4] = peek4u({ptrRect,4})
        --rect[1] = fetch( ptrRect, rectLeft )
        --rect[2] = fetch( ptrRect, rectTop )
        --rect[3] = fetch( ptrRect, rectRight )
        --rect[4] = fetch( ptrRect, rectBottom )
    
        -- Free the structure
        release_mem( ptrRect )
    
    end if
    -- fetch the values

    -- is there a toolbar?
    toolbar = window_toolbar[ id ]
    if toolbar and ((vWinMainState = kNotStarted) or 
(call_func(r_isVisible, {toolbar}))) then
                            
        -- get the size of the toolbar
        size = getCtlSize( toolbar )
        
        -- add height to the y value
        rect[2] += size[2]
        rect[4] -= size[2]
    end if                      
	          
    -- is there a statusbar?
    statusbar = window_statusbar[ id ]
    if statusbar and ((vWinMainState = kNotStarted) or 
(call_func(r_isVisible, {statusbar}))) then
    
        -- get the size of the toolbar
        size = getCtlSize( statusbar )
        
        -- subtract height from the y value
        rect[4] -= size[2]
    
    end if                      
                              
    rect[5] = rect[3]
    rect[6] = rect[4]
    return rect
	          
end function
r_getClientRect = routine_id("getClientRect")

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

Search



Quick Links

User menu

Not signed in.

Misc Menu