xref: /haiku/src/apps/diskprobe/ProbeWindow.cpp (revision 24159a0c7d6d6dcba9f2a0c1a7c08d2c8167f21b)
1 /*
2 ** Copyright 2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3 ** Distributed under the terms of the OpenBeOS License.
4 */
5 
6 
7 #include "ProbeWindow.h"
8 #include "DiskProbe.h"
9 
10 #include <Application.h>
11 
12 
13 ProbeWindow::ProbeWindow(BRect rect, entry_ref *ref)
14 	: BWindow(rect, ref->name, B_DOCUMENT_WINDOW, B_ASYNCHRONOUS_CONTROLS),
15 	fRef(*ref)
16 {
17 }
18 
19 
20 ProbeWindow::~ProbeWindow()
21 {
22 }
23 
24 
25 void
26 ProbeWindow::MessageReceived(BMessage *message)
27 {
28 	switch (message->what) {
29 		case B_MOUSE_WHEEL_CHANGED:
30 			if (BView *view = FindView("dataView"))
31 				view->MessageReceived(message);
32 			break;
33 
34 		case B_SIMPLE_DATA:
35 		{
36 			BMessage refsReceived(*message);
37 			refsReceived.what = B_REFS_RECEIVED;
38 			be_app_messenger.SendMessage(&refsReceived);
39 			break;
40 		}
41 
42 		default:
43 			BWindow::MessageReceived(message);
44 	}
45 }
46 
47 
48 bool
49 ProbeWindow::QuitRequested()
50 {
51 	BMessage update(kMsgSettingsChanged);
52 	update.AddRect("window_frame", Frame());
53 	be_app_messenger.SendMessage(&update);
54 
55 	be_app_messenger.SendMessage(kMsgWindowClosed);
56 	return true;
57 }
58 
59