Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.52 KB | None | 0 0
  1. import wx
  2.  
  3. from application.gui.ctrls.panelCalibration.PanelGridCalibration import PanelGridCalibration
  4. from lib.common.dataStructures.Value import ExpressionValue
  5.  
  6.  
  7. class PanelValueCalibration(PanelGridCalibration):
  8. def __init__(self, parent, defaultValues, changeableSize=False):
  9. PanelGridCalibration.__init__(self, parent, defaultValues, False)
  10. self.grid.SetRowLabelSize(0)
  11. self.grid.SetColLabelSize(0)
  12. self.grid.SetDimension(1, 1)
  13. self.grid.Unbind(wx.grid.EVT_GRID_CELL_RIGHT_CLICK)
  14. wx.CallAfter(self.ExpandCell)
  15.  
  16. self.DisableWriteByVariable()
  17.  
  18. def ExpandCell(self):
  19. self.grid.SetColSize(0, self.grid.GetClientSize().x - 20)
  20.  
  21. def SetDefaultValues(self, defaultValue):
  22. pass
  23. #self.grid.GetTable().SetDefaultValue(0, 0, defaultValue)
  24.  
  25. def SetValues(self, value):
  26. self.grid.GetTable().SetValue(0, 0, value.GetValue())
  27.  
  28. def OnGridDimensionChanged(self, oldDimension, newDimension):
  29. pass
  30.  
  31. def GetValues(self):
  32. return ExpressionValue(self.grid.GetCellValue(0, 0))
  33.  
  34. def CheckInput(self):
  35. if self.GetValues().GetValue() == None:
  36. self.ShowErrorDialog(_(u"Kein Wert zum Schreiben angegeben!"))
  37. return False
  38. return True
  39.  
  40. from application.gui.ctrls.ExpressionCtrls import ExpressionTextCtrl
  41.  
  42. class PanelValueCalibration(ExpressionTextCtrl):
  43. def __init__(self, parent, defaultValues, changeableSize=False):
  44. ExpressionTextCtrl.__init__(self, parent, defaultValues, False)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement