Skip to content

Commit

Permalink
more tweaks to CIF browser
Browse files Browse the repository at this point in the history
  • Loading branch information
newville committed Sep 8, 2024
1 parent 9c2448b commit 4ca134d
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions larch/wxlib/cif_browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
FNB_STYLE = fnb.FNB_NO_X_BUTTON|fnb.FNB_SMART_TABS
FNB_STYLE |= fnb.FNB_NO_NAV_BUTTONS|fnb.FNB_NODRAG

MAINSIZE = (1000, 650)
MAINSIZE = (1150, 650)

class CIFFrame(wx.Frame):
_about = """Larch Crystallographic Information File Browser
Expand Down Expand Up @@ -112,9 +112,8 @@ def createMainPanel(self):
splitter = wx.SplitterWindow(self, style=wx.SP_LIVE_UPDATE)
splitter.SetMinimumPaneSize(250)

leftpanel = wx.Panel(splitter)
self.ciflist = EditableListBox(leftpanel,
self.onShowCIF, size=(300,-1))
leftpanel = wx.Panel(splitter, size=(375, -1))
self.ciflist = EditableListBox(leftpanel, self.onShowCIF, size=(375, -1))
set_color(self.ciflist, 'list_fg', bg='list_bg')
self.cif_selections = {}

Expand All @@ -124,15 +123,18 @@ def createMainPanel(self):

# right hand side
rightpanel = scrolled.ScrolledPanel(splitter)
panel = wx.Panel(rightpanel)
panel = wx.Panel(rightpanel, size=(725, -1))

self.ciflist.SetMinSize((375, 250))
rightpanel.SetMinSize((400, 250))

sizer = wx.GridBagSizer(2, 2)

self.title = SimpleText(panel, 'Search American Mineralogical CIF Database:',
size=(700, -1), style=LEFT)
self.title.SetFont(Font(FONTSIZE+2))
wids = self.wids = {}


minlab = SimpleText(panel, ' Mineral Name: ')
minhint= SimpleText(panel, ' example: hem* ')
wids['mineral'] = wx.TextCtrl(panel, value='', size=(250, -1),
Expand Down Expand Up @@ -172,7 +174,6 @@ def createMainPanel(self):
wids['search'] = Button(panel, 'Search for CIFs', action=self.onSearch)



ir = 0
sizer.Add(self.title, (0, 0), (1, 6), LEFT, 2)

Expand Down Expand Up @@ -348,10 +349,12 @@ def _swallow_plot_messages(s, panel=0):
r_sizer = wx.BoxSizer(wx.VERTICAL)
r_sizer.Add(panel, 0, LEFT|wx.GROW|wx.ALL)
r_sizer.Add(self.nb, 1, LEFT|wx.GROW, 2)

pack(rightpanel, r_sizer)
rightpanel.SetupScrolling()
splitter.SplitVertically(leftpanel, rightpanel, 1)


def get_nbpage(self, name):
"get nb page by name"
name = name.lower()
Expand Down Expand Up @@ -411,7 +414,7 @@ def onSearch(self, event=None):
year = cif.publication.year
journal= cif.publication.journalname
cid = cif.ams_id
label = f'{label}: {mineral}, {year} {journal} ({cid})'
label = f'{label}: {mineral}, {year} {journal} [{cid}]'
except:
label = None
if label is not None:
Expand Down

0 comments on commit 4ca134d

Please sign in to comment.