Patch #1581767: Another fix for wx.lib.calendar
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42226 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -74,6 +74,12 @@
|
|||||||
#
|
#
|
||||||
# 12/10/2006 - Walter Barnes walter_barnes05@yahoo.com
|
# 12/10/2006 - Walter Barnes walter_barnes05@yahoo.com
|
||||||
# o Fixed CalDraw to properly render months that start on a Sunday.
|
# o Fixed CalDraw to properly render months that start on a Sunday.
|
||||||
|
#
|
||||||
|
# 21/10/2006 - Walter Barnes walter_barnes05@yahoo.com
|
||||||
|
# o Fixed a bug in Calendar: Shift and Control key status was only recorded for
|
||||||
|
# left-down events.
|
||||||
|
# o Added handlers for wxEVT_MIDDLE_DOWN and wxEVT_MIDDLE_DCLICK to generate
|
||||||
|
# EVT_CALENDAR for these mouse events.
|
||||||
|
|
||||||
|
|
||||||
import wx
|
import wx
|
||||||
@@ -707,6 +713,8 @@ class Calendar( wx.PyControl ):
|
|||||||
self.Bind(wx.EVT_LEFT_DCLICK, self.OnLeftDEvent)
|
self.Bind(wx.EVT_LEFT_DCLICK, self.OnLeftDEvent)
|
||||||
self.Bind(wx.EVT_RIGHT_DOWN, self.OnRightEvent)
|
self.Bind(wx.EVT_RIGHT_DOWN, self.OnRightEvent)
|
||||||
self.Bind(wx.EVT_RIGHT_DCLICK, self.OnRightDEvent)
|
self.Bind(wx.EVT_RIGHT_DCLICK, self.OnRightDEvent)
|
||||||
|
self.Bind(wx.EVT_MIDDLE_DOWN, self.OnMiddleEvent)
|
||||||
|
self.Bind(wx.EVT_MIDDLE_DCLICK, self.OnMiddleDEvent)
|
||||||
self.Bind(wx.EVT_SET_FOCUS, self.OnSetFocus)
|
self.Bind(wx.EVT_SET_FOCUS, self.OnSetFocus)
|
||||||
self.Bind(wx.EVT_KILL_FOCUS, self.OnKillFocus)
|
self.Bind(wx.EVT_KILL_FOCUS, self.OnKillFocus)
|
||||||
self.Bind(wx.EVT_KEY_DOWN, self.OnKeyDown)
|
self.Bind(wx.EVT_KEY_DOWN, self.OnKeyDown)
|
||||||
@@ -744,6 +752,8 @@ class Calendar( wx.PyControl ):
|
|||||||
|
|
||||||
def ProcessClick(self, event):
|
def ProcessClick(self, event):
|
||||||
self.x, self.y = event.GetX(), event.GetY()
|
self.x, self.y = event.GetX(), event.GetY()
|
||||||
|
self.shiftkey = event.ShiftDown()
|
||||||
|
self.ctrlkey = event.ControlDown()
|
||||||
key = self.GetDayHit(self.x, self.y)
|
key = self.GetDayHit(self.x, self.y)
|
||||||
self.SelectDay(key)
|
self.SelectDay(key)
|
||||||
|
|
||||||
@@ -751,8 +761,6 @@ class Calendar( wx.PyControl ):
|
|||||||
|
|
||||||
def OnLeftEvent(self, event):
|
def OnLeftEvent(self, event):
|
||||||
self.click = 'LEFT'
|
self.click = 'LEFT'
|
||||||
self.shiftkey = event.ShiftDown()
|
|
||||||
self.ctrlkey = event.ControlDown()
|
|
||||||
self.ProcessClick(event)
|
self.ProcessClick(event)
|
||||||
|
|
||||||
def OnLeftDEvent(self, event):
|
def OnLeftDEvent(self, event):
|
||||||
@@ -767,6 +775,14 @@ class Calendar( wx.PyControl ):
|
|||||||
self.click = 'DRIGHT'
|
self.click = 'DRIGHT'
|
||||||
self.ProcessClick(event)
|
self.ProcessClick(event)
|
||||||
|
|
||||||
|
def OnMiddleEvent(self, event):
|
||||||
|
self.click = 'MIDDLE'
|
||||||
|
self.ProcessClick(event)
|
||||||
|
|
||||||
|
def OnMiddleDEvent(self, event):
|
||||||
|
self.click = 'DMIDDLE'
|
||||||
|
self.ProcessClick(event)
|
||||||
|
|
||||||
def OnSetFocus(self, event):
|
def OnSetFocus(self, event):
|
||||||
self.hasFocus = True
|
self.hasFocus = True
|
||||||
self.DrawFocusIndicator(True)
|
self.DrawFocusIndicator(True)
|
||||||
|
Reference in New Issue
Block a user