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
|
||||
|
@@ -22,7 +22,7 @@ class TestPanel( wxScrolledPanel ):
|
||||
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" )
|
||||
|
@@ -535,7 +535,7 @@ def EVT_SPLITTER_UNSPLIT(win, id, func):
|
||||
|
||||
def EVT_SPLITTER_DOUBLECLICKED(win, id, func):
|
||||
win.Connect(id, -1, wxEVT_COMMAND_SPLITTER_DOUBLECLICKED, func)
|
||||
|
||||
EVT_SPLITTER_DCLICK = EVT_SPLITTER_DOUBLECLICKED
|
||||
|
||||
# wxTimer
|
||||
def EVT_TIMER(win, id, func):
|
||||
|
@@ -114,7 +114,7 @@ class wxCalendarEvent : public wxCommandEvent
|
||||
public:
|
||||
wxCalendarEvent(wxCalendarCtrl *cal, wxEventType type);
|
||||
|
||||
const wxDateTime& GetDate() const;
|
||||
const wxDateTime GetDate() const;
|
||||
wxDateTime::WeekDay GetWeekDay() const;
|
||||
|
||||
};
|
||||
|
@@ -350,12 +350,12 @@ class wxListEvent: public wxNotifyEvent {
|
||||
public:
|
||||
wxListEvent(wxEventType commandType = wxEVT_NULL, int id = 0);
|
||||
|
||||
%readonly
|
||||
int m_code;
|
||||
long m_oldItemIndex;
|
||||
long m_itemIndex;
|
||||
int m_col;
|
||||
wxPoint m_pointDrag;
|
||||
%readonly
|
||||
wxListItem m_item;
|
||||
%readwrite
|
||||
|
||||
|
@@ -941,7 +941,7 @@ public:
|
||||
class wxGridCellFloatEditor : public wxGridCellTextEditor
|
||||
{
|
||||
public:
|
||||
wxGridCellFloatEditor();
|
||||
wxGridCellFloatEditor(int width = -1, int precision = -1);
|
||||
%pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
|
||||
};
|
||||
|
||||
|
@@ -1193,9 +1193,8 @@ off_t wxPyCBInputStream::OnSysTell() const {
|
||||
if (PyLong_Check(result))
|
||||
o = PyLong_AsLongLong(result);
|
||||
else
|
||||
#else
|
||||
o = PyInt_AsLong(result);
|
||||
#endif
|
||||
o = PyInt_AsLong(result);
|
||||
Py_DECREF(result);
|
||||
};
|
||||
wxPyEndBlockThreads();
|
||||
|
Reference in New Issue
Block a user