Ejemplo n.º 1
0
 def set_entries(self):
     self.ent_lgn = sh.Entry (parent = self.frm_rht
                             ,side = 'top'
                             ,ClearAll = True
                             )
     self.ent_pwd = sh.Entry (parent = self.frm_rht
                             ,side = 'bottom'
                             ,ClearAll = True
                             ,Password = True
                             )
Ejemplo n.º 2
0
 def set_frame_panel(self):
     ''' Do not mix 'self.frm_pnl' and 'self.frm_btm', otherwise,
         they may overlap each other.
     '''
     self.frm_pnl = sh.Frame(parent=self.frm_btm, expand=0, fill='x')
     # Canvas should be created within a frame
     self.cvs_prm = sh.Canvas(parent=self.frm_pnl, expand=0)
     self.frm_btn = sh.Frame(parent=self.frm_pnl, expand=0)
     # A search entry field
     self.ent_src = sh.Entry(parent=self.frm_btn, side='left', ipady=5)
     self.set_buttons()
     self.cvs_prm.embed(obj=self.frm_btn)
     ''' #TODO: Updating idletasks will show the AllDic 'Please wait'
         message for too long, however, we need to update in order to
         set canvas dimensions correctly.
     '''
     sh.objs.get_root().update_idle()
     height = self.frm_btn.get_height()
     width = self.frm_btn.get_width()
     self.cvs_prm.widget.config(width=self.obj.get_resolution()[0])
     self.cvs_prm.widget.config(height=height)
     x2 = (width / 2)
     x1 = -x2
     y2 = (height / 2)
     y1 = -y2
     self.cvs_prm.widget.config(scrollregion=(x1, y1, x2, y2))
     # The scrollbar is set at the end for some reason
     self.cvs_prm.widget.xview_moveto(0)
Ejemplo n.º 3
0
 def search_tracks(self):
     self.ent_sr2 = sh.Entry (parent = self.frm
                             ,side = 'left'
                             )
     sh.ToolTip (obj = self.ent_sr2
                ,text = _('Search in tracks')
                ,hdir = 'bottom'
                )
Ejemplo n.º 4
0
 def search_ids(self):
     self.ent_ids = sh.Entry (parent = self.frm
                             ,side = 'left'
                             ,width = 5
                             )
     sh.ToolTip (obj = self.ent_ids
                ,text = _('Search an album by ID')
                ,hdir = 'bottom'
                )
Ejemplo n.º 5
0
 def set_limit(self):
     self.lbl_lim = sh.Label (parent = self.frm_lim
                             ,text = _('Limit:')
                             ,side = 'left'
                             ,width = self.width
                             )
     self.ent_lim = sh.Entry (parent = self.frm_lim
                             ,side = 'left'
                             ,width = 5
                             )
     self.ent_lim.insert(100)
Ejemplo n.º 6
0
 def set_year(self):
     self.lbl_yer = sh.Label (parent = self.frm_yer
                             ,text = _('Year:')
                             ,side = 'left'
                             ,fill = None
                             ,expand = False
                             ,width = self.width
                             )
     self.opt_yer = sh.OptionMenu (parent = self.frm_yer
                                  ,items = ITEMS_YEAR
                                  ,side = 'left'
                                  ,default = _('Not set')
                                  )
     self.ent_yer = sh.Entry (parent = self.frm_yer
                             ,side = 'left'
                             ,fill = None
                             ,expand = None
                             ,width = 4
                             )
Ejemplo n.º 7
0
 def set_widgets(self):
     message = _(
         'Enter a word to guess. Use a question mark, a dot or an underscore to set a missing character.'
     )
     message = list(message)
     for i in range(len(message)):
         if i % 50 == 0:
             message.insert(i, '\n')
     message = ''.join(message)
     self.lbl1 = sh.Label(parent=self.frm1, text=message, expand=True)
     self.ent1 = sh.Entry(parent=self.frm1, expand=True, fill='x')
     self.lbl2 = sh.Label(parent=self.frm1,
                          text=_('Guessed words:'),
                          expand=True)
     self.cvs = sh.Canvas(parent=self.frm2, expand=False)
     self.frme = sh.Frame(parent=self.frm2, expand=False)
     self.cvs.embed(self.frme)
     self.lbl3 = sh.Label(parent=self.frme,
                          text=_('No match'),
                          expand=False)
     self.ent1.focus()
Ejemplo n.º 8
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'
                )
Ejemplo n.º 9
0
 def set_entries(self):
     if self.Extended:
         self.ent_aid = sh.Entry (parent = self.frm_rht
                                 ,expand = True
                                 ,fill = 'x'
                                 ,ipady = 1
                                 )
     self.ent_tno = sh.Entry (parent = self.frm_rht
                             ,expand = True
                             ,fill = 'x'
                             ,ipady = 1
                             )
     self.ent_tit = sh.Entry (parent = self.frm_rht
                             ,expand = True
                             ,fill = 'x'
                             ,ipady = 1
                             )
     self.ent_lyr = sh.Entry (parent = self.frm_rht
                             ,expand = True
                             ,fill = 'x'
                             ,ipady = 1
                             )
     self.ent_com = sh.Entry (parent = self.frm_rht
                             ,expand = True
                             ,fill = 'x'
                             ,ipady = 1
                             )
     self.ent_bit = sh.Entry (parent = self.frm_rht
                             ,expand = True
                             ,fill = 'x'
                             ,ipady = 1
                             )
     self.ent_len = sh.Entry (parent = self.frm_rht
                             ,expand = True
                             ,fill = 'x'
                             ,ipady = 1
                             )
Ejemplo n.º 10
0
 def set_entries(self):
     self.ent_art = sh.Entry (parent = self.frm_rht
                             ,expand = True
                             ,fill = 'x'
                             ,ipady = 1
                             )
     self.ent_alb = sh.Entry (parent = self.frm_rht
                             ,expand = True
                             ,fill = 'x'
                             ,ipady = 1
                             )
     self.ent_yer = sh.Entry (parent = self.frm_rht
                             ,expand = True
                             ,ipady = 1
                             ,fill = 'both'
                             )
     self.ent_cnt = sh.Entry (parent = self.frm_rht
                             ,expand = True
                             ,ipady = 1
                             ,fill = 'both'
                             )
     self.ent_com = sh.Entry (parent = self.frm_rht
                             ,expand = True
                             ,fill = 'x'
                             ,ipady = 1
                             )
     self.ent_bit = sh.Entry (parent = self.frm_rht
                             ,expand = True
                             ,fill = 'x'
                             ,ipady = 1
                           )
     self.ent_len = sh.Entry (parent = self.frm_rht
                             ,expand = True
                             ,fill = 'x'
                             ,ipady = 1
                             )
Ejemplo n.º 11
0
 def set_labels(self):
     ''' Other possible color schemes:
         font = 'Sans 9 italic', fg = 'khaki4'
     '''
     sh.Label(parent=self.frm_scm,
              text=_('Style:'),
              font='Sans 9',
              side='top',
              fill='both',
              expand=True,
              fg='PaleTurquoise1',
              bg='RoyalBlue3')
     sh.Label(parent=self.frm_cl1,
              text=_('Column') + ' 1:',
              font='Sans 9',
              side='top',
              fill='both',
              expand=True,
              fg='PaleTurquoise1',
              bg='RoyalBlue3')
     sh.Label(parent=self.frm_cl2,
              text=_('Column') + ' 2:',
              font='Sans 9',
              side='top',
              fill='both',
              expand=True,
              fg='PaleTurquoise1',
              bg='RoyalBlue3')
     sh.Label(parent=self.frm_cl3,
              text=_('Column') + ' 3:',
              font='Sans 9',
              side='top',
              fill='both',
              expand=True,
              fg='PaleTurquoise1',
              bg='RoyalBlue3')
     sh.Label(parent=self.frm_cl4,
              text=_('Column') + ' 4:',
              font='Sans 9',
              side='top',
              fill='both',
              expand=True,
              fg='PaleTurquoise1',
              bg='RoyalBlue3')
     self.lbl_no1 = sh.Label(
         parent=self.frm_cb1,
         text=
         _('Sort by each column (if it is set, except for transcription) and order parts of speech'
           ),
         side='left')
     self.lbl_no2 = sh.Label(parent=self.frm_cb2,
                             text=_('Alphabetize terms'),
                             side='left')
     self.lbl_no3 = sh.Label(parent=self.frm_cb3,
                             text=_('Block subjects from blacklist'),
                             side='left')
     self.lbl_no4 = sh.Label(parent=self.frm_cb4,
                             text=_('Prioritize subjects'),
                             side='left')
     self.lbl_no5 = sh.Label(parent=self.frm_cb5,
                             text=_('Vertical view'),
                             side='left')
     self.lbl_no6 = sh.Label(parent=self.frm_cb6,
                             text=_('Shorten subject titles'),
                             side='left')
     self.lbl_no7 = sh.Label(parent=self.frm_cb7,
                             text=_('Shorten parts of speech'),
                             side='left')
     self.lbl_no8 = sh.Label(parent=self.frm_cb8,
                             text=_('Show user names'),
                             side='left')
     self.lbl_no9 = sh.Label(parent=self.frm_cb9,
                             text=_('Select terms only'),
                             side='left')
     self.lbl_no10 = sh.Label(
         parent=self.frm_cb10,
         text=_('Iconify the program window after copying'),
         side='left')
     self.lbl_no11 = sh.Label(parent=self.frm_cb11,
                              text=_('Show suggestions on input'),
                              side='left')
     self.lbl_no12 = sh.Label(
         parent=self.frm_cb12,
         text=_('Autoswap Russian and the other language if appropriate'),
         side='left')
     self.lbl_no13 = sh.Label(parent=self.frm_cb13,
                              text=_('Show a phrase count'),
                              side='left')
     self.lbl_no14 = sh.Label(parent=self.frm_cb14,
                              text=_('Adjust columns by width'),
                              side='left')
     self.lbl_no15 = sh.Label(parent=self.frm_cb15,
                              text=_('Use a custom table width:'),
                              side='left')
     self.ent_tab = sh.Entry(parent=self.frm_cb15, side='left', width=3)
     self.lbl_prc = sh.Label(parent=self.frm_cb15, text='%', side='left')
     sh.Label(parent=self.frm_sp1,
              text=_('Part of speech') + ' 1:',
              font='Sans 8',
              side='top',
              fill='both',
              expand=True,
              fg='PaleTurquoise1',
              bg='RoyalBlue3')
     sh.Label(parent=self.frm_sp2,
              text=_('Part of speech') + ' 2:',
              font='Sans 8',
              side='top',
              fill='both',
              expand=True,
              fg='PaleTurquoise1',
              bg='RoyalBlue3')
     sh.Label(parent=self.frm_sp3,
              text=_('Part of speech') + ' 3:',
              font='Sans 8',
              side='top',
              fill='both',
              expand=True,
              fg='PaleTurquoise1',
              bg='RoyalBlue3')
     sh.Label(parent=self.frm_sp4,
              text=_('Part of speech') + ' 4:',
              font='Sans 8',
              side='top',
              fill='both',
              expand=True,
              fg='PaleTurquoise1',
              bg='RoyalBlue3')
     sh.Label(parent=self.frm_sp5,
              text=_('Part of speech') + ' 5:',
              font='Sans 8',
              side='top',
              fill='both',
              expand=True,
              fg='PaleTurquoise1',
              bg='RoyalBlue3')
     sh.Label(parent=self.frm_sp6,
              text=_('Part of speech') + ' 6:',
              font='Sans 8',
              side='top',
              fill='both',
              expand=True,
              fg='PaleTurquoise1',
              bg='RoyalBlue3')
     sh.Label(parent=self.frm_sp7,
              text=_('Part of speech') + ' 7:',
              font='Sans 8',
              side='top',
              fill='both',
              expand=True,
              fg='PaleTurquoise1',
              bg='RoyalBlue3')