View previous topic :: View next topic |
Author |
Message |
marty Professional Member
Joined: 10 May 2001 Posts: 789
|
Posted: Tue Mar 26, 2002 1:52 pm Post subject: TRACKBAR.. Any way to change the color/style? |
|
|
Hi,
I'm trying to change the color of the TRACKBAR element, but doesnt seem to accept any styles (except the ones in the help) or Im maybe doing something wrong...
Is it possible? or Maybe it's possible to use a bitmap as a slider button.
I want to create a volume slider.
Thanks |
|
Back to top |
|
|
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1751 Location: Space and Time
|
Posted: Tue Mar 26, 2002 2:49 pm Post subject: |
|
|
Marty,
Here is a quick code example for what you need. It is for VDS 4.x
but it can be modified for VDS 3.x.
Code: |
rem this is for VDS 4.x only. You can use a dll (VDSKeyboard I think)
rem to test for a mouse down event in VDS 3.x
DIALOG CREATE,Slider,-1,0,194,160
DIALOG ADD,SHAPE,SHAPE1,16,155,7,100,WHITE,BLACK,,RECTANGLE,CLICK
DIALOG ADD,SHAPE,SHAPE2,16,148,20,11,RED,BLACK,,RECTANGLE
DIALOG ADD,SHAPE,SHAPE3,21,167,10,1,black,BLACK,,RECTANGLE
rem To click and drag you must use a blank bitmap. The bitmap click
rem event is generated before the mouse button is let go, that is
rem how we can make it drag. The other click events are created when
rem the mouse button is let go.
DIALOG ADD,BITMAP,BITMAP1,16,148,20,11,,,STRETCH,CLICK
DIALOG ADD,TEXT,TEXT1,124,154,34,13,0
DIALOG ADD,TEXT,TEXT2,62,16,130,18,Click and drag the red box.
DIALOG SHOW
:EVLOOP
wait event
%e = @event()
goto %e
:close
exit
:bitmap1click
REPEAT
%x = @mousepos(X)
%y = @mousepos(Y)
%t = @winpos("Slider", T)
%l = @winpos("Slider", L)
%p = @diff(%y, @sum(%t,40))
if @greater(%p, 100)
%p = 100
end
if @greater(0, %p)
%p = 0
end
DIALOG SETPOS, bitmap1, @sum(%p,10)
DIALOG SETpos, shape2, @sum(%p,10)
DIALOG SETpos, shape3, @sum(%p,15)
dialog set,text1,%p
UNTIL @not(@mousedown(L))
goto EVLOOP
|
Take Care _________________ Chris
Http://theblindhouse.com |
|
Back to top |
|
|
marty Professional Member
Joined: 10 May 2001 Posts: 789
|
Posted: Tue Mar 26, 2002 2:53 pm Post subject: |
|
|
Thanks Chris!
Exacly what I needed!
PS: Assilem now works using another port... |
|
Back to top |
|
|
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1751 Location: Space and Time
|
Posted: Tue Mar 26, 2002 3:16 pm Post subject: |
|
|
Great to hear! Was it the one you gave me before? _________________ Chris
Http://theblindhouse.com |
|
Back to top |
|
|
marty Professional Member
Joined: 10 May 2001 Posts: 789
|
Posted: Tue Mar 26, 2002 8:56 pm Post subject: |
|
|
I'm not sure, now i'm using 7666. Let me know if you want to connect to it
Anyway your solution caused a bit of problems when I put on my interface. I'm already using a Bitmap as the main interface, and adding another bitmap click gave some strange feedback. Like the main bitmap (interface) shifted down, and also another bitmap object that I have shifted upward... weird.. Thanks anyway.. was a nice demo that I will definetly keep.. |
|
Back to top |
|
|
|
|
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 vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|