commit-gnue
[Top][All Lists]
Advanced

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

gnue-forms/src GFParser.py GFObjects/GFBlock.py...


From: Bajusz Tamás
Subject: gnue-forms/src GFParser.py GFObjects/GFBlock.py...
Date: Tue, 19 Aug 2003 08:10:15 -0400

CVSROOT:        /cvsroot/gnue
Module name:    gnue-forms
Branch:         
Changes by:     Bajusz Tamás <address@hidden>   03/08/19 08:10:15

Modified files:
        src            : GFParser.py 
        src/GFObjects  : GFBlock.py GFScrollBar.py 
        src/uidrivers/wx/widgets: scrollbar.py 

Log message:
        adding scrollbar support

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-forms/src/GFParser.py.diff?tr1=1.111&tr2=1.112&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-forms/src/GFObjects/GFBlock.py.diff?tr1=1.84&tr2=1.85&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-forms/src/GFObjects/GFScrollBar.py.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-forms/src/uidrivers/wx/widgets/scrollbar.py.diff?tr1=1.1&tr2=1.2&r1=text&r2=text

Patches:
Index: gnue-forms/src/GFObjects/GFBlock.py
diff -c gnue-forms/src/GFObjects/GFBlock.py:1.84 
gnue-forms/src/GFObjects/GFBlock.py:1.85
*** gnue-forms/src/GFObjects/GFBlock.py:1.84    Tue Jun 17 17:29:54 2003
--- gnue-forms/src/GFObjects/GFBlock.py Tue Aug 19 08:10:15 2003
***************
*** 67,72 ****
--- 67,74 ----
      self._gap = 0
      self._rows = 1
  
+     self._scrollbars= []
+ 
      # Populated by GFEntry's initialize
      self._entryList = []
  
***************
*** 259,264 ****
--- 261,270 ----
        self._form.updateUIEntry(field)
        self._form.refreshUIEvents()
  
+     # Adjusting scrollbars
+     for sb in self._scrollbars:
+       sb.adjustScrollbar(self._currentRecord, self._recordCount)
+ 
    #
    # newRecord
    #
***************
*** 534,539 ****
--- 540,553 ----
        block.processTrigger('POST-QUERY')
        for field in block._fieldList:
          field.processTrigger('POST-QUERY')
+ 
+     # Adjusting scrollbars
+     for sb in self._scrollbars:
+       sb.adjustScrollbar(self._currentRecord, self._recordCount)
+ 
+ 
+   def registerScrollbar(self, sb):
+     self._scrollbars.append(sb)
  
  #
  # _generateConditional
Index: gnue-forms/src/GFObjects/GFScrollBar.py
diff -c gnue-forms/src/GFObjects/GFScrollBar.py:1.4 
gnue-forms/src/GFObjects/GFScrollBar.py:1.5
*** gnue-forms/src/GFObjects/GFScrollBar.py:1.4 Wed Jun 11 15:55:17 2003
--- gnue-forms/src/GFObjects/GFScrollBar.py     Tue Aug 19 08:10:15 2003
***************
*** 43,52 ****
      self.label = ""
      self.rows = 1
  
  
  
! 
! 
  
  
  
--- 43,59 ----
      self.label = ""
      self.rows = 1
  
+     # Runtime Variables
+     self._inits = [self.initialize]
  
+   def initialize(self):
+     self._form = self.findParentOfType('GFForm')
  
!     # ...Block
!     try:
!       self._block = block = self._form._logic._blockMap[self.block]
!     except KeyError:
!       raise "Entry references non-existent block '%s'" % self.block
  
  
  
Index: gnue-forms/src/GFParser.py
diff -c gnue-forms/src/GFParser.py:1.111 gnue-forms/src/GFParser.py:1.112
*** gnue-forms/src/GFParser.py:1.111    Wed Jun 11 21:00:09 2003
--- gnue-forms/src/GFParser.py  Tue Aug 19 08:10:15 2003
***************
*** 508,513 ****
--- 508,517 ----
        'scrollbar': {
           'BaseClass': GFObjects.GFScrollBar,
           'Attributes': {
+             'name': {
+                'Unique': 1,
+                'Typecast': GTypecast.name,
+                'Description': 'TODO' },
              'block': {
                 'Required': 1,
                 'Typecast': GTypecast.name,
Index: gnue-forms/src/uidrivers/wx/widgets/scrollbar.py
diff -c gnue-forms/src/uidrivers/wx/widgets/scrollbar.py:1.1 
gnue-forms/src/uidrivers/wx/widgets/scrollbar.py:1.2
*** gnue-forms/src/uidrivers/wx/widgets/scrollbar.py:1.1        Mon Feb 10 
21:01:49 2003
--- gnue-forms/src/uidrivers/wx/widgets/scrollbar.py    Tue Aug 19 08:10:15 2003
***************
*** 28,41 ****
  #
  from wxPython.wx import *
  
! ## from gnue.forms import VERSION
! ## from gnue.forms.GFForm import *
! ## from gnue.forms.uidrivers._base.UIdriver import *
  
- ## from gnue.forms.uidrivers.wx.GFwxApp import *
- ## from gnue.forms.uidrivers.wx.UIWXSplashScreen import *
  from gnue.forms.uidrivers.wx.widgets._base import UIHelper
! ## from gnue.common import *
  
  
  #
--- 28,39 ----
  #
  from wxPython.wx import *
  
! from wxPython.wx import *
! from gnue.common import events
  
  from gnue.forms.uidrivers.wx.widgets._base import UIHelper
! from gnue.forms.uidrivers.wx.common import _eventObjTowxWindow
! from gnue.forms.uidrivers.wx.common import _setDefaultEventHandlers
  
  
  #
***************
*** 47,57 ****
  class UIScrollBar(UIHelper):
    def _createWidget(self, event, spacer):
      object = event.object
!     newWidget =wxScrollBar(event.container,-1,
                             
wxPoint(object.Char__x*event.widgetWidth,(object.Char__y+spacer)*event.widgetHeight),
                             
wxSize(object.Char__width*event.widgetWidth,object.Char__height*event.widgetHeight),
                             wxSB_VERTICAL)
      return newWidget
  
  configuration = {
      'baseClass'  : UIScrollBar,
--- 45,81 ----
  class UIScrollBar(UIHelper):
    def _createWidget(self, event, spacer):
      object = event.object
!     newWidget = self._widget = wxScrollBar(event.container,-1,
                             
wxPoint(object.Char__x*event.widgetWidth,(object.Char__y+spacer)*event.widgetHeight),
                             
wxSize(object.Char__width*event.widgetWidth,object.Char__height*event.widgetHeight),
                             wxSB_VERTICAL)
+ 
+     if event.initialize:
+       self._eventHandler = event.eventHandler
+       EVT_COMMAND_SCROLL(newWidget, newWidget.GetId(), self.scrollbarHandler)
+       _setDefaultEventHandlers(newWidget, event.eventHandler, 
event.initialize,self._uiDriver)
+ 
+       object._block.registerScrollbar(self)
+       self._rows = object._block._rows
+ 
      return newWidget
+ 
+   def scrollbarHandler(self, event):
+     object = _eventObjTowxWindow(event)
+     id = object.GetId()
+ 
+     value = object.GetThumbPosition()
+     recno = int(value)+1
+ 
+     gfObject     = self._uiDriver._IdToGFObj[id]
+     action = events.Event('requestRECORDNUMBER',object=gfObject,
+                             data=recno,
+                           _form=gfObject._form)
+     self._eventHandler(action)
+ 
+   def adjustScrollbar(self, pos, range):
+       # position, thumbSize, range, pageSize, refresh = TRUE
+       self._widget.SetScrollbar(pos, 1, range, self._rows-1)
  
  configuration = {
      'baseClass'  : UIScrollBar,




reply via email to

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