Beijer Electronics (formerly QSI Corporation)

Manufacturer of Mobile Data and Human Machine Interface Terminals.
It is currently Wed Nov 22, 2017 5:55 am

All times are UTC - 7 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Wed Mar 11, 2009 10:24 am 
Offline

Joined: Mon Mar 19, 2007 8:56 am
Posts: 21
Hey all,

Here's what I'm trying to do ...

Press an object (without releasing yet), a popup screen appears with text in it, then as the user drags their finger up or down, the text in the popup screen updates per my other code. The original object does not move. This is for a fancy volume control.

Any ideas?

Thanks


Top
 Profile  
 
PostPosted: Wed Mar 11, 2009 11:00 am 
Offline
User avatar

Joined: Thu Mar 02, 2006 2:12 pm
Posts: 487
Location: Salt Lake City, Utah
It's possible with some overrides on a button object, but I certainly see the potential of some strange behavior if your not careful. I was able to do this with a Screen, Button, Slider, and Label. The Slider and Label I placed inside the screen. I added this code to the slider:

Code:
init parent := screen_1
init xpos := 0
init ypos := 40
init width := 320
init height := 200
init direction := move_up

func ValueChanged()
    label_1.value = str(slider_1.Value)
endfunc


and this code to the button.

Code:
func ScreenPress (x as integer, y as integer) returns boolean
    handles MSG_SCREEN_PRESS

    screen_1.enabled = true
    sendtofront(screen_1)
    fakescreenmsg(SCREEN_RELEASE, x, y, 0, 0)
    fakescreenmsg(SCREEN_PUSH, x, y, 0, 0)

    return default (x, y)
endfunc


I've attached an example workspace to this post. If you don't want to see the slider, try putting a Label in front of it. If you want to put an Image object front of the slider, you'll need to create a custom template based off the ImageV2 object and erase this code or change the "return true" to "return false":

Code:
fixed func ScreenPress(xdown as integer, ydown as integer) returns boolean
    handles MSG_SCREEN_PRESS

    handlepress()
    return true
endfunc

fixed func ScreenMove(xto as integer, yto as integer,xfrom as integer, yfrom as integer) returns boolean
    handles MSG_SCREEN_MOVE
    return true
endfunc

fixed func ScreenRelease(xup as integer, yup as integer) returns boolean
    handles MSG_SCREEN_RELEASE

    handlerelease()
    return true
endfunc


Do this in a template copy, not in the library.


Attachments:
slider_screen_ex.qly [5.71 KiB]
Downloaded 148 times

_________________
Ron L.

http://www.beijerelectronicsinc.com/
Top
 Profile  
 
PostPosted: Wed Mar 11, 2009 11:18 am 
Offline
QSI Support
QSI Support
User avatar

Joined: Wed Mar 08, 2006 12:25 pm
Posts: 881
Location: Salt Lake City, Utah
One thing that could be useful in this is: SetCapture -- you may want to call SetCapture in your screen down and RemoveCapture in your screen up. One other tip: You probably do not want to use the PopupScreenV2 object here (despite the name). A regular screen will be much better.

_________________
Jeremy
http://www.beijerinc.com


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 7 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group