diff options
| author | ruki <[email protected]> | 2018-01-28 21:50:36 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2018-01-28 21:50:36 +0800 |
| commit | e6c76e74f1bcc15bacd50cdd19510e32ee1f033a (patch) | |
| tree | 8be6630669d46df7ecfa67002be7574c2b8f929e | |
| parent | f7c740be4a6af2f23c5c04a11e5807e3de563b46 (diff) | |
add search dialog in mconfdialog
| -rw-r--r-- | xmake/core/ui/mconfdialog.lua | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/xmake/core/ui/mconfdialog.lua b/xmake/core/ui/mconfdialog.lua index 2824f6b1f..7fb70758e 100644 --- a/xmake/core/ui/mconfdialog.lua +++ b/xmake/core/ui/mconfdialog.lua @@ -158,8 +158,19 @@ end -- get search dialog function mconfdialog:searchdialog() if not self._SEARCHDIALOG then - -- TODO - local dialog_search = nil + local dialog_search = inputdialog:new("mconfdialog.input", rect {0, 0, math.min(80, self:width()), math.min(8, self:height())}, "Search Configuration Parameter") + dialog_search:background_set(self:frame():background()) + dialog_search:frame():background_set("cyan") + dialog_search:textedit():option_set("multiline", false) + dialog_search:text():text_set("Enter (sub)string or lua pattern string to search for configuration") + dialog_search:button_add("ok", "< Ok >", function (v) + -- TODO + dialog_search:quit() + end) + dialog_search:button_add("cancel", "< Cancel >", function (v) + dialog_search:quit() + end) + dialog_search:button_select("ok") self._SEARCHDIALOG = dialog_search end return self._SEARCHDIALOG @@ -198,7 +209,9 @@ end -- show search dialog function mconfdialog:show_search() - -- TODO + local dialog_search = self:searchdialog() + dialog_search:panel():select(dialog_search:textedit()) + self:insert(dialog_search, {centerx = true, centery = true}) end -- on event |
