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

@ -81,7 +81,7 @@ function on_message(self, message_id, message, sender)
end
function on_input(self, action_id, action)
self.druid:on_input(action_id, action)
return self.druid:on_input(action_id, action)
end
```

View File

@ -1,22 +1,33 @@
Simple to-do for Druid Alpha 2.0
Simple to-do for Druid Alpha 0.2.0
- custom input settings (name of touch, text, etc)
- refactor on_swipe. To on_scroll? Add input priority
-- High
- remove button event and match_event from druid
- add docs for all components
- button polish, actions
- ability to relocalize all locale text nodes
- add hover component
- add druid events/triggers? better callback system
- better name for locale component? lang? lang_text?
- better scroll size management, check different cases. So implicit now
- better grid + scroll management
- button polish, actions
- button add key trigger
- add text component for alpha release
- refactor on_swipe. To on_scroll? Add input priority
- add druid settings (add auto_focus input and other stuff)
- better default style, add template for custom style
- add template for user components
- add good examples with template and/or nodes (basic component no use any of them)
- add docs folder for every component with gifs? Solutions
- add init/remove stuff for every style in component. How to set custom sprites for button states?
- better callbacks for every components
- separate custom data and predefined fields in components?
- try use final druid in real project (FI uses custom druid)
- better default style, add template for custom style
- add docs for all components
- add docs folder for every component with gifs? Solutions
- better name for slider component?
- add text component for alpha release
- separate custom data and predefined fields in components?
- unify component api (get/set/to and other general stuff)
- compare with gooey
-- Low
- add code template and example for user components
- custom input settings (name of touch, text, etc)
- ability to relocalize all locale text nodes
- add good examples with template and/or nodes (basic component no use any of them)
- try use final druid in real project (FI uses custom druid) (use in 4321?)
- Druid store assest - separate repository with rich components

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

View File

@ -33,7 +33,7 @@ local slider = require("druid.base.slider")
local checkbox = require("druid.base.checkbox")
local checkbox_group = require("druid.base.checkbox_group")
local radio_group = require("druid.base.radio_group")
-- local input - require("druid.base.input")
local input - require("druid.base.input")
-- local infinity_scroll = require("druid.base.infinity_scroll")
local progress_rich = require("druid.rich.progress_rich")