Changeset 6351
- Timestamp:
- Feb 17, 2009, 8:56:26 AM (16 years ago)
- Location:
- misc/tools/plotcsv
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
misc/tools/plotcsv/plotcsv.py
r6350 r6351 311 311 312 312 313 ################################################################################ 314 # GUI routines 315 ################################################################################ 316 313 317 class MyFrame(wx.Frame): 314 318 def __init__(self, parent, id, title, pos=wx.DefaultPosition, 315 319 size=wx.DefaultSize, style=wx.DEFAULT_FRAME_STYLE): 320 '''Lay out the GUI form''' 321 316 322 # Make the frame 317 323 wx.Frame.__init__(self, parent, id, title, pos=(50, 50), … … 369 375 size=(100, BUTTON_HEIGHT)) 370 376 377 # bind controls/events to handlers 371 378 self.Bind(wx.EVT_BUTTON, self.AddCSVFile, self.btnAddCSVFile) 372 379 self.Bind(wx.EVT_BUTTON, self.DelCSVFile, self.btnDelCSVFile) 373 380 self.Bind(wx.EVT_BUTTON, self.PlotFiles, self.btnPlot) 381 374 382 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 376 386 self.cfg = Config(ConfigFilename) 377 self.common_headers = None378 387 self.doStateRestore() 379 388 self.updateHdrChoices() … … 409 418 410 419 def DelCSVFile(self, event): 411 """ Add a CSV file tothe listbox"""420 """Delete a CSV file from the listbox""" 412 421 413 422 sel = self.txtCSVFiles.GetSelections() … … 421 430 422 431 def doStateSave(self, event): 423 """Save state from 'self' variables ."""432 """Save state from 'self' variables & controls.""" 424 433 425 434 self.cfg['CSVFiles'] = self.CSVFiles … … 485 494 '''Update choice controls with header lists. 486 495 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. 488 498 ''' 489 499 500 # get current selections, if any 490 501 selected_x = self.cbXColHdr.GetStringSelection() 491 502 selected_y = self.cbYColHdr.GetStringSelection() … … 513 524 514 525 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 ''' 516 531 517 532 if self.common_headers: … … 522 537 523 538 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 ''' 525 544 526 545 result = [] … … 533 552 534 553 def PlotFiles(self, event): 554 '''Plot files in the CSV file listbox.''' 555 535 556 selected_x = self.cbXColHdr.GetStringSelection() 536 557 selected_y = self.cbYColHdr.GetStringSelection() … … 540 561 541 562 def error(self, msg): 563 '''Issue xwPython error message.''' 564 542 565 dlg = wx.MessageDialog(self, msg, 'Error', 543 566 wx.OK | wx.ICON_INFORMATION) … … 547 570 548 571 ################################################################################ 549 # Code to do the GUI572 # Mainline code - start the application. 550 573 ################################################################################ 551 574 -
misc/tools/plotcsv/tkinter_error.py
r6348 r6351 24 24 self.LABEL["bg"] = "yellow" 25 25 self.LABEL["justify"] = "left" 26 self.LABEL["font"] = " Courier"26 self.LABEL["font"] = "9x15bold" 27 27 self.LABEL.pack() 28 28
Note: See TracChangeset
for help on using the changeset viewer.