Esempio n. 1
0
    def __init__( self ):

        pygame.init()

        theme.Theme()

        surface = pygame.display.set_mode( (800,600) )
        gui.twidget_manager.TWidgetManager.sdl_surface = surface
Esempio n. 2
0
    def __init__( self ):
        self._countries = []
        self._players = []
        self._myname = 'noname'
        self._mycolor = 'nocolor'
        self._status = 0
        self._peerServer = None
        self._conn = None

        self._theme = theme.Theme()
        self._theme.parseTheme()
Esempio n. 3
0
 def __init__(self, stat):
     self.chosen_theme = theme.Theme('|', '-', '-', '*', curses.COLOR_BLACK,
                                     curses.COLOR_CYAN, curses.COLOR_WHITE)
     curses.init_pair(1, self.chosen_theme.text_colour,
                      self.chosen_theme.background_colour)
     curses.init_pair(2, self.chosen_theme.text_typedcolour,
                      self.chosen_theme.background_colour)
     self.stats = stat
     self.scr = curses.initscr()
     self.height, self.width = self.scr.getmaxyx()
     curses.cbreak()
     self.scr.keypad(True)
     self.scr.refresh()
     curses.noecho()
Esempio n. 4
0
    def __init__(self, config):
        # read config file
        self.cfg = config

        # launch remote control "driver"
        if self.cfg.remote:
            self.rc = remote.Remote()
        else:
            self.rc = None

        # initialize theme
        self.thm = theme.Theme(self.cfg)

        # initialize menu classes
        self.tv_menu = tv.TV_Menu(self.cfg, self.thm)
        self.video_menu = video.Video_Menu(self.cfg, self.thm)
        self.dvd_menu = dvd.DVD_Menu(self.cfg, self.thm)
        self.music_menu = music.Music_Menu(self.cfg, self.thm)
        self.photo_menu = photo.Photo_Menu(self.cfg, self.thm)
        self.web_menu = web.Web_Menu(self.cfg, self.thm)
Esempio n. 5
0
    def __init__(self, raw_path=None):
        self.tk_root = tk.Tk()

        self._theme = theme.Theme()

        self._edit_zone = edit_zone.EditZone(self.tk_root, self._theme)
        self._search_bar = search_bar.SearchBar(self.tk_root,
                                                self._edit_zone._scrolled_text)
        self._search_bar.match_color_bg = self._theme.hlsearchbg
        self._search_bar.match_color_fg = self._theme.hlsearchfg

        # Allow text cell to grow when more space is available
        self.tk_root.columnconfigure(0, weight=1)
        self.tk_root.rowconfigure(1, weight=1)  # edit zone

        self._file = file.File(self, self._edit_zone.get_buffer())
        self._file.set_root_window_title()
        self._edit_zone.set_check_text_change_since_last_save_cb(
            self._file.check_text_change_since_last_save)
        if raw_path:
            self._file.open(raw_path)

        menu_bar = tk.Menu(self.tk_root)

        self._file_menu = tk.Menu(menu_bar, tearoff=0)
        self._file_menu.add_command(label='Nouveau',
                                    underline=0,
                                    accelerator='Ctrl+N',
                                    command=self._file.on_file_new)
        self._file_menu.add_command(label='Ouvrir...',
                                    underline=0,
                                    accelerator='Ctrl+O',
                                    command=self._file.on_file_open)
        self._file_menu.add_separator()
        self._favrecent_index_first = 3  # The first favorite file is at index 3
        self._favrecent_nb = 0
        self._icon_star = get_star_image()
        self._build_fav_recent_menu_entries()
        recent_files.register_update_recent_files_cb(
            self._update_fav_recent_menu_entries)
        self._file_menu.add_separator()
        self._file_menu.add_command(label='Enregistrer',
                                    underline=0,
                                    accelerator='Ctrl+S',
                                    command=self._file.on_file_save)
        self._file_menu.add_command(label='Enregistrer sous...',
                                    underline=3,
                                    command=self._file.on_file_save_as)
        self._file_menu.add_separator()
        self._file_menu.add_command(label='Quitter',
                                    underline=0,
                                    accelerator='Alt+F4',
                                    command=self.exit)
        menu_bar.add_cascade(label='Fichier',
                             underline=0,
                             menu=self._file_menu)

        self._edit_menu = tk.Menu(menu_bar, tearoff=0)
        self._edit_menu.add_command(label='Annuler',
                                    underline=4,
                                    accelerator='Ctrl+Z',
                                    command=self._edit_zone.on_edit_undo)
        self._edit_menu.add_command(label='Rétablir',
                                    underline=0,
                                    accelerator='Ctrl+Y',
                                    command=self._edit_zone.on_edit_redo)
        self._edit_menu.add_separator()
        self._edit_menu.add_command(label='Couper',
                                    underline=0,
                                    accelerator='Ctrl+X',
                                    command=self._edit_zone.on_edit_cut)
        self._edit_menu.add_command(label='Copier',
                                    underline=1,
                                    accelerator='Ctrl+C',
                                    command=self._edit_zone.on_edit_copy)
        self._edit_menu.add_command(label='Coller',
                                    underline=0,
                                    accelerator='Ctrl+V',
                                    command=self._edit_zone.on_edit_paste)
        self._edit_menu.add_command(label='Tout sélectionner',
                                    underline=0,
                                    accelerator='Ctrl+A',
                                    command=self._edit_zone.on_edit_select_all)
        self._edit_menu.add_separator()
        self._edit_menu.add_command(label='Rechercher...',
                                    underline=0,
                                    accelerator='Ctrl+F',
                                    command=self._search_bar.on_edit_search)
        menu_bar.add_cascade(label='Edition',
                             underline=1,
                             menu=self._edit_menu)

        self.tk_root.config(menu=menu_bar)

        self.tk_root.bind('<Control-N>', self._file.on_file_new)
        self.tk_root.bind('<Control-n>', self._file.on_file_new)
        self.tk_root.bind('<Control-O>', self._file.on_file_open)
        self.tk_root.bind('<Control-o>', self._file.on_file_open)
        self.tk_root.bind('<Control-S>', self._file.on_file_save)
        self.tk_root.bind('<Control-s>', self._file.on_file_save)
        self.tk_root.bind('Alt-Keypress-F4', self.exit)

        self._edit_zone._scrolled_text.bind('<Control-Y>',
                                            self._edit_zone.on_edit_redo)
        self._edit_zone._scrolled_text.bind('<Control-y>',
                                            self._edit_zone.on_edit_redo)
        # rem: if bound at root level: ctrl+y will do 'paste', not 'redo'
        self._edit_zone._scrolled_text.bind('<Control-A>',
                                            self._edit_zone.on_edit_select_all)
        self._edit_zone._scrolled_text.bind('<Control-a>',
                                            self._edit_zone.on_edit_select_all)
        self.tk_root.bind('<Control-F>', self._search_bar.on_edit_search)
        self.tk_root.bind('<Control-f>', self._search_bar.on_edit_search)

        self.tk_root.protocol('WM_DELETE_WINDOW', self.exit)
Esempio n. 6
0
 def ajouterTheme(self, idTheme, nom):
     self.themes[idTheme] = theme.Theme(idTheme, nom)
Esempio n. 7
0
 def loadTheme(self):
     self.theme = theme.Theme(self.configuration)