wxPython 2.9.5.0 preview build

Hi all,

It looks like the automatic email from the build script didn't make it to the list... There is a preview build for you to play with at http://wxpython.kosoftworks.com/preview/20121216/ Have fun!

···

--
Robin Dunn
Software Craftsman
http://wxPython.org

Went through the demo and found the following (Windows 7, Python
2.7).
Changing line 20 from:
dataDir = os.path.join(dirName, “agw”, “data”)
To fixes it:
dataDir = os.path.join(dirName, “data”)

  • Font looks like it is bold
  • the Grouping char or Decimal char fields are too small, this is
    due to my patch I submitted some time ago:
    Lines 2872 and 2880 in wx.lib.masked.maskededit.py create a
    sizing_text of “” if the self._masklength == 1.
    The only thing I can come up with is to replace these two lines with
    (i.e. adding the +1):
    sizing_text = ‘MJ’ * ((self._masklength+1)/2)
    But maybe someone has a better solution then that.
  • can not resize the two controls when dragging the “drag marker”
    C:\Python27\Doc\wxPython2.9 Docs and Demos\demo\agw
    MDIDemo.py:77: wxPyDeprecationWarning: Call to deprecated item
    ‘InitAllImageHand
    lers’.
    wx.InitAllImageHandlers()
    MDISashDemo.py:142: wxPyDeprecationWarning: Call to deprecated item
    ‘InitAllImag
    eHandlers’.
    wx.InitAllImageHandlers()
    C:\Python27\Doc\wxPython2.9 Docs and Demos\demo\agw
    OnCloseWindow
    C:\Python27\lib\site-packages\wx-2.9.5-msw\wx\lib\agw\flatmenu.py:6151:
    wxPyDepr
    ecationWarning: Accessing deprecated property.
    event.m_x = p.x
    C:\Python27\lib\site-packages\wx-2.9.5-msw\wx\lib\agw\flatmenu.py:6152:
    wxPyDepr
    ecationWarning: Accessing deprecated property.
    event.m_y = p.y
    SetTitle Floating!
    Best regards
    Werner
···

Hi Robin,

  On 17/12/2012 03:27, Robin Dunn wrote:
  Hi

all,

  It looks like the automatic email from the build script didn't

make it to the list… There is a preview build for you to play
with at Have
fun!

** XLSGRID demo “Example_1.xls” is not found.**
NumCtrl
ResizeWidget:
Traceback in console:

http://wxpython.kosoftworks.com/preview/20121216/

Hi Robin and Andrea,

···

On 17/12/2012 03:27, Robin Dunn wrote:

Hi all,

It looks like the automatic email from the build script didn't make it to the list... There is a preview build for you to play with at http://wxpython.kosoftworks.com/preview/20121216/ Have fun!

The wx.lib.agw.aquabutton is missing SetShadowColour.

Andrea applied this patch early this month.

Werner

Just pulled wx.lib.agw from SVN and it is in there - so I am a bit confused here or did it somehow not get pulled into the 2.9.5 build?

Werner

···

On 17/12/2012 14:36, Werner wrote:

Hi Robin and Andrea,

On 17/12/2012 03:27, Robin Dunn wrote:

Hi all,

It looks like the automatic email from the build script didn't make it to the list... There is a preview build for you to play with at http://wxpython.kosoftworks.com/preview/20121216/ Have fun!

The wx.lib.agw.aquabutton is missing SetShadowColour.

Andrea applied this patch early this month.

Hi Robin,

···

On 17/12/2012 03:27, Robin Dunn wrote:

Hi all,

It looks like the automatic email from the build script didn't make it to the list... There is a preview build for you to play with at http://wxpython.kosoftworks.com/preview/20121216/ Have fun!

FYI, I am also having a sizing issue in a custom popup control of mine, under 2.9.4 it sizes fine, in 2.9.5 I get a 32x32 large window (way to small).

Haven't figured out what is causing this and might not have enough time today to look into this.

Werner

Found it, here what I needed to do to make it work in 2.9.5, just in case someone else has a similar issue.

Reorder the following in my popupctrl.setContent method:

         self.content.Reparent(self.win)
         self.content.Show(True)

         self.win.SetClientSize(self.content.GetSize())
         self.SetSize(self.win.GetSize())

Before I had the "Show" call after the SetXSize calls, in 2.9.5 this caused the window to be too small.

Werner

···

On 17/12/2012 15:35, Werner wrote:

Hi Robin,

On 17/12/2012 03:27, Robin Dunn wrote:

Hi all,

It looks like the automatic email from the build script didn't make it to the list... There is a preview build for you to play with at http://wxpython.kosoftworks.com/preview/20121216/ Have fun!

FYI, I am also having a sizing issue in a custom popup control of mine, under 2.9.4 it sizes fine, in 2.9.5 I get a 32x32 large window (way to small).

Haven't figured out what is causing this and might not have enough time today to look into this.

Yeah, I forgot to update the subrepositories in my local workspace.

···

On 12/17/12 5:43 AM, Werner wrote:

On 17/12/2012 14:36, Werner wrote:

Hi Robin and Andrea,

On 17/12/2012 03:27, Robin Dunn wrote:

Hi all,

It looks like the automatic email from the build script didn't make
it to the list... There is a preview build for you to play with at
http://wxpython.kosoftworks.com/preview/20121216/ Have fun!

The wx.lib.agw.aquabutton is missing SetShadowColour.

Andrea applied this patch early this month.

Just pulled wx.lib.agw from SVN and it is in there - so I am a bit
confused here or did it somehow not get pulled into the 2.9.5 build?

--
Robin Dunn
Software Craftsman

Hi Robin,

Hi all,

It looks like the automatic email from the build script didn't make it
to the list... There is a preview build for you to play with at
http://wxpython.kosoftworks.com/preview/20121216/ Have fun!

Went through the demo and found the following (Windows 7, Python 2.7).

*XLSGRID demo "Example_1.xls" is not found. *

Changing line 20 from:
     dataDir = os.path.join(dirName, "agw", "data")

To fixes it:
     dataDir = os.path.join(dirName, "data")

Ok.

*NumCtrl*
- Font looks like it is bold

But it isn't. In the WIT:

   >>> f = obj.GetFont()
   >>> f.GetFaceName()
   u'Courier New'
   >>> f.GetWeight() == wx.FONTWEIGHT_NORMAL
   True

And it looks normal on OSX. I'm not sure why it would look a bit bold only on Windows.

Looking at it a little closer it seems a little muddy, like what happens when you draw the same text multiple times at the same location on a wx.DC, and the anti-aliasing of the separate draws blends together. Perhaps something the Masked code is causing the native widget to do redraws without clears? If you can figure something out let me know. At this point you know a lot more about the Masked code than I do.

- the Grouping char or Decimal char fields are too small, this is due to
my patch I submitted some time ago:

Lines 2872 and 2880 in wx.lib.masked.maskededit.py create a sizing_text
of "" if the self._masklength == 1.

The only thing I can come up with is to replace these two lines with
(i.e. adding the +1):

sizing_text = 'MJ' * ((self._masklength+1)/2)

But maybe someone has a better solution then that.

Perhaps it would be best to have a lower bound on what the min size could be set to? Setting the minimum width to 8 seems wrong when there is probably going to be at least that much space in the border and margin areas. Perhaps Masked should be using SetMinClientSize instead?

*ResizeWidget:*
- can not resize the two controls when dragging the "drag marker"

I'm working on this one.

*Traceback in console:**
*C:\Python27\Doc\wxPython2.9 Docs and Demos\demo\agw
MDIDemo.py:77: wxPyDeprecationWarning: Call to deprecated item
'InitAllImageHand
lers'.
   wx.InitAllImageHandlers()
MDISashDemo.py:142: wxPyDeprecationWarning: Call to deprecated item
'InitAllImag
eHandlers'.
   wx.InitAllImageHandlers()

Ok, all wx.InitAllImageHandlers calls have been removed.

C:\Python27\Doc\wxPython2.9 Docs and Demos\demo\agw
OnCloseWindow
C:\Python27\lib\site-packages\wx-2.9.5-msw\wx\lib\agw\flatmenu.py:6151:
wxPyDepr
ecationWarning: Accessing deprecated property.
   event.m_x = p.x
C:\Python27\lib\site-packages\wx-2.9.5-msw\wx\lib\agw\flatmenu.py:6152:
wxPyDepr
ecationWarning: Accessing deprecated property.
   event.m_y = p.y

Fixed.

···

On 12/17/12 2:44 AM, Werner wrote:

On 17/12/2012 03:27, Robin Dunn wrote:

--
Robin Dunn
Software Craftsman

two issues for me
- two occurrences of m_controlDown in gridmovers.py should be changed to
ControlDown() (this was also present in 2.9.4)

Done.

- I get this for wx.ScrolledWindow using PseudoDC (worked fine on
2.9.4), win7, py2.7

     bch.ChartCanvas.OnPaint(self,event)
   File "C:\Program Files
(x86)\Python27\lib\site-packages\AF\GUI\ItemChartView.p
y", line 757, in OnPaint
     self.pdc.DrawToDCClipped(dc,r)
   File "C:\Program Files
(x86)\Python27\lib\site-packages\wx-2.9.5-msw\wx\_gdi.p
y", line 7878, in DrawToDCClipped
     return _gdi_.PseudoDC_DrawToDCClipped(*args, **kwargs)
wx._core.PyAssertionError: C++ assertion "m_hdc" failed at
..\..\src\msw\textmea
sure.cpp(65) in wxTextMeasure::BeginMeasuring(): Must not be used with
non-nativ
e wxDCs

May be related to a GetTextExtent call? I have this in my code

ws,hs = wx.ClientDC(self).GetTextExtent(dt_s)

Probably not unless wx.ClientDC is broken.

What kind of DC are you passing to DrawToDCClipped? Have you tried narrowing down which operations being played back by the PseudoDC might be causing it?

···

On 12/18/12 2:03 AM, Marco Prosperi wrote:

--
Robin Dunn
Software Craftsman

Hi Robin,

...

*NumCtrl*
- Font looks like it is bold

But it isn't. In the WIT:

  >>> f = obj.GetFont()
  >>> f.GetFaceName()
  u'Courier New'
  >>> f.GetWeight() == wx.FONTWEIGHT_NORMAL
  True

Agree, it just looks like it.

And it looks normal on OSX. I'm not sure why it would look a bit bold only on Windows.

Maybe because the point size is adjusted for wxMac in MaskedEditMixin._setFont:), I tried the same trick for Windows the other day but couldn't get it to work, i.e. it ended up being too small.

Looking at it a little closer it seems a little muddy, like what happens when you draw the same text multiple times at the same location on a wx.DC, and the anti-aliasing of the separate draws blends together.

I am not sure this applies to masked, as it is using a TextCtrl and I don't think that it uses a wx.DC.

Will look at it a bit more over the next couple of days.

Perhaps something the Masked code is causing the native widget to do redraws without clears? If you can figure something out let me know. At this point you know a lot more about the Masked code than I do.

- the Grouping char or Decimal char fields are too small, this is due to
my patch I submitted some time ago:

Lines 2872 and 2880 in wx.lib.masked.maskededit.py create a sizing_text
of "" if the self._masklength == 1.

The only thing I can come up with is to replace these two lines with
(i.e. adding the +1):

sizing_text = 'MJ' * ((self._masklength+1)/2)

But maybe someone has a better solution then that.

Perhaps it would be best to have a lower bound on what the min size could be set to? Setting the minimum width to 8 seems wrong when there is probably going to be at least that much space in the border and margin areas. Perhaps Masked should be using SetMinClientSize instead?

The problem is only happening if one uses autoFit of the masked control and they are sizing too small if the _maskedLength = 1, I think.

Werner

···

On 19/12/2012 19:08, Robin Dunn wrote:

Hi Robin,

Hi Robin,

...

*NumCtrl*
- Font looks like it is bold

But it isn't. In the WIT:

  >>> f = obj.GetFont()
  >>> f.GetFaceName()
  u'Courier New'
  >>> f.GetWeight() == wx.FONTWEIGHT_NORMAL
  True

Agree, it just looks like it.

And it looks normal on OSX. I'm not sure why it would look a bit bold only on Windows.

Maybe because the point size is adjusted for wxMac in MaskedEditMixin._setFont:), I tried the same trick for Windows the other day but couldn't get it to work, i.e. it ended up being too small.

Looking at it a little closer it seems a little muddy, like what happens when you draw the same text multiple times at the same location on a wx.DC, and the anti-aliasing of the separate draws blends together.

I am not sure this applies to masked, as it is using a TextCtrl and I don't think that it uses a wx.DC.

Running it through the debugger I can see that SetFont is done twice on numctrl.

MaskedEditMixin.__init__ calls SetCtrlParameters which in turn calls _setFont and
NumCtrl.__init__ is doing the same

Could that explain it?

Tried brute force by only calling it in one or the other, but that would have been too simple.

Werner

···

On 19/12/2012 21:09, Werner wrote:

On 19/12/2012 19:08, Robin Dunn wrote:

> - I get this for wx.ScrolledWindow using PseudoDC (worked fine on
> 2.9.4), win7, py2.7

> bch.ChartCanvas.OnPaint(self,event)
> File "C:\Program Files
> (x86)\Python27\lib\site-packages\AF\GUI\ItemChartView.p
> y", line 757, in OnPaint
> self.pdc.DrawToDCClipped(dc,r)
> File "C:\Program Files
> (x86)\Python27\lib\site-packages\wx-2.9.5-msw\wx\_gdi.p
> y", line 7878, in DrawToDCClipped
> return _gdi_.PseudoDC_DrawToDCClipped(*args, **kwargs)
> wx._core.PyAssertionError: C++ assertion "m_hdc" failed at
> ..\..\src\msw\textmea
> sure.cpp(65) in wxTextMeasure::BeginMeasuring(): Must not be used with
> non-nativ
> e wxDCs

> May be related to a GetTextExtent call? I have this in my code

> ws,hs = wx.ClientDC(self).GetTextExtent(dt_s)

Probably not unless wx.ClientDC is broken.

What kind of DC are you passing to DrawToDCClipped? Have you tried
narrowing down which operations being played back by the PseudoDC might
be causing it?

--
Robin Dunn
Software Craftsmanhttp://wxPython.org

dc is a wx.GCDC and the problem seems to be related to a DrawLabel
call. I've changed this with a DrawText and managed the alignment of
text in other ways than those offered by DrawLabel

Marco

dc is a wx.GCDC and the problem seems to be related to a DrawLabel
call. I've changed this with a DrawText and managed the alignment of
text in other ways than those offered by DrawLabel

Marco

another exception, this time with DrawText:

[omissis]
  File "C:\Program Files (x86)\Python27\lib\site-packages\wx-2.9.5-msw
\wx\lib\pl
ot.py", line 1714, in _drawAxes
dc.DrawText(label,pt[0],pt[1]+2*self._pointSize[1])
  File "C:\Program Files (x86)\Python27\lib\site-packages\wx-2.9.5-msw
\wx\_gdi.p
y", line 3823, in DrawText
    return _gdi_.DC_DrawText(*args, **kwargs)
wx._core.PyAssertionError: C++ assertion "m_hdc" failed at ..\..\src
\msw\textmea
sure.cpp(65) in wxTextMeasure::BeginMeasuring(): Must not be used with
non-nativ
e wxDCs

where:
type(dc) is <class 'wx._gdi.GCDC'> and label was "july\n2011".
Removing "\n" solved the problem

Marco

Ok, the use of the wx.GCDC helps to define the problem. I've created a ticket for this at wxTrac has been migrated to GitHub Issues - wxWidgets

···

On 12/21/12 1:26 AM, Marco Prosperi wrote:

dc is a wx.GCDC and the problem seems to be related to a DrawLabel
call. I've changed this with a DrawText and managed the alignment of
text in other ways than those offered by DrawLabel

--
Robin Dunn
Software Craftsman

No, at least it shouldn't.

I was thinking more along the lines of Refresh(False) being called a lot (so the erase isn't done before the redraw) but I don't see anything like that either with a quick search.

···

On 12/20/12 1:28 AM, Werner wrote:

Hi Robin,

On 19/12/2012 21:09, Werner wrote:

Hi Robin,

On 19/12/2012 19:08, Robin Dunn wrote:
...

*NumCtrl*
- Font looks like it is bold

But it isn't. In the WIT:

  >>> f = obj.GetFont()
  >>> f.GetFaceName()
  u'Courier New'
  >>> f.GetWeight() == wx.FONTWEIGHT_NORMAL
  True

Agree, it just looks like it.

And it looks normal on OSX. I'm not sure why it would look a bit
bold only on Windows.

Maybe because the point size is adjusted for wxMac in
MaskedEditMixin._setFont:), I tried the same trick for Windows the
other day but couldn't get it to work, i.e. it ended up being too small.

Looking at it a little closer it seems a little muddy, like what
happens when you draw the same text multiple times at the same
location on a wx.DC, and the anti-aliasing of the separate draws
blends together.

I am not sure this applies to masked, as it is using a TextCtrl and I
don't think that it uses a wx.DC.

Running it through the debugger I can see that SetFont is done twice on
numctrl.

MaskedEditMixin.__init__ calls SetCtrlParameters which in turn calls
_setFont and
NumCtrl.__init__ is doing the same

Could that explain it?

--
Robin Dunn
Software Craftsman