self.name = name
self.buffer = ''
def write(self, data):
- self.buffer += data.encode(g.currentEncoding)
+ if g.currentEncoding:
+ self.buffer += data.encode(g.currentEncoding)
+ else:
+ self.buffer += data.encode()
def close(self):
wxMemoryFSHandler_AddFile(self.name, self.buffer)
def Remove(self):
map(wxWindow.Destroy, self.lines)
g.testWin.highLight = None
+ def Refresh(self):
+ map(wxWindow.Refresh, self.lines)
################################################################################
g.testWin.highLight.Replace(pos, size)
else:
g.testWin.highLight = HighLightBox(pos, size)
+ g.testWin.highLight.Refresh()
g.testWin.highLight.item = item
def ShowTestWindow(self, item):
memFile.close() # write to wxMemoryFS
xmlFlags = wxXRC_NO_SUBCLASSING
# Use translations if encoding is not specified
- if g.currentEncoding == 'ascii':
+ if not g.currentEncoding:
xmlFlags != wxXRC_USE_LOCALE
res = wxXmlResource('', xmlFlags)
res.Load('memory:xxx.xrc')
tb.AddSimpleTool(wxID_COPY, copy_bmp, 'Copy', 'Copy')
tb.AddSimpleTool(self.ID_TOOL_PASTE, paste_bmp, 'Paste', 'Paste')
tb.AddControl(wxStaticLine(tb, -1, size=(-1,23), style=wxLI_VERTICAL))
- tb.AddCheckTool(self.ID_TOOL_LOCATE,
- images.getLocateBitmap(), images.getLocateArmedBitmap(),
- 'Locate', 'Locate control in test window and select it')
+ tb.AddSimpleTool(self.ID_TOOL_LOCATE,
+ images.getLocateBitmap(), #images.getLocateArmedBitmap(),
+ 'Locate', 'Locate control in test window and select it', True)
tb.AddControl(wxStaticLine(tb, -1, size=(-1,23), style=wxLI_VERTICAL))
tb.AddSimpleTool(self.ID_TEST, images.getTestBitmap(), 'Test', 'Test window')
tb.AddSimpleTool(self.ID_REFRESH, images.getRefreshBitmap(),
if dom.encoding:
g.currentEncoding = dom.encoding
wx.SetDefaultPyEncoding(g.currentEncoding.encode())
+ else:
+ g.currentEncoding = ''
# Change dir
self.dataFile = path = os.path.abspath(path)
dir = os.path.dirname(path)
if tree.selection and panel.IsModified():
self.OnRefresh(wxCommandEvent())
if g.currentEncoding:
- f = codecs.open(path, 'w', g.currentEncoding)
+ f = codecs.open(path, 'wt', g.currentEncoding)
else:
- f = codecs.open(path, 'w')
+ f = codecs.open(path, 'wt')
# Make temporary copy for formatting it
# !!! We can't clone dom node, it works only once
#self.domCopy = tree.dom.cloneNode(True)
<object class="sizeritem">
<object class="wxTextCtrl" name="TEXT">
-
<size>250,100</size>
-
<style>wxTE_MULTILINE</style>
</object>
-
<option>1</option>
-
<flag>wxALL|wxEXPAND</flag>
-
<border>5</border>
</object>
</object>
-
<option>1</option>
-
<flag>wxEXPAND</flag>
</object>
<object class="sizeritem">
<object class="wxStaticLine"/>
-
<flag>wxEXPAND</flag>
</object>
<object class="sizeritem">
<object class="sizeritem">
<object class="wxButton" name="wxID_OK">
-
<label>OK</label>
-
<default>1</default>
</object>
-
<flag>wxRIGHT</flag>
-
<border>10</border>
</object>
<object class="sizeritem">
<object class="wxButton" name="wxID_CANCEL">
-
<label>Cancel</label>
</object>
</object>
</object>
-
<flag>wxALL|wxALIGN_CENTRE_HORIZONTAL</flag>
-
<border>10</border>
</object>
</object>
<object class="sizeritem">
<object class="wxListBox" name="LIST">
-
<content/>
</object>
-
<option>1</option>
-
<flag>wxTOP|wxBOTTOM|wxLEFT|wxEXPAND</flag>
-
<border>5</border>
</object>
<object class="sizeritem">
<object class="sizeritem">
<object class="wxButton" name="BUTTON_UP">
-
<label>Move Up</label>
</object>
-
<flag>wxBOTTOM|wxEXPAND</flag>
-
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxButton" name="BUTTON_DOWN">
-
<label>Move Down</label>
</object>
-
<flag>wxEXPAND</flag>
</object>
<object class="spacer">
-
<size>10,20</size>
-
<option>1</option>
</object>
<object class="sizeritem">
<object class="wxButton" name="BUTTON_APPEND">
-
<label>Append...</label>
</object>
-
<flag>wxBOTTOM|wxEXPAND</flag>
-
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxButton" name="BUTTON_REMOVE">
-
<label>Remove</label>
</object>
-
<flag>wxEXPAND</flag>
</object>
</object>
-
<flag>wxALL|wxEXPAND</flag>
-
<border>5</border>
</object>
</object>
-
<option>1</option>
-
<flag>wxEXPAND</flag>
</object>
<object class="sizeritem">
<object class="wxStaticLine"/>
-
<flag>wxEXPAND</flag>
</object>
<object class="sizeritem">
<object class="sizeritem">
<object class="wxButton" name="wxID_OK">
-
<label>OK</label>
-
<default>1</default>
</object>
-
<flag>wxRIGHT</flag>
-
<border>10</border>
</object>
<object class="sizeritem">
<object class="wxButton" name="wxID_CANCEL">
-
<label>Cancel</label>
</object>
</object>
</object>
-
<flag>wxALL|wxALIGN_CENTRE_HORIZONTAL</flag>
-
<border>10</border>
</object>
</object>
<object class="sizeritem">
<object class="wxCheckListBox" name="CHECK_LIST">
-
<content/>
</object>
-
<option>1</option>
-
<flag>wxTOP|wxBOTTOM|wxLEFT|wxEXPAND</flag>
-
<border>5</border>
</object>
<object class="sizeritem">
<object class="sizeritem">
<object class="wxButton" name="BUTTON_UP">
-
<label>Move Up</label>
</object>
-
<flag>wxBOTTOM|wxEXPAND</flag>
-
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxButton" name="BUTTON_DOWN">
-
<label>Move Down</label>
</object>
-
<flag>wxEXPAND</flag>
</object>
<object class="spacer">
-
<size>10,20</size>
-
<option>1</option>
</object>
<object class="sizeritem">
<object class="wxButton" name="BUTTON_APPEND">
-
<label>Append...</label>
</object>
-
<flag>wxBOTTOM|wxEXPAND</flag>
-
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxButton" name="BUTTON_REMOVE">
-
<label>Remove</label>
</object>
-
<flag>wxEXPAND</flag>
</object>
</object>
-
<flag>wxALL|wxEXPAND</flag>
-
<border>5</border>
</object>
</object>
-
<option>1</option>
-
<flag>wxEXPAND</flag>
</object>
<object class="sizeritem">
<object class="wxStaticLine"/>
-
<flag>wxEXPAND</flag>
</object>
<object class="sizeritem">
<object class="sizeritem">
<object class="wxButton" name="wxID_OK">
-
<label>OK</label>
-
<default>1</default>
</object>
-
<flag>wxRIGHT</flag>
-
<border>10</border>
</object>
<object class="sizeritem">
<object class="wxButton" name="wxID_CANCEL">
-
<label>Cancel</label>
</object>
</object>
</object>
-
<flag>wxALL|wxALIGN_CENTRE_HORIZONTAL</flag>
-
<border>10</border>
</object>
</object>
<object class="sizeritem">
<object class="wxCheckListBox" name="CHECK_LIST">
-
<content/>
-
<size>250,250</size>
-
<style></style>
</object>
-
<option>1</option>
-
<flag>wxALL|wxEXPAND</flag>
-
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxStaticLine"/>
-
<flag>wxEXPAND</flag>
</object>
<object class="sizeritem">
<object class="sizeritem">
<object class="wxButton" name="wxID_OK">
-
<label>OK</label>
-
<default>1</default>
</object>
-
<flag>wxRIGHT</flag>
-
<border>10</border>
</object>
<object class="sizeritem">
<object class="wxButton" name="wxID_CANCEL">
-
<label>Cancel</label>
</object>
</object>
</object>
-
<flag>wxALL|wxALIGN_CENTRE_HORIZONTAL</flag>
-
<border>10</border>
</object>
</object>
<object class="sizeritem">
<object class="wxListBox" name="LIST">
-
<content/>
-
<size>80,100</size>
-
<style>wxLB_SORT</style>
</object>
-
<option>1</option>
-
<flag>wxALL|wxALIGN_CENTRE_HORIZONTAL</flag>
-
<border>10</border>
</object>
<object class="sizeritem">
<object class="sizeritem">
<object class="wxButton" name="BUTTON_ADD">
-
<label>Add...</label>
</object>
-
<flag>wxBOTTOM</flag>
-
<border>3</border>
</object>
<object class="sizeritem">
<object class="wxButton" name="BUTTON_REMOVE">
-
<label>Remove</label>
</object>
</object>
</object>
-
<flag>wxALL|wxALIGN_CENTRE_HORIZONTAL</flag>
-
<border>5</border>
</object>
</object>
-
<option>1</option>
-
<flag>wxEXPAND</flag>
</object>
<object class="sizeritem">
<object class="wxStaticLine"/>
-
<flag>wxEXPAND</flag>
</object>
<object class="sizeritem">
<object class="sizeritem">
<object class="wxButton" name="wxID_OK">
-
<label>OK</label>
-
<default>1</default>
</object>
-
<flag>wxBOTTOM</flag>
-
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxButton" name="wxID_CANCEL">
-
<label>Cancel</label>
</object>
</object>
</object>
-
<flag>wxALL|wxALIGN_CENTRE_HORIZONTAL</flag>
-
<border>10</border>
</object>
</object>
<object class="sizeritem">
<object class="wxRadioButton" name="RADIO_STD">
-
<label>art:</label>
</object>
-
<flag>wxALIGN_CENTRE_VERTICAL</flag>
</object>
<object class="sizeritem">
<object class="wxComboBox" name="COMBO_STD">
-
<content>
<item>wxART_ADD_BOOKMARK</item>
<item>wxART_DEL_BOOKMARK</item>
</content>
</object>
-
<flag>wxRIGHT|wxEXPAND</flag>
-
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxRadioButton" name="RADIO_FILE">
-
<label>file:</label>
</object>
-
<flag>wxALIGN_CENTRE_VERTICAL</flag>
</object>
<object class="sizeritem">
<object class="sizeritem">
<object class="wxTextCtrl" name="TEXT_FILE"/>
-
<option>1</option>
-
<flag>wxRIGHT|wxEXPAND</flag>
-
<border>5</border>
</object>
<object class="sizeritem">
<object class="wxButton" name="BUTTON_BROWSE">
-
<label>Browse...</label>
-
<size>40,-1d</size>
</object>
</object>
</object>
-
<flag>wxRIGHT|wxEXPAND</flag>
-
<border>5</border>
</object>
<vgap>2</vgap>
<growablecols>1</growablecols>
</object>
-
<flag>wxEXPAND</flag>
</object>
</object>