Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions DiagramConstantsDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
# DiagramConstantsDialog.py --- Dialog to define constantes in a diagram.
# --------------------------------
# Copyright (c) 2020
# L. CAPOCCHI (capocchi@univ-corse.fr)
# SPE Lab - SISU Group - University of Corsica
# L. CAPOCCHI (capocchi@univ-corse.fr)
# SPE Lab - University of Corsica
# --------------------------------
# Version 1.0 last modified: 08/11/20
## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
# Version 1.0 last modified: 10/30/21
# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
#
# GENERAL NOTES AND REMARKS:
#
Expand Down Expand Up @@ -80,20 +80,20 @@ def InitUI(self):

tb.Realize()

self._grid = wx.grid.Grid(panel)
self._grid = wx.grid.Grid(panel, size=(300,200))
self._grid.AutoSizeColumns(True)
self._grid.CreateGrid(1, 2)
self._grid.SetColLabelValue(0, _("Name"))
self._grid.SetColSize(0, 200)
self._grid.SetColSize(0, 150)
self._grid.SetColLabelValue(1, _("Value"))
self._grid.SetColSize(1, 200)
self._grid.SetColSize(1, 150)

### label column is not visible
self._grid.SetRowLabelSize(0)

vbox.Add(self._grid, 1, wx.EXPAND|wx.ALL,0)

vbox.Add((-1, 15))
vbox.Add((-1, 5))

self._button_ok = wx.Button(panel, wx.ID_OK, size=(70, 30))
self._button_cancel = wx.Button(panel, wx.ID_CANCEL, size=(70, 30))
Expand All @@ -102,7 +102,7 @@ def InitUI(self):
hbox.Add(self._button_cancel)
hbox.Add(self._button_ok, flag=wx.LEFT|wx.BOTTOM, border=5)

vbox.Add(hbox, 0, flag=wx.EXPAND, border=10)
vbox.Add(hbox, 0, flag=wx.CENTER, border=5)

# From http://docs.wxwidgets.org/trunk/overview_windowsizing.html, wxWidgets provides two main methods for sizing:
#
Expand Down
47 changes: 24 additions & 23 deletions PlotGUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -920,6 +920,7 @@ def __init__(self, parent=None, id=wx.NewIdRef(), title="", atomicModel=None, xL
PlotFrame.__init__(self, parent, id, title)

# local copy
self.parent = parent
self.atomicModel = atomicModel
self.xLabel = xLabel
self.yLabel = yLabel
Expand Down Expand Up @@ -949,21 +950,21 @@ def __init__(self, parent=None, id=wx.NewIdRef(), title="", atomicModel=None, xL
self.Bind(wx.EVT_MENU, self.OnPlotSpectrum, menu.Append(wx.NewIdRef(), _('Signal %s')%str(self.iport), _('Spectrum Plot')))
self.mainmenu.Append(menu, _('&Spectrum'))

# self.timer = wx.Timer(self)
self.timer = wx.Timer(self)
### DEFAULT_PLOT_DYN_FREQ can be configured in preference-> simulation
# self.timer.Start(milliseconds=DEFAULT_PLOT_DYN_FREQ)
self.timer.Start(milliseconds=DEFAULT_PLOT_DYN_FREQ)

# self.Bind(wx.EVT_TIMER, self.OnTimerEvent)
# self.Bind(wx.EVT_PAINT, getattr(self, "On%s"%self.type))
self.Bind(wx.EVT_TIMER, self.OnPlotRedraw)
#self.Bind(wx.EVT_TIMER, self.OnTimerEvent)
#self.Bind(wx.EVT_PAINT, getattr(self, "On%s"%self.type))
self.Bind(wx.EVT_CLOSE, self.OnQuit)

getattr(self, "On%s"%self.type)()

def OnTimerEvent(self, event):
pass

#self.GetEventHandler().ProcessEvent(wx.PaintEvent())

self.OnPlotRedraw(event)

def Normalize(self, data):
m = max(a[1] for a in data)
return [(b[0], b[1]/m) for b in data]
Expand All @@ -975,10 +976,10 @@ def OnPlotLine(self, event=None)->None:
#if self.timer.IsRunning():
### unbinding paint event

if self.type != "PlotLine":
self.type = "PlotLine"
self.Unbind(wx.EVT_PAINT)
self.Bind(wx.EVT_PAINT, getattr(self, "On%s"%self.type))
# if self.type != "PlotLine":
# self.type = "PlotLine"
# self.Unbind(wx.EVT_PAINT)
# self.Bind(wx.EVT_PAINT, getattr(self, "On%s"%self.type))

### without fusion
if self.iport is not None:
Expand Down Expand Up @@ -1036,10 +1037,10 @@ def OnPlotSquare(self, event):

#if self.timer.IsRunning():
### unbinding paint event
if self.type != "PlotSquare":
self.type = "PlotSquare"
self.Unbind(wx.EVT_PAINT)
self.Bind(wx.EVT_PAINT, getattr(self, "On%s"%self.type))
# if self.type != "PlotSquare":
# self.type = "PlotSquare"
# self.Unbind(wx.EVT_PAINT)
# self.Bind(wx.EVT_PAINT, getattr(self, "On%s"%self.type))

## without fusion
if self.iport is not None:
Expand Down Expand Up @@ -1120,10 +1121,10 @@ def OnPlotScatter(self, event):

#if self.timer.IsRunning():
### unbinding paint event
if self.type != "PlotScatter":
self.type = "PlotScatter"
self.Unbind(wx.EVT_PAINT)
self.Bind(wx.EVT_PAINT, getattr(self, "On%s"%self.type))
# if self.type != "PlotScatter":
# self.type = "PlotScatter"
# self.Unbind(wx.EVT_PAINT)
# self.Bind(wx.EVT_PAINT, getattr(self, "On%s"%self.type))

## sans fusion
if self.iport is not None:
Expand Down Expand Up @@ -1192,10 +1193,10 @@ def OnPlotBar(self,event):

#if self.timer.IsRunning():
### unbinding paint event
if self.type != "PlotBar":
self.type = "PlotBar"
self.Unbind(wx.EVT_PAINT)
self.Bind(wx.EVT_PAINT, getattr(self, "On%s"%self.type))
# if self.type != "PlotBar":
# self.type = "PlotBar"
# self.Unbind(wx.EVT_PAINT)
# self.Bind(wx.EVT_PAINT, getattr(self, "On%s"%self.type))

## sans fusion
if self.iport is not None:
Expand Down
3 changes: 2 additions & 1 deletion PrintOut.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,10 @@ def PrintPreview(self, event):
printout2 = Printout(c)

self.preview = wx.PrintPreview(printout, printout2, data)
self.preview.SetZoom(100)

if self.preview.IsOk():
pfrm = wx.PreviewFrame(self.preview, parent, _("Print preview"), style = wx.DEFAULT_FRAME_STYLE | wx.CLIP_CHILDREN )
pfrm = wx.PreviewFrame(self.preview, parent, _("Print Preview"), style = wx.DEFAULT_FRAME_STYLE | wx.CLIP_CHILDREN )
pfrm.SetIcon(parent.GetIcon())
pfrm.Initialize()
pfrm.SetPosition((300, 200))
Expand Down