diff --git a/demo/AUI_DockingWindowMgr.py b/demo/AUI_DockingWindowMgr.py index 9078d07b..28aa3084 100644 --- a/demo/AUI_DockingWindowMgr.py +++ b/demo/AUI_DockingWindowMgr.py @@ -7,34 +7,34 @@ import wx.aui as aui from six import BytesIO -ID_CreateTree = wx.NewId() -ID_CreateGrid = wx.NewId() -ID_CreateText = wx.NewId() -ID_CreateHTML = wx.NewId() -ID_CreateSizeReport = wx.NewId() -ID_GridContent = wx.NewId() -ID_TextContent = wx.NewId() -ID_TreeContent = wx.NewId() -ID_HTMLContent = wx.NewId() -ID_SizeReportContent = wx.NewId() -ID_CreatePerspective = wx.NewId() -ID_CopyPerspective = wx.NewId() +ID_CreateTree = wx.Window.NewControlId() +ID_CreateGrid = wx.Window.NewControlId() +ID_CreateText = wx.Window.NewControlId() +ID_CreateHTML = wx.Window.NewControlId() +ID_CreateSizeReport = wx.Window.NewControlId() +ID_GridContent = wx.Window.NewControlId() +ID_TextContent = wx.Window.NewControlId() +ID_TreeContent = wx.Window.NewControlId() +ID_HTMLContent = wx.Window.NewControlId() +ID_SizeReportContent = wx.Window.NewControlId() +ID_CreatePerspective = wx.Window.NewControlId() +ID_CopyPerspective = wx.Window.NewControlId() -ID_TransparentHint = wx.NewId() -ID_VenetianBlindsHint = wx.NewId() -ID_RectangleHint = wx.NewId() -ID_NoHint = wx.NewId() -ID_HintFade = wx.NewId() -ID_AllowFloating = wx.NewId() -ID_NoVenetianFade = wx.NewId() -ID_TransparentDrag = wx.NewId() -ID_AllowActivePane = wx.NewId() -ID_NoGradient = wx.NewId() -ID_VerticalGradient = wx.NewId() -ID_HorizontalGradient = wx.NewId() +ID_TransparentHint = wx.Window.NewControlId() +ID_VenetianBlindsHint = wx.Window.NewControlId() +ID_RectangleHint = wx.Window.NewControlId() +ID_NoHint = wx.Window.NewControlId() +ID_HintFade = wx.Window.NewControlId() +ID_AllowFloating = wx.Window.NewControlId() +ID_NoVenetianFade = wx.Window.NewControlId() +ID_TransparentDrag = wx.Window.NewControlId() +ID_AllowActivePane = wx.Window.NewControlId() +ID_NoGradient = wx.Window.NewControlId() +ID_VerticalGradient = wx.Window.NewControlId() +ID_HorizontalGradient = wx.Window.NewControlId() -ID_Settings = wx.NewId() -ID_About = wx.NewId() +ID_Settings = wx.Window.NewControlId() +ID_About = wx.Window.NewControlId() ID_FirstPerspective = ID_CreatePerspective+1000 diff --git a/demo/ActiveXWrapper_Acrobat.py b/demo/ActiveXWrapper_Acrobat.py index a1ce519d..fcfe4775 100644 --- a/demo/ActiveXWrapper_Acrobat.py +++ b/demo/ActiveXWrapper_Acrobat.py @@ -48,15 +48,15 @@ class TestPanel(wx.Panel): sizer.Add(self.pdf, 1, wx.EXPAND) - btn = wx.Button(self, wx.NewId(), "Open PDF File") + btn = wx.Button(self, wx.ID_ANY, "Open PDF File") wx.EVT_BUTTON(self, btn.GetId(), self.OnOpenButton) btnSizer.Add(btn, 1, wx.EXPAND|wx.ALL, 5) - btn = wx.Button(self, wx.NewId(), "<-- Previous Page") + btn = wx.Button(self, wx.ID_ANY, "<-- Previous Page") wx.EVT_BUTTON(self, btn.GetId(), self.OnPrevPageButton) btnSizer.Add(btn, 1, wx.EXPAND|wx.ALL, 5) - btn = wx.Button(self, wx.NewId(), "Next Page -->") + btn = wx.Button(self, wx.ID_ANY, "Next Page -->") wx.EVT_BUTTON(self, btn.GetId(), self.OnNextPageButton) btnSizer.Add(btn, 1, wx.EXPAND|wx.ALL, 5) diff --git a/demo/ActiveXWrapper_IE.py b/demo/ActiveXWrapper_IE.py index 522c05f1..52f3f254 100644 --- a/demo/ActiveXWrapper_IE.py +++ b/demo/ActiveXWrapper_IE.py @@ -32,38 +32,38 @@ class TestPanel(wx.Window): self.ie = theClass(self, -1) - btn = wx.Button(self, wx.NewId(), "Open", style=wx.BU_EXACTFIT) + btn = wx.Button(self, wx.ID_ANY, "Open", style=wx.BU_EXACTFIT) self.Bind(wx.EVT_BUTTON, self.OnOpenButton, btn) btnSizer.Add(btn, 0, wx.EXPAND|wx.ALL, 2) - btn = wx.Button(self, wx.NewId(), "Home", style=wx.BU_EXACTFIT) + btn = wx.Button(self, wx.ID_ANY, "Home", style=wx.BU_EXACTFIT) self.Bind(wx.EVT_BUTTON, self.OnHomeButton, btn) btnSizer.Add(btn, 0, wx.EXPAND|wx.ALL, 2) - btn = wx.Button(self, wx.NewId(), "<--", style=wx.BU_EXACTFIT) + btn = wx.Button(self, wx.ID_ANY, "<--", style=wx.BU_EXACTFIT) self.Bind(wx.EVT_BUTTON, self.OnPrevPageButton, btn) btnSizer.Add(btn, 0, wx.EXPAND|wx.ALL, 2) - btn = wx.Button(self, wx.NewId(), "-->", style=wx.BU_EXACTFIT) + btn = wx.Button(self, wx.ID_ANY, "-->", style=wx.BU_EXACTFIT) self.Bind(wx.EVT_BUTTON, self.OnNextPageButton, btn) btnSizer.Add(btn, 0, wx.EXPAND|wx.ALL, 2) - btn = wx.Button(self, wx.NewId(), "Stop", style=wx.BU_EXACTFIT) + btn = wx.Button(self, wx.ID_ANY, "Stop", style=wx.BU_EXACTFIT) self.Bind(wx.EVT_BUTTON, self.OnStopButton, btn) btnSizer.Add(btn, 0, wx.EXPAND|wx.ALL, 2) - btn = wx.Button(self, wx.NewId(), "Search", style=wx.BU_EXACTFIT) + btn = wx.Button(self, wx.ID_ANY, "Search", style=wx.BU_EXACTFIT) self.Bind(wx.EVT_BUTTON, self.OnSearchPageButton, btn) btnSizer.Add(btn, 0, wx.EXPAND|wx.ALL, 2) - btn = wx.Button(self, wx.NewId(), "Refresh", style=wx.BU_EXACTFIT) + btn = wx.Button(self, wx.ID_ANY, "Refresh", style=wx.BU_EXACTFIT) self.Bind(wx.EVT_BUTTON, self.OnRefreshPageButton, btn) btnSizer.Add(btn, 0, wx.EXPAND|wx.ALL, 2) txt = wx.StaticText(self, -1, "Location:") btnSizer.Add(txt, 0, wx.CENTER|wx.ALL, 2) - self.location = wx.ComboBox(self, wx.NewId(), "", style=wx.CB_DROPDOWN) + self.location = wx.ComboBox(self, wx.ID_ANY, "", style=wx.CB_DROPDOWN) self.Bind(wx.EVT_COMBOBOX, self.OnLocationSelect, self.location) self.location.Bind(wx.EVT_KEY_UP, self.OnLocationKey) self.location.Bind(wx.EVT_CHAR, self.IgnoreReturn) diff --git a/demo/ActiveX_FlashWindow.py b/demo/ActiveX_FlashWindow.py index 6604a65a..8afff0eb 100644 --- a/demo/ActiveX_FlashWindow.py +++ b/demo/ActiveX_FlashWindow.py @@ -23,11 +23,11 @@ class TestPanel(wx.Panel): sizer.Add(self.flash, proportion=1, flag=wx.EXPAND) - btn = wx.Button(self, wx.NewId(), "Open Flash File") + btn = wx.Button(self, wx.ID_ANY, "Open Flash File") self.Bind(wx.EVT_BUTTON, self.OnOpenFileButton, btn) btnSizer.Add(btn, proportion=1, flag=wx.EXPAND|wx.ALL, border=5) - btn = wx.Button(self, wx.NewId(), "Open Flash URL") + btn = wx.Button(self, wx.ID_ANY, "Open Flash URL") self.Bind(wx.EVT_BUTTON, self.OnOpenURLButton, btn) btnSizer.Add(btn, proportion=1, flag=wx.EXPAND|wx.ALL, border=5) diff --git a/demo/ActiveX_PDFWindow.py b/demo/ActiveX_PDFWindow.py index 924e38dd..aab67a0d 100644 --- a/demo/ActiveX_PDFWindow.py +++ b/demo/ActiveX_PDFWindow.py @@ -18,35 +18,35 @@ class TestPanel(wx.Panel): self.pdf = PDFWindow(self, style=wx.SUNKEN_BORDER) leftsizer.Add(self.pdf, proportion=1, flag=wx.EXPAND) - box = wx.StaticBox(self, wx.NewId(), "" ) + box = wx.StaticBox(self, wx.ID_ANY, "" ) buttonsizer = wx.StaticBoxSizer(box, wx.HORIZONTAL ) - b1 = wx.Button(self, wx.NewId(), "First") + b1 = wx.Button(self, wx.ID_ANY, "First") buttonsizer.Add(b1, proportion=0, flag=wx.ALIGN_CENTER|wx.ALL, border=5) self.Bind(wx.EVT_BUTTON, self.OnFirstPageButton, b1) - b2 = wx.Button(self, wx.NewId(), "Previous") + b2 = wx.Button(self, wx.ID_ANY, "Previous") buttonsizer.Add(b2, proportion=0, flag=wx.ALIGN_CENTER|wx.ALL, border=5) self.Bind(wx.EVT_BUTTON, self.OnPreviousPageButton, b2) - tx1 = wx.StaticText(self, wx.NewId(), " Go to page" ) + tx1 = wx.StaticText(self, wx.ID_ANY, " Go to page" ) buttonsizer.Add(tx1, proportion=0, flag=wx.ALIGN_CENTER|wx.ALL, border=5) - tc1 = wx.TextCtrl(self, wx.NewId(), "0", size=[30,-1]) + tc1 = wx.TextCtrl(self, wx.ID_ANY, "0", size=[30,-1]) buttonsizer.Add( tc1, proportion=0, flag=wx.ALIGN_CENTER|wx.ALL, border=5) self.Bind(wx.EVT_TEXT, self.OnGotoPage, tc1) - b3 = wx.Button(self, wx.NewId(), "Next") + b3 = wx.Button(self, wx.ID_ANY, "Next") buttonsizer.Add(b3, proportion=0, flag=wx.ALIGN_CENTER|wx.ALL, border=5) self.Bind(wx.EVT_BUTTON, self.OnNextPageButton, b3) - b4 = wx.Button(self, wx.NewId(), "Last") + b4 = wx.Button(self, wx.ID_ANY, "Last") buttonsizer.Add(b4, proportion=0, flag=wx.ALIGN_CENTER|wx.ALL, border=5) self.Bind(wx.EVT_BUTTON, self.OnLastPageButton, b4) - tx2 = wx.StaticText(self, wx.NewId(), " Zoom") + tx2 = wx.StaticText(self, wx.ID_ANY, " Zoom") buttonsizer.Add(tx2, proportion=0, flag=wx.ALIGN_CENTER|wx.ALL, border=5) - ch1 = wx.Choice(self, wx.NewId(), + ch1 = wx.Choice(self, wx.ID_ANY, choices=["Default", "Fit", "FitH", "FitV", "25%", "50%", "75%", "100%", "125%", "200%", "400%"]) ch1.SetSelection(0) @@ -56,42 +56,42 @@ class TestPanel(wx.Panel): leftsizer.Add(buttonsizer, proportion=0) mainsizer.Add(leftsizer, proportion=1, flag=wx.GROW|wx.ALIGN_CENTER_HORIZONTAL|wx.ALL, border=5) - box = wx.StaticBox(self, wx.NewId(), "" ) + box = wx.StaticBox(self, wx.ID_ANY, "" ) rightsizer = wx.StaticBoxSizer(box, wx.VERTICAL) - b5 = wx.Button(self, wx.NewId(), "Load PDF") + b5 = wx.Button(self, wx.ID_ANY, "Load PDF") rightsizer.Add(b5, proportion=0, flag=wx.ALIGN_CENTER_VERTICAL|wx.ALL, border=5) self.Bind(wx.EVT_BUTTON, self.OnLoadButton, b5) - b6 = wx.Button(self, wx.NewId(), "Print") + b6 = wx.Button(self, wx.ID_ANY, "Print") rightsizer.Add(b6, proportion=0, flag=wx.ALIGN_CENTER_VERTICAL|wx.ALL, border=5) self.Bind(wx.EVT_BUTTON, self.OnPrintButton, b6) - tx3 = wx.StaticText(self, wx.NewId(), "Page mode:") + tx3 = wx.StaticText(self, wx.ID_ANY, "Page mode:") rightsizer.Add(tx3, proportion=0, flag=wx.ALIGN_CENTER_VERTICAL|wx.ALL, border=5) - ch2 = wx.Choice(self, wx.NewId(),size=[100,-1], + ch2 = wx.Choice(self, wx.ID_ANY,size=[100,-1], choices=["None", "Bookmarks", "Thumbs"]) ch2.SetSelection(0) rightsizer.Add(ch2, proportion=0, flag=wx.ALIGN_CENTER_VERTICAL|wx.ALL, border=5) self.Bind(wx.EVT_CHOICE, self.OnPageMode, ch2) - tx4 = wx.StaticText(self, wx.NewId(), "Layout mode:") + tx4 = wx.StaticText(self, wx.ID_ANY, "Layout mode:") rightsizer.Add(tx4, proportion=0, flag=wx.ALIGN_CENTER_VERTICAL|wx.ALL, border=5) - ch3 = wx.Choice(self, wx.NewId(),size=[100,-1], + ch3 = wx.Choice(self, wx.ID_ANY,size=[100,-1], choices=["DontCare", "SinglePage", "OneColumn", "TwoColumnLeft", "TwoColumnRight" ]) ch3.SetSelection(0) rightsizer.Add(ch3, proportion=0, flag=wx.ALIGN_CENTER_VERTICAL|wx.ALL, border=5) self.Bind(wx.EVT_CHOICE, self.OnLayoutMode, ch3) - cx1 = wx.CheckBox(self, wx.NewId(), "Toolbar") + cx1 = wx.CheckBox(self, wx.ID_ANY, "Toolbar") cx1.SetValue( True ) rightsizer.Add( cx1,proportion=0, flag=wx.ALIGN_CENTER_VERTICAL|wx.ALL, border=5) self.Bind(wx.EVT_CHECKBOX, self.OnToolbar, cx1) - cx2 = wx.CheckBox(self, wx.NewId(), "Scrollbars") + cx2 = wx.CheckBox(self, wx.ID_ANY, "Scrollbars") cx2.SetValue( True ) rightsizer.Add( cx2,proportion=0, flag=wx.ALIGN_CENTER_VERTICAL|wx.ALL, border=5) self.Bind(wx.EVT_CHECKBOX, self.OnScrollbars, cx2) diff --git a/demo/AdjustChannels.py b/demo/AdjustChannels.py index 39479442..b32f0225 100644 --- a/demo/AdjustChannels.py +++ b/demo/AdjustChannels.py @@ -21,7 +21,7 @@ class TestAdjustChannels(wx.Panel): label= wx.StaticText(self, -1, "Factor red in %") label.SetForegroundColour("RED") ctrlsizer.Add(label, 0, wx.ALL, 5) - sliderred= wx.Slider(self, wx.NewId(), 100, 0, 200, size=(150, -1), style = wx.SL_HORIZONTAL | wx.SL_AUTOTICKS | wx.SL_LABELS) + sliderred= wx.Slider(self, wx.ID_ANY, 100, 0, 200, size=(150, -1), style = wx.SL_HORIZONTAL | wx.SL_AUTOTICKS | wx.SL_LABELS) sliderred.SetForegroundColour("RED") sliderred.SetTickFreq(50) ctrlsizer.Add(sliderred) @@ -30,7 +30,7 @@ class TestAdjustChannels(wx.Panel): label= wx.StaticText(self, -1, "Factor green in %") label.SetForegroundColour("GREEN") ctrlsizer.Add(label, 0, wx.ALL, 5) - slidergreen= wx.Slider(self, wx.NewId(), 100, 0, 200, size=(150, -1), style = wx.SL_HORIZONTAL | wx.SL_AUTOTICKS | wx.SL_LABELS) + slidergreen= wx.Slider(self, wx.ID_ANY, 100, 0, 200, size=(150, -1), style = wx.SL_HORIZONTAL | wx.SL_AUTOTICKS | wx.SL_LABELS) slidergreen.SetForegroundColour("GREEN") slidergreen.SetTickFreq(50) ctrlsizer.Add(slidergreen) @@ -39,7 +39,7 @@ class TestAdjustChannels(wx.Panel): label= wx.StaticText(self, -1, "Factor blue in %") label.SetForegroundColour("BLUE") ctrlsizer.Add(label, 0, wx.ALL, 5) - sliderblue= wx.Slider(self, wx.NewId(), 100, 0, 200, size=(150, -1), style = wx.SL_HORIZONTAL | wx.SL_AUTOTICKS | wx.SL_LABELS) + sliderblue= wx.Slider(self, wx.ID_ANY, 100, 0, 200, size=(150, -1), style = wx.SL_HORIZONTAL | wx.SL_AUTOTICKS | wx.SL_LABELS) sliderblue.SetForegroundColour("BLUE") sliderblue.SetTickFreq(50) ctrlsizer.Add(sliderblue) @@ -47,7 +47,7 @@ class TestAdjustChannels(wx.Panel): label= wx.StaticText(self, -1, "Factor alpha in %") ctrlsizer.Add(label, 0, wx.ALL, 5) - slideralpha= wx.Slider(self, wx.NewId(), 100, 0, 200, size=(150, -1), style = wx.SL_HORIZONTAL | wx.SL_AUTOTICKS | wx.SL_LABELS) + slideralpha= wx.Slider(self, wx.ID_ANY, 100, 0, 200, size=(150, -1), style = wx.SL_HORIZONTAL | wx.SL_AUTOTICKS | wx.SL_LABELS) slideralpha.SetTickFreq(50) ctrlsizer.Add(slideralpha) diff --git a/demo/Calendar.py b/demo/Calendar.py index e4a54ccf..e1081687 100644 --- a/demo/Calendar.py +++ b/demo/Calendar.py @@ -309,17 +309,17 @@ class CalendFrame(wx.Frame): def MakeFileMenu(self): menu = wx.Menu() - mID = wx.NewId() + mID = wx.Window.NewControlId() menu.Append(mID, 'Decrement', 'Next') self.Bind(wx.EVT_MENU, self.OnDecMonth, id=mID) - mID = wx.NewId() + mID = wx.Window.NewControlId() menu.Append(mID, 'Increment', 'Dec') self.Bind(wx.EVT_MENU, self.OnIncMonth, id=mID) menu.AppendSeparator() - mID = wx.NewId() + mID = wx.Window.NewControlId() menu.Append(mID, 'E&xit', 'Exit') self.Bind(wx.EVT_MENU, self.OnCloseWindow, id=mID) @@ -328,23 +328,23 @@ class CalendFrame(wx.Frame): def MakeToolMenu(self): tb = self.CreateToolBar(wx.TB_HORIZONTAL|wx.NO_BORDER) - mID = wx.NewId() + mID = wx.Window.NewControlId() SetToolPath(self, tb, mID, images.DbDec.GetBitmap(), 'Dec Year') self.Bind(wx.EVT_TOOL, self.OnDecYear, id=mID) - mID = wx.NewId() + mID = wx.Window.NewControlId() SetToolPath(self, tb, mID, images.Dec.GetBitmap(), 'Dec Month') self.Bind(wx.EVT_TOOL, self.OnDecMonth, id=mID) - mID = wx.NewId() + mID = wx.Window.NewControlId() SetToolPath(self, tb, mID, images.Pt.GetBitmap(), 'Current Month') self.Bind(wx.EVT_TOOL, self.OnCurrent, id=mID) - mID = wx.NewId() + mID = wx.Window.NewControlId() SetToolPath(self, tb, mID, images.Inc.GetBitmap(), 'Inc Month') self.Bind(wx.EVT_TOOL, self.OnIncMonth, id=mID) - mID = wx.NewId() + mID = wx.Window.NewControlId() SetToolPath(self, tb, mID, images.DbInc.GetBitmap(), 'Inc Year') self.Bind(wx.EVT_TOOL, self.OnIncYear, id=mID) diff --git a/demo/DragAndDrop.py b/demo/DragAndDrop.py index b1325143..ccc6eeef 100644 --- a/demo/DragAndDrop.py +++ b/demo/DragAndDrop.py @@ -4,9 +4,9 @@ import wx #---------------------------------------------------------------------- -ID_CopyBtn = wx.NewId() -ID_PasteBtn = wx.NewId() -ID_BitmapBtn = wx.NewId() +ID_CopyBtn = wx.Window.NewControlId() +ID_PasteBtn = wx.Window.NewControlId() +ID_BitmapBtn = wx.Window.NewControlId() #---------------------------------------------------------------------- diff --git a/demo/GLCanvas.py b/demo/GLCanvas.py index f82506bf..bb1b8991 100644 --- a/demo/GLCanvas.py +++ b/demo/GLCanvas.py @@ -22,8 +22,8 @@ except ImportError: buttonDefs = { - wx.NewId() : ('CubeCanvas', 'Cube'), - wx.NewId() : ('ConeCanvas', 'Cone'), + wx.Window.NewControlId() : ('CubeCanvas', 'Cube'), + wx.Window.NewControlId() : ('ConeCanvas', 'Cone'), } class ButtonPanel(wx.Panel): diff --git a/demo/Grid_MegaExample.py b/demo/Grid_MegaExample.py index 332693b5..8495e046 100644 --- a/demo/Grid_MegaExample.py +++ b/demo/Grid_MegaExample.py @@ -332,8 +332,8 @@ class MegaGrid(Grid.Grid): def rowPopup(self, row, evt): """(row, evt) -> display a popup menu when a row label is right clicked""" - appendID = wx.NewId() - deleteID = wx.NewId() + appendID = wx.Window.NewControlId() + deleteID = wx.Window.NewControlId() x = self.GetRowSize(row)/2 if not self.GetSelectedRows(): @@ -365,8 +365,8 @@ class MegaGrid(Grid.Grid): right clicked""" x = self.GetColSize(col)/2 menu = wx.Menu() - id1 = wx.NewId() - sortID = wx.NewId() + id1 = wx.Window.NewControlId() + sortID = wx.Window.NewControlId() xo, yo = evt.GetPosition() self.SelectCol(col) diff --git a/demo/I18N.py b/demo/I18N.py index 31680695..72e8214c 100644 --- a/demo/I18N.py +++ b/demo/I18N.py @@ -32,7 +32,7 @@ exampleStrings = [ wxID_LANGUAGESELECTPANELLANGFILTERRB, wxID_LANGUAGESELECTPANELSTATICLINE1, wxID_LANGUAGESELECTPANELSTATICTEXT1, wxID_LANGUAGESELECTPANELSTATICTEXT2, wxID_LANGUAGESELECTPANELSTATICTEXT3, wxID_LANGUAGESELECTPANELTRANSLATEDST, -] = [wx.NewId() for _init_ctrls in range(9)] +] = [wx.Window.NewControlId() for _init_ctrls in range(9)] class LanguageSelectPanel(wx.Panel): def _init_coll_boxSizer3_Items(self, parent): diff --git a/demo/InfoBar.py b/demo/InfoBar.py index eceae0e3..23133cd7 100644 --- a/demo/InfoBar.py +++ b/demo/InfoBar.py @@ -72,7 +72,7 @@ to display non-critical information to the user.""" def OnAddButton(self, evt): - btnId = wx.NewId() + btnId = wx.Window.NewControlId() self.info.AddButton(btnId, "new button") self.info.Bind(wx.EVT_BUTTON, self.OnButtonClicked, id=btnId) diff --git a/demo/LayoutAnchors.py b/demo/LayoutAnchors.py index 49da58aa..51f1ba41 100644 --- a/demo/LayoutAnchors.py +++ b/demo/LayoutAnchors.py @@ -5,7 +5,7 @@ import wx.lib.anchors as anchors #---------------------------------------------------------------------- -# Nifty little trick here; apply wx.NewId() to generate a series of +# Nifty little trick here; apply wx.Window.NewControlId() to generate a series of # IDs used later on in the app. [ ID_ANCHORSDEMOFRAMEANCHOREDPANEL, @@ -18,7 +18,7 @@ import wx.lib.anchors as anchors ID_ANCHORSDEMOFRAMEBOTTOMCHECKBOX, ID_ANCHORSDEMOFRAME, ID_ANCHORSDEMOFRAMELEFTCHECKBOX, - ] = map(lambda _init_ctrls: wx.NewId(), range(10)) + ] = map(lambda _init_ctrls: wx.Window.NewControlId(), range(10)) # A small note here: while only certain parts of this frame are actually demonstrating # the capabilities of the LayoutAnchors feature, all the controls are within the same diff --git a/demo/ListCtrl.py b/demo/ListCtrl.py index 111eb11d..ea3d74db 100644 --- a/demo/ListCtrl.py +++ b/demo/ListCtrl.py @@ -90,7 +90,7 @@ class TestListCtrlPanel(wx.Panel, listmix.ColumnSorterMixin): wx.Panel.__init__(self, parent, -1, style=wx.WANTS_CHARS) self.log = log - tID = wx.NewId() + tID = wx.Window.NewControlId() sizer = wx.BoxSizer(wx.VERTICAL) @@ -304,12 +304,12 @@ class TestListCtrlPanel(wx.Panel, listmix.ColumnSorterMixin): # only do this part the first time so the events are only bound once if not hasattr(self, "popupID1"): - self.popupID1 = wx.NewId() - self.popupID2 = wx.NewId() - self.popupID3 = wx.NewId() - self.popupID4 = wx.NewId() - self.popupID5 = wx.NewId() - self.popupID6 = wx.NewId() + self.popupID1 = wx.Window.NewControlId() + self.popupID2 = wx.Window.NewControlId() + self.popupID3 = wx.Window.NewControlId() + self.popupID4 = wx.Window.NewControlId() + self.popupID5 = wx.Window.NewControlId() + self.popupID6 = wx.Window.NewControlId() self.Bind(wx.EVT_MENU, self.OnPopupOne, id=self.popupID1) self.Bind(wx.EVT_MENU, self.OnPopupTwo, id=self.popupID2) diff --git a/demo/ListCtrl_edit.py b/demo/ListCtrl_edit.py index f48e1533..7f59c0db 100644 --- a/demo/ListCtrl_edit.py +++ b/demo/ListCtrl_edit.py @@ -86,7 +86,7 @@ class TestListCtrlPanel(wx.Panel): wx.Panel.__init__(self, parent, -1, style=wx.WANTS_CHARS) self.log = log - tID = wx.NewId() + tID = wx.Window.NewControlId() sizer = wx.BoxSizer(wx.VERTICAL) diff --git a/demo/MDIDemo.py b/demo/MDIDemo.py index 4d148753..6dc44794 100644 --- a/demo/MDIDemo.py +++ b/demo/MDIDemo.py @@ -10,8 +10,8 @@ import images SHOW_BACKGROUND = 1 #---------------------------------------------------------------------- -ID_New = wx.NewId() -ID_Exit = wx.NewId() +ID_New = wx.Window.NewControlId() +ID_Exit = wx.Window.NewControlId() #---------------------------------------------------------------------- class MyParentFrame(wx.MDIParentFrame): diff --git a/demo/Main.py b/demo/Main.py index eba90ebd..c31060f4 100644 --- a/demo/Main.py +++ b/demo/Main.py @@ -1306,10 +1306,10 @@ class MainPanel(wx.Panel): #--------------------------------------------------------------------------- class DemoTaskBarIcon(TaskBarIcon): - TBMENU_RESTORE = wx.NewId() - TBMENU_CLOSE = wx.NewId() - TBMENU_CHANGE = wx.NewId() - TBMENU_REMOVE = wx.NewId() + TBMENU_RESTORE = wx.Window.NewControlId() + TBMENU_CLOSE = wx.Window.NewControlId() + TBMENU_CHANGE = wx.Window.NewControlId() + TBMENU_REMOVE = wx.Window.NewControlId() def __init__(self, frame): TaskBarIcon.__init__(self, wx.adv.TBI_DOCK) # wx.adv.TBI_CUSTOM_STATUSITEM diff --git a/demo/Menu.py b/demo/Menu.py index 795e21dc..7558631c 100644 --- a/demo/Menu.py +++ b/demo/Menu.py @@ -245,7 +245,7 @@ check the source for this sample to see how to implement them. pos += 1 # now insert the new item - ID = wx.NewId() + ID = wx.Window.NewControlId() item = wx.MenuItem(menu, ID, "NewItem " + str(ID)) menu.InsertItem(pos, item) diff --git a/demo/MouseGestures.py b/demo/MouseGestures.py index 0dd66a04..f86a9556 100644 --- a/demo/MouseGestures.py +++ b/demo/MouseGestures.py @@ -25,10 +25,10 @@ class TestPanel(wx.Panel): def __init__(self, parent, log): wx.Panel.__init__(self, parent, -1) - ID_GESTURE = wx.NewId() - ID_MOUSE = wx.NewId() - ID_MODIFIER = wx.NewId() - ID_VISIBLE = wx.NewId() + ID_GESTURE = wx.Window.NewControlId() + ID_MOUSE = wx.Window.NewControlId() + ID_MODIFIER = wx.Window.NewControlId() + ID_VISIBLE = wx.Window.NewControlId() self.log = log diff --git a/demo/PDFViewer.py b/demo/PDFViewer.py index 3f24031a..e77d1aaf 100644 --- a/demo/PDFViewer.py +++ b/demo/PDFViewer.py @@ -15,14 +15,14 @@ class TestPanel(wx.Panel): wx.Panel.__init__(self, parent, -1) hsizer = wx.BoxSizer( wx.HORIZONTAL ) vsizer = wx.BoxSizer( wx.VERTICAL ) - self.buttonpanel = pdfButtonPanel(self, wx.NewId(), + self.buttonpanel = pdfButtonPanel(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, 0) vsizer.Add(self.buttonpanel, 0, wx.GROW|wx.ALIGN_CENTER_VERTICAL|wx.LEFT|wx.RIGHT|wx.TOP, 5) - self.viewer = pdfViewer( self, wx.NewId(), wx.DefaultPosition, + self.viewer = pdfViewer( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.HSCROLL|wx.VSCROLL|wx.SUNKEN_BORDER) vsizer.Add(self.viewer, 1, wx.GROW|wx.LEFT|wx.RIGHT|wx.BOTTOM, 5) - loadbutton = wx.Button(self, wx.NewId(), "Load PDF file", + loadbutton = wx.Button(self, wx.ID_ANY, "Load PDF file", wx.DefaultPosition, wx.DefaultSize, 0 ) vsizer.Add(loadbutton, 0, wx.ALIGN_CENTER|wx.ALL, 5) hsizer.Add(vsizer, 1, wx.GROW|wx.ALIGN_CENTER_HORIZONTAL|wx.ALL, 5) diff --git a/demo/PlateButton.py b/demo/PlateButton.py index 54a97c58..589a7256 100644 --- a/demo/PlateButton.py +++ b/demo/PlateButton.py @@ -155,15 +155,15 @@ class TestPanel(scrolled.ScrolledPanel): if btn[0] is not None and btn[0] == folder: for fname in os.listdir(wx.GetHomeDir()): if not fname.startswith('.'): - menu.Append(wx.NewId(), fname) + menu.Append(wx.ID_ANY, fname) elif btn[0] is not None and btn[0] == bookmark: for url in ['http://wxpython.org', 'http://slashdot.org', 'http://editra.org', 'http://xkcd.com']: - menu.Append(wx.NewId(), url, "Open %s in your browser" % url) + menu.Append(wx.ID_ANY, url, "Open %s in your browser" % url) else: - menu.Append(wx.NewId(), "Menu Item 1") - menu.Append(wx.NewId(), "Menu Item 2") - menu.Append(wx.NewId(), "Menu Item 3") + menu.Append(wx.ID_ANY, "Menu Item 1") + menu.Append(wx.ID_ANY, "Menu Item 2") + menu.Append(wx.ID_ANY, "Menu Item 3") tbtn.SetMenu(menu) # Set a custom colour? diff --git a/demo/PopupMenu.py b/demo/PopupMenu.py index b6f9a82d..be6eb701 100644 --- a/demo/PopupMenu.py +++ b/demo/PopupMenu.py @@ -56,15 +56,15 @@ class TestPanel(wx.Panel): # avoid clutter, some prefer them close to the object of interest # for clarity. if not hasattr(self, "popupID1"): - self.popupID1 = wx.NewId() - self.popupID2 = wx.NewId() - self.popupID3 = wx.NewId() - self.popupID4 = wx.NewId() - self.popupID5 = wx.NewId() - self.popupID6 = wx.NewId() - self.popupID7 = wx.NewId() - self.popupID8 = wx.NewId() - self.popupID9 = wx.NewId() + self.popupID1 = wx.Window.NewControlId() + self.popupID2 = wx.Window.NewControlId() + self.popupID3 = wx.Window.NewControlId() + self.popupID4 = wx.Window.NewControlId() + self.popupID5 = wx.Window.NewControlId() + self.popupID6 = wx.Window.NewControlId() + self.popupID7 = wx.Window.NewControlId() + self.popupID8 = wx.Window.NewControlId() + self.popupID9 = wx.Window.NewControlId() self.Bind(wx.EVT_MENU, self.OnPopupOne, id=self.popupID1) self.Bind(wx.EVT_MENU, self.OnPopupTwo, id=self.popupID2) diff --git a/demo/PseudoDC.py b/demo/PseudoDC.py index 21b72edd..1c4aed4b 100644 --- a/demo/PseudoDC.py +++ b/demo/PseudoDC.py @@ -173,7 +173,7 @@ class MyCanvas(wx.ScrolledWindow): self.objids = [] self.boundsdict = {} for i in range(SHAPE_COUNT): - id = wx.NewId() + id = wx.Window.NewControlId() dc.SetId(id) choice = random.randint(0,8) if choice in (0,1): diff --git a/demo/ToolBar.py b/demo/ToolBar.py index eeb56cc7..4c6426e2 100644 --- a/demo/ToolBar.py +++ b/demo/ToolBar.py @@ -123,7 +123,7 @@ class TestToolBar(wx.Frame): self.Bind(wx.EVT_TIMER, self.OnClearSB) tb.AddSeparator() - cbID = wx.NewId() + cbID = wx.Window.NewControlId() tb.AddControl( wx.ComboBox( diff --git a/demo/TreeCtrl.py b/demo/TreeCtrl.py index 4b7ceb54..ea6644d5 100644 --- a/demo/TreeCtrl.py +++ b/demo/TreeCtrl.py @@ -28,7 +28,7 @@ class TestTreeCtrlPanel(wx.Panel): self.Bind(wx.EVT_SIZE, self.OnSize) self.log = log - tID = wx.NewId() + tID = wx.Window.NewControlId() self.tree = MyTreeCtrl(self, tID, wx.DefaultPosition, wx.DefaultSize, wx.TR_HAS_BUTTONS diff --git a/demo/agw/AGWInfoBar.py b/demo/agw/AGWInfoBar.py index be62dbbc..26c53f80 100644 --- a/demo/agw/AGWInfoBar.py +++ b/demo/agw/AGWInfoBar.py @@ -115,7 +115,7 @@ to display non-critical information to the user.""" def OnAddButton(self, event): - btnId = wx.NewId() + btnId = wx.Window.NewControlId() if self.checkBitmap.GetValue(): bitmap = random.choice(self.valid_images) diff --git a/demo/agw/BalloonTip.py b/demo/agw/BalloonTip.py index 79e91754..38d5c94e 100644 --- a/demo/agw/BalloonTip.py +++ b/demo/agw/BalloonTip.py @@ -286,8 +286,8 @@ class BalloonTipDemo(wx.Frame): file_menu = wx.Menu() help_menu = wx.Menu() - TEST_QUIT = wx.NewId() - TEST_ABOUT = wx.NewId() + TEST_QUIT = wx.Window.NewControlId() + TEST_ABOUT = wx.Window.NewControlId() file_menu.Append(TEST_QUIT, "&Exit") help_menu.Append(TEST_ABOUT, "&About") diff --git a/demo/agw/ButtonPanel.py b/demo/agw/ButtonPanel.py index eed66d8b..349dd28f 100644 --- a/demo/agw/ButtonPanel.py +++ b/demo/agw/ButtonPanel.py @@ -21,15 +21,15 @@ import random #---------------------------------------------------------------------- -ID_BackgroundColour = wx.NewId() -ID_GradientFrom = wx.NewId() -ID_GradientTo = wx.NewId() -ID_BorderColour = wx.NewId() -ID_CaptionColour = wx.NewId() -ID_ButtonTextColour = wx.NewId() -ID_SelectionBrush = wx.NewId() -ID_SelectionPen = wx.NewId() -ID_SeparatorColour = wx.NewId() +ID_BackgroundColour = wx.Window.NewControlId() +ID_GradientFrom = wx.Window.NewControlId() +ID_GradientTo = wx.Window.NewControlId() +ID_BorderColour = wx.Window.NewControlId() +ID_CaptionColour = wx.Window.NewControlId() +ID_ButtonTextColour = wx.Window.NewControlId() +ID_SelectionBrush = wx.Window.NewControlId() +ID_SelectionPen = wx.Window.NewControlId() +ID_SeparatorColour = wx.Window.NewControlId() #---------------------------------------------------------------------- @@ -605,7 +605,7 @@ class ButtonPanelDemo(wx.Frame): kind = wx.ITEM_NORMAL longHelp = "Simple Button without label No %d"%(count+1) - btn = bp.ButtonInfo(self.titleBar, wx.NewId(), + btn = bp.ButtonInfo(self.titleBar, wx.ID_ANY, png[0], kind=kind, shortHelp=shortHelp, longHelp=longHelp) @@ -665,7 +665,7 @@ class ButtonPanelDemo(wx.Frame): hasText = random.randint(0, 1) itemKind = random.randint(0, 1) - btn = bp.ButtonInfo(self.titleBar, wx.NewId(), self.pngs[itemImage][0], + btn = bp.ButtonInfo(self.titleBar, wx.ID_ANY, self.pngs[itemImage][0], kind=itemKind) if hasText: diff --git a/demo/agw/FlatMenu.py b/demo/agw/FlatMenu.py index 8a6f08fc..a7248d98 100644 --- a/demo/agw/FlatMenu.py +++ b/demo/agw/FlatMenu.py @@ -48,18 +48,18 @@ else: # Menu items IDs #------------------------------- -MENU_STYLE_DEFAULT = wx.NewId() -MENU_STYLE_XP = wx.NewId() -MENU_STYLE_2007 = wx.NewId() -MENU_STYLE_VISTA = wx.NewId() -MENU_STYLE_MY = wx.NewId() -MENU_USE_CUSTOM = wx.NewId() -MENU_LCD_MONITOR = wx.NewId() -MENU_HELP = wx.NewId() +MENU_STYLE_DEFAULT = wx.Window.NewControlId() +MENU_STYLE_XP = wx.Window.NewControlId() +MENU_STYLE_2007 = wx.Window.NewControlId() +MENU_STYLE_VISTA = wx.Window.NewControlId() +MENU_STYLE_MY = wx.Window.NewControlId() +MENU_USE_CUSTOM = wx.Window.NewControlId() +MENU_LCD_MONITOR = wx.Window.NewControlId() +MENU_HELP = wx.Window.NewControlId() -MENU_DISABLE_MENU_ITEM = wx.NewId() -MENU_REMOVE_MENU = wx.NewId() -MENU_TRANSPARENCY = wx.NewId() +MENU_DISABLE_MENU_ITEM = wx.Window.NewControlId() +MENU_REMOVE_MENU = wx.Window.NewControlId() +MENU_TRANSPARENCY = wx.Window.NewControlId() MENU_NEW_FILE = 10005 MENU_SAVE = 10006 diff --git a/demo/agw/FlatNotebook.py b/demo/agw/FlatNotebook.py index d997584b..6a541ccd 100644 --- a/demo/agw/FlatNotebook.py +++ b/demo/agw/FlatNotebook.py @@ -24,51 +24,51 @@ import images #---------------------------------------------------------------------- -MENU_EDIT_DELETE_ALL = wx.NewId() -MENU_EDIT_ADD_PAGE = wx.NewId() -MENU_EDIT_DELETE_PAGE = wx.NewId() -MENU_EDIT_SET_SELECTION = wx.NewId() -MENU_EDIT_ADVANCE_SELECTION_FWD = wx.NewId() -MENU_EDIT_ADVANCE_SELECTION_BACK = wx.NewId() -MENU_SET_ALL_TABS_SHAPE_ANGLE = wx.NewId() -MENU_SHOW_IMAGES = wx.NewId() -MENU_USE_VC71_STYLE = wx.NewId() -MENU_USE_DEFAULT_STYLE = wx.NewId() -MENU_USE_FANCY_STYLE = wx.NewId() -MENU_USE_RIBBON_STYLE = wx.NewId() -MENU_SELECT_GRADIENT_COLOUR_FROM = wx.NewId() -MENU_SELECT_GRADIENT_COLOUR_TO = wx.NewId() -MENU_SELECT_GRADIENT_COLOUR_BORDER = wx.NewId() -MENU_SET_PAGE_IMAGE_INDEX = wx.NewId() -MENU_HIDE_X = wx.NewId() -MENU_HIDE_NAV_BUTTONS = wx.NewId() -MENU_USE_MOUSE_MIDDLE_BTN = wx.NewId() -MENU_DRAW_BORDER = wx.NewId() -MENU_USE_BOTTOM_TABS = wx.NewId() -MENU_ENABLE_TAB = wx.NewId() -MENU_DISABLE_TAB = wx.NewId() -MENU_ENABLE_DRAG_N_DROP = wx.NewId() -MENU_DCLICK_CLOSES_TAB = wx.NewId() -MENU_USE_VC8_STYLE = wx.NewId() -MENU_USE_FF2_STYLE = wx.NewId() -MENU_HIDE_ON_SINGLE_TAB = wx.NewId() -MENU_HIDE_TABS = wx.NewId() -MENU_NO_TABS_FOCUS = wx.NewId() +MENU_EDIT_DELETE_ALL = wx.Window.NewControlId() +MENU_EDIT_ADD_PAGE = wx.Window.NewControlId() +MENU_EDIT_DELETE_PAGE = wx.Window.NewControlId() +MENU_EDIT_SET_SELECTION = wx.Window.NewControlId() +MENU_EDIT_ADVANCE_SELECTION_FWD = wx.Window.NewControlId() +MENU_EDIT_ADVANCE_SELECTION_BACK = wx.Window.NewControlId() +MENU_SET_ALL_TABS_SHAPE_ANGLE = wx.Window.NewControlId() +MENU_SHOW_IMAGES = wx.Window.NewControlId() +MENU_USE_VC71_STYLE = wx.Window.NewControlId() +MENU_USE_DEFAULT_STYLE = wx.Window.NewControlId() +MENU_USE_FANCY_STYLE = wx.Window.NewControlId() +MENU_USE_RIBBON_STYLE = wx.Window.NewControlId() +MENU_SELECT_GRADIENT_COLOUR_FROM = wx.Window.NewControlId() +MENU_SELECT_GRADIENT_COLOUR_TO = wx.Window.NewControlId() +MENU_SELECT_GRADIENT_COLOUR_BORDER = wx.Window.NewControlId() +MENU_SET_PAGE_IMAGE_INDEX = wx.Window.NewControlId() +MENU_HIDE_X = wx.Window.NewControlId() +MENU_HIDE_NAV_BUTTONS = wx.Window.NewControlId() +MENU_USE_MOUSE_MIDDLE_BTN = wx.Window.NewControlId() +MENU_DRAW_BORDER = wx.Window.NewControlId() +MENU_USE_BOTTOM_TABS = wx.Window.NewControlId() +MENU_ENABLE_TAB = wx.Window.NewControlId() +MENU_DISABLE_TAB = wx.Window.NewControlId() +MENU_ENABLE_DRAG_N_DROP = wx.Window.NewControlId() +MENU_DCLICK_CLOSES_TAB = wx.Window.NewControlId() +MENU_USE_VC8_STYLE = wx.Window.NewControlId() +MENU_USE_FF2_STYLE = wx.Window.NewControlId() +MENU_HIDE_ON_SINGLE_TAB = wx.Window.NewControlId() +MENU_HIDE_TABS = wx.Window.NewControlId() +MENU_NO_TABS_FOCUS = wx.Window.NewControlId() -MENU_SET_ACTIVE_TEXT_COLOUR = wx.NewId() -MENU_DRAW_TAB_X = wx.NewId() -MENU_SET_ACTIVE_TAB_COLOUR = wx.NewId() -MENU_SET_TAB_AREA_COLOUR = wx.NewId() -MENU_SELECT_NONACTIVE_TEXT_COLOUR = wx.NewId() -MENU_GRADIENT_BACKGROUND = wx.NewId() -MENU_COLOURFUL_TABS = wx.NewId() -MENU_SMART_TABS = wx.NewId() -MENU_USE_DROP_ARROW_BUTTON = wx.NewId() -MENU_ALLOW_FOREIGN_DND = wx.NewId() +MENU_SET_ACTIVE_TEXT_COLOUR = wx.Window.NewControlId() +MENU_DRAW_TAB_X = wx.Window.NewControlId() +MENU_SET_ACTIVE_TAB_COLOUR = wx.Window.NewControlId() +MENU_SET_TAB_AREA_COLOUR = wx.Window.NewControlId() +MENU_SELECT_NONACTIVE_TEXT_COLOUR = wx.Window.NewControlId() +MENU_GRADIENT_BACKGROUND = wx.Window.NewControlId() +MENU_COLOURFUL_TABS = wx.Window.NewControlId() +MENU_SMART_TABS = wx.Window.NewControlId() +MENU_USE_DROP_ARROW_BUTTON = wx.Window.NewControlId() +MENU_ALLOW_FOREIGN_DND = wx.Window.NewControlId() -MENU_TILE_HORIZONTALLY = wx.NewId() -MENU_TILE_VERTICALLY = wx.NewId() -MENU_TILE_NONE = wx.NewId() +MENU_TILE_HORIZONTALLY = wx.Window.NewControlId() +MENU_TILE_VERTICALLY = wx.Window.NewControlId() +MENU_TILE_NONE = wx.Window.NewControlId() class FlatNotebookDemo(wx.Frame): diff --git a/demo/agw/FoldPanelBar.py b/demo/agw/FoldPanelBar.py index a7831a8b..23d86507 100644 --- a/demo/agw/FoldPanelBar.py +++ b/demo/agw/FoldPanelBar.py @@ -297,11 +297,11 @@ class Extended(wx.Frame): item = self._pnl.AddFoldPanel("Caption Style", False, foldIcons=Images) - self.ID_USE_VGRADIENT = wx.NewId() - self.ID_USE_HGRADIENT = wx.NewId() - self.ID_USE_SINGLE = wx.NewId() - self.ID_USE_RECTANGLE = wx.NewId() - self.ID_USE_FILLED_RECTANGLE = wx.NewId() + self.ID_USE_VGRADIENT = wx.Window.NewControlId() + self.ID_USE_HGRADIENT = wx.Window.NewControlId() + self.ID_USE_SINGLE = wx.Window.NewControlId() + self.ID_USE_RECTANGLE = wx.Window.NewControlId() + self.ID_USE_FILLED_RECTANGLE = wx.Window.NewControlId() currStyle = wx.RadioButton(item, self.ID_USE_VGRADIENT, "&Vertical Gradient") self._pnl.AddFoldPanelWindow(item, currStyle, fpb.FPB_ALIGN_WIDTH, @@ -339,7 +339,7 @@ class Extended(wx.Frame): item = self._pnl.AddFoldPanel("Misc Stuff", collapsed=True, foldIcons=Images, cbstyle=cs) - button2 = wx.Button(item, wx.NewId(), "Collapse All") + button2 = wx.Button(item, wx.ID_ANY, "Collapse All") self._pnl.AddFoldPanelWindow(item, button2) self._pnl.AddFoldPanelWindow(item, wx.StaticText(item, -1, "Enter Some Comments"), fpb.FPB_ALIGN_WIDTH, 5, 20) @@ -523,13 +523,13 @@ class Extended(wx.Frame): # Make a menubar file_menu = wx.Menu() - FPBTEST_QUIT = wx.NewId() - FPBTEST_REFRESH = wx.NewId() - FPB_BOTTOM_FOLD = wx.NewId() - FPB_SINGLE_FOLD = wx.NewId() - FPB_EXCLUSIVE_FOLD = wx.NewId() - FPBTEST_TOGGLE_WINDOW = wx.NewId() - FPBTEST_ABOUT = wx.NewId() + FPBTEST_QUIT = wx.Window.NewControlId() + FPBTEST_REFRESH = wx.Window.NewControlId() + FPB_BOTTOM_FOLD = wx.Window.NewControlId() + FPB_SINGLE_FOLD = wx.Window.NewControlId() + FPB_EXCLUSIVE_FOLD = wx.Window.NewControlId() + FPBTEST_TOGGLE_WINDOW = wx.Window.NewControlId() + FPBTEST_ABOUT = wx.Window.NewControlId() file_menu.Append(FPBTEST_QUIT, "&Exit") @@ -722,10 +722,10 @@ class Collapsed(wx.Frame): def CreateMenuBar(self): - FoldPanelBarTest_Quit = wx.NewId() - FoldPanelBarTest_About = wx.NewId() - FoldPanelBarTest_Horizontal = wx.NewId() - FoldPanelBarTest_Vertical = wx.NewId() + FoldPanelBarTest_Quit = wx.Window.NewControlId() + FoldPanelBarTest_About = wx.Window.NewControlId() + FoldPanelBarTest_Horizontal = wx.Window.NewControlId() + FoldPanelBarTest_Vertical = wx.Window.NewControlId() menuFile = wx.Menu() menuFile.Append(FoldPanelBarTest_Horizontal, "&Horizontal\tAlt-H") @@ -846,8 +846,8 @@ class NotCollapsed(wx.Frame): def CreateMenuBar(self): - FoldPanelBarTest_Quit = wx.NewId() - FoldPanelBarTest_About = wx.NewId() + FoldPanelBarTest_Quit = wx.Window.NewControlId() + FoldPanelBarTest_About = wx.Window.NewControlId() menuFile = wx.Menu() menuFile.Append(FoldPanelBarTest_Quit, "E&xit\tAlt-X", "Quit This Program") diff --git a/demo/agw/HyperLinkCtrl.py b/demo/agw/HyperLinkCtrl.py index 3f9dba8e..1193afaf 100644 --- a/demo/agw/HyperLinkCtrl.py +++ b/demo/agw/HyperLinkCtrl.py @@ -107,8 +107,8 @@ class TestPanel(wx.Panel): def OnRightLink(self, event): pos = self._hyper3.GetPosition() + event.GetPosition() menuPopUp = wx.Menu("Having a nice day?") - ID_MENU_YES = wx.NewId() - ID_MENU_NO = wx.NewId() + ID_MENU_YES = wx.Window.NewControlId() + ID_MENU_NO = wx.Window.NewControlId() menuPopUp.Append(ID_MENU_YES, "Yes, absolutely!") menuPopUp.Append(ID_MENU_NO, "I've had better") self.PopupMenu(menuPopUp) diff --git a/demo/agw/HyperTreeList.py b/demo/agw/HyperTreeList.py index 0640ea56..f03ec378 100644 --- a/demo/agw/HyperTreeList.py +++ b/demo/agw/HyperTreeList.py @@ -1072,13 +1072,13 @@ class HyperTreeListDemo(wx.Frame): file_menu = wx.Menu() - AS_EXIT = wx.NewId() + AS_EXIT = wx.Window.NewControlId() file_menu.Append(AS_EXIT, "&Exit") self.Bind(wx.EVT_MENU, self.OnClose, id=AS_EXIT) help_menu = wx.Menu() - AS_ABOUT = wx.NewId() + AS_ABOUT = wx.Window.NewControlId() help_menu.Append(AS_ABOUT, "&About...") self.Bind(wx.EVT_MENU, self.OnAbout, id=AS_ABOUT) diff --git a/demo/agw/ShapedButton.py b/demo/agw/ShapedButton.py index d5ce5239..6e88fa8b 100644 --- a/demo/agw/ShapedButton.py +++ b/demo/agw/ShapedButton.py @@ -340,13 +340,13 @@ class ShapedButtonDemo(wx.Frame): file_menu = wx.Menu() - AS_EXIT = wx.NewId() + AS_EXIT = wx.Window.NewControlId() file_menu.Append(AS_EXIT, "&Exit") self.Bind(wx.EVT_MENU, self.OnClose, id=AS_EXIT) help_menu = wx.Menu() - AS_ABOUT = wx.NewId() + AS_ABOUT = wx.Window.NewControlId() help_menu.Append(AS_ABOUT, "&About...") self.Bind(wx.EVT_MENU, self.OnAbout, id=AS_ABOUT) diff --git a/demo/agw/ShortcutEditor.py b/demo/agw/ShortcutEditor.py index 7f3da3a6..b1bd197a 100644 --- a/demo/agw/ShortcutEditor.py +++ b/demo/agw/ShortcutEditor.py @@ -33,7 +33,7 @@ TOP_MENUS = ['File', 'Edit', 'View', 'Options', 'Window', 'Help'] COMBINATIONS = string.ascii_uppercase + string.digits COMBINATIONS = [c for c in COMBINATIONS] + list(SE.KEYMAP.values()) -ACCEL_IDS = [wx.NewId() for i in range(6)] +ACCEL_IDS = [wx.Window.NewControlId() for i in range(6)] _ = wx.GetTranslation diff --git a/demo/agw/ThumbnailCtrl.py b/demo/agw/ThumbnailCtrl.py index b5d4d79a..37aa3fdf 100644 --- a/demo/agw/ThumbnailCtrl.py +++ b/demo/agw/ThumbnailCtrl.py @@ -166,13 +166,13 @@ class ThumbnailCtrlDemo(wx.Frame): file_menu = wx.Menu() - AS_EXIT = wx.NewId() + AS_EXIT = wx.Window.NewControlId() file_menu.Append(AS_EXIT, "&Exit") self.Bind(wx.EVT_MENU, self.OnClose, id=AS_EXIT) help_menu = wx.Menu() - AS_ABOUT = wx.NewId() + AS_ABOUT = wx.Window.NewControlId() help_menu.Append(AS_ABOUT, "&About...") self.Bind(wx.EVT_MENU, self.OnAbout, id=AS_ABOUT) @@ -431,18 +431,18 @@ class ThumbnailCtrlDemo(wx.Frame): def CreatePopups(self): if not hasattr(self, "popupID1"): - self.popupID1 = wx.NewId() - self.popupID2 = wx.NewId() - self.popupID3 = wx.NewId() - self.popupID4 = wx.NewId() - self.popupID5 = wx.NewId() - self.popupID6 = wx.NewId() - self.popupID7 = wx.NewId() - self.popupID8 = wx.NewId() - self.popupID9 = wx.NewId() - self.popupID10 = wx.NewId() - self.popupID11 = wx.NewId() - self.popupID12 = wx.NewId() + self.popupID1 = wx.Window.NewControlId() + self.popupID2 = wx.Window.NewControlId() + self.popupID3 = wx.Window.NewControlId() + self.popupID4 = wx.Window.NewControlId() + self.popupID5 = wx.Window.NewControlId() + self.popupID6 = wx.Window.NewControlId() + self.popupID7 = wx.Window.NewControlId() + self.popupID8 = wx.Window.NewControlId() + self.popupID9 = wx.Window.NewControlId() + self.popupID10 = wx.Window.NewControlId() + self.popupID11 = wx.Window.NewControlId() + self.popupID12 = wx.Window.NewControlId() self.Bind(wx.EVT_MENU, self.OnPopupOne, id=self.popupID1) self.Bind(wx.EVT_MENU, self.OnPopupTwo, id=self.popupID2) @@ -480,9 +480,9 @@ class ThumbnailCtrlDemo(wx.Frame): def CreateGlobalPopups(self): if not hasattr(self, "popupID10"): - self.popupID10 = wx.NewId() - self.popupID11 = wx.NewId() - self.popupID12 = wx.NewId() + self.popupID10 = wx.Window.NewControlId() + self.popupID11 = wx.Window.NewControlId() + self.popupID12 = wx.Window.NewControlId() self.Bind(wx.EVT_MENU, self.OnPopupTen, id=self.popupID10) self.Bind(wx.EVT_MENU, self.OnPopupEleven, id=self.popupID11) diff --git a/demo/agw/UltimateReportDemo.py b/demo/agw/UltimateReportDemo.py index 2b08ca19..1a46dd61 100644 --- a/demo/agw/UltimateReportDemo.py +++ b/demo/agw/UltimateReportDemo.py @@ -855,12 +855,12 @@ class UltimateListCtrlPanel(wx.Panel, listmix.ColumnSorterMixin): # only do this part the first time so the events are only bound once if not hasattr(self, "popupID1"): - self.popupID1 = wx.NewId() - self.popupID2 = wx.NewId() - self.popupID3 = wx.NewId() - self.popupID4 = wx.NewId() - self.popupID5 = wx.NewId() - self.popupID6 = wx.NewId() + self.popupID1 = wx.Window.NewControlId() + self.popupID2 = wx.Window.NewControlId() + self.popupID3 = wx.Window.NewControlId() + self.popupID4 = wx.Window.NewControlId() + self.popupID5 = wx.Window.NewControlId() + self.popupID6 = wx.Window.NewControlId() self.Bind(wx.EVT_MENU, self.OnPopupOne, id=self.popupID1) self.Bind(wx.EVT_MENU, self.OnPopupTwo, id=self.popupID2) diff --git a/demo/infoframe.py b/demo/infoframe.py index 46b4a0b4..5a92b62f 100644 --- a/demo/infoframe.py +++ b/demo/infoframe.py @@ -17,12 +17,12 @@ class MyFrame(wx.Frame): menu = wx.Menu() # Enable output menu item - mID = wx.NewId() + mID = wx.Window.NewControlId() menu.Append(mID, "&Enable output", "Display output frame") self.Bind(wx.EVT_MENU, output.EnableOutput, id=mID) # Disable output menu item - mID = wx.NewId() + mID = wx.Window.NewControlId() menu.Append(mID, "&Disable output", "Close output frame") self.Bind(wx.EVT_MENU, output.DisableOutput, id=mID) diff --git a/unittests/test_lib_agw_buttonpanel.py b/unittests/test_lib_agw_buttonpanel.py index 40b096d2..1a276c18 100644 --- a/unittests/test_lib_agw_buttonpanel.py +++ b/unittests/test_lib_agw_buttonpanel.py @@ -11,14 +11,14 @@ class lib_agw_buttonpanel_Tests(wtc.WidgetTestCase): def test_lib_agw_buttonpanelCtor(self): bar = BP.ButtonPanel(self.frame, -1, 'sample text') - btn = BP.ButtonInfo(bar, wx.NewId(), + btn = BP.ButtonInfo(bar, wx.ID_ANY, wx.ArtProvider.GetBitmap(wx.ART_INFORMATION, wx.ART_OTHER, (32, 32)), text='Button 1') bar.AddButton(btn) def test_lib_agw_buttonpanelMethods(self): bar = BP.ButtonPanel(self.frame, -1, 'sample text') - btn = BP.ButtonInfo(bar, wx.NewId(), + btn = BP.ButtonInfo(bar, wx.ID_ANY, wx.ArtProvider.GetBitmap(wx.ART_INFORMATION, wx.ART_OTHER, (32, 32)), text='Button 1') bar.AddButton(btn) diff --git a/unittests/test_lib_pdfviewer_pdfviewer.py b/unittests/test_lib_pdfviewer_pdfviewer.py index f1a5d009..0a3600f8 100644 --- a/unittests/test_lib_pdfviewer_pdfviewer.py +++ b/unittests/test_lib_pdfviewer_pdfviewer.py @@ -21,12 +21,12 @@ class lib_pdfviewer_pdfviewer_Tests(wtc.WidgetTestCase): @unittest.skipIf(not havePyPDF, "PyMuPDF or PyPDF2 required") def test_lib_pdfviewer_pdfviewerButtonPanelCtor(self): - bp = pdfButtonPanel(self.frame, wx.NewId(), + bp = pdfButtonPanel(self.frame, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, 0) @unittest.skipIf(not havePyPDF, "PyMuPDF or PyPDF2 required") def test_lib_pdfviewer_pdfviewerPdfViewerCtor(self): - pv = pdfViewer(self.frame, wx.NewId(), wx.DefaultPosition, + pv = pdfViewer(self.frame, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.HSCROLL|wx.VSCROLL|wx.SUNKEN_BORDER) @@ -34,10 +34,10 @@ class lib_pdfviewer_pdfviewer_Tests(wtc.WidgetTestCase): def test_lib_pdfviewer_loadFile(self): paneCont = sc.SizedPanel(self.frame) - self.buttonpanel = pdfButtonPanel(paneCont, wx.NewId(), + self.buttonpanel = pdfButtonPanel(paneCont, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, 0) self.buttonpanel.SetSizerProps(expand=True) - self.viewer = pdfViewer(paneCont, wx.NewId(), wx.DefaultPosition, + self.viewer = pdfViewer(paneCont, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.HSCROLL|wx.VSCROLL|wx.SUNKEN_BORDER) self.viewer.SetSizerProps(expand=True, proportion=1) diff --git a/unittests/test_pyevent.py b/unittests/test_pyevent.py index d0b2631b..412dbeb7 100644 --- a/unittests/test_pyevent.py +++ b/unittests/test_pyevent.py @@ -9,7 +9,7 @@ import wx class PyEvents(unittest.TestCase): def test_PyEvent(self): - id = wx.NewId() + id = wx.Window.NewControlId() typ = wx.NewEventType() evt = wx.PyEvent(id, typ) evt.newAttr = "hello" @@ -24,7 +24,7 @@ class PyEvents(unittest.TestCase): def test_PyCommandEvent(self): - id = wx.NewId() + id = wx.Window.NewControlId() typ = wx.NewEventType() evt = wx.PyCommandEvent(id, typ) evt.newAttr = "hello" diff --git a/unittests/test_utils.py b/unittests/test_utils.py index 06f55721..6f7aebcc 100644 --- a/unittests/test_utils.py +++ b/unittests/test_utils.py @@ -42,7 +42,7 @@ class utils_Tests(wtc.WidgetTestCase): wx.GetMouseState() wx.EnableTopLevelWindows(True) wx.FindWindowAtPoint((1,1)) - wx.NewId() + wx.Window.NewControlId() wx.RegisterId(12345) wx.GetUserName() wx.GetUserId() diff --git a/wx/lib/agw/aui/auibar.py b/wx/lib/agw/aui/auibar.py index 1677ce8a..c7f9d317 100644 --- a/wx/lib/agw/aui/auibar.py +++ b/wx/lib/agw/aui/auibar.py @@ -1826,7 +1826,7 @@ class AuiToolBar(wx.Control): item.spacer_pixels = 0 if tool_id == wx.ID_ANY: - tool_id = wx.NewId() + tool_id = wx.Window.NewControlId() item.id = tool_id item.state = 0 @@ -1931,7 +1931,7 @@ class AuiToolBar(wx.Control): item.spacer_pixels = 0 if tool_id == wx.ID_ANY: - tool_id = wx.NewId() + tool_id = wx.Window.NewControlId() item.id = tool_id item.state = 0 diff --git a/wx/lib/agw/buttonpanel.py b/wx/lib/agw/buttonpanel.py index f8337b0a..1f5747c2 100644 --- a/wx/lib/agw/buttonpanel.py +++ b/wx/lib/agw/buttonpanel.py @@ -105,19 +105,19 @@ Usage example:: titleBar = BP.ButtonPanel(mainPanel, -1, "A Simple Test & Demo") - btn1 = BP.ButtonInfo(titleBar, wx.NewId(), wx.Bitmap("png4.png", wx.BITMAP_TYPE_PNG)) + btn1 = BP.ButtonInfo(titleBar, wx.ID_ANY, wx.Bitmap("png4.png", wx.BITMAP_TYPE_PNG)) titleBar.AddButton(btn1) self.Bind(wx.EVT_BUTTON, self.OnButton, btn1) - btn2 = BP.ButtonInfo(titleBar, wx.NewId(), wx.Bitmap("png3.png", wx.BITMAP_TYPE_PNG)) + btn2 = BP.ButtonInfo(titleBar, wx.ID_ANY, wx.Bitmap("png3.png", wx.BITMAP_TYPE_PNG)) titleBar.AddButton(btn2) self.Bind(wx.EVT_BUTTON, self.OnButton, btn2) - btn3 = BP.ButtonInfo(titleBar, wx.NewId(), wx.Bitmap("png2.png", wx.BITMAP_TYPE_PNG)) + btn3 = BP.ButtonInfo(titleBar, wx.ID_ANY, wx.Bitmap("png2.png", wx.BITMAP_TYPE_PNG)) titleBar.AddButton(btn3) self.Bind(wx.EVT_BUTTON, self.OnButton, btn3) - btn4 = BP.ButtonInfo(titleBar, wx.NewId(), wx.Bitmap("png1.png", wx.BITMAP_TYPE_PNG)) + btn4 = BP.ButtonInfo(titleBar, wx.ID_ANY, wx.Bitmap("png1.png", wx.BITMAP_TYPE_PNG)) titleBar.AddButton(btn4) self.Bind(wx.EVT_BUTTON, self.OnButton, btn4) @@ -853,7 +853,7 @@ class Control(wx.EvtHandler): self._parent = parent if id == wx.ID_ANY: - self._id = wx.NewId() + self._id = wx.Window.NewControlId() else: self._id = id @@ -1387,7 +1387,7 @@ class ButtonInfo(Control): """ if id == wx.ID_ANY: - id = wx.NewId() + id = wx.Window.NewControlId() self._status = status self._rect = wx.Rect() @@ -2776,19 +2776,19 @@ if __name__ == '__main__': titleBar = ButtonPanel(mainPanel, -1, 'A Simple Test & Demo') - btn1 = ButtonInfo(titleBar, wx.NewId(), + btn1 = ButtonInfo(titleBar, wx.ID_ANY, wx.ArtProvider.GetBitmap(wx.ART_INFORMATION, wx.ART_OTHER, (32, 32)), text='Button 1') titleBar.AddButton(btn1) self.Bind(wx.EVT_BUTTON, self.OnButton, btn1) - btn2 = ButtonInfo(titleBar, wx.NewId(), + btn2 = ButtonInfo(titleBar, wx.ID_ANY, wx.ArtProvider.GetBitmap(wx.ART_TIP, wx.ART_OTHER, (32, 32)), text='Button 2') titleBar.AddButton(btn2) self.Bind(wx.EVT_BUTTON, self.OnButton, btn2) - btn3 = ButtonInfo(titleBar, wx.NewId(), + btn3 = ButtonInfo(titleBar, wx.ID_ANY, wx.ArtProvider.GetBitmap(wx.ART_WARNING, wx.ART_OTHER, (32, 32)), text='Button 3') diff --git a/wx/lib/agw/flatmenu.py b/wx/lib/agw/flatmenu.py index 03ad70f5..66db3609 100644 --- a/wx/lib/agw/flatmenu.py +++ b/wx/lib/agw/flatmenu.py @@ -2234,7 +2234,7 @@ class MenuEntryInfo(object): self._rect = wx.Rect() self._state = state if cmd == wx.ID_ANY: - cmd = wx.NewId() + cmd = wx.Window.NewControlId() self._cmd = cmd # the menu itself accelerator id @@ -3560,7 +3560,7 @@ class FlatMenuBar(wx.Panel): if not self._moreMenu: # first time self._moreMenu = FlatMenu(self) - self._popupDlgCmdId = wx.NewId() + self._popupDlgCmdId = wx.Window.NewControlId() # Connect an event handler for this event self.Connect(self._popupDlgCmdId, -1, wxEVT_FLAT_MENU_SELECTED, self.OnCustomizeDlg) @@ -3956,7 +3956,7 @@ class FlatMenuButton(object): self._parent = menu self._pos = wx.Point() self._size = wx.Size() - self._timerID = wx.NewId() + self._timerID = wx.Window.NewControlId() self._scrollOnHover = scrollOnHover if not disabledBmp.IsOk(): @@ -4565,11 +4565,11 @@ class FlatToolbarItem(object): """ if id == wx.ID_ANY: - id = wx.NewId() + id = wx.Window.NewControlId() if controlType is None: # Is a separator self._normalBmp = wx.NullBitmap - self._id = wx.NewId() + self._id = wx.Window.NewControlId() self._label = "" self._disabledImg = wx.NullBitmap self._customCtrl = None @@ -4837,7 +4837,7 @@ class FlatMenuItem(object): self._helpString = helpString if id == wx.ID_ANY: - id = wx.NewId() + id = wx.Window.NewControlId() self._id = id self._parentMenu = parent diff --git a/wx/lib/agw/fmcustomizedlg.py b/wx/lib/agw/fmcustomizedlg.py index 17059ba8..4cbc2f27 100644 --- a/wx/lib/agw/fmcustomizedlg.py +++ b/wx/lib/agw/fmcustomizedlg.py @@ -286,7 +286,7 @@ class FMCustomizeDlg(wx.Dialog): self._visibleMenus = visible self._hiddenMenus = hidden - self._menuListId = wx.NewId() + self._menuListId = wx.Window.NewControlId() self._checkListMenus = wx.CheckListBox(menus, self._menuListId, pos=wx.DefaultPosition, size=wx.Size(250, 250), choices=self.order, style=wx.BORDER_SIMPLE) self._checkListMenus.Bind(wx.EVT_CHECKLISTBOX, self.OnMenuChecked) @@ -338,7 +338,7 @@ class FMCustomizeDlg(wx.Dialog): # + Menu bar background colour (combo button) #----------------------------------------------------------- - self._menuStyleID = wx.NewId() + self._menuStyleID = wx.Window.NewControlId() choices = [_("Default Style"), _("Metallic")] self._menuStyle = wx.RadioBox(options, self._menuStyleID, _("Menu bar style"), wx.DefaultPosition, wx.DefaultSize, choices) @@ -357,19 +357,19 @@ class FMCustomizeDlg(wx.Dialog): vsizer.Add(self._menuStyle, 0, wx.EXPAND | wx.ALL, 5) self._sbStyle = wx.StaticBoxSizer(wx.StaticBox(options, -1, _("Default style settings")), wx.VERTICAL) - self._drawVertGradID = wx.NewId() + self._drawVertGradID = wx.Window.NewControlId() self._verticalGradient = wx.CheckBox(options, self._drawVertGradID, _("Draw vertical gradient")) self._verticalGradient.Bind(wx.EVT_CHECKBOX, self.OnChangeStyle) self._sbStyle.Add(self._verticalGradient, 0, wx.EXPAND | wx.ALL, 3) self._verticalGradient.SetValue(ArtManager.Get().GetMBVerticalGradient()) - self._drawBorderID = wx.NewId() + self._drawBorderID = wx.Window.NewControlId() self._drawBorder = wx.CheckBox(options, self._drawBorderID, _("Draw border around menu bar")) self._drawBorder.Bind(wx.EVT_CHECKBOX, self.OnChangeStyle) self._sbStyle.Add(self._drawBorder, 0, wx.EXPAND | wx.ALL, 3) self._drawBorder.SetValue(ArtManager.Get().GetMenuBarBorder()) - self._shadowUnderTBID = wx.NewId() + self._shadowUnderTBID = wx.Window.NewControlId() self._shadowUnderTB = wx.CheckBox(options, self._shadowUnderTBID, _("Toolbar float over menu bar")) self._shadowUnderTB.Bind(wx.EVT_CHECKBOX, self.OnChangeStyle) self._sbStyle.Add(self._shadowUnderTB, 0, wx.EXPAND | wx.ALL, 3) @@ -379,7 +379,7 @@ class FMCustomizeDlg(wx.Dialog): # Misc sb = wx.StaticBoxSizer(wx.StaticBox(options, -1, _("Colour Scheme")), wx.VERTICAL) - self._colourID = wx.NewId() + self._colourID = wx.Window.NewControlId() colourChoices = ArtManager.Get().GetColourSchemes() colourChoices.sort() diff --git a/wx/lib/agw/infobar.py b/wx/lib/agw/infobar.py index e08f27a6..7e528a39 100644 --- a/wx/lib/agw/infobar.py +++ b/wx/lib/agw/infobar.py @@ -71,7 +71,7 @@ For example:: info = InfoBar(parent) bitmap = wx.Bitmap('nice_bitmap.png', wx.BITMAP_TYPE_PNG) - info.AddButton(wx.NewId(), 'New Button', bitmap) + info.AddButton(wx.ID_ANY, 'New Button', bitmap) diff --git a/wx/lib/agw/pygauge.py b/wx/lib/agw/pygauge.py index cfed7522..222db62b 100644 --- a/wx/lib/agw/pygauge.py +++ b/wx/lib/agw/pygauge.py @@ -150,7 +150,7 @@ class PyGauge(wx.Window): self._value = [0] self._valueSorted = [0] - self._timerId = wx.NewId() + self._timerId = wx.Window.NewControlId() self._timer = None self._drawIndicatorText = False diff --git a/wx/lib/agw/rulerctrl.py b/wx/lib/agw/rulerctrl.py index 0aa44ce2..a738cd3d 100644 --- a/wx/lib/agw/rulerctrl.py +++ b/wx/lib/agw/rulerctrl.py @@ -390,7 +390,7 @@ class Indicator(object): self._parent = parent if id == wx.ID_ANY: - id = wx.NewId() + id = wx.Window.NewControlId() self._id = id self._colour = None diff --git a/wx/lib/agw/toasterbox.py b/wx/lib/agw/toasterbox.py index d87ea4d9..b1e3ef68 100644 --- a/wx/lib/agw/toasterbox.py +++ b/wx/lib/agw/toasterbox.py @@ -984,7 +984,7 @@ class ToasterBoxWindow(wx.Frame): self._direction = wx.UP self.SetupPositions() self.ScrollUp() - timerid = wx.NewId() + timerid = wx.Window.NewControlId() self.showtime = wx.Timer(self, timerid) self.showtime.Start(self._pausetime) self.Bind(wx.EVT_TIMER, self.NotifyTimer, id=timerid) diff --git a/wx/lib/analogclock/analogclock.py b/wx/lib/analogclock/analogclock.py index 12b9cc3f..701d9d44 100644 --- a/wx/lib/analogclock/analogclock.py +++ b/wx/lib/analogclock/analogclock.py @@ -76,8 +76,8 @@ class AnalogClock(wx.Window): self.Setup = None # Make a context menu. - popup1 = wx.NewId() - popup2 = wx.NewId() + popup1 = wx.Window.NewControlId() + popup2 = wx.Window.NewControlId() cm = self.cm = wx.Menu() cm.Append(popup1, "Customize...") cm.Append(popup2, "About...") diff --git a/wx/lib/colourchooser/pycolourchooser.py b/wx/lib/colourchooser/pycolourchooser.py index ab1d930d..29193fb4 100644 --- a/wx/lib/colourchooser/pycolourchooser.py +++ b/wx/lib/colourchooser/pycolourchooser.py @@ -125,8 +125,8 @@ class PyColourChooser(wx.Panel): ] * NO_CUSTOM_COLOURS last_custom = 0 - idADD_CUSTOM = wx.NewId() - idSCROLL = wx.NewId() + idADD_CUSTOM = wx.Window.NewControlId() + idSCROLL = wx.Window.NewControlId() def __init__(self, parent, id): """Creates an instance of the colour chooser. Note that it is best to @@ -148,7 +148,7 @@ class PyColourChooser(wx.Panel): self.colour_boxs = [ ] colour_grid = wx.GridSizer(rows=6, cols=8, vgap=0, hgap=0) for name in self.colour_names: - new_id = wx.NewId() + new_id = wx.Window.NewControlId() box = pycolourbox.PyColourBox(self, new_id) box.GetColourBox().Bind(wx.EVT_LEFT_DOWN, lambda x, b=box: self.onBasicClick(x, b)) @@ -160,7 +160,7 @@ class PyColourChooser(wx.Panel): self.custom_boxs = [ ] custom_grid = wx.GridSizer(rows=2, cols=8, vgap=0, hgap=0) for wxcolour, slidepos in self.custom_colours: - new_id = wx.NewId() + new_id = wx.Window.NewControlId() custom = pycolourbox.PyColourBox(self, new_id) custom.GetColourBox().Bind(wx.EVT_LEFT_DOWN, lambda x, b=custom: self.onCustomClick(x, b)) diff --git a/wx/lib/filebrowsebutton.py b/wx/lib/filebrowsebutton.py index 27ef87aa..6580de8d 100644 --- a/wx/lib/filebrowsebutton.py +++ b/wx/lib/filebrowsebutton.py @@ -414,10 +414,10 @@ if __name__ == "__main__": labelText = "Simple dir browse button", style = wx.SUNKEN_BORDER|wx.CLIP_CHILDREN) innerbox.Add( control, 0, wx.EXPAND) - ID = wx.NewId() + ID = wx.Window.NewControlId() innerbox.Add( wx.Button( panel, ID,"Change Label", ), 1, wx.EXPAND) self.Bind(wx.EVT_BUTTON, self.OnChangeLabel , id=ID) - ID = wx.NewId() + ID = wx.Window.NewControlId() innerbox.Add( wx.Button( panel, ID,"Change Value", ), 1, wx.EXPAND) self.Bind(wx.EVT_BUTTON, self.OnChangeValue, id=ID ) panel.SetAutoLayout(True) diff --git a/wx/lib/foldmenu.py b/wx/lib/foldmenu.py index 0b3fe6be..8931ec51 100644 --- a/wx/lib/foldmenu.py +++ b/wx/lib/foldmenu.py @@ -23,7 +23,7 @@ class FoldOutWindow(wx.PopupWindow): self.SetBackgroundColour(faceClr) def AddButton(self,bitmap,handler=None): - id=wx.NewId() + id=wx.Window.NewControlId() btn=wx.BitmapButton(self,id,bitmap) self.sizer.Add(btn, 1, wx.ALIGN_CENTER|wx.ALL|wx.EXPAND, 2) self.Bind(wx.EVT_BUTTON, self.OnBtnClick, btn) diff --git a/wx/lib/imagebrowser.py b/wx/lib/imagebrowser.py index 98bac733..b5add72c 100644 --- a/wx/lib/imagebrowser.py +++ b/wx/lib/imagebrowser.py @@ -98,13 +98,13 @@ _ = wx.GetTranslation #--------------------------------------------------------------------------- BAD_IMAGE = -1 -ID_WHITE_BG = wx.NewId() -ID_BLACK_BG = wx.NewId() -ID_GREY_BG = wx.NewId() -ID_CHECK_BG = wx.NewId() -ID_NO_FRAME = wx.NewId() -ID_BOX_FRAME = wx.NewId() -ID_CROP_FRAME = wx.NewId() +ID_WHITE_BG = wx.Window.NewControlId() +ID_BLACK_BG = wx.Window.NewControlId() +ID_GREY_BG = wx.Window.NewControlId() +ID_CHECK_BG = wx.Window.NewControlId() +ID_NO_FRAME = wx.Window.NewControlId() +ID_BOX_FRAME = wx.Window.NewControlId() +ID_CROP_FRAME = wx.Window.NewControlId() def ConvertBMP(file_nm): """ diff --git a/wx/lib/intctrl.py b/wx/lib/intctrl.py index 08633e1a..870e62f7 100644 --- a/wx/lib/intctrl.py +++ b/wx/lib/intctrl.py @@ -942,7 +942,7 @@ if __name__ == '__main__': style = wx.DEFAULT_DIALOG_STYLE ): wx.Dialog.__init__(self, parent, id, title, pos, size, style) - self.int_ctrl = IntCtrl(self, wx.NewId(), size=(55,20)) + self.int_ctrl = IntCtrl(self, wx.ID_ANY, size=(55,20)) self.OK = wx.Button( self, wx.ID_OK, "OK") self.Cancel = wx.Button( self, wx.ID_CANCEL, "Cancel") diff --git a/wx/lib/masked/maskededit.py b/wx/lib/masked/maskededit.py index a0e05122..86bd61bc 100644 --- a/wx/lib/masked/maskededit.py +++ b/wx/lib/masked/maskededit.py @@ -6529,7 +6529,7 @@ class __test(wx.App): self.editList = [] rowcount = 4 - id, id1 = wx.NewId(), wx.NewId() + id, id1 = wx.Window.NewControlId(), wx.Window.NewControlId() self.command1 = wx.Button( self.panel, id, "&Close" ) self.command2 = wx.Button( self.panel, id1, "&AutoFormats" ) self.sizer.Add(self.command1, row=0, col=0, flag=wx.ALL, border = 5) @@ -6704,7 +6704,7 @@ To see a great example of validations in action, try entering a bad email addres self.sizer.Add( self.label3, row=3,col=1, flag=wx.ALL,border=5) self.sizer.Add( self.label4, row=3,col=2, flag=wx.ALL,border=5) - id, id1 = wx.NewId(), wx.NewId() + id, id1 = wx.Window.NewControlId(), wx.Window.NewControlId() self.command1 = wx.Button( self.panel, id, "&Close") self.command2 = wx.Button( self.panel, id1, "&Print Formats") self.panel.Bind(wx.EVT_BUTTON, self.onClick, self.command1) diff --git a/wx/lib/masked/numctrl.py b/wx/lib/masked/numctrl.py index c7051854..658639e3 100644 --- a/wx/lib/masked/numctrl.py +++ b/wx/lib/masked/numctrl.py @@ -1919,7 +1919,7 @@ if __name__ == '__main__': style = wx.DEFAULT_DIALOG_STYLE ): wx.Dialog.__init__(self, parent, id, title, pos, size, style) - self.int_ctrl = NumCtrl(self, wx.NewId(), size=(55,20)) + self.int_ctrl = NumCtrl(self, wx.ID_ANY, size=(55,20)) self.OK = wx.Button( self, wx.ID_OK, "OK") self.Cancel = wx.Button( self, wx.ID_CANCEL, "Cancel") diff --git a/wx/lib/newevent.py b/wx/lib/newevent.py index db6c7840..1fb5a73c 100644 --- a/wx/lib/newevent.py +++ b/wx/lib/newevent.py @@ -46,8 +46,8 @@ Sample usage:: time.sleep(DELAY) wx.PostEvent(win, GooEvent(id, goo=id)) - ID_CMD1 = wx.NewId() - ID_CMD2 = wx.NewId() + ID_CMD1 = wx.Window.NewControlId() + ID_CMD2 = wx.Window.NewControlId() class Frame(wx.Frame): def __init__(self): @@ -170,8 +170,8 @@ def _test(): time.sleep(DELAY) wx.PostEvent(win, GooEvent(id, goo=id)) - ID_CMD1 = wx.NewId() - ID_CMD2 = wx.NewId() + ID_CMD1 = wx.Window.NewControlId() + ID_CMD2 = wx.Window.NewControlId() class Frame(wx.Frame): def __init__(self): diff --git a/wx/lib/ogl/basic.py b/wx/lib/ogl/basic.py index 5efd08cb..d31f9b39 100644 --- a/wx/lib/ogl/basic.py +++ b/wx/lib/ogl/basic.py @@ -966,7 +966,7 @@ class Shape(ShapeEvtHandler): def AssignNewIds(self): """Assign new ids to this image and its children.""" - self._id = wx.NewId() + self._id = wx.Window.NewControlId() for child in self._children: child.AssignNewIds() diff --git a/wx/lib/ogl/composit.py b/wx/lib/ogl/composit.py index 1c3d13c2..ab7cb3ea 100644 --- a/wx/lib/ogl/composit.py +++ b/wx/lib/ogl/composit.py @@ -663,7 +663,7 @@ class CompositeShape(RectangleShape): """ self._constraints.append(constraint) if constraint._constraintId == 0: - constraint._constraintId = wx.NewId() + constraint._constraintId = wx.Window.NewControlId() return constraint def AddSimpleConstraint(self, type, constraining, constrained): @@ -677,7 +677,7 @@ class CompositeShape(RectangleShape): """ constraint = Constraint(type, constraining, constrained) if constraint._constraintId == 0: - constraint._constraintId = wx.NewId() + constraint._constraintId = wx.Window.NewControlId() self._constraints.append(constraint) return constraint diff --git a/wx/lib/ogl/lines.py b/wx/lib/ogl/lines.py index 246604ee..2503d0d0 100644 --- a/wx/lib/ogl/lines.py +++ b/wx/lib/ogl/lines.py @@ -122,7 +122,7 @@ class ArrowHead(object): self._metaFile = mf self._id = arrowId if self._id == -1: - self._id = wx.NewId() + self._id = wx.Window.NewControlId() def _GetType(self): return self._arrowType diff --git a/wx/lib/pdfviewer/__init__.py b/wx/lib/pdfviewer/__init__.py index d04d3e98..66c64fa8 100644 --- a/wx/lib/pdfviewer/__init__.py +++ b/wx/lib/pdfviewer/__init__.py @@ -59,10 +59,10 @@ Sample usage:: super(PDFViewer, self).__init__(parent, **kwds) paneCont = self.GetContentsPane() - self.buttonpanel = pdfButtonPanel(paneCont, wx.NewId(), + self.buttonpanel = pdfButtonPanel(paneCont, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, 0) self.buttonpanel.SetSizerProps(expand=True) - self.viewer = pdfViewer(paneCont, wx.NewId(), wx.DefaultPosition, + self.viewer = pdfViewer(paneCont, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.HSCROLL|wx.VSCROLL|wx.SUNKEN_BORDER) diff --git a/wx/lib/pdfviewer/buttonpanel.py b/wx/lib/pdfviewer/buttonpanel.py index 9946c275..0f829849 100644 --- a/wx/lib/pdfviewer/buttonpanel.py +++ b/wx/lib/pdfviewer/buttonpanel.py @@ -97,7 +97,7 @@ class pdfButtonPanel(bp.ButtonPanel): for item in panelitems: if item[0].lower() == 'btn': x_type, image, kind, popup, handler = item - btn = bp.ButtonInfo(self, wx.NewId(),image, kind=kind, + btn = bp.ButtonInfo(self, wx.ID_ANY,image, kind=kind, shortHelp=popup, longHelp='') self.AddButton(btn) btn.Enable(False) diff --git a/wx/lib/pydocview.py b/wx/lib/pydocview.py index f3b79230..afca0770 100644 --- a/wx/lib/pydocview.py +++ b/wx/lib/pydocview.py @@ -34,8 +34,8 @@ else: # Constants #---------------------------------------------------------------------------- -VIEW_TOOLBAR_ID = wx.NewId() -VIEW_STATUSBAR_ID = wx.NewId() +VIEW_TOOLBAR_ID = wx.Window.NewControlId() +VIEW_STATUSBAR_ID = wx.Window.NewControlId() EMBEDDED_WINDOW_TOP = 1 EMBEDDED_WINDOW_BOTTOM = 2 @@ -48,7 +48,7 @@ EMBEDDED_WINDOW_BOTTOMRIGHT = 128 EMBEDDED_WINDOW_ALL = EMBEDDED_WINDOW_TOP | EMBEDDED_WINDOW_BOTTOM | EMBEDDED_WINDOW_LEFT | EMBEDDED_WINDOW_RIGHT | \ EMBEDDED_WINDOW_TOPLEFT | EMBEDDED_WINDOW_BOTTOMLEFT | EMBEDDED_WINDOW_TOPRIGHT | EMBEDDED_WINDOW_BOTTOMRIGHT -SAVEALL_ID = wx.NewId() +SAVEALL_ID = wx.Window.NewControlId() WINDOW_MENU_NUM_ITEMS = 9 @@ -502,7 +502,7 @@ class DocMDIParentFrameMixIn: Creates the embedded window with the specified size, orientation, and alignment. If the window is not visible it will retain the size with which it was last viewed. """ - window = wx.SashLayoutWindow(parent, wx.NewId(), style = wx.NO_BORDER | wx.SW_3D) + window = wx.SashLayoutWindow(parent, wx.ID_ANY, style = wx.NO_BORDER | wx.SW_3D) window.SetDefaultSize(size) window.SetOrientation(orientation) window.SetAlignment(alignment) @@ -796,9 +796,9 @@ class DocTabbedParentFrame(wx.Frame, DocFrameMixIn, DocMDIParentFrameMixIn): Creates the notebook to use for the tabbed document interface. """ if wx.Platform != "__WXMAC__": - self._notebook = wx.Notebook(self, wx.NewId()) + self._notebook = wx.Notebook(self, wx.ID_ANY) else: - self._notebook = wx.Listbook(self, wx.NewId(), style=wx.LB_LEFT) + self._notebook = wx.Listbook(self, wx.ID_ANY, style=wx.LB_LEFT) # self._notebook.SetSizer(wx.NotebookSizer(self._notebook)) if wx.Platform != "__WXMAC__": wx.EVT_NOTEBOOK_PAGE_CHANGED(self, self._notebook.GetId(), self.OnNotebookPageChanged) @@ -899,13 +899,13 @@ class DocTabbedParentFrame(wx.Frame, DocFrameMixIn, DocMDIParentFrameMixIn): x, y = event.GetX(), event.GetY() if index > -1: doc = self._notebook.GetPage(index).GetView().GetDocument() - id = wx.NewId() + id = wx.Window.NewControlId() menu.Append(id, _("Close")) def OnRightMenuSelect(event): doc.DeleteAllViews() wx.EVT_MENU(self, id, OnRightMenuSelect) if self._notebook.GetPageCount() > 1: - id = wx.NewId() + id = wx.Window.NewControlId() menu.Append(id, _("Close All but \"%s\"" % doc.GetPrintableName())) def OnRightMenuSelect(event): for i in range(self._notebook.GetPageCount()-1, -1, -1): # Go from len-1 to 0 @@ -916,7 +916,7 @@ class DocTabbedParentFrame(wx.Frame, DocFrameMixIn, DocMDIParentFrameMixIn): wx.EVT_MENU(self, id, OnRightMenuSelect) menu.AppendSeparator() tabsMenu = wx.Menu() - menu.AppendMenu(wx.NewId(), _("Select Tab"), tabsMenu) + menu.AppendMenu(wx.ID_ANY, _("Select Tab"), tabsMenu) else: y = y - 25 # wxBug: It is offsetting click events in the blank notebook area tabsMenu = menu @@ -924,7 +924,7 @@ class DocTabbedParentFrame(wx.Frame, DocFrameMixIn, DocMDIParentFrameMixIn): if self._notebook.GetPageCount() > 1: selectIDs = {} for i in range(0, self._notebook.GetPageCount()): - id = wx.NewId() + id = wx.Window.NewControlId() selectIDs[id] = i tabsMenu.Append(id, self._notebook.GetPageText(i)) def OnRightMenuSelect(event): @@ -1497,9 +1497,9 @@ class OptionsDialog(wx.Dialog): sizer = wx.BoxSizer(wx.VERTICAL) if wx.Platform == "__WXMAC__": - optionsNotebook = wx.Listbook(self, wx.NewId(), style=wx.LB_DEFAULT) + optionsNotebook = wx.Listbook(self, wx.ID_ANY, style=wx.LB_DEFAULT) else: - optionsNotebook = wx.Notebook(self, wx.NewId(), style=wx.NB_MULTILINE) # NB_MULTILINE is windows platform only + optionsNotebook = wx.Notebook(self, wx.ID_ANY, style=wx.NB_MULTILINE) # NB_MULTILINE is windows platform only sizer.Add(optionsNotebook, 0, wx.ALL | wx.EXPAND, SPACE) if wx.Platform == "__WXMAC__": @@ -2542,7 +2542,7 @@ class FilePropertiesService(DocService): with the current document. """ - PROPERTIES_ID = wx.NewId() + PROPERTIES_ID = wx.Window.NewControlId() def __init__(self): @@ -2851,11 +2851,11 @@ class WindowMenuService(DocService): #---------------------------------------------------------------------------- # Constants #---------------------------------------------------------------------------- - ARRANGE_WINDOWS_ID = wx.NewId() - SELECT_MORE_WINDOWS_ID = wx.NewId() - SELECT_NEXT_WINDOW_ID = wx.NewId() - SELECT_PREV_WINDOW_ID = wx.NewId() - CLOSE_CURRENT_WINDOW_ID = wx.NewId() + ARRANGE_WINDOWS_ID = wx.Window.NewControlId() + SELECT_MORE_WINDOWS_ID = wx.Window.NewControlId() + SELECT_NEXT_WINDOW_ID = wx.Window.NewControlId() + SELECT_PREV_WINDOW_ID = wx.Window.NewControlId() + CLOSE_CURRENT_WINDOW_ID = wx.Window.NewControlId() def __init__(self): @@ -2864,7 +2864,7 @@ class WindowMenuService(DocService): """ self._selectWinIds = [] for i in range(0, 9): - self._selectWinIds.append(wx.NewId()) + self._selectWinIds.append(wx.Window.NewControlId()) def InstallControls(self, frame, menuBar=None, toolBar=None, statusBar=None, document=None): @@ -3056,7 +3056,7 @@ class WindowMenuService(DocService): if numPages > len(self._selectWinIds): for i in range(len(self._selectWinIds), numPages): - self._selectWinIds.append(wx.NewId()) + self._selectWinIds.append(wx.Window.NewControlId()) wx.EVT_MENU(currentFrame, self._selectWinIds[i], self.OnCtrlKeySelect) for i in range(0, numPages): diff --git a/wx/lib/throbber.py b/wx/lib/throbber.py index 41384ffc..a29c2b66 100644 --- a/wx/lib/throbber.py +++ b/wx/lib/throbber.py @@ -151,7 +151,7 @@ class Throbber(wx.Panel): self.SetClientSize((width, height)) - timerID = wx.NewId() + timerID = wx.Window.NewControlId() self.timer = wx.Timer(self, timerID) self.Bind(EVT_UPDATE_THROBBER, self.Update) diff --git a/wx/py/frame.py b/wx/py/frame.py index e93ab37f..85e7d554 100644 --- a/wx/py/frame.py +++ b/wx/py/frame.py @@ -23,42 +23,42 @@ ID_COPY = wx.ID_COPY ID_PASTE = wx.ID_PASTE ID_CLEAR = wx.ID_CLEAR ID_SELECTALL = wx.ID_SELECTALL -ID_EMPTYBUFFER = wx.NewId() +ID_EMPTYBUFFER = wx.Window.NewControlId() ID_ABOUT = wx.ID_ABOUT -ID_HELP = wx.NewId() -ID_AUTOCOMP = wx.NewId() -ID_AUTOCOMP_SHOW = wx.NewId() -ID_AUTOCOMP_MAGIC = wx.NewId() -ID_AUTOCOMP_SINGLE = wx.NewId() -ID_AUTOCOMP_DOUBLE = wx.NewId() -ID_CALLTIPS = wx.NewId() -ID_CALLTIPS_SHOW = wx.NewId() -ID_CALLTIPS_INSERT = wx.NewId() -ID_COPY_PLUS = wx.NewId() -ID_NAMESPACE = wx.NewId() -ID_PASTE_PLUS = wx.NewId() -ID_WRAP = wx.NewId() -ID_TOGGLE_MAXIMIZE = wx.NewId() -ID_SHOW_LINENUMBERS = wx.NewId() -ID_ENABLESHELLMODE = wx.NewId() -ID_ENABLEAUTOSYMPY = wx.NewId() -ID_AUTO_SAVESETTINGS = wx.NewId() -ID_SAVEACOPY = wx.NewId() -ID_SAVEHISTORY = wx.NewId() -ID_SAVEHISTORYNOW = wx.NewId() -ID_CLEARHISTORY = wx.NewId() -ID_SAVESETTINGS = wx.NewId() -ID_DELSETTINGSFILE = wx.NewId() -ID_EDITSTARTUPSCRIPT = wx.NewId() -ID_EXECSTARTUPSCRIPT = wx.NewId() -ID_SHOWPYSLICESTUTORIAL = wx.NewId() -ID_STARTUP = wx.NewId() -ID_SETTINGS = wx.NewId() +ID_HELP = wx.Window.NewControlId() +ID_AUTOCOMP = wx.Window.NewControlId() +ID_AUTOCOMP_SHOW = wx.Window.NewControlId() +ID_AUTOCOMP_MAGIC = wx.Window.NewControlId() +ID_AUTOCOMP_SINGLE = wx.Window.NewControlId() +ID_AUTOCOMP_DOUBLE = wx.Window.NewControlId() +ID_CALLTIPS = wx.Window.NewControlId() +ID_CALLTIPS_SHOW = wx.Window.NewControlId() +ID_CALLTIPS_INSERT = wx.Window.NewControlId() +ID_COPY_PLUS = wx.Window.NewControlId() +ID_NAMESPACE = wx.Window.NewControlId() +ID_PASTE_PLUS = wx.Window.NewControlId() +ID_WRAP = wx.Window.NewControlId() +ID_TOGGLE_MAXIMIZE = wx.Window.NewControlId() +ID_SHOW_LINENUMBERS = wx.Window.NewControlId() +ID_ENABLESHELLMODE = wx.Window.NewControlId() +ID_ENABLEAUTOSYMPY = wx.Window.NewControlId() +ID_AUTO_SAVESETTINGS = wx.Window.NewControlId() +ID_SAVEACOPY = wx.Window.NewControlId() +ID_SAVEHISTORY = wx.Window.NewControlId() +ID_SAVEHISTORYNOW = wx.Window.NewControlId() +ID_CLEARHISTORY = wx.Window.NewControlId() +ID_SAVESETTINGS = wx.Window.NewControlId() +ID_DELSETTINGSFILE = wx.Window.NewControlId() +ID_EDITSTARTUPSCRIPT = wx.Window.NewControlId() +ID_EXECSTARTUPSCRIPT = wx.Window.NewControlId() +ID_SHOWPYSLICESTUTORIAL = wx.Window.NewControlId() +ID_STARTUP = wx.Window.NewControlId() +ID_SETTINGS = wx.Window.NewControlId() ID_FIND = wx.ID_FIND -ID_FINDNEXT = wx.NewId() -ID_FINDPREVIOUS = wx.NewId() -ID_SHOWTOOLS = wx.NewId() -ID_HIDEFOLDINGMARGIN = wx.NewId() +ID_FINDNEXT = wx.Window.NewControlId() +ID_FINDPREVIOUS = wx.Window.NewControlId() +ID_SHOWTOOLS = wx.Window.NewControlId() +ID_HIDEFOLDINGMARGIN = wx.Window.NewControlId() diff --git a/wx/py/shell.py b/wx/py/shell.py index 9490347e..8c58cc7d 100755 --- a/wx/py/shell.py +++ b/wx/py/shell.py @@ -318,13 +318,13 @@ class Shell(editwindow.EditWindow): self.ID_UNDO = wx.ID_UNDO self.ID_REDO = wx.ID_REDO else: - self.ID_CUT = wx.NewId() - self.ID_COPY = wx.NewId() - self.ID_PASTE = wx.NewId() - self.ID_SELECTALL = wx.NewId() - self.ID_CLEAR = wx.NewId() - self.ID_UNDO = wx.NewId() - self.ID_REDO = wx.NewId() + self.ID_CUT = wx.Window.NewControlId() + self.ID_COPY = wx.Window.NewControlId() + self.ID_PASTE = wx.Window.NewControlId() + self.ID_SELECTALL = wx.Window.NewControlId() + self.ID_CLEAR = wx.Window.NewControlId() + self.ID_UNDO = wx.Window.NewControlId() + self.ID_REDO = wx.Window.NewControlId() # Assign handlers for edit events self.Bind(wx.EVT_MENU, lambda evt: self.Cut(), id=self.ID_CUT) diff --git a/wx/py/sliceshell.py b/wx/py/sliceshell.py index 2060fa4d..618d2e42 100755 --- a/wx/py/sliceshell.py +++ b/wx/py/sliceshell.py @@ -813,13 +813,13 @@ class SlicesShell(editwindow.EditWindow): self.ID_UNDO = wx.ID_UNDO self.ID_REDO = wx.ID_REDO else: - self.ID_CUT = wx.NewId() - self.ID_COPY = wx.NewId() - self.ID_PASTE = wx.NewId() - self.ID_SELECTALL = wx.NewId() - self.ID_CLEAR = wx.NewId() - self.ID_UNDO = wx.NewId() - self.ID_REDO = wx.NewId() + self.ID_CUT = wx.Window.NewControlId() + self.ID_COPY = wx.Window.NewControlId() + self.ID_PASTE = wx.Window.NewControlId() + self.ID_SELECTALL = wx.Window.NewControlId() + self.ID_CLEAR = wx.Window.NewControlId() + self.ID_UNDO = wx.Window.NewControlId() + self.ID_REDO = wx.Window.NewControlId() # Assign handlers for edit events self.Bind(wx.EVT_MENU, lambda evt: self.Cut(), id=self.ID_CUT)