Skip to content

Commit

Permalink
more sizing tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
newville committed Jul 18, 2024
1 parent 4c51210 commit c37a801
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 26 deletions.
3 changes: 2 additions & 1 deletion larch/wxlib/xrfdisplay.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,8 @@ def createControlPanel(self):

xlines.SetMinSize((300, 240))
xlines.Bind(dv.EVT_DATAVIEW_SELECTION_CHANGED,
self.onSelectXrayLine)

self.onSelectXrayLine)
store = xlines.GetStore()

# main layout
Expand Down
35 changes: 21 additions & 14 deletions larch/wxxas/feffit_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import wx.dataview as dv

from pyshortcuts import platform
from lmfit import Parameter
from lmfit.model import (save_modelresult, load_modelresult,
save_model, load_model)
Expand Down Expand Up @@ -1897,7 +1898,6 @@ def build(self):
sizer.Add(SimpleText(panel, 'Fit Label:', style=LEFT), (irow, 0), (1, 1), LEFT)
sizer.Add(lpanel, (irow, 1), (1, 4), LEFT)


irow += 1
title = SimpleText(panel, '[[Fit Statistics]]', font=Font(FONTSIZE+2),
colour=COLORS['title'], style=LEFT)
Expand All @@ -1910,16 +1910,19 @@ def build(self):
sview = self.wids['stats'] = dv.DataViewListCtrl(panel, style=DVSTYLE)
sview.SetFont(self.font_fixedwidth)
sview.Bind(dv.EVT_DATAVIEW_SELECTION_CHANGED, self.onSelectFit)
sview.AppendTextColumn(' # ', width=40)
sview.AppendTextColumn('Label', width=135)
sview.AppendTextColumn('Npaths', width=80)
sview.AppendTextColumn('Nvary', width=80)
sview.AppendTextColumn('Nidp', width=92)
sview.AppendTextColumn('\u03c7\u00B2', width=92)
sview.AppendTextColumn('reduced \u03c7\u00B2', width=122)
sview.AppendTextColumn('R Factor', width=100)
# sview.AppendTextColumn('Akaike Info', width=85)

xw = (40, 135, 80, 80, 92, 92, 122, 100)
if platform=='darwin':
xw = (30, 125, 60, 60, 75, 75, 90, 90)

sview.AppendTextColumn(' # ', width=xw[0])
sview.AppendTextColumn('Label', width=xw[1])
sview.AppendTextColumn('Npaths', width=xw[2])
sview.AppendTextColumn('Nvary', width=xw[3])
sview.AppendTextColumn('Nidp', width=xw[4])
sview.AppendTextColumn('\u03c7\u00B2', width=xw[5])
sview.AppendTextColumn('reduced \u03c7\u00B2', width=xw[6])
sview.AppendTextColumn('R Factor', width=xw[7])

for col in range(sview.ColumnCount):
this = sview.Columns[col]
Expand All @@ -1945,10 +1948,14 @@ def build(self):
pview = self.wids['params'] = dv.DataViewListCtrl(panel, style=DVSTYLE)
pview.SetFont(self.font_fixedwidth)
self.wids['paramsdata'] = []
pview.AppendTextColumn('Parameter', width=180)
pview.AppendTextColumn('Best Value', width=140)
pview.AppendTextColumn('1-\u03c3 Uncertainty', width=150)
pview.AppendTextColumn('Info ', width=250)
xw = (180, 140, 150, 250)
if platform=='darwin':
xw = (180, 110, 110, 250)

pview.AppendTextColumn('Parameter', width=xw[0])
pview.AppendTextColumn('Best Value', width=xw[1])
pview.AppendTextColumn('1-\u03c3 Uncertainty', width=xw[2])
pview.AppendTextColumn('Info ', width=xw[3])

for col in range(4):
this = pview.Columns[col]
Expand Down
31 changes: 20 additions & 11 deletions larch/wxxas/prepeak_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
import wx.dataview as dv

from lmfit import Parameter

import lmfit.models as lm_models
from pyshortcuts import platform

from larch import Group, site_config
from larch.utils import uname, gformat, mkdir, fix_varname
Expand Down Expand Up @@ -302,13 +302,18 @@ def build(self):

sview.SetFont(self.font_fixedwidth)

xw = (175, 85, 85, 130, 130, 130)
if platform=='darwin':
xw = (160, 75, 75, 110, 110, 120)


sview.Bind(dv.EVT_DATAVIEW_SELECTION_CHANGED, self.onSelectFit)
sview.AppendTextColumn('Label', width=175)
sview.AppendTextColumn('N_data', width=85)
sview.AppendTextColumn('N_vary', width=85)
sview.AppendTextColumn('\u03c7\u00B2', width=130)
sview.AppendTextColumn('reduced \u03c7\u00B2', width=130)
sview.AppendTextColumn('Akaike Info', width=130)
sview.AppendTextColumn('Label', width=xw[0])
sview.AppendTextColumn('N_data', width=xw[1])
sview.AppendTextColumn('N_vary', width=xw[2])
sview.AppendTextColumn('\u03c7\u00B2', width=xw[3])
sview.AppendTextColumn('reduced \u03c7\u00B2', width=xw[4])
sview.AppendTextColumn('Akaike Info', width=xw[5])

for col in range(sview.ColumnCount):
this = sview.Columns[col]
Expand Down Expand Up @@ -337,10 +342,14 @@ def build(self):
pview = self.wids['params'] = dv.DataViewListCtrl(panel, style=DVSTYLE)
pview.SetFont(self.font_fixedwidth)
self.wids['paramsdata'] = []
pview.AppendTextColumn('Parameter', width=180)
pview.AppendTextColumn('Best Value', width=140)
pview.AppendTextColumn('1-\u03c3 Uncertainty', width=150)
pview.AppendTextColumn('Info ', width=250)

xw = (180, 140, 150, 250)
if platform=='darwin':
xw = (180, 110, 110, 250)
pview.AppendTextColumn('Parameter', width=xw[0])
pview.AppendTextColumn('Best Value', width=xw[1])
pview.AppendTextColumn('1-\u03c3 Uncertainty', width=xw[2])
pview.AppendTextColumn('Info ', width=xw[3])

for col in range(4):
this = pview.Columns[col]
Expand Down

0 comments on commit c37a801

Please sign in to comment.