mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-07 12:30:07 +01:00
@@ -95,7 +95,17 @@ class MaskedTimeCtrlTests(wtc.WidgetTestCase):
|
||||
#t = m.TextCtrl()
|
||||
#t.Create(self.frame)
|
||||
|
||||
|
||||
def test_timectrlIsValid(self):
|
||||
t = m.TimeCtrl(self.frame, -1, "18:25:18")
|
||||
|
||||
theTime = t.GetValue(as_wxDateTime=True)
|
||||
self.assertEqual(theTime.hour, 18, "Hour: %s instead of '18'" % theTime.hour)
|
||||
self.assertEqual(theTime.minute, 25, "Minutes: %s instead of '18'" % theTime.minute)
|
||||
self.assertEqual(theTime.second, 18, "Seconds: %s instead of '18'" % theTime.second)
|
||||
|
||||
self.assertEqual(t.IsInBounds(), True)
|
||||
self.assertEqual(t.GetCtrlParameter('validBackgroundColour'), t.GetBackgroundColour())
|
||||
|
||||
def test_timectrlProperties(self):
|
||||
t = m.TimeCtrl(self.frame)
|
||||
|
||||
|
||||
@@ -1254,7 +1254,7 @@ class TimeCtrl(BaseMaskedTextCtrl):
|
||||
def __OnChar(self, event):
|
||||
"""
|
||||
Handler to explicitly look for ':' keyevents, and if found,
|
||||
clear the m_shiftDown field, so it will behave as forward tab.
|
||||
clear the shiftDown field, so it will behave as forward tab.
|
||||
It then calls the base control's _OnChar routine with the modified
|
||||
event instance.
|
||||
"""
|
||||
@@ -1263,7 +1263,7 @@ class TimeCtrl(BaseMaskedTextCtrl):
|
||||
## dbg('keycode:', keycode)
|
||||
if keycode == ord(':'):
|
||||
## dbg('colon seen! removing shift attribute')
|
||||
event.m_shiftDown = False
|
||||
event.shiftDown = False
|
||||
BaseMaskedTextCtrl._OnChar(self, event ) ## handle each keypress
|
||||
## dbg(indent=0)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user