From 78f94f81ff8b88b29881f9a1108aad6bfc54cc26 Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Sun, 22 Nov 2009 16:10:02 +0000 Subject: [PATCH] Add a BScrollView around the instantiated TermView (only as a test) git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34188 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/tests/apps/terminal_replicant/main.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/tests/apps/terminal_replicant/main.cpp b/src/tests/apps/terminal_replicant/main.cpp index e8b03d171a..f7a0017d5e 100644 --- a/src/tests/apps/terminal_replicant/main.cpp +++ b/src/tests/apps/terminal_replicant/main.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include #include @@ -62,14 +63,19 @@ Window::AttachTermView() message.AddString("class", "TermView"); message.AddString("add_on", TERM_SIGNATURE); message.AddBool("use_rect", true); - message.AddRect("_frame", Bounds().InsetByCopy(2, 2)); + + BRect viewFrame = Bounds(); + viewFrame.right -= 15; + message.AddRect("_frame", viewFrame); BView *termView = dynamic_cast(instantiate_object(&message)); - - if (termView != NULL) { - termView->SetResizingMode(B_FOLLOW_ALL); - AddChild(termView); + if (termView == NULL) + return; - termView->ResizeToPreferred(); - } + termView->SetResizingMode(B_FOLLOW_ALL); + + BScrollView *scrollView = new BScrollView("scrollview", termView, + B_FOLLOW_ALL, B_WILL_DRAW, false, true); + + AddChild(scrollView); }