Permalink
Browse files

Merge pull request #1087 from cbeytas/master

Fix bugs in CustomTreeCtrl and HyperTreeList
(cherry picked from commit e5d2407)
  • Loading branch information...
RobinD42 committed Nov 30, 2018
1 parent 46b81b9 commit 1c085eea1e9f06cc0ad896cc95deb3bd3bd3f6c9
Showing with 451 additions and 183 deletions.
  1. +5 −4 demo/agw/CustomTreeCtrl.py
  2. +26 −4 demo/agw/HyperTreeList.py
  3. +286 −141 wx/lib/agw/customtreectrl.py
  4. +134 −34 wx/lib/agw/hypertreelist.py
@@ -726,7 +726,7 @@ def GetBitmap(self, input, which):
bmp = images.Smiles.GetBitmap()
else:
bmp = wx.ArtProvider.GetBitmap(eval(ArtIDs[input]), wx.ART_OTHER, (16,16))
if not bmp.Ok():
if not bmp.IsOk():
bmp = wx.Bitmap(16,16)
self.ClearBmp(bmp)
@@ -746,7 +746,7 @@ def GetBitmaps(self, bitmaps):
bmp = images.Smiles.GetBitmap()
else:
bmp = wx.ArtProvider.GetBitmap(eval(ArtIDs[input+1]), wx.ART_OTHER, (16,16))
if not bmp.Ok():
if not bmp.IsOk():
bmp = wx.Bitmap(16,16)
self.ClearBmp(bmp)
@@ -2088,9 +2088,10 @@ def OnHyperLink(self, event):
def OnTextCtrl(self, event):
char = chr(event.GetKeyCode())
keycode = event.GetKeyCode()
char = chr(keycode) if keycode < 256 else ''
self.log.write("EDITING THE TEXTCTRL: You Wrote '" + char + \
"' (KeyCode = " + str(event.GetKeyCode()) + ")\n")
"' (KeyCode = " + str(keycode) + ")\n")
event.Skip()
@@ -825,7 +825,7 @@ def GetBitmap(self, input, which):
bmp = GetSmilesBitmap()
else:
bmp = wx.ArtProvider.GetBitmap(eval(ArtIDs[input]), wx.ART_OTHER, (16,16))
if not bmp.Ok():
if not bmp.IsOk():
bmp = wx.Bitmap(16,16)
self.ClearBmp(bmp)
@@ -845,7 +845,7 @@ def GetBitmaps(self, bitmaps):
bmp = GetSmilesBitmap()
else:
bmp = wx.ArtProvider.GetBitmap(eval(ArtIDs[input+1]), wx.ART_OTHER, (16,16))
if not bmp.Ok():
if not bmp.IsOk():
bmp = wx.Bitmap(16,16)
self.ClearBmp(bmp)
@@ -2061,6 +2061,9 @@ def OnRightUp(self, event):
item7 = menu.Append(wx.ID_ANY, "Disable Item")
menu.AppendSeparator()
item14 = menu.Append(wx.ID_ANY, "Hide Item")
item15 = menu.Append(wx.ID_ANY, "Unhide All Items")
menu.AppendSeparator()
item8 = menu.Append(wx.ID_ANY, "Change Item Icons")
menu.AppendSeparator()
@@ -2084,6 +2087,8 @@ def OnRightUp(self, event):
self.Bind(wx.EVT_MENU, self.OnItemPrepend, item11)
self.Bind(wx.EVT_MENU, self.OnItemAppend, item12)
self.Bind(wx.EVT_MENU, self.OnItemBackground, item13)
self.Bind(wx.EVT_MENU, self.OnHideItem, item14)
self.Bind(wx.EVT_MENU, self.OnUnhideItems, item15)
self.PopupMenu(menu)
menu.Destroy()
@@ -2145,6 +2150,22 @@ def OnDisableItem(self, event):
event.Skip()
def OnHideItem(self, event):
self.HideItem(self.current)
event.Skip()
def OnUnhideItems(self, event):
item = self.GetRootItem()
while item:
if item.IsHidden():
self.HideItem(item, False)
item = self.GetNext(item)
event.Skip()
def OnItemIcons(self, event):
bitmaps = [self.itemdict["normal"], self.itemdict["selected"],
@@ -2476,9 +2497,10 @@ def OnHyperLink(self, event):
def OnTextCtrl(self, event):
char = chr(event.GetKeyCode())
keycode = event.GetKeyCode()
char = chr(keycode) if keycode < 256 else ''
self.log.write("EDITING THE TEXTCTRL: You Wrote '" + char + \
"' (KeyCode = " + str(event.GetKeyCode()) + ")\n")
"' (KeyCode = " + str(keycode) + ")\n")
event.Skip()
Oops, something went wrong.

0 comments on commit 1c085ee

Please sign in to comment.