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)) {
#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))
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):
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):
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 ):
# 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 ):
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)
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'))