Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
GotFocus like event for bars in a sysmenu popup?
Message
De
22/02/2002 13:55:59
 
 
À
22/02/2002 12:50:16
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de menu & Menus
Divers
Thread ID:
00623560
Message ID:
00623838
Vues:
8
This message has been marked as a message which has helped to the initial question of the thread.
>Hi Gregory,
>
>Thanks again for taking the time to help me out with this challenge. Your code is clever, but it fails to call the ShowIt() function dynamically, i.e. the ShowIt() function is called only when a popup bar is initially defined and the value returned is cached in the menu bar's 'message' property. The message clause does NOT appear to be evaluated while a user is navigating a popup. You can verify this yourself by placing the following statement in your ShowIt() function.
>
>@2,2 say "Menu bar =" + str( p ) + space( 10 )
>
>If you run (or trace) your code with the above statement added, you will note that the ShowIt() function is only called at popup bar definition time. ShowIt() doesn't get called when I activate the Management popup and highlight the two menu bars.
>
>BTW: Are you near Antwarp? I traveled to Belgium on a business trip a year ago and really enjoyed myself. The people and the food were great.

Have lived in Antwerp for 10 years. Have come back to the roots since

>Thanks again for your help. Any other ideas???
>
>Malcolm
>
Malcolm,

You are right in that the message part is only evaluated once.

In addition, the following below only works for popups that are not activated via the menu. Once they get there, the game is over.

There may, just may be a possibility, but I haven't found it.

Menus, bars, pads and the like are strange animals in vfp

Sorry, thought I had hit the jackpot
*--------------------------------------------------------------------------
procedure do_it()

	local i, p
	private MenuItem && not needed really, but shows possibilities
	MenuItem = ''

	p = sys(2015)
	define popup (p) shortcut
	for i = 1 to 10
		define bar cntbar(p)+1 of (p) prompt str(i)
		on bar cntbar(p) of (p) x=ShowIt(p, bar())
	endfor

	activate popup (p)
	if( !empty(bar()) )	&& not escaped
		?'MenuItem=', MenuItem
	endif
	release popup (p)

endproc
*--------------------------------------------------------------------------
function	ShowIt(p, i)
	MenuItem = 'Something ' + p + str(i)
	*set help to aaa
	*_screen.HelpContextId = 1000 + i
	?? chr(7)
	wait window nowait 'Menubar = ' + p + ' ' + str(i)
	return 'active message ' + prmbar(p, i)

endfunc
*--------------------------------------------------------------------------
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform