X-Git-Url: http://iramuteq.org/git?p=iramuteq;a=blobdiff_plain;f=guifunct.py;h=67538dcced71b8a20abf2b6b73c2b18155ecf4b1;hp=696c7ff868fd44d86419be79038dcb798e88f9db;hb=cda523e0d21bd5b05802643fcf83463db95d1da1;hpb=b5c60c0bc62747f2256137641d239e2edcbe506b;ds=sidebyside diff --git a/guifunct.py b/guifunct.py index 696c7ff..67538dc 100644 --- a/guifunct.py +++ b/guifunct.py @@ -58,6 +58,7 @@ def get_table_param(self, filename) : if self.tableau.parametres['colsep'] == 'tabulation' : self.tableau.parametres['colsep'] = '\t' self.tableau.parametres['filetype'] = 'csv' + self.tableau.parametres['encodage'] = dlg.le[dlg.list_encodages.GetSelection()] elif getfileextension(filename) == '.xls' : dlg = dialog.FileOptionDialog(self, -1, _(u"File format").decode('utf8'), sep=False, sheet = True, size=(350, 200), style=wx.DEFAULT_DIALOG_STYLE) @@ -169,7 +170,16 @@ class PrefSimi ( wx.Dialog ): if wordlist is not None : self.listcol = ListForSpec(self, self, wordlist, ['eff']) self.listcol.SetMinSize( wx.Size( 270,-1 ) ) - bSizer16.Add( self.listcol, 0, wx.ALL|wx.EXPAND, 5 ) + listsizer = wx.BoxSizer( wx.VERTICAL ) + countsizer = wx.BoxSizer( wx.HORIZONTAL ) + self.butcount = wx.Button(self, -1, "count") + self.textcount = wx.TextCtrl(self, -1, "", wx.DefaultPosition, wx.Size( 100,-1 ), wx.TE_READONLY ) + countsizer.Add(self.butcount, 0, wx.ALL, 5) + countsizer.Add(self.textcount, 0, wx.ALL, 5 ) + listsizer.Add(countsizer, 0, wx.ALL, 5) + listsizer.Add(self.listcol, 2, wx.ALL|wx.EXPAND, 5 ) + #bSizer16.Add( self.listcol, 0, wx.ALL|wx.EXPAND, 5 ) + bSizer16.Add( listsizer, 0, wx.ALL|wx.EXPAND, 5) if selected is None : for row in xrange(self.listcol.GetItemCount()): self.listcol.Select(row) @@ -725,6 +735,11 @@ class PrefSimi ( wx.Dialog ): self.checki.Bind( wx.EVT_CHECKBOX, self.OnChecki ) self.check_vcex.Bind( wx.EVT_CHECKBOX, self.OnCheck_vcex ) self.check_s_size.Bind( wx.EVT_CHECKBOX, self.OnCheck_s_size ) + self.listcol.Bind( wx.EVT_LIST_ITEM_SELECTED, self.ChangeCount) + self.listcol.Bind( wx.EVT_LIST_ITEM_DESELECTED, self.ChangeCount) + self.butcount.Bind( wx.EVT_BUTTON, self.ChangeCount) + self.ChangeCount(wx.EVT_BUTTON) + def __set_properties(self): self.choice1.SetSelection(self.paramsimi['coeff']) @@ -772,6 +787,9 @@ class PrefSimi ( wx.Dialog ): self.comcheck.SetValue(self.paramsimi['com']) self.choix_com.SetSelection(self.paramsimi['communities']) self.halo.SetValue(self.paramsimi['halo']) + + def ChangeCount(self, evt) : + self.textcount.SetValue('%i' % self.listcol.GetSelectedItemCount()) def OnCheck_s_size(self, evt): if self.check_s_size.GetValue() : @@ -950,7 +968,6 @@ class PrepSimi : param['cexfromchi'] = self.dial.checkit.GetValue() if 'sfromchi' in self.parametres : param['sfromchi'] = self.dial.checki.GetValue() - print param if 'vlabcolor' in self.parametres : param['vlabcolor'] = self.parametres['vlabcolor'] if 'check_bystar' in dir(self.dial) : @@ -1054,7 +1071,7 @@ class CreateTgenDialog ( wx.Frame ): class TGenFrame ( wx.Frame ): def __init__( self, parent, corpus, Tgen ): - wx.Frame.__init__ ( self, parent, id = wx.ID_ANY, title = u"Tgen", pos = wx.DefaultPosition, size = wx.Size( 473,434 ), style = wx.DEFAULT_FRAME_STYLE|wx.TAB_TRAVERSAL|wx.FRAME_FLOAT_ON_PARENT|wx.STAY_ON_TOP ) + wx.Frame.__init__ ( self, parent, id = wx.ID_ANY, title = u"Tgen", pos = wx.DefaultPosition, size = wx.Size( 600,434 ), style = wx.DEFAULT_FRAME_STYLE|wx.TAB_TRAVERSAL|wx.FRAME_FLOAT_ON_PARENT|wx.STAY_ON_TOP ) self.Tgen = Tgen self.parent = parent @@ -1100,7 +1117,7 @@ class TGenFrame ( wx.Frame ): fgSizer2.Add( self.but_del, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 ) - fgSizer1.Add( fgSizer2, 1, wx.EXPAND, 5 ) + fgSizer1.Add( fgSizer2, 0, wx.EXPAND, 5 ) fgSizer3 = wx.FlexGridSizer( 0, 2, 0, 0 ) fgSizer3.SetFlexibleDirection( wx.BOTH ) @@ -1111,7 +1128,7 @@ class TGenFrame ( wx.Frame ): self.but_compute = wx.Button( self, wx.ID_ANY, u"Compute", wx.DefaultPosition, wx.DefaultSize, 0 ) fgSizer3.Add( self.but_compute, 1, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 ) - fgSizer1.Add( fgSizer3, 1, wx.EXPAND, 5 ) + fgSizer1.Add( fgSizer3, 0, wx.EXPAND, 5 ) bSizer1.Add( fgSizer1, 1, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )