Esempio n. 1
0
    def __init__(self):
        gtk.VBox.__init__(self)
        Signalizable.__init__(self)

        self.options = list()

        self.install_signal("selected")
Esempio n. 2
0
    def __init__(self):
        GObject.GObject.__init__(self)
        Signalizable.__init__(self)

        self.options = list()

        self.install_signal("selected")
Esempio n. 3
0
    def __init__(self, orientation=VERTICAL):
        gtk.Viewport.__init__(self)
        Signalizable.__init__(self)

        self.orientation = orientation
        self.x = 0
        self.y = 0
        self.offset = 0
        self.tags = list()
        self.zoom = 1.0
        self.show_position = True
        self.layout = gtk.Layout()
        self.add(self.layout)

        size = 25
        if self.orientation == HORIZONTAL:
            self.set_size_request(-1, size)
        elif self.orientation == VERTICAL:
            self.set_size_request(size, -1)

        self.add_events(gtk.gdk.POINTER_MOTION_MASK)
        self.layout.add_events(gtk.gdk.EXPOSURE_MASK)
        self.add_events(gtk.gdk.BUTTON_RELEASE_MASK)

        self.connect("motion-notify-event", self.motion, False)
        self.connect("button-release-event", self.release)
        self.connect("button-press-event", self.press)
        self.layout.connect("expose-event", self.expose)

        self.install_signal("append-tag")
        self.install_signal("move-tag")
Esempio n. 4
0
    def __init__(self):
        GObject.GObject.__init__(self)
        Signalizable.__init__(self)

        self.options = list()

        self.install_signal("selected")
Esempio n. 5
0
    def __init__(self):
        gtk.VBox.__init__(self)
        Signalizable.__init__(self)

        self.options = list()

        self.install_signal("selected")
Esempio n. 6
0
    def __init__(self, orientation=VERTICAL):
        GObject.GObject.__init__(self)
        Signalizable.__init__(self)

        self.orientation = orientation
        self.x = 0
        self.y = 0
        self.offset = 0
        self.tags = list()
        self.zoom = 1.0
        self.show_position = True
        self.layout = Gtk.Layout()
        self.add(self.layout)

        size = 25
        if self.orientation == HORIZONTAL:
            self.set_size_request(-1, size)
        elif self.orientation == VERTICAL:
            self.set_size_request(size, -1)

        self.add_events(Gdk.EventMask.POINTER_MOTION_MASK)
        self.layout.add_events(Gdk.EventMask.EXPOSURE_MASK)
        self.add_events(Gdk.EventMask.BUTTON_RELEASE_MASK)

        self.connect("motion-notify-event", self.motion, False)
        self.connect("button-release-event", self.release)
        self.connect("button-press-event", self.press)
        self.layout.connect("draw", self.expose)

        self.install_signal("append-tag")
        self.install_signal("move-tag")
Esempio n. 7
0
    def __init__(self, application):
        GObject.GObject.__init__(self)
        Signalizable.__init__(self)

        #from ui.application import Application
        #self.application = Application()
        self.application = application
        self.stack = None
        self.submenu = None
Esempio n. 8
0
    def __init__(self, application):
        gtk.MenuBar.__init__(self)
        Signalizable.__init__(self)

        #from ui.application import Application
        #self.application = Application()
        self.application = application
        self.stack = None
        self.submenu = None
Esempio n. 9
0
    def __init__(self, application=None):
        gtk.Layout.__init__(self)
        Signalizable.__init__(self)

        self.is_testing = False

        self.configure()
        #from ui.application import Application
        #self.application = Application()
        if application:
            self.application = application

        self.install_statics()
Esempio n. 10
0
    def __init__(self, application=None):
        GObject.GObject.__init__(self)
        Signalizable.__init__(self)

        self.is_testing = False

        self.configure()
        #from ui.application import Application
        #self.application = Application()
        if application:
            self.application = application

        self.install_statics()
Esempio n. 11
0
    def __init__(self):
        GObject.GObject.__init__(self)
        Signalizable.__init__(self)

        self.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)

        units = Gtk.ListStore(str)
        units.append([_("millimeters")])
        units.append([_("inches")])
        units.append([_("pixels")])

        self.liststore = Gtk.ListStore(str, int, str)

        treeview = Gtk.TreeView(self.liststore)
        treeview.set_size_request(-1, 100)
        treeview.set_rules_hint(True)
        treeview.set_grid_lines(True)
        self.add(treeview)

        cell = Gtk.CellRendererText()
        cell.connect("edited", self.title_edited)
        cell.set_property("editable", True)
        column = Gtk.TreeViewColumn(_("Title"))
        column.pack_start(cell, True)
        column.set_attributes(cell, text=COLUMN_TITLE)
        treeview.append_column(column)
        treeview.set_search_column(COLUMN_TITLE)

        adjustment = Gtk.Adjustment(0, 0, 100, 1)
        cell = Gtk.CellRendererSpin()
        cell.connect("edited", self.width_edited)
        cell.set_property("editable", True)
        cell.set_property("adjustment", adjustment)
        cell.set_property("xalign", 1.0)
        column = Gtk.TreeViewColumn(_("Width"))
        column.pack_start(cell, True)
        column.set_attributes(cell, text=COLUMN_WIDTH)
        treeview.append_column(column)

        cell = Gtk.CellRendererCombo()
        cell.set_property("editable", True)
        cell.set_property("has-entry", False)
        cell.set_property("model", units)
        cell.set_property("text-column", 0)
        column = Gtk.TreeViewColumn(_("Unit"))
        column.pack_start(cell, True)
        column.set_attributes(cell, text=COLUMN_UNIT)
        treeview.append_column(column)

        self.install_signals()
Esempio n. 12
0
    def __init__(self):
        GObject.GObject.__init__(self)
        Signalizable.__init__(self)

        self.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)

        units = Gtk.ListStore(str)
        units.append([_("millimeters")])
        units.append([_("inches")])
        units.append([_("pixels")])

        self.liststore = Gtk.ListStore(str, int, str)

        treeview = Gtk.TreeView(self.liststore)
        treeview.set_size_request(-1, 100)
        treeview.set_rules_hint(True)
        treeview.set_grid_lines(True)
        self.add(treeview)

        cell = Gtk.CellRendererText()
        cell.connect("edited", self.title_edited)
        cell.set_property("editable", True)
        column = Gtk.TreeViewColumn(_("Title"))
        column.pack_start(cell, True)
        column.set_attributes(cell, text=COLUMN_TITLE)
        treeview.append_column(column)
        treeview.set_search_column(COLUMN_TITLE)

        adjustment = Gtk.Adjustment(0, 0, 100, 1)
        cell = Gtk.CellRendererSpin()
        cell.connect("edited", self.width_edited)
        cell.set_property("editable", True)
        cell.set_property("adjustment", adjustment)
        cell.set_property("xalign", 1.0)
        column = Gtk.TreeViewColumn(_("Width"))
        column.pack_start(cell, True)
        column.set_attributes(cell, text=COLUMN_WIDTH)
        treeview.append_column(column)

        cell = Gtk.CellRendererCombo()
        cell.set_property("editable", True)
        cell.set_property("has-entry", False)
        cell.set_property("model", units)
        cell.set_property("text-column", 0)
        column = Gtk.TreeViewColumn(_("Unit"))
        column.pack_start(cell, True)
        column.set_attributes(cell, text=COLUMN_UNIT)
        treeview.append_column(column)

        self.install_signals()
Esempio n. 13
0
    def __init__(self, orientation=VERTICAL):
        GObject.GObject.__init__(self)
        Signalizable.__init__(self)
        #self.connect("realize", self.realize)

        if orientation == HORIZONTAL:
            self.set_orientation(Gtk.Orientation.HORIZONTAL)
        elif orientation == VERTICAL:
            self.set_orientation(Gtk.Orientation.VERTICAL)

        self.set_style(Gtk.ToolbarStyle.BOTH_HORIZ)
        self.set_icon_size(Gtk.IconSize.SMALL_TOOLBAR)

        self.position = 0
        self.submenu = None
        self.signals = list()
Esempio n. 14
0
    def __init__(self, orientation=VERTICAL):
        gtk.Toolbar.__init__(self)
        Signalizable.__init__(self)
        #self.connect("realize", self.realize)

        if orientation == HORIZONTAL:
            self.set_orientation(gtk.ORIENTATION_HORIZONTAL)
        elif orientation == VERTICAL:
            self.set_orientation(gtk.ORIENTATION_VERTICAL)

        self.set_style(gtk.TOOLBAR_BOTH_HORIZ)
        self.set_icon_size(gtk.ICON_SIZE_SMALL_TOOLBAR)

        self.position = 0
        self.submenu = None
        self.signals = list()
Esempio n. 15
0
    def __init__(self):
        gtk.HBox.__init__(self)
        Signalizable.__init__(self)

        self.set_spacing(1)
        alignment = gtk.Alignment(0.0, 0.5)
        self.add(alignment)
        self.spin = gtk.SpinButton()
        alignment.add(self.spin)

        self.spin.set_digits(2)
        self.spin.set_increments(1.0, 10.0)
        self.spin.set_numeric(True)
        self.spin.set_wrap(False)

        alignment = gtk.Alignment(0.0, 0.5)
        self.add(alignment)
        self.entry = gtk.combo_box_new_text()
        alignment.add(self.entry)

        self.install_signal("value-changed")
Esempio n. 16
0
    def __init__(self):
        GObject.GObject.__init__(self)
        Signalizable.__init__(self)

        self.set_spacing(1)
        alignment = Gtk.Alignment.new(0.0, 0.5, 0.0, 0.0)
        self.add(alignment)
        self.spin = Gtk.SpinButton()
        alignment.add(self.spin)

        self.spin.set_digits(2)
        self.spin.set_increments(1.0, 10.0)
        self.spin.set_numeric(True)
        self.spin.set_wrap(False)

        alignment = Gtk.Alignment.new(0.0, 0.5, 0.0, 0.0)
        self.add(alignment)
        self.entry = Gtk.ComboBoxText()
        alignment.add(self.entry)

        self.install_signal("value-changed")
Esempio n. 17
0
    def __init__(self):
        gtk.HBox.__init__(self)
        Signalizable.__init__(self)

        self.set_spacing(1)
        alignment = gtk.Alignment(0.0, 0.5)
        self.add(alignment)
        self.spin = gtk.SpinButton()
        alignment.add(self.spin)

        self.spin.set_digits(2)
        self.spin.set_increments(1.0, 10.0)
        self.spin.set_numeric(True)
        self.spin.set_wrap(False)

        alignment = gtk.Alignment(0.0, 0.5)
        self.add(alignment)
        self.entry = gtk.combo_box_new_text()
        alignment.add(self.entry)

        self.install_signal("value-changed")
Esempio n. 18
0
    def __init__(self):
        GObject.GObject.__init__(self)
        Signalizable.__init__(self)

        self.set_spacing(1)
        alignment = Gtk.Alignment.new(0.0, 0.5, 0.0, 0.0)
        self.add(alignment)
        self.spin = Gtk.SpinButton()
        alignment.add(self.spin)

        self.spin.set_digits(2)
        self.spin.set_increments(1.0, 10.0)
        self.spin.set_numeric(True)
        self.spin.set_wrap(False)

        alignment = Gtk.Alignment.new(0.0, 0.5, 0.0, 0.0)
        self.add(alignment)
        self.entry = Gtk.ComboBoxText()
        alignment.add(self.entry)

        self.install_signal("value-changed")
Esempio n. 19
0
    def __init__(self, application):
        GObject.GObject.__init__(self)
        Signalizable.__init__(self)

        handle = Gtk.HandleBox()
        handle.set_handle_position(Gtk.PositionType.LEFT)
        self.pack_start(handle, False, False, 0)

        toolbar = Gtk.Toolbar()
        toolbar.set_orientation(Gtk.Orientation.HORIZONTAL)
        #toolbar.set_style(Gtk.ToolbarStyle.ICONS)
        toolbar.set_style(Gtk.ToolbarStyle.BOTH_HORIZ)
        toolbar.set_icon_size(Gtk.IconSize.MENU)
        handle.add(toolbar)

        position = 0
        button = Gtk.ToolButton(Gtk.STOCK_BOLD)
        toolbar.insert(button, position)

        position += 1
        button = Gtk.ToolButton(Gtk.STOCK_ITALIC)
        toolbar.insert(button, position)

        position += 1
        button = Gtk.ToolButton(Gtk.STOCK_UNDERLINE)
        toolbar.insert(button, position)

        position += 1
        button = Gtk.ToolButton(Gtk.STOCK_STRIKETHROUGH)
        toolbar.insert(button, position)

        position += 1
        separator = Gtk.SeparatorToolItem()
        toolbar.insert(separator, position)

        position += 1
        button = Gtk.ToolButton(Gtk.STOCK_JUSTIFY_LEFT)
        toolbar.insert(button, position)

        position += 1
        button = Gtk.ToolButton(Gtk.STOCK_JUSTIFY_RIGHT)
        toolbar.insert(button, position)

        position += 1
        button = Gtk.ToolButton(Gtk.STOCK_JUSTIFY_CENTER)
        toolbar.insert(button, position)

        position += 1
        button = Gtk.ToolButton(Gtk.STOCK_JUSTIFY_FILL)
        toolbar.insert(button, position)

        position += 1
        separator = Gtk.SeparatorToolItem()
        toolbar.insert(separator, position)

        position += 1
        button = Gtk.ToolButton(Gtk.STOCK_INDENT)
        toolbar.insert(button, position)

        position += 1
        button = Gtk.ToolButton(Gtk.STOCK_UNINDENT)
        toolbar.insert(button, position)

        area = Gtk.ScrolledWindow()
        area.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
        adjustment = area.get_vadjustment()
        adjustment.need_scroll = True
        adjustment.connect("changed", self.update_adjustment)
        adjustment.connect("value-changed", self.update_value)
        entry = Gtk.TextView()
        entry.connect_after("move-cursor", self.move)
        entry.connect("focus-in-event", self.focus_in)
        entry.connect("focus-out-event", self.focus_out)
        entry.set_size_request(-1, 100)
        self.buffer = entry.get_buffer()
        #self.disconnect_handler = buffer.connect("changed", self.changed)
        self.buffer.connect("insert-text", self.update_scroll, entry)
        self.buffer.connect("changed", self.changed)
        #area.add_with_viewport(entry)
        area.add(entry)
        #entry.set_wrap_mode(Gtk.WrapMode.WORD_CHAR)
        entry.set_wrap_mode(Gtk.WrapMode.CHAR)
        self.add(area)

        #        from application import Application
        #        self.application = Application()
        self.application = application

        self.install_signal("cursor-moved")
Esempio n. 20
0
    def __init__(self, application):
        GObject.GObject.__init__(self)
        Signalizable.__init__(self)

        handle = Gtk.HandleBox()
        handle.set_handle_position(Gtk.PositionType.LEFT)
        self.pack_start(handle, False, False, 0)

        toolbar = Gtk.Toolbar()
        toolbar.set_orientation(Gtk.Orientation.HORIZONTAL)
        #toolbar.set_style(Gtk.ToolbarStyle.ICONS)
        toolbar.set_style(Gtk.ToolbarStyle.BOTH_HORIZ)
        toolbar.set_icon_size(Gtk.IconSize.MENU)
        handle.add(toolbar)

        position = 0
        button = Gtk.ToolButton(Gtk.STOCK_BOLD)
        toolbar.insert(button, position)

        position += 1
        button = Gtk.ToolButton(Gtk.STOCK_ITALIC)
        toolbar.insert(button, position)

        position += 1
        button = Gtk.ToolButton(Gtk.STOCK_UNDERLINE)
        toolbar.insert(button, position)

        position += 1
        button = Gtk.ToolButton(Gtk.STOCK_STRIKETHROUGH)
        toolbar.insert(button, position)

        position += 1
        separator = Gtk.SeparatorToolItem()
        toolbar.insert(separator, position)

        position += 1
        button = Gtk.ToolButton(Gtk.STOCK_JUSTIFY_LEFT)
        toolbar.insert(button, position)

        position += 1
        button = Gtk.ToolButton(Gtk.STOCK_JUSTIFY_RIGHT)
        toolbar.insert(button, position)

        position += 1
        button = Gtk.ToolButton(Gtk.STOCK_JUSTIFY_CENTER)
        toolbar.insert(button, position)

        position += 1
        button = Gtk.ToolButton(Gtk.STOCK_JUSTIFY_FILL)
        toolbar.insert(button, position)

        position += 1
        separator = Gtk.SeparatorToolItem()
        toolbar.insert(separator, position)

        position += 1
        button = Gtk.ToolButton(Gtk.STOCK_INDENT)
        toolbar.insert(button, position)

        position += 1
        button = Gtk.ToolButton(Gtk.STOCK_UNINDENT)
        toolbar.insert(button, position)

        area = Gtk.ScrolledWindow()
        area.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
        adjustment = area.get_vadjustment()
        adjustment.need_scroll = True
        adjustment.connect("changed", self.update_adjustment)
        adjustment.connect("value-changed", self.update_value)
        entry = Gtk.TextView()
        entry.connect_after("move-cursor", self.move)
        entry.connect("focus-in-event", self.focus_in)
        entry.connect("focus-out-event", self.focus_out)
        entry.set_size_request(-1, 100)
        self.buffer = entry.get_buffer()
        #self.disconnect_handler = buffer.connect("changed", self.changed)
        self.buffer.connect("insert-text", self.update_scroll, entry)
        self.buffer.connect("changed", self.changed)
        #area.add_with_viewport(entry)
        area.add(entry)
        #entry.set_wrap_mode(Gtk.WrapMode.WORD_CHAR)
        entry.set_wrap_mode(Gtk.WrapMode.CHAR)
        self.add(area)

#        from application import Application
#        self.application = Application()
        self.application = application

        self.install_signal("cursor-moved")