mirror of
https://github.com/Insality/druid
synced 2025-06-27 10:27:48 +02:00
Add functions stubs
This commit is contained in:
parent
aac80795b9
commit
b198e09560
@ -81,7 +81,7 @@ function on_message(self, message_id, message, sender)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function on_input(self, action_id, action)
|
function on_input(self, action_id, action)
|
||||||
self.druid:on_input(action_id, action)
|
return self.druid:on_input(action_id, action)
|
||||||
end
|
end
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -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
|
- remove button event and match_event from druid
|
||||||
- add docs for all components
|
- add hover component
|
||||||
- button polish, actions
|
- add druid events/triggers? better callback system
|
||||||
- ability to relocalize all locale text nodes
|
|
||||||
- better name for locale component? lang? lang_text?
|
- better name for locale component? lang? lang_text?
|
||||||
- better scroll size management, check different cases. So implicit now
|
- better scroll size management, check different cases. So implicit now
|
||||||
- better grid + scroll management
|
- 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)
|
- 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?
|
- add init/remove stuff for every style in component. How to set custom sprites for button states?
|
||||||
- better callbacks for every components
|
- better callbacks for every components
|
||||||
- separate custom data and predefined fields in components?
|
- better default style, add template for custom style
|
||||||
- try use final druid in real project (FI uses custom druid)
|
- add docs for all components
|
||||||
|
- add docs folder for every component with gifs? Solutions
|
||||||
- better name for slider component?
|
- 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
|
||||||
|
@ -1,11 +1,6 @@
|
|||||||
--- Component to handle basic GUI button
|
--- Component to handle basic GUI button
|
||||||
-- @module druid.button
|
-- @module druid.button
|
||||||
|
|
||||||
-- TODO: Add button mode:
|
|
||||||
-- Long tap
|
|
||||||
-- Repeated tap
|
|
||||||
-- Double tap?
|
|
||||||
|
|
||||||
local const = require("druid.const")
|
local const = require("druid.const")
|
||||||
local helper = require("druid.helper")
|
local helper = require("druid.helper")
|
||||||
local component = require("druid.component")
|
local component = require("druid.component")
|
||||||
@ -148,4 +143,41 @@ function M.set_click_zone(self, zone)
|
|||||||
end
|
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
|
return M
|
||||||
|
15
druid/base/input.lua
Normal file
15
druid/base/input.lua
Normal 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
|
@ -33,7 +33,7 @@ local slider = require("druid.base.slider")
|
|||||||
local checkbox = require("druid.base.checkbox")
|
local checkbox = require("druid.base.checkbox")
|
||||||
local checkbox_group = require("druid.base.checkbox_group")
|
local checkbox_group = require("druid.base.checkbox_group")
|
||||||
local radio_group = require("druid.base.radio_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 infinity_scroll = require("druid.base.infinity_scroll")
|
||||||
local progress_rich = require("druid.rich.progress_rich")
|
local progress_rich = require("druid.rich.progress_rich")
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user