Ejemplo n.º 1
0
 def __init__(self):
     wx.Frame.__init__(self, None, -1, "Shaped Window",
             style = wx.FRAME_SHAPED | wx.SIMPLE_BORDER |
             wx.FRAME_NO_TASKBAR)
     self.hasShape = False
     self.bmp = images.getVippiBitmap()
     self.SetClientSize((self.bmp.GetWidth(), self.bmp.GetHeight()))
     dc = wx.ClientDC(self)
     dc.DrawBitmap(self.bmp, 0,0, True)
     self.SetWindowShape()
     self.Bind(wx.EVT_LEFT_DCLICK, self.OnDoubleClick)
     self.Bind(wx.EVT_RIGHT_UP, self.OnExit)
     self.Bind(wx.EVT_PAINT, self.OnPaint)
     self.Bind(wx.EVT_WINDOW_CREATE, self.SetWindowShape)
Ejemplo n.º 2
0
 def __init__(self):
     wx.Frame.__init__(self, None, -1, "Shaped Window",
             style = wx.FRAME_SHAPED | wx.SIMPLE_BORDER )
     self.hasShape = False
     self.delta = wx.Point(0,0)
     self.bmp = images.getVippiBitmap()
     self.SetClientSize((self.bmp.GetWidth(), self.bmp.GetHeight()))
     dc = wx.ClientDC(self)
     dc.DrawBitmap(self.bmp, 0,0, True)
     self.SetWindowShape()
     self.Bind(wx.EVT_LEFT_DCLICK, self.OnDoubleClick)
     self.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDown)
     self.Bind(wx.EVT_LEFT_UP, self.OnLeftUp)
     self.Bind(wx.EVT_MOTION, self.OnMouseMove)
     self.Bind(wx.EVT_RIGHT_UP, self.OnExit)
     self.Bind(wx.EVT_PAINT, self.OnPaint)
     self.Bind(wx.EVT_WINDOW_CREATE, self.SetWindowShape)
Ejemplo n.º 3
0
    def __init__(self, parent, log):
        self.log = log
        wx.Frame.__init__(self,
                          parent,
                          -1,
                          "Shaped Window",
                          style=wx.FRAME_SHAPED
                          | wx.SIMPLE_BORDER
                          | wx.FRAME_NO_TASKBAR
                          | wx.STAY_ON_TOP)

        self.hasShape = False
        self.delta = (0, 0)

        self.Bind(wx.EVT_LEFT_DCLICK, self.OnDoubleClick)
        self.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDown)
        self.Bind(wx.EVT_LEFT_UP, self.OnLeftUp)
        self.Bind(wx.EVT_MOTION, self.OnMouseMove)
        self.Bind(wx.EVT_RIGHT_UP, self.OnExit)
        self.Bind(wx.EVT_PAINT, self.OnPaint)

        self.bmp = images.getVippiBitmap()
        w, h = self.bmp.GetWidth(), self.bmp.GetHeight()
        self.SetClientSize((w, h))

        if wx.Platform != "__WXMAC__":
            # wxMac clips the tooltip to the window shape, YUCK!!!
            self.SetToolTipString(
                "Right-click to close the window\n"
                "Double-click the image to set/unset the window shape")

        if wx.Platform == "__WXGTK__":
            # wxGTK requires that the window be created before you can
            # set its shape, so delay the call to SetWindowShape until
            # this event.
            self.Bind(wx.EVT_WINDOW_CREATE, self.SetWindowShape)
        else:
            # On wxMSW and wxMac the window has already been created, so go for it.
            self.SetWindowShape()

        dc = wx.ClientDC(self)
        dc.DrawBitmap(self.bmp, 0, 0, True)
Ejemplo n.º 4
0
    def __init__(self, parent, log):
        self.log = log
        wx.Frame.__init__(self, parent, -1, "Shaped Window",
                         style =
                           wx.FRAME_SHAPED
                         | wx.SIMPLE_BORDER
                         | wx.FRAME_NO_TASKBAR
                         | wx.STAY_ON_TOP
                         )

        self.hasShape = False
        self.delta = (0,0)

        self.Bind(wx.EVT_LEFT_DCLICK,   self.OnDoubleClick)
        self.Bind(wx.EVT_LEFT_DOWN,     self.OnLeftDown)
        self.Bind(wx.EVT_LEFT_UP,       self.OnLeftUp)
        self.Bind(wx.EVT_MOTION,        self.OnMouseMove)
        self.Bind(wx.EVT_RIGHT_UP,      self.OnExit)
        self.Bind(wx.EVT_PAINT,         self.OnPaint)

        self.bmp = images.getVippiBitmap()
        w, h = self.bmp.GetWidth(), self.bmp.GetHeight()
        self.SetClientSize( (w, h) )

        if wx.Platform != "__WXMAC__":
            # wxMac clips the tooltip to the window shape, YUCK!!!
            self.SetToolTipString("Right-click to close the window\n"
                                  "Double-click the image to set/unset the window shape")

        if wx.Platform == "__WXGTK__":
            # wxGTK requires that the window be created before you can
            # set its shape, so delay the call to SetWindowShape until
            # this event.
            self.Bind(wx.EVT_WINDOW_CREATE, self.SetWindowShape)
        else:
            # On wxMSW and wxMac the window has already been created, so go for it.
            self.SetWindowShape()

        dc = wx.ClientDC(self)
        dc.DrawBitmap(self.bmp, 0,0, True)