Image scroll

Image scroll

Postby Silvio.Falconi » Mon Oct 15, 2018 5: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: Select all  Expand view
#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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7056
Joined: Thu Oct 18, 2012 7:17 pm

Re: Image scroll

Postby cnavarro » Tue Oct 16, 2018 8: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: Select all  Expand view

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
User avatar
cnavarro
 
Posts: 6541
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Image scroll

Postby nageswaragunupudi » Tue Oct 16, 2018 9: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
User avatar
nageswaragunupudi
 
Posts: 10632
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Image scroll

Postby nageswaragunupudi » Tue Oct 16, 2018 9: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
User avatar
nageswaragunupudi
 
Posts: 10632
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Image scroll

Postby Silvio.Falconi » Wed Oct 17, 2018 8: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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7056
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 114 guests