LRESULT Twindow::TwidgetSubclassTbr::onContextMenu(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM lParam) { static const char_t *menu[]= {_l("Reset"),_l("Edit"),NULL}; switch (self->selectFromMenu(menu,0)) { case 0: if (!onReset()) { return 0; } else { break; } case 1: { if (!onEdit()) { return 0; } else { break; } } default: return 0; } if (bind && bind->onClick) { (self->*bind->onClick)(); } else { self->cfg2dlg(); } return 0; }
EntitiesTreeWidget::EntitiesTreeWidget(QWidget *parent) : QTreeWidget(parent) { applicationNode = new QTreeWidgetItem(this,QStringList() << "Application"); modulesNode = new QTreeWidgetItem(this,QStringList() << "Modules"); resourcesNode = new QTreeWidgetItem(this,QStringList() << "Resources"); templatesNode = new QTreeWidgetItem(this,QStringList() << "Templates"); applicationNode->setIcon(0,QIcon(":/images/folderapp_ico.png")); modulesNode->setIcon(0,QIcon(":/images/foldermod_ico.png")); resourcesNode->setIcon(0,QIcon(":/images/folderres_ico.png")); templatesNode->setIcon(0,QIcon(":/images/folder_ico.png")); addTopLevelItem(applicationNode); addTopLevelItem(modulesNode); addTopLevelItem(resourcesNode); addTopLevelItem(templatesNode); setExpandsOnDoubleClick(false); setContextMenuPolicy(Qt::CustomContextMenu); resizeColumnToContents(0); connect(this, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)),this,SLOT(onItemDoubleClicked(QTreeWidgetItem*,int))); connect(this,SIGNAL(customContextMenuRequested(QPoint)),this,SLOT(onContext(QPoint))); openFile = new QAction("Open File",this); importFile = new QAction("Import Files...",this); topLevelMenu.addAction(openFile); topLevelMenu.addAction(importFile); loadFiles = new QAction("Load",this); QAction *separator = new QAction(this); separator->setSeparator(true); reopen = new QAction("Reopen",this); remove = new QAction("Remove",this); secondLevelMenu.addAction(loadFiles); secondLevelMenu.addAction(separator); secondLevelMenu.addAction(reopen); secondLevelMenu.addAction(remove); edit = new QAction("Edit",this); leafLevelMenu.addAction(edit); connect(loadFiles,SIGNAL(triggered()),this,SLOT(onLoadFile())); connect(openFile,SIGNAL(triggered()),this,SIGNAL(openFiles())); connect(importFile,SIGNAL(triggered()),this,SIGNAL(importFiles())); connect(edit,SIGNAL(triggered()),this,SLOT(onEdit())); connect(remove,SIGNAL(triggered()),this,SLOT(onRemove())); }
// -------------------------------------------------------------------------- ctkAddRemoveComboBox::ctkAddRemoveComboBox(QWidget* _parent) : Superclass(_parent) , d_ptr(new ctkAddRemoveComboBoxPrivate(*this)) { Q_D(ctkAddRemoveComboBox); d->setupUi(this); // connect d->connectComboBox(d->ComboBox); this->connect(d->AddPushButton, SIGNAL(pressed()), SLOT(onAdd())); this->connect(d->RemovePushButton, SIGNAL(pressed()), SLOT(onRemove())); this->connect(d->EditPushButton, SIGNAL(pressed()), SLOT(onEdit())); // Add default 'empty item' d->insertEmptyItem(); }
void LLPanelOutfitsInventory::onCustomAction(const LLSD& userdata) { if (!isActionEnabled(userdata)) return; const std::string command_name = userdata.asString(); if (command_name == "new") { onSave(); } if (command_name == "edit") { onEdit(); } if (command_name == "wear") { onWearButtonClick(); } // Note: This option has been removed from the gear menu. if (command_name == "add") { onAdd(); } if (command_name == "remove") { onRemove(); } if (command_name == "rename") { onClipboardAction("rename"); } if (command_name == "remove_link") { onClipboardAction("delete"); } if (command_name == "delete") { onClipboardAction("delete"); } updateListCommands(); updateVerbs(); }
/** * \brief widget, creates the Options Tab Shortcuts Widget * \return QWidget*, points to the previously created widget */ QWidget *OptionsTabShortcuts::widget() { if ( w ) return 0; w = new OptShortcutsUI(); OptShortcutsUI *d = (OptShortcutsUI *)w; d->treeShortcuts->setColumnWidth(0, 320); d->add->setEnabled(false); d->remove->setEnabled(false); d->edit->setEnabled(false); connect(d->treeShortcuts, SIGNAL(itemSelectionChanged()), this, SLOT(onItemSelectionChanged())); connect(d->treeShortcuts, SIGNAL(itemDoubleClicked(QTreeWidgetItem *, int)), this, SLOT(onItemDoubleClicked(QTreeWidgetItem *, int))); connect(d->add, SIGNAL(clicked()), this, SLOT(onAdd())); connect(d->remove, SIGNAL(clicked()), this, SLOT(onRemove())); connect(d->edit, SIGNAL(clicked()), this, SLOT(onEdit())); connect(d->restoreDefaults, SIGNAL(clicked()), this, SLOT(onRestoreDefaults())); return w; }
EntitiesTreeWidget::EntitiesTreeWidget(QWidget *parent) : QTreeWidget(parent) { applicationNode = new QTreeWidgetItem(this,QStringList() << "Application"); modulesNode = new QTreeWidgetItem(this,QStringList() << "Modules"); resourcesNode = new QTreeWidgetItem(this,QStringList() << "Resources"); templatesNode = new QTreeWidgetItem(this,QStringList() << "Templates"); applicationNode->setIcon(0,QIcon(":/folder-app.svg")); modulesNode->setIcon(0,QIcon(":/folder-mod.svg")); resourcesNode->setIcon(0,QIcon(":/folder-res.svg")); templatesNode->setIcon(0,QIcon(":/folder.svg")); addTopLevelItem(applicationNode); addTopLevelItem(modulesNode); addTopLevelItem(resourcesNode); addTopLevelItem(templatesNode); setExpandsOnDoubleClick(false); setContextMenuPolicy(Qt::CustomContextMenu); resizeColumnToContents(0); connect(this, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)),this,SLOT(onItemDoubleClicked(QTreeWidgetItem*,int))); connect(this,SIGNAL(customContextMenuRequested(QPoint)),this,SLOT(onContext(QPoint))); openFile = new QAction("Open File",this); importFile = new QAction("Import Files...",this); topLevelMenu.addAction(openFile); topLevelMenu.addAction(importFile); loadFiles = new QAction("Load",this); QAction *separator = new QAction(this); separator->setSeparator(true); reopen = new QAction("Refresh",this); remove = new QAction("Remove",this); editApplication = new QAction("Edit",this); secondLevelMenu.addAction(loadFiles); secondLevelMenu.addAction(editApplication); secondLevelMenu.addAction(separator); secondLevelMenu.addAction(reopen); secondLevelMenu.addAction(remove); edit = new QAction("Edit",this); leafLevelMenu.addAction(edit); connect(loadFiles,SIGNAL(triggered()),this,SLOT(onLoadFile())); connect(editApplication,SIGNAL(triggered()),this,SLOT(onEditApplication())); connect(openFile,SIGNAL(triggered()),this,SIGNAL(openFiles())); connect(importFile,SIGNAL(triggered()),this,SIGNAL(importFiles())); connect(edit,SIGNAL(triggered()),this,SLOT(onEdit())); connect(remove,SIGNAL(triggered()),this,SLOT(onRemove())); connect(reopen,SIGNAL(triggered()),this,SLOT(onReopen())); #if defined(WIN32) ext_editor = "notepad.exe"; #else ext_editor = "xdg-open"; #endif setDragEnabled(true); setDragDropMode(DragOnly); }
/** * \brief Emet le signal que le bouton éditer à été clické */ void DocumentEditorRow::edit() { emit onEdit(this); }