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

📄 richtext.py

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

import _richtext
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


USE_TEXTATTREX = _richtext.USE_TEXTATTREX
import _windows
import _core
wx = _core 
__docfilter__ = wx.__DocFilter(globals()) 
RE_READONLY = _richtext.RE_READONLY
RE_MULTILINE = _richtext.RE_MULTILINE
RICHTEXT_SHIFT_DOWN = _richtext.RICHTEXT_SHIFT_DOWN
RICHTEXT_CTRL_DOWN = _richtext.RICHTEXT_CTRL_DOWN
RICHTEXT_ALT_DOWN = _richtext.RICHTEXT_ALT_DOWN
RICHTEXT_SELECTED = _richtext.RICHTEXT_SELECTED
RICHTEXT_TAGGED = _richtext.RICHTEXT_TAGGED
RICHTEXT_FOCUSSED = _richtext.RICHTEXT_FOCUSSED
RICHTEXT_IS_FOCUS = _richtext.RICHTEXT_IS_FOCUS
RICHTEXT_TYPE_ANY = _richtext.RICHTEXT_TYPE_ANY
RICHTEXT_TYPE_TEXT = _richtext.RICHTEXT_TYPE_TEXT
RICHTEXT_TYPE_XML = _richtext.RICHTEXT_TYPE_XML
RICHTEXT_TYPE_HTML = _richtext.RICHTEXT_TYPE_HTML
RICHTEXT_TYPE_RTF = _richtext.RICHTEXT_TYPE_RTF
RICHTEXT_TYPE_PDF = _richtext.RICHTEXT_TYPE_PDF
RICHTEXT_FIXED_WIDTH = _richtext.RICHTEXT_FIXED_WIDTH
RICHTEXT_FIXED_HEIGHT = _richtext.RICHTEXT_FIXED_HEIGHT
RICHTEXT_VARIABLE_WIDTH = _richtext.RICHTEXT_VARIABLE_WIDTH
RICHTEXT_VARIABLE_HEIGHT = _richtext.RICHTEXT_VARIABLE_HEIGHT
RICHTEXT_HITTEST_NONE = _richtext.RICHTEXT_HITTEST_NONE
RICHTEXT_HITTEST_BEFORE = _richtext.RICHTEXT_HITTEST_BEFORE
RICHTEXT_HITTEST_AFTER = _richtext.RICHTEXT_HITTEST_AFTER
RICHTEXT_HITTEST_ON = _richtext.RICHTEXT_HITTEST_ON
RICHTEXT_FORMATTED = _richtext.RICHTEXT_FORMATTED
RICHTEXT_UNFORMATTED = _richtext.RICHTEXT_UNFORMATTED
TEXT_ATTR_TEXT_COLOUR = _richtext.TEXT_ATTR_TEXT_COLOUR
TEXT_ATTR_BACKGROUND_COLOUR = _richtext.TEXT_ATTR_BACKGROUND_COLOUR
TEXT_ATTR_FONT_FACE = _richtext.TEXT_ATTR_FONT_FACE
TEXT_ATTR_FONT_SIZE = _richtext.TEXT_ATTR_FONT_SIZE
TEXT_ATTR_FONT_WEIGHT = _richtext.TEXT_ATTR_FONT_WEIGHT
TEXT_ATTR_FONT_ITALIC = _richtext.TEXT_ATTR_FONT_ITALIC
TEXT_ATTR_FONT_UNDERLINE = _richtext.TEXT_ATTR_FONT_UNDERLINE
TEXT_ATTR_FONT = _richtext.TEXT_ATTR_FONT
TEXT_ATTR_ALIGNMENT = _richtext.TEXT_ATTR_ALIGNMENT
TEXT_ATTR_LEFT_INDENT = _richtext.TEXT_ATTR_LEFT_INDENT
TEXT_ATTR_RIGHT_INDENT = _richtext.TEXT_ATTR_RIGHT_INDENT
TEXT_ATTR_TABS = _richtext.TEXT_ATTR_TABS
TEXT_ATTR_PARA_SPACING_AFTER = _richtext.TEXT_ATTR_PARA_SPACING_AFTER
TEXT_ATTR_PARA_SPACING_BEFORE = _richtext.TEXT_ATTR_PARA_SPACING_BEFORE
TEXT_ATTR_LINE_SPACING = _richtext.TEXT_ATTR_LINE_SPACING
TEXT_ATTR_CHARACTER_STYLE_NAME = _richtext.TEXT_ATTR_CHARACTER_STYLE_NAME
TEXT_ATTR_PARAGRAPH_STYLE_NAME = _richtext.TEXT_ATTR_PARAGRAPH_STYLE_NAME
TEXT_ATTR_BULLET_STYLE = _richtext.TEXT_ATTR_BULLET_STYLE
TEXT_ATTR_BULLET_NUMBER = _richtext.TEXT_ATTR_BULLET_NUMBER
TEXT_ATTR_BULLET_SYMBOL = _richtext.TEXT_ATTR_BULLET_SYMBOL
TEXT_ATTR_BULLET_STYLE_NONE = _richtext.TEXT_ATTR_BULLET_STYLE_NONE
TEXT_ATTR_BULLET_STYLE_ARABIC = _richtext.TEXT_ATTR_BULLET_STYLE_ARABIC
TEXT_ATTR_BULLET_STYLE_LETTERS_UPPER = _richtext.TEXT_ATTR_BULLET_STYLE_LETTERS_UPPER
TEXT_ATTR_BULLET_STYLE_LETTERS_LOWER = _richtext.TEXT_ATTR_BULLET_STYLE_LETTERS_LOWER
TEXT_ATTR_BULLET_STYLE_ROMAN_UPPER = _richtext.TEXT_ATTR_BULLET_STYLE_ROMAN_UPPER
TEXT_ATTR_BULLET_STYLE_ROMAN_LOWER = _richtext.TEXT_ATTR_BULLET_STYLE_ROMAN_LOWER
TEXT_ATTR_BULLET_STYLE_SYMBOL = _richtext.TEXT_ATTR_BULLET_STYLE_SYMBOL
TEXT_ATTR_BULLET_STYLE_BITMAP = _richtext.TEXT_ATTR_BULLET_STYLE_BITMAP
TEXT_ATTR_BULLET_STYLE_PARENTHESES = _richtext.TEXT_ATTR_BULLET_STYLE_PARENTHESES
TEXT_ATTR_BULLET_STYLE_PERIOD = _richtext.TEXT_ATTR_BULLET_STYLE_PERIOD
TEXT_ATTR_LINE_SPACING_NORMAL = _richtext.TEXT_ATTR_LINE_SPACING_NORMAL
TEXT_ATTR_LINE_SPACING_HALF = _richtext.TEXT_ATTR_LINE_SPACING_HALF
TEXT_ATTR_LINE_SPACING_TWICE = _richtext.TEXT_ATTR_LINE_SPACING_TWICE
TEXT_ALIGNMENT_DEFAULT = _richtext.TEXT_ALIGNMENT_DEFAULT
TEXT_ALIGNMENT_LEFT = _richtext.TEXT_ALIGNMENT_LEFT
TEXT_ALIGNMENT_CENTRE = _richtext.TEXT_ALIGNMENT_CENTRE
TEXT_ALIGNMENT_CENTER = _richtext.TEXT_ALIGNMENT_CENTER
TEXT_ALIGNMENT_RIGHT = _richtext.TEXT_ALIGNMENT_RIGHT
TEXT_ALIGNMENT_JUSTIFIED = _richtext.TEXT_ALIGNMENT_JUSTIFIED
class RichTextRange(object):
    """
    RichTextRange is a data structure that represents a range of text
    within a `RichTextCtrl`.  It simply contains integer ``start`` and
    ``end`` properties and a few operations useful for dealing with
    ranges.  In most places in wxPython where a RichTextRange is expected a
    2-tuple containing (start, end) can be used instead.
    """
    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, long start=0, long end=0) -> RichTextRange

        Creates a new range object.
        """
        _richtext.RichTextRange_swiginit(self,_richtext.new_RichTextRange(*args, **kwargs))
    __swig_destroy__ = _richtext.delete_RichTextRange
    __del__ = lambda self : None;
    def __eq__(*args, **kwargs):
        """
        __eq__(self, PyObject other) -> bool

        Test for equality of RichTextRange objects.
        """
        return _richtext.RichTextRange___eq__(*args, **kwargs)

    def __sub__(*args, **kwargs):
        """__sub__(self, RichTextRange range) -> RichTextRange"""
        return _richtext.RichTextRange___sub__(*args, **kwargs)

    def __add__(*args, **kwargs):
        """__add__(self, RichTextRange range) -> RichTextRange"""
        return _richtext.RichTextRange___add__(*args, **kwargs)

    def SetRange(*args, **kwargs):
        """SetRange(self, long start, long end)"""
        return _richtext.RichTextRange_SetRange(*args, **kwargs)

    def SetStart(*args, **kwargs):
        """SetStart(self, long start)"""
        return _richtext.RichTextRange_SetStart(*args, **kwargs)

    def GetStart(*args, **kwargs):
        """GetStart(self) -> long"""
        return _richtext.RichTextRange_GetStart(*args, **kwargs)

    start = property(GetStart, SetStart) 
    def SetEnd(*args, **kwargs):
        """SetEnd(self, long end)"""
        return _richtext.RichTextRange_SetEnd(*args, **kwargs)

    def GetEnd(*args, **kwargs):
        """GetEnd(self) -> long"""
        return _richtext.RichTextRange_GetEnd(*args, **kwargs)

    end = property(GetEnd, SetEnd) 
    def IsOutside(*args, **kwargs):
        """
        IsOutside(self, RichTextRange range) -> bool

        Returns true if this range is completely outside 'range'
        """
        return _richtext.RichTextRange_IsOutside(*args, **kwargs)

    def IsWithin(*args, **kwargs):
        """
        IsWithin(self, RichTextRange range) -> bool

        Returns true if this range is completely within 'range'
        """
        return _richtext.RichTextRange_IsWithin(*args, **kwargs)

    def Contains(*args, **kwargs):
        """
        Contains(self, long pos) -> bool

        Returns true if the given position is within this range. Allow for the
        possibility of an empty range - assume the position is within this
        empty range.
        """
        return _richtext.RichTextRange_Contains(*args, **kwargs)

    def LimitTo(*args, **kwargs):
        """
        LimitTo(self, RichTextRange range) -> bool

        Limit this range to be within 'range'
        """
        return _richtext.RichTextRange_LimitTo(*args, **kwargs)

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

        Gets the length of the range
        """
        return _richtext.RichTextRange_GetLength(*args, **kwargs)

    def Swap(*args, **kwargs):
        """
        Swap(self)

        Swaps the start and end
        """
        return _richtext.RichTextRange_Swap(*args, **kwargs)

    def Get(*args, **kwargs):
        """
        Get() -> (start,end)

        Returns the start and end properties as a tuple.
        """
        return _richtext.RichTextRange_Get(*args, **kwargs)

    def __str__(self):                   return str(self.Get())
    def __repr__(self):                  return 'RichTextRange'+str(self.Get())
    def __len__(self):                   return len(self.Get())
    def __getitem__(self, index):        return self.Get()[index]
    def __setitem__(self, index, val):
        if index == 0: self.start = val
        elif index == 1: self.end = val
        else: raise IndexError
    def __nonzero__(self):               return self.Get() != (0,0)
    __safe_for_unpickling__ = True
    def __reduce__(self):                return (RichTextRange, self.Get())

_richtext.RichTextRange_swigregister(RichTextRange)

class RichTextAttr(object):
    """
    The RichTextAttr class stored information about the various attributes
    for a block of text, including font, colour, indents, alignments, and
    etc.
    """
    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 colText=wxNullColour, Colour colBack=wxNullColour, 
            int alignment=TEXT_ALIGNMENT_DEFAULT) -> RichTextAttr

        The RichTextAttr class stored information about the various attributes
        for a block of text, including font, colour, indents, alignments, and
        etc.
        """
        _richtext.RichTextAttr_swiginit(self,_richtext.new_RichTextAttr(*args, **kwargs))
    __swig_destroy__ = _richtext.delete_RichTextAttr
    __del__ = lambda self : None;
    def CreateFont(*args, **kwargs):
        """CreateFont(self) -> Font"""
        return _richtext.RichTextAttr_CreateFont(*args, **kwargs)

    def GetFontAttributes(*args, **kwargs):
        """GetFontAttributes(self, Font font) -> bool"""
        return _richtext.RichTextAttr_GetFontAttributes(*args, **kwargs)

    def GetFont(self):
        return self.CreateFont()
    def SetFont(self, font):
        return self.GetFontAttributes(font)

    def SetTextColour(*args, **kwargs):
        """SetTextColour(self, Colour colText)"""
        return _richtext.RichTextAttr_SetTextColour(*args, **kwargs)

    def SetBackgroundColour(*args, **kwargs):
        """SetBackgroundColour(self, Colour colBack)"""
        return _richtext.RichTextAttr_SetBackgroundColour(*args, **kwargs)

    def SetAlignment(*args, **kwargs):
        """SetAlignment(self, int alignment)"""
        return _richtext.RichTextAttr_SetAlignment(*args, **kwargs)

    def SetTabs(*args, **kwargs):
        """SetTabs(self, wxArrayInt tabs)"""
        return _richtext.RichTextAttr_SetTabs(*args, **kwargs)

    def SetLeftIndent(*args, **kwargs):
        """SetLeftIndent(self, int indent, int subIndent=0)"""
        return _richtext.RichTextAttr_SetLeftIndent(*args, **kwargs)

    def SetRightIndent(*args, **kwargs):
        """SetRightIndent(self, int indent)"""
        return _richtext.RichTextAttr_SetRightIndent(*args, **kwargs)

    def SetFontSize(*args, **kwargs):
        """SetFontSize(self, int pointSize)"""
        return _richtext.RichTextAttr_SetFontSize(*args, **kwargs)

    def SetFontStyle(*args, **kwargs):
        """SetFontStyle(self, int fontStyle)"""
        return _richtext.RichTextAttr_SetFontStyle(*args, **kwargs)

    def SetFontWeight(*args, **kwargs):
        """SetFontWeight(self, int fontWeight)"""
        return _richtext.RichTextAttr_SetFontWeight(*args, **kwargs)

    def SetFontFaceName(*args, **kwargs):
        """SetFontFaceName(self, String faceName)"""
        return _richtext.RichTextAttr_SetFontFaceName(*args, **kwargs)

    def SetFontUnderlined(*args, **kwargs):
        """SetFontUnderlined(self, bool underlined)"""
        return _richtext.RichTextAttr_SetFontUnderlined(*args, **kwargs)

    def SetFlags(*args, **kwargs):
        """SetFlags(self, long flags)"""
        return _richtext.RichTextAttr_SetFlags(*args, **kwargs)

    def SetCharacterStyleName(*args, **kwargs):
        """SetCharacterStyleName(self, String name)"""

⌨️ 快捷键说明

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