Skip to content

Commit

Permalink
wxPython packages updates: v4.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
soltanoff committed Feb 6, 2023
1 parent 912ace0 commit a843720
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 21 deletions.
2 changes: 1 addition & 1 deletion snakerunner/listviews.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ def integrateRecords(self, functions):
self.reorder()
self.Refresh()

indicated_attribute = wx.ListItemAttr()
indicated_attribute = wx.ItemAttr()
indicated_attribute.SetBackgroundColour('#00ff00')

def OnGetItemAttr(self, item):
Expand Down
23 changes: 10 additions & 13 deletions snakerunner/snakerunner.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,18 @@

log = logging.getLogger(__name__)

ID_OPEN = wx.NewId()
ID_EXIT = wx.NewId()
ID_OPEN = wx.NewIdRef(count=1)
ID_EXIT = wx.NewIdRef(count=1)

ID_TREE_TYPE = wx.NewId()
ID_TREE_TYPE = wx.NewIdRef(count=1)

#ID_PACKAGE_VIEW = wx.NewId()

ID_PERCENTAGE_VIEW = wx.NewId()
ID_ROOT_VIEW = wx.NewId()
ID_BACK_VIEW = wx.NewId()
ID_UP_VIEW = wx.NewId()
ID_DEEPER_VIEW = wx.NewId()
ID_SHALLOWER_VIEW = wx.NewId()
ID_MORE_SQUARE = wx.NewId()
ID_PERCENTAGE_VIEW = wx.NewIdRef(count=1)
ID_ROOT_VIEW = wx.NewIdRef(count=1)
ID_BACK_VIEW = wx.NewIdRef(count=1)
ID_UP_VIEW = wx.NewIdRef(count=1)
ID_DEEPER_VIEW = wx.NewIdRef(count=1)
ID_SHALLOWER_VIEW = wx.NewIdRef(count=1)
ID_MORE_SQUARE = wx.NewIdRef(count=1)

PROFILE_VIEW_COLUMNS = [
listviews.ColumnDefinition(
Expand Down Expand Up @@ -214,7 +212,6 @@ def CreateControls(self, config_parser):
self.tabs.AddPage(self.callerListControl, _('Callers'), False)
self.tabs.AddPage(self.allCallerListControl, _('All Callers'), False)
self.tabs.AddPage(self.sourceCodeControl, _('Source Code'), False)
self.rightSplitter.SetSashSize(10)
# calculate size as proportional value for initial display...
self.LoadState(config_parser)
width, height = self.GetSize()
Expand Down
12 changes: 6 additions & 6 deletions snakerunner/squaremap.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ def FontForLabels(self, dc):
''' Return the default GUI font, scaled for printing if necessary. '''
font = wx.SystemSettings.GetFont(wx.SYS_DEFAULT_GUI_FONT)
scale = dc.GetPPI()[0] / wx.ScreenDC().GetPPI()[0]
font.SetPointSize(scale*font.GetPointSize())
font.SetPointSize(int(scale)*font.GetPointSize())
return font

def BrushForNode(self, node, depth=0):
Expand Down Expand Up @@ -318,11 +318,11 @@ def DrawBox(self, dc, node, x, y, w, h, hot_map, depth=0):
if sys.platform == 'darwin':
# Macs don't like drawing small rounded rects...
if w < self.padding*2 or h < self.padding*2:
dc.DrawRectangle(dx, dy, dw, dh)
dc.DrawRectangle(int(dx), int(dy), int(dw), int(dh))
else:
dc.DrawRoundedRectangle(dx, dy, dw, dh, self.padding)
dc.DrawRoundedRectangle(int(dx), int(dy), int(dw), int(dh), float(self.padding))
else:
dc.DrawRoundedRectangle(dx, dy, dw, dh, self.padding*3)
dc.DrawRoundedRectangle(int(dx), int(dy), int(dw), int(dh), float(self.padding*3))
# self.DrawIconAndLabel(dc, node, x, y, w, h, depth)
children_hot_map = []
hot_map.append(
Expand Down Expand Up @@ -363,7 +363,7 @@ def DrawIconAndLabel(self, dc, node, x, y, w, h, depth):
''' Draw the icon, if any, and the label, if any, of the node. '''
if w-2 < self._em_size_//2 or h-2 < self._em_size_ // 2:
return
dc.SetClippingRegion(x+1, y+1, w-2, h-2) # Don't draw outside the box
dc.SetClippingRegion(int(x+1), int(y+1), int(w-2), int(h-2)) # Don't draw outside the box
try:
icon = self.adapter.icon(node, node == self.selectedNode)
if icon and h >= icon.GetHeight() and w >= icon.GetWidth():
Expand All @@ -373,7 +373,7 @@ def DrawIconAndLabel(self, dc, node, x, y, w, h, depth):
iconWidth = 0
if self.labels and h >= dc.GetTextExtent('ABC')[1]:
dc.SetTextForeground(self.TextForegroundForNode(node, depth))
dc.DrawText(self.adapter.label(node), x + iconWidth + 2, y+2)
dc.DrawText(self.adapter.label(node), int(x + iconWidth + 2), int(y+2))
finally:
dc.DestroyClippingRegion()

Expand Down
2 changes: 1 addition & 1 deletion snakerunner/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '2.0.4'
__version__ = '2.1.0'

0 comments on commit a843720

Please sign in to comment.