feat(marker): fanen Marker — tabel, detalje (plan/kørsel/riv/tving lager/marksiloer), markflåde, Start nu/Stop
This commit is contained in:
@@ -65,7 +65,7 @@ function SmartPickupFrame:flowCells(adEnv, run)
|
||||
end
|
||||
|
||||
-- Hele rækken klikbar med musen (Bitmap-rækker har ingen onClick). Klikket gemmes kun som
|
||||
-- pendingJumpRunId; hoppet sker i update(), fordi genopbygningen sletter netop denne række.
|
||||
-- pendingClick; handlingen køres i update(), fordi genopbygningen sletter netop denne række.
|
||||
local MOUSE_LEFT = Input ~= nil and Input.MOUSE_BUTTON_LEFT or 1
|
||||
|
||||
local function isInside(element, posX, posY)
|
||||
@@ -74,7 +74,7 @@ local function isInside(element, posX, posY)
|
||||
return posX >= position[1] and posX <= position[1] + size[1] and posY >= position[2] and posY <= position[2] + size[2]
|
||||
end
|
||||
|
||||
function SmartPickupFrame:makeRowClickable(row, runId)
|
||||
function SmartPickupFrame:makeRowClickable(row, action)
|
||||
local frame = self
|
||||
local baseMouseEvent = row.mouseEvent
|
||||
row.mouseEvent = function(element, posX, posY, isDown, isUp, button, eventUsed)
|
||||
@@ -82,7 +82,7 @@ function SmartPickupFrame:makeRowClickable(row, runId)
|
||||
-- også inden for listens synlige udsnit: rækker scrollet ud af syne må ikke fange klik
|
||||
if not used and not eventUsed and isUp and button == MOUSE_LEFT and (element.getIsVisible == nil or element:getIsVisible())
|
||||
and isInside(element, posX, posY) and isInside(frame.boxLayout, posX, posY) then
|
||||
frame.pendingJumpRunId = runId
|
||||
frame.pendingClick = action
|
||||
return true
|
||||
end
|
||||
return used
|
||||
@@ -100,7 +100,8 @@ function SmartPickupFrame:fillOverviewRows(adEnv)
|
||||
for _, run in ipairs(group.runs) do
|
||||
local cells = self:addCellRow(self.flowPrefab, self:flowCells(adEnv, run))
|
||||
if cells[1] ~= nil and cells[1].parent ~= nil then
|
||||
self:makeRowClickable(cells[1].parent, run.id)
|
||||
local runId = run.id
|
||||
self:makeRowClickable(cells[1].parent, function(frame) frame:openFlow(runId) end)
|
||||
end
|
||||
table.insert(self.overviewRows, {runId = run.id, cells = cells})
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user