#! /usr/bin/env python
#  -*- coding: utf-8 -*-
#
# GUI module generated by PAGE version 4.23a
#  in conjunction with Tcl version 8.6
#    Jun 25, 2019 11:22:56 PM -03  platform: Windows NT

import sys

try:
    import Tkinter as tk
except ImportError:
    import tkinter as tk

try:
    import ttk
    py3 = False
except ImportError:
    import tkinter.ttk as ttk
    py3 = True

import views.biodinamica_support as biodinamica_support
import views.abm_medicos as medicos
import views.abm_pacientes as pacientes
import views.gestos as gestos
import views.estudios as estudios
import views.historial as historial

def vp_start_gui():
    '''Starting point when module is the main routine.'''
    global val, w, root
    root = tk.Tk()
    top = tea (root)
    biodinamica_support.init(root, top)
    root.mainloop()

w = None
def create_tea(root, *args, **kwargs):
    '''Starting point when module is imported by another program.'''
    global w, w_win, rt
    rt = root
    w = tk.Toplevel (root)
    top = tea (w)
    biodinamica_support.init(w, top, *args, **kwargs)
    return (w, top)

def destroy_tea():
    global w
    w.destroy()
    w = None

class tea:
    def __init__(self, top=None):
        '''This class configures and populates the toplevel window.
           top is the toplevel containing window.'''
        _bgcolor = '#d9d9d9'  # X11 color: 'gray85'
        _fgcolor = '#000000'  # X11 color: 'black'
        _compcolor = '#d9d9d9' # X11 color: 'gray85'
        _ana1color = '#d9d9d9' # X11 color: 'gray85'
        _ana2color = '#ececec' # Closest X11 color: 'gray92'
        font9 = "-family {Segoe UI} -size 22 -weight normal -slant "  \
            "roman -underline 0 -overstrike 0"
        self.style = ttk.Style()
        if sys.platform == "win32":
            self.style.theme_use('winnative')
        self.style.configure('.',background=_bgcolor)
        self.style.configure('.',foreground=_fgcolor)
        self.style.configure('.',font="TkDefaultFont")
        self.style.map('.',background=
            [('selected', _compcolor), ('active',_ana2color)])

        top.geometry("600x450+483+154")
        top.title("TEA")
        top.configure(background="#d9d9d9")
        top.configure(highlightbackground="#d9d9d9")
        top.configure(highlightcolor="black")

        self.Message1 = tk.Message(top)
        self.Message1.place(relx=0.2, rely=0.133, relheight=0.14, relwidth=0.6)
        self.Message1.configure(background="#d9d9d9")
        self.Message1.configure(font=font9)
        self.Message1.configure(foreground="#000000")
        self.Message1.configure(highlightbackground="#d9d9d9")
        self.Message1.configure(highlightcolor="black")
        self.Message1.configure(text='''BIODINÁMICA TEA''')
        self.Message1.configure(width=360)

        self.abmpacientes = ttk.Button(top)
        self.abmpacientes.place(relx=0.083, rely=0.422, height=35, width=206)
        self.abmpacientes.configure(takefocus="")
        self.abmpacientes.configure(text='''ABM Pacientes''')
        self.abmpacientes.configure(command=self.abrirPacientes)

        

        self.abmmedicos = ttk.Button(top)
        self.abmmedicos.place(relx=0.083, rely=0.544, height=35, width=206)
        self.abmmedicos.configure(takefocus="")
        self.abmmedicos.configure(text='''ABM Médicos''')
        self.abmmedicos.configure(command=self.abrirMedicos)

        self.abmgestos = ttk.Button(top)
        self.abmgestos.place(relx=0.083, rely=0.667, height=35, width=206)
        self.abmgestos.configure(takefocus="")
        self.abmgestos.configure(text='''ABM Gestos''')
        self.abmgestos.configure(command=self.abrirGestos)

        self.estudio = ttk.Button(top)
        self.estudio.place(relx=0.567, rely=0.422, height=35, width=196)
        self.estudio.configure(takefocus="")
        self.estudio.configure(text='''Nuevo Estudio''')
        self.estudio.configure(command=estudios.vp_start_gui)

        self.historia = ttk.Button(top)
        self.historia.place(relx=0.567, rely=0.544, height=35, width=196)
        self.historia.configure(takefocus="")
        self.historia.configure(text='''Historial''')
        self.historia.configure(command=historial.vp_start_gui)

        self.salir = ttk.Button(top)
        self.salir.place(relx=0.4, rely=0.844, height=35, width=76)
        self.salir.configure(command=biodinamica_support.destroy_window)
        self.salir.configure(takefocus="")
        self.salir.configure(text='''Salir''')
    
    def abrirPacientes(self):
            pacientes.create_abmPacientes(root)
    def abrirMedicos(self):
            medicos.create_abmMedicos(root)
    def abrirGestos(self):
            gestos.create_abmGestos(root)

if __name__ == '__main__':
    vp_start_gui()





