Add functions stubs

This commit is contained in:
Insality
2020-02-22 14:44:01 +03:00
parent aac80795b9
commit b198e09560
5 changed files with 78 additions and 20 deletions

View File

@@ -1,11 +1,6 @@
--- Component to handle basic GUI button
-- @module druid.button
-- TODO: Add button mode:
-- Long tap
-- Repeated tap
-- Double tap?
local const = require("druid.const")
local helper = require("druid.helper")
local component = require("druid.component")
@@ -148,4 +143,41 @@ function M.set_click_zone(self, zone)
end
-- TODO: implement them all!
--- Set key-code to trigger this button
function M.set_key_trigger(self, key)
end
--- Get key-code to trigger this button
function M.get_key_trigger(self)
end
--- Set usual button callback
function M.set_callback(self, callback)
end
--- Repeat callback always, while holding button
function M.set_hold_callback(self, callback)
end
--- Get doubletap callback on this button
function M.set_double_tap_callback(self, callback)
end
--- Single callbacka after long_tap. No usual callback invoked
function M.set_long_tap_callback(self, callback)
end
return M

15
druid/base/input.lua Normal file
View File

@@ -0,0 +1,15 @@
--- Druid input text component
-- @local unimplemented
-- @module druid.input
local component = require("druid.component")
local M = component.create("input")
function M.init(self, node, callback, click_node)
self.style = self:get_style()
end
return M