From f2d130ffc03b233ab0a09f7bfa89a854f4ada83a Mon Sep 17 00:00:00 2001 From: Andrea Gavana Date: Wed, 27 Mar 2013 21:25:20 +0000 Subject: [PATCH] AGW on Phoenix: restore support for `HTMLListBox` and `SimpleHTMLListBox` in `persist_handlers.py`. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@73727 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wx/lib/agw/persist/persist_handlers.py | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/wx/lib/agw/persist/persist_handlers.py b/wx/lib/agw/persist/persist_handlers.py index 049b385e..7f078f14 100644 --- a/wx/lib/agw/persist/persist_handlers.py +++ b/wx/lib/agw/persist/persist_handlers.py @@ -534,13 +534,12 @@ class ListBoxHandler(AbstractHandler): indices = [] - # Not wrapped yet? - # if isinstance(listBox, (wx.HtmlListBox, wx.SimpleHtmlListBox)): - # if listBox.GetSelectedCount() == 0: - # return indices - # else: - if listBox.GetSelectedItemCount() == 0: - return indices + if isinstance(listBox, (wx.HtmlListBox, wx.SimpleHtmlListBox)): + if listBox.GetSelectedCount() == 0: + return indices + else: + if listBox.GetSelectedItemCount() == 0: + return indices isVirtual = issubclass(listBox.__class__, wx.VListBox) @@ -607,9 +606,8 @@ class ListBoxHandler(AbstractHandler): isVirtual = issubclass(listBox.__class__, wx.VListBox) or isinstance(listBox, wx.CheckListBox) - # Not wrapped yet? - # isHtml = isinstance(listBox, wx.HtmlListBox) - if isVirtual: # and not isHtml: + isHtml = isinstance(listBox, wx.HtmlListBox) + if isVirtual and not isHtml: count = listBox.GetCount() else: count = listBox.GetItemCount() @@ -2509,7 +2507,7 @@ HANDLERS = [ ("TreeCtrlHandler", (wx.TreeCtrl, wx.GenericDirCtrl, CT.CustomTreeCtrl)), ("MenuBarHandler", (wx.MenuBar, FM.FlatMenuBar)), ("ToolBarHandler", (AUI.AuiToolBar, )), - ("ListBoxHandler", (wx.ListBox, wx.VListBox, # not wrapped yet?? wx.HtmlListBox, wx.SimpleHtmlListBox, + ("ListBoxHandler", (wx.ListBox, wx.VListBox, wx.HtmlListBox, wx.SimpleHtmlListBox, wx.adv.EditableListBox)), ("ListCtrlHandler", (wx.ListCtrl, wx.ListView)), #ULC.UltimateListCtrl (later) ("ChoiceComboHandler", (wx.Choice, wx.ComboBox, wx.adv.OwnerDrawnComboBox)),