def __init__(self, parent, data): AeroPage.__init__(self, parent, u"¡No hay problema!") instrucciones = AeroStaticText(self, -1, u"Solución del problema:") self.content.Add(instrucciones, 0, wx.BOTTOM, 10) self.red_residual = None self.panel_vista_previa = scrolledpanel.ScrolledPanel(self, -1, size=(650,300)) self.panel_vista_previa.SetBackgroundColour("#000000") self.bitmap_grafo = wx.StaticBitmap(self.panel_vista_previa, -1) self.panel_vista_previa.SetAutoLayout(1) self.panel_vista_previa.SetBackgroundColour(wx.WHITE) self.panel_vista_previa.SetSizer(wx.BoxSizer(wx.VERTICAL)) self.panel_vista_previa.GetSizer().Add(self.bitmap_grafo, 1, wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_CENTER_VERTICAL) self.content.Add(self.panel_vista_previa, 1, wx.EXPAND | wx.BOTTOM, 20) # botones bmps = [wx.Bitmap("ui/img/media-"+x, wx.BITMAP_TYPE_PNG) for x in ["skip-backward.png", "playback-start.png", "playback-pause.png", "skip-forward.png"]] buttons = [wx.BitmapButton(self, -1, bmp, (-1,-1),(bmp.GetWidth() + 20, bmp.GetHeight() + 10)) for bmp in bmps] #bmp_play = wx.Bitmap("ui/img/media-playback-start.png", wx.BITMAP_TYPE_PNG) #b = wx.BitmapButton(self, -1, bmp_play, (-1,-1),(bmp_play.GetWidth() + 10, bmp_play.GetHeight() + 10)) #self.content.Add(b) hb = wx.BoxSizer(wx.HORIZONTAL) #hb.AddMany([b for b in buttons]) for b in buttons: hb.Add(b, 0, wx.ALIGN_CENTER_VERTICAL, 0) b.Show(False) self.slider_tiempo = wx.Slider(self, -1, 0, 0, 15, style = wx.SL_HORIZONTAL | wx.SL_AUTOTICKS) self.Bind(EVT_SLIDER, self.OnTick, self.slider_tiempo) hb.Add(self.slider_tiempo, 1, wx.EXPAND, 0) self.content.Add(hb, 0, wx.EXPAND | wx.BOTTOM, 20)
def __init__(self, parent, data): AeroPage.__init__(self, parent, u"Defina la red") instrucciones = AeroStaticText( self, -1, u"Indique la cantidad de nodos que tendrá la red y los arcos que hay entre ellos." ) self.content.Add(instrucciones, 0, wx.BOTTOM, 10) # cantidad de nodos hb = wx.BoxSizer(wx.HORIZONTAL) l = wx.StaticText(self, -1, u"Nodos:") hb.Add(l, 0, wx.ALIGN_CENTER_VERTICAL, 0) self.cantidad_nodos = wx.SpinCtrl(self, -1, "3") self.cantidad_nodos.SetRange(1, 50) self.Bind(wx.EVT_SPINCTRL, self.OnSpin, self.cantidad_nodos) hb.Add(self.cantidad_nodos) self.content.Add(hb, 0, wx.BOTTOM, 10) hb = wx.BoxSizer(wx.HORIZONTAL) # tabla de arcos box = wx.StaticBox(self, -1, u"Capacidad de los arcos") bsizer = wx.StaticBoxSizer(box, wx.VERTICAL) self.tabla_de_arcos = wx.grid.Grid(self, -1, (-1, -1), (400, 300)) self.datos_de_arcos = TablaDeArcos() self.tabla_de_arcos.SetDefaultCellAlignment(wx.ALIGN_CENTER, wx.ALIGN_CENTER) self.tabla_de_arcos.SetDefaultColSize(36) self.tabla_de_arcos.SetDefaultRowSize(36) self.tabla_de_arcos.SetDefaultRenderer(Renderer()) self.tabla_de_arcos.Bind(wx.grid.EVT_GRID_CELL_CHANGE, self.OnCellChange) self.tabla_de_arcos.Bind(wx.grid.EVT_GRID_SELECT_CELL, self.OnCellSelect) bsizer.Add(self.tabla_de_arcos, 1, wx.EXPAND) hb.Add(bsizer, 1, wx.EXPAND) hb.AddSpacer(10) # vista previa box = wx.StaticBox(self, -1, u"Vista previa") bsizer = wx.StaticBoxSizer(box, wx.VERTICAL) self.panel_vista_previa = scrolledpanel.ScrolledPanel(self, -1, size=(400, 300)) self.panel_vista_previa.SetBackgroundColour("#000000") self.bitmap_grafo = wx.StaticBitmap(self.panel_vista_previa, -1) self.panel_vista_previa.SetAutoLayout(1) self.panel_vista_previa.SetBackgroundColour(wx.WHITE) self.panel_vista_previa.SetSizer(wx.BoxSizer(wx.VERTICAL)) self.panel_vista_previa.GetSizer().Add( self.bitmap_grafo, 1, wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_CENTER_VERTICAL) self.graficador = GraficoDeRed(self.datos_de_arcos.GetRed()) bsizer.Add(self.panel_vista_previa, 0, wx.EXPAND) hb.Add(bsizer, 0, wx.EXPAND) self.content.Add(hb, 0, wx.BOTTOM, 20)
def __init__(self, parent, data): AeroPage.__init__(self, parent, u"Bienvenido a PyFlow") text1 = AeroStaticText(self, -1, u"Investigación de Operaciones - Trabajo práctico\nIngeniería Informática - Junio 2010") self.content.Add(text1, 0, wx.BOTTOM, 10) hs = wx.BoxSizer(wx.HORIZONTAL) boton_nuevo_flujo = wx.Button(self, -1, u"\nCrear nuevo flujo\n ") self.Bind(wx.EVT_BUTTON, self.EventoNuevo, boton_nuevo_flujo) boton_abrir_flujo = wx.Button(self, -1, u"\nAbrir flujo...\n ") hs.Add(boton_nuevo_flujo, 1, wx.EXPAND, 0) hs.Add(boton_abrir_flujo, 1, wx.EXPAND, 0) self.content.Add(hs, 0, wx.EXPAND | wx.ALIGN_CENTER | wx.BOTTOM, 20)
def __init__(self, parent, data): AeroPage.__init__(self, parent, u"¡No hay problema!") instrucciones = AeroStaticText(self, -1, u"Solución del problema:") self.content.Add(instrucciones, 0, wx.BOTTOM, 10) self.red_residual = None self.panel_vista_previa = scrolledpanel.ScrolledPanel(self, -1, size=(650, 300)) self.panel_vista_previa.SetBackgroundColour("#000000") self.bitmap_grafo = wx.StaticBitmap(self.panel_vista_previa, -1) self.panel_vista_previa.SetAutoLayout(1) self.panel_vista_previa.SetBackgroundColour(wx.WHITE) self.panel_vista_previa.SetSizer(wx.BoxSizer(wx.VERTICAL)) self.panel_vista_previa.GetSizer().Add( self.bitmap_grafo, 1, wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_CENTER_VERTICAL) self.content.Add(self.panel_vista_previa, 1, wx.EXPAND | wx.BOTTOM, 20) # botones bmps = [ wx.Bitmap("ui/img/media-" + x, wx.BITMAP_TYPE_PNG) for x in [ "skip-backward.png", "playback-start.png", "playback-pause.png", "skip-forward.png" ] ] buttons = [ wx.BitmapButton(self, -1, bmp, (-1, -1), (bmp.GetWidth() + 20, bmp.GetHeight() + 10)) for bmp in bmps ] #bmp_play = wx.Bitmap("ui/img/media-playback-start.png", wx.BITMAP_TYPE_PNG) #b = wx.BitmapButton(self, -1, bmp_play, (-1,-1),(bmp_play.GetWidth() + 10, bmp_play.GetHeight() + 10)) #self.content.Add(b) hb = wx.BoxSizer(wx.HORIZONTAL) #hb.AddMany([b for b in buttons]) for b in buttons: hb.Add(b, 0, wx.ALIGN_CENTER_VERTICAL, 0) b.Show(False) self.slider_tiempo = wx.Slider(self, -1, 0, 0, 15, style=wx.SL_HORIZONTAL | wx.SL_AUTOTICKS) self.Bind(EVT_SLIDER, self.OnTick, self.slider_tiempo) hb.Add(self.slider_tiempo, 1, wx.EXPAND, 0) self.content.Add(hb, 0, wx.EXPAND | wx.BOTTOM, 20)
def __init__(self, parent, data): AeroPage.__init__(self, parent, u"Bienvenido a PyFlow") text1 = AeroStaticText( self, -1, u"Investigación de Operaciones - Trabajo práctico\nIngeniería Informática - Junio 2010" ) self.content.Add(text1, 0, wx.BOTTOM, 10) hs = wx.BoxSizer(wx.HORIZONTAL) boton_nuevo_flujo = wx.Button(self, -1, u"\nCrear nuevo flujo\n ") self.Bind(wx.EVT_BUTTON, self.EventoNuevo, boton_nuevo_flujo) boton_abrir_flujo = wx.Button(self, -1, u"\nAbrir flujo...\n ") hs.Add(boton_nuevo_flujo, 1, wx.EXPAND, 0) hs.Add(boton_abrir_flujo, 1, wx.EXPAND, 0) self.content.Add(hs, 0, wx.EXPAND | wx.ALIGN_CENTER | wx.BOTTOM, 20)
def GetNext(self): if len(self.combo_origen.GetValue()) == 0 or len( self.combo_destino.GetValue()) == 0: return False else: #print AeroPage.GetNext(self) return AeroPage.GetNext(self)
def __init__(self, parent, data): AeroPage.__init__(self, parent, u"Defina la red") instrucciones = AeroStaticText(self, -1, u"Indique la cantidad de nodos que tendrá la red y los arcos que hay entre ellos.") self.content.Add(instrucciones, 0, wx.BOTTOM, 10) # cantidad de nodos hb = wx.BoxSizer(wx.HORIZONTAL) l = wx.StaticText(self, -1, u"Nodos:") hb.Add(l, 0, wx.ALIGN_CENTER_VERTICAL, 0) self.cantidad_nodos = wx.SpinCtrl(self, -1, "3") self.cantidad_nodos.SetRange(1, 50) self.Bind(wx.EVT_SPINCTRL, self.OnSpin, self.cantidad_nodos) hb.Add(self.cantidad_nodos) self.content.Add(hb, 0, wx.BOTTOM, 10) hb = wx.BoxSizer(wx.HORIZONTAL) # tabla de arcos box = wx.StaticBox(self, -1, u"Capacidad de los arcos") bsizer = wx.StaticBoxSizer(box, wx.VERTICAL) self.tabla_de_arcos = wx.grid.Grid(self, -1, (-1, -1), (400, 300)) self.datos_de_arcos = TablaDeArcos() self.tabla_de_arcos.SetDefaultCellAlignment(wx.ALIGN_CENTER, wx.ALIGN_CENTER) self.tabla_de_arcos.SetDefaultColSize(36) self.tabla_de_arcos.SetDefaultRowSize(36) self.tabla_de_arcos.SetDefaultRenderer(Renderer()) self.tabla_de_arcos.Bind(wx.grid.EVT_GRID_CELL_CHANGE, self.OnCellChange) self.tabla_de_arcos.Bind(wx.grid.EVT_GRID_SELECT_CELL, self.OnCellSelect) bsizer.Add(self.tabla_de_arcos, 1, wx.EXPAND) hb.Add(bsizer, 1, wx.EXPAND) hb.AddSpacer(10) # vista previa box = wx.StaticBox(self, -1, u"Vista previa") bsizer = wx.StaticBoxSizer(box, wx.VERTICAL) self.panel_vista_previa = scrolledpanel.ScrolledPanel(self, -1, size=(400,300)) self.panel_vista_previa.SetBackgroundColour("#000000") self.bitmap_grafo = wx.StaticBitmap(self.panel_vista_previa, -1) self.panel_vista_previa.SetAutoLayout(1) self.panel_vista_previa.SetBackgroundColour(wx.WHITE) self.panel_vista_previa.SetSizer(wx.BoxSizer(wx.VERTICAL)) self.panel_vista_previa.GetSizer().Add(self.bitmap_grafo, 1, wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_CENTER_VERTICAL) self.graficador = GraficoDeRed(self.datos_de_arcos.GetRed()) bsizer.Add(self.panel_vista_previa, 0, wx.EXPAND) hb.Add(bsizer, 0, wx.EXPAND) self.content.Add(hb, 0, wx.BOTTOM, 20)
def __init__(self, parent, data): AeroPage.__init__(self, parent, u"Fuente y destino de la red") instrucciones = AeroStaticText( self, -1, u"Indique el nodo origen y el nodo destino de la red.") self.content.Add(instrucciones, 0, wx.BOTTOM, 10) hb = wx.BoxSizer(wx.HORIZONTAL) # origen y destino box = wx.StaticBox(self, -1, u"Origen y Destino") bsizer = wx.StaticBoxSizer(box, wx.VERTICAL) self.combo_origen = wx.ComboBox(self, -1) self.combo_destino = wx.ComboBox(self, -1) self.combo_origen.Bind(wx.EVT_COMBOBOX, self.OnCombo) self.combo_destino.Bind(wx.EVT_COMBOBOX, self.OnCombo) fgs = wx.FlexGridSizer(2, 2, 2, 2) fgs.AddMany([ wx.StaticText(self, -1, u"Origen:"), self.combo_origen, wx.StaticText(self, -1, u"Destino:"), self.combo_destino ]) bsizer.Add(fgs) hb.Add(bsizer, 0, wx.EXPAND) hb.AddSpacer(10) # vista previa box = wx.StaticBox(self, -1, u"Vista previa") bsizer = wx.StaticBoxSizer(box, wx.VERTICAL) self.panel_vista_previa = scrolledpanel.ScrolledPanel(self, -1, size=(400, 300)) self.panel_vista_previa.SetBackgroundColour("#000000") self.bitmap_grafo = wx.StaticBitmap(self.panel_vista_previa, -1) self.panel_vista_previa.SetAutoLayout(1) self.panel_vista_previa.SetBackgroundColour(wx.WHITE) self.panel_vista_previa.SetSizer(wx.BoxSizer(wx.VERTICAL)) self.panel_vista_previa.GetSizer().Add( self.bitmap_grafo, 1, wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_CENTER_VERTICAL) bsizer.Add(self.panel_vista_previa, 0, wx.EXPAND) hb.Add(bsizer, 0, wx.EXPAND) self.content.Add(hb, 0, wx.BOTTOM, 20)
def __init__(self, parent, data): AeroPage.__init__(self, parent, u"Fuente y destino de la red") instrucciones = AeroStaticText(self, -1, u"Indique el nodo origen y el nodo destino de la red.") self.content.Add(instrucciones, 0, wx.BOTTOM, 10) hb = wx.BoxSizer(wx.HORIZONTAL) # origen y destino box = wx.StaticBox(self, -1, u"Origen y Destino") bsizer = wx.StaticBoxSizer(box, wx.VERTICAL) self.combo_origen = wx.ComboBox(self, -1) self.combo_destino = wx.ComboBox(self, -1) self.combo_origen.Bind(wx.EVT_COMBOBOX, self.OnCombo) self.combo_destino.Bind(wx.EVT_COMBOBOX, self.OnCombo) fgs = wx.FlexGridSizer(2, 2, 2, 2) fgs.AddMany([wx.StaticText(self, -1, u"Origen:"), self.combo_origen, wx.StaticText(self, -1, u"Destino:"), self.combo_destino ]) bsizer.Add(fgs) hb.Add(bsizer, 0, wx.EXPAND) hb.AddSpacer(10) # vista previa box = wx.StaticBox(self, -1, u"Vista previa") bsizer = wx.StaticBoxSizer(box, wx.VERTICAL) self.panel_vista_previa = scrolledpanel.ScrolledPanel(self, -1, size=(400,300)) self.panel_vista_previa.SetBackgroundColour("#000000") self.bitmap_grafo = wx.StaticBitmap(self.panel_vista_previa, -1) self.panel_vista_previa.SetAutoLayout(1) self.panel_vista_previa.SetBackgroundColour(wx.WHITE) self.panel_vista_previa.SetSizer(wx.BoxSizer(wx.VERTICAL)) self.panel_vista_previa.GetSizer().Add(self.bitmap_grafo, 1, wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_CENTER_VERTICAL) bsizer.Add(self.panel_vista_previa, 0, wx.EXPAND) hb.Add(bsizer, 0, wx.EXPAND) self.content.Add(hb, 0, wx.BOTTOM, 20)