Esempio n. 1
0
    if not _sharedConfs.has_key(confFile):
        conf = ConfigParser()
        conf.read(confFile)
        conf.confFile = confFile
        _sharedConfs[confFile] = conf

    return _sharedConfs[confFile]

def writeConfig(conf):
    conf.write(open(conf.confFile, 'w'))

import wx.html

wxEVT_HTML_URL_CLICK = wx.NewId()
EVT_HTML_URL_CLICK = wx.PyEventBinder(wxEVT_HTML_URL_CLICK)


class wxHtmlWindowUrlClick(wx.PyEvent):
    def __init__(self, linkinfo):
        wx.PyEvent.__init__(self)
        self.SetEventType(wxEVT_HTML_URL_CLICK)
        self.linkinfo = (linkinfo.GetHref(), linkinfo.GetTarget())

class wxUrlClickHtmlWindow(wx.html.HtmlWindow):
    """ HTML window that generates and OnLinkClicked event.

    Use this to avoid having to override HTMLWindow
    """
    def OnLinkClicked(self, linkinfo):
        wx.PostEvent(self, wxHtmlWindowUrlClick(linkinfo))
Esempio n. 2
0
    "z3EtAGDtnf65cn7NDs0JQwIcDWJ0oZApFrIgNAMCI9/I+L/Ht0KVSjbD3xsj110nuhYb9cbz"
    "nnl8W5JsZCt6vP4BQCYNciTwQXKs95b/jwCoEbDOghqr3dt7r13riA4OPD/K7mFGj4yOUZHj"
    "Uc8pj9fOvvHlL3+ZHj58SP/yi5/v5svlkv7yl7/QRx99tAc4y+XykUDpLWZm0SsbkFmAStCN"
    "+HgG3VLhozbU3pLELYqA0iGATva6Nf8Kn8patACXnj4ZkJMF7xLgyJMc69srzAMl4eyJiDe3"
    "EUnFoyrYyYDfSM6h5yRlVJIlX4vGegBIt3uAB1HWTtGD++kTHQS6szHfSu6H3MMIwCIdDuFP"
    "Uo/oA8feay2/FzzyfvfmFO/wBPXzZMo4OZlM6Otf/zo9fPiQXnzxRZr/9re/pbfeeotOT0/3"
    "t6ZQgOw5ZqouRuviRcgSnSSMoh4QMFoXKW8k79ZA0xOQRgezx5HgKoTW00pk1a/k3gSxjXjJ"
    "YXRw/LRQa2LLjIv8rgXY9xJK8jrRZm3007qnEd1EPDnkej5OMCmpchoeEcfP9XpNRET/Ax6j"
    "kIck2UJrAAAAAElFTkSuQmCC")

# ----------------------------------------------------------------------------
# ZoomBar events and binding for handling them
# ----------------------------------------------------------------------------

wxEVT_ZOOMBAR = wx.NewEventType()
EVT_ZOOMBAR = wx.PyEventBinder(wxEVT_ZOOMBAR, 1)
""" Process a `wxEVT_ZOOMBAR` event, when a :class:`ZoomBar` button is clicked. """

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


def MakeDisabledBitmap(original):
    """
    Creates a disabled-looking bitmap starting from the input one.

    :param `original`: an instance of :class:`wx.Bitmap` to be greyed-out.
    """

    img = original.ConvertToImage()
    return wx.Bitmap(img.ConvertToGreyscale())
Esempio n. 3
0
#
# this module is used for custom event
#

import wx

# ------------------------------------- #
# Custom EventType
# ------------------------------------- #
wxNotifyEvent = wx.NewEventType()

# ------------------------------------- #
# Custom Python Event Binder
# ------------------------------------- #
EVT_NOTIFY_EVENT = wx.PyEventBinder(wxNotifyEvent,1)

# 
# ------------------------------------- #
# Class NotifyEvent
# ------------------------------------- #
class NotifyEvent(wx.PyCommandEvent):
    '''
    custom notify event
    data: save some private info
    '''
    def __init__(self, evtType, id = -1):
        wx.PyCommandEvent.__init__(self,evtType,id)
        self.data = None
        #self._eventType = evtType
    def SetData(self,data=None):
Esempio n. 4
0

def getListCtrlSelection(listctrl, state=wx.LIST_STATE_SELECTED):
    """ Returns list of item indexes of given state (selected by defaults) """
    res = []
    idx = -1
    while 1:
        idx = listctrl.GetNextItem(idx, wx.LIST_NEXT_ALL, state)
        if idx == -1:
            break
        res.append(idx)
    return res


wxEVT_DOPOPUPMENU = wx.NewEventType()
EVT_DOPOPUPMENU = wx.PyEventBinder(wxEVT_DOPOPUPMENU, 0)


class ListCtrlSelectionManagerMix:
    """Mixin that defines a platform independent selection policy

    As selection single and multi-select list return the item index or a
    list of item indexes respectively.
    """
    _menu = None

    def __init__(self):
        self.Bind(wx.EVT_RIGHT_DOWN, self.OnLCSMRightDown)
        self.Bind(EVT_DOPOPUPMENU, self.OnLCSMDoPopup)
#        self.Connect(-1, -1, self.wxEVT_DOPOPUPMENU, self.OnLCSMDoPopup)
Esempio n. 5
0
CTRLBAR_NAME_STR = u'EditraControlBar'
CTRLBOX_NAME_STR = u'EditraControlBox'

#-- Control Style Flags --#

# ControlBar
CTRLBAR_STYLE_DEFAULT       = 0
CTRLBAR_STYLE_GRADIENT      = 1     # Paint the bar with a gradient
CTRLBAR_STYLE_BORDER_BOTTOM = 2     # Add a border to the bottom
CTRLBAR_STYLE_BORDER_TOP    = 4     # Add a border to the top

#CTRLBAR_STYLE_FOLDABLE = 2  # Add a fold button to the bar.

# ControlBar event for items added by AddTool
edEVT_CTRLBAR = wx.NewEventType()
EVT_CTRLBAR = wx.PyEventBinder(edEVT_CTRLBAR, 1)
class ControlBarEvent(wx.PyCommandEvent):
    """ControlBar Button Event"""

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

class ControlBox(wx.PyPanel):
    """Simple managed panel helper class that allows for adding and
    managing the position of a small toolbar like panel.
    @see: L{ControlBar}

    """
    def __init__(self, parent, id=wx.ID_ANY,
                 pos=wx.DefaultPosition, size=wx.DefaultSize,
                 style=wx.TAB_TRAVERSAL|wx.NO_BORDER,
                 name=CTRLBOX_NAME_STR):
import wx

from control import RibbonControl
from art import *

wxEVT_COMMAND_RIBBONGALLERY_HOVER_CHANGED = wx.NewEventType()
wxEVT_COMMAND_RIBBONGALLERY_SELECTED = wx.NewEventType()

EVT_RIBBONGALLERY_HOVER_CHANGED = wx.PyEventBinder(
    wxEVT_COMMAND_RIBBONGALLERY_HOVER_CHANGED, 1)
EVT_RIBBONGALLERY_SELECTED = wx.PyEventBinder(
    wxEVT_COMMAND_RIBBONGALLERY_SELECTED, 1)


class RibbonGalleryEvent(wx.PyCommandEvent):
    def __init__(self, command_type=None, win_id=0, gallery=None, item=None):

        wx.PyCommandEvent.__init__(self, command_type, win_id)
        self._gallery = gallery
        self._item = item

    def Clone(self):

        return RibbonGalleryEvent(self)

    def GetGallery(self):

        return self._gallery

    def GetGalleryItem(self):
Esempio n. 7
0
# Set no delay time to open the web page
webbrowser.PROCESS_CREATION_DELAY = 0

# To show a popup that copies the hyperlinks on the clipboard
wxHYPERLINKS_POPUP_COPY = 1000
""" Flag used to show a popup that copies the hyperlinks on the clipboard. """

# wxEVT_HYPERLINK_LEFT: Respond To A Left Mouse Button Event
# wxEVT_HYPERLINK_MIDDLE: Respond To A Middle Mouse Button Event
# wxEVT_HYPERLINK_RIGHT: Respond To A Right Mouse Button Event

wxEVT_HYPERLINK_LEFT = wx.NewEventType()
wxEVT_HYPERLINK_MIDDLE = wx.NewEventType()
wxEVT_HYPERLINK_RIGHT = wx.NewEventType()

EVT_HYPERLINK_LEFT = wx.PyEventBinder(wxEVT_HYPERLINK_LEFT, 1)
""" Responds to a left mouse button event. Sent when the left mouse button is
clicked, but only if `AutoBrowse` is set to ``False``. """
EVT_HYPERLINK_MIDDLE = wx.PyEventBinder(wxEVT_HYPERLINK_MIDDLE, 1)
""" Responds to a middle mouse button event. Sent when the middle mouse button is clicked. """
EVT_HYPERLINK_RIGHT = wx.PyEventBinder(wxEVT_HYPERLINK_RIGHT, 1)
""" Handles a right mouse button event. Sent when the right mouse button is
clicked, but only if `DoPopup` is set to ``False``. """


# ------------------------------------------------------------
# This class implements the event listener for the hyperlinks
# ------------------------------------------------------------

class HyperLinkEvent(wx.CommandEvent):
    """
Esempio n. 8
0
            return False
        # Command to feed pexpect
        #self.command = ' '.join([
        #        'echo "' + self.pw + '" | ',
        #        'sudo openconnect',
        #        '--protocol="' + self.prot + '"',
        #        '--user="******"',
        #        '--passwd-on-stdin',
        #        self.host
        #    ])
        # Initialise pexpect
        self.command = 'cmd.exe /C "for /L %i in (1,1,20) do @echo Log entry %i && @timeout /t 2 > nul"'

# Custom logging event
myCustomLogEvent = wx.NewEventType()
customLogEvent = wx.PyEventBinder(myCustomLogEvent, 1)
class logEvent(wx.PyCommandEvent):
    '''Event to signal that log entries are ready'''
    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 self._value

class vpnThread(threading.Thread):
    def __init__(self, parent, params):
        '''
        @param parent: The gui object that should receive logs
Esempio n. 9
0
        return self.model

    def SetModel(self, model):
        self.model = model

    def SetDescription(self, desc):
        '''
        Set a string that describes the event that has occurred
        '''
        self.description = desc


# Generating an event type:
myEVT_NEW_MODEL = wx.NewEventType()
# Creating an event binder object
EVT_NEW_MODEL = wx.PyEventBinder(myEVT_NEW_MODEL)


def _post_new_model_event(parent, model, desc=''):
    # Send an event that a new data set has been loaded
    evt = GenericModelEvent(myEVT_NEW_MODEL, parent.GetId(), model)
    evt.SetDescription(desc)
    # Process the event!
    parent.GetEventHandler().ProcessEvent(evt)


# Generating an event type:
myEVT_SIM_PLOT = wx.NewEventType()
# Creating an event binder object
EVT_SIM_PLOT = wx.PyEventBinder(myEVT_SIM_PLOT)
Esempio n. 10
0
                     IEC_BTN_1, IEC_BTN_2, IEC_BTN_3, IEC_BTN_4, IEC_BTN_9,
                     IEC_BTN_10, IEC_BTN_11, IEC_BTN_12, IEC_BTN_13,
                     IEC_BTN_14)[code - IEC_BTN_0], val)

        return event


# ------------------------------------------------------------------------
# new wxPython event classes
# ------------------------------------------------------------------------

grEVT_POWERMATE_BUTTON = wx.NewEventType()
grEVT_POWERMATE_ROTATE = wx.NewEventType()
grEVT_POWERMATE_SHUTTLE = wx.NewEventType()

EVT_POWERMATE_BUTTON = wx.PyEventBinder(grEVT_POWERMATE_BUTTON, 0)
EVT_POWERMATE_ROTATE = wx.PyEventBinder(grEVT_POWERMATE_ROTATE, 0)
EVT_POWERMATE_SHUTTLE = wx.PyEventBinder(grEVT_POWERMATE_SHUTTLE, 0)


class PMButtonEvent(wx.PyEvent):
    def __init__(self, button, value):
        wx.PyEvent.__init__(self)
        self.SetEventType(grEVT_POWERMATE_BUTTON)
        self.button = button
        self.value = value

    def Clone(self):
        self.__class__(self.GetId())

Esempio n. 11
0
# All Styles
OPB_ALL_STYLES = (wx.stc.STC_STYLE_DEFAULT, wx.stc.STC_STYLE_CONTROLCHAR,
                  OPB_STYLE_DEFAULT, OPB_STYLE_ERROR, OPB_STYLE_INFO,
                  OPB_STYLE_WARN)

# Error Codes
OPB_ERROR_NONE = 0
OPB_ERROR_INVALID_COMMAND = -1

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

# Event for notifying that the process has started running
# GetValue will return the command line string that started the process
edEVT_PROCESS_START = wx.NewEventType()
EVT_PROCESS_START = wx.PyEventBinder(edEVT_PROCESS_START, 1)

# Event for notifying that a task is starting to run
edEVT_TASK_START = wx.NewEventType()
EVT_TASK_START = wx.PyEventBinder(edEVT_TASK_START, 1)

# Event for passing output data to buffer
# GetValue returns the output text retrieved from the process
edEVT_UPDATE_TEXT = wx.NewEventType()
EVT_UPDATE_TEXT = wx.PyEventBinder(edEVT_UPDATE_TEXT, 1)

# Event for notifying that the the process has finished and no more update
# events will be sent. GetValue will return the processes exit code
edEVT_PROCESS_EXIT = wx.NewEventType()
EVT_PROCESS_EXIT = wx.PyEventBinder(edEVT_PROCESS_EXIT, 1)
Esempio n. 12
0
This module contains a widget class and supporting classes for a generic HTML
renderer.  It supports only a subset of the HTML standards, and no Javascript
or CSS, but it is relatively lightweight and has no platform dependencies.  It
is suitable for displaying simple HTML documents, such as the application's
documentation or built-in help pages.

.. note:: Due to some internal dynamic initialization in wxWidgets, this
          module should be imported **before** the :class:`wx.App` object is
          created.
"""

from ._html import *

import wx

EVT_HTML_CELL_CLICKED = wx.PyEventBinder(wxEVT_HTML_CELL_CLICKED, 1)
EVT_HTML_CELL_HOVER = wx.PyEventBinder(wxEVT_HTML_CELL_HOVER, 1)
EVT_HTML_LINK_CLICKED = wx.PyEventBinder(wxEVT_HTML_LINK_CLICKED, 1)

# deprecated wxEVT aliases
wxEVT_COMMAND_HTML_CELL_CLICKED = wxEVT_HTML_CELL_CLICKED
wxEVT_COMMAND_HTML_CELL_HOVER = wxEVT_HTML_CELL_HOVER
wxEVT_COMMAND_HTML_LINK_CLICKED = wxEVT_HTML_LINK_CLICKED


def _HtmlBookRecArray___repr__(self):
    return "HtmlBookRecArray: " + repr(list(self))


HtmlBookRecArray.__repr__ = _HtmlBookRecArray___repr__
del _HtmlBookRecArray___repr__
Esempio n. 13
0
BASE_URL = "http://dawningbrooke.net/apis/admin/registration/attendeeonsite/add/"
SERIAL_DEVICE = "/dev/ttyACM0"

if len(sys.argv) == 3:
    BASE_URL = sys.argv[1]
    SERIAL_DEVICE = sys.argv[2]
else:
    print "Usage: {} <Base Add URL> <Serial port>".format(sys.argv[0])
    print "Using defaults:\n  URL: {}\n  Port: {}\n".format(BASE_URL, SERIAL_DEVICE)


def xstr(s):
    return '' if s is None else str(s)

t_DATA_WAITING = wx.NewEventType()
DATA_WAITING = wx.PyEventBinder(t_DATA_WAITING, 1)
t_THREAD_ERROR = wx.NewEventType()
THREAD_ERROR = wx.PyEventBinder(t_THREAD_ERROR, 1)

class AAMVATestFrame(wx.Frame):
    def __init__(self, *args, **kwargs):
        wx.Frame.__init__(self, *args, **kwargs)
        self.panel = wx.Panel(self)

        vSizer = wx.BoxSizer(wx.VERTICAL)
        hSizer1 = wx.BoxSizer(wx.HORIZONTAL)

        #Row 1
        nameSt = wx.StaticText(self.panel, wx.ID_ANY, "Name")
        hSizer1.Add(nameSt, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5)
        self.NameText = wx.TextCtrl(self.panel, wx.ID_ANY, style=wx.TE_READONLY)
Esempio n. 14
0
import codecs
import serial
import threading
import wx
import wxSerialConfigDialog

# ----------------------------------------------------------------------
# Create an own event type, so that GUI updates can be delegated
# this is required as on some platforms only the main thread can
# access the GUI without crashing. wxMutexGuiEnter/wxMutexGuiLeave
# could be used too, but an event is more elegant.

SERIALRX = wx.NewEventType()
# bind to serial data receive events
EVT_SERIALRX = wx.PyEventBinder(SERIALRX, 0)


class SerialRxEvent(wx.PyCommandEvent):
    eventType = SERIALRX

    def __init__(self, windowID, data):
        wx.PyCommandEvent.__init__(self, self.eventType, windowID)
        self.data = data

    def Clone(self):
        self.__class__(self.GetId(), self.data)


# ----------------------------------------------------------------------
Esempio n. 15
0
def _EventMaker():
    evt = wx.NewEventType()
    return (evt, wx.PyEventBinder(evt))
Esempio n. 16
0
import wx

rpcPENDING = 0
rpcDONE = 1
rpcEXCEPT = 2


class RPCRequest:
    """A wrapper to use for handling requests and their responses"""
    status = rpcPENDING
    result = None


# here's the ID for external events
wxEVT_EXTERNAL_EVENT = wx.NewEventType()
EVT_EXTERNAL_EVENT = wx.PyEventBinder(wxEVT_EXTERNAL_EVENT, 0)


class ExternalEvent(wx.PyEvent):
    """The custom event class used to pass xmlrpc calls from
     the server thread into the GUI thread

  """
    def __init__(self, method, args):
        wx.PyEvent.__init__(self)
        self.SetEventType(wxEVT_EXTERNAL_EVENT)
        self.method = method
        self.args = args
        self.rpcStatus = RPCRequest()
        self.rpcStatusLock = threading.Lock()
        self.rpcCondVar = threading.Condition()
Esempio n. 17
0
        out = []
        while 1:
            if inpLines:
                inp.write(inpLines.pop())
            l = outp.readline()
            if not l: break
            out.append(l)

        errLines = errp.readlines()
        serr = ErrorStack.buildErrorList(errLines)
        self.pid = pid

        if serr or out:
            return self.checkError(serr, _('Ran'), out, errRaw=errLines)
        else:
            return None


PreferredRunner = PopenModuleRunner

wxEVT_EXEC_FINISH = wx.NewId()

EVT_EXEC_FINISH = wx.PyEventBinder(wxEVT_EXEC_FINISH)


class ExecFinishEvent(wx.PyEvent):
    def __init__(self, runner):
        wx.PyEvent.__init__(self)
        self.SetEventType(wxEVT_EXEC_FINISH)
        self.runner = runner
Esempio n. 18
0
 def __init__(self):
     self.EVT_TYPE_NOTICE = wx.NewEventType()
     self.EVT_NOTICE = wx.PyEventBinder(self.EVT_TYPE_NOTICE, 1)
     self.subscribers = {}
Esempio n. 19
0
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Cockpit.  If not, see <http://www.gnu.org/licenses/>.

import collections
import json
import typing

import wx

import cockpit.events

EVT_CHANNEL_ADDED = wx.PyEventBinder(wx.NewEventType())
EVT_CHANNEL_REMOVED = wx.PyEventBinder(wx.NewEventType())

Channel = typing.Dict[str, typing.Any]


class Channels(wx.EvtHandler):
    """Map names to channel configurations.

    A channel configuration sets objective, light sources, and
    cameras.  It is the configuration to replicate the image
    acquisition settings.

    `Channels` keep the order of channels that are added.  While
    technically not needed for a map/dict object, this is used to
    construct GUI elements where it is important to keep the order for
Esempio n. 20
0
# (See also the genaxmodule script.)

import wx
import wx.activex

clsID = '{D27CDB6E-AE6D-11CF-96B8-444553540000}'
progID = 'ShockwaveFlash.ShockwaveFlash.1'



# Create eventTypes and event binders
wxEVT_ReadyStateChange = wx.activex.RegisterActiveXEvent('OnReadyStateChange')
wxEVT_Progress = wx.activex.RegisterActiveXEvent('OnProgress')
wxEVT_FSCommand = wx.activex.RegisterActiveXEvent('FSCommand')

EVT_ReadyStateChange = wx.PyEventBinder(wxEVT_ReadyStateChange, 1)
EVT_Progress = wx.PyEventBinder(wxEVT_Progress, 1)
EVT_FSCommand = wx.PyEventBinder(wxEVT_FSCommand, 1)


# Derive a new class from ActiveXWindow
class FlashWindow(wx.activex.ActiveXWindow):
    def __init__(self, parent, ID=-1, pos=wx.DefaultPosition,
                 size=wx.DefaultSize, style=0, name='FlashWindow'):
        wx.activex.ActiveXWindow.__init__(self, parent,
            wx.activex.CLSID('{D27CDB6E-AE6D-11CF-96B8-444553540000}'),
            ID, pos, size, style, name)

    # Methods exported by the ActiveX object
    def QueryInterface(self, riid):
        return self.CallAXMethod('QueryInterface', riid)
Esempio n. 21
0
import imagepreview
import nebulaguisettings as guisettings
import servers
import togwin
import trnlayerprefsdlg

import conjurerconfig as cfg
import conjurerframework as cjr

# Layers limit
MaxLayers = 255


# Event used to notify selection of a layer control
EVT_SELECT_TYPE = wx.NewEventType()
EVT_SELECT = wx.PyEventBinder(EVT_SELECT_TYPE, 1)

# LayerSelectedEvent class
class LayerSelectedEvent(wx.PyCommandEvent):
    def __init__(self, id, object):
        wx.PyCommandEvent.__init__(self, EVT_SELECT_TYPE, id)
        self.SetEventObject(object)


# LayerCtrl class
class LayerCtrl(wx.PyControl):
    """Control used to handle a single terrain texture layer"""
    
    def __init__(self, parent, id, layer_id):
        wx.PyControl.__init__(self, parent, id, style=wx.NO_BORDER)
        self.layer_id = layer_id
Esempio n. 22
0
# -*- coding: utf-8 -*-
"""
Created on Sun Dec 06 20:14:02 2015

@author: Sebastien Popoff
"""

try:
    import wx
except ImportError:
    raise ImportError("The wxPython module is required to run this program.")
import threading
import numpy as np
import time

EVT_NEW_IMAGE = wx.PyEventBinder(wx.NewEventType(), 0)


class ImageEvent(wx.PyCommandEvent):
    def __init__(self, eventType=EVT_NEW_IMAGE.evtType[0], id=0):
        wx.PyCommandEvent.__init__(self, eventType, id)
        self.img = None
        self.color = False
        self.oldImageLock = None
        self.eventLock = None


class SLMframe(wx.Frame):
    """Frame used to display full screen image."""
    def __init__(self, monitor, isImageLock=True):
        self.isImageLock = isImageLock
Esempio n. 23
0
import wx.gizmos as gizmos
from wx.lib.pubsub import pub as Publisher
import wx.lib.splitter as spl

import invesalius.constants as const
import invesalius.gui.dialogs as dlg
#import invesalius.gui.dicom_preview_panel as dpp
import invesalius.reader.dicom_grouper as dcm
import invesalius.net.dicom as dcm_net

from wx.lib.mixins.listctrl import CheckListCtrlMixin
#from dicionario import musicdata
import wx.lib.mixins.listctrl as listmix

myEVT_SELECT_SERIE = wx.NewEventType()
EVT_SELECT_SERIE = wx.PyEventBinder(myEVT_SELECT_SERIE, 1)

myEVT_SELECT_SLICE = wx.NewEventType()
EVT_SELECT_SLICE = wx.PyEventBinder(myEVT_SELECT_SLICE, 1)

myEVT_SELECT_PATIENT = wx.NewEventType()
EVT_SELECT_PATIENT = wx.PyEventBinder(myEVT_SELECT_PATIENT, 1)

myEVT_SELECT_SERIE_TEXT = wx.NewEventType()
EVT_SELECT_SERIE_TEXT = wx.PyEventBinder(myEVT_SELECT_SERIE_TEXT, 1)


class SelectEvent(wx.PyCommandEvent):
    def __init__(self, evtType, id):
        super(SelectEvent, self).__init__(evtType, id)
Esempio n. 24
0
# o wxGridRowMover -> GridRowMover
#

import wx
import wx.grid

#----------------------------------------------------------------------------
# event class and macros
#
# New style 12/7/03
#

wxEVT_COMMAND_GRID_COL_MOVE = wx.NewEventType()
wxEVT_COMMAND_GRID_ROW_MOVE = wx.NewEventType()

EVT_GRID_COL_MOVE = wx.PyEventBinder(wxEVT_COMMAND_GRID_COL_MOVE, 1)
EVT_GRID_ROW_MOVE = wx.PyEventBinder(wxEVT_COMMAND_GRID_ROW_MOVE, 1)

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


class GridColMoveEvent(wx.PyCommandEvent):
    def __init__(self, id, dCol, bCol):
        wx.PyCommandEvent.__init__(self, id=id)
        self.SetEventType(wxEVT_COMMAND_GRID_COL_MOVE)
        self.moveColumn = dCol
        self.beforeColumn = bCol

    def GetMoveColumn(self):
        return self.moveColumn
Esempio n. 25
0
import projects.ProjCmnDlg as ProjCmnDlg

# Editra Library Imports
import util
import eclib

#--------------------------------------------------------------------------#
# Globals
_ = wx.GetTranslation

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

DATE_FORMAT = '%Y-%m-%d %I:%M %p'

edEVT_UPDATE_ITEMS = wx.NewEventType()
EVT_UPDATE_ITEMS = wx.PyEventBinder(edEVT_UPDATE_ITEMS, 1)


class UpdateItemsEvent(wx.PyCommandEvent):
    """Event to signal that items need updating"""
    def __init__(self, etype, eid, value=[]):
        super(UpdateItemsEvent, self).__init__(etype, eid)
        self._value = value

    def GetValue(self):
        """Get event value"""
        return self._value


#--------------------------------------------------------------------------#
Esempio n. 26
0
import wx

TOOLBUTTONEVENT = wx.NewEventType()
TOOLTOGGLEEVENT = wx.NewEventType()
TOOLDROPDOWNEVENT = wx.NewEventType()
TOOLRIGHTCLICKEVENT = wx.NewEventType()
TOOLRESIZEEVENT = wx.NewEventType()

ZEVT_TOOL_BUTTON = wx.PyEventBinder(TOOLBUTTONEVENT, 1)
ZEVT_TOOL_TOGGLE_BUTTON = wx.PyEventBinder(TOOLTOGGLEEVENT, 1)
ZEVT_TOOL_DROPDOWN_BUTTON = wx.PyEventBinder(TOOLDROPDOWNEVENT, 1)
ZEVT_TOOL_RIGHT_CLICK = wx.PyEventBinder(TOOLRIGHTCLICKEVENT, 1)
ZEVT_TOOLBAR_RESIZE = wx.PyEventBinder(TOOLRESIZEEVENT, 1)

# ----------------------------------------------------------------------------
# Custom event class.
# ----------------------------------------------------------------------------
class ZToolEvent(wx.PyCommandEvent):

    def __init__(self, eventType, windowID, toolNode):
        self.toolNode = toolNode
        wx.PyCommandEvent.__init__(self, eventType, windowID)
    #end __init__

    def getToolNode(self):
        return self.toolNode
    # end getToolNode()

    def Clone(self):
        return self.__class__(self.GetEventType(), self.GetId(), self.getToolNode())
    # end Clone()
Esempio n. 27
0
    def GetCurveWWWl(self, curve):
        return (self.curves[curve].ww, self.curves[curve].wl)


class CLUTEvent(wx.PyCommandEvent):
    def __init__(self, evtType, id, curve):
        wx.PyCommandEvent.__init__(self, evtType, id)
        self.curve = curve

    def GetCurve(self):
        return self.curve


# Occurs when CLUT is sliding
myEVT_CLUT_SLIDER = wx.NewEventType()
EVT_CLUT_SLIDER = wx.PyEventBinder(myEVT_CLUT_SLIDER, 1)

# Occurs when CLUT was slided
myEVT_CLUT_SLIDER_CHANGE = wx.NewEventType()
EVT_CLUT_SLIDER_CHANGE = wx.PyEventBinder(myEVT_CLUT_SLIDER_CHANGE, 1)

# Occurs when CLUT point is changing
myEVT_CLUT_POINT_MOVE = wx.NewEventType()
EVT_CLUT_POINT_MOVE = wx.PyEventBinder(myEVT_CLUT_POINT_MOVE, 1)

# Occurs when a CLUT point was changed
myEVT_CLUT_POINT_RELEASE = wx.NewEventType()
EVT_CLUT_POINT_RELEASE = wx.PyEventBinder(myEVT_CLUT_POINT_RELEASE, 1)

# Selected a curve
myEVT_CLUT_CURVE_SELECT = wx.NewEventType()
Esempio n. 28
0
__docformat__ = "epytext"


import wx
import math

# Flag to use double buffering (recommendeded = 1)
KC_BUFFERED_DC = 1
"""Flag to use double buffering (recommendeded = 1)"""

# Events
wxEVT_KC_ANGLE_CHANGING = wx.NewEventType()
wxEVT_KC_ANGLE_CHANGED = wx.NewEventType()

EVT_KC_ANGLE_CHANGING = wx.PyEventBinder(wxEVT_KC_ANGLE_CHANGING, 1)
""" Notify the client that the knob is changing its value."""
EVT_KC_ANGLE_CHANGED = wx.PyEventBinder(wxEVT_KC_ANGLE_CHANGED, 1)
""" Notify the client that the knob has changed its value."""

# ---------------------------------------------------------------------------- #
# Class KnobCtrlEvent
# ---------------------------------------------------------------------------- #

class KnobCtrlEvent(wx.CommandEvent):
    """
    Represent details of the events that the :class:`KnobCtrl` object sends.
    """

    def __init__(self, eventType, eventId=1):
        """
Esempio n. 29
0
import os
import wx
import math
import wx.lib.agw.floatspin as FS

from time import sleep
from ViewPane import ViewPane
from protocolPane import ProtocolPane
from controlPanel import ControlPanel
from LightCrafter import wxLightCrafterFrame
from PreferencesDialog import PreferencesDialog
import socket
import threading

myEVT_MESSAGE = wx.NewEventType()
EVT_MESSAGE = wx.PyEventBinder(myEVT_MESSAGE, 1)

myEVT_RETURN_MESSAGE = wx.NewEventType()
EVT_RETURN_MESSAGE = wx.PyEventBinder(myEVT_RETURN_MESSAGE, 2)


# Sets Up The Class For The Program And Creates The Window
class wxFixationFrame(wx.Frame):
    # The number of ppd of the screen we'll be projecting to (e.g. Lightcrafter, Projector, etc).
    SCREEN_PPD = 20

    # The increment steps we'll use.
    MINOR_INCREMENT = 0.5
    MAJOR_INCREMENT = 1

    def __init__(self, parent=None, id=wx.ID_ANY):
Esempio n. 30
0
        wx.PyCommandEvent.__init__(self, id=id)
        self.SetEventType(wxEVT_COMMAND_COLOURSELECT)
        self.value = value

    def GetValue(self):
        """
        Returns the currently selected colour.

        :rtype: :class:`wx.Colour`
        """

        return self.value


EVT_COLOURSELECT = wx.PyEventBinder(wxEVT_COMMAND_COLOURSELECT, 1)

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


class CustomColourData(object):
    """
    A simple container for tracking custom colours to be shown in the colour
    dialog, and which facilitates reuse of this collection across multiple
    instances or multiple invocations of the :class:`ColourSelect` button.
    """
    COUNT = 16

    def __init__(self):
        self._customColours = [None] * self.COUNT