mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-09-22 14:20:35 +08:00
wxPython updates to match recent updates to wxCalendarCtrl, wxGrid,
and wxGLCanvas. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12278 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -94,7 +94,7 @@ public:
|
||||
|
||||
|
||||
|
||||
class wxGLCanvas : public wxScrolledWindow {
|
||||
class wxGLCanvas : public wxWindow {
|
||||
public:
|
||||
wxGLCanvas(wxWindow *parent, wxWindowID id = -1,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
|
||||
@@ -288,22 +288,6 @@ static PyObject *_wrap_wxGLContext_GetWindow(PyObject *self, PyObject *args, PyO
|
||||
return _resultobj;
|
||||
}
|
||||
|
||||
static void *SwigwxGLCanvasTowxScrolledWindow(void *ptr) {
|
||||
wxGLCanvas *src;
|
||||
wxScrolledWindow *dest;
|
||||
src = (wxGLCanvas *) ptr;
|
||||
dest = (wxScrolledWindow *) src;
|
||||
return (void *) dest;
|
||||
}
|
||||
|
||||
static void *SwigwxGLCanvasTowxPanel(void *ptr) {
|
||||
wxGLCanvas *src;
|
||||
wxPanel *dest;
|
||||
src = (wxGLCanvas *) ptr;
|
||||
dest = (wxPanel *) src;
|
||||
return (void *) dest;
|
||||
}
|
||||
|
||||
static void *SwigwxGLCanvasTowxWindow(void *ptr) {
|
||||
wxGLCanvas *src;
|
||||
wxWindow *dest;
|
||||
@@ -810,7 +794,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
|
||||
{ "_size_t","_int",0},
|
||||
{ "_size_t","_wxWindowID",0},
|
||||
{ "_size_t","_uint",0},
|
||||
{ "_wxPanel","_wxGLCanvas",SwigwxGLCanvasTowxPanel},
|
||||
{ "_uint","_wxCoord",0},
|
||||
{ "_uint","_wxPrintQuality",0},
|
||||
{ "_uint","_time_t",0},
|
||||
@@ -844,7 +827,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
|
||||
{ "_wxObject","_wxGLContext",SwigwxGLContextTowxObject},
|
||||
{ "_signed_short","_WXTYPE",0},
|
||||
{ "_signed_short","_short",0},
|
||||
{ "_wxScrolledWindow","_wxGLCanvas",SwigwxGLCanvasTowxScrolledWindow},
|
||||
{ "_unsigned_char","_byte",0},
|
||||
{ "_unsigned_int","_wxCoord",0},
|
||||
{ "_unsigned_int","_wxPrintQuality",0},
|
||||
|
||||
@@ -70,7 +70,7 @@ class wxGLContext(wxGLContextPtr):
|
||||
|
||||
|
||||
|
||||
class wxGLCanvasPtr(wxScrolledWindowPtr):
|
||||
class wxGLCanvasPtr(wxWindowPtr):
|
||||
def __init__(self,this):
|
||||
self.this = this
|
||||
self.thisown = 0
|
||||
|
||||
@@ -128,9 +128,9 @@ void wxGLContext::SetColour(const char *colour)
|
||||
* wxGLCanvas implementation
|
||||
*/
|
||||
|
||||
IMPLEMENT_CLASS(wxGLCanvas, wxScrolledWindow)
|
||||
IMPLEMENT_CLASS(wxGLCanvas, wxWindow)
|
||||
|
||||
BEGIN_EVENT_TABLE(wxGLCanvas, wxScrolledWindow)
|
||||
BEGIN_EVENT_TABLE(wxGLCanvas, wxWindow)
|
||||
EVT_SIZE(wxGLCanvas::OnSize)
|
||||
EVT_PALETTE_CHANGED(wxGLCanvas::OnPaletteChanged)
|
||||
EVT_QUERY_NEW_PALETTE(wxGLCanvas::OnQueryNewPalette)
|
||||
@@ -138,7 +138,7 @@ END_EVENT_TABLE()
|
||||
|
||||
wxGLCanvas::wxGLCanvas(wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos, const wxSize& size, long style, const wxString& name,
|
||||
int *attribList, const wxPalette& palette) : wxScrolledWindow()
|
||||
int *attribList, const wxPalette& palette) : wxWindow()
|
||||
{
|
||||
m_glContext = (wxGLContext*) NULL;
|
||||
|
||||
@@ -162,7 +162,7 @@ wxGLCanvas::wxGLCanvas( wxWindow *parent,
|
||||
const wxGLContext *shared, wxWindowID id,
|
||||
const wxPoint& pos, const wxSize& size, long style, const wxString& name,
|
||||
int *attribList, const wxPalette& palette )
|
||||
: wxScrolledWindow()
|
||||
: wxWindow()
|
||||
{
|
||||
m_glContext = (wxGLContext*) NULL;
|
||||
|
||||
@@ -187,7 +187,7 @@ wxGLCanvas::wxGLCanvas( wxWindow *parent,
|
||||
wxGLCanvas::wxGLCanvas( wxWindow *parent, const wxGLCanvas *shared, wxWindowID id,
|
||||
const wxPoint& pos, const wxSize& size, long style, const wxString& name,
|
||||
int *attribList, const wxPalette& palette ):
|
||||
wxScrolledWindow()
|
||||
wxWindow()
|
||||
{
|
||||
m_glContext = (wxGLContext*) NULL;
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#include <wx/setup.h>
|
||||
#undef wxUSE_GLCANVAS
|
||||
#define wxUSE_GLCANVAS 1
|
||||
#if wxUSE_GLCANVAS
|
||||
|
||||
#include <wx/palette.h>
|
||||
#include <wx/scrolwin.h>
|
||||
@@ -84,7 +83,7 @@ public:
|
||||
wxWindow* m_window;
|
||||
};
|
||||
|
||||
class wxGLCanvas: public wxScrolledWindow
|
||||
class wxGLCanvas: public wxWindow
|
||||
{
|
||||
DECLARE_CLASS(wxGLCanvas)
|
||||
public:
|
||||
@@ -152,8 +151,6 @@ private:
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
// wxUSE_GLCANVAS
|
||||
#endif
|
||||
// _WX_GLCANVAS_H_
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
.emacs.desktop
|
||||
b.bat
|
||||
hangman_dict.txt
|
||||
mimetypes_wdr
|
||||
setup.bat
|
||||
test.out
|
||||
tmphtml.txt
|
||||
|
||||
@@ -33,6 +33,9 @@ class SimpleGrid(wxGrid): ##, wxGridAutoEditMixin):
|
||||
self.SetCellEditor(6, 0, wxGridCellFloatEditor())
|
||||
self.SetCellValue(6, 0, "123.34")
|
||||
|
||||
self.SetCellValue(6, 3, "You can veto editing this cell")
|
||||
|
||||
|
||||
# attribute objects let you keep a set of formatting values
|
||||
# in one spot, and reuse them if needed
|
||||
attr = wxGridCellAttr()
|
||||
@@ -168,15 +171,29 @@ class SimpleGrid(wxGrid): ##, wxGridAutoEditMixin):
|
||||
|
||||
|
||||
def OnEditorShown(self, evt):
|
||||
if evt.GetRow() == 6 and evt.GetCol() == 3 and \
|
||||
wxMessageBox("Are you sure you wish to edit this cell?",
|
||||
"Checking", wxYES_NO) == wxNO:
|
||||
evt.Veto()
|
||||
return
|
||||
|
||||
self.log.write("OnEditorShown: (%d,%d) %s\n" %
|
||||
(evt.GetRow(), evt.GetCol(), evt.GetPosition()))
|
||||
evt.Skip()
|
||||
|
||||
|
||||
def OnEditorHidden(self, evt):
|
||||
if evt.GetRow() == 6 and evt.GetCol() == 3 and \
|
||||
wxMessageBox("Are you sure you wish to finish editing this cell?",
|
||||
"Checking", wxYES_NO) == wxNO:
|
||||
evt.Veto()
|
||||
return
|
||||
|
||||
self.log.write("OnEditorHidden: (%d,%d) %s\n" %
|
||||
(evt.GetRow(), evt.GetCol(), evt.GetPosition()))
|
||||
evt.Skip()
|
||||
|
||||
|
||||
def OnEditorCreated(self, evt):
|
||||
self.log.write("OnEditorCreated: (%d, %d) %s\n" %
|
||||
(evt.GetRow(), evt.GetCol(), evt.GetControl()))
|
||||
|
||||
@@ -41,6 +41,8 @@ enum {
|
||||
wxCAL_SHOW_HOLIDAYS,
|
||||
wxCAL_NO_YEAR_CHANGE,
|
||||
wxCAL_NO_MONTH_CHANGE,
|
||||
wxCAL_SEQUENTIAL_MONTH_SELECTION,
|
||||
wxCAL_SHOW_SURROUNDING_WEEKS,
|
||||
};
|
||||
|
||||
|
||||
@@ -49,6 +51,9 @@ enum wxCalendarHitTestResult
|
||||
wxCAL_HITTEST_NOWHERE, // outside of anything
|
||||
wxCAL_HITTEST_HEADER, // on the header (weekdays)
|
||||
wxCAL_HITTEST_DAY // on a day in the calendar
|
||||
wxCAL_HITTEST_INCMONTH,
|
||||
wxCAL_HITTEST_DECMONTH,
|
||||
wxCAL_HITTEST_SURROUNDING_WEEK
|
||||
};
|
||||
|
||||
// border types for a date
|
||||
@@ -176,6 +181,18 @@ public:
|
||||
void SetDate(const wxDateTime& date);
|
||||
const wxDateTime& GetDate() const;
|
||||
|
||||
// set/get the range in which selection can occur
|
||||
// ---------------------------------------------
|
||||
|
||||
bool SetLowerDateLimit(const wxDateTime& date = wxDefaultDateTime);
|
||||
const wxDateTime& GetLowerDateLimit() const;
|
||||
bool SetUpperDateLimit(const wxDateTime& date = wxDefaultDateTime);
|
||||
const wxDateTime& GetUpperDateLimit() const;
|
||||
|
||||
bool SetDateRange(const wxDateTime& lowerdate = wxDefaultDateTime,
|
||||
const wxDateTime& upperdate = wxDefaultDateTime);
|
||||
|
||||
|
||||
// calendar mode
|
||||
// -------------
|
||||
|
||||
@@ -231,6 +248,10 @@ public:
|
||||
wxDateTime *date = NULL,
|
||||
wxDateTime::WeekDay *wd = NULL);
|
||||
|
||||
|
||||
bool Enable(bool enable = TRUE);
|
||||
bool Show(bool show = TRUE);
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
+267
-667
File diff suppressed because it is too large
Load Diff
@@ -35,80 +35,6 @@ def EVT_CALENDAR_WEEKDAY_CLICKED(win, id, fn):
|
||||
win.Connect(id, -1, wxEVT_CALENDAR_WEEKDAY_CLICKED, fn)
|
||||
|
||||
|
||||
class wxCalendarDateAttrPtr :
|
||||
def __init__(self,this):
|
||||
self.this = this
|
||||
self.thisown = 0
|
||||
def SetTextColour(self, *_args, **_kwargs):
|
||||
val = apply(calendarc.wxCalendarDateAttr_SetTextColour,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def SetBackgroundColour(self, *_args, **_kwargs):
|
||||
val = apply(calendarc.wxCalendarDateAttr_SetBackgroundColour,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def SetBorderColour(self, *_args, **_kwargs):
|
||||
val = apply(calendarc.wxCalendarDateAttr_SetBorderColour,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def SetFont(self, *_args, **_kwargs):
|
||||
val = apply(calendarc.wxCalendarDateAttr_SetFont,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def SetBorder(self, *_args, **_kwargs):
|
||||
val = apply(calendarc.wxCalendarDateAttr_SetBorder,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def SetHoliday(self, *_args, **_kwargs):
|
||||
val = apply(calendarc.wxCalendarDateAttr_SetHoliday,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def HasTextColour(self, *_args, **_kwargs):
|
||||
val = apply(calendarc.wxCalendarDateAttr_HasTextColour,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def HasBackgroundColour(self, *_args, **_kwargs):
|
||||
val = apply(calendarc.wxCalendarDateAttr_HasBackgroundColour,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def HasBorderColour(self, *_args, **_kwargs):
|
||||
val = apply(calendarc.wxCalendarDateAttr_HasBorderColour,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def HasFont(self, *_args, **_kwargs):
|
||||
val = apply(calendarc.wxCalendarDateAttr_HasFont,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def HasBorder(self, *_args, **_kwargs):
|
||||
val = apply(calendarc.wxCalendarDateAttr_HasBorder,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def IsHoliday(self, *_args, **_kwargs):
|
||||
val = apply(calendarc.wxCalendarDateAttr_IsHoliday,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def GetTextColour(self, *_args, **_kwargs):
|
||||
val = apply(calendarc.wxCalendarDateAttr_GetTextColour,(self,) + _args, _kwargs)
|
||||
if val: val = wxColourPtr(val)
|
||||
return val
|
||||
def GetBackgroundColour(self, *_args, **_kwargs):
|
||||
val = apply(calendarc.wxCalendarDateAttr_GetBackgroundColour,(self,) + _args, _kwargs)
|
||||
if val: val = wxColourPtr(val)
|
||||
return val
|
||||
def GetBorderColour(self, *_args, **_kwargs):
|
||||
val = apply(calendarc.wxCalendarDateAttr_GetBorderColour,(self,) + _args, _kwargs)
|
||||
if val: val = wxColourPtr(val)
|
||||
return val
|
||||
def GetFont(self, *_args, **_kwargs):
|
||||
val = apply(calendarc.wxCalendarDateAttr_GetFont,(self,) + _args, _kwargs)
|
||||
if val: val = wxFontPtr(val)
|
||||
return val
|
||||
def GetBorder(self, *_args, **_kwargs):
|
||||
val = apply(calendarc.wxCalendarDateAttr_GetBorder,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def __repr__(self):
|
||||
return "<C wxCalendarDateAttr instance at %s>" % (self.this,)
|
||||
class wxCalendarDateAttr(wxCalendarDateAttrPtr):
|
||||
def __init__(self,*_args,**_kwargs):
|
||||
self.this = apply(calendarc.new_wxCalendarDateAttr,_args,_kwargs)
|
||||
self.thisown = 1
|
||||
|
||||
|
||||
|
||||
def wxCalendarDateAttrBorder(*_args,**_kwargs):
|
||||
val = wxCalendarDateAttrPtr(apply(calendarc.new_wxCalendarDateAttrBorder,_args,_kwargs))
|
||||
val.thisown = 1
|
||||
return val
|
||||
|
||||
|
||||
class wxCalendarEventPtr(wxCommandEventPtr):
|
||||
def __init__(self,this):
|
||||
self.this = this
|
||||
@@ -144,6 +70,23 @@ class wxCalendarCtrlPtr(wxControlPtr):
|
||||
val = apply(calendarc.wxCalendarCtrl_GetDate,(self,) + _args, _kwargs)
|
||||
if val: val = wxDateTimePtr(val)
|
||||
return val
|
||||
def SetLowerDateLimit(self, *_args, **_kwargs):
|
||||
val = apply(calendarc.wxCalendarCtrl_SetLowerDateLimit,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def GetLowerDateLimit(self, *_args, **_kwargs):
|
||||
val = apply(calendarc.wxCalendarCtrl_GetLowerDateLimit,(self,) + _args, _kwargs)
|
||||
if val: val = wxDateTimePtr(val)
|
||||
return val
|
||||
def SetUpperDateLimit(self, *_args, **_kwargs):
|
||||
val = apply(calendarc.wxCalendarCtrl_SetUpperDateLimit,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def GetUpperDateLimit(self, *_args, **_kwargs):
|
||||
val = apply(calendarc.wxCalendarCtrl_GetUpperDateLimit,(self,) + _args, _kwargs)
|
||||
if val: val = wxDateTimePtr(val)
|
||||
return val
|
||||
def SetDateRange(self, *_args, **_kwargs):
|
||||
val = apply(calendarc.wxCalendarCtrl_SetDateRange,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def EnableYearChange(self, *_args, **_kwargs):
|
||||
val = apply(calendarc.wxCalendarCtrl_EnableYearChange,(self,) + _args, _kwargs)
|
||||
return val
|
||||
@@ -188,7 +131,6 @@ class wxCalendarCtrlPtr(wxControlPtr):
|
||||
return val
|
||||
def GetAttr(self, *_args, **_kwargs):
|
||||
val = apply(calendarc.wxCalendarCtrl_GetAttr,(self,) + _args, _kwargs)
|
||||
if val: val = wxCalendarDateAttrPtr(val)
|
||||
return val
|
||||
def SetAttr(self, *_args, **_kwargs):
|
||||
val = apply(calendarc.wxCalendarCtrl_SetAttr,(self,) + _args, _kwargs)
|
||||
@@ -202,6 +144,12 @@ class wxCalendarCtrlPtr(wxControlPtr):
|
||||
def HitTest(self, *_args, **_kwargs):
|
||||
val = apply(calendarc.wxCalendarCtrl_HitTest,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def Enable(self, *_args, **_kwargs):
|
||||
val = apply(calendarc.wxCalendarCtrl_Enable,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def Show(self, *_args, **_kwargs):
|
||||
val = apply(calendarc.wxCalendarCtrl_Show,(self,) + _args, _kwargs)
|
||||
return val
|
||||
def __repr__(self):
|
||||
return "<C wxCalendarCtrl instance at %s>" % (self.this,)
|
||||
class wxCalendarCtrl(wxCalendarCtrlPtr):
|
||||
@@ -232,12 +180,11 @@ wxCAL_MONDAY_FIRST = calendarc.wxCAL_MONDAY_FIRST
|
||||
wxCAL_SHOW_HOLIDAYS = calendarc.wxCAL_SHOW_HOLIDAYS
|
||||
wxCAL_NO_YEAR_CHANGE = calendarc.wxCAL_NO_YEAR_CHANGE
|
||||
wxCAL_NO_MONTH_CHANGE = calendarc.wxCAL_NO_MONTH_CHANGE
|
||||
wxCAL_SEQUENTIAL_MONTH_SELECTION = calendarc.wxCAL_SEQUENTIAL_MONTH_SELECTION
|
||||
wxCAL_SHOW_SURROUNDING_WEEKS = calendarc.wxCAL_SHOW_SURROUNDING_WEEKS
|
||||
wxCAL_HITTEST_NOWHERE = calendarc.wxCAL_HITTEST_NOWHERE
|
||||
wxCAL_HITTEST_HEADER = calendarc.wxCAL_HITTEST_HEADER
|
||||
wxCAL_HITTEST_DAY = calendarc.wxCAL_HITTEST_DAY
|
||||
wxCAL_BORDER_NONE = calendarc.wxCAL_BORDER_NONE
|
||||
wxCAL_BORDER_SQUARE = calendarc.wxCAL_BORDER_SQUARE
|
||||
wxCAL_BORDER_ROUND = calendarc.wxCAL_BORDER_ROUND
|
||||
wxEVT_CALENDAR_DOUBLECLICKED = calendarc.wxEVT_CALENDAR_DOUBLECLICKED
|
||||
wxEVT_CALENDAR_SEL_CHANGED = calendarc.wxEVT_CALENDAR_SEL_CHANGED
|
||||
wxEVT_CALENDAR_DAY_CHANGED = calendarc.wxEVT_CALENDAR_DAY_CHANGED
|
||||
|
||||
Reference in New Issue
Block a user