diff --git a/src/core/BaseDialog.coffee b/src/core/BaseDialog.coffee index bd742d8..c12e998 100644 --- a/src/core/BaseDialog.coffee +++ b/src/core/BaseDialog.coffee @@ -120,6 +120,48 @@ PromptDialog.scheme = """ """ this.OS.register "PromptDialog", PromptDialog +class TextDialog extends this.OS.GUI.BasicDialog + constructor: () -> + super "TextDialog", TextDialog.scheme + + init: () -> + super.init() + $input = $(@find "txtInput") + $input.val @data.value if @data and @data.value + + @find("btnOk").set "onbtclick", (e) => + value = $input.val() + return unless value and value isnt "" + @handle value if @handle + @quit() + + @find("btnCancel").set "onbtclick", (e) => + @quit() + + $input.focus() + +TextDialog.scheme = """ + + + +
+ +
+