From: Robin Dunn Date: Wed, 29 Dec 1999 20:07:27 +0000 (+0000) Subject: Added some missing EVT_ functions X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/3af4e610b182d2aeb504bdeeef8b44cb1279f28e Added some missing EVT_ functions Fixes to wxPython.lib.wxCalendar for new toolbar and region code other fixes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5144 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/utils/wxPython/CHANGES.txt b/utils/wxPython/CHANGES.txt index 76c78b0874..9ed776e60b 100644 --- a/utils/wxPython/CHANGES.txt +++ b/utils/wxPython/CHANGES.txt @@ -70,6 +70,7 @@ Removed all non wx stuff from the glcanvas module since DA's PyOpenGL is better and compatible with the wxGLCanvas. You can get it at http://starship.python.net:9673/crew/da/Code/PyOpenGL. +Added some missing EVT_ functions. diff --git a/utils/wxPython/demo/Threads.py b/utils/wxPython/demo/Threads.py index 0aa4c91320..2dabc263b8 100644 --- a/utils/wxPython/demo/Threads.py +++ b/utils/wxPython/demo/Threads.py @@ -131,6 +131,8 @@ class GraphWindow(wxWindow): wdc.Blit(0,0, size.width, size.height, dc, 0,0) wdc.EndDrawing() + dc.SelectObject(wxNullBitmap) + def OnEraseBackground(self, evt): pass diff --git a/utils/wxPython/demo/wxCalendar.py b/utils/wxPython/demo/wxCalendar.py index 6ef4e745d2..eda9cd341a 100644 --- a/utils/wxPython/demo/wxCalendar.py +++ b/utils/wxPython/demo/wxCalendar.py @@ -394,7 +394,8 @@ class CalendFrame(wxFrame): def SetToolPath(self, tb, id, bmp, title): global dir_path - tb.AddTool(id, wxBitmap(os.path.join(dir_path, bmp), wxBITMAP_TYPE_BMP), wxNullBitmap, false, -1, -1, title, title) + tb.AddSimpleTool(id, wxBitmap(os.path.join(dir_path, bmp), wxBITMAP_TYPE_BMP), + title, title) class MyApp(wxApp): diff --git a/utils/wxPython/lib/calendar.py b/utils/wxPython/lib/calendar.py index d56a702772..eb394e9734 100644 --- a/utils/wxPython/lib/calendar.py +++ b/utils/wxPython/lib/calendar.py @@ -392,7 +392,7 @@ class wxCalendar(wxWindow): for key in self.rg.keys(): val = self.rg[key] rt = wxRegion() - rt.Union(val) + rt.UnionRect(val) if rt.Contains(mx, my) != 0: result = self.TestDay(key) return result diff --git a/utils/wxPython/src/_defs.i b/utils/wxPython/src/_defs.i index 0954ef199d..c5121712ac 100644 --- a/utils/wxPython/src/_defs.i +++ b/utils/wxPython/src/_defs.i @@ -768,6 +768,7 @@ enum wxEventType { wxEVT_COMMAND_LISTBOX_SELECTED, wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, + wxEVT_COMMAND_SPINCTRL_UPDATED, wxEVT_COMMAND_TEXT_UPDATED, wxEVT_COMMAND_TEXT_ENTER, wxEVT_COMMAND_MENU_SELECTED, diff --git a/utils/wxPython/src/_extras.py b/utils/wxPython/src/_extras.py index aa94aefeed..53cb1132af 100644 --- a/utils/wxPython/src/_extras.py +++ b/utils/wxPython/src/_extras.py @@ -146,6 +146,20 @@ def EVT_ICONIZE(win, func): def EVT_NAVIGATION_KEY(win, func): win.Connect(-1, -1, wxEVT_NAVIGATION_KEY, func) +def EVT_PALETTE_CHANGED(win, func): + win.Connect(-1, -1, wxEVT_PALETTE_CHANGED, func) + +def EVT_QUERY_NEW_PALETTE(win, func): + win.Connect(-1, -1, wxEVT_QUERY_NEW_PALETTE, func) + +def EVT_WINDOW_CREATE(win, func): + win.Connect(-1, -1, wxEVT_WINDOW_CREATE, func) + +def EVT_WINDOW_DESTROY(win, func): + win.Connect(-1, -1, wxEVT_WINDOW_DESTROY, func) + + + def EVT_IDLE(win, func): win.Connect(-1, -1, wxEVT_IDLE, func) @@ -390,15 +404,25 @@ def EVT_COMBOBOX(win, id, func): def EVT_TOOL(win, id, func): win.Connect(id, -1, wxEVT_COMMAND_TOOL_CLICKED, func) +def EVT_TOOL_RANGE(win, id, id2, func): + win.Connect(id, id2, wxEVT_COMMAND_TOOL_CLICKED, func) + def EVT_TOOL_RCLICKED(win, id, func): win.Connect(id, -1, wxEVT_COMMAND_TOOL_RCLICKED, func) +def EVT_TOOL_RCLICKED_RANGE(win, id, id2, func): + win.Connect(id, id2, wxEVT_COMMAND_TOOL_RCLICKED, func) + def EVT_TOOL_ENTER(win, id, func): win.Connect(id, -1, wxEVT_COMMAND_TOOL_ENTER, func) def EVT_CHECKLISTBOX(win, id, func): win.Connect(id, -1, wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, func) +def EVT_SPINCTRL(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_SPINCTRL_UPDATED, func) + + # Generic command events diff --git a/utils/wxPython/src/msw/printfw.cpp b/utils/wxPython/src/msw/printfw.cpp index 65d2ebe346..e4a9868116 100644 --- a/utils/wxPython/src/msw/printfw.cpp +++ b/utils/wxPython/src/msw/printfw.cpp @@ -112,7 +112,7 @@ static char* wxStringErrorMsg = "string type is required for parameter"; // Since this one would be tough and ugly to do with the Macros... void wxPyPrintout::GetPageInfo(int *minPage, int *maxPage, int *pageFrom, int *pageTo) { - bool hadErr = false; + bool hadErr = FALSE; bool doSave = wxPyRestoreThread(); if (m_myInst.findCallback("GetPageInfo")) { @@ -122,22 +122,22 @@ void wxPyPrintout::GetPageInfo(int *minPage, int *maxPage, int *pageFrom, int *p val = PyTuple_GetItem(result, 0); if (PyInt_Check(val)) *minPage = PyInt_AsLong(val); - else hadErr = true; + else hadErr = TRUE; val = PyTuple_GetItem(result, 1); if (PyInt_Check(val)) *maxPage = PyInt_AsLong(val); - else hadErr = true; + else hadErr = TRUE; val = PyTuple_GetItem(result, 2); if (PyInt_Check(val)) *pageFrom = PyInt_AsLong(val); - else hadErr = true; + else hadErr = TRUE; val = PyTuple_GetItem(result, 3); if (PyInt_Check(val)) *pageTo = PyInt_AsLong(val); - else hadErr = true; + else hadErr = TRUE; } else - hadErr = true; + hadErr = TRUE; if (hadErr) { PyErr_SetString(PyExc_TypeError, "GetPageInfo should return a tuple of 4 integers."); diff --git a/utils/wxPython/src/msw/wx.cpp b/utils/wxPython/src/msw/wx.cpp index 6c761f2cf3..9559317838 100644 --- a/utils/wxPython/src/msw/wx.cpp +++ b/utils/wxPython/src/msw/wx.cpp @@ -2605,6 +2605,7 @@ SWIGEXPORT(void) initwxc() { PyDict_SetItemString(d,"wxEVT_COMMAND_LISTBOX_SELECTED", PyInt_FromLong((long) wxEVT_COMMAND_LISTBOX_SELECTED)); PyDict_SetItemString(d,"wxEVT_COMMAND_LISTBOX_DOUBLECLICKED", PyInt_FromLong((long) wxEVT_COMMAND_LISTBOX_DOUBLECLICKED)); PyDict_SetItemString(d,"wxEVT_COMMAND_CHECKLISTBOX_TOGGLED", PyInt_FromLong((long) wxEVT_COMMAND_CHECKLISTBOX_TOGGLED)); + PyDict_SetItemString(d,"wxEVT_COMMAND_SPINCTRL_UPDATED", PyInt_FromLong((long) wxEVT_COMMAND_SPINCTRL_UPDATED)); PyDict_SetItemString(d,"wxEVT_COMMAND_TEXT_UPDATED", PyInt_FromLong((long) wxEVT_COMMAND_TEXT_UPDATED)); PyDict_SetItemString(d,"wxEVT_COMMAND_TEXT_ENTER", PyInt_FromLong((long) wxEVT_COMMAND_TEXT_ENTER)); PyDict_SetItemString(d,"wxEVT_COMMAND_MENU_SELECTED", PyInt_FromLong((long) wxEVT_COMMAND_MENU_SELECTED)); diff --git a/utils/wxPython/src/msw/wx.py b/utils/wxPython/src/msw/wx.py index 89af171ebb..cfa48e2254 100644 --- a/utils/wxPython/src/msw/wx.py +++ b/utils/wxPython/src/msw/wx.py @@ -668,6 +668,7 @@ wxEVT_COMMAND_CHOICE_SELECTED = wxc.wxEVT_COMMAND_CHOICE_SELECTED wxEVT_COMMAND_LISTBOX_SELECTED = wxc.wxEVT_COMMAND_LISTBOX_SELECTED wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = wxc.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = wxc.wxEVT_COMMAND_CHECKLISTBOX_TOGGLED +wxEVT_COMMAND_SPINCTRL_UPDATED = wxc.wxEVT_COMMAND_SPINCTRL_UPDATED wxEVT_COMMAND_TEXT_UPDATED = wxc.wxEVT_COMMAND_TEXT_UPDATED wxEVT_COMMAND_TEXT_ENTER = wxc.wxEVT_COMMAND_TEXT_ENTER wxEVT_COMMAND_MENU_SELECTED = wxc.wxEVT_COMMAND_MENU_SELECTED @@ -967,6 +968,20 @@ def EVT_ICONIZE(win, func): def EVT_NAVIGATION_KEY(win, func): win.Connect(-1, -1, wxEVT_NAVIGATION_KEY, func) +def EVT_PALETTE_CHANGED(win, func): + win.Connect(-1, -1, wxEVT_PALETTE_CHANGED, func) + +def EVT_QUERY_NEW_PALETTE(win, func): + win.Connect(-1, -1, wxEVT_QUERY_NEW_PALETTE, func) + +def EVT_WINDOW_CREATE(win, func): + win.Connect(-1, -1, wxEVT_WINDOW_CREATE, func) + +def EVT_WINDOW_DESTROY(win, func): + win.Connect(-1, -1, wxEVT_WINDOW_DESTROY, func) + + + def EVT_IDLE(win, func): win.Connect(-1, -1, wxEVT_IDLE, func) @@ -1211,15 +1226,25 @@ def EVT_COMBOBOX(win, id, func): def EVT_TOOL(win, id, func): win.Connect(id, -1, wxEVT_COMMAND_TOOL_CLICKED, func) +def EVT_TOOL_RANGE(win, id, id2, func): + win.Connect(id, id2, wxEVT_COMMAND_TOOL_CLICKED, func) + def EVT_TOOL_RCLICKED(win, id, func): win.Connect(id, -1, wxEVT_COMMAND_TOOL_RCLICKED, func) +def EVT_TOOL_RCLICKED_RANGE(win, id, id2, func): + win.Connect(id, id2, wxEVT_COMMAND_TOOL_RCLICKED, func) + def EVT_TOOL_ENTER(win, id, func): win.Connect(id, -1, wxEVT_COMMAND_TOOL_ENTER, func) def EVT_CHECKLISTBOX(win, id, func): win.Connect(id, -1, wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, func) +def EVT_SPINCTRL(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_SPINCTRL_UPDATED, func) + + # Generic command events