def onSelect(self, event):
     #mapsafe
     log.op("WindowRegisterBrowser.onSelect",
            [self._elementOf(self._unmap(event.GetIndex())), self._smart],
            0)
     if (not self._smart) or self._windowVeto:
         RegisterBrowser.onSelect(self, event)
     else:
         rawItemId = event.GetIndex()
         itemId = self._unmap(rawItemId)
         if rawItemId / float(self.LIMIT()) < 0.25 or rawItemId / float(
                 self.LIMIT()) > 0.75:
             self._scrollBrowser(itemId)
             self._windowVeto = True
             self._select(itemId)
             self._windowVeto = False
         else:
             RegisterBrowser.onSelect(self, event)
     log.opr("WindowRegisterBrowser.onSelect return", [], 1)
Exemple #2
0
	def onSelect(self, event):
		#print "reg select"
		if self._binary:
			#self.stopBinarySearch()
			for l in self._listeners:
				l.stop_binary_search()
		if self._veto:
			return
		if self.__localVeto:
			RegisterBrowser.onSelect(self, event)
		elif self.__level in ["FICHE-ENTRY", "FICHE-GAP"]:
			itemId = event.GetIndex()
			element = self._item2element[itemId]
			entry = None
			for l in self._listeners:
				entry = l.request_entry_change()
			if entry != None and not (self.__noLocate):
				if not ((self.__entry == None and entry == u"") or (self.__entry != None and (self.__entry == entry or (entry == u"" and self._selected != self._items[0] and self._selected != self._items[-1])))):
					for l in self._listeners:
						l.locate_needed(element)
					RegisterBrowser.onSelect(self, event)
					return
			ind = self.__index + self._items.index(itemId) - self.__limit / 2
			if ind < 0:
				ind = 0
			#print self._items.index(itemId), len(self._items), itemId
			if (self._items.index(itemId) / float(len(self._items)) < 0.25 or self._items.index(itemId) / float(len(self._items)) > 0.75) and len(self._items) > 1:
				if self.__level == "FICHE-GAP":
					(elements, self.__index, self.__next) = self.__dBController.getFichesForGap(self.__selectedElement[1], self.__selectedElement[2], self.__limit, ind, len(self._items))
				else:
					(elements, self.__index, self.__next) = self.__dBController.getFichesForEntry(self.__selectedElement, self.__limit, ind, len(self._items))					
				self.DeleteAllItems()
				self.__fillRegister(elements)
				itemId = self._element2item[element]
				self.__localVeto = True
				self.__noLocate = True
				self._select(itemId)
				self.__noLocate = False
				self.__localVeto = False
			else:
				RegisterBrowser.onSelect(self, event)
		else:
			itemId = event.GetIndex()
			element = self._item2element[itemId]
			for l in self._listeners:
				l.on_structure_element_selected(self.__text(element))
			RegisterBrowser.onSelect(self, event)
Exemple #3
0
	def onSelect(self, event):
		log.op("StructureRegisterBrowser.onSelect", [self._elementOf(self._unmap(event.GetIndex()))], 0)
		RegisterBrowser.onSelect(self, event)
		log.opr("StructureRegisterBrowser.onSelect return", [], 1)