This commit is contained in:
phidias authored and GitHub committed 2026-11-26 23:13:44 +09:00
1 parent 613760db52
commit bb583a94e9
4 files changed
+17 -20

No files matched your search

+11 -17
View File
@@ -63,21 +63,14 @@ local function factorial(n)
return result return result
end end
--- Expression caption label --- Caption label
Elements.calculator_expression_caption_label = Gui.define("calculator/expression_caption_label") --- @class ExpGui_Calculator.calculator_caption_label: ExpElement
--- @overload fun(parent: LuaGuiElement, caption: LocalisedString): LuaGuiElement
Elements.calculator_caption_label = Gui.define("calculator/caption_label")
:draw{ :draw{
type = "label", type = "label",
caption = {"exp-gui_calculator.expression"}, caption = Gui.from_argument(1),
name = "calculator_expression_caption_label", name = "calculator_header_label",
style = "heading_2_label",
}
--- Result caption label
Elements.calculator_result_caption_label = Gui.define("calculator/result_caption_label")
:draw{
type = "label",
caption = {"exp-gui_calculator.expression"},
name = "calculator_result_caption_label",
style = "heading_2_label", style = "heading_2_label",
} }
@@ -85,7 +78,7 @@ Elements.calculator_result_caption_label = Gui.define("calculator/result_caption
Elements.calculator_info_label = Gui.define("calculator/info_label") Elements.calculator_info_label = Gui.define("calculator/info_label")
:draw{ :draw{
type = "label", type = "label",
caption = {"exp-gui_calculator.reference"}, caption = {"exp-gui_calculator.info"},
name = "calculator_info_label", name = "calculator_info_label",
} }
:style{ :style{
@@ -115,11 +108,12 @@ Elements.container = Gui.define("calculator/container")
:draw(function(def, parent) :draw(function(def, parent)
local screen_frame = Gui.elements.screen_frame(parent, nil, true) local screen_frame = Gui.elements.screen_frame(parent, nil, true)
local button_flow = Gui.elements.screen_frame.get_button_flow(screen_frame) local button_flow = Gui.elements.screen_frame.get_button_flow(screen_frame)
local header = Gui.elements.header(button_flow, { caption = { "exp-gui_calculator.tooltip" } }) Elements.calculator_caption_label(button_flow, {"exp-gui_calculator.tooltip"})
Elements.calculator_expression_caption_label(screen_frame) Elements.calculator_caption_label(screen_frame, {"exp-gui_calculator.expression"})
Elements.calculator_input_textfield(screen_frame) Elements.calculator_input_textfield(screen_frame)
Elements.calculator_result_caption_label(screen_frame) Elements.calculator_caption_label(screen_frame, {"exp-gui_calculator.result"})
Elements.calculator_result_label(screen_frame) Elements.calculator_result_label(screen_frame)
Elements.calculator_caption_label(screen_frame, {"exp-gui_calculator.reference"})
Elements.calculator_info_label(screen_frame) Elements.calculator_info_label(screen_frame)
return Gui.elements.screen_frame.get_root_element(screen_frame) return Gui.elements.screen_frame.get_root_element(screen_frame)
end) end)
+2 -1
View File
@@ -273,7 +273,8 @@ inserted=Inserted __1__ __2__ into __3__
tooltip=Calculator tooltip=Calculator
expression=Expression: expression=Expression:
result=Result: result=Result:
reference=Reference\nOperator\n+ - * / % () ^ ** !\nPrefix\nK M G T P\nBase\n0x 0b 0o\nFunction\nABS, CEIL, EXP, FLOOR, LN, LOG, ROUND, SQRT, TRUNC reference=Reference
info=Operator\n+ - * / % () ^ ** !\nPrefix\nK M G T P\nBase\n0x 0b 0o\nFunction\nABS, CEIL, EXP, FLOOR, LN, LOG, ROUND, SQRT, TRUNC
error=[ERROR] error=[ERROR]
input_too_long=Input too long input_too_long=Input too long
factorial_neg=Factorial of a negative number __1__ factorial_neg=Factorial of a negative number __1__
+2 -1
View File
@@ -275,7 +275,8 @@ inserted=自動填入 __1__ __2__ 到 __3__
tooltip=計算機 tooltip=計算機
expression=表達式: expression=表達式:
result=結果: result=結果:
reference=參考\n運算符\n+ - * / % () ^ ** !\n詞頭\nK M G T P\n進制\n0x 0b 0o\n函數\nABS, CEIL, EXP, FLOOR, LN, LOG, ROUND, SQRT, TRUNC reference=參考
info=運算符\n+ - * / % () ^ ** !\n詞頭\nK M G T P\n進制\n0x 0b 0o\n函數\nABS, CEIL, EXP, FLOOR, LN, LOG, ROUND, SQRT, TRUNC
error=[錯誤] error=[錯誤]
input_too_long=輸入太長 input_too_long=輸入太長
factorial_neg=負數的階乘 __1__ factorial_neg=負數的階乘 __1__
+2 -1
View File
@@ -275,7 +275,8 @@ inserted=自動填入 __1__ __2__ 到 __3__
tooltip=計算機 tooltip=計算機
expression=表達式: expression=表達式:
result=結果: result=結果:
reference=參考\n運算符\n+ - * / % () ^ ** !\n詞頭\nK M G T P\n進制\n0x 0b 0o\n函數\nABS, CEIL, EXP, FLOOR, LN, LOG, ROUND, SQRT, TRUNC reference=參考
info=運算符\n+ - * / % () ^ ** !\n詞頭\nK M G T P\n進制\n0x 0b 0o\n函數\nABS, CEIL, EXP, FLOOR, LN, LOG, ROUND, SQRT, TRUNC
error=[錯誤] error=[錯誤]
input_too_long=輸入太長 input_too_long=輸入太長
factorial_neg=負數的階乘 __1__ factorial_neg=負數的階乘 __1__