FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Mouse wheel scrolling in get spinner?
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Mouse wheel scrolling in get spinner?
Posted: Wed May 28, 2008 09:14 AM

How can I get mouse wheel to invoke the up and down actions in a get spinner.
Thanks in advance
Otto

Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Mouse wheel scrolling in get spinner?
Posted: Thu May 29, 2008 11:19 AM

oGet:oVScroll:bGoUp
bGoDown
..............

Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Mouse wheel scrolling in get spinner?
Posted: Thu May 29, 2008 09:10 PM

Thank you for your help. I tried your code but it didn't work.
Does someone have a get class changed for mousewheel support?
Thanks in advance
Otto

Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Mouse wheel scrolling in get spinner?
Posted: Thu May 29, 2008 10:28 PM

FUNCTION MAIN()
local nVal := -1
local oGet
private oDlg

DEFINE DIALOG oDlg

@ 1,1 GET oGet VAR nVal;
PICTURE "999" SPINNER
oGet:bChange:={||MyFun()}

@ 1,15 SAY "..."

ACTIVATE DIALOG oDlg CENTER

RETURN NIL

procedure MyFun
oDlg:aControls[2]:SetText(oDlg:aControls[1]:cText())
return
[/code]

Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Mouse wheel scrolling in get spinner?
Posted: Fri May 30, 2008 05:13 AM

Hello Natter,
thank you for your sample.
I compiled the sample but here mouse wheel does not work.
I think a get field with mouse wheel support should work either if you click on the scrollbar or it the field has focus and you turn the wheel.
And this is not happen.
Regards,
Otto

Posts: 782
Joined: Wed Dec 19, 2007 07:50 AM
Mouse wheel scrolling in get spinner?
Posted: Fri May 30, 2008 06:47 AM
Otto wrote:I compiled the sample but here mouse wheel does not work.
Hi Otto:

Taking the Natter's sample try this:
#include "Fivewin.ch"

Static oGet

Function Main()

   Local oGet, oDlg, ;
         nVal := -1

   DEFINE DIALOG oDlg

   TGet_Modify()

   @  1,  1 GET oGet VAR nVal ;
            PICTURE "999" SPINNER

   oGet:bChange:={ || MyFun( oDlg ) }

   @  1, 15 SAY "..."

   ACTIVATE DIALOG oDlg CENTERED

Return Nil

//---------------------------------------------------------//

Static Function MyFun( oDlg )

   oDlg:aControls[ 2 ]:SetText( oDlg:aControls[ 1 ]:cText() )

Return Nil

//---------------------------------------------------------//

Static Function TGet_Modify()

  Override Method MouseWheel In Class TGet With UseTheWheel

Return Nil

//---------------------------------------------------------//

Static Function UseTheWheel( nKey, nDelta, nXPos, nYPos )

   Local Self := QSelf()

   If nDelta > 0
      Self++
   Else
      Self--
   EndIf

Return Nil
Best regards.

Manuel Mercado
manuelmercado at prodigy dot net dot mx
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Mouse wheel scrolling in get spinner?
Posted: Fri May 30, 2008 10:07 AM

Hello Manuel,

Thank you very much for your help. This is working.

I must figure out how to implement this method into TGet class.
I use Harbour too and override I think does not exist in Harbour.

I have uploaded the snip to:

http://www.fwcodesnips.com/

Regards,
Otto

Posts: 782
Joined: Wed Dec 19, 2007 07:50 AM
Mouse wheel scrolling in get spinner?
Posted: Fri May 30, 2008 02:05 PM
Otto wrote:I must figure out how to implement this method into TGet class.
The main virtue of Override and Extend procedures is not having to touch original classes for solve very specific cases.

Besides, I'm sure that Antonio has take note of your request for retouching TGet accordantly in a future FWH release.

Otto wrote:I use Harbour too and override I think does not exist in Harbour.
Unfortunately no (at least up to my version 8.02), we hope that the Harbour's people to implement it soon.

Best regards.

Manuel Mercado
manuelmercado at prodigy dot net dot mx
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Mouse wheel scrolling in get spinner?
Posted: Fri May 30, 2008 02:26 PM

Otto,

Is there a reason that you are not using xHarbour for everything? I use xHarbour exclusively.

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Mouse wheel scrolling in get spinner?
Posted: Fri May 30, 2008 03:34 PM

Hello James, hello Manuel,

Thank you for your help.
No there is not really a reason why I use both.

I tried to insert the method in TGet. I think it should only work on Gets with spinner. Therefore I inserted the proof for lSpinner.

Regards,
Otto

METHOD MouseWheel( nKeys, nDelta, nXPos, nYPos )
IF ::lSpinner=.t.
If nDelta > 0
Self++
Else
Self--
EndIf
ENDIF

Return Nil

//---------------------------------------------------------//

Continue the discussion