Changeset e0f3ade in git


Ignore:
Timestamp:
14/01/14 04:18:13 (6 years ago)
Author:
Olly Betts <olly@…>
Branches:
line_contents, master, stereo, travis-osx
Children:
db095f9
Parents:
a57af18
Message:

src/guicontrol.cc: If dragging with more than one mouse button held
down, releasing one causes another which is still held down to take
effect.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ChangeLog

    ra57af18 re0f3ade  
     1Tue Jan 14 04:17:10 GMT 2014  Olly Betts <olly@survex.com>
     2
     3        * src/guicontrol.cc: If dragging with more than one mouse button held
     4          down, releasing one causes another which is still held down to take
     5          effect.
     6
    17Tue Jan 14 03:33:38 GMT 2014  Olly Betts <olly@survex.com>
    28
  • src/guicontrol.cc

    ra57af18 re0f3ade  
    55//
    66//  Copyright (C) 2000-2002,2005 Mark R. Shinwell
    7 //  Copyright (C) 2001,2003,2004,2005,2006,2011,2012 Olly Betts
     7//  Copyright (C) 2001,2003,2004,2005,2006,2011,2012,2014 Olly Betts
    88//
    99//  This program is free software; you can redistribute it and/or modify
     
    320320        if (m_View->PointWithinCompass(m_DragStart)) {
    321321            m_LastDrag = drag_COMPASS;
     322            m_View->SetCursor(GfxCore::CURSOR_ROTATE_HORIZONTALLY);
    322323        } else if (m_View->PointWithinClino(m_DragStart)) {
    323324            m_LastDrag = drag_ELEV;
     325            m_View->SetCursor(GfxCore::CURSOR_ROTATE_VERTICALLY);
    324326        } else if (m_View->PointWithinScaleBar(m_DragStart)) {
    325327            m_LastDrag = drag_SCALE;
     328            m_View->SetCursor(GfxCore::CURSOR_HORIZONTAL_RESIZE);
    326329        } else {
    327             if (event.ControlDown()) {
    328                 if (m_View->IsExtendedElevation()) {
    329                     return;
    330                 }
     330            if (event.ControlDown() && !m_View->IsExtendedElevation()) {
    331331                m_View->SetCursor(GfxCore::CURSOR_ROTATE_EITHER_WAY);
    332332            } else {
     
    358358        }
    359359
    360 //      m_View->RedrawIndicators();
     360        if (event.MiddleIsDown()) {
     361            OnMButtonDown(event);
     362            return;
     363        }
     364
     365        if (event.RightIsDown()) {
     366            OnRButtonDown(event);
     367            return;
     368        }
     369
    361370        m_View->ReleaseMouse();
    362371
     
    389398}
    390399
    391 void GUIControl::OnMButtonUp(wxMouseEvent&)
     400void GUIControl::OnMButtonUp(wxMouseEvent& event)
    392401{
    393402    if (m_View->HasData()) {
    394403        if (dragging != MIDDLE_DRAG)
    395404            return;
     405
     406        if (event.LeftIsDown()) {
     407            OnLButtonDown(event);
     408            return;
     409        }
     410
     411        if (event.RightIsDown()) {
     412            OnRButtonDown(event);
     413            return;
     414        }
    396415
    397416        dragging = NO_DRAG;
     
    421440}
    422441
    423 void GUIControl::OnRButtonUp(wxMouseEvent&)
     442void GUIControl::OnRButtonUp(wxMouseEvent& event)
    424443{
    425444    if (dragging != RIGHT_DRAG)
    426445        return;
     446
     447    if (event.LeftIsDown()) {
     448        OnLButtonDown(event);
     449        return;
     450    }
     451
     452    if (event.MiddleIsDown()) {
     453        OnMButtonDown(event);
     454        return;
     455    }
    427456
    428457    m_LastDrag = drag_NONE;
Note: See TracChangeset for help on using the changeset viewer.