May 04, 2024, 09:19:08 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


bingo program

Started by hugh, May 27, 2010, 08:49:38 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

hugh

May 27, 2010, 08:49:38 AM Last Edit: May 27, 2010, 11:53:29 AM by hugh
This is my bingo program, needs sprucing up a lot, open to suggestions, and, ridicule, i cant figure how to get rid of the flashing when the program starts up and displays the main board for input
This is the source,
Sorry!

I removed the source as i just copied and pasted it into the message window
seems some got lost, especially 3 subs.

uploaded a zip of the source code below.

hugh

May 27, 2010, 09:49:17 AM #1 Last Edit: May 27, 2010, 06:30:44 PM by Larry McCaughn
Requires Custom Button Designer and Library in order to compile

otherwise you have to change the custom buttons to standard ones, but use the same diminsions.
sorry
Hugh

GWS

Hello Hugh,

It looks like your program was so long - something has chopped off the end ..  ::)

It would probably be easier if you zipped it, and posted the zip ..  :)

It must have taken you at least a couple of days to create that one ..  ;D ;D ;D

best wishes, :)

Graham
Tomorrow may be too late ..

hugh

May 27, 2010, 11:40:47 AM #3 Last Edit: May 27, 2010, 11:50:27 AM by hugh
think your right graham, removing it and  zip uploaded and attached


cheers

hugh


LarryMc

Hugh

On line 26 where you open w1 you have |@swhide on the end after the handler ID.
1st that is not in the proper location for a style flag.
2nd, that is not a valid style flag
The line should read:OPENWINDOW w1,0,0,sw,sh,@SIZE|@NOCAPTION|@MAXIMIZED|@hidden,0,"",&w1handler

On line 132 you have a SHOWWINDOW w1,@SWHIDE
it's not needed because you already have one on line 62

On lines 262 through 269 you have the same problem that you have on line 26, above.

Fixing those may help(I can't tell because my computer is so fast).
But you will still see one 'flicker' because of the structure of your program.

You create w1 as hidden (so you are still looking at your desktop, not a problem)
Before creating any controls  (understandable) you show w1 and display a message box asking which version to run.
Then you hide w1 (so you are now creating all the proper controls) and the desktop is being displayed.
You have a bunch of controls so it is not instantaneous therefore the desktop is shown for a pronounced period of time.
Then you show w1 again.

there are two ways to fix it and it really depends on the look you want.

1. the easiest
create w1 exactly the way you do now
do not use SHOWWINDOW before the messagebox
Use MESSAGEBOX NULL instead of MESSAGEBOX w1 to open the messagebox
(this means the messagebox for English/US appears with your desktop in the background)
then create your proper controls
then show w1

2. other
create a new window w1a exactly the same as w1 is up to the messagebox
that means same size, color, etc with no controls
don't use hidden on w1a so it shows immediately
use MESSAGEBOX w1a to open the messagebox
then create all the proper controls for w1
show w1 and then hide w1a

this is the harder(more lines of code) because you have to add the extra window and handler for that window

Your choice
Option 1 shows the messagebox on the desk top
Option 2 shows the messagebox on the pretty green background.

Hope that helps.

LarryMc

LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

LarryMc

went back an doublecheck and found something else.

Everything in my last post still hold true but one other change needs to be made.

when you create w1 on line 26 you are using the @MAXIMIZED style flag which will override the @hidden flag.

So that style flag, @MAXIMIZED , needs to be removed.

With just a brief glance it doesn't appear you need it anyway since you are creating the window based upon the results from the GETSCREENSIZE command.

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

hugh

Thanks for your 2 post Larry, they are a big help, i will go for option 1 first, then option 2 as its not very nice having a messagebox opening up on the desktop at the start of a program. just got to print your longer reply first and implement changes you suggested.
Thanks again.
regards
Hugh

LarryMc

Quote from: hugh on May 27, 2010, 03:48:29 PM
... i will go for option 1 first, then option 2 ....

In that case, a working option 2 is attached ;)

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

hugh

Larry, that is magic, works just the way i wanted it to work, and i am not going to say i allready had it sorted, i didn't.
even on this slow computer, i have no more flashing, cant thank you enough Larry.
im just working on a minor problem which i found, i will have to disable the [LINE CALLED] button until Mycount=>5 for the single line call and do the same for the [HOUSE CALLED] button untill Mycount =>15.
best place for me to do that is in the SUB bingonumber().
Regards
Hugh

hugh

Thanks for your help Larry
i have kept the second option,ie the second window.
Attached is the final program, in zip format, i have Remmed all your buttons out and created standard buttons for those who do not
have your Custom Button Designer, so they have a choice to Rem them out if they have your Libary.

Computerised_Bingo.zip attached
I would appreciate anyone suggesting improvements to the source code to spruce it up. I am useless in 2d/3d programming,
probably useless in programming alltogether, but i am happy the way it turned out, it does what its supposed to do.

are you involved in charity work?, create a folder on your hard drive C:\ computerised_bingo, copy the source to it, compile it.
record the numbers with your own voice, the exact location is in the PLAYWAVE lines so you know which folder to create and were to put them. stick it on your laptop, you now have a portable bingo machine, raise all the money you want for charity.
Regards
Hugh