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

Side by Side Diff: views/examples/textfield_example.h

Issue 1155008: Adds the ability to display text in a textfield when the text is (Closed)
Patch Set: Updates Created 10 years, 9 months 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
« no previous file with comments | « views/controls/textfield/textfield.h ('k') | views/views.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 #ifndef VIEWS_EXAMPLES_TEXTFIELD_EXAMPLE_H_ 5 #ifndef VIEWS_EXAMPLES_TEXTFIELD_EXAMPLE_H_
6 #define VIEWS_EXAMPLES_TEXTFIELD_EXAMPLE_H_ 6 #define VIEWS_EXAMPLES_TEXTFIELD_EXAMPLE_H_
7 7
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "views/controls/button/text_button.h" 9 #include "views/controls/button/text_button.h"
10 #include "views/controls/label.h" 10 #include "views/controls/label.h"
(...skipping 14 matching lines...) Expand all
25 25
26 virtual ~TextfieldExample() {} 26 virtual ~TextfieldExample() {}
27 27
28 virtual std::wstring GetExampleTitle() { 28 virtual std::wstring GetExampleTitle() {
29 return L"Textfield"; 29 return L"Textfield";
30 } 30 }
31 31
32 virtual void CreateExampleView(views::View* container) { 32 virtual void CreateExampleView(views::View* container) {
33 name_ = new Textfield(); 33 name_ = new Textfield();
34 password_ = new Textfield(Textfield::STYLE_PASSWORD); 34 password_ = new Textfield(Textfield::STYLE_PASSWORD);
35 password_->set_text_to_display_when_empty(ASCIIToUTF16("password"));
35 show_password_ = new views::TextButton(this, L"Show password"); 36 show_password_ = new views::TextButton(this, L"Show password");
36 clear_all_ = new views::TextButton(this, L"Clear All"); 37 clear_all_ = new views::TextButton(this, L"Clear All");
37 append_ = new views::TextButton(this, L"Append"); 38 append_ = new views::TextButton(this, L"Append");
38 name_->SetController(this); 39 name_->SetController(this);
39 password_->SetController(this); 40 password_->SetController(this);
40 41
41 views::GridLayout* layout = new views::GridLayout(container); 42 views::GridLayout* layout = new views::GridLayout(container);
42 container->SetLayoutManager(layout); 43 container->SetLayoutManager(layout);
43 44
44 views::ColumnSet* column_set = layout->AddColumnSet(0); 45 views::ColumnSet* column_set = layout->AddColumnSet(0);
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 views::TextButton* clear_all_; 102 views::TextButton* clear_all_;
102 views::TextButton* append_; 103 views::TextButton* append_;
103 104
104 DISALLOW_COPY_AND_ASSIGN(TextfieldExample); 105 DISALLOW_COPY_AND_ASSIGN(TextfieldExample);
105 }; 106 };
106 107
107 } // namespace examples 108 } // namespace examples
108 109
109 #endif // VIEWS_EXAMPLES_TEXTFIELD_EXAMPLE_H_ 110 #endif // VIEWS_EXAMPLES_TEXTFIELD_EXAMPLE_H_
110 111
OLDNEW
« no previous file with comments | « views/controls/textfield/textfield.h ('k') | views/views.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698