+void SHAPERGUI_ToolbarItemsDlg::onDown()
+{
+ QModelIndex aCurrentIdx = myItemsList->currentIndex();
+ if (aCurrentIdx.isValid()) {
+ int aNb = myItemsList->count();
+ int aRow = aCurrentIdx.row();
+ if (aRow < (aNb - 1)) {
+ QListWidgetItem* aItem = myItemsList->takeItem(aRow);
+ aRow++;
+ myItemsList->insertItem(aRow, aItem);
+ myItemsList->setCurrentRow(aRow);
+ }
+ }
+}
+
+QIntList SHAPERGUI_ToolbarItemsDlg::freeItems() const
+{
+ return getItems(myCommandsList, 1);
+}
+
+QIntList SHAPERGUI_ToolbarItemsDlg::toolbarItems() const
+{
+ return getItems(myItemsList, 0);
+}
+
+QIntList SHAPERGUI_ToolbarItemsDlg::getItems(QListWidget* theWidget, int theStart) const
+{
+ QIntList aList;
+ SHAPERGUI_CommandIdItem* aItem = 0;
+ int aNb = theWidget->count();
+ for (int i = theStart; i < aNb; i++) {
+ aItem = (SHAPERGUI_CommandIdItem*)theWidget->item(i);
+ aList.append(aItem->id());
+ }
+ return aList;
+}
+
+void SHAPERGUI_ToolbarItemsDlg::onHelp()
+{
+ SUIT_Application* app = SUIT_Session::session()->activeApplication();
+ if (app)
+ app->onHelpContextModule("SHAPER", "Introduction.html", "edit-toolbar-dialog-box");
+}