/[papo]/gnue/designer/src/forms/wizards/AddBlock.py
ViewVC logotype

Diff of /gnue/designer/src/forms/wizards/AddBlock.py

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

revision 1.4 by styxman, Fri Nov 8 16:46:03 2002 UTC revision 1.4.4.1 by anthonyl, Tue Mar 4 22:11:40 2003 UTC
# Line 16  Line 16 
16  # write to the Free Software Foundation, Inc., 59 Temple Place  # write to the Free Software Foundation, Inc., 59 Temple Place
17  # - Suite 330, Boston, MA 02111-1307, USA.  # - Suite 330, Boston, MA 02111-1307, USA.
18  #  #
19  # Copyright 2001-2002 Free Software Foundation  # Copyright 2001-2003 Free Software Foundation
20  #  #
21  # FILE:  # FILE:
22  # forms/wizards/AddBlock.py  # forms/wizards/AddBlock.py
# Line 36  import string Line 36  import string
36    
37  class AddBlockWizard(FormTemplate):  class AddBlockWizard(FormTemplate):
38    
39      # The first step in our wizard.
40      # The template parser will initially
41      # call GetStep(FIRST_STEP).
42      FIRST_STEP = '0'
43      
44    
45    ###############    ###############
46    #    #
# Line 46  class AddBlockWizard(FormTemplate): Line 50  class AddBlockWizard(FormTemplate):
50      self.form = root      self.form = root
51      self.current = current      self.current = current
52    
53      ###############
54      #
55      # Return the markup for a specific page
56      #
57      def GetStep(self, step):
58        print step
59        #
60        # Step #0 / Get Name
61        #
62        if step == '0':
63    
64          content = [WizardText('This will insert a new block.'),
65                     WizardInput('name',label='Object Name:',required=1,size=20)]
66    
67          return   { 'title': 'Add Block',
68                     'content': content,
69                     'prev': None,
70                     'next': None }
71    
72    ###############    ###############
73    #    #
# Line 53  class AddBlockWizard(FormTemplate): Line 75  class AddBlockWizard(FormTemplate):
75    #    #
76    def Finalize(self):    def Finalize(self):
77    
78        attrs = {'name': self.GetUniqueName(self.variables['name'] or 'Block1')}
79      # Find or create parent block...      # Find form...
80      page = self.current.findParentOfType('GFPage')      logic = self.current['logic']
81      block = self.AddElement('block', page)      block = self.AddElement('block', logic, attrs)
82    
83      return 1      return 1
84    
# Line 73  TemplateInformation = { Line 95  TemplateInformation = {
95      'Description' : 'Inserts a Block',      'Description' : 'Inserts a Block',
96      'Version' : VERSION,      'Version' : VERSION,
97      'Author' : 'The GNUe Designer Team',      'Author' : 'The GNUe Designer Team',
98      'Behavior': TEMPLATE,      'Behavior': WIZARD,
99      'Location' : 'Tools|Insert|Block'      'Location' : 'Edit|Insert|Block'
100  }  }
101    

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.4.4.1

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