Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Strange Shortcut Menu Location
Message
General information
Forum:
Visual FoxPro
Category:
Menus & Menu designer
Title:
Strange Shortcut Menu Location
Miscellaneous
Thread ID:
00674054
Message ID:
00674054
Views:
61
I'm trying to pop up a shortcut menu. Should me a simple task, except that
I can't seem to get it to popup where I want it.

I have a button on a toolbar that calls the code below. if theres a form
up, then the menu is in the wrong place. and I DO have the IN SCREEN
clause. So the menu location should not be influenced by the form.

The menu should pop up at the lower left corner of the toolbar button, regardless
of where the toolbar is. If there is no form open, all works ok, but with a form
open, it comes up in the wrong place.

Here's the code:
LPARAMETERS oMenuObj

LOCAL oMenuObj, nBar, cPrompt

WITH This

  nRow = MROW() + 1
  nCol = MCOL() - 7.5

  ** Define the popup  
  DEFINE POPUP ShortCuts FROM nRow, nCol IN SCREEN SHORTCUT

  FOR nBar = 1 TO ALEN(.aMenuInfo, 1)
	  
    cPrompt = .aMenuInfo[nBar, 1]
    cPicture = .aMenuInfo[nBar, 2]
	  	
    IF EMPTY(cPrompt)
      DEFINE BAR nBar OF ShortCuts PROMPT "\-"
    ELSE
      DEFINE BAR nBar OF ShortCuts PROMPT cPrompt PICTURE cPicture 
    ENDIF
		  
  ENDFOR

  ** Define selection actions
  ON SELECTION POPUP ShortCuts oMenuObj.MenuSelect()

  ** Show the popup
  ACTIVATE POPUP ShortCuts

ENDWITH

RETURN
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Next
Reply
Map
View

Click here to load this message in the networking platform