def __init__(self,parent): wx.wizard.PyWizardPage.__init__(self,parent) self.sizer = wx.BoxSizer(wx.VERTICAL) self.sizer = wx.GridBagSizer(1,1) self.cbAutoOCR = wx.CheckBox(self,-1,_('Automatically proceed to OCR when a new document is added to the database')) self.clOcrProgs = wx.CheckListBox(self,-1,style=wx.LB_EXTENDED) self.clSpellProgs = wx.CheckListBox(self,-1,style=wx.LB_EXTENDED) ocrConf = database.theConfig.get_ocr_configuration() self.clOcrProgs.AppendItems(ocrConf.get_available_ocr_programs()) self.clSpellProgs.AppendItems(get_available_languages()) self.sizer.Add(self.cbAutoOCR,(0,0),span=(1,6),flag=wx.ALL|wx.EXPAND) self.sizer.Add(wx.StaticText(self,-1,_("OCR programs to use")),(1,0),span=(1,3),flag=wx.ALL|wx.EXPAND) self.sizer.Add(wx.StaticText(self,-1,_("OCR Checking languages")),(1,3),span=(1,3),flag=wx.ALL|wx.EXPAND) self.sizer.Add(self.clOcrProgs,(2,0),span=(1,3),flag=wx.ALL|wx.EXPAND) self.sizer.Add(self.clSpellProgs,(2,3),span=(1,3),flag=wx.ALL|wx.EXPAND) self.sizer.AddGrowableCol(0) self.sizer.AddGrowableCol(5) self.sizer.AddGrowableRow(2) self.actionLoad() self.SetSizer(self.sizer)
def __init__(self,parent,page_id,name): wx.NotebookPage.__init__(self,parent,page_id,name=name) self.panel = wx.Panel(self, -1) self.sizer = wx.GridBagSizer(1,1) self.cbAutoOCR = wx.CheckBox(self.panel,-1,_('Automatically proceed to OCR when a new document is added to the database')) self.clOcrProgs = wx.CheckListBox(self.panel,-1,style=wx.LB_EXTENDED) self.clSpellProgs = wx.CheckListBox(self.panel,-1,style=wx.LB_EXTENDED) #self.btOcrUp = wx.BitmapButton(self.panel,-1,wx.Bitmap(Resources.get_icon_filename('BT_UP'))) #self.btOcrDown = wx.BitmapButton(self.panel,-1,wx.Bitmap(Resources.get_icon_filename('BT_DOWN'))) #self.btSpellUp = wx.BitmapButton(self.panel,-1,wx.Bitmap(Resources.get_icon_filename('BT_UP'))) #self.btSpellDown = wx.BitmapButton(self.panel,-1,wx.Bitmap(Resources.get_icon_filename('BT_DOWN'))) ocrConf = theConfig.get_ocr_configuration() self.clOcrProgs.AppendItems(ocrConf.get_available_ocr_programs()) self.clSpellProgs.AppendItems(get_available_languages()) # all_sects = ocrConf.get_available_ocr_programs() # needed_ext = set() # for i in all_sects : needed_ext.add(ocrConf.get_needed_image_format(i)) # print needed_ext # for i in all_sects : print ocrConf.build_call_sequence(i, 'toto.'+ocrConf.get_needed_image_format(i), 'toto.txt') self.sizer.Add(self.cbAutoOCR,(0,0),span=(1,6),flag=wx.ALL|wx.EXPAND) self.sizer.Add(wx.StaticText(self.panel,-1,_("OCR programs to use")),(1,0),span=(1,3),flag=wx.ALL|wx.EXPAND) self.sizer.Add(wx.StaticText(self.panel,-1,_("OCR Checking languages")),(1,3),span=(1,3),flag=wx.ALL|wx.EXPAND) self.sizer.Add(self.clOcrProgs,(2,0),span=(1,3),flag=wx.ALL|wx.EXPAND) self.sizer.Add(self.clSpellProgs,(2,3),span=(1,3),flag=wx.ALL|wx.EXPAND) #self.sizer.Add(self.btOcrUp,(3,1),flag=wx.CENTER) #self.sizer.Add(self.btOcrDown,(3,2),flag=wx.CENTER) #self.sizer.Add(self.btSpellUp,(3,4),flag=wx.CENTER) #self.sizer.Add(self.btSpellDown,(3,5),flag=wx.CENTER) self.sizer.AddGrowableCol(0) self.sizer.AddGrowableCol(5) self.sizer.AddGrowableRow(2) self.actionLoad() self.panel.SetSizerAndFit(self.sizer)