Files
SCam/entrybutton.py
2021-09-29 18:54:47 +02:00

33 lines
876 B
Python

import wx
from mathentry import MathEntry
class EntryButton(wx.BoxSizer):
def __init__(self, parent, id=wx.ID_ANY, label="", value="", button="", style=wx.TE_RIGHT):
super().__init__(wx.HORIZONTAL)
self.label = label = wx.StaticText(parent, label=label)
self.entry = entry = MathEntry(parent, value=value, style=wx.TE_RIGHT)
self.button = button = wx.Button(parent, label=button)
self.Add(label, 0, wx.ALIGN_CENTER_VERTICAL)
self.Add(5, 0, 0)
self.Add(entry, 1, wx.EXPAND)
self.Add(5, 0, 0)
self.Add(button)
def GetValue(self):
return self.entry.GetValue()
def Enable(self):
self.label.Enable()
self.entry.Enable()
self.button.Enable()
def Disable(self):
self.label.Disable()
self.entry.Disable()
self.button.Disable()