Changeset 6351


Ignore:
Timestamp:
Feb 17, 2009, 8:56:26 AM (15 years ago)
Author:
rwilson
Message:

Cleanup and attempt to get matplotlib 0.98.5.2 working.

Location:
misc/tools/plotcsv
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • misc/tools/plotcsv/plotcsv.py

    r6350 r6351  
    311311
    312312
     313################################################################################
     314# GUI routines
     315################################################################################
     316
    313317class MyFrame(wx.Frame):
    314318    def __init__(self, parent, id, title, pos=wx.DefaultPosition,
    315319                    size=wx.DefaultSize, style=wx.DEFAULT_FRAME_STYLE):
     320        '''Lay out the GUI form'''
     321       
    316322        # Make the frame
    317323        wx.Frame.__init__(self, parent, id, title, pos=(50, 50),
     
    369375                                     size=(100, BUTTON_HEIGHT))
    370376
     377        # bind controls/events to handlers
    371378        self.Bind(wx.EVT_BUTTON, self.AddCSVFile, self.btnAddCSVFile)
    372379        self.Bind(wx.EVT_BUTTON, self.DelCSVFile, self.btnDelCSVFile)
    373380        self.Bind(wx.EVT_BUTTON, self.PlotFiles, self.btnPlot)
     381       
    374382        self.Bind(wx.EVT_CLOSE, self.doStateSave)
    375         self.Bind(wx.EVT_CLOSE, self.doStateSave)
     383
     384        # restore saved values
     385        self.common_headers = None
    376386        self.cfg = Config(ConfigFilename)
    377         self.common_headers = None
    378387        self.doStateRestore()
    379388        self.updateHdrChoices()
     
    409418
    410419    def DelCSVFile(self, event):
    411         """Add a CSV file to the listbox"""
     420        """Delete a CSV file from the listbox"""
    412421
    413422        sel = self.txtCSVFiles.GetSelections()
     
    421430
    422431    def doStateSave(self, event):
    423         """Save state from 'self' variables."""
     432        """Save state from 'self' variables & controls."""
    424433
    425434        self.cfg['CSVFiles'] = self.CSVFiles
     
    485494        '''Update choice controls with header lists.
    486495
    487         Keep initially visible strings visible afterwards, if possible.
     496        Disable controls if no CSV files (ie, no headers).
     497        Keep selections visible afterwards, if possible.
    488498        '''
    489499
     500        # get current selections, if any
    490501        selected_x = self.cbXColHdr.GetStringSelection()
    491502        selected_y = self.cbYColHdr.GetStringSelection()
     
    513524
    514525    def orHeaders(self, new_header):
    515         '''Update X & Y column header choices'''
     526        '''Update X & Y column header choices.
     527
     528        Return new 'common headers' list from current
     529        self.common_headers and the supplied new_header list.
     530        '''
    516531
    517532        if self.common_headers:
     
    522537
    523538    def GenCommonHeaders(self, headers):
    524         '''Get new set of common headers'''
     539        '''Get new set of common headers.
     540
     541        Return a new 'common header' list given a
     542        list of header lists.
     543        '''
    525544
    526545        result = []
     
    533552
    534553    def PlotFiles(self, event):
     554        '''Plot files in the CSV file listbox.'''
     555       
    535556        selected_x = self.cbXColHdr.GetStringSelection()
    536557        selected_y = self.cbYColHdr.GetStringSelection()
     
    540561           
    541562    def error(self, msg):
     563        '''Issue xwPython error message.'''
     564       
    542565        dlg = wx.MessageDialog(self, msg, 'Error',
    543566                               wx.OK | wx.ICON_INFORMATION)
     
    547570       
    548571################################################################################
    549 # Code to do the GUI
     572# Mainline code - start the application.
    550573################################################################################
    551574
  • misc/tools/plotcsv/tkinter_error.py

    r6348 r6351  
    2424            self.LABEL["bg"] = "yellow"
    2525            self.LABEL["justify"] = "left"
    26             self.LABEL["font"] = "Courier"
     26            self.LABEL["font"] = "9x15bold"
    2727            self.LABEL.pack()
    2828
Note: See TracChangeset for help on using the changeset viewer.