Some Python 2.0 related fixes

Some little fixes and tweaks here and there
Some distrib stuff


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@8643 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2000-10-26 07:53:33 +00:00
parent 898e82a8c7
commit e852f9033e
23 changed files with 136 additions and 86 deletions

View File

@@ -42,6 +42,12 @@ Changed the build to make one big extension module instead of one for
the core and each contrib. This allowed me to do away with the
libwxPyHelpers.so on unix systems.
Lots of little fixes here and there.
Some hacks on wxGTK to try and make the AutoComplete listbox in the
wxStyledTextCtrl to behave better. It's still not as nice as on
wxMSW, but at least it's a bit more usable now.

View File

@@ -13,8 +13,9 @@ class MyAboutBox(wxDialog):
<center><table bgcolor="#458154" width="100%%" cellspacing="0"
cellpadding="0" border="1">
<tr>
<td align="center"><h1>wxPython %s</h1>
Running on Python %s
<td align="center">
<h1>wxPython %s</h1>
Running on Python %s<br>
</td>
</tr>
</table>

View File

@@ -1,9 +1,16 @@
import string
import string, sys
py2 = sys.version[0] == '2'
from wxPython.wx import *
try:
from xml.parsers import pyexpat
if py2:
from xml.parsers import expat
parsermodule = expat
else:
from xml.parsers import pyexpat
parsermodule = pyexpat
haveXML = true
except ImportError:
haveXML = false
@@ -12,7 +19,8 @@ except ImportError:
if not haveXML:
def runTest(frame, nb, log):
dlg = wxMessageDialog(frame, 'This demo requires the XML package. See http://www.python.org/sigs/xml-sig/',
dlg = wxMessageDialog(frame, 'This demo requires the XML package. '
'See http://www.python.org/sigs/xml-sig/',
'Sorry', wxOK | wxICON_INFORMATION)
dlg.ShowModal()
dlg.Destroy()
@@ -26,6 +34,8 @@ else:
# Define a handler for start element events
def StartElement(self, name, attrs ):
if py2:
name = name.encode()
id = self.AppendItem(self.nodeStack[-1], name)
self.nodeStack.append(id)
@@ -34,12 +44,14 @@ else:
def CharacterData(self, data ):
if string.strip(data):
if py2:
data = data.encode()
self.AppendItem(self.nodeStack[-1], data)
def LoadTree(self, filename):
# Create a parser
Parser = pyexpat.ParserCreate()
Parser = parsermodule.ParserCreate()
# Tell the parser what the start element handler is
Parser.StartElementHandler = self.StartElement

View File

@@ -81,6 +81,9 @@ class MyCanvas(wxScrolledWindow):
dc.DrawRectangle(50,500,50,50)
dc.DrawRectangle(100,500,50,50)
dc.SetPen(pen1)
dc.DrawEllipticArc(200, 500, 50, 75, 0, 90)
#from wxPython import dch
#dch.FillRect(dc, wxRect(50, 400, 50, 50), wxBLACK)

Binary file not shown.

View File

@@ -81,6 +81,10 @@ item: Set Variable
Variable=PYTHONVER
Value=1.5
end
item: Set Variable
Variable=SAMEDIR
Value=1
end
item: Remark
end
item: Get Registry Key Value
@@ -813,11 +817,24 @@ item: Install File
Destination=%SYS%\Msvcrt.dll
Flags=0000001010000011
end
item: If/While Statement
Variable=SAMEDIR
Value=0
end
item: Install File
Source=c:\projects\wx\lib\wx22_2.dll
Destination=%SYS%\wx22_2.dll
Flags=0000001010010010
end
item: Else Statement
end
item: Install File
Source=c:\projects\wx\lib\wx22_2.dll
Destination=%MAINDIR%\wxPython\wx22_2.dll
Flags=0000000010010010
end
item: End Block
end
item: Install File
Source=c:\Projects\wx\wxPython\wxPython\*.py
Destination=%MAINDIR%\wxPython
@@ -1332,7 +1349,7 @@ item: Custom Dialog Set
end
item: Push Button
Rectangle=90 68 153 82
Alternate=0%MAINDIR%\wxPython\README.txt
Alternate=0%MAINDIR%\wxPython\docs\README.txt
Action=6
Enabled Color=00000000000000001111111111111111
Create Flags=01010000000000010000000000000000

View File

@@ -4,24 +4,25 @@ rem **** Make a directory to build up a distribution tree
md _distrib_zip
md _distrib_zip\wxPython-%1
rem **** Copy the license files
copy %WXWIN%\docs\gpl.txt _distrib_zip\wxPython-%1
copy %WXWIN%\docs\lgpl.txt _distrib_zip\wxPython-%1
copy %WXWIN%\docs\licence.txt _distrib_zip\wxPython-%1
copy %WXWIN%\docs\licendoc.txt _distrib_zip\wxPython-%1
copy %WXWIN%\docs\preamble.txt _distrib_zip\wxPython-%1
REM rem **** Copy the license files
REM copy %WXWIN%\docs\gpl.txt _distrib_zip\wxPython-%1
REM copy %WXWIN%\docs\lgpl.txt _distrib_zip\wxPython-%1
REM copy %WXWIN%\docs\licence.txt _distrib_zip\wxPython-%1
REM copy %WXWIN%\docs\licendoc.txt _distrib_zip\wxPython-%1
REM copy %WXWIN%\docs\preamble.txt _distrib_zip\wxPython-%1
rem **** Make a zip fron the live files
zip -@ -r _distrib_zip\temp.zip < distrib\wxPython.rsp
REM rem **** Make a zip fron the live files
REM zip -@ -r _distrib_zip\temp.zip < distrib\wxPython.rsp
rem **** Unzip it in our build dir
cd _distrib_zip\wxPython-%1
unzip ..\temp.zip
REM rem **** Unzip it in our build dir
REM cd _distrib_zip\wxPython-%1
REM unzip ..\temp.zip
rem **** zip up the build dir
cd ..
zip -r ..\distrib\wxPython-src-%1.zip wxPython-%1
REM rem **** zip up the build dir
REM cd ..
REM zip -r ..\distrib\wxPython-src-%1.zip wxPython-%1
cd _distrib_zip
rem **** copy the docs into the tree
md wxPython-%1\docs

View File

@@ -669,7 +669,7 @@ public:
}
wxGridCellEditor *Clone() const {
wxGridCellEditor*Clone() const {
wxGridCellEditor* rval = NULL;
bool doSave = wxPyRestoreThread();
if (m_myInst.findCallback("Clone")) {
@@ -796,23 +796,6 @@ public:
wxGridCellChoiceEditor(int LCOUNT = 0,
const wxString* choices = NULL,
bool allowOthers = FALSE);
#ifdef PRE2115
%addmethods {
wxGridCellChoiceEditor(PyObject* choices,
bool allowOthers = FALSE) {
const char** temp = string_LIST_helper(choices);
if (temp) {
int count = PyList_Size(choices);
wxGridCellChoiceEditor* ret;
ret = new wxGridCellChoiceEditor(count, temp, allowOthers);
delete [] temp;
return ret;
}
return NULL;
}
}
#endif
};
//---------------------------------------------------------------------------

View File

@@ -595,7 +595,7 @@ public:
}
wxGridCellEditor *Clone() const {
wxGridCellEditor*Clone() const {
wxGridCellEditor* rval = NULL;
bool doSave = wxPyRestoreThread();
if (m_myInst.findCallback("Clone")) {

View File

@@ -574,23 +574,6 @@ static PyObject *_wrap_wxYield(PyObject *self, PyObject *args, PyObject *kwargs)
return _resultobj;
}
static PyObject *_wrap_wxSafeYield(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
bool _result;
char *_kwnames[] = { NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,":wxSafeYield",_kwnames))
return NULL;
{
wxPy_BEGIN_ALLOW_THREADS;
_result = (bool )wxSafeYield();
wxPy_END_ALLOW_THREADS;
} _resultobj = Py_BuildValue("i",_result);
return _resultobj;
}
static PyObject *_wrap_wxEnableTopLevelWindows(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
bool _arg0;
@@ -4923,7 +4906,6 @@ static PyMethodDef misccMethods[] = {
{ "wxStripMenuCodes", (PyCFunction) _wrap_wxStripMenuCodes, METH_VARARGS | METH_KEYWORDS },
{ "wxGetResource", (PyCFunction) _wrap_wxGetResource, METH_VARARGS | METH_KEYWORDS },
{ "wxEnableTopLevelWindows", (PyCFunction) _wrap_wxEnableTopLevelWindows, METH_VARARGS | METH_KEYWORDS },
{ "wxSafeYield", (PyCFunction) _wrap_wxSafeYield, METH_VARARGS | METH_KEYWORDS },
{ "wxYield", (PyCFunction) _wrap_wxYield, METH_VARARGS | METH_KEYWORDS },
{ "wxUsleep", (PyCFunction) _wrap_wxUsleep, METH_VARARGS | METH_KEYWORDS },
{ "wxSleep", (PyCFunction) _wrap_wxSleep, METH_VARARGS | METH_KEYWORDS },

View File

@@ -649,8 +649,6 @@ wxUsleep = miscc.wxUsleep
wxYield = miscc.wxYield
wxSafeYield = miscc.wxSafeYield
wxEnableTopLevelWindows = miscc.wxEnableTopLevelWindows
wxGetResource = miscc.wxGetResource

View File

@@ -1207,6 +1207,32 @@ static PyObject *_wrap_wxWakeUpIdle(PyObject *self, PyObject *args, PyObject *kw
return _resultobj;
}
static PyObject *_wrap_wxSafeYield(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
bool _result;
wxWindow * _arg0 = (wxWindow *) NULL;
PyObject * _argo0 = 0;
char *_kwnames[] = { "win", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"|O:wxSafeYield",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxWindow_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxSafeYield. Expected _wxWindow_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
_result = (bool )wxSafeYield(_arg0);
wxPy_END_ALLOW_THREADS;
} _resultobj = Py_BuildValue("i",_result);
return _resultobj;
}
static PyObject *_wrap_wxShowTip(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
bool _result;
@@ -4944,6 +4970,7 @@ static PyMethodDef misc2cMethods[] = {
{ "wxDragIcon", (PyCFunction) _wrap_wxDragIcon, METH_VARARGS | METH_KEYWORDS },
{ "wxCreateFileTipProvider", (PyCFunction) _wrap_wxCreateFileTipProvider, METH_VARARGS | METH_KEYWORDS },
{ "wxShowTip", (PyCFunction) _wrap_wxShowTip, METH_VARARGS | METH_KEYWORDS },
{ "wxSafeYield", (PyCFunction) _wrap_wxSafeYield, METH_VARARGS | METH_KEYWORDS },
{ "wxWakeUpIdle", (PyCFunction) _wrap_wxWakeUpIdle, METH_VARARGS | METH_KEYWORDS },
{ "wxPostEvent", (PyCFunction) _wrap_wxPostEvent, METH_VARARGS | METH_KEYWORDS },
{ "wxCaret_SetBlinkTime", (PyCFunction) _wrap_wxCaret_SetBlinkTime, METH_VARARGS | METH_KEYWORDS },

View File

@@ -561,6 +561,8 @@ wxPostEvent = misc2c.wxPostEvent
wxWakeUpIdle = misc2c.wxWakeUpIdle
wxSafeYield = misc2c.wxSafeYield
wxShowTip = misc2c.wxShowTip
def wxCreateFileTipProvider(*_args, **_kwargs):

View File

@@ -292,7 +292,6 @@ wxString wxGetOsDescription();
void wxSleep(int secs);
void wxUsleep(unsigned long milliseconds);
bool wxYield();
bool wxSafeYield();
void wxEnableTopLevelWindows(bool enable);
%inline %{

View File

@@ -366,6 +366,8 @@ public:
void wxPostEvent(wxEvtHandler *dest, wxEvent& event);
void wxWakeUpIdle();
bool wxSafeYield(wxWindow* win=NULL);
//----------------------------------------------------------------------

View File

@@ -595,7 +595,7 @@ public:
}
wxGridCellEditor *Clone() const {
wxGridCellEditor*Clone() const {
wxGridCellEditor* rval = NULL;
bool doSave = wxPyRestoreThread();
if (m_myInst.findCallback("Clone")) {

View File

@@ -591,23 +591,6 @@ static PyObject *_wrap_wxYield(PyObject *self, PyObject *args, PyObject *kwargs)
return _resultobj;
}
static PyObject *_wrap_wxSafeYield(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
bool _result;
char *_kwnames[] = { NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,":wxSafeYield",_kwnames))
return NULL;
{
wxPy_BEGIN_ALLOW_THREADS;
_result = (bool )wxSafeYield();
wxPy_END_ALLOW_THREADS;
} _resultobj = Py_BuildValue("i",_result);
return _resultobj;
}
static PyObject *_wrap_wxEnableTopLevelWindows(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
bool _arg0;
@@ -4940,7 +4923,6 @@ static PyMethodDef misccMethods[] = {
{ "wxStripMenuCodes", (PyCFunction) _wrap_wxStripMenuCodes, METH_VARARGS | METH_KEYWORDS },
{ "wxGetResource", (PyCFunction) _wrap_wxGetResource, METH_VARARGS | METH_KEYWORDS },
{ "wxEnableTopLevelWindows", (PyCFunction) _wrap_wxEnableTopLevelWindows, METH_VARARGS | METH_KEYWORDS },
{ "wxSafeYield", (PyCFunction) _wrap_wxSafeYield, METH_VARARGS | METH_KEYWORDS },
{ "wxYield", (PyCFunction) _wrap_wxYield, METH_VARARGS | METH_KEYWORDS },
{ "wxUsleep", (PyCFunction) _wrap_wxUsleep, METH_VARARGS | METH_KEYWORDS },
{ "wxSleep", (PyCFunction) _wrap_wxSleep, METH_VARARGS | METH_KEYWORDS },

View File

@@ -651,8 +651,6 @@ wxUsleep = miscc.wxUsleep
wxYield = miscc.wxYield
wxSafeYield = miscc.wxSafeYield
wxEnableTopLevelWindows = miscc.wxEnableTopLevelWindows
wxGetResource = miscc.wxGetResource

View File

@@ -1207,6 +1207,32 @@ static PyObject *_wrap_wxWakeUpIdle(PyObject *self, PyObject *args, PyObject *kw
return _resultobj;
}
static PyObject *_wrap_wxSafeYield(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
bool _result;
wxWindow * _arg0 = (wxWindow *) NULL;
PyObject * _argo0 = 0;
char *_kwnames[] = { "win", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"|O:wxSafeYield",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxWindow_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxSafeYield. Expected _wxWindow_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
_result = (bool )wxSafeYield(_arg0);
wxPy_END_ALLOW_THREADS;
} _resultobj = Py_BuildValue("i",_result);
return _resultobj;
}
static PyObject *_wrap_wxShowTip(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
bool _result;
@@ -4944,6 +4970,7 @@ static PyMethodDef misc2cMethods[] = {
{ "wxDragIcon", (PyCFunction) _wrap_wxDragIcon, METH_VARARGS | METH_KEYWORDS },
{ "wxCreateFileTipProvider", (PyCFunction) _wrap_wxCreateFileTipProvider, METH_VARARGS | METH_KEYWORDS },
{ "wxShowTip", (PyCFunction) _wrap_wxShowTip, METH_VARARGS | METH_KEYWORDS },
{ "wxSafeYield", (PyCFunction) _wrap_wxSafeYield, METH_VARARGS | METH_KEYWORDS },
{ "wxWakeUpIdle", (PyCFunction) _wrap_wxWakeUpIdle, METH_VARARGS | METH_KEYWORDS },
{ "wxPostEvent", (PyCFunction) _wrap_wxPostEvent, METH_VARARGS | METH_KEYWORDS },
{ "wxCaret_SetBlinkTime", (PyCFunction) _wrap_wxCaret_SetBlinkTime, METH_VARARGS | METH_KEYWORDS },

View File

@@ -561,6 +561,8 @@ wxPostEvent = misc2c.wxPostEvent
wxWakeUpIdle = misc2c.wxWakeUpIdle
wxSafeYield = misc2c.wxSafeYield
wxShowTip = misc2c.wxShowTip
def wxCreateFileTipProvider(*_args, **_kwargs):

View File

@@ -646,6 +646,10 @@ extern "C" SWIGEXPORT(void) inithtmlhelpc();
extern "C" SWIGEXPORT(void) initcalendarc();
extern "C" SWIGEXPORT(void) initstreamsc();
extern "C" SWIGEXPORT(void) initfilesysc();
extern "C" SWIGEXPORT(void) initglcanvasc();
extern "C" SWIGEXPORT(void) initoglc();
extern "C" SWIGEXPORT(void) initstc_c();
#ifdef __cplusplus
extern "C" {
#endif
@@ -2966,6 +2970,10 @@ SWIGEXPORT(void) initwxc() {
inithtmlc();
inithtmlhelpc();
initcalendarc();
initglcanvasc();
initoglc();
initstc_c();
{
int i;
for (i = 0; _swig_mapping[i].n1; i++)

View File

@@ -616,7 +616,7 @@ class TreePainter(Painter):
dc.SetPen(self.linepen)
dc.SetBrush(self.bgbrush)
dc.DrawRectangle(px -4, py-4, 9, 9)
self.knobs.append(kid, Rect(px -4, py -4, 9, 9))
self.knobs.append( (kid, Rect(px -4, py -4, 9, 9)) )
dc.SetPen(self.textpen)
if not kid.expanded:
dc.DrawLine(px, py -2, px, py + 3)
@@ -627,7 +627,7 @@ class TreePainter(Painter):
dc.SetPen(self.linepen)
dc.SetBrush(self.bgbrush)
dc.DrawRectangle(px -4, py-4, 9, 9)
self.knobs.append(node, Rect(px -4, py -4, 9, 9))
self.knobs.append( (node, Rect(px -4, py -4, 9, 9)) )
dc.SetPen(self.textpen)
if not node.expanded:
dc.DrawLine(px, py -2, px, py + 3)

View File

@@ -184,7 +184,7 @@ class PlotCanvas(wx.wxWindow):
def OnPaint(self, event):
pdc = wx.wxPaintDC(self)
if self.last_draw is not None:
apply(self.draw, self.last_draw + (pdc,))
apply(self.draw, self.last_draw + (pdc,))
def reconfigure(self, event):
(new_width,new_height) = self.GetClientSizeTuple()
@@ -342,7 +342,7 @@ class PlotCanvas(wx.wxWindow):
ticks = []
t = -grid*Numeric.floor(-lower/grid)
while t <= upper:
ticks.append(t, format % (t,))
ticks.append( (t, format % (t,)) )
t = t + grid
return ticks