示例#1
0
    def __init__(self,
                 parent,
                 app,
                 id=wx.ID_ANY,
                 pos=(0, 0),
                 title='',
                 text='',
                 tags=[],
                 state=None):
        # inner state

        self.parent = parent
        self.app = app
        self.dimmed = False
        self.brokenEmblem = wx.Bitmap(self.app.iconsPath + 'brokenemblem.png')
        self.externalEmblem = wx.Bitmap(self.app.iconsPath +
                                        'externalemblem.png')
        self.paintBuffer = wx.MemoryDC()
        self.paintBufferBounds = None
        if state:
            self.passage = state['passage']
            self.pos = list(pos) if pos != (0, 0) else state['pos']
            self.selected = state['selected']
        else:
            self.passage = tiddlywiki.Tiddler('')
            self.selected = False
            self.pos = list(pos)
        if title: self.passage.title = title
        if text: self.passage.text = text
        if tags: self.passage.tags += tags

        self.bitmap = None
        self.updateBitmap()
        self.passage.update()
示例#2
0
    def __init__(self,
                 parent,
                 app,
                 id=wx.ID_ANY,
                 pos=(0, 0),
                 title='',
                 text='',
                 state=None):
        # inner state

        self.parent = parent
        self.app = app
        self.dimmed = False
        self.brokenEmblem = wx.Bitmap(self.app.getPath() + os.sep + 'icons' +
                                      os.sep + 'brokenemblem.png')
        self.paintBuffer = wx.MemoryDC()
        self.paintBufferBounds = None
        pos = list(pos)

        if state:
            self.passage = state['passage']
            self.pos = state['pos']
            self.selected = state['selected']
        else:
            self.passage = tiddlywiki.Tiddler('')
            self.passage.title = title
            self.passage.text = text
            self.passage.draw = None
            self.selected = False
            self.pos = list(pos)
            self.findSpace()
示例#3
0
    def __init__(self,
                 parent,
                 app,
                 id=wx.ID_ANY,
                 pos=(0, 0),
                 title='',
                 text='',
                 tags=[],
                 state=None):
        # inner state

        self.parent = parent
        self.app = app
        self.dimmed = False
        if sys.platform == 'darwin':
            self.brokenEmblem = wx.Bitmap(
                re.sub('lib/.*', '', os.path.realpath(sys.path[0])) + "icons" +
                os.sep + 'brokenemblem.png')
        else:
            self.brokenEmblem = wx.Bitmap(self.app.getPath() + os.sep +
                                          'icons' + os.sep +
                                          'brokenemblem.png')
        self.paintBuffer = wx.MemoryDC()
        self.paintBufferBounds = None
        pos = list(pos)

        if state:
            self.passage = state['passage']
            self.pos = state['pos']
            self.selected = state['selected']
        else:
            self.passage = tiddlywiki.Tiddler('')
            self.selected = False
            self.pos = list(pos)

        if title: self.passage.title = title
        if text: self.passage.text = text
        if tags: self.passage.tags += tags

        self.bitmap = None
        self.updateBitmap()
        self.passage.update()