...
authorPierre Ratinaud <ratinaud@univ-tlse2.fr>
Thu, 11 Dec 2014 22:50:11 +0000 (23:50 +0100)
committerPierre Ratinaud <ratinaud@univ-tlse2.fr>
Thu, 11 Dec 2014 22:50:11 +0000 (23:50 +0100)
Rscripts/simi.R
dialog.py
iramuteq.py

index bd772c2..48b871d 100644 (file)
@@ -222,7 +222,7 @@ do.simi <- function(x, method = 'cooc',seuil = NULL, p.type = 'tkplot',layout.ty
        out <- list(graph = g.toplot, mat.eff = mat.eff, eff = eff, mat = mat.simi, v.label = v.label, we.width = we.width, we.label=we.label, label.cex = label.cex, layout = lo, communities = com, halo = halo, elim=vec)
 }
        
-plot.simi <- function(graph.simi, p.type = 'tkplot',filename=NULL, communities = NULL, vertex.col = 'red', edge.col = 'black', edge.label = TRUE, vertex.label=TRUE, vertex.label.color = 'black', vertex.label.cex= NULL, vertex.size=NULL, leg=NULL, width = 800, height = 800, alpha = 0.1, cexalpha = FALSE, movie = NULL, edge.curved = TRUE, svg = FALSE) {
+plot.simi <- function(graph.simi, p.type = 'tkplot',filename=NULL, communities = NULL, vertex.col = 'red', edge.col = 'black', edge.label = TRUE, vertex.label=TRUE, vertex.label.color = 'black', vertex.label.cex= NULL, vertex.size=NULL, leg=NULL, width = 800, height = 800, alpha = 0.1, cexalpha = FALSE, movie = NULL, edge.curved = TRUE, svg = FALSE, bg='white') {
        mat.simi <- graph.simi$mat
        g.toplot <- graph.simi$graph
     if (is.null(vertex.size)) {
@@ -266,6 +266,7 @@ plot.simi <- function(graph.simi, p.type = 'tkplot',filename=NULL, communities =
         #print('ATTENTION - PAS OPEN FILE')
         open_file_graph(filename, width = width, height = height, svg = svg)
         par(mar=c(2,2,2,2))
+        par(bg=bg)
         if (!is.null(leg)) {
             layout(matrix(c(1,2),1,2, byrow=TRUE),widths=c(3,lcm(7)))
             par(mar=c(2,2,1,0))
index 66a427a..17a0025 100755 (executable)
--- a/dialog.py
+++ b/dialog.py
@@ -2237,8 +2237,10 @@ class ChiDialog(wx.Dialog):
         self.__set_properties()
         self.__do_layout()
 
-        self.Bind(wx.EVT_LISTBOX, self.Select1, self.list_box_1)
+        self.Bind(wx.EVT_LISTBOX, self.selchange, self.list_box_1)
+        self.Bind(wx.EVT_LISTBOX, self.selchange, self.list_box_2)
         self.Bind(wx.EVT_BUTTON, self.onparam, self.button_pref)
+        self.button_1.Enable(False)
         # end wxGlade
 #-------------------------------
     def __set_properties(self):
@@ -2264,8 +2266,11 @@ class ChiDialog(wx.Dialog):
         self.Layout()
         # end wxGlade
 
-    def Select1(self, event): # wxGlade: ConfChi2.<event_handler>
-        event.Skip()
+    def selchange(self, event): # wxGlade: ConfChi2.<event_handler>
+        if (len(self.list_box_1.GetSelections()) == 0) or (len(self.list_box_2.GetSelections()) == 0) :
+            self.button_1.Enable(False)
+        else :
+            self.button_1.Enable(True)
     
     
     def onparam(self,event):
@@ -2851,11 +2856,17 @@ class FreqDialog ( wx.Dialog ):
         bSizer1.Fit( self )
         
         self.Centre( wx.BOTH )
+        self.Bind(wx.EVT_LISTBOX, self.selchange, self.m_listBox1)
+        self.m_sdbSizer1OK.Enable(False)
     
     def __del__( self ):
         pass
     
-
+    def selchange(self, evt):
+        if len(self.m_listBox1.GetSelections()) == 0 :
+            self.m_sdbSizer1OK.Enable(False)
+        else :
+            self.m_sdbSizer1OK.Enable(True)
 
 class ProtoDial ( wx.Dialog ):
     
@@ -2973,10 +2984,20 @@ class ProtoDial ( wx.Dialog ):
         # Connect Events
         self.choix_freq.Bind( wx.EVT_CHOICE, self.UpdateText )
         self.choix_rang.Bind( wx.EVT_CHOICE, self.UpdateText )
+        self.Bind(wx.EVT_LISTBOX, self.selchange, self.variables)
+        self.Bind(wx.EVT_LISTBOX, self.selchange, self.rangs)
+        
+        self.m_sdbSizer1OK.Enable(False)
     
     def __del__( self ):
         pass
     
+    def selchange(self, evt):
+        if (len(self.variables.GetSelections()) == 0) or (len(self.rangs.GetSelections()) == 0) or (len(self.variables.GetSelections()) != len(self.rangs.GetSelections())) :
+            self.m_sdbSizer1OK.Enable(False)
+        else :
+            self.m_sdbSizer1OK.Enable(True)
+    
     
     # Virtual event handlers, overide them in your derived class
     def UpdateText( self, event ):
index 157c0d6..29e284b 100644 (file)
@@ -242,7 +242,7 @@ class IraFrame(wx.Frame):
         file_menu.AppendItem(item)
         
         item = wx.MenuItem(file_menu, ID_OnOpenAnalyse, _(u"Open an analysis").decode('utf8'), _(u"Open an analysis").decode('utf8'))
-        item.SetBitmap(wx.ArtProvider_GetBitmap(wx.ART_FILE_OPEN))
+        item.SetBitmap(wx.ArtProvider_GetBitmap(wx.ART_FILE_OPEN, size = (16,16)))
         file_menu.AppendItem(item)
 
         
@@ -283,7 +283,10 @@ class IraFrame(wx.Frame):
         file_menu.Append(wx.ID_EXIT, _(u"Exit").decode('utf8'))
         
         edit_menu = wx.Menu()
-        edit_menu.Append(wx.ID_PREFERENCES, _(u'Preferences').decode('utf8'))
+        pref = wx.MenuItem(edit_menu, wx.ID_PREFERENCES, _(u'Preferences').decode('utf8'))
+        pref.SetBitmap(wx.ArtProvider_GetBitmap(wx.ART_HELP_SETTINGS, size = (16,16)))
+        edit_menu.AppendItem(pref)
+        #edit_menu.Append(wx.ID_PREFERENCES, _(u'Preferences').decode('utf8'))
         
         view_menu = wx.Menu()
         view_menu.Append(ID_ACCEUIL, _(u"Home page").decode('utf8'))