Merged modifications from the 2.6 branch
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36607 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -29,10 +29,16 @@ class TestPanel(wx.Panel):
|
||||
mask = wx.Mask(bmp, wx.BLUE)
|
||||
|
||||
bmp.SetMask(mask)
|
||||
b = wx.BitmapButton(self, 30, bmp, (20, 20),
|
||||
b = wx.BitmapButton(self, -1, bmp, (20, 20),
|
||||
(bmp.GetWidth()+10, bmp.GetHeight()+10))
|
||||
b.SetToolTipString("This is a bitmap button.")
|
||||
self.Bind(wx.EVT_BUTTON, self.OnClick, b)
|
||||
|
||||
b = wx.BitmapButton(self, -1, bmp, (20, 120),
|
||||
(bmp.GetWidth()+10, bmp.GetHeight()+10),
|
||||
style = wx.NO_BORDER)
|
||||
b.SetToolTipString("This is a bitmap button with \nwx.NO_BORDER style.")
|
||||
self.Bind(wx.EVT_BUTTON, self.OnClick, b)
|
||||
|
||||
|
||||
def OnClick(self, event):
|
||||
|
@@ -27,7 +27,8 @@ class TestPanel(wx.Panel):
|
||||
self, -1, size=(450, -1), changeCallback = self.dbbCallback
|
||||
)
|
||||
|
||||
self.fbbh.SetHistory(['You', 'can', 'put', 'some', 'filenames', 'here'])
|
||||
self.fbbh.callCallback = False
|
||||
self.fbbh.SetHistory(['You', 'can', 'put', 'some', 'filenames', 'here'], 4)
|
||||
|
||||
sizer = wx.BoxSizer(wx.VERTICAL)
|
||||
sizer.Add(self.fbb, 0, wx.ALL, 5)
|
||||
@@ -45,6 +46,8 @@ class TestPanel(wx.Panel):
|
||||
def fbbhCallback(self, evt):
|
||||
if hasattr(self, 'fbbh'):
|
||||
value = evt.GetString()
|
||||
if not value:
|
||||
return
|
||||
self.log.write('FileBrowseButtonWithHistory: %s\n' % value)
|
||||
history = self.fbbh.GetHistory()
|
||||
if value not in history:
|
||||
|
@@ -344,6 +344,10 @@ class Extended(wx.Frame):
|
||||
# or normal
|
||||
|
||||
if event.IsChecked():
|
||||
self.GetMenuBar().Check(self._singlestyle, False)
|
||||
self.GetMenuBar().Check(self._exclusivestyle, False)
|
||||
self._flags = self._flags & ~fpb.FPB_SINGLE_FOLD
|
||||
self._flags = self._flags & ~fpb.FPB_EXCLUSIVE_FOLD
|
||||
self._flags = self._flags | fpb.FPB_COLLAPSE_TO_BOTTOM
|
||||
else:
|
||||
self._flags = self._flags & ~fpb.FPB_COLLAPSE_TO_BOTTOM
|
||||
@@ -352,13 +356,15 @@ class Extended(wx.Frame):
|
||||
|
||||
|
||||
def OnCreateNormalStyle(self, event):
|
||||
|
||||
|
||||
# recreate with style where only one panel at the time is
|
||||
# allowed to be opened
|
||||
|
||||
# TODO: Not yet implemented even in the C++ class!!!!
|
||||
|
||||
if event.IsChecked():
|
||||
self.GetMenuBar().Check(self._bottomstyle, False)
|
||||
self.GetMenuBar().Check(self._exclusivestyle, False)
|
||||
self._flags = self._flags & ~fpb.FPB_EXCLUSIVE_FOLD
|
||||
self._flags = self._flags & ~fpb.FPB_COLLAPSE_TO_BOTTOM
|
||||
self._flags = self._flags | fpb.FPB_SINGLE_FOLD
|
||||
else:
|
||||
self._flags = self._flags & ~fpb.FPB_SINGLE_FOLD
|
||||
@@ -366,6 +372,23 @@ class Extended(wx.Frame):
|
||||
self.ReCreateFoldPanel(self._flags)
|
||||
|
||||
|
||||
def OnCreateExclusiveStyle(self, event):
|
||||
|
||||
# recreate with style where only one panel at the time is
|
||||
# allowed to be opened and the others are collapsed to bottom
|
||||
|
||||
if event.IsChecked():
|
||||
self.GetMenuBar().Check(self._singlestyle, False)
|
||||
self.GetMenuBar().Check(self._bottomstyle, False)
|
||||
self._flags = self._flags & ~fpb.FPB_SINGLE_FOLD
|
||||
self._flags = self._flags & ~fpb.FPB_COLLAPSE_TO_BOTTOM
|
||||
self._flags = self._flags | fpb.FPB_EXCLUSIVE_FOLD
|
||||
else:
|
||||
self._flags = self._flags & ~fpb.FPB_EXCLUSIVE_FOLD
|
||||
|
||||
self.ReCreateFoldPanel(self._flags)
|
||||
|
||||
|
||||
def OnCollapseMe(self, event):
|
||||
|
||||
for i in range(0, self._pnl.GetCount()):
|
||||
@@ -487,8 +510,9 @@ class Extended(wx.Frame):
|
||||
|
||||
FPBTEST_QUIT = wx.NewId()
|
||||
FPBTEST_REFRESH = wx.NewId()
|
||||
FPB_BOTTOM_STICK = wx.NewId()
|
||||
FPB_BOTTOM_FOLD = wx.NewId()
|
||||
FPB_SINGLE_FOLD = wx.NewId()
|
||||
FPB_EXCLUSIVE_FOLD = wx.NewId()
|
||||
FPBTEST_TOGGLE_WINDOW = wx.NewId()
|
||||
FPBTEST_ABOUT = wx.NewId()
|
||||
|
||||
@@ -504,10 +528,13 @@ class Extended(wx.Frame):
|
||||
# make fold panel menu
|
||||
|
||||
fpb_menu = wx.Menu()
|
||||
fpb_menu.AppendCheckItem(FPB_BOTTOM_STICK, "Create with &fpb.FPB_COLLAPSE_TO_BOTTOM")
|
||||
fpb_menu.AppendCheckItem(FPB_BOTTOM_FOLD, "Create with &fpb.FPB_COLLAPSE_TO_BOTTOM")
|
||||
|
||||
# Not Yet Implemented In The C++ class!!!
|
||||
# fpb_menu.AppendCheckItem(FPB_SINGLE_FOLD, _T("Create with &FPB_SINGLE_FOLD"))
|
||||
# Now Implemented!
|
||||
fpb_menu.AppendCheckItem(FPB_SINGLE_FOLD, "Create with &fpb.FPB_SINGLE_FOLD")
|
||||
|
||||
# Now Implemented!
|
||||
fpb_menu.AppendCheckItem(FPB_EXCLUSIVE_FOLD, "Create with &fpb.FPB_EXCLUSIVE_FOLD")
|
||||
|
||||
fpb_menu.AppendSeparator()
|
||||
fpb_menu.Append(FPBTEST_TOGGLE_WINDOW, "&Toggle FoldPanelBar")
|
||||
@@ -528,8 +555,13 @@ class Extended(wx.Frame):
|
||||
self.Bind(wx.EVT_MENU, self.OnAbout, id=FPBTEST_ABOUT)
|
||||
self.Bind(wx.EVT_MENU, self.OnQuit, id=FPBTEST_QUIT)
|
||||
self.Bind(wx.EVT_MENU, self.OnToggleWindow, id=FPBTEST_TOGGLE_WINDOW)
|
||||
self.Bind(wx.EVT_MENU, self.OnCreateBottomStyle, id=FPB_BOTTOM_STICK)
|
||||
self.Bind(wx.EVT_MENU, self.OnCreateBottomStyle, id=FPB_BOTTOM_FOLD)
|
||||
self.Bind(wx.EVT_MENU, self.OnCreateNormalStyle, id=FPB_SINGLE_FOLD)
|
||||
self.Bind(wx.EVT_MENU, self.OnCreateExclusiveStyle, id=FPB_EXCLUSIVE_FOLD)
|
||||
|
||||
self._bottomstyle = FPB_BOTTOM_FOLD
|
||||
self._singlestyle = FPB_SINGLE_FOLD
|
||||
self._exclusivestyle = FPB_EXCLUSIVE_FOLD
|
||||
|
||||
return menu_bar
|
||||
|
||||
|
@@ -80,6 +80,7 @@ class MyCanvasBase(glcanvas.GLCanvas):
|
||||
# initial mouse position
|
||||
self.lastx = self.x = 30
|
||||
self.lasty = self.y = 30
|
||||
self.size = None
|
||||
self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnEraseBackground)
|
||||
self.Bind(wx.EVT_SIZE, self.OnSize)
|
||||
self.Bind(wx.EVT_PAINT, self.OnPaint)
|
||||
@@ -93,7 +94,7 @@ class MyCanvasBase(glcanvas.GLCanvas):
|
||||
|
||||
|
||||
def OnSize(self, event):
|
||||
size = self.GetClientSize()
|
||||
size = self.size = self.GetClientSize()
|
||||
if self.GetContext():
|
||||
self.SetCurrent()
|
||||
glViewport(0, 0, size.width, size.height)
|
||||
@@ -111,6 +112,7 @@ class MyCanvasBase(glcanvas.GLCanvas):
|
||||
|
||||
def OnMouseDown(self, evt):
|
||||
self.CaptureMouse()
|
||||
self.x, self.y = self.lastx, self.lasty = evt.GetPosition()
|
||||
|
||||
|
||||
def OnMouseUp(self, evt):
|
||||
@@ -119,7 +121,7 @@ class MyCanvasBase(glcanvas.GLCanvas):
|
||||
|
||||
def OnMouseMotion(self, evt):
|
||||
if evt.Dragging() and evt.LeftIsDown():
|
||||
self.x, self.y = self.lastx, self.lasty
|
||||
self.lastx, self.lasty = self.x, self.y
|
||||
self.x, self.y = evt.GetPosition()
|
||||
self.Refresh(False)
|
||||
|
||||
@@ -129,25 +131,25 @@ class MyCanvasBase(glcanvas.GLCanvas):
|
||||
class CubeCanvas(MyCanvasBase):
|
||||
def InitGL(self):
|
||||
# set viewing projection
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glFrustum(-0.5, 0.5, -0.5, 0.5, 1.0, 3.0);
|
||||
glMatrixMode(GL_PROJECTION)
|
||||
glFrustum(-0.5, 0.5, -0.5, 0.5, 1.0, 3.0)
|
||||
|
||||
# position viewer
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glTranslatef(0.0, 0.0, -2.0);
|
||||
glMatrixMode(GL_MODELVIEW)
|
||||
glTranslatef(0.0, 0.0, -2.0)
|
||||
|
||||
# position object
|
||||
glRotatef(self.y, 1.0, 0.0, 0.0);
|
||||
glRotatef(self.x, 0.0, 1.0, 0.0);
|
||||
glRotatef(self.y, 1.0, 0.0, 0.0)
|
||||
glRotatef(self.x, 0.0, 1.0, 0.0)
|
||||
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glEnable(GL_LIGHTING);
|
||||
glEnable(GL_LIGHT0);
|
||||
glEnable(GL_DEPTH_TEST)
|
||||
glEnable(GL_LIGHTING)
|
||||
glEnable(GL_LIGHT0)
|
||||
|
||||
|
||||
def OnDraw(self):
|
||||
# clear color and depth buffers
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
|
||||
|
||||
# draw six faces of a cube
|
||||
glBegin(GL_QUADS)
|
||||
@@ -188,8 +190,15 @@ class CubeCanvas(MyCanvasBase):
|
||||
glVertex3f(-0.5, 0.5,-0.5)
|
||||
glEnd()
|
||||
|
||||
glRotatef((self.lasty - self.y)/100., 1.0, 0.0, 0.0);
|
||||
glRotatef((self.lastx - self.x)/100., 0.0, 1.0, 0.0);
|
||||
if self.size is None:
|
||||
self.size = self.GetClientSize()
|
||||
w, h = self.size
|
||||
w = max(w, 1.0)
|
||||
h = max(h, 1.0)
|
||||
xScale = 180.0 / w
|
||||
yScale = 180.0 / h
|
||||
glRotatef((self.y - self.lasty) * yScale, 1.0, 0.0, 0.0);
|
||||
glRotatef((self.x - self.lastx) * xScale, 0.0, 1.0, 0.0);
|
||||
|
||||
self.SwapBuffers()
|
||||
|
||||
@@ -199,9 +208,9 @@ class CubeCanvas(MyCanvasBase):
|
||||
|
||||
class ConeCanvas(MyCanvasBase):
|
||||
def InitGL( self ):
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glMatrixMode(GL_PROJECTION)
|
||||
# camera frustrum setup
|
||||
glFrustum(-0.5, 0.5, -0.5, 0.5, 1.0, 3.0);
|
||||
glFrustum(-0.5, 0.5, -0.5, 0.5, 1.0, 3.0)
|
||||
glMaterial(GL_FRONT, GL_AMBIENT, [0.2, 0.2, 0.2, 1.0])
|
||||
glMaterial(GL_FRONT, GL_DIFFUSE, [0.8, 0.8, 0.8, 1.0])
|
||||
glMaterial(GL_FRONT, GL_SPECULAR, [1.0, 0.0, 1.0, 1.0])
|
||||
@@ -209,7 +218,7 @@ class ConeCanvas(MyCanvasBase):
|
||||
glLight(GL_LIGHT0, GL_AMBIENT, [0.0, 1.0, 0.0, 1.0])
|
||||
glLight(GL_LIGHT0, GL_DIFFUSE, [1.0, 1.0, 1.0, 1.0])
|
||||
glLight(GL_LIGHT0, GL_SPECULAR, [1.0, 1.0, 1.0, 1.0])
|
||||
glLight(GL_LIGHT0, GL_POSITION, [1.0, 1.0, 1.0, 0.0]);
|
||||
glLight(GL_LIGHT0, GL_POSITION, [1.0, 1.0, 1.0, 0.0])
|
||||
glLightModel(GL_LIGHT_MODEL_AMBIENT, [0.2, 0.2, 0.2, 1.0])
|
||||
glEnable(GL_LIGHTING)
|
||||
glEnable(GL_LIGHT0)
|
||||
@@ -217,25 +226,28 @@ class ConeCanvas(MyCanvasBase):
|
||||
glEnable(GL_DEPTH_TEST)
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
|
||||
# position viewer
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glMatrixMode(GL_MODELVIEW)
|
||||
# position viewer
|
||||
glTranslatef(0.0, 0.0, -2.0);
|
||||
|
||||
|
||||
|
||||
def OnDraw(self):
|
||||
# clear color and depth buffers
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
|
||||
# use a fresh transformation matrix
|
||||
glPushMatrix()
|
||||
# position object
|
||||
glTranslate(0.0, 0.0, -2.0);
|
||||
glRotate(30.0, 1.0, 0.0, 0.0);
|
||||
glRotate(30.0, 0.0, 1.0, 0.0);
|
||||
#glTranslate(0.0, 0.0, -2.0)
|
||||
glRotate(30.0, 1.0, 0.0, 0.0)
|
||||
glRotate(30.0, 0.0, 1.0, 0.0)
|
||||
|
||||
glTranslate(0, -1, 0)
|
||||
glRotate(250, 1, 0, 0)
|
||||
glutSolidCone(0.5, 1, 30, 5)
|
||||
glPopMatrix()
|
||||
glRotatef((self.lasty - self.y)/100., 0.0, 0.0, 1.0);
|
||||
glRotatef(0.0, (self.lastx - self.x)/100., 1.0, 0.0);
|
||||
glRotatef((self.y - self.lasty), 0.0, 0.0, 1.0);
|
||||
glRotatef((self.x - self.lastx), 1.0, 0.0, 0.0);
|
||||
# push into visible buffer
|
||||
self.SwapBuffers()
|
||||
|
||||
|
@@ -89,7 +89,7 @@ class TestPanel(wx.Panel):
|
||||
|
||||
|
||||
def OnRightLink(self, event):
|
||||
pos = event.GetPosition()
|
||||
pos = self._hyper3.GetPosition() + event.GetPosition()
|
||||
menuPopUp = wx.Menu("Having a nice day?")
|
||||
ID_MENU_YES = wx.NewId()
|
||||
ID_MENU_NO = wx.NewId()
|
||||
|
@@ -56,7 +56,7 @@ class TestLayoutConstraints(wx.Panel):
|
||||
lc.centreY.SameAs (self.panelA, wx.CentreY)
|
||||
lc.height.AsIs ()
|
||||
lc.width.PercentOf (self.panelA, wx.Width, 50)
|
||||
b.SetConstraints(lc);
|
||||
b.SetConstraints(lc)
|
||||
|
||||
b = wx.Button(self.panelB, 100, ' Panel B ')
|
||||
lc = wx.LayoutConstraints()
|
||||
@@ -64,7 +64,7 @@ class TestLayoutConstraints(wx.Panel):
|
||||
lc.right.SameAs (self.panelB, wx.Right, 4)
|
||||
lc.height.AsIs ()
|
||||
lc.width.AsIs ()
|
||||
b.SetConstraints(lc);
|
||||
b.SetConstraints(lc)
|
||||
|
||||
self.panelD = wx.Window(self.panelC, -1, style=wx.SIMPLE_BORDER)
|
||||
self.panelD.SetBackgroundColour(wx.GREEN)
|
||||
@@ -78,14 +78,14 @@ class TestLayoutConstraints(wx.Panel):
|
||||
lc.left.RightOf (self.panelD)
|
||||
lc.height.AsIs ()
|
||||
lc.width.AsIs ()
|
||||
b.SetConstraints(lc);
|
||||
b.SetConstraints(lc)
|
||||
|
||||
lc = wx.LayoutConstraints()
|
||||
lc.bottom.PercentOf (self.panelC, wx.Height, 50)
|
||||
lc.right.PercentOf (self.panelC, wx.Width, 50)
|
||||
lc.height.SameAs (b, wx.Height)
|
||||
lc.width.SameAs (b, wx.Width)
|
||||
self.panelD.SetConstraints(lc);
|
||||
self.panelD.SetConstraints(lc)
|
||||
|
||||
|
||||
def OnButton(self, event):
|
||||
|
@@ -1,8 +1,7 @@
|
||||
|
||||
import wx
|
||||
|
||||
import MDIDemo
|
||||
import MDISashDemo
|
||||
import os
|
||||
import sys
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
@@ -25,14 +24,14 @@ class TestPanel(wx.Panel):
|
||||
self.SetSizer(box)
|
||||
|
||||
|
||||
# These are spawned as new processes because on Mac there can be
|
||||
# some problems related to having regular frames and MDI frames in
|
||||
# the same app.
|
||||
def ShowMDIDemo(self, evt):
|
||||
frame = MDIDemo.MyParentFrame()
|
||||
frame.Show()
|
||||
os.spawnl(os.P_NOWAIT, sys.executable, sys.executable, "MDIDemo.py")
|
||||
|
||||
def ShowMDISashDemo(self, evt):
|
||||
frame = MDISashDemo.MyParentFrame()
|
||||
frame.Show()
|
||||
|
||||
os.spawnl(os.P_NOWAIT, sys.executable, sys.executable, "MDISashDemo.py")
|
||||
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
|
@@ -51,6 +51,7 @@ _treeList = [
|
||||
'GIFAnimationCtrl',
|
||||
'HyperLinkCtrl',
|
||||
'MultiSplitterWindow',
|
||||
'Throbber',
|
||||
]),
|
||||
|
||||
# managed windows == things with a (optional) caption you can close
|
||||
@@ -803,7 +804,8 @@ class DemoModules:
|
||||
def LoadDict(self, modID):
|
||||
if self.name != __name__:
|
||||
source = self.modules[modID][1]
|
||||
description = self.modules[modID][3]
|
||||
#description = self.modules[modID][3]
|
||||
description = self.modules[modID][2]
|
||||
|
||||
try:
|
||||
self.modules[modID][0] = {}
|
||||
@@ -1211,6 +1213,7 @@ class wxPythonDemo(wx.Frame):
|
||||
self.SetMenuBar(self.mainmenu)
|
||||
|
||||
self.finddata = wx.FindReplaceData()
|
||||
self.finddata.SetFlags(wx.FR_DOWN)
|
||||
|
||||
if 0:
|
||||
# This is another way to set Accelerators, in addition to
|
||||
@@ -1528,9 +1531,7 @@ class wxPythonDemo(wx.Frame):
|
||||
|
||||
self.nb.SetSelection(1)
|
||||
self.finddlg = wx.FindReplaceDialog(self, self.finddata, "Find",
|
||||
wx.FR_NOUPDOWN |
|
||||
wx.FR_NOMATCHCASE |
|
||||
wx.FR_NOWHOLEWORD)
|
||||
wx.FR_NOMATCHCASE | wx.FR_NOWHOLEWORD)
|
||||
self.finddlg.Show(True)
|
||||
|
||||
|
||||
@@ -1543,13 +1544,22 @@ class wxPythonDemo(wx.Frame):
|
||||
self.nb.SetSelection(1)
|
||||
end = editor.GetLastPosition()
|
||||
textstring = editor.GetRange(0, end).lower()
|
||||
start = editor.GetSelection()[1]
|
||||
findstring = self.finddata.GetFindString().lower()
|
||||
loc = textstring.find(findstring, start)
|
||||
backward = not (self.finddata.GetFlags() & wx.FR_DOWN)
|
||||
if backward:
|
||||
start = editor.GetSelection()[0]
|
||||
loc = textstring.rfind(findstring, 0, start)
|
||||
else:
|
||||
start = editor.GetSelection()[1]
|
||||
loc = textstring.find(findstring, start)
|
||||
if loc == -1 and start != 0:
|
||||
# string not found, start at beginning
|
||||
start = 0
|
||||
loc = textstring.find(findstring, start)
|
||||
if backward:
|
||||
start = end
|
||||
loc = textstring.rfind(findstring, 0, start)
|
||||
else:
|
||||
start = 0
|
||||
loc = textstring.find(findstring, start)
|
||||
if loc == -1:
|
||||
dlg = wx.MessageDialog(self, 'Find String Not Found',
|
||||
'Find String Not Found in Demo File',
|
||||
|
@@ -22,7 +22,8 @@ class TestPanel(wx.Panel):
|
||||
self.cmd = wx.TextCtrl(self, -1, 'python -u data/echo.py')
|
||||
self.exBtn = wx.Button(self, -1, 'Execute')
|
||||
|
||||
self.out = wx.TextCtrl(self, -1, '', style=wx.TE_MULTILINE|wx.TE_READONLY)
|
||||
self.out = wx.TextCtrl(self, -1, '',
|
||||
style=wx.TE_MULTILINE|wx.TE_READONLY|wx.TE_RICH2)
|
||||
|
||||
self.inp = wx.TextCtrl(self, -1, '', style=wx.TE_PROCESS_ENTER)
|
||||
self.sndBtn = wx.Button(self, -1, 'Send')
|
||||
|
@@ -75,33 +75,33 @@ class PythonSTC(stc.StyledTextCtrl):
|
||||
|
||||
if self.fold_symbols == 0:
|
||||
# Arrow pointing right for contracted folders, arrow pointing down for expanded
|
||||
self.MarkerDefine(stc.STC_MARKNUM_FOLDEROPEN, stc.STC_MARK_ARROWDOWN, "black", "black");
|
||||
self.MarkerDefine(stc.STC_MARKNUM_FOLDER, stc.STC_MARK_ARROW, "black", "black");
|
||||
self.MarkerDefine(stc.STC_MARKNUM_FOLDERSUB, stc.STC_MARK_EMPTY, "black", "black");
|
||||
self.MarkerDefine(stc.STC_MARKNUM_FOLDERTAIL, stc.STC_MARK_EMPTY, "black", "black");
|
||||
self.MarkerDefine(stc.STC_MARKNUM_FOLDEREND, stc.STC_MARK_EMPTY, "white", "black");
|
||||
self.MarkerDefine(stc.STC_MARKNUM_FOLDEROPENMID, stc.STC_MARK_EMPTY, "white", "black");
|
||||
self.MarkerDefine(stc.STC_MARKNUM_FOLDERMIDTAIL, stc.STC_MARK_EMPTY, "white", "black");
|
||||
self.MarkerDefine(stc.STC_MARKNUM_FOLDEROPEN, stc.STC_MARK_ARROWDOWN, "black", "black")
|
||||
self.MarkerDefine(stc.STC_MARKNUM_FOLDER, stc.STC_MARK_ARROW, "black", "black")
|
||||
self.MarkerDefine(stc.STC_MARKNUM_FOLDERSUB, stc.STC_MARK_EMPTY, "black", "black")
|
||||
self.MarkerDefine(stc.STC_MARKNUM_FOLDERTAIL, stc.STC_MARK_EMPTY, "black", "black")
|
||||
self.MarkerDefine(stc.STC_MARKNUM_FOLDEREND, stc.STC_MARK_EMPTY, "white", "black")
|
||||
self.MarkerDefine(stc.STC_MARKNUM_FOLDEROPENMID, stc.STC_MARK_EMPTY, "white", "black")
|
||||
self.MarkerDefine(stc.STC_MARKNUM_FOLDERMIDTAIL, stc.STC_MARK_EMPTY, "white", "black")
|
||||
|
||||
elif self.fold_symbols == 1:
|
||||
# Plus for contracted folders, minus for expanded
|
||||
self.MarkerDefine(stc.STC_MARKNUM_FOLDEROPEN, stc.STC_MARK_MINUS, "white", "black");
|
||||
self.MarkerDefine(stc.STC_MARKNUM_FOLDER, stc.STC_MARK_PLUS, "white", "black");
|
||||
self.MarkerDefine(stc.STC_MARKNUM_FOLDERSUB, stc.STC_MARK_EMPTY, "white", "black");
|
||||
self.MarkerDefine(stc.STC_MARKNUM_FOLDERTAIL, stc.STC_MARK_EMPTY, "white", "black");
|
||||
self.MarkerDefine(stc.STC_MARKNUM_FOLDEREND, stc.STC_MARK_EMPTY, "white", "black");
|
||||
self.MarkerDefine(stc.STC_MARKNUM_FOLDEROPENMID, stc.STC_MARK_EMPTY, "white", "black");
|
||||
self.MarkerDefine(stc.STC_MARKNUM_FOLDERMIDTAIL, stc.STC_MARK_EMPTY, "white", "black");
|
||||
self.MarkerDefine(stc.STC_MARKNUM_FOLDEROPEN, stc.STC_MARK_MINUS, "white", "black")
|
||||
self.MarkerDefine(stc.STC_MARKNUM_FOLDER, stc.STC_MARK_PLUS, "white", "black")
|
||||
self.MarkerDefine(stc.STC_MARKNUM_FOLDERSUB, stc.STC_MARK_EMPTY, "white", "black")
|
||||
self.MarkerDefine(stc.STC_MARKNUM_FOLDERTAIL, stc.STC_MARK_EMPTY, "white", "black")
|
||||
self.MarkerDefine(stc.STC_MARKNUM_FOLDEREND, stc.STC_MARK_EMPTY, "white", "black")
|
||||
self.MarkerDefine(stc.STC_MARKNUM_FOLDEROPENMID, stc.STC_MARK_EMPTY, "white", "black")
|
||||
self.MarkerDefine(stc.STC_MARKNUM_FOLDERMIDTAIL, stc.STC_MARK_EMPTY, "white", "black")
|
||||
|
||||
elif self.fold_symbols == 2:
|
||||
# Like a flattened tree control using circular headers and curved joins
|
||||
self.MarkerDefine(stc.STC_MARKNUM_FOLDEROPEN, stc.STC_MARK_CIRCLEMINUS, "white", "#404040");
|
||||
self.MarkerDefine(stc.STC_MARKNUM_FOLDER, stc.STC_MARK_CIRCLEPLUS, "white", "#404040");
|
||||
self.MarkerDefine(stc.STC_MARKNUM_FOLDERSUB, stc.STC_MARK_VLINE, "white", "#404040");
|
||||
self.MarkerDefine(stc.STC_MARKNUM_FOLDERTAIL, stc.STC_MARK_LCORNERCURVE, "white", "#404040");
|
||||
self.MarkerDefine(stc.STC_MARKNUM_FOLDEREND, stc.STC_MARK_CIRCLEPLUSCONNECTED, "white", "#404040");
|
||||
self.MarkerDefine(stc.STC_MARKNUM_FOLDEROPENMID, stc.STC_MARK_CIRCLEMINUSCONNECTED, "white", "#404040");
|
||||
self.MarkerDefine(stc.STC_MARKNUM_FOLDERMIDTAIL, stc.STC_MARK_TCORNERCURVE, "white", "#404040");
|
||||
self.MarkerDefine(stc.STC_MARKNUM_FOLDEROPEN, stc.STC_MARK_CIRCLEMINUS, "white", "#404040")
|
||||
self.MarkerDefine(stc.STC_MARKNUM_FOLDER, stc.STC_MARK_CIRCLEPLUS, "white", "#404040")
|
||||
self.MarkerDefine(stc.STC_MARKNUM_FOLDERSUB, stc.STC_MARK_VLINE, "white", "#404040")
|
||||
self.MarkerDefine(stc.STC_MARKNUM_FOLDERTAIL, stc.STC_MARK_LCORNERCURVE, "white", "#404040")
|
||||
self.MarkerDefine(stc.STC_MARKNUM_FOLDEREND, stc.STC_MARK_CIRCLEPLUSCONNECTED, "white", "#404040")
|
||||
self.MarkerDefine(stc.STC_MARKNUM_FOLDEROPENMID, stc.STC_MARK_CIRCLEMINUSCONNECTED, "white", "#404040")
|
||||
self.MarkerDefine(stc.STC_MARKNUM_FOLDERMIDTAIL, stc.STC_MARK_TCORNERCURVE, "white", "#404040")
|
||||
|
||||
elif self.fold_symbols == 3:
|
||||
# Like a flattened tree control using square headers
|
||||
@@ -286,7 +286,7 @@ class PythonSTC(stc.StyledTextCtrl):
|
||||
for lineNum in range(lineCount):
|
||||
if self.GetFoldLevel(lineNum) & stc.STC_FOLDLEVELHEADERFLAG:
|
||||
expanding = not self.GetFoldExpanded(lineNum)
|
||||
break;
|
||||
break
|
||||
|
||||
lineNum = 0
|
||||
|
||||
@@ -342,7 +342,7 @@ class PythonSTC(stc.StyledTextCtrl):
|
||||
else:
|
||||
line = self.Expand(line, False, force, visLevels-1)
|
||||
else:
|
||||
line = line + 1;
|
||||
line = line + 1
|
||||
|
||||
return line
|
||||
|
||||
|
@@ -1,6 +1,5 @@
|
||||
|
||||
import os
|
||||
|
||||
import wx
|
||||
import wx.lib.printout as printout
|
||||
|
||||
@@ -9,6 +8,7 @@ import wx.lib.printout as printout
|
||||
buttonDefs = {
|
||||
814 : ('PreviewWide', 'Preview print of a wide table'),
|
||||
815 : ('PreviewNarrow', 'Preview print of a narrow table with color highlights'),
|
||||
816 : ('PreviewText', 'Preview print of a text file'),
|
||||
818 : ('OnPreviewMatrix', 'Preview print of a narrow column grid without a table header'),
|
||||
817 : ('PreviewLine', 'Preview print to demonstrate the use of line breaks'),
|
||||
819 : ('PrintWide', 'Direct print (no preview) of a wide table'),
|
||||
@@ -150,6 +150,17 @@ class TablePanel(wx.Panel):
|
||||
prt.SetFooter()
|
||||
prt.Preview()
|
||||
|
||||
def PreviewText(self):
|
||||
prt = printout.PrintTable(self.frame)
|
||||
prt.SetHeader("PROCLAMATION")
|
||||
file = open('data/proclamation.txt')
|
||||
data = []
|
||||
for txt in file:
|
||||
data.append(txt.strip())
|
||||
file.close()
|
||||
prt.data = data
|
||||
prt.Preview()
|
||||
|
||||
def PrintWide(self):
|
||||
self.ReadData()
|
||||
prt = printout.PrintTable(self.frame)
|
||||
|
@@ -69,6 +69,13 @@ class TestPanel(wx.Panel):
|
||||
pointSize = 8, family = wx.DEFAULT, style = wx.NORMAL, weight = wx.BOLD
|
||||
))
|
||||
|
||||
self.customThrobber = \
|
||||
throb.Throbber(self, -1, images, size=(36, 36),
|
||||
frameDelay = 0.1,
|
||||
rest = 4,
|
||||
sequence = [ 1, 5, 2, 7, 3, 6, 4, 4, 4, 4, 7, 2, 2, 0 ]
|
||||
)
|
||||
|
||||
box = wx.BoxSizer(wx.VERTICAL)
|
||||
sizer = wx.GridBagSizer()
|
||||
box.Add(sizer, 1, wx.EXPAND|wx.ALL, 5)
|
||||
@@ -90,6 +97,18 @@ class TestPanel(wx.Panel):
|
||||
|
||||
row += 1
|
||||
|
||||
# Add custom throbber to sizer.
|
||||
row += 2
|
||||
sizer.Add(
|
||||
self.customThrobber, (row, 0), (1, 1),
|
||||
flag = wx.ALIGN_CENTER|wx.ALL, border=2
|
||||
)
|
||||
|
||||
sizer.Add(
|
||||
wx.StaticText(self, -1, 'with custom & manual sequences'),
|
||||
(row, 1), flag = wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_LEFT
|
||||
)
|
||||
|
||||
# start and stop buttons
|
||||
startButton = wx.Button(self, -1, "Start")
|
||||
self.Bind(wx.EVT_BUTTON, self.OnStartAnimation, startButton)
|
||||
@@ -104,9 +123,54 @@ class TestPanel(wx.Panel):
|
||||
])
|
||||
|
||||
sizer.Add(
|
||||
buttonBox, (len(self.throbbers) + 3, 0), (1, 3), flag = wx.ALIGN_CENTER
|
||||
buttonBox, (len(self.throbbers) + 2, 0), (1, 3), flag = wx.ALIGN_CENTER
|
||||
)
|
||||
|
||||
# Buttoms for the custom throbber.
|
||||
nextButton = wx.Button(self, -1, "Next")
|
||||
self.Bind(wx.EVT_BUTTON, self.OnNext, nextButton)
|
||||
|
||||
prevButton = wx.Button(self, -1, "Previous")
|
||||
self.Bind(wx.EVT_BUTTON, self.OnPrevious, prevButton)
|
||||
|
||||
incButton = wx.Button(self, -1, "Increment")
|
||||
self.Bind(wx.EVT_BUTTON, self.OnIncrement, incButton)
|
||||
|
||||
decButton = wx.Button(self, -1, "Decrement")
|
||||
self.Bind(wx.EVT_BUTTON, self.OnDecrement, decButton)
|
||||
|
||||
revButton = wx.Button(self, -1, "Reverse")
|
||||
self.Bind(wx.EVT_BUTTON, self.OnReverse, revButton)
|
||||
|
||||
restButton = wx.Button(self, -1, "Rest")
|
||||
self.Bind(wx.EVT_BUTTON, self.OnRest, restButton)
|
||||
|
||||
startButton = wx.Button(self, -1, "Start")
|
||||
self.Bind(wx.EVT_BUTTON, self.OnStart, startButton)
|
||||
|
||||
stopButton = wx.Button(self, -1, "Stop")
|
||||
self.Bind(wx.EVT_BUTTON, self.OnStop, stopButton)
|
||||
|
||||
customBox1 = wx.BoxSizer(wx.HORIZONTAL)
|
||||
customBox1.AddMany([
|
||||
(nextButton, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALL, 5),
|
||||
(prevButton, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALL, 5),
|
||||
(incButton, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALL, 5),
|
||||
(decButton, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALL, 5),
|
||||
(revButton, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALL, 5),
|
||||
])
|
||||
|
||||
customBox2 = wx.BoxSizer(wx.HORIZONTAL)
|
||||
customBox2.AddMany([
|
||||
(restButton, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALL, 5),
|
||||
(startButton, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALL, 5),
|
||||
(stopButton, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALL, 5),
|
||||
])
|
||||
|
||||
sizer.Add( customBox1, (len(self.throbbers) + 5, 0), (1, 3), flag = wx.ALIGN_CENTER )
|
||||
sizer.Add( customBox2, (len(self.throbbers) + 6, 0), (1, 3), flag = wx.ALIGN_CENTER )
|
||||
|
||||
# Layout.
|
||||
self.SetSizer(box)
|
||||
self.SetAutoLayout(True)
|
||||
self.Layout()
|
||||
@@ -130,6 +194,30 @@ class TestPanel(wx.Panel):
|
||||
for t in self.throbbers.keys():
|
||||
self.throbbers[t]['throbber'].Rest()
|
||||
|
||||
def OnNext(self, event):
|
||||
self.customThrobber.Next()
|
||||
|
||||
def OnPrevious(self, event):
|
||||
self.customThrobber.Previous()
|
||||
|
||||
def OnIncrement(self, event):
|
||||
self.customThrobber.Increment()
|
||||
|
||||
def OnDecrement(self, event):
|
||||
self.customThrobber.Decrement()
|
||||
|
||||
def OnReverse(self, event):
|
||||
self.customThrobber.Reverse()
|
||||
|
||||
def OnRest(self, event):
|
||||
self.customThrobber.Rest()
|
||||
|
||||
def OnStart(self, event):
|
||||
self.customThrobber.Start()
|
||||
|
||||
def OnStop(self, event):
|
||||
self.customThrobber.Stop()
|
||||
|
||||
def ShutdownDemo(self):
|
||||
for t in self.throbbers.keys():
|
||||
self.throbbers[t]['throbber'].Rest()
|
||||
|
@@ -71,11 +71,11 @@ class MyCustomPanelXmlHandler(xrc.XmlResourceHandler):
|
||||
def __init__(self):
|
||||
xrc.XmlResourceHandler.__init__(self)
|
||||
# Specify the styles recognized by objects of this type
|
||||
self.AddStyle("wxNO_3D", wx.NO_3D);
|
||||
self.AddStyle("wxTAB_TRAVERSAL", wx.TAB_TRAVERSAL);
|
||||
self.AddStyle("wxWS_EX_VALIDATE_RECURSIVELY", wx.WS_EX_VALIDATE_RECURSIVELY);
|
||||
self.AddStyle("wxCLIP_CHILDREN", wx.CLIP_CHILDREN);
|
||||
self.AddWindowStyles();
|
||||
self.AddStyle("wxNO_3D", wx.NO_3D)
|
||||
self.AddStyle("wxTAB_TRAVERSAL", wx.TAB_TRAVERSAL)
|
||||
self.AddStyle("wxWS_EX_VALIDATE_RECURSIVELY", wx.WS_EX_VALIDATE_RECURSIVELY)
|
||||
self.AddStyle("wxCLIP_CHILDREN", wx.CLIP_CHILDREN)
|
||||
self.AddWindowStyles()
|
||||
|
||||
# This method and the next one are required for XmlResourceHandlers
|
||||
def CanHandle(self, node):
|
||||
|
115
wxPython/demo/data/proclamation.txt
Normal file
115
wxPython/demo/data/proclamation.txt
Normal file
@@ -0,0 +1,115 @@
|
||||
EMANCIPATION PROCLAMATION:
|
||||
By the President of the United States of America:
|
||||
A PROCLAMATION
|
||||
|
||||
Whereas on the 22nd day of September, A.D. 1862, a proclamation
|
||||
was issued by the President of the United States, containing,
|
||||
among other things, the following, to wit:
|
||||
|
||||
"That on the 1st day of January, A.D. 1863, all persons held as
|
||||
slaves within any State or designated part of a State the people
|
||||
whereof shall then be in rebellion against the United States shall
|
||||
be then, thenceforward, and forever free; and the executive
|
||||
government of the United States, including the military and naval
|
||||
authority thereof, will recognize and maintain the freedom of such
|
||||
persons and will do no act or acts to repress such persons, or any
|
||||
of them, in any efforts they may make for their actual freedom.
|
||||
|
||||
"That the executive will on the 1st day of January aforesaid,
|
||||
by proclamation, designate the States and parts of States, if any,
|
||||
in which the people thereof, respectively, shall then be in
|
||||
rebellion against the United States; and the fact that any State
|
||||
or the people thereof shall on that day be in good faith
|
||||
represented in the Congress of the United States by members
|
||||
chosen thereto at elections wherein a majority of the qualified
|
||||
voters of such States shall have participated shall, in the
|
||||
absence of strong countervailing testimony, be deemed conclusive
|
||||
evidence that such State and the people thereof are not then
|
||||
in rebellion against the United States."
|
||||
|
||||
Now, therefore, I, Abraham Lincoln, President of the United
|
||||
States, by virtue of the power in me vested as Commander-In-Chief
|
||||
of the Army and Navy of the United States in time of actual armed
|
||||
rebellion against the authority and government of the United States,
|
||||
and as a fit and necessary war measure for supressing said
|
||||
rebellion, do, on this 1st day of January, A.D. 1863, and in
|
||||
accordance with my purpose so to do, publicly proclaimed for the
|
||||
full period of one hundred days from the first day above mentioned,
|
||||
order and designate as the States and parts of States wherein the
|
||||
people thereof, respectively, are this day in rebellion against
|
||||
the United States the following, to wit:
|
||||
|
||||
Arkansas, Texas, Louisiana (except the parishes of St. Bernard,
|
||||
Palquemines, Jefferson, St. John, St. Charles, St. James, Ascension,
|
||||
Assumption, Terrebone, Lafourche, St. Mary, St. Martin, and Orleans,
|
||||
including the city of New Orleans), Mississippi, Alabama, Florida,
|
||||
Georgia, South Carolina, North Carolina, and Virginia (except the
|
||||
forty-eight counties designated as West Virginia, and also the
|
||||
counties of Berkeley, Accomac, Morthhampton, Elizabeth City, York,
|
||||
Princess Anne, and Norfolk, including the cities of Norfolk and
|
||||
Portsmouth), and which excepted parts are for the present left
|
||||
precisely as if this proclamation were not issued.
|
||||
|
||||
And by virtue of the power and for the purpose aforesaid, I do
|
||||
order and declare that all persons held as slaves within said
|
||||
designated States and parts of States are, and henceforward shall
|
||||
be, free; and that the Executive Government of the United States,
|
||||
including the military and naval authorities thereof, will
|
||||
recognize and maintain the freedom of said persons.
|
||||
|
||||
And I hereby enjoin upon the people so declared to be free to
|
||||
abstain from all violence, unless in necessary self-defence; and
|
||||
I recommend to them that, in all case when allowed, they labor
|
||||
faithfully for reasonable wages.
|
||||
|
||||
And I further declare and make known that such persons of
|
||||
suitable condition will be received into the armed service of
|
||||
the United States to garrison forts, positions, stations, and
|
||||
other places, and to man vessels of all sorts in said service.
|
||||
|
||||
And upon this act, sincerely believed to be an act of justice,
|
||||
warranted by the Constitution upon military necessity, I invoke
|
||||
the considerate judgment of mankind and the gracious favor
|
||||
of Almighty God.
|
||||
|
||||
(signed)
|
||||
ABRAHAM LINCOLN
|
||||
-------------------------------------
|
||||
|
||||
On Jan. 1, 1863, U.S. President Abraham Lincoln declared free
|
||||
all slaves residing in territory in rebellion against the federal
|
||||
government. This Emancipation Proclamation actually freed few
|
||||
people. It did not apply to slaves in border states fighting on
|
||||
the Union side; nor did it affect slaves in southern areas already
|
||||
under Union control. Naturally, the states in rebellion did not
|
||||
act on Lincoln's order. But the proclamation did show Americans--
|
||||
and the world--that the civil war was now being fought to end slavery.
|
||||
|
||||
Lincoln had been reluctant to come to this position. A believer
|
||||
in white supremacy, he initially viewed the war only in terms of
|
||||
preserving the Union. As pressure for abolition mounted in
|
||||
Congress and the country, however, Lincoln became more sympathetic
|
||||
to the idea. On Sept. 22, 1862, he issued a preliminary proclamation
|
||||
announcing that emancipation would become effective on Jan. 1, 1863,
|
||||
in those states still in rebellion. Although the Emancipation
|
||||
Proclamation did not end slavery in America--this was achieved
|
||||
by the passage of the 13TH Amendment to the Constitution on Dec.
|
||||
18, 1865--it did make that accomplishment a basic war goal and
|
||||
a virtual certainty.
|
||||
|
||||
DOUGLAS T. MILLER
|
||||
|
||||
Bibliography: Commager, Henry Steele, The Great Proclamation
|
||||
(1960); Donovan, Frank, Mr. Lincoln's Proclamation (1964);
|
||||
Franklin, John Hope, ed., The Emancipation Proclamation (1964).
|
||||
|
||||
-------------------------------------
|
||||
|
||||
Prepared by Gerald Murphy (The Cleveland Free-Net - aa300)
|
||||
Distributed by the Cybercasting Services Division of the
|
||||
National Public Telecomputing Network (NPTN).
|
||||
|
||||
Permission is hereby granted to download, reprint, and/or otherwise
|
||||
redistribute this file, provided appropriate point of origin
|
||||
credit is given to the preparer(s) and the National Public
|
||||
Telecomputing Network.
|
Reference in New Issue
Block a user