Exemple #1
0
 def __init__(self, manager, editor):
     from ComboBox import ComboBox
     ComboBox(manager, editor)
     from Entry import Entry
     Entry(manager, editor)
     from Displayer import Displayer
     Displayer(manager, editor)
Exemple #2
0
 def __init__(self, manager, editor):
     from Window.Manager import Manager
     Manager(manager, editor)
     from FileChooser.Manager import Manager
     Manager(manager, editor)
     from ComboBox import ComboBox
     ComboBox(manager, editor)
     from OpenButton import Button
     Button(manager, editor)
     from CancelButton import Button
     Button(manager, editor)
Exemple #3
0
	def __init__(self, manager, editor):
		from Window import Window
		Window(manager, editor)
		from ComboBox import ComboBox
		ComboBox(manager, editor)
		from Label import Label
		Label(manager, editor)
		from OpenButton import Button
		Button(manager, editor)
		from CloseButton import Button
		Button(manager, editor)
Exemple #4
0
	def __init__(self, manager, editor):
		self.__init_attributes(manager, editor)
		from OpenButton import Button
		Button(editor, manager)
		from ComboBoxEntry import ComboBoxEntry
		ComboBoxEntry(editor, manager)
		from ComboBox import ComboBox
		ComboBox(manager, editor)
		from CancelButton import Button
		Button(editor, manager)
		from Window import Window
		Window(editor, manager)
Exemple #5
0
 def __init__(self, manager, editor):
     from FeedbackUpdater import Updater
     Updater(manager, editor)
     from Window.Manager import Manager
     Manager(manager, editor)
     from FileChooser.Manager import Manager
     Manager(manager, editor)
     from ComboBox import ComboBox
     ComboBox(manager, editor)
     from SaveButton import Button
     Button(manager, editor)
     from CancelButton import Button
     Button(manager, editor)
Exemple #6
0
 def __init__(self, manager, editor):
     from ButtonSwitcher import Switcher
     Switcher(manager, editor)
     from Bar import Bar
     Bar(manager, editor)
     from Entry import Entry
     Entry(manager, editor)
     from ComboBox import ComboBox
     ComboBox(manager, editor)
     from MenuButton import Button
     Button(manager, editor)
     from PopupMenu import PopupMenu
     PopupMenu(manager, editor)
     #		from MatchCaseButton import Button
     #		Button(manager, editor)
     from MatchWordButton import Button
     Button(manager, editor)
     #		from MenuComboBox import ComboBox
     #		ComboBox(manager, editor)
     from EntryActivator import Activator
     Activator(manager, editor)
     from PreviousButton import Button
     Button(manager, editor)
     from NextButton import Button
     Button(manager, editor)
     from StopButton import Button
     Button(manager, editor)
     from FindButton import Button
     Button(manager, editor)
     from ReplaceWidgetDisplayer import Displayer
     Displayer(manager, editor)
     from ReplaceEntry import Entry
     Entry(manager, editor)
     from ReplaceButton import Button
     Button(manager, editor)
     from ReplaceAllButton import Button
     Button(manager, editor)
    def __init__(self, file):
        super().__init__()
        self.connect('delete-event', Gtk.main_quit)  # exit when window closed
        self.connect('size-allocate', self._on_resize)
        self.connect('key-press-event', self._on_key)
        self.file = file
        self.width = 256
        self.scale = 2
        self.offset = 0
        self.format = imageFormats[0]

        file.seek(0, 2)
        self.fileSize = file.tell()
        file.seek(0)

        self.set_default_size(1024, 768)

        mainBox = Gtk.Box(orientation='horizontal')
        self.add(mainBox)

        self.canvas = Canvas(self)
        mainBox.pack_start(self.canvas, True, True, 0)

        rightBox = Gtk.Box(orientation='vertical')
        mainBox.pack_start(rightBox, False, False, 0)

        # format box
        box = Gtk.Box(orientation='horizontal')
        rightBox.pack_start(box, False, False, 0)
        box.pack_start(Gtk.Label(label="Format:"), False, False, 0)

        fmts = [fmt.name for fmt in imageFormats]
        self.lstFormat = ComboBox(fmts, onChange=lambda: self.redraw())
        box.pack_start(self.lstFormat, False, False, 0)

        # offset box
        box = Gtk.Box(orientation='horizontal')
        rightBox.pack_start(box, False, False, 0)
        box.pack_start(Gtk.Label(label="Offset: 0x"), False, False, 0)
        self.txtOffs = Gtk.Entry(input_purpose=Gtk.InputPurpose.NUMBER,
                                 overwrite_mode=True)
        self.txtOffs.set_text('000000')
        self.txtOffs.connect('changed', lambda widget: self.redraw())
        box.pack_start(self.txtOffs, False, False, 0)

        # size box
        box = Gtk.Box(orientation='horizontal')
        rightBox.pack_start(box, False, False, 0)
        box.pack_start(Gtk.Label(label="Size: 0x"), False, False, 0)
        self.txtFileSize = Gtk.Entry(editable=False)
        self.txtFileSize.set_text('%06X' % self.fileSize)
        box.pack_start(self.txtFileSize, False, False, 0)

        # width box
        box = Gtk.Box(orientation='horizontal')
        rightBox.pack_start(box, False, False, 0)
        box.pack_start(Gtk.Label(label="Width:"), False, False, 0)
        self.txtWidth = Gtk.Entry(input_purpose=Gtk.InputPurpose.NUMBER,
                                  overwrite_mode=True)
        self.txtWidth.set_text(str(self.width))
        self.txtWidth.connect('changed', lambda widget: self.redraw())
        box.pack_start(self.txtWidth, False, False, 0)

        # scale box
        box = Gtk.Box(orientation='horizontal')
        rightBox.pack_start(box, False, False, 0)
        box.pack_start(Gtk.Label(label="Scale:"), False, False, 0)
        self.txtScale = Gtk.Entry(input_purpose=Gtk.InputPurpose.NUMBER,
                                  overwrite_mode=True)
        self.txtScale.set_text(str(self.scale))
        self.txtScale.connect('changed', lambda widget: self.redraw())
        box.pack_start(self.txtScale, False, False, 0)