.. wxPython Phoenix documentation

   This file was generated by Phoenix's sphinx generator and associated
   tools, do not edit by hand.

   Copyright: (c) 2011-2020 by Total Control Software
   License:   wxWindows License

.. include:: headings.inc



.. _wx.ActivateEvent:

==========================================================================================================================================
|phoenix_title|  **wx.ActivateEvent**
==========================================================================================================================================

An activate event is sent when a window or application is being activated or deactivated.          

^^ 





.. _ActivateEvent-events:

|events| Events Emitted by this Class
=====================================

Handlers bound for the following event types will receive a :ref:`wx.ActivateEvent` parameter.

Event macros: 

- EVT_ACTIVATE: Process a  ``wxEVT_ACTIVATE``   event.   
- EVT_ACTIVATE_APP: Process a  ``wxEVT_ACTIVATE_APP``   event. This event is received by the App-derived instance only.   
- EVT_HIBERNATE: Process a hibernate event, supplying the member function. This event applies to :ref:`wx.App`  only, and only on Windows SmartPhone and PocketPC. It is generated when the system is low on memory; the application should free up as much memory as possible, and restore full working state when it receives a  ``wxEVT_ACTIVATE``   or   ``wxEVT_ACTIVATE_APP``   event. ^^ 






         



.. note:: 

   Until wxWidgets 3.1.0 activation events could be sent by wxMSW when the window was minimized. This reflected the native MSW behaviour but was often surprising and unexpected, so starting from 3.1.0 such events are not sent any more when the window is in the minimized state.  







.. seealso:: :ref:`Events and Event Handling <events and event handling>`, :meth:`wx.App.IsActive`     







|

|class_hierarchy| Class Hierarchy
=================================

.. raw:: html

   <div id="toggleBlock" onclick="return toggleVisibility(this)" class="closed" style="cursor:pointer;">
   <img id="toggleBlock-trigger" src="_static/images/closed.png"/>
   Inheritance diagram for class <strong>ActivateEvent</strong>:
   </div>
   <div id="toggleBlock-summary" style="display:block;"></div>
   <div id="toggleBlock-content" style="display:none;">
   <p class="graphviz">
   <center><img src="_static/images/inheritance/wx.ActivateEvent_inheritance.png" alt="Inheritance diagram of ActivateEvent" usemap="#dummy" class="inheritance"/></center>
   <script type="text/javascript">toggleVisibilityOnLoad(document.getElementById('toggleBlock'))</script>
   <map id="dummy" name="dummy"> <area shape="rect" id="node1" href="wx.ActivateEvent.html" title="wx.ActivateEvent" alt="" coords="5,160,141,189"/> <area shape="rect" id="node2" href="wx.Event.html" title="wx.Event" alt="" coords="32,83,115,112"/> <area shape="rect" id="node3" href="wx.Object.html" title="wx.Object" alt="" coords="30,5,117,35"/> </map> 
   </p>
   </div>

|


|method_summary| Methods Summary
================================

================================================================================ ================================================================================
:meth:`~wx.ActivateEvent.__init__`                                               Constructor.
:meth:`~wx.ActivateEvent.GetActivationReason`                                    Allows checking if the window was activated by clicking it with the mouse or in some other way.
:meth:`~wx.ActivateEvent.GetActive`                                              Returns ``True`` if the application or window is being activated, ``False`` otherwise.
================================================================================ ================================================================================


|


|property_summary| Properties Summary
=====================================

================================================================================ ================================================================================
:attr:`~wx.ActivateEvent.Active`                                                 See :meth:`~wx.ActivateEvent.GetActive`
================================================================================ ================================================================================


|


|api| Class API
===============


.. class:: wx.ActivateEvent(Event)

   **Possible constructors**::

       ActivateEvent(eventType=wxEVT_NULL, active=True, id=0,
                     ActivationReason=Reason_Unknown)
       
   
   An activate event is sent when a window or application is being
   activated or deactivated.



   .. method:: __init__(self, eventType=wxEVT_NULL, active=True, id=0, ActivationReason=Reason_Unknown)

      Constructor.                  


      :param `eventType`: 
      :type `eventType`: wx.EventType
      :param `active`: 
      :type `active`: bool
      :param `id`: 
      :type `id`: int
      :param `ActivationReason`: 
      :type `ActivationReason`: wx.ActivateEvent.Reason







   .. method:: GetActivationReason(self)

      Allows checking if the window was activated by clicking it with the mouse or in some other way.                  

      This method is currently only implemented in wxMSW and returns  ``Reason_Mouse``   there if the window was activated by a mouse click and   ``Reason_Unknown``   if it was activated in any other way (e.g. from keyboard or programmatically). 

      Under all the other platforms,  ``Reason_Unknown``   is always returned. 

                

      :rtype: :ref:`wx.ActivateEvent.Reason`







      .. versionadded:: 3.0   








   .. method:: GetActive(self)

      Returns ``True`` if the application or window is being activated, ``False`` otherwise.                  

      :rtype: `bool`








   .. attribute:: Active

      See :meth:`~wx.ActivateEvent.GetActive`


.. toctree::
   :maxdepth: 1
   :hidden:

   wx.ActivateEvent.Reason.enumeration
