resizing window and image control

Post Reply
User avatar
plantenkennis
Posts: 151
Joined: Wed Nov 25, 2015 7:13 pm
Location: the Netherlands
Contact:

resizing window and image control

Post by plantenkennis »

Hello,
I have a function that shows a bigger image in a window. With the older libs (date 23-03-2018) it worked fine when I use the next code:

Code: Select all

FUNCTION RK_FotoGroot(cFoto)
*to show a big picture  

LOCAL oWndFoto, oBtnZoom
LOCAL oFoto
LOCAL nWidth := 0
LOCAL nHeight := 0
LOCAL nFotoWidth
LOCAL nFotoHeight

DEFINE DIALOG oWndFoto TITLE 'grote foto' ;
    FROM 0, 0 TO 800, 800

    @ 40, 10 IMAGE oFoto FILENAME cFoto OF oWndFoto SIZE 1000, 1000

    nFotoWidth := oFoto:GetWidth()
    nFotoHeight := oFoto:GetHeight()

    oFoto:SetSize( nFotoWidth, nFotoHeight )
       oFoto:SetScaling( 1 )  
       
    oWndFoto:SetSize( nFotoWidth + 20, nFotoHeight + 40 )
        
    @ 10, 10 BUTTON oBtnZoom PROMPT 'Ok' OF oWndFoto ACTION oWndFoto:End()
       oBtnZoom:SetPos( 5, oWndFoto:nWidth / 2 - oBtnZoom:nWidth / 2 )  

ACTIVATE DIALOG oWndFoto

RETURN NIL
 
That gives the next result:
Image

With the newest lib this gives another result:
Image

If I look in the source of Windows.prg there si something strnage too?

Code: Select all

 
 METHOD ChangeSize(nNewHeight, nNewWidth) INLINE WinSizeChange(::hWnd, nNewHeight, nNewWidth ) 
   
   METHOD SetSize( nWidth, nHeight ) INLINE WinSetSize( ::hWnd, nWidth, nHeight )  
   
   METHOD SetSizeChange(nNewHeight, nNewWidth ) INLINE WinSetSizeChange(::hWnd, nNewHeight, nNewWidth ) 
 
As you can see METHOD ChangeSize and SetSize first have Height and than Width, While SetSize works with Width and than Height.

Is this as it is ment to be?
Kind regards,

René Koot
User avatar
mastintin
Posts: 1502
Joined: Thu May 27, 2010 2:06 pm

Re: resizing window and image control

Post by mastintin »

If I look in the source of Windows.prg there si something strnage too?
Yes, I detect this , It would be easy to change it, but we would lose the retro compatibility in old programs ...

I have seen the problem of the photos, is the new setsize method that overwrites setsize Tcontrol Method . I rename this method to Resize and setsize is now ok.
New libs in https://www.dropbox.com/s/a3qlwm9lkhwy7 ... s.zip?dl=0

The get problem is complex to solve for me ... I will try to improve it a bit :-)
Saludos.
User avatar
plantenkennis
Posts: 151
Joined: Wed Nov 25, 2015 7:13 pm
Location: the Netherlands
Contact:

Re: resizing window and image control

Post by plantenkennis »

Hello Manuel,

Thanks for these new libs, the resizing is working OK now.
Kind regards,

René Koot
Post Reply