Hello all,
is there any way to paint to a modal dialog? I am trying to add
a 'New...' button to the standard wxDirDialog by blitting an
image of the button in the right place and then catching the
mouse move events - but I don't seem to be able to paint to
the dialog; OnPaint in the code below is not even called
in the [unfinished] code below (and neither is
OnLeftUp):
class ExtDirDialog(wxDirDialog):
def __init__(self, parent, **optionD):
apply(wxDirDialog.__init__, (self, parent), optionD)
EVT_PAINT(self, self.OnPaint)
EVT_LEFT_UP(self, self.OnLeftUp)
···
#
def OnLeftUp(self, ev):
x = ev.GetX()
y = ev.GetY()
leftX,leftY,rightX,rightY = self._cornerT
if leftX <= x <= rightX and leftY <= y <= rightY:
return self.OnNew()
#
ev.Skip()
#
def OnPaint(self, ev):
dc = wxPaintDC(self)
bmp = wxBitmap('c:\\newbutton.bmp',
wxBITMAP_TYPE_BMP)
memdc = wxMemoryDC()
memdc.SelectObject(bmp)
width = bmp.GetWidth()
height = bmp.GetHeight()
cornerT = self._cornerT = (100,100,100 + width, 100 + height)
apply(dc.Blit, cornerT + (memdc, 0, 0, wxCOPY))
#
ev.Skip()
#
def OnNew(self):
pass
Any ideas?
Thanks,
Oliver
F. Oliver Gathmann
CRI Inc., 80 Ashford St., Boston, 02134 MA
phone: (617) 787-5700#224 ; fax: (617) 787-4488
e-mail: ogathmann@cri-inc.com
web: http://www.scar.utoronto.ca/~gathmann
_______________________________________________
wxPython-users maillist - wxPython-users@starship.python.net
http://starship.python.net/mailman/listinfo/wxpython-users