A huge glob of changes in the 2.4 branch merged over to HEAD
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24050 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -8,11 +8,10 @@ that you know your way around a command line and that you know how to
|
||||
get things from various CVS repositories as needed.
|
||||
|
||||
|
||||
1. "MacPython-OSX" 2.3 is required. There is a disk image with an
|
||||
installer package in the wxPython Sourceforge download area, in
|
||||
this group:
|
||||
1. "MacPython-OSX" 2.3 is required. If you don't have it already there is a disk image with an
|
||||
installer package at
|
||||
|
||||
http://sourceforge.net/project/showfiles.php?group_id=10718&release_id=84730
|
||||
http://homepages.cwi.nl/~jack/macpython/download.html
|
||||
|
||||
If, for some reason you need to build your own Python, get the
|
||||
source from www.python.org and follow the instructions in the
|
||||
@@ -34,7 +33,16 @@ get things from various CVS repositories as needed.
|
||||
3. Run configure from that build directory.
|
||||
|
||||
cd build
|
||||
../configure --with-mac --with-opengl --enable-debug
|
||||
../configure --with-mac
|
||||
--with-opengl \
|
||||
--enable-geometry \
|
||||
--enable-optimise \
|
||||
--with-libjpeg=builtin \
|
||||
--with-libpng=builtin \
|
||||
--with-libtiff=builtin \
|
||||
|
||||
If you want to add code that activates various runtime checks and
|
||||
assertion exceptions then add --enable-debug_flag.
|
||||
|
||||
4. Make and install wxMac.
|
||||
|
||||
|
@@ -6,7 +6,7 @@ directions for how to build wxPython the "new way." This files
|
||||
describes the "old way" to build on unix-like systems. The difference
|
||||
is very simple: The new way uses a private copy of wxGTK while the
|
||||
old way uses either an existing wxGTK that may be installed and used
|
||||
by other apps, or you can build a wxGTK that will be accissible by
|
||||
by other apps, or you can build a wxGTK that will be accessable by
|
||||
other apps.
|
||||
|
||||
|
||||
|
@@ -19,13 +19,13 @@ I use a tool called SWIG (http://www.swig.org) to help generate the
|
||||
C++ sources used in the wxPython extension module. However you don't
|
||||
need to have SWIG unless you want to modify the *.i files. I've made
|
||||
several modifications to SWIG specific to wxPython's needs and so the
|
||||
modified sources are included in the wx CVS at.../wxPython/wxSWIG.
|
||||
modified sources are included in the wx CVS at .../wxPython/wxSWIG.
|
||||
But because of the size and since most people won't need it my SWIG is
|
||||
not included in the wxPythonSrc tarball. You'll need to get it from
|
||||
CVS or a CVS snapshot.
|
||||
|
||||
If you need to modify the *.i files for wxPython then change to this
|
||||
directory and run:
|
||||
If you need to modify the *.i files for wxPython then change to the
|
||||
.../wxPython/wxSWIG directory and run:
|
||||
|
||||
nmake -f makefile.vc
|
||||
|
||||
@@ -119,7 +119,6 @@ C. Change to the %WXWIN%\include\wx\msw directory and copy setup0.h to
|
||||
wxUSE_TREELAYOUT 0
|
||||
wxUSE_MS_HTML_HELP 0
|
||||
wxUSE_POSTSCRIPT 1
|
||||
wxUSE_DYNLIB_CLASS 1
|
||||
|
||||
|
||||
** NEW **
|
||||
|
@@ -41,12 +41,21 @@ from wxBookCtrl.
|
||||
|
||||
|
||||
|
||||
2.4.1.x
|
||||
2.4.2.4
|
||||
-------
|
||||
|
||||
Use wxSTC in the demo for displaying the soucre code of the samples.
|
||||
|
||||
Lots of bug fixes and such from the wxWindows folks.
|
||||
|
||||
Added wxPython.lib.newevent from Miki Tebeka. Its usage is
|
||||
demonstrated in the Threads sample in the demo.
|
||||
|
||||
Updates to wxMaskedEditCtrl.
|
||||
|
||||
Added wxMaskedNumCtrl.
|
||||
|
||||
Added Chris Barker's FloatCanvas.
|
||||
|
||||
|
||||
|
||||
|
@@ -19,18 +19,18 @@ and to play with as a learning exercise.
|
||||
The next thing you should do is join the wxPython-users maillist where
|
||||
you can interact with a community of other users and developers who
|
||||
are willing to help you learn, answer questions and solve problems.
|
||||
To join the mail list just send an email message to the following
|
||||
address from the account you want to receive the mail messages from
|
||||
the list:
|
||||
To join the mail list just go to this web page and follow the
|
||||
instructions there:
|
||||
|
||||
wxPython-users-subscribe@lists.wxwindows.org
|
||||
http://wxpython.org/maillist.php
|
||||
|
||||
There is also a good set of class reference documentation available
|
||||
for wxPython, but currently it is geared for the C++ user. This may
|
||||
be a little daunting at first, but with a little practice you'll
|
||||
easily be able to "translate" from the C++ shown there to Python. Not
|
||||
all classes documented are available in Python, but most of the GUI
|
||||
related classes are.
|
||||
easily be able to "mentally translate" from the C++ shown into Python.
|
||||
(See http://wiki.wxpython.org/index.cgi/C_2b_2bGuideForwxPythoneers
|
||||
for a little help on this process.) Not all classes documented are
|
||||
available in Python, but most of the GUI related classes are.
|
||||
|
||||
|
||||
Other Info
|
||||
|
@@ -72,13 +72,6 @@ elseiff "%1" == "a" then
|
||||
shift
|
||||
set CMD=echo Finished!
|
||||
|
||||
call b.bat 21 d
|
||||
call b.bat 21 h
|
||||
call b.bat 21 r
|
||||
call b.bat 21 d UNICODE=1
|
||||
call b.bat 21 h UNICODE=1
|
||||
call b.bat 21 r UNICODE=1
|
||||
|
||||
call b.bat 22 d
|
||||
call b.bat 22 h
|
||||
call b.bat 22 r
|
||||
|
@@ -16,10 +16,6 @@
|
||||
%{
|
||||
#include "wxPython.h"
|
||||
|
||||
#ifdef __WXMAC__ // avoid a bug in Carbon headers
|
||||
#define scalb scalbn
|
||||
#endif
|
||||
|
||||
#ifdef __WXMSW__
|
||||
#include "myglcanvas.h"
|
||||
#else
|
||||
|
@@ -56,10 +56,6 @@ extern PyObject *SWIG_newvarlink(void);
|
||||
|
||||
#include "wxPython.h"
|
||||
|
||||
#ifdef __WXMAC__ // avoid a bug in Carbon headers
|
||||
#define scalb scalbn
|
||||
#endif
|
||||
|
||||
#ifdef __WXMSW__
|
||||
#include "myglcanvas.h"
|
||||
#else
|
||||
|
@@ -11,7 +11,7 @@ you can use just like wxWindow, (set the size and position, use in a
|
||||
sizer, etc.) except its contents will be the COM control.
|
||||
|
||||
<p>
|
||||
This demo embeds the Internet Exploer WebBrowser control, and shows
|
||||
This demo embeds the Internet Explorer WebBrowser control, and shows
|
||||
how to receive events from the COM control. (The title bar and status
|
||||
bar are updated as pages change, in addition to the log messages being
|
||||
shown.)
|
||||
|
@@ -5,11 +5,6 @@ from wxPython.lib import colourdb
|
||||
import images
|
||||
|
||||
|
||||
# This loads a whole bunch of new color names and values
|
||||
# into wxTheColourDatabase
|
||||
|
||||
colourdb.updateColourDB()
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
class TestWindow(wxScrolledWindow):
|
||||
@@ -28,7 +23,7 @@ class TestWindow(wxScrolledWindow):
|
||||
dc = wxClientDC(self)
|
||||
dc.SetFont(self.font)
|
||||
|
||||
w,h,d,e = dc.GetFullTextExtent("Wy") # a wide character and one that decends
|
||||
w,h,d,e = dc.GetFullTextExtent("Wy") # a wide character and one that descends
|
||||
self.textHeight = h + d
|
||||
self.lineHeight = self.textHeight + 5
|
||||
self.cellWidth = w
|
||||
@@ -120,6 +115,10 @@ class TestPanel(wxPanel):
|
||||
|
||||
|
||||
def runTest(frame, nb, log):
|
||||
# This loads a whole bunch of new color names and values
|
||||
# into wxTheColourDatabase
|
||||
colourdb.updateColourDB()
|
||||
|
||||
win = TestPanel(nb)
|
||||
return win
|
||||
|
||||
|
@@ -81,8 +81,8 @@ def runTest(frame, nb, log):
|
||||
|
||||
|
||||
overview = """
|
||||
This demo shows how to encorporate Context Sensitive
|
||||
help into your applicaiton using the wxSimpleHelpProvider class.
|
||||
This demo shows how to incorporate Context Sensitive
|
||||
help into your application using the wxSimpleHelpProvider class.
|
||||
|
||||
"""
|
||||
|
||||
|
@@ -58,7 +58,7 @@ def makeRandomRectangles(num, W, H):
|
||||
|
||||
|
||||
def makeRandomText(num):
|
||||
Np = 8 # number of charcters in text
|
||||
Np = 8 # number of characters in text
|
||||
text = []
|
||||
for i in range(num):
|
||||
word = []
|
||||
@@ -386,7 +386,7 @@ drawing routines. Currently they are:
|
||||
DrawLineList(sequence, pens=None)
|
||||
</pre>
|
||||
Where sequence is a tuple, list, whatever of 4 element tuples
|
||||
(x1,y1, x2,y2) andd pens is either None, a single pen or a list
|
||||
(x1,y1, x2,y2) and pens is either None, a single pen or a list
|
||||
of pens.
|
||||
|
||||
<pre>
|
||||
|
@@ -188,7 +188,7 @@ class InnerTile(wxPanel):
|
||||
r = InnerTile.START_COLOR_TUPLE[0] + (InnerTile.DELTAS[0] * percent)
|
||||
g = InnerTile.START_COLOR_TUPLE[1] + (InnerTile.DELTAS[1] * percent)
|
||||
b = InnerTile.START_COLOR_TUPLE[2] + (InnerTile.DELTAS[2] * percent)
|
||||
self.setColor(wxColor(r,g,b))
|
||||
self.setColor(wxColor(int(r), int(g), int(b)))
|
||||
|
||||
|
||||
|
||||
|
443
wxPython/demo/FloatCanvas.py
Normal file
443
wxPython/demo/FloatCanvas.py
Normal file
@@ -0,0 +1,443 @@
|
||||
|
||||
from wxPython.wx import *
|
||||
|
||||
|
||||
## Stuff to integrate FloatCanvas into wxPython Demo
|
||||
try:
|
||||
import Numeric
|
||||
haveNumeric = True
|
||||
except ImportError:
|
||||
haveNumeric = False
|
||||
|
||||
|
||||
if not haveNumeric:
|
||||
errorText = """\
|
||||
The FloatCanvas requires the Numeric module:
|
||||
You can get it at:
|
||||
http://sourceforge.net/projects/numpy
|
||||
"""
|
||||
def runTest(frame, nb, log):
|
||||
dlg = wxMessageDialog(frame, errorText,
|
||||
'Sorry', wxOK | wxICON_INFORMATION)
|
||||
dlg.ShowModal()
|
||||
dlg.Destroy()
|
||||
|
||||
overview = ""
|
||||
|
||||
else:
|
||||
def runTest(frame, nb, log):
|
||||
"""
|
||||
This method is used by the wxPython Demo Framework for integrating
|
||||
this demo with the rest.
|
||||
"""
|
||||
win = DrawFrame(NULL, -1, "FloatCanvas Drawing Window",wxDefaultPosition,wxSize(500,500))
|
||||
frame.otherWin = win
|
||||
win.Show(True)
|
||||
|
||||
|
||||
|
||||
from wxPython.lib import floatcanvas
|
||||
import wxPython.lib.colourdb
|
||||
|
||||
ID_ABOUT_MENU = wxNewId()
|
||||
ID_EXIT_MENU = wxNewId()
|
||||
ID_ZOOM_TO_FIT_MENU = wxNewId()
|
||||
ID_DRAWTEST_MENU = wxNewId()
|
||||
ID_LINETEST_MENU = wxNewId()
|
||||
ID_DRAWMAP_MENU = wxNewId()
|
||||
ID_DRAWMAP2_MENU = wxNewId()
|
||||
ID_CLEAR_MENU = wxNewId()
|
||||
|
||||
wxPython.lib.colourdb.updateColourDB()
|
||||
colors = wxPython.lib.colourdb.getColourList()
|
||||
|
||||
LineStyles = floatcanvas.draw_object.LineStyleList.keys()
|
||||
|
||||
class DrawFrame(wxFrame):
|
||||
|
||||
"""
|
||||
|
||||
A frame used for the FloatCanvas Demo
|
||||
|
||||
"""
|
||||
|
||||
def __init__(self,parent, id,title,position,size):
|
||||
wxFrame.__init__(self,parent, id,title,position, size)
|
||||
|
||||
## Set up the MenuBar
|
||||
|
||||
MenuBar = wxMenuBar()
|
||||
|
||||
file_menu = wxMenu()
|
||||
file_menu.Append(ID_EXIT_MENU, "&Close","Close this frame")
|
||||
EVT_MENU(self, ID_EXIT_MENU, self.OnQuit)
|
||||
MenuBar.Append(file_menu, "&File")
|
||||
|
||||
draw_menu = wxMenu()
|
||||
draw_menu.Append(ID_DRAWTEST_MENU, "&Draw Test","Run a test of drawing random components")
|
||||
EVT_MENU(self, ID_DRAWTEST_MENU,self.DrawTest)
|
||||
draw_menu.Append(ID_LINETEST_MENU, "&Line Test","Run a test of drawing random lines")
|
||||
EVT_MENU(self, ID_LINETEST_MENU,self.LineTest)
|
||||
draw_menu.Append(ID_DRAWMAP_MENU, "Draw &Map","Run a test of drawing a map")
|
||||
EVT_MENU(self, ID_DRAWMAP_MENU,self.DrawMap)
|
||||
draw_menu.Append(ID_CLEAR_MENU, "&Clear","Clear the Canvas")
|
||||
EVT_MENU(self, ID_CLEAR_MENU,self.Clear)
|
||||
MenuBar.Append(draw_menu, "&Draw")
|
||||
|
||||
|
||||
view_menu = wxMenu()
|
||||
view_menu.Append(ID_ZOOM_TO_FIT_MENU, "Zoom to &Fit","Zoom to fit the window")
|
||||
EVT_MENU(self, ID_ZOOM_TO_FIT_MENU,self.ZoomToFit)
|
||||
MenuBar.Append(view_menu, "&View")
|
||||
|
||||
help_menu = wxMenu()
|
||||
help_menu.Append(ID_ABOUT_MENU, "&About",
|
||||
"More information About this program")
|
||||
EVT_MENU(self, ID_ABOUT_MENU, self.OnAbout)
|
||||
MenuBar.Append(help_menu, "&Help")
|
||||
|
||||
self.SetMenuBar(MenuBar)
|
||||
|
||||
self.CreateStatusBar()
|
||||
self.SetStatusText("")
|
||||
|
||||
EVT_CLOSE(self, self.OnCloseWindow)
|
||||
|
||||
# Other event handlers:
|
||||
EVT_RIGHT_DOWN(self, self.RightButtonEvent)
|
||||
|
||||
# Add the Canvas
|
||||
self.Canvas = floatcanvas.FloatCanvas(self,-1,(500,500),
|
||||
ProjectionFun = 'FlatEarth',
|
||||
Debug = 1,
|
||||
EnclosingFrame = self,
|
||||
BackgroundColor = "DARK SLATE BLUE",
|
||||
UseBackground = 0,
|
||||
UseToolbar = 1)
|
||||
self.Show(True)
|
||||
|
||||
self.object_list = []
|
||||
|
||||
return None
|
||||
|
||||
def RightButtonEvent(self,event):
|
||||
print "Right Button has been clicked in DrawFrame"
|
||||
print "coords are: %i, %i"%(event.GetX(),event.GetY())
|
||||
event.Skip()
|
||||
|
||||
def OnAbout(self, event):
|
||||
dlg = wxMessageDialog(self, "This is a small program to demonstrate\n"
|
||||
"the use of the FloatCanvas\n",
|
||||
"About Me", wxOK | wxICON_INFORMATION)
|
||||
dlg.ShowModal()
|
||||
dlg.Destroy()
|
||||
|
||||
def SetMode(self,event):
|
||||
for id in [ID_ZOOM_IN_BUTTON,ID_ZOOM_OUT_BUTTON,ID_MOVE_MODE_BUTTON]:
|
||||
self.ToolBar.ToggleTool(id,0)
|
||||
self.ToolBar.ToggleTool(event.GetId(),1)
|
||||
if event.GetId() == ID_ZOOM_IN_BUTTON:
|
||||
self.Canvas.SetGUIMode("ZoomIn")
|
||||
elif event.GetId() == ID_ZOOM_OUT_BUTTON:
|
||||
self.Canvas.SetGUIMode("ZoomOut")
|
||||
elif event.GetId() == ID_MOVE_MODE_BUTTON:
|
||||
self.Canvas.SetGUIMode("Move")
|
||||
|
||||
def ZoomToFit(self,event):
|
||||
self.Canvas.ZoomToBB()
|
||||
|
||||
def Clear(self,event = None):
|
||||
self.Canvas.RemoveObjects(self.object_list)
|
||||
self.object_list = []
|
||||
self.Canvas.Draw()
|
||||
|
||||
def OnQuit(self,event):
|
||||
self.Close(True)
|
||||
|
||||
def OnCloseWindow(self, event):
|
||||
self.Destroy()
|
||||
|
||||
def DrawTest(self,event):
|
||||
wxGetApp().Yield()
|
||||
import random
|
||||
import RandomArray
|
||||
Range = (-10,10)
|
||||
|
||||
Canvas = self.Canvas
|
||||
object_list = self.object_list
|
||||
|
||||
## Random tests of everything:
|
||||
|
||||
# Rectangles
|
||||
for i in range(5):
|
||||
x,y = (random.uniform(Range[0],Range[1]),random.uniform(Range[0],Range[1]))
|
||||
lw = random.randint(1,5)
|
||||
cf = random.randint(0,len(colors)-1)
|
||||
h = random.randint(1,5)
|
||||
w = random.randint(1,5)
|
||||
object_list.append(Canvas.AddRectangle(x,y,h,w,LineWidth = lw,FillColor = colors[cf]))
|
||||
|
||||
# Ellipses
|
||||
for i in range(5):
|
||||
x,y = (random.uniform(Range[0],Range[1]),random.uniform(Range[0],Range[1]))
|
||||
lw = random.randint(1,5)
|
||||
cf = random.randint(0,len(colors)-1)
|
||||
h = random.randint(1,5)
|
||||
w = random.randint(1,5)
|
||||
object_list.append(Canvas.AddEllipse(x,y,h,w,LineWidth = lw,FillColor = colors[cf]))
|
||||
|
||||
# Dots
|
||||
for i in range(5):
|
||||
x,y = (random.uniform(Range[0],Range[1]),random.uniform(Range[0],Range[1]))
|
||||
D = random.randint(1,50)
|
||||
lw = random.randint(1,5)
|
||||
cf = random.randint(0,len(colors)-1)
|
||||
cl = random.randint(0,len(colors)-1)
|
||||
object_list.append(Canvas.AddDot(x,y,D,LineWidth = lw,LineColor = colors[cl],FillColor = colors[cf]))
|
||||
|
||||
# Circles
|
||||
for i in range(5):
|
||||
x,y = (random.uniform(Range[0],Range[1]),random.uniform(Range[0],Range[1]))
|
||||
D = random.randint(1,5)
|
||||
lw = random.randint(1,5)
|
||||
cf = random.randint(0,len(colors)-1)
|
||||
cl = random.randint(0,len(colors)-1)
|
||||
object_list.append(Canvas.AddCircle(x,y,D,LineWidth = lw,LineColor = colors[cl],FillColor = colors[cf]))
|
||||
self.object_list.append(self.Canvas.AddText("Circle # %i"%(i),x,y,Size = 12,BackGround = None,Position = "cc"))
|
||||
|
||||
# Lines
|
||||
for i in range(5):
|
||||
points = []
|
||||
for j in range(random.randint(2,10)):
|
||||
point = (random.randint(Range[0],Range[1]),random.randint(Range[0],Range[1]))
|
||||
points.append(point)
|
||||
lw = random.randint(1,10)
|
||||
cf = random.randint(0,len(colors)-1)
|
||||
cl = random.randint(0,len(colors)-1)
|
||||
self.object_list.append(self.Canvas.AddLine(points, LineWidth = lw, LineColor = colors[cl]))
|
||||
|
||||
# Polygons
|
||||
for i in range(3):
|
||||
points = []
|
||||
for j in range(random.randint(2,6)):
|
||||
point = (random.uniform(Range[0],Range[1]),random.uniform(Range[0],Range[1]))
|
||||
points.append(point)
|
||||
lw = random.randint(1,6)
|
||||
cf = random.randint(0,len(colors)-1)
|
||||
cl = random.randint(0,len(colors)-1)
|
||||
self.object_list.append(self.Canvas.AddPolygon(points,
|
||||
LineWidth = lw,
|
||||
LineColor = colors[cl],
|
||||
FillColor = colors[cf],
|
||||
FillStyle = 'Solid'))
|
||||
|
||||
|
||||
## Pointset
|
||||
for i in range(4):
|
||||
points = []
|
||||
points = RandomArray.uniform(Range[0],Range[1],(100,2))
|
||||
cf = random.randint(0,len(colors)-1)
|
||||
D = random.randint(1,4)
|
||||
self.object_list.append(self.Canvas.AddPointSet(points, Color = colors[cf], Diameter = D))
|
||||
|
||||
# Text
|
||||
String = "Some text"
|
||||
for i in range(10):
|
||||
ts = random.randint(10,40)
|
||||
cf = random.randint(0,len(colors)-1)
|
||||
x,y = (random.uniform(Range[0],Range[1]),random.uniform(Range[0],Range[1]))
|
||||
self.object_list.append(self.Canvas.AddText(String,x,y,Size = ts,ForeGround = colors[cf],Position = "cc"))
|
||||
|
||||
self.Canvas.ZoomToBB()
|
||||
|
||||
def DrawMap(self,event = None):
|
||||
wxGetApp().Yield()
|
||||
import os, time
|
||||
## Test of Actual Map Data
|
||||
self.Clear()
|
||||
start = time.clock()
|
||||
Shorelines = Read_MapGen(os.path.join("data",'world.dat'),stats = 0)
|
||||
print "It took %f seconds to load %i shorelines"%(time.clock() - start,len(Shorelines) )
|
||||
start = time.clock()
|
||||
for segment in Shorelines:
|
||||
self.object_list.append(self.Canvas.AddLine(segment))
|
||||
print "It took %f seconds to add %i shorelines"%(time.clock() - start,len(Shorelines) )
|
||||
start = time.clock()
|
||||
self.Canvas.ZoomToBB()
|
||||
print "It took %f seconds to draw %i shorelines"%(time.clock() - start,len(Shorelines) )
|
||||
|
||||
## def LineTest(self,event = None):
|
||||
## wxGetApp().Yield()
|
||||
## import os, time
|
||||
## import random
|
||||
## Range = (-10,10)
|
||||
## ## Test of drawing lots of lines
|
||||
## self.Clear()
|
||||
## start = time.clock()
|
||||
## linepoints = []
|
||||
## linecolors = []
|
||||
## linewidths = []
|
||||
## linestyles = []
|
||||
## for i in range(500):
|
||||
## points = (random.randint(Range[0],Range[1]),
|
||||
## random.randint(Range[0],Range[1]))
|
||||
## linepoints.append(points)
|
||||
## points = (random.randint(Range[0],Range[1]),
|
||||
## random.randint(Range[0],Range[1]))
|
||||
## linepoints.append(points)
|
||||
## linewidths.append(random.randint(1,10) )
|
||||
## linecolors.append(colors[random.randint(0,len(colors)-1) ])
|
||||
## linestyles.append(LineStyles[random.randint(0, len(LineStyles)-1)])
|
||||
|
||||
## self.object_list.append(self.Canvas.AddLineSet(linepoints, LineWidths = linewidths, LineColors = linecolors, LineStyles = linestyles))
|
||||
## print "It took %f seconds to add %i lines"%(time.clock() - start,len(linepoints) )
|
||||
## start = time.clock()
|
||||
## self.Canvas.ZoomToBB()
|
||||
## print "It took %f seconds to draw %i lines"%(time.clock() - start,len(linepoints) )
|
||||
|
||||
def LineTest(self,event = None):
|
||||
wxGetApp().Yield()
|
||||
import os, time
|
||||
import random
|
||||
Range = (-10,10)
|
||||
## Test of drawing lots of lines
|
||||
self.Clear()
|
||||
start = time.clock()
|
||||
linepoints = []
|
||||
linecolors = []
|
||||
linewidths = []
|
||||
for i in range(2000):
|
||||
points = (random.randint(Range[0],Range[1]),
|
||||
random.randint(Range[0],Range[1]),
|
||||
random.randint(Range[0],Range[1]),
|
||||
random.randint(Range[0],Range[1]))
|
||||
linepoints.append(points)
|
||||
linewidths.append(random.randint(1,10) )
|
||||
linecolors.append(random.randint(0,len(colors)-1) )
|
||||
for (points,color,width) in zip(linepoints,linecolors,linewidths):
|
||||
self.object_list.append(self.Canvas.AddLine((points[0:2],points[2:4]), LineWidth = width, LineColor = colors[color]))
|
||||
print "It took %f seconds to add %i lines"%(time.clock() - start,len(linepoints) )
|
||||
start = time.clock()
|
||||
self.Canvas.ZoomToBB()
|
||||
print "It took %f seconds to draw %i lines"%(time.clock() - start,len(linepoints) )
|
||||
|
||||
class DemoApp(wxApp):
|
||||
"""
|
||||
How the demo works:
|
||||
|
||||
Under the Draw menu, there are three options:
|
||||
|
||||
*Draw Test: will put up a picture of a bunch of randomly generated
|
||||
objects, of each kind supported.
|
||||
|
||||
*Draw Map: will draw a map of the world. Be patient, it is a big map,
|
||||
with a lot of data, and will take a while to load and draw (about 10 sec
|
||||
on my 450Mhz PIII). Redraws take about 2 sec. This demonstrates how the
|
||||
performance is not very good for large drawings.
|
||||
|
||||
*Clear: Clears the Canvas.
|
||||
|
||||
Once you have a picture drawn, you can zoom in and out and move about
|
||||
the picture. There is a tool bar with three tools that can be
|
||||
selected.
|
||||
|
||||
The magnifying glass with the plus is the zoom in tool. Once selected,
|
||||
if you click the image, it will zoom in, centered on where you
|
||||
clicked. If you click and drag the mouse, you will get a rubber band
|
||||
box, and the image will zoom to fit that box when you release it.
|
||||
|
||||
The magnifying glass with the minus is the zoom out tool. Once selected,
|
||||
if you click the image, it will zoom out, centered on where you
|
||||
clicked. (note that this takes a while when you are looking at the map,
|
||||
as it has a LOT of lines to be drawn. The image is double buffered, so
|
||||
you don't see the drawing in progress)
|
||||
|
||||
The hand is the move tool. Once selected, if you click and drag on the
|
||||
image, it will move so that the part you clicked on ends up where you
|
||||
release the mouse. Nothing is changed while you are dragging. The
|
||||
drawing is too slow for that.
|
||||
|
||||
I'd like the cursor to change as you change tools, but the stock
|
||||
wxCursors didn't include anything I liked, so I stuck with the
|
||||
pointer. Please let me know if you have any nice cursor images for me to
|
||||
use.
|
||||
|
||||
|
||||
Any bugs, comments, feedback, questions, and especially code are welcome:
|
||||
|
||||
-Chris Barker
|
||||
|
||||
Chris.Barker@noaa.gov
|
||||
|
||||
"""
|
||||
|
||||
def OnInit(self):
|
||||
frame = DrawFrame(NULL, -1, "FloatCanvas Demo App",wxDefaultPosition,wxSize(700,700))
|
||||
|
||||
self.SetTopWindow(frame)
|
||||
|
||||
return True
|
||||
|
||||
def Read_MapGen(filename,stats = 0,AllLines=0):
|
||||
"""
|
||||
This function reads a MapGen Format file, and
|
||||
returns a list of NumPy arrays with the line segments in them.
|
||||
|
||||
Each NumPy array in the list is an NX2 array of Python Floats.
|
||||
|
||||
The demo should have come with a file, "world.dat" that is the
|
||||
shorelines of the whole world, in MapGen format.
|
||||
|
||||
"""
|
||||
import string
|
||||
from Numeric import array
|
||||
file = open(filename,'rt')
|
||||
data = file.readlines()
|
||||
data = map(string.strip,data)
|
||||
|
||||
Shorelines = []
|
||||
segment = []
|
||||
for line in data:
|
||||
if line:
|
||||
if line == "# -b": #New segment beginning
|
||||
if segment: Shorelines.append(array(segment))
|
||||
segment = []
|
||||
else:
|
||||
segment.append(map(float,string.split(line)))
|
||||
if segment: Shorelines.append(array(segment))
|
||||
|
||||
if stats:
|
||||
NumSegments = len(Shorelines)
|
||||
NumPoints = 0
|
||||
for segment in Shorelines:
|
||||
NumPoints = NumPoints + len(segment)
|
||||
AvgPoints = NumPoints / NumSegments
|
||||
print "Number of Segments: ", NumSegments
|
||||
print "Average Number of Points per segment: ",AvgPoints
|
||||
if AllLines:
|
||||
Lines = []
|
||||
for segment in Shorelines:
|
||||
Lines.append(segment[0])
|
||||
for point in segment[1:-1]:
|
||||
Lines.append(point)
|
||||
Lines.append(point)
|
||||
Lines.append(segment[-1])
|
||||
#print Shorelines
|
||||
#for point in Lines: print point
|
||||
return Lines
|
||||
else:
|
||||
return Shorelines
|
||||
|
||||
## for the wxPython demo:
|
||||
overview = floatcanvas.FloatCanvas.__doc__
|
||||
|
||||
if __name__ == "__main__":
|
||||
if not haveNumeric:
|
||||
print errorText
|
||||
else:
|
||||
app = DemoApp(0)
|
||||
app.MainLoop()
|
||||
|
||||
|
||||
|
||||
|
@@ -83,7 +83,7 @@ class CustomDataTable(wxPyGridTableBase):
|
||||
|
||||
# Called to determine the kind of editor/renderer to use by
|
||||
# default, doesn't necessarily have to be the same type used
|
||||
# nativly by the editor/renderer if they know how to convert.
|
||||
# natively by the editor/renderer if they know how to convert.
|
||||
def GetTypeName(self, row, col):
|
||||
return self.dataTypes[col]
|
||||
|
||||
|
@@ -160,7 +160,7 @@ class SimpleGrid(wxGrid): ##, wxGridAutoEditMixin):
|
||||
|
||||
# Show how to stay in a cell that has bad data. We can't just
|
||||
# call SetGridCursor here since we are nested inside one so it
|
||||
# won't have any effect. Instead, set coordinants to move to in
|
||||
# won't have any effect. Instead, set coordinates to move to in
|
||||
# idle time.
|
||||
value = self.GetCellValue(evt.GetRow(), evt.GetCol())
|
||||
if value == 'no good':
|
||||
|
@@ -28,6 +28,8 @@ _treeList = [
|
||||
('Recent Additions', [
|
||||
'wxVListBox',
|
||||
'wxListbook',
|
||||
'wxMaskedNumCtrl',
|
||||
'FloatCanvas',
|
||||
]),
|
||||
|
||||
# managed windows == things with a (optional) caption you can close
|
||||
@@ -100,7 +102,7 @@ _treeList = [
|
||||
'wxValidator',
|
||||
]),
|
||||
|
||||
# controls coming from other librairies
|
||||
# controls coming from other libraries
|
||||
('More Windows/Controls', [
|
||||
#'wxFloatBar', deprecated
|
||||
#'wxMVCTree', deprecated
|
||||
@@ -109,6 +111,7 @@ _treeList = [
|
||||
'ColourSelect',
|
||||
'ContextHelp',
|
||||
'FancyText',
|
||||
'FloatCanvas',
|
||||
'FileBrowseButton',
|
||||
'GenericButtons',
|
||||
'MaskedEditControls',
|
||||
@@ -128,6 +131,7 @@ _treeList = [
|
||||
'wxIntCtrl',
|
||||
'wxLEDNumberCtrl',
|
||||
'wxMimeTypesManager',
|
||||
'wxMaskedNumCtrl',
|
||||
'wxMultiSash',
|
||||
'wxPopupControl',
|
||||
'wxStyledTextCtrl_1',
|
||||
@@ -212,6 +216,7 @@ _treeList = [
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Show how to derive a custom wxLog class
|
||||
|
||||
class MyLog(wx.PyLog):
|
||||
def __init__(self, textCtrl, logTime=0):
|
||||
@@ -235,6 +240,7 @@ class MyTP(wx.PyTipProvider):
|
||||
# A class to be used to display source code in the demo. Try using the
|
||||
# wxSTC in the wxStyledTextCtrl_2 sample first, fall back to wxTextCtrl
|
||||
# if there is an error, such as the stc module not being present.
|
||||
#
|
||||
|
||||
try:
|
||||
##raise ImportError
|
||||
@@ -814,7 +820,7 @@ platform GUI library, which is written in C++.
|
||||
<p> Like Python and wxWindows, wxPython is <b>Open Source</b> which
|
||||
means that it is free for anyone to use and the source code is
|
||||
available for anyone to look at and modify. Or anyone can contribute
|
||||
fixes or enhnacments to the project.
|
||||
fixes or enhancements to the project.
|
||||
|
||||
<p> wxPython is a <b>cross-platform</b> toolkit. This means that the
|
||||
same program will run on multiple platforms without modification.
|
||||
|
@@ -1,10 +1,12 @@
|
||||
from wxPython.wx import *
|
||||
from wxPython.lib.maskededit import Field, wxMaskedTextCtrl, wxMaskedComboBox, wxIpAddrCtrl, states, months
|
||||
from wxPython.lib.maskededit import __doc__ as overviewdoc
|
||||
from wxPython.lib.maskededit import Field, wxMaskedTextCtrl, wxMaskedComboBox, wxIpAddrCtrl, states, state_names, months
|
||||
from wxPython.lib.maskededit import __doc__ as maskededit_doc
|
||||
from wxPython.lib.maskededit import autoformats
|
||||
from wxPython.lib.maskedctrl import wxMaskedCtrl, controlTypes, MASKEDCOMBO
|
||||
from wxPython.lib.scrolledpanel import wxScrolledPanel
|
||||
import string, sys, traceback
|
||||
|
||||
|
||||
class demoMixin:
|
||||
"""
|
||||
Centralized routines common to demo pages, to remove repetition.
|
||||
@@ -14,7 +16,7 @@ class demoMixin:
|
||||
mask = wxStaticText( self, -1, "Mask Value" )
|
||||
formatcode = wxStaticText( self, -1, "Format" )
|
||||
regex = wxStaticText( self, -1, "Regexp Validator(opt.)" )
|
||||
ctrl = wxStaticText( self, -1, "wxMaskedEdit Ctrl" )
|
||||
ctrl = wxStaticText( self, -1, "wxMaskedTextCtrl" )
|
||||
|
||||
description.SetFont( wxFont(9, wxSWISS, wxNORMAL, wxBOLD))
|
||||
mask.SetFont( wxFont(9, wxSWISS, wxNORMAL, wxBOLD))
|
||||
@@ -130,7 +132,7 @@ Smith, Jones, Williams). Signs on numbers can be toggled with the minus key.
|
||||
|
||||
def onHighlightEmpty( self, event ):
|
||||
""" Highlight empty values"""
|
||||
self.changeControlParams( event, "emptyBackgroundColor", "Blue", "White" )
|
||||
self.changeControlParams( event, "emptyBackgroundColour", "Blue", "White" )
|
||||
|
||||
def onShowFill( self, event ):
|
||||
""" Set fillChar parameter to '?' or ' ' """
|
||||
@@ -144,8 +146,9 @@ class demoPage2(wxScrolledPanel, demoMixin):
|
||||
self.sizer = wxBoxSizer( wxVERTICAL )
|
||||
|
||||
label = wxStaticText( self, -1, """\
|
||||
All these controls have been created by passing a single parameter, the autoformat code.
|
||||
The class contains an internal dictionary of types and formats (autoformats).
|
||||
All these controls have been created by passing a single parameter, the autoformat code,
|
||||
and use the factory class wxMaskedCtrl with its default controlType.
|
||||
The maskededit module contains an internal dictionary of types and formats (autoformats).
|
||||
Many of these already do complicated validation; To see some examples, try
|
||||
29 Feb 2002 vs. 2004 for the date formats, or email address validation.
|
||||
""")
|
||||
@@ -155,7 +158,7 @@ Many of these already do complicated validation; To see some examples, try
|
||||
|
||||
description = wxStaticText( self, -1, "Description")
|
||||
autofmt = wxStaticText( self, -1, "AutoFormat Code")
|
||||
ctrl = wxStaticText( self, -1, "wxMaskedEdit Control")
|
||||
ctrl = wxStaticText( self, -1, "wxMaskedCtrl")
|
||||
|
||||
description.SetFont( wxFont( 9, wxSWISS, wxNORMAL, wxBOLD ) )
|
||||
autofmt.SetFont( wxFont( 9, wxSWISS, wxNORMAL, wxBOLD ) )
|
||||
@@ -169,7 +172,7 @@ Many of these already do complicated validation; To see some examples, try
|
||||
for autoformat, desc in autoformats:
|
||||
grid.Add( wxStaticText( self, -1, desc), 0, wxALIGN_LEFT )
|
||||
grid.Add( wxStaticText( self, -1, autoformat), 0, wxALIGN_LEFT )
|
||||
grid.Add( wxMaskedTextCtrl( self, -1, "",
|
||||
grid.Add( wxMaskedCtrl( self, -1, "",
|
||||
autoformat = autoformat,
|
||||
demo = True,
|
||||
name = autoformat),
|
||||
@@ -208,7 +211,7 @@ has a legal range specified.
|
||||
controls = [
|
||||
#description mask excl format regexp range,list,initial
|
||||
("U.S. State (2 char)", "AA", "", 'F!_', "[A-Z]{2}", '',states, states[0]),
|
||||
("Integer (signed)", "#{6}", "", 'F-_R', "", '','', '0 '),
|
||||
("Integer (signed)", "#{6}", "", 'F-_', "", '','', ' 0 '),
|
||||
("Integer (unsigned)\n(1-399)","######", "", 'F_', "", (1,399),'', '1 '),
|
||||
("Float (signed)", "#{6}.#{9}", "", 'F-_R', "", '','', '000000.000000000'),
|
||||
("Date (MDY) + Time", "##/##/#### ##:##:## AM", 'BCDEFGHIJKLMNOQRSTUVWXYZ','DF!',"", '','', wxDateTime_Now().Format("%m/%d/%Y %I:%M:%S %p")),
|
||||
@@ -248,7 +251,7 @@ Page Up and Shift-Up arrow will similarly cycle backwards through the list.
|
||||
description = wxStaticText( self, -1, "Description" )
|
||||
autofmt = wxStaticText( self, -1, "AutoFormat Code" )
|
||||
fields = wxStaticText( self, -1, "Field Objects" )
|
||||
ctrl = wxStaticText( self, -1, "wxMaskedEdit Control" )
|
||||
ctrl = wxStaticText( self, -1, "wxMaskedTextCtrl" )
|
||||
|
||||
description.SetFont( wxFont( 9, wxSWISS, wxNORMAL, wxBOLD ) )
|
||||
autofmt.SetFont( wxFont( 9, wxSWISS, wxNORMAL, wxBOLD ) )
|
||||
@@ -325,12 +328,33 @@ class demoPage5(wxScrolledPanel, demoMixin):
|
||||
self.log = log
|
||||
wxScrolledPanel.__init__( self, parent, -1 )
|
||||
self.sizer = wxBoxSizer( wxVERTICAL )
|
||||
label = wxStaticText( self, -1, """\
|
||||
These are examples of wxMaskedComboBox and wxIpAddrCtrl, and more useful
|
||||
configurations of a wxMaskedTextCtrl for integer and floating point input.
|
||||
""")
|
||||
label.SetForegroundColour( "Blue" )
|
||||
self.sizer.Add( label, 0, wxALIGN_LEFT|wxALL, 5 )
|
||||
|
||||
|
||||
labelMaskedCombos = wxStaticText( self, -1, """\
|
||||
These are some examples of wxMaskedComboBox:""")
|
||||
labelMaskedCombos.SetForegroundColour( "Blue" )
|
||||
|
||||
|
||||
label_statecode = wxStaticText( self, -1, """\
|
||||
A state selector; only
|
||||
"legal" values can be
|
||||
entered:""")
|
||||
statecode = wxMaskedComboBox( self, -1, states[0],
|
||||
choices = states,
|
||||
autoformat="USSTATE")
|
||||
|
||||
label_statename = wxStaticText( self, -1, """\
|
||||
A state name selector,
|
||||
with auto-select:""")
|
||||
|
||||
# Create this one using factory function:
|
||||
statename = wxMaskedCtrl( self, -1, state_names[0],
|
||||
controlType = controlTypes.MASKEDCOMBO,
|
||||
choices = state_names,
|
||||
autoformat="USSTATENAME",
|
||||
autoSelect=True)
|
||||
statename.SetCtrlParameters(formatcodes = 'F!V_')
|
||||
|
||||
|
||||
numerators = [ str(i) for i in range(1, 4) ]
|
||||
denominators = [ string.ljust(str(i), 2) for i in [2,3,4,5,8,16,32,64] ]
|
||||
@@ -343,12 +367,13 @@ configurations of a wxMaskedTextCtrl for integer and floating point input.
|
||||
choices.append( '%s/%s' % (n,d) )
|
||||
|
||||
|
||||
text1 = wxStaticText( self, -1, """\
|
||||
label_fraction = wxStaticText( self, -1, """\
|
||||
A masked ComboBox for fraction selection.
|
||||
Choices for each side of the fraction can be
|
||||
selected with PageUp/Down:""")
|
||||
Choices for each side of the fraction can
|
||||
be selected with PageUp/Down:""")
|
||||
|
||||
fraction = wxMaskedComboBox( self, -1, "",
|
||||
fraction = wxMaskedCtrl( self, -1, "",
|
||||
controlType = MASKEDCOMBO,
|
||||
choices = choices,
|
||||
choiceRequired = True,
|
||||
mask = "#/##",
|
||||
@@ -357,7 +382,7 @@ selected with PageUp/Down:""")
|
||||
fields = fieldsDict )
|
||||
|
||||
|
||||
text2 = wxStaticText( self, -1, """
|
||||
label_code = wxStaticText( self, -1, """\
|
||||
A masked ComboBox to validate
|
||||
text from a list of numeric codes:""")
|
||||
|
||||
@@ -368,100 +393,155 @@ text from a list of numeric codes:""")
|
||||
formatcodes = "F_r",
|
||||
mask = "####")
|
||||
|
||||
label_selector = wxStaticText( self, -1, """\
|
||||
Programmatically set
|
||||
choice sets:""")
|
||||
self.list_selector = wxComboBox(self, -1, '', choices = ['list1', 'list2', 'list3'])
|
||||
self.dynamicbox = wxMaskedCtrl( self, -1, ' ',
|
||||
controlType = controlTypes.MASKEDCOMBO,
|
||||
mask = 'XXXX',
|
||||
formatcodes = 'F_',
|
||||
# these are to give dropdown some initial height,
|
||||
# as base control apparently only sets that size
|
||||
# during initial construction <sigh>:
|
||||
choices = ['', '1', '2', '3', '4', '5'] )
|
||||
|
||||
text3 = wxStaticText( self, -1, """\
|
||||
A masked state selector; only "legal" values
|
||||
can be entered:""")
|
||||
|
||||
state = wxMaskedComboBox( self, -1, states[0],
|
||||
choices = states,
|
||||
autoformat="USSTATE")
|
||||
|
||||
text4 = wxStaticText( self, -1, "An empty IP Address entry control:")
|
||||
ip_addr1 = wxIpAddrCtrl( self, -1, style = wxTE_PROCESS_TAB )
|
||||
self.dynamicbox.Clear() # get rid of initial choices used to size the dropdown
|
||||
|
||||
|
||||
text5 = wxStaticText( self, -1, "An IP Address control with a restricted mask:")
|
||||
ip_addr2 = wxIpAddrCtrl( self, -1, mask=" 10. 1.109.###" )
|
||||
labelIpAddrs = wxStaticText( self, -1, """\
|
||||
Here are some examples of wxIpAddrCtrl, a control derived from wxMaskedTextCtrl:""")
|
||||
labelIpAddrs.SetForegroundColour( "Blue" )
|
||||
|
||||
|
||||
text6 = wxStaticText( self, -1, """\
|
||||
An IP Address control with restricted choices
|
||||
of form: 10. (1|2) . (129..255) . (0..255)""")
|
||||
ip_addr3 = wxIpAddrCtrl( self, -1, mask=" 10. #.###.###")
|
||||
ip_addr3.SetFieldParameters(0, validRegex="1|2" ) # requires entry to match or not allowed
|
||||
label_ipaddr1 = wxStaticText( self, -1, "An empty control:")
|
||||
ipaddr1 = wxIpAddrCtrl( self, -1, style = wxTE_PROCESS_TAB )
|
||||
|
||||
|
||||
label_ipaddr2 = wxStaticText( self, -1, "A restricted mask:")
|
||||
ipaddr2 = wxIpAddrCtrl( self, -1, mask=" 10. 1.109.###" )
|
||||
|
||||
|
||||
label_ipaddr3 = wxStaticText( self, -1, """\
|
||||
A control with restricted legal values:
|
||||
10. (1|2) . (129..255) . (0..255)""")
|
||||
ipaddr3 = wxMaskedCtrl( self, -1,
|
||||
controlType = controlTypes.IPADDR,
|
||||
mask=" 10. #.###.###")
|
||||
ipaddr3.SetFieldParameters(0, validRegex="1|2",validRequired=False ) # requires entry to match or not allowed
|
||||
|
||||
# This allows any value in penultimate field, but colors anything outside of the range invalid:
|
||||
ip_addr3.SetFieldParameters(1, validRange=(129,255), validRequired=False )
|
||||
ipaddr3.SetFieldParameters(1, validRange=(129,255), validRequired=False )
|
||||
|
||||
text7 = wxStaticText( self, -1, """\
|
||||
A right-insert integer entry control:""")
|
||||
intctrl = wxMaskedTextCtrl(self, -1, name='intctrl', mask="#{9}", formatcodes = '_-r,F')
|
||||
|
||||
text8 = wxStaticText( self, -1, """\
|
||||
|
||||
labelNumerics = wxStaticText( self, -1, """\
|
||||
Here are some useful configurations of a wxMaskedTextCtrl for integer and floating point input that still treat
|
||||
the control as a text control. (For a true numeric control, check out the wxMaskedNumCtrl class!)""")
|
||||
labelNumerics.SetForegroundColour( "Blue" )
|
||||
|
||||
label_intctrl1 = wxStaticText( self, -1, """\
|
||||
An integer entry control with
|
||||
shifting insert enabled:""")
|
||||
self.intctrl1 = wxMaskedTextCtrl(self, -1, name='intctrl', mask="#{9}", formatcodes = '_-,F>')
|
||||
label_intctrl2 = wxStaticText( self, -1, """\
|
||||
Right-insert integer entry:""")
|
||||
self.intctrl2 = wxMaskedTextCtrl(self, -1, name='intctrl', mask="#{9}", formatcodes = '_-,Fr')
|
||||
|
||||
label_floatctrl = wxStaticText( self, -1, """\
|
||||
A floating point entry control
|
||||
with right-insert for ordinal:""")
|
||||
self.floatctrl = wxMaskedTextCtrl(self, -1, name='floatctrl', mask="#{9}.#{2}", formatcodes="F,_-R")
|
||||
self.floatctrl = wxMaskedTextCtrl(self, -1, name='floatctrl', mask="#{9}.#{2}", formatcodes="F,_-R", useParensForNegatives=False)
|
||||
self.floatctrl.SetFieldParameters(0, formatcodes='r<', validRequired=True) # right-insert, require explicit cursor movement to change fields
|
||||
self.floatctrl.SetFieldParameters(1, defaultValue='00') # don't allow blank fraction
|
||||
|
||||
text9 = wxStaticText( self, -1, """\
|
||||
Use this control to programmatically set
|
||||
the value of the above float control:""")
|
||||
number_combo = wxComboBox(self, -1, choices = [ '', '111', '222.22', '-3', '54321.666666666', '-1353.978',
|
||||
label_numselect = wxStaticText( self, -1, """\
|
||||
<= Programmatically set the value
|
||||
of the float entry ctrl:""")
|
||||
numselect = wxComboBox(self, -1, choices = [ '', '111', '222.22', '-3', '54321.666666666', '-1353.978',
|
||||
'1234567', '-1234567', '123456789', '-123456789.1',
|
||||
'1234567890.', '-1234567890.1' ])
|
||||
|
||||
grid = wxFlexGridSizer( 0, 2, vgap=10, hgap = 5 )
|
||||
grid.Add( text1, 0, wxALIGN_LEFT )
|
||||
grid.Add( fraction, 0, wxALIGN_LEFT )
|
||||
grid.Add( text2, 0, wxALIGN_LEFT )
|
||||
grid.Add( code, 0, wxALIGN_LEFT )
|
||||
grid.Add( text3, 0, wxALIGN_LEFT )
|
||||
grid.Add( state, 0, wxALIGN_LEFT )
|
||||
grid.Add( text4, 0, wxALIGN_LEFT )
|
||||
grid.Add( ip_addr1, 0, wxALIGN_LEFT )
|
||||
grid.Add( text5, 0, wxALIGN_LEFT )
|
||||
grid.Add( ip_addr2, 0, wxALIGN_LEFT )
|
||||
grid.Add( text6, 0, wxALIGN_LEFT )
|
||||
grid.Add( ip_addr3, 0, wxALIGN_LEFT )
|
||||
grid.Add( text7, 0, wxALIGN_LEFT )
|
||||
grid.Add( intctrl, 0, wxALIGN_LEFT )
|
||||
grid.Add( text8, 0, wxALIGN_LEFT )
|
||||
grid.Add( self.floatctrl, 0, wxALIGN_LEFT )
|
||||
grid.Add( text9, 0, wxALIGN_LEFT )
|
||||
grid.Add( number_combo, 0, wxALIGN_LEFT )
|
||||
parens_check = wxCheckBox(self, -1, "Use () to indicate negatives in above controls")
|
||||
|
||||
|
||||
|
||||
gridCombos = wxFlexGridSizer( 0, 4, vgap=10, hgap = 10 )
|
||||
gridCombos.Add( label_statecode, 0, wxALIGN_LEFT )
|
||||
gridCombos.Add( statecode, 0, wxALIGN_LEFT )
|
||||
gridCombos.Add( label_fraction, 0, wxALIGN_LEFT )
|
||||
gridCombos.Add( fraction, 0, wxALIGN_LEFT )
|
||||
gridCombos.Add( label_statename, 0, wxALIGN_LEFT )
|
||||
gridCombos.Add( statename, 0, wxALIGN_LEFT )
|
||||
gridCombos.Add( label_code, 0, wxALIGN_LEFT )
|
||||
gridCombos.Add( code, 0, wxALIGN_LEFT )
|
||||
gridCombos.Add( label_selector, 0, wxALIGN_LEFT)
|
||||
hbox = wxBoxSizer( wxHORIZONTAL )
|
||||
hbox.Add( self.list_selector, 0, wxALIGN_LEFT )
|
||||
hbox.Add(wxStaticText(self, -1, ' => '), 0, wxALIGN_LEFT)
|
||||
hbox.Add( self.dynamicbox, 0, wxALIGN_LEFT )
|
||||
gridCombos.Add( hbox, 0, wxALIGN_LEFT )
|
||||
|
||||
gridIpAddrs = wxFlexGridSizer( 0, 4, vgap=10, hgap = 15 )
|
||||
gridIpAddrs.Add( label_ipaddr1, 0, wxALIGN_LEFT )
|
||||
gridIpAddrs.Add( ipaddr1, 0, wxALIGN_LEFT )
|
||||
gridIpAddrs.Add( label_ipaddr2, 0, wxALIGN_LEFT )
|
||||
gridIpAddrs.Add( ipaddr2, 0, wxALIGN_LEFT )
|
||||
gridIpAddrs.Add( label_ipaddr3, 0, wxALIGN_LEFT )
|
||||
gridIpAddrs.Add( ipaddr3, 0, wxALIGN_LEFT )
|
||||
|
||||
gridNumerics = wxFlexGridSizer( 0, 4, vgap=10, hgap = 10 )
|
||||
gridNumerics.Add( label_intctrl1, 0, wxALIGN_LEFT )
|
||||
gridNumerics.Add( self.intctrl1, 0, wxALIGN_LEFT )
|
||||
gridNumerics.Add( label_intctrl2, 0, wxALIGN_RIGHT )
|
||||
gridNumerics.Add( self.intctrl2, 0, wxALIGN_LEFT )
|
||||
gridNumerics.Add( label_floatctrl, 0, wxALIGN_LEFT )
|
||||
gridNumerics.Add( self.floatctrl, 0, wxALIGN_LEFT )
|
||||
gridNumerics.Add( label_numselect, 0, wxALIGN_RIGHT )
|
||||
gridNumerics.Add( numselect, 0, wxALIGN_LEFT )
|
||||
|
||||
self.sizer.Add( labelMaskedCombos, 0, wxALIGN_LEFT|wxALL, 5 )
|
||||
self.sizer.Add( gridCombos, 0, wxALIGN_LEFT|wxALL, border=5 )
|
||||
self.sizer.Add( wxStaticLine(self, -1), 0, wxEXPAND|wxTOP|wxBOTTOM, border=8 )
|
||||
self.sizer.Add( labelIpAddrs, 0, wxALIGN_LEFT|wxALL, 5 )
|
||||
self.sizer.Add( gridIpAddrs, 0, wxALIGN_LEFT|wxALL, border=5 )
|
||||
self.sizer.Add( wxStaticLine(self, -1), 0, wxEXPAND|wxTOP|wxBOTTOM, border=8 )
|
||||
self.sizer.Add( labelNumerics, 0, wxALIGN_LEFT|wxALL, 5 )
|
||||
self.sizer.Add( gridNumerics, 0, wxALIGN_LEFT|wxALL, border=5 )
|
||||
self.sizer.Add( parens_check, 0, wxALIGN_LEFT|wxALL, 5 )
|
||||
|
||||
self.sizer.Add( grid, 0, wxALIGN_LEFT|wxALL, border=5 )
|
||||
self.SetSizer( self.sizer )
|
||||
self.SetAutoLayout(1)
|
||||
self.SetupScrolling()
|
||||
|
||||
EVT_COMBOBOX( self, fraction.GetId(), self.OnComboChange )
|
||||
EVT_COMBOBOX( self, code.GetId(), self.OnComboChange )
|
||||
EVT_COMBOBOX( self, state.GetId(), self.OnComboChange )
|
||||
EVT_TEXT( self, fraction.GetId(), self.OnComboChange )
|
||||
EVT_TEXT( self, code.GetId(), self.OnComboChange )
|
||||
EVT_TEXT( self, state.GetId(), self.OnComboChange )
|
||||
EVT_COMBOBOX( self, fraction.GetId(), self.OnComboSelection )
|
||||
EVT_COMBOBOX( self, code.GetId(), self.OnComboSelection )
|
||||
EVT_COMBOBOX( self, statecode.GetId(), self.OnComboSelection )
|
||||
EVT_COMBOBOX( self, statename.GetId(), self.OnComboSelection )
|
||||
EVT_TEXT( self, fraction.GetId(), self.OnTextChange )
|
||||
EVT_TEXT( self, code.GetId(), self.OnTextChange )
|
||||
EVT_TEXT( self, statecode.GetId(), self.OnTextChange )
|
||||
EVT_TEXT( self, statename.GetId(), self.OnTextChange )
|
||||
EVT_COMBOBOX( self, self.list_selector.GetId(), self.OnListSelection )
|
||||
|
||||
EVT_TEXT( self, ip_addr1.GetId(), self.OnIpAddrChange )
|
||||
EVT_TEXT( self, ip_addr2.GetId(), self.OnIpAddrChange )
|
||||
EVT_TEXT( self, ip_addr3.GetId(), self.OnIpAddrChange )
|
||||
EVT_TEXT( self, intctrl.GetId(), self.OnTextChange )
|
||||
EVT_TEXT( self, self.intctrl1.GetId(), self.OnTextChange )
|
||||
EVT_TEXT( self, self.intctrl2.GetId(), self.OnTextChange )
|
||||
EVT_TEXT( self, self.floatctrl.GetId(), self.OnTextChange )
|
||||
EVT_COMBOBOX( self, number_combo.GetId(), self.OnNumberSelect )
|
||||
EVT_COMBOBOX( self, numselect.GetId(), self.OnNumberSelect )
|
||||
EVT_CHECKBOX( self, parens_check.GetId(), self.OnParensCheck )
|
||||
|
||||
EVT_TEXT( self, ipaddr1.GetId(), self.OnIpAddrChange )
|
||||
EVT_TEXT( self, ipaddr2.GetId(), self.OnIpAddrChange )
|
||||
EVT_TEXT( self, ipaddr3.GetId(), self.OnIpAddrChange )
|
||||
|
||||
|
||||
def OnComboChange( self, event ):
|
||||
|
||||
|
||||
def OnComboSelection( self, event ):
|
||||
ctl = self.FindWindowById( event.GetId() )
|
||||
if not ctl.IsValid():
|
||||
self.log.write('current value not a valid choice')
|
||||
|
||||
def OnIpAddrChange( self, event ):
|
||||
ip_addr = self.FindWindowById( event.GetId() )
|
||||
if ip_addr.IsValid():
|
||||
self.log.write('new addr = %s\n' % ip_addr.GetAddress() )
|
||||
self.log.write('new value = %s' % ctl.GetValue())
|
||||
|
||||
def OnTextChange( self, event ):
|
||||
ctl = self.FindWindowById( event.GetId() )
|
||||
@@ -470,14 +550,8 @@ the value of the above float control:""")
|
||||
|
||||
def OnNumberSelect( self, event ):
|
||||
value = event.GetString()
|
||||
|
||||
# Format choice to fit into format for #{9}.#{2}, with sign position reserved:
|
||||
# (ordinal + fraction == 11 + decimal point + sign == 13)
|
||||
#
|
||||
# Note: since self.floatctrl a right-aligned control, you could also just use
|
||||
# "%.2f", but this wouldn't work properly for a left-aligned control.
|
||||
# (See .SetValue() documentation in Overview.)
|
||||
#
|
||||
if value:
|
||||
floattext = "%13.2f" % float(value)
|
||||
else:
|
||||
@@ -489,6 +563,37 @@ the value of the above float control:""")
|
||||
for line in traceback.format_exception_only(type, value):
|
||||
self.log.write(line)
|
||||
|
||||
def OnParensCheck( self, event ):
|
||||
self.intctrl1.SetCtrlParameters(useParensForNegatives=event.Checked())
|
||||
self.intctrl2.SetCtrlParameters(useParensForNegatives=event.Checked())
|
||||
self.floatctrl.SetCtrlParameters(useParensForNegatives=event.Checked())
|
||||
|
||||
def OnIpAddrChange( self, event ):
|
||||
ipaddr = self.FindWindowById( event.GetId() )
|
||||
if ipaddr.IsValid():
|
||||
self.log.write('new addr = %s\n' % ipaddr.GetAddress() )
|
||||
|
||||
def OnListSelection( self, event ):
|
||||
list = self.list_selector.GetStringSelection()
|
||||
formatcodes = 'F_'
|
||||
if list == 'list1':
|
||||
choices = ['abc', 'defg', 'hi']
|
||||
mask = 'aaaa'
|
||||
elif list == 'list2':
|
||||
choices = ['1', '2', '34', '567']
|
||||
formatcodes += 'r'
|
||||
mask = '###'
|
||||
else:
|
||||
choices = states
|
||||
mask = 'AA'
|
||||
formatcodes += '!'
|
||||
self.dynamicbox.SetCtrlParameters( mask = mask,
|
||||
choices = choices,
|
||||
choiceRequired=True,
|
||||
autoSelect=True,
|
||||
formatcodes=formatcodes)
|
||||
self.dynamicbox.SetValue(choices[0])
|
||||
|
||||
# ---------------------------------------------------------------------
|
||||
class TestMaskedTextCtrls(wxNotebook):
|
||||
def __init__(self, parent, id, log):
|
||||
@@ -530,7 +635,7 @@ if __name__ == "__main__":
|
||||
|
||||
overview = """<html>
|
||||
<PRE><FONT SIZE=-1>
|
||||
""" + overviewdoc + """
|
||||
""" + maskededit_doc + """
|
||||
</FONT></PRE>
|
||||
"""
|
||||
|
||||
|
@@ -69,7 +69,7 @@ class MyPrintout(wxPrintout):
|
||||
# Use x or y scaling factor, whichever fits on the DC
|
||||
actualScale = min(scaleX, scaleY)
|
||||
|
||||
# Calculate the position on the DC for centring the graphic
|
||||
# Calculate the position on the DC for centering the graphic
|
||||
posX = (w - (self.canvas.getWidth() * actualScale)) / 2.0
|
||||
posY = (h - (self.canvas.getHeight() * actualScale)) / 2.0
|
||||
|
||||
|
@@ -77,7 +77,7 @@ def runTest(frame, nb, log):
|
||||
|
||||
|
||||
overview = """\
|
||||
This demo is a contrived example of defining an event class in wxPython and sending it up the containment heirachy for processing.
|
||||
This demo is a contrived example of defining an event class in wxPython and sending it up the containment hierarchy for processing.
|
||||
"""
|
||||
|
||||
|
||||
|
@@ -362,7 +362,7 @@ theTests = [
|
||||
),
|
||||
|
||||
("Add a stretchable", makeSimpleBox3,
|
||||
"We've added one more button with the strechable flag turned on. Notice "
|
||||
"We've added one more button with the stretchable flag turned on. Notice "
|
||||
"how it grows to fill the extra space in the otherwise fixed dimension."
|
||||
),
|
||||
|
||||
@@ -372,7 +372,7 @@ theTests = [
|
||||
),
|
||||
|
||||
("Weighting factor", makeSimpleBox5,
|
||||
"This one shows more than one strechable, but one of them has a weighting "
|
||||
"This one shows more than one stretchable, but one of them has a weighting "
|
||||
"factor so it gets more of the free space."
|
||||
),
|
||||
|
||||
@@ -421,7 +421,7 @@ theTests = [
|
||||
),
|
||||
|
||||
("Boxes inside a Border", makeBoxInBorder,
|
||||
"Sizers of different types can be nested withing each other as well. "
|
||||
"Sizers of different types can be nested within each other as well. "
|
||||
"Here is a box sizer with several buttons embedded within a border sizer."
|
||||
),
|
||||
|
||||
@@ -434,7 +434,7 @@ theTests = [
|
||||
("Simple Grid", makeGrid1,
|
||||
"This is an example of the wxGridSizer. In this case all row heights "
|
||||
"and column widths are kept the same as all the others and all items "
|
||||
"fill their available space. The horzontal and vertical gaps are set to "
|
||||
"fill their available space. The horizontal and vertical gaps are set to "
|
||||
"2 pixels each."
|
||||
),
|
||||
|
||||
@@ -461,7 +461,7 @@ theTests = [
|
||||
|
||||
("Proportional resize", makeSimpleBoxShaped,
|
||||
"Managed items can preserve their original aspect ratio. The last item has the "
|
||||
"wxSHAPED flag set and will resize proportional to its origingal size."
|
||||
"wxSHAPED flag set and will resize proportional to its original size."
|
||||
),
|
||||
|
||||
("Proportional resize with Alignments", makeShapes,
|
||||
|
@@ -187,7 +187,7 @@ This demo shows various ways of using the <b><i>new
|
||||
</i></b> PrintOut class. To understand the class you need to examine the demo examples
|
||||
and the library <a href="%s">printout.py</a> module classes.
|
||||
<p>
|
||||
The initial class primarily contains a Table preview/printing class. There is alot of flexibility
|
||||
The initial class primarily contains a Table preview/printing class. There is a lot of flexibility
|
||||
in manipulating the placement, sizing, colours, alignment of the table text and cell background colors.
|
||||
There are also a number of options for printing Header and Footer information on the page.
|
||||
<p>
|
||||
|
@@ -1,5 +1,6 @@
|
||||
|
||||
from wxPython.wx import *
|
||||
from wxPython.lib import newevent
|
||||
|
||||
import thread
|
||||
import time
|
||||
@@ -7,18 +8,8 @@ from whrandom import random
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
wxEVT_UPDATE_BARGRAPH = wxNewEventType()
|
||||
|
||||
def EVT_UPDATE_BARGRAPH(win, func):
|
||||
win.Connect(-1, -1, wxEVT_UPDATE_BARGRAPH, func)
|
||||
|
||||
|
||||
class UpdateBarEvent(wxPyEvent):
|
||||
def __init__(self, barNum, value):
|
||||
wxPyEvent.__init__(self)
|
||||
self.SetEventType(wxEVT_UPDATE_BARGRAPH)
|
||||
self.barNum = barNum
|
||||
self.value = value
|
||||
# This creates a new Event class and a EVT binder function
|
||||
UpdateBarEvent, EVT_UPDATE_BARGRAPH = newevent.NewEvent()
|
||||
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
@@ -41,7 +32,7 @@ class CalcBarThread:
|
||||
|
||||
def Run(self):
|
||||
while self.keepGoing:
|
||||
evt = UpdateBarEvent(self.barNum, int(self.val))
|
||||
evt = UpdateBarEvent(barNum = self.barNum, value = int(self.val))
|
||||
wxPostEvent(self.win, evt)
|
||||
#del evt
|
||||
|
||||
@@ -232,7 +223,7 @@ so any cross platform GUI Toolkit and applications written with it
|
||||
need to take that into account.
|
||||
|
||||
The solution is to only allow interaction with the GUI from a single
|
||||
thread, but this often severly limits what can be done in an
|
||||
thread, but this often severely limits what can be done in an
|
||||
application and makes it difficult to use additional threads at all.
|
||||
|
||||
Since wxPython already makes extensive use of event handlers, it is a
|
||||
|
61493
wxPython/demo/data/world.dat
Normal file
61493
wxPython/demo/data/world.dat
Normal file
File diff suppressed because it is too large
Load Diff
@@ -93,7 +93,7 @@ class MyApp(wx.App):
|
||||
while self.Pending():
|
||||
self.Dispatch()
|
||||
|
||||
# Send idle events to idle handlers. You may want to throtle
|
||||
# Send idle events to idle handlers. You may want to throttle
|
||||
# this back a bit so there is not too much CPU time spent in
|
||||
# the idle handlers. For this example, I'll just snooze a
|
||||
# little...
|
||||
|
@@ -1,4 +1,4 @@
|
||||
"""Basic regular expression demostration facility (Perl style syntax)."""
|
||||
"""Basic regular expression demonstration facility (Perl style syntax)."""
|
||||
|
||||
from wxPython.wx import *
|
||||
import re
|
||||
|
@@ -35,9 +35,9 @@
|
||||
When using wxPython, the call to app.Mainloop() takes over
|
||||
the thread from which it is called. This presents a
|
||||
problem for applications that want to use the standard
|
||||
Python command line user interface, while occasionaly
|
||||
Python command line user interface, while occasionally
|
||||
creating a GUI window for viewing an image, plot, etc.
|
||||
One soultion is to mangage the GUI in a second thread.
|
||||
One solution is to manage the GUI in a second thread.
|
||||
|
||||
wxPython does not behave well if windows are created in
|
||||
a thread other than the one where wxPython was originally
|
||||
|
@@ -481,7 +481,7 @@ class PrintCalend:
|
||||
|
||||
year, month = self.IncMonth(year, month)
|
||||
y = y + 3.5
|
||||
x = x + 4.0 # next colum
|
||||
x = x + 4.0 # next column
|
||||
|
||||
DC.EndDrawing()
|
||||
|
||||
|
@@ -13,7 +13,7 @@ class TestPanel(wxPanel):
|
||||
cal = wxCalendarCtrl(self, -1, wxDateTime_Now(), pos = (25,50),
|
||||
style = wxCAL_SHOW_HOLIDAYS
|
||||
| wxCAL_SUNDAY_FIRST
|
||||
#| wxCAL_SEQUENTIAL_MONTH_SELECTION
|
||||
| wxCAL_SEQUENTIAL_MONTH_SELECTION
|
||||
)
|
||||
|
||||
EVT_CALENDAR(self, cal.GetId(), self.OnCalSelected)
|
||||
|
@@ -194,7 +194,7 @@ class DragCanvas(wxScrolledWindow):
|
||||
if not self.dragShape or not evt.Dragging() or not evt.LeftIsDown():
|
||||
return
|
||||
|
||||
# if we have a shape, but havn't started dragging yet
|
||||
# if we have a shape, but haven't started dragging yet
|
||||
if self.dragShape and not self.dragImage:
|
||||
|
||||
# only start the drag after having moved a couple pixels
|
||||
|
@@ -16,7 +16,7 @@ def runTest(frame, nb, log):
|
||||
"This is a simple text editor, the class name is",
|
||||
"wxEditor. Type a few lines and try it out.",
|
||||
"",
|
||||
"It uses Windows-style key commands that can be overriden by subclassing.",
|
||||
"It uses Windows-style key commands that can be overridden by subclassing.",
|
||||
"Mouse select works. Here are the key commands:",
|
||||
"",
|
||||
"Cursor movement: Arrow keys or mouse",
|
||||
|
@@ -8,7 +8,7 @@ text = """\
|
||||
Right-click on the panel to get a menu. This menu will be managed by
|
||||
a wxFileHistory object and so the files you select will automatically
|
||||
be added to the end of the menu and will be selectable the next time
|
||||
the menu is viewed. The filename selcted, either via the Open menu
|
||||
the menu is viewed. The filename selected, either via the Open menu
|
||||
item, or from the history, will be displayed in the log window below.
|
||||
"""
|
||||
|
||||
|
@@ -287,7 +287,7 @@ value to fall within the current bounds.
|
||||
<DT><B>SetNoneAllowed(bool)</B>
|
||||
<DD>If called with a value of True, this function will cause the control
|
||||
to allow the value to be empty, representing a value of None.
|
||||
If called with a value of fakse, this function will prevent the value
|
||||
If called with a value of false, this function will prevent the value
|
||||
from being None. If the value of the control is currently None,
|
||||
ie. the control is empty, then the value will be changed to that
|
||||
of the lower bound of the control, or 0 if no lower bound is set.
|
||||
|
@@ -61,7 +61,7 @@ class TestVirtualList(wxListCtrl):
|
||||
# "virtualness" of the list... Normally you would
|
||||
# determine the text, attributes and/or image based
|
||||
# on values from some external data source, but for
|
||||
# this demo we'll just calcualte them
|
||||
# this demo we'll just calculate them
|
||||
def OnGetItemText(self, item, col):
|
||||
return "Item %d, column %d" % (item, col)
|
||||
|
||||
|
335
wxPython/demo/wxMaskedNumCtrl.py
Normal file
335
wxPython/demo/wxMaskedNumCtrl.py
Normal file
@@ -0,0 +1,335 @@
|
||||
from wxPython.wx import *
|
||||
from wxPython.lib.maskednumctrl import wxMaskedNumCtrl, EVT_MASKEDNUM
|
||||
from wxPython.lib.maskednumctrl import __doc__ as overviewdoc
|
||||
from wxPython.lib.maskededit import wxMaskedTextCtrl
|
||||
import string, sys, traceback
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
class TestPanel( wxPanel ):
|
||||
def __init__( self, parent, log ):
|
||||
|
||||
wxPanel.__init__( self, parent, -1 )
|
||||
self.log = log
|
||||
panel = wxPanel( self, -1 )
|
||||
|
||||
header = wxStaticText(panel, -1, """\
|
||||
This shows the various options for wxMaskedNumCtrl.
|
||||
The controls at the top reconfigure the resulting control at the bottom.
|
||||
""")
|
||||
header.SetForegroundColour( "Blue" )
|
||||
|
||||
intlabel = wxStaticText( panel, -1, "Integer width:" )
|
||||
self.integerwidth = wxMaskedNumCtrl(
|
||||
panel, value=10,
|
||||
integerWidth=2,
|
||||
allowNegative=False)
|
||||
|
||||
fraclabel = wxStaticText( panel, -1, "Fraction width:" )
|
||||
self.fractionwidth = wxMaskedNumCtrl(
|
||||
panel, value=0,
|
||||
integerWidth=2,
|
||||
allowNegative=False )
|
||||
|
||||
groupcharlabel = wxStaticText( panel,-1, "Grouping char:" )
|
||||
self.groupchar = wxMaskedTextCtrl( panel, -1,
|
||||
value=',',
|
||||
mask='&',
|
||||
excludeChars = '-()',
|
||||
formatcodes='F',
|
||||
emptyInvalid=True,
|
||||
validRequired=True)
|
||||
|
||||
decimalcharlabel = wxStaticText( panel,-1, "Decimal char:" )
|
||||
self.decimalchar = wxMaskedTextCtrl( panel, -1,
|
||||
value='.',
|
||||
mask='&',
|
||||
excludeChars = '-()',
|
||||
formatcodes='F',
|
||||
emptyInvalid=True,
|
||||
validRequired=True)
|
||||
|
||||
self.set_min = wxCheckBox( panel, -1, "Set minimum value:" )
|
||||
# Create this wxMaskedNumCtrl using factory, to show how:
|
||||
self.min = wxMaskedNumCtrl( panel, integerWidth=5, fractionWidth=2 )
|
||||
self.min.Enable( False )
|
||||
|
||||
self.set_max = wxCheckBox( panel, -1, "Set maximum value:" )
|
||||
self.max = wxMaskedNumCtrl( panel, integerWidth=5, fractionWidth=2 )
|
||||
self.max.Enable( False )
|
||||
|
||||
|
||||
self.limit_target = wxCheckBox( panel, -1, "Limit control" )
|
||||
self.allow_none = wxCheckBox( panel, -1, "Allow empty control" )
|
||||
self.group_digits = wxCheckBox( panel, -1, "Group digits" )
|
||||
self.group_digits.SetValue( True )
|
||||
self.allow_negative = wxCheckBox( panel, -1, "Allow negative values" )
|
||||
self.allow_negative.SetValue( True )
|
||||
self.use_parens = wxCheckBox( panel, -1, "Use parentheses" )
|
||||
self.select_on_entry = wxCheckBox( panel, -1, "Select on entry" )
|
||||
self.select_on_entry.SetValue( True )
|
||||
|
||||
label = wxStaticText( panel, -1, "Resulting numeric control:" )
|
||||
font = label.GetFont()
|
||||
font.SetWeight(wxBOLD)
|
||||
label.SetFont(font)
|
||||
|
||||
self.target_ctl = wxMaskedNumCtrl( panel, -1, name="target control" )
|
||||
|
||||
label_numselect = wxStaticText( panel, -1, """\
|
||||
Programmatically set the above
|
||||
value entry ctrl:""")
|
||||
self.numselect = wxComboBox(panel, -1, choices = [ '0', '111', '222.22', '-3', '54321.666666666', '-1353.978',
|
||||
'1234567', '-1234567', '123456789', '-123456789.1',
|
||||
'1234567890.', '-9876543210.9' ])
|
||||
|
||||
grid1 = wxFlexGridSizer( 0, 4, 0, 0 )
|
||||
grid1.Add( intlabel, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5)
|
||||
grid1.Add( self.integerwidth, 0, wxALIGN_LEFT|wxALL, 5 )
|
||||
|
||||
grid1.Add( groupcharlabel, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5)
|
||||
grid1.Add( self.groupchar, 0, wxALIGN_LEFT|wxALL, 5 )
|
||||
|
||||
grid1.Add( fraclabel, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5 )
|
||||
grid1.Add( self.fractionwidth, 0, wxALIGN_LEFT|wxALL, 5 )
|
||||
|
||||
grid1.Add( decimalcharlabel, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5)
|
||||
grid1.Add( self.decimalchar, 0, wxALIGN_LEFT|wxALL, 5 )
|
||||
|
||||
grid1.Add( self.set_min, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5 )
|
||||
grid1.Add( self.min, 0, wxALIGN_LEFT|wxALL, 5 )
|
||||
grid1.Add( (5,5), 0, wxALIGN_LEFT|wxALL, 5)
|
||||
grid1.Add( (5,5), 0, wxALIGN_LEFT|wxALL, 5)
|
||||
|
||||
grid1.Add( self.set_max, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5 )
|
||||
grid1.Add( self.max, 0, wxALIGN_LEFT|wxALL, 5 )
|
||||
grid1.Add( (5,5), 0, wxALIGN_LEFT|wxALL, 5)
|
||||
grid1.Add( (5,5), 0, wxALIGN_LEFT|wxALL, 5)
|
||||
|
||||
|
||||
grid1.Add( self.limit_target, 0, wxALIGN_LEFT|wxALL, 5 )
|
||||
grid1.Add( self.allow_none, 0, wxALIGN_LEFT|wxALL, 5 )
|
||||
hbox1 = wxBoxSizer( wxHORIZONTAL )
|
||||
hbox1.Add( (17,5), 0, wxALIGN_LEFT|wxALL, 5)
|
||||
hbox1.Add( self.group_digits, 0, wxALIGN_LEFT|wxLEFT, 5 )
|
||||
grid1.Add( hbox1, 0, wxALIGN_LEFT|wxALL, 5)
|
||||
grid1.Add( (5,5), 0, wxALIGN_LEFT|wxALL, 5)
|
||||
|
||||
grid1.Add( self.allow_negative, 0, wxALIGN_LEFT|wxALL, 5 )
|
||||
grid1.Add( self.use_parens, 0, wxALIGN_LEFT|wxALL, 5 )
|
||||
hbox2 = wxBoxSizer( wxHORIZONTAL )
|
||||
hbox2.Add( (17,5), 0, wxALIGN_LEFT|wxALL, 5)
|
||||
hbox2.Add( self.select_on_entry, 0, wxALIGN_LEFT|wxLEFT, 5 )
|
||||
grid1.Add( hbox2, 0, wxALIGN_LEFT|wxALL, 5)
|
||||
grid1.Add( (5,5), 0, wxALIGN_LEFT|wxALL, 5)
|
||||
|
||||
|
||||
grid2 = wxFlexGridSizer( 0, 2, 0, 0 )
|
||||
grid2.Add( label, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5 )
|
||||
grid2.Add( self.target_ctl, 0, wxALIGN_LEFT|wxALL, 5 )
|
||||
grid2.Add( (5,5), 0, wxALIGN_LEFT|wxALL, 5)
|
||||
grid2.Add( (5,5), 0, wxALIGN_LEFT|wxALL, 5)
|
||||
grid2.Add( label_numselect, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5 )
|
||||
grid2.Add( self.numselect, 0, wxALIGN_LEFT|wxALL, 5 )
|
||||
grid2.Add( (5,5), 0, wxALIGN_LEFT|wxALL, 5)
|
||||
grid2.Add( (5,5), 0, wxALIGN_LEFT|wxALL, 5)
|
||||
grid2.AddGrowableCol(1)
|
||||
|
||||
self.outer_box = wxBoxSizer( wxVERTICAL )
|
||||
self.outer_box.Add(header, 0, wxALIGN_LEFT|wxTOP|wxLEFT, 20)
|
||||
self.outer_box.Add( grid1, 0, wxALIGN_CENTRE|wxLEFT|wxBOTTOM|wxRIGHT, 20 )
|
||||
self.outer_box.Add( grid2, 0, wxALIGN_LEFT|wxALL, 20 )
|
||||
self.grid2 = grid2
|
||||
|
||||
panel.SetAutoLayout( True )
|
||||
panel.SetSizer( self.outer_box )
|
||||
self.outer_box.Fit( panel )
|
||||
panel.Move( (50,10) )
|
||||
self.panel = panel
|
||||
|
||||
EVT_MASKEDNUM( self, self.integerwidth.GetId(), self.OnSetIntWidth )
|
||||
EVT_MASKEDNUM( self, self.fractionwidth.GetId(), self.OnSetFractionWidth )
|
||||
EVT_TEXT( self, self.groupchar.GetId(), self.OnSetGroupChar )
|
||||
EVT_TEXT( self, self.decimalchar.GetId(), self.OnSetDecimalChar )
|
||||
|
||||
EVT_CHECKBOX( self, self.set_min.GetId(), self.OnSetMin )
|
||||
EVT_CHECKBOX( self, self.set_max.GetId(), self.OnSetMax )
|
||||
EVT_MASKEDNUM( self, self.min.GetId(), self.SetTargetMinMax )
|
||||
EVT_MASKEDNUM( self, self.max.GetId(), self.SetTargetMinMax )
|
||||
|
||||
EVT_CHECKBOX( self, self.limit_target.GetId(), self.SetTargetMinMax )
|
||||
EVT_CHECKBOX( self, self.allow_none.GetId(), self.OnSetAllowNone )
|
||||
EVT_CHECKBOX( self, self.group_digits.GetId(), self.OnSetGroupDigits )
|
||||
EVT_CHECKBOX( self, self.allow_negative.GetId(), self.OnSetAllowNegative )
|
||||
EVT_CHECKBOX( self, self.use_parens.GetId(), self.OnSetUseParens )
|
||||
EVT_CHECKBOX( self, self.select_on_entry.GetId(), self.OnSetSelectOnEntry )
|
||||
|
||||
EVT_MASKEDNUM( self, self.target_ctl.GetId(), self.OnTargetChange )
|
||||
EVT_COMBOBOX( self, self.numselect.GetId(), self.OnNumberSelect )
|
||||
|
||||
|
||||
def OnSetIntWidth(self, event ):
|
||||
width = self.integerwidth.GetValue()
|
||||
if width < 1:
|
||||
self.log.write("integer width must be positive\n")
|
||||
self.integerwidth.SetForegroundColour(wxRED)
|
||||
else:
|
||||
self.integerwidth.SetForegroundColour(wxBLACK)
|
||||
self.log.write("setting integer width to %d\n" % width)
|
||||
self.target_ctl.SetParameters( integerWidth = width)
|
||||
# Now resize and fit the dialog as appropriate:
|
||||
self.grid2.SetItemMinSize(self.target_ctl, self.target_ctl.GetSize())
|
||||
self.outer_box.Fit( self.panel )
|
||||
self.outer_box.SetSizeHints( self.panel )
|
||||
|
||||
|
||||
def OnSetFractionWidth(self, event ):
|
||||
width = self.fractionwidth.GetValue()
|
||||
self.log.write("setting fraction width to %d\n" % width)
|
||||
self.target_ctl.SetParameters( fractionWidth = width)
|
||||
# Now resize and fit the dialog as appropriate:
|
||||
self.grid2.SetItemMinSize(self.target_ctl, self.target_ctl.GetSize())
|
||||
self.outer_box.Fit( self.panel )
|
||||
self.outer_box.SetSizeHints( self.panel )
|
||||
|
||||
|
||||
def OnSetGroupChar( self, event ):
|
||||
char = self.groupchar.GetValue()
|
||||
if self.target_ctl.GetDecimalChar() == char:
|
||||
self.log.write("group and decimal chars must be different\n")
|
||||
self.groupchar.SetForegroundColour(wxRED)
|
||||
else:
|
||||
self.groupchar.SetForegroundColour(wxBLACK)
|
||||
self.log.write("setting group char to %s\n" % char)
|
||||
self.target_ctl.SetGroupChar( char )
|
||||
|
||||
def OnSetDecimalChar( self, event ):
|
||||
char = self.decimalchar.GetValue()
|
||||
if self.target_ctl.GetGroupChar() == char:
|
||||
self.log.write("group and decimal chars must be different\n")
|
||||
self.decimalchar.SetForegroundColour(wxRED)
|
||||
else:
|
||||
self.decimalchar.SetForegroundColour(wxBLACK)
|
||||
self.log.write("setting decimal char to %s\n" % char)
|
||||
self.target_ctl.SetDecimalChar( char )
|
||||
|
||||
|
||||
def OnSetMin( self, event ):
|
||||
self.min.Enable( self.set_min.GetValue() )
|
||||
self.SetTargetMinMax()
|
||||
|
||||
def OnSetMax( self, event ):
|
||||
self.max.Enable( self.set_max.GetValue() )
|
||||
self.SetTargetMinMax()
|
||||
|
||||
|
||||
def SetTargetMinMax( self, event=None ):
|
||||
min = max = None
|
||||
self.target_ctl.SetLimited( self.limit_target.GetValue() )
|
||||
|
||||
if self.set_min.GetValue():
|
||||
min = self.min.GetValue()
|
||||
if self.set_max.GetValue():
|
||||
max = self.max.GetValue()
|
||||
|
||||
cur_min, cur_max = self.target_ctl.GetBounds()
|
||||
|
||||
if min != cur_min and not self.target_ctl.SetMin( min ):
|
||||
if self.target_ctl.GetMax() is None and cur_max > min:
|
||||
self.log.write( "min (%d) won't fit in control -- bound not set\n" % min )
|
||||
else:
|
||||
self.log.write( "min (%d) > current max (%d) -- bound not set\n" % ( min, self.target_ctl.GetMax() ) )
|
||||
self.min.SetParameters( signedForegroundColour=wxRED, foregroundColour=wxRED )
|
||||
else:
|
||||
self.min.SetParameters( signedForegroundColour=wxBLACK, foregroundColour=wxBLACK )
|
||||
self.min.Refresh()
|
||||
|
||||
if max != cur_max and not self.target_ctl.SetMax( max ):
|
||||
if self.target_ctl.GetMax() is None and cur_min < max:
|
||||
self.log.write( "max (%d) won't fit in control -- bound not set\n" % max )
|
||||
else:
|
||||
self.log.write( "max (%d) < current min (%d) -- bound not set\n" % ( max, self.target_ctl.GetMin() ) )
|
||||
self.max.SetParameters( signedForegroundColour=wxRED, foregroundColour=wxRED )
|
||||
else:
|
||||
self.max.SetParameters( signedForegroundColour=wxBLACK, foregroundColour=wxBLACK )
|
||||
self.max.Refresh()
|
||||
|
||||
if min != cur_min or max != cur_max:
|
||||
new_min, new_max = self.target_ctl.GetBounds()
|
||||
self.log.write( "current min, max: (%s, %s)\n" % ( str(new_min), str(new_max) ) )
|
||||
|
||||
|
||||
def OnSetAllowNone( self, event ):
|
||||
self.target_ctl.SetAllowNone( self.allow_none.GetValue() )
|
||||
|
||||
|
||||
def OnSetGroupDigits( self, event ):
|
||||
self.target_ctl.SetGroupDigits( self.group_digits.GetValue() )
|
||||
# Now resize and fit the dialog as appropriate:
|
||||
self.grid2.SetItemMinSize(self.target_ctl, self.target_ctl.GetSize())
|
||||
self.outer_box.Fit( self.panel )
|
||||
self.outer_box.SetSizeHints( self.panel )
|
||||
|
||||
|
||||
def OnSetAllowNegative( self, event ):
|
||||
if self.allow_negative.GetValue():
|
||||
self.use_parens.Enable(True)
|
||||
self.target_ctl.SetParameters(allowNegative=True,
|
||||
useParensForNegatives = self.use_parens.GetValue())
|
||||
else:
|
||||
self.target_ctl.SetAllowNegative(False)
|
||||
# Now resize and fit the dialog as appropriate:
|
||||
self.grid2.SetItemMinSize(self.target_ctl, self.target_ctl.GetSize())
|
||||
self.outer_box.Fit( self.panel )
|
||||
self.outer_box.SetSizeHints( self.panel )
|
||||
|
||||
|
||||
def OnSetUseParens( self, event ):
|
||||
self.target_ctl.SetUseParensForNegatives( self.use_parens.GetValue() )
|
||||
# Now resize and fit the dialog as appropriate:
|
||||
self.grid2.SetItemMinSize(self.target_ctl, self.target_ctl.GetSize())
|
||||
self.outer_box.Fit( self.panel )
|
||||
self.outer_box.SetSizeHints( self.panel )
|
||||
|
||||
|
||||
def OnSetSelectOnEntry( self, event ):
|
||||
self.target_ctl.SetSelectOnEntry( self.select_on_entry.GetValue() )
|
||||
|
||||
|
||||
def OnTargetChange( self, event ):
|
||||
ctl = event.GetEventObject()
|
||||
value = ctl.GetValue()
|
||||
ib_str = [ " (out of bounds)", "" ]
|
||||
self.log.write( "value = %s (%s)%s\n" % ( repr(value), repr(type(value)), ib_str[ ctl.IsInBounds(value) ] ) )
|
||||
|
||||
|
||||
def OnNumberSelect( self, event ):
|
||||
value = event.GetString()
|
||||
if value:
|
||||
if value.find('.') != -1:
|
||||
numvalue = float(value)
|
||||
else:
|
||||
numvalue = long(value)
|
||||
else:
|
||||
numvalue = value # try to clear the value again
|
||||
|
||||
try:
|
||||
self.target_ctl.SetValue(numvalue)
|
||||
except:
|
||||
type, value, tb = sys.exc_info()
|
||||
for line in traceback.format_exception_only(type, value):
|
||||
self.log.write(line)
|
||||
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
def runTest( frame, nb, log ):
|
||||
win = TestPanel( nb, log )
|
||||
return win
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
overview = overviewdoc
|
||||
|
||||
if __name__ == '__main__':
|
||||
import sys,os
|
||||
import run
|
||||
run.main(['', os.path.basename(sys.argv[0])])
|
@@ -5,8 +5,11 @@ from wxPython.wx import *
|
||||
|
||||
def runTest(frame, nb, log):
|
||||
data = wxPageSetupDialogData()
|
||||
data.SetMarginTopLeft(wxPoint(50,50))
|
||||
data.SetMarginBottomRight(wxPoint(50,50))
|
||||
data.SetMarginTopLeft( (15, 15) )
|
||||
data.SetMarginBottomRight( (15, 15) )
|
||||
#data.SetDefaultMinMargins(True)
|
||||
data.SetPaperId(wxPAPER_LETTER)
|
||||
|
||||
dlg = wxPageSetupDialog(frame, data)
|
||||
if dlg.ShowModal() == wxID_OK:
|
||||
data = dlg.GetPageSetupData()
|
||||
|
@@ -103,7 +103,7 @@ def runTest(frame, nb, log):
|
||||
overview = """<html><body>
|
||||
wxScrolledPanel fills a "hole" in the implementation of wxScrolledWindow,
|
||||
providing automatic scrollbar and scrolling behavior and the tab traversal
|
||||
mangement that wxScrolledWindow lacks.
|
||||
management that wxScrolledWindow lacks.
|
||||
</body></html>
|
||||
"""
|
||||
|
||||
|
@@ -6,7 +6,7 @@ from wxPython.wx import *
|
||||
def runTest(frame, nb, log):
|
||||
dlg = wxSingleChoiceDialog(frame, 'Test Single Choice', 'The Caption',
|
||||
['zero', 'one', 'two', 'three', 'four', 'five',
|
||||
'six', 'seven', 'eight'], wxDEFAULT_DIALOG_STYLE|wxOK|wxCANCEL)
|
||||
'six', 'seven', 'eight'], wxCHOICEDLG_STYLE)
|
||||
if dlg.ShowModal() == wxID_OK:
|
||||
log.WriteText('You selected: %s\n' % dlg.GetStringSelection())
|
||||
dlg.Destroy()
|
||||
|
@@ -16,7 +16,7 @@ the name suggests, you can define styles that can be applied to
|
||||
sections of text. This will typically be used for things like
|
||||
syntax highlighting code editors, but I'm sure that there are other
|
||||
applications as well. A style is a combination of font, point size,
|
||||
forground and background colours. The editor can handle
|
||||
foreground and background colours. The editor can handle
|
||||
proportional fonts just as easily as monospaced fonts, and various
|
||||
styles can use different sized fonts.
|
||||
|
||||
@@ -86,7 +86,7 @@ class MySTC(wxStyledTextCtrl):
|
||||
% (evt.GetX(), evt.GetY(), evt.GetPosition(), evt.GetDragResult()))
|
||||
|
||||
if debug and evt.GetPosition() < 250:
|
||||
evt.SetDragResult(wxDragNone) # prevent dropping at the begining of the buffer
|
||||
evt.SetDragResult(wxDragNone) # prevent dropping at the beginning of the buffer
|
||||
|
||||
|
||||
def OnDoDrop(self, evt):
|
||||
|
@@ -103,9 +103,9 @@ class PythonSTC(wxStyledTextCtrl):
|
||||
self.StyleSetSpec(wxSTC_STYLE_BRACEBAD, "fore:#000000,back:#FF0000,bold")
|
||||
|
||||
# Python styles
|
||||
# White space
|
||||
self.StyleSetSpec(wxSTC_P_DEFAULT, "fore:#808080,face:%(helv)s,size:%(size)d" % faces)
|
||||
# Comment
|
||||
# Default
|
||||
self.StyleSetSpec(wxSTC_P_DEFAULT, "fore:#000000,face:%(helv)s,size:%(size)d" % faces)
|
||||
# Comments
|
||||
self.StyleSetSpec(wxSTC_P_COMMENTLINE, "fore:#007F00,face:%(other)s,size:%(size)d" % faces)
|
||||
# Number
|
||||
self.StyleSetSpec(wxSTC_P_NUMBER, "fore:#007F7F,size:%(size)d" % faces)
|
||||
@@ -126,7 +126,7 @@ class PythonSTC(wxStyledTextCtrl):
|
||||
# Operators
|
||||
self.StyleSetSpec(wxSTC_P_OPERATOR, "bold,size:%(size)d" % faces)
|
||||
# Identifiers
|
||||
self.StyleSetSpec(wxSTC_P_IDENTIFIER, "fore:#808080,face:%(helv)s,size:%(size)d" % faces)
|
||||
self.StyleSetSpec(wxSTC_P_IDENTIFIER, "fore:#000000,face:%(helv)s,size:%(size)d" % faces)
|
||||
# Comment-blocks
|
||||
self.StyleSetSpec(wxSTC_P_COMMENTBLOCK, "fore:#7F7F7F,size:%(size)d" % faces)
|
||||
# End of line where string is not closed
|
||||
|
@@ -29,7 +29,7 @@ class TestPanel(wxPanel):
|
||||
EVT_KILL_FOCUS(t1, self.OnKillFocus)
|
||||
EVT_WINDOW_DESTROY(t1, self.OnWindowDestroy)
|
||||
|
||||
l2 = wxStaticText(self, -1, "Passsword")
|
||||
l2 = wxStaticText(self, -1, "Password")
|
||||
t2 = wxTextCtrl(self, -1, "", size=(125, -1), style=wxTE_PASSWORD)
|
||||
EVT_TEXT(self, t2.GetId(), self.EvtText)
|
||||
|
||||
@@ -47,8 +47,6 @@ class TestPanel(wxPanel):
|
||||
b3 = wxButton(self, -1, "Test WriteText")
|
||||
EVT_BUTTON(self, b3.GetId(), self.OnTestWriteText)
|
||||
self.tc = t3
|
||||
b4 = wxButton(self, -1, "Test Simulated Event")
|
||||
EVT_BUTTON(self, b4.GetId(), self.OnTestEvent)
|
||||
|
||||
|
||||
l4 = wxStaticText(self, -1, "Rich Text")
|
||||
@@ -74,7 +72,6 @@ class TestPanel(wxPanel):
|
||||
bsizer.Add(b, 0, wxGROW|wxALL, 4)
|
||||
bsizer.Add(b2, 0, wxGROW|wxALL, 4)
|
||||
bsizer.Add(b3, 0, wxGROW|wxALL, 4)
|
||||
bsizer.Add(b4, 0, wxGROW|wxALL, 4)
|
||||
|
||||
sizer = wxFlexGridSizer(cols=3, hgap=6, vgap=6)
|
||||
sizer.AddMany([ l1, t1, (0,0),
|
||||
@@ -145,14 +142,6 @@ class TestPanel(wxPanel):
|
||||
% (ip, text[ip], lp, len(text)))
|
||||
|
||||
|
||||
def OnTestEvent(self, evt):
|
||||
ke = wxKeyEvent(wxEVT_CHAR)
|
||||
ke.SetEventObject(self.tc1)
|
||||
ke.SetId(self.tc1.GetId())
|
||||
ke.m_keyCode = ord('A')
|
||||
self.tc1.GetEventHandler().ProcessEvent(ke)
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
def runTest(frame, nb, log):
|
||||
|
@@ -50,7 +50,17 @@ Clear as mud? Good. Let's get started.
|
||||
You may want to use --enable-debug instead of --enable-optimise if
|
||||
you need to run though a debugger and want full debugging symbols.
|
||||
|
||||
if you want to use the image and zlib libraries included with
|
||||
SOLARIS NOTE: The --enable-rpath option may cause problems when
|
||||
using wxGTK on Solaris when compiling wxPython in step 4 below.
|
||||
The woraround is to not use --enable-rpath flag for configure, but
|
||||
in that case all wxPython applications must have the
|
||||
LD_LIBRARY_PATH set to include $WXPREF/lib, or you can use the
|
||||
'crle' program to modify the runtime linking environment. If this
|
||||
is the only installation of wxGTK on the system then you can use a
|
||||
system library path for WXPREF and not have to worry about it at
|
||||
all.
|
||||
|
||||
If you want to use the image and zlib libraries included with
|
||||
wxWindows instead of those already installed on your system, (for
|
||||
example, to reduce dependencies on 3rd party libraries) then you
|
||||
can add these flags to the configure command:
|
||||
@@ -61,8 +71,8 @@ Clear as mud? Good. Let's get started.
|
||||
--with-zlib=builtin \
|
||||
|
||||
If you would like to use GTK 2.x and unicode, then add the
|
||||
following flags. Please note that this is still beta-level
|
||||
quality, but does look and work quite nice for the most part:
|
||||
following flags. Please note that this is still considered beta,
|
||||
but does look and work quite nice for the most part:
|
||||
|
||||
--enable-gtk2 \
|
||||
--enable-unicode \
|
||||
@@ -99,7 +109,7 @@ Clear as mud? Good. Let's get started.
|
||||
setup.py command line to disable the building of the glcanvas
|
||||
module.
|
||||
|
||||
If you would like to install to someplace besides the Python
|
||||
If you would like to install to some place besides the Python
|
||||
site-packages directory (such as to your home directory) then you
|
||||
can add "--root=<path>" after the "install" command. To use
|
||||
wxPython like this you'll need to ensure that the directory
|
||||
@@ -116,6 +126,12 @@ Clear as mud? Good. Let's get started.
|
||||
|
||||
python demo.py
|
||||
|
||||
SOLARIS NOTE: If you get unresolved symbol errors when importing
|
||||
wxPython and you are running on Solaris and building with gcc, then
|
||||
you may be able to work around the problem by uncommenting a bit of
|
||||
code in setup.py and building again. Look for 'SunOS' in setup.py
|
||||
and uncomment the block containing it. The problem is that Sun's ld
|
||||
does not automatically add libgcc to the link step.
|
||||
|
||||
7. That's all, except for the having fun part!
|
||||
|
||||
|
@@ -139,11 +139,13 @@ if [ -z "$skipconfig" ]; then
|
||||
--enable-precomp=no \
|
||||
--enable-geometry \
|
||||
--enable-optimise \
|
||||
--enable-debug_flag \
|
||||
--with-libjpeg=builtin \
|
||||
--with-libpng=builtin \
|
||||
--with-libtiff=builtin \
|
||||
--with-zlib=builtin
|
||||
|
||||
|
||||
# --with-zlib=builtin
|
||||
# --enable-debug_flag
|
||||
|
||||
fi
|
||||
|
||||
|
@@ -1,5 +0,0 @@
|
||||
Welcome!
|
||||
|
||||
This program will install wxPython 2.4.1.1 for MacPython-OSX 2.3.
|
||||
|
||||
Build date: Fri Jun 13 10:07:30 PDT 2003
|
@@ -1,18 +0,0 @@
|
||||
#!/bin/sh -e
|
||||
# Compile the .py files in the wxPython pacakge
|
||||
/usr/local/bin/python $2/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/../compileall.py $2/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/wxPython
|
||||
/usr/local/bin/python -O $2/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/../compileall.py $2/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/wxPython
|
||||
|
||||
# and in the demo
|
||||
/usr/local/bin/python $2/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/../compileall.py /Applications/wxPythonOSX-2.4.1.1/demo
|
||||
|
||||
# Make the demo/data dir writable
|
||||
chmod a+w /Applications/wxPythonOSX-2.4.1.1/demo/data
|
||||
|
||||
# and the wxPython pacakge should be group writable
|
||||
chgrp -R admin $2/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/wxPython
|
||||
chgrp -R admin /Applications/wxPythonOSX-2.4.1.1
|
||||
chmod -R g+w $2/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/wxPython
|
||||
chmod -R g+w /Applications/wxPythonOSX-2.4.1.1
|
||||
|
||||
exit 0
|
@@ -1,3 +1,16 @@
|
||||
# -*- coding: iso-8859-1 -*-
|
||||
#----------------------------------------------------------------------
|
||||
# Name: make_installer.py
|
||||
# Purpose: A script to create the wxPython windows installer
|
||||
#
|
||||
# Author: Robin Dunn
|
||||
#
|
||||
# Created: 30-April-2001
|
||||
# RCS-ID: $Id$
|
||||
# Copyright: (c) 2003 by Total Control Software
|
||||
# Licence: wxWindows license
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
"""
|
||||
This script will generate a setup script for InnoSetup and then run it
|
||||
to make the installer executable. If all goes right the proper versions
|
||||
@@ -25,7 +38,7 @@ AppCopyright = Copyright
|
||||
DefaultDirName = {code:GetInstallDir|c:\DoNotInstallHere}
|
||||
DefaultGroupName = wxPython %(SHORTVER)s for Python %(PYTHONVER)s
|
||||
AlwaysCreateUninstallIcon = yes
|
||||
AdminPrivilegesRequired = yes
|
||||
AdminPrivilegesRequired = no
|
||||
OutputDir = dist
|
||||
WizardStyle = modern
|
||||
UninstallStyle = modern
|
||||
@@ -45,7 +58,7 @@ AppPublisherURL = http://wxPython.org/
|
||||
LicenseFile = licence\licence.txt
|
||||
CodeFile = %(IFSFILE)s
|
||||
|
||||
;; WizardDebug = yes
|
||||
;;WizardDebug = yes
|
||||
|
||||
;;------------------------------------------------------------
|
||||
|
||||
@@ -64,9 +77,12 @@ Name: samples; Description: "Sample applications"; Types: full
|
||||
;;------------------------------------------------------------
|
||||
|
||||
[Files]
|
||||
Source: "%(SYSDIR)s\MSVCRT.dll"; DestDir: "{sys}"; CopyMode: alwaysskipifsameorolder; Flags: sharedfile uninsneveruninstall restartreplace; Components: core
|
||||
Source: "%(SYSDIR)s\MSVCIRT.dll"; DestDir: "{sys}"; CopyMode: alwaysskipifsameorolder; Flags: sharedfile uninsneveruninstall restartreplace; Components: core
|
||||
Source: "%(SYSDIR)s\MSVCP60.dll"; DestDir: "{sys}"; CopyMode: alwaysskipifsameorolder; Flags: sharedfile uninsneveruninstall restartreplace; Components: core
|
||||
Source: "%(SYSDIR)s\MSVCRT.dll"; DestDir: "{sys}"; CopyMode: alwaysskipifsameorolder; Flags: sharedfile uninsneveruninstall restartreplace; Check: IsSysInstall; Components: core
|
||||
Source: "%(SYSDIR)s\MSVCIRT.dll"; DestDir: "{sys}"; CopyMode: alwaysskipifsameorolder; Flags: sharedfile uninsneveruninstall restartreplace; Check: IsSysInstall; Components: core
|
||||
Source: "%(SYSDIR)s\MSVCP60.dll"; DestDir: "{sys}"; CopyMode: alwaysskipifsameorolder; Flags: sharedfile uninsneveruninstall restartreplace; Check: IsSysInstall; Components: core
|
||||
Source: "%(SYSDIR)s\MSVCRT.dll"; DestDir: "{code:GetPythonDir}"; CopyMode: alwaysskipifsameorolder; Flags: uninsneveruninstall; Check: IsNotSysInstall; Components: core
|
||||
Source: "%(SYSDIR)s\MSVCIRT.dll"; DestDir: "{code:GetPythonDir}"; CopyMode: alwaysskipifsameorolder; Flags: uninsneveruninstall; Check: IsNotSysInstall; Components: core
|
||||
Source: "%(SYSDIR)s\MSVCP60.dll"; DestDir: "{code:GetPythonDir}"; CopyMode: alwaysskipifsameorolder; Flags: uninsneveruninstall; Check: IsNotSysInstall; Components: core
|
||||
|
||||
Source: "%(WXDIR)s\lib\%(WXDLL)s"; DestDir: "{app}\wxPython"; Components: core
|
||||
%(MSLU)s
|
||||
@@ -136,7 +152,7 @@ Source: "demo\data\*.py"; DestDir: "{app}\wxPython\demo\data";
|
||||
Source: "demo\data\*.png"; DestDir: "{app}\wxPython\demo\data"; Components: demo
|
||||
Source: "demo\data\*.bmp"; DestDir: "{app}\wxPython\demo\data"; Components: demo
|
||||
Source: "demo\data\*.i"; DestDir: "{app}\wxPython\demo\data"; Components: demo
|
||||
;;Source: "demo\data\*.h"; DestDir: "{app}\wxPython\demo\data"; Components: demo
|
||||
Source: "demo\data\*.dat"; DestDir: "{app}\wxPython\demo\data"; Components: demo
|
||||
Source: "demo\data\*.txt"; DestDir: "{app}\wxPython\demo\data"; Components: demo
|
||||
Source: "demo\data\*.wav"; DestDir: "{app}\wxPython\demo\data"; Components: demo
|
||||
Source: "demo\data\*.wdr"; DestDir: "{app}\wxPython\demo\data"; Components: demo
|
||||
@@ -332,10 +348,15 @@ program Setup;
|
||||
var
|
||||
PythonDir : String;
|
||||
InstallDir : String;
|
||||
sysInstall : Boolean;
|
||||
|
||||
|
||||
function InitializeSetup(): Boolean;
|
||||
begin
|
||||
|
||||
(* -------------------------------------------------------------- *)
|
||||
(* Figure out what to use as a default installation dir *)
|
||||
|
||||
if not RegQueryStringValue(HKEY_LOCAL_MACHINE,
|
||||
'Software\Python\PythonCore\%(PYTHONVER)s\InstallPath',
|
||||
'', PythonDir) then begin
|
||||
@@ -352,15 +373,62 @@ begin
|
||||
end;
|
||||
InstallDir := PythonDir;
|
||||
%(IF22)s
|
||||
|
||||
|
||||
(* -------------------------------------------------------------- *)
|
||||
(* And now where to put the system DLLs *)
|
||||
|
||||
sysInstall := False;
|
||||
|
||||
(* Check if Python has a regkey in HKLM, if so it installed the DLLs in the SYSTEM dir *)
|
||||
if RegValueExists(HKEY_LOCAL_MACHINE,
|
||||
'Software\Python\PythonCore\%(PYTHONVER)s\InstallPath', '') then begin
|
||||
sysInstall := True;
|
||||
end;
|
||||
|
||||
(* If so, ensure that the user can write to HKLM *)
|
||||
if sysInstall and not RegWriteStringValue(HKEY_LOCAL_MACHINE,
|
||||
'Software\Python\PythonCore\%(PYTHONVER)s\Modules\wxPython',
|
||||
'', '%(VERSION)s') then begin
|
||||
(* if not then revert to installing to the Python dir *)
|
||||
sysInstall := False;
|
||||
(* and put the regkey in HKCU *)
|
||||
RegWriteStringValue(HKEY_CURRENT_USER,
|
||||
'Software\Python\PythonCore\%(PYTHONVER)s\Modules\wxPython',
|
||||
'', '%(VERSION)s');
|
||||
end;
|
||||
|
||||
Result := true;
|
||||
end;
|
||||
|
||||
|
||||
function IsSysInstall(): Boolean;
|
||||
begin
|
||||
Result := sysInstall;
|
||||
end;
|
||||
function IsNotSysInstall(): Boolean;
|
||||
begin
|
||||
Result := not sysInstall;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
function GetDLLDir(Default: String): String;
|
||||
begin
|
||||
if sysInstall then begin
|
||||
Result := Default;
|
||||
end else begin
|
||||
Result := PythonDir;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
function GetPythonDir(Default: String): String;
|
||||
begin
|
||||
Result := PythonDir;
|
||||
end;
|
||||
|
||||
|
||||
function GetInstallDir(Default: String): String;
|
||||
begin
|
||||
Result := InstallDir;
|
||||
@@ -430,6 +498,14 @@ def build_locale_string():
|
||||
os.path.walk('wxPython\\locale', walk_helper, stringlst)
|
||||
return '\n'.join(stringlst)
|
||||
|
||||
def get_system_dir():
|
||||
for p in [r"C:\WINNT\SYSTEM32",
|
||||
r"C:\WINDOWS\SYSTEM32",
|
||||
]:
|
||||
if os.path.exists(p):
|
||||
return p
|
||||
raise IOError, "System dir not found"
|
||||
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
@@ -446,7 +522,7 @@ def main():
|
||||
PYVER = "Py" + PYTHONVER[0] + PYTHONVER[2]
|
||||
WXDIR = os.environ["WXWIN"]
|
||||
WXPYDIR = os.path.join(WXDIR, "wxPython")
|
||||
SYSDIR = r"C:\WINNT\SYSTEM32"
|
||||
SYSDIR = get_system_dir()
|
||||
ISSFILE = "__wxPython.iss"
|
||||
IFSFILE = "__wxPython.ifs"
|
||||
LOCALE = build_locale_string()
|
||||
|
29
wxPython/distrib/makesrpm
Executable file
29
wxPython/distrib/makesrpm
Executable file
@@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
if [ ! -d wxPython -o ! -e distrib/makerpm ]; then
|
||||
echo "Please run this script from the root wxPython directory."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
# Check parameters
|
||||
|
||||
function useage {
|
||||
echo "Usage: $0 wx_version "
|
||||
echo " wx_version String to use for version in filenames, etc."
|
||||
}
|
||||
|
||||
if [ $# -lt 1 ]; then
|
||||
useage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
ver=$1
|
||||
|
||||
|
||||
distrib/makerpm $ver 2.2 skipclean srpm
|
||||
distrib/makerpm $ver 2.3 skipclean skipcopy skiptar srpm
|
||||
distrib/makerpm $ver 2.2 skipclean skipcopy skiptar srpm gtk2
|
||||
distrib/makerpm $ver 2.3 skipclean skipcopy skiptar srpm gtk2
|
@@ -8,8 +8,8 @@
|
||||
%define version @VERSION@
|
||||
%define ver2 @VER2@
|
||||
%define release 1
|
||||
%define wxpref %{pref}/lib/wxPython-%{version}
|
||||
%define wxprefbase %{pref}/lib/wxPython
|
||||
%define wxpref %{wxprefbase}-%{version}
|
||||
%define name wxPython%{port}-py%{pyver}
|
||||
|
||||
|
||||
@@ -188,7 +188,7 @@ cd $WXDIR/wxPython
|
||||
#
|
||||
# TODO: Should this be dependent on %{builtin_libs} or something like it?
|
||||
|
||||
mkdir -p $RPM_BUILD_ROOT/usr/bin
|
||||
mkdir -p $RPM_BUILD_ROOT%{pref}/bin
|
||||
for s in \
|
||||
helpviewer \
|
||||
img2png \
|
||||
@@ -200,25 +200,30 @@ for s in \
|
||||
pywrap \
|
||||
pyshell \
|
||||
xrced; do
|
||||
cp scripts/$s $RPM_BUILD_ROOT/%{pref}/bin
|
||||
cp scripts/$s $RPM_BUILD_ROOT%{pref}/bin
|
||||
done
|
||||
|
||||
|
||||
# Install wxrc
|
||||
cp $WXDIR/contrib/utils/wxrc/wxrc $RPM_BUILD_ROOT/%{pref}/bin
|
||||
cp $WXDIR/contrib/utils/wxrc/wxrc $RPM_BUILD_ROOT%{pref}/bin
|
||||
|
||||
|
||||
# link specific name to generic name
|
||||
ln -s wxPython-%{version} $RPM_BUILD_ROOT%{wxprefbase}
|
||||
|
||||
|
||||
|
||||
# Copy icons and make menu entries
|
||||
#-- This only works for Mandrake. Is there a cross-distro way to do it?
|
||||
##mkdir -p $RPM_BUILD_ROOT/%{_iconsdir}
|
||||
##mkdir -p $RPM_BUILD_ROOT/%{_miconsdir}
|
||||
##mkdir -p $RPM_BUILD_ROOT/%{_menudir}
|
||||
##install -p -m 644 $WXDIR/wxPython/wxPython/py/PyCrust_32.png $RPM_BUILD_ROOT/%{_iconsdir}/PyCrust.png
|
||||
##install -p -m 644 $WXDIR/wxPython/wxPython/py/PyCrust_16.png $RPM_BUILD_ROOT/%{_miconsdir}/PyCrust.png
|
||||
##install -p -m 644 $WXDIR/wxPython/wxPython/tools/XRCed/XRCed_32.png $RPM_BUILD_ROOT/%{_iconsdir}/XRCed.png
|
||||
##install -p -m 644 $WXDIR/wxPython/wxPython/tools/XRCed/XRCed_16.png $RPM_BUILD_ROOT/%{_miconsdir}/XRCed.png
|
||||
##mkdir -p $RPM_BUILD_ROOT%{_iconsdir}
|
||||
##mkdir -p $RPM_BUILD_ROOT%{_miconsdir}
|
||||
##mkdir -p $RPM_BUILD_ROOT%{_menudir}
|
||||
##install -p -m 644 $WXDIR/wxPython/wxPython/py/PyCrust_32.png $RPM_BUILD_ROOT%{_iconsdir}/PyCrust.png
|
||||
##install -p -m 644 $WXDIR/wxPython/wxPython/py/PyCrust_16.png $RPM_BUILD_ROOT%{_miconsdir}/PyCrust.png
|
||||
##install -p -m 644 $WXDIR/wxPython/wxPython/tools/XRCed/XRCed_32.png $RPM_BUILD_ROOT%{_iconsdir}/XRCed.png
|
||||
##install -p -m 644 $WXDIR/wxPython/wxPython/tools/XRCed/XRCed_16.png $RPM_BUILD_ROOT%{_miconsdir}/XRCed.png
|
||||
##
|
||||
##cat > $RPM_BUILD_ROOT/%{_menudir}/%{name} <<EOF
|
||||
##cat > $RPM_BUILD_ROOT%{_menudir}/%{name} <<EOF
|
||||
##?package(%{name}): command="%_bindir/pyshell" needs="X11" \
|
||||
##icon="PyCrust.png" section="Applications/Development" \
|
||||
##title="PyShell" longtitle="Python Shell"
|
||||
@@ -253,6 +258,7 @@ $GFL $RPM_BUILD_ROOT %{pref}/lib >> FILELIST
|
||||
$GFL -r $RPM_BUILD_ROOT %{pref}/lib/python%{pyver} >> FILELIST
|
||||
$GFL -r $RPM_BUILD_ROOT %{pref}/share >> FILELIST
|
||||
$GFL $RPM_BUILD_ROOT %{wxpref} >> FILELIST
|
||||
$GFL $RPM_BUILD_ROOT %{wxprefbase} >> FILELIST
|
||||
$GFL $RPM_BUILD_ROOT %{wxpref}/lib >> FILELIST
|
||||
$GFL $RPM_BUILD_ROOT "%{wxpref}/lib/libwx*" >> FILELIST
|
||||
$GFL -r $RPM_BUILD_ROOT %{wxpref}/share >> FILELIST
|
||||
@@ -274,11 +280,10 @@ $GFL $RPM_BUILD_ROOT %{wxpref}/bin/wx-config >> DEVELLIST
|
||||
##%{clean_menus}
|
||||
|
||||
|
||||
%post
|
||||
%pre
|
||||
if [ -e %{wxprefbase} ]; then
|
||||
rm %{wxprefbase}
|
||||
rm -r %{wxprefbase}
|
||||
fi
|
||||
ln -s %{wxpref} %{wxprefbase}
|
||||
|
||||
%postun
|
||||
if [ -e %{wxprefbase} ]; then
|
||||
|
@@ -21,9 +21,6 @@ import os, sys, glob
|
||||
wxmodule_template = """
|
||||
\"\"\"Renamer stub: provides a way to drop the wx prefix from wxPython objects.\"\"\"
|
||||
|
||||
__cvsid__ = \"\x24Id: \x24\"
|
||||
__revision__ = \"\x24Revision: \x24\"[11:-2]
|
||||
|
||||
from wx import _rename
|
||||
from wxPython%(prefix)s import %(suffix)s
|
||||
_rename(globals(), %(suffix)s.__dict__, modulename='%(name)s')
|
||||
@@ -31,6 +28,11 @@ del %(suffix)s
|
||||
del _rename
|
||||
"""
|
||||
|
||||
call_main = """
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
"""
|
||||
|
||||
wxPython_dir = "../wxPython"
|
||||
|
||||
subpackage_list = ['.',
|
||||
@@ -50,6 +52,9 @@ skip_modules = [ '__init__', '__version__',
|
||||
]
|
||||
|
||||
|
||||
add_call_main = ['py/PyAlaCarte.py', 'py/PyAlaMode.py', 'py/PyCrust.py',
|
||||
'py/PyFilling.py', 'py/PyShell.py', 'py/PyWrap.py'
|
||||
]
|
||||
|
||||
|
||||
|
||||
@@ -104,6 +109,8 @@ for subdir in subpackage_list:
|
||||
content = wxmodule_template % globals()
|
||||
f = open(fname, 'w')
|
||||
f.write(content)
|
||||
if fname in add_call_main:
|
||||
f.write(call_main)
|
||||
f.close()
|
||||
print fname + ' created'
|
||||
|
||||
|
@@ -84,7 +84,7 @@ void MyApp::Init_wxPython()
|
||||
wxPyCoreAPI_IMPORT();
|
||||
|
||||
// Ensure that the new classes defined in the wxPython wrappers are
|
||||
// recognised by the wx RTTI system. (If you don't use wxWindow in
|
||||
// recognised by the wx RTTI system. (If you don't use wxWindows in
|
||||
// your C++ app you won't need to do this.)
|
||||
wxClassInfo::CleanUpClasses();
|
||||
wxClassInfo::InitializeClasses();
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env python
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
import sys, os, glob, fnmatch
|
||||
import sys, os, glob, fnmatch, commands
|
||||
from distutils.core import setup, Extension
|
||||
from distutils.file_util import copy_file
|
||||
from distutils.dir_util import mkpath
|
||||
@@ -479,6 +479,8 @@ elif os.name == 'posix':
|
||||
if debug:
|
||||
cflags.append('-g')
|
||||
cflags.append('-O0')
|
||||
else:
|
||||
cflags.append('-O3')
|
||||
|
||||
lflags = os.popen(WX_CONFIG + ' --libs', 'r').read()[:-1]
|
||||
lflags = lflags.split()
|
||||
@@ -517,11 +519,12 @@ elif os.name == 'posix':
|
||||
|
||||
cflags += portcfg.split()
|
||||
|
||||
# Some distros (e.g. Mandrake) put libGLU in /usr/X11R6/lib, but
|
||||
# wx-config doesn't output that for some reason. For now, just
|
||||
# add it unconditionally but we should really check if the lib is
|
||||
# really found there or wx-config should be fixed.
|
||||
libdirs.append("/usr/X11R6/lib")
|
||||
# If you get unresolved symbol errors on Solaris and are using gcc, then
|
||||
# uncomment this block to add the right flags to the link step and build
|
||||
# again.
|
||||
## if os.uname()[0] == 'SunOS':
|
||||
## libs.append('gcc')
|
||||
## libdirs.append(commands.getoutput("gcc -print-search-dirs | grep '^install' | awk '{print $2}'")[:-1])
|
||||
|
||||
|
||||
# Move the various -I, -D, etc. flags we got from the *config scripts
|
||||
|
@@ -2415,6 +2415,7 @@ SWIGEXPORT(void) initwxc() {
|
||||
PyDict_SetItemString(d,"wxMENU_TEAROFF", PyInt_FromLong((long) wxMENU_TEAROFF));
|
||||
PyDict_SetItemString(d,"wxMB_DOCKABLE", PyInt_FromLong((long) wxMB_DOCKABLE));
|
||||
PyDict_SetItemString(d,"wxNO_FULL_REPAINT_ON_RESIZE", PyInt_FromLong((long) wxNO_FULL_REPAINT_ON_RESIZE));
|
||||
PyDict_SetItemString(d,"wxFULL_REPAINT_ON_RESIZE", PyInt_FromLong((long) wxFULL_REPAINT_ON_RESIZE));
|
||||
PyDict_SetItemString(d,"wxLEFT", PyInt_FromLong((long) wxLEFT));
|
||||
PyDict_SetItemString(d,"wxRIGHT", PyInt_FromLong((long) wxRIGHT));
|
||||
PyDict_SetItemString(d,"wxUP", PyInt_FromLong((long) wxUP));
|
||||
|
@@ -438,6 +438,7 @@ wxDD_DEFAULT_STYLE = wxc.wxDD_DEFAULT_STYLE
|
||||
wxMENU_TEAROFF = wxc.wxMENU_TEAROFF
|
||||
wxMB_DOCKABLE = wxc.wxMB_DOCKABLE
|
||||
wxNO_FULL_REPAINT_ON_RESIZE = wxc.wxNO_FULL_REPAINT_ON_RESIZE
|
||||
wxFULL_REPAINT_ON_RESIZE = wxc.wxFULL_REPAINT_ON_RESIZE
|
||||
wxLEFT = wxc.wxLEFT
|
||||
wxRIGHT = wxc.wxRIGHT
|
||||
wxUP = wxc.wxUP
|
||||
@@ -1901,8 +1902,11 @@ of your Mac."""
|
||||
# KeyboardInterrupt???) but will later segfault on exit. By
|
||||
# setting the default handler then the app will exit, as
|
||||
# expected (depending on platform.)
|
||||
try:
|
||||
import signal
|
||||
signal.signal(signal.SIGINT, signal.SIG_DFL)
|
||||
except:
|
||||
pass
|
||||
|
||||
# this initializes wxWindows and then calls our OnInit
|
||||
_wxStart(self.OnInit)
|
||||
|
@@ -16,6 +16,10 @@
|
||||
#include <wx/wx.h>
|
||||
#include <wx/geometry.h>
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
#ifdef __WXMAC__ // avoid a bug in Carbon headers
|
||||
#define scalb scalbn
|
||||
#endif
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
typedef unsigned char byte;
|
||||
|
@@ -1,9 +1,6 @@
|
||||
|
||||
"""Renamer stub: provides a way to drop the wx prefix from wxPython objects."""
|
||||
|
||||
__cvsid__ = "$Id$"
|
||||
__revision__ = "$Revision$"[11:-2]
|
||||
|
||||
from wx import _rename
|
||||
from wxPython import calendar
|
||||
_rename(globals(), calendar.__dict__, modulename='calendar')
|
||||
|
@@ -1,9 +1,6 @@
|
||||
|
||||
"""Renamer stub: provides a way to drop the wx prefix from wxPython objects."""
|
||||
|
||||
__cvsid__ = "$Id$"
|
||||
__revision__ = "$Revision$"[11:-2]
|
||||
|
||||
from wx import _rename
|
||||
from wxPython import dllwidget
|
||||
_rename(globals(), dllwidget.__dict__, modulename='dllwidget')
|
||||
|
@@ -1,9 +1,6 @@
|
||||
|
||||
"""Renamer stub: provides a way to drop the wx prefix from wxPython objects."""
|
||||
|
||||
__cvsid__ = "$Id$"
|
||||
__revision__ = "$Revision$"[11:-2]
|
||||
|
||||
from wx import _rename
|
||||
from wxPython import gizmos
|
||||
_rename(globals(), gizmos.__dict__, modulename='gizmos')
|
||||
|
@@ -1,9 +1,6 @@
|
||||
|
||||
"""Renamer stub: provides a way to drop the wx prefix from wxPython objects."""
|
||||
|
||||
__cvsid__ = "$Id$"
|
||||
__revision__ = "$Revision$"[11:-2]
|
||||
|
||||
from wx import _rename
|
||||
from wxPython import glcanvas
|
||||
_rename(globals(), glcanvas.__dict__, modulename='glcanvas')
|
||||
|
@@ -1,9 +1,6 @@
|
||||
|
||||
"""Renamer stub: provides a way to drop the wx prefix from wxPython objects."""
|
||||
|
||||
__cvsid__ = "$Id$"
|
||||
__revision__ = "$Revision$"[11:-2]
|
||||
|
||||
from wx import _rename
|
||||
from wxPython import grid
|
||||
_rename(globals(), grid.__dict__, modulename='grid')
|
||||
|
@@ -1,9 +1,6 @@
|
||||
|
||||
"""Renamer stub: provides a way to drop the wx prefix from wxPython objects."""
|
||||
|
||||
__cvsid__ = "$Id$"
|
||||
__revision__ = "$Revision$"[11:-2]
|
||||
|
||||
from wx import _rename
|
||||
from wxPython import help
|
||||
_rename(globals(), help.__dict__, modulename='help')
|
||||
|
@@ -1,9 +1,6 @@
|
||||
|
||||
"""Renamer stub: provides a way to drop the wx prefix from wxPython objects."""
|
||||
|
||||
__cvsid__ = "$Id$"
|
||||
__revision__ = "$Revision$"[11:-2]
|
||||
|
||||
from wx import _rename
|
||||
from wxPython import html
|
||||
_rename(globals(), html.__dict__, modulename='html')
|
||||
|
@@ -1,9 +1,6 @@
|
||||
|
||||
"""Renamer stub: provides a way to drop the wx prefix from wxPython objects."""
|
||||
|
||||
__cvsid__ = "$Id$"
|
||||
__revision__ = "$Revision$"[11:-2]
|
||||
|
||||
from wx import _rename
|
||||
from wxPython.lib import CDate
|
||||
_rename(globals(), CDate.__dict__, modulename='lib.CDate')
|
||||
|
@@ -1,9 +1,6 @@
|
||||
|
||||
"""Renamer stub: provides a way to drop the wx prefix from wxPython objects."""
|
||||
|
||||
__cvsid__ = "$Id$"
|
||||
__revision__ = "$Revision$"[11:-2]
|
||||
|
||||
from wx import _rename
|
||||
from wxPython.lib import ClickableHtmlWindow
|
||||
_rename(globals(), ClickableHtmlWindow.__dict__, modulename='lib.ClickableHtmlWindow')
|
||||
|
@@ -1,9 +1,6 @@
|
||||
|
||||
"""Renamer stub: provides a way to drop the wx prefix from wxPython objects."""
|
||||
|
||||
__cvsid__ = "$Id$"
|
||||
__revision__ = "$Revision$"[11:-2]
|
||||
|
||||
from wx import _rename
|
||||
from wxPython.lib import ErrorDialogs
|
||||
_rename(globals(), ErrorDialogs.__dict__, modulename='lib.ErrorDialogs')
|
||||
|
@@ -1,9 +1,6 @@
|
||||
|
||||
"""Renamer stub: provides a way to drop the wx prefix from wxPython objects."""
|
||||
|
||||
__cvsid__ = "$Id$"
|
||||
__revision__ = "$Revision$"[11:-2]
|
||||
|
||||
from wx import _rename
|
||||
from wxPython.lib import ErrorDialogs_wdr
|
||||
_rename(globals(), ErrorDialogs_wdr.__dict__, modulename='lib.ErrorDialogs_wdr')
|
||||
|
@@ -1,9 +1,6 @@
|
||||
|
||||
"""Renamer stub: provides a way to drop the wx prefix from wxPython objects."""
|
||||
|
||||
__cvsid__ = "$Id$"
|
||||
__revision__ = "$Revision$"[11:-2]
|
||||
|
||||
from wx import _rename
|
||||
from wxPython.lib import PythonBitmaps
|
||||
_rename(globals(), PythonBitmaps.__dict__, modulename='lib.PythonBitmaps')
|
||||
|
@@ -1,9 +1,6 @@
|
||||
|
||||
"""Renamer stub: provides a way to drop the wx prefix from wxPython objects."""
|
||||
|
||||
__cvsid__ = "$Id$"
|
||||
__revision__ = "$Revision$"[11:-2]
|
||||
|
||||
from wx import _rename
|
||||
from wxPython.lib import activexwrapper
|
||||
_rename(globals(), activexwrapper.__dict__, modulename='lib.activexwrapper')
|
||||
|
@@ -1,9 +1,6 @@
|
||||
|
||||
"""Renamer stub: provides a way to drop the wx prefix from wxPython objects."""
|
||||
|
||||
__cvsid__ = "$Id$"
|
||||
__revision__ = "$Revision$"[11:-2]
|
||||
|
||||
from wx import _rename
|
||||
from wxPython.lib import analogclock
|
||||
_rename(globals(), analogclock.__dict__, modulename='lib.analogclock')
|
||||
|
@@ -1,9 +1,6 @@
|
||||
|
||||
"""Renamer stub: provides a way to drop the wx prefix from wxPython objects."""
|
||||
|
||||
__cvsid__ = "$Id$"
|
||||
__revision__ = "$Revision$"[11:-2]
|
||||
|
||||
from wx import _rename
|
||||
from wxPython.lib import anchors
|
||||
_rename(globals(), anchors.__dict__, modulename='lib.anchors')
|
||||
|
@@ -1,9 +1,6 @@
|
||||
|
||||
"""Renamer stub: provides a way to drop the wx prefix from wxPython objects."""
|
||||
|
||||
__cvsid__ = "$Id$"
|
||||
__revision__ = "$Revision$"[11:-2]
|
||||
|
||||
from wx import _rename
|
||||
from wxPython.lib import buttons
|
||||
_rename(globals(), buttons.__dict__, modulename='lib.buttons')
|
||||
|
@@ -1,9 +1,6 @@
|
||||
|
||||
"""Renamer stub: provides a way to drop the wx prefix from wxPython objects."""
|
||||
|
||||
__cvsid__ = "$Id$"
|
||||
__revision__ = "$Revision$"[11:-2]
|
||||
|
||||
from wx import _rename
|
||||
from wxPython.lib import calendar
|
||||
_rename(globals(), calendar.__dict__, modulename='lib.calendar')
|
||||
|
@@ -1,9 +1,6 @@
|
||||
|
||||
"""Renamer stub: provides a way to drop the wx prefix from wxPython objects."""
|
||||
|
||||
__cvsid__ = "$Id$"
|
||||
__revision__ = "$Revision$"[11:-2]
|
||||
|
||||
from wx import _rename
|
||||
from wxPython.lib.colourchooser import canvas
|
||||
_rename(globals(), canvas.__dict__, modulename='lib.colourchooser.canvas')
|
||||
|
@@ -1,9 +1,6 @@
|
||||
|
||||
"""Renamer stub: provides a way to drop the wx prefix from wxPython objects."""
|
||||
|
||||
__cvsid__ = "$Id$"
|
||||
__revision__ = "$Revision$"[11:-2]
|
||||
|
||||
from wx import _rename
|
||||
from wxPython.lib.colourchooser import intl
|
||||
_rename(globals(), intl.__dict__, modulename='lib.colourchooser.intl')
|
||||
|
@@ -1,9 +1,6 @@
|
||||
|
||||
"""Renamer stub: provides a way to drop the wx prefix from wxPython objects."""
|
||||
|
||||
__cvsid__ = "$Id$"
|
||||
__revision__ = "$Revision$"[11:-2]
|
||||
|
||||
from wx import _rename
|
||||
from wxPython.lib.colourchooser import pycolourbox
|
||||
_rename(globals(), pycolourbox.__dict__, modulename='lib.colourchooser.pycolourbox')
|
||||
|
@@ -1,9 +1,6 @@
|
||||
|
||||
"""Renamer stub: provides a way to drop the wx prefix from wxPython objects."""
|
||||
|
||||
__cvsid__ = "$Id$"
|
||||
__revision__ = "$Revision$"[11:-2]
|
||||
|
||||
from wx import _rename
|
||||
from wxPython.lib.colourchooser import pycolourchooser
|
||||
_rename(globals(), pycolourchooser.__dict__, modulename='lib.colourchooser.pycolourchooser')
|
||||
|
@@ -1,9 +1,6 @@
|
||||
|
||||
"""Renamer stub: provides a way to drop the wx prefix from wxPython objects."""
|
||||
|
||||
__cvsid__ = "$Id$"
|
||||
__revision__ = "$Revision$"[11:-2]
|
||||
|
||||
from wx import _rename
|
||||
from wxPython.lib.colourchooser import pycolourslider
|
||||
_rename(globals(), pycolourslider.__dict__, modulename='lib.colourchooser.pycolourslider')
|
||||
|
@@ -1,9 +1,6 @@
|
||||
|
||||
"""Renamer stub: provides a way to drop the wx prefix from wxPython objects."""
|
||||
|
||||
__cvsid__ = "$Id$"
|
||||
__revision__ = "$Revision$"[11:-2]
|
||||
|
||||
from wx import _rename
|
||||
from wxPython.lib.colourchooser import pypalette
|
||||
_rename(globals(), pypalette.__dict__, modulename='lib.colourchooser.pypalette')
|
||||
|
@@ -1,9 +1,6 @@
|
||||
|
||||
"""Renamer stub: provides a way to drop the wx prefix from wxPython objects."""
|
||||
|
||||
__cvsid__ = "$Id$"
|
||||
__revision__ = "$Revision$"[11:-2]
|
||||
|
||||
from wx import _rename
|
||||
from wxPython.lib import colourdb
|
||||
_rename(globals(), colourdb.__dict__, modulename='lib.colourdb')
|
||||
|
@@ -1,9 +1,6 @@
|
||||
|
||||
"""Renamer stub: provides a way to drop the wx prefix from wxPython objects."""
|
||||
|
||||
__cvsid__ = "$Id$"
|
||||
__revision__ = "$Revision$"[11:-2]
|
||||
|
||||
from wx import _rename
|
||||
from wxPython.lib import colourselect
|
||||
_rename(globals(), colourselect.__dict__, modulename='lib.colourselect')
|
||||
|
@@ -1,9 +1,6 @@
|
||||
|
||||
"""Renamer stub: provides a way to drop the wx prefix from wxPython objects."""
|
||||
|
||||
__cvsid__ = "$Id$"
|
||||
__revision__ = "$Revision$"[11:-2]
|
||||
|
||||
from wx import _rename
|
||||
from wxPython.lib import dialogs
|
||||
_rename(globals(), dialogs.__dict__, modulename='lib.dialogs')
|
||||
|
@@ -1,9 +1,6 @@
|
||||
|
||||
"""Renamer stub: provides a way to drop the wx prefix from wxPython objects."""
|
||||
|
||||
__cvsid__ = "$Id$"
|
||||
__revision__ = "$Revision$"[11:-2]
|
||||
|
||||
from wx import _rename
|
||||
from wxPython.lib.editor import editor
|
||||
_rename(globals(), editor.__dict__, modulename='lib.editor.editor')
|
||||
|
@@ -1,9 +1,6 @@
|
||||
|
||||
"""Renamer stub: provides a way to drop the wx prefix from wxPython objects."""
|
||||
|
||||
__cvsid__ = "$Id$"
|
||||
__revision__ = "$Revision$"[11:-2]
|
||||
|
||||
from wx import _rename
|
||||
from wxPython.lib.editor import images
|
||||
_rename(globals(), images.__dict__, modulename='lib.editor.images')
|
||||
|
@@ -1,9 +1,6 @@
|
||||
|
||||
"""Renamer stub: provides a way to drop the wx prefix from wxPython objects."""
|
||||
|
||||
__cvsid__ = "$Id$"
|
||||
__revision__ = "$Revision$"[11:-2]
|
||||
|
||||
from wx import _rename
|
||||
from wxPython.lib.editor import selection
|
||||
_rename(globals(), selection.__dict__, modulename='lib.editor.selection')
|
||||
|
@@ -1,9 +1,6 @@
|
||||
|
||||
"""Renamer stub: provides a way to drop the wx prefix from wxPython objects."""
|
||||
|
||||
__cvsid__ = "$Id$"
|
||||
__revision__ = "$Revision$"[11:-2]
|
||||
|
||||
from wx import _rename
|
||||
from wxPython.lib import evtmgr
|
||||
_rename(globals(), evtmgr.__dict__, modulename='lib.evtmgr')
|
||||
|
@@ -1,9 +1,6 @@
|
||||
|
||||
"""Renamer stub: provides a way to drop the wx prefix from wxPython objects."""
|
||||
|
||||
__cvsid__ = "$Id$"
|
||||
__revision__ = "$Revision$"[11:-2]
|
||||
|
||||
from wx import _rename
|
||||
from wxPython.lib import fancytext
|
||||
_rename(globals(), fancytext.__dict__, modulename='lib.fancytext')
|
||||
|
@@ -1,9 +1,6 @@
|
||||
|
||||
"""Renamer stub: provides a way to drop the wx prefix from wxPython objects."""
|
||||
|
||||
__cvsid__ = "$Id$"
|
||||
__revision__ = "$Revision$"[11:-2]
|
||||
|
||||
from wx import _rename
|
||||
from wxPython.lib import filebrowsebutton
|
||||
_rename(globals(), filebrowsebutton.__dict__, modulename='lib.filebrowsebutton')
|
||||
|
@@ -1,9 +1,6 @@
|
||||
|
||||
"""Renamer stub: provides a way to drop the wx prefix from wxPython objects."""
|
||||
|
||||
__cvsid__ = "$Id$"
|
||||
__revision__ = "$Revision$"[11:-2]
|
||||
|
||||
from wx import _rename
|
||||
from wxPython.lib import floatbar
|
||||
_rename(globals(), floatbar.__dict__, modulename='lib.floatbar')
|
||||
|
8
wxPython/wx/lib/floatcanvas.py
Normal file
8
wxPython/wx/lib/floatcanvas.py
Normal file
@@ -0,0 +1,8 @@
|
||||
|
||||
"""Renamer stub: provides a way to drop the wx prefix from wxPython objects."""
|
||||
|
||||
from wx import _rename
|
||||
from wxPython.lib import floatcanvas
|
||||
_rename(globals(), floatcanvas.__dict__, modulename='lib.floatcanvas')
|
||||
del floatcanvas
|
||||
del _rename
|
@@ -1,9 +1,6 @@
|
||||
|
||||
"""Renamer stub: provides a way to drop the wx prefix from wxPython objects."""
|
||||
|
||||
__cvsid__ = "$Id$"
|
||||
__revision__ = "$Revision$"[11:-2]
|
||||
|
||||
from wx import _rename
|
||||
from wxPython.lib import gridmovers
|
||||
_rename(globals(), gridmovers.__dict__, modulename='lib.gridmovers')
|
||||
|
@@ -1,9 +1,6 @@
|
||||
|
||||
"""Renamer stub: provides a way to drop the wx prefix from wxPython objects."""
|
||||
|
||||
__cvsid__ = "$Id$"
|
||||
__revision__ = "$Revision$"[11:-2]
|
||||
|
||||
from wx import _rename
|
||||
from wxPython.lib import grids
|
||||
_rename(globals(), grids.__dict__, modulename='lib.grids')
|
||||
|
@@ -1,9 +1,6 @@
|
||||
|
||||
"""Renamer stub: provides a way to drop the wx prefix from wxPython objects."""
|
||||
|
||||
__cvsid__ = "$Id$"
|
||||
__revision__ = "$Revision$"[11:-2]
|
||||
|
||||
from wx import _rename
|
||||
from wxPython.lib import imagebrowser
|
||||
_rename(globals(), imagebrowser.__dict__, modulename='lib.imagebrowser')
|
||||
|
@@ -1,9 +1,6 @@
|
||||
|
||||
"""Renamer stub: provides a way to drop the wx prefix from wxPython objects."""
|
||||
|
||||
__cvsid__ = "$Id$"
|
||||
__revision__ = "$Revision$"[11:-2]
|
||||
|
||||
from wx import _rename
|
||||
from wxPython.lib import imageutils
|
||||
_rename(globals(), imageutils.__dict__, modulename='lib.imageutils')
|
||||
|
@@ -1,9 +1,6 @@
|
||||
|
||||
"""Renamer stub: provides a way to drop the wx prefix from wxPython objects."""
|
||||
|
||||
__cvsid__ = "$Id$"
|
||||
__revision__ = "$Revision$"[11:-2]
|
||||
|
||||
from wx import _rename
|
||||
from wxPython.lib import infoframe
|
||||
_rename(globals(), infoframe.__dict__, modulename='lib.infoframe')
|
||||
|
@@ -1,9 +1,6 @@
|
||||
|
||||
"""Renamer stub: provides a way to drop the wx prefix from wxPython objects."""
|
||||
|
||||
__cvsid__ = "$Id$"
|
||||
__revision__ = "$Revision$"[11:-2]
|
||||
|
||||
from wx import _rename
|
||||
from wxPython.lib import intctrl
|
||||
_rename(globals(), intctrl.__dict__, modulename='lib.intctrl')
|
||||
|
@@ -1,9 +1,6 @@
|
||||
|
||||
"""Renamer stub: provides a way to drop the wx prefix from wxPython objects."""
|
||||
|
||||
__cvsid__ = "$Id$"
|
||||
__revision__ = "$Revision$"[11:-2]
|
||||
|
||||
from wx import _rename
|
||||
from wxPython.lib import layoutf
|
||||
_rename(globals(), layoutf.__dict__, modulename='lib.layoutf')
|
||||
|
8
wxPython/wx/lib/maskedctrl.py
Normal file
8
wxPython/wx/lib/maskedctrl.py
Normal file
@@ -0,0 +1,8 @@
|
||||
|
||||
"""Renamer stub: provides a way to drop the wx prefix from wxPython objects."""
|
||||
|
||||
from wx import _rename
|
||||
from wxPython.lib import maskedctrl
|
||||
_rename(globals(), maskedctrl.__dict__, modulename='lib.maskedctrl')
|
||||
del maskedctrl
|
||||
del _rename
|
@@ -1,9 +1,6 @@
|
||||
|
||||
"""Renamer stub: provides a way to drop the wx prefix from wxPython objects."""
|
||||
|
||||
__cvsid__ = "$Id$"
|
||||
__revision__ = "$Revision$"[11:-2]
|
||||
|
||||
from wx import _rename
|
||||
from wxPython.lib import maskededit
|
||||
_rename(globals(), maskededit.__dict__, modulename='lib.maskededit')
|
||||
|
8
wxPython/wx/lib/maskednumctrl.py
Normal file
8
wxPython/wx/lib/maskednumctrl.py
Normal file
@@ -0,0 +1,8 @@
|
||||
|
||||
"""Renamer stub: provides a way to drop the wx prefix from wxPython objects."""
|
||||
|
||||
from wx import _rename
|
||||
from wxPython.lib import maskednumctrl
|
||||
_rename(globals(), maskednumctrl.__dict__, modulename='lib.maskednumctrl')
|
||||
del maskednumctrl
|
||||
del _rename
|
@@ -1,9 +1,6 @@
|
||||
|
||||
"""Renamer stub: provides a way to drop the wx prefix from wxPython objects."""
|
||||
|
||||
__cvsid__ = "$Id$"
|
||||
__revision__ = "$Revision$"[11:-2]
|
||||
|
||||
from wx import _rename
|
||||
from wxPython.lib.mixins import grid
|
||||
_rename(globals(), grid.__dict__, modulename='lib.mixins.grid')
|
||||
|
@@ -1,9 +1,6 @@
|
||||
|
||||
"""Renamer stub: provides a way to drop the wx prefix from wxPython objects."""
|
||||
|
||||
__cvsid__ = "$Id$"
|
||||
__revision__ = "$Revision$"[11:-2]
|
||||
|
||||
from wx import _rename
|
||||
from wxPython.lib.mixins import imagelist
|
||||
_rename(globals(), imagelist.__dict__, modulename='lib.mixins.imagelist')
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user