Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Popup menu over toolbar
Message
From
12/06/2004 17:52:16
 
General information
Forum:
Visual FoxPro
Category:
Menus & Menu designer
Miscellaneous
Thread ID:
00912732
Message ID:
00913121
Views:
43
This message has been marked as the solution to the initial question of the thread.
Privet, Sergey.
Your example does not work correctly.
Try dock toolbar in to the right side of a sreen and you see it.
  DECL INTEGER GetCursorPos in user32 AS Api_GetCursorPos STRING @
  DECL INTEGER ScreenToClient in user32 AS Api_ScreenToClient integer, STRING @
  PUBL goTbr
  goTbr=CREATEO('TOOLBAR')
  =goTbr.AddObject('cnt','cnt'),goTbr.Show()
 *************************************  
  DEFINE CLAS cnt AS Container
    Visible=.T.
 *************************************  
  PROC RightClick
  LOCAL lcPoint
  lcPoint=SPACE(8)
  =Api_GetCursorPos(@lcPoint)
  =Api_ScreenToClient(_screen.hWnd, @lcPoint)
  x = Str2Long(LEFT(lcPoint,4))/(_screen.width/scols())
  y = Str2Long(RIGHT(lcPoint,4))/(_screen.height/srows())

  ACTIVATE SCREEN
  DEFI POPU mnu FROM y,x SHOR rela marg
  DEFI BAR 1 OF mnu PROM 'Bar 1'
  DEFI BAR 2 OF mnu PROM 'Bar 2'
  ACTI POPU mnu
  ENDPROC && RightClick  
 *************************************  
  ENDDEFINE && cnt  
 *************************************  
  PROC Str2Long
  LPAR lcStr
  RETU ASC(SUBS(lcStr,1,1))+ASC(SUBS(lcStr,2,1))*256+ASC(SUBS(lcStr,3,1))*65536+ASC(SUBS(lcStr,4,1))*16777216
  ENDPROC &&Str2Long
There's never enough time to do it right, but always enough time to do it again.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform