Mercurial > MadButterfly
comparison pyink/comp_dock.py @ 1333:3cbc1ab15541
Implement the function to create a link to a component.
- It creates a svg:use for a component in the component list.
- The svg:use node is inserted into current layer.
author | Thinker K.F. Li <thinker@codemud.net> |
---|---|
date | Mon, 31 Jan 2011 18:19:23 +0800 |
parents | a0d3a4f8e99d |
children | 194c7a831083 |
comparison
equal
deleted
inserted
replaced
1332:a0d3a4f8e99d | 1333:3cbc1ab15541 |
---|---|
232 tl_name = 'New Timeline %d' % (idx) | 232 tl_name = 'New Timeline %d' % (idx) |
233 idx = idx + 1 | 233 idx = idx + 1 |
234 pass | 234 pass |
235 return tl_name | 235 return tl_name |
236 | 236 |
237 if self._current_component() == 'main': | 237 if self._domview_ui.get_current_component() == 'main': |
238 return | 238 return |
239 | 239 |
240 tl_name = _make_timeline_name() | 240 tl_name = _make_timeline_name() |
241 print tl_name | 241 print tl_name |
242 self._domview_ui.add_timeline(tl_name) | 242 self._domview_ui.add_timeline(tl_name) |
311 | 311 |
312 treeview.set_cursor(path, col, True) | 312 treeview.set_cursor(path, col, True) |
313 pass | 313 pass |
314 | 314 |
315 def on_link_component_activate(self, *args): | 315 def on_link_component_activate(self, *args): |
316 desktop = self._desktop | |
317 | |
318 comp_name = self._current_component() | |
319 cur_layer_group_sp = desktop.currentLayer() | |
320 cur_layer_group = cur_layer_group_sp.repr | |
321 | |
322 self._domview_ui.link_to_component(comp_name, cur_layer_group) | |
316 pass | 323 pass |
317 | 324 |
318 def on_switch_component_activate(self, *args): | 325 def on_switch_component_activate(self, *args): |
319 self._switch_component() | 326 self._switch_component() |
320 pass | 327 pass |