2 * Copyright (C) 2008 Stephan Aßmus <superstippi@gmx.de>
3 * All rights reserved. Distributed under the terms of the MIT license.
5 #include "TestWindow.h"
10 TestView::TestView(BRect frame
, Test
* test
, drawing_mode mode
,
11 bool useClipping
, const BMessenger
& target
)
13 BView(frame
, "test view", B_FOLLOW_ALL
, B_WILL_DRAW
),
16 fUseClipping(useClipping
)
23 TestView::AttachedToWindow()
27 fTest
->SetupClipping(this);
32 TestView::Draw(BRect updateRect
)
34 if (fTest
->RunIteration(this)) {
39 fTarget
.SendMessage(MSG_TEST_FINISHED
);
43 TestWindow::TestWindow(BRect frame
, Test
* test
, drawing_mode mode
,
44 bool useClipping
, const BMessenger
& target
)
45 : BWindow(frame
, "Test Window", B_TITLED_WINDOW_LOOK
,
46 B_FLOATING_ALL_WINDOW_FEEL
, B_NOT_ZOOMABLE
| B_NOT_RESIZABLE
),
50 fTestView
= new TestView(Bounds(), test
, mode
, useClipping
, target
);
57 TestWindow::QuitRequested()
62 fTarget
.SendMessage(MSG_TEST_CANCELED
);
68 TestWindow::SetAllowedToQuit(bool allowed
)
70 fAllowedToQuit
= allowed
;