1
0
Fork 0
fgdata/Nasal/canvas/PFD/HighlightElement.nas
Stuart Buchanan ad77dc2f9c Modify FG1000 EIS to use Emesary,
- New Emesary notificaion type for engine data
- New Canvas PFD UI Elements - Pointer, Rotating
- Upate EIS to use above.
2018-01-03 20:24:41 +00:00

41 lines
1.1 KiB
Text

# PFD UI Element - Highlight UI Element. Can have values set and retrieved
# Highlighting simply shows the element.
var HighlightElement =
{
new : func (pagename, svg, name, value="", style=nil)
{
var obj = {
parents : [ HighlightElement, PFD.UIElement ],
_name : pagename ~ name,
_value : value,
_style : style,
};
if (style == nil) obj._style = PFD.DefaultStyle;
obj._symbol = svg.getElementById(obj._name);
assert(obj._symbol != nil, "Unable to find element " ~ obj._name);
obj.unhighlightElement();
return obj;
},
getName : func() { return me._name; },
getValue : func() { return me._value; },
setValue : func(value) { me._value = value; },
setVisible : func(vis) { me._symbol.setVisible(vis); },
highlightElement : func() {
me._symbol.setVisible(1);
},
unhighlightElement : func() {
me._symbol.setVisible(0);
},
isEditable : func () { return 0; },
isInEdit : func() { return 0; },
enterElement : func() { return me.getValue(); },
clearElement : func() { },
editElement : func() { },
incrSmall : func(value) { },
incrLarge : func(value) { },
};