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
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
#include <Dragger.h>
|
#include <Dragger.h>
|
||||||
#include <Message.h>
|
#include <Message.h>
|
||||||
#include <Path.h>
|
#include <Path.h>
|
||||||
|
#include <ScrollView.h>
|
||||||
#include <Shelf.h>
|
#include <Shelf.h>
|
||||||
#include <Window.h>
|
#include <Window.h>
|
||||||
|
|
||||||
@@ -62,14 +63,19 @@ Window::AttachTermView()
|
|||||||
message.AddString("class", "TermView");
|
message.AddString("class", "TermView");
|
||||||
message.AddString("add_on", TERM_SIGNATURE);
|
message.AddString("add_on", TERM_SIGNATURE);
|
||||||
message.AddBool("use_rect", true);
|
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));
|
BView *termView = dynamic_cast<BView *>(instantiate_object(&message));
|
||||||
|
if (termView == NULL)
|
||||||
if (termView != NULL) {
|
return;
|
||||||
termView->SetResizingMode(B_FOLLOW_ALL);
|
|
||||||
AddChild(termView);
|
|
||||||
|
|
||||||
termView->ResizeToPreferred();
|
termView->SetResizingMode(B_FOLLOW_ALL);
|
||||||
}
|
|
||||||
|
BScrollView *scrollView = new BScrollView("scrollview", termView,
|
||||||
|
B_FOLLOW_ALL, B_WILL_DRAW, false, true);
|
||||||
|
|
||||||
|
AddChild(scrollView);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user