moved ValueEntry to entries
This commit is contained in:
@@ -4,43 +4,11 @@ import wx
|
||||
from slic.utils import printed_exception
|
||||
from slic.utils.reprate import get_pvname_reprate
|
||||
|
||||
from ..widgets import LabeledMathEntry, LabeledEntry, LabeledFilenameEntry, TwoButtons, make_filled_hbox, make_filled_vbox, STRETCH, EXPANDING
|
||||
from ..widgets import LabeledMathEntry, LabeledEntry, LabeledFilenameEntry, LabeledValueEntry, TwoButtons, make_filled_hbox, make_filled_vbox, STRETCH, EXPANDING
|
||||
from ..persist import PersistableWidget
|
||||
from .tools import AdjustableComboBox, ETADisplay, correct_n_pulses, run, post_event
|
||||
|
||||
|
||||
class LabeledValueEntry(wx.BoxSizer): #TODO: largely copy of LabeledEntry
|
||||
|
||||
def __init__(self, parent, id=wx.ID_ANY, label="", value=""):
|
||||
super().__init__(wx.VERTICAL)
|
||||
|
||||
value = str(value)
|
||||
name = label
|
||||
|
||||
self.label = label = wx.StaticText(parent, label=label)
|
||||
self.text = text = ValueEntry(parent, value=value, name=name)
|
||||
|
||||
self.Add(label, flag=wx.EXPAND)
|
||||
self.Add(text, flag=wx.EXPAND, proportion=1)
|
||||
|
||||
|
||||
def __getattr__(self, name):
|
||||
return getattr(self.text, name)
|
||||
|
||||
|
||||
|
||||
class ValueEntry(wx.TextCtrl, PersistableWidget):
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
if "style" in kwargs:
|
||||
kwargs["style"] |= wx.TE_MULTILINE
|
||||
else:
|
||||
kwargs["style"] = wx.TE_MULTILINE
|
||||
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
|
||||
|
||||
class SpecialScanPanel(wx.Panel):
|
||||
|
||||
def __init__(self, parent, scanner, instrument, *args, **kwargs):
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
from .completers import ContainsTextCompleter, FuzzyTextCompleter
|
||||
from .entries import LabeledEntry, LabeledFilenameEntry, LabeledMathEntry, LabeledTweakEntry
|
||||
from .entries import LabeledEntry, LabeledFilenameEntry, LabeledMathEntry, LabeledTweakEntry, LabeledValueEntry
|
||||
from .lists import AutoWidthListCtrl, show_list, show_two_lists
|
||||
from .mods import MainPanel, NotebookDX
|
||||
from .tools import EXPANDING, MINIMIZED, STRETCH, make_filled_vbox, make_filled_hbox, copy_to_clipboard, post_event
|
||||
|
||||
@@ -174,9 +174,22 @@ class FilenameEntry(wx.TextCtrl, PersistableWidget):
|
||||
|
||||
|
||||
|
||||
class ValueEntry(wx.TextCtrl, PersistableWidget):
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
if "style" in kwargs:
|
||||
kwargs["style"] |= wx.TE_MULTILINE
|
||||
else:
|
||||
kwargs["style"] = wx.TE_MULTILINE
|
||||
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
|
||||
|
||||
LabeledEntry = make_labeled(wx.TextCtrl)
|
||||
LabeledMathEntry = make_labeled(MathEntry)
|
||||
LabeledFilenameEntry = make_labeled(FilenameEntry)
|
||||
LabeledValueEntry = make_labeled(ValueEntry)
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user