⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 _gdi.py

📁 Wxpython Implemented on Windows CE, Source code
💻 PY
📖 第 1 页 / 共 5 页
字号:
# This file was created automatically by SWIG 1.3.29.
# Don't modify this file, modify the SWIG interface instead.

import _gdi_
import new
new_instancemethod = new.instancemethod
def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
    if (name == "thisown"): return self.this.own(value)
    if (name == "this"):
        if type(value).__name__ == 'PySwigObject':
            self.__dict__[name] = value
            return
    method = class_type.__swig_setmethods__.get(name,None)
    if method: return method(self,value)
    if (not static) or hasattr(self,name):
        self.__dict__[name] = value
    else:
        raise AttributeError("You cannot add attributes to %s" % self)

def _swig_setattr(self,class_type,name,value):
    return _swig_setattr_nondynamic(self,class_type,name,value,0)

def _swig_getattr(self,class_type,name):
    if (name == "thisown"): return self.this.own()
    method = class_type.__swig_getmethods__.get(name,None)
    if method: return method(self)
    raise AttributeError,name

def _swig_repr(self):
    try: strthis = "proxy of " + self.this.__repr__()
    except: strthis = ""
    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)

import types
try:
    _object = types.ObjectType
    _newclass = 1
except AttributeError:
    class _object : pass
    _newclass = 0
del types


def _swig_setattr_nondynamic_method(set):
    def set_attr(self,name,value):
        if (name == "thisown"): return self.this.own(value)
        if hasattr(self,name) or (name == "this"):
            set(self,name,value)
        else:
            raise AttributeError("You cannot add attributes to %s" % self)
    return set_attr


import _core
wx = _core 
#---------------------------------------------------------------------------

class GDIObject(_core.Object):
    """Proxy of C++ GDIObject class"""
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
    __repr__ = _swig_repr
    def __init__(self, *args, **kwargs): 
        """__init__(self) -> GDIObject"""
        _gdi_.GDIObject_swiginit(self,_gdi_.new_GDIObject(*args, **kwargs))
    __swig_destroy__ = _gdi_.delete_GDIObject
    __del__ = lambda self : None;
    def IsNull(*args, **kwargs):
        """IsNull(self) -> bool"""
        return _gdi_.GDIObject_IsNull(*args, **kwargs)

_gdi_.GDIObject_swigregister(GDIObject)

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

C2S_NAME = _gdi_.C2S_NAME
C2S_CSS_SYNTAX = _gdi_.C2S_CSS_SYNTAX
C2S_HTML_SYNTAX = _gdi_.C2S_HTML_SYNTAX
class Colour(_core.Object):
    """
    A colour is an object representing a combination of Red, Green, and
    Blue (RGB) intensity values, and is used to determine drawing colours,
    window colours, etc.  Valid RGB values are in the range 0 to 255.

    In wxPython there are typemaps that will automatically convert from a
    colour name, from a '#RRGGBB' colour hex value string, or from a 3
    integer tuple to a wx.Colour object when calling C++ methods that
    expect a wxColour.  This means that the following are all
    equivallent::

        win.SetBackgroundColour(wxColour(0,0,255))
        win.SetBackgroundColour('BLUE')
        win.SetBackgroundColour('#0000FF')
        win.SetBackgroundColour((0,0,255))

    Additional colour names and their coresponding values can be added
    using `wx.ColourDatabase`.  Various system colours (as set in the
    user's system preferences) can be retrieved with
    `wx.SystemSettings.GetColour`.

    """
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
    __repr__ = _swig_repr
    def __init__(self, *args, **kwargs): 
        """
        __init__(self, byte red=0, byte green=0, byte blue=0) -> Colour

        Constructs a colour from red, green and blue values.

        :see: Alternate constructors `wx.NamedColour` and `wx.ColourRGB`.

        """
        _gdi_.Colour_swiginit(self,_gdi_.new_Colour(*args, **kwargs))
    __swig_destroy__ = _gdi_.delete_Colour
    __del__ = lambda self : None;
    def Red(*args, **kwargs):
        """
        Red(self) -> byte

        Returns the red intensity.
        """
        return _gdi_.Colour_Red(*args, **kwargs)

    def Green(*args, **kwargs):
        """
        Green(self) -> byte

        Returns the green intensity.
        """
        return _gdi_.Colour_Green(*args, **kwargs)

    def Blue(*args, **kwargs):
        """
        Blue(self) -> byte

        Returns the blue intensity.
        """
        return _gdi_.Colour_Blue(*args, **kwargs)

    def Ok(*args, **kwargs):
        """
        Ok(self) -> bool

        Returns True if the colour object is valid (the colour has been
        initialised with RGB values).
        """
        return _gdi_.Colour_Ok(*args, **kwargs)

    def Set(*args, **kwargs):
        """
        Set(self, byte red, byte green, byte blue)

        Sets the RGB intensity values.
        """
        return _gdi_.Colour_Set(*args, **kwargs)

    def SetRGB(*args, **kwargs):
        """
        SetRGB(self, unsigned long colRGB)

        Sets the RGB intensity values from a packed RGB value.
        """
        return _gdi_.Colour_SetRGB(*args, **kwargs)

    def SetFromName(*args, **kwargs):
        """
        SetFromName(self, String colourName)

        Sets the RGB intensity values using a colour name listed in
        ``wx.TheColourDatabase``.
        """
        return _gdi_.Colour_SetFromName(*args, **kwargs)

    def GetAsString(*args, **kwargs):
        """
        GetAsString(self, long flags=wxC2S_NAME|wxC2S_CSS_SYNTAX) -> String

        Return the colour as a string.  Acceptable flags are:

                    =================== ==================================
                    wx.C2S_NAME          return colour name, when possible
                    wx.C2S_CSS_SYNTAX    return colour in rgb(r,g,b) syntax
                    wx.C2S_HTML_SYNTAX   return colour in #rrggbb syntax     
                    =================== ==================================
        """
        return _gdi_.Colour_GetAsString(*args, **kwargs)

    def GetPixel(*args, **kwargs):
        """
        GetPixel(self) -> long

        Returns a pixel value which is platform-dependent. On Windows, a
        COLORREF is returned. On X, an allocated pixel value is returned.  -1
        is returned if the pixel is invalid (on X, unallocated).
        """
        return _gdi_.Colour_GetPixel(*args, **kwargs)

    def __eq__(*args, **kwargs):
        """
        __eq__(self, PyObject other) -> bool

        Compare colours for equality.
        """
        return _gdi_.Colour___eq__(*args, **kwargs)

    def __ne__(*args, **kwargs):
        """
        __ne__(self, PyObject other) -> bool

        Compare colours for inequality.
        """
        return _gdi_.Colour___ne__(*args, **kwargs)

    def Get(*args, **kwargs):
        """
        Get() -> (r, g, b)

        Returns the RGB intensity values as a tuple.
        """
        return _gdi_.Colour_Get(*args, **kwargs)

    def GetRGB(*args, **kwargs):
        """
        GetRGB(self) -> unsigned long

        Return the colour as a packed RGB value
        """
        return _gdi_.Colour_GetRGB(*args, **kwargs)

    asTuple = wx._deprecated(Get, "asTuple is deprecated, use `Get` instead")
    def __str__(self):                  return str(self.Get())
    def __repr__(self):                 return 'wx.Colour' + str(self.Get())
    def __nonzero__(self):              return self.Ok()
    __safe_for_unpickling__ = True
    def __reduce__(self):               return (Colour, self.Get())

_gdi_.Colour_swigregister(Colour)

def NamedColour(*args, **kwargs):
    """
    NamedColour(String colorName) -> Colour

    Constructs a colour object using a colour name listed in
    ``wx.TheColourDatabase``.
    """
    val = _gdi_.new_NamedColour(*args, **kwargs)
    return val

def ColourRGB(*args, **kwargs):
    """
    ColourRGB(unsigned long colRGB) -> Colour

    Constructs a colour from a packed RGB value.
    """
    val = _gdi_.new_ColourRGB(*args, **kwargs)
    return val

Color = Colour
NamedColor = NamedColour
ColorRGB = ColourRGB

class Palette(GDIObject):
    """Proxy of C++ Palette class"""
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
    __repr__ = _swig_repr
    def __init__(self, *args, **kwargs): 
        """__init__(self, int n, unsigned char red, unsigned char green, unsigned char blue) -> Palette"""
        _gdi_.Palette_swiginit(self,_gdi_.new_Palette(*args, **kwargs))
    __swig_destroy__ = _gdi_.delete_Palette
    __del__ = lambda self : None;
    def GetPixel(*args, **kwargs):
        """GetPixel(self, byte red, byte green, byte blue) -> int"""
        return _gdi_.Palette_GetPixel(*args, **kwargs)

    def GetRGB(*args, **kwargs):
        """GetRGB(self, int pixel) -> (R,G,B)"""
        return _gdi_.Palette_GetRGB(*args, **kwargs)

    def GetColoursCount(*args, **kwargs):
        """GetColoursCount(self) -> int"""
        return _gdi_.Palette_GetColoursCount(*args, **kwargs)

    def Ok(*args, **kwargs):
        """Ok(self) -> bool"""
        return _gdi_.Palette_Ok(*args, **kwargs)

    def __nonzero__(self): return self.Ok() 
_gdi_.Palette_swigregister(Palette)

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

class Pen(GDIObject):
    """Proxy of C++ Pen class"""
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
    __repr__ = _swig_repr
    def __init__(self, *args, **kwargs): 
        """__init__(self, Colour colour, int width=1, int style=SOLID) -> Pen"""
        _gdi_.Pen_swiginit(self,_gdi_.new_Pen(*args, **kwargs))
    __swig_destroy__ = _gdi_.delete_Pen
    __del__ = lambda self : None;
    def GetCap(*args, **kwargs):
        """GetCap(self) -> int"""
        return _gdi_.Pen_GetCap(*args, **kwargs)

    def GetColour(*args, **kwargs):
        """GetColour(self) -> Colour"""
        return _gdi_.Pen_GetColour(*args, **kwargs)

    def GetJoin(*args, **kwargs):
        """GetJoin(self) -> int"""
        return _gdi_.Pen_GetJoin(*args, **kwargs)

    def GetStyle(*args, **kwargs):
        """GetStyle(self) -> int"""
        return _gdi_.Pen_GetStyle(*args, **kwargs)

    def GetWidth(*args, **kwargs):
        """GetWidth(self) -> int"""
        return _gdi_.Pen_GetWidth(*args, **kwargs)

    def Ok(*args, **kwargs):
        """Ok(self) -> bool"""
        return _gdi_.Pen_Ok(*args, **kwargs)

    def SetCap(*args, **kwargs):
        """SetCap(self, int cap_style)"""
        return _gdi_.Pen_SetCap(*args, **kwargs)

    def SetColour(*args, **kwargs):
        """SetColour(self, Colour colour)"""
        return _gdi_.Pen_SetColour(*args, **kwargs)

    def SetJoin(*args, **kwargs):
        """SetJoin(self, int join_style)"""
        return _gdi_.Pen_SetJoin(*args, **kwargs)

    def SetStyle(*args, **kwargs):
        """SetStyle(self, int style)"""
        return _gdi_.Pen_SetStyle(*args, **kwargs)

    def SetWidth(*args, **kwargs):
        """SetWidth(self, int width)"""
        return _gdi_.Pen_SetWidth(*args, **kwargs)

    def SetDashes(*args, **kwargs):
        """SetDashes(self, int dashes)"""
        return _gdi_.Pen_SetDashes(*args, **kwargs)

    def GetDashes(*args, **kwargs):
        """GetDashes(self) -> PyObject"""
        return _gdi_.Pen_GetDashes(*args, **kwargs)

    def _SetDashes(*args, **kwargs):
        """_SetDashes(self, PyObject _self, PyObject pyDashes)"""
        return _gdi_.Pen__SetDashes(*args, **kwargs)

    def SetDashes(self, dashes):
        """
        Associate a list of dash lengths with the Pen.
        """
        self._SetDashes(self, dashes)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -