xref: /haiku/src/apps/debugger/user_interface/gui/util/SignalDispositionMenu.cpp (revision 1deede7388b04dbeec5af85cae7164735ea9e70d)
1 /*
2  * Copyright 2015, Rene Gollent, rene@gollent.com.
3  * Distributed under the terms of the MIT License.
4  */
5 
6 
7 #include "SignalDispositionMenu.h"
8 
9 #include <new>
10 
11 #include <MenuItem.h>
12 
13 #include "SignalDispositionTypes.h"
14 #include "UiUtils.h"
15 
16 
17 SignalDispositionMenu::SignalDispositionMenu(const char* label,
18 	BMessage* baseMessage)
19 	:
20 	BMenu(label)
21 {
22 	for (int i = 0; i < SIGNAL_DISPOSITION_MAX; i++) {
23 		BMessage* message = NULL;
24 		if (baseMessage != NULL) {
25 			message = new BMessage(*baseMessage);
26 			message->AddInt32("disposition", i);
27 		}
28 
29 		AddItem(new BMenuItem(UiUtils::SignalDispositionToString(i), message));
30 	}
31 }
32 
33 
34 SignalDispositionMenu::~SignalDispositionMenu()
35 {
36 }
37