FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveMac / FivePhone (iPhone, iPad) resizing window and image control
Posts: 166
Joined: Wed Nov 25, 2015 07:13 PM
resizing window and image control
Posted: Sat Jun 16, 2018 05:48 PM
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 (fw): Select all Collapse
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:


With the newest lib this gives another result:


If I look in the source of Windows.prg there si something strnage too?
Code (fw): Select all Collapse
 
 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
Posts: 1516
Joined: Thu May 27, 2010 02:06 PM
Re: resizing window and image control
Posted: Sun Jun 24, 2018 09:20 AM

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.
Posts: 166
Joined: Wed Nov 25, 2015 07:13 PM
Re: resizing window and image control
Posted: Wed Jun 27, 2018 05:05 AM

Hello Manuel,

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

Kind regards,



René Koot

Continue the discussion