Merge pull request #1495 from wxWidgets/tweaks-and-stuff

little tweaks and fixes
This commit is contained in:
Robin Dunn
2020-01-23 12:53:25 -08:00
committed by GitHub
14 changed files with 43 additions and 41 deletions

View File

@@ -44,7 +44,7 @@ jobs:
$PYTHON --version
$MAKE_VENV
source venv/bin/activate
python -m pip install -U pip setuptools wheel
python -m pip install -U pip "setuptools<45" wheel
python -m pip install -r requirements.txt
displayName: 'Install Python dependencies'

View File

@@ -40,7 +40,7 @@ jobs:
- script: |
curl -O https://bootstrap.pypa.io/get-pip.py
$PYTHON get-pip.py
$PYTHON -m pip install -U setuptools wheel
$PYTHON -m pip install -U "setuptools<45" wheel
$PYTHON -m pip install -r requirements.txt
displayName: 'Install Python dependencies'

View File

@@ -53,7 +53,7 @@ jobs:
- bash: |
curl -O https://bootstrap.pypa.io/get-pip.py
python get-pip.py
python -m pip install -U setuptools wheel
python -m pip install -U "setuptools<45" wheel
python -m pip install -r requirements.txt
displayName: 'Install Python dependencies'

View File

@@ -201,9 +201,10 @@ def runTest(frame, nb, log):
overview = """<html><body>
<h2><center>DemoName</center></h2>
<h2><center>DataViewCustomRenderer</center></h2>
Say something nice here
This sample shows how to implement a renderer for drawing the cells in a
DataViewControl in a custom manner.
</body></html>
"""

View File

@@ -36,7 +36,7 @@ check the source for this sample to see how to implement them.
item.SetFont(wx.Font(wx.FontInfo(10).Bold()))
menu1.Append(item)
else:
# But we'lkl just do it the normal way for this sample
# But we'll just do it the normal way for this sample
menu1.Append(103, "&Earth", "You may select Earth too")
menu1.AppendSeparator()
menu1.Append(104, "&Close", "Close this frame")

View File

@@ -83,7 +83,7 @@ class RunDemoApp(wx.App, wx.lib.mixins.inspection.InspectionMixin):
# its own top-level window
if win:
# so set the frame to a good size for showing stuff
frame.SetSize((640, 480))
frame.SetSize((800, 600))
win.SetFocus()
self.window = win
ns['win'] = win

View File

@@ -1446,6 +1446,7 @@
"GridDirection":"wx.grid.",
"GridEditorCreatedEvent":"wx.grid.",
"GridEvent":"wx.grid.",
"GridFitMode":"wx.grid.",
"GridHeaderLabelsRenderer":"wx.grid.",
"GridNameStr":"wx.grid.",
"GridRangeSelectEvent":"wx.grid.",

View File

@@ -89,7 +89,9 @@ def run():
c.find('SetMask.mask').transfer = True
c.addCppMethod('void', 'SetMaskColour', '(const wxColour& colour)', """\
c.addCppMethod('void', 'SetMaskColour', '(const wxColour& colour)',
doc="Create a mask for this bitmap based on the pixels with the given colour.",
body="""\
wxMask* mask = new wxMask(*self, *colour);
self->SetMask(mask);
""")

View File

@@ -99,15 +99,6 @@ def run():
#endif
""")
# C macros that need to be ignored
module.find('wx__DECLARE_EVT0').ignore()
module.find('wx__DECLARE_EVT1').ignore()
module.find('wx__DECLARE_EVT2').ignore()
module.find('wxEVENT_HANDLER_CAST').ignore()
module.find('wxDECLARE_EXPORTED_EVENT').ignore()
module.find('wxDECLARE_EVENT').ignore()
module.find('wxDEFINE_EVENT').ignore()
module.addPyClass('PyEventBinder', ['object'],
doc="""\
@@ -354,6 +345,8 @@ def run():
c.abstract = True
c.find('Clone').factory = True
c.find('GetEventUserData').ignore()
c.addProperty('EventObject GetEventObject SetEventObject')
c.addProperty('EventType GetEventType SetEventType')
c.addProperty('Id GetId SetId')

View File

@@ -201,6 +201,11 @@ def run():
c.find('GetCurrentPoint').findOverload('wxDouble *x, wxDouble *y').ignore()
c.mustHaveApp()
c.find('GetNativePath').setCppCode("""\
if (self->IsNull())
return (void*)0;
return self->GetNativePath();
""")
#---------------------------------------------
c = module.find('wxGraphicsRenderer')
@@ -283,6 +288,12 @@ def run():
c.find('TransformPoint.x').inOut = True
c.find('TransformPoint.y').inOut = True
c.find('GetNativeMatrix').setCppCode("""\
if (self->IsNull())
return (void*)0;
return self->GetNativeMatrix();
""")
#---------------------------------------------
c = module.find('wxGraphicsGradientStops')
@@ -293,6 +304,16 @@ def run():
factory=True)
#---------------------------------------------
c = module.find('wxGraphicsBitmap')
c.find('GetNativeBitmap').setCppCode("""\
if (self->IsNull())
return (void*)0;
return self->GetNativeBitmap();
""")
#---------------------------------------------
c = module.find('wxGraphicsPenInfo')
# Ignore Dashes for now

View File

@@ -39,6 +39,7 @@ ITEMS = [ 'wxGridCellCoords',
'wxGridCellFloatEditor',
'wxGridCellNumberEditor',
'wxGridFitMode',
'wxGridCellAttr',
'wxGridCornerHeaderRenderer',

View File

@@ -42,21 +42,21 @@ def run():
c.addCppMethod('void', 'SetSearchBitmap', '(const wxBitmap* bmp)',
"""\
#ifdef __WXMAC__
#if wxUSE_NATIVE_SEARCH_CONTROL
#else
self->SetSearchBitmap(*bmp);
#endif
""")
c.addCppMethod('void', 'SetSearchMenuBitmap', '(const wxBitmap* bmp)',
"""\
#ifdef __WXMAC__
#if wxUSE_NATIVE_SEARCH_CONTROL
#else
self->SetSearchMenuBitmap(*bmp);
#endif
""")
c.addCppMethod('void', 'SetCancelBitmap', '(const wxBitmap* bmp)',
"""\
#ifdef __WXMAC__
#if wxUSE_NATIVE_SEARCH_CONTROL
#else
self->SetCancelBitmap(*bmp);
#endif
@@ -85,25 +85,6 @@ def run():
klass = mod.find('wxTextEntry')
searchCtrl.items.extend(klass.items)
# Do the same with wxTextCtrl, but also remove things like the
# Constructors and Create methods first.
import textctrl
mod = textctrl.parseAndTweakModule()
klass = mod.find('wxTextCtrl')
# get just the methods that are not ctors, dtor or Create
items = [item for item in klass.items if isinstance(item, etgtools.MethodDef) and
not item.isCtor and
not item.isDtor and
item.name != 'Create']
searchCtrl.items.extend(items)
searchCtrl.find('LoadFile').ignore()
searchCtrl.find('SaveFile').ignore()
searchCtrl.find('MacCheckSpelling').ignore()
searchCtrl.find('ShowNativeCaret').ignore()
searchCtrl.find('HideNativeCaret').ignore()
# Add some properties that autoProperties would not see because they are
# not using 'Get' and 'Set'

View File

@@ -1,7 +1,9 @@
# Python packages needed for building and testing wxPython Phoenix
-r install.txt
appdirs
setuptools
setuptools < 45 ; python_version < '3.0'
setuptools ; python_version >= '3.0'
wheel
twine
requests