<?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>wxMenuItem</title>
</header>
<module>wxMenuItem</module>
<modulesummary>Functions for wxMenuItem class</modulesummary>
<description><p>A menu item represents an item in a menu.
      </p><p>Note that you usually don't have to deal with it directly as <seeerl marker="wxMenu"><c>wxMenu</c></seeerl> methods usually construct an object of this class for you.
      </p><p>Also please note that the methods related to fonts and bitmaps are currently only implemented for Windows, Mac and GTK+.
      </p><p>See: <seeerl marker="wxMenuBar"><c>wxMenuBar</c></seeerl>, <seeerl marker="wxMenu"><c>wxMenu</c></seeerl>
      </p>
  <p>wxWidgets docs: <url href="https://docs.wxwidgets.org/3.1/classwx_menu_item.html">wxMenuItem</url></p>
  </description><section><title>Events</title><p>Event types emitted from this class: <seeerl marker="wxMenuEvent"><c>menu_open</c></seeerl>, <seeerl marker="wxMenuEvent"><c>menu_close</c></seeerl>, <seeerl marker="wxMenuEvent"><c>menu_highlight</c></seeerl></p></section>
<datatypes><datatype><name name="wxMenuItem"/></datatype></datatypes>

<funcs>
  <func>
    <name name="new" arity="0" clause_i="1" since=""/>
    <fsummary>See: <c>new/1</c></fsummary>
  </func>
  
  <func>
    <name name="new" arity="1" clause_i="1" since=""/>
    <fsummary>Constructs a <c>wxMenuItem</c> object. </fsummary>
    <desc><p>Constructs a <seeerl marker="wxMenuItem"><c>wxMenuItem</c></seeerl> object. 
      </p><p>Menu items can be standard, or "stock menu items", or custom. For the standard menu items (such as commands to open a file, exit the program and so on, see page_stockitems for the full list) it is enough to specify just the stock ID and leave <c>text</c> and <c>help</c> string empty. Some platforms (currently wxGTK only, and see the remark in <seemfa marker="#setBitmap/2"><c>setBitmap/2</c></seemfa> documentation) will also show standard bitmaps for stock menu items.
      </p><p>Leaving at least <c>text</c> empty for the stock menu items is actually strongly recommended as they will have appearance and keyboard interface (including standard accelerators) familiar to the user.
      </p><p>For the custom (non-stock) menu items, <c>text</c> must be specified and while <c>help</c> string may be left empty, it's recommended to pass the item description (which is automatically shown by the library in the status bar when the menu item is selected) in this parameter.
      </p><p>Finally note that you can e.g. use a stock menu label without using its stock help string:
      </p><p>that is, stock properties are set independently one from the other.
      </p></desc>
  </func>
  
  <func>
    <name name="destroy" arity="1" clause_i="1" since=""/>
    <fsummary>Destructor. </fsummary>
    <desc><p>Destructor. 
      </p></desc>
  </func>
  
  <func>
    <name name="check" arity="1" clause_i="1" since=""/>
    <fsummary>See: <c>check/2</c></fsummary>
  </func>
  
  <func>
    <name name="check" arity="2" clause_i="1" since=""/>
    <fsummary>Checks or unchecks the menu item. </fsummary>
    <desc><p>Checks or unchecks the menu item. 
      </p><p>Note that this only works when the item is already appended to a menu. 
      </p></desc>
  </func>
  
  <func>
    <name name="enable" arity="1" clause_i="1" since=""/>
    <fsummary>See: <c>enable/2</c></fsummary>
  </func>
  
  <func>
    <name name="enable" arity="2" clause_i="1" since=""/>
    <fsummary>Enables or disables the menu item. </fsummary>
    <desc><p>Enables or disables the menu item. 
      </p></desc>
  </func>
  
  <func>
    <name name="getBitmap" arity="1" clause_i="1" since=""/>
    <fsummary>Returns the checked or unchecked bitmap. </fsummary>
    <desc><p>Returns the checked or unchecked bitmap. 
      </p><p>Only for:wxmsw</p></desc>
  </func>
  
  <func>
    <name name="getHelp" arity="1" clause_i="1" since=""/>
    <fsummary>Returns the help string associated with the menu item. </fsummary>
    <desc><p>Returns the help string associated with the menu item. 
      </p></desc>
  </func>
  
  <func>
    <name name="getId" arity="1" clause_i="1" since=""/>
    <fsummary>Returns the menu item identifier. </fsummary>
    <desc><p>Returns the menu item identifier. 
      </p></desc>
  </func>
  
  <func>
    <name name="getKind" arity="1" clause_i="1" since=""/>
    <fsummary>Returns the item kind, one of <c>wxITEM_SEPARATOR</c>, <c>wxITEM_NORMAL</c>, <c>wxITEM_CHECK</c> or <c>wxITEM_RADIO</c>. </fsummary>
    <desc><p>Returns the item kind, one of <c>wxITEM_SEPARATOR</c>, <c>wxITEM_NORMAL</c>, <c>wxITEM_CHECK</c> or <c>wxITEM_RADIO</c>. 
      </p></desc>
  </func>
  
  <func>
    <name name="getLabelFromText" arity="1" clause_i="1" since=""/>
    <fsummary>See: <c>getLabelText/1</c></fsummary>
    <desc><p>See: <seemfa marker="#getLabelText/1"><c>getLabelText/1</c></seemfa>.</p>
    </desc>
  </func>
  
  <func>
    <name name="getLabelText" arity="1" clause_i="1" since=""/>
    <fsummary>Strips all accelerator characters and mnemonics from the given <c>text</c>. </fsummary>
    <desc><p>Strips all accelerator characters and mnemonics from the given <c>text</c>. 
      </p><p>For example:
      </p><p>will return just <c>"Hello"</c>.
      </p><p>See: <seemfa marker="#getItemLabelText/1"><c>getItemLabelText/1</c></seemfa>, <seemfa marker="#getItemLabel/1"><c>getItemLabel/1</c></seemfa>
      </p></desc>
  </func>
  
  <func>
    <name name="getText" arity="1" clause_i="1" since=""/>
    <fsummary>See: <c>getItemLabel/1</c></fsummary>
    <desc><p>See: <seemfa marker="#getItemLabel/1"><c>getItemLabel/1</c></seemfa>.</p>
    </desc>
  </func>
  
  <func>
    <name name="getItemLabel" arity="1" clause_i="1" since=""/>
    <fsummary>Returns the text associated with the menu item including any accelerator characters that were passed to the constructor or <c>setItemLabel/2</c>. </fsummary>
    <desc><p>Returns the text associated with the menu item including any accelerator characters that were passed to the constructor or <seemfa marker="#setItemLabel/2"><c>setItemLabel/2</c></seemfa>. 
      </p><p>See: <seemfa marker="#getItemLabelText/1"><c>getItemLabelText/1</c></seemfa>, <seemfa marker="#getLabelText/1"><c>getLabelText/1</c></seemfa>
      </p></desc>
  </func>
  
  <func>
    <name name="getLabel" arity="1" clause_i="1" since=""/>
    <fsummary>See: <c>getItemLabelText/1</c></fsummary>
    <desc><p>See: <seemfa marker="#getItemLabelText/1"><c>getItemLabelText/1</c></seemfa>.</p>
    </desc>
  </func>
  
  <func>
    <name name="getItemLabelText" arity="1" clause_i="1" since=""/>
    <fsummary>Returns the text associated with the menu item, without any accelerator characters. </fsummary>
    <desc><p>Returns the text associated with the menu item, without any accelerator characters. 
      </p><p>See: <seemfa marker="#getItemLabel/1"><c>getItemLabel/1</c></seemfa>, <seemfa marker="#getLabelText/1"><c>getLabelText/1</c></seemfa>
      </p></desc>
  </func>
  
  <func>
    <name name="getMenu" arity="1" clause_i="1" since=""/>
    <fsummary>Returns the menu this menu item is in, or NULL if this menu item is not attached. </fsummary>
    <desc><p>Returns the menu this menu item is in, or NULL if this menu item is not attached. 
      </p></desc>
  </func>
  
  <func>
    <name name="getSubMenu" arity="1" clause_i="1" since=""/>
    <fsummary>Returns the submenu associated with the menu item, or NULL if there isn't one. </fsummary>
    <desc><p>Returns the submenu associated with the menu item, or NULL if there isn't one. 
      </p></desc>
  </func>
  
  <func>
    <name name="isCheckable" arity="1" clause_i="1" since=""/>
    <fsummary>Returns true if the item is checkable. </fsummary>
    <desc><p>Returns true if the item is checkable. 
      </p><p>Notice that the radio buttons are considered to be checkable as well, so this method returns true for them too. Use <c>IsCheck()</c> (not implemented in wx) if you want to test for the check items only. 
      </p></desc>
  </func>
  
  <func>
    <name name="isChecked" arity="1" clause_i="1" since=""/>
    <fsummary>Returns true if the item is checked. </fsummary>
    <desc><p>Returns true if the item is checked. 
      </p></desc>
  </func>
  
  <func>
    <name name="isEnabled" arity="1" clause_i="1" since=""/>
    <fsummary>Returns true if the item is enabled. </fsummary>
    <desc><p>Returns true if the item is enabled. 
      </p></desc>
  </func>
  
  <func>
    <name name="isSeparator" arity="1" clause_i="1" since=""/>
    <fsummary>Returns true if the item is a separator. </fsummary>
    <desc><p>Returns true if the item is a separator. 
      </p></desc>
  </func>
  
  <func>
    <name name="isSubMenu" arity="1" clause_i="1" since=""/>
    <fsummary>Returns true if the item is a submenu. </fsummary>
    <desc><p>Returns true if the item is a submenu. 
      </p></desc>
  </func>
  
  <func>
    <name name="setBitmap" arity="2" clause_i="1" since=""/>
    <fsummary>Sets the bitmap for the menu item. </fsummary>
    <desc><p>Sets the bitmap for the menu item. 
      </p><p>It is equivalent to wxMenuItem::SetBitmaps(bmp, wxNullBitmap) if <c>checked</c> is true (default value) or SetBitmaps(wxNullBitmap, bmp) otherwise.
      </p><p><seemfa marker="#setBitmap/2"><c>setBitmap/2</c></seemfa> must be called before the item is appended to the menu, i.e. appending the item without a bitmap and setting one later is not guaranteed to work. But the bitmap can be changed or reset later if it had been set up initially.
      </p><p>Notice that GTK+ uses a global setting called <c>gtk-menu-images</c> to determine if the images should be shown in the menus at all. If it is off (which is the case in e.g. Gnome 2.28 by default), no images will be shown, consistently with the native behaviour.
      </p><p>Only for:wxmsw,wxosx,wxgtk</p></desc>
  </func>
  
  <func>
    <name name="setHelp" arity="2" clause_i="1" since=""/>
    <fsummary>Sets the help string. </fsummary>
    <desc><p>Sets the help string. 
      </p></desc>
  </func>
  
  <func>
    <name name="setMenu" arity="2" clause_i="1" since=""/>
    <fsummary>Sets the parent menu which will contain this menu item. </fsummary>
    <desc><p>Sets the parent menu which will contain this menu item. 
      </p></desc>
  </func>
  
  <func>
    <name name="setSubMenu" arity="2" clause_i="1" since=""/>
    <fsummary>Sets the submenu of this menu item. </fsummary>
    <desc><p>Sets the submenu of this menu item. 
      </p></desc>
  </func>
  
  <func>
    <name name="setText" arity="2" clause_i="1" since=""/>
    <fsummary>See: <c>setItemLabel/2</c></fsummary>
    <desc><p>See: <seemfa marker="#setItemLabel/2"><c>setItemLabel/2</c></seemfa>.</p>
    </desc>
  </func>
  
  <func>
    <name name="setItemLabel" arity="2" clause_i="1" since=""/>
    <fsummary>Sets the label associated with the menu item. </fsummary>
    <desc><p>Sets the label associated with the menu item. 
      </p><p>Note that if the ID of this menu item corresponds to a stock ID, then it is not necessary to specify a label: wxWidgets will automatically use the stock item label associated with that ID. See the <seemfa marker="#new/1"><c>new/1</c></seemfa> for more info.
      </p><p>The label string for the normal menu items (not separators) may include the accelerator which can be used to activate the menu item from keyboard. An accelerator key can be specified using the ampersand <c>&amp;</c> character. In order to embed an ampersand character in the menu item text, the ampersand must be doubled.
      </p><p>Optionally you can specify also an accelerator string appending a tab character <c>\t</c> followed by a valid key combination (e.g. <c>CTRL+V</c>). Its general syntax is any combination of <c>"CTRL"</c>, <c>"RAWCTRL"</c>, <c>"ALT"</c> and <c>"SHIFT"</c> strings (case doesn't matter) separated by either <c>'-'</c> or <c>'+'</c> characters and followed by the accelerator itself. Notice that <c>CTRL</c> corresponds to the "Ctrl" key on most platforms but not under macOS where it is mapped to "Cmd" key on Mac keyboard. Usually this is exactly what you want in portable code but if you really need to use the (rarely used for this purpose) "Ctrl" key even under Mac, you may use <c>RAWCTRL</c> to prevent this mapping. Under the other platforms <c>RAWCTRL</c> is the same as plain <c>CTRL</c>.
      </p><p>The accelerator may be any alphanumeric character, any function key (from <c>F1</c> to <c>F12</c>), any numpad digit key using <c>KP_</c> prefix (i.e. from <c>KP_0</c> to <c>KP_9</c>) or one of the special strings listed below (again, case doesn't matter) corresponding to the specified key code:
      </p><p>Examples:
      </p><p>Note: In wxGTK using <c>"SHIFT"</c> with non-alphabetic characters currently doesn't work, even in combination with other modifiers, due to GTK+ limitation. E.g. <c>Shift+Ctrl+A</c> works but <c>Shift+Ctrl+1</c> or <c>Shift+/</c> do not, so avoid using accelerators of this form in portable code.
      </p><p>Note: In wxGTk, the left/right/up/down arrow keys do not work as accelerator keys for a menu item unless a modifier key is used. Additionally, the following keycodes are not supported as menu accelerator keys: 
      </p><p>See: <seemfa marker="#getItemLabel/1"><c>getItemLabel/1</c></seemfa>, <seemfa marker="#getItemLabelText/1"><c>getItemLabelText/1</c></seemfa>
      </p></desc>
  </func>
  </funcs>
</erlref>
