コード例 #1
0
ファイル: view_board.py プロジェクト: solutema/tryton
    def _parse_page(self, node, notebook, attributes):
        tab_box = gtk.HBox(spacing=3)
        if '_' not in attributes['string']:
            attributes['string'] = '_' + attributes['string']
        label = gtk.Label(attributes['string'])
        label.set_use_underline(True)
        tab_box.pack_start(label)

        if 'icon' in attributes:
            ICONFACTORY.register_icon(attributes['icon'])
            pixbuf = tab_box.render_icon(attributes['icon'],
                                         gtk.ICON_SIZE_SMALL_TOOLBAR)
            icon = gtk.Image()
            icon.set_from_pixbuf(pixbuf)
            tab_box.pack_start(icon)
        tab_box.show_all()

        viewport = gtk.Viewport()
        viewport.set_shadow_type(gtk.SHADOW_NONE)
        scrolledwindow = gtk.ScrolledWindow()
        scrolledwindow.set_shadow_type(gtk.SHADOW_NONE)
        scrolledwindow.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
        scrolledwindow.add(viewport)
        scrolledwindow.show_all()
        notebook.append_page(scrolledwindow, tab_box)
        container = self.parse(node)
        viewport.add(container.table)
コード例 #2
0
ファイル: form.py プロジェクト: kret0s/gnuhealth-live
    def _parse_page(self, node, notebook, attributes):
        tab_box = gtk.HBox(spacing=3)
        if 'name' in attributes:
            field = self.screen.group.fields[attributes['name']]
            if attributes['name'] == self.screen.exclude_field:
                return
            for attr in ('states', 'string'):
                if attr not in attributes and attr in field.attrs:
                    attributes[attr] = field.attrs[attr]
        label = gtk.Label('_' + attributes['string'].replace('_', '__'))
        label.set_use_underline(True)
        tab_box.pack_start(label)

        if 'icon' in attributes:
            ICONFACTORY.register_icon(attributes['icon'])
            pixbuf = tab_box.render_icon(attributes['icon'],
                gtk.ICON_SIZE_SMALL_TOOLBAR)
            icon = gtk.Image()
            icon.set_from_pixbuf(pixbuf)
            tab_box.pack_start(icon)
        tab_box.show_all()

        viewport = gtk.Viewport()
        viewport.set_shadow_type(gtk.SHADOW_NONE)
        scrolledwindow = ScrolledWindow(attrs=attributes)
        scrolledwindow.set_shadow_type(gtk.SHADOW_NONE)
        scrolledwindow.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
        scrolledwindow.add(viewport)
        scrolledwindow.show_all()
        self.state_widgets.append(scrolledwindow)
        notebook.append_page(scrolledwindow, tab_box)
        container = self.parse(node)
        viewport.add(container.table)
コード例 #3
0
    def _parse_page(self, node, notebook, attributes):
        tab_box = gtk.HBox(spacing=3)
        if 'name' in attributes:
            field = self.screen.group.fields[attributes['name']]
            if attributes['name'] == self.screen.exclude_field:
                return
            for attr in ('states', 'string'):
                if attr not in attributes and attr in field.attrs:
                    attributes[attr] = field.attrs[attr]
        label = gtk.Label('_' + attributes['string'].replace('_', '__'))
        label.set_use_underline(True)
        tab_box.pack_start(label)

        if 'icon' in attributes:
            ICONFACTORY.register_icon(attributes['icon'])
            pixbuf = tab_box.render_icon(attributes['icon'],
                                         gtk.ICON_SIZE_SMALL_TOOLBAR)
            icon = gtk.Image()
            icon.set_from_pixbuf(pixbuf)
            tab_box.pack_start(icon)
        tab_box.show_all()

        viewport = gtk.Viewport()
        viewport.set_shadow_type(gtk.SHADOW_NONE)
        scrolledwindow = ScrolledWindow(attrs=attributes)
        scrolledwindow.set_shadow_type(gtk.SHADOW_NONE)
        scrolledwindow.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
        scrolledwindow.add(viewport)
        scrolledwindow.show_all()
        self.state_widgets.append(scrolledwindow)
        notebook.append_page(scrolledwindow, tab_box)
        container = self.parse(node)
        viewport.add(container.table)
コード例 #4
0
ファイル: view_board.py プロジェクト: coopengo/tryton
    def _parse_page(self, node, notebook, attributes):
        tab_box = gtk.HBox(spacing=3)
        if '_' not in attributes['string']:
            attributes['string'] = '_' + attributes['string']
        label = gtk.Label(attributes['string'])
        label.set_use_underline(True)
        tab_box.pack_start(label)

        if 'icon' in attributes:
            ICONFACTORY.register_icon(attributes['icon'])
            pixbuf = tab_box.render_icon(attributes['icon'],
                gtk.ICON_SIZE_SMALL_TOOLBAR)
            icon = gtk.Image()
            icon.set_from_pixbuf(pixbuf)
            tab_box.pack_start(icon)
        tab_box.show_all()

        viewport = gtk.Viewport()
        viewport.set_shadow_type(gtk.SHADOW_NONE)
        scrolledwindow = gtk.ScrolledWindow()
        scrolledwindow.set_shadow_type(gtk.SHADOW_NONE)
        scrolledwindow.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
        scrolledwindow.add(viewport)
        scrolledwindow.show_all()
        notebook.append_page(scrolledwindow, tab_box)
        container = self.parse(node)
        viewport.add(container.table)
コード例 #5
0
 def _set_icon(self, stock):
     if not stock:
         self.set_image(gtk.Image())
         return
     ICONFACTORY.register_icon(stock)
     icon = gtk.Image()
     icon.set_from_stock(stock, gtk.ICON_SIZE_SMALL_TOOLBAR)
     self.set_image(icon)
コード例 #6
0
 def _set_icon(self, stock):
     image = self.get_image()
     if not image and not stock:
         return
     elif image and image.get_stock()[0] == stock:
         return
     if not stock:
         self.set_image(gtk.Image())
         return
     ICONFACTORY.register_icon(stock)
     icon = gtk.Image()
     icon.set_from_stock(stock, gtk.ICON_SIZE_SMALL_TOOLBAR)
     self.set_image(icon)
コード例 #7
0
ファイル: button.py プロジェクト: coopengo/tryton
 def _set_icon(self, stock):
     image = self.get_image()
     if not image and not stock:
         return
     elif image and image.get_stock()[0] == stock:
         return
     if not stock:
         self.set_image(gtk.Image())
         return
     ICONFACTORY.register_icon(stock)
     icon = gtk.Image()
     icon.set_from_stock(stock, gtk.ICON_SIZE_SMALL_TOOLBAR)
     self.set_image(icon)
コード例 #8
0
ファイル: form.py プロジェクト: kret0s/gnuhealth-live
 def _parse_image(self, node, container, attributes):
     ICONFACTORY.register_icon(attributes['name'])
     image = Image(attrs=attributes)
     image.set_from_stock(attributes['name'], gtk.ICON_SIZE_DIALOG)
     self.state_widgets.append(image)
     container.add(image, attributes)
コード例 #9
0
ファイル: form.py プロジェクト: PierreCookie/tryton
 def _parse_image(self, node, container, attributes):
     ICONFACTORY.register_icon(attributes['name'])
     image = Image(attrs=attributes)
     image.set_from_stock(attributes['name'], gtk.ICON_SIZE_DIALOG)
     self.state_widgets.append(image)
     container.add(image, attributes)
コード例 #10
0
ファイル: view_board.py プロジェクト: solutema/tryton
 def _parse_image(self, node, container, attributes):
     ICONFACTORY.register_icon(attributes['name'])
     image = gtk.Image()
     image.set_from_stock(attributes['name'], gtk.ICON_SIZE_DIALOG)
     container.add(image, attributes)
コード例 #11
0
ファイル: view_board.py プロジェクト: coopengo/tryton
 def _parse_image(self, node, container, attributes):
     ICONFACTORY.register_icon(attributes['name'])
     image = gtk.Image()
     image.set_from_stock(attributes['name'], gtk.ICON_SIZE_DIALOG)
     container.add(image, attributes)