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 


Picture viewer

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


Joined: 06 Jan 2003
Posts: 2

PostPosted: Tue Jan 07, 2003 3:29 pm    Post subject: Picture viewer Reply with quote

Hello,
I am brand new to vds, still using the shareware. So please be patient with my ignorance. There are no books on vds to help guide me, only the woefully inadequate help documentation and this users forum:)
I am trying to write a little picture viewer script with vds. This involves a listbox on the left of the dialog, wherein you click an entry in the list and a corresponding picture (bmp) pops up on the right. Complicated, eh? Well it is for me! lol
Perhaps some code already exists for this common app somewhere, and you can provide me with a link. If not, a quick explanation of how to do the above would be greatly appreciated!!
Thanks,
Ben
Back to top
View user's profile Send private message
Tsunami1988
Contributor
Contributor


Joined: 15 Aug 2002
Posts: 70
Location: The Netherlands

PostPosted: Tue Jan 07, 2003 3:35 pm    Post subject: Re: Picture viewer Reply with quote

BenSides wrote:
Hello,
I am brand new to vds, still using the shareware. So please be patient with my ignorance. There are no books on vds to help guide me, only the woefully inadequate help documentation and this users forum:)
I am trying to write a little picture viewer script with vds. This involves a listbox on the left of the dialog, wherein you click an entry in the list and a corresponding picture (bmp) pops up on the right. Complicated, eh? Well it is for me! lol
Perhaps some code already exists for this common app somewhere, and you can provide me with a link. If not, a quick explanation of how to do the above would be greatly appreciated!!
Thanks,
Ben

Do you want an explanation or the code? Very Happy Both are very easy Smile
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
cnodnarb
Professional Member
Professional Member


Joined: 11 Sep 2002
Posts: 766
Location: Eastman, GA

PostPosted: Tue Jan 07, 2003 4:52 pm    Post subject: Reply with quote

Start VDS and bring up the dialog designer by hitting F2. Add a list and a bitmap element, for this just leave it as list1 and bitmap1...make the list have "click" as a style. Also add a button (button1) and make the caption "Change Directory". Place the button below the list.

Code:

rem get the bitmaps
list filelist,list1,*.bmp

rem wait for an event to happen then jump to it.
:evloop
wait event
goto @event()

rem happens when the "x" is clicked
:close
exit

rem button1 is pushed
:button1button
rem access directory dialog from windows api
%%dirdlg = @dirdlg()

rem if cancel was not pushed and a directory was selected
if %%dirdlg
directory change,%%dirdlg
list filelist,list1,*.bmp
end
goto evloop

:list1click
rem set bitmap
dialog set,bitmap1,@item(list1)
goto evloop


For an advanced excercise, change this to where list1 is floating in a seperate window than bitmap1. Use dialog select,0 and dialog select,1 to access the proper dialog elements in each window. Also try making bitmap1 stretch style and making the dialog resizable. Use @dlgpos(,WH) to get the width and height of the window and dialog setpos,bitmap1 to set the bitmap to fill the whole window.

Crud...too much holiday time with my kids I guess Confused I sound like an overbearing parent Sad

NodNarb
Back to top
View user's profile Send private message AIM Address
BenSides
Newbie


Joined: 06 Jan 2003
Posts: 2

PostPosted: Tue Jan 07, 2003 5:14 pm    Post subject: Re: Picture viewer Reply with quote

>>>>Do you want an explanation or the code? Smile<<<

Both! Very Happy Thanks for a quick response!

>>>>Crud...too much holiday time with my kids I guess I sound like an overbearing parent <<<<

In my case, new to vds, I need an overbearing parent Smile. Like tsunamai, thanks for the quick response, as well as the code with comments. I'll get on it tonight, you guys are great.Smile
Ben

_________________
Ben
Back to top
View user's profile Send private message
Tsunami1988
Contributor
Contributor


Joined: 15 Aug 2002
Posts: 70
Location: The Netherlands

PostPosted: Tue Jan 07, 2003 5:20 pm    Post subject: Re: Picture viewer Reply with quote

BenSides wrote:
... Like tsunamai, thanks for the quick response, ...

Let's thank that one to the creator of VDS Checkup Laughing
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
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