Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sub Menu Limitation
Message
De
06/02/2006 14:16:47
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de menu & Menus
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP1
Divers
Thread ID:
01093998
Message ID:
01094051
Vues:
26
This message has been marked as a message which has helped to the initial question of the thread.
Hi Ali,
This snipit may not be the cleanest because I took a working tool and trimmed out the business logic to just show you what you need to see. Put this in a program & run it. You'll see (hopefully) that there are 100 items in the menu, but on a specified interval, it spawns off a new submenu just simulating a continuation of the original menu. Does this server your purposes?
LOCAL nBarCount, retVal, oForm, macSubString, oTextBox, cFieldList, cFromTables, cUnionText, ;
	cWhereClause, cOrderBy, cDisplayField, popupCount, popupname, barsPerColumn, totCounter, myValField

retVal = ""
totCounter = 1
barsPerColumn = 25
popupCount = 0
popupName = "shortcut"
nBarCount = 0

wait window "Gathering List..." nowait noclear

create cursor menuSource ( menuLabel C(50), menuAction C(50) )
for x = 1 to 100
	insert into menuSource( menuLabel, menuAction) values( alltrim(str(x)), "messagebox('" + alltrim(str(x)) + "')" )
endfor

	DEFINE POPUP shortcut SHORTCUT RELATIVE FROM MROW(),MCOL()
	select menuSource
	go top in menuSource
	scan
		totCounter = totCounter + 1
		if int((totCounter + popupCount) / barsPerColumn) <> popupCount
			popupCount = popupCount + 1
			oldpopupname = popupname
			popupName = "shortcut" + iif(popupCount > 0, alltrim(str(popupCount)), "")
			DEFINE BAR barsPerColumn OF &oldpopupname PROMPT "More Options..."
			DEFINE POPUP &popupName SHORTCUT RELATIVE
			ON BAR barsPerColumn OF &oldpopupname ACTIVATE POPUP &popupName AT MROW(), MCOL()
		endif
		nBarCount = ((totCounter + iif(popupCount > 0, popupCount - 1, popupCount)) % barsPerColumn) + ;
			iif(popupCount > 0, 1, popupCount)
		DEFINE BAR nBarCount OF &popupName PROMPT alltrim(menuSource.menuLabel)

		ON SELECTION BAR nBarCount OF &popupName &macSubString
	endscan
	ACTIVATE POPUP shortcut
>>Hi Ali,
>> I had a similar problem once when we created a right-click functionality on a textbox to query all available values for the field behind the text box (controlSource), and display those in a popup menu. I overcame the problem by every 'n' number of menu items, spawn a submenu that is really just an extension (a continuation) of the original popup. Depending on how many menu options you truely have, this still may not be an ideal solution because your cascading menus will eventually fill the whole screen and, as Craig suggests, be non-user-friendly and unpractical.
>>
>Hi Paul
>i have more that 40 item with \-
>I know that but There isn't a solution for this?
Paul A. Busbey
Victoria Insurance
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform