|
Post by Rod on Mar 22, 2022 12:03:18 GMT -5
Well one way to display cards is with sprites. This is fast and consumes relatively little memory. There is no flushing involved. But learning how to manage sprites will take a little reading and playing. You could create little sprite routines that easily mimic the qcard functionality or just roll your own display. Here is a sample that just demonstrates how flexible sprites can be. The one caveat is that scrolling will need a strategy but it can be done one set of sprites into view one set out of view. Card Sprite StarterEdit, having just read your last post the one thing that sprites cannot do is multiwindow. Only one sprite enabled window at a time. The other windows could just be drawn with the bmps if they are relatively static. But for gameplay, card picking and moving, card animation, scrolling only one window can be created.
|
|
|
Post by Walt Decker on Mar 23, 2022 8:18:35 GMT -5
I tried to dl Qcard32.dll from the link on Mrs. Watson's site and was redirected to google. Anyone have a good link or perhaps the original zip to share?
|
|
|
Post by turtleman on Mar 23, 2022 11:05:11 GMT -5
Walt: It's rather embarrassing, but I haven't been able to figure out how to implement the minimized window detection! Namely, I'm confused between "CALLDLL #user32, "IsIconic", GfxHndl AS ULONG, Iconic AS BOOLEAN" and the example in the post right below that which includes "OPEN "User32.dll" FOR DLL AS #USER" I substituted the graphics window name in place of GfxHndl, but don't see any change in Iconic when the window is minimized. Hint?
|
|
|
Post by Walt Decker on Mar 23, 2022 12:15:54 GMT -5
Here you go, not tested but should work
OPEN "DMO" FOR WINDOW AS #DMO PRINT #DMO, "TRAPCLOSE END.DMO"
[BEGIN.TIMER] TIMER 150, [CHK.ICONIC] WAIT
'--------------------------------------------- '---------------------------------------------
SUB END.DMO Hndl$
CLOSE #Hndl$ END END SUB
'--------------------------------------------- '---------------------------------------------
[CHK.ICONIC] WinHndl = HWND(#DMO) CALLDLL #user32, "IsIconic", WinHndl AS ULONG, Iconic AS BOOLEAN
IF Iconic THEN PRINT "WINDOW NAMED DMO IS MINIMIZED" GOTO [BEGIN.TIMER] [CHK.ICONIC.END]
|
|
|
Post by Rod on Mar 23, 2022 13:01:10 GMT -5
walt the link is being hijacked by your browser nanny nag. Right click and select download. The download is there it’s just the browser protecting single click download.
|
|
|
Post by Walt Decker on Mar 23, 2022 13:41:06 GMT -5
Thank you, Rod. I have tried 3 different browsers, none have "download" when I right click and if I left click I am redirected to google.
|
|
|
Post by Rod on Mar 23, 2022 13:49:01 GMT -5
Persevere, I am on an iMac but right click, copy the link, paste it to your browsers url box, does it download now? check your download directory. It is possible to download you just need to negotiate your browsers "protection" it's a new browser thing, nothing to do with Alyce whose page has worked flawlessly for years.
|
|
|
Post by turtleman on Mar 23, 2022 14:11:36 GMT -5
Walt: As it turns out, I was using your code in my program as you posted it, but it still didn't work for me. So, after banging my head against the wall for an hour or so, I started "experimenting" with just the standalone example you were kind enough to supply. Now I'm REALLY confused!
Does it really need to loop continually? I was thinking that Iconic would be a static 0 until the window was minimized and then go to 1. I tried eliminating the loop without success. What am I missing? I need a stiff drink!
|
|
|
Post by Chris Iverson on Mar 23, 2022 15:06:11 GMT -5
Does it really need to loop continually? I was thinking that Iconic would be a static 0 until the window was minimized and then go to 1. I tried eliminating the loop without success. What am I missing? I need a stiff drink! It needs to loop continuously, because the "Is iconic" API call does not create some sort of automatically updated status indicator. The API call is meant to answer one single question, and that's all it does. "Is the specified window currently iconic/minimized?" You ask the question once(call the API), and get a single answer. That answer does not update or change. "Is the window minimized right now? Yes or no." If you want to check if the window is minimized again, you need to call the API again. You won't get an updated answer if you don't.
|
|
|
Post by turtleman on Mar 23, 2022 15:16:10 GMT -5
Thanks Chris, that certainly explains things and probably saves me countless hours and bottles of booze! How was I to know that, or does it fall into the "obvious" category? At any rate, I very much appreciate your feedback!
|
|
|
Post by Walt Decker on Mar 23, 2022 15:17:42 GMT -5
Yes, it needs to loop. The reason: Clicking the minimize button triggers an event. Windows sends two messages to the window callback function: WM_SYSCOMMAND and WM_SIZE. Under WM_SYSCOMMAND there are two additional messages SC_MINIMIZE and the coordinates of the mouse cursor Under WM_SIZE there are also two messages, one is SIZE_MINIMIZE, and the other is the client size of the window. You have no way to intercept these messages other than continually checking to see if the minimize flag is set. That is what function IsIconic() does. (Actually there are a number of messages that windows can send but you are only concerned with minimize.) As long as the window is minimized IsIconic() will return a value. When the window is either restored or maximized, IsIconic() will return zero. Bottom line is, you have to arrange your code in such a way as to get the size status for each of your windows that can be minimized. Either that or disable the minimize button via STYLEBITS.
Yes. The snippet I posted printed to main when the window was minimized and did not print when it was restored.
|
|
|
Post by turtleman on Mar 23, 2022 15:29:00 GMT -5
Thanks Walt. Believe it or not, I had disabled the minimize button with STYLEBITS several months ago. However, I recently put it back, undoubtedly encouraged by recent successes with flush/delsegment commands.
|
|
|
Post by Walt Decker on Mar 23, 2022 15:43:25 GMT -5
Thank you, Rod. I finally down loaded it by using copy and then pasting the copy into the path edit box.
|
|
|
Post by turtleman on Mar 24, 2022 5:31:01 GMT -5
Walt: Thanks to your explanation, I now understand how the minimize code works. What I meant by "… does it fall into the obvious category" was simply how on earth is a novice programmer supposed to know this stuff! LOL
I'm now trying to figure out how to integrate the minimize function (for several windows) into the entire program. I'll probably just go back to removing the minimize button(s) altogether.
|
|
|
Post by Walt Decker on Mar 24, 2022 8:53:27 GMT -5
I am sorry. I misunderstood the "obvious" statement. As a novice you will not know this stuff and the LB paradyme discourages knowledge of how things work "under the hood". That is why this forum is valuable. Ask and ye shall receive.
Frankly, I do not understand why you are worried about minimization. The user can not interact with a minimized window. As soon as the window is normalized it is updated with whatever happened to it while it was minimized.
If you are set on checking minimization you can use the following as a guide: '
DIM WinNames$(2) '<--- RETAIN WINDOW TAGS FOR CONVIENCE
WinNames$(0) = "#WIN1" WinNames$(1) = "#WIN2" WinNames$(2) = "#WIN3"
'<---------------- CREATE THE WINDOWS ---------> OPEN "WIN 1" FOR WINDOW AS #WIN1 OPEN "WIN 2" FOR WINDOW AS #WIN2 OPEN "WIN 3" FOR WINDOW AS #WIN3
'<----------- GOODBY HANDLER -----------> PRINT #WIN1, "TRAPCLOSE END.CARDS" PRINT #WIN2, "TRAPCLOSE END.CARDS" PRINT #WIN3, "TRAPCLOSE END.CARDS"
[BEGIN.ICONIC.CHECK] '<--- SET TIMER TIMER 150, [CHECK.ICONIC] [END.ICONIC.CHECK] WAIT
'------------------------------------------------- '-------------------------------------------------
[CHECK.ICONIC] TIMER 0 '<--- DISABLE TIMER
'<-------- CHECK EACH WINDOW FOR MINIMIZATION -------> FOR I = 0 TO 2 IF FN.QueryIconic(WinNames$(I)) THEN 'DO WHATEVER YOU WANT TO DO END IF NEXT I GOTO [BEGIN.ICONIC.CHECK] '<--- GO BACK AND RESET TIMER [CHECK.ICONIC.END]
'------------------------------------------------- '-------------------------------------------------
SUB END.CARDS WinHndl$ '<--- GOODBY
FOR I = 0 TO 2 WinN$ = WinNames$(I) CLOSE #WinN$ NEXT I END END SUB
'-------------------------------------------------- '--------------------------------------------------
FUNCTION FN.QueryIconic(WinTag$)
WinHndl = 0 Iconic = 0
WinHndl = FN.GetHandle(WinTag$) '<--- GET HANDLE OF WINDOW
'<------------- IS WINDOW MINIMIZED? YES = <> 0 NO = 0 ----> CALLDLL #user32, "IsIconic", WinHndl AS ULONG, Iconic AS BOOLEAN
FN.QueryIconic = Iconic '<--- RETURN: 0 = NO, <> 0 = YES END FUNCTION
'-------------------------------------------------- '--------------------------------------------------
FUNCTION FN.GetHandle(WinTag$)
Hndl = 0 WinTag$ = FN.CheckTag$(WinTag$) '<--- MAKE SURE TAG HAS "#" Hndl = HWND(#WinTag$) '<--- GET HANDLE NUMBER
FN.GetHandle = Hndl '<--- RETURN END FUNCTION
'-------------------------------------------------- '--------------------------------------------------
FUNCTION FN.CheckTag$(WinTag$)
'<--- CHECK FOR "#" IN FIRST CHARACTER OF TAG ---> IF LEFT$(WinTag$, 1) <> "#" THEN WinTag$ = "#" + WinTag$
FN.CheckTag$ = WinTag$ '<--- RETURN END FUNCTION
|
|