[haiku-commits] r34188 - haiku/trunk/src/tests/apps/terminal_replicant

  • From: stefano.ceccherini@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sun, 22 Nov 2009 17:10:03 +0100 (CET)

Author: jackburton
Date: 2009-11-22 17:10:02 +0100 (Sun, 22 Nov 2009)
New Revision: 34188
Changeset: http://dev.haiku-os.org/changeset/34188/haiku

Modified:
   haiku/trunk/src/tests/apps/terminal_replicant/main.cpp
Log:
Add a BScrollView around the instantiated TermView (only as a test)


Modified: haiku/trunk/src/tests/apps/terminal_replicant/main.cpp
===================================================================
--- haiku/trunk/src/tests/apps/terminal_replicant/main.cpp      2009-11-22 
16:09:32 UTC (rev 34187)
+++ haiku/trunk/src/tests/apps/terminal_replicant/main.cpp      2009-11-22 
16:10:02 UTC (rev 34188)
@@ -4,6 +4,7 @@
 #include <Dragger.h>
 #include <Message.h>
 #include <Path.h>
+#include <ScrollView.h>
 #include <Shelf.h>
 #include <Window.h>
 
@@ -62,14 +63,19 @@
        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<BView *>(instantiate_object(&message));
+       if (termView == NULL)
+               return;
+               
+       termView->SetResizingMode(B_FOLLOW_ALL);
        
-       if (termView != NULL) {
-               termView->SetResizingMode(B_FOLLOW_ALL);
-               AddChild(termView);
+       BScrollView *scrollView = new BScrollView("scrollview", termView,
+               B_FOLLOW_ALL, B_WILL_DRAW, false, true);
                
-               termView->ResizeToPreferred();
-       }
+       AddChild(scrollView);
 }


Other related posts:

  • » [haiku-commits] r34188 - haiku/trunk/src/tests/apps/terminal_replicant - stefano . ceccherini