From a8437202438c96e39d919904ab126f856037efc1 Mon Sep 17 00:00:00 2001 From: soltanoff Date: Sun, 5 Feb 2023 18:46:58 +0300 Subject: [PATCH] wxPython packages updates: v4.2.0 --- snakerunner/listviews.py | 2 +- snakerunner/snakerunner.py | 23 ++++++++++------------- snakerunner/squaremap.py | 12 ++++++------ snakerunner/version.py | 2 +- 4 files changed, 18 insertions(+), 21 deletions(-) diff --git a/snakerunner/listviews.py b/snakerunner/listviews.py index 3db1acc..c892293 100644 --- a/snakerunner/listviews.py +++ b/snakerunner/listviews.py @@ -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): diff --git a/snakerunner/snakerunner.py b/snakerunner/snakerunner.py index 2e63688..0d0d447 100755 --- a/snakerunner/snakerunner.py +++ b/snakerunner/snakerunner.py @@ -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( @@ -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() diff --git a/snakerunner/squaremap.py b/snakerunner/squaremap.py index 46c5fc8..0625d92 100755 --- a/snakerunner/squaremap.py +++ b/snakerunner/squaremap.py @@ -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): @@ -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( @@ -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(): @@ -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() diff --git a/snakerunner/version.py b/snakerunner/version.py index f593cd5..a33997d 100644 --- a/snakerunner/version.py +++ b/snakerunner/version.py @@ -1 +1 @@ -__version__ = '2.0.4' +__version__ = '2.1.0'