Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(122)

Side by Side Diff: ui/views/controls/table/table_view_win.cc

Issue 11269022: Add Vector2d classes that represent offsets, instead of using Point. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix step one more time Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/views/controls/table/table_view_win.h" 5 #include "ui/views/controls/table/table_view_win.h"
6 6
7 #include <commctrl.h> 7 #include <commctrl.h>
8 #include <windowsx.h> 8 #include <windowsx.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after
702 SetCapture(window); 702 SetCapture(window);
703 return 0; 703 return 0;
704 } 704 }
705 // else case, continue on to default handler 705 // else case, continue on to default handler
706 } 706 }
707 break; 707 break;
708 } 708 }
709 709
710 case WM_MOUSEMOVE: { 710 case WM_MOUSEMOVE: {
711 if (in_mouse_down) { 711 if (in_mouse_down) {
712 int x = GET_X_LPARAM(l_param); 712 gfx::Point mouse_pos(GET_X_LPARAM(l_param), GET_Y_LPARAM(l_param));
713 int y = GET_Y_LPARAM(l_param); 713 gfx::Point mouse_down_pos(mouse_down_x, mouse_down_y);
Peter Kasting 2012/10/31 01:04:41 Nit: Convert mouse_down_x/mouse_down_y from a pair
danakj 2012/10/31 16:55:46 Oh, fancy.
714 if (View::ExceededDragThreshold(x - mouse_down_x, y - mouse_down_y)) { 714 if (View::ExceededDragThreshold(mouse_pos - mouse_down_pos)) {
715 // We're about to start drag and drop, which results in no mouse up. 715 // We're about to start drag and drop, which results in no mouse up.
716 // Release capture and reset state. 716 // Release capture and reset state.
717 ReleaseCapture(); 717 ReleaseCapture();
718 in_mouse_down = false; 718 in_mouse_down = false;
719 719
720 NMLISTVIEW details; 720 NMLISTVIEW details;
721 memset(&details, 0, sizeof(details)); 721 memset(&details, 0, sizeof(details));
722 details.hdr.code = LVN_BEGINDRAG; 722 details.hdr.code = LVN_BEGINDRAG;
723 SendMessage(::GetParent(window), WM_NOTIFY, 0, 723 SendMessage(::GetParent(window), WM_NOTIFY, 0,
724 reinterpret_cast<LPARAM>(&details)); 724 reinterpret_cast<LPARAM>(&details));
(...skipping 916 matching lines...) Expand 10 before | Expand all | Expand 10 after
1641 } 1641 }
1642 1642
1643 void TableSelectionIterator::UpdateModelIndexFromViewIndex() { 1643 void TableSelectionIterator::UpdateModelIndexFromViewIndex() {
1644 if (view_index_ == -1) 1644 if (view_index_ == -1)
1645 model_index_ = -1; 1645 model_index_ = -1;
1646 else 1646 else
1647 model_index_ = table_view_->ViewToModel(view_index_); 1647 model_index_ = table_view_->ViewToModel(view_index_);
1648 } 1648 }
1649 1649
1650 } // namespace views 1650 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698