| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "views/controls/table/native_table_win.h" | 5 #include "views/controls/table/native_table_win.h" |
| 6 | 6 |
| 7 #include <commctrl.h> | 7 #include <commctrl.h> |
| 8 #include <windowsx.h> | 8 #include <windowsx.h> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 579 } | 579 } |
| 580 } | 580 } |
| 581 | 581 |
| 582 memset(&item, 0, sizeof(LVITEM)); | 582 memset(&item, 0, sizeof(LVITEM)); |
| 583 item.stateMask = 0; | 583 item.stateMask = 0; |
| 584 item.mask = LVIF_TEXT; | 584 item.mask = LVIF_TEXT; |
| 585 if (table_->type() == ICON_AND_TEXT) | 585 if (table_->type() == ICON_AND_TEXT) |
| 586 item.mask |= LVIF_IMAGE; | 586 item.mask |= LVIF_IMAGE; |
| 587 | 587 |
| 588 for (size_t j = start_column; j < table_->GetVisibleColumnCount(); ++j) { | 588 for (size_t j = start_column; j < table_->GetVisibleColumnCount(); ++j) { |
| 589 TableColumn& col = table_->GetVisibleColumnAt(j); | 589 TableColumn col = table_->GetVisibleColumnAt(j); |
| 590 int max_text_width = ListView_GetStringWidth(native_view(), | 590 int max_text_width = ListView_GetStringWidth(native_view(), |
| 591 col.title.c_str()); | 591 col.title.c_str()); |
| 592 for (int i = start; i < max_row; ++i) { | 592 for (int i = start; i < max_row; ++i) { |
| 593 item.iItem = i; | 593 item.iItem = i; |
| 594 item.iSubItem = j; | 594 item.iSubItem = j; |
| 595 std::wstring text = table_->model()->GetText(i, col.id); | 595 std::wstring text = table_->model()->GetText(i, col.id); |
| 596 item.pszText = const_cast<LPWSTR>(text.c_str()); | 596 item.pszText = const_cast<LPWSTR>(text.c_str()); |
| 597 item.iImage = 0; | 597 item.iImage = 0; |
| 598 ListView_SetItem(native_view(), &item); | 598 ListView_SetItem(native_view(), &item); |
| 599 | 599 |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 903 | 903 |
| 904 //////////////////////////////////////////////////////////////////////////////// | 904 //////////////////////////////////////////////////////////////////////////////// |
| 905 // NativeButtonWrapper, public: | 905 // NativeButtonWrapper, public: |
| 906 | 906 |
| 907 // static | 907 // static |
| 908 NativeTableWrapper* NativeTableWrapper::CreateNativeWrapper(TableView2* table) { | 908 NativeTableWrapper* NativeTableWrapper::CreateNativeWrapper(TableView2* table) { |
| 909 return new NativeTableWin(table); | 909 return new NativeTableWin(table); |
| 910 } | 910 } |
| 911 | 911 |
| 912 } // namespace views | 912 } // namespace views |
| OLD | NEW |