How to Disable TXIMAGE:MouseWheel to resize image? *Solved*

How to Disable TXIMAGE:MouseWheel to resize image? *Solved*

Postby dutch » Sat Sep 16, 2017 3:54 pm

I need to fix size of TXIMAGE. How do I disable Zoom In/Out by MouseWheel?

Thanks in advance.
Last edited by dutch on Sun Sep 17, 2017 4:55 am, edited 1 time in total.
Regards,
Dutch

FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
User avatar
dutch
 
Posts: 1535
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: How to Disable TXIMAGE:MouseWheel to resize image?

Postby cnavarro » Sat Sep 16, 2017 7:58 pm

Dear Dutch
Add at method MouseWheel of class TXImage

Code: Select all  Expand view

METHOD MouseWheel( nKeys, nDelta, nXPos, nYPos ) CLASS TXImage

   local aPoint := { nYPos, nXPos }

   if !Empty( ::bMouseWheel ) .and. ValType( ::bMouseWheel ) = "B"
      Eval( ::bMouseWheel, Self )
      Return nil
   endif

   if ::oRect != nil

   .../...

 


In your code

Code: Select all  Expand view

   oImage:bMouseWheel := { || .T. }
   //oImage:bRClicked := { || .T. }     // Also for disable button right mouse
 
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: 6498
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: How to Disable TXIMAGE:MouseWheel to resize image?

Postby nageswaragunupudi » Sat Sep 16, 2017 8:49 pm

I suggest you use TImage instead of TXImage.
TXImage is intentionally made for giving user full control and therefore till now we did not provide for restricting any user actions.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10207
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: How to Disable TXIMAGE:MouseWheel to resize image?

Postby dutch » Sun Sep 17, 2017 1:24 am

Dear Mr.Rao,

I used BITMAP for many year but when I move BMP file to MySQL field (Mediumblob). I saw the TIMAGE has support it.
Which class that does support image from field instead of TXIMAGE?

nageswaragunupudi wrote:I suggest you use TImage instead of TXImage.
TXImage is intentionally made for giving user full control and therefore till now we did not provide for restricting any user actions.
Regards,
Dutch

FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
User avatar
dutch
 
Posts: 1535
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: How to Disable TXIMAGE:MouseWheel to resize image?

Postby nageswaragunupudi » Sun Sep 17, 2017 3:06 am

By default, the user can pan, zoom and rotate the image with mouse or by touch.
FWH 17.08 onwards you can disable this by setting oImage:nUserControl := 0
So please wait for a day or two.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10207
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: How to Disable TXIMAGE:MouseWheel to resize image?

Postby dutch » Sun Sep 17, 2017 4:53 am

Dear Mr.Rao,

Thank you so much. I would be better, if you can make TIMAGE or BITMAP to support IMAGE from FIELD.
Regards,
Dutch

FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
User avatar
dutch
 
Posts: 1535
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: How to Disable TXIMAGE:MouseWheel to resize image?

Postby dutch » Sun Sep 17, 2017 4:54 am

Dear Navarro,

Thanks once again for your help.
cnavarro wrote:Dear Dutch
Add at method MouseWheel of class TXImage

Code: Select all  Expand view

METHOD MouseWheel( nKeys, nDelta, nXPos, nYPos ) CLASS TXImage

   local aPoint := { nYPos, nXPos }

   if !Empty( ::bMouseWheel ) .and. ValType( ::bMouseWheel ) = "B"
      Eval( ::bMouseWheel, Self )
      Return nil
   endif

   if ::oRect != nil

   .../...

 


In your code

Code: Select all  Expand view

   oImage:bMouseWheel := { || .T. }
   //oImage:bRClicked := { || .T. }     // Also for disable button right mouse
 
Regards,
Dutch

FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
User avatar
dutch
 
Posts: 1535
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 11 guests