Пример #1
0
    def __init__(self, nombreBD, nombreTabla):
        self.ventana = Tk()
        self.nombreBD = nombreBD
        self.nombreTabla = nombreTabla
        # obteniendo grafico de la tabla indicada
        Storage.checkDirs()
        tab = Storage.rollback('tables/' + nombreBD + nombreTabla)
        tab.chart()

        self.ventana.title("Tabla " + self.nombreTabla)
        self.ventana.geometry("450x300")

        self.contenedor = Frame(self.ventana)
        self.contenedor.pack(fill="both", expand=True)
        #self.titulo = Label(self.contenedor, text="Tuplas de la tabla: " + self.nombreTabla, font=("Comic Sans MS", 18)).place(x=150, y=5)
        self.canvas = Canvas(self.contenedor)
        self.canvas.pack(side=LEFT, fill=BOTH, expand=1)
        self.scroll = ttk.Scrollbar(self.contenedor,
                                    orient=VERTICAL,
                                    command=self.canvas.yview)
        self.scroll.pack(side=RIGHT, fill=Y)
        self.canvas.configure(yscrollcommand=self.scroll.set)
        self.canvas.bind(
            '<Configure>', lambda e: self.canvas.configure(scrollregion=self.
                                                           canvas.bbox("all")))

        self.segundocontenedor = Frame(self.canvas, width=300, height=300)
        self.canvas.create_window((0, 0),
                                  window=self.segundocontenedor,
                                  anchor="nw")
        imagen = PhotoImage(file="isam.png")
        labelimagen = Label(self.segundocontenedor, image=imagen).pack()

        Button(self.segundocontenedor,
               text="Salir",
               command=self.salir,
               width=20).pack()
        self.ventana.mainloop()
Пример #2
0
    def __init__(self, nombreBD, nombreTabla, listaTuplas):
        self.ventana = Tk()
        self.nombreBD = nombreBD
        self.nombreTabla = nombreTabla
        self.listaTuplas = listaTuplas
        self.ventana.title("Opciones de las Tuplas")
        self.contenedor = Frame(self.ventana, width=500, height=380)
        self.contenedor.pack(fill="both", expand=True)
        self.titulo = Label(self.contenedor,
                            text="Tuplas de la tabla: " + self.nombreTabla,
                            font=("Comic Sans MS", 18)).place(x=110, y=10)
        self.titulo = Label(
            self.contenedor,
            text="Posee " + str(
                Storage.rollback('tables/' + self.nombreBD +
                                 self.nombreTabla).numberColumns) +
            " Columnas",
            font=("Comic Sans MS", 14)).place(x=150, y=40)

        # boton crear tabla
        Button(self.contenedor,
               text="Extraer Tabla Completa",
               command=self.extraertabla,
               width=20).place(x=300, y=80)
        Button(self.contenedor,
               text="Extraer Por Rangos",
               command=self.extraerrango,
               width=20).place(x=300, y=110)
        Button(self.contenedor,
               text="Extraer Row (tupla)",
               command=self.extraertupla,
               width=20).place(x=300, y=140)

        Button(self.contenedor,
               text="Insertar Registro",
               command=self.insertar,
               width=20).place(x=300, y=170)

        Button(self.contenedor,
               text="Actualizar Registro",
               command=self.actualizar,
               width=20).place(x=300, y=200)

        Button(self.contenedor,
               text="Eliminar Registro",
               command=self.eliminar,
               width=20).place(x=300, y=230)
        Button(self.contenedor,
               text="Eliminar Todo",
               command=self.eliminartodo,
               width=20).place(x=300, y=260)
        Button(self.contenedor,
               text="Cargar CSV",
               command=self.cargarCSV,
               width=20).place(x=300, y=290)

        Button(self.contenedor, text="Regresar", command=self.salir,
               width=20).place(x=300, y=320)

        self.listboxTuplas = Listbox(self.contenedor, width=40, height=16)
        self.Cargartuplas()
        self.listboxTuplas.place(x=35, y=80)

        self.ventana.mainloop()