FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Image scroll
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Image scroll
Posted: Mon Oct 15, 2018 05:30 PM
If I have an Image with Scroll ( vertical and Horizontal)

I click on image and I can see the coordinates

I f move the scroll and I click I see the same coordinates How I make to see the right position ?
Code (fw): Select all Collapse
#include "FiveWin.ch"

static oWnd,oImage

function Main()

Local cImage

  DEFINE WINDOW oWnd TITLE "Testing the Mouse"

    @ 0, 0 IMAGE oImage SIZE 480, 400 OF oWnd SCROLL NOBORDER

 SET MESSAGE OF oWnd TO "Press any mouse button" CENTERED


   oImage:bLClicked    = { | nRow, nCol, nFlags | Msginfo( nrow,ncol) }






   ACTIVATE WINDOW oWnd;
   ON INIT cImage:= GetImage()

RETURN NIL
//----------------------------------------------------------------------//

function GetImage()

   local gcFile := cGetFile( "Bitmap (*.bmp)| *.bmp|" +         ;
                             "DIB   (*.dib)| *.dib|" +          ;
                             "PCX   (*.pcx)| *.pcx|"  +         ;
                             "JPEG  (*.jpg)| *.jpg|" +          ;
                             "GIF   (*.gif)| *.gif|"  +         ;
                             "TARGA (*.tga)| *.tga|" +          ;
                             "RLE   (*.rle)| *.rle|" +          ;
                             "All Files (*.*)| *.*"             ;
                            ,"Please select a image file", 4 )

   if ! Empty( gcFile ) .and. File( gcFile )
      oImage:LoadBmp( gcFile )


endif

return gcFile
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Image scroll
Posted: Tue Oct 16, 2018 08:37 AM
Please try with this,
But I think the movement of the scrolls controls is inverted: when pressed on the vertical scroll moves horizontally and when pressed on the horizontal scroll moves vertically.

Code (fw): Select all Collapse
function Main()

   Local cImage

   DEFINE WINDOW oWnd TITLE "Testing the Mouse"

   @ 0, 0 IMAGE oImage SIZE 200, 200 OF oWnd SCROLL NOBORDER

   //SET MESSAGE OF oWnd TO "Press any mouse button" CENTERED


   oImage:bLClicked    = { | nRow, nCol, nFlags | Msginfo( Str( nrow ), Str( ncol ) ), ;
                             MsgInfo( Str( oImage:nX ), Str( oImage:nY ) ) }

   ACTIVATE WINDOW oWnd ON INIT cImage := GetImage()

RETURN NIL


function GetImage()

   local gcFile := cGetFile( "Bitmap (*.bmp)| *.bmp|" +         ;
                             "DIB   (*.dib)| *.dib|" +          ;
                             "PCX   (*.pcx)| *.pcx|"  +         ;
                             "JPEG  (*.jpg)| *.jpg|" +          ;
                             "GIF   (*.gif)| *.gif|"  +         ;
                             "TARGA (*.tga)| *.tga|" +          ;
                             "RLE   (*.rle)| *.rle|" +          ;
                             "All Files (*.*)| *.*"             ;
                            ,"Please select a image file", 4 )

   if ! Empty( gcFile ) .and. File( gcFile )
      oImage:LoadBmp( gcFile )
   endif

return gcFile
Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo

El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Image scroll
Posted: Tue Oct 16, 2018 09:38 PM
I f move the scroll and I click I see the same coordinates How I make to see the right position ?


Row = nRow - oImage:nX
Col = nCol - oImage:nY
Regards



G. N. Rao.

Hyderabad, India
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Image scroll
Posted: Tue Oct 16, 2018 09:42 PM
cnavarro wrote:But I think the movement of the scrolls controls is inverted: when pressed on the vertical scroll moves horizontally and when pressed on the horizontal scroll moves vertically.

This is a bug introduced in FWH1801. Mr Silvio is using 1712 and he does not have this problem.
Fixed in FWH1808.
Regards



G. N. Rao.

Hyderabad, India
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Image scroll
Posted: Wed Oct 17, 2018 08:06 AM

ok
I use Scroll on image...
If I use oImage:Vscroll:getpos() or oImage:Hscroll:getpos()
why it is not the same result ?

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com

Continue the discussion