[[https://www.revelation.com/|Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community]]
==== Context menu (OpenInsight 32-bit Specific) ====
=== At 19 NOV 2004 05:50:08AM Irina wrote: ===
{{tag>"OpenInsight 32-bit Specific"}}
Hello, I use subroutine Utility("CREATE",MenuStruct) to make a context menu. But as far as i understand, this menu is created when the form generates the "create" event. But I need to make 2 types of context menus in one form for different names of controls. Could you tell me what to do for it? Thanks a lot.
----
=== At 19 NOV 2004 09:43AM Donald Bakke wrote: ===
Irina,
Have you already looked at the Knowledge Base article on [url=http://www.revelation.com/knowledge.nsf/d77dcc92cb73ae6b852566f500657e9d/d0edb4df752b6fb8852563b9005f7e03?OpenDocument]Creating Context Menus[/url]?
What version of OI are you using? OI 7.x now has a Context Menu builder.
dbakke@srpcs.com
[url=http://www.srpcs.com]SRP Computer Solutions, Inc.[/url]
[img]http://www.srpcs.com/srpicon1.gif[/img]
----
=== At 19 NOV 2004 03:14PM Irina wrote: ===
Of course, I've used this topic. But I don't understand how to make two types of menus using this event handler. The problem is how to create two types of menus when the form is creating and how to execute one or another for different controls.
----
=== At 19 NOV 2004 04:25PM Donald Bakke wrote: ===
Irina,
My response is a bit over-simplified because there are a variety of little issues that are involved with this. However, instead of using the CREATE event you will want to capture the right-click of a mouse and create your context menu on-the-fly (as it were) for the control that the mouse is floating over. This involves using the WINMSG event and qualifying the appropriate Windows Message. There have been threads posted on this site that detail how to do this as well as another Knowledge Base article called [url=http://www.revelation.com/knowledge.nsf/d77dcc92cb73ae6b852566f500657e9d/06e169a04f31bd0a852565370049a959?OpenDocument]Catching a Right Mouse Click, and other Windows Messages[/url].
Bottom line, you need to take the basic elements of what has already been documented and adapt them to your situation. The original context menu article is admittedly too simple. However, it does give you the mechanics for creating the context menu. So, instead of doing it in the CREATE event of a window just put this code in the WINMSG event and you will be well on your way.
dbakke@srpcs.com
[url=http://www.srpcs.com]SRP Computer Solutions, Inc.[/url]
[img]http://www.srpcs.com/srpicon1.gif[/img]
[[https://www.revelation.com/revweb/oecgi4p.php/O4W_HANDOFF?DESTN=O4W_RUN_FORM&INQID=NONWORKS_READ&SUMMARY=1&KEY=29F29B6CD2F8724885256F51003B85CF|View this thread on the forum...]]