Example #1
0
    def __init__(self, iddocente):
        'contructor requiere de parent como interfaz contenedor y manipulador como clase que accedera a la informacion'

        self.conectordatabase = ConnectionDataBase.Connection(
            "localhost", "examen", "adminexamen", "pasexamen",
            "5434")  #se rquerie de datos para conexion a motor
        self.conexion = ConnSchema.ConnSchema(self.conectordatabase)
        self.iddocente = iddocente
        app = wx.App(False)
        displaySize = wx.DisplaySize()
        wx.Frame.__init__(self,
                          None,
                          pos=(0, 0),
                          size=(displaySize[0], displaySize[1]))
        displaySize = wx.DisplaySize()
        topPanel = scrolled.ScrolledPanel(self)
        topPanel.SetupScrolling(scroll_y=True)
        topPanel.SetBackgroundColour('3399FF')
        sizertopPanel = wx.BoxSizer(wx.VERTICAL)
        sizertopPanel.Add(HeadLow.Head(topPanel),
                          0,
                          wx.EXPAND | wx.ALL,
                          border=10)
        sizertopPanel.Add(Body(topPanel, iddocente),
                          0,
                          wx.EXPAND | wx.ALL,
                          border=10)
        sizertopPanel.Add(HeadLow.Low(topPanel),
                          0,
                          wx.EXPAND | wx.ALL,
                          border=10)
        topPanel.SetSizer(sizertopPanel)
        self.sizer = sizertopPanel
        self.topPanel = topPanel
        self.topanel = topPanel
        self.Bind(wx.EVT_CLOSE, self.OnClose)
        #Genracion de menu Principal que controlara el interfaz
        menuBar = wx.MenuBar()
        menu = wx.Menu()
        m_exit = menu.Append(wx.ID_EXIT, "&salir\tAlt-X",
                             "Close window and exit program.")
        self.Bind(wx.EVT_MENU, self.OnClose, m_exit)
        menuBar.Append(menu, "&Archivo")
        menu = wx.Menu()
        m_agregartema = menu.Append(ID_AGREGAR_EXAMEN, "&Agregar tema",
                                    "Agregar nuevo Examen")
        self.Bind(wx.EVT_MENU,
                  self.agregar,
                  m_agregartema,
                  id=ID_AGREGAR_EXAMEN)
        menu = wx.Menu()
        m_about = menu.Append(wx.ID_ABOUT, "&Sobre nosotros",
                              "Information about this program")
        self.Bind(wx.EVT_MENU, self.OnAbout, m_about)
        menuBar.Append(menu, "&Ayuda")
        self.SetMenuBar(menuBar)
        self.Show()
        app.MainLoop()
        self.GetSizer().Layout()
        self.Fit()
Example #2
0
 def cambiarpanel(self, nuevopanel):
     """Metodo usado para cambiar un panel en el que ya se
      registró la informacion para el nuevo examen y se requiere
      que el siguiente paso en el registro de un nuevo examen se muestre
      requiere como parametro el nuevo panel "nuevopanel" en el que se va a
      reemplazar el ya utlizado"""
     #siempre se cambia en la poscion 2 ya que es la del body
     sizer = self.sizer
     sizer.Hide(0)
     sizer.Remove(0)
     sizer.Hide(0)
     sizer.Remove(0)
     sizer.Hide(0)
     sizer.Remove(0)
     sizer.Add(HeadLow.Head(self.topanel),
               0,
               wx.EXPAND | wx.ALL,
               border=10)
     sizer.Add(nuevopanel, 0, wx.EXPAND | wx.ALL, border=10)
     sizer.Add(HeadLow.Low(self.topanel),
               0,
               wx.EXPAND | wx.ALL,
               border=10)
     self.topanel.SetSizer(self.sizer)
     self.father.SetSizer(sizer)
     self.father.GetSizer().Layout()
     self.father.Fit()
Example #3
0
 def __init__(self, parent):
     wx.Panel.__init__(self, parent)
     self.SetBackgroundColour("#696969")
     sizerlow = wx.BoxSizer(wx.VERTICAL)
     low = HeadLow.Low(self)
     sizerlow.Add(low, 0, wx.EXPAND | wx.ALL, border=0)
     self.SetSizer(sizerlow)
Example #4
0
 def __init__(self, parent):
     wx.Panel.__init__(self, parent)
     self.SetBackgroundColour("3399FF")
     head = HeadLow.Head(self)
     sizerhead = wx.BoxSizer(wx.VERTICAL)
     sizerhead.Add(head, 0, wx.EXPAND | wx.ALL, border=0)
     self.SetSizer(sizerhead)
Example #5
0
    def __init__(self, parent):
        'Inicia el pie de página de la interfaz'
        wx.Panel.__init__(self, parent)
        self.SetBackgroundColour("#696969")
        sizerlow = wx.BoxSizer(wx.VERTICAL)
        low = HeadLow.Low(self)
        sizerlow.Add(low, 0, wx.EXPAND | wx.ALL, border=0)
        self.SetSizer(sizerlow)


##-----------------------------------------------------------

#app=wx.App(False)
#frame = wx.Frame(None, wx.ID_ANY, 'ZUHÉ - UD', pos=(0, 0), size=( wx.EXPAND|wx.ALL,wx.EXPAND|wx.ALL))
#menubar = wx.MenuBar()
#topPanel= scrolled.ScrolledPanel(frame)
#topPanel.SetupScrolling(scroll_y=True)
#topPanel.SetBackgroundColour("#696969")
#sizertopPanel=wx.BoxSizer(wx.VERTICAL)
#Body= Body(topPanel)
#sizertopPanel.Add(Head(topPanel),0,wx.EXPAND|wx.ALL,border=0)
#sizertopPanel.Add(Body,0,wx.EXPAND|wx.ALL,border=0)
#sizertopPanel.Add(Low(topPanel),wx.ALIGN_BOTTOM,wx.ALIGN_CENTER)
#topPanel.SetSizer(sizertopPanel)
#frame.Show()
#frame.Update()
#frame.Layout()
#app.MainLoop()
Example #6
0
 def __init__(self, parent):
     'Inicia el encabezado de la interfaz'
     wx.Panel.__init__(self, parent)
     self.SetBackgroundColour("#696969")
     head = HeadLow.Head(self)
     sizerhead = wx.BoxSizer(wx.VERTICAL)
     sizerhead.Add(head, 0, wx.EXPAND | wx.ALL, border=0)
     self.SetSizer(sizerhead)
Example #7
0
 def __init__(self, parent):
     'Inicia el pie de página de la interfaz'
     wx.Panel.__init__(self, parent)
     self.SetBackgroundColour("#696969")
     sizerlow = wx.BoxSizer(wx.VERTICAL)
     low = HeadLow.Low(self)
     sizerlow.Add(low, 0, wx.EXPAND | wx.ALL, border=0)
     self.SetSizer(sizerlow)
Example #8
0
    def cambiarpanel(self, nuevopanel):
        """Metodo usado para cambiar un panel en el que ya se
             registró la informacion para el nuevo examen y se requiere
             que el siguiente paso en el registro de un nuevo examen se muestre
             requiere como parametro el nuevo panel "nuevopanel" en el que se va a
             reemplazar el ya utlizado"""
        #siempre se cambia en la poscion 2 ya que es la del body
        sizer = self.sizer
        sizer.Hide(0)
        sizer.Remove(0)
        sizer.Hide(0)
        sizer.Remove(0)
        sizer.Hide(0)
        sizer.Remove(0)
        sizer.Add(HeadLow.Head(self.topanel), 0, wx.EXPAND | wx.ALL, border=10)
        sizer.Add(nuevopanel, 0, wx.EXPAND | wx.ALL, border=10)
        sizer.Add(HeadLow.Low(self.topanel), 0, wx.EXPAND | wx.ALL, border=10)
        self.topanel.SetSizer(self.sizer)
        self.father.SetSizer(sizer)
        self.father.GetSizer().Layout()
        self.father.Fit()


#app=wx.App(False)
#displaySize= wx.DisplaySize()
#frame = wx.Frame(None, wx.ID_ANY, 'Full display size', pos=(0, 0), size=(displaySize[0], displaySize[1]))
#menubar = wx.MenuBar()
#topPanel= scrolled.ScrolledPanel(frame)
#topPanel.SetupScrolling(scroll_y=True)
#topPanel.SetBackgroundColour('3399FF')
#sizertopPanel=wx.BoxSizer(wx.VERTICAL)
#iddocente = "4"
#interfaz = interfazpanelpaso(frame,iddocente,topPanel,sizertopPanel)
#sizertopPanel.Add(HeadLow.Head(topPanel),0,wx.EXPAND|wx.ALL,border=10)
#sizertopPanel.Add(BodyNuevoExamen(topPanel,interfaz,iddocente),0,wx.EXPAND|wx.ALL,border=10)
#sizertopPanel.Add(HeadLow.Low(topPanel),0,wx.EXPAND|wx.ALL,border=10)
#topPanel.SetSizer(sizertopPanel)
#frame.Show()
#app.MainLoop()
Example #9
0
 def __init__(self,parent,idexamen, localport):
     """Constructor"""
     displaySize= wx.DisplaySize()
     self.localport = str(localport)
     wx.Dialog.__init__(self, parent, wx.ID_ANY, 'Full display size', pos=(0, 0), size=(displaySize[0], displaySize[1]))
     self.conectordatabase = ConnectionDataBase.Connection("localhost","examen","adminexamen","pasexamen",self.localport)
     self.conexion = ConnSchema.ConnSchema(self.conectordatabase)
     query ="select examen.titulo_exa, persona.nom_pers || ' ' ||persona.apellido_pers, examen.tiempo_exa_inicio, examen.tiempo_exa_fin "
     query += "from persona, examen, docente where docente.id_persona = persona.id_persona and examen.id_dcnte = docente.id_persona and examen.id_exa = "+str(idexamen)+";"    
     self.generalidadexamen = (self.conectordatabase).ExecuteQuery(query) #consulta de todos los tipos de examen
     print str(self.generalidadexamen)
     gs = wx.GridSizer(3, 2, 1, 1) #Creacion grilla de tamaño
     topPanel= scrolled.ScrolledPanel(parent)
     panel =wx.Panel(topPanel)
     self.lblname = wx.StaticText(panel, label="Nombre Examen : "+str(self.generalidadexamen[0][0]), pos=(0, 35))
     self.docente = wx.StaticText(panel, label="Docente :"+str(self.generalidadexamen[0][1]), pos=(100, 35))
     self.lblhoraini = wx.StaticText(panel, label="Hora Inicio :"+str(self.generalidadexamen[0][2]), pos=(0, 65))
     self.lblhorafin = wx.StaticText(panel, label="Hora Fin: "+str(self.generalidadexamen[0][3]), pos=(100, 65))
     self.enviar = wx.Button(panel, wx.ID_OK,label="Enviar")
     #--------------Adición de Paneles a la Grilla, esta grilla permite que los paneles se ajuste al tamaño de la pantalla
     gs.AddMany([(self.lblname, 0, wx.ALIGN_CENTER),(self.docente, 0, wx.ALIGN_CENTER),
                 (self.lblhoraini, 0, wx.ALIGN_CENTER),(self.lblhorafin, 0, wx.ALIGN_CENTER),
                 (self.enviar,0,wx.FIXED_MINSIZE)])
     sizer = wx.BoxSizer(wx.VERTICAL) #Adición de la grilla de tamaños al panel padre
     #sizer.Add(self.enviar, proportion=1,flag=wx.FIXED_MINSIZE)
     sizer.Add(gs, proportion=1, flag=wx.EXPAND)
     panel.SetSizer(sizer)
     topPanel.SetupScrolling(scroll_y=True)
     topPanel.SetBackgroundColour('#00BF8F')
     sizertopPanel=wx.BoxSizer(wx.VERTICAL)
     sizertopPanel.Add(HeadLow.Head(topPanel),0,wx.EXPAND|wx.ALL,border=10)
     sizertopPanel.Add(panel, 0,wx.EXPAND|wx.ALL,border=10)
     sizertopPanel.Add(InterfazExamen(topPanel,idexamen,self.conectordatabase,self.conexion),0,wx.EXPAND|wx.ALL,border=5)
     sizertopPanel.Add(HeadLow.Low(topPanel),0,wx.EXPAND|wx.ALL,border=10)
     topPanel.SetSizer(sizertopPanel)
     self.SetSizer(sizertopPanel)
Example #10
0
    def getconexion(self):
        """consutlor que retorna la clase administradora de la base de datos"""
        return self.conexion.connection

    def iniciarinterfazExamen(self, idexamen):
        verexamen = InterfazExamen.__init__.iniciarverexamen(idexamen)
        res = verexamen.ShowModal()
        if res == wx.ID_OK:
            print("examen contestado")
        verexamen.Destroy()


app = wx.App(False)
displaySize = wx.DisplaySize()
frame = wx.Frame(None,
                 wx.ID_ANY,
                 'Full display size',
                 pos=(0, 0),
                 size=(displaySize[0], displaySize[1]))
menubar = wx.MenuBar()
topPanel = scrolled.ScrolledPanel(frame)
topPanel.SetupScrolling(scroll_y=True)
topPanel.SetBackgroundColour('3399FF')
sizertopPanel = wx.BoxSizer(wx.VERTICAL)
interfaz = interfazpanelpaso(frame, topPanel, sizertopPanel)
sizertopPanel.Add(HeadLow.Head(topPanel), 0, wx.EXPAND | wx.ALL, border=10)
sizertopPanel.Add(Body(topPanel, interfaz), 0, wx.EXPAND | wx.ALL, border=10)
sizertopPanel.Add(HeadLow.Low(topPanel), 0, wx.EXPAND | wx.ALL, border=10)
topPanel.SetSizer(sizertopPanel)
frame.Show()
app.MainLoop()
Example #11
0
    def __init__(self, idestudiante, localport):
        'contructor requiere de parent como interfaz contenedor y manipulador como clase que accedera a la informacion'
        self.localport = str(localport)
        self.conectordatabase = ConnectionDataBase.Connection(
            "localhost", "examen", "adminexamen", "pasexamen",
            self.localport)  #se rquerie de datos para conexion a motor
        self.conexion = ConnSchema.ConnSchema(self.conectordatabase)
        self.idestudiante = idestudiante
        app = wx.App(False)
        displaySize = wx.DisplaySize()
        wx.Frame.__init__(self,
                          None,
                          pos=(0, 0),
                          size=(displaySize[0], displaySize[1]))
        displaySize = wx.DisplaySize()
        topPanel = scrolled.ScrolledPanel(self)
        topPanel.SetupScrolling(scroll_y=True)
        topPanel.SetBackgroundColour('#00BF8F')
        sizertopPanel = wx.BoxSizer(wx.VERTICAL)
        sizertopPanel.Add(HeadLow.Head(topPanel),
                          0,
                          wx.EXPAND | wx.ALL,
                          border=10)
        sizertopPanel.Add(Body(topPanel, idestudiante, self.localport),
                          0,
                          wx.EXPAND | wx.ALL,
                          border=10)
        sizertopPanel.Add(HeadLow.Low(topPanel),
                          0,
                          wx.EXPAND | wx.ALL,
                          border=10)
        topPanel.SetSizer(sizertopPanel)
        self.sizer = sizertopPanel
        self.topPanel = topPanel
        self.topanel = topPanel
        self.Bind(wx.EVT_CLOSE, self.OnClose)
        #Genracion de menu Principal que controlara el interfaz
        menuBar = wx.MenuBar()
        menu = wx.Menu()
        m_exit = menu.Append(wx.ID_EXIT, "&salir\tAlt-X",
                             "Close window and exit program.")
        self.Bind(wx.EVT_MENU, self.OnClose, m_exit)

        menuBar.Append(menu, "&Archivo")
        menu = wx.Menu()
        m_miscursos = menu.Append(ID_CURSO, "&Mis Cursos",
                                  "Ingresar al modulo Cursos")
        self.Bind(wx.EVT_MENU, self.abrirmiscursos, m_miscursos, id=ID_CURSO)

        m_buscarcursos = menu.Append(ID_BUSCAR_CURSO, "&Buscar Cursos",
                                     "Ingresar al modulo de buscar Cursos")
        self.Bind(wx.EVT_MENU,
                  self.buscarCursos,
                  m_buscarcursos,
                  id=ID_BUSCAR_CURSO)

        menuBar.Append(menu, "&Cursos")
        menu = wx.Menu()
        m_about = menu.Append(wx.ID_ABOUT, "&Sobre nosotros",
                              "Information about this program")
        self.Bind(wx.EVT_MENU, self.OnAbout, m_about)

        menuBar.Append(menu, "&Ayuda")
        self.SetMenuBar(menuBar)
        self.Show()
        self.Fit()
        app.MainLoop()