From deb04b10f57c2bc43596ed3f3df3a693806f089d Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 2 Sep 2010 15:26:38 -0400 Subject: [PATCH] Remove 'results' panel from GUI. Use 'block info' instead. --- doc/gui.txt | 12 ----- hooke/ui/gui/__init__.py | 1 - hooke/ui/gui/panel/__init__.py | 1 - hooke/ui/gui/panel/results.py | 95 ---------------------------------- 4 files changed, 109 deletions(-) delete mode 100644 hooke/ui/gui/panel/results.py diff --git a/doc/gui.txt b/doc/gui.txt index eb1f1f4..c6b8e08 100644 --- a/doc/gui.txt +++ b/doc/gui.txt @@ -26,7 +26,6 @@ key toggles the visibility of the panel): * Output (`F8`) * Playlists (`F9`) * Properties (`F10`) -* Results (`F11`) .. image:: img/gui_screenshot.jpg @@ -119,17 +118,6 @@ floating point values. .. todo:: Document new, non-PropGrid :mod:`~hooke.ui.gui.panel.propertyeditor`. -Results -======= -The results from the `autopeak` or `multidistance` commands are -displayed here. Initially, all results are checked (i.e. visible). If -you want to hide a result, simply uncheck it. Hidden curves will not -be exported either. You can only display one type of fit result (WLC, -FJC, etc.) at a time and you can switch between result types (results -plugin - show_results). - -.. todo:: Results panel not yet re-implemented. - Output ====== The Output window serves as a log where pertinent information is diff --git a/hooke/ui/gui/__init__.py b/hooke/ui/gui/__init__.py index 1cdeb05..6f1a021 100644 --- a/hooke/ui/gui/__init__.py +++ b/hooke/ui/gui/__init__.py @@ -196,7 +196,6 @@ class HookeFrame (wx.Frame): size=wx.Size(150, 90), style=wx.TE_READONLY|wx.NO_BORDER|wx.TE_MULTILINE), 'bottom'), -# ('results', panel.results.Results(self), 'bottom'), ]: self._add_panel(p, style) self.execute_command( # setup already loaded playlists diff --git a/hooke/ui/gui/panel/__init__.py b/hooke/ui/gui/panel/__init__.py index a1be1eb..a63ee46 100644 --- a/hooke/ui/gui/panel/__init__.py +++ b/hooke/ui/gui/panel/__init__.py @@ -31,7 +31,6 @@ PANEL_MODULES = [ 'playlist', 'plot', 'propertyeditor', -# 'results', # 'selection', # 'welcome', ] diff --git a/hooke/ui/gui/panel/results.py b/hooke/ui/gui/panel/results.py deleted file mode 100644 index 35568b6..0000000 --- a/hooke/ui/gui/panel/results.py +++ /dev/null @@ -1,95 +0,0 @@ -# Copyright (C) 2010 Massimo Sandal -# Rolf Schmidt -# W. Trevor King -# -# This file is part of Hooke. -# -# Hooke is free software: you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# Hooke is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General -# Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with Hooke. If not, see -# . - -"""Fitting results panel for Hooke. -""" - -import sys - -import wx -from wx.lib.mixins.listctrl import CheckListCtrlMixin - -class CheckListCtrl(wx.ListCtrl, CheckListCtrlMixin): - def __init__(self, parent): - wx.ListCtrl.__init__(self, parent, -1, style=wx.LC_REPORT) - CheckListCtrlMixin.__init__(self) - self.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.OnItemActivated) - - def OnItemActivated(self, evt): - self.ToggleItem(evt.m_itemIndex) - - -class Results(wx.Panel): - def __init__(self, parent): - wx.Panel.__init__(self, parent, -1) - self.results_list = CheckListCtrl(self) - sizer = wx.BoxSizer() - sizer.Add(self.results_list, 1, wx.EXPAND) - self.SetSizer(sizer) - self.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnItemSelected, self.results_list) - self.Bind(wx.EVT_LIST_ITEM_DESELECTED, self.OnItemDeselected, self.results_list) - - def _GetWidthInPixels(self, text): - #TODO: - #Returns the width of a string in pixels - #Unfortunately, it does not work terribly well (although it should). - #Thus, we have to add a bit afterwards. - #Annoys the heck out of me (illysam). - font = self.results_list.GetFont() - dc = wx.WindowDC(self.results_list) - dc.SetFont(font) - width, height = dc.GetTextExtent(text) - return width - - def ClearResults(self): - self.results_list.ClearAll() - - def DisplayResults(self, results): - self.ClearResults() - header = results.get_header_as_list() - self.results_list.InsertColumn(0, 'Show') - for index, column in enumerate(header): - self.results_list.InsertColumn(index + 1, column, wx.LIST_FORMAT_RIGHT) - - for result in results.results: - done = False - for index, column in enumerate(results.columns): - value_str = results.get_pretty_value(column, result.result[column]) - if not done: - index_col = self.results_list.InsertStringItem(sys.maxint, '') - done = True - column_width = len(self.results_list.GetColumn(index + 1).GetText()) - value_str = value_str.center(column_width) - self.results_list.SetStringItem(index_col, index + 1, value_str) - - for index, result in enumerate(results.results): - if result.visible: - #if we use 'CheckItem' then 'UpdatePlot' is called (ie repeated updates) - self.results_list.SetItemImage(index, 1) - for index in range(self.results_list.GetColumnCount()): - column_text = self.results_list.GetColumn(index).GetText() - column_width = self._GetWidthInPixels(column_text) - self.results_list.SetColumnWidth(index, column_width + 15) - - def OnItemSelected(self, evt): - pass - - def OnItemDeselected(self, evt): - pass -- 2.26.2