Esempio n. 1
0
 def OnTreeCtrlVocabTreeItemActivated(self, event):
     item = self.treeCtrlVocab.GetSelection()
     if not self.treeCtrlVocab.GetChildrenCount(item):
         self.txtStatus.Show()
         self.Update()
         nodo = self.treeCtrlVocab.GetPyData(item)
         lista = QueryTesNode.filter_by(parent_id = nodo.id).order_by(TesNode.descripcion).all()
         
         for nodoHijo  in  lista:
             LlenaTree(self.treeCtrlVocab, item, nodoHijo,  treeStyle="vocab", maxDeep=1)
         self.txtStatus.Show(False)
         self.Update()
Esempio n. 2
0
 def __init__(self, parent):
     self._init_ctrls(parent)
     n = QueryTesNode.filter(TesNode.name==u"rootnode")[0]
     id = n.id
     
     self.FillTree()
Esempio n. 3
0
 def FillTree(self, toExpand=None, ExpandId=None, name=u"rootnode"):
     self.treeCtrlVocab.DeleteAllItems()
     query = QueryTesNode.filter_by(name=name)
     if query.count():
         rootElement = query[0]
         LlenaTree(self.treeCtrlVocab, None, rootElement, toExpand=toExpand, id=ExpandId, treeStyle="vocab", maxDeep=2)
Esempio n. 4
0
def getTaxonomyTree(prnt, type, title, Pattern=None, ctrl=None, id=None, poli=None, VOrden=None, deep=None, help=u'', search=False):
        #if type in status.dlg.keys() and not search and type not in status.dlgExcepciones:
        

        if type in status.dlg[search].keys() and type not in status.dlgExcepciones:
            dlg = status.dlg[search][type]
            dlg.staticTextNotas.Clear()
            if dlg.help != help:
                LlenaAyuda(dlg, help)
                dlg.help = help
            
        else:

            dlg = DialogTaxTree(prnt)
            dlg.search = search
            dlg.staticTextNotas.Clear()
            dlg.help = help
    
            dlg.poli=poli
            VOrden = getVOrden(type)
            query = QueryTesNode.filter_by(name=type)
            cuenta = None
            try:
                cuenta = query.count()
            except:
                MError(None, u"Ocurri\xf3 un problema de acceso a la red. Se recomienda cerrar el programa y volver a ejecutarlo") 
                
            if cuenta:
                rootElement = QueryTesNode.filter_by(name=type)[0]
                if deep:
                    maxDeep = deep
                else:
                    maxDeep = 999
                
                LlenaTree(dlg.treeCtrl1, None, rootElement, NamePattern=Pattern, poli=poli, VOrden=VOrden, maxDeep=maxDeep)
                
                dlg.Title=title
                
                selecciones = dlg.treeCtrl1.GetSelections()
                dlg.checkBoxInvertir.Show(search)
                LlenaAyuda(dlg, help)
            else: # if query.count():
                MError(prnt, type +u": Vocabulario inv\xe1lido")
                dlg.Destroy()
                return None
            
            if not search and not (type in status.dlgExcepciones):
                status.dlg[search][type]=dlg

      
        dlg.treeCtrl1.CollapseAll()
        root = dlg.treeCtrl1.GetRootItem()
        dlg.treeCtrl1.Expand(root) 
        dlg.tipoActual = None    
        dlg.tiposActuales = []         
        
        dlg.ShowModal()
        if ctrl:
            ctrl.SetLabel( dlg.tipoActual.descripcion)
        tipo =     dlg.tipoActual
        tipos =    dlg.tiposActuales
        invertir = dlg.checkBoxInvertir.GetValue()
        #dlg.Destroy()
        if search:
            return tipos, invertir, dlg.cancelar 
        else:
            return tipo