Changeset 1529 for trunk/GSASIIgrid.py


Ignore:
Timestamp:
Oct 17, 2014 2:46:23 PM (8 years ago)
Author:
vondreele
Message:

revise display of space group info so that operators are in lined up columns
in bot the LS output & the popup window. - new class SGMessageBox (from wx.Dialog!)
G2spc.SGPrint now returns 2 items: Text & Tables
Work on supersymmetry - now better display of operators
operators more complete
use ErrorDialog? for more error messages instead of putting the message on the console

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIgrid.py

    r1524 r1529  
    161161#### GSAS-II class definitions
    162162################################################################################
     163
     164class SGMessageBox(wx.Dialog):
     165    ''' Special version of MessageBox that displays space group & super space group text
     166    in two blocks
     167    '''
     168    def __init__(self,parent,title,text,table,):
     169        wx.Dialog.__init__(self,parent,wx.ID_ANY,title,pos=wx.DefaultPosition,
     170            style=wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER)
     171        self.text=text
     172        self.table = table
     173        self.panel = wx.Panel(self)
     174        mainSizer = wx.BoxSizer(wx.VERTICAL)
     175        mainSizer.Add((0,10))
     176        for line in text:
     177            mainSizer.Add(wx.StaticText(self.panel,label='     %s     '%(line)),0,WACV)
     178        tableSizer = wx.FlexGridSizer(0,2,0,0)
     179        for item in self.table:
     180            tableSizer.Add(wx.StaticText(self.panel,label='     %s'%(item.ljust(30))),0,WACV)
     181        mainSizer.Add(tableSizer)
     182        btnsizer = wx.StdDialogButtonSizer()
     183        OKbtn = wx.Button(self.panel, wx.ID_OK)
     184        OKbtn.SetDefault()
     185        btnsizer.AddButton(OKbtn)
     186        btnsizer.Realize()
     187        mainSizer.Add((0,10))
     188        mainSizer.Add(btnsizer,0,wx.ALIGN_CENTER)
     189        self.panel.SetSizer(mainSizer)
     190        self.panel.Fit()
     191        self.Fit()
     192        size = self.GetSize()
     193        self.SetSize([size[0]+20,size[1]])
     194
     195    def Show(self):
     196        '''Use this method after creating the dialog to post it
     197        '''
     198        self.ShowModal()
     199        return
     200       
     201       
    163202
    164203class G2TreeCtrl(wx.TreeCtrl):
Note: See TracChangeset for help on using the changeset viewer.