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:
Robin Dunn
2005-05-23 22:29:06 +00:00
parent 5da070d00f
commit c580b5db1f
8 changed files with 27 additions and 22 deletions

View File

@@ -598,7 +598,8 @@ class SetPrintout(wxPrintout):
class MyApp(wxApp): class MyApp(wxApp):
def OnInit(self): def OnInit(self):
frame = CalendFrame(None, -1, "Test Calendar") wxInitAllImageHandlers()
frame = CalendFrame(None, -1, "Test Calendar", sys.stdout)
frame.Show(True) frame.Show(True)
self.SetTopWindow(frame) self.SetTopWindow(frame)
return True 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): def runTest(frame, nb, log):
win = TestPanel(nb, log, frame) win = TestPanel(nb, log, frame)
return win 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 = """\ 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. 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.

View File

@@ -96,14 +96,18 @@ else:
EVT_LEFT_UP(self, self.OnMouseUp) EVT_LEFT_UP(self, self.OnMouseUp)
EVT_MOTION(self, self.OnMouseMotion) EVT_MOTION(self, self.OnMouseMotion)
def OnEraseBackground(self, event): def OnEraseBackground(self, event):
pass # Do nothing, to avoid flashing on MSW. pass # Do nothing, to avoid flashing on MSW.
def OnSize(self, event): def OnSize(self, event):
size = self.GetClientSize() size = self.GetClientSize()
if self.GetContext(): if self.GetContext():
self.SetCurrent() self.SetCurrent()
glViewport(0, 0, size.width, size.height) glViewport(0, 0, size.width, size.height)
event.Skip()
def OnPaint(self, event): def OnPaint(self, event):
dc = wxPaintDC(self) dc = wxPaintDC(self)
@@ -113,12 +117,15 @@ else:
self.init = True self.init = True
self.OnDraw() self.OnDraw()
def OnMouseDown(self, evt): def OnMouseDown(self, evt):
self.CaptureMouse() self.CaptureMouse()
def OnMouseUp(self, evt): def OnMouseUp(self, evt):
self.ReleaseMouse() self.ReleaseMouse()
def OnMouseMotion(self, evt): def OnMouseMotion(self, evt):
if evt.Dragging() and evt.LeftIsDown(): if evt.Dragging() and evt.LeftIsDown():
self.x, self.y = self.lastx, self.lasty self.x, self.y = self.lastx, self.lasty

View File

@@ -19,10 +19,10 @@ class TestPanel( wxScrolledPanel ):
text2 = wxStaticText( self, -1, "24-hour format:") text2 = wxStaticText( self, -1, "24-hour format:")
spin2 = wxSpinButton( self, -1, wxDefaultPosition, wxSize(-1,20), 0 ) 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:") 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 = wxFlexGridSizer( 0, 2, 10, 5 )
grid.Add( text1, 0, wxALIGN_RIGHT ) grid.Add( text1, 0, wxALIGN_RIGHT )
@@ -68,11 +68,12 @@ class TestPanel( wxScrolledPanel ):
self.set_bounds = wxCheckBox( self, -1, "Set time bounds:" ) self.set_bounds = wxCheckBox( self, -1, "Set time bounds:" )
minlabel = wxStaticText( self, -1, "minimum time:" ) 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 ) self.min.Enable( False )
maxlabel = wxStaticText( self, -1, "maximum time:" ) 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.max.Enable( False )
self.limit_check = wxCheckBox( self, -1, "Limit control" ) self.limit_check = wxCheckBox( self, -1, "Limit control" )

View File

@@ -535,7 +535,7 @@ def EVT_SPLITTER_UNSPLIT(win, id, func):
def EVT_SPLITTER_DOUBLECLICKED(win, id, func): def EVT_SPLITTER_DOUBLECLICKED(win, id, func):
win.Connect(id, -1, wxEVT_COMMAND_SPLITTER_DOUBLECLICKED, func) win.Connect(id, -1, wxEVT_COMMAND_SPLITTER_DOUBLECLICKED, func)
EVT_SPLITTER_DCLICK = EVT_SPLITTER_DOUBLECLICKED
# wxTimer # wxTimer
def EVT_TIMER(win, id, func): def EVT_TIMER(win, id, func):

View File

@@ -114,7 +114,7 @@ class wxCalendarEvent : public wxCommandEvent
public: public:
wxCalendarEvent(wxCalendarCtrl *cal, wxEventType type); wxCalendarEvent(wxCalendarCtrl *cal, wxEventType type);
const wxDateTime& GetDate() const; const wxDateTime GetDate() const;
wxDateTime::WeekDay GetWeekDay() const; wxDateTime::WeekDay GetWeekDay() const;
}; };

View File

@@ -350,12 +350,12 @@ class wxListEvent: public wxNotifyEvent {
public: public:
wxListEvent(wxEventType commandType = wxEVT_NULL, int id = 0); wxListEvent(wxEventType commandType = wxEVT_NULL, int id = 0);
%readonly
int m_code; int m_code;
long m_oldItemIndex; long m_oldItemIndex;
long m_itemIndex; long m_itemIndex;
int m_col; int m_col;
wxPoint m_pointDrag; wxPoint m_pointDrag;
%readonly
wxListItem m_item; wxListItem m_item;
%readwrite %readwrite

View File

@@ -941,7 +941,7 @@ public:
class wxGridCellFloatEditor : public wxGridCellTextEditor class wxGridCellFloatEditor : public wxGridCellTextEditor
{ {
public: public:
wxGridCellFloatEditor(); wxGridCellFloatEditor(int width = -1, int precision = -1);
%pragma(python) addtomethod = "__init__:self._setOORInfo(self)" %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
}; };

View File

@@ -1193,9 +1193,8 @@ off_t wxPyCBInputStream::OnSysTell() const {
if (PyLong_Check(result)) if (PyLong_Check(result))
o = PyLong_AsLongLong(result); o = PyLong_AsLongLong(result);
else else
#else
o = PyInt_AsLong(result);
#endif #endif
o = PyInt_AsLong(result);
Py_DECREF(result); Py_DECREF(result);
}; };
wxPyEndBlockThreads(); wxPyEndBlockThreads();