'--- RIGHT Position process Case "RIGHT"
'--- Set the Rotation for the object to 180 (in this case 180 is right) object.Rotation = 180
'--- FORCE the LEFT position to Screenwidth - object.width '--- this makes the object LOCK to the right side of the screen Object.Left =system.ScreenWidth-object.Width
'--- Move the inside text to a position to keep it from being '--- off the edge of the object. '--- This would also be used to move things you had inside the widget. desktopx.Object("Test").top = 25 desktopx.Object("Test").left = 22
'--- if the Y (up and down) position is less then 0 '--- it will stop the top at 0 '--- this keeps you from scrolling the object up past the top of the screen. '--- It sets the noMove to True (stops the script from moving the position) If newY <= 0 Then Object.Top = 0 nomove = True End If
'--- set TEMP to the screen height minus the object height '--- This sets the MAX Y position to stop you from '--- moving the object OFF the screen '--- It also sets the noMove to True temp = system.ScreenHeight-object.Height If newY => temp Then Object.Top = temp nomove = True End If
'--- if noMove <> True then go ahead and move the object's top to the newY position. If nomove = False Then Object.Top = newY
'--- TOP Position process Case "TOP"
'--- Set the Rotation for the object to 90 (in this case 90 is DOWN) object.Rotation = 90
'--- FORCE the TOP position to 9 (this could change on your widget) '--- the 9 is because its being Rotated and its not a perfect square '--- this makes the object LOCK to the top of the screen object.top = 9
'--- Move the inside text to a position to keep it from being '--- off the edge of the object. '--- This would also be used to move things you had inside the widget. desktopx.Object("Test").top = 20 desktopx.Object("Test").left = 28
'--- if the X (left/right) position is less then 0 '--- it will stop the left at 0 '--- this keeps you from scrolling the object left past the edge of the screen. '--- It sets the noMove to True (stops the script from moving the position) If newX <= 0 Then Object.Left = 0 nomove = True End If
'--- set TEMP to the screen width minus the object width '--- This sets the MAX X position to stop you from '--- moving the object OFF the screen '--- It also sets the noMove to True temp = system.ScreenWidth-object.Width If newX => temp Then Object.Left = temp nomove = True End If '--- if noMove <> True then go ahead and move the object's top to the newY position. If nomove = False Then Object.Left = newX
'--- BOTTOM Position process Case "BOT"
'--- Set the Rotation for the object to -90 (in this case -90 is UP) object.Rotation = -90
'--- FORCE the TOP position to the screen height minus the object height minus 9 (this could change on your widget) '--- the 9 is because its being Rotated and its not a perfect square '--- this makes the object LOCK to the bottom of the screen object.top = system.ScreenHeight-object.Height-9
'--- Move the inside text to a position to keep it from being '--- off the edge of the object. '--- This would also be used to move things you had inside the widget. desktopx.Object("Test").top = 20 desktopx.Object("Test").left = 22
'--- if the X (left/right) position is less then 0 '--- it will stop the left at 0 '--- this keeps you from scrolling the object left past the edge of the screen. '--- It sets the noMove to True (stops the script from moving the position) If newX <= 0 Then Object.Left = 0 nomove = True End If
'--- set TEMP to the screen width minus the object width '--- This sets the MAX X position to stop you from '--- moving the object OFF the screen '--- It also sets the noMove to True temp = system.ScreenWidth-object.Width If newX => temp Then Object.Left = temp nomove = True End If '--- if noMove <> True then go ahead and move the object's top to the newY position. If nomove = False Then Object.Left = newX
'--- If the cursor is outside of the Top/Left/Bot/Right areas '--- DON'T MOVE IT!! '--- This uses the original top/left that we saved at the beginning of the sub. '--- If you don't use this the object can move all over. Case Else object.Left = OrigL object.Top = OrigT
'--- End the CASE Select End Select
'--- End the Sub End Sub |