Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Questions (Windows Mobile)
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Questions (Windows Mobile) Post any question regarding Basic4ppc.

MouseMove position

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-12-2009, 07:58 AM
Knows the basics
 
Join Date: Dec 2008
Posts: 77
Awards Showcase
Beta Tester 
Total Awards: 1
Default MouseMove position

Is there anyway to detect if a MouseMove event is going up or down?

If the first value, moving down, is less than the new value, it would be moving up.

One option is with a Door event to get one property and _MouseMove to get the other.

Another way is calling a Sub from _MouseMove to save the Y position and check the new value against it.

In both situations saving it in a Global var.
The result is always the same value.
MouseUp and MouseDown obviously work, but not with MouseMove.

I just want a ImageButton to show a value based on the Y location and to decrease when moving Up.

.NET "Control.MousePosition.Y" might help, but I expect it would return the same result.

Any Thoughts?
Reply With Quote
  #2 (permalink)  
Old 04-12-2009, 08:44 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

I'm not sure what your problem is. This works for me
Code:
Sub Globals
    
'Declare the global variables here.
    oldY = 0
End Sub

Sub App_Start
    Form1.Show
End Sub


Sub Form1_MouseMove(x, y)
    oy = oldy
    oldy = y
    
If y < oy Then
        Label1.Text = 
"Going up!"
    
Else If y > oy
        Label1.Text = 
"Going down!"
    
Else
        Label1.Text = 
"Going nowhere!"    
    
End If
End Sub
Reply With Quote
  #3 (permalink)  
Old 04-12-2009, 04:24 PM
Knows the basics
 
Join Date: Dec 2008
Posts: 77
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Quote:
Originally Posted by agraham View Post
I'm not sure what your problem is. This works for me
Code:
Sub Globals
    
'Declare the global variables here.
    oldY = 0
End Sub

Sub App_Start
    Form1.Show
End Sub


Sub Form1_MouseMove(x, y)
    oy = oldy
    oldy = y
    
If y < oy Then
        Label1.Text = 
"Going up!"
    
Else If y > oy
        Label1.Text = 
"Going down!"
    
Else
        Label1.Text = 
"Going nowhere!"    
    
End If
End Sub

Well I missed the oy = oldy
Thanks, it works.

Now another question.

I'm having trouble with args()
The only way a command line seems to work is
Code:
If ArrayLen(args())=2 then Form1.Show Else msgbox("NoForm")
How can the argument be saved, or read?

Code:
For.....
    
If args(i) = -ShowTheForm then Form1.Show Else msgbox("NoForm")
Next
Index Out Of Range
Reply With Quote
  #4 (permalink)  
Old 04-12-2009, 04:34 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Like this
Code:
    If ArrayLen(args()) > 0 Then
    
For i = 0 To ArrayLen(args()) - 1
        msg = msg & args(i) & 
CRLF
    
Next
Else
    msg = 
"No arguments"
End If
Msgbox(msg)
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
The Mousemove event N1c0_ds Questions (Windows Mobile) 1 11-08-2008 03:36 PM
MouseMove over Image - problem DaveW Questions (Windows Mobile) 10 11-04-2008 08:27 AM
How can I get the position of cursor in then text box? fishworld2006 Questions (Windows Mobile) 4 08-20-2008 04:53 AM
Windows position WZSun Basic4ppc Wishlist 12 06-08-2008 02:56 AM
Position of form designer pixelpoint Basic4ppc Wishlist 0 08-16-2007 12:51 PM


All times are GMT. The time now is 04:16 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0