Hi all,
Am using a framework where I have not really had to use right-click menus for the most part. Needed one recently for a grid and found that the framework class for this is *really* old (they say so themselves in the intro to the class). Was thinking of creating my own class anyhow and need some input. Here is a general overview of how their class works:
- based on custom class
- class loads and has empty methods to define bars etc
- when initializing, you can pass in the form and the calling object (in my case, an object reference to the grid)
- after loading everything, class has this code:
ACTIVATE POPUP ShortCut
STORE UPPER(ALLTRIM(PROMPT())) TO This.icSelPrompt
- basically, they just capture the prompt used
- they then have another method where you can put in a big CASE statement and based on the prompt, jump to the action
- this works: I use the following to "reach back" to the form and execute a method there e.g.
CASE THIS.icSelPrompt == "Delete"
THIS.ioCallingForm.DeleteDocument(THIS.ioCallingObject) etc
But I sort of wanted to use ON SELECTION BAR to jump to the form but could not figure out how to do that e.g.
ON SELECTION BAR <bar> THIS.ioCallingForm.DeleteDocument()
Reading the help, I see why: you can only execute a command. So I would need to call a .prg or a procedure in some procedure file (and then I would suspect that there would be problems anyhow as a popup is sort of just "out there" on it's own i.e. I am not sure I could get back to the last active form anyhow.
So my question: is this the only real design for a class if I need to be able to reference something on the calling form or calling object?
Thanks,
Albert