controls/DebugVariablePanel/DebugVariableViewer.py
changeset 1847 6198190bc121
parent 1841 9fd29e8b1393
child 1850 614396cbffbf
equal deleted inserted replaced
1846:14b40afccd69 1847:6198190bc121
   246     def RefreshButtonsPosition(self):
   246     def RefreshButtonsPosition(self):
   247         """
   247         """
   248         Function that refresh buttons position in Viewer
   248         Function that refresh buttons position in Viewer
   249         """
   249         """
   250         # Get Viewer size
   250         # Get Viewer size
   251         width, height = self.GetSize()
   251         width, _height = self.GetSize()
   252 
   252 
   253         # Buttons are align right so we calculate buttons positions in
   253         # Buttons are align right so we calculate buttons positions in
   254         # reverse order
   254         # reverse order
   255         buttons = self.Buttons[:]
   255         buttons = self.Buttons[:]
   256         buttons.reverse()
   256         buttons.reverse()
   260         for button in buttons:
   260         for button in buttons:
   261             # Buttons are stacked right, removing those that are not active
   261             # Buttons are stacked right, removing those that are not active
   262             if button.IsEnabled():
   262             if button.IsEnabled():
   263                 # Update button position according to button width and offset
   263                 # Update button position according to button width and offset
   264                 # on x coordinate
   264                 # on x coordinate
   265                 w, h = button.GetSize()
   265                 w, _h = button.GetSize()
   266                 button.SetPosition(width - 5 - w - x_offset, 5)
   266                 button.SetPosition(width - 5 - w - x_offset, 5)
   267                 # Update offset on x coordinate
   267                 # Update offset on x coordinate
   268                 x_offset += w + 2
   268                 x_offset += w + 2
   269 
   269 
   270     def DrawCommonElements(self, dc, buttons=None):
   270     def DrawCommonElements(self, dc, buttons=None):
   370         highlight according to mouse position
   370         highlight according to mouse position
   371         @param x: X coordinate of mouse pointer
   371         @param x: X coordinate of mouse pointer
   372         @param y: Y coordinate of mouse pointer
   372         @param y: Y coordinate of mouse pointer
   373         """
   373         """
   374         # Get Viewer size
   374         # Get Viewer size
   375         width, height = self.GetSize()
   375         _width, height = self.GetSize()
   376 
   376 
   377         # Mouse is in the first half of Viewer
   377         # Mouse is in the first half of Viewer
   378         if y < height / 2:
   378         if y < height / 2:
   379             # If Viewer is the upper one, draw drop before highlight
   379             # If Viewer is the upper one, draw drop before highlight
   380             if self.ParentWindow.IsViewerFirst(self):
   380             if self.ParentWindow.IsViewerFirst(self):