aldweb

Fermer I. aldweb

Fermer II. Gratuitiels PC

Fermer III. Gratuitiels Palm

Fermer IV. Partagiciels Palm

Fermer V. iziBasic Palm

Fermer VI. Connaissance Palm

Fermer VII. Ordinateur Poche

Fermer VIII. miniPortail

Spécial !



Version mobile
de l'aldweb Site

m.aldweb.com


Ni Français, ni Anglais ?

Essayez donc l'un de ces drapeaux :
[de] [es] [it] [pt]
Recherche




Météo / Spam / www

Météo Lyon


aldweb contre le SPAM


Newsletter
Pour avoir des nouvelles de ce site, inscrivez-vous à notre Newsletter.
S'abonner
Se désabonner
298 Abonnés
Sites web de la famille

Webmaster - Infos
News Amis
Visites

   visiteurs

   visiteurs en ligne

Sondage
Comment trouve-tu le nouvel habillage de l'aldweb Site ?
 
Superbe !
Joli
Moyen
Moche...
Résultats
forum.gifForum - iziBasic - Sujet n°1238

Forum - Forum
iziBasic - iziBasic


Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 257

actif  Sujet n° 1238  Menu Close Event

le 28/07/2005 @ 14:50
par MikeF

Anonyme



I've noticed on my 'Reviews' application that once I recompiled it with iziBasic 5.2 (previously used 5.0) each menu selection now returns two events - a 'selection' event and the new 'close' event. Is this deliberate?

I had expected the close event to occur only when the menu was closed without making a selection (as a selection implies a close event anyway) so hadn't checked through my code to see how it would handle the extra events.
Ecrire à MikeF   Poster une réponse  Haut

[]   


Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 1
--------
le 28/07/2005 @ 22:50
par aldweb

Anonyme

visiteur
Hello Mike,

This new close menu event was indeed added, in version 5.1 and I remember very well of it because I spent hours and hours to implement it!
So, there was a good reason for doing it

This is indeed absolutely required for real time games (the one to thank for giving me the information is Leonard: http://izibasic.aldweb.com/leonard/) that need to know when to stop/start again the animation after the menu was closed. I spent that number of hours because this event is not provided by Palm OS so I had to trick the system to simulate one...

Now, in a way, you are right, the close event is usually not needed if a selection was made and I understand very well your point of view.

But, between the time the selection is made and the time the menu is really closed there might be a few system ticks and the real time game programmer would rather capture the right event... Otherwise some drawing could occur on top of the menu, which is then erased, erasing at the same time what was drawn.

And also, to be honest with you, since my trick succeeded to capture/simulate this close event, I was so happy with it (remember that I spent hours and hours on this topic!) that I'd rather leave it that way.

I also believe that the succession of events is clean this way:
1. a menu is opened
2. eventually, a menu item is selected
3. the menu is closed

Now, in a usual case, all you need to do in a source code is:
1. was there a menu event? (EVENT 1001)
2. what item was eventually selected? (MENUITEM >0)
At this stage, I believed that this change would cause no change in users existing source codes. I always pay very much attention to the compatibility topic so that any source code of a previous version should compile and run the same way with a new iziBasic version.

So, I hope that you will allow me to ask you one question. I ask it to the friend that you are and not at all in a commercial way at all as I should probably do with the famous reviewer at a great web site (dear other readers, you should bookmark this site if not already done: http://www.palm247.com) that you are... well you know my sense of humour!
So here is the question: maybe was your source code not really optimized? Maybe is this the good opportunity to optimize it now? (I cheated, I asked 2 questions!)

You see, I could write a full story on this topic! So, I better stop now!

Cheers,


@+
aldweb
Ecrire à aldweb   Poster une réponse  Haut

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 2
--------
le 28/07/2005 @ 23:06
par MikeF

Anonyme

visiteur
My code? Not optimised? How dare you Sir!

OK...actually 'not well bounded' would be a better description as I was simply testing for a value less than 6 (and -1 is less than 6!). It is already corrected and I'm happy for it to remain so.

I can understand the need for the event (my day job being real-time software for aircraft rather than games) and have seen a few PalmOS utilities that overwrite their menu windows and then close them.

Congratulations on making it work!
Ecrire à MikeF   Poster une réponse  Haut

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 3
--------
le 28/07/2005 @ 23:25
par KHertan

Anonyme

visiteur
Oh my god ... it s was only that ... i m thinking that a endif is lost between one of my 48 conditional test ...

Thanks for the detailed answer.
Ecrire à KHertan   Poster une réponse  Haut

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 4
--------
le 28/07/2005 @ 23:36
par aldweb

Anonyme

visiteur
Reading you Khertan, I think that I shall really start to think about some counter at compilation time that would check that the number of [IF test THEN] and [ENDIF] is the same at the end of the compilation process.

Cheers,


@+
aldweb
Ecrire à aldweb   Poster une réponse  Haut

Warning: A non-numeric value encountered in /web5/aldweb/www/aldweb_com/www/thread.php on line 497
Réponse n° 5
--------
le 28/07/2005 @ 23:40
par aldweb

Anonyme

visiteur
Mike,

Some good code could be:
M=MENUITEM
IF M>0 THEN 'not open and not close
SELECT CASE M
CASE 1
' Item 1 was selected
CASE 2
' Item 2 was selected
END SELECT
END IF

There, you are sure to deal with available menu items only...

I have always tried to put negative values in iziBasic for "strange" cases. For instance with DOEVENTS (or WAITEVENT).

Cheers,


@+
aldweb
Ecrire à aldweb   Poster une réponse  Haut
actif sujet actif   clos sujet clos   Important! Important!   Nouveau Nouveau message   -   Rectifier Rectifier message   Clôturer Clôturer sujet   Remonter Remonter
[]
Catégories de discussion  Forum 



 
^ Haut ^