ed_event.py :  » GUI » wxPython » wxPython-src-2.8.11.0 » wxPython » wx » tools » Editra » src » Python Open Source

Home
Python Open Source
1.3.1.2 Python
2.Ajax
3.Aspect Oriented
4.Blog
5.Build
6.Business Application
7.Chart Report
8.Content Management Systems
9.Cryptographic
10.Database
11.Development
12.Editor
13.Email
14.ERP
15.Game 2D 3D
16.GIS
17.GUI
18.IDE
19.Installer
20.IRC
21.Issue Tracker
22.Language Interface
23.Log
24.Math
25.Media Sound Audio
26.Mobile
27.Network
28.Parser
29.PDF
30.Project Management
31.RSS
32.Search
33.Security
34.Template Engines
35.Test
36.UML
37.USB Serial
38.Web Frameworks
39.Web Server
40.Web Services
41.Web Unit
42.Wiki
43.Windows
44.XML
Python Open Source » GUI » wxPython 
wxPython » wxPython src 2.8.11.0 » wxPython » wx » tools » Editra » src » ed_event.py
###############################################################################
# Name: ed_event.py                                                           #
# Purpose: Custom events used by Editra                                       #
# Author: Cody Precord <cprecord@editra.org>                                  #
# Copyright: (c) 2007 Cody Precord <staff@editra.org>                         #
# License: wxWindows License                                                  #
###############################################################################

"""
Provides custom events for the editors controls/objects to utilize

"""

__author__ = "Cody Precord <cprecord@editra.org>"
__svnid__ = "$Id: ed_event.py 63789 2010-03-30 02:25:17Z CJP $"
__revision__ = "$Revision: 63789 $"

#-----------------------------------------------------------------------------#
# Dependencies
import wx

#-----------------------------------------------------------------------------#

edEVT_UPDATE_TEXT = wx.NewEventType()
EVT_UPDATE_TEXT = wx.PyEventBinder(edEVT_UPDATE_TEXT, 1)
class UpdateTextEvent(wx.PyCommandEvent):
    """Event to signal that text needs updating"""
    def __init__(self, etype, eid, value=None):
        """Creates the event object"""
        wx.PyCommandEvent.__init__(self, etype, eid)
        self._value = value

    def GetValue(self):
        """Returns the value from the event.
        @return: the value of this event

        """
        return self._value

#--------------------------------------------------------------------------#

edEVT_NOTIFY = wx.NewEventType()
EVT_NOTIFY = wx.PyEventBinder(edEVT_NOTIFY, 1)
class NotificationEvent(UpdateTextEvent):
    """General notification event"""
    def __init__(self, etype, eid, value=None, obj=None):
        UpdateTextEvent.__init__(self, etype, eid, value)
        self.SetEventObject(obj)

#--------------------------------------------------------------------------#

edEVT_MAINWINDOW_EXIT = wx.NewEventType()
EVT_MAINWINDOW_EXIT = wx.PyEventBinder(edEVT_MAINWINDOW_EXIT, 1)
class MainWindowExitEvent(wx.PyCommandEvent):
    """Event to signal that the main window is exiting"""
    pass

#--------------------------------------------------------------------------#

edEVT_STATUS = wx.NewEventType()
EVT_STATUS = wx.PyEventBinder(edEVT_STATUS, 1)
class StatusEvent(wx.PyCommandEvent):
    """Event for posting status events"""
    def __init__(self, etype, eid, msg=None, sec=0):
        """Create an event that can be used to post status messages
        to the main windows status bar.
        @param etype: The type of event to create
        @param eid: The event id
        @keyword msg: The status message to post with the event
        @keyword sec: The section of the status bar to post message to

        """
        wx.PyCommandEvent.__init__(self, etype, eid)
        self._msg = msg
        self._sec = sec

    def GetMessage(self):
        """Returns the value from the event.
        @return: the value of this event

        """
        return self._msg

    def GetSection(self):
        """Returns the messages posting section
        @return: int zero based index of where to post to statusbar

        """
        return self._sec
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.