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

Unified Diff: views/examples/message_box_example.h

Issue 347010: Fixed view example. It was failing because some of view classes requires WidgetGTK in (Closed)
Patch Set: revert unintentional change Created 11 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « views/examples/examples_main.cc ('k') | views/examples/radio_button_example.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/examples/message_box_example.h
diff --git a/views/examples/message_box_example.h b/views/examples/message_box_example.h
index 3edd210cf226c8ab3da455f530662f469a2f0ad8..9d3631b95f20656c0818c22598cd697666929d5c 100644
--- a/views/examples/message_box_example.h
+++ b/views/examples/message_box_example.h
@@ -16,17 +16,25 @@
namespace examples {
// A MessageBoxView example. This tests some of checkbox features as well.
-class MessageBoxExample : protected ExampleBase, private views::ButtonListener {
+class MessageBoxExample : public ExampleBase,
+ public views::ButtonListener {
public:
- explicit MessageBoxExample(ExamplesMain* main) : ExampleBase(main) {
+ explicit MessageBoxExample(ExamplesMain* main) : ExampleBase(main) {}
+
+ virtual ~MessageBoxExample() {}
+
+ virtual std::wstring GetExampleTitle() {
+ return L"Message Box View";
+ }
+
+ virtual void CreateExampleView(views::View* container) {
message_box_view_ =
new MessageBoxView(0, L"Message Box Message", L"Default Prompt");
status_ = new views::TextButton(this, L"Show Status");
toggle_ = new views::TextButton(this, L"Toggle Checkbox");
- container_ = new views::View();
- views::GridLayout* layout = new views::GridLayout(container_);
- container_->SetLayoutManager(layout);
+ views::GridLayout* layout = new views::GridLayout(container);
+ container->SetLayoutManager(layout);
message_box_view_->SetCheckBoxLabel(L"Check Box");
@@ -50,16 +58,6 @@ class MessageBoxExample : protected ExampleBase, private views::ButtonListener {
layout->AddView(toggle_);
}
- virtual ~MessageBoxExample() {}
-
- virtual std::wstring GetExampleTitle() {
- return L"Message Box View";
- }
-
- virtual views::View* GetExampleView() {
- return container_;
- }
-
private:
// ButtonListener overrides.
virtual void ButtonPressed(views::Button* sender, const views::Event& event) {
@@ -74,9 +72,6 @@ class MessageBoxExample : protected ExampleBase, private views::ButtonListener {
}
}
- // The view containing this test's controls.
- views::View* container_;
-
// The MessageBoxView to be tested.
MessageBoxView* message_box_view_;
« no previous file with comments | « views/examples/examples_main.cc ('k') | views/examples/radio_button_example.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698