commit-gnue
[Top][All Lists]
Advanced

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

gnue/designer/src/forms/wizards CreateWebForm.py


From: Jan Ischebeck
Subject: gnue/designer/src/forms/wizards CreateWebForm.py
Date: Tue, 29 Apr 2003 16:36:12 -0400

CVSROOT:        /cvsroot/gnue
Module name:    gnue
Changes by:     Jan Ischebeck <address@hidden>  03/04/29 16:36:12

Modified files:
        designer/src/forms/wizards: CreateWebForm.py 

Log message:
        minor fixes + menu entry/name change

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/designer/src/forms/wizards/CreateWebForm.py.diff?tr1=1.1&tr2=1.2&r1=text&r2=text

Patches:
Index: gnue/designer/src/forms/wizards/CreateWebForm.py
diff -c gnue/designer/src/forms/wizards/CreateWebForm.py:1.1 
gnue/designer/src/forms/wizards/CreateWebForm.py:1.2
*** gnue/designer/src/forms/wizards/CreateWebForm.py:1.1        Mon Apr 28 
18:04:04 2003
--- gnue/designer/src/forms/wizards/CreateWebForm.py    Tue Apr 29 16:36:12 2003
***************
*** 42,48 ****
  #         - add tooltips to Toolbar Icons 
  #         - support multiple rows
  #         - create page switching tab (if enabled)
! #         - add code for a login/logged out window on top of the form
  
  
  from gnue.designer.forms.TemplateSupport import *
--- 42,48 ----
  #         - add tooltips to Toolbar Icons 
  #         - support multiple rows
  #         - create page switching tab (if enabled)
! #         - add code for a login/logged out window on top of the form (done)
  
  
  from gnue.designer.forms.TemplateSupport import *
***************
*** 309,315 ****
  
        if hasattr(obj,'default'):
          # TODO: fix default values (default is a keyword in javascript)
!         outp+="field.default='%s';\n" % obj.default
  
        if hasattr(obj,'max_length'):
          outp+="field.max_length='%s';\n" % obj.max_length
--- 309,315 ----
  
        if hasattr(obj,'default'):
          # TODO: fix default values (default is a keyword in javascript)
!         outp+="field._default='%s';\n" % obj.default
  
        if hasattr(obj,'max_length'):
          outp+="field.max_length='%s';\n" % obj.max_length
***************
*** 326,331 ****
--- 326,336 ----
        outp+="label._setParent(page);\n"
        outp+="label.name='%s';\n\n" % obj.name
  
+     if obj._type=='GFBox':
+       outp+="box = new GFBox(page);\n"    # do we need to add gflayout?
+       outp+="box._setParent(page);\n"
+       outp+="box.name='%s';\n\n" % obj.name
+ 
      if obj._type=='GFButton':
        outp+="btn = new GFButton(page);\n" # do we need to add gflayout?
        outp+="btn._setParent(page);\n"
***************
*** 344,354 ****
        if hasattr(obj,'__Char_x'):
          outp+="entry.__char_x='%s';\n" % obj.__Char_x
  
!       if hasattr(obj,'__Char_x'):
!         outp+="entry.__char_x='%s';\n" % obj.__Char_x
  
!       if hasattr(obj,'__Char_x'):
!         outp+="entry.__char_x='%s';\n" % obj.__Char_x
          
        outp+='\n'
  
--- 349,362 ----
        if hasattr(obj,'__Char_x'):
          outp+="entry.__char_x='%s';\n" % obj.__Char_x
  
!       if hasattr(obj,'__Char_y'):
!         outp+="entry.__char_y='%s';\n" % obj.__Char_y
  
!       if hasattr(obj,'__Char_width'):
!         outp+="entry.__char_width='%s';\n" % obj.__Char_width
! 
!       if hasattr(obj,'__Char_height'):
!         outp+="entry.__char_height='%s';\n" % obj.__Char_heigth
          
        outp+='\n'
  
***************
*** 428,462 ****
      return outp;
  
    def addStatusBar(self):
!     return """
  <DIV STYLE="position:absolute; top: %spx;left: %spx;width: %spx;border-width: 
1px; border-style: solid;background-color:#EEEEEE;" align="right">
       <div id="status" style="display:inline"></div> | 
       <div id="pos" style="display:inline"></div> | 
       <div id="max" style="display:inline"></div>&nbsp;&nbsp;
  </DIV>
! """ % (((self.Ysize+2)*self.Yraster)+self.yBase+20,\
!         (max([self.Xsize*self.Xraster,540])/2+self.xBase-270),540)
  
  
    def computePageSize(self,obj):
      if ((obj._type=='GFEntry') or  (obj._type=='GFLabel') or \
          (obj._type=='GFButton')) and not obj.hidden:
  
!       if not hasattr(obj,'width'):
          if (obj._type=='GFLabel'):
!           obj.width=len(obj.text)
          else:
!           obj.width=10 # TODO: use default from gConfig instead
  
!       if not hasattr(obj,'height'):
!         obj.height=1 # TODO: use default from gConfig instead
  
        # compute max/min
!       if obj.x+obj.width>self.Xsize:
!         self.Xsize=int(obj.x+obj.width+1)
        
!       if obj.y+obj.height>self.Ysize:
!         self.Ysize=int(obj.y+obj.height+1)
  
      for child in obj._children:
        self.computePageSize(child)
--- 436,470 ----
      return outp;
  
    def addStatusBar(self):
!     return '''
  <DIV STYLE="position:absolute; top: %spx;left: %spx;width: %spx;border-width: 
1px; border-style: solid;background-color:#EEEEEE;" align="right">
       <div id="status" style="display:inline"></div> | 
       <div id="pos" style="display:inline"></div> | 
       <div id="max" style="display:inline"></div>&nbsp;&nbsp;
  </DIV>
! ''' % (((self.Ysize+2)*self.Yraster)+self.yBase+20,\
!        (max([self.Xsize*self.Xraster,540])/2+self.xBase-270),540)
  
  
    def computePageSize(self,obj):
      if ((obj._type=='GFEntry') or  (obj._type=='GFLabel') or \
          (obj._type=='GFButton')) and not obj.hidden:
  
!       if not hasattr(obj,'Char__width'):
          if (obj._type=='GFLabel'):
!           obj.Char__width=len(obj.text)
          else:
!           obj.Char__width=10 # TODO: use default from gConfig instead
  
!       if not hasattr(obj,'Char__height'):
!         obj.Char__height=1 # TODO: use default from gConfig instead
  
        # compute max/min
!       if obj.Char__x+obj.Char__width>self.Xsize:
!         self.Xsize=int(obj.Char__x+obj.Char__width+1)
        
!       if obj.Char__y+obj.Char__height>self.Ysize:
!         self.Ysize=int(obj.Char__y+obj.Char__height+1)
  
      for child in obj._children:
        self.computePageSize(child)
***************
*** 468,490 ****
      outp=""
      
      if ((obj._type=='GFEntry') or (obj._type=='GFLabel') or \
!         (obj._type=='GFButton')) and not obj.hidden:
          
-       # Check if we shoudn't use obj.Char__x etc. instead
        pos_code='STYLE="position:absolute; '+\
!                 'top: %spx;' % int(obj.y*self.Yraster+self.yBase) +\
!                 'left: %spx;' % int(obj.x*self.Xraster+self.xBase) +\
!                 'width: %spx;' % int(obj.width*self.Xraster) +\
!                 'height: %spx;' % int(obj.height*self.Yraster-self.baseline)
  
        if visible==0: 
        pos_code+='visibility:hidden;'
  
        if obj._type=='GFLabel':
          pos_code+='font-size: %spx;' % int(self.fontsize) +\
!                    'line-height: %spx"' % int(self.lineheight)
        else:
!         pos_code+='font-size: %spx;"' % int(self.fontsize_entry)
  
        # TODO: add loop for row setting
        if obj._type=='GFEntry':
--- 476,502 ----
      outp=""
      
      if ((obj._type=='GFEntry') or (obj._type=='GFLabel') or \
!         (obj._type=='GFButton') or (obj._type=='GFBox')) and not obj.hidden:
          
        pos_code='STYLE="position:absolute; '+\
!                 'top: %spx;' % int(obj.Char__y*self.Yraster+self.yBase) +\
!                 'left: %spx;' % int(obj.Char__x*self.Xraster+self.xBase) +\
!                 'width: %spx;' % int(obj.Char__width*self.Xraster) +\
!                 'height: %spx;' % 
int(obj.Char__height*self.Yraster-self.baseline)
  
        if visible==0: 
        pos_code+='visibility:hidden;'
  
        if obj._type=='GFLabel':
          pos_code+='font-size: %spx;' % int(self.fontsize) +\
!                    'line-height: %spx' % int(self.lineheight)
!       else:
!         pos_code+='font-size: %spx;' % int(self.fontsize_entry)
! 
!       if obj._type=='GFBox':
!         pos_code+='border-width: 1px; border-style: solid;"'
        else:
!         pos_code+='"'
  
        # TODO: add loop for row setting
        if obj._type=='GFEntry':
***************
*** 523,528 ****
--- 535,545 ----
          outp+='  <button %s id="%s_button">%s</button>\n' % \
                 (pos_code,obj.name,obj.label)
  
+       elif obj._type=='GFBox':
+         outp+='  <!-- Box %s -->\n' % obj.name
+         outp+='  <div %s id="%s_box">%s</div>\n' % \
+                (pos_code,obj.name,obj.label)
+ 
          
  
      for child in obj._children:
***************
*** 555,566 ****
  TemplateInformation = {
      'Product': 'forms',
      'BaseClass' : CreateWebFormWizard,
!     'Name' : 'Create Web Form',
!     'Description' : 'create a gnue Web Form file',
      'Version' : VERSION,
      'Author' : 'The GNUe Designer Team',
      'Behavior': WIZARD,
!     'Location' : 'Extras|Create WebForm'
  }
  
  if __name__ == "__main__":
--- 572,583 ----
  TemplateInformation = {
      'Product': 'forms',
      'BaseClass' : CreateWebFormWizard,
!     'Name' : 'Compile Form for GNUe JsForms',
!     'Description' : 'create a intermediate html+java for the jsForms client',
      'Version' : VERSION,
      'Author' : 'The GNUe Designer Team',
      'Behavior': WIZARD,
!     'Location' : 'Extras|Compile Form for GNUe JsForms'
  }
  
  if __name__ == "__main__":




reply via email to

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