Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Putting Shortcut Menu into Grid Cell
Message
De
17/07/2001 09:43:01
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
17/07/2001 09:31:03
Jimi Lee
Pop Electronic Products Ltd.
Hong Kong, Hong Kong
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00531450
Message ID:
00531495
Vues:
17
This message has been marked as the solution to the initial question of the thread.
Hi Jimmy,
Then it's easier :) Just change column 4th text1 with your class:) ie :
procedure init
  with this
    .recordsource="Booking"
    with .Columns(4)
       .NewObject('myText','myText')
       .myText.Visible = .t.
       .CurrentControl = 'myText'
       .Sparse = .f.
   endwith
*...
endproc
*...
enddefine

define class myTextBox as TextBox
 BorderStyle = 0
 procedure RightClick
  do mymenu.mpr with this
 endproc
enddefine

*mymenu.mpr
lparameters oTarget
DEFINE POPUP shortcut SHORTCUT RELATIVE FROM MROW(),MCOL()
DEFINE BAR 1 OF shortcut PROMPT "Add hello"
ON SELECTION BAR 1 OF shortcut oTarget.Value = trim(oTarget.Value)+'hello'
ACTIVATE POPUP shortcut 
If this doesn't work I can send a full sample later.
Cetin


>Hi Cetin,
>
>This is the problem, since I'm making the grid with code only, I can't double click on an object to add event codes, in my grid I just do something like:
>
>procedure init
>  with this
>    .recordsource="Booking"
>    .column1.width=100
>    .column2.width=90
>    .column3.width=90
>    .column4.width=115
>
>    .column1.controlsource="A"
>    .column2.controlsource="B"
>    .column3.controlsource="C"
>    .column4.controlsource="D"
>
>    .column1.header.caption="A"
>    blah blah blah...
>
>
>In this case how should I add the event code to column4's cells? I wish you'll have time to teach me in a bit more details, thank you very much!!
>
>Jimi
>
>
>
>>>Hello everyone,
>>>
>>>I have programmatically generated a grid, also a shortcut menu MyMenu.mpr
>>>
>>>But I dunno how to set, such that only when I right click on the 4th column would activate the menu, and do something on the active cell. I actually dunno where to put the "do MyMenu.mpr" code, someone help please?
>>>
>>>Jimi
>>
>>Jimi,
>>In 4th column currentcontrol (possibly dfefault text1) rightclick :
>>
>>do mymenu.mpr with this && If it's waiting an object parameter
>>Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform