summaryrefslogtreecommitdiff
path: root/indra/newview/scripts/lua/test_luafloater_gesture_list.lua
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/scripts/lua/test_luafloater_gesture_list.lua')
-rw-r--r--indra/newview/scripts/lua/test_luafloater_gesture_list.lua27
1 files changed, 27 insertions, 0 deletions
diff --git a/indra/newview/scripts/lua/test_luafloater_gesture_list.lua b/indra/newview/scripts/lua/test_luafloater_gesture_list.lua
new file mode 100644
index 0000000000..5f929c0d0c
--- /dev/null
+++ b/indra/newview/scripts/lua/test_luafloater_gesture_list.lua
@@ -0,0 +1,27 @@
+local LLGesture = require 'LLGesture'
+local startup = require 'startup'
+local UI = require 'UI'
+
+local flt = UI.Floater(
+ "luafloater_gesture_list.xml",
+ {gesture_list = {"double_click"}})
+
+function flt:post_build(event_data)
+ local gestures_uuid = LLGesture.getActiveGestures()
+ local action_data = {}
+ action_data.action = "add_list_element"
+ action_data.ctrl_name = "gesture_list"
+ local gestures = {}
+ for uuid, info in pairs(gestures_uuid) do
+ table.insert(gestures, {value = uuid, columns={column = "gesture_name", value = info.name}})
+ end
+ action_data.value = gestures
+ self:post(action_data)
+end
+
+function flt:double_click_gesture_list(event_data)
+ LLGesture.startGesture(event_data.value)
+end
+
+startup.wait('STATE_STARTED')
+flt:show()