Author: reinhard Date: 2011-06-18 04:18:15 -0500 (Sat, 18 Jun 2011) New Revision: 10330
Modified: trunk/gnue-designer/ trunk/gnue-designer/src/templates/forms/FormBuilder.py trunk/gnue-designer/src/templates/forms/Simple.py Log: Field length vs entry width - form to allow value with full column size. Property changes on: trunk/gnue-designer ___________________________________________________________________ Name: bzr:revision-info - timestamp: 2011-06-10 12:37:06.089999914 -0700 committer: whizman properties: branch-nick: designer + timestamp: 2011-06-10 14:28:20.727999926 -0700 committer: whizman properties: branch-nick: designer Name: bzr:file-ids - FAQ 5245@3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-designer:FAQ src/forms/Incubator.py 2934@3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-designer:src%2Fforms%2FIncubator.py src/forms/PagePainter/skins/common.py 8340@3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-designer:src%2Fforms%2FPagePainter%2Fskins%2Fcommon.py src/forms/PagePainter/skins/default.py 8340@3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-designer:src%2Fforms%2FPagePainter%2Fskins%2Fdefault.py src/templates/forms/Simple.py 1411@3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-designer:src%2Ftemplates%2Fforms%2FSimple.py + src/templates/forms/FormBuilder.py 2490@3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-designer:src%2Ftemplates%2Fforms%2FFormBuilder.py src/templates/forms/Simple.py 1411@3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-designer:src%2Ftemplates%2Fforms%2FSimple.py Name: bzr:revision-id:v4 - 937 reinhard.muel...@bytewise.at-20100426083744-iq5ahvdxf38ltx6r 938 whizman_software_solutions_www.whizman.com-20110131201023-bmx4kgkf4erlim85 939 whizman_software_solutions_www.whizman.com-20110226005239-cn6eioyybe5p62rh 940 whizman-20110504201148-w669gtbff176vhop 941 whizman-20110505231025-243w4sfxhzqcbzt2 942 whizman-20110509181949-gnbxobve89qk8pr5 943 whizman-20110509204654-xx9cb9tiuszib409 944 whizman-20110519181636-ighctsn5h1uftknz 945 whizman-20110527230256-kqjr2eb33a29zy9o 946 whizman-20110527235820-zqeownp0345308ww 947 whizman-20110601222222-rvg8tu47q0x6y6rf 948 whizman-20110602174655-bbnm4cs5i6ht5mbg 949 whizman-20110604010805-vqpv6d319epfvvq0 950 whizman-20110609205251-fos3f8ur2m1bnkgv 951 whizman-20110609212406-jyc6m05v8dwxm3vx 952 whizman-20110610193706-5vjbvkyd9w3male1 + 937 reinhard.muel...@bytewise.at-20100426083744-iq5ahvdxf38ltx6r 938 whizman_software_solutions_www.whizman.com-20110131201023-bmx4kgkf4erlim85 939 whizman_software_solutions_www.whizman.com-20110226005239-cn6eioyybe5p62rh 940 whizman-20110504201148-w669gtbff176vhop 941 whizman-20110505231025-243w4sfxhzqcbzt2 942 whizman-20110509181949-gnbxobve89qk8pr5 943 whizman-20110509204654-xx9cb9tiuszib409 944 whizman-20110519181636-ighctsn5h1uftknz 945 whizman-20110527230256-kqjr2eb33a29zy9o 946 whizman-20110527235820-zqeownp0345308ww 947 whizman-20110601222222-rvg8tu47q0x6y6rf 948 whizman-20110602174655-bbnm4cs5i6ht5mbg 949 whizman-20110604010805-vqpv6d319epfvvq0 950 whizman-20110609205251-fos3f8ur2m1bnkgv 951 whizman-20110609212406-jyc6m05v8dwxm3vx 952 whizman-20110610193706-5vjbvkyd9w3male1 953 whizman-20110610212820-inbfsiihadp7erc8 Name: bzr:text-parents - FAQ svn-v3-single1-dHJ1bmsvZ251ZS1kZXNpZ25lcg..:3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-designer:9998 src/forms/Incubator.py svn-v3-single1-dHJ1bmsvZ251ZS1kZXNpZ25lcg..:3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-designer:9955 src/forms/PagePainter/skins/common.py svn-v3-single1-dHJ1bmsvZ251ZS1kZXNpZ25lcg..:3a364389-8fce-0310-8f11-cc363fde16c7:trunk%2Fgnue-designer:9955 src/forms/PagePainter/skins/default.py whizman-20110604010805-vqpv6d319epfvvq0 src/templates/forms/Simple.py whizman-20110609205251-fos3f8ur2m1bnkgv + src/templates/forms/FormBuilder.py whizman-20110609205251-fos3f8ur2m1bnkgv Modified: trunk/gnue-designer/src/templates/forms/FormBuilder.py =================================================================== --- trunk/gnue-designer/src/templates/forms/FormBuilder.py 2011-06-18 09:18:13 UTC (rev 10329) +++ trunk/gnue-designer/src/templates/forms/FormBuilder.py 2011-06-18 09:18:15 UTC (rev 10330) @@ -432,6 +432,7 @@ largestField = 0 largestLabel = 0 defaultWidth = 10 + maxWidth = 40 # First, let's make all the fields for name in self.variables['tablefields%s' % count]: @@ -469,13 +470,13 @@ # If we have a length for the field, use this as the length # for the entry. Also, adjust the display width if necessary. if hasattr(field, 'length'): - ln = max(min(field.length, 40),0) or defaultWidth - attrs['length'] = ln - largestField = max(largestField, ln) + attrs['length'] = field.length + ln = min(field.length, maxWidth) + largestField = max(largestField, ln) # entry s:max_width else: largestField = max(largestField, defaultWidth) - # Create the entry element + # Create the field element fld = self.AddElement('field', block, attrs) # and queue it so we can create entry's later @@ -510,7 +511,7 @@ # If label width is larger than entry width, center the entry try: - entryWidth = min(field['length'],40) or defaultWidth + entryWidth = min(field['length'],maxWidth) or defaultWidth except KeyError: entryWidth = defaultWidth if entryWidth < textLen: @@ -527,8 +528,7 @@ # Single Record layout (regardless of label location) else: - # Assign the starting (x,y) values for labels (l) and fields (f) - # as well as the delta (x,y) values. + # Entries stack vertically, whether labels to left or above. curParent = self.AddElement('vbox', page, {'block': blockName}) if leftlabels: @@ -598,10 +598,8 @@ # If we have a length for the field, use this as the length # for the entry. Also, adjust the display width if necessary. - try: - attrs['_poswidth'] = min(field['length'], 40) - except KeyError: - pass + if hasattr(field, 'length') and field['length'] > maxWidth: + attrs['s:max_width'] = maxWidth # Create the entry element self.AddElement('entry', entryParent, attrs) Modified: trunk/gnue-designer/src/templates/forms/Simple.py =================================================================== --- trunk/gnue-designer/src/templates/forms/Simple.py 2011-06-18 09:18:13 UTC (rev 10329) +++ trunk/gnue-designer/src/templates/forms/Simple.py 2011-06-18 09:18:15 UTC (rev 10330) @@ -219,6 +219,7 @@ largestField = 0 largestLabel = 0 defaultWidth = 10 + maxWidth = 40 # First, let's make all the fields for name in self.variables['fields']: @@ -256,15 +257,13 @@ # If we have a length for the field, use this as the length # for the entry. Also, adjust the display width if necessary. if hasattr(field, 'length'): - ln = max(min(field.length, 40),0) or defaultWidth - - ##ln = min(field.length, 40) - attrs['length'] = ln - largestField = max(largestField, ln) + attrs['length'] = field.length + ln = min(field.length, maxWidth) + largestField = max(largestField, ln) # entry s:max_width else: largestField = max(largestField, defaultWidth) - # Create the entry element + # Create the field element fld = self.AddElement('field', block, attrs) # and queue it so we can create entry's later @@ -299,8 +298,8 @@ # If label width is larger than entry width, center the entry if hasattr(field, 'length'): - entryWidth = min(field['length'],40) or defaultWidth # beware None - # max(min(field['length'], 40),0) or defaultWidth + entryWidth = min(field['length'],maxWidth) or defaultWidth # beware None + # max(min(field['length'], maxWidth),0) else: entryWidth = defaultWidth if entryWidth < textLen: @@ -316,8 +315,7 @@ # Single Record layout (regardless of label location) else: - # Assign the starting (x,y) values for labels (l) and fields (f) - # as well as the delta (x,y) values. + # Entries stack vertically, whether labels to left or above. curParent = self.AddElement('vbox', page, {'block': blockName}) if leftlabels: @@ -326,11 +324,9 @@ fx, fy, fdx, fdy = (largestLabel + 2, 1, 0, 1) # Set form width width = largestField + largestLabel + 3 - #boxTag = 'vbox' else: # Labels above the entries - #boxTag = 'hbox' lx, ly, ldx, ldy = (1, 1, 0, 3) fx, fy, fdx, fdy = (1, 2, 0, 3) # Set the form width @@ -395,13 +391,9 @@ # If we have a length for the field, use this as the length # for the entry. Also, adjust the display width if necessary. - # 2011-06: change to managed layout - # if do anything with this in meantime, see hasattr above - # try: - # attrs[':poswidth'] = min(field['length'], 40) \ - # or defaultWidth # beware None - # except KeyError: - # pass + # s:max_width is not saved in the GFD as of 2011-06-10 - xmlns? + if hasattr(field, 'length') and field['length'] > maxWidth: + attrs['s:max_width'] = maxWidth # Create the entry element self.AddElement('entry', entryParent, attrs) _______________________________________________ commit-gnue mailing list commit-gnue@gnu.org https://lists.gnu.org/mailman/listinfo/commit-gnue