<?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><year>2021</year>
    <holder>wxWidgets team.</holder></copyright>
  <legalnotice>Licensed under the wxWindows Free Documentation Licence, Version 3
  </legalnotice>
  <title>wxUpdateUIEvent</title>
</header>
<module>wxUpdateUIEvent</module>
<modulesummary>Functions for wxUpdateUIEvent class</modulesummary>
<description><p>This class is used for pseudo-events which are called by wxWidgets to give an application the chance to update various user interface elements.
      </p><p>Without update UI events, an application has to work hard to check/uncheck, enable/disable, show/hide, and set the text for elements such as menu items and toolbar buttons. The code for doing this has to be mixed up with the code that is invoked when an action is invoked for a menu item or button.
      </p><p>With update UI events, you define an event handler to look at the state of the application and change UI elements accordingly. wxWidgets will call your member functions in idle time, so you don't have to worry where to call this code.
      </p><p>In addition to being a clearer and more declarative method, it also means you don't have to worry whether you're updating a toolbar or menubar identifier. The same handler can update a menu item and toolbar button, if the identifier is the same. Instead of directly manipulating the menu or button, you call functions in the event object, such as <seemfa marker="#check/2"><c>check/2</c></seemfa>. wxWidgets will determine whether such a call has been made, and which UI element to update.
      </p><p>These events will work for popup menus as well as menubars. Just before a menu is popped up, <c>wxMenu::UpdateUI</c> (not implemented in wx) is called to process any UI events for the window that owns the menu.
      </p><p>If you find that the overhead of UI update processing is affecting your application, you can do one or both of the following: 
      </p><p> Note that although events are sent in idle time, defining a <seeerl marker="wxIdleEvent"><c>wxIdleEvent</c></seeerl> handler for a window does not affect this because the events are sent from <c>wxWindow::OnInternalIdle</c> (not implemented in wx) which is always called in idle time.
      </p><p>wxWidgets tries to optimize update events on some platforms. On Windows and GTK+, events for menubar items are only sent when the menu is about to be shown, and not in idle time.
      </p><p>See: <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_update_u_i_event.html">wxUpdateUIEvent</url></p>
  </description><section><title>Events</title><p>Use <seemfa marker="wxEvtHandler#connect/3"><c>wxEvtHandler:connect/3</c></seemfa> with <seetype marker="#wxUpdateUIEventType"><c>wxUpdateUIEventType</c></seetype> to subscribe to events of this type.</p></section>
<datatypes>
    <datatype><name name="wxUpdateUIEvent"/></datatype>
    <datatype><name name="wxUpdateUI"/></datatype>
    <datatype><name name="wxUpdateUIEventType"/></datatype></datatypes>

<funcs>
  <func>
    <name name="canUpdate" arity="1" clause_i="1" since=""/>
    <fsummary>Returns true if it is appropriate to update (send UI update events to) this window. </fsummary>
    <desc><p>Returns true if it is appropriate to update (send UI update events to) this window. 
      </p><p>This function looks at the mode used (see <seemfa marker="#setMode/1"><c>setMode/1</c></seemfa>), the wxWS_EX_PROCESS_UI_UPDATES flag in <c>window</c>, the time update events were last sent in idle time, and the update interval, to determine whether events should be sent to this window now. By default this will always return true because the update mode is initially wxUPDATE_UI_PROCESS_ALL and the interval is set to 0; so update events will be sent as often as possible. You can reduce the frequency that events are sent by changing the mode and/or setting an update interval.
      </p><p>See: <seemfa marker="#resetUpdateTime/0"><c>resetUpdateTime/0</c></seemfa>, <seemfa marker="#setUpdateInterval/1"><c>setUpdateInterval/1</c></seemfa>, <seemfa marker="#setMode/1"><c>setMode/1</c></seemfa>
      </p></desc>
  </func>
  
  <func>
    <name name="check" arity="2" clause_i="1" since=""/>
    <fsummary>Check or uncheck the UI element. </fsummary>
    <desc><p>Check or uncheck the UI element. 
      </p></desc>
  </func>
  
  <func>
    <name name="enable" arity="2" clause_i="1" since=""/>
    <fsummary>Enable or disable the UI element. </fsummary>
    <desc><p>Enable or disable the UI element. 
      </p></desc>
  </func>
  
  <func>
    <name name="show" arity="2" clause_i="1" since=""/>
    <fsummary>Show or hide the UI element. </fsummary>
    <desc><p>Show or hide the UI element. 
      </p></desc>
  </func>
  
  <func>
    <name name="getChecked" arity="1" clause_i="1" since=""/>
    <fsummary>Returns true if the UI element should be checked. </fsummary>
    <desc><p>Returns true if the UI element should be checked. 
      </p></desc>
  </func>
  
  <func>
    <name name="getEnabled" arity="1" clause_i="1" since=""/>
    <fsummary>Returns true if the UI element should be enabled. </fsummary>
    <desc><p>Returns true if the UI element should be enabled. 
      </p></desc>
  </func>
  
  <func>
    <name name="getShown" arity="1" clause_i="1" since=""/>
    <fsummary>Returns true if the UI element should be shown. </fsummary>
    <desc><p>Returns true if the UI element should be shown. 
      </p></desc>
  </func>
  
  <func>
    <name name="getSetChecked" arity="1" clause_i="1" since=""/>
    <fsummary>Returns true if the application has called <c>check/2</c>. </fsummary>
    <desc><p>Returns true if the application has called <seemfa marker="#check/2"><c>check/2</c></seemfa>. 
      </p><p>For wxWidgets internal use only. 
      </p></desc>
  </func>
  
  <func>
    <name name="getSetEnabled" arity="1" clause_i="1" since=""/>
    <fsummary>Returns true if the application has called <c>enable/2</c>. </fsummary>
    <desc><p>Returns true if the application has called <seemfa marker="#enable/2"><c>enable/2</c></seemfa>. 
      </p><p>For wxWidgets internal use only. 
      </p></desc>
  </func>
  
  <func>
    <name name="getSetShown" arity="1" clause_i="1" since=""/>
    <fsummary>Returns true if the application has called <c>show/2</c>. </fsummary>
    <desc><p>Returns true if the application has called <seemfa marker="#show/2"><c>show/2</c></seemfa>. 
      </p><p>For wxWidgets internal use only. 
      </p></desc>
  </func>
  
  <func>
    <name name="getSetText" arity="1" clause_i="1" since=""/>
    <fsummary>Returns true if the application has called <c>setText/2</c>. </fsummary>
    <desc><p>Returns true if the application has called <seemfa marker="#setText/2"><c>setText/2</c></seemfa>. 
      </p><p>For wxWidgets internal use only. 
      </p></desc>
  </func>
  
  <func>
    <name name="getText" arity="1" clause_i="1" since=""/>
    <fsummary>Returns the text that should be set for the UI element. </fsummary>
    <desc><p>Returns the text that should be set for the UI element. 
      </p></desc>
  </func>
  
  <func>
    <name name="getMode" arity="0" clause_i="1" since=""/>
    <fsummary>Static function returning a value specifying how wxWidgets will send update events: to all windows, or only to those which specify that they will process the events. </fsummary>
    <desc><p>Static function returning a value specifying how wxWidgets will send update events: to all windows, or only to those which specify that they will process the events. 
      </p><p>See: <seemfa marker="#setMode/1"><c>setMode/1</c></seemfa>
      </p></desc>
  </func>
  
  <func>
    <name name="getUpdateInterval" arity="0" clause_i="1" since=""/>
    <fsummary>Returns the current interval between updates in milliseconds. </fsummary>
    <desc><p>Returns the current interval between updates in milliseconds. 
      </p><p>The value -1 disables updates, 0 updates as frequently as possible.
      </p><p>See: <seemfa marker="#setUpdateInterval/1"><c>setUpdateInterval/1</c></seemfa>
      </p></desc>
  </func>
  
  <func>
    <name name="resetUpdateTime" arity="0" clause_i="1" since=""/>
    <fsummary>Used internally to reset the last-updated time to the current time. </fsummary>
    <desc><p>Used internally to reset the last-updated time to the current time. 
      </p><p>It is assumed that update events are normally sent in idle time, so this is called at the end of idle processing.
      </p><p>See: <seemfa marker="#canUpdate/1"><c>canUpdate/1</c></seemfa>, <seemfa marker="#setUpdateInterval/1"><c>setUpdateInterval/1</c></seemfa>, <seemfa marker="#setMode/1"><c>setMode/1</c></seemfa>
      </p></desc>
  </func>
  
  <func>
    <name name="setMode" arity="1" clause_i="1" since=""/>
    <fsummary>Specify how wxWidgets will send update events: to all windows, or only to those which specify that they will process the events. </fsummary>
    <desc><p>Specify how wxWidgets will send update events: to all windows, or only to those which specify that they will process the events. 
      </p></desc>
  </func>
  
  <func>
    <name name="setText" arity="2" clause_i="1" since=""/>
    <fsummary>Sets the text for this UI element. </fsummary>
    <desc><p>Sets the text for this UI element. 
      </p></desc>
  </func>
  
  <func>
    <name name="setUpdateInterval" arity="1" clause_i="1" since=""/>
    <fsummary>Sets the interval between updates in milliseconds. </fsummary>
    <desc><p>Sets the interval between updates in milliseconds. 
      </p><p>Set to -1 to disable updates, or to 0 to update as frequently as possible. The default is 0.
      </p><p>Use this to reduce the overhead of UI update events if your application has a lot of windows. If you set the value to -1 or greater than 0, you may also need to call <seemfa marker="wxWindow#updateWindowUI/2"><c>wxWindow:updateWindowUI/2</c></seemfa> at appropriate points in your application, such as when a dialog is about to be shown. 
      </p></desc>
  </func>
  </funcs>
</erlref>
