/[papo]/gnue/forms/samples/intro/intro.gfd
ViewVC logotype

Diff of /gnue/forms/samples/intro/intro.gfd

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by styxman, Thu Nov 14 22:16:52 2002 UTC revision 1.2.2.1 by anthonyl, Tue Mar 4 22:18:20 2003 UTC
# Line 1  Line 1 
1  <?xml version="1.0"?>  <?xml version="1.0"?>
2    
3  <!--  GNUe Designer (0.1.0)  <!--  GNUe Forms 0.5.0 Migration Tool
4        Form saved on: 2001-11-20 17:14:37  -->        Saved on: 2002-11-26 20:28:15  -->
5    
6  <form tabbed="top" title="Welcome to GNUe Forms">  <form title="Welcome to GNUe Forms">
7    <trigger type="NAMED" name="PigLatin">#    <trigger name="PigLatin" type="NAMED"><![CDATA[#
8  # from Joe Strout's Python Tidbits (http://www.strout.net/python/)  # from Joe Strout's Python Tidbits (http://www.strout.net/python/)
9  #  #
10    
# Line 17  def append(w,suffix): Line 17  def append(w,suffix):
17  import string  import string
18    
19  s = SampleBlock.NameEntry.get()  s = SampleBlock.NameEntry.get()
20  if len(s) &gt; 4:  try:
21   out = ''   out = ''
22    
23   for word in string.splitfields(s,' '):   for word in string.splitfields(s,' '):
# Line 44  if len(s) &gt; 4: Line 44  if len(s) &gt; 4:
44    
45      # remove up to the first vowel to make suffix      # remove up to the first vowel to make suffix
46      p = 0      p = 0
47      while p &lt; len(word) and word[p] not in "aoeuiyAOEUIY":      while p < len(word) and word[p] not in "aoeuiyAOEUIY":
48        p = p+1        p = p+1
49    
50      if not p:      if not p:
# Line 60  if len(s) &gt; 4: Line 60  if len(s) &gt; 4:
60    
61    out = out + ' ' + word    out = out + ' ' + word
62    
63  else:  except:
64    out = "Name not long enough."    out = "Name not long enough."
65  SampleBlock.CodeNameEntry.set(string.strip(out))  SampleBlock.CodeNameEntry.set(string.strip(out))
66  </trigger>  ]]></trigger>
67    <trigger type="NAMED" name="MyFortune">    <trigger name="MyFortune" type="NAMED"><![CDATA[
68  Fortunes = ['You will have a long and fruitful life with GNUe.',  Fortunes = ['You will have a long and fruitful life with GNUe.',
69              'GNUe will solve your next IT problem.',              'GNUe will solve your next IT problem.',
70              'Why you not use GNUe before now?',              'Why you not use GNUe before now?',
# Line 87  else: Line 87  else:
87    val = "Please enter a valid birth year first."    val = "Please enter a valid birth year first."
88    
89  SampleBlock.FortuneEntry.set(val)  SampleBlock.FortuneEntry.set(val)
90  </trigger>  ]]></trigger>
91    <page name="Welcome">    <logic>
92      <block name="Block_1">      <block name="Block_1">
93        <entry name="Entry_1" x="3" y="9" width="34" default="Press 'Page Down' for a demo"/>        <field name="Entry_1" default="Press 'Page Down' for a demo"/>
94      </block>      </block>
     <label x="6" y="1" width="26" name="Label_1"  
            text="Welcome to GNU Enterprise!"/>  
     <label x="3" y="4" width="34" name="Label_3"  
            text="This is a placeholder form."/>  
     <box x="1" y="2" width="38" label="Demo" name="Box_1" height="9"/>  
     <label x="3" y="5" width="34" name="Label_8"  
            text="You would normally invoke Forms"/>  
     <label x="3" y="6" width="34" name="Label_9"  
            text="by double-clicking a GFD file"/>  
     <label x="3" y="7" width="34" name="Label_10"  
            text="or by typing 'gnue-forms &lt;file&gt;'."/>  
   </page>  
   <page name="Sample">  
     <box x="1" y="0" width="38" label="Sample" name="Box_2" height="8"/>  
     <label x="3" y="2" width="10" name="Label_5" text="Your Name: "/>  
     <label x="3" y="3" width="20" name="Label_6" text="Year you were born:"/>  
     <label x="3" y="5" width="15" name="Label_7" text="Your Code Name:"/>  
95      <block name="SampleBlock">      <block name="SampleBlock">
96        <entry x="14" y="2" name="NameEntry" width="23">        <field name="NameEntry">
97          <trigger type="PRE-FOCUSOUT" name="Trigger_1" src="PigLatin"/>          <trigger name="Trigger_1" src="PigLatin" type="PRE-FOCUSOUT"/>
98        </entry>        </field>
99        <entry name="YearEntry" x="22" y="3" width="6"/>        <field name="YearEntry">
100        <button x="29" y="3" trigger="MyFortune" width="8" label="Fortune"          <options>
101                name="btnClear" height="1"/>             <option name="tip" value="Enter the year of your birth"/>
102        <entry name="CodeNameEntry" x="3" y="6" width="34"/>          </options>
103        <entry name="FortuneEntry" x="2" y="8" width="36" height="4"/>        </field>
104          <field name="CodeNameEntry"/>
105          <field name="FortuneEntry"/>
106      </block>      </block>
107    </page>    </logic>
108      <layout xmlns:c="GNUe:Layout:Char" c:height="12" tabbed="top" c:width="40">
109        <page name="Welcome">
110          <label name="Label_1" text="Welcome to GNU Enterprise!" c:width="26"
111                 c:x="6" c:y="1"/>
112          <label name="Label_3" text="This is a placeholder form." c:width="34"
113                 c:x="3" c:y="4"/>
114          <box name="Box_1" c:height="9" label="Demo" c:width="38" c:x="1" c:y="2"/>
115          <label name="Label_8" text="You would normally invoke Forms"
116                 c:width="34" c:x="3" c:y="5"/>
117          <label name="Label_9" text="by double-clicking a GFD file" c:width="34"
118                 c:x="3" c:y="6"/>
119          <label name="Label_10" text="or by typing 'gnue-forms &lt;file&gt;'."
120                 c:width="34" c:x="3" c:y="7"/>
121          <entry block="Block_1" field="Entry_1" c:width="34" c:x="3" c:y="9"/>
122        </page>
123        <page name="Sample">
124          <box name="Box_2" c:height="8" label="Sample" c:width="38" c:x="1"
125               c:y="0"/>
126          <label name="Label_5" text="Your Name: " c:width="10" c:x="3" c:y="2"/>
127          <label name="Label_6" text="Year you were born:" c:width="20" c:x="3"
128                 c:y="3"/>
129          <label name="Label_7" text="Your Code Name:" c:width="15" c:x="3"
130                 c:y="5"/>
131          <entry block="SampleBlock" field="NameEntry" c:width="23" c:x="14"
132                 c:y="2"/>
133          <entry block="SampleBlock" field="YearEntry" c:width="6" c:x="22"
134                 c:y="3"/>
135          <button name="btnClear" c:height="1" label="Fortune" c:width="8"
136                  c:x="29" c:y="3">
137            <trigger src="MyFortune" type="On-Action"/>
138          </button>
139          <entry block="SampleBlock" field="CodeNameEntry" c:width="34" c:x="3"
140                 c:y="6"/>
141          <entry block="SampleBlock" field="FortuneEntry" c:height="4"
142                 c:width="36" c:x="2" c:y="8"/>
143        </page>
144      </layout>
145  </form>  </form>

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.2.2.1

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26