def __init__(self, owner, name, title, icono, folder, li_tam_blocks): self.tol = TurnOnLights.read_tol(name, title, folder, li_tam_blocks) self.reinit = False titulo = _("Turn on the lights") + ": " + title extparam = "tol%s-%d" % (name, self.tol.work_level) QTVarios.WDialogo.__init__(self, owner, titulo, icono, extparam) self.colorTheme = QTUtil.qtColor("#F0F0F0") # Toolbar tb = Controles.TBrutina(self) tb.new(_("Close"), Iconos.MainMenu(), self.terminar) anterior, siguiente = self.tol.prev_next() if anterior: tb.new(_("Previous"), Iconos.Anterior(), self.goto_previous) if siguiente: tb.new(_("Next"), Iconos.Siguiente(), self.goto_next) tb.new(_("Config"), Iconos.Configurar(), self.config) tb.new(_("Information"), Iconos.Informacion(), self.colors) # Lista oColumnas = Columnas.ListaColumnas() work_level = self.tol.work_level + 1 oColumnas.nueva("THEME", _("Level %d/%d") % (work_level, self.tol.num_levels), 175) for x in range(self.tol.num_blocks): oColumnas.nueva("BLOCK%d" % x, "%d" % (x + 1, ), 42, siCentrado=True, edicion=Delegados.PmIconosColor()) self.grid = grid = Grid.Grid(self, oColumnas, altoFila=42, background="white") self.grid.setAlternatingRowColors(False) self.grid.tipoLetra(puntos=10, peso=500) nAnchoPgn = self.grid.anchoColumnas() + 20 self.grid.setMinimumWidth(nAnchoPgn) self.registrarGrid(grid) # Colocamos --------------------------------------------------------------- ly = Colocacion.V().control(tb).control(self.grid) self.setLayout(ly) alto = self.tol.num_themes * 42 + 116 self.recuperarVideo(siTam=True, altoDefecto=alto, anchoDefecto=nAnchoPgn)
def __init__(self, procesador, name, title, icono, folder, li_tam_blocks, one_line): self.one_line = one_line if one_line: self.tol = TurnOnLights.read_oneline_tol() else: self.tol = TurnOnLights.read_tol(name, title, folder, li_tam_blocks) self.reinit = False titulo = _("Turn on the lights") + ": " + title if self.tol.is_calculation_mode(): tipo = _("Calculation mode") background = "#88AA3A" else: tipo = _("Memory mode") background = "#BDDBE8" self.procesador = procesador extparam = "tol%s-%d" % (name, self.tol.work_level) QTVarios.WDialogo.__init__(self, procesador.pantalla, titulo, icono, extparam) self.colorTheme = QTUtil.qtColor("#F0F0F0") lb = Controles.LB(self, tipo) lb.ponFondoN(background).alinCentrado().ponTipoLetra(puntos=14) # Toolbar tb = Controles.TBrutina(self) tb.new(_("Close"), Iconos.MainMenu(), self.terminar) anterior, siguiente, terminado = self.tol.prev_next() if terminado: tb.new(_("Rebuild"), Iconos.Reindexar(), self.rebuild) if anterior: tb.new(_("Previous"), Iconos.Anterior(), self.goto_previous) if siguiente: tb.new(_("Next"), Iconos.Siguiente(), self.goto_next) if one_line: tb.new(_("Change"), Iconos.TOLchange(), self.cambiar_one_line) tb.new(_("Config"), Iconos.Configurar(), self.config) tb.new(_("Information"), Iconos.Informacion(), self.colors) # Lista oColumnas = Columnas.ListaColumnas() work_level = self.tol.work_level + 1 oColumnas.nueva("THEME", _("Level %d/%d") % (work_level, self.tol.num_levels), 175) edicionIconos = Delegados.PmIconosColor() self.dicIconos = {} for k, pm in edicionIconos.dicpmIconos.iteritems(): self.dicIconos[k] = QtGui.QIcon(pm) for x in range(self.tol.num_blocks): oColumnas.nueva("BLOCK%d" % x, "%d" % (x + 1, ), 42, siCentrado=True, edicion=edicionIconos) self.grid = grid = Grid.Grid(self, oColumnas, altoFila=42, background="white") self.grid.setAlternatingRowColors(False) self.grid.tipoLetra(puntos=10, peso=500) nAnchoPgn = self.grid.anchoColumnas() + 20 self.grid.setMinimumWidth(nAnchoPgn) self.registrarGrid(grid) # Colocamos --------------------------------------------------------------- ly = Colocacion.V().control(lb).control(tb).control(self.grid) self.setLayout(ly) alto = self.tol.num_themes * 42 + 146 self.recuperarVideo(siTam=True, altoDefecto=alto, anchoDefecto=max(nAnchoPgn, 480))