summaryrefslogtreecommitdiffhomepage
path: root/Stars45/ConfirmDlg.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Stars45/ConfirmDlg.cpp')
-rw-r--r--Stars45/ConfirmDlg.cpp92
1 files changed, 46 insertions, 46 deletions
diff --git a/Stars45/ConfirmDlg.cpp b/Stars45/ConfirmDlg.cpp
index 858faee..526ac68 100644
--- a/Stars45/ConfirmDlg.cpp
+++ b/Stars45/ConfirmDlg.cpp
@@ -1,15 +1,15 @@
/* Project Starshatter 4.5
- Destroyer Studios LLC
- Copyright © 1997-2004. All Rights Reserved.
+ Destroyer Studios LLC
+ Copyright © 1997-2004. All Rights Reserved.
- SUBSYSTEM: Stars.exe
- FILE: ConfirmDlg.cpp
- AUTHOR: John DiCamillo
+ SUBSYSTEM: Stars.exe
+ FILE: ConfirmDlg.cpp
+ AUTHOR: John DiCamillo
- OVERVIEW
- ========
- General-purpose confirmation dialog class
+ OVERVIEW
+ ========
+ General-purpose confirmation dialog class
*/
#include "MemDebug.h"
@@ -31,10 +31,10 @@ DEF_MAP_CLIENT(ConfirmDlg, OnCancel);
// +--------------------------------------------------------------------+
ConfirmDlg::ConfirmDlg(Screen* s, FormDef& def, MenuScreen* mgr)
- : FormWindow(s, 0, 0, s->Width(), s->Height()), manager(mgr),
- parent_control(0), btn_apply(0), btn_cancel(0)
+: FormWindow(s, 0, 0, s->Width(), s->Height()), manager(mgr),
+parent_control(0), btn_apply(0), btn_cancel(0)
{
- Init(def);
+ Init(def);
}
ConfirmDlg::~ConfirmDlg()
@@ -44,17 +44,17 @@ ConfirmDlg::~ConfirmDlg()
void
ConfirmDlg::RegisterControls()
{
- if (btn_apply)
- return;
+ if (btn_apply)
+ return;
- btn_apply = (Button*) FindControl(1);
- REGISTER_CLIENT(EID_CLICK, btn_apply, ConfirmDlg, OnApply);
+ btn_apply = (Button*) FindControl(1);
+ REGISTER_CLIENT(EID_CLICK, btn_apply, ConfirmDlg, OnApply);
- btn_cancel = (Button*) FindControl(2);
- REGISTER_CLIENT(EID_CLICK, btn_cancel, ConfirmDlg, OnCancel);
+ btn_cancel = (Button*) FindControl(2);
+ REGISTER_CLIENT(EID_CLICK, btn_cancel, ConfirmDlg, OnCancel);
- lbl_title = FindControl(100);
- lbl_message = FindControl(101);
+ lbl_title = FindControl(100);
+ lbl_message = FindControl(101);
}
// +--------------------------------------------------------------------+
@@ -62,45 +62,45 @@ ConfirmDlg::RegisterControls()
ActiveWindow*
ConfirmDlg::GetParentControl()
{
- return parent_control;
+ return parent_control;
}
void
ConfirmDlg::SetParentControl(ActiveWindow* p)
{
- parent_control = p;
+ parent_control = p;
}
Text
ConfirmDlg::GetTitle()
{
- if (lbl_title)
- return lbl_title->GetText();
+ if (lbl_title)
+ return lbl_title->GetText();
- return "";
+ return "";
}
void
ConfirmDlg::SetTitle(const char* t)
{
- if (lbl_title)
- lbl_title->SetText(t);
+ if (lbl_title)
+ lbl_title->SetText(t);
}
Text
ConfirmDlg::GetMessage()
{
- if (lbl_message)
- return lbl_message->GetText();
+ if (lbl_message)
+ return lbl_message->GetText();
- return "";
+ return "";
}
void
ConfirmDlg::SetMessage(const char* m)
{
- if (lbl_message)
- lbl_message->SetText(m);
+ if (lbl_message)
+ lbl_message->SetText(m);
}
// +--------------------------------------------------------------------+
@@ -108,13 +108,13 @@ ConfirmDlg::SetMessage(const char* m)
void
ConfirmDlg::ExecFrame()
{
- if (Keyboard::KeyDown(VK_RETURN)) {
- OnApply(0);
- }
+ if (Keyboard::KeyDown(VK_RETURN)) {
+ OnApply(0);
+ }
- if (Keyboard::KeyDown(VK_ESCAPE)) {
- OnCancel(0);
- }
+ if (Keyboard::KeyDown(VK_ESCAPE)) {
+ OnCancel(0);
+ }
}
// +--------------------------------------------------------------------+
@@ -122,12 +122,12 @@ ConfirmDlg::ExecFrame()
void
ConfirmDlg::Show()
{
- if (!IsShown()) {
- Button::PlaySound(Button::SND_CONFIRM);
- }
+ if (!IsShown()) {
+ Button::PlaySound(Button::SND_CONFIRM);
+ }
- FormWindow::Show();
- SetFocus();
+ FormWindow::Show();
+ SetFocus();
}
// +--------------------------------------------------------------------+
@@ -135,16 +135,16 @@ ConfirmDlg::Show()
void
ConfirmDlg::OnApply(AWEvent* event)
{
- manager->HideConfirmDlg();
+ manager->HideConfirmDlg();
- if (parent_control)
- parent_control->ClientEvent(EID_USER_1);
+ if (parent_control)
+ parent_control->ClientEvent(EID_USER_1);
}
void
ConfirmDlg::OnCancel(AWEvent* event)
{
- manager->HideConfirmDlg();
+ manager->HideConfirmDlg();
}
// +--------------------------------------------------------------------+