Many thanks, Im really glad I found that attribute, and I would really have 
loved to have it from the start, specified in the positions part of the 
documentation, since through this many positions problems can be solved.

In particular, the "delete all nodes" function can, through this,  get a 
list of all the given nodes positions gnx associated also with each of 
their parent's gnx.
This way we can recursively go through that list and delete all the nodes, 
even with outline changes.
I commented this in this post after realizing about that:
https://groups.google.com/forum/?hl=en#!topic/leo-editor/IR8tV9a99NY

Also, for several selected nodes moving/cut/paste/moving-right-or-left on 
an outline, I am already using it myself with they pyqt and its really 
convenient.

Sorry for the rudimentary coding (I did this with the Leo-coding utility Im 
preparing for new users), but if anyone wants the "several nodes moving" 
functionality right now, here is the code. Only for copying now but soon 
will be available for all the options.

MyValue=g.app.gui.runAskOkDialog(c,'Select the nodes',message='Please 
> select the nodes you want to move, then press Next',text='Ok')
> c.db['Button_NextHeader']='Next'
> c.db['Button_NextStatusLine']='Next'
> c.db['Button_NextVars']=list()
> del c.db["Button_NextColor"]
> c.db["Button_NextColor"]='#CC9900'
> if c.db.has_key('Button_Current_List'):
>     c.db['Button_NextID']=len(c.db['Button_Current_List'])
> else:
>     c.db['Button_Current_List']=list()
>     c.db['Button_NextID']=0
>
> def MyButtonCommand(c=c,ButtonID=c.db['Button_NextID']):
>     if c.db.has_key('Button_Current_List'):
>         for item in c.db['Button_Current_List']:
>             item[0].parent().removeAction(item[0])
>         c.db.__delitem__('Button_Current_List')
>     NodesToMove=list()
>     for MySelectedNode in c.getSelectedPositions():
>         MyNodeGNX=MySelectedNode.gnx
>         NodesToMove.append(MyNodeGNX)
>         g.es(MySelectedNode.h)
>     c.db['Button_NextHeader']='Copy'
>     c.db['Button_NextStatusLine']='Copy'
>     c.db['Button_NextVars']=list()
>     c.db['Button_NextVars'].append(NodesToMove)
>     del c.db["Button_NextColor"]
>     c.db["Button_NextColor"]='#82CD82'
>     if c.db.has_key('Button_Current_List'):
>         c.db['Button_NextID']=len(c.db['Button_Current_List'])
>     else:
>         c.db['Button_Current_List']=list()
>         c.db['Button_NextID']=0
>
>     def MyButtonCommand(c=c,ButtonID=c.db['Button_NextID']):
>         MySlot1=c.db['Button_Current_List'][ButtonID][1]
>      
>         if c.db.has_key('Button_Current_List'):
>             for item in c.db['Button_Current_List']:
>                 item[0].parent().removeAction(item[0])
>             c.db.__delitem__('Button_Current_List')
>         DestinyNode=c.p.gnx
>         for OriginGNX in MySlot1:
>             for MyNode in c.all_positions():
>                 if MyNode.gnx == OriginGNX and MyNode.parent().gnx != 
> DestinyNode:
>                     for node in c.all_positions():
>                         if node.gnx==DestinyNode:
>                             DestinyNodePos=node.copy()
>                             break
>                     c.selectPosition(MyNode)
>                     
> NewPos=c.p.copyTreeFromSelfTo(DestinyNodePos.insertAsLastChild())
>                     break
>
>         c.redraw()
>
>     from leo.plugins.mod_scripting import scriptingController
>     TempButtonHold=scriptingController(c).createIconButton( 
> c.db['Button_NextHeader'], command = MyButtonCommand, statusLine = 
> c.db['Button_NextStatusLine'], bg="#FF0000" )
>     if c.db.has_key("Button_NextColor"):
>         Aux_Var_For_Creating_Button_XX_00=c.db["Button_NextColor"]
>         TempButtonHold.button.setStyleSheet('QWidget {background-color: 
> '+Aux_Var_For_Creating_Button_XX_00+' }')
>         
>     c.db['Button_Current_List'].append(list())
>     
> c.db['Button_Current_List'][c.db['Button_NextID']].append(TempButtonHold)
>     
> c.db['Button_Current_List'][c.db['Button_NextID']].extend(c.db['Button_NextVars'])
>
> from leo.plugins.mod_scripting import scriptingController
> TempButtonHold=scriptingController(c).createIconButton( 
> c.db['Button_NextHeader'], command = MyButtonCommand, statusLine = 
> c.db['Button_NextStatusLine'], bg="#FF0000" )
> if c.db.has_key("Button_NextColor"):
>     Aux_Var_For_Creating_Button_XX_00=c.db["Button_NextColor"]
>     TempButtonHold.button.setStyleSheet('QWidget {background-color: 
> '+Aux_Var_For_Creating_Button_XX_00+' }')
>     
> c.db['Button_Current_List'].append(list())
> c.db['Button_Current_List'][c.db['Button_NextID']].append(TempButtonHold)
>
>>
>> c.db['Button_Current_List'][c.db['Button_NextID']].extend(c.db['Button_NextVars'])
>
>
 

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to