forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Need Bitmap to change colors

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
starfire
Newbie


Joined: 16 Dec 2008
Posts: 24
Location: Florida USA

PostPosted: Sat Dec 20, 2008 10:46 pm    Post subject: Need Bitmap to change colors Reply with quote

Hi,

I have a bitmap image that is a yellow circle on my vds form app that I created. I want to have the circle turn red when ever there is text filled in for edit box 2. If no text is typed into the edit 2 box from the customer I need it to stay yellow. Is this possible? Any clues as to how to do this?

What I believe I need is a if statement of somekind. I am still newbie at this VDS scripting/programming. Not sure how to write it. Can someone help me out?

Thanks
Starfire
Back to top
View user's profile Send private message
DaveR
Valued Contributor
Valued Contributor


Joined: 03 Sep 2005
Posts: 413
Location: Australia

PostPosted: Sun Dec 21, 2008 6:07 am    Post subject: Reply with quote

You need 2 bitmaps, one of each colour. Then place the 2nd one on top of the first one. When you want to see the first bitmap you hide the second bitmap. When you want to see the second bitmap you show the second bitmap.

Code:
  DIALOG CREATE,Change Bitmap,-1,0,240,120
  DIALOG ADD,BITMAP,YellowBITMAP,10,10,100,100,yellow.bmp
  DIALOG ADD,BITMAP,RedBITMAP,10,10,100,100,red.bmp
  DIALOG ADD,BUTTON,BUTTON1,30,135,84,24,Show Yellow
  DIALOG ADD,BUTTON,BUTTON2,65,135,84,24,Show Red
  dialog hide,RedBITMAP
  DIALOG SHOW

:loop
  wait event
  goto @event()

:BUTTON1
  dialog hide,RedBITMAP
  goto loop

:BUTTON2
  dialog show,RedBITMAP
  goto loop

_________________
cheers

Dave
Back to top
View user's profile Send private message
DaveR
Valued Contributor
Valued Contributor


Joined: 03 Sep 2005
Posts: 413
Location: Australia

PostPosted: Sun Dec 21, 2008 6:15 am    Post subject: Reply with quote

The following code will check the edit2's contents every second.

Code:
:evloop
wait event,1
goto @event()

:timer
if @dlgtext(edit2)
  dialog show,redbitmap
else
  dialog hide,redbitmap
end


This is just one way to do it. Using the exit and/or click styles on the edit box is another.

_________________
cheers

Dave
Back to top
View user's profile Send private message
starfire
Newbie


Joined: 16 Dec 2008
Posts: 24
Location: Florida USA

PostPosted: Sun Dec 21, 2008 8:00 pm    Post subject: Reply with quote

Hi Dave,

That worked out great. I played with it awhile to suit my
look, feel and play but I finally got it to work for me in my VDS script.

This is really a learning experience for me. I had a small clue about how to do it but was lost. Thanks for helping me out and giving me the scoop on the code I needed. I can now move on to my next stage on the program.

Thanks
Starfire
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
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

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group