-class FreqDialog(wx.Dialog):
- def __init__(
- self, parent, ID, title, size=wx.DefaultSize, pos=wx.DefaultPosition,
- style=wx.DEFAULT_DIALOG_STYLE | wx.CANCEL | wx.OK
- ):
- pre = wx.PreDialog()
- pre.SetExtraStyle(wx.DIALOG_EX_CONTEXTHELP)
- pre.Create(parent, ID, title, pos, size, style)
- self.PostCreate(pre)
- self.parent = parent
- sizer = wx.BoxSizer(wx.VERTICAL)
- self.content = parent.content
- self.header = parent.tableau.get_colnames()
- LABELLIST = []
- for i in self.header:
- forme = i
- if len(forme) > 60 :
- LABELLIST.append(i[0:60])
- else:
- LABELLIST.append(i)
- self.list_box_1 = wx.ListBox(self, -1, choices=LABELLIST, style=wx.LB_EXTENDED | wx.LB_HSCROLL)
- sizer.Add(self.list_box_1, 0, 5)
-
- btnsizer = wx.BoxSizer(wx.HORIZONTAL)
-
- btn = wx.Button(self, wx.ID_CANCEL)
- btn.SetHelpText("Annuler")
- btnsizer.Add(btn)
-
- btn = wx.Button(self, wx.ID_OK)
- btn.SetHelpText("Valider")
- btn.SetDefault()
- btnsizer.Add(btn)
-
- sizer.Add(btnsizer, 0, wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_CENTER_HORIZONTAL, 5)
- self.SetSizer(sizer)
- sizer.Fit(self)
- self.SetTitle(u"Sélection")
-
- # end wxGlade
-
-class Frequences():
- def __init__(self, parent):
- #self.Filename = parent.filename
- self.fileforR = parent.tableau.parametre['csvfile']
- self.TEMPDIR = parent.TEMPDIR
- self.num = parent.FreqNum
- self.DICTFILE = {}
- self.RPath = parent.PathPath.get('PATHS', 'rpath')
- self.parent=parent
- dlg = FreqDialog(parent, -1, u"Fréquences", size=(350, 200),
- style=wx.DEFAULT_DIALOG_STYLE)
- dlg.CenterOnParent()
- val = dlg.ShowModal()
- if val == wx.ID_OK :
- ColSel = dlg.list_box_1.GetSelections()
- self.header=dlg.header
- dlg.Destroy()
- listfileout = self.ShowFreq(ColSel)
- parent.FreqNum += 1
- parent.DictTab[u"Fréquences_%s*" % parent.FreqNum] = listfileout
- parent.FileTabList.append(listfileout)
- parent.newtab = wx.html.HtmlWindow(parent.nb, -1)
- if "gtk2" in wx.PlatformInfo:
- parent.newtab.SetStandardFonts()
- parent.newtab.LoadPage(listfileout[len(listfileout) - 1])
- parent.nb.AddPage(parent.newtab, u"Fréquences_%s*" % parent.FreqNum)
- parent.nb.SetSelection(parent.nb.GetPageCount() - 1)
- parent.ShowAPane("Tab_content")
- parent.DisEnSaveTabAs(True)