示例#1
0
    def _build(self, batch=None, group=None):
        Widget._build(self, batch) #, group)
        if self._label:
            self._label.delete()
            self._label = None
        if self._layout:
            self._layout.delete()
            self._layout = None
        if self._caret:
            self._caret.delete()
            self._caret = None

        # Dummy layout creation and deletion seems to make rendering faster
        doc = pyglet.text.document.UnformattedDocument('dummy')
        pyglet.text.layout.IncrementalTextLayout(doc, 1, 1, batch=self._batch).delete()
        if not self._active:
            self._label = cached.Label(text = self._text, multiline=False,
                                       batch=self._batch, group=self._fg_group,
                                       anchor_x='left', anchor_y='top')
        else:
            doc = pyglet.text.document.UnformattedDocument(self._text or ' ')
            self._layout = pyglet.text.layout.IncrementalTextLayout(
                doc, 1, 1, multiline=False, batch=self._batch, group=self._fg_group)
            self._layout.anchor_x = 'left'
            self._layout.anchor_y = 'top'
            self._caret = pyglet.text.caret.Caret(self._layout)
        self._deleted = False
        self._update_style()
        self._update_state()
        self._update_size()
示例#2
0
文件: label.py 项目: obspy/branches
 def _build(self, batch=None, group=None):
     Widget._build(self, batch)
     self._label.delete()
     self._label = cached.Label(text = self._text, multiline=False,
                               batch=self._batch, group=self._fg_group,
                               anchor_x='left', anchor_y='top')
     self._deleted = False
     self._update_style()
     self._update_state()
     self._update_size()
示例#3
0
    def _build(self, batch=None, group=None):

        Widget._build(self, batch)  #, group)
        for child in self._children:
            child._delete()
            child._build(batch=self._batch)  #, group=self._fg_group)
        self._deleted = False
        self._update_style()
        self._update_state()
        self._update_size()
示例#4
0
    def _build(self, batch=None, group=None):

        Widget._build(self, batch) #, group)
        for child in self._children:
            child._delete()
            child._build(batch=self._batch) #, group=self._fg_group)
        self._deleted = False
        self._update_style()
        self._update_state()
        self._update_size()
示例#5
0
 def _build(self, batch=None, group=None):
     Widget._build(self, batch)
     self._label.delete()
     self._label = cached.Label(text=self._text,
                                multiline=False,
                                batch=self._batch,
                                group=self._fg_group,
                                anchor_x='left',
                                anchor_y='top')
     self._deleted = False
     self._update_style()
     self._update_state()
     self._update_size()
示例#6
0
    def _build(self, batch=None, group=None):
        ''' Build entry and add it to batch and group.

        **Parameters**
            `batch` : `Batch`
                Optional graphics batch to add the object to.
            `group` : `Group`
                Optional graphics group to use.
        '''

        Widget._build(self, batch)  #, group)
        if self._label:
            self._label.delete()
            self._label = None
        if self._layout:
            self._layout.delete()
            self._layout = None
        if self._caret:
            self._caret.delete()
            self._caret = None

        # Dummy layout creation and deletion seems to make rendering faster
        doc = pyglet.text.document.UnformattedDocument('dummy')
        pyglet.text.layout.IncrementalTextLayout(doc, 1, 1,
                                                 batch=self._batch).delete()
        if not self._active:
            self._label = cached.Label(text=self._text,
                                       multiline=False,
                                       batch=self._batch,
                                       group=self._fg_group,
                                       anchor_x='left',
                                       anchor_y='top')
        else:
            doc = pyglet.text.document.UnformattedDocument(self._text or '')
            self._layout = pyglet.text.layout.IncrementalTextLayout(
                doc,
                1,
                1,
                multiline=False,
                batch=self._batch,
                group=self._fg_group)
            self._layout.anchor_x = 'left'
            self._layout.anchor_y = 'top'
            self._caret = pyglet.text.caret.Caret(self._layout)
        self._deleted = False
        self._update_style()
        self._update_state()
        self._update_size()
示例#7
0
    def _build(self, batch=None, group=None):
        ''' Build container and add it to batch and group.

        :Parameters:
            `batch` : `Batch`
                Optional graphics batch to add the object to.
            `group` : `Group`
                Optional graphics group to use.
        '''

        Widget._build(self, batch)  #, group)
        for child in self._children:
            child._delete()
            child._build(batch=self._batch)  #, group=self._fg_group)
        self._deleted = False
        self._update_style()
        self._update_state()
        self._update_size()
示例#8
0
    def _build(self, batch=None, group=None):
        ''' Build container and add it to batch and group.

        :Parameters:
            `batch` : `Batch`
                Optional graphics batch to add the object to.
            `group` : `Group`
                Optional graphics group to use.
        '''

        Widget._build(self, batch) #, group)
        for child in self._children:
            child._delete()
            child._build(batch=self._batch) #, group=self._fg_group)
        self._deleted = False
        self._update_style()
        self._update_state()
        self._update_size()
示例#9
0
    def _build(self, batch=None, group=None):
        ''' Build widget and add it to batch and group.

        **Parameters**
            `batch` : `Batch`
                Optional graphics batch to add the object to.
            `group` : `Group`
                Optional graphics group to use.
        '''

        Widget._build(self, batch) #, group)
        self._label.delete()
        self._label = cached.Label(text = self._text, multiline=False,
                                  batch=self._batch, group=self._fg_group,
                                  anchor_x='left', anchor_y='top')
        self._deleted = False
        self._update_style()
        self._update_state()
        self._update_size()
示例#10
0
    def _build(self, batch=None, group=None):
        ''' Build box and add it to batch and group.

        :Parameters:
            `batch` : `Batch`
                Optional graphics batch to add the object to.
            `group` : `Group`
                Optional graphics group to use.
        '''
        Widget._build(self, batch)  #, group)
        self.title._delete()
        self.title._build(batch=self._batch)  #, group=self._fg_group)
        if self.child:
            self.child._delete()
        if self.title._active:
            self.child._build(batch=self._batch, group=self._fg_group)
        self._update_state()
        self._update_style()
        self._update_size()
示例#11
0
文件: folder.py 项目: obspy/branches
    def _build(self, batch=None, group=None):
        ''' Build box and add it to batch and group.

        :Parameters:
            `batch` : `Batch`
                Optional graphics batch to add the object to.
            `group` : `Group`
                Optional graphics group to use.
        '''
        Widget._build(self, batch) #, group)
        self.title._delete()
        self.title._build(batch=self._batch) #, group=self._fg_group)
        if self.child:
            self.child._delete()
        if self.title._active:
            self.child._build(batch=self._batch, group=self._fg_group)
        self._update_state()
        self._update_style()
        self._update_size()
示例#12
0
    def _build(self, batch=None, group=None):
        ''' Build widget and add it to batch and group.

        **Parameters**
            `batch` : `Batch`
                Optional graphics batch to add the object to.
            `group` : `Group`
                Optional graphics group to use.
        '''

        Widget._build(self, batch)  #, group)
        self._label.delete()
        self._label = cached.Label(text=self._text,
                                   multiline=False,
                                   batch=self._batch,
                                   group=self._fg_group,
                                   anchor_x='left',
                                   anchor_y='top')
        self._deleted = False
        self._update_style()
        self._update_state()
        self._update_size()
示例#13
0
    def _build(self, batch=None, group=None):
        ''' Build entry and add it to batch and group.

        **Parameters**
            `batch` : `Batch`
                Optional graphics batch to add the object to.
            `group` : `Group`
                Optional graphics group to use.
        '''

        Widget._build(self, batch) #, group)
        if self._label:
            self._label.delete()
            self._label = None
        if self._layout:
            self._layout.delete()
            self._layout = None
        if self._caret:
            self._caret.delete()
            self._caret = None

        # Dummy layout creation and deletion seems to make rendering faster
        doc = pyglet.text.document.UnformattedDocument('dummy')
        pyglet.text.layout.IncrementalTextLayout(doc, 1, 1, batch=self._batch).delete()
        if not self._active:
            self._label = cached.Label(text = self._text, multiline=False,
                                       batch=self._batch, group=self._fg_group,
                                       anchor_x='left', anchor_y='top')
        else:
            doc = pyglet.text.document.UnformattedDocument(self._text or '')
            self._layout = pyglet.text.layout.IncrementalTextLayout(
                doc, 1, 1, multiline=False, batch=self._batch, group=self._fg_group)
            self._layout.anchor_x = 'left'
            self._layout.anchor_y = 'top'
            self._caret = pyglet.text.caret.Caret(self._layout)
        self._deleted = False
        self._update_style()
        self._update_state()
        self._update_size()
示例#14
0
文件: entry.py 项目: obspy/branches
    def _build(self, batch=None, group=None):
        Widget._build(self, batch)  # , group)
        if self._label:
            self._label.delete()
            self._label = None
        if self._layout:
            self._layout.delete()
            self._layout = None
        if self._caret:
            self._caret.delete()
            self._caret = None

        # Dummy layout creation and deletion seems to make rendering faster
        doc = pyglet.text.document.UnformattedDocument("dummy")
        pyglet.text.layout.IncrementalTextLayout(doc, 1, 1, batch=self._batch).delete()
        if not self._active:
            self._label = cached.Label(
                text=self._text,
                multiline=False,
                batch=self._batch,
                group=self._fg_group,
                anchor_x="left",
                anchor_y="top",
            )
        else:
            doc = pyglet.text.document.UnformattedDocument(self._text or " ")
            self._layout = pyglet.text.layout.IncrementalTextLayout(
                doc, 1, 1, multiline=False, batch=self._batch, group=self._fg_group
            )
            self._layout.anchor_x = "left"
            self._layout.anchor_y = "top"
            self._caret = pyglet.text.caret.Caret(self._layout)
        self._deleted = False
        self._update_style()
        self._update_state()
        self._update_size()