diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2008-12-17 18:05:15 -0800 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2008-12-17 18:05:15 -0800 |
commit | 1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353 (patch) | |
tree | 4457a7306ea5acb43fe05bfe0973b1f7faf97ba2 /WebCore/platform/wx/MouseEventWx.cpp | |
parent | 9364f22aed35e1a1e9d07c121510f80be3ab0502 (diff) | |
download | external_webkit-1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353.zip external_webkit-1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353.tar.gz external_webkit-1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353.tar.bz2 |
Code drop from //branches/cupcake/...@124589
Diffstat (limited to 'WebCore/platform/wx/MouseEventWx.cpp')
-rw-r--r-- | WebCore/platform/wx/MouseEventWx.cpp | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/WebCore/platform/wx/MouseEventWx.cpp b/WebCore/platform/wx/MouseEventWx.cpp index 920ffd8..c9468a9 100644 --- a/WebCore/platform/wx/MouseEventWx.cpp +++ b/WebCore/platform/wx/MouseEventWx.cpp @@ -20,11 +20,13 @@ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "config.h" +#include "Assertions.h" #include "PlatformMouseEvent.h" +#include "SystemTime.h" #include <wx/defs.h> #include <wx/event.h> @@ -34,7 +36,6 @@ namespace WebCore { PlatformMouseEvent::PlatformMouseEvent(const wxMouseEvent& event, const wxPoint& globalPoint) : m_position(event.GetPosition()) , m_globalPosition(globalPoint) - , m_clickCount(event.ButtonDClick() ? 2 : 1) , m_shiftKey(event.ShiftDown()) , m_ctrlKey(event.CmdDown()) , m_altKey(event.AltDown()) @@ -53,12 +54,22 @@ PlatformMouseEvent::PlatformMouseEvent(const wxMouseEvent& event, const wxPoint& else if (type == wxEVT_MOTION) m_eventType = MouseEventMoved; - if (event.LeftIsDown()) + if (event.LeftIsDown() || event.Button(wxMOUSE_BTN_LEFT)) m_button = LeftButton; - else if (event.RightIsDown()) + else if (event.RightIsDown() || event.Button(wxMOUSE_BTN_RIGHT)) m_button = RightButton; - else if (event.MiddleIsDown()) + else if (event.MiddleIsDown() || event.Button(wxMOUSE_BTN_MIDDLE)) m_button = MiddleButton; + else if (!m_eventType == MouseEventMoved) + ASSERT_NOT_REACHED(); + + + if (m_eventType == MouseEventMoved) + m_clickCount = 0; + else + m_clickCount = event.ButtonDClick() ? 2 : 1; + + m_timestamp = WebCore::currentTime(); } } |