mirror of
https://github.com/MikaylaFischler/cc-mek-scada.git
synced 2024-08-30 18:22:34 +00:00
#367 simplified chk_entry
This commit is contained in:
parent
8a5c468606
commit
8c6b264f6b
@ -22,20 +22,21 @@ local function init(parent, msg, fail_code)
|
|||||||
local root = Div{parent=parent,x=2,y=2,height=4,width=parent.get_width()-2,hidden=true}
|
local root = Div{parent=parent,x=2,y=2,height=4,width=parent.get_width()-2,hidden=true}
|
||||||
local entry = Div{parent=root,x=2,y=1,height=3,fg_bg=style.theme.highlight_box_bright}
|
local entry = Div{parent=root,x=2,y=1,height=3,fg_bg=style.theme.highlight_box_bright}
|
||||||
|
|
||||||
|
local fg_bg = cpair(colors.black,colors.yellow)
|
||||||
|
local tag = "MISSING"
|
||||||
|
|
||||||
if fail_code == 1 then
|
if fail_code == 1 then
|
||||||
TextBox{parent=entry,y=1,text="",width=11,fg_bg=cpair(colors.black,colors.orange)}
|
fg_bg = cpair(colors.black,colors.orange)
|
||||||
TextBox{parent=entry,text="BAD INDEX",alignment=ALIGN.CENTER,width=11,fg_bg=cpair(colors.black,colors.orange)}
|
tag = "BAD INDEX"
|
||||||
TextBox{parent=entry,text="",width=11,fg_bg=cpair(colors.black,colors.orange)}
|
|
||||||
elseif fail_code == 2 then
|
elseif fail_code == 2 then
|
||||||
TextBox{parent=entry,y=1,text="",width=11,fg_bg=cpair(colors.black,colors.red)}
|
fg_bg = cpair(colors.black,colors.red)
|
||||||
TextBox{parent=entry,text="DUPLICATE",alignment=ALIGN.CENTER,width=11,fg_bg=cpair(colors.black,colors.red)}
|
tag = "DUPLICATE"
|
||||||
TextBox{parent=entry,text="",width=11,fg_bg=cpair(colors.black,colors.red)}
|
|
||||||
elseif fail_code == 4 then
|
|
||||||
TextBox{parent=entry,y=1,text="",width=11,fg_bg=cpair(colors.black,colors.yellow)}
|
|
||||||
TextBox{parent=entry,text="MISSING",alignment=ALIGN.CENTER,width=11,fg_bg=cpair(colors.black,colors.yellow)}
|
|
||||||
TextBox{parent=entry,text="",width=11,fg_bg=cpair(colors.black,colors.yellow)}
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
TextBox{parent=entry,y=1,text="",width=11,fg_bg=fg_bg}
|
||||||
|
TextBox{parent=entry,text=tag,alignment=ALIGN.CENTER,width=11,fg_bg=fg_bg}
|
||||||
|
TextBox{parent=entry,text="",width=11,fg_bg=fg_bg}
|
||||||
|
|
||||||
TextBox{parent=entry,x=13,y=2,text=msg}
|
TextBox{parent=entry,x=13,y=2,text=msg}
|
||||||
|
|
||||||
return root
|
return root
|
||||||
|
Loading…
Reference in New Issue
Block a user