/[papo]/gnue/forms/src/GFForm.py
ViewVC logotype

Diff of /gnue/forms/src/GFForm.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.14.2.3 by apronotti, Mon Feb 17 22:52:47 2003 UTC revision 1.14.2.4 by styxman, Tue May 6 14:32:12 2003 UTC
# Line 60  class GFMainToolBar(GFObj, GFEventAware) Line 60  class GFMainToolBar(GFObj, GFEventAware)
60      GFObj.__init__(self, parent)      GFObj.__init__(self, parent)
61      self._type = "GFMainToolBar"      self._type = "GFMainToolBar"
62      self._currentObject = [self]      self._currentObject = [self]
63      
64    
65  class GFForm(GFObj, GRootObj, GFEventAware):  class GFForm(GFObj, GRootObj, GFEventAware):
66    def __init__(self, parent=None, app=None):    def __init__(self, parent=None, app=None):
# Line 92  class GFForm(GFObj, GRootObj, GFEventAwa Line 92  class GFForm(GFObj, GRootObj, GFEventAwa
92    
93      # This will be set by GFInstance      # This will be set by GFInstance
94      self._parameters = {}      self._parameters = {}
95        
96      # The "None" init gives datasources time to setup master/detail      # The "None" init gives datasources time to setup master/detail
97      self._inits = [self.primaryInit, None, self.secondaryInit]      self._inits = [self.primaryInit, None, self.secondaryInit]
98    
# Line 109  class GFForm(GFObj, GRootObj, GFEventAwa Line 109  class GFForm(GFObj, GRootObj, GFEventAwa
109                                'genericBox':{'function':self.triggerGenericBox},                                'genericBox':{'function':self.triggerGenericBox},
110                                'callTrigger':{'function':self.triggerCallTrigger},                                'callTrigger':{'function':self.triggerCallTrigger},
111                                'exit':{'function':self.exit},                                'exit':{'function':self.exit},
112                                'setParameter':{'function':self.setParameter},                                                              'setParameter':{'function':self.setParameter},
113                                'getParameter':{'function':self.getParameter,                                'getParameter':{'function':self.getParameter,
114                                            'global': 1,                                            'global': 1,
115                                            },                                            },
116                                }                                }
117    
118    
119      
120    #    #
121    # Convert some deprecated options to new style    # Convert some deprecated options to new style
122    #    #
# Line 263  class GFForm(GFObj, GRootObj, GFEventAwa Line 263  class GFForm(GFObj, GRootObj, GFEventAwa
263    # an event source    # an event source
264    #    #
265    def changeFocus(self, widget, fireFocusTriggers=1):    def changeFocus(self, widget, fireFocusTriggers=1):
266        
267      GDebug.printMesg (4, 'changing focus')      GDebug.printMesg (4, 'changing focus')
268      # for i in dir (widget):      # for i in dir (widget):
269        # attr= getattr (widget, i)        # attr= getattr (widget, i)
# Line 543  class GFForm(GFObj, GRootObj, GFEventAwa Line 543  class GFForm(GFObj, GRootObj, GFEventAwa
543        block.processRollback(recover)        block.processRollback(recover)
544      self.refreshDisplay(self)      self.refreshDisplay(self)
545      self._currentBlock.jumpRecord(self._currentBlock._currentRecord)      self._currentBlock.jumpRecord(self._currentBlock._currentRecord)
546        
547    #    #
548    # fireTrigger    # fireTrigger
549    #    #
# Line 554  class GFForm(GFObj, GRootObj, GFEventAwa Line 554  class GFForm(GFObj, GRootObj, GFEventAwa
554  # Updated methods for the new gfclient code  # Updated methods for the new gfclient code
555  #  #
556    
557      # ugh!
558      def gimmeNames (self, x):
559        try:
560          r= x.name
561        except AttributeError:
562          try:
563            r= x.label
564          except AttributeError:
565            try:
566              r= x._value
567            except AttributeError:
568              r= x
569        return r
570    
571    
572    def _getFocusableEntries (self, children):    def _getFocusableEntries (self, children):
573      # I *hate* debug      # I *hate* debug
574      # GDebug.printMesg (5, )  
575            # GDebug.printMesg (1, "_gFE: children: %s" % map (self.gimmeNames, children))
576      entryNo= 0      entryNo= 0
577      result= children      result= children
578      for entry in children:      for entry in children:
579        # shouldn't this be 'in containers'?        # shouldn't this be 'in containers'?
580        if entry._type == 'GFBox':        if entry._type in [ 'GFBox', 'GFBlock' ]:
581          next= self._getFocusableEntries (entry._children)          next= self._getFocusableEntries (entry._children)
582          # replace the box with its children recursively          # replace the box with its children recursively
583          result= result[:entryNo]+next+result[entryNo+1:]          result= result[:entryNo]+next+result[entryNo+1:]
584          entryNo= entryNo+len (next)          entryNo= entryNo+len (next)
585        entryNo= entryNo+1        entryNo= entryNo+1
586    
587        # GDebug.printMesg (1, "_gFE: result: %s" % map (self.gimmeNames, result))
588      return result      return result
589      
590    #    #
591    # nextEntry    # nextEntry
592    #    #
# Line 582  class GFForm(GFObj, GRootObj, GFEventAwa Line 598  class GFForm(GFObj, GRootObj, GFEventAwa
598      nextEntry = None      nextEntry = None
599      keepNext = 0      keepNext = 0
600    
601      entryList= self._getFocusableEntries (self._currentBlock._children)      # entryList= self._getFocusableEntries (self._currentBlock._children)
602        entryList= self._getFocusableEntries (self._currentPage._children)
603      for object in entryList:      for object in entryList:
604        # Put the first field as the next to rollover        # Put the first field as the next to rollover
605        if (object._type in TabStops and        if (object._type in TabStops and
# Line 618  class GFForm(GFObj, GRootObj, GFEventAwa Line 635  class GFForm(GFObj, GRootObj, GFEventAwa
635      nextEntry = None      nextEntry = None
636      lastEntry = self._currentEntry      lastEntry = self._currentEntry
637    
638      entryList= self._getFocusableEntries (self._currentBlock._children)      # entryList= self._getFocusableEntries (self._currentBlock._children)
639        entryList= self._getFocusableEntries (self._currentPage._children)
640      for object in entryList:      for object in entryList:
641        if (object._type in TabStops and        if (object._type in TabStops and
642            (not object.hidden) and ((not object.readonly) or            (not object.hidden) and ((not object.readonly) or
# Line 765  class GFForm(GFObj, GRootObj, GFEventAwa Line 783  class GFForm(GFObj, GRootObj, GFEventAwa
783    
784    def triggerCallTrigger(self, triggerName):    def triggerCallTrigger(self, triggerName):
785      self._triggerDictionary[triggerName](self)      self._triggerDictionary[triggerName](self)
786        

Legend:
Removed from v.1.14.2.3  
changed lines
  Added in v.1.14.2.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26