From c7e7022c2c800a01e0b95d371fb213b0d25e3214 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 14 Aug 2001 19:19:48 +0000 Subject: [PATCH] Deprecated PyShell and PyShellWindow, added a snapshot of PyCrust. Added the new virtual list capabilities to wxListCtrl. Other odds and ends. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11380 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/CHANGES.txt | 2 + wxPython/demo/Main.py | 8 +- wxPython/demo/PyCrust.py | 16 + wxPython/demo/PyShell.py | 21 - wxPython/demo/PyShellWindow.py | 15 - wxPython/demo/VirtualListCtrl.py | 51 + wxPython/demo/wxListCtrl.py | 76 +- wxPython/demo/wxStyledTextCtrl_1.py | 17 +- wxPython/demo/wxTextCtrl.py | 18 +- wxPython/setup.py | 2 +- wxPython/src/_defs.i | 2 + wxPython/src/_extras.py | 55 +- wxPython/src/controls2.i | 480 +++-- wxPython/src/events.i | 11 + wxPython/src/gdi.i | 4 + wxPython/src/helpers.h | 98 +- wxPython/src/msw/controls2.cpp | 1896 ++++++++++------- wxPython/src/msw/controls2.py | 325 +-- wxPython/src/msw/events.cpp | 154 ++ wxPython/src/msw/events.py | 23 + wxPython/src/msw/gdi.cpp | 29 + wxPython/src/msw/gdi.py | 3 + wxPython/src/msw/windows.cpp | 176 ++ wxPython/src/msw/windows.py | 18 + wxPython/src/windows.i | 8 + wxPython/wxPython/lib/PyCrust/PyCrust.py | 148 ++ .../wxPython/lib/PyCrust/PyCrustEditor.py | 349 +++ .../wxPython/lib/PyCrust/PyCrustInterp.py | 81 + wxPython/wxPython/lib/PyCrust/PyCrustShell.py | 180 ++ .../wxPython/lib/PyCrust/PyCrustVersion.py | 10 + wxPython/wxPython/lib/PyCrust/__init__.py | 1 + wxPython/wxPython/lib/PyCrust/introspect.py | 140 ++ wxPython/wxPython/lib/PyCrust/pseudo.py | 90 + wxPython/wxPython/lib/pyshell.py | 4 + wxPython/wxPython/lib/shell.py | 5 +- 35 files changed, 3323 insertions(+), 1193 deletions(-) create mode 100644 wxPython/demo/PyCrust.py delete mode 100644 wxPython/demo/PyShell.py delete mode 100644 wxPython/demo/PyShellWindow.py create mode 100644 wxPython/demo/VirtualListCtrl.py create mode 100644 wxPython/wxPython/lib/PyCrust/PyCrust.py create mode 100644 wxPython/wxPython/lib/PyCrust/PyCrustEditor.py create mode 100644 wxPython/wxPython/lib/PyCrust/PyCrustInterp.py create mode 100644 wxPython/wxPython/lib/PyCrust/PyCrustShell.py create mode 100644 wxPython/wxPython/lib/PyCrust/PyCrustVersion.py create mode 100644 wxPython/wxPython/lib/PyCrust/__init__.py create mode 100644 wxPython/wxPython/lib/PyCrust/introspect.py create mode 100644 wxPython/wxPython/lib/PyCrust/pseudo.py diff --git a/wxPython/CHANGES.txt b/wxPython/CHANGES.txt index 42b3fdd3e5..5c0b736ae9 100644 --- a/wxPython/CHANGES.txt +++ b/wxPython/CHANGES.txt @@ -9,7 +9,9 @@ EVT_DETAILED_HELP_RANGE, EVT_CONTEXT_MENU, wxHelpEvent, wxContextMenuEvent, wxContextHelp, wxContextHelpButton, wxTipWindow, and a demo to show them in action. +Deprecated PyShell and PyShellWindow, added a snapshot of PyCrust. +Added the new virtual list capabilities to wxListCtrl. diff --git a/wxPython/demo/Main.py b/wxPython/demo/Main.py index e1de6b0e69..bd8dea1fce 100644 --- a/wxPython/demo/Main.py +++ b/wxPython/demo/Main.py @@ -23,6 +23,8 @@ import images _treeList = [ ('New since last release', ['ContextHelp', + 'PyCrust', + 'VirtualListCtrl' ]), ('Managed Windows', ['wxFrame', 'wxDialog', 'wxMiniFrame']), @@ -58,10 +60,10 @@ _treeList = [ ('wxPython Library', ['Layoutf', 'wxScrolledMessageDialog', 'wxMultipleChoiceDialog', 'wxPlotCanvas', 'wxFloatBar', - 'PyShell', 'wxCalendar', 'wxMVCTree', 'wxVTKRenderWindow', + 'wxCalendar', 'wxMVCTree', 'wxVTKRenderWindow', 'FileBrowseButton', 'GenericButtons', 'wxEditor', - 'PyShellWindow', 'ColourSelect', 'ImageBrowser', - 'infoframe', 'ColourDB', + 'ColourSelect', 'ImageBrowser', + 'infoframe', 'ColourDB', 'PyCrust', ]), ('Cool Contribs', ['pyTree', 'hangman', 'SlashDot', 'XMLtreeview']), diff --git a/wxPython/demo/PyCrust.py b/wxPython/demo/PyCrust.py new file mode 100644 index 0000000000..f8428f3ef7 --- /dev/null +++ b/wxPython/demo/PyCrust.py @@ -0,0 +1,16 @@ + + +from wxPython.lib.PyCrust import PyCrustShell, PyCrustEditor, PyCrustVersion + + +#---------------------------------------------------------------------- + +intro = 'Welcome To PyCrust %s - The Flakiest Python Shell' % PyCrustVersion.version + +def runTest(frame, nb, log): + shell = PyCrustShell.Shell(nb, intro) + return shell.editor + +#---------------------------------------------------------------------- + +overview = PyCrustShell.__doc__ diff --git a/wxPython/demo/PyShell.py b/wxPython/demo/PyShell.py deleted file mode 100644 index 450f73925b..0000000000 --- a/wxPython/demo/PyShell.py +++ /dev/null @@ -1,21 +0,0 @@ - -from wxPython.wx import * -from wxPython.lib.shell import PyShell - -#---------------------------------------------------------------------- - - -def runTest(frame, nb, log): - testGlobals = {'hello' : 'How are you?'} - win = PyShell(nb, globals=testGlobals) - win.Show(true) - return win - - -#---------------------------------------------------------------------- - - -overview = """ -A simple GUI version of the interactive interpreter. -""" - diff --git a/wxPython/demo/PyShellWindow.py b/wxPython/demo/PyShellWindow.py deleted file mode 100644 index 1f68ed8be6..0000000000 --- a/wxPython/demo/PyShellWindow.py +++ /dev/null @@ -1,15 +0,0 @@ - - -from wxPython.lib.pyshell import PyShellWindow - -#---------------------------------------------------------------------- - -def runTest(frame, nb, log): - win = PyShellWindow(nb, -1) - return win - -#---------------------------------------------------------------------- - -import wxPython.lib.pyshell - -overview = wxPython.lib.pyshell.__doc__ diff --git a/wxPython/demo/VirtualListCtrl.py b/wxPython/demo/VirtualListCtrl.py new file mode 100644 index 0000000000..96a20d06b8 --- /dev/null +++ b/wxPython/demo/VirtualListCtrl.py @@ -0,0 +1,51 @@ + + +from wxPython.wx import * + +#---------------------------------------------------------------------- + +class TestVirtualList(wxListCtrl): + def __init__(self, parent, log): + wxListCtrl.__init__(self, parent, -1, + style=wxLC_REPORT|wxLC_VIRTUAL|wxLC_HRULES|wxLC_VRULES) + self.log = log + + self.InsertColumn(0, "First") + self.InsertColumn(1, "Second") + self.InsertColumn(2, "Third") + self.SetColumnWidth(0, 175) + self.SetColumnWidth(1, 175) + self.SetColumnWidth(2, 175) + + self.SetItemCount(1000000) + + + + + def OnGetItemText(self, item, col): + return "Item %d, column %d" % (item, col) + + def OnGetItemImage(self, item): + return 0 + + def OnGetItemAttr(self, item): + return None + + +#---------------------------------------------------------------------- + +def runTest(frame, nb, log): + win = TestVirtualList(nb, log) + return win + +#---------------------------------------------------------------------- + + + + + + + + +overview = """\ +""" diff --git a/wxPython/demo/wxListCtrl.py b/wxPython/demo/wxListCtrl.py index cbe8cd0958..9a71bdd521 100644 --- a/wxPython/demo/wxListCtrl.py +++ b/wxPython/demo/wxListCtrl.py @@ -22,39 +22,39 @@ musicdata = { 4 : ("Gloria Estefan", "Here We Are", "Rock"), 5 : ("Linda Ronstadt", "Don't Know Much", "Rock"), 6 : ("Michael Bolton", "How Am I Supposed To Live Without You", "Blues"), -7 : ("Paul Young", "Oh Girl", "Rock"), -8 : ("Paula Abdul", "Opposites Attract", "Rock"), -9 : ("Richard Marx", "Should've Known Better", "Rock"), -10: ("Rod Stewart", "Forever Young", "Rock"), -11: ("Roxette", "Dangerous", "Rock"), -12: ("Sheena Easton", "The Lover In Me", "Rock"), -13: ("Sinead O'Connor", "Nothing Compares 2 U", "Rock"), -14: ("Stevie B.", "Because I Love You", "Rock"), -15: ("Taylor Dayne", "Love Will Lead You Back", "Rock"), -16: ("The Bangles", "Eternal Flame", "Rock"), -17: ("Wilson Phillips", "Release Me", "Rock"), -18: ("Billy Joel", "Blonde Over Blue", "Rock"), -19: ("Billy Joel", "Famous Last Words", "Rock"), -20: ("Billy Joel", "Lullabye (Goodnight, My Angel)", "Rock"), -21: ("Billy Joel", "The River Of Dreams", "Rock"), -22: ("Billy Joel", "Two Thousand Years", "Rock"), -23: ("Janet Jackson", "Alright", "Rock"), -24: ("Janet Jackson", "Black Cat", "Rock"), -25: ("Janet Jackson", "Come Back To Me", "Rock"), -26: ("Janet Jackson", "Escapade", "Rock"), -27: ("Janet Jackson", "Love Will Never Do (Without You)", "Rock"), -28: ("Janet Jackson", "Miss You Much", "Rock"), -29: ("Janet Jackson", "Rhythm Nation", "Rock"), -30: ("Janet Jackson", "State Of The World", "Rock"), -31: ("Janet Jackson", "The Knowledge", "Rock"), -32: ("Spyro Gyra", "End of Romanticism", "Jazz"), -33: ("Spyro Gyra", "Heliopolis", "Jazz"), -34: ("Spyro Gyra", "Jubilee", "Jazz"), -35: ("Spyro Gyra", "Little Linda", "Jazz"), -36: ("Spyro Gyra", "Morning Dance", "Jazz"), -37: ("Spyro Gyra", "Song for Lorraine", "Jazz"), -38: ("Yes", "Owner Of A Lonely Heart", "Rock"), -39: ("Yes", "Rhythm Of Love", "Rock"), +## 7 : ("Paul Young", "Oh Girl", "Rock"), +## 8 : ("Paula Abdul", "Opposites Attract", "Rock"), +## 9 : ("Richard Marx", "Should've Known Better", "Rock"), +## 10: ("Rod Stewart", "Forever Young", "Rock"), +## 11: ("Roxette", "Dangerous", "Rock"), +## 12: ("Sheena Easton", "The Lover In Me", "Rock"), +## 13: ("Sinead O'Connor", "Nothing Compares 2 U", "Rock"), +## 14: ("Stevie B.", "Because I Love You", "Rock"), +## 15: ("Taylor Dayne", "Love Will Lead You Back", "Rock"), +## 16: ("The Bangles", "Eternal Flame", "Rock"), +## 17: ("Wilson Phillips", "Release Me", "Rock"), +## 18: ("Billy Joel", "Blonde Over Blue", "Rock"), +## 19: ("Billy Joel", "Famous Last Words", "Rock"), +## 20: ("Billy Joel", "Lullabye (Goodnight, My Angel)", "Rock"), +## 21: ("Billy Joel", "The River Of Dreams", "Rock"), +## 22: ("Billy Joel", "Two Thousand Years", "Rock"), +## 23: ("Janet Jackson", "Alright", "Rock"), +## 24: ("Janet Jackson", "Black Cat", "Rock"), +## 25: ("Janet Jackson", "Come Back To Me", "Rock"), +## 26: ("Janet Jackson", "Escapade", "Rock"), +## 27: ("Janet Jackson", "Love Will Never Do (Without You)", "Rock"), +## 28: ("Janet Jackson", "Miss You Much", "Rock"), +## 29: ("Janet Jackson", "Rhythm Nation", "Rock"), +## 30: ("Janet Jackson", "State Of The World", "Rock"), +## 31: ("Janet Jackson", "The Knowledge", "Rock"), +## 32: ("Spyro Gyra", "End of Romanticism", "Jazz"), +## 33: ("Spyro Gyra", "Heliopolis", "Jazz"), +## 34: ("Spyro Gyra", "Jubilee", "Jazz"), +## 35: ("Spyro Gyra", "Little Linda", "Jazz"), +## 36: ("Spyro Gyra", "Morning Dance", "Jazz"), +## 37: ("Spyro Gyra", "Song for Lorraine", "Jazz"), +## 38: ("Yes", "Owner Of A Lonely Heart", "Rock"), +## 39: ("Yes", "Rhythm Of Love", "Rock"), } import images @@ -72,7 +72,7 @@ class TestListCtrlPanel(wxPanel): idx1 = self.il.Add(bmp) self.list = wxListCtrl(self, tID, - style=wxLC_REPORT|wxSUNKEN_BORDER) + style=wxLC_REPORT|wxSUNKEN_BORDER)#|wxLC_VRULES|wxLC_HRULES) self.list.SetImageList(self.il, wxIMAGE_LIST_SMALL) # Why doesn't this show up on MSW??? @@ -103,6 +103,10 @@ class TestListCtrlPanel(wxPanel): item.SetTextColour(wxBLUE) self.list.SetItem(item) + item = self.list.GetItem(4) + item.SetTextColour(wxRED) + self.list.SetItem(item) + self.currentItem = 0 EVT_SIZE(self, self.OnSize) EVT_LIST_ITEM_SELECTED(self, tID, self.OnItemSelected) @@ -159,7 +163,9 @@ class TestListCtrlPanel(wxPanel): def ColumnSorter(self, key1, key2): item1 = musicdata[key1][self.col] item2 = musicdata[key2][self.col] - if item1 == item2: return 0 + + # when the items are identical, compare someting else to make the sort key unique... + if item1 == item2: return key1 - key2 elif item1 < item2: return -1 else: return 1 diff --git a/wxPython/demo/wxStyledTextCtrl_1.py b/wxPython/demo/wxStyledTextCtrl_1.py index e8f725ee71..eb55ea356c 100644 --- a/wxPython/demo/wxStyledTextCtrl_1.py +++ b/wxPython/demo/wxStyledTextCtrl_1.py @@ -30,7 +30,6 @@ wxStyledTextEditor also supports setting markers in the margin... you want in your application. Cut, Copy, Paste, Drag and Drop of text works, as well as virtually unlimited Undo and Redo capabilities, (right click to try it out.) - """ if wxPlatform == '__WXMSW__': @@ -168,6 +167,22 @@ def runTest(frame, nb, log): ed.SetStyling(10, wxSTC_INDIC1_MASK) ed.SetStyling(10, wxSTC_INDIC2_MASK | wxSTC_INDIC1_MASK) + # some test stuff... + if 1: + print "GetTextLength(): ", ed.GetTextLength(), len(ed.GetText()) + print "GetText(): ", repr(ed.GetText()) + print + print "GetStyledText(98, 104): ", repr(ed.GetStyledText(98, 104)), len(ed.GetStyledText(98, 104)) + print + print "GetCurLine(): ", repr(ed.GetCurLine()) + print + print "GetLine(1): ", repr(ed.GetLine(1)) + print + ed.SetSelection(25, 35) + print "GetSelectedText(): ", repr(ed.GetSelectedText()) + print "GetTextRange(25, 35): ", repr(ed.GetTextRange(25, 35)) + + ed.GotoPos(0) return p diff --git a/wxPython/demo/wxTextCtrl.py b/wxPython/demo/wxTextCtrl.py index c27bee37ef..66fbd17c53 100644 --- a/wxPython/demo/wxTextCtrl.py +++ b/wxPython/demo/wxTextCtrl.py @@ -33,6 +33,9 @@ class TestPanel(wxPanel): size=(200, 100), style=wxTE_MULTILINE) t3.SetInsertionPoint(0) EVT_TEXT(self, 30, self.EvtText) + b = wxButton(self, -1, "Test Replace") + EVT_BUTTON(self, b.GetId(), self.OnTestReplace) + self.tc = t3 l4 = wxStaticText(self, -1, "Rich Text") t4 = wxTextCtrl(self, 40, "If supported by the native control, this is red, and this is a different font.", @@ -47,11 +50,11 @@ class TestPanel(wxPanel): t4.SetStyle(63, 77, wxTextAttr("BLUE", wxNullColour, f)) ## print 'a2', sys.getrefcount(f) - sizer = wxFlexGridSizer(cols=2, hgap=6, vgap=6) - sizer.AddMany([ l1, t1, - l2, t2, - l3, t3, - l4, t4, + sizer = wxFlexGridSizer(cols=3, hgap=6, vgap=6) + sizer.AddMany([ l1, t1, (0,0), + l2, t2, (0,0), + l3, t3, b, + l4, t4, (0,0), ]) border = wxBoxSizer(wxVERTICAL) border.Add(sizer, 0, wxALL, 25) @@ -68,6 +71,11 @@ class TestPanel(wxPanel): event.Skip() + def OnTestReplace(self, evt): + self.tc.Replace(4, 8, "DOES") + #self.tc.Remove(4, 8) + + #--------------------------------------------------------------------------- def runTest(frame, nb, log): diff --git a/wxPython/setup.py b/wxPython/setup.py index ce3be79c2c..e0c545f162 100755 --- a/wxPython/setup.py +++ b/wxPython/setup.py @@ -204,7 +204,7 @@ if os.name == 'nt': 'advapi32', 'wsock32'] - cflags = [] #['/GX-'] # workaround for internal compiler error in MSVC 5 + cflags = [] #['/GX-'] # workaround for internal compiler error in MSVC on some machines lflags = None diff --git a/wxPython/src/_defs.i b/wxPython/src/_defs.i index a5f364d7fb..594a1174fc 100644 --- a/wxPython/src/_defs.i +++ b/wxPython/src/_defs.i @@ -270,6 +270,7 @@ enum { wxTE_MULTILINE, wxTE_AUTO_SCROLL, wxTE_NO_VSCROLL, + wxTE_AUTO_URL, wxCB_SIMPLE, wxCB_DROPDOWN, wxCB_SORT, @@ -813,6 +814,7 @@ enum wxEventType { wxEVT_COMMAND_SPINCTRL_UPDATED, wxEVT_COMMAND_TEXT_UPDATED, wxEVT_COMMAND_TEXT_ENTER, + wxEVT_COMMAND_TEXT_URL, wxEVT_COMMAND_MENU_SELECTED, wxEVT_COMMAND_SLIDER_UPDATED, wxEVT_COMMAND_RADIOBOX_SELECTED, diff --git a/wxPython/src/_extras.py b/wxPython/src/_extras.py index 6551f91bce..82b38484dd 100644 --- a/wxPython/src/_extras.py +++ b/wxPython/src/_extras.py @@ -362,6 +362,9 @@ def EVT_TEXT(win, id, func): def EVT_TEXT_ENTER(win, id, func): win.Connect(id, -1, wxEVT_COMMAND_TEXT_ENTER, func) +def EVT_TEXT_URL(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_TEXT_URL, func) + def EVT_MENU(win, id, func): win.Connect(id, -1, wxEVT_COMMAND_MENU_SELECTED, func) @@ -544,58 +547,6 @@ def EVT_CALCULATE_LAYOUT(win, func): win.Connect(-1, -1, wxEVT_EVT_CALCULATE_LAYOUT, func) -# wxListCtrl -def EVT_LIST_BEGIN_DRAG(win, id, func): - win.Connect(id, -1, wxEVT_COMMAND_LIST_BEGIN_DRAG, func) - -def EVT_LIST_BEGIN_RDRAG(win, id, func): - win.Connect(id, -1, wxEVT_COMMAND_LIST_BEGIN_RDRAG, func) - -def EVT_LIST_BEGIN_LABEL_EDIT(win, id, func): - win.Connect(id, -1, wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT, func) - -def EVT_LIST_END_LABEL_EDIT(win, id, func): - win.Connect(id, -1, wxEVT_COMMAND_LIST_END_LABEL_EDIT, func) - -def EVT_LIST_DELETE_ITEM(win, id, func): - win.Connect(id, -1, wxEVT_COMMAND_LIST_DELETE_ITEM, func) - -def EVT_LIST_DELETE_ALL_ITEMS(win, id, func): - win.Connect(id, -1, wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS, func) - -def EVT_LIST_GET_INFO(win, id, func): - win.Connect(id, -1, wxEVT_COMMAND_LIST_GET_INFO, func) - -def EVT_LIST_SET_INFO(win, id, func): - win.Connect(id, -1, wxEVT_COMMAND_LIST_SET_INFO, func) - -def EVT_LIST_ITEM_SELECTED(win, id, func): - win.Connect(id, -1, wxEVT_COMMAND_LIST_ITEM_SELECTED, func) - -def EVT_LIST_ITEM_DESELECTED(win, id, func): - win.Connect(id, -1, wxEVT_COMMAND_LIST_ITEM_DESELECTED, func) - -def EVT_LIST_KEY_DOWN(win, id, func): - win.Connect(id, -1, wxEVT_COMMAND_LIST_KEY_DOWN, func) - -def EVT_LIST_INSERT_ITEM(win, id, func): - win.Connect(id, -1, wxEVT_COMMAND_LIST_INSERT_ITEM, func) - -def EVT_LIST_COL_CLICK(win, id, func): - win.Connect(id, -1, wxEVT_COMMAND_LIST_COL_CLICK, func) - -def EVT_LIST_ITEM_RIGHT_CLICK(win, id, func): - win.Connect(id, -1, wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK, func) - -def EVT_LIST_ITEM_MIDDLE_CLICK(win, id, func): - win.Connect(id, -1, wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK, func) - -def EVT_LIST_ITEM_ACTIVATED(win, id, func): - win.Connect(id, -1, wxEVT_COMMAND_LIST_ITEM_ACTIVATED, func) - - - - #wxSplitterWindow def EVT_SPLITTER_SASH_POS_CHANGING(win, id, func): win.Connect(id, -1, wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING, func) diff --git a/wxPython/src/controls2.i b/wxPython/src/controls2.i index 42a787dbe0..dbb653bda4 100644 --- a/wxPython/src/controls2.i +++ b/wxPython/src/controls2.i @@ -37,21 +37,132 @@ %pragma(python) code = "import wx" + +//---------------------------------------------------------------------- //---------------------------------------------------------------------- +enum { + /* List control event types */ + wxEVT_COMMAND_LIST_BEGIN_DRAG, + wxEVT_COMMAND_LIST_BEGIN_RDRAG, + wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT, + wxEVT_COMMAND_LIST_END_LABEL_EDIT, + wxEVT_COMMAND_LIST_DELETE_ITEM, + wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS, + wxEVT_COMMAND_LIST_GET_INFO, + wxEVT_COMMAND_LIST_SET_INFO, + wxEVT_COMMAND_LIST_ITEM_SELECTED, + wxEVT_COMMAND_LIST_ITEM_DESELECTED, + wxEVT_COMMAND_LIST_KEY_DOWN, + wxEVT_COMMAND_LIST_INSERT_ITEM, + wxEVT_COMMAND_LIST_COL_CLICK, + wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK, + wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK, + wxEVT_COMMAND_LIST_ITEM_ACTIVATED, + wxEVT_COMMAND_LIST_CACHE_HINT, +}; + + +%pragma(python) code = " +def EVT_LIST_BEGIN_DRAG(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_LIST_BEGIN_DRAG, func) + +def EVT_LIST_BEGIN_RDRAG(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_LIST_BEGIN_RDRAG, func) + +def EVT_LIST_BEGIN_LABEL_EDIT(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT, func) + +def EVT_LIST_END_LABEL_EDIT(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_LIST_END_LABEL_EDIT, func) + +def EVT_LIST_DELETE_ITEM(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_LIST_DELETE_ITEM, func) + +def EVT_LIST_DELETE_ALL_ITEMS(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS, func) + +def EVT_LIST_GET_INFO(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_LIST_GET_INFO, func) + +def EVT_LIST_SET_INFO(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_LIST_SET_INFO, func) + +def EVT_LIST_ITEM_SELECTED(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_LIST_ITEM_SELECTED, func) + +def EVT_LIST_ITEM_DESELECTED(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_LIST_ITEM_DESELECTED, func) + +def EVT_LIST_KEY_DOWN(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_LIST_KEY_DOWN, func) + +def EVT_LIST_INSERT_ITEM(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_LIST_INSERT_ITEM, func) + +def EVT_LIST_COL_CLICK(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_LIST_COL_CLICK, func) + +def EVT_LIST_ITEM_RIGHT_CLICK(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK, func) + +def EVT_LIST_ITEM_MIDDLE_CLICK(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK, func) + +def EVT_LIST_ITEM_ACTIVATED(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_LIST_ITEM_ACTIVATED, func) + +def EVT_LIST_CACHE_HINT(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_LIST_CACHE_HINT, func) +" + enum { + /* Style flags */ + wxLC_VRULES, + wxLC_HRULES, + + wxLC_ICON, + wxLC_SMALL_ICON, + wxLC_LIST, + wxLC_REPORT, + + wxLC_ALIGN_TOP, + wxLC_ALIGN_LEFT, + wxLC_AUTOARRANGE, + wxLC_VIRTUAL, + wxLC_EDIT_LABELS, + wxLC_NO_HEADER, + wxLC_NO_SORT_HEADER, + wxLC_SINGLE_SEL, + wxLC_SORT_ASCENDING, + wxLC_SORT_DESCENDING, + + wxLC_MASK_TYPE, + wxLC_MASK_ALIGN, + wxLC_MASK_SORT, + +}; + + +enum { + // Mask flags + wxLIST_MASK_STATE, wxLIST_MASK_TEXT, wxLIST_MASK_IMAGE, wxLIST_MASK_DATA, + wxLIST_SET_ITEM, wxLIST_MASK_WIDTH, wxLIST_MASK_FORMAT, - wxLIST_MASK_STATE, + + // State flags wxLIST_STATE_DONTCARE, wxLIST_STATE_DROPHILITED, wxLIST_STATE_FOCUSED, wxLIST_STATE_SELECTED, wxLIST_STATE_CUT, + + // Hit test flags wxLIST_HITTEST_ABOVE, wxLIST_HITTEST_BELOW, wxLIST_HITTEST_NOWHERE, @@ -62,27 +173,40 @@ enum { wxLIST_HITTEST_TOLEFT, wxLIST_HITTEST_TORIGHT, wxLIST_HITTEST_ONITEM, + + // Flags for GetNextItem wxLIST_NEXT_ABOVE, wxLIST_NEXT_ALL, wxLIST_NEXT_BELOW, wxLIST_NEXT_LEFT, wxLIST_NEXT_RIGHT, + + // Alignment flags wxLIST_ALIGN_DEFAULT, wxLIST_ALIGN_LEFT, wxLIST_ALIGN_TOP, wxLIST_ALIGN_SNAP_TO_GRID, - wxLIST_AUTOSIZE, - wxLIST_AUTOSIZE_USEHEADER, + + // Autosize values for SetColumnWidth + wxLIST_AUTOSIZE = -1, + wxLIST_AUTOSIZE_USEHEADER = -2, + + // Flag values for GetItemRect wxLIST_RECT_BOUNDS, wxLIST_RECT_ICON, wxLIST_RECT_LABEL, + + // Flag values for FindItem (MSW only) wxLIST_FIND_UP, wxLIST_FIND_DOWN, wxLIST_FIND_LEFT, wxLIST_FIND_RIGHT, + + }; + enum wxListColumnFormat { wxLIST_FORMAT_LEFT, @@ -92,61 +216,17 @@ enum wxListColumnFormat }; -enum { - /* List control event types */ - wxEVT_COMMAND_LIST_BEGIN_DRAG, - wxEVT_COMMAND_LIST_BEGIN_RDRAG, - wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT, - wxEVT_COMMAND_LIST_END_LABEL_EDIT, - wxEVT_COMMAND_LIST_DELETE_ITEM, - wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS, - wxEVT_COMMAND_LIST_GET_INFO, - wxEVT_COMMAND_LIST_SET_INFO, - wxEVT_COMMAND_LIST_ITEM_SELECTED, - wxEVT_COMMAND_LIST_ITEM_DESELECTED, - wxEVT_COMMAND_LIST_KEY_DOWN, - wxEVT_COMMAND_LIST_INSERT_ITEM, - wxEVT_COMMAND_LIST_COL_CLICK, - wxEVT_COMMAND_LIST_ITEM_ACTIVATED, - wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK, - wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK, -}; - -enum { - /* Style flags */ - wxLC_ICON, - wxLC_SMALL_ICON, - wxLC_LIST, - wxLC_REPORT, - wxLC_ALIGN_TOP, - wxLC_ALIGN_LEFT, - wxLC_AUTOARRANGE, - wxLC_USER_TEXT, - wxLC_EDIT_LABELS, - wxLC_NO_HEADER, - wxLC_NO_SORT_HEADER, - wxLC_SINGLE_SEL, - wxLC_SORT_ASCENDING, - wxLC_SORT_DESCENDING, - wxLC_MASK_TYPE, - wxLC_MASK_ALIGN, - wxLC_MASK_SORT, - wxLC_HRULES, - wxLC_VRULES, - wxLC_VIRTUAL, -}; - class wxListItemAttr { public: // ctors - wxListItemAttr(); - //wxListItemAttr(const wxColour& colText, - // const wxColour& colBack, - // const wxFont& font) - // : m_colText(colText), m_colBack(colBack), m_font(font) { } + //wxListItemAttr(); + wxListItemAttr(const wxColour& colText = wxNullColour, + const wxColour& colBack = wxNullColour, + const wxFont& font = wxNullFont); + // setters void SetTextColour(const wxColour& colText); @@ -252,45 +332,76 @@ public: }; +%{ +class wxPyListCtrl : public wxListCtrl { + DECLARE_ABSTRACT_CLASS(wxPyListCtrl); +public: + wxPyListCtrl(wxWindow* parent, wxWindowID id, + const wxPoint& pos, + const wxSize& size, + long style, + const wxValidator& validator, + char* name) : + wxListCtrl(parent, id, pos, size, style, validator, name) {} + + DEC_PYCALLBACK_STRING_LONGLONG(OnGetItemText); + DEC_PYCALLBACK_INT_LONG(OnGetItemImage); + DEC_PYCALLBACK_LISTATTR_LONG(OnGetItemAttr); + + PYPRIVATE; +}; + +IMPLEMENT_ABSTRACT_CLASS(wxPyListCtrl, wxListCtrl); -class wxListCtrl : public wxControl { +IMP_PYCALLBACK_STRING_LONGLONG(wxPyListCtrl, wxListCtrl, OnGetItemText); +IMP_PYCALLBACK_INT_LONG(wxPyListCtrl, wxListCtrl, OnGetItemImage); +IMP_PYCALLBACK_LISTATTR_LONG(wxPyListCtrl, wxListCtrl, OnGetItemAttr); +%} + + +%name(wxListCtrl)class wxPyListCtrl : public wxControl { public: - wxListCtrl(wxWindow* parent, wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxLC_ICON, - const wxValidator& validator = wxDefaultValidator, - char* name = "listCtrl"); + wxPyListCtrl(wxWindow* parent, wxWindowID id = -1, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = wxLC_ICON, + const wxValidator& validator = wxDefaultValidator, + char* name = "listCtrl"); + void _setSelf(PyObject* self, PyObject* _class); %pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)" + %pragma(python) addtomethod = "__init__:self._setSelf(self, wxListCtrl)" - bool Arrange(int flag = wxLIST_ALIGN_DEFAULT); - void AssignImageList(wxImageList* imageList, int which); - %pragma(python) addtomethod = "AssignImageList:_args[0].thisown = 0" - bool DeleteItem(long item); - bool DeleteAllItems(); - bool DeleteColumn(int col); - bool DeleteAllColumns(void); - void ClearAll(void); -#ifdef __WXMSW__ - wxTextCtrl* EditLabel(long item); - bool EndEditLabel(bool cancel); - wxTextCtrl* GetEditControl(); -#else - void EditLabel(long item); -#endif - bool EnsureVisible(long item); - long FindItem(long start, const wxString& str, bool partial = FALSE); - %name(FindItemData)long FindItem(long start, long data); - %name(FindItemAtPos)long FindItem(long start, const wxPoint& pt, - int direction); - bool GetColumn(int col, wxListItem& item); - int GetColumnWidth(int col); - int GetCountPerPage(); - wxImageList* GetImageList(int which); - long GetItemData(long item); + // Set the control colours + bool SetForegroundColour(const wxColour& col); + bool SetBackgroundColour(const wxColour& col); + + // Gets information about this column + bool GetColumn(int col, wxListItem& item) const; + + // Sets information about this column + bool SetColumn(int col, wxListItem& item) ; + + // Gets the column width + int GetColumnWidth(int col) const; + + // Sets the column width + bool SetColumnWidth(int col, int width) ; + + // Gets the number of items that can fit vertically in the + // visible area of the list control (list or report view) + // or the total number of items in the list control (icon + // or small icon view) + int GetCountPerPage() const; + + // Gets the edit control for editing labels. + wxTextCtrl* GetEditControl() const; + + + //bool GetItem(wxListItem& info) const ; %addmethods { + // Gets information about the item %new wxListItem* GetItem(long itemId, int col=0) { wxListItem* info = new wxListItem; info->m_itemId = itemId; @@ -307,12 +418,45 @@ public: return val " + + // Sets information about the item + bool SetItem(wxListItem& info) ; + + // Sets a string field at a particular column + %name(SetStringItem)long SetItem(long index, int col, const wxString& label, int imageId = -1); + + // Gets the item state + int GetItemState(long item, long stateMask) const ; + + // Sets the item state + bool SetItemState(long item, long state, long stateMask) ; + + // Sets the item image + bool SetItemImage(long item, int image, int selImage) ; + + // Gets the item text + wxString GetItemText(long item) const ; + + // Sets the item text + void SetItemText(long item, const wxString& str) ; + + // Gets the item data + long GetItemData(long item) const ; + + // Sets the item data + bool SetItemData(long item, long data) ; + + + //bool GetItemRect(long item, wxRect& rect, int code = wxLIST_RECT_BOUNDS) const ; + //bool GetItemPosition(long item, wxPoint& pos) const ; %addmethods { + // Gets the item position %new wxPoint* GetItemPosition(long item) { wxPoint* pos = new wxPoint; self->GetItemPosition(item, *pos); return pos; } + // Gets the item rectangle %new wxRect* GetItemRect(long item, int code = wxLIST_RECT_BOUNDS) { wxRect* rect= new wxRect; self->GetItemRect(item, *rect, code); @@ -320,60 +464,158 @@ public: } } - int GetItemState(long item, long stateMask); - int GetItemCount(); - int GetItemSpacing(bool isSmall); - wxString GetItemText(long item); - long GetNextItem(long item, - int geometry = wxLIST_NEXT_ALL, - int state = wxLIST_STATE_DONTCARE); - int GetSelectedItemCount(); -#ifdef __WXMSW__ - wxColour GetTextColour(); + + // Sets the item position + bool SetItemPosition(long item, const wxPoint& pos) ; + + // Gets the number of items in the list control + int GetItemCount() const; + + // Gets the number of columns in the list control + int GetColumnCount() const { return m_colCount; } + + // Retrieves the spacing between icons in pixels. + // If small is TRUE, gets the spacing for the small icon + // view, otherwise the large icon view. + int GetItemSpacing(bool isSmall) const; + + // Gets the number of selected items in the list control + int GetSelectedItemCount() const; + + // Gets the text colour of the listview + wxColour GetTextColour() const; + + // Sets the text colour of the listview void SetTextColour(const wxColour& col); -#endif - long GetTopItem(); + + // Gets the index of the topmost visible item when in + // list or report view + long GetTopItem() const ; + + // Add or remove a single window style + void SetSingleStyle(long style, bool add = TRUE) ; + + // Set the whole window style + void SetWindowStyleFlag(long style) ; + + // Searches for an item, starting from 'item'. + // item can be -1 to find the first item that matches the + // specified flags. + // Returns the item or -1 if unsuccessful. + long GetNextItem(long item, int geometry = wxLIST_NEXT_ALL, int state = wxLIST_STATE_DONTCARE) const ; + + // Gets one of the three image lists + wxImageList *GetImageList(int which) const ; + + // Sets the image list + void SetImageList(wxImageList *imageList, int which) ; + void AssignImageList(wxImageList *imageList, int which) ; + %pragma(python) addtomethod = "AssignImageList:_args[0].thisown = 0" + + // returns true if it is a virtual list control + bool IsVirtual() const; + + // refresh items selectively (only useful for virtual list controls) + void RefreshItem(long item); + void RefreshItems(long itemFrom, long itemTo); + + + + + // Arranges the items + bool Arrange(int flag = wxLIST_ALIGN_DEFAULT); + + // Deletes an item + bool DeleteItem(long item); + + // Deletes all items + bool DeleteAllItems() ; + + // Deletes a column + bool DeleteColumn(int col); + + // Deletes all columns + bool DeleteAllColumns(); + + // Clears items, and columns if there are any. + void ClearAll(); + + // Edit the label + wxTextCtrl* EditLabel(long item /*, wxClassInfo* textControlClass = CLASSINFO(wxTextCtrl)*/); + + // End label editing, optionally cancelling the edit + bool EndEditLabel(bool cancel); + + // Ensures this item is visible + bool EnsureVisible(long item) ; + + // Find an item whose label matches this string, starting from the item after 'start' + // or the beginning if 'start' is -1. + long FindItem(long start, const wxString& str, bool partial = FALSE); + + // Find an item whose data matches this data, starting from the item after 'start' + // or the beginning if 'start' is -1. + %name(FindItemData)long FindItem(long start, long data); + + // Find an item nearest this position in the specified direction, starting from + // the item after 'start' or the beginning if 'start' is -1. + %name(FindItemAtPos)long FindItem(long start, const wxPoint& pt, int direction); + + // Determines which item (if any) is at the specified point, + // giving details in the second return value (see wxLIST_HITTEST_... flags above) long HitTest(const wxPoint& point, int& OUTPUT); + + // Inserts an item, returning the index of the new item if successful, + // -1 otherwise. + long InsertItem(wxListItem& info); + + // Insert a string item + %name(InsertStringItem)long InsertItem(long index, const wxString& label); + + // Insert an image item + %name(InsertImageItem)long InsertItem(long index, int imageIndex); + + // Insert an image/string item + %name(InsertImageStringItem)long InsertItem(long index, const wxString& label, int imageIndex); + + // For list view mode (only), inserts a column. %name(InsertColumnInfo)long InsertColumn(long col, wxListItem& info); - long InsertColumn(long col, const wxString& heading, + + long InsertColumn(long col, + const wxString& heading, int format = wxLIST_FORMAT_LEFT, int width = -1); - long InsertItem(wxListItem& info); - %name(InsertStringItem) long InsertItem(long index, const wxString& label); - %name(InsertImageItem) long InsertItem(long index, int imageIndex); - %name(InsertImageStringItem)long InsertItem(long index, const wxString& label, - int imageIndex); + // set the number of items in a virtual list control + void SetItemCount(long count); + // Scrolls the list control. If in icon, small icon or report view mode, + // x specifies the number of pixels to scroll. If in list view mode, x + // specifies the number of columns to scroll. + // If in icon, small icon or list view mode, y specifies the number of pixels + // to scroll. If in report view mode, y specifies the number of lines to scroll. bool ScrollList(int dx, int dy); - void SetBackgroundColour(const wxColour& col); - bool SetColumn(int col, wxListItem& item); - bool SetColumnWidth(int col, int width); - void SetImageList(wxImageList* imageList, int which); - - bool SetItem(wxListItem& info); - %name(SetStringItem)long SetItem(long index, int col, const wxString& label, - int imageId = -1); - - bool SetItemData(long item, long data); - bool SetItemImage(long item, int image, int selImage); - bool SetItemPosition(long item, const wxPoint& pos); - bool SetItemState(long item, long state, long stateMask); - void SetItemText(long item, const wxString& text); - void SetSingleStyle(long style, bool add = TRUE); - void SetWindowStyleFlag(long style); // bool SortItems(wxListCtrlCompare fn, long data); %addmethods { + // Sort items. + // func is a function which takes 2 long arguments: item1, item2. + // item1 is the long data associated with a first item (NOT the index). + // item2 is the long data associated with a second item (NOT the index). + // The return value is a negative number if the first item should precede the second + // item, a positive number of the second item should precede the first, + // or zero if the two items are equivalent. bool SortItems(PyObject* func) { if (!PyCallable_Check(func)) return FALSE; - return self->SortItems(wxPyListCtrl_SortItems, (long)func); } } + }; + + %{ int wxCALLBACK wxPyListCtrl_SortItems(long item1, long item2, long funcPtr) { int retval = 0; diff --git a/wxPython/src/events.i b/wxPython/src/events.i index 03c1a0d1bb..029e29bdd6 100644 --- a/wxPython/src/events.i +++ b/wxPython/src/events.i @@ -446,6 +446,17 @@ public: int GetInterval(); }; +//--------------------------------------------------------------------------- + +class wxTextUrlEvent : public wxCommandEvent +{ +public: + wxTextUrlEvent(int id, const wxMouseEvent& evtMouse, + long start, long end); + const wxMouseEvent& GetMouseEvent(); + long GetURLStart(); + long GetURLEnd(); +}; //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- diff --git a/wxPython/src/gdi.i b/wxPython/src/gdi.i index 192668dbab..21f67f0232 100644 --- a/wxPython/src/gdi.i +++ b/wxPython/src/gdi.i @@ -623,6 +623,10 @@ public: void CalcBoundingBox(int x, int y); void ResetBoundingBox(); + +#ifdef __WXMSW__ + long GetHDC(); +#endif }; diff --git a/wxPython/src/helpers.h b/wxPython/src/helpers.h index 8258295e46..ccf14da092 100644 --- a/wxPython/src/helpers.h +++ b/wxPython/src/helpers.h @@ -1176,19 +1176,19 @@ public: //--------------------------------------------------------------------------- -#define DEC_PYCALLBACK_DATAFMT_SIZET(CBNAME) \ - wxDataFormat CBNAME(); \ - wxDataFormat base_##CBNAME(); +#define DEC_PYCALLBACK_DATAFMT_SIZET(CBNAME) \ + wxDataFormat CBNAME(size_t a); \ + wxDataFormat base_##CBNAME(size_t a); #define IMP_PYCALLBACK_DATAFMT_SIZET(CLASS, PCLASS, CBNAME) \ wxDataFormat CLASS::CBNAME(size_t a) { \ wxDataFormat rval; \ bool doSave = wxPyRestoreThread(); \ - if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \ + if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \ PyObject* ro; \ wxDataFormat* ptr; \ - ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(i)", a)); \ + ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(i)", a)); \ if (ro) { \ if (! SWIG_GetPtrObj(ro, (void **)&ptr, "_wxDataFormat_p")) \ rval = *ptr; \ @@ -1278,6 +1278,94 @@ public: //--------------------------------------------------------------------------- +#define DEC_PYCALLBACK_STRING_LONGLONG(CBNAME) \ + wxString CBNAME(long a, long b) const; \ + wxString base_##CBNAME(long a, long b)const ; + + +#define IMP_PYCALLBACK_STRING_LONGLONG(CLASS, PCLASS, CBNAME) \ + wxString CLASS::CBNAME(long a, long b) const { \ + wxString rval; \ + bool doSave = wxPyRestoreThread(); \ + if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \ + PyObject* ro; \ + ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(ll)",a,b)); \ + if (ro) { \ + PyObject* str = PyObject_Str(ro); \ + rval = PyString_AsString(str); \ + Py_DECREF(ro); Py_DECREF(str); \ + } \ + } \ + else \ + rval = PCLASS::CBNAME(a,b); \ + wxPySaveThread(doSave); \ + return rval; \ + } \ + wxString CLASS::base_##CBNAME(long a, long b) const { \ + return PCLASS::CBNAME(a,b); \ + } + +//--------------------------------------------------------------------------- + +#define DEC_PYCALLBACK_INT_LONG(CBNAME) \ + int CBNAME(long a) const; \ + int base_##CBNAME(long a)const ; + + +#define IMP_PYCALLBACK_INT_LONG(CLASS, PCLASS, CBNAME) \ + int CLASS::CBNAME(long a) const { \ + int rval=-1; \ + bool doSave = wxPyRestoreThread(); \ + if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \ + PyObject* ro; \ + ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(l)",a)); \ + if (ro) { \ + rval = PyInt_AsLong(ro); \ + Py_DECREF(ro); \ + } \ + } \ + else \ + rval = PCLASS::CBNAME(a); \ + wxPySaveThread(doSave); \ + return rval; \ + } \ + int CLASS::base_##CBNAME(long a) const { \ + return PCLASS::CBNAME(a); \ + } + + +//--------------------------------------------------------------------------- + +#define DEC_PYCALLBACK_LISTATTR_LONG(CBNAME) \ + wxListItemAttr* CBNAME(long a); \ + wxListItemAttr* base_##CBNAME(long a); + + +#define IMP_PYCALLBACK_LISTATTR_LONG(CLASS, PCLASS, CBNAME) \ + wxListItemAttr *CLASS::CBNAME(long a) { \ + wxListItemAttr *rval = NULL; \ + bool doSave = wxPyRestoreThread(); \ + if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \ + PyObject* ro; \ + wxListItemAttr* ptr; \ + ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(i)", a)); \ + if (ro) { \ + if (! SWIG_GetPtrObj(ro, (void **)&ptr, "_wxListItemAttr_p")) \ + rval = ptr; \ + Py_DECREF(ro); \ + } \ + } \ + else \ + rval = PCLASS::CBNAME(a); \ + wxPySaveThread(doSave); \ + return rval; \ + } \ + wxListItemAttr *CLASS::base_##CBNAME(long a) { \ + return PCLASS::CBNAME(a); \ + } + +//--------------------------------------------------------------------------- + #endif diff --git a/wxPython/src/msw/controls2.cpp b/wxPython/src/msw/controls2.cpp index ce59aa5e28..e364b95063 100644 --- a/wxPython/src/msw/controls2.cpp +++ b/wxPython/src/msw/controls2.cpp @@ -96,6 +96,30 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) { static char* wxStringErrorMsg = "string type is required for parameter"; #endif +class wxPyListCtrl : public wxListCtrl { + DECLARE_ABSTRACT_CLASS(wxPyListCtrl); +public: + wxPyListCtrl(wxWindow* parent, wxWindowID id, + const wxPoint& pos, + const wxSize& size, + long style, + const wxValidator& validator, + char* name) : + wxListCtrl(parent, id, pos, size, style, validator, name) {} + + DEC_PYCALLBACK_STRING_LONGLONG(OnGetItemText); + DEC_PYCALLBACK_INT_LONG(OnGetItemImage); + DEC_PYCALLBACK_LISTATTR_LONG(OnGetItemAttr); + + PYPRIVATE; +}; + +IMPLEMENT_ABSTRACT_CLASS(wxPyListCtrl, wxListCtrl); + +IMP_PYCALLBACK_STRING_LONGLONG(wxPyListCtrl, wxListCtrl, OnGetItemText); +IMP_PYCALLBACK_INT_LONG(wxPyListCtrl, wxListCtrl, OnGetItemImage); +IMP_PYCALLBACK_LISTATTR_LONG(wxPyListCtrl, wxListCtrl, OnGetItemAttr); + int wxCALLBACK wxPyListCtrl_SortItems(long item1, long item2, long funcPtr) { int retval = 0; PyObject* func = (PyObject*)funcPtr; @@ -178,19 +202,46 @@ IMPLEMENT_ABSTRACT_CLASS(wxPyTreeCtrl, wxTreeCtrl); #ifdef __cplusplus extern "C" { #endif -#define new_wxListItemAttr() (new wxListItemAttr()) +#define new_wxListItemAttr(_swigarg0,_swigarg1,_swigarg2) (new wxListItemAttr(_swigarg0,_swigarg1,_swigarg2)) static PyObject *_wrap_new_wxListItemAttr(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxListItemAttr * _result; - char *_kwnames[] = { NULL }; + wxColour * _arg0 = (wxColour *) &wxNullColour; + wxColour * _arg1 = (wxColour *) &wxNullColour; + wxFont * _arg2 = (wxFont *) &wxNullFont; + wxColour temp; + PyObject * _obj0 = 0; + wxColour temp0; + PyObject * _obj1 = 0; + PyObject * _argo2 = 0; + char *_kwnames[] = { "colText","colBack","font", NULL }; char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,":new_wxListItemAttr",_kwnames)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"|OOO:new_wxListItemAttr",_kwnames,&_obj0,&_obj1,&_argo2)) + return NULL; + if (_obj0) +{ + _arg0 = &temp; + if (! wxColour_helper(_obj0, &_arg0)) + return NULL; +} + if (_obj1) +{ + _arg1 = &temp0; + if (! wxColour_helper(_obj1, &_arg1)) + return NULL; +} + if (_argo2) { + if (_argo2 == Py_None) { _arg2 = NULL; } + else if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_wxFont_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 3 of new_wxListItemAttr. Expected _wxFont_p."); return NULL; + } + } { wxPy_BEGIN_ALLOW_THREADS; - _result = (wxListItemAttr *)new_wxListItemAttr(); + _result = (wxListItemAttr *)new_wxListItemAttr(*_arg0,*_arg1,*_arg2); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; @@ -2885,44 +2936,44 @@ static PyObject *_wrap_wxListEvent_GetItem(PyObject *self, PyObject *args, PyObj return _resultobj; } -static void *SwigwxListCtrlTowxControl(void *ptr) { - wxListCtrl *src; +static void *SwigwxPyListCtrlTowxControl(void *ptr) { + wxPyListCtrl *src; wxControl *dest; - src = (wxListCtrl *) ptr; + src = (wxPyListCtrl *) ptr; dest = (wxControl *) src; return (void *) dest; } -static void *SwigwxListCtrlTowxWindow(void *ptr) { - wxListCtrl *src; +static void *SwigwxPyListCtrlTowxWindow(void *ptr) { + wxPyListCtrl *src; wxWindow *dest; - src = (wxListCtrl *) ptr; + src = (wxPyListCtrl *) ptr; dest = (wxWindow *) src; return (void *) dest; } -static void *SwigwxListCtrlTowxEvtHandler(void *ptr) { - wxListCtrl *src; +static void *SwigwxPyListCtrlTowxEvtHandler(void *ptr) { + wxPyListCtrl *src; wxEvtHandler *dest; - src = (wxListCtrl *) ptr; + src = (wxPyListCtrl *) ptr; dest = (wxEvtHandler *) src; return (void *) dest; } -static void *SwigwxListCtrlTowxObject(void *ptr) { - wxListCtrl *src; +static void *SwigwxPyListCtrlTowxObject(void *ptr) { + wxPyListCtrl *src; wxObject *dest; - src = (wxListCtrl *) ptr; + src = (wxPyListCtrl *) ptr; dest = (wxObject *) src; return (void *) dest; } -#define new_wxListCtrl(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5,_swigarg6) (new wxListCtrl(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5,_swigarg6)) +#define new_wxListCtrl(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5,_swigarg6) (new wxPyListCtrl(_swigarg0,_swigarg1,_swigarg2,_swigarg3,_swigarg4,_swigarg5,_swigarg6)) static PyObject *_wrap_new_wxListCtrl(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - wxListCtrl * _result; + wxPyListCtrl * _result; wxWindow * _arg0; - wxWindowID _arg1; + wxWindowID _arg1 = (wxWindowID ) -1; wxPoint * _arg2 = (wxPoint *) &wxDefaultPosition; wxSize * _arg3 = (wxSize *) &wxDefaultSize; long _arg4 = (long ) (wxLC_ICON); @@ -2938,7 +2989,7 @@ static PyObject *_wrap_new_wxListCtrl(PyObject *self, PyObject *args, PyObject * char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|OOlOs:new_wxListCtrl",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_argo5,&_arg6)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|iOOlOs:new_wxListCtrl",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_argo5,&_arg6)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } @@ -2968,12 +3019,12 @@ static PyObject *_wrap_new_wxListCtrl(PyObject *self, PyObject *args, PyObject * } { wxPy_BEGIN_ALLOW_THREADS; - _result = (wxListCtrl *)new_wxListCtrl(_arg0,_arg1,*_arg2,*_arg3,_arg4,*_arg5,_arg6); + _result = (wxPyListCtrl *)new_wxListCtrl(_arg0,_arg1,*_arg2,*_arg3,_arg4,*_arg5,_arg6); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; } if (_result) { - SWIG_MakePtr(_ptemp, (char *) _result,"_wxListCtrl_p"); + SWIG_MakePtr(_ptemp, (char *) _result,"_wxPyListCtrl_p"); _resultobj = Py_BuildValue("s",_ptemp); } else { Py_INCREF(Py_None); @@ -2982,95 +3033,109 @@ static PyObject *_wrap_new_wxListCtrl(PyObject *self, PyObject *args, PyObject * return _resultobj; } -#define wxListCtrl_Arrange(_swigobj,_swigarg0) (_swigobj->Arrange(_swigarg0)) -static PyObject *_wrap_wxListCtrl_Arrange(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxListCtrl__setSelf(_swigobj,_swigarg0,_swigarg1) (_swigobj->_setSelf(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxListCtrl__setSelf(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - bool _result; - wxListCtrl * _arg0; - int _arg1 = (int ) (wxLIST_ALIGN_DEFAULT); + wxPyListCtrl * _arg0; + PyObject * _arg1; + PyObject * _arg2; PyObject * _argo0 = 0; - char *_kwnames[] = { "self","flag", NULL }; + PyObject * _obj1 = 0; + PyObject * _obj2 = 0; + char *_kwnames[] = { "self","self","_class", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|i:wxListCtrl_Arrange",_kwnames,&_argo0,&_arg1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOO:wxListCtrl__setSelf",_kwnames,&_argo0,&_obj1,&_obj2)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListCtrl_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_Arrange. Expected _wxListCtrl_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl__setSelf. Expected _wxPyListCtrl_p."); return NULL; } } +{ + _arg1 = _obj1; +} +{ + _arg2 = _obj2; +} { wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxListCtrl_Arrange(_arg0,_arg1); + wxListCtrl__setSelf(_arg0,_arg1,_arg2); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; -} _resultobj = Py_BuildValue("i",_result); +} Py_INCREF(Py_None); + _resultobj = Py_None; return _resultobj; } -#define wxListCtrl_AssignImageList(_swigobj,_swigarg0,_swigarg1) (_swigobj->AssignImageList(_swigarg0,_swigarg1)) -static PyObject *_wrap_wxListCtrl_AssignImageList(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxListCtrl_SetForegroundColour(_swigobj,_swigarg0) (_swigobj->SetForegroundColour(_swigarg0)) +static PyObject *_wrap_wxListCtrl_SetForegroundColour(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - wxListCtrl * _arg0; - wxImageList * _arg1; - int _arg2; + bool _result; + wxPyListCtrl * _arg0; + wxColour * _arg1; PyObject * _argo0 = 0; - PyObject * _argo1 = 0; - char *_kwnames[] = { "self","imageList","which", NULL }; + wxColour temp; + PyObject * _obj1 = 0; + char *_kwnames[] = { "self","col", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOi:wxListCtrl_AssignImageList",_kwnames,&_argo0,&_argo1,&_arg2)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxListCtrl_SetForegroundColour",_kwnames,&_argo0,&_obj1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListCtrl_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_AssignImageList. Expected _wxListCtrl_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_SetForegroundColour. Expected _wxPyListCtrl_p."); return NULL; } } - if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxImageList_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxListCtrl_AssignImageList. Expected _wxImageList_p."); +{ + _arg1 = &temp; + if (! wxColour_helper(_obj1, &_arg1)) return NULL; - } - } +} { wxPy_BEGIN_ALLOW_THREADS; - wxListCtrl_AssignImageList(_arg0,_arg1,_arg2); + _result = (bool )wxListCtrl_SetForegroundColour(_arg0,*_arg1); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; -} Py_INCREF(Py_None); - _resultobj = Py_None; +} _resultobj = Py_BuildValue("i",_result); return _resultobj; } -#define wxListCtrl_DeleteItem(_swigobj,_swigarg0) (_swigobj->DeleteItem(_swigarg0)) -static PyObject *_wrap_wxListCtrl_DeleteItem(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxListCtrl_SetBackgroundColour(_swigobj,_swigarg0) (_swigobj->SetBackgroundColour(_swigarg0)) +static PyObject *_wrap_wxListCtrl_SetBackgroundColour(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; bool _result; - wxListCtrl * _arg0; - long _arg1; + wxPyListCtrl * _arg0; + wxColour * _arg1; PyObject * _argo0 = 0; - char *_kwnames[] = { "self","item", NULL }; + wxColour temp; + PyObject * _obj1 = 0; + char *_kwnames[] = { "self","col", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Ol:wxListCtrl_DeleteItem",_kwnames,&_argo0,&_arg1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxListCtrl_SetBackgroundColour",_kwnames,&_argo0,&_obj1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListCtrl_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_DeleteItem. Expected _wxListCtrl_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_SetBackgroundColour. Expected _wxPyListCtrl_p."); return NULL; } } +{ + _arg1 = &temp; + if (! wxColour_helper(_obj1, &_arg1)) + return NULL; +} { wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxListCtrl_DeleteItem(_arg0,_arg1); + _result = (bool )wxListCtrl_SetBackgroundColour(_arg0,*_arg1); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; @@ -3078,27 +3143,37 @@ static PyObject *_wrap_wxListCtrl_DeleteItem(PyObject *self, PyObject *args, PyO return _resultobj; } -#define wxListCtrl_DeleteAllItems(_swigobj) (_swigobj->DeleteAllItems()) -static PyObject *_wrap_wxListCtrl_DeleteAllItems(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxListCtrl_GetColumn(_swigobj,_swigarg0,_swigarg1) (_swigobj->GetColumn(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxListCtrl_GetColumn(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; bool _result; - wxListCtrl * _arg0; + wxPyListCtrl * _arg0; + int _arg1; + wxListItem * _arg2; PyObject * _argo0 = 0; - char *_kwnames[] = { "self", NULL }; + PyObject * _argo2 = 0; + char *_kwnames[] = { "self","col","item", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxListCtrl_DeleteAllItems",_kwnames,&_argo0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO:wxListCtrl_GetColumn",_kwnames,&_argo0,&_arg1,&_argo2)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListCtrl_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_DeleteAllItems. Expected _wxListCtrl_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_GetColumn. Expected _wxPyListCtrl_p."); + return NULL; + } + } + if (_argo2) { + if (_argo2 == Py_None) { _arg2 = NULL; } + else if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_wxListItem_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 3 of wxListCtrl_GetColumn. Expected _wxListItem_p."); return NULL; } } { wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxListCtrl_DeleteAllItems(_arg0); + _result = (bool )wxListCtrl_GetColumn(_arg0,_arg1,*_arg2); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; @@ -3106,28 +3181,37 @@ static PyObject *_wrap_wxListCtrl_DeleteAllItems(PyObject *self, PyObject *args, return _resultobj; } -#define wxListCtrl_DeleteColumn(_swigobj,_swigarg0) (_swigobj->DeleteColumn(_swigarg0)) -static PyObject *_wrap_wxListCtrl_DeleteColumn(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxListCtrl_SetColumn(_swigobj,_swigarg0,_swigarg1) (_swigobj->SetColumn(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxListCtrl_SetColumn(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; bool _result; - wxListCtrl * _arg0; + wxPyListCtrl * _arg0; int _arg1; + wxListItem * _arg2; PyObject * _argo0 = 0; - char *_kwnames[] = { "self","col", NULL }; + PyObject * _argo2 = 0; + char *_kwnames[] = { "self","col","item", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxListCtrl_DeleteColumn",_kwnames,&_argo0,&_arg1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO:wxListCtrl_SetColumn",_kwnames,&_argo0,&_arg1,&_argo2)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListCtrl_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_DeleteColumn. Expected _wxListCtrl_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_SetColumn. Expected _wxPyListCtrl_p."); + return NULL; + } + } + if (_argo2) { + if (_argo2 == Py_None) { _arg2 = NULL; } + else if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_wxListItem_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 3 of wxListCtrl_SetColumn. Expected _wxListItem_p."); return NULL; } } { wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxListCtrl_DeleteColumn(_arg0,_arg1); + _result = (bool )wxListCtrl_SetColumn(_arg0,_arg1,*_arg2); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; @@ -3135,27 +3219,28 @@ static PyObject *_wrap_wxListCtrl_DeleteColumn(PyObject *self, PyObject *args, P return _resultobj; } -#define wxListCtrl_DeleteAllColumns(_swigobj) (_swigobj->DeleteAllColumns()) -static PyObject *_wrap_wxListCtrl_DeleteAllColumns(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxListCtrl_GetColumnWidth(_swigobj,_swigarg0) (_swigobj->GetColumnWidth(_swigarg0)) +static PyObject *_wrap_wxListCtrl_GetColumnWidth(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - bool _result; - wxListCtrl * _arg0; + int _result; + wxPyListCtrl * _arg0; + int _arg1; PyObject * _argo0 = 0; - char *_kwnames[] = { "self", NULL }; + char *_kwnames[] = { "self","col", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxListCtrl_DeleteAllColumns",_kwnames,&_argo0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxListCtrl_GetColumnWidth",_kwnames,&_argo0,&_arg1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListCtrl_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_DeleteAllColumns. Expected _wxListCtrl_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_GetColumnWidth. Expected _wxPyListCtrl_p."); return NULL; } } { wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxListCtrl_DeleteAllColumns(_arg0); + _result = (int )wxListCtrl_GetColumnWidth(_arg0,_arg1); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; @@ -3163,115 +3248,122 @@ static PyObject *_wrap_wxListCtrl_DeleteAllColumns(PyObject *self, PyObject *arg return _resultobj; } -#define wxListCtrl_ClearAll(_swigobj) (_swigobj->ClearAll()) -static PyObject *_wrap_wxListCtrl_ClearAll(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxListCtrl_SetColumnWidth(_swigobj,_swigarg0,_swigarg1) (_swigobj->SetColumnWidth(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxListCtrl_SetColumnWidth(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - wxListCtrl * _arg0; + bool _result; + wxPyListCtrl * _arg0; + int _arg1; + int _arg2; PyObject * _argo0 = 0; - char *_kwnames[] = { "self", NULL }; + char *_kwnames[] = { "self","col","width", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxListCtrl_ClearAll",_kwnames,&_argo0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oii:wxListCtrl_SetColumnWidth",_kwnames,&_argo0,&_arg1,&_arg2)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListCtrl_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_ClearAll. Expected _wxListCtrl_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_SetColumnWidth. Expected _wxPyListCtrl_p."); return NULL; } } { wxPy_BEGIN_ALLOW_THREADS; - wxListCtrl_ClearAll(_arg0); + _result = (bool )wxListCtrl_SetColumnWidth(_arg0,_arg1,_arg2); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; -} Py_INCREF(Py_None); - _resultobj = Py_None; +} _resultobj = Py_BuildValue("i",_result); return _resultobj; } -#define wxListCtrl_EditLabel(_swigobj,_swigarg0) (_swigobj->EditLabel(_swigarg0)) -static PyObject *_wrap_wxListCtrl_EditLabel(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxListCtrl_GetCountPerPage(_swigobj) (_swigobj->GetCountPerPage()) +static PyObject *_wrap_wxListCtrl_GetCountPerPage(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - wxTextCtrl * _result; - wxListCtrl * _arg0; - long _arg1; + int _result; + wxPyListCtrl * _arg0; PyObject * _argo0 = 0; - char *_kwnames[] = { "self","item", NULL }; + char *_kwnames[] = { "self", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Ol:wxListCtrl_EditLabel",_kwnames,&_argo0,&_arg1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxListCtrl_GetCountPerPage",_kwnames,&_argo0)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListCtrl_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_EditLabel. Expected _wxListCtrl_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_GetCountPerPage. Expected _wxPyListCtrl_p."); return NULL; } } { wxPy_BEGIN_ALLOW_THREADS; - _result = (wxTextCtrl *)wxListCtrl_EditLabel(_arg0,_arg1); + _result = (int )wxListCtrl_GetCountPerPage(_arg0); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; -}{ _resultobj = wxPyMake_wxObject(_result); } +} _resultobj = Py_BuildValue("i",_result); return _resultobj; } -#define wxListCtrl_EndEditLabel(_swigobj,_swigarg0) (_swigobj->EndEditLabel(_swigarg0)) -static PyObject *_wrap_wxListCtrl_EndEditLabel(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxListCtrl_GetEditControl(_swigobj) (_swigobj->GetEditControl()) +static PyObject *_wrap_wxListCtrl_GetEditControl(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - bool _result; - wxListCtrl * _arg0; - bool _arg1; + wxTextCtrl * _result; + wxPyListCtrl * _arg0; PyObject * _argo0 = 0; - int tempbool1; - char *_kwnames[] = { "self","cancel", NULL }; + char *_kwnames[] = { "self", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxListCtrl_EndEditLabel",_kwnames,&_argo0,&tempbool1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxListCtrl_GetEditControl",_kwnames,&_argo0)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListCtrl_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_EndEditLabel. Expected _wxListCtrl_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_GetEditControl. Expected _wxPyListCtrl_p."); return NULL; } } - _arg1 = (bool ) tempbool1; { wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxListCtrl_EndEditLabel(_arg0,_arg1); + _result = (wxTextCtrl *)wxListCtrl_GetEditControl(_arg0); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; -} _resultobj = Py_BuildValue("i",_result); +}{ _resultobj = wxPyMake_wxObject(_result); } return _resultobj; } -#define wxListCtrl_GetEditControl(_swigobj) (_swigobj->GetEditControl()) -static PyObject *_wrap_wxListCtrl_GetEditControl(PyObject *self, PyObject *args, PyObject *kwargs) { +static wxListItem * wxPyListCtrl_GetItem(wxPyListCtrl *self,long itemId,int col) { + wxListItem* info = new wxListItem; + info->m_itemId = itemId; + info->m_col = col; + info->m_mask = 0xFFFF; + self->GetItem(*info); + return info; + } +static PyObject *_wrap_wxListCtrl_GetItem(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - wxTextCtrl * _result; - wxListCtrl * _arg0; + wxListItem * _result; + wxPyListCtrl * _arg0; + long _arg1; + int _arg2 = (int ) 0; PyObject * _argo0 = 0; - char *_kwnames[] = { "self", NULL }; + char *_kwnames[] = { "self","itemId","col", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxListCtrl_GetEditControl",_kwnames,&_argo0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Ol|i:wxListCtrl_GetItem",_kwnames,&_argo0,&_arg1,&_arg2)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListCtrl_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_GetEditControl. Expected _wxListCtrl_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_GetItem. Expected _wxPyListCtrl_p."); return NULL; } } { wxPy_BEGIN_ALLOW_THREADS; - _result = (wxTextCtrl *)wxListCtrl_GetEditControl(_arg0); + _result = (wxListItem *)wxPyListCtrl_GetItem(_arg0,_arg1,_arg2); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; @@ -3279,28 +3371,36 @@ static PyObject *_wrap_wxListCtrl_GetEditControl(PyObject *self, PyObject *args, return _resultobj; } -#define wxListCtrl_EnsureVisible(_swigobj,_swigarg0) (_swigobj->EnsureVisible(_swigarg0)) -static PyObject *_wrap_wxListCtrl_EnsureVisible(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxListCtrl_SetItem(_swigobj,_swigarg0) (_swigobj->SetItem(_swigarg0)) +static PyObject *_wrap_wxListCtrl_SetItem(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; bool _result; - wxListCtrl * _arg0; - long _arg1; + wxPyListCtrl * _arg0; + wxListItem * _arg1; PyObject * _argo0 = 0; - char *_kwnames[] = { "self","item", NULL }; + PyObject * _argo1 = 0; + char *_kwnames[] = { "self","info", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Ol:wxListCtrl_EnsureVisible",_kwnames,&_argo0,&_arg1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxListCtrl_SetItem",_kwnames,&_argo0,&_argo1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListCtrl_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_EnsureVisible. Expected _wxListCtrl_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_SetItem. Expected _wxPyListCtrl_p."); + return NULL; + } + } + if (_argo1) { + if (_argo1 == Py_None) { _arg1 = NULL; } + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxListItem_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxListCtrl_SetItem. Expected _wxListItem_p."); return NULL; } } { wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxListCtrl_EnsureVisible(_arg0,_arg1); + _result = (bool )wxListCtrl_SetItem(_arg0,*_arg1); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; @@ -3308,161 +3408,146 @@ static PyObject *_wrap_wxListCtrl_EnsureVisible(PyObject *self, PyObject *args, return _resultobj; } -#define wxListCtrl_FindItem(_swigobj,_swigarg0,_swigarg1,_swigarg2) (_swigobj->FindItem(_swigarg0,_swigarg1,_swigarg2)) -static PyObject *_wrap_wxListCtrl_FindItem(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxListCtrl_SetStringItem(_swigobj,_swigarg0,_swigarg1,_swigarg2,_swigarg3) (_swigobj->SetItem(_swigarg0,_swigarg1,_swigarg2,_swigarg3)) +static PyObject *_wrap_wxListCtrl_SetStringItem(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; long _result; - wxListCtrl * _arg0; + wxPyListCtrl * _arg0; long _arg1; - wxString * _arg2; - bool _arg3 = (bool ) FALSE; + int _arg2; + wxString * _arg3; + int _arg4 = (int ) -1; PyObject * _argo0 = 0; - PyObject * _obj2 = 0; - int tempbool3 = (int) FALSE; - char *_kwnames[] = { "self","start","str","partial", NULL }; + PyObject * _obj3 = 0; + char *_kwnames[] = { "self","index","col","label","imageId", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OlO|i:wxListCtrl_FindItem",_kwnames,&_argo0,&_arg1,&_obj2,&tempbool3)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OliO|i:wxListCtrl_SetStringItem",_kwnames,&_argo0,&_arg1,&_arg2,&_obj3,&_arg4)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListCtrl_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_FindItem. Expected _wxListCtrl_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_SetStringItem. Expected _wxPyListCtrl_p."); return NULL; } } { #if PYTHON_API_VERSION >= 1009 char* tmpPtr; int tmpSize; - if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + if (!PyString_Check(_obj3) && !PyUnicode_Check(_obj3)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + if (PyString_AsStringAndSize(_obj3, &tmpPtr, &tmpSize) == -1) return NULL; - _arg2 = new wxString(tmpPtr, tmpSize); + _arg3 = new wxString(tmpPtr, tmpSize); #else - if (!PyString_Check(_obj2)) { + if (!PyString_Check(_obj3)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); + _arg3 = new wxString(PyString_AS_STRING(_obj3), PyString_GET_SIZE(_obj3)); #endif } - _arg3 = (bool ) tempbool3; { wxPy_BEGIN_ALLOW_THREADS; - _result = (long )wxListCtrl_FindItem(_arg0,_arg1,*_arg2,_arg3); + _result = (long )wxListCtrl_SetStringItem(_arg0,_arg1,_arg2,*_arg3,_arg4); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("l",_result); { - if (_obj2) - delete _arg2; + if (_obj3) + delete _arg3; } return _resultobj; } -#define wxListCtrl_FindItemData(_swigobj,_swigarg0,_swigarg1) (_swigobj->FindItem(_swigarg0,_swigarg1)) -static PyObject *_wrap_wxListCtrl_FindItemData(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxListCtrl_GetItemState(_swigobj,_swigarg0,_swigarg1) (_swigobj->GetItemState(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxListCtrl_GetItemState(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - long _result; - wxListCtrl * _arg0; + int _result; + wxPyListCtrl * _arg0; long _arg1; long _arg2; PyObject * _argo0 = 0; - char *_kwnames[] = { "self","start","data", NULL }; + char *_kwnames[] = { "self","item","stateMask", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oll:wxListCtrl_FindItemData",_kwnames,&_argo0,&_arg1,&_arg2)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oll:wxListCtrl_GetItemState",_kwnames,&_argo0,&_arg1,&_arg2)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListCtrl_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_FindItemData. Expected _wxListCtrl_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_GetItemState. Expected _wxPyListCtrl_p."); return NULL; } } { wxPy_BEGIN_ALLOW_THREADS; - _result = (long )wxListCtrl_FindItemData(_arg0,_arg1,_arg2); + _result = (int )wxListCtrl_GetItemState(_arg0,_arg1,_arg2); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; -} _resultobj = Py_BuildValue("l",_result); +} _resultobj = Py_BuildValue("i",_result); return _resultobj; } -#define wxListCtrl_FindItemAtPos(_swigobj,_swigarg0,_swigarg1,_swigarg2) (_swigobj->FindItem(_swigarg0,_swigarg1,_swigarg2)) -static PyObject *_wrap_wxListCtrl_FindItemAtPos(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxListCtrl_SetItemState(_swigobj,_swigarg0,_swigarg1,_swigarg2) (_swigobj->SetItemState(_swigarg0,_swigarg1,_swigarg2)) +static PyObject *_wrap_wxListCtrl_SetItemState(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - long _result; - wxListCtrl * _arg0; + bool _result; + wxPyListCtrl * _arg0; long _arg1; - wxPoint * _arg2; - int _arg3; + long _arg2; + long _arg3; PyObject * _argo0 = 0; - wxPoint temp; - PyObject * _obj2 = 0; - char *_kwnames[] = { "self","start","pt","direction", NULL }; + char *_kwnames[] = { "self","item","state","stateMask", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OlOi:wxListCtrl_FindItemAtPos",_kwnames,&_argo0,&_arg1,&_obj2,&_arg3)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Olll:wxListCtrl_SetItemState",_kwnames,&_argo0,&_arg1,&_arg2,&_arg3)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListCtrl_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_FindItemAtPos. Expected _wxListCtrl_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_SetItemState. Expected _wxPyListCtrl_p."); return NULL; } } -{ - _arg2 = &temp; - if (! wxPoint_helper(_obj2, &_arg2)) - return NULL; -} { wxPy_BEGIN_ALLOW_THREADS; - _result = (long )wxListCtrl_FindItemAtPos(_arg0,_arg1,*_arg2,_arg3); + _result = (bool )wxListCtrl_SetItemState(_arg0,_arg1,_arg2,_arg3); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; -} _resultobj = Py_BuildValue("l",_result); +} _resultobj = Py_BuildValue("i",_result); return _resultobj; } -#define wxListCtrl_GetColumn(_swigobj,_swigarg0,_swigarg1) (_swigobj->GetColumn(_swigarg0,_swigarg1)) -static PyObject *_wrap_wxListCtrl_GetColumn(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxListCtrl_SetItemImage(_swigobj,_swigarg0,_swigarg1,_swigarg2) (_swigobj->SetItemImage(_swigarg0,_swigarg1,_swigarg2)) +static PyObject *_wrap_wxListCtrl_SetItemImage(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; bool _result; - wxListCtrl * _arg0; - int _arg1; - wxListItem * _arg2; + wxPyListCtrl * _arg0; + long _arg1; + int _arg2; + int _arg3; PyObject * _argo0 = 0; - PyObject * _argo2 = 0; - char *_kwnames[] = { "self","col","item", NULL }; + char *_kwnames[] = { "self","item","image","selImage", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO:wxListCtrl_GetColumn",_kwnames,&_argo0,&_arg1,&_argo2)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Olii:wxListCtrl_SetItemImage",_kwnames,&_argo0,&_arg1,&_arg2,&_arg3)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListCtrl_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_GetColumn. Expected _wxListCtrl_p."); - return NULL; - } - } - if (_argo2) { - if (_argo2 == Py_None) { _arg2 = NULL; } - else if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_wxListItem_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 3 of wxListCtrl_GetColumn. Expected _wxListItem_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_SetItemImage. Expected _wxPyListCtrl_p."); return NULL; } } { wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxListCtrl_GetColumn(_arg0,_arg1,*_arg2); + _result = (bool )wxListCtrl_SetItemImage(_arg0,_arg1,_arg2,_arg3); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; @@ -3470,89 +3555,90 @@ static PyObject *_wrap_wxListCtrl_GetColumn(PyObject *self, PyObject *args, PyOb return _resultobj; } -#define wxListCtrl_GetColumnWidth(_swigobj,_swigarg0) (_swigobj->GetColumnWidth(_swigarg0)) -static PyObject *_wrap_wxListCtrl_GetColumnWidth(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxListCtrl_GetItemText(_swigobj,_swigarg0) (_swigobj->GetItemText(_swigarg0)) +static PyObject *_wrap_wxListCtrl_GetItemText(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - int _result; - wxListCtrl * _arg0; - int _arg1; + wxString * _result; + wxPyListCtrl * _arg0; + long _arg1; PyObject * _argo0 = 0; - char *_kwnames[] = { "self","col", NULL }; + char *_kwnames[] = { "self","item", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxListCtrl_GetColumnWidth",_kwnames,&_argo0,&_arg1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Ol:wxListCtrl_GetItemText",_kwnames,&_argo0,&_arg1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListCtrl_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_GetColumnWidth. Expected _wxListCtrl_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_GetItemText. Expected _wxPyListCtrl_p."); return NULL; } } { wxPy_BEGIN_ALLOW_THREADS; - _result = (int )wxListCtrl_GetColumnWidth(_arg0,_arg1); + _result = new wxString (wxListCtrl_GetItemText(_arg0,_arg1)); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; -} _resultobj = Py_BuildValue("i",_result); +}{ + _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); +} +{ + delete _result; +} return _resultobj; } -#define wxListCtrl_GetCountPerPage(_swigobj) (_swigobj->GetCountPerPage()) -static PyObject *_wrap_wxListCtrl_GetCountPerPage(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxListCtrl_SetItemText(_swigobj,_swigarg0,_swigarg1) (_swigobj->SetItemText(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxListCtrl_SetItemText(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - int _result; - wxListCtrl * _arg0; + wxPyListCtrl * _arg0; + long _arg1; + wxString * _arg2; PyObject * _argo0 = 0; - char *_kwnames[] = { "self", NULL }; + PyObject * _obj2 = 0; + char *_kwnames[] = { "self","item","str", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxListCtrl_GetCountPerPage",_kwnames,&_argo0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OlO:wxListCtrl_SetItemText",_kwnames,&_argo0,&_arg1,&_obj2)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListCtrl_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_GetCountPerPage. Expected _wxListCtrl_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_SetItemText. Expected _wxPyListCtrl_p."); return NULL; } } { - wxPy_BEGIN_ALLOW_THREADS; - _result = (int )wxListCtrl_GetCountPerPage(_arg0); - - wxPy_END_ALLOW_THREADS; - if (PyErr_Occurred()) return NULL; -} _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - -#define wxListCtrl_GetImageList(_swigobj,_swigarg0) (_swigobj->GetImageList(_swigarg0)) -static PyObject *_wrap_wxListCtrl_GetImageList(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject * _resultobj; - wxImageList * _result; - wxListCtrl * _arg0; - int _arg1; - PyObject * _argo0 = 0; - char *_kwnames[] = { "self","which", NULL }; - - self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxListCtrl_GetImageList",_kwnames,&_argo0,&_arg1)) +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; - if (_argo0) { - if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListCtrl_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_GetImageList. Expected _wxListCtrl_p."); + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else + if (!PyString_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; - } } + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif +} { wxPy_BEGIN_ALLOW_THREADS; - _result = (wxImageList *)wxListCtrl_GetImageList(_arg0,_arg1); + wxListCtrl_SetItemText(_arg0,_arg1,*_arg2); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; -}{ _resultobj = wxPyMake_wxObject(_result); } +} Py_INCREF(Py_None); + _resultobj = Py_None; +{ + if (_obj2) + delete _arg2; +} return _resultobj; } @@ -3560,7 +3646,7 @@ static PyObject *_wrap_wxListCtrl_GetImageList(PyObject *self, PyObject *args, P static PyObject *_wrap_wxListCtrl_GetItemData(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; long _result; - wxListCtrl * _arg0; + wxPyListCtrl * _arg0; long _arg1; PyObject * _argo0 = 0; char *_kwnames[] = { "self","item", NULL }; @@ -3570,8 +3656,8 @@ static PyObject *_wrap_wxListCtrl_GetItemData(PyObject *self, PyObject *args, Py return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListCtrl_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_GetItemData. Expected _wxListCtrl_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_GetItemData. Expected _wxPyListCtrl_p."); return NULL; } } @@ -3585,44 +3671,37 @@ static PyObject *_wrap_wxListCtrl_GetItemData(PyObject *self, PyObject *args, Py return _resultobj; } -static wxListItem * wxListCtrl_GetItem(wxListCtrl *self,long itemId,int col) { - wxListItem* info = new wxListItem; - info->m_itemId = itemId; - info->m_col = col; - info->m_mask = 0xFFFF; - self->GetItem(*info); - return info; - } -static PyObject *_wrap_wxListCtrl_GetItem(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxListCtrl_SetItemData(_swigobj,_swigarg0,_swigarg1) (_swigobj->SetItemData(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxListCtrl_SetItemData(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - wxListItem * _result; - wxListCtrl * _arg0; + bool _result; + wxPyListCtrl * _arg0; long _arg1; - int _arg2 = (int ) 0; + long _arg2; PyObject * _argo0 = 0; - char *_kwnames[] = { "self","itemId","col", NULL }; + char *_kwnames[] = { "self","item","data", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Ol|i:wxListCtrl_GetItem",_kwnames,&_argo0,&_arg1,&_arg2)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oll:wxListCtrl_SetItemData",_kwnames,&_argo0,&_arg1,&_arg2)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListCtrl_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_GetItem. Expected _wxListCtrl_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_SetItemData. Expected _wxPyListCtrl_p."); return NULL; } } { wxPy_BEGIN_ALLOW_THREADS; - _result = (wxListItem *)wxListCtrl_GetItem(_arg0,_arg1,_arg2); + _result = (bool )wxListCtrl_SetItemData(_arg0,_arg1,_arg2); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; -}{ _resultobj = wxPyMake_wxObject(_result); } +} _resultobj = Py_BuildValue("i",_result); return _resultobj; } -static wxPoint * wxListCtrl_GetItemPosition(wxListCtrl *self,long item) { +static wxPoint * wxPyListCtrl_GetItemPosition(wxPyListCtrl *self,long item) { wxPoint* pos = new wxPoint; self->GetItemPosition(item, *pos); return pos; @@ -3630,7 +3709,7 @@ static wxPoint * wxListCtrl_GetItemPosition(wxListCtrl *self,long item) { static PyObject *_wrap_wxListCtrl_GetItemPosition(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxPoint * _result; - wxListCtrl * _arg0; + wxPyListCtrl * _arg0; long _arg1; PyObject * _argo0 = 0; char *_kwnames[] = { "self","item", NULL }; @@ -3641,14 +3720,14 @@ static PyObject *_wrap_wxListCtrl_GetItemPosition(PyObject *self, PyObject *args return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListCtrl_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_GetItemPosition. Expected _wxListCtrl_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_GetItemPosition. Expected _wxPyListCtrl_p."); return NULL; } } { wxPy_BEGIN_ALLOW_THREADS; - _result = (wxPoint *)wxListCtrl_GetItemPosition(_arg0,_arg1); + _result = (wxPoint *)wxPyListCtrl_GetItemPosition(_arg0,_arg1); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; @@ -3662,7 +3741,7 @@ static PyObject *_wrap_wxListCtrl_GetItemPosition(PyObject *self, PyObject *args return _resultobj; } -static wxRect * wxListCtrl_GetItemRect(wxListCtrl *self,long item,int code) { +static wxRect * wxPyListCtrl_GetItemRect(wxPyListCtrl *self,long item,int code) { wxRect* rect= new wxRect; self->GetItemRect(item, *rect, code); return rect; @@ -3670,7 +3749,7 @@ static wxRect * wxListCtrl_GetItemRect(wxListCtrl *self,long item,int code) { static PyObject *_wrap_wxListCtrl_GetItemRect(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; wxRect * _result; - wxListCtrl * _arg0; + wxPyListCtrl * _arg0; long _arg1; int _arg2 = (int ) (wxLIST_RECT_BOUNDS); PyObject * _argo0 = 0; @@ -3682,14 +3761,14 @@ static PyObject *_wrap_wxListCtrl_GetItemRect(PyObject *self, PyObject *args, Py return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListCtrl_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_GetItemRect. Expected _wxListCtrl_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_GetItemRect. Expected _wxPyListCtrl_p."); return NULL; } } { wxPy_BEGIN_ALLOW_THREADS; - _result = (wxRect *)wxListCtrl_GetItemRect(_arg0,_arg1,_arg2); + _result = (wxRect *)wxPyListCtrl_GetItemRect(_arg0,_arg1,_arg2); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; @@ -3703,29 +3782,36 @@ static PyObject *_wrap_wxListCtrl_GetItemRect(PyObject *self, PyObject *args, Py return _resultobj; } -#define wxListCtrl_GetItemState(_swigobj,_swigarg0,_swigarg1) (_swigobj->GetItemState(_swigarg0,_swigarg1)) -static PyObject *_wrap_wxListCtrl_GetItemState(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxListCtrl_SetItemPosition(_swigobj,_swigarg0,_swigarg1) (_swigobj->SetItemPosition(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxListCtrl_SetItemPosition(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - int _result; - wxListCtrl * _arg0; + bool _result; + wxPyListCtrl * _arg0; long _arg1; - long _arg2; + wxPoint * _arg2; PyObject * _argo0 = 0; - char *_kwnames[] = { "self","item","stateMask", NULL }; + wxPoint temp; + PyObject * _obj2 = 0; + char *_kwnames[] = { "self","item","pos", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oll:wxListCtrl_GetItemState",_kwnames,&_argo0,&_arg1,&_arg2)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OlO:wxListCtrl_SetItemPosition",_kwnames,&_argo0,&_arg1,&_obj2)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListCtrl_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_GetItemState. Expected _wxListCtrl_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_SetItemPosition. Expected _wxPyListCtrl_p."); return NULL; } } +{ + _arg2 = &temp; + if (! wxPoint_helper(_obj2, &_arg2)) + return NULL; +} { wxPy_BEGIN_ALLOW_THREADS; - _result = (int )wxListCtrl_GetItemState(_arg0,_arg1,_arg2); + _result = (bool )wxListCtrl_SetItemPosition(_arg0,_arg1,*_arg2); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; @@ -3737,7 +3823,7 @@ static PyObject *_wrap_wxListCtrl_GetItemState(PyObject *self, PyObject *args, P static PyObject *_wrap_wxListCtrl_GetItemCount(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; int _result; - wxListCtrl * _arg0; + wxPyListCtrl * _arg0; PyObject * _argo0 = 0; char *_kwnames[] = { "self", NULL }; @@ -3746,8 +3832,8 @@ static PyObject *_wrap_wxListCtrl_GetItemCount(PyObject *self, PyObject *args, P return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListCtrl_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_GetItemCount. Expected _wxListCtrl_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_GetItemCount. Expected _wxPyListCtrl_p."); return NULL; } } @@ -3761,30 +3847,27 @@ static PyObject *_wrap_wxListCtrl_GetItemCount(PyObject *self, PyObject *args, P return _resultobj; } -#define wxListCtrl_GetItemSpacing(_swigobj,_swigarg0) (_swigobj->GetItemSpacing(_swigarg0)) -static PyObject *_wrap_wxListCtrl_GetItemSpacing(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxListCtrl_GetColumnCount(_swigobj) (_swigobj->GetColumnCount()) +static PyObject *_wrap_wxListCtrl_GetColumnCount(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; int _result; - wxListCtrl * _arg0; - bool _arg1; + wxPyListCtrl * _arg0; PyObject * _argo0 = 0; - int tempbool1; - char *_kwnames[] = { "self","isSmall", NULL }; + char *_kwnames[] = { "self", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxListCtrl_GetItemSpacing",_kwnames,&_argo0,&tempbool1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxListCtrl_GetColumnCount",_kwnames,&_argo0)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListCtrl_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_GetItemSpacing. Expected _wxListCtrl_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_GetColumnCount. Expected _wxPyListCtrl_p."); return NULL; } } - _arg1 = (bool ) tempbool1; { wxPy_BEGIN_ALLOW_THREADS; - _result = (int )wxListCtrl_GetItemSpacing(_arg0,_arg1); + _result = (int )wxListCtrl_GetColumnCount(_arg0); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; @@ -3792,115 +3875,81 @@ static PyObject *_wrap_wxListCtrl_GetItemSpacing(PyObject *self, PyObject *args, return _resultobj; } -#define wxListCtrl_GetItemText(_swigobj,_swigarg0) (_swigobj->GetItemText(_swigarg0)) -static PyObject *_wrap_wxListCtrl_GetItemText(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxListCtrl_GetItemSpacing(_swigobj,_swigarg0) (_swigobj->GetItemSpacing(_swigarg0)) +static PyObject *_wrap_wxListCtrl_GetItemSpacing(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - wxString * _result; - wxListCtrl * _arg0; - long _arg1; + int _result; + wxPyListCtrl * _arg0; + bool _arg1; PyObject * _argo0 = 0; - char *_kwnames[] = { "self","item", NULL }; + int tempbool1; + char *_kwnames[] = { "self","isSmall", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Ol:wxListCtrl_GetItemText",_kwnames,&_argo0,&_arg1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxListCtrl_GetItemSpacing",_kwnames,&_argo0,&tempbool1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListCtrl_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_GetItemText. Expected _wxListCtrl_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_GetItemSpacing. Expected _wxPyListCtrl_p."); return NULL; } } + _arg1 = (bool ) tempbool1; { wxPy_BEGIN_ALLOW_THREADS; - _result = new wxString (wxListCtrl_GetItemText(_arg0,_arg1)); + _result = (int )wxListCtrl_GetItemSpacing(_arg0,_arg1); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; -}{ - _resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len()); -} -{ - delete _result; -} +} _resultobj = Py_BuildValue("i",_result); return _resultobj; } -#define wxListCtrl_GetNextItem(_swigobj,_swigarg0,_swigarg1,_swigarg2) (_swigobj->GetNextItem(_swigarg0,_swigarg1,_swigarg2)) -static PyObject *_wrap_wxListCtrl_GetNextItem(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxListCtrl_GetSelectedItemCount(_swigobj) (_swigobj->GetSelectedItemCount()) +static PyObject *_wrap_wxListCtrl_GetSelectedItemCount(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - long _result; - wxListCtrl * _arg0; - long _arg1; - int _arg2 = (int ) (wxLIST_NEXT_ALL); - int _arg3 = (int ) (wxLIST_STATE_DONTCARE); + int _result; + wxPyListCtrl * _arg0; PyObject * _argo0 = 0; - char *_kwnames[] = { "self","item","geometry","state", NULL }; + char *_kwnames[] = { "self", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Ol|ii:wxListCtrl_GetNextItem",_kwnames,&_argo0,&_arg1,&_arg2,&_arg3)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxListCtrl_GetSelectedItemCount",_kwnames,&_argo0)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListCtrl_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_GetNextItem. Expected _wxListCtrl_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_GetSelectedItemCount. Expected _wxPyListCtrl_p."); return NULL; } } { wxPy_BEGIN_ALLOW_THREADS; - _result = (long )wxListCtrl_GetNextItem(_arg0,_arg1,_arg2,_arg3); + _result = (int )wxListCtrl_GetSelectedItemCount(_arg0); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; -} _resultobj = Py_BuildValue("l",_result); +} _resultobj = Py_BuildValue("i",_result); return _resultobj; } -#define wxListCtrl_GetSelectedItemCount(_swigobj) (_swigobj->GetSelectedItemCount()) -static PyObject *_wrap_wxListCtrl_GetSelectedItemCount(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxListCtrl_GetTextColour(_swigobj) (_swigobj->GetTextColour()) +static PyObject *_wrap_wxListCtrl_GetTextColour(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - int _result; - wxListCtrl * _arg0; + wxColour * _result; + wxPyListCtrl * _arg0; PyObject * _argo0 = 0; char *_kwnames[] = { "self", NULL }; + char _ptemp[128]; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxListCtrl_GetSelectedItemCount",_kwnames,&_argo0)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxListCtrl_GetTextColour",_kwnames,&_argo0)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListCtrl_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_GetSelectedItemCount. Expected _wxListCtrl_p."); - return NULL; - } - } -{ - wxPy_BEGIN_ALLOW_THREADS; - _result = (int )wxListCtrl_GetSelectedItemCount(_arg0); - - wxPy_END_ALLOW_THREADS; - if (PyErr_Occurred()) return NULL; -} _resultobj = Py_BuildValue("i",_result); - return _resultobj; -} - -#define wxListCtrl_GetTextColour(_swigobj) (_swigobj->GetTextColour()) -static PyObject *_wrap_wxListCtrl_GetTextColour(PyObject *self, PyObject *args, PyObject *kwargs) { - PyObject * _resultobj; - wxColour * _result; - wxListCtrl * _arg0; - PyObject * _argo0 = 0; - char *_kwnames[] = { "self", NULL }; - char _ptemp[128]; - - self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxListCtrl_GetTextColour",_kwnames,&_argo0)) - return NULL; - if (_argo0) { - if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListCtrl_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_GetTextColour. Expected _wxListCtrl_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_GetTextColour. Expected _wxPyListCtrl_p."); return NULL; } } @@ -3918,7 +3967,7 @@ static PyObject *_wrap_wxListCtrl_GetTextColour(PyObject *self, PyObject *args, #define wxListCtrl_SetTextColour(_swigobj,_swigarg0) (_swigobj->SetTextColour(_swigarg0)) static PyObject *_wrap_wxListCtrl_SetTextColour(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - wxListCtrl * _arg0; + wxPyListCtrl * _arg0; wxColour * _arg1; PyObject * _argo0 = 0; wxColour temp; @@ -3930,8 +3979,8 @@ static PyObject *_wrap_wxListCtrl_SetTextColour(PyObject *self, PyObject *args, return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListCtrl_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_SetTextColour. Expected _wxListCtrl_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_SetTextColour. Expected _wxPyListCtrl_p."); return NULL; } } @@ -3955,7 +4004,7 @@ static PyObject *_wrap_wxListCtrl_SetTextColour(PyObject *self, PyObject *args, static PyObject *_wrap_wxListCtrl_GetTopItem(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; long _result; - wxListCtrl * _arg0; + wxPyListCtrl * _arg0; PyObject * _argo0 = 0; char *_kwnames[] = { "self", NULL }; @@ -3964,8 +4013,8 @@ static PyObject *_wrap_wxListCtrl_GetTopItem(PyObject *self, PyObject *args, PyO return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListCtrl_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_GetTopItem. Expected _wxListCtrl_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_GetTopItem. Expected _wxPyListCtrl_p."); return NULL; } } @@ -3979,416 +4028,369 @@ static PyObject *_wrap_wxListCtrl_GetTopItem(PyObject *self, PyObject *args, PyO return _resultobj; } -#define wxListCtrl_HitTest(_swigobj,_swigarg0,_swigarg1) (_swigobj->HitTest(_swigarg0,_swigarg1)) -static PyObject *_wrap_wxListCtrl_HitTest(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxListCtrl_SetSingleStyle(_swigobj,_swigarg0,_swigarg1) (_swigobj->SetSingleStyle(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxListCtrl_SetSingleStyle(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - long _result; - wxListCtrl * _arg0; - wxPoint * _arg1; - int * _arg2; - int temp; + wxPyListCtrl * _arg0; + long _arg1; + bool _arg2 = (bool ) TRUE; PyObject * _argo0 = 0; - wxPoint temp0; - PyObject * _obj1 = 0; - char *_kwnames[] = { "self","point", NULL }; + int tempbool2 = (int) TRUE; + char *_kwnames[] = { "self","style","add", NULL }; self = self; -{ - _arg2 = &temp; -} - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxListCtrl_HitTest",_kwnames,&_argo0,&_obj1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Ol|i:wxListCtrl_SetSingleStyle",_kwnames,&_argo0,&_arg1,&tempbool2)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListCtrl_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_HitTest. Expected _wxListCtrl_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_SetSingleStyle. Expected _wxPyListCtrl_p."); return NULL; } } -{ - _arg1 = &temp0; - if (! wxPoint_helper(_obj1, &_arg1)) - return NULL; -} + _arg2 = (bool ) tempbool2; { wxPy_BEGIN_ALLOW_THREADS; - _result = (long )wxListCtrl_HitTest(_arg0,*_arg1,*_arg2); + wxListCtrl_SetSingleStyle(_arg0,_arg1,_arg2); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; -} _resultobj = Py_BuildValue("l",_result); -{ - PyObject *o; - o = PyInt_FromLong((long) (*_arg2)); - _resultobj = t_output_helper(_resultobj, o); -} +} Py_INCREF(Py_None); + _resultobj = Py_None; return _resultobj; } -#define wxListCtrl_InsertColumnInfo(_swigobj,_swigarg0,_swigarg1) (_swigobj->InsertColumn(_swigarg0,_swigarg1)) -static PyObject *_wrap_wxListCtrl_InsertColumnInfo(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxListCtrl_SetWindowStyleFlag(_swigobj,_swigarg0) (_swigobj->SetWindowStyleFlag(_swigarg0)) +static PyObject *_wrap_wxListCtrl_SetWindowStyleFlag(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - long _result; - wxListCtrl * _arg0; + wxPyListCtrl * _arg0; long _arg1; - wxListItem * _arg2; PyObject * _argo0 = 0; - PyObject * _argo2 = 0; - char *_kwnames[] = { "self","col","info", NULL }; + char *_kwnames[] = { "self","style", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OlO:wxListCtrl_InsertColumnInfo",_kwnames,&_argo0,&_arg1,&_argo2)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Ol:wxListCtrl_SetWindowStyleFlag",_kwnames,&_argo0,&_arg1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListCtrl_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_InsertColumnInfo. Expected _wxListCtrl_p."); - return NULL; - } - } - if (_argo2) { - if (_argo2 == Py_None) { _arg2 = NULL; } - else if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_wxListItem_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 3 of wxListCtrl_InsertColumnInfo. Expected _wxListItem_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_SetWindowStyleFlag. Expected _wxPyListCtrl_p."); return NULL; } } { wxPy_BEGIN_ALLOW_THREADS; - _result = (long )wxListCtrl_InsertColumnInfo(_arg0,_arg1,*_arg2); + wxListCtrl_SetWindowStyleFlag(_arg0,_arg1); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; -} _resultobj = Py_BuildValue("l",_result); +} Py_INCREF(Py_None); + _resultobj = Py_None; return _resultobj; } -#define wxListCtrl_InsertColumn(_swigobj,_swigarg0,_swigarg1,_swigarg2,_swigarg3) (_swigobj->InsertColumn(_swigarg0,_swigarg1,_swigarg2,_swigarg3)) -static PyObject *_wrap_wxListCtrl_InsertColumn(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxListCtrl_GetNextItem(_swigobj,_swigarg0,_swigarg1,_swigarg2) (_swigobj->GetNextItem(_swigarg0,_swigarg1,_swigarg2)) +static PyObject *_wrap_wxListCtrl_GetNextItem(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; long _result; - wxListCtrl * _arg0; + wxPyListCtrl * _arg0; long _arg1; - wxString * _arg2; - int _arg3 = (int ) (wxLIST_FORMAT_LEFT); - int _arg4 = (int ) -1; + int _arg2 = (int ) (wxLIST_NEXT_ALL); + int _arg3 = (int ) (wxLIST_STATE_DONTCARE); PyObject * _argo0 = 0; - PyObject * _obj2 = 0; - char *_kwnames[] = { "self","col","heading","format","width", NULL }; + char *_kwnames[] = { "self","item","geometry","state", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OlO|ii:wxListCtrl_InsertColumn",_kwnames,&_argo0,&_arg1,&_obj2,&_arg3,&_arg4)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Ol|ii:wxListCtrl_GetNextItem",_kwnames,&_argo0,&_arg1,&_arg2,&_arg3)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListCtrl_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_InsertColumn. Expected _wxListCtrl_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_GetNextItem. Expected _wxPyListCtrl_p."); return NULL; } } { -#if PYTHON_API_VERSION >= 1009 - char* tmpPtr; int tmpSize; - if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + wxPy_BEGIN_ALLOW_THREADS; + _result = (long )wxListCtrl_GetNextItem(_arg0,_arg1,_arg2,_arg3); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("l",_result); + return _resultobj; +} + +#define wxListCtrl_GetImageList(_swigobj,_swigarg0) (_swigobj->GetImageList(_swigarg0)) +static PyObject *_wrap_wxListCtrl_GetImageList(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxImageList * _result; + wxPyListCtrl * _arg0; + int _arg1; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self","which", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxListCtrl_GetImageList",_kwnames,&_argo0,&_arg1)) return NULL; - _arg2 = new wxString(tmpPtr, tmpSize); -#else - if (!PyString_Check(_obj2)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_GetImageList. Expected _wxPyListCtrl_p."); return NULL; + } } - _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); -#endif -} { wxPy_BEGIN_ALLOW_THREADS; - _result = (long )wxListCtrl_InsertColumn(_arg0,_arg1,*_arg2,_arg3,_arg4); + _result = (wxImageList *)wxListCtrl_GetImageList(_arg0,_arg1); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; -} _resultobj = Py_BuildValue("l",_result); -{ - if (_obj2) - delete _arg2; -} +}{ _resultobj = wxPyMake_wxObject(_result); } return _resultobj; } -#define wxListCtrl_InsertItem(_swigobj,_swigarg0) (_swigobj->InsertItem(_swigarg0)) -static PyObject *_wrap_wxListCtrl_InsertItem(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxListCtrl_SetImageList(_swigobj,_swigarg0,_swigarg1) (_swigobj->SetImageList(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxListCtrl_SetImageList(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - long _result; - wxListCtrl * _arg0; - wxListItem * _arg1; + wxPyListCtrl * _arg0; + wxImageList * _arg1; + int _arg2; PyObject * _argo0 = 0; PyObject * _argo1 = 0; - char *_kwnames[] = { "self","info", NULL }; + char *_kwnames[] = { "self","imageList","which", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxListCtrl_InsertItem",_kwnames,&_argo0,&_argo1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOi:wxListCtrl_SetImageList",_kwnames,&_argo0,&_argo1,&_arg2)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListCtrl_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_InsertItem. Expected _wxListCtrl_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_SetImageList. Expected _wxPyListCtrl_p."); return NULL; } } if (_argo1) { if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxListItem_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxListCtrl_InsertItem. Expected _wxListItem_p."); + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxImageList_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxListCtrl_SetImageList. Expected _wxImageList_p."); return NULL; } } { wxPy_BEGIN_ALLOW_THREADS; - _result = (long )wxListCtrl_InsertItem(_arg0,*_arg1); + wxListCtrl_SetImageList(_arg0,_arg1,_arg2); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; -} _resultobj = Py_BuildValue("l",_result); +} Py_INCREF(Py_None); + _resultobj = Py_None; return _resultobj; } -#define wxListCtrl_InsertStringItem(_swigobj,_swigarg0,_swigarg1) (_swigobj->InsertItem(_swigarg0,_swigarg1)) -static PyObject *_wrap_wxListCtrl_InsertStringItem(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxListCtrl_AssignImageList(_swigobj,_swigarg0,_swigarg1) (_swigobj->AssignImageList(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxListCtrl_AssignImageList(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - long _result; - wxListCtrl * _arg0; - long _arg1; - wxString * _arg2; + wxPyListCtrl * _arg0; + wxImageList * _arg1; + int _arg2; PyObject * _argo0 = 0; - PyObject * _obj2 = 0; - char *_kwnames[] = { "self","index","label", NULL }; + PyObject * _argo1 = 0; + char *_kwnames[] = { "self","imageList","which", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OlO:wxListCtrl_InsertStringItem",_kwnames,&_argo0,&_arg1,&_obj2)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOi:wxListCtrl_AssignImageList",_kwnames,&_argo0,&_argo1,&_arg2)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListCtrl_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_InsertStringItem. Expected _wxListCtrl_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_AssignImageList. Expected _wxPyListCtrl_p."); return NULL; } } -{ -#if PYTHON_API_VERSION >= 1009 - char* tmpPtr; int tmpSize; - if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) - return NULL; - _arg2 = new wxString(tmpPtr, tmpSize); -#else - if (!PyString_Check(_obj2)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + if (_argo1) { + if (_argo1 == Py_None) { _arg1 = NULL; } + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxImageList_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxListCtrl_AssignImageList. Expected _wxImageList_p."); return NULL; + } } - _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); -#endif -} { wxPy_BEGIN_ALLOW_THREADS; - _result = (long )wxListCtrl_InsertStringItem(_arg0,_arg1,*_arg2); + wxListCtrl_AssignImageList(_arg0,_arg1,_arg2); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; -} _resultobj = Py_BuildValue("l",_result); -{ - if (_obj2) - delete _arg2; -} +} Py_INCREF(Py_None); + _resultobj = Py_None; return _resultobj; } -#define wxListCtrl_InsertImageItem(_swigobj,_swigarg0,_swigarg1) (_swigobj->InsertItem(_swigarg0,_swigarg1)) -static PyObject *_wrap_wxListCtrl_InsertImageItem(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxListCtrl_IsVirtual(_swigobj) (_swigobj->IsVirtual()) +static PyObject *_wrap_wxListCtrl_IsVirtual(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - long _result; - wxListCtrl * _arg0; - long _arg1; - int _arg2; + bool _result; + wxPyListCtrl * _arg0; PyObject * _argo0 = 0; - char *_kwnames[] = { "self","index","imageIndex", NULL }; + char *_kwnames[] = { "self", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oli:wxListCtrl_InsertImageItem",_kwnames,&_argo0,&_arg1,&_arg2)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxListCtrl_IsVirtual",_kwnames,&_argo0)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListCtrl_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_InsertImageItem. Expected _wxListCtrl_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_IsVirtual. Expected _wxPyListCtrl_p."); return NULL; } } { wxPy_BEGIN_ALLOW_THREADS; - _result = (long )wxListCtrl_InsertImageItem(_arg0,_arg1,_arg2); + _result = (bool )wxListCtrl_IsVirtual(_arg0); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; -} _resultobj = Py_BuildValue("l",_result); +} _resultobj = Py_BuildValue("i",_result); return _resultobj; } -#define wxListCtrl_InsertImageStringItem(_swigobj,_swigarg0,_swigarg1,_swigarg2) (_swigobj->InsertItem(_swigarg0,_swigarg1,_swigarg2)) -static PyObject *_wrap_wxListCtrl_InsertImageStringItem(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxListCtrl_RefreshItem(_swigobj,_swigarg0) (_swigobj->RefreshItem(_swigarg0)) +static PyObject *_wrap_wxListCtrl_RefreshItem(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - long _result; - wxListCtrl * _arg0; + wxPyListCtrl * _arg0; long _arg1; - wxString * _arg2; - int _arg3; PyObject * _argo0 = 0; - PyObject * _obj2 = 0; - char *_kwnames[] = { "self","index","label","imageIndex", NULL }; + char *_kwnames[] = { "self","item", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OlOi:wxListCtrl_InsertImageStringItem",_kwnames,&_argo0,&_arg1,&_obj2,&_arg3)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Ol:wxListCtrl_RefreshItem",_kwnames,&_argo0,&_arg1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListCtrl_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_InsertImageStringItem. Expected _wxListCtrl_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_RefreshItem. Expected _wxPyListCtrl_p."); return NULL; } } -{ -#if PYTHON_API_VERSION >= 1009 - char* tmpPtr; int tmpSize; - if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) - return NULL; - _arg2 = new wxString(tmpPtr, tmpSize); -#else - if (!PyString_Check(_obj2)) { - PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); - return NULL; - } - _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); -#endif -} { wxPy_BEGIN_ALLOW_THREADS; - _result = (long )wxListCtrl_InsertImageStringItem(_arg0,_arg1,*_arg2,_arg3); + wxListCtrl_RefreshItem(_arg0,_arg1); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; -} _resultobj = Py_BuildValue("l",_result); -{ - if (_obj2) - delete _arg2; -} +} Py_INCREF(Py_None); + _resultobj = Py_None; return _resultobj; } -#define wxListCtrl_ScrollList(_swigobj,_swigarg0,_swigarg1) (_swigobj->ScrollList(_swigarg0,_swigarg1)) -static PyObject *_wrap_wxListCtrl_ScrollList(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxListCtrl_RefreshItems(_swigobj,_swigarg0,_swigarg1) (_swigobj->RefreshItems(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxListCtrl_RefreshItems(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - bool _result; - wxListCtrl * _arg0; - int _arg1; - int _arg2; + wxPyListCtrl * _arg0; + long _arg1; + long _arg2; PyObject * _argo0 = 0; - char *_kwnames[] = { "self","dx","dy", NULL }; + char *_kwnames[] = { "self","itemFrom","itemTo", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oii:wxListCtrl_ScrollList",_kwnames,&_argo0,&_arg1,&_arg2)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oll:wxListCtrl_RefreshItems",_kwnames,&_argo0,&_arg1,&_arg2)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListCtrl_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_ScrollList. Expected _wxListCtrl_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_RefreshItems. Expected _wxPyListCtrl_p."); return NULL; } } { wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxListCtrl_ScrollList(_arg0,_arg1,_arg2); + wxListCtrl_RefreshItems(_arg0,_arg1,_arg2); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; -} _resultobj = Py_BuildValue("i",_result); +} Py_INCREF(Py_None); + _resultobj = Py_None; return _resultobj; } -#define wxListCtrl_SetBackgroundColour(_swigobj,_swigarg0) (_swigobj->SetBackgroundColour(_swigarg0)) -static PyObject *_wrap_wxListCtrl_SetBackgroundColour(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxListCtrl_Arrange(_swigobj,_swigarg0) (_swigobj->Arrange(_swigarg0)) +static PyObject *_wrap_wxListCtrl_Arrange(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - wxListCtrl * _arg0; - wxColour * _arg1; + bool _result; + wxPyListCtrl * _arg0; + int _arg1 = (int ) (wxLIST_ALIGN_DEFAULT); PyObject * _argo0 = 0; - wxColour temp; - PyObject * _obj1 = 0; - char *_kwnames[] = { "self","col", NULL }; + char *_kwnames[] = { "self","flag", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxListCtrl_SetBackgroundColour",_kwnames,&_argo0,&_obj1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O|i:wxListCtrl_Arrange",_kwnames,&_argo0,&_arg1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListCtrl_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_SetBackgroundColour. Expected _wxListCtrl_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_Arrange. Expected _wxPyListCtrl_p."); return NULL; } } -{ - _arg1 = &temp; - if (! wxColour_helper(_obj1, &_arg1)) - return NULL; -} { wxPy_BEGIN_ALLOW_THREADS; - wxListCtrl_SetBackgroundColour(_arg0,*_arg1); + _result = (bool )wxListCtrl_Arrange(_arg0,_arg1); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; -} Py_INCREF(Py_None); - _resultobj = Py_None; +} _resultobj = Py_BuildValue("i",_result); return _resultobj; } -#define wxListCtrl_SetColumn(_swigobj,_swigarg0,_swigarg1) (_swigobj->SetColumn(_swigarg0,_swigarg1)) -static PyObject *_wrap_wxListCtrl_SetColumn(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxListCtrl_DeleteItem(_swigobj,_swigarg0) (_swigobj->DeleteItem(_swigarg0)) +static PyObject *_wrap_wxListCtrl_DeleteItem(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; bool _result; - wxListCtrl * _arg0; - int _arg1; - wxListItem * _arg2; + wxPyListCtrl * _arg0; + long _arg1; PyObject * _argo0 = 0; - PyObject * _argo2 = 0; - char *_kwnames[] = { "self","col","item", NULL }; + char *_kwnames[] = { "self","item", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO:wxListCtrl_SetColumn",_kwnames,&_argo0,&_arg1,&_argo2)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Ol:wxListCtrl_DeleteItem",_kwnames,&_argo0,&_arg1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListCtrl_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_SetColumn. Expected _wxListCtrl_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_DeleteItem. Expected _wxPyListCtrl_p."); return NULL; } } - if (_argo2) { - if (_argo2 == Py_None) { _arg2 = NULL; } - else if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_wxListItem_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 3 of wxListCtrl_SetColumn. Expected _wxListItem_p."); +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (bool )wxListCtrl_DeleteItem(_arg0,_arg1); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxListCtrl_DeleteAllItems(_swigobj) (_swigobj->DeleteAllItems()) +static PyObject *_wrap_wxListCtrl_DeleteAllItems(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxPyListCtrl * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxListCtrl_DeleteAllItems",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_DeleteAllItems. Expected _wxPyListCtrl_p."); return NULL; } } { wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxListCtrl_SetColumn(_arg0,_arg1,*_arg2); + _result = (bool )wxListCtrl_DeleteAllItems(_arg0); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; @@ -4396,29 +4398,28 @@ static PyObject *_wrap_wxListCtrl_SetColumn(PyObject *self, PyObject *args, PyOb return _resultobj; } -#define wxListCtrl_SetColumnWidth(_swigobj,_swigarg0,_swigarg1) (_swigobj->SetColumnWidth(_swigarg0,_swigarg1)) -static PyObject *_wrap_wxListCtrl_SetColumnWidth(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxListCtrl_DeleteColumn(_swigobj,_swigarg0) (_swigobj->DeleteColumn(_swigarg0)) +static PyObject *_wrap_wxListCtrl_DeleteColumn(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; bool _result; - wxListCtrl * _arg0; + wxPyListCtrl * _arg0; int _arg1; - int _arg2; PyObject * _argo0 = 0; - char *_kwnames[] = { "self","col","width", NULL }; + char *_kwnames[] = { "self","col", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oii:wxListCtrl_SetColumnWidth",_kwnames,&_argo0,&_arg1,&_arg2)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxListCtrl_DeleteColumn",_kwnames,&_argo0,&_arg1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListCtrl_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_SetColumnWidth. Expected _wxListCtrl_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_DeleteColumn. Expected _wxPyListCtrl_p."); return NULL; } } { wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxListCtrl_SetColumnWidth(_arg0,_arg1,_arg2); + _result = (bool )wxListCtrl_DeleteColumn(_arg0,_arg1); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; @@ -4426,36 +4427,54 @@ static PyObject *_wrap_wxListCtrl_SetColumnWidth(PyObject *self, PyObject *args, return _resultobj; } -#define wxListCtrl_SetImageList(_swigobj,_swigarg0,_swigarg1) (_swigobj->SetImageList(_swigarg0,_swigarg1)) -static PyObject *_wrap_wxListCtrl_SetImageList(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxListCtrl_DeleteAllColumns(_swigobj) (_swigobj->DeleteAllColumns()) +static PyObject *_wrap_wxListCtrl_DeleteAllColumns(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - wxListCtrl * _arg0; - wxImageList * _arg1; - int _arg2; + bool _result; + wxPyListCtrl * _arg0; PyObject * _argo0 = 0; - PyObject * _argo1 = 0; - char *_kwnames[] = { "self","imageList","which", NULL }; + char *_kwnames[] = { "self", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOi:wxListCtrl_SetImageList",_kwnames,&_argo0,&_argo1,&_arg2)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxListCtrl_DeleteAllColumns",_kwnames,&_argo0)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListCtrl_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_SetImageList. Expected _wxListCtrl_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_DeleteAllColumns. Expected _wxPyListCtrl_p."); return NULL; } } - if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxImageList_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxListCtrl_SetImageList. Expected _wxImageList_p."); +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (bool )wxListCtrl_DeleteAllColumns(_arg0); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxListCtrl_ClearAll(_swigobj) (_swigobj->ClearAll()) +static PyObject *_wrap_wxListCtrl_ClearAll(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxPyListCtrl * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxListCtrl_ClearAll",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_ClearAll. Expected _wxPyListCtrl_p."); return NULL; } } { wxPy_BEGIN_ALLOW_THREADS; - wxListCtrl_SetImageList(_arg0,_arg1,_arg2); + wxListCtrl_ClearAll(_arg0); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; @@ -4464,36 +4483,88 @@ static PyObject *_wrap_wxListCtrl_SetImageList(PyObject *self, PyObject *args, P return _resultobj; } -#define wxListCtrl_SetItem(_swigobj,_swigarg0) (_swigobj->SetItem(_swigarg0)) -static PyObject *_wrap_wxListCtrl_SetItem(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxListCtrl_EditLabel(_swigobj,_swigarg0) (_swigobj->EditLabel(_swigarg0)) +static PyObject *_wrap_wxListCtrl_EditLabel(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxTextCtrl * _result; + wxPyListCtrl * _arg0; + long _arg1; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self","item", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Ol:wxListCtrl_EditLabel",_kwnames,&_argo0,&_arg1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_EditLabel. Expected _wxPyListCtrl_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (wxTextCtrl *)wxListCtrl_EditLabel(_arg0,_arg1); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +}{ _resultobj = wxPyMake_wxObject(_result); } + return _resultobj; +} + +#define wxListCtrl_EndEditLabel(_swigobj,_swigarg0) (_swigobj->EndEditLabel(_swigarg0)) +static PyObject *_wrap_wxListCtrl_EndEditLabel(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; bool _result; - wxListCtrl * _arg0; - wxListItem * _arg1; + wxPyListCtrl * _arg0; + bool _arg1; PyObject * _argo0 = 0; - PyObject * _argo1 = 0; - char *_kwnames[] = { "self","info", NULL }; + int tempbool1; + char *_kwnames[] = { "self","cancel", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxListCtrl_SetItem",_kwnames,&_argo0,&_argo1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxListCtrl_EndEditLabel",_kwnames,&_argo0,&tempbool1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListCtrl_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_SetItem. Expected _wxListCtrl_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_EndEditLabel. Expected _wxPyListCtrl_p."); return NULL; } } - if (_argo1) { - if (_argo1 == Py_None) { _arg1 = NULL; } - else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxListItem_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxListCtrl_SetItem. Expected _wxListItem_p."); + _arg1 = (bool ) tempbool1; +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (bool )wxListCtrl_EndEditLabel(_arg0,_arg1); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxListCtrl_EnsureVisible(_swigobj,_swigarg0) (_swigobj->EnsureVisible(_swigarg0)) +static PyObject *_wrap_wxListCtrl_EnsureVisible(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxPyListCtrl * _arg0; + long _arg1; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self","item", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Ol:wxListCtrl_EnsureVisible",_kwnames,&_argo0,&_arg1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_EnsureVisible. Expected _wxPyListCtrl_p."); return NULL; } } { wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxListCtrl_SetItem(_arg0,*_arg1); + _result = (bool )wxListCtrl_EnsureVisible(_arg0,_arg1); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; @@ -4501,207 +4572,408 @@ static PyObject *_wrap_wxListCtrl_SetItem(PyObject *self, PyObject *args, PyObje return _resultobj; } -#define wxListCtrl_SetStringItem(_swigobj,_swigarg0,_swigarg1,_swigarg2,_swigarg3) (_swigobj->SetItem(_swigarg0,_swigarg1,_swigarg2,_swigarg3)) -static PyObject *_wrap_wxListCtrl_SetStringItem(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxListCtrl_FindItem(_swigobj,_swigarg0,_swigarg1,_swigarg2) (_swigobj->FindItem(_swigarg0,_swigarg1,_swigarg2)) +static PyObject *_wrap_wxListCtrl_FindItem(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; long _result; - wxListCtrl * _arg0; + wxPyListCtrl * _arg0; long _arg1; - int _arg2; - wxString * _arg3; - int _arg4 = (int ) -1; + wxString * _arg2; + bool _arg3 = (bool ) FALSE; PyObject * _argo0 = 0; - PyObject * _obj3 = 0; - char *_kwnames[] = { "self","index","col","label","imageId", NULL }; + PyObject * _obj2 = 0; + int tempbool3 = (int) FALSE; + char *_kwnames[] = { "self","start","str","partial", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OliO|i:wxListCtrl_SetStringItem",_kwnames,&_argo0,&_arg1,&_arg2,&_obj3,&_arg4)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OlO|i:wxListCtrl_FindItem",_kwnames,&_argo0,&_arg1,&_obj2,&tempbool3)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListCtrl_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_SetStringItem. Expected _wxListCtrl_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_FindItem. Expected _wxPyListCtrl_p."); return NULL; } } { #if PYTHON_API_VERSION >= 1009 char* tmpPtr; int tmpSize; - if (!PyString_Check(_obj3) && !PyUnicode_Check(_obj3)) { + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - if (PyString_AsStringAndSize(_obj3, &tmpPtr, &tmpSize) == -1) + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) return NULL; - _arg3 = new wxString(tmpPtr, tmpSize); + _arg2 = new wxString(tmpPtr, tmpSize); #else - if (!PyString_Check(_obj3)) { + if (!PyString_Check(_obj2)) { PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; } - _arg3 = new wxString(PyString_AS_STRING(_obj3), PyString_GET_SIZE(_obj3)); + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); #endif } + _arg3 = (bool ) tempbool3; { wxPy_BEGIN_ALLOW_THREADS; - _result = (long )wxListCtrl_SetStringItem(_arg0,_arg1,_arg2,*_arg3,_arg4); + _result = (long )wxListCtrl_FindItem(_arg0,_arg1,*_arg2,_arg3); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; } _resultobj = Py_BuildValue("l",_result); { - if (_obj3) - delete _arg3; + if (_obj2) + delete _arg2; } return _resultobj; } -#define wxListCtrl_SetItemData(_swigobj,_swigarg0,_swigarg1) (_swigobj->SetItemData(_swigarg0,_swigarg1)) -static PyObject *_wrap_wxListCtrl_SetItemData(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxListCtrl_FindItemData(_swigobj,_swigarg0,_swigarg1) (_swigobj->FindItem(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxListCtrl_FindItemData(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - bool _result; - wxListCtrl * _arg0; + long _result; + wxPyListCtrl * _arg0; long _arg1; long _arg2; PyObject * _argo0 = 0; - char *_kwnames[] = { "self","item","data", NULL }; + char *_kwnames[] = { "self","start","data", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oll:wxListCtrl_SetItemData",_kwnames,&_argo0,&_arg1,&_arg2)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oll:wxListCtrl_FindItemData",_kwnames,&_argo0,&_arg1,&_arg2)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListCtrl_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_SetItemData. Expected _wxListCtrl_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_FindItemData. Expected _wxPyListCtrl_p."); return NULL; } } { wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxListCtrl_SetItemData(_arg0,_arg1,_arg2); + _result = (long )wxListCtrl_FindItemData(_arg0,_arg1,_arg2); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; -} _resultobj = Py_BuildValue("i",_result); +} _resultobj = Py_BuildValue("l",_result); return _resultobj; } -#define wxListCtrl_SetItemImage(_swigobj,_swigarg0,_swigarg1,_swigarg2) (_swigobj->SetItemImage(_swigarg0,_swigarg1,_swigarg2)) -static PyObject *_wrap_wxListCtrl_SetItemImage(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxListCtrl_FindItemAtPos(_swigobj,_swigarg0,_swigarg1,_swigarg2) (_swigobj->FindItem(_swigarg0,_swigarg1,_swigarg2)) +static PyObject *_wrap_wxListCtrl_FindItemAtPos(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - bool _result; - wxListCtrl * _arg0; + long _result; + wxPyListCtrl * _arg0; + long _arg1; + wxPoint * _arg2; + int _arg3; + PyObject * _argo0 = 0; + wxPoint temp; + PyObject * _obj2 = 0; + char *_kwnames[] = { "self","start","pt","direction", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OlOi:wxListCtrl_FindItemAtPos",_kwnames,&_argo0,&_arg1,&_obj2,&_arg3)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_FindItemAtPos. Expected _wxPyListCtrl_p."); + return NULL; + } + } +{ + _arg2 = &temp; + if (! wxPoint_helper(_obj2, &_arg2)) + return NULL; +} +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (long )wxListCtrl_FindItemAtPos(_arg0,_arg1,*_arg2,_arg3); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("l",_result); + return _resultobj; +} + +#define wxListCtrl_HitTest(_swigobj,_swigarg0,_swigarg1) (_swigobj->HitTest(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxListCtrl_HitTest(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + long _result; + wxPyListCtrl * _arg0; + wxPoint * _arg1; + int * _arg2; + int temp; + PyObject * _argo0 = 0; + wxPoint temp0; + PyObject * _obj1 = 0; + char *_kwnames[] = { "self","point", NULL }; + + self = self; +{ + _arg2 = &temp; +} + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxListCtrl_HitTest",_kwnames,&_argo0,&_obj1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_HitTest. Expected _wxPyListCtrl_p."); + return NULL; + } + } +{ + _arg1 = &temp0; + if (! wxPoint_helper(_obj1, &_arg1)) + return NULL; +} +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (long )wxListCtrl_HitTest(_arg0,*_arg1,*_arg2); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("l",_result); +{ + PyObject *o; + o = PyInt_FromLong((long) (*_arg2)); + _resultobj = t_output_helper(_resultobj, o); +} + return _resultobj; +} + +#define wxListCtrl_InsertItem(_swigobj,_swigarg0) (_swigobj->InsertItem(_swigarg0)) +static PyObject *_wrap_wxListCtrl_InsertItem(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + long _result; + wxPyListCtrl * _arg0; + wxListItem * _arg1; + PyObject * _argo0 = 0; + PyObject * _argo1 = 0; + char *_kwnames[] = { "self","info", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxListCtrl_InsertItem",_kwnames,&_argo0,&_argo1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_InsertItem. Expected _wxPyListCtrl_p."); + return NULL; + } + } + if (_argo1) { + if (_argo1 == Py_None) { _arg1 = NULL; } + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxListItem_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxListCtrl_InsertItem. Expected _wxListItem_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (long )wxListCtrl_InsertItem(_arg0,*_arg1); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("l",_result); + return _resultobj; +} + +#define wxListCtrl_InsertStringItem(_swigobj,_swigarg0,_swigarg1) (_swigobj->InsertItem(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxListCtrl_InsertStringItem(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + long _result; + wxPyListCtrl * _arg0; + long _arg1; + wxString * _arg2; + PyObject * _argo0 = 0; + PyObject * _obj2 = 0; + char *_kwnames[] = { "self","index","label", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OlO:wxListCtrl_InsertStringItem",_kwnames,&_argo0,&_arg1,&_obj2)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_InsertStringItem. Expected _wxPyListCtrl_p."); + return NULL; + } + } +{ +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else + if (!PyString_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + return NULL; + } + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif +} +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (long )wxListCtrl_InsertStringItem(_arg0,_arg1,*_arg2); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("l",_result); +{ + if (_obj2) + delete _arg2; +} + return _resultobj; +} + +#define wxListCtrl_InsertImageItem(_swigobj,_swigarg0,_swigarg1) (_swigobj->InsertItem(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxListCtrl_InsertImageItem(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + long _result; + wxPyListCtrl * _arg0; long _arg1; int _arg2; - int _arg3; PyObject * _argo0 = 0; - char *_kwnames[] = { "self","item","image","selImage", NULL }; + char *_kwnames[] = { "self","index","imageIndex", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Olii:wxListCtrl_SetItemImage",_kwnames,&_argo0,&_arg1,&_arg2,&_arg3)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oli:wxListCtrl_InsertImageItem",_kwnames,&_argo0,&_arg1,&_arg2)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListCtrl_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_SetItemImage. Expected _wxListCtrl_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_InsertImageItem. Expected _wxPyListCtrl_p."); return NULL; } } { wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxListCtrl_SetItemImage(_arg0,_arg1,_arg2,_arg3); + _result = (long )wxListCtrl_InsertImageItem(_arg0,_arg1,_arg2); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; -} _resultobj = Py_BuildValue("i",_result); +} _resultobj = Py_BuildValue("l",_result); return _resultobj; } -#define wxListCtrl_SetItemPosition(_swigobj,_swigarg0,_swigarg1) (_swigobj->SetItemPosition(_swigarg0,_swigarg1)) -static PyObject *_wrap_wxListCtrl_SetItemPosition(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxListCtrl_InsertImageStringItem(_swigobj,_swigarg0,_swigarg1,_swigarg2) (_swigobj->InsertItem(_swigarg0,_swigarg1,_swigarg2)) +static PyObject *_wrap_wxListCtrl_InsertImageStringItem(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - bool _result; - wxListCtrl * _arg0; + long _result; + wxPyListCtrl * _arg0; long _arg1; - wxPoint * _arg2; + wxString * _arg2; + int _arg3; PyObject * _argo0 = 0; - wxPoint temp; PyObject * _obj2 = 0; - char *_kwnames[] = { "self","item","pos", NULL }; + char *_kwnames[] = { "self","index","label","imageIndex", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OlO:wxListCtrl_SetItemPosition",_kwnames,&_argo0,&_arg1,&_obj2)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OlOi:wxListCtrl_InsertImageStringItem",_kwnames,&_argo0,&_arg1,&_obj2,&_arg3)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListCtrl_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_SetItemPosition. Expected _wxListCtrl_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_InsertImageStringItem. Expected _wxPyListCtrl_p."); return NULL; } } { - _arg2 = &temp; - if (! wxPoint_helper(_obj2, &_arg2)) +#if PYTHON_API_VERSION >= 1009 + char* tmpPtr; int tmpSize; + if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + return NULL; + } + if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1) + return NULL; + _arg2 = new wxString(tmpPtr, tmpSize); +#else + if (!PyString_Check(_obj2)) { + PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); return NULL; + } + _arg2 = new wxString(PyString_AS_STRING(_obj2), PyString_GET_SIZE(_obj2)); +#endif } { wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxListCtrl_SetItemPosition(_arg0,_arg1,*_arg2); + _result = (long )wxListCtrl_InsertImageStringItem(_arg0,_arg1,*_arg2,_arg3); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; -} _resultobj = Py_BuildValue("i",_result); +} _resultobj = Py_BuildValue("l",_result); +{ + if (_obj2) + delete _arg2; +} return _resultobj; } -#define wxListCtrl_SetItemState(_swigobj,_swigarg0,_swigarg1,_swigarg2) (_swigobj->SetItemState(_swigarg0,_swigarg1,_swigarg2)) -static PyObject *_wrap_wxListCtrl_SetItemState(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxListCtrl_InsertColumnInfo(_swigobj,_swigarg0,_swigarg1) (_swigobj->InsertColumn(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxListCtrl_InsertColumnInfo(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - bool _result; - wxListCtrl * _arg0; + long _result; + wxPyListCtrl * _arg0; long _arg1; - long _arg2; - long _arg3; + wxListItem * _arg2; PyObject * _argo0 = 0; - char *_kwnames[] = { "self","item","state","stateMask", NULL }; + PyObject * _argo2 = 0; + char *_kwnames[] = { "self","col","info", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Olll:wxListCtrl_SetItemState",_kwnames,&_argo0,&_arg1,&_arg2,&_arg3)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OlO:wxListCtrl_InsertColumnInfo",_kwnames,&_argo0,&_arg1,&_argo2)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListCtrl_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_SetItemState. Expected _wxListCtrl_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_InsertColumnInfo. Expected _wxPyListCtrl_p."); + return NULL; + } + } + if (_argo2) { + if (_argo2 == Py_None) { _arg2 = NULL; } + else if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_wxListItem_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 3 of wxListCtrl_InsertColumnInfo. Expected _wxListItem_p."); return NULL; } } { wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxListCtrl_SetItemState(_arg0,_arg1,_arg2,_arg3); + _result = (long )wxListCtrl_InsertColumnInfo(_arg0,_arg1,*_arg2); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; -} _resultobj = Py_BuildValue("i",_result); +} _resultobj = Py_BuildValue("l",_result); return _resultobj; } -#define wxListCtrl_SetItemText(_swigobj,_swigarg0,_swigarg1) (_swigobj->SetItemText(_swigarg0,_swigarg1)) -static PyObject *_wrap_wxListCtrl_SetItemText(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxListCtrl_InsertColumn(_swigobj,_swigarg0,_swigarg1,_swigarg2,_swigarg3) (_swigobj->InsertColumn(_swigarg0,_swigarg1,_swigarg2,_swigarg3)) +static PyObject *_wrap_wxListCtrl_InsertColumn(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - wxListCtrl * _arg0; + long _result; + wxPyListCtrl * _arg0; long _arg1; wxString * _arg2; + int _arg3 = (int ) (wxLIST_FORMAT_LEFT); + int _arg4 = (int ) -1; PyObject * _argo0 = 0; PyObject * _obj2 = 0; - char *_kwnames[] = { "self","item","text", NULL }; + char *_kwnames[] = { "self","col","heading","format","width", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OlO:wxListCtrl_SetItemText",_kwnames,&_argo0,&_arg1,&_obj2)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OlO|ii:wxListCtrl_InsertColumn",_kwnames,&_argo0,&_arg1,&_obj2,&_arg3,&_arg4)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListCtrl_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_SetItemText. Expected _wxListCtrl_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_InsertColumn. Expected _wxPyListCtrl_p."); return NULL; } } @@ -4725,12 +4997,11 @@ static PyObject *_wrap_wxListCtrl_SetItemText(PyObject *self, PyObject *args, Py } { wxPy_BEGIN_ALLOW_THREADS; - wxListCtrl_SetItemText(_arg0,_arg1,*_arg2); + _result = (long )wxListCtrl_InsertColumn(_arg0,_arg1,*_arg2,_arg3,_arg4); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; -} Py_INCREF(Py_None); - _resultobj = Py_None; +} _resultobj = Py_BuildValue("l",_result); { if (_obj2) delete _arg2; @@ -4738,30 +5009,27 @@ static PyObject *_wrap_wxListCtrl_SetItemText(PyObject *self, PyObject *args, Py return _resultobj; } -#define wxListCtrl_SetSingleStyle(_swigobj,_swigarg0,_swigarg1) (_swigobj->SetSingleStyle(_swigarg0,_swigarg1)) -static PyObject *_wrap_wxListCtrl_SetSingleStyle(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxListCtrl_SetItemCount(_swigobj,_swigarg0) (_swigobj->SetItemCount(_swigarg0)) +static PyObject *_wrap_wxListCtrl_SetItemCount(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - wxListCtrl * _arg0; + wxPyListCtrl * _arg0; long _arg1; - bool _arg2 = (bool ) TRUE; PyObject * _argo0 = 0; - int tempbool2 = (int) TRUE; - char *_kwnames[] = { "self","style","add", NULL }; + char *_kwnames[] = { "self","count", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Ol|i:wxListCtrl_SetSingleStyle",_kwnames,&_argo0,&_arg1,&tempbool2)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Ol:wxListCtrl_SetItemCount",_kwnames,&_argo0,&_arg1)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListCtrl_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_SetSingleStyle. Expected _wxListCtrl_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_SetItemCount. Expected _wxPyListCtrl_p."); return NULL; } } - _arg2 = (bool ) tempbool2; { wxPy_BEGIN_ALLOW_THREADS; - wxListCtrl_SetSingleStyle(_arg0,_arg1,_arg2); + wxListCtrl_SetItemCount(_arg0,_arg1); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; @@ -4770,45 +5038,45 @@ static PyObject *_wrap_wxListCtrl_SetSingleStyle(PyObject *self, PyObject *args, return _resultobj; } -#define wxListCtrl_SetWindowStyleFlag(_swigobj,_swigarg0) (_swigobj->SetWindowStyleFlag(_swigarg0)) -static PyObject *_wrap_wxListCtrl_SetWindowStyleFlag(PyObject *self, PyObject *args, PyObject *kwargs) { +#define wxListCtrl_ScrollList(_swigobj,_swigarg0,_swigarg1) (_swigobj->ScrollList(_swigarg0,_swigarg1)) +static PyObject *_wrap_wxListCtrl_ScrollList(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; - wxListCtrl * _arg0; - long _arg1; + bool _result; + wxPyListCtrl * _arg0; + int _arg1; + int _arg2; PyObject * _argo0 = 0; - char *_kwnames[] = { "self","style", NULL }; + char *_kwnames[] = { "self","dx","dy", NULL }; self = self; - if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Ol:wxListCtrl_SetWindowStyleFlag",_kwnames,&_argo0,&_arg1)) + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oii:wxListCtrl_ScrollList",_kwnames,&_argo0,&_arg1,&_arg2)) return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListCtrl_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_SetWindowStyleFlag. Expected _wxListCtrl_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_ScrollList. Expected _wxPyListCtrl_p."); return NULL; } } { wxPy_BEGIN_ALLOW_THREADS; - wxListCtrl_SetWindowStyleFlag(_arg0,_arg1); + _result = (bool )wxListCtrl_ScrollList(_arg0,_arg1,_arg2); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; -} Py_INCREF(Py_None); - _resultobj = Py_None; +} _resultobj = Py_BuildValue("i",_result); return _resultobj; } -static bool wxListCtrl_SortItems(wxListCtrl *self,PyObject * func) { +static bool wxPyListCtrl_SortItems(wxPyListCtrl *self,PyObject * func) { if (!PyCallable_Check(func)) return FALSE; - return self->SortItems(wxPyListCtrl_SortItems, (long)func); } static PyObject *_wrap_wxListCtrl_SortItems(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject * _resultobj; bool _result; - wxListCtrl * _arg0; + wxPyListCtrl * _arg0; PyObject * _arg1; PyObject * _argo0 = 0; PyObject * _obj1 = 0; @@ -4819,8 +5087,8 @@ static PyObject *_wrap_wxListCtrl_SortItems(PyObject *self, PyObject *args, PyOb return NULL; if (_argo0) { if (_argo0 == Py_None) { _arg0 = NULL; } - else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxListCtrl_p")) { - PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_SortItems. Expected _wxListCtrl_p."); + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyListCtrl_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxListCtrl_SortItems. Expected _wxPyListCtrl_p."); return NULL; } } @@ -4829,7 +5097,7 @@ static PyObject *_wrap_wxListCtrl_SortItems(PyObject *self, PyObject *args, PyOb } { wxPy_BEGIN_ALLOW_THREADS; - _result = (bool )wxListCtrl_SortItems(_arg0,_arg1); + _result = (bool )wxPyListCtrl_SortItems(_arg0,_arg1); wxPy_END_ALLOW_THREADS; if (PyErr_Occurred()) return NULL; @@ -8273,49 +8541,19 @@ static PyMethodDef controls2cMethods[] = { { "delete_wxTreeItemId", (PyCFunction) _wrap_delete_wxTreeItemId, METH_VARARGS | METH_KEYWORDS }, { "new_wxTreeItemId", (PyCFunction) _wrap_new_wxTreeItemId, METH_VARARGS | METH_KEYWORDS }, { "wxListCtrl_SortItems", (PyCFunction) _wrap_wxListCtrl_SortItems, METH_VARARGS | METH_KEYWORDS }, - { "wxListCtrl_SetWindowStyleFlag", (PyCFunction) _wrap_wxListCtrl_SetWindowStyleFlag, METH_VARARGS | METH_KEYWORDS }, - { "wxListCtrl_SetSingleStyle", (PyCFunction) _wrap_wxListCtrl_SetSingleStyle, METH_VARARGS | METH_KEYWORDS }, - { "wxListCtrl_SetItemText", (PyCFunction) _wrap_wxListCtrl_SetItemText, METH_VARARGS | METH_KEYWORDS }, - { "wxListCtrl_SetItemState", (PyCFunction) _wrap_wxListCtrl_SetItemState, METH_VARARGS | METH_KEYWORDS }, - { "wxListCtrl_SetItemPosition", (PyCFunction) _wrap_wxListCtrl_SetItemPosition, METH_VARARGS | METH_KEYWORDS }, - { "wxListCtrl_SetItemImage", (PyCFunction) _wrap_wxListCtrl_SetItemImage, METH_VARARGS | METH_KEYWORDS }, - { "wxListCtrl_SetItemData", (PyCFunction) _wrap_wxListCtrl_SetItemData, METH_VARARGS | METH_KEYWORDS }, - { "wxListCtrl_SetStringItem", (PyCFunction) _wrap_wxListCtrl_SetStringItem, METH_VARARGS | METH_KEYWORDS }, - { "wxListCtrl_SetItem", (PyCFunction) _wrap_wxListCtrl_SetItem, METH_VARARGS | METH_KEYWORDS }, - { "wxListCtrl_SetImageList", (PyCFunction) _wrap_wxListCtrl_SetImageList, METH_VARARGS | METH_KEYWORDS }, - { "wxListCtrl_SetColumnWidth", (PyCFunction) _wrap_wxListCtrl_SetColumnWidth, METH_VARARGS | METH_KEYWORDS }, - { "wxListCtrl_SetColumn", (PyCFunction) _wrap_wxListCtrl_SetColumn, METH_VARARGS | METH_KEYWORDS }, - { "wxListCtrl_SetBackgroundColour", (PyCFunction) _wrap_wxListCtrl_SetBackgroundColour, METH_VARARGS | METH_KEYWORDS }, { "wxListCtrl_ScrollList", (PyCFunction) _wrap_wxListCtrl_ScrollList, METH_VARARGS | METH_KEYWORDS }, + { "wxListCtrl_SetItemCount", (PyCFunction) _wrap_wxListCtrl_SetItemCount, METH_VARARGS | METH_KEYWORDS }, + { "wxListCtrl_InsertColumn", (PyCFunction) _wrap_wxListCtrl_InsertColumn, METH_VARARGS | METH_KEYWORDS }, + { "wxListCtrl_InsertColumnInfo", (PyCFunction) _wrap_wxListCtrl_InsertColumnInfo, METH_VARARGS | METH_KEYWORDS }, { "wxListCtrl_InsertImageStringItem", (PyCFunction) _wrap_wxListCtrl_InsertImageStringItem, METH_VARARGS | METH_KEYWORDS }, { "wxListCtrl_InsertImageItem", (PyCFunction) _wrap_wxListCtrl_InsertImageItem, METH_VARARGS | METH_KEYWORDS }, { "wxListCtrl_InsertStringItem", (PyCFunction) _wrap_wxListCtrl_InsertStringItem, METH_VARARGS | METH_KEYWORDS }, { "wxListCtrl_InsertItem", (PyCFunction) _wrap_wxListCtrl_InsertItem, METH_VARARGS | METH_KEYWORDS }, - { "wxListCtrl_InsertColumn", (PyCFunction) _wrap_wxListCtrl_InsertColumn, METH_VARARGS | METH_KEYWORDS }, - { "wxListCtrl_InsertColumnInfo", (PyCFunction) _wrap_wxListCtrl_InsertColumnInfo, METH_VARARGS | METH_KEYWORDS }, { "wxListCtrl_HitTest", (PyCFunction) _wrap_wxListCtrl_HitTest, METH_VARARGS | METH_KEYWORDS }, - { "wxListCtrl_GetTopItem", (PyCFunction) _wrap_wxListCtrl_GetTopItem, METH_VARARGS | METH_KEYWORDS }, - { "wxListCtrl_SetTextColour", (PyCFunction) _wrap_wxListCtrl_SetTextColour, METH_VARARGS | METH_KEYWORDS }, - { "wxListCtrl_GetTextColour", (PyCFunction) _wrap_wxListCtrl_GetTextColour, METH_VARARGS | METH_KEYWORDS }, - { "wxListCtrl_GetSelectedItemCount", (PyCFunction) _wrap_wxListCtrl_GetSelectedItemCount, METH_VARARGS | METH_KEYWORDS }, - { "wxListCtrl_GetNextItem", (PyCFunction) _wrap_wxListCtrl_GetNextItem, METH_VARARGS | METH_KEYWORDS }, - { "wxListCtrl_GetItemText", (PyCFunction) _wrap_wxListCtrl_GetItemText, METH_VARARGS | METH_KEYWORDS }, - { "wxListCtrl_GetItemSpacing", (PyCFunction) _wrap_wxListCtrl_GetItemSpacing, METH_VARARGS | METH_KEYWORDS }, - { "wxListCtrl_GetItemCount", (PyCFunction) _wrap_wxListCtrl_GetItemCount, METH_VARARGS | METH_KEYWORDS }, - { "wxListCtrl_GetItemState", (PyCFunction) _wrap_wxListCtrl_GetItemState, METH_VARARGS | METH_KEYWORDS }, - { "wxListCtrl_GetItemRect", (PyCFunction) _wrap_wxListCtrl_GetItemRect, METH_VARARGS | METH_KEYWORDS }, - { "wxListCtrl_GetItemPosition", (PyCFunction) _wrap_wxListCtrl_GetItemPosition, METH_VARARGS | METH_KEYWORDS }, - { "wxListCtrl_GetItem", (PyCFunction) _wrap_wxListCtrl_GetItem, METH_VARARGS | METH_KEYWORDS }, - { "wxListCtrl_GetItemData", (PyCFunction) _wrap_wxListCtrl_GetItemData, METH_VARARGS | METH_KEYWORDS }, - { "wxListCtrl_GetImageList", (PyCFunction) _wrap_wxListCtrl_GetImageList, METH_VARARGS | METH_KEYWORDS }, - { "wxListCtrl_GetCountPerPage", (PyCFunction) _wrap_wxListCtrl_GetCountPerPage, METH_VARARGS | METH_KEYWORDS }, - { "wxListCtrl_GetColumnWidth", (PyCFunction) _wrap_wxListCtrl_GetColumnWidth, METH_VARARGS | METH_KEYWORDS }, - { "wxListCtrl_GetColumn", (PyCFunction) _wrap_wxListCtrl_GetColumn, METH_VARARGS | METH_KEYWORDS }, { "wxListCtrl_FindItemAtPos", (PyCFunction) _wrap_wxListCtrl_FindItemAtPos, METH_VARARGS | METH_KEYWORDS }, { "wxListCtrl_FindItemData", (PyCFunction) _wrap_wxListCtrl_FindItemData, METH_VARARGS | METH_KEYWORDS }, { "wxListCtrl_FindItem", (PyCFunction) _wrap_wxListCtrl_FindItem, METH_VARARGS | METH_KEYWORDS }, { "wxListCtrl_EnsureVisible", (PyCFunction) _wrap_wxListCtrl_EnsureVisible, METH_VARARGS | METH_KEYWORDS }, - { "wxListCtrl_GetEditControl", (PyCFunction) _wrap_wxListCtrl_GetEditControl, METH_VARARGS | METH_KEYWORDS }, { "wxListCtrl_EndEditLabel", (PyCFunction) _wrap_wxListCtrl_EndEditLabel, METH_VARARGS | METH_KEYWORDS }, { "wxListCtrl_EditLabel", (PyCFunction) _wrap_wxListCtrl_EditLabel, METH_VARARGS | METH_KEYWORDS }, { "wxListCtrl_ClearAll", (PyCFunction) _wrap_wxListCtrl_ClearAll, METH_VARARGS | METH_KEYWORDS }, @@ -8323,8 +8561,45 @@ static PyMethodDef controls2cMethods[] = { { "wxListCtrl_DeleteColumn", (PyCFunction) _wrap_wxListCtrl_DeleteColumn, METH_VARARGS | METH_KEYWORDS }, { "wxListCtrl_DeleteAllItems", (PyCFunction) _wrap_wxListCtrl_DeleteAllItems, METH_VARARGS | METH_KEYWORDS }, { "wxListCtrl_DeleteItem", (PyCFunction) _wrap_wxListCtrl_DeleteItem, METH_VARARGS | METH_KEYWORDS }, - { "wxListCtrl_AssignImageList", (PyCFunction) _wrap_wxListCtrl_AssignImageList, METH_VARARGS | METH_KEYWORDS }, { "wxListCtrl_Arrange", (PyCFunction) _wrap_wxListCtrl_Arrange, METH_VARARGS | METH_KEYWORDS }, + { "wxListCtrl_RefreshItems", (PyCFunction) _wrap_wxListCtrl_RefreshItems, METH_VARARGS | METH_KEYWORDS }, + { "wxListCtrl_RefreshItem", (PyCFunction) _wrap_wxListCtrl_RefreshItem, METH_VARARGS | METH_KEYWORDS }, + { "wxListCtrl_IsVirtual", (PyCFunction) _wrap_wxListCtrl_IsVirtual, METH_VARARGS | METH_KEYWORDS }, + { "wxListCtrl_AssignImageList", (PyCFunction) _wrap_wxListCtrl_AssignImageList, METH_VARARGS | METH_KEYWORDS }, + { "wxListCtrl_SetImageList", (PyCFunction) _wrap_wxListCtrl_SetImageList, METH_VARARGS | METH_KEYWORDS }, + { "wxListCtrl_GetImageList", (PyCFunction) _wrap_wxListCtrl_GetImageList, METH_VARARGS | METH_KEYWORDS }, + { "wxListCtrl_GetNextItem", (PyCFunction) _wrap_wxListCtrl_GetNextItem, METH_VARARGS | METH_KEYWORDS }, + { "wxListCtrl_SetWindowStyleFlag", (PyCFunction) _wrap_wxListCtrl_SetWindowStyleFlag, METH_VARARGS | METH_KEYWORDS }, + { "wxListCtrl_SetSingleStyle", (PyCFunction) _wrap_wxListCtrl_SetSingleStyle, METH_VARARGS | METH_KEYWORDS }, + { "wxListCtrl_GetTopItem", (PyCFunction) _wrap_wxListCtrl_GetTopItem, METH_VARARGS | METH_KEYWORDS }, + { "wxListCtrl_SetTextColour", (PyCFunction) _wrap_wxListCtrl_SetTextColour, METH_VARARGS | METH_KEYWORDS }, + { "wxListCtrl_GetTextColour", (PyCFunction) _wrap_wxListCtrl_GetTextColour, METH_VARARGS | METH_KEYWORDS }, + { "wxListCtrl_GetSelectedItemCount", (PyCFunction) _wrap_wxListCtrl_GetSelectedItemCount, METH_VARARGS | METH_KEYWORDS }, + { "wxListCtrl_GetItemSpacing", (PyCFunction) _wrap_wxListCtrl_GetItemSpacing, METH_VARARGS | METH_KEYWORDS }, + { "wxListCtrl_GetColumnCount", (PyCFunction) _wrap_wxListCtrl_GetColumnCount, METH_VARARGS | METH_KEYWORDS }, + { "wxListCtrl_GetItemCount", (PyCFunction) _wrap_wxListCtrl_GetItemCount, METH_VARARGS | METH_KEYWORDS }, + { "wxListCtrl_SetItemPosition", (PyCFunction) _wrap_wxListCtrl_SetItemPosition, METH_VARARGS | METH_KEYWORDS }, + { "wxListCtrl_GetItemRect", (PyCFunction) _wrap_wxListCtrl_GetItemRect, METH_VARARGS | METH_KEYWORDS }, + { "wxListCtrl_GetItemPosition", (PyCFunction) _wrap_wxListCtrl_GetItemPosition, METH_VARARGS | METH_KEYWORDS }, + { "wxListCtrl_SetItemData", (PyCFunction) _wrap_wxListCtrl_SetItemData, METH_VARARGS | METH_KEYWORDS }, + { "wxListCtrl_GetItemData", (PyCFunction) _wrap_wxListCtrl_GetItemData, METH_VARARGS | METH_KEYWORDS }, + { "wxListCtrl_SetItemText", (PyCFunction) _wrap_wxListCtrl_SetItemText, METH_VARARGS | METH_KEYWORDS }, + { "wxListCtrl_GetItemText", (PyCFunction) _wrap_wxListCtrl_GetItemText, METH_VARARGS | METH_KEYWORDS }, + { "wxListCtrl_SetItemImage", (PyCFunction) _wrap_wxListCtrl_SetItemImage, METH_VARARGS | METH_KEYWORDS }, + { "wxListCtrl_SetItemState", (PyCFunction) _wrap_wxListCtrl_SetItemState, METH_VARARGS | METH_KEYWORDS }, + { "wxListCtrl_GetItemState", (PyCFunction) _wrap_wxListCtrl_GetItemState, METH_VARARGS | METH_KEYWORDS }, + { "wxListCtrl_SetStringItem", (PyCFunction) _wrap_wxListCtrl_SetStringItem, METH_VARARGS | METH_KEYWORDS }, + { "wxListCtrl_SetItem", (PyCFunction) _wrap_wxListCtrl_SetItem, METH_VARARGS | METH_KEYWORDS }, + { "wxListCtrl_GetItem", (PyCFunction) _wrap_wxListCtrl_GetItem, METH_VARARGS | METH_KEYWORDS }, + { "wxListCtrl_GetEditControl", (PyCFunction) _wrap_wxListCtrl_GetEditControl, METH_VARARGS | METH_KEYWORDS }, + { "wxListCtrl_GetCountPerPage", (PyCFunction) _wrap_wxListCtrl_GetCountPerPage, METH_VARARGS | METH_KEYWORDS }, + { "wxListCtrl_SetColumnWidth", (PyCFunction) _wrap_wxListCtrl_SetColumnWidth, METH_VARARGS | METH_KEYWORDS }, + { "wxListCtrl_GetColumnWidth", (PyCFunction) _wrap_wxListCtrl_GetColumnWidth, METH_VARARGS | METH_KEYWORDS }, + { "wxListCtrl_SetColumn", (PyCFunction) _wrap_wxListCtrl_SetColumn, METH_VARARGS | METH_KEYWORDS }, + { "wxListCtrl_GetColumn", (PyCFunction) _wrap_wxListCtrl_GetColumn, METH_VARARGS | METH_KEYWORDS }, + { "wxListCtrl_SetBackgroundColour", (PyCFunction) _wrap_wxListCtrl_SetBackgroundColour, METH_VARARGS | METH_KEYWORDS }, + { "wxListCtrl_SetForegroundColour", (PyCFunction) _wrap_wxListCtrl_SetForegroundColour, METH_VARARGS | METH_KEYWORDS }, + { "wxListCtrl__setSelf", (PyCFunction) _wrap_wxListCtrl__setSelf, METH_VARARGS | METH_KEYWORDS }, { "new_wxListCtrl", (PyCFunction) _wrap_new_wxListCtrl, METH_VARARGS | METH_KEYWORDS }, { "wxListEvent_GetItem", (PyCFunction) _wrap_wxListEvent_GetItem, METH_VARARGS | METH_KEYWORDS }, { "wxListEvent_GetMask", (PyCFunction) _wrap_wxListEvent_GetMask, METH_VARARGS | METH_KEYWORDS }, @@ -8477,14 +8752,14 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxObject","_wxPyTreeCtrl",SwigwxPyTreeCtrlTowxObject}, { "_wxObject","_wxTreeEvent",SwigwxTreeEventTowxObject}, { "_wxObject","_wxPyTreeItemData",SwigwxPyTreeItemDataTowxObject}, - { "_wxObject","_wxListCtrl",SwigwxListCtrlTowxObject}, + { "_wxObject","_wxPyListCtrl",SwigwxPyListCtrlTowxObject}, { "_wxObject","_wxListEvent",SwigwxListEventTowxObject}, { "_wxObject","_wxListItem",SwigwxListItemTowxObject}, { "_signed_short","_WXTYPE",0}, { "_signed_short","_short",0}, { "_unsigned_char","_byte",0}, { "_wxControl","_wxPyTreeCtrl",SwigwxPyTreeCtrlTowxControl}, - { "_wxControl","_wxListCtrl",SwigwxListCtrlTowxControl}, + { "_wxControl","_wxPyListCtrl",SwigwxPyListCtrlTowxControl}, { "_unsigned_int","_wxCoord",0}, { "_unsigned_int","_wxPrintQuality",0}, { "_unsigned_int","_time_t",0}, @@ -8530,9 +8805,9 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxCoord","_time_t",0}, { "_wxCoord","_wxPrintQuality",0}, { "_wxEvtHandler","_wxPyTreeCtrl",SwigwxPyTreeCtrlTowxEvtHandler}, - { "_wxEvtHandler","_wxListCtrl",SwigwxListCtrlTowxEvtHandler}, + { "_wxEvtHandler","_wxPyListCtrl",SwigwxPyListCtrlTowxEvtHandler}, { "_wxWindow","_wxPyTreeCtrl",SwigwxPyTreeCtrlTowxWindow}, - { "_wxWindow","_wxListCtrl",SwigwxListCtrlTowxWindow}, + { "_wxWindow","_wxPyListCtrl",SwigwxPyListCtrlTowxWindow}, {0,0,0}}; static PyObject *SWIG_globals; @@ -8544,12 +8819,49 @@ SWIGEXPORT(void) initcontrols2c() { SWIG_globals = SWIG_newvarlink(); m = Py_InitModule("controls2c", controls2cMethods); d = PyModule_GetDict(m); + PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_BEGIN_DRAG", PyInt_FromLong((long) wxEVT_COMMAND_LIST_BEGIN_DRAG)); + PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_BEGIN_RDRAG", PyInt_FromLong((long) wxEVT_COMMAND_LIST_BEGIN_RDRAG)); + PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT", PyInt_FromLong((long) wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT)); + PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_END_LABEL_EDIT", PyInt_FromLong((long) wxEVT_COMMAND_LIST_END_LABEL_EDIT)); + PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_DELETE_ITEM", PyInt_FromLong((long) wxEVT_COMMAND_LIST_DELETE_ITEM)); + PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS", PyInt_FromLong((long) wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS)); + PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_GET_INFO", PyInt_FromLong((long) wxEVT_COMMAND_LIST_GET_INFO)); + PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_SET_INFO", PyInt_FromLong((long) wxEVT_COMMAND_LIST_SET_INFO)); + PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_ITEM_SELECTED", PyInt_FromLong((long) wxEVT_COMMAND_LIST_ITEM_SELECTED)); + PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_ITEM_DESELECTED", PyInt_FromLong((long) wxEVT_COMMAND_LIST_ITEM_DESELECTED)); + PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_KEY_DOWN", PyInt_FromLong((long) wxEVT_COMMAND_LIST_KEY_DOWN)); + PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_INSERT_ITEM", PyInt_FromLong((long) wxEVT_COMMAND_LIST_INSERT_ITEM)); + PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_COL_CLICK", PyInt_FromLong((long) wxEVT_COMMAND_LIST_COL_CLICK)); + PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK", PyInt_FromLong((long) wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK)); + PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK", PyInt_FromLong((long) wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK)); + PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_ITEM_ACTIVATED", PyInt_FromLong((long) wxEVT_COMMAND_LIST_ITEM_ACTIVATED)); + PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_CACHE_HINT", PyInt_FromLong((long) wxEVT_COMMAND_LIST_CACHE_HINT)); + PyDict_SetItemString(d,"wxLC_VRULES", PyInt_FromLong((long) wxLC_VRULES)); + PyDict_SetItemString(d,"wxLC_HRULES", PyInt_FromLong((long) wxLC_HRULES)); + PyDict_SetItemString(d,"wxLC_ICON", PyInt_FromLong((long) wxLC_ICON)); + PyDict_SetItemString(d,"wxLC_SMALL_ICON", PyInt_FromLong((long) wxLC_SMALL_ICON)); + PyDict_SetItemString(d,"wxLC_LIST", PyInt_FromLong((long) wxLC_LIST)); + PyDict_SetItemString(d,"wxLC_REPORT", PyInt_FromLong((long) wxLC_REPORT)); + PyDict_SetItemString(d,"wxLC_ALIGN_TOP", PyInt_FromLong((long) wxLC_ALIGN_TOP)); + PyDict_SetItemString(d,"wxLC_ALIGN_LEFT", PyInt_FromLong((long) wxLC_ALIGN_LEFT)); + PyDict_SetItemString(d,"wxLC_AUTOARRANGE", PyInt_FromLong((long) wxLC_AUTOARRANGE)); + PyDict_SetItemString(d,"wxLC_VIRTUAL", PyInt_FromLong((long) wxLC_VIRTUAL)); + PyDict_SetItemString(d,"wxLC_EDIT_LABELS", PyInt_FromLong((long) wxLC_EDIT_LABELS)); + PyDict_SetItemString(d,"wxLC_NO_HEADER", PyInt_FromLong((long) wxLC_NO_HEADER)); + PyDict_SetItemString(d,"wxLC_NO_SORT_HEADER", PyInt_FromLong((long) wxLC_NO_SORT_HEADER)); + PyDict_SetItemString(d,"wxLC_SINGLE_SEL", PyInt_FromLong((long) wxLC_SINGLE_SEL)); + PyDict_SetItemString(d,"wxLC_SORT_ASCENDING", PyInt_FromLong((long) wxLC_SORT_ASCENDING)); + PyDict_SetItemString(d,"wxLC_SORT_DESCENDING", PyInt_FromLong((long) wxLC_SORT_DESCENDING)); + PyDict_SetItemString(d,"wxLC_MASK_TYPE", PyInt_FromLong((long) wxLC_MASK_TYPE)); + PyDict_SetItemString(d,"wxLC_MASK_ALIGN", PyInt_FromLong((long) wxLC_MASK_ALIGN)); + PyDict_SetItemString(d,"wxLC_MASK_SORT", PyInt_FromLong((long) wxLC_MASK_SORT)); + PyDict_SetItemString(d,"wxLIST_MASK_STATE", PyInt_FromLong((long) wxLIST_MASK_STATE)); PyDict_SetItemString(d,"wxLIST_MASK_TEXT", PyInt_FromLong((long) wxLIST_MASK_TEXT)); PyDict_SetItemString(d,"wxLIST_MASK_IMAGE", PyInt_FromLong((long) wxLIST_MASK_IMAGE)); PyDict_SetItemString(d,"wxLIST_MASK_DATA", PyInt_FromLong((long) wxLIST_MASK_DATA)); + PyDict_SetItemString(d,"wxLIST_SET_ITEM", PyInt_FromLong((long) wxLIST_SET_ITEM)); PyDict_SetItemString(d,"wxLIST_MASK_WIDTH", PyInt_FromLong((long) wxLIST_MASK_WIDTH)); PyDict_SetItemString(d,"wxLIST_MASK_FORMAT", PyInt_FromLong((long) wxLIST_MASK_FORMAT)); - PyDict_SetItemString(d,"wxLIST_MASK_STATE", PyInt_FromLong((long) wxLIST_MASK_STATE)); PyDict_SetItemString(d,"wxLIST_STATE_DONTCARE", PyInt_FromLong((long) wxLIST_STATE_DONTCARE)); PyDict_SetItemString(d,"wxLIST_STATE_DROPHILITED", PyInt_FromLong((long) wxLIST_STATE_DROPHILITED)); PyDict_SetItemString(d,"wxLIST_STATE_FOCUSED", PyInt_FromLong((long) wxLIST_STATE_FOCUSED)); @@ -8587,42 +8899,6 @@ SWIGEXPORT(void) initcontrols2c() { PyDict_SetItemString(d,"wxLIST_FORMAT_RIGHT", PyInt_FromLong((long) wxLIST_FORMAT_RIGHT)); PyDict_SetItemString(d,"wxLIST_FORMAT_CENTRE", PyInt_FromLong((long) wxLIST_FORMAT_CENTRE)); PyDict_SetItemString(d,"wxLIST_FORMAT_CENTER", PyInt_FromLong((long) wxLIST_FORMAT_CENTER)); - PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_BEGIN_DRAG", PyInt_FromLong((long) wxEVT_COMMAND_LIST_BEGIN_DRAG)); - PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_BEGIN_RDRAG", PyInt_FromLong((long) wxEVT_COMMAND_LIST_BEGIN_RDRAG)); - PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT", PyInt_FromLong((long) wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT)); - PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_END_LABEL_EDIT", PyInt_FromLong((long) wxEVT_COMMAND_LIST_END_LABEL_EDIT)); - PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_DELETE_ITEM", PyInt_FromLong((long) wxEVT_COMMAND_LIST_DELETE_ITEM)); - PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS", PyInt_FromLong((long) wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS)); - PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_GET_INFO", PyInt_FromLong((long) wxEVT_COMMAND_LIST_GET_INFO)); - PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_SET_INFO", PyInt_FromLong((long) wxEVT_COMMAND_LIST_SET_INFO)); - PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_ITEM_SELECTED", PyInt_FromLong((long) wxEVT_COMMAND_LIST_ITEM_SELECTED)); - PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_ITEM_DESELECTED", PyInt_FromLong((long) wxEVT_COMMAND_LIST_ITEM_DESELECTED)); - PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_KEY_DOWN", PyInt_FromLong((long) wxEVT_COMMAND_LIST_KEY_DOWN)); - PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_INSERT_ITEM", PyInt_FromLong((long) wxEVT_COMMAND_LIST_INSERT_ITEM)); - PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_COL_CLICK", PyInt_FromLong((long) wxEVT_COMMAND_LIST_COL_CLICK)); - PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_ITEM_ACTIVATED", PyInt_FromLong((long) wxEVT_COMMAND_LIST_ITEM_ACTIVATED)); - PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK", PyInt_FromLong((long) wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK)); - PyDict_SetItemString(d,"wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK", PyInt_FromLong((long) wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK)); - PyDict_SetItemString(d,"wxLC_ICON", PyInt_FromLong((long) wxLC_ICON)); - PyDict_SetItemString(d,"wxLC_SMALL_ICON", PyInt_FromLong((long) wxLC_SMALL_ICON)); - PyDict_SetItemString(d,"wxLC_LIST", PyInt_FromLong((long) wxLC_LIST)); - PyDict_SetItemString(d,"wxLC_REPORT", PyInt_FromLong((long) wxLC_REPORT)); - PyDict_SetItemString(d,"wxLC_ALIGN_TOP", PyInt_FromLong((long) wxLC_ALIGN_TOP)); - PyDict_SetItemString(d,"wxLC_ALIGN_LEFT", PyInt_FromLong((long) wxLC_ALIGN_LEFT)); - PyDict_SetItemString(d,"wxLC_AUTOARRANGE", PyInt_FromLong((long) wxLC_AUTOARRANGE)); - PyDict_SetItemString(d,"wxLC_USER_TEXT", PyInt_FromLong((long) wxLC_USER_TEXT)); - PyDict_SetItemString(d,"wxLC_EDIT_LABELS", PyInt_FromLong((long) wxLC_EDIT_LABELS)); - PyDict_SetItemString(d,"wxLC_NO_HEADER", PyInt_FromLong((long) wxLC_NO_HEADER)); - PyDict_SetItemString(d,"wxLC_NO_SORT_HEADER", PyInt_FromLong((long) wxLC_NO_SORT_HEADER)); - PyDict_SetItemString(d,"wxLC_SINGLE_SEL", PyInt_FromLong((long) wxLC_SINGLE_SEL)); - PyDict_SetItemString(d,"wxLC_SORT_ASCENDING", PyInt_FromLong((long) wxLC_SORT_ASCENDING)); - PyDict_SetItemString(d,"wxLC_SORT_DESCENDING", PyInt_FromLong((long) wxLC_SORT_DESCENDING)); - PyDict_SetItemString(d,"wxLC_MASK_TYPE", PyInt_FromLong((long) wxLC_MASK_TYPE)); - PyDict_SetItemString(d,"wxLC_MASK_ALIGN", PyInt_FromLong((long) wxLC_MASK_ALIGN)); - PyDict_SetItemString(d,"wxLC_MASK_SORT", PyInt_FromLong((long) wxLC_MASK_SORT)); - PyDict_SetItemString(d,"wxLC_HRULES", PyInt_FromLong((long) wxLC_HRULES)); - PyDict_SetItemString(d,"wxLC_VRULES", PyInt_FromLong((long) wxLC_VRULES)); - PyDict_SetItemString(d,"wxLC_VIRTUAL", PyInt_FromLong((long) wxLC_VIRTUAL)); PyDict_SetItemString(d,"wxTreeItemIcon_Normal", PyInt_FromLong((long) wxTreeItemIcon_Normal)); PyDict_SetItemString(d,"wxTreeItemIcon_Selected", PyInt_FromLong((long) wxTreeItemIcon_Selected)); PyDict_SetItemString(d,"wxTreeItemIcon_Expanded", PyInt_FromLong((long) wxTreeItemIcon_Expanded)); diff --git a/wxPython/src/msw/controls2.py b/wxPython/src/msw/controls2.py index 46c97a51f1..fa3a1681aa 100644 --- a/wxPython/src/msw/controls2.py +++ b/wxPython/src/msw/controls2.py @@ -13,6 +13,58 @@ from events import * from controls import * import wx + +def EVT_LIST_BEGIN_DRAG(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_LIST_BEGIN_DRAG, func) + +def EVT_LIST_BEGIN_RDRAG(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_LIST_BEGIN_RDRAG, func) + +def EVT_LIST_BEGIN_LABEL_EDIT(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT, func) + +def EVT_LIST_END_LABEL_EDIT(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_LIST_END_LABEL_EDIT, func) + +def EVT_LIST_DELETE_ITEM(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_LIST_DELETE_ITEM, func) + +def EVT_LIST_DELETE_ALL_ITEMS(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS, func) + +def EVT_LIST_GET_INFO(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_LIST_GET_INFO, func) + +def EVT_LIST_SET_INFO(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_LIST_SET_INFO, func) + +def EVT_LIST_ITEM_SELECTED(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_LIST_ITEM_SELECTED, func) + +def EVT_LIST_ITEM_DESELECTED(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_LIST_ITEM_DESELECTED, func) + +def EVT_LIST_KEY_DOWN(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_LIST_KEY_DOWN, func) + +def EVT_LIST_INSERT_ITEM(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_LIST_INSERT_ITEM, func) + +def EVT_LIST_COL_CLICK(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_LIST_COL_CLICK, func) + +def EVT_LIST_ITEM_RIGHT_CLICK(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK, func) + +def EVT_LIST_ITEM_MIDDLE_CLICK(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK, func) + +def EVT_LIST_ITEM_ACTIVATED(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_LIST_ITEM_ACTIVATED, func) + +def EVT_LIST_CACHE_HINT(win, id, func): + win.Connect(id, -1, wxEVT_COMMAND_LIST_CACHE_HINT, func) + class wxListItemAttrPtr : def __init__(self,this): self.this = this @@ -315,66 +367,62 @@ class wxListCtrlPtr(wxControlPtr): def __init__(self,this): self.this = this self.thisown = 0 - def Arrange(self, *_args, **_kwargs): - val = apply(controls2c.wxListCtrl_Arrange,(self,) + _args, _kwargs) - return val - def AssignImageList(self, *_args, **_kwargs): - val = apply(controls2c.wxListCtrl_AssignImageList,(self,) + _args, _kwargs) - _args[0].thisown = 0 + def _setSelf(self, *_args, **_kwargs): + val = apply(controls2c.wxListCtrl__setSelf,(self,) + _args, _kwargs) return val - def DeleteItem(self, *_args, **_kwargs): - val = apply(controls2c.wxListCtrl_DeleteItem,(self,) + _args, _kwargs) + def SetForegroundColour(self, *_args, **_kwargs): + val = apply(controls2c.wxListCtrl_SetForegroundColour,(self,) + _args, _kwargs) return val - def DeleteAllItems(self, *_args, **_kwargs): - val = apply(controls2c.wxListCtrl_DeleteAllItems,(self,) + _args, _kwargs) + def SetBackgroundColour(self, *_args, **_kwargs): + val = apply(controls2c.wxListCtrl_SetBackgroundColour,(self,) + _args, _kwargs) return val - def DeleteColumn(self, *_args, **_kwargs): - val = apply(controls2c.wxListCtrl_DeleteColumn,(self,) + _args, _kwargs) + def GetColumn(self, *_args, **_kwargs): + val = apply(controls2c.wxListCtrl_GetColumn,(self,) + _args, _kwargs) return val - def DeleteAllColumns(self, *_args, **_kwargs): - val = apply(controls2c.wxListCtrl_DeleteAllColumns,(self,) + _args, _kwargs) + def SetColumn(self, *_args, **_kwargs): + val = apply(controls2c.wxListCtrl_SetColumn,(self,) + _args, _kwargs) return val - def ClearAll(self, *_args, **_kwargs): - val = apply(controls2c.wxListCtrl_ClearAll,(self,) + _args, _kwargs) + def GetColumnWidth(self, *_args, **_kwargs): + val = apply(controls2c.wxListCtrl_GetColumnWidth,(self,) + _args, _kwargs) return val - def EditLabel(self, *_args, **_kwargs): - val = apply(controls2c.wxListCtrl_EditLabel,(self,) + _args, _kwargs) + def SetColumnWidth(self, *_args, **_kwargs): + val = apply(controls2c.wxListCtrl_SetColumnWidth,(self,) + _args, _kwargs) return val - def EndEditLabel(self, *_args, **_kwargs): - val = apply(controls2c.wxListCtrl_EndEditLabel,(self,) + _args, _kwargs) + def GetCountPerPage(self, *_args, **_kwargs): + val = apply(controls2c.wxListCtrl_GetCountPerPage,(self,) + _args, _kwargs) return val def GetEditControl(self, *_args, **_kwargs): val = apply(controls2c.wxListCtrl_GetEditControl,(self,) + _args, _kwargs) return val - def EnsureVisible(self, *_args, **_kwargs): - val = apply(controls2c.wxListCtrl_EnsureVisible,(self,) + _args, _kwargs) + def GetItem(self, *_args, **_kwargs): + val = apply(controls2c.wxListCtrl_GetItem,(self,) + _args, _kwargs) return val - def FindItem(self, *_args, **_kwargs): - val = apply(controls2c.wxListCtrl_FindItem,(self,) + _args, _kwargs) + def SetItem(self, *_args, **_kwargs): + val = apply(controls2c.wxListCtrl_SetItem,(self,) + _args, _kwargs) return val - def FindItemData(self, *_args, **_kwargs): - val = apply(controls2c.wxListCtrl_FindItemData,(self,) + _args, _kwargs) + def SetStringItem(self, *_args, **_kwargs): + val = apply(controls2c.wxListCtrl_SetStringItem,(self,) + _args, _kwargs) return val - def FindItemAtPos(self, *_args, **_kwargs): - val = apply(controls2c.wxListCtrl_FindItemAtPos,(self,) + _args, _kwargs) + def GetItemState(self, *_args, **_kwargs): + val = apply(controls2c.wxListCtrl_GetItemState,(self,) + _args, _kwargs) return val - def GetColumn(self, *_args, **_kwargs): - val = apply(controls2c.wxListCtrl_GetColumn,(self,) + _args, _kwargs) + def SetItemState(self, *_args, **_kwargs): + val = apply(controls2c.wxListCtrl_SetItemState,(self,) + _args, _kwargs) return val - def GetColumnWidth(self, *_args, **_kwargs): - val = apply(controls2c.wxListCtrl_GetColumnWidth,(self,) + _args, _kwargs) + def SetItemImage(self, *_args, **_kwargs): + val = apply(controls2c.wxListCtrl_SetItemImage,(self,) + _args, _kwargs) return val - def GetCountPerPage(self, *_args, **_kwargs): - val = apply(controls2c.wxListCtrl_GetCountPerPage,(self,) + _args, _kwargs) + def GetItemText(self, *_args, **_kwargs): + val = apply(controls2c.wxListCtrl_GetItemText,(self,) + _args, _kwargs) return val - def GetImageList(self, *_args, **_kwargs): - val = apply(controls2c.wxListCtrl_GetImageList,(self,) + _args, _kwargs) + def SetItemText(self, *_args, **_kwargs): + val = apply(controls2c.wxListCtrl_SetItemText,(self,) + _args, _kwargs) return val def GetItemData(self, *_args, **_kwargs): val = apply(controls2c.wxListCtrl_GetItemData,(self,) + _args, _kwargs) return val - def GetItem(self, *_args, **_kwargs): - val = apply(controls2c.wxListCtrl_GetItem,(self,) + _args, _kwargs) + def SetItemData(self, *_args, **_kwargs): + val = apply(controls2c.wxListCtrl_SetItemData,(self,) + _args, _kwargs) return val def GetItemPosition(self, *_args, **_kwargs): val = apply(controls2c.wxListCtrl_GetItemPosition,(self,) + _args, _kwargs) @@ -384,21 +432,18 @@ class wxListCtrlPtr(wxControlPtr): val = apply(controls2c.wxListCtrl_GetItemRect,(self,) + _args, _kwargs) if val: val = wxRectPtr(val) ; val.thisown = 1 return val - def GetItemState(self, *_args, **_kwargs): - val = apply(controls2c.wxListCtrl_GetItemState,(self,) + _args, _kwargs) + def SetItemPosition(self, *_args, **_kwargs): + val = apply(controls2c.wxListCtrl_SetItemPosition,(self,) + _args, _kwargs) return val def GetItemCount(self, *_args, **_kwargs): val = apply(controls2c.wxListCtrl_GetItemCount,(self,) + _args, _kwargs) return val + def GetColumnCount(self, *_args, **_kwargs): + val = apply(controls2c.wxListCtrl_GetColumnCount,(self,) + _args, _kwargs) + return val def GetItemSpacing(self, *_args, **_kwargs): val = apply(controls2c.wxListCtrl_GetItemSpacing,(self,) + _args, _kwargs) return val - def GetItemText(self, *_args, **_kwargs): - val = apply(controls2c.wxListCtrl_GetItemText,(self,) + _args, _kwargs) - return val - def GetNextItem(self, *_args, **_kwargs): - val = apply(controls2c.wxListCtrl_GetNextItem,(self,) + _args, _kwargs) - return val def GetSelectedItemCount(self, *_args, **_kwargs): val = apply(controls2c.wxListCtrl_GetSelectedItemCount,(self,) + _args, _kwargs) return val @@ -412,68 +457,96 @@ class wxListCtrlPtr(wxControlPtr): def GetTopItem(self, *_args, **_kwargs): val = apply(controls2c.wxListCtrl_GetTopItem,(self,) + _args, _kwargs) return val - def HitTest(self, *_args, **_kwargs): - val = apply(controls2c.wxListCtrl_HitTest,(self,) + _args, _kwargs) + def SetSingleStyle(self, *_args, **_kwargs): + val = apply(controls2c.wxListCtrl_SetSingleStyle,(self,) + _args, _kwargs) return val - def InsertColumnInfo(self, *_args, **_kwargs): - val = apply(controls2c.wxListCtrl_InsertColumnInfo,(self,) + _args, _kwargs) + def SetWindowStyleFlag(self, *_args, **_kwargs): + val = apply(controls2c.wxListCtrl_SetWindowStyleFlag,(self,) + _args, _kwargs) return val - def InsertColumn(self, *_args, **_kwargs): - val = apply(controls2c.wxListCtrl_InsertColumn,(self,) + _args, _kwargs) + def GetNextItem(self, *_args, **_kwargs): + val = apply(controls2c.wxListCtrl_GetNextItem,(self,) + _args, _kwargs) return val - def InsertItem(self, *_args, **_kwargs): - val = apply(controls2c.wxListCtrl_InsertItem,(self,) + _args, _kwargs) + def GetImageList(self, *_args, **_kwargs): + val = apply(controls2c.wxListCtrl_GetImageList,(self,) + _args, _kwargs) return val - def InsertStringItem(self, *_args, **_kwargs): - val = apply(controls2c.wxListCtrl_InsertStringItem,(self,) + _args, _kwargs) + def SetImageList(self, *_args, **_kwargs): + val = apply(controls2c.wxListCtrl_SetImageList,(self,) + _args, _kwargs) return val - def InsertImageItem(self, *_args, **_kwargs): - val = apply(controls2c.wxListCtrl_InsertImageItem,(self,) + _args, _kwargs) + def AssignImageList(self, *_args, **_kwargs): + val = apply(controls2c.wxListCtrl_AssignImageList,(self,) + _args, _kwargs) + _args[0].thisown = 0 return val - def InsertImageStringItem(self, *_args, **_kwargs): - val = apply(controls2c.wxListCtrl_InsertImageStringItem,(self,) + _args, _kwargs) + def IsVirtual(self, *_args, **_kwargs): + val = apply(controls2c.wxListCtrl_IsVirtual,(self,) + _args, _kwargs) return val - def ScrollList(self, *_args, **_kwargs): - val = apply(controls2c.wxListCtrl_ScrollList,(self,) + _args, _kwargs) + def RefreshItem(self, *_args, **_kwargs): + val = apply(controls2c.wxListCtrl_RefreshItem,(self,) + _args, _kwargs) return val - def SetBackgroundColour(self, *_args, **_kwargs): - val = apply(controls2c.wxListCtrl_SetBackgroundColour,(self,) + _args, _kwargs) + def RefreshItems(self, *_args, **_kwargs): + val = apply(controls2c.wxListCtrl_RefreshItems,(self,) + _args, _kwargs) return val - def SetColumn(self, *_args, **_kwargs): - val = apply(controls2c.wxListCtrl_SetColumn,(self,) + _args, _kwargs) + def Arrange(self, *_args, **_kwargs): + val = apply(controls2c.wxListCtrl_Arrange,(self,) + _args, _kwargs) return val - def SetColumnWidth(self, *_args, **_kwargs): - val = apply(controls2c.wxListCtrl_SetColumnWidth,(self,) + _args, _kwargs) + def DeleteItem(self, *_args, **_kwargs): + val = apply(controls2c.wxListCtrl_DeleteItem,(self,) + _args, _kwargs) return val - def SetImageList(self, *_args, **_kwargs): - val = apply(controls2c.wxListCtrl_SetImageList,(self,) + _args, _kwargs) + def DeleteAllItems(self, *_args, **_kwargs): + val = apply(controls2c.wxListCtrl_DeleteAllItems,(self,) + _args, _kwargs) return val - def SetItem(self, *_args, **_kwargs): - val = apply(controls2c.wxListCtrl_SetItem,(self,) + _args, _kwargs) + def DeleteColumn(self, *_args, **_kwargs): + val = apply(controls2c.wxListCtrl_DeleteColumn,(self,) + _args, _kwargs) return val - def SetStringItem(self, *_args, **_kwargs): - val = apply(controls2c.wxListCtrl_SetStringItem,(self,) + _args, _kwargs) + def DeleteAllColumns(self, *_args, **_kwargs): + val = apply(controls2c.wxListCtrl_DeleteAllColumns,(self,) + _args, _kwargs) return val - def SetItemData(self, *_args, **_kwargs): - val = apply(controls2c.wxListCtrl_SetItemData,(self,) + _args, _kwargs) + def ClearAll(self, *_args, **_kwargs): + val = apply(controls2c.wxListCtrl_ClearAll,(self,) + _args, _kwargs) return val - def SetItemImage(self, *_args, **_kwargs): - val = apply(controls2c.wxListCtrl_SetItemImage,(self,) + _args, _kwargs) + def EditLabel(self, *_args, **_kwargs): + val = apply(controls2c.wxListCtrl_EditLabel,(self,) + _args, _kwargs) return val - def SetItemPosition(self, *_args, **_kwargs): - val = apply(controls2c.wxListCtrl_SetItemPosition,(self,) + _args, _kwargs) + def EndEditLabel(self, *_args, **_kwargs): + val = apply(controls2c.wxListCtrl_EndEditLabel,(self,) + _args, _kwargs) return val - def SetItemState(self, *_args, **_kwargs): - val = apply(controls2c.wxListCtrl_SetItemState,(self,) + _args, _kwargs) + def EnsureVisible(self, *_args, **_kwargs): + val = apply(controls2c.wxListCtrl_EnsureVisible,(self,) + _args, _kwargs) return val - def SetItemText(self, *_args, **_kwargs): - val = apply(controls2c.wxListCtrl_SetItemText,(self,) + _args, _kwargs) + def FindItem(self, *_args, **_kwargs): + val = apply(controls2c.wxListCtrl_FindItem,(self,) + _args, _kwargs) return val - def SetSingleStyle(self, *_args, **_kwargs): - val = apply(controls2c.wxListCtrl_SetSingleStyle,(self,) + _args, _kwargs) + def FindItemData(self, *_args, **_kwargs): + val = apply(controls2c.wxListCtrl_FindItemData,(self,) + _args, _kwargs) return val - def SetWindowStyleFlag(self, *_args, **_kwargs): - val = apply(controls2c.wxListCtrl_SetWindowStyleFlag,(self,) + _args, _kwargs) + def FindItemAtPos(self, *_args, **_kwargs): + val = apply(controls2c.wxListCtrl_FindItemAtPos,(self,) + _args, _kwargs) + return val + def HitTest(self, *_args, **_kwargs): + val = apply(controls2c.wxListCtrl_HitTest,(self,) + _args, _kwargs) + return val + def InsertItem(self, *_args, **_kwargs): + val = apply(controls2c.wxListCtrl_InsertItem,(self,) + _args, _kwargs) + return val + def InsertStringItem(self, *_args, **_kwargs): + val = apply(controls2c.wxListCtrl_InsertStringItem,(self,) + _args, _kwargs) + return val + def InsertImageItem(self, *_args, **_kwargs): + val = apply(controls2c.wxListCtrl_InsertImageItem,(self,) + _args, _kwargs) + return val + def InsertImageStringItem(self, *_args, **_kwargs): + val = apply(controls2c.wxListCtrl_InsertImageStringItem,(self,) + _args, _kwargs) + return val + def InsertColumnInfo(self, *_args, **_kwargs): + val = apply(controls2c.wxListCtrl_InsertColumnInfo,(self,) + _args, _kwargs) + return val + def InsertColumn(self, *_args, **_kwargs): + val = apply(controls2c.wxListCtrl_InsertColumn,(self,) + _args, _kwargs) + return val + def SetItemCount(self, *_args, **_kwargs): + val = apply(controls2c.wxListCtrl_SetItemCount,(self,) + _args, _kwargs) + return val + def ScrollList(self, *_args, **_kwargs): + val = apply(controls2c.wxListCtrl_ScrollList,(self,) + _args, _kwargs) return val def SortItems(self, *_args, **_kwargs): val = apply(controls2c.wxListCtrl_SortItems,(self,) + _args, _kwargs) @@ -491,6 +564,7 @@ class wxListCtrl(wxListCtrlPtr): self.this = apply(controls2c.new_wxListCtrl,_args,_kwargs) self.thisown = 1 #wx._StdWindowCallbacks(self) + self._setSelf(self, wxListCtrl) @@ -838,12 +912,49 @@ class wxTreeCtrl(wxTreeCtrlPtr): #-------------- VARIABLE WRAPPERS ------------------ +wxEVT_COMMAND_LIST_BEGIN_DRAG = controls2c.wxEVT_COMMAND_LIST_BEGIN_DRAG +wxEVT_COMMAND_LIST_BEGIN_RDRAG = controls2c.wxEVT_COMMAND_LIST_BEGIN_RDRAG +wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT = controls2c.wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT +wxEVT_COMMAND_LIST_END_LABEL_EDIT = controls2c.wxEVT_COMMAND_LIST_END_LABEL_EDIT +wxEVT_COMMAND_LIST_DELETE_ITEM = controls2c.wxEVT_COMMAND_LIST_DELETE_ITEM +wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS = controls2c.wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS +wxEVT_COMMAND_LIST_GET_INFO = controls2c.wxEVT_COMMAND_LIST_GET_INFO +wxEVT_COMMAND_LIST_SET_INFO = controls2c.wxEVT_COMMAND_LIST_SET_INFO +wxEVT_COMMAND_LIST_ITEM_SELECTED = controls2c.wxEVT_COMMAND_LIST_ITEM_SELECTED +wxEVT_COMMAND_LIST_ITEM_DESELECTED = controls2c.wxEVT_COMMAND_LIST_ITEM_DESELECTED +wxEVT_COMMAND_LIST_KEY_DOWN = controls2c.wxEVT_COMMAND_LIST_KEY_DOWN +wxEVT_COMMAND_LIST_INSERT_ITEM = controls2c.wxEVT_COMMAND_LIST_INSERT_ITEM +wxEVT_COMMAND_LIST_COL_CLICK = controls2c.wxEVT_COMMAND_LIST_COL_CLICK +wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK = controls2c.wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK +wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK = controls2c.wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK +wxEVT_COMMAND_LIST_ITEM_ACTIVATED = controls2c.wxEVT_COMMAND_LIST_ITEM_ACTIVATED +wxEVT_COMMAND_LIST_CACHE_HINT = controls2c.wxEVT_COMMAND_LIST_CACHE_HINT +wxLC_VRULES = controls2c.wxLC_VRULES +wxLC_HRULES = controls2c.wxLC_HRULES +wxLC_ICON = controls2c.wxLC_ICON +wxLC_SMALL_ICON = controls2c.wxLC_SMALL_ICON +wxLC_LIST = controls2c.wxLC_LIST +wxLC_REPORT = controls2c.wxLC_REPORT +wxLC_ALIGN_TOP = controls2c.wxLC_ALIGN_TOP +wxLC_ALIGN_LEFT = controls2c.wxLC_ALIGN_LEFT +wxLC_AUTOARRANGE = controls2c.wxLC_AUTOARRANGE +wxLC_VIRTUAL = controls2c.wxLC_VIRTUAL +wxLC_EDIT_LABELS = controls2c.wxLC_EDIT_LABELS +wxLC_NO_HEADER = controls2c.wxLC_NO_HEADER +wxLC_NO_SORT_HEADER = controls2c.wxLC_NO_SORT_HEADER +wxLC_SINGLE_SEL = controls2c.wxLC_SINGLE_SEL +wxLC_SORT_ASCENDING = controls2c.wxLC_SORT_ASCENDING +wxLC_SORT_DESCENDING = controls2c.wxLC_SORT_DESCENDING +wxLC_MASK_TYPE = controls2c.wxLC_MASK_TYPE +wxLC_MASK_ALIGN = controls2c.wxLC_MASK_ALIGN +wxLC_MASK_SORT = controls2c.wxLC_MASK_SORT +wxLIST_MASK_STATE = controls2c.wxLIST_MASK_STATE wxLIST_MASK_TEXT = controls2c.wxLIST_MASK_TEXT wxLIST_MASK_IMAGE = controls2c.wxLIST_MASK_IMAGE wxLIST_MASK_DATA = controls2c.wxLIST_MASK_DATA +wxLIST_SET_ITEM = controls2c.wxLIST_SET_ITEM wxLIST_MASK_WIDTH = controls2c.wxLIST_MASK_WIDTH wxLIST_MASK_FORMAT = controls2c.wxLIST_MASK_FORMAT -wxLIST_MASK_STATE = controls2c.wxLIST_MASK_STATE wxLIST_STATE_DONTCARE = controls2c.wxLIST_STATE_DONTCARE wxLIST_STATE_DROPHILITED = controls2c.wxLIST_STATE_DROPHILITED wxLIST_STATE_FOCUSED = controls2c.wxLIST_STATE_FOCUSED @@ -881,42 +992,6 @@ wxLIST_FORMAT_LEFT = controls2c.wxLIST_FORMAT_LEFT wxLIST_FORMAT_RIGHT = controls2c.wxLIST_FORMAT_RIGHT wxLIST_FORMAT_CENTRE = controls2c.wxLIST_FORMAT_CENTRE wxLIST_FORMAT_CENTER = controls2c.wxLIST_FORMAT_CENTER -wxEVT_COMMAND_LIST_BEGIN_DRAG = controls2c.wxEVT_COMMAND_LIST_BEGIN_DRAG -wxEVT_COMMAND_LIST_BEGIN_RDRAG = controls2c.wxEVT_COMMAND_LIST_BEGIN_RDRAG -wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT = controls2c.wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT -wxEVT_COMMAND_LIST_END_LABEL_EDIT = controls2c.wxEVT_COMMAND_LIST_END_LABEL_EDIT -wxEVT_COMMAND_LIST_DELETE_ITEM = controls2c.wxEVT_COMMAND_LIST_DELETE_ITEM -wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS = controls2c.wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS -wxEVT_COMMAND_LIST_GET_INFO = controls2c.wxEVT_COMMAND_LIST_GET_INFO -wxEVT_COMMAND_LIST_SET_INFO = controls2c.wxEVT_COMMAND_LIST_SET_INFO -wxEVT_COMMAND_LIST_ITEM_SELECTED = controls2c.wxEVT_COMMAND_LIST_ITEM_SELECTED -wxEVT_COMMAND_LIST_ITEM_DESELECTED = controls2c.wxEVT_COMMAND_LIST_ITEM_DESELECTED -wxEVT_COMMAND_LIST_KEY_DOWN = controls2c.wxEVT_COMMAND_LIST_KEY_DOWN -wxEVT_COMMAND_LIST_INSERT_ITEM = controls2c.wxEVT_COMMAND_LIST_INSERT_ITEM -wxEVT_COMMAND_LIST_COL_CLICK = controls2c.wxEVT_COMMAND_LIST_COL_CLICK -wxEVT_COMMAND_LIST_ITEM_ACTIVATED = controls2c.wxEVT_COMMAND_LIST_ITEM_ACTIVATED -wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK = controls2c.wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK -wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK = controls2c.wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK -wxLC_ICON = controls2c.wxLC_ICON -wxLC_SMALL_ICON = controls2c.wxLC_SMALL_ICON -wxLC_LIST = controls2c.wxLC_LIST -wxLC_REPORT = controls2c.wxLC_REPORT -wxLC_ALIGN_TOP = controls2c.wxLC_ALIGN_TOP -wxLC_ALIGN_LEFT = controls2c.wxLC_ALIGN_LEFT -wxLC_AUTOARRANGE = controls2c.wxLC_AUTOARRANGE -wxLC_USER_TEXT = controls2c.wxLC_USER_TEXT -wxLC_EDIT_LABELS = controls2c.wxLC_EDIT_LABELS -wxLC_NO_HEADER = controls2c.wxLC_NO_HEADER -wxLC_NO_SORT_HEADER = controls2c.wxLC_NO_SORT_HEADER -wxLC_SINGLE_SEL = controls2c.wxLC_SINGLE_SEL -wxLC_SORT_ASCENDING = controls2c.wxLC_SORT_ASCENDING -wxLC_SORT_DESCENDING = controls2c.wxLC_SORT_DESCENDING -wxLC_MASK_TYPE = controls2c.wxLC_MASK_TYPE -wxLC_MASK_ALIGN = controls2c.wxLC_MASK_ALIGN -wxLC_MASK_SORT = controls2c.wxLC_MASK_SORT -wxLC_HRULES = controls2c.wxLC_HRULES -wxLC_VRULES = controls2c.wxLC_VRULES -wxLC_VIRTUAL = controls2c.wxLC_VIRTUAL wxTreeItemIcon_Normal = controls2c.wxTreeItemIcon_Normal wxTreeItemIcon_Selected = controls2c.wxTreeItemIcon_Selected wxTreeItemIcon_Expanded = controls2c.wxTreeItemIcon_Expanded diff --git a/wxPython/src/msw/events.cpp b/wxPython/src/msw/events.cpp index 2d2ec601d9..c621b19105 100644 --- a/wxPython/src/msw/events.cpp +++ b/wxPython/src/msw/events.cpp @@ -6514,6 +6514,153 @@ static PyObject *_wrap_wxTimerEvent_GetInterval(PyObject *self, PyObject *args, return _resultobj; } +static void *SwigwxTextUrlEventTowxCommandEvent(void *ptr) { + wxTextUrlEvent *src; + wxCommandEvent *dest; + src = (wxTextUrlEvent *) ptr; + dest = (wxCommandEvent *) src; + return (void *) dest; +} + +static void *SwigwxTextUrlEventTowxEvent(void *ptr) { + wxTextUrlEvent *src; + wxEvent *dest; + src = (wxTextUrlEvent *) ptr; + dest = (wxEvent *) src; + return (void *) dest; +} + +static void *SwigwxTextUrlEventTowxObject(void *ptr) { + wxTextUrlEvent *src; + wxObject *dest; + src = (wxTextUrlEvent *) ptr; + dest = (wxObject *) src; + return (void *) dest; +} + +#define new_wxTextUrlEvent(_swigarg0,_swigarg1,_swigarg2,_swigarg3) (new wxTextUrlEvent(_swigarg0,_swigarg1,_swigarg2,_swigarg3)) +static PyObject *_wrap_new_wxTextUrlEvent(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxTextUrlEvent * _result; + int _arg0; + wxMouseEvent * _arg1; + long _arg2; + long _arg3; + PyObject * _argo1 = 0; + char *_kwnames[] = { "id","evtMouse","start","end", NULL }; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"iOll:new_wxTextUrlEvent",_kwnames,&_arg0,&_argo1,&_arg2,&_arg3)) + return NULL; + if (_argo1) { + if (_argo1 == Py_None) { _arg1 = NULL; } + else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxMouseEvent_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of new_wxTextUrlEvent. Expected _wxMouseEvent_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (wxTextUrlEvent *)new_wxTextUrlEvent(_arg0,*_arg1,_arg2,_arg3); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} if (_result) { + SWIG_MakePtr(_ptemp, (char *) _result,"_wxTextUrlEvent_p"); + _resultobj = Py_BuildValue("s",_ptemp); + } else { + Py_INCREF(Py_None); + _resultobj = Py_None; + } + return _resultobj; +} + +#define wxTextUrlEvent_GetMouseEvent(_swigobj) (_swigobj->GetMouseEvent()) +static PyObject *_wrap_wxTextUrlEvent_GetMouseEvent(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + wxMouseEvent * _result; + wxTextUrlEvent * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxTextUrlEvent_GetMouseEvent",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxTextUrlEvent_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxTextUrlEvent_GetMouseEvent. Expected _wxTextUrlEvent_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + const wxMouseEvent & _result_ref = wxTextUrlEvent_GetMouseEvent(_arg0); + _result = (wxMouseEvent *) &_result_ref; + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +}{ _resultobj = wxPyMake_wxObject(_result); } + return _resultobj; +} + +#define wxTextUrlEvent_GetURLStart(_swigobj) (_swigobj->GetURLStart()) +static PyObject *_wrap_wxTextUrlEvent_GetURLStart(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + long _result; + wxTextUrlEvent * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxTextUrlEvent_GetURLStart",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxTextUrlEvent_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxTextUrlEvent_GetURLStart. Expected _wxTextUrlEvent_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (long )wxTextUrlEvent_GetURLStart(_arg0); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("l",_result); + return _resultobj; +} + +#define wxTextUrlEvent_GetURLEnd(_swigobj) (_swigobj->GetURLEnd()) +static PyObject *_wrap_wxTextUrlEvent_GetURLEnd(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + long _result; + wxTextUrlEvent * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxTextUrlEvent_GetURLEnd",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxTextUrlEvent_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxTextUrlEvent_GetURLEnd. Expected _wxTextUrlEvent_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (long )wxTextUrlEvent_GetURLEnd(_arg0); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("l",_result); + return _resultobj; +} + static void *SwigwxPyEventTowxEvent(void *ptr) { wxPyEvent *src; wxEvent *dest; @@ -6800,6 +6947,10 @@ static PyMethodDef eventscMethods[] = { { "wxPyEvent_SetSelf", (PyCFunction) _wrap_wxPyEvent_SetSelf, METH_VARARGS | METH_KEYWORDS }, { "delete_wxPyEvent", (PyCFunction) _wrap_delete_wxPyEvent, METH_VARARGS | METH_KEYWORDS }, { "new_wxPyEvent", (PyCFunction) _wrap_new_wxPyEvent, METH_VARARGS | METH_KEYWORDS }, + { "wxTextUrlEvent_GetURLEnd", (PyCFunction) _wrap_wxTextUrlEvent_GetURLEnd, METH_VARARGS | METH_KEYWORDS }, + { "wxTextUrlEvent_GetURLStart", (PyCFunction) _wrap_wxTextUrlEvent_GetURLStart, METH_VARARGS | METH_KEYWORDS }, + { "wxTextUrlEvent_GetMouseEvent", (PyCFunction) _wrap_wxTextUrlEvent_GetMouseEvent, METH_VARARGS | METH_KEYWORDS }, + { "new_wxTextUrlEvent", (PyCFunction) _wrap_new_wxTextUrlEvent, METH_VARARGS | METH_KEYWORDS }, { "wxTimerEvent_GetInterval", (PyCFunction) _wrap_wxTimerEvent_GetInterval, METH_VARARGS | METH_KEYWORDS }, { "new_wxTimerEvent", (PyCFunction) _wrap_new_wxTimerEvent, METH_VARARGS | METH_KEYWORDS }, { "wxWindowDestroyEvent_GetWindow", (PyCFunction) _wrap_wxWindowDestroyEvent_GetWindow, METH_VARARGS | METH_KEYWORDS }, @@ -7012,6 +7163,7 @@ static PyMethodDef eventscMethods[] = { static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_wxEvent","_wxPyCommandEvent",SwigwxPyCommandEventTowxEvent}, { "_wxEvent","_wxPyEvent",SwigwxPyEventTowxEvent}, + { "_wxEvent","_wxTextUrlEvent",SwigwxTextUrlEventTowxEvent}, { "_wxEvent","_wxTimerEvent",SwigwxTimerEventTowxEvent}, { "_wxEvent","_wxWindowDestroyEvent",SwigwxWindowDestroyEventTowxEvent}, { "_wxEvent","_wxWindowCreateEvent",SwigwxWindowCreateEventTowxEvent}, @@ -7071,6 +7223,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_uint","_wxWindowID",0}, { "_wxChar","_char",0}, { "_wxCommandEvent","_wxPyCommandEvent",SwigwxPyCommandEventTowxCommandEvent}, + { "_wxCommandEvent","_wxTextUrlEvent",SwigwxTextUrlEventTowxCommandEvent}, { "_wxCommandEvent","_wxWindowDestroyEvent",SwigwxWindowDestroyEventTowxCommandEvent}, { "_wxCommandEvent","_wxWindowCreateEvent",SwigwxWindowCreateEventTowxCommandEvent}, { "_wxCommandEvent","_wxNotifyEvent",SwigwxNotifyEventTowxCommandEvent}, @@ -7096,6 +7249,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = { { "_unsigned_short","_short",0}, { "_wxObject","_wxPyCommandEvent",SwigwxPyCommandEventTowxObject}, { "_wxObject","_wxPyEvent",SwigwxPyEventTowxObject}, + { "_wxObject","_wxTextUrlEvent",SwigwxTextUrlEventTowxObject}, { "_wxObject","_wxTimerEvent",SwigwxTimerEventTowxObject}, { "_wxObject","_wxWindowDestroyEvent",SwigwxWindowDestroyEventTowxObject}, { "_wxObject","_wxWindowCreateEvent",SwigwxWindowCreateEventTowxObject}, diff --git a/wxPython/src/msw/events.py b/wxPython/src/msw/events.py index 23b0f69519..3ffb34f29d 100644 --- a/wxPython/src/msw/events.py +++ b/wxPython/src/msw/events.py @@ -942,6 +942,29 @@ class wxTimerEvent(wxTimerEventPtr): +class wxTextUrlEventPtr(wxCommandEventPtr): + def __init__(self,this): + self.this = this + self.thisown = 0 + def GetMouseEvent(self, *_args, **_kwargs): + val = apply(eventsc.wxTextUrlEvent_GetMouseEvent,(self,) + _args, _kwargs) + return val + def GetURLStart(self, *_args, **_kwargs): + val = apply(eventsc.wxTextUrlEvent_GetURLStart,(self,) + _args, _kwargs) + return val + def GetURLEnd(self, *_args, **_kwargs): + val = apply(eventsc.wxTextUrlEvent_GetURLEnd,(self,) + _args, _kwargs) + return val + def __repr__(self): + return "" % (self.this,) +class wxTextUrlEvent(wxTextUrlEventPtr): + def __init__(self,*_args,**_kwargs): + self.this = apply(eventsc.new_wxTextUrlEvent,_args,_kwargs) + self.thisown = 1 + + + + class wxPyEventPtr(wxEventPtr): def __init__(self,this): self.this = this diff --git a/wxPython/src/msw/gdi.cpp b/wxPython/src/msw/gdi.cpp index caa2634f5e..f30a267d9e 100644 --- a/wxPython/src/msw/gdi.cpp +++ b/wxPython/src/msw/gdi.cpp @@ -8515,6 +8515,34 @@ static PyObject *_wrap_wxDC_ResetBoundingBox(PyObject *self, PyObject *args, PyO return _resultobj; } +#define wxDC_GetHDC(_swigobj) (_swigobj->GetHDC()) +static PyObject *_wrap_wxDC_GetHDC(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + long _result; + wxDC * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxDC_GetHDC",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxDC_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxDC_GetHDC. Expected _wxDC_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (long )wxDC_GetHDC(_arg0); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("l",_result); + return _resultobj; +} + static void *SwigwxMemoryDCTowxDC(void *ptr) { wxMemoryDC *src; wxDC *dest; @@ -10770,6 +10798,7 @@ static PyMethodDef gdicMethods[] = { { "new_wxScreenDC", (PyCFunction) _wrap_new_wxScreenDC, METH_VARARGS | METH_KEYWORDS }, { "wxMemoryDC_SelectObject", (PyCFunction) _wrap_wxMemoryDC_SelectObject, METH_VARARGS | METH_KEYWORDS }, { "new_wxMemoryDC", (PyCFunction) _wrap_new_wxMemoryDC, METH_VARARGS | METH_KEYWORDS }, + { "wxDC_GetHDC", (PyCFunction) _wrap_wxDC_GetHDC, METH_VARARGS | METH_KEYWORDS }, { "wxDC_ResetBoundingBox", (PyCFunction) _wrap_wxDC_ResetBoundingBox, METH_VARARGS | METH_KEYWORDS }, { "wxDC_CalcBoundingBox", (PyCFunction) _wrap_wxDC_CalcBoundingBox, METH_VARARGS | METH_KEYWORDS }, { "wxDC_SetAxisOrientation", (PyCFunction) _wrap_wxDC_SetAxisOrientation, METH_VARARGS | METH_KEYWORDS }, diff --git a/wxPython/src/msw/gdi.py b/wxPython/src/msw/gdi.py index b8a6156f14..a4a82578fa 100644 --- a/wxPython/src/msw/gdi.py +++ b/wxPython/src/msw/gdi.py @@ -821,6 +821,9 @@ class wxDCPtr(wxObjectPtr): def ResetBoundingBox(self, *_args, **_kwargs): val = apply(gdic.wxDC_ResetBoundingBox,(self,) + _args, _kwargs) return val + def GetHDC(self, *_args, **_kwargs): + val = apply(gdic.wxDC_GetHDC,(self,) + _args, _kwargs) + return val def __repr__(self): return "" % (self.this,) class wxDC(wxDCPtr): diff --git a/wxPython/src/msw/windows.cpp b/wxPython/src/msw/windows.cpp index 879fd55b6d..b0b02922b3 100644 --- a/wxPython/src/msw/windows.cpp +++ b/wxPython/src/msw/windows.cpp @@ -5411,6 +5411,176 @@ static PyObject *_wrap_wxWindow_SetHelpText(PyObject *self, PyObject *args, PyOb return _resultobj; } +#define wxWindow_ScrollLines(_swigobj,_swigarg0) (_swigobj->ScrollLines(_swigarg0)) +static PyObject *_wrap_wxWindow_ScrollLines(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxWindow * _arg0; + int _arg1; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self","lines", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxWindow_ScrollLines",_kwnames,&_argo0,&_arg1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxWindow_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxWindow_ScrollLines. Expected _wxWindow_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (bool )wxWindow_ScrollLines(_arg0,_arg1); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxWindow_ScrollPages(_swigobj,_swigarg0) (_swigobj->ScrollPages(_swigarg0)) +static PyObject *_wrap_wxWindow_ScrollPages(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxWindow * _arg0; + int _arg1; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self","pages", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxWindow_ScrollPages",_kwnames,&_argo0,&_arg1)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxWindow_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxWindow_ScrollPages. Expected _wxWindow_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (bool )wxWindow_ScrollPages(_arg0,_arg1); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxWindow_LineUp(_swigobj) (_swigobj->LineUp()) +static PyObject *_wrap_wxWindow_LineUp(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxWindow * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxWindow_LineUp",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxWindow_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxWindow_LineUp. Expected _wxWindow_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (bool )wxWindow_LineUp(_arg0); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxWindow_LineDown(_swigobj) (_swigobj->LineDown()) +static PyObject *_wrap_wxWindow_LineDown(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxWindow * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxWindow_LineDown",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxWindow_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxWindow_LineDown. Expected _wxWindow_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (bool )wxWindow_LineDown(_arg0); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxWindow_PageUp(_swigobj) (_swigobj->PageUp()) +static PyObject *_wrap_wxWindow_PageUp(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxWindow * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxWindow_PageUp",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxWindow_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxWindow_PageUp. Expected _wxWindow_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (bool )wxWindow_PageUp(_arg0); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + +#define wxWindow_PageDown(_swigobj) (_swigobj->PageDown()) +static PyObject *_wrap_wxWindow_PageDown(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject * _resultobj; + bool _result; + wxWindow * _arg0; + PyObject * _argo0 = 0; + char *_kwnames[] = { "self", NULL }; + + self = self; + if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxWindow_PageDown",_kwnames,&_argo0)) + return NULL; + if (_argo0) { + if (_argo0 == Py_None) { _arg0 = NULL; } + else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxWindow_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxWindow_PageDown. Expected _wxWindow_p."); + return NULL; + } + } +{ + wxPy_BEGIN_ALLOW_THREADS; + _result = (bool )wxWindow_PageDown(_arg0); + + wxPy_END_ALLOW_THREADS; + if (PyErr_Occurred()) return NULL; +} _resultobj = Py_BuildValue("i",_result); + return _resultobj; +} + static void *SwigwxPanelTowxWindow(void *ptr) { wxPanel *src; wxWindow *dest; @@ -10611,6 +10781,12 @@ static PyMethodDef windowscMethods[] = { { "wxPanel_GetDefaultItem", (PyCFunction) _wrap_wxPanel_GetDefaultItem, METH_VARARGS | METH_KEYWORDS }, { "wxPanel_InitDialog", (PyCFunction) _wrap_wxPanel_InitDialog, METH_VARARGS | METH_KEYWORDS }, { "new_wxPanel", (PyCFunction) _wrap_new_wxPanel, METH_VARARGS | METH_KEYWORDS }, + { "wxWindow_PageDown", (PyCFunction) _wrap_wxWindow_PageDown, METH_VARARGS | METH_KEYWORDS }, + { "wxWindow_PageUp", (PyCFunction) _wrap_wxWindow_PageUp, METH_VARARGS | METH_KEYWORDS }, + { "wxWindow_LineDown", (PyCFunction) _wrap_wxWindow_LineDown, METH_VARARGS | METH_KEYWORDS }, + { "wxWindow_LineUp", (PyCFunction) _wrap_wxWindow_LineUp, METH_VARARGS | METH_KEYWORDS }, + { "wxWindow_ScrollPages", (PyCFunction) _wrap_wxWindow_ScrollPages, METH_VARARGS | METH_KEYWORDS }, + { "wxWindow_ScrollLines", (PyCFunction) _wrap_wxWindow_ScrollLines, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_SetHelpText", (PyCFunction) _wrap_wxWindow_SetHelpText, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_GetHelpText", (PyCFunction) _wrap_wxWindow_GetHelpText, METH_VARARGS | METH_KEYWORDS }, { "wxWindow_Thaw", (PyCFunction) _wrap_wxWindow_Thaw, METH_VARARGS | METH_KEYWORDS }, diff --git a/wxPython/src/msw/windows.py b/wxPython/src/msw/windows.py index 62b262461d..86a35d04a2 100644 --- a/wxPython/src/msw/windows.py +++ b/wxPython/src/msw/windows.py @@ -520,6 +520,24 @@ class wxWindowPtr(wxEvtHandlerPtr): def SetHelpText(self, *_args, **_kwargs): val = apply(windowsc.wxWindow_SetHelpText,(self,) + _args, _kwargs) return val + def ScrollLines(self, *_args, **_kwargs): + val = apply(windowsc.wxWindow_ScrollLines,(self,) + _args, _kwargs) + return val + def ScrollPages(self, *_args, **_kwargs): + val = apply(windowsc.wxWindow_ScrollPages,(self,) + _args, _kwargs) + return val + def LineUp(self, *_args, **_kwargs): + val = apply(windowsc.wxWindow_LineUp,(self,) + _args, _kwargs) + return val + def LineDown(self, *_args, **_kwargs): + val = apply(windowsc.wxWindow_LineDown,(self,) + _args, _kwargs) + return val + def PageUp(self, *_args, **_kwargs): + val = apply(windowsc.wxWindow_PageUp,(self,) + _args, _kwargs) + return val + def PageDown(self, *_args, **_kwargs): + val = apply(windowsc.wxWindow_PageDown,(self,) + _args, _kwargs) + return val def __repr__(self): return "" % (self.this,) # replaces broken shadow method diff --git a/wxPython/src/windows.i b/wxPython/src/windows.i index aaa636182d..d5a7222622 100644 --- a/wxPython/src/windows.i +++ b/wxPython/src/windows.i @@ -389,6 +389,14 @@ public: wxString GetHelpText(); void SetHelpText(const wxString& helpText); + bool ScrollLines(int lines); + bool ScrollPages(int pages); + bool LineUp(); + bool LineDown(); + bool PageUp(); + bool PageDown(); + + // // Properties list // %pragma(python) addtoclass = " diff --git a/wxPython/wxPython/lib/PyCrust/PyCrust.py b/wxPython/wxPython/lib/PyCrust/PyCrust.py new file mode 100644 index 0000000000..43423d65d5 --- /dev/null +++ b/wxPython/wxPython/lib/PyCrust/PyCrust.py @@ -0,0 +1,148 @@ +#!/usr/bin/env python +"""PyCrust is a python shell application. +""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__date__ = "July 1, 2001" +__version__ = "$Revision$"[11:-2] + +from wxPython.wx import * + +from PyCrustVersion import version +from PyCrustShell import Shell + + +class Frame(wxFrame): + """Main window for the PyCrust application.""" + def __init__(self, parent, id, title): + """Create the main frame object for the application.""" + wxFrame.__init__(self, parent, id, title) + intro = 'Welcome To PyCrust %s - The Flakiest Python Shell' % version + self.CreateStatusBar() + self.SetStatusText(intro) + self.createMenus() + # Create the shell, which will create a default editor and + # a default interpreter. + self.shell = Shell(editorParent=self, introText=intro) + # Override the editor so that status messages go to the status bar. + self.shell.editor.setStatusText = self.SetStatusText + + def createMenus(self): + m = self.fileMenu = wxMenu() + m.AppendSeparator() + m.Append(wxID_EXIT, 'E&xit', 'Exit PyCrust') + + m = self.editMenu = wxMenu() + m.Append(wxID_UNDO, '&Undo \tCtrl+Z', 'Undo the last action') + m.Append(wxID_REDO, '&Redo \tCtrl+Y', 'Redo the last undone action') + m.AppendSeparator() + m.Append(wxID_CUT, 'Cu&t \tCtrl+X', 'Cut the selection') + m.Append(wxID_COPY, '&Copy \tCtrl+C', 'Copy the selection') + m.Append(wxID_PASTE, '&Paste \tCtrl+V', 'Paste') + m.AppendSeparator() + m.Append(wxID_CLEAR, 'Cle&ar \tDel', 'Delete the selection') + m.Append(wxID_SELECTALL, 'Select A&ll \tCtrl+A', 'Select all text') + + m = self.helpMenu = wxMenu() + m.AppendSeparator() + m.Append(wxID_ABOUT, '&About...', 'About PyCrust') + + b = self.menuBar = wxMenuBar() + b.Append(self.fileMenu, '&File') + b.Append(self.editMenu, '&Edit') + b.Append(self.helpMenu, '&Help') + self.SetMenuBar(b) + + EVT_MENU(self, wxID_EXIT, self.OnExit) + EVT_MENU(self, wxID_UNDO, self.OnUndo) + EVT_MENU(self, wxID_REDO, self.OnRedo) + EVT_MENU(self, wxID_CUT, self.OnCut) + EVT_MENU(self, wxID_COPY, self.OnCopy) + EVT_MENU(self, wxID_PASTE, self.OnPaste) + EVT_MENU(self, wxID_CLEAR, self.OnClear) + EVT_MENU(self, wxID_SELECTALL, self.OnSelectAll) + EVT_MENU(self, wxID_ABOUT, self.OnAbout) + + EVT_UPDATE_UI(self, wxID_UNDO, self.OnUpdateMenu) + EVT_UPDATE_UI(self, wxID_REDO, self.OnUpdateMenu) + EVT_UPDATE_UI(self, wxID_CUT, self.OnUpdateMenu) + EVT_UPDATE_UI(self, wxID_COPY, self.OnUpdateMenu) + EVT_UPDATE_UI(self, wxID_PASTE, self.OnUpdateMenu) + EVT_UPDATE_UI(self, wxID_CLEAR, self.OnUpdateMenu) + + def OnExit(self, event): + self.Close(true) + + def OnUndo(self, event): + self.shell.editor.Undo() + + def OnRedo(self, event): + self.shell.editor.Redo() + + def OnCut(self, event): + self.shell.editor.Cut() + + def OnCopy(self, event): + self.shell.editor.Copy() + + def OnPaste(self, event): + self.shell.editor.Paste() + + def OnClear(self, event): + self.shell.editor.Clear() + + def OnSelectAll(self, event): + self.shell.editor.SelectAll() + + def OnAbout(self, event): + """Display an About PyCrust window.""" + title = 'About PyCrust' + text = 'PyCrust %s\n\n' % version + \ + 'Yet another Python shell, only flakier.\n\n' + \ + 'Half-baked by Patrick K. O\'Brien,\n' + \ + 'the other half is still in the oven.' + dialog = wxMessageDialog(self, text, title, wxOK | wxICON_INFORMATION) + dialog.ShowModal() + dialog.Destroy() + + def OnUpdateMenu(self, event): + """Update menu items based on which should be enabled/disabled.""" + id = event.GetId() + if id == wxID_UNDO: + event.Enable(self.shell.editor.CanUndo()) + elif id == wxID_REDO: + event.Enable(self.shell.editor.CanRedo()) + elif id == wxID_CUT: + event.Enable(self.shell.editor.CanCut()) + elif id == wxID_COPY: + event.Enable(self.shell.editor.CanCopy()) + elif id == wxID_PASTE: + event.Enable(self.shell.editor.CanPaste()) + elif id == wxID_CLEAR: + event.Enable(self.shell.editor.CanCut()) + + +class App(wxApp): + def OnInit(self): + parent = None + id = -1 + title = 'PyCrust' + self.frame = Frame(parent, id, title) + self.frame.Show(true) + self.SetTopWindow(self.frame) + return true + + +def main(): + import sys + application = App(0) + # Add the application object to the sys module's namespace. + # This allows a shell user to do: + # >>> import sys + # >>> sys.application.whatever + sys.application = application + application.MainLoop() + +if __name__ == '__main__': + main() diff --git a/wxPython/wxPython/lib/PyCrust/PyCrustEditor.py b/wxPython/wxPython/lib/PyCrust/PyCrustEditor.py new file mode 100644 index 0000000000..458e0ad5b1 --- /dev/null +++ b/wxPython/wxPython/lib/PyCrust/PyCrustEditor.py @@ -0,0 +1,349 @@ + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__date__ = "July 1, 2001" +__version__ = "$Revision$"[11:-2] + +from wxPython.wx import * +from wxPython.stc import * + +import keyword +import sys + + +if wxPlatform == '__WXMSW__': + faces = { 'times' : 'Times New Roman', + 'mono' : 'Courier New', + 'helv' : 'Lucida Console', + 'lucida' : 'Lucida Console', + 'other' : 'Comic Sans MS', + 'size' : 8, + 'lnsize' : 7, + 'backcol': '#FFFFFF', + } +else: # GTK + faces = { 'times' : 'Times', + 'mono' : 'Courier', + 'helv' : 'Helvetica', + 'other' : 'new century schoolbook', + 'size' : 9, + 'lnsize' : 8, + 'backcol': '#FFFFFF', + } + + +class Editor(wxStyledTextCtrl): + """PyCrust Editor based on wxStyledTextCtrl.""" + revision = __version__ + def __init__(self, parent, id): + """Create a PyCrust editor object based on wxStyledTextCtrl.""" + wxStyledTextCtrl.__init__(self, parent, id, style=wxCLIP_CHILDREN) + # Commands get pushed to a method determined by the outer shell. + #self.shellPush = pushMethod + # Keep track of the most recent prompt starting and ending positions. + self.promptPos = [0, 0] + # Keep track of multi-line commands. + self.more = 0 + # Configure various defaults and user preferences. + self.config() + # Assign handlers for keyboard events. + EVT_KEY_DOWN(self, self.OnKeyDown) + EVT_CHAR(self, self.OnChar) + + def config(self): + """Configure editor based on user preferences.""" + self.SetMarginType(1, wxSTC_MARGIN_NUMBER) + self.SetMarginWidth(1, 40) + + self.SetLexer(wxSTC_LEX_PYTHON) + self.SetKeyWords(0, ' '.join(keyword.kwlist)) + + self.setStyles(faces) + self.SetViewWhiteSpace(0) + self.SetTabWidth(4) + self.SetUseTabs(0) + # Do we want to automatically pop up command completion options? + self.autoComplete = 1 + self.autoCompleteCaseInsensitive = 1 + self.AutoCompSetIgnoreCase(self.autoCompleteCaseInsensitive) + # De we want to automatically pop up command argument help? + self.autoCallTip = 1 + self.CallTipSetBackground(wxColour(255, 255, 232)) + + def setStyles(self, faces): + """Configure font size, typeface and color for lexer.""" + + # Default style + self.StyleSetSpec(wxSTC_STYLE_DEFAULT, "face:%(mono)s,size:%(size)d" % faces) + + self.StyleClearAll() + + # Built in styles + self.StyleSetSpec(wxSTC_STYLE_LINENUMBER, "back:#C0C0C0,face:%(mono)s,size:%(lnsize)d" % faces) + self.StyleSetSpec(wxSTC_STYLE_CONTROLCHAR, "face:%(mono)s" % faces) + self.StyleSetSpec(wxSTC_STYLE_BRACELIGHT, "fore:#0000FF,back:#FFFF88") + self.StyleSetSpec(wxSTC_STYLE_BRACEBAD, "fore:#FF0000,back:#FFFF88") + + # Python styles + self.StyleSetSpec(wxSTC_P_DEFAULT, "face:%(mono)s" % faces) + self.StyleSetSpec(wxSTC_P_COMMENTLINE, "fore:#007F00,face:%(mono)s" % faces) + self.StyleSetSpec(wxSTC_P_NUMBER, "") + self.StyleSetSpec(wxSTC_P_STRING, "fore:#7F007F,face:%(mono)s" % faces) + self.StyleSetSpec(wxSTC_P_CHARACTER, "fore:#7F007F,face:%(mono)s" % faces) + self.StyleSetSpec(wxSTC_P_WORD, "fore:#00007F,bold") + self.StyleSetSpec(wxSTC_P_TRIPLE, "fore:#7F0000") + self.StyleSetSpec(wxSTC_P_TRIPLEDOUBLE, "fore:#000033,back:#FFFFE8") + self.StyleSetSpec(wxSTC_P_CLASSNAME, "fore:#0000FF,bold") + self.StyleSetSpec(wxSTC_P_DEFNAME, "fore:#007F7F,bold") + self.StyleSetSpec(wxSTC_P_OPERATOR, "") + self.StyleSetSpec(wxSTC_P_IDENTIFIER, "") + self.StyleSetSpec(wxSTC_P_COMMENTBLOCK, "fore:#7F7F7F") + self.StyleSetSpec(wxSTC_P_STRINGEOL, "fore:#000000,face:%(mono)s,back:#E0C0E0,eolfilled" % faces) + + def OnKeyDown(self, event): + """Key down event handler. + + The main goal here is to not allow modifications to previous + lines of text. + """ + key = event.KeyCode() + currpos = self.GetCurrentPos() + stoppos = self.promptPos[1] + # If the auto-complete window is up let it do its thing. + if self.AutoCompActive(): + event.Skip() + # Return is used to submit a command to the interpreter. + elif key == WXK_RETURN: + if self.CallTipActive: self.CallTipCancel() + self.processLine() + # Home needs to be aware of the prompt. + elif key == WXK_HOME: + if currpos >= stoppos: + self.SetCurrentPos(stoppos) + self.SetAnchor(stoppos) + else: + event.Skip() + # Basic navigation keys should work anywhere. + elif key in (WXK_END, WXK_LEFT, WXK_RIGHT, WXK_UP, WXK_DOWN, \ + WXK_PRIOR, WXK_NEXT): + event.Skip() + # Don't backspace over the latest prompt. + elif key == WXK_BACK: + if currpos > stoppos: + event.Skip() + # Only allow these keys after the latest prompt. + elif key in (WXK_TAB, WXK_DELETE): + if currpos >= stoppos: + event.Skip() + # Don't toggle between insert mode and overwrite mode. + elif key == WXK_INSERT: + pass + else: + event.Skip() + + def OnChar(self, event): + """Keypress event handler. + + The main goal here is to not allow modifications to previous + lines of text. + """ + key = event.KeyCode() + currpos = self.GetCurrentPos() + stoppos = self.promptPos[1] + if currpos >= stoppos: + if key == 46: + # "." The dot or period key activates auto completion. + # Get the command between the prompt and the cursor. + # Add a dot to the end of the command. + command = self.GetTextRange(stoppos, currpos) + '.' + self.write('.') + if self.autoComplete: self.autoCompleteShow(command) + elif key == 40: + # "(" The left paren activates a call tip and cancels + # an active auto completion. + if self.AutoCompActive(): self.AutoCompCancel() + # Get the command between the prompt and the cursor. + # Add the '(' to the end of the command. + command = self.GetTextRange(stoppos, currpos) + '(' + self.write('(') + if self.autoCallTip: self.autoCallTipShow(command) + else: + # Allow the normal event handling to take place. + event.Skip() + else: + pass + + def setStatusText(self, text): + """Display status information.""" + + # This method will most likely be replaced by the enclosing app + # to do something more interesting, like write to a status bar. + print text + + def autoCompleteShow(self, command): + """Display auto-completion popup list.""" + list = self.getAutoCompleteList(command) + if list: + options = ' '.join(list) + offset = 0 + self.AutoCompShow(offset, options) + + def getAutoCompleteList(self, command): + """Return list of auto-completion options for command.""" + + # This method needs to be replaced by the enclosing app + # to get the proper auto complete list from the interpreter. + return [] + + def autoCallTipShow(self, command): + """Display argument spec and docstring in a popup bubble thingie.""" + if self.CallTipActive: self.CallTipCancel() + tip = self.getCallTip(command) + if tip: + offset = self.GetCurrentPos() + self.CallTipShow(offset, tip) + + def getCallTip(self, command): + """Return arguments and docstring for command.""" + + # This method needs to be replaced by the enclosing app + # to get the proper auto complete list from the interpreter. + return '' + + def processLine(self): + """Process the line of text at which the user hit Enter.""" + + # The user hit ENTER and we need to decide what to do. They could be + # sitting on any line in the editor. + + # Grab information about the current line. + thepos = self.GetCurrentPos() + theline = self.GetCurrentLine() + thetext = self.GetCurLine()[0] + command = self.getCommand(thetext) + # Go to the very bottom of the editor. + endpos = self.GetTextLength() + self.SetCurrentPos(endpos) + endline = self.GetCurrentLine() + # If they hit RETURN on the last line, execute the command. + if theline == endline: + self.push(command) + # Otherwise, replace the last line with the new line. + else: + # If the new line contains a command (even an invalid one). + if command: + startpos = self.PositionFromLine(endline) + self.SetSelection(startpos, endpos) + self.ReplaceSelection('') + self.prompt() + self.write(command) + # Otherwise, put the cursor back where we started. + else: + self.SetCurrentPos(thepos) + self.SetAnchor(thepos) + + def getCommand(self, text): + """Extract a command from text which may include a shell prompt. + + The command may not necessarily be valid Python syntax. + """ + + # XXX Need to extract real prompts here. Need to keep track of the + # prompt every time a command is issued. Do this in the interpreter + # with a line number, prompt, command dictionary. For the history, perhaps. + ps1 = str(sys.ps1) + ps1size = len(ps1) + ps2 = str(sys.ps2) + ps2size = len(ps2) + text = text.rstrip() + # Strip the prompt off the front of text leaving just the command. + if text[:ps1size] == ps1: + command = text[ps1size:] + elif text[:ps2size] == ps2: + command = text[ps2size:] + else: + command = '' + return command + + def push(self, command): + """Start a new line, send command to the shell, display a prompt.""" + self.write('\n') + self.more = self.shellPush(command) + self.prompt() + # Keep the undo feature from undoing previous responses. The only + # thing that can be undone is stuff typed after the prompt, before + # hitting enter. After they hit enter it becomes permanent. + self.EmptyUndoBuffer() + + def clear(self): + """Delete all text from the editor.""" + self.ClearAll() + + def prompt(self): + """Display appropriate prompt for the context, either ps1 or ps2. + + If this is a continuation line, autoindent as necessary. + """ + if self.more: + prompt = str(sys.ps2) + else: + prompt = str(sys.ps1) + pos = self.GetCurLine()[1] + if pos > 0: self.write('\n') + self.promptPos[0] = self.GetCurrentPos() + self.write(prompt) + self.promptPos[1] = self.GetCurrentPos() + # XXX Add some autoindent magic here if more. + if self.more: + self.write('\t') # Temporary hack indentation. + self.EnsureCaretVisible() + self.ScrollToColumn(0) + + def readIn(self): + """Replacement for stdin.""" + prompt = 'Please enter your response:' + dialog = wxTextEntryDialog(None, prompt, \ + 'Input Dialog (Standard)', '') + try: + if dialog.ShowModal() == wxID_OK: + text = dialog.GetValue() + self.write(text + '\n') + return text + finally: + dialog.Destroy() + return '' + + def readRaw(self, prompt='Please enter your response:'): + """Replacement for raw_input.""" + dialog = wxTextEntryDialog(None, prompt, \ + 'Input Dialog (Raw)', '') + try: + if dialog.ShowModal() == wxID_OK: + text = dialog.GetValue() + return text + finally: + dialog.Destroy() + return '' + + def write(self, text): + """Display text in the editor.""" + self.AddText(text) + self.EnsureCaretVisible() + #self.ScrollToColumn(0) + + def writeOut(self, text): + """Replacement for stdout.""" + self.write(text) + + def writeErr(self, text): + """Replacement for stderr.""" + self.write(text) + + def CanCut(self): + """Return true if text is selected and can be cut.""" + return self.GetSelectionStart() != self.GetSelectionEnd() + + def CanCopy(self): + """Return true if text is selected and can be copied.""" + return self.GetSelectionStart() != self.GetSelectionEnd() + diff --git a/wxPython/wxPython/lib/PyCrust/PyCrustInterp.py b/wxPython/wxPython/lib/PyCrust/PyCrustInterp.py new file mode 100644 index 0000000000..dd606c2138 --- /dev/null +++ b/wxPython/wxPython/lib/PyCrust/PyCrustInterp.py @@ -0,0 +1,81 @@ + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__date__ = "July 1, 2001" +__version__ = "$Revision$"[11:-2] + +import os +import sys + +from code import InteractiveInterpreter +import introspect + + +class Interpreter(InteractiveInterpreter): + """PyCrust Interpreter based on code.InteractiveInterpreter.""" + revision = __version__ + def __init__(self, locals=None, rawin=None, + stdin=sys.stdin, stdout=sys.stdout, stderr=sys.stderr): + """Create an interactive interpreter object.""" + InteractiveInterpreter.__init__(self, locals=locals) + self.stdin = stdin + self.stdout = stdout + self.stderr = stderr + if rawin is not None: + import __builtin__ + __builtin__.raw_input = rawin + del __builtin__ + copyright = 'Type "copyright", "credits" or "license" for more information.' + self.introText = 'Python %s on %s\n%s' % \ + (sys.version, sys.platform, copyright) + try: + sys.ps1 + except AttributeError: + sys.ps1 = '>>> ' + try: + sys.ps2 + except AttributeError: + sys.ps2 = '... ' + self.more = 0 + self.commandBuffer = [] # List of lists to support recursive push(). + self.commandHistory = [] + self.startupScript = os.environ.get('PYTHONSTARTUP') + + def push(self, command): + """Send command to the interpreter to be executed. + + Because this may be called recursively, we append a new list + onto the commandBuffer list and then append commands into that. + If the passed in command is part of a multi-line command we keep + appending the pieces to the last list in commandBuffer until we + have a complete command, then, finally, we delete that last list. + """ + if not self.more: self.commandBuffer.append([]) + self.commandBuffer[-1].append(command) + source = '\n'.join(self.commandBuffer[-1]) + self.more = self.runsource(source) + if not self.more: del self.commandBuffer[-1] + return self.more + + def runsource(self, source): + """Compile and run source code in the interpreter.""" + stdin, stdout, stderr = sys.stdin, sys.stdout, sys.stderr + sys.stdin = self.stdin + sys.stdout = self.stdout + sys.stderr = self.stderr + more = InteractiveInterpreter.runsource(self, source) + sys.stdin, sys.stdout, sys.stderr = stdin, stdout, stderr + return more + + def getAutoCompleteList(self, command=''): + """Return list of auto-completion options for a command. + + The list of options will be based on the locals namespace.""" + return introspect.getAutoCompleteList(command, self.locals) + + def getCallTip(self, command=''): + """Return call tip text for a command. + + The call tip information will be based on the locals namespace.""" + return introspect.getCallTip(command, self.locals) + diff --git a/wxPython/wxPython/lib/PyCrust/PyCrustShell.py b/wxPython/wxPython/lib/PyCrust/PyCrustShell.py new file mode 100644 index 0000000000..07c232d156 --- /dev/null +++ b/wxPython/wxPython/lib/PyCrust/PyCrustShell.py @@ -0,0 +1,180 @@ +""" +""" +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__date__ = "July 1, 2001" +__version__ = "$Revision$"[11:-2] + +import os +from PyCrustVersion import version + +class Shell: + """PyCrust Shell manages the Editor and Interpreter.""" + name = 'PyCrust Shell' + revision = __version__ + def __init__(self, editorParent=None, introText='', editor=None, interp=None): + """Create a PyCrust shell object to manage the editor and interpreter.""" + try: + eval('crap') + except: + pass + self.introText = introText + # Create a default editor if one isn't provided. + if editor == None: + from PyCrustEditor import Editor + self.editor = Editor(editorParent, id=-1) + else: + self.editor = editor + # Link the editor to the shell so that the shell is a conduit for + # pushing commands to the interpreter. + self.editor.shellPush = self.shellPush + # Create a default interpreter if one isn't provided. + if interp == None: + from PyCrustInterp import Interpreter + from pseudo import PseudoFileIn, PseudoFileOut, PseudoFileErr + self.stdin = PseudoFileIn(self.editor.readIn) + self.stdout = PseudoFileOut(self.editor.writeOut) + self.stderr = PseudoFileErr(self.editor.writeErr) + # Override the default locals so we have something interesting. + locals = {'__name__': 'PyCrust', + '__doc__': 'PyCrust, The Python Shell.', + '__version__': version, + } + self.interp = Interpreter(locals=locals, + rawin=self.editor.readRaw, + stdin=self.stdin, + stdout=self.stdout, + stderr=self.stderr) + else: + self.interp = interp + # XXX redo this using hasattr() or something so that we can link + # these if a provided editor has this method. + if editor == None or editor == self: + # Override so the auto complete list comes from the interpreter. + self.editor.getAutoCompleteList = self.interp.getAutoCompleteList + # Override so the call tip comes from the interpreter. + self.editor.getCallTip = self.interp.getCallTip + # Keep track of whether the interpreter needs more. + self.more = 0 + + try: + self.showIntro(self.introText) + except: + pass + + try: + self.setBuiltinKeywords() + except: + pass + + try: + self.setLocalShell() + except: + pass + + # Do this last so the user has complete control over their + # environment. They can override anything they want. + try: + self.execStartupScript(self.interp.startupScript) + except: + pass + + def destroy(self): + del self.editor + del self.stdin + del self.stdout + del self.stderr + del self.interp + + def showIntro(self, text=''): + """Display introductory text in the shell editor.""" + if text: + if text[-1] != '\n': text += '\n' + self.editor.write(text) + try: + self.editor.write(self.interp.introText) + except AttributeError: + pass + + def setBuiltinKeywords(self): + """Create pseudo keywords as part of builtins. + + This is a rather clever hack that sets "close", "exit" and "quit" + to a PseudoKeyword object so that we can make them do what we want. + In this case what we want is to call our self.quit() method. + The user can type "close", "exit" or "quit" without the final parens. + """ + import __builtin__ + from pseudo import PseudoKeyword + __builtin__.close = __builtin__.exit = __builtin__.quit = \ + PseudoKeyword(self.quit) + + def quit(self): + """Quit the application.""" + + # XXX Good enough for now but later we want to send a close event. + + # In the close event handler we can prompt to make sure they want to quit. + # Other applications, like PythonCard, may choose to hide rather than + # quit so we should just post the event and let the surrounding app + # decide what it wants to do. + self.editor.write('Click on the close button to leave the application.') + + def setLocalShell(self): + """Add 'shell' to locals.""" + self.interp.locals['shell'] = self + + def execStartupScript(self, startupScript): + """Execute the user's PYTHONSTARTUP script if they have one.""" + if startupScript and os.path.isfile(startupScript): + startupText = 'Startup script executed: ' + startupScript + self.editor.push('print %s;execfile(%s)' % \ + (`startupText`, `startupScript`)) + else: + self.editor.push('') + + def run(self, command, prompt=1, verbose=1): + """Execute command within the shell as if it was typed in directly. + >>> shell.run('print "this"') + >>> print "this" + this + >>> + """ + command = command.rstrip() + if prompt: self.editor.prompt() + if verbose: self.editor.write(command) + self.editor.push(command) + + def runfile(self, filename): + """Execute all commands in file as if they were typed into the shell.""" + file = open(filename) + try: + self.editor.prompt() + for command in file.readlines(): + if command[:6] == 'shell.': # Run shell methods silently. + self.run(command, prompt=0, verbose=0) + else: + self.run(command, prompt=0, verbose=1) + finally: + file.close() + + def push(self, command): + """Send command to the interpreter for execution.""" + self.more = self.interp.push(command) + return self.more + + shellPush = push + + def ask(self, prompt='Please enter your response:'): + """Get response from the user.""" + return raw_input(prompt=prompt) + + def pause(self): + """Halt execution pending a response from the user.""" + self.ask('Press enter to continue:') + + def clear(self): + """Delete all text from the shell editor.""" + self.editor.clear() + + diff --git a/wxPython/wxPython/lib/PyCrust/PyCrustVersion.py b/wxPython/wxPython/lib/PyCrust/PyCrustVersion.py new file mode 100644 index 0000000000..de8a0d0d0f --- /dev/null +++ b/wxPython/wxPython/lib/PyCrust/PyCrustVersion.py @@ -0,0 +1,10 @@ +"""Provides an object representing the current "version" or "release" of +PyCrust as a whole. Individual classes, such as the shell, editor and +interpreter, each have a revision property based on the CVS $Revision$.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__date__ = "July 1, 2001" +__version__ = "$Revision$"[11:-2] + +version = '0.5' diff --git a/wxPython/wxPython/lib/PyCrust/__init__.py b/wxPython/wxPython/lib/PyCrust/__init__.py new file mode 100644 index 0000000000..db6003cf3b --- /dev/null +++ b/wxPython/wxPython/lib/PyCrust/__init__.py @@ -0,0 +1 @@ +# Orbtech python package. \ No newline at end of file diff --git a/wxPython/wxPython/lib/PyCrust/introspect.py b/wxPython/wxPython/lib/PyCrust/introspect.py new file mode 100644 index 0000000000..c9342c8a0c --- /dev/null +++ b/wxPython/wxPython/lib/PyCrust/introspect.py @@ -0,0 +1,140 @@ +"""Provides a variety of introspective-type support functions for things +like call tips and command auto completion.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__date__ = "August 8, 2001" +__version__ = "$Revision$"[11:-2] + +import inspect +import string + +def getAutoCompleteList(command='', locals=None): + """Return list of auto-completion options for command. + + The list of options will be based on the locals namespace.""" + + # Get the proper chunk of code from the command. + root = getRoot(command, terminator='.') + try: + object = eval(root, locals) + attributes = getAttributes(object) + return attributes + except: + return [] + +def getAttributes(object): + """Return list of unique attributes, including inherited, for an object.""" + attributes = [] + dict = {} + # Remove duplicates from the attribute list. + for item in getAllAttributes(object): + dict[item] = None + attributes += dict.keys() + attributes.sort() + return attributes + +def getAllAttributes(object): + """Return list of all attributes, including inherited, for an object. + + Recursively walk through a class and all base classes. + """ + attributes = [] + try: + attributes += dir(object) + if hasattr(object, '__class__'): + attributes += getAllAttributes(object.__class__) + if hasattr(object, '__bases__'): + for base in object.__bases__: + attributes += getAllAttributes(base) + finally: + return attributes + +def getCallTip(command='', locals=None): + """Return call tip text for a command. + + The call tip information will be based on the locals namespace.""" + + # Get the proper chunk of code from the command. + root = getRoot(command, terminator='(') + try: + object = eval(root, locals) + except: + return '' + dropSelf = 0 + if hasattr(object, '__name__'): # Make sure this is a useable object. + # Switch to the object that has the information we need. + if inspect.ismethod(object): + # Get the function from the object otherwise inspec.getargspec() + # complains that the object isn't a Python function. + object = object.im_func + dropSelf = 1 + elif inspect.isclass(object): + # Get the __init__ method for the class. + try: + object = object.__init__.im_func + dropSelf = 1 + except AttributeError: + for base in object.__bases__: + constructor = _find_constructor(base) + if constructor is not None: + object = constructor + dropSelf = 1 + break + name = object.__name__ + if inspect.isbuiltin(object): + # Builtin functions don't have an argspec that we can get. + tip1 = '' + else: + # tip1 is a string like: "getCallTip(command='', locals=None)" + argspec = apply(inspect.formatargspec, inspect.getargspec(object)) + if dropSelf: + # The first parameter to a method is a reference to the + # instance, usually coded as "self", and is passed + # automatically by Python and therefore we want to drop it. + temp = argspec.split(',') + if len(temp) == 1: # No other arguments. + argspec = '()' + else: # Drop the first argument. + argspec = '(' + ','.join(temp[1:]).lstrip() + tip1 = name + argspec + doc = inspect.getdoc(object) + if doc: + # tip2 is the first separated line of the docstring, like: + # "Return call tip text for a command." + # tip3 is the rest of the docstring, like: + # "The call tip information will be based on ... + docpieces = doc.split('\n\n') + tip2 = docpieces[0] + tip3 = '\n\n'.join(docpieces[1:]) + tip = '%s\n\n%s\n\n%s' % (tip1, tip2, tip3) + else: + tip = tip1 + return tip.strip() + else: + return '' + +def getRoot(command, terminator=None): + """Return the rightmost root portion of an arbitrary Python command. + + The command would normally terminate with a "(" or ".". Anything after + the terminator will be dropped, allowing you to get back to the root. + """ + root = '' + validChars = "._" + string.uppercase + string.lowercase + string.digits + # Remove all whitespace from the command. + command = ''.join(command.split()) + # Deal with the terminator. + if terminator: + pieces = command.split(terminator) + if len(pieces) > 1: + # Drop the final terminator and anything that follows. + command = terminator.join(pieces[:-1]) + # Go backward through the command until we hit an "invalid" character. + i = len(command) + while i and command[i-1] in validChars: + i -= 1 + # Grab everything from the "invalid" character to the end. + root = command[i:] + return root + diff --git a/wxPython/wxPython/lib/PyCrust/pseudo.py b/wxPython/wxPython/lib/PyCrust/pseudo.py new file mode 100644 index 0000000000..c709a8351c --- /dev/null +++ b/wxPython/wxPython/lib/PyCrust/pseudo.py @@ -0,0 +1,90 @@ +"""Provides a variety of classes to create pseudo keywords and pseudo files.""" + +__author__ = "Patrick K. O'Brien " +__cvsid__ = "$Id$" +__date__ = "July 1, 2001" +__version__ = "$Revision$"[11:-2] + +class PseudoKeyword: + """A callable class that calls a method passed as a parameter. + + Good for creating a pseudo keyword in the python runtime + environment. The keyword is really an object that has a repr() + that calls itself which calls the method that was passed in the + init of the object. All this just to avoid having to type in the + closing parens on a method. So, for example: + + >>> quit = PseudoKeyword(SomeObject.someMethod) + >>> quit + + SomeObject.someMethod gets executed as if it had been called + directly and the user didn't have to type the parens, like + "quit()". This technique is most applicable for pseudo keywords + like quit, exit and help. + + If SomeObject.someMethod can take parameters, they can still be + passed by using the keyword in the traditional way with parens. + """ + def __init__(self, method): + """Create a callable object that executes method when called.""" + + # XXX Should probably check that this is a callable object. + self.method = method + + def __call__(self, *args, **kwds): + self.method(*args, **kwds) + + def __repr__(self): + self() + return '' + + +class PseudoFile: + + def __init__(self): + """Create a file-like object.""" + pass + + def readline(self): + pass + + def write(self, s): + pass + + def writelines(self, l): + map(self.write, l) + + def flush(self): + pass + + def isatty(self): + pass + + +class PseudoFileIn(PseudoFile): + + def __init__(self, readline): + self.readline = readline + + def isatty(self): + return 1 + + +class PseudoFileOut(PseudoFile): + + def __init__(self, write): + self.write = write + + def isatty(self): + return 1 + + +class PseudoFileErr(PseudoFile): + + def __init__(self, write): + self.write = write + + def isatty(self): + return 1 + + diff --git a/wxPython/wxPython/lib/pyshell.py b/wxPython/wxPython/lib/pyshell.py index 229e2e5190..7457f3c830 100644 --- a/wxPython/wxPython/lib/pyshell.py +++ b/wxPython/wxPython/lib/pyshell.py @@ -20,6 +20,10 @@ There is still much to be done to improve this class, such as line buffering/recall, autoindent, calltips, autocomplete, fixing the colourizer, etc... But it's a good start. + +8-10-2001 THIS MODULE IS NOW DEPRECATED. Please see the most excellent + PyCrust package instead. + """ diff --git a/wxPython/wxPython/lib/shell.py b/wxPython/wxPython/lib/shell.py index b919213c42..2434f55bca 100644 --- a/wxPython/wxPython/lib/shell.py +++ b/wxPython/wxPython/lib/shell.py @@ -17,11 +17,14 @@ History: input prompts and output styles added to customized demo some html cleanups 04-oct-1999 [rpd] Changed to use the new sizers -05-oct-1990 [als] changes inspired by code.InteractiveInterpreter() +05-oct-1999 [als] changes inspired by code.InteractiveInterpreter() from Python Library. if i knew about this class earlier, i would rather inherit from it. renamed to wxPyShell.py since i've renounced the 8.3 scheme +8-10-2001 THIS MODULE IS NOW DEPRECATED. Please see the most excellent + PyCrust package instead. + """ __version__ ="$Revision$" # $RCSfile$ -- 2.45.2