Пример #1
0
class PyEmbeddedImage(object):
    """
    PyEmbeddedImage is primarily intended to be used by code generated
    by img2py as a means of embedding image data in a python module so
    the image can be used at runtime without needing to access the
    image from an image file.  This makes distributing icons and such
    that an application uses simpler since tools like py2exe will
    automatically bundle modules that are imported, and the
    application doesn't have to worry about how to locate the image
    files on the user's filesystem.

    The class can also be used for image data that may be acquired
    from some other source at runtime, such as over the network or
    from a database.  In this case pass False for isBase64 (unless the
    data actually is base64 encoded.)  Any image type that
    wx.Image can handle should be okay.
    """

    def __init__(self, data, isBase64=True):
        self.data = data
        self.isBase64 = isBase64

    def GetBitmap(self):
        return wx.Bitmap(self.GetImage())

    def GetData(self):
        data = self.data
        if self.isBase64:
            data = b64decode(self.data)
        return data

    def GetIcon(self):
        icon = wx.Icon()
        icon.CopyFromBitmap(self.GetBitmap())
        return icon

    def GetImage(self):
        stream = BytesIO(self.GetData())
        return wx.Image(stream)

    # added for backwards compatibility
    getBitmap = wx.deprecated(GetBitmap)
    getData = wx.deprecated(GetData)
    getIcon = wx.deprecated(GetIcon)
    getImage = wx.deprecated(GetImage)

    # define properties, for convenience
    Bitmap = property(GetBitmap)
    Data = property(GetData)
    Icon = property(GetIcon)
    Image = property(GetImage)
Пример #2
0
# This file is generated by wxPython's SIP generator.  Do not edit by hand.
#
# Copyright: (c) 2017 by Total Control Software
# License:   wxWindows License
"""
The classes in this module enable loading widgets and layout from XML.
"""

from ._xrc import *

import wx
ID_NONE = wx.ID_NONE  # Needed for some parameter defaults in this module

XmlResource.LoadFromString = wx.deprecated(XmlResource.LoadFromBuffer,
                                           'Use LoadFromBuffer instead')


@wx.deprecatedMsg("Use :class:`xrc.XmlResource` instead")
def EmptyXmlResource(flags=XRC_USE_LOCALE, domain=""):
    """
    A compatibility wrapper for the XmlResource(flags, domain) constructor
    """
    return XmlResource(flags, domain)


def XRCID(str_id, value_if_not_found=wx.ID_NONE):
    """
    Returns a numeric ID that is equivalent to the string ID used in an XML resource.
    """
    return XmlResource.GetXRCID(str_id, value_if_not_found)
Пример #3
0
import wx

AboutDialogInfo.HasLicense = AboutDialogInfo.HasLicence
AboutDialogInfo.GetLicense = AboutDialogInfo.GetLicence
AboutDialogInfo.License = AboutDialogInfo.Licence


def _DateEvent_PyGetDate(self):
    """
    Return the date as a Python datetime.date object.
    """
    return wx.wxdate2pydate(self.GetDate())


DateEvent.PyGetDate = wx.deprecated(_DateEvent_PyGetDate,
                                    "Use GetDate instead.")
del _DateEvent_PyGetDate
DateEvent.PySetDate = wx.deprecated(DateEvent.SetDate, 'Use SetDate instead.')

EVT_DATE_CHANGED = wx.PyEventBinder(wxEVT_DATE_CHANGED, 1)
EVT_TIME_CHANGED = wx.PyEventBinder(wxEVT_TIME_CHANGED, 1)


def _CalendarCtrl_PyGetDate(self):
    """
    Return the date as a Python datetime.date object.
    """
    return wx.wxdate2pydate(self.GetDate())


CalendarCtrl.PyGetDate = wx.deprecated(_CalendarCtrl_PyGetDate,
Пример #4
0
# This file is generated by wxPython's SIP generator.  Do not edit by hand.
#
# Copyright: (c) 2020 by Total Control Software
# License:   wxWindows License
"""
Some simple XML classes for use with XRC.

For more advanced XML needs it would be better to use one of the XML packages
provided by Python.
"""

from ._xml import *

import wx

XmlProperty = wx.deprecated(XmlAttribute, 'Use XmlProperty instead.')
Пример #5
0
            newmap = dict()
        newmap.update(self.mapper)
        self.mapper = newmap
        self.usingWeakRefs = flag


class PyDataViewModel(DataViewModel, DataViewItemObjectMapper):
    """
    A convenience class that is a :class:`DataViewModel` combined with an object mapper.
    """
    def __init__(self):
        DataViewModel.__init__(self)
        DataViewItemObjectMapper.__init__(self)


PyDataViewIndexListModel = wx.deprecated(DataViewIndexListModel)
PyDataViewVirtualListModel = wx.deprecated(DataViewVirtualListModel)

PyDataViewCustomRenderer = wx.deprecated(DataViewCustomRenderer,
                                         "Use DataViewCustomRenderer instead")

EVT_DATAVIEW_SELECTION_CHANGED         = wx.PyEventBinder( wxEVT_DATAVIEW_SELECTION_CHANGED, 1)
EVT_DATAVIEW_ITEM_ACTIVATED            = wx.PyEventBinder( wxEVT_DATAVIEW_ITEM_ACTIVATED, 1)
EVT_DATAVIEW_ITEM_COLLAPSED            = wx.PyEventBinder( wxEVT_DATAVIEW_ITEM_COLLAPSED, 1)
EVT_DATAVIEW_ITEM_EXPANDED             = wx.PyEventBinder( wxEVT_DATAVIEW_ITEM_EXPANDED, 1)
EVT_DATAVIEW_ITEM_COLLAPSING           = wx.PyEventBinder( wxEVT_DATAVIEW_ITEM_COLLAPSING, 1)
EVT_DATAVIEW_ITEM_EXPANDING            = wx.PyEventBinder( wxEVT_DATAVIEW_ITEM_EXPANDING, 1)
EVT_DATAVIEW_ITEM_START_EDITING        = wx.PyEventBinder( wxEVT_DATAVIEW_ITEM_START_EDITING, 1)    
EVT_DATAVIEW_ITEM_EDITING_STARTED      = wx.PyEventBinder( wxEVT_DATAVIEW_ITEM_EDITING_STARTED, 1)
EVT_DATAVIEW_ITEM_EDITING_DONE         = wx.PyEventBinder( wxEVT_DATAVIEW_ITEM_EDITING_DONE, 1)
EVT_DATAVIEW_ITEM_VALUE_CHANGED        = wx.PyEventBinder( wxEVT_DATAVIEW_ITEM_VALUE_CHANGED, 1)
Пример #6
0
            newmap = dict()
        newmap.update(self.mapper)
        self.mapper = newmap
        self.usingWeakRefs = flag


class PyDataViewModel(DataViewModel, DataViewItemObjectMapper):
    """
    A convenience class that is a :class:`DataViewModel` combined with an object mapper.
    """
    def __init__(self):
        DataViewModel.__init__(self)
        DataViewItemObjectMapper.__init__(self)


PyDataViewIndexListModel = wx.deprecated(DataViewIndexListModel)
PyDataViewVirtualListModel = wx.deprecated(DataViewVirtualListModel)

PyDataViewCustomRenderer = wx.deprecated(DataViewCustomRenderer,
                                         "Use DataViewCustomRenderer instead")

EVT_DATAVIEW_SELECTION_CHANGED = wx.PyEventBinder(
    wxEVT_DATAVIEW_SELECTION_CHANGED, 1)
EVT_DATAVIEW_ITEM_ACTIVATED = wx.PyEventBinder(wxEVT_DATAVIEW_ITEM_ACTIVATED,
                                               1)
EVT_DATAVIEW_ITEM_COLLAPSED = wx.PyEventBinder(wxEVT_DATAVIEW_ITEM_COLLAPSED,
                                               1)
EVT_DATAVIEW_ITEM_EXPANDED = wx.PyEventBinder(wxEVT_DATAVIEW_ITEM_EXPANDED, 1)
EVT_DATAVIEW_ITEM_COLLAPSING = wx.PyEventBinder(wxEVT_DATAVIEW_ITEM_COLLAPSING,
                                                1)
EVT_DATAVIEW_ITEM_EXPANDING = wx.PyEventBinder(wxEVT_DATAVIEW_ITEM_EXPANDING,
Пример #7
0
GRID_VALUE_CHOICEINT = "choiceint"
GRID_VALUE_DATETIME = "datetime"

from collections import namedtuple

_im_GridCellCoords = namedtuple('_im_GridCellCoords', ['Row', 'Col'])
del namedtuple


def _GridCellCoordsArray___repr__(self):
    return "GridCellCoordsArray: " + repr(list(self))


GridCellCoordsArray.__repr__ = _GridCellCoordsArray___repr__
del _GridCellCoordsArray___repr__
PyGridCellRenderer = wx.deprecated(GridCellRenderer,
                                   'Use GridCellRenderer instead.')

PyGridCellEditor = wx.deprecated(GridCellEditor, 'Use GridCellEditor instead.')

PyGridCellAttrProvider = wx.deprecated(GridCellAttrProvider,
                                       'Use GridCellAttrProvider instead.')

PyGridTableBase = wx.deprecated(GridTableBase, 'Use GridTableBase instead.')

EVT_GRID_CELL_LEFT_CLICK = wx.PyEventBinder(wxEVT_GRID_CELL_LEFT_CLICK)
EVT_GRID_CELL_RIGHT_CLICK = wx.PyEventBinder(wxEVT_GRID_CELL_RIGHT_CLICK)
EVT_GRID_CELL_LEFT_DCLICK = wx.PyEventBinder(wxEVT_GRID_CELL_LEFT_DCLICK)
EVT_GRID_CELL_RIGHT_DCLICK = wx.PyEventBinder(wxEVT_GRID_CELL_RIGHT_DCLICK)
EVT_GRID_LABEL_LEFT_CLICK = wx.PyEventBinder(wxEVT_GRID_LABEL_LEFT_CLICK)
EVT_GRID_LABEL_RIGHT_CLICK = wx.PyEventBinder(wxEVT_GRID_LABEL_RIGHT_CLICK)
EVT_GRID_LABEL_LEFT_DCLICK = wx.PyEventBinder(wxEVT_GRID_LABEL_LEFT_DCLICK)
Пример #8
0
del _RichTextDrawingHandlerList___repr__


def _RichTextActionList___repr__(self):
    return "RichTextActionList: " + repr(list(self))


RichTextActionList.__repr__ = _RichTextActionList___repr__
del _RichTextActionList___repr__


def _RichTextCtrl_GetDefaultStyle(self):
    return self.GetDefaultStyleEx()


RichTextCtrl.GetDefaultStyle = wx.deprecated(_RichTextCtrl_GetDefaultStyle,
                                             "Use GetDefaultStyleEx instead")
del _RichTextCtrl_GetDefaultStyle
RichTextCtrl.DefaultStyle = property(RichTextCtrl.GetDefaultStyle,
                                     RichTextCtrl.SetDefaultStyle)
EVT_RICHTEXT_LEFT_CLICK = wx.PyEventBinder(wxEVT_RICHTEXT_LEFT_CLICK)
EVT_RICHTEXT_RIGHT_CLICK = wx.PyEventBinder(wxEVT_RICHTEXT_RIGHT_CLICK)
EVT_RICHTEXT_MIDDLE_CLICK = wx.PyEventBinder(wxEVT_RICHTEXT_MIDDLE_CLICK)
EVT_RICHTEXT_LEFT_DCLICK = wx.PyEventBinder(wxEVT_RICHTEXT_LEFT_DCLICK)
EVT_RICHTEXT_RETURN = wx.PyEventBinder(wxEVT_RICHTEXT_RETURN)
EVT_RICHTEXT_CHARACTER = wx.PyEventBinder(wxEVT_RICHTEXT_CHARACTER)
EVT_RICHTEXT_DELETE = wx.PyEventBinder(wxEVT_RICHTEXT_DELETE)

EVT_RICHTEXT_STYLESHEET_CHANGING = wx.PyEventBinder(
    wxEVT_RICHTEXT_STYLESHEET_CHANGING)
EVT_RICHTEXT_STYLESHEET_CHANGED = wx.PyEventBinder(
    wxEVT_RICHTEXT_STYLESHEET_CHANGED)
Пример #9
0
# This file is generated by wxPython's SIP generator.  Do not edit by hand.
# 
# Copyright: (c) 2013 by Total Control Software
# License:   wxWindows License

from ._xml import *

import wx

XmlProperty = wx.deprecated(XmlAttribute, 'Use XmlProperty instead.')

Пример #10
0
# This file is generated by wxPython's SIP generator.  Do not edit by hand.
#
# Copyright: (c) 2018 by Total Control Software
# License:   wxWindows License
"""
This module contains a few classes that are only available on Windows.
"""

from ._msw import *

import wx

Metafile = wx.deprecated(wx.Metafile,
                         'Metafile has moved to the core wx module.')
MetafileDC = wx.deprecated(wx.MetafileDC,
                           'MetafileDC has moved to the core wx module.')
Пример #11
0
EVT_GRID_CMD_EDITOR_SHOWN =        wx.PyEventBinder( wxEVT_GRID_EDITOR_SHOWN,       1 )
EVT_GRID_CMD_EDITOR_HIDDEN =       wx.PyEventBinder( wxEVT_GRID_EDITOR_HIDDEN,      1 )
EVT_GRID_CMD_EDITOR_CREATED =      wx.PyEventBinder( wxEVT_GRID_EDITOR_CREATED,     1 )
EVT_GRID_CMD_CELL_BEGIN_DRAG =     wx.PyEventBinder( wxEVT_GRID_CELL_BEGIN_DRAG,    1 )
EVT_GRID_CMD_COL_MOVE =            wx.PyEventBinder( wxEVT_GRID_COL_MOVE,           1 )
EVT_GRID_CMD_COL_SORT =            wx.PyEventBinder( wxEVT_GRID_COL_SORT,           1 )
EVT_GRID_CMD_TABBING =             wx.PyEventBinder( wxEVT_GRID_TABBING,            1 )

GRID_VALUE_STRING =    "string"
GRID_VALUE_BOOL =      "bool"
GRID_VALUE_NUMBER =    "long"
GRID_VALUE_FLOAT =     "double"
GRID_VALUE_CHOICE =    "choice"
GRID_VALUE_TEXT =      "string"
GRID_VALUE_LONG =      "long"
GRID_VALUE_CHOICEINT = "choiceint"
GRID_VALUE_DATETIME =  "datetime"

def _GridCellCoordsArray___repr__(self):
    return "GridCellCoordsArray: " + repr(list(self))
GridCellCoordsArray.__repr__ = _GridCellCoordsArray___repr__
del _GridCellCoordsArray___repr__
PyGridCellRenderer = wx.deprecated(GridCellRenderer, 'Use GridCellRenderer instead.')

PyGridCellEditor = wx.deprecated(GridCellEditor, 'Use GridCellEditor instead.')

PyGridCellAttrProvider = wx.deprecated(GridCellAttrProvider, 'Use GridCellAttrProvider instead.')

PyGridTableBase = wx.deprecated(GridTableBase, 'Use GridTableBase instead.')

Пример #12
0
del _RichTextObjectList____repr__
def _RichTextFileHandlerList___repr__(self):
    return "RichTextFileHandlerList: " + repr(list(self))
RichTextFileHandlerList.__repr__ = _RichTextFileHandlerList___repr__
del _RichTextFileHandlerList___repr__
def _RichTextDrawingHandlerList___repr__(self):
    return "RichTextDrawingHandlerList: " + repr(list(self))
RichTextDrawingHandlerList.__repr__ = _RichTextDrawingHandlerList___repr__
del _RichTextDrawingHandlerList___repr__
def _RichTextActionList___repr__(self):
    return "RichTextActionList: " + repr(list(self))
RichTextActionList.__repr__ = _RichTextActionList___repr__
del _RichTextActionList___repr__
def _RichTextCtrl_GetDefaultStyle(self):
    return self.GetDefaultStyleEx()
RichTextCtrl.GetDefaultStyle = wx.deprecated(_RichTextCtrl_GetDefaultStyle, "Use GetDefaultStyleEx instead")
del _RichTextCtrl_GetDefaultStyle
RichTextCtrl.DefaultStyle = property(RichTextCtrl.GetDefaultStyle, RichTextCtrl.SetDefaultStyle)
EVT_RICHTEXT_LEFT_CLICK = wx.PyEventBinder(wxEVT_RICHTEXT_LEFT_CLICK)
EVT_RICHTEXT_RIGHT_CLICK = wx.PyEventBinder(wxEVT_RICHTEXT_RIGHT_CLICK)
EVT_RICHTEXT_MIDDLE_CLICK = wx.PyEventBinder(wxEVT_RICHTEXT_MIDDLE_CLICK)
EVT_RICHTEXT_LEFT_DCLICK = wx.PyEventBinder(wxEVT_RICHTEXT_LEFT_DCLICK)
EVT_RICHTEXT_RETURN = wx.PyEventBinder(wxEVT_RICHTEXT_RETURN)
EVT_RICHTEXT_CHARACTER = wx.PyEventBinder(wxEVT_RICHTEXT_CHARACTER)
EVT_RICHTEXT_DELETE = wx.PyEventBinder(wxEVT_RICHTEXT_DELETE)

EVT_RICHTEXT_STYLESHEET_CHANGING = wx.PyEventBinder(wxEVT_RICHTEXT_STYLESHEET_CHANGING)
EVT_RICHTEXT_STYLESHEET_CHANGED = wx.PyEventBinder(wxEVT_RICHTEXT_STYLESHEET_CHANGED)
EVT_RICHTEXT_STYLESHEET_REPLACING = wx.PyEventBinder(wxEVT_RICHTEXT_STYLESHEET_REPLACING)
EVT_RICHTEXT_STYLESHEET_REPLACED = wx.PyEventBinder(wxEVT_RICHTEXT_STYLESHEET_REPLACED)
Пример #13
0
# This file is generated by wxPython's SIP generator.  Do not edit by hand.
# 
# Copyright: (c) 2013 by Total Control Software
# License:   wxWindows License

from ._adv import *

import wx

EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 )
EVT_TIME_CHANGED = wx.PyEventBinder( wxEVT_TIME_CHANGED, 1 )

DateEvent.PyGetDate = wx.deprecated(DateEvent.GetDate, 'Use GetDate instead.')
DateEvent.PySetDate = wx.deprecated(DateEvent.SetDate, 'Use SetDate instead.')

EVT_CALENDAR =                 wx.PyEventBinder( wxEVT_CALENDAR_DOUBLECLICKED, 1)
EVT_CALENDAR_SEL_CHANGED =     wx.PyEventBinder( wxEVT_CALENDAR_SEL_CHANGED, 1)
EVT_CALENDAR_WEEKDAY_CLICKED = wx.PyEventBinder( wxEVT_CALENDAR_WEEKDAY_CLICKED, 1)
EVT_CALENDAR_PAGE_CHANGED =    wx.PyEventBinder( wxEVT_CALENDAR_PAGE_CHANGED, 1)

EVT_CALENDAR_DAY =             wx.PyEventBinder( wxEVT_CALENDAR_DAY_CHANGED, 1)
EVT_CALENDAR_MONTH =           wx.PyEventBinder( wxEVT_CALENDAR_MONTH_CHANGED, 1)
EVT_CALENDAR_YEAR =            wx.PyEventBinder( wxEVT_CALENDAR_YEAR_CHANGED, 1)

CalendarCtrl.PyGetDate = wx.deprecated(CalendarCtrl.GetDate, 'Use GetDate instead.')
CalendarCtrl.PySetDate = wx.deprecated(CalendarCtrl.SetDate, 'Use SetDate instead.')
CalendarCtrl.PySetDateRange = wx.deprecated(CalendarCtrl.SetDateRange, 'Use SetDateRange instead.')

GenericCalendarCtrl.PyGetDate = wx.deprecated(GenericCalendarCtrl.GetDate, 'Use GetDate instead.')
GenericCalendarCtrl.PySetDate = wx.deprecated(GenericCalendarCtrl.SetDate, 'Use SetDate instead.')
GenericCalendarCtrl.PySetDateRange = wx.deprecated(GenericCalendarCtrl.SetDateRange, 'Use SetDateRange instead.')