<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">

<!-- THIS FILE IS GENERATED DO NOT EDIT -->


<erlref>
<header>
  <copyright>
    <year>2020</year>
    <holder>Ericsson AB. All Rights Reserved.</holder></copyright>
  <legalnotice>
      Licensed under the Apache License, Version 2.0 (the "License");
      you may not use this file except in compliance with the License.
      You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

      Unless required by applicable law or agreed to in writing, software
      distributed under the License is distributed on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      See the License for the specific language governing permissions and
      limitations under the License.

  </legalnotice>
  <title>wxContextMenuEvent</title>
</header>
<module>wxContextMenuEvent</module>
<modulesummary>Functions for wxContextMenuEvent class</modulesummary>
<description><p>This class is used for context menu events, sent to give the application a chance to show a context (popup) menu for a <seeerl marker="wxWindow"><c>wxWindow</c></seeerl>.
      </p><p>Note that if <seemfa marker="#getPosition/1"><c>getPosition/1</c></seemfa> returns wxDefaultPosition, this means that the event originated from a keyboard context button event, and you should compute a suitable position yourself, for example by calling <seemfa marker="wx_misc#getMousePosition/0"><c>wx_misc:getMousePosition/0</c></seemfa>.
      </p><p>Notice that the exact sequence of mouse events is different across the platforms. For example, under MSW the context menu event is generated after <c>EVT_RIGHT_UP</c> event and only if it was not handled but under GTK the context menu event is generated after <c>EVT_RIGHT_DOWN</c> event. This is correct in the sense that it ensures that the context menu is shown according to the current platform UI conventions and also means that you must not handle (or call <seemfa marker="wxEvent#skip/2"><c>wxEvent:skip/2</c></seemfa> in your handler if you do have one) neither right mouse down nor right mouse up event if you plan on handling <c>EVT_CONTEXT_MENU</c> event.
      </p><p>See: <seeerl marker="wxCommandEvent"><c>wxCommandEvent</c></seeerl>, <url href="https://docs.wxwidgets.org/3.1/overview_events.html#overview_events">Overview events</url>
      </p>
  <p>This class is derived (and can use functions) from: 
    <seeerl marker="wxCommandEvent"><c>wxCommandEvent</c></seeerl> <seeerl marker="wxEvent"><c>wxEvent</c></seeerl></p>
  
  <p>wxWidgets docs: <url href="https://docs.wxwidgets.org/3.1/classwx_context_menu_event.html">wxContextMenuEvent</url></p>
  </description><section><title>Events</title><p>Use <seemfa marker="wxEvtHandler#connect/3"><c>wxEvtHandler:connect/3</c></seemfa> with <seetype marker="#wxContextMenuEventType"><c>wxContextMenuEventType</c></seetype> to subscribe to events of this type.</p></section>
<datatypes>
    <datatype><name name="wxContextMenuEvent"/></datatype>
    <datatype><name name="wxContextMenu"/></datatype>
    <datatype><name name="wxContextMenuEventType"/></datatype></datatypes>

<funcs>
  <func>
    <name name="getPosition" arity="1" clause_i="1" since=""/>
    <fsummary>Returns the position in screen coordinates at which the menu should be shown. </fsummary>
    <desc><p>Returns the position in screen coordinates at which the menu should be shown. 
      </p><p>Use <seemfa marker="wxWindow#screenToClient/2"><c>wxWindow:screenToClient/2</c></seemfa> to convert to client coordinates.
      </p><p>You can also omit a position from <seemfa marker="wxWindow#popupMenu/4"><c>wxWindow:popupMenu/4</c></seemfa> in order to use the current mouse pointer position.
      </p><p>If the event originated from a keyboard event, the value returned from this function will be wxDefaultPosition. 
      </p></desc>
  </func>
  
  <func>
    <name name="setPosition" arity="2" clause_i="1" since=""/>
    <fsummary>Sets the position at which the menu should be shown. </fsummary>
    <desc><p>Sets the position at which the menu should be shown. 
      </p></desc>
  </func>
  </funcs>
</erlref>
