commit-gnue
[Top][All Lists]
Advanced

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

gnue/designer/src forms/LayoutEditor/WidgetHand...


From: Jason Cater
Subject: gnue/designer/src forms/LayoutEditor/WidgetHand...
Date: Tue, 21 Jan 2003 00:03:06 -0500

CVSROOT:        /cvsroot/gnue
Module name:    gnue
Changes by:     Jason Cater <address@hidden>    03/01/21 00:02:41

Modified files:
        designer/src/forms/LayoutEditor: WidgetHandler.py 
        designer/src/templates/forms: FormBuilder.py 

Log message:
        misc bug fixes

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/designer/src/forms/LayoutEditor/WidgetHandler.py.diff?tr1=1.8&tr2=1.9&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/designer/src/templates/forms/FormBuilder.py.diff?tr1=1.12&tr2=1.13&r1=text&r2=text

Patches:
Index: gnue/designer/src/forms/LayoutEditor/WidgetHandler.py
diff -c gnue/designer/src/forms/LayoutEditor/WidgetHandler.py:1.8 
gnue/designer/src/forms/LayoutEditor/WidgetHandler.py:1.9
*** gnue/designer/src/forms/LayoutEditor/WidgetHandler.py:1.8   Wed Jan  1 
19:45:46 2003
--- gnue/designer/src/forms/LayoutEditor/WidgetHandler.py       Tue Jan 21 
00:02:41 2003
***************
*** 280,285 ****
--- 280,290 ----
  
      nx = dx * self.instance.gridWidth
      ny = dy * self.instance.gridHeight
+     
+     try:
+       self.object.Char__height
+     except: 
+       self.object.Char__height = 1
  
      if (self.object.Char__width + dx < 0 or self.object.Char__height + dy < 
0):
        return 0
Index: gnue/designer/src/templates/forms/FormBuilder.py
diff -c gnue/designer/src/templates/forms/FormBuilder.py:1.12 
gnue/designer/src/templates/forms/FormBuilder.py:1.13
*** gnue/designer/src/templates/forms/FormBuilder.py:1.12       Wed Jan  1 
19:45:47 2003
--- gnue/designer/src/templates/forms/FormBuilder.py    Tue Jan 21 00:02:41 2003
***************
*** 360,365 ****
--- 360,366 ----
      formwidth = 0
      formheight = 0
      basey = 0
+     height = 0
      dataSourceArray = {}
      pageCounter = 1
  
***************
*** 370,382 ****
          page = self.AddElement('page', layout,
                                 {  'name': 'pg%s' % pageCounter })
          basey=0
  
        tableKey = string.upper(self.variables['table%s' % count])
!       datasource = self.AddElement('datasource', self.form,
!                                    {  'connection': 
self.variables['connection%s' % count],
!                                       'table': self.variables['table%s' % 
count],
!                                       'type': 'object',
!                                       'name': 'dts%s%s' %  (tableKey,count) })
  
  
        # Is this a grid style form?
--- 371,392 ----
          page = self.AddElement('page', layout,
                                 {  'name': 'pg%s' % pageCounter })
          basey=0
+         height=0
  
        tableKey = string.upper(self.variables['table%s' % count])
!       
!       attrs = { 'connection': self.variables['connection%s' % count],
!                 'table': self.variables['table%s' % count],
!                 'type': 'object',
!                 'name': 'dts%s%s' %  (tableKey,count) }
! 
!       if self.variables['hasmaster%s' % count] == '1':
!         attrs['master'] = dataSourceArray[self.variables['mastertable%s' % 
count]].name
!         attrs['masterlink'] = string.join(self.variables['masterkeys%s' % 
count],',')
!         attrs['detaillink'] = string.join(self.variables['detailkeys%s' % 
count],',')
!                       
!       datasource = self.AddElement('datasource', self.form, attrs)
!       dataSourceArray[count] = datasource
  
  
        # Is this a grid style form?
***************
*** 457,463 ****
          # If we have a length for the field, use this as the max_length
          # for the entry. Also, adjust the display width if necessary.
          if hasattr(field,'length'):
!           ln = min(field.length, 25)
            attrs['max_length'] = ln
            largestField = max(largestField, ln)
          else:
--- 467,473 ----
          # If we have a length for the field, use this as the max_length
          # for the entry. Also, adjust the display width if necessary.
          if hasattr(field,'length'):
!           ln = max(min(field.length, 25),0) or 10 
            attrs['max_length'] = ln
            largestField = max(largestField, ln)
          else:
***************
*** 478,484 ****
        # Grid/multirecord layout
        if multirecord:
  
!         height = 13
          width = 1
          x = 1
  
--- 488,494 ----
        # Grid/multirecord layout
        if multirecord:
  
!         height += 13
          width = 1
          x = 1
  
***************
*** 488,496 ****
            textLen = len(text)
  
            labelQueue[i][1] = x
!           labelQueue[i][2] = 1
            entryQueue[i][1] = x
!           entryQueue[i][2] = 2
  
            # If label width is larger than entry width, center the entry
            try:
--- 498,506 ----
            textLen = len(text)
  
            labelQueue[i][1] = x
!           labelQueue[i][2] = basey + 1
            entryQueue[i][1] = x
!           entryQueue[i][2] = basey + 2
  
            # If label width is larger than entry width, center the entry
            try:
***************
*** 506,511 ****
--- 516,522 ----
            # Increase the form width accordingly
            width += dx
            x += dx
+         basey += 12
  
        # Single Record layout (regardless of label location)
        else:
***************
*** 529,547 ****
            width = 2 + max(largestField, largestLabel)
  
          # Rearrange
!         height = fy+2-fdy
          for i in range(len(entryQueue)):
            labelQueue[i][1] = lx
!           labelQueue[i][2] = ly
            entryQueue[i][1] = fx
!           entryQueue[i][2] = fy
  
            ly = ly + ldy
            lx = lx + ldx
            fy = fy + fdy
            fx = fx + fdx
            height += fdy
! 
  
        #
        # Finally, add the visual elements...
--- 540,559 ----
            width = 2 + max(largestField, largestLabel)
  
          # Rearrange
!         height += fy+2-fdy
!         by = basey
          for i in range(len(entryQueue)):
            labelQueue[i][1] = lx
!           labelQueue[i][2] = by + ly
            entryQueue[i][1] = fx
!           entryQueue[i][2] = by + fy
  
            ly = ly + ldy
            lx = lx + ldx
            fy = fy + fdy
            fx = fx + fdx
            height += fdy
!           basey += fdy
  
        #
        # Finally, add the visual elements...
***************
*** 588,594 ****
      #
      # Set the basic attributes of the form
      #
!     self.form['title'] = title
      layout['Char:width'] = formwidth
      layout['Char:height'] = formheight
  
--- 600,606 ----
      #
      # Set the basic attributes of the form
      #
!     self.form['title'] = self.variables['title']
      layout['Char:width'] = formwidth
      layout['Char:height'] = formheight
  




reply via email to

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