ref: 31a58552ffc647d2c87b557441d3725c6fba2b37
parent: abfc7bfe709000c1ca82654b64e6b43d3e06308a
author: Simon Howard <fraggle@gmail.com>
date: Thu Oct 20 18:00:46 EDT 2011
Use TXT_MessageBox where appropriate. Subversion-branch: /branches/v2-branch Subversion-revision: 2446
--- a/src/setup/execute.c
+++ b/src/setup/execute.c
@@ -370,14 +370,10 @@
char *main_cfg;
char *extra_cfg;
txt_window_t *testwindow;
- txt_label_t *label;
- testwindow = TXT_NewWindow("Starting Doom");
-
- label = TXT_NewLabel("Starting Doom to test the\n"
- "settings. Please wait.");
- TXT_SetWidgetAlign(label, TXT_HORIZ_CENTER);
- TXT_AddWidget(testwindow, label);
+ testwindow = TXT_MessageBox("Starting Doom",
+ "Starting Doom to test the\n"
+ "settings. Please wait.");
TXT_DrawDesktop();
// Save temporary configuration files with the current configuration
--- a/src/setup/mainmenu.c
+++ b/src/setup/mainmenu.c
@@ -100,9 +100,7 @@
SensibleDefaults();
cheat_sequence_index = 0;
- window = TXT_NewWindow(NULL);
- TXT_AddWidget(window, TXT_NewLabel(" \x01 "));
- TXT_SetWindowAction(window, TXT_HORIZ_RIGHT, NULL);
+ window = TXT_MessageBox(NULL, " \x01 ");
return 1;
}
--- a/src/setup/txt_joybinput.c
+++ b/src/setup/txt_joybinput.c
@@ -76,22 +76,12 @@
static void OpenErrorWindow(void)
{
- txt_window_t *window;
-
- window = TXT_NewWindow(NULL);
-
- TXT_AddWidget(window, TXT_NewLabel("Please configure a joystick first!"));
-
- TXT_SetWindowAction(window, TXT_HORIZ_LEFT, NULL);
- TXT_SetWindowAction(window, TXT_HORIZ_CENTER,
- TXT_NewWindowEscapeAction(window));
- TXT_SetWindowAction(window, TXT_HORIZ_RIGHT, NULL);
+ TXT_MessageBox(NULL, "Please configure a joystick first!");
}
static void OpenPromptWindow(txt_joystick_input_t *joystick_input)
{
txt_window_t *window;
- txt_label_t *label;
SDL_Joystick *joystick;
// Silently update when the shift button is held down.
@@ -115,16 +105,8 @@
// Open the prompt window
- window = TXT_NewWindow(NULL);
- TXT_SetWindowAction(window, TXT_HORIZ_LEFT, NULL);
- TXT_SetWindowAction(window, TXT_HORIZ_CENTER,
- TXT_NewWindowAbortAction(window));
- TXT_SetWindowAction(window, TXT_HORIZ_RIGHT, NULL);
-
- label = TXT_NewLabel("Press the new joystick button...");
+ window = TXT_MessageBox(NULL, "Press the new joystick button...");
- TXT_AddWidget(window, label);
- TXT_SetWidgetAlign(label, TXT_HORIZ_CENTER);
TXT_SDL_SetEventCallback(EventCallback, joystick_input);
TXT_SignalConnect(window, "closed", PromptWindowClosed, joystick);
joystick_input->prompt_window = window;
--- a/src/setup/txt_keyinput.c
+++ b/src/setup/txt_keyinput.c
@@ -70,22 +70,12 @@
static void OpenPromptWindow(txt_key_input_t *key_input)
{
txt_window_t *window;
- txt_label_t *label;
// Silently update when the shift button is held down.
key_input->check_conflicts = !TXT_GetModifierState(TXT_MOD_SHIFT);
- window = TXT_NewWindow(NULL);
- TXT_SetWindowAction(window, TXT_HORIZ_LEFT, NULL);
- TXT_SetWindowAction(window, TXT_HORIZ_CENTER,
- TXT_NewWindowAbortAction(window));
- TXT_SetWindowAction(window, TXT_HORIZ_RIGHT, NULL);
-
- label = TXT_NewLabel("Press the new key...");
-
- TXT_AddWidget(window, label);
- TXT_SetWidgetAlign(label, TXT_HORIZ_CENTER);
+ window = TXT_MessageBox(NULL, "Press the new key...");
TXT_SetKeyListener(window, KeyPressCallback, key_input);
--- a/src/setup/txt_mouseinput.c
+++ b/src/setup/txt_mouseinput.c
@@ -56,21 +56,11 @@
static void OpenPromptWindow(txt_mouse_input_t *mouse_input)
{
txt_window_t *window;
- txt_label_t *label;
// Silently update when the shift key is held down.
mouse_input->check_conflicts = !TXT_GetModifierState(TXT_MOD_SHIFT);
- window = TXT_NewWindow(NULL);
- TXT_SetWindowAction(window, TXT_HORIZ_LEFT, NULL);
- TXT_SetWindowAction(window, TXT_HORIZ_CENTER,
- TXT_NewWindowAbortAction(window));
- TXT_SetWindowAction(window, TXT_HORIZ_RIGHT, NULL);
-
- label = TXT_NewLabel("Press the new mouse button...");
-
- TXT_AddWidget(window, label);
- TXT_SetWidgetAlign(label, TXT_HORIZ_CENTER);
+ window = TXT_MessageBox(NULL, "Press the new mouse button...");
TXT_SetMouseListener(window, MousePressCallback, mouse_input);
}