How can I get mouse wheel to invoke the up and down actions in a get spinner.
Thanks in advance
Otto
Mouse wheel scrolling in get spinner?
Hi Otto:Otto wrote:I compiled the sample but here mouse wheel does not work.
Taking the Natter's sample try this:
Code: Select all
#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
Manuel Mercado
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
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
The main virtue of Override and Extend procedures is not having to touch original classes for solve very specific cases.Otto wrote:I must figure out how to implement this method into TGet class.
Besides, I'm sure that Antonio has take note of your request for retouching TGet accordantly in a future FWH release.
Unfortunately no (at least up to my version 8.02), we hope that the Harbour's people to implement it soon.Otto wrote:I use Harbour too and override I think does not exist in Harbour.
Best regards.
Manuel Mercado
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
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
//---------------------------------------------------------//
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
//---------------------------------------------------------//