Minor tweaks
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@34304 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -598,7 +598,8 @@ class SetPrintout(wxPrintout):
|
||||
|
||||
class MyApp(wxApp):
|
||||
def OnInit(self):
|
||||
frame = CalendFrame(None, -1, "Test Calendar")
|
||||
wxInitAllImageHandlers()
|
||||
frame = CalendFrame(None, -1, "Test Calendar", sys.stdout)
|
||||
frame.Show(True)
|
||||
self.SetTopWindow(frame)
|
||||
return True
|
||||
@@ -612,17 +613,6 @@ def MessageDlg(self, message, type = 'Message'):
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
def main():
|
||||
app = MyApp(0)
|
||||
app.MainLoop()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
def runTest(frame, nb, log):
|
||||
win = TestPanel(nb, log, frame)
|
||||
return win
|
||||
@@ -630,6 +620,14 @@ def runTest(frame, nb, log):
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
import sys,os
|
||||
import run
|
||||
run.main(['', os.path.basename(sys.argv[0])])
|
||||
|
||||
|
||||
|
||||
|
||||
overview = """\
|
||||
This control provides a calendar control class for displaying and selecting dates. In addition, the class is extended and can now be used for printing/previewing.
|
||||
|
||||
|
@@ -96,14 +96,18 @@ else:
|
||||
EVT_LEFT_UP(self, self.OnMouseUp)
|
||||
EVT_MOTION(self, self.OnMouseMotion)
|
||||
|
||||
|
||||
def OnEraseBackground(self, event):
|
||||
pass # Do nothing, to avoid flashing on MSW.
|
||||
|
||||
|
||||
def OnSize(self, event):
|
||||
size = self.GetClientSize()
|
||||
if self.GetContext():
|
||||
self.SetCurrent()
|
||||
glViewport(0, 0, size.width, size.height)
|
||||
event.Skip()
|
||||
|
||||
|
||||
def OnPaint(self, event):
|
||||
dc = wxPaintDC(self)
|
||||
@@ -113,12 +117,15 @@ else:
|
||||
self.init = True
|
||||
self.OnDraw()
|
||||
|
||||
|
||||
def OnMouseDown(self, evt):
|
||||
self.CaptureMouse()
|
||||
|
||||
|
||||
def OnMouseUp(self, evt):
|
||||
self.ReleaseMouse()
|
||||
|
||||
|
||||
def OnMouseMotion(self, evt):
|
||||
if evt.Dragging() and evt.LeftIsDown():
|
||||
self.x, self.y = self.lastx, self.lasty
|
||||
|
@@ -19,10 +19,10 @@ class TestPanel( wxScrolledPanel ):
|
||||
|
||||
text2 = wxStaticText( self, -1, "24-hour format:")
|
||||
spin2 = wxSpinButton( self, -1, wxDefaultPosition, wxSize(-1,20), 0 )
|
||||
self.time24 = wxTimeCtrl( self, -1, name="24 hour control", fmt24hr=True, spinButton = spin2 )
|
||||
self.time24 = wxTimeCtrl( self, -1, name="24 hour control", fmt24hr=True, spinButton=spin2 )
|
||||
|
||||
text3 = wxStaticText( self, -1, "No seconds\nor spin button:")
|
||||
self.spinless_ctrl = wxTimeCtrl( self, -1, name="spinless control", display_seconds = False )
|
||||
self.spinless_ctrl = wxTimeCtrl( self, -1, name="spinless control", displaySeconds=False )
|
||||
|
||||
grid = wxFlexGridSizer( 0, 2, 10, 5 )
|
||||
grid.Add( text1, 0, wxALIGN_RIGHT )
|
||||
@@ -68,11 +68,12 @@ class TestPanel( wxScrolledPanel ):
|
||||
self.set_bounds = wxCheckBox( self, -1, "Set time bounds:" )
|
||||
|
||||
minlabel = wxStaticText( self, -1, "minimum time:" )
|
||||
self.min = wxTimeCtrl( self, -1, name="min", display_seconds = False )
|
||||
# (Show use of format parameter to alternatively specify format of control:)
|
||||
self.min = wxTimeCtrl( self, -1, name="min", format="HHMM" )
|
||||
self.min.Enable( False )
|
||||
|
||||
maxlabel = wxStaticText( self, -1, "maximum time:" )
|
||||
self.max = wxTimeCtrl( self, -1, name="max", display_seconds = False )
|
||||
self.max = wxTimeCtrl( self, -1, name="max", format="HHMM" )
|
||||
self.max.Enable( False )
|
||||
|
||||
self.limit_check = wxCheckBox( self, -1, "Limit control" )
|
||||
|
Reference in New Issue
Block a user