IFmapper has a clipboard, that can hold an arbitrary number of items. You can use this to
The clipboard is realised as a normal section outside of the current map. Insertion and deletion work the normal way.
«*»= void ClearClip() while(clipboard->itemNum>0) DeleteItem(clipboard,&clipboard->items[0]); clipboard->items=NULL; @
[[CutToClip]] moves all selected items from the current section to the clipboard. The current content of clipboard is deleted. «*»= void CutToClip() int i; Item *ci;
ClearClip();
for(i=0;i<currentSection->itemNum;i++) if(isSelected(¤tSection->items[i])) ci=NewItem(clipboard); CopyItemTo(¤tSection->items[i],ci); DeleteItem(currentSection,¤tSection->items[i]); i–; @
[[CopyToClip]] works similar to [[CutToClip]], but the selected items are deleted from the current section. «*»= void CopyToClip() Item *ci; int i;
ClearClip();
for(i=0;i<currentSection->itemNum;i++) if(isSelected(¤tSection->items[i])) ci=NewItem(clipboard); CopyItemTo(¤tSection->items[i],ci); @
Paste the content of the clipboard to the current section. this is done in 4 steps:
DeselectAll(); for(i=0;i<clipboard->itemNum;i++) ci=NewItem(currentSection); CopyItemTo(&clipboard->items[i],ci);
SelectedRect(&r); mx=r.topLeft.x-currentSection->si.xoffset; my=r.topLeft.y-currentSection->si.yoffset;
for(i=0;i<currentSection->itemNum;i++) if(isSelected(¤tSection->items[i])) MoveItem(¤tSection->items[i],-mx,-my); @