Hi (Robin),
Hi (Robin),
I have finally be able to recompile Phoenix to the latest SVN version.
While testing to port the remaining of AGW to Phoenix, I found the
following issues:
1. wx.ADJUST_MINSIZE (references in wx.lib.inspection, for example)
raises an AttributeError
wxADJUST_MINSIZE is inside a "#if WXWIN_COMPATIBILITY_2_8" block so it should probably not be put in the wx docs. I'll add an item for it in an etg script instead.
I have done some more porting/testing:
1. wx.WXK_PRIOR, wx.WXK_NEXT, wx.WXK_NUMPAD_PRIOR, wx.WXK_NUMPAD_NEXT
all raise an AttributeError (maybe they have been removed altogether
from wxWidgets);
These are in WXWIN_COMPATIBILITY_2_6 blocks. That is old enough that I think they should not be included any more at all. WXK_*PAGEUP and WXK_*PAGEDOWN can be used instead.
2. FlatMenu uses wx.StopWatch, which seems to be missing;
I'll add it.
3. I am not sure how to replace the (now non-existing) method
wx.adv.SashLayoutWindow.SizeWindows (I use it in the FoldPanelBar
demo). Maybe I am just looking in the wrong place or doing the wrong
thing;
It looks like that and some other methods were left out of the wx docs, so nothing was generated for them in Phoenix. I'll get them added.
4. AquaButton, GradientButton and everything else that uses the
following OnPaint initialization:
def OnPaint(self, event):
"""
Handles the ``wx.EVT_PAINT`` event for :class:`GradientButton`.
:param `event`: a :class:`PaintEvent` event to be processed.
"""
dc = wx.BufferedPaintDC(self)
gc = wx.GraphicsContext.Create(dc)
does not display anything. I remember hitting this problem a while
back but I can't figure out what I am doing wrong.
It's a bug in sip's and/or my code. I misunderstood how the KeepReference sip annotation works. I want to ensure that the dc lives as long as the gc and won't be garbage collected before the gc is. That is in case code like this is used:
gc = wx.GraphicsContext.Create(wx.BufferedPaintDC(self))
Without saving an extra reference to the dc then the dc will flush its buffer to the screen right after that line of code and the gc will end up with an invalid DC.
However since Create is a static method and there is no self to associate the extra reference with then SIP's KeepReference argument annotation is causing that extra reference to be leaked and so the buffered dc will never flush it's bitmap to the screen. It looks like I'll need to find another way to do what I need there...
5. wx.SetCursor raises an AttributeError, although I can see it in the
wxWidgets documentation:
I have an item on my ToDo list to track down the various global functions and some other miscellaneous items that are not wrapped yet. This is one of those items. It will get added soonish.
Probably I should just use wx.Window.SetCursor, although I am not sure
it is a global setting as it was for wx.SetCursor.
No, it will just set the cursor for the given window. Most of the time that is what you want, but if you need it done no matter where the cursor is located then it is not enough.
6. wx.USE_UNICODE is gone, as I assume that now everything is unicode
anyway, so I can get rid of that check.
Yes.
7. When I try to run the ShortcutEditor demo (cleaned from a couple of
harmless DeprecationWarnings), I get a Windows "segmentation fault",
with the usual message dialog telling me that Python has stopped
working...
Do you have any general idea where the crash might be happening or what might be going on in the application at the time?
8. FlatMenu also uses wx.GetAccelFromString, which has been removed in
wxWidgets: what is the recommended way to get the accelerator out of a
menu label?
It looks like this should work:
accel = wx.AcceleratorEntry()
accel.FromString(label)
9. The AGW demos needed heavy modifications to be somehow compatible
with Phoenix: what is the recommended approach to deal with Classic
and Phoenix at the same time? Should we have two separate "demos"
repositories for Phoenix and Classic or should I pepper the code with
"if" conditions to distinguish Phoenix from Classic?
I've been working under the assumption that there would be separate demo code, and also that the demo framework itself would be cleaned up and improved at the same time. (In other words, to be less of a jumble of hacked up features bolted together in a haphazard manner. ) But I haven't given it much thought beyond that and almost no work. So far when I've needed something more than unit tests I've been adding something to the samples folder.
Few others I found:
1) wx.DIALOG_NO_PARENT raises an AttributeError:
wxWidgets: wxDialog Class Reference
It was described in the docs, but the actual declaration of the flag was missing from the interface file. Fixed.
2) In wx.lib.agw.aui, I have a custom subclass of wx.DragImage to
display notebook tabs being dragged around. I initialize it like this:
self._drag_image = TabDragImage(self, page, tab_button.cur_state, self._art)
And it is initialized correctly. However, as soon as I call BeginDrag():
self._drag_image.BeginDrag(wx.Point(0,0), self, self.GetParent())
Then self._drag_image is reset to None. If I don't call BeginDrag()
then everything is fine.
Do you override BeginDrag in your subclass? If so does it make any modifications to self? I don't see how something like that could happen from the wrapped C++ code.
3. It appears that now DC.SetClippingRegion does not accept a regions
as input parameters (only a 4-element tuple or a wx.Rect), so all the
fancy drawings of tabs in AuiNotebook is a bit out of reach. What is
the alternative way of restricting drawing to a non-rectangular
region?
It looks like it is possible with the SetDeviceClippingRegion. I'm not sure why it has been split out to a new method name, although it makes sense if the SetClippingRegion(region) could not be made to work correctly with logical coordinates.
···
On 12/20/12 2:32 AM, Andrea Gavana wrote:
On 19 December 2012 22:22, Andrea Gavana wrote:
On 18 December 2012 22:48, Andrea Gavana wrote:
--
Robin Dunn
Software Craftsman