Esempio n. 1
0
 def add_buttons(self):
     self.btn_top = sh.Button (parent = self.frm_top
                              ,hint = _('This button is at the top')
                              ,text = _('Top')
                              ,hdir = 'bottom'
                              ,active = self.icn_top
                              ,inactive = self.icn_top
                              ,expand = True
                              ,action = self.move_up
                              )
     self.btn_btm = sh.Button (parent = self.frm_btm
                              ,hint = _('This button is at the bottom')
                              ,text = _('Bottom')
                              ,hdir = 'top'
                              ,active = self.icn_btm
                              ,inactive = self.icn_btm
                              ,expand = True
                              ,action = self.move_down
                              )
     self.btn_lft = sh.Button (parent = self.frm_lft
                              ,hint = _('This button is at the left')
                              ,text = _('Left')
                              ,hdir = 'bottom'
                              ,active = self.icn_lft
                              ,inactive = self.icn_lft
                              ,action = self.move_left
                              )
     self.btn_rht = sh.Button (parent = self.frm_rht
                              ,hint = _('This button is at the right')
                              ,text = _('Right')
                              ,hdir = 'bottom'
                              ,active = self.icn_rht
                              ,inactive = self.icn_rht
                              ,action = self.move_right
                              )
Esempio n. 2
0
 def set_meter(self):
     self.btn_prv = sh.Button (parent = self.frm
                              ,hint = _('Go to the preceding record')
                              ,inactive = self.prev_inactive
                              ,active = self.prev_active
                              ,text = '←'
                              ,hdir = 'bottom'
                              ,side = 'left'
                              ,bindings = '<Alt-Left>'
                              )
     # Show the current record #/total records ratio
     self.lbl_mtr = sh.Label (parent = self.frm
                             ,text = '0 / 0'
                             ,expand = False
                             ,side = 'left'
                             )
     sh.ToolTip (obj = self.lbl_mtr
                ,text = _('Album ID')
                ,hdir = 'bottom'
                )
     self.btn_nxt = sh.Button (parent = self.frm
                              ,hint = _('Go to the following record')
                              ,inactive = self.next_inactive
                              ,active = self.next_active
                              ,text = '→'
                              ,hdir = 'bottom'
                              ,side = 'left'
                              ,bindings = '<Alt-Right>'
                              )
Esempio n. 3
0
 def set_buttons(self):
     self.btn1 = sh.Button(parent=self.parent,
                           text=_('Word Guesser'),
                           side='top')
     self.btn2 = sh.Button(parent=self.parent,
                           text=_('Word Scrambler'),
                           side='top')
     self.btn1.focus()
Esempio n. 4
0
 def set_buttons(self):
     self.btn_can = sh.Button (parent = self.frm_btm
                              ,text = _('Cancel')
                              ,side = 'left'
                              )
     self.btn_ok1 = sh.Button (parent = self.frm_btm
                              ,text = _('OK')
                              ,side = 'right'
                              )
Esempio n. 5
0
 def set_buttons(self):
     self.btn1 = sh.Button(parent=self.frm4,
                           side='left',
                           text=_('Close'),
                           hint=_('Close this window'),
                           action=self.close)
     self.btn2 = sh.Button(parent=self.frm4,
                           side='right',
                           text=_('Guess'),
                           hint=_('Guess missing characters in the word'))
Esempio n. 6
0
    def set_buttons(self):
        sh.Button(parent=self.frm_btn,
                  action=self.reset,
                  hint=_('Reset settings'),
                  text=_('Reset'),
                  side='left')

        self.btn_apl = sh.Button(parent=self.frm_btn,
                                 hint=_('Apply settings'),
                                 text=_('Apply'),
                                 side='right')
Esempio n. 7
0
 def set_buttons(self):
     # Show the license
     self.btn_thd = sh.Button(parent=self.frm_sec,
                              text=_('Third parties'),
                              hint=_('Third-party licenses'),
                              side='left')
     self.btn_lic = sh.Button(parent=self.frm_ter,
                              text=_('License'),
                              hint=_('View the license'),
                              side='left')
     # Send mail to the author
     self.btn_eml = sh.Button(parent=self.frm_ter,
                              text=_('Contact the author'),
                              hint=_('Draft an email to the author'),
                              side='right')
Esempio n. 8
0
 def set_buttons(self):
     self.btn_cls = sh.Button (parent = self.frm_btl
                              ,text = _('Close')
                              ,side = 'left'
                              ,action = self.close
                              )
     self.btn_rst = sh.Button (parent = self.frm_btl
                              ,text = _('Reset')
                              ,side = 'right'
                              ,action = self.reset
                              )
     self.btn_str = sh.Button (parent = self.frm_btr
                              ,text = _('Start')
                              ,side = 'right'
                              ,Focus = True
                              )
Esempio n. 9
0
 def search_albums(self):
     self.btn_spr = sh.Button (parent = self.frm
                              ,hint = _('Search older records')
                              ,inactive = self.prev_inactive
                              ,active = self.prev_active
                              ,text = '←'
                              ,hdir = 'bottom'
                              ,side = 'left'
                              )
     self.ent_src = sh.Entry (parent = self.frm
                             ,side = 'left'
                             )
     self.btn_snx = sh.Button (parent = self.frm
                              ,hint = _('Search newer records')
                              ,inactive = self.next_inactive
                              ,active = self.next_active
                              ,text = '→'
                              ,hdir = 'bottom'
                              ,side = 'left'
                              )
     sh.ToolTip (obj = self.ent_src
                ,text = _('Search in albums')
                ,hdir = 'bottom'
                )
Esempio n. 10
0
 def add_buttons(self):
     self.btn_rld = sh.Button (parent = self.frm_btn
                              ,text = _('Reload')
                              ,hint = _('Reload the present record')
                              ,side = 'left'
                              ,inactive = self.icn_rld
                              ,active = self.icn_rld
                              ,bindings = ('<F5>','<Control-r>')
                              )
     self.btn_rat = sh.Button (parent = self.frm_btn
                              ,text = _('Clear rating')
                              ,hint = _('Clear rating of all tracks')
                              ,side = 'left'
                              ,inactive = self.icn_rat
                              ,active = self.icn_rat
                              ,action = self.clear_rating
                              )
     self.btn_dez = sh.Button (parent = self.frm_btn
                              ,text = _('Decypher')
                              ,hint = _('Decypher text (Caesar algorithm)')
                              ,side = 'left'
                              ,inactive = self.icn_dez
                              ,active = self.icn_dez
                              )
     self.btn_cyp = sh.Button (parent = self.frm_btn
                              ,text = _('Cypher')
                              ,hint = _('Cypher text (Caesar algorithm)')
                              ,side = 'left'
                              ,inactive = self.icn_cyp
                              ,active = self.icn_cyp
                              )
     self.btn_dec = sh.Button (parent = self.frm_btn
                              ,text = _('Decode')
                              ,hint = _('Decode back to cp1251')
                              ,side = 'left'
                              ,inactive = self.icn_dec
                              ,active = self.icn_dec
                              )
     self.btn_sav = sh.Button (parent = self.frm_btn
                              ,text = _('Save')
                              ,hint = _('Save changes')
                              ,side = 'right'
                              ,inactive = self.icn_sav
                              ,active = self.icn_sav
                              ,bindings = ('<F2>','<Control-s>')
                              )
Esempio n. 11
0
 def set_buttons(self):
     font = 'Serif 11'
     self.a.append (sh.Button (parent = self.parent
                              ,text = _('Album Editor')
                              ,side = 'top'
                              ,font = font
                              )
                   )
     self.a.append (sh.Button (parent = self.parent
                              ,text = _('Prepare files')
                              ,hint = _('Move sub-folders to a root folder, split large lossless files, etc.')
                              ,side = 'top'
                              ,font = font
                              )
                    )
     self.a.append (sh.Button (parent = self.parent
                              ,text = _('Collect tags & Obfuscate')
                              ,side = 'top'
                              ,font = font
                              )
                    )
     self.a.append (sh.Button (parent = self.parent
                              ,text = _('Copy music')
                              ,side = 'top'
                              ,font = font
                              )
                    )
     self.a.append (sh.Button (parent = self.parent
                              ,text = _('Delete low-rated music')
                              ,side = 'top'
                              ,font = font
                              )
                   )
     self.a.append (sh.Button (parent = self.parent
                              ,text = _('Quit')
                              ,side = 'top'
                              ,font = font
                              ,action = self.close
                              )
                   )
Esempio n. 12
0
 def set_bottom(self):
     self.opt_gnr = sh.OptionMenu (parent = self.frm_rht
                                  ,side = 'left'
                                  )
     self.btn_rld = sh.Button (parent = self.frm1
                              ,text = _('Reload')
                              ,hint = _('Reload the present record')
                              ,side = 'left'
                              ,inactive = self.icn_rld
                              ,active = self.icn_rld
                              ,bindings = ('<F5>','<Control-r>')
                              )
     self.btn_rec = sh.Button (parent = self.frm1
                              ,text = _('Create')
                              ,hint = _('Create a new record')
                              ,side = 'left'
                              ,inactive = self.icn_add
                              ,active = self.icn_add
                              ,bindings = '<Control-n>'
                              )
     self.btn_del = sh.Button (parent = self.frm1
                              ,text = _('Delete')
                              ,hint = _('Delete the present record')
                              ,side = 'left'
                              ,inactive = self.icn_del
                              ,active = self.icn_del
                              )
     self.btn_dez = sh.Button (parent = self.frm2
                              ,text = _('Decypher')
                              ,hint = _('Decypher text (Caesar algorithm)')
                              ,side = 'left'
                              ,inactive = self.icn_dez
                              ,active = self.icn_dez
                              )
     self.btn_cyp = sh.Button (parent = self.frm2
                              ,text = _('Cypher')
                              ,hint = _('Cypher text (Caesar algorithm)')
                              ,side = 'left'
                              ,inactive = self.icn_cyp
                              ,active = self.icn_cyp
                              )
     self.btn_dec = sh.Button (parent = self.frm2
                              ,text = _('Decode')
                              ,hint = _('Decode back to cp1251')
                              ,side = 'left'
                              ,inactive = self.icn_dec
                              ,active = self.icn_dec
                              )
     self.btn_sav = sh.Button (parent = self.frm2
                              ,text = _('Save')
                              ,hint = _('Save changes')
                              ,side = 'left'
                              ,inactive = self.icn_sav
                              ,active = self.icn_sav
                              ,bindings = ('<F2>','<Control-s>')
                              )
     self.btn_trk = sh.Button (parent = self.frm2
                              ,text = _('Tracks')
                              ,hint = _('Edit tracks')
                              ,side = 'left'
                              ,inactive = self.icn_trk
                              ,active = self.icn_trk
                              ,bindings = ('<F4>','<Control-t>'
                                          ,'<Alt-t>'
                                          )
                              )
Esempio n. 13
0
 def set_buttons(self):
     self.btn_lft = sh.Button(parent=self.frm_cnt,
                              hint=_('Block selection on the right'),
                              inactive=icn_lft,
                              active=icn_lft,
                              text='←',
                              side='top',
                              expand=0,
                              hdir='bottom')
     self.btn_rht = sh.Button(parent=self.frm_cnt,
                              hint=_('Unblock selection on the left'),
                              inactive=icn_rht,
                              active=icn_rht,
                              text='→',
                              side='top',
                              expand=0,
                              hdir='bottom')
     self.btn_grb = sh.Button(parent=self.frm_cnt,
                              hint=_('Block related subjects'),
                              inactive=icn_grb,
                              active=icn_grb,
                              text='⟸',
                              side='top',
                              expand=0,
                              hdir='bottom')
     self.btn_gru = sh.Button(parent=self.frm_cnt,
                              hint=_('Unblock related subjects'),
                              inactive=icn_gru,
                              active=icn_gru,
                              text='⇒',
                              side='top',
                              expand=0,
                              hdir='bottom')
     self.btn_clr = sh.Button(parent=self.frm_cnt,
                              hint=_('Clear selection in both panes'),
                              inactive=icn_clr,
                              active=icn_clr,
                              text=_('Clear'),
                              side='top',
                              expand=0,
                              hdir='bottom')
     self.btn_rld = sh.Button(parent=self.frm_cnt,
                              text=_('Reload'),
                              hint=_('Reload settings'),
                              inactive=icn_rld,
                              active=icn_rld,
                              expand=0,
                              side='top',
                              hdir='bottom')
     self.btn_cls = sh.Button(parent=self.frm_bm1,
                              text=_('Close'),
                              hint=_('Close this window'),
                              expand=0,
                              side='left',
                              hdir='top')
     self.btn_all = sh.Button(parent=self.frm_bm3,
                              text=_('All'),
                              hint=_('Show all subjects'),
                              expand=0,
                              side='left',
                              hdir='top')
     self.btn_mjr = sh.Button(parent=self.frm_bm3,
                              text=_('Main'),
                              hint=_('Show main subjects'),
                              expand=0,
                              side='left',
                              hdir='top')
     self.btn_art = sh.Button(
         parent=self.frm_bm3,
         text=_('From the article'),
         hint=_('Show subjects from the current article'),
         expand=0,
         side='right',
         hdir='top')
Esempio n. 14
0
    def set_buttons(self):
        ''' Create buttons
            Bindings are indicated here only to set hints. In order to
            set bindings, use 'self.bindings'.
        '''
        # A button for newbies, substitutes Enter in search_field
        self.btn_trn = sh.Button(parent=self.frm_btn,
                                 text=_('Translate'),
                                 hint=_('Translate'),
                                 inactive=self.icn_ret,
                                 active=self.icn_ret)

        # A button to clear the search field
        self.btn_clr = sh.Button(parent=self.frm_btn,
                                 text=_('Clear'),
                                 hint=_('Clear search field'),
                                 inactive=self.icn_clr,
                                 active=self.icn_clr)

        # A button to insert text into the search field
        self.btn_ins = sh.Button(parent=self.frm_btn,
                                 text=_('Paste'),
                                 hint=_('Paste text from clipboard'),
                                 inactive=self.icn_ins,
                                 active=self.icn_ins)
        # A button to insert a current search
        self.btn_rp1 = sh.Button(parent=self.frm_btn,
                                 text='!',
                                 hint=_('Paste current request'),
                                 inactive=self.icn_rp0,
                                 active=self.icn_rp1)
        # A button to insert a previous search
        self.btn_rp2 = sh.Button(parent=self.frm_btn,
                                 text='!!',
                                 hint=_('Paste previous request'),
                                 inactive=self.icn_r20,
                                 active=self.icn_r21)
        # A button to insert special symbols
        self.btn_sym = sh.Button(parent=self.frm_btn,
                                 text=_('Symbols'),
                                 hint=_('Paste a special symbol'),
                                 inactive=self.icn_sym,
                                 active=self.icn_sym)
        self.opt_src = sh.OptionMenu(parent=self.frm_btn,
                                     Combo=True,
                                     font='Sans 11')
        ''' Configure the option menu at the GUI creation time to avoid
            glitches with the search field.
        '''
        self.opt_src.widget.configure(width=14, font='Sans 11')
        # Drop-down lists with languages
        self.opt_lg1 = sh.OptionMenu(parent=self.frm_btn,
                                     Combo=True,
                                     font='Sans 11')
        self.btn_swp = sh.Button(parent=self.frm_btn,
                                 hint=_('Swap source and target languages'),
                                 inactive=self.icn_swp,
                                 active=self.icn_swp,
                                 text=_('Swap'))
        self.opt_lg2 = sh.OptionMenu(parent=self.frm_btn,
                                     Combo=True,
                                     font='Sans 11')
        self.opt_col = sh.OptionMenu(parent=self.frm_btn,
                                     items=(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),
                                     default=4,
                                     Combo=True,
                                     font='Sans 11')
        ''' The 'height' argument changes a height of the drop-down
            list and not the main widget.
        '''
        self.opt_lg1.widget.config(width=11, height=15)
        self.opt_lg2.widget.config(width=11, height=15)
        self.opt_col.widget.config(width=2)
        # A settings button
        self.btn_set = sh.Button(parent=self.frm_btn,
                                 text=_('Settings'),
                                 hint=_('Tune up view settings'),
                                 inactive=self.icn_set,
                                 active=self.icn_set)
        # A button to toggle subject blocking
        self.btn_blk = sh.Button(parent=self.frm_btn,
                                 text=_('Blacklist'),
                                 hint=_('Configure blacklisting'),
                                 inactive=self.icn_bl0,
                                 active=self.icn_bl1)
        # A button to toggle subject prioritization
        self.btn_pri = sh.Button(parent=self.frm_btn,
                                 text=_('Prioritize'),
                                 hint=_('Configure prioritization'),
                                 inactive=self.icn_pr0,
                                 active=self.icn_pr1)
        # A button to toggle subject alphabetization
        self.btn_alp = sh.Button(parent=self.frm_btn,
                                 text=_('Alphabetize'),
                                 hint=_('Toggle alphabetizing'),
                                 inactive=self.icn_al0,
                                 active=self.icn_al1)
        # A button to change the article view
        self.btn_viw = sh.Button(parent=self.frm_btn,
                                 text=_('Toggle view'),
                                 hint=_('Toggle the article view mode'),
                                 inactive=self.icn_ver,
                                 active=self.icn_hor)
        # A button to move to the previous article
        self.btn_prv = sh.Button(parent=self.frm_btn,
                                 text='←',
                                 hint=_('Go to the preceding article'),
                                 inactive=self.icn_bk0,
                                 active=self.icn_bk1)
        # A button to move to the next article
        self.btn_nxt = sh.Button(parent=self.frm_btn,
                                 text='→',
                                 hint=_('Go to the following article'),
                                 inactive=self.icn_fw0,
                                 active=self.icn_fw1)
        # A button to toggle and clear history
        self.btn_hst = sh.Button(parent=self.frm_btn,
                                 text=_('History'),
                                 inactive=self.icn_hst,
                                 active=self.icn_hst)
        # A button to reload the article
        self.btn_rld = sh.Button(parent=self.frm_btn,
                                 text=_('Reload'),
                                 hint=_('Reload the article'),
                                 inactive=self.icn_rld,
                                 active=self.icn_rld)
        # A button to search within the article
        self.btn_ser = sh.Button(parent=self.frm_btn,
                                 text=_('Search'),
                                 hint=_('Find in the current article'),
                                 inactive=self.icn_src,
                                 active=self.icn_src)
        # A button to save the article
        self.btn_sav = sh.Button(parent=self.frm_btn,
                                 text=_('Save'),
                                 hint=_('Save the current article'),
                                 inactive=self.icn_sav,
                                 active=self.icn_sav)
        # A button to open the current article in a browser
        self.btn_brw = sh.Button(
            parent=self.frm_btn,
            text=_('Browse'),
            hint=_('Open the current article in a browser'),
            inactive=self.icn_brw,
            active=self.icn_brw)
        # A button to print the article
        self.btn_prn = sh.Button(parent=self.frm_btn,
                                 text=_('Print'),
                                 hint=_('Create a print-ready preview'),
                                 inactive=self.icn_prn,
                                 active=self.icn_prn)
        # A button to define a term
        self.btn_def = sh.Button(parent=self.frm_btn,
                                 text=_('Define'),
                                 hint=_('Define the current term'),
                                 inactive=self.icn_def,
                                 active=self.icn_def)
        # A button to toggle capturing Ctrl-c-c and Ctrl-Ins-Ins
        self.btn_cap = sh.Button(parent=self.frm_btn,
                                 text=_('Clipboard'),
                                 hint=_('Capture Ctrl-c-c and Ctrl-Ins-Ins'),
                                 inactive=self.icn_cp0,
                                 active=self.icn_cp1,
                                 fg='red')
        # A button to show info about the program
        self.btn_abt = sh.Button(parent=self.frm_btn,
                                 text=_('About'),
                                 hint=_('View About'),
                                 inactive=self.icn_abt,
                                 active=self.icn_abt)
        # A button to quit the program
        self.btn_qit = sh.Button(parent=self.frm_btn,
                                 text=_('Quit'),
                                 hint=_('Quit the program'),
                                 action=self.close,
                                 inactive=self.icn_qit,
                                 active=self.icn_qit,
                                 side='right')
Esempio n. 15
0
 def set_buttons(self):
     self.btn_lft = sh.Button(parent=self.frm_cnt,
                              hint=_('Prioritize selection on the right'),
                              inactive=icn_lft,
                              active=icn_lft,
                              text='←',
                              side='top',
                              expand=0,
                              hdir='bottom')
     self.btn_rht = sh.Button(parent=self.frm_cnt,
                              hint=_('Unprioritize selection on the left'),
                              inactive=icn_rht,
                              active=icn_rht,
                              text='→',
                              side='top',
                              expand=0,
                              hdir='bottom')
     self.btn_grp = sh.Button(parent=self.frm_cnt,
                              hint=_('Prioritize related subjects'),
                              inactive=icn_grp,
                              active=icn_grp,
                              text='⟸',
                              side='top',
                              expand=0,
                              hdir='bottom')
     self.btn_gru = sh.Button(parent=self.frm_cnt,
                              hint=_('Unprioritize related subjects'),
                              inactive=icn_gru,
                              active=icn_gru,
                              text='⇒',
                              side='top',
                              expand=0,
                              hdir='bottom')
     self.btn_up1 = sh.Button(parent=self.frm_cnt,
                              hint=_('Increase priority'),
                              inactive=icn_up1,
                              active=icn_up1,
                              text='↑',
                              side='top',
                              expand=0,
                              hdir='bottom')
     self.btn_dwn = sh.Button(parent=self.frm_cnt,
                              hint=_('Decrease priority'),
                              inactive=icn_dwn,
                              active=icn_dwn,
                              text='↓',
                              side='top',
                              expand=0,
                              hdir='bottom')
     self.btn_top = sh.Button(parent=self.frm_cnt,
                              hint=_('Move to the top'),
                              inactive=icn_top,
                              active=icn_top,
                              text='↑↑',
                              side='top',
                              expand=0,
                              hdir='bottom')
     self.btn_btm = sh.Button(parent=self.frm_cnt,
                              hint=_('Move to the bottom'),
                              inactive=icn_btm,
                              active=icn_btm,
                              text='↓↓',
                              side='top',
                              expand=0,
                              hdir='bottom')
     self.btn_clr = sh.Button(parent=self.frm_cnt,
                              hint=_('Clear selection in both panes'),
                              inactive=icn_clr,
                              active=icn_clr,
                              text=_('Clear'),
                              side='top',
                              expand=0,
                              hdir='bottom')
     self.btn_rld = sh.Button(parent=self.frm_cnt,
                              text=_('Reload'),
                              hint=_('Reload settings'),
                              inactive=icn_rld,
                              active=icn_rld,
                              expand=0,
                              side='top',
                              hdir='bottom')
     self.btn_cls = sh.Button(parent=self.frm_bm1,
                              text=_('Close'),
                              hint=_('Close this window'),
                              expand=0,
                              side='left',
                              hdir='top')
     self.btn_all = sh.Button(parent=self.frm_bm3,
                              text=_('All'),
                              hint=_('Show all subjects'),
                              expand=0,
                              side='left',
                              hdir='top')
     self.btn_mjr = sh.Button(parent=self.frm_bm3,
                              text=_('Main'),
                              hint=_('Show main subjects'),
                              expand=0,
                              side='left',
                              hdir='top')
     self.btn_art = sh.Button(
         parent=self.frm_bm3,
         text=_('From the article'),
         hint=_('Show subjects from the current article'),
         expand=0,
         side='right',
         hdir='top')