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