void Primitive::removeRotationControls() { show_rotation_control_ = false; removeControl("rotate_x"); removeControl("rotate_y"); removeControl("rotate_z"); }
void Primitive::removeMovementControls() { show_movement_control_ = false; removeControl("move_x"); removeControl("move_y"); removeControl("move_z"); }
DialogExtraControls::DialogExtraControls(QWidget *parent) : QDialog(parent), m_ui(new Ui::DialogExtraControls) { m_ui->setupUi(this); m_ui->btnUp->setIcon(style()->standardIcon(QStyle::StandardPixmap(QStyle::SP_ArrowUp))); m_ui->btnDown->setIcon(style()->standardIcon(QStyle::StandardPixmap(QStyle::SP_ArrowDown))); m_ui->btnAdd->setIcon(QtIconLoader::icon("list-add", QIcon(":/vpiano/list-add.svg"))); m_ui->btnRemove->setIcon(QtIconLoader::icon("list-remove", QIcon(":/vpiano/list-remove.svg"))); connect( m_ui->btnAdd, SIGNAL(clicked()), SLOT(addControl()) ); connect( m_ui->btnRemove, SIGNAL(clicked()), SLOT(removeControl()) ); connect( m_ui->btnUp, SIGNAL(clicked()), SLOT(controlUp()) ); connect( m_ui->btnDown, SIGNAL(clicked()), SLOT(controlDown()) ); connect( m_ui->extraList, SIGNAL(currentItemChanged(QListWidgetItem *, QListWidgetItem *)), SLOT(itemSelected(QListWidgetItem *, QListWidgetItem*)) ); connect( m_ui->txtLabel, SIGNAL(textEdited(QString)), SLOT(labelEdited(QString)) ); connect( m_ui->spinController, SIGNAL(valueChanged(int)), SLOT(controlChanged(int)) ); connect( m_ui->cboControlType, SIGNAL(currentIndexChanged(int)), SLOT(typeChanged(int)) ); connect( m_ui->chkSwitchDefOn, SIGNAL(toggled(bool)), SLOT(defOnChanged(bool)) ); connect( m_ui->spinKnobDef, SIGNAL(valueChanged(int)), SLOT(defaultChanged(int)) ); connect( m_ui->spinSpinDef, SIGNAL(valueChanged(int)), SLOT(defaultChanged(int)) ); connect( m_ui->spinSliderDef, SIGNAL(valueChanged(int)), SLOT(defaultChanged(int)) ); connect( m_ui->spinKnobMax, SIGNAL(valueChanged(int)), SLOT(maximumChanged(int)) ); connect( m_ui->spinSpinMax, SIGNAL(valueChanged(int)), SLOT(maximumChanged(int)) ); connect( m_ui->spinSliderMax, SIGNAL(valueChanged(int)), SLOT(maximumChanged(int)) ); connect( m_ui->spinKnobMin, SIGNAL(valueChanged(int)), SLOT(minimumChanged(int)) ); connect( m_ui->spinSpinMin, SIGNAL(valueChanged(int)), SLOT(minimumChanged(int)) ); connect( m_ui->spinSliderMin, SIGNAL(valueChanged(int)), SLOT(minimumChanged(int)) ); connect( m_ui->spinValueOff, SIGNAL(valueChanged(int)), SLOT(minimumChanged(int)) ); connect( m_ui->spinValueOn, SIGNAL(valueChanged(int)), SLOT(maximumChanged(int)) ); connect( m_ui->spinSliderSize, SIGNAL(valueChanged(int)), SLOT(sizeChanged(int)) ); connect( m_ui->spinValue, SIGNAL(valueChanged(int)), SLOT(minimumChanged(int)) ); connect( m_ui->btnFileSyx, SIGNAL(clicked()), SLOT(openFile()) ); }
void BoundingBox::showBoundingBoxControl(bool show) { for (unsigned int i = 0; i < control_.markers.size(); i++) control_.markers[i].color.a = show ? BBOX_MAX_ALPHA : BBOX_MIN_ALPHA; removeControl(BOUNDING_BOX_CONTROL_NAME); object_.controls.push_back(control_); }
void ControlResizer::removeControl(std::map<HWND, std::shared_ptr<ControlResizerItem>>& controls, HWND hwndCtrl) const { controls.erase(hwndCtrl); for (auto& control : controls) { removeControl(control.second->controls, hwndCtrl); } }
void cContextMenu::clear() { // Iterate over all known controls and see how high this thing is Iterator it; for (it = entries.begin(); it != entries.end(); ++it) { removeControl((*it)); delete *it; } entries.clear(); setCallback(0, 0); // Reset callback }
void Object::removePregraspPositions() { show_pregrasp_control_ = false; removeControl(pregrasp1_.name); removeControl(pregrasp2_.name); removeControl(pregrasp3_.name); removeControl(pregrasp4_.name); removeControl(pregrasp5_.name); removeControl(pregrasp6_.name); }
/*!\func * add state with name * \param - name - name of new state * \return id of new state (or -1) */ bool Data::removeState(const qint32 id) { if(states.contains(id)) { QList<qint32> list; foreach(Relation relation, relations) if((relation.getDest().getId() == id)||(relation.getSource().getId() == id)) list<<relation.getId(); foreach(qint32 id, list) removeRelation(id); list.clear(); foreach(Control control, controls) if(control.getState().getId() == id) list<<control.getId(); foreach(qint32 id, list) removeControl(id); states.remove(id); emit sRemoveState(id); return true; }
void ControlResizer::removeControl(int ctlId) const { removeControl(GetDlgItem(window->hWnd, ctlId)); }
void ControlResizer::removeControl(HWND hwndCtl) const { removeControl(window->controls, hwndCtl); }
void Window::removeControls(std::vector<Control*> pControls) throw (WindowException) { for (std::vector<Control*>::iterator iter = pControls.begin(); iter != pControls.end(); iter++) removeControl(*iter); }
bool ofxGuiGrid::mousePressed( int x, int y, int button ) { if ( !mIsActive ) { //! This control is not active now return false; } ofxPoint2f inside = mouseToLocal( x, y ); mMouseIsDown = isPointInsideMe( inside ); if ( mMouseIsDown ) { // ----------------------- if ( bDblClickMode ) { // TODO mNowClickTime = ofGetSystemTime(); if ( mNowClickTime - mPrevClickTime <= OFXGUI_DBLCLICK_INTERVAL ) { mPrevClickTime = 0; // reset switchDblClickMode( false ); return true; } mPrevClickTime = mNowClickTime; return true; } // ----------------------- //! Check the controls first bool handled = false; for ( int i = 0; i < mObjects.size(); i++ ) { handled = (ofxGuiObject*)mObjects[i]->mousePressed( x, y, button ); if ( handled ) { return true; // we got the result } } // ----------------------- int id = mouseToGridId( inside ); setSelectedId( id ); mGlobals->mListener->handleGui( mParamId, kofxGui_Set_Int, &mCamIndex, sizeof(int) ); mDragging = false; //! reset the value if ( id != -1 ) { clickingPoint = inside; mValidSelection = true; } else { mValidSelection = false; } // ----------------------- //! Double click check mNowClickTime = ofGetSystemTime(); if ( id != -1 && utils->isUsed( id ) && mNowClickTime - mPrevClickTime <= OFXGUI_DBLCLICK_INTERVAL ) { mPrevClickTime = 0; // reset the time switchDblClickMode( true ); return true; } mPrevClickTime = mNowClickTime; // ------------------------ //! ----- Add controls ----- //! Control temp values int x, y, textWidth; string btnText = ""; ofxGuiButton* btn; //! The reset button if ( bShowResetBtn ) { removeControl( mResetBtnId ); if ( id != -1 && utils->isUsed( id )) { //! The position is relate with the panel x = mObjX + getGridX( id % mXGrid ) + 5; y = mObjY + getGridY( id / mXGrid ) + getGridHeight() - 5 - OFXGUI_BUTTON_HEIGHT; //! If the grid is too small, we remove the text btnText = "Reset"; textWidth = mGlobals->mParamFont.stringWidth( btnText ); if ( getGridWidth() < textWidth + 5 + OFXGUI_BUTTON_HEIGHT ) { btnText = ""; } btn = (ofxGuiButton*)addButton( mResetBtnId, btnText, x, y, OFXGUI_BUTTON_HEIGHT, OFXGUI_BUTTON_HEIGHT, kofxGui_Button_Off, kofxGui_Button_Trigger ); btn->setHighlightMode( true ); } } //! The setting button if ( bShowSettingBtn ) { removeControl( mSettingBtnId ); if ( id != -1 && utils->isUsed( id ) ) { y -= 15; btnText = "Setting"; textWidth = mGlobals->mParamFont.stringWidth( btnText ); if ( getGridWidth() < textWidth + 5 + OFXGUI_BUTTON_HEIGHT ) { btnText = ""; } btn = (ofxGuiButton*)addButton( mSettingBtnId, btnText, x, y, OFXGUI_BUTTON_HEIGHT, OFXGUI_BUTTON_HEIGHT, kofxGui_Button_Off, kofxGui_Button_Trigger ); btn->setHighlightMode( true ); } } } return mMouseIsDown; }
void MapTool:: buttonCallback(int buttonSlotIndex, Vrui::InputDevice::ButtonCallbackData* cbData) { statsMan.start(StatsManager::EDITLINE); Geometry::Point<double,3> pos = getPosition(); pos = crusta->mapToUnscaledGlobe(pos); Shape*& curShape = crusta->getMapManager()->getActiveShape(toolId); if (cbData->newButtonState) { if (buttonSlotIndex==0) { switch (mode) { case MODE_IDLE: { createShape(curShape, curControl, pos); crusta->getMapManager()->updateActiveShape(toolId); mode = MODE_DRAGGING; break; } case MODE_SELECTING_CONTROL: { selectControl(pos); addControlPoint(curShape, curControl, pos); mode = MODE_DRAGGING; break; } case MODE_SELECTING_SHAPE: { if (curShape != NULL) { deleteShape(curShape, curControl); } break; } default: break; } } else { switch (mode) { case MODE_DRAGGING: { removeControl(curShape, curControl); //destroy empty shapes if (curShape->getControlPoints().size()==0) { deleteShape(curShape, curControl); mode = MODE_IDLE; } else mode = MODE_SELECTING_CONTROL; break; } case MODE_IDLE: case MODE_SELECTING_CONTROL: { selectShape(pos); mode = MODE_SELECTING_SHAPE; break; } default: break; } } } else { if (buttonSlotIndex==0) { switch (mode) { case MODE_DRAGGING: { mode = MODE_SELECTING_CONTROL; break; } default: break; } } else { switch (mode) { case MODE_SELECTING_SHAPE: { if (curShape != NULL) { mode = MODE_SELECTING_CONTROL; } else { mode = MODE_IDLE; } break; } default: break; } } } statsMan.stop(StatsManager::EDITLINE); }
void Primitive::removeDescriptionControl() { show_description_control_ = false; removeControl("description_control"); }
void Primitive::removeMeasureControl() { show_measure_control_ = false; removeControl("measure_control"); }
void Billboard::removeTrajectoryControls() { show_trajectory_control_ = false; removeControl("trajectory_control"); }