Esempio n. 1
0
    def __init__(self, callback=None):
        ui.Box.__init__(self, background='#FFFFFF')
        self.callback = callback

        grid = ui.Grid()
        self.set_child(grid)

        label = ui.Label('Select file to open', '#000000')
        grid.append_row(label)

        model = ui.FileModel()
        files = ui.TreeView(model, self._file_selected, text_color='#000000')
        grid.append_row(files)
        grid.focus(files)
Esempio n. 2
0
    def __init__(self, screen):
        self.display = PrideDisplay(self, screen)
        self.fullscreen = False

        self.stack = ui.Stack()
        self.display.set_child(self.stack)

        self.main_list = ui.Grid()
        self.stack.add_child(self.main_list)

        self.editor = Editor()
        self.editor.load_file('main.py')
        self.editor.load_file('README.md')
        self.main_list.append_row(self.editor)

        def console_changed():
            self.display.refresh()

        self.python_console = PythonConsole(console_changed)
        self.main_list.append_row(self.python_console)

        self.main_list.focus(self.editor)

        self.help_dialog = HelpDialog()
        self.help_dialog.visible = False
        self.stack.add_child(self.help_dialog)

        self.menu_dialog = MenuDialog()
        self.menu_dialog.visible = False
        self.menu_dialog.set_scale(0.5, 0.5)
        self.stack.add_child(self.menu_dialog)

        self.file_dialog = FileDialog(self._on_file_selected)
        self.file_dialog.visible = False
        self.file_dialog.set_scale(0.5, 0.5)
        self.stack.add_child(self.file_dialog)

        self.emoji_dialog = ui.EmojiDialog()
        self.emoji_dialog.visible = False
        self.emoji_dialog.select_character = self.select_emoji
        self.emoji_dialog.set_scale(0.5, 0.5)
        self.stack.add_child(self.emoji_dialog)
Esempio n. 3
0
    def __init__(self):
        ui.Grid.__init__(self)

        tab_grid = ui.Grid()
        tab_grid.set_scale(1.0, 0.0)
        self.append_row(tab_grid)

        tab_grid.append_column(
            ui.Label(unicodedata.lookup('PAGE FACING UP') + '  ',
                     background='#0000FF'))

        self.tabs = ui.Tabs()
        tab_grid.append_column(self.tabs)

        self.file_stack = ui.Stack()
        self.append_row(self.file_stack)

        self.file_views = []
        self.selected = 0
        self.focus(self.file_stack)
Esempio n. 4
0
    def __init__(self):
        ui.Box.__init__(self, background='#FFFFFF')

        grid = ui.Grid()
        grid.set_scale(1.0, 1.0)
        self.set_child(grid)

        label = ui.Label('Menu', '#000000')
        grid.append_row(label)

        button = ui.Button('New File',
                           'Ctrl+N',
                           background='#FFFFFF',
                           clicked_callback=self._new_file_clicked)
        grid.append_row(button)
        grid.focus(button)

        button = ui.Button('Foo', background='#FFFFFF')
        grid.append_row(button)

        button = ui.Button('Options',
                           background='#FFFFFF',
                           clicked_callback=self._options_clicked)
        grid.append_row(button)
Esempio n. 5
0
    def __init__(self):
        ui.Box.__init__(self, background='#FFFFFF')

        grid = ui.Grid()
        self.set_child(grid)

        label = ui.Label('PRIDE - The Python Remote IDE\n', '#000000')
        grid.append_row(label)

        label = ui.Label('F1 - Help screen', '#000000')
        grid.append_row(label)
        label = ui.Label('F2 - Menu', '#000000')
        grid.append_row(label)
        label = ui.Label('F3 - Next file', '#000000')
        grid.append_row(label)
        label = ui.Label('F4 - Switch between editor and Python', '#000000')
        grid.append_row(label)
        label = ui.Label('F5 - Run file', '#000000')
        grid.append_row(label)
        label = ui.Label('Insert - Insert Emoji', '#000000')
        grid.append_row(label)

        python_logo = PythonLogo()
        grid.append_row(python_logo)