ADG Lua 

ADG Lua Commit Details

Date:2013-03-28 18:09:01 (6 years 5 months ago)
Author:Nicola Fontana
Branch:master
Commit:6d61a92b63c57746244b88aacc5ab28d63b9b24a
Parents: cacd99d3fc1f68aa224b79dab448bf9ece35c30e
Message:s/adg-demo:regenerate/piston:refresh/

Moved code that refreshes the part after data changes from adg-demo to
piston.lua and renamed to refresh. It will be shared in other
piston-based applications.
Changes:
Madg-demo.lua.in (3 diffs)
Mpiston.lua (1 diff)

File differences

adg-demo.lua.in
213213
214214
215215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232216
233217
234218
......
248232
249233
250234
251
235
252236
253237
254238
......
270254
271255
272256
273
257
274258
275259
276260
ui.btnReset:set_sensitive(sensitiveness)
end
local function regenerate()
-- Regenerate all the models
for _, model in pairs(piston.model) do
model:reset()
model:regenerate(piston)
model:changed()
end
-- Update the title block data
local title_block = canvas.title_block
for field in pairs(Adg.TitleBlock._property) do
local value = piston.data[field:upper()]
if value then title_block[field] = value end
end
end
for field in pairs(piston.data) do
local widget = ui['edit' .. field]
if widget then
end
end
regenerate()
piston:refresh()
ui.editGROOVE.on_toggled = function (self)
local toggled = self:get_active()
end
end
regenerate()
piston:refresh()
area:queue_draw()
lock_ui()
end
piston.lua
543543
544544
545545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
546565
547566
548567
end
})
part.refresh = function (self)
-- Regenerate all the models
for _, model in pairs(self.model) do
model:reset()
model:regenerate(self)
model:changed()
end
-- Update the title block of all the views
for _, view in pairs(self.view) do
local title_block = view.title_block
for field in pairs(Adg.TitleBlock._property) do
local value = self.data[field:upper()]
if value then title_block[field] = value end
end
end
end
return part
end

Archive Download the corresponding diff file

Branches

Tags