-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathmakerNewFileDialog.py
executable file
·130 lines (108 loc) · 3.81 KB
/
makerNewFileDialog.py
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
# This file was automatically generated by pywxrc, do not edit by hand.
# -*- coding: UTF-8 -*-
import wx
import wx.xrc as xrc
__res = None
def get_resources():
""" This function provides access to the XML resources in this module."""
global __res
if __res == None:
__init_resources()
return __res
class xrcnewFile(wx.Dialog):
def PreCreate(self, pre):
"""This function is called during the class's initialization.
Override it for custom setup before the window is created usually to
set additional window styles using SetWindowStyle() and SetExtraStyle()."""
pass
def __init__(self, parent):
# Two stage creation (see http://wiki.wxpython.org/index.cgi/TwoStageCreation)
pre = wx.PreDialog()
self.PreCreate(pre)
get_resources().LoadOnDialog(pre, parent, "newFile")
self.PostCreate(pre)
# create attributes for the named items in this container
self.textField = xrc.XRCCTRL(self, "textField")
self.langChoice = xrc.XRCCTRL(self, "langChoice")
self.static = xrc.XRCCTRL(self, "static")
self.Add = xrc.XRCCTRL(self, "Add")
self.Cancel = xrc.XRCCTRL(self, "Cancel")
# ------------------------ Resource data ----------------------
def __init_resources():
global __res
__res = xrc.EmptyXmlResource()
wx.FileSystem.AddHandler(wx.MemoryFSHandler())
newFile_xrc = """\
<?xml version="1.0" ?><resource>
<object class="wxDialog" name="newFile">
<title>Add New File</title>
<centered>1</centered>
<pos>10,0</pos>
<size>450, 140</size>
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<object class="wxBoxSizer">
<orient>wxVERTICAL</orient>
<object class="sizeritem">
<object class="wxPanel">
<object class="wxTextCtrl" name="textField">
<value>newFilename</value>
<pos>20,40</pos>
<size>300, 25</size>
</object>
<object class="wxChoice" name="langChoice">
<content>
<item/></content>
<selection></selection>
<pos>340, 40</pos>
<size>78,20</size>
</object>
<object class="wxStaticText" name="static">
<label>Language:</label>
<pos>346, 15</pos>
</object>
</object>
</object>
</object>
<option>1</option>
<flag>wxGROW</flag>
</object>
<object class="sizeritem">
<object class="wxPanel">
<object class="wxButton" name="Add">
<label>Add</label>
<default>1</default>
<pos>335, 4</pos>
<size>80, 25</size>
</object>
<object class="wxButton" name="Cancel">
<label>Cancel</label>
<default>0</default>
<pos>236, 4</pos>
<size>80, 25</size>
</object>
</object>
<option>0</option>
<flag>wxEXPAND</flag>
<minsize>440, 40</minsize>
</object>
</object>
</object>
</resource>"""
wx.MemoryFSHandler.AddFile("XRC/newFile/newFile_xrc", newFile_xrc)
__res.Load("memory:XRC/newFile/newFile_xrc")
# ----------------------- Gettext strings ---------------------
def __gettext_strings():
# This is a dummy function that lists all the strings that are used in
# the XRC file in the _("a string") format to be recognized by GNU
# gettext utilities (specificaly the xgettext utility) and the
# mki18n.py script. For more information see:
# http://wiki.wxpython.org/index.cgi/Internationalization
def _(str):
pass
_("add new file")
_("newFilename")
_("Language:")
_("Add")
_("Cancel")