-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathlabel.py
30 lines (26 loc) · 1.04 KB
/
label.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
"""
Implementations of form input controls
"""
from . import GetParam, form
from .input import FormControlMixin
from ..controls import Label
import wx
import wx.html
class FormLabel(Label, FormControlMixin):
def __init__(self, parent, form, tag, parser, *args, **kwargs):
label = GetParam(tag, "VALUE", default="label")
kwargs["name"] = GetParam(tag, "NAME", str(id(self)))
Label.__init__(self, parent, *args, **kwargs)
FormControlMixin.__init__(self, form, tag)
self.size = (int(GetParam(tag, "SIZE", default=-1)), -1)
if tag.HasEnding():
src = parser.GetSource()[tag.GetBeginPos():tag.GetEndPos1()]
else:
src = ''
#TODO: get actual font from HMTL Cell Parser
#self.SetFont(wx.SystemSettings.GetFont(wx.SYS_ANSI_FIXED_FONT))
self.text = src
#TODO: Bind mouse click with the real control: GetParam("for")
##self.Bind(wx.EVT_BUTTON, self.OnClick)
def get_value(self):
return None