commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gnue/forms/src/uidrivers _base/UIdriver.py gtk2...


From: Jason Cater
Subject: gnue/forms/src/uidrivers _base/UIdriver.py gtk2...
Date: Wed, 23 Oct 2002 23:08:23 -0400

CVSROOT:        /home/cvs
Module name:    gnue
Changes by:     Jason Cater <address@hidden>    02/10/23 23:08:23

Modified files:
        forms/src/uidrivers/_base: UIdriver.py 
        forms/src/uidrivers/gtk2: UIdriver.py 
        forms/src/uidrivers/nstti: UIdriver.py 
        forms/src/uidrivers/wx: UIdriver.py 

Log message:
        fixed erratic mouse selections with multi-row blocks; greyed out unused 
blocks

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/forms/src/uidrivers/_base/UIdriver.py.diff?cvsroot=OldCVS&tr1=1.74&tr2=1.75&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/forms/src/uidrivers/gtk2/UIdriver.py.diff?cvsroot=OldCVS&tr1=1.10&tr2=1.11&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/forms/src/uidrivers/nstti/UIdriver.py.diff?cvsroot=OldCVS&tr1=1.12&tr2=1.13&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/forms/src/uidrivers/wx/UIdriver.py.diff?cvsroot=OldCVS&tr1=1.196&tr2=1.197&r1=text&r2=text

Patches:
Index: gnue/forms/src/uidrivers/_base/UIdriver.py
diff -c gnue/forms/src/uidrivers/_base/UIdriver.py:1.74 
gnue/forms/src/uidrivers/_base/UIdriver.py:1.75
*** gnue/forms/src/uidrivers/_base/UIdriver.py:1.74     Sat Sep 14 16:15:02 2002
--- gnue/forms/src/uidrivers/_base/UIdriver.py  Wed Oct 23 23:08:22 2002
***************
*** 336,345 ****
  
      # Fill the prior spots
      for count in range(index):
!         value = 
handler.getDisplayFiller(block._resultSet.getRecord(currentRecord- \
!                                 (index-count)).getField(entry.field))
  
-         self._formToUIWidget[entry].setValue(value,count)
  
  
      # Fill current spot
--- 336,346 ----
  
      # Fill the prior spots
      for count in range(index):
!       value = 
handler.getDisplayFiller(block._resultSet.getRecord(currentRecord- \
!                               (index-count)).getField(entry.field))
! 
!       self._formToUIWidget[entry].setValue(value,count)
  
  
  
      # Fill current spot
***************
*** 352,367 ****
      # you do not want to just add 1 to count
      # as the formulas would then be off
      count = index
      while count < int(entry._rows):
        if count != index:
!         rec = block._resultSet.getRecord(currentRecord+(count-index))
  
          if rec == None:
            value = handler.getDisplayFiller(None)
          else:
            value = handler.getDisplayFiller(rec.getField(entry.field))
  
!         self._formToUIWidget[entry].setValue(value, count)
        count += 1
  
      handler.editing = prehandling
--- 353,373 ----
      # you do not want to just add 1 to count
      # as the formulas would then be off
      count = index
+ 
+     lastRow = block._resultSet.getRecordCount()
      while count < int(entry._rows):
        if count != index:
!         cr = currentRecord+(count-index)
!         rec = block._resultSet.getRecord(cr)
  
          if rec == None:
            value = handler.getDisplayFiller(None)
+           # Don't ask... but it's needed
+           lastRow -= 1
          else:
            value = handler.getDisplayFiller(rec.getField(entry.field))
  
!         self._formToUIWidget[entry].setValue(value, count, cr <= lastRow)
        count += 1
  
      handler.editing = prehandling
Index: gnue/forms/src/uidrivers/gtk2/UIdriver.py
diff -c gnue/forms/src/uidrivers/gtk2/UIdriver.py:1.10 
gnue/forms/src/uidrivers/gtk2/UIdriver.py:1.11
*** gnue/forms/src/uidrivers/gtk2/UIdriver.py:1.10      Wed Sep 18 20:17:34 2002
--- gnue/forms/src/uidrivers/gtk2/UIdriver.py   Wed Oct 23 23:08:22 2002
***************
*** 827,833 ****
      else:
        self.widgets[index].grab_focus()
        
!   def setValue(self, value, index=0):
      # These must be here or dropdown style controls
      # will get events they shouldn't and break.
      #$self.widgets[index].SetEvtHandlerEnabled(FALSE
--- 827,833 ----
      else:
        self.widgets[index].grab_focus()
        
!   def setValue(self, value, index=0, enabled=1):
      # These must be here or dropdown style controls
      # will get events they shouldn't and break.
      #$self.widgets[index].SetEvtHandlerEnabled(FALSE
Index: gnue/forms/src/uidrivers/nstti/UIdriver.py
diff -c gnue/forms/src/uidrivers/nstti/UIdriver.py:1.12 
gnue/forms/src/uidrivers/nstti/UIdriver.py:1.13
*** gnue/forms/src/uidrivers/nstti/UIdriver.py:1.12     Thu Oct 17 19:35:01 2002
--- gnue/forms/src/uidrivers/nstti/UIdriver.py  Wed Oct 23 23:08:22 2002
***************
*** 445,451 ****
      widget = self.widgets[index]
      widget.PARENT.SetFocus(widget,run=0)
  
!   def setValue(self, value, index=0):
      self.widgets[index].SetValue(value)
  ##     self.widgets[index].SetEvtHandlerEnabled(FALSE)
  ##     self.widgets[index].SetValue(value)
--- 445,451 ----
      widget = self.widgets[index]
      widget.PARENT.SetFocus(widget,run=0)
  
!   def setValue(self, value, index=0, enabled=1):
      self.widgets[index].SetValue(value)
  ##     self.widgets[index].SetEvtHandlerEnabled(FALSE)
  ##     self.widgets[index].SetValue(value)
Index: gnue/forms/src/uidrivers/wx/UIdriver.py
diff -c gnue/forms/src/uidrivers/wx/UIdriver.py:1.196 
gnue/forms/src/uidrivers/wx/UIdriver.py:1.197
*** gnue/forms/src/uidrivers/wx/UIdriver.py:1.196       Wed Oct 23 22:30:42 2002
--- gnue/forms/src/uidrivers/wx/UIdriver.py     Wed Oct 23 23:08:23 2002
***************
*** 51,56 ****
--- 51,58 ----
  _IdToGFObj = {}
  _IdToUIObj = {}
  
+ _disabledColour = wxLIGHT_GREY
+ 
  # Finishing creation of dictionary for language font encodings
  
  encodings = {
***************
*** 240,246 ****
      self.statusBar.SetStatusWidths([-1,50,50,75,75])
      initFont(self.statusBar,0)
  
!     
      # This will be a dict of the form { 'requestROLLBACK': 1001 }
      # where 1001 is the wxId associated with requestROLLBACK.
      self.__eventMenuMapping = {}
--- 242,248 ----
      self.statusBar.SetStatusWidths([-1,50,50,75,75])
      initFont(self.statusBar,0)
  
! 
      # This will be a dict of the form { 'requestROLLBACK': 1001 }
      # where 1001 is the wxId associated with requestROLLBACK.
      self.__eventMenuMapping = {}
***************
*** 323,328 ****
--- 325,333 ----
      mainToolBar.Realize()
  
      self.mainWindow.panel = wxPanel(self.mainWindow,-1, 
wxDefaultPosition,self.mainWindow.GetClientSize())
+     
+     global _disabledColour
+     _disabledColour = self.mainWindow.GetBackgroundColour()
  
      self.currentWidget = [self.mainWindow.panel]
      self._wxapp.SetTopWindow(self.mainWindow)
***************
*** 619,630 ****
    def indexedFocus(self, index):
      self.widgets[index].SetFocus()
  
!   def setValue(self, value, index=0):
      # These must be here or dropdown style controls
      # will get events they shouldn't and break.
!     self.widgets[index].SetEvtHandlerEnabled(FALSE)
!     self.widgets[index].SetValue(value)
!     self.widgets[index].SetEvtHandlerEnabled(TRUE)
  
    def setCursorPosition(self, position, index=0):
      try:
--- 624,641 ----
    def indexedFocus(self, index):
      self.widgets[index].SetFocus()
  
!   def setValue(self, value, index=0, enabled=1):
      # These must be here or dropdown style controls
      # will get events they shouldn't and break.
!     widget = self.widgets[index]
!     widget.SetEvtHandlerEnabled(FALSE)
!     widget.SetValue(value)
!     widget.Enable(enabled)
!     widget.SetEvtHandlerEnabled(TRUE)
!     if enabled:
!       widget.SetBackgroundColour(widget.__origBackgroundColor)
!     else:
!       widget.SetBackgroundColour(_disabledColour)
  
    def setCursorPosition(self, position, index=0):
      try:
***************
*** 644,649 ****
--- 655,661 ----
      _IdToWxObj[id]=widget
      _IdToGFObj[id]=gfobject
      _IdToUIObj[id]=uiobject
+     widget.__origBackgroundColor = widget.GetBackgroundColour()
  
  
    def _deleteFromCrossRef(self, widget, object):




reply via email to

[Prev in Thread] Current Thread [Next in Thread]