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

Unified Diff: views/controls/tree/tree_view.cc

Issue 399030: Add an option to tree_view for whether to show lines from the root node... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « views/controls/tree/tree_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/controls/tree/tree_view.cc
===================================================================
--- views/controls/tree/tree_view.cc (revision 31645)
+++ views/controls/tree/tree_view.cc (working copy)
@@ -26,11 +26,13 @@
TreeView::TreeView()
: tree_view_(NULL),
model_(NULL),
+ auto_expand_children_(false),
editable_(true),
next_id_(0),
controller_(NULL),
editing_node_(NULL),
root_shown_(true),
+ lines_at_root_(false),
process_enter_(false),
show_context_menu_only_when_node_selected_(true),
select_on_right_mouse_down_(true),
@@ -351,6 +353,8 @@
style |= TVS_DISABLEDRAGDROP;
if (editable_)
style |= TVS_EDITLABELS;
+ if (lines_at_root_)
+ style |= TVS_LINESATROOT;
tree_view_ = ::CreateWindowEx(WS_EX_CLIENTEDGE | GetAdditionalExStyle(),
WC_TREEVIEW,
L"",
@@ -415,9 +419,12 @@
GetNodeDetailsByID(static_cast<int>(info->itemNew.lParam));
if (!details->loaded_children) {
details->loaded_children = true;
- for (int i = 0; i < model_->GetChildCount(details->node); ++i)
+ for (int i = 0; i < model_->GetChildCount(details->node); ++i) {
CreateItem(details->tree_item, TVI_LAST,
model_->GetChild(details->node, i));
+ if (auto_expand_children_)
+ Expand(model_->GetChild(details->node, i));
+ }
}
// Return FALSE to allow the item to be expanded.
return FALSE;
« no previous file with comments | « views/controls/tree/tree_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698