mirror of
https://github.com/Insality/druid
synced 2025-09-27 18:12:21 +02:00
#108 Move component interests const from const.lua to component.lua
This commit is contained in:
@@ -16,11 +16,10 @@
|
||||
-- @tfield Button button
|
||||
|
||||
|
||||
local const = require("druid.const")
|
||||
local Event = require("druid.event")
|
||||
local component = require("druid.component")
|
||||
|
||||
local Checkbox = component.create("checkbox", { const.ON_LAYOUT_CHANGE })
|
||||
local Checkbox = component.create("checkbox", { component.ON_LAYOUT_CHANGE })
|
||||
|
||||
|
||||
local function on_click(self)
|
||||
|
@@ -1,10 +1,9 @@
|
||||
--- Druid component template
|
||||
-- @module druid.component
|
||||
-- @local
|
||||
local const = require("druid.const")
|
||||
local component = require("druid.component")
|
||||
|
||||
local Component = component.create("my_component_name", { const.ON_UPDATE })
|
||||
local Component = component.create("my_component_name", { component.ON_UPDATE })
|
||||
|
||||
|
||||
-- Component constructor
|
||||
@@ -12,12 +11,12 @@ function Component:init(...)
|
||||
end
|
||||
|
||||
|
||||
-- Call only if exist interest: const.ON_UPDATE
|
||||
-- Call only if exist interest: component.ON_UPDATE
|
||||
function Component:update(dt)
|
||||
end
|
||||
|
||||
|
||||
-- Call only if exist interest: const.ON_INPUT or const.ON_INPUT_HIGH
|
||||
-- Call only if exist interest: component.ON_INPUT or component.ON_INPUT_HIGH
|
||||
function Component:on_input(action_id, action)
|
||||
return false
|
||||
end
|
||||
@@ -28,7 +27,7 @@ function Component:on_style_change(style)
|
||||
end
|
||||
|
||||
|
||||
-- Call only if exist interest: const.ON_MESSAGE
|
||||
-- Call only if exist interest: component.ON_MESSAGE
|
||||
function Component:on_message(message_id, message, sender)
|
||||
end
|
||||
|
||||
|
@@ -42,7 +42,7 @@ local Event = require("druid.event")
|
||||
local helper = require("druid.helper")
|
||||
local component = require("druid.component")
|
||||
|
||||
local DynamicGrid = component.create("dynamic_grid", { const.ON_LAYOUT_CHANGE })
|
||||
local DynamicGrid = component.create("dynamic_grid", { component.ON_LAYOUT_CHANGE })
|
||||
|
||||
|
||||
local SIDE_VECTORS = {
|
||||
|
@@ -50,7 +50,7 @@ local const = require("druid.const")
|
||||
local component = require("druid.component")
|
||||
local utf8 = require("druid.system.utf8")
|
||||
|
||||
local Input = component.create("input", { const.ON_INPUT, const.ON_FOCUS_LOST })
|
||||
local Input = component.create("input", { component.ON_INPUT, component.ON_FOCUS_LOST })
|
||||
|
||||
|
||||
--- Mask text by replacing every character with a mask character
|
||||
|
@@ -12,11 +12,10 @@
|
||||
|
||||
|
||||
local Event = require("druid.event")
|
||||
local const = require("druid.const")
|
||||
local settings = require("druid.system.settings")
|
||||
local component = require("druid.component")
|
||||
|
||||
local LangText = component.create("lang_text", { const.ON_LANGUAGE_CHANGE })
|
||||
local LangText = component.create("lang_text", { component.ON_LANGUAGE_CHANGE })
|
||||
|
||||
|
||||
--- Component init function
|
||||
|
@@ -31,7 +31,7 @@ local const = require("druid.const")
|
||||
local helper = require("druid.helper")
|
||||
local component = require("druid.component")
|
||||
|
||||
local Progress = component.create("progress", { const.ON_UPDATE, const.ON_LAYOUT_CHANGE })
|
||||
local Progress = component.create("progress", { component.ON_UPDATE, component.ON_LAYOUT_CHANGE })
|
||||
|
||||
|
||||
local function check_steps(self, from, to, exactly)
|
||||
|
@@ -37,7 +37,7 @@ local helper = require("druid.helper")
|
||||
local const = require("druid.const")
|
||||
local component = require("druid.component")
|
||||
|
||||
local Slider = component.create("slider", { const.ON_INPUT_HIGH, const.ON_LAYOUT_CHANGE })
|
||||
local Slider = component.create("slider", { component.ON_INPUT_HIGH, component.ON_LAYOUT_CHANGE })
|
||||
|
||||
|
||||
local function on_change_value(self)
|
||||
|
@@ -28,12 +28,11 @@
|
||||
|
||||
|
||||
local Event = require("druid.event")
|
||||
local const = require("druid.const")
|
||||
local formats = require("druid.helper.formats")
|
||||
local helper = require("druid.helper")
|
||||
local component = require("druid.component")
|
||||
|
||||
local Timer = component.create("timer", { const.ON_UPDATE })
|
||||
local Timer = component.create("timer", { component.ON_UPDATE })
|
||||
|
||||
|
||||
--- Component init function
|
||||
|
Reference in New Issue
Block a user