Re: WinClass Question for Al (part 2)
- Posted by Al Getz <Xaxo at aol.com> Dec 22, 2005
- 520 views
don cole wrote: > > snip > > > > I meant to ask you... was your intention with this viewer to stop > > directory wrap around (ie after the last picture the viewer jumps > > back to the beginning of the directory...first pic) or was that an > > accident? > > > > > In onClick_ButtonForward() I added: > > count=count+1 > if count>=totalSupportedFiles then > SSToggle=0 > retv=win:KillTimer(0,Tid) > count=totalSupportedFiles > DirListIndex=DirListIndex-1 > end if > > This is to intentionally stop the slide show after it's over. > Why would you want to see it again? > Unless you are showing it in a department store window or something like that. > > That reminds me I have to write something in there so the screensaver doesn't > kick in. On my computer the screen just goes black after a while. > Maybe put a keystroke in the timer or onClick_ButtonForward(). > Can you force a keystroke with WinClass? > > One other thing I have friend who would like to see this slide show but only > uses Lenux. Would it be a lot of work to make this cross platform? > > Don Cole > A Bug is an un-documented feature. > A Feature is a documented Bug. To force a keystroke you can use this: void=win:IDSendMessage(MCx,WM_KEYDOWN,#22,0) for example to force a keydown. The only way to make this cross platform is to use a library that allows windows programs to run under Linux. The reason is the GdiPlus lib is made for Windows. There is a lib called "Wine" that allows Windows programs to run under Linux, but i've never tried it. Perhaps you can ask some others who have some experiance with it about this. BTW i had a tiny problem with the 'count' in that if there are any files that are not picture files in the directory they tend to mess up the count, so that pic #1 might come out pic #2 if you forward to the end of the directory and then back up to the beginning. I tried this with only 8 pictures in a directory and one ex.err file that got there by accident when the viewer first crashed without the include file i talked about. What happens is when i forward to the last pic (and maybe hit forward another time not knowing it's the last pic) then go backward trying to get to the first pic, the pic count gets all messed up because that one extra file (ex.err) messes up the 'count' variable. In other words, it looks like maybe managing the 'count' variable to keep track of pics (which by the way is also a good idea) needs to be looked at again (with at least one pic that is not a picture in the same directory as some pictures you are viewing). In my original viewer i only kept track of files by index, even if they were not pics, so it counted everything in the directory. This was not as good as having 'count', but it was easier to implement :) Take care, Al And, good luck with your Euphoria programming! My bumper sticker: "I brake for LED's"