2 * Copyright 2001-2006, Haiku.
3 * Distributed under the terms of the MIT License.
7 * Stefano Ceccherini (burton666@libero.it)
8 * Axel Dörfler, axeld@pinc-software.de
11 #include "AlertWindow.h"
12 #include "AlertView.h"
13 #include "Constants.h"
20 #undef B_TRANSLATION_CONTEXT
21 #define B_TRANSLATION_CONTEXT "Screen"
24 AlertWindow::AlertWindow(BMessenger target
)
25 : BWindow(BRect(100.0, 100.0, 400.0, 193.0), B_TRANSLATE("Undo"),
26 B_MODAL_WINDOW_LOOK
, B_MODAL_APP_WINDOW_FEEL
,
27 B_NOT_RESIZABLE
| B_NOT_ZOOMABLE
, B_ALL_WORKSPACES
),
30 fAlertView
= new AlertView(Bounds(), "AlertView");
32 ResizeTo(fAlertView
->Bounds().Width(), fAlertView
->Bounds().Height());
35 // center window on screen
37 MoveTo(screen
.Frame().left
+ (screen
.Frame().Width() - Frame().Width()) / 2,
38 screen
.Frame().top
+ (screen
.Frame().Height() - Frame().Height()) / 2);
43 AlertWindow::MessageReceived(BMessage
*message
)
45 switch (message
->what
) {
47 fTarget
.SendMessage(MAKE_INITIAL_MSG
);
48 PostMessage(B_QUIT_REQUESTED
);
52 fTarget
.SendMessage(BUTTON_UNDO_MSG
);
53 PostMessage(B_QUIT_REQUESTED
);
57 BWindow::MessageReceived(message
);