Hi everybody !
When I move my windows's program, this windows can leave the screen like all program.
But me, I would like to know how I can do to always keep all part of my windows (when I move it) visible
I do this:
I have a problem on screen's corners, the scrip bug
When I move my windows's program, this windows can leave the screen like all program.
But me, I would like to know how I can do to always keep all part of my windows (when I move it) visible
I do this:
Code:
self.width = GetSystemMetrics(0)
self.height = GetSystemMetrics(1)
def OnLeftDown(self, evt):
self.CaptureMouse()
pos = self.ClientToScreen(evt.GetPosition())
origin = self.GetPosition()
self.delta = wx.Point(pos.x - origin.x, pos.y - origin.y)
def OnMouseMove(self, evt):
if evt.Dragging() and evt.LeftIsDown():
pos = self.ClientToScreen(evt.GetPosition())
newPos = (pos.x - self.delta.x, pos.y - self.delta.y)
if newPos[0] > 0 and newPos[0] < (self.width-482) and newPos[1] > 0 and newPos[1] < (self.height- 68):
self.Move(newPos)
if pos.x <= 0 :
newPos = (0 , pos.y - self.delta.y)
self.Move(newPos)
if pos.x >= (self.width-468):
newPos = ( self.width-482 , pos.y - self.delta.y)
self.Move(newPos)
if pos.y <= 0:
newPos = (pos.x - self.delta.x ,0 )
self.Move(newPos)
if pos.y >= (self.height- 68):
newPos = (pos.x - self.delta.x ,self.height- 68)
self.Move(newPos)
Comment