| View previous topic :: View next topic |
| Author |
Message |
BenSides Newbie
Joined: 06 Jan 2003 Posts: 2
|
Posted: Tue Jan 07, 2003 3:29 pm Post subject: Picture viewer |
|
|
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 |
|
 |
Tsunami1988 Contributor


Joined: 15 Aug 2002 Posts: 70 Location: The Netherlands
|
Posted: Tue Jan 07, 2003 3:35 pm Post subject: Re: Picture viewer |
|
|
| 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? Both are very easy  |
|
| Back to top |
|
 |
cnodnarb Professional Member


Joined: 11 Sep 2002 Posts: 766 Location: Eastman, GA
|
Posted: Tue Jan 07, 2003 4:52 pm Post subject: |
|
|
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 I sound like an overbearing parent
NodNarb |
|
| Back to top |
|
 |
BenSides Newbie
Joined: 06 Jan 2003 Posts: 2
|
Posted: Tue Jan 07, 2003 5:14 pm Post subject: Re: Picture viewer |
|
|
>>>>Do you want an explanation or the code? <<<
Both! 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 . Like tsunamai, thanks for the quick response, as well as the code with comments. I'll get on it tonight, you guys are great.
Ben _________________ Ben |
|
| Back to top |
|
 |
Tsunami1988 Contributor


Joined: 15 Aug 2002 Posts: 70 Location: The Netherlands
|
Posted: Tue Jan 07, 2003 5:20 pm Post subject: Re: Picture viewer |
|
|
| BenSides wrote: | | ... Like tsunamai, thanks for the quick response, ... |
Let's thank that one to the creator of VDS Checkup  |
|
| 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
|
|