View source
From TaskDepender
for
Paste elements
Jump to:
navigation
,
search
''This page describes the possibility to paste a certain number of elements.'' == Introduction == Once a number of elements are [[Cut selected elements|cut]] from the current container, the view can be changed to another container at which the cut elements can be placed. The following describes how this is implemented. == Design == To be able to paste a number of elements that were previously [[Cut selected elements in the Administration|cut]] and stored on the 'clipboard' the Administration simply finds the elements with <tt>ContainerId</tt> equal to <tt>MaxInt</tt> and sets their <tt>ContainerId</tt> to the <tt>Id</tt> of the current container. == Implementation == <syntaxhighlight lang="cpp"> void Admin::Paste(void) { // Find all elements with container MaxInt and are to be placed at the current level. SelectedTasksIds->Clear(); SelectedDeliverablesIds->Clear(); TaskC *containerTask = TasksAdmin->FindTask(SelectedContainerTaskId); // -- Find tasks on 'clipboard' -- TaskC* task = TasksAdmin->First(); while( task != NULL ) { if( task->Container == MaxInt ) { // Task in clipboard found. task->Container = SelectedContainerTaskId; if( containerTask != NULL ) { containerTask->NumContainedElements++; } SelectedTasksIds->Add(task->Id); } task = task->next(); } // -- Find deliverables on 'clipboard' -- DeliverableC* deliverable = DeliverablesAdmin->First(); while( deliverable != NULL ) { if( deliverable->Container == MaxInt ) { // Deliverable on clipboard found. deliverable->Container = SelectedContainerTaskId; if( containerTask != NULL ) { containerTask->NumContainedElements++; } SelectedDeliverablesIds->Add(deliverable->Id); } deliverable = deliverable->next(); } } </syntaxhighlight> ---- * [[Cut selected elements]]
Return to
Paste elements
.
Views
Page
Discussion
View source
History
Personal tools
3.144.12.14
Talk for this IP address
Log in
Navigation
Main page
Recent changes
Help
Search
Toolbox
What links here
Related changes
Special pages