Added wxEditor from Dirc Holtwic
Some tweaks and fixes Some distrib updates git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5161 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -23,7 +23,7 @@ _useNestedSplitter = true
|
||||
_treeList = [
|
||||
('New since last release', ['wxMVCTree', 'wxVTKRenderWindow',
|
||||
'FileBrowseButton', 'GenericButtons',
|
||||
'wxMask']),
|
||||
'wxMask', 'wxEditor']),
|
||||
|
||||
('Managed Windows', ['wxFrame', 'wxDialog', 'wxMiniFrame']),
|
||||
|
||||
@@ -53,7 +53,7 @@ _treeList = [
|
||||
('wxPython Library', ['Layoutf', 'wxScrolledMessageDialog',
|
||||
'wxMultipleChoiceDialog', 'wxPlotCanvas', 'wxFloatBar',
|
||||
'PyShell', 'wxCalendar', 'wxMVCTree', 'wxVTKRenderWindow',
|
||||
'FileBrowseButton', 'GenericButtons']),
|
||||
'FileBrowseButton', 'GenericButtons', 'wxEditor']),
|
||||
|
||||
('Cool Contribs', ['pyTree', 'hangman', 'SlashDot', 'XMLtreeview']),
|
||||
|
||||
|
42
utils/wxPython/demo/wxEditor.py
Normal file
42
utils/wxPython/demo/wxEditor.py
Normal file
@@ -0,0 +1,42 @@
|
||||
|
||||
from wxPython.wx import *
|
||||
from wxPython.lib.editor import wxEditor, wxPyEditor
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
def runTest(frame, nb, log):
|
||||
win = wxPanel(nb, -1)
|
||||
ed = wxEditor(win)
|
||||
pyed = wxPyEditor(win)
|
||||
box = wxBoxSizer(wxVERTICAL)
|
||||
box.Add(ed, 1, wxALL|wxGROW, 5)
|
||||
box.Add(pyed, 1, wxALL|wxGROW, 5)
|
||||
win.SetSizer(box)
|
||||
win.SetAutoLayout(true)
|
||||
|
||||
ed.SetText(["",
|
||||
"This is a simple text editor, the class name is",
|
||||
"wxEditor. Type a few lines and try it out."])
|
||||
|
||||
pyed.SetText(["# This one is a derived class named wxPyEditor.",
|
||||
"# It adds syntax highlighting, folding (press",
|
||||
"# F12 on the \"def\" line below) and other stuff.",
|
||||
"import sys",
|
||||
"def hello():",
|
||||
" print 'hello'",
|
||||
" for x in sys.path:",
|
||||
" print x",
|
||||
""])
|
||||
return win
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
overview = """\
|
||||
"""
|
||||
|
||||
|
||||
|
@@ -17,24 +17,24 @@ class TestFloatBar(wxFrame):
|
||||
tb.SetFloatable(1)
|
||||
tb.SetTitle("Floating!")
|
||||
self.CreateStatusBar()
|
||||
tb.AddTool(10, wxBitmap('bitmaps/new.bmp', wxBITMAP_TYPE_BMP),
|
||||
wxNullBitmap, false, -1, -1, "New", "Long help for 'New'")
|
||||
tb.AddSimpleTool(10, wxBitmap('bitmaps/new.bmp', wxBITMAP_TYPE_BMP),
|
||||
"New", "Long help for 'New'")
|
||||
EVT_TOOL(self, 10, self.OnToolClick)
|
||||
EVT_TOOL_RCLICKED(self, 10, self.OnToolRClick)
|
||||
|
||||
tb.AddTool(20, wxBitmap('bitmaps/open.bmp', wxBITMAP_TYPE_BMP),
|
||||
wxNullBitmap, false, -1, -1, "Open")
|
||||
tb.AddSimpleTool(20, wxBitmap('bitmaps/open.bmp', wxBITMAP_TYPE_BMP),
|
||||
"Open")
|
||||
EVT_TOOL(self, 20, self.OnToolClick)
|
||||
EVT_TOOL_RCLICKED(self, 20, self.OnToolRClick)
|
||||
|
||||
tb.AddSeparator()
|
||||
tb.AddTool(30, wxBitmap('bitmaps/copy.bmp', wxBITMAP_TYPE_BMP),
|
||||
wxNullBitmap, false, -1, -1, "Copy")
|
||||
tb.AddSimpleTool(30, wxBitmap('bitmaps/copy.bmp', wxBITMAP_TYPE_BMP),
|
||||
"Copy")
|
||||
EVT_TOOL(self, 30, self.OnToolClick)
|
||||
EVT_TOOL_RCLICKED(self, 30, self.OnToolRClick)
|
||||
|
||||
tb.AddTool(40, wxBitmap('bitmaps/paste.bmp', wxBITMAP_TYPE_BMP),
|
||||
wxNullBitmap, false, -1, -1, "Paste")
|
||||
tb.AddSimpleTool(40, wxBitmap('bitmaps/paste.bmp', wxBITMAP_TYPE_BMP),
|
||||
"Paste")
|
||||
EVT_TOOL(self, 40, self.OnToolClick)
|
||||
EVT_TOOL_RCLICKED(self, 40, self.OnToolRClick)
|
||||
|
||||
@@ -42,8 +42,8 @@ class TestFloatBar(wxFrame):
|
||||
|
||||
|
||||
tb.AddTool(60, wxBitmap('bitmaps/tog1.bmp', wxBITMAP_TYPE_BMP),
|
||||
wxBitmap('bitmaps/tog2.bmp', wxBITMAP_TYPE_BMP),
|
||||
true, -1, -1, "Toggle with 2 bitmaps")
|
||||
wxBitmap('bitmaps/tog2.bmp', wxBITMAP_TYPE_BMP),
|
||||
shortHelpString="Toggle with 2 bitmaps", toggle=true)
|
||||
EVT_TOOL(self, 60, self.OnToolClick)
|
||||
EVT_TOOL_RCLICKED(self, 60, self.OnToolRClick)
|
||||
tb.Realize()
|
||||
|
Reference in New Issue
Block a user