// Right Click Release void GuiMaterialPreview::onRightMouseUp(const GuiEvent &event) { mouseUnlock(); mMouseState = None; Parent::onRightMouseUp( event ); // Copyright (C) 2013 WinterLeaf Entertainment LLC. }
void GuiDecoyCtrl::onMouseUp(const GuiEvent &event) { mouseUnlock(); setUpdate(); //this code is pretty hacky. right now there is no way that guiCanvas will allow sending more than //one signal to one gui control at a time. if(mIsDecoy == true) { mVisible = false; GuiControl *parent = getParent(); Point2I localPoint = parent->globalToLocalCoord(event.mousePoint); GuiControl *tempControl = parent->findHitControl(localPoint); //the decoy control has the responsibility of keeping track of the decoyed controls status if( mDecoyReference != NULL && tempControl == mDecoyReference) tempControl->onMouseUp(event); else if(mDecoyReference != NULL && tempControl != mDecoyReference) { //as explained earlier, this control was written in the mindset for buttons. //nothing bad should ever happen if not a button due to the checks in this function though. GuiButtonBaseCtrl *unCastCtrl = NULL; unCastCtrl = dynamic_cast<GuiButtonBaseCtrl *>( mDecoyReference ); if(unCastCtrl != NULL) unCastCtrl->resetState(); } mVisible = true; } }
void GuiTextEditCtrl::onMouseUp(const GuiEvent &event) { TORQUE_UNUSED(event); mDragHit = false; mScrollDir = 0; mouseUnlock(); }
void GuiTextEditSliderCtrl::onMouseUp(const GuiEvent &event) { // If we're not active then skip out. if ( !mActive || !mAwake || !mVisible ) { Parent::onMouseUp(event); return; } mMulInc = 0.0f; mouseUnlock(); if ( mTextAreaHit != None ) selectAllText(); //if we released the mouse within this control, then the parent will call //the mConsoleCommand other wise we have to call it. Parent::onMouseUp(event); //if we didn't release the mouse within this control, then perform the action // if (!cursorInControl()) execConsoleCallback(); execAltConsoleCallback(); //Set the cursor position to where the user clicked mCursorPos = calculateCursorPos( event.mousePoint ); mTextAreaHit = None; }
void GuiGradientCtrl::onMouseUp(const GuiEvent &) { //if we released the mouse within this control, perform the action if (mActive && mMouseDown ) mMouseDown = false; mouseUnlock(); }
void GuiTextEditCtrl::onMouseUp(const GuiEvent &event) { TORQUE_UNUSED(event); mDragHit = false; mScrollDir = 0; mouseUnlock(); onChangeCursorPos(); //.logicking }
void ForestEditorCtrl::on3DMouseUp( const Gui3DMouseEvent &evt ) { if ( !isMouseLocked() ) return; if ( mTool ) mTool->on3DMouseUp( evt ); mouseUnlock(); }
void TextEdit::onMouseUp(const SimGui::Event &event) { event; dragHit = FALSE; scrollDir = 0; mouseUnlock(); //let the parent get the event Parent::onMouseUp(event); }
bool EditTSCtrl::onInputEvent(const InputEventInfo & event) { if(mRightMousePassThru && event.deviceType == MouseDeviceType && event.objInst == KEY_BUTTON1 && event.action == SI_BREAK) { // if the right mouse pass thru is enabled, // we want to reactivate mouse on a right mouse button up GuiCanvas *pCanvas = getRoot(); if( !pCanvas ) return false; PlatformWindow *pWindow = static_cast<GuiCanvas*>(getRoot())->getPlatformWindow(); if( !pWindow ) return false; PlatformCursorController *pController = pWindow->getCursorController(); if( !pController ) return false; pWindow->setMouseLocked(false); pCanvas->setCursorON( true ); if(mDisplayType != DisplayTypePerspective) { mouseUnlock(); pCanvas->setForceMouseToGUI(false); pCanvas->setClampTorqueCursor(mLastMouseClamping); } } if(mMiddleMousePassThru && event.deviceType == MouseDeviceType && event.objInst == KEY_BUTTON2 && event.action == SI_BREAK) { // if the middle mouse pass thru is enabled, // we want to reactivate mouse on a middle mouse button up GuiCanvas *pCanvas = getRoot(); if( !pCanvas ) return false; PlatformWindow *pWindow = static_cast<GuiCanvas*>(getRoot())->getPlatformWindow(); if( !pWindow ) return false; PlatformCursorController *pController = pWindow->getCursorController(); if( !pController ) return false; pWindow->setMouseLocked(false); pCanvas->setCursorON( true ); } // we return false so that the canvas can properly process the right mouse button up... return false; }
void GuiRiverEditorCtrl::on3DMouseUp(const Gui3DMouseEvent & event) { // Keep the Gizmo up to date. mGizmo->on3DMouseUp( event ); mStartWidth = -1.0f; mStartHeight = -1.0f; mSavedDrag = false; mouseUnlock(); }
void GuiSliderCtrl::onMouseUp( const GuiEvent& event ) { if ( !mActive || !mAwake || !mVisible ) return; mouseUnlock(); mDepressed = false; mMouseDragged = false; _updateThumb( _getThumbValue( event ), event.modifier & SI_SHIFT ); execConsoleCallback(); }
void GuiSliderCtrl::setActive( bool value ) { if( !value && mDepressed ) { // We're in the middle of a drag. Finish it here as once we've // been deactivated, we are not going to see a mouse-up event. mDepressed = false; mouseUnlock(); execConsoleCallback(); } Parent::setActive( value ); }
//-------------------------------------------------------------------------- void GuiColorPickerCtrl::onMouseUp(const GuiEvent &) { //if we released the mouse within this control, perform the action if (mActive && mMouseDown && (mDisplayMode != pDropperBackground)) mMouseDown = false; if (mActive && (mDisplayMode == pDropperBackground)) { // In a dropper, the alt command executes the mouse up action (to signal stopping) execAltConsoleCallback(); } mouseUnlock(); }
void GuiFormCtrl::onMouseUp(const GuiEvent &event) { // Make sure we only get events we ought to be getting... if (! mActive) return; mouseUnlock(); setUpdate(); Point2I localClick = globalToLocalCoord(event.mousePoint); // If we're clicking in the header then resize //if(localClick.y < mThumbSize.y && mDepressed) // setCollapsed(!mCollapsed); }
//------------------------------------------------------------------------------ void GuiBubbleTextCtrl::popBubble() { // Release the mouse: mInAction = false; mouseUnlock(); // Pop the dialog getRoot()->popDialogControl(mDlg); // Kill the popup mDlg->removeObject(mPopup); mPopup->removeObject(mMLText); mMLText->deleteObject(); mPopup->deleteObject(); mDlg->deleteObject(); }
void GuiButtonBaseCtrl::onMouseUp(const GuiEvent &event) { mouseUnlock(); if( !mActive ) return; setUpdate(); if( mUseMouseEvents ) onMouseUp_callback(); //if we released the mouse within this control, perform the action if( mDepressed ) onAction(); mDepressed = false; mMouseDragged = false; }
void GuiInspectorField::setHLEnabled( bool enabled ) { mHighlighted = enabled; if ( mHighlighted ) { if ( mEdit && !mEdit->isFirstResponder() ) { mEdit->setFirstResponder(); GuiTextEditCtrl *edit = dynamic_cast<GuiTextEditCtrl*>( mEdit ); if ( edit ) { mouseUnlock(); edit->mouseLock(); edit->setCursorPos(0); } } _executeSelectedCallback(); } }
void GuiSplitContainer::onMouseUp( const GuiEvent &event ) { // If we've been dragging, we need to update the fixed panel extent. // NOTE : This should ONLY ever happen in this function. the Fixed panel // is to REMAIN FIXED unless the user changes it. if ( mDragging ) { Point2I newSplitPoint = getSplitPoint(); // Update Fixed Panel Extent if ( mFixedPanel == FirstPanel ) mFixedPanelSize = ( mOrientation == Horizontal ) ? newSplitPoint.y : newSplitPoint.x; else mFixedPanelSize = ( mOrientation == Horizontal ) ? getExtent().y - newSplitPoint.y : getExtent().x - newSplitPoint.x; setUpdateLayout(); } mDragging = false; mouseUnlock(); }
void GuiRoadEditorCtrl::on3DMouseUp(const Gui3DMouseEvent & event) { mStartWidth = -1.0f; mSavedDrag = false; mouseUnlock(); }
// Mouse Wheel Click Release void GuiMaterialPreview::onMiddleMouseUp(const GuiEvent &event) { mouseUnlock(); mMouseState = None; }
void GuiObjectView::onRightMouseUp( const GuiEvent &event ) { mouseUnlock(); mMouseState = None; }
void GuiRolloutCtrl::onMouseUp( const GuiEvent &event ) { _onMouseUp( event, true ); if( isMouseLocked() ) mouseUnlock(); }