Last Modified: 2023-03-11

Action editor model

index.lua

.
├── actionCommand
│   ├── cancel.lua
│   ├── delete.lua
│   └── save.lua
├── actionCommandButtons.lua
├── actionCommandPropsTable.lua
├── actionCommandTable.lua
├── actionTable.lua
├── buttons.lua
├── commandbox.lua
├── controller
│   ├── cancel.lua
│   ├── copy.lua
│   ├── create.lua
│   ├── delete.lua
│   ├── index.lua
│   ├── paste.lua
│   ├── save.lua
│   ├── selectAction.lua
│   └── selectActionCommand.lua
├── index.lua
├── model.lua
└── selector.lua
local M = {name = name, views = {
  "index", -- this creates actionIcon button
  "selector", -- context:mapCommands "selectAction", "selectActionCommand"
  "actionTable", -- lists actions in a page
  "actionCommandTable",
  "actionCommandPropsTable",
  "commandbox", -- animation.play, pause, ..
  "buttons",
  "actionCommandButtons"
}}

...
...

function M:create(UI)
  if self.sceneGroup then return end
  --
  self.sceneGroup = UI.editor.sceneGroup
  controller:init(UI, self.sceneGroup, categoryMap, selectbox)
  -- print("create", self.name)
  local posX, posY = display.contentCenterX/2 + 42, -2
  -----------------------------------------
  self:createIcon(UI, posX, posY)
  -----------------------------------------
  self:createSelectbox(UI, posX, posY)
  -----------------------------------------
  local scrollListener  = function(e) end
  local scrollView = widget.newScrollView{
       top                    = 22,
       left                   = display.contentCenterX,
       width                  = 100,
       height                 = 240,
    -- height                 = #models*18,
       scrollWidth            = display.contentWidth*0.5,
       scrollHeight           = display.contentHeight*0.8,
       hideBackground         = false,
       isBounceEnabled        = false,
       verticalScrollDisabled = false,
       backgroundColor        = {1.0},
       listener               = scrollListener
  }
  self.sceneGroup:insert(scrollView)
  -----------------------------------------
  self:createTable(scrollView, models)
  -----------------------------------------
  UI.editor.actionEditor = self
  self.sceneGroup.actionEditor = scrollView
  --
  self:hide()
  -- self:show()
end