Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Cetin Basoz
  Where is Cetin Basoz?
 Izmir
 Turkey
 Cetin Basoz
 To: Manik Chamara
  Where is Manik Chamara?
 Mawanella
 Sri Lanka
 Manik Chamara
 Tags
Subject: RE: Create Popup Menu with Sub Menu
Thread ID: 310922 Message ID: 310946 # Views: 57 # Ratings: 2
Version: Visual FoxPro 9 SP2 Category: VFP and .NET
Date: Monday, June 27, 2011 12:00:12 PM         
   


> thanks cetin ,
> But i wanna display a sub menu popup when clicking on the each main menu item for particular level.
>
> Example
> : A -> ABC
> ABC
> B -> BCD
> BFF

What does it matter, just create a menu with submenu. It is the same:

Public oForm
oForm = Createobject('myForm')
oForm.Show()

Define Class myForm As Form
  Height=400
  Width=800

  Add Object myGrid As Grid With ;
    Height=400,Width=800,Anchor=15,;
    RecordSourceType=4, ;
    recordsource='select * from ("'+_samples+'data\customer") into cursor crsCustomer'

  Procedure Init
    Local ix
    For ix=1 To This.myGrid.ColumnCount
      Bindevent( This.myGrid.Columns(m.ix).Text1, 'RightClick', This, 'MyHandler')
    Endfor
  Endproc

  Procedure MyContextMenu
    Local loForm, lcRead
    loForm = Thisform
    lcRead = Evaluate('crsCustomer.'+Varread())

    Define Popup shortcut shortcut Relative From Mrow(),Mcol()
    Define Bar 1 Of shortcut Prompt "\<Filter on this value"
    Define Bar 2 Of shortcut Prompt "\<Clear filter"
    Define Bar 3 Of shortcut Prompt "\<My Submenu"

    On Selection Bar 1 Of shortcut loForm.MyFilter( m.lcRead)
    On Selection Bar 2 Of shortcut loForm.ClearFilter()
    On Bar 3 Of shortcut Activate Popup mySubmenu

    Define Popup mySubmenu shortcut Relative
    Define Bar 1 Of mySubmenu Prompt "\<Current value"
    Define Bar 2 Of mySubmenu Prompt "\<Current controlsource"
    On Selection Bar 1 Of mySubmenu Messagebox(m.lcRead)
    On Selection Bar 2 Of mySubmenu Messagebox(Varread())


    Activate Popup shortcut
  Endproc

  Procedure MyHandler
    Thisform.MyContextMenu()
  Endproc

  Procedure MyFilter( tcRead )
    This.myGrid.RecordSource = 'select * from ("'+_samples+'data\customer") where '+Varread()+' = ?m.tcRead into cursor crsCustomer'
  Endproc
  Procedure ClearFilter( )
    This.myGrid.RecordSource = 'select * from ("'+_samples+'data\customer") into cursor crsCustomer'
  Endproc
Enddefine


Cetin Basoz

.Net has got better.Think about moving - check my blog:
My Blog
Blog (mirror) - sounds to be down

ENTIRE THREAD

Create Popup Menu with Sub Menu Posted by Manik Chamara @ 6/27/2011 9:56:55 AM
RE: Create Popup Menu with Sub Menu Posted by Cetin Basoz @ 6/27/2011 10:29:53 AM
RE: Create Popup Menu with Sub Menu Posted by Manik Chamara @ 6/27/2011 10:43:35 AM
RE: Create Popup Menu with Sub Menu Posted by Cetin Basoz @ 6/27/2011 12:00:12 PM
RE: Create Popup Menu with Sub Menu Posted by Stefan Wuebbe @ 6/27/2011 10:30:36 AM
RE: Create Popup Menu with Sub Menu Posted by Manik Chamara @ 6/27/2011 10:46:19 AM
RE: Create Popup Menu with Sub Menu Posted by Stefan Wuebbe @ 6/27/2011 11:21:56 AM
RE: Create Popup Menu with Sub Menu Posted by Manik Chamara @ 6/27/2011 11:30:56 AM
RE: Create Popup Menu with Sub Menu Posted by Stefan Wuebbe @ 6/27/2011 11:58:23 AM
RE: Create Popup Menu with Sub Menu Posted by tushar @ 6/27/2011 10:54:46 AM
RE: Create Popup Menu with Sub Menu Posted by Manik Chamara @ 6/27/2011 11:23:49 AM
RE: Create Popup Menu with Sub Menu Posted by tushar @ 6/27/2011 11:38:45 AM
RE: Create Popup Menu with Sub Menu Posted by Manik Chamara @ 6/27/2011 11:49:13 AM