File: layout.pythoncode

package info (click to toggle)
wxformbuilder 4.2.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 8,908 kB
  • sloc: cpp: 37,318; xml: 6,611; javascript: 1,353; python: 94; sh: 62; makefile: 62
file content (171 lines) | stat: -rw-r--r-- 6,892 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!--
wxFormBuilder - A Visual Dialog Editor for wxWidgets.
Copyright (C) 2005 José Antonio Hurtado

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

Written by
  José Antonio Hurtado - joseantonio.hurtado@gmail.com
  Juan Antonio Ortega  - jortegalalmolda@gmail.com

Python code generation written by
  Michal Bližňák - michal.bliznak@gmail.com
-->
<codegen language="Python">

  <templates class="sizer">
    <template name="settings">
      #ifnotnull $minimum_size
      @{ $name.SetMinSize( $minimum_size ) @}
    </template>
  </templates>

  <templates class="spacer"/>

  <templates class="sizeritem">
    <template name="window_add">#parent $name.Add( self.#child $name, $proportion, $flag, $border ) #nl</template>
    <template name="sizer_add">#parent $name.Add( #child $name, $proportion, $flag, $border ) #nl</template>
    <template name="spacer_add">#parent $name.Add( ( #child $width, #child $height), $proportion, $flag, $border ) #nl</template>
  </templates>

  <templates class="gbsizeritem">
    <template name="window_add">#parent $name.Add( self.#child $name, wx.GBPosition( $row, $column ), wx.GBSpan( $rowspan, $colspan ), $flag, $border ) #nl</template>
    <template name="sizer_add">#parent $name.Add( #child $name, wx.GBPosition( $row, $column ), wx.GBSpan( $rowspan, $colspan ), $flag, $border ) #nl</template>
    <template name="spacer_add">#parent $name.Add( ( #child $width, #child $height ), wx.GBPosition( $row, $column ), wx.GBSpan( $rowspan, $colspan ), $flag, $border ) #nl</template>
  </templates>

  <templates class="wxBoxSizer">
    <template name="construction">$name = wx.BoxSizer( $orient ) #nl</template>
  </templates>

  <templates class="wxStaticBoxSizer">
    <template name="construction">$name = wx.StaticBoxSizer( wx.StaticBox( #wxparent $name, $id, $label ), $orient ) #nl</template>
    <template name="evt_connect_OnUpdateUI">$name.GetStaticBox().Bind( wx.EVT_UPDATE_UI, #handler )</template>
  </templates>

  <templates class="wxWrapSizer">
    <template name="construction">$name = wx.WrapSizer( $orient, $flags ) #nl</template>
  </templates>

  <templates class="wxGridSizer">
    <template name="construction">$name = wx.GridSizer( $rows, $cols, $vgap, $hgap ) #nl</template>
  </templates>

  <templates class="wxFlexGridSizer">
    <template name="construction">$name = wx.FlexGridSizer( $rows, $cols, $vgap, $hgap )
      #ifnotnull $growablecols
      @{
        #foreach $growablecols
        @{ $name.AddGrowableCol( #pred ) @}
      @}

      #ifnotnull $growablerows
      @{
        #foreach $growablerows
        @{ $name.AddGrowableRow( #pred ) @}
      @}
      #ifnotnull $flexible_direction
      @{ #nl $name.SetFlexibleDirection( $flexible_direction ) @}

      #ifnotnull $non_flexible_grow_mode
      @{ #nl $name.SetNonFlexibleGrowMode( $non_flexible_grow_mode ) @}
      #nl
    </template>
  </templates>

  <templates class="wxGridBagSizer">
    <template name="construction">$name = wx.GridBagSizer( $vgap, $hgap )
      #ifnotnull $flexible_direction
      @{ #nl $name.SetFlexibleDirection( $flexible_direction ) @}

      #ifnotnull $non_flexible_grow_mode
      @{ #nl $name.SetNonFlexibleGrowMode( $non_flexible_grow_mode ) @}

      #ifnotnull $empty_cell_size
      @{ #nl $name.SetEmptyCellSize( $empty_cell_size ) @}
      #nl
    </template>
    <template name="after_addchild">
      #ifnotnull $growablecols
      @{ #foreach $growablecols @{ $name.AddGrowableCol( #pred ) @} @}
      #ifnotnull $growablerows
      @{ #foreach $growablerows @{ $name.AddGrowableRow( #pred ) @} @}
    </template>
  </templates>

  <templates class="wxStdDialogButtonSizer">
    <template name="construction">$name = wx.StdDialogButtonSizer()
      #ifequal $OK "1"
      @{
        #nl self.$name #append OK = wx.Button( #wxparent $name, wx.ID_OK )
        #nl $name.AddButton( self.$name #append OK )
      @}

      #ifequal $Yes "1"
      @{
        #nl self.$name #append Yes = wx.Button( #wxparent $name, wx.ID_YES )
        #nl $name.AddButton( self.$name #append Yes )
      @}

      #ifequal $Save "1"
      @{
        #nl self.$name #append Save = wx.Button( #wxparent $name, wx.ID_SAVE )
        #nl $name.AddButton( self.$name #append Save )
      @}

      #ifequal $Apply "1"
      @{
        #nl self.$name #append Apply = wx.Button( #wxparent $name, wx.ID_APPLY )
        #nl $name.AddButton( self.$name #append Apply )
      @}

      #ifequal $No "1"
      @{
        #nl self.$name #append No = wx.Button( #wxparent $name, wx.ID_NO )
        #nl $name.AddButton( self.$name #append No )
      @}

      #ifequal $Cancel "1"
      @{
        #nl self.$name #append Cancel = wx.Button( #wxparent $name, wx.ID_CANCEL )
        #nl $name.AddButton( self.$name #append Cancel )
      @}

      #ifequal $Help "1"
      @{
        #nl self.$name #append Help = wx.Button( #wxparent $name, wx.ID_HELP )
        #nl $name.AddButton( self.$name #append Help )
      @}

      #ifequal $ContextHelp "1"
      @{
        #nl self.$name #append ContextHelp = wx.Button( #wxparent $name, wx.ID_CONTEXT_HELP )
        #nl $name.AddButton( self.$name #append ContextHelp )
      @}

      #nl $name.Realize()
    </template>
    <template name="evt_connect_OnOKButtonClick">self.$name #append OK.Bind( wx.EVT_BUTTON, #handler )</template>
    <template name="evt_connect_OnYesButtonClick">self.$name #append Yes.Bind(  wx.EVT_BUTTON, #handler )</template>
    <template name="evt_connect_OnSaveButtonClick">self.$name #append Save.Bind(  wx.EVT_BUTTON, #handler )</template>
    <template name="evt_connect_OnApplyButtonClick">self.$name #append Apply.Bind(  wx.EVT_BUTTON, #handler )</template>
    <template name="evt_connect_OnNoButtonClick">self.$name #append No.Bind( wx.EVT_BUTTON, #handler )</template>
    <template name="evt_connect_OnCancelButtonClick">self.$name #append Cancel.Bind(  wx.EVT_BUTTON, #handler )</template>
    <template name="evt_connect_OnHelpButtonClick">self.$name #append Help.Bind(  wx.EVT_BUTTON, #handler )</template>
    <template name="evt_connect_OnContextHelpButtonClick">self.$name #append ContextHelp.Bind( wx.EVT_BUTTON, #handler )</template>
  </templates>

</codegen>