--- a/gui_editactions.cpp Mon May 06 15:39:45 2013 +0300 +++ b/gui_editactions.cpp Tue May 07 00:22:01 2013 +0300 @@ -684,4 +684,28 @@ History::addEntry (new EditHistory (indices, oldCopies, newCopies)); g_win->refresh (); } +} + +// ============================================================================= +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +// ============================================================================= +void setGroup (const LDObject::Group group) { + for (LDObject* obj : g_win->sel ()) + obj->setGroup (group); + + g_win->refresh (); +} + +#define GROUP_ACTION(N, KEY) \ + MAKE_ACTION (group##N, "Group " #N, "group", "Set group of selected objects to " #N, CTRL_SHIFT (KEY)) { \ + setGroup (LDObject::N); \ + } + +GROUP_ACTION (A, 1) +GROUP_ACTION (B, 2) +GROUP_ACTION (C, 3) +GROUP_ACTION (D, 4) + +MAKE_ACTION (groupNone, "No Group", "group-no", "Unset objects' group", CTRL_SHIFT (0)) { + setGroup (LDObject::NoGroup); } \ No newline at end of file