From 69209c38968c6f4066a772e0a51a2928749217de Mon Sep 17 00:00:00 2001 From: "FWoltermann@gmail.com" Date: Fri, 9 Dec 2011 19:00:23 +0000 Subject: Re-indenting the code to use standard tabs. Yes, I know this is pretty pointless, but who cares? --- Stars45/MenuDlg.cpp | 270 ++++++++++++++++++++++++++-------------------------- 1 file changed, 135 insertions(+), 135 deletions(-) (limited to 'Stars45/MenuDlg.cpp') diff --git a/Stars45/MenuDlg.cpp b/Stars45/MenuDlg.cpp index 436526d..db70724 100644 --- a/Stars45/MenuDlg.cpp +++ b/Stars45/MenuDlg.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: MenuDlg.cpp - AUTHOR: John DiCamillo + SUBSYSTEM: Stars.exe + FILE: MenuDlg.cpp + AUTHOR: John DiCamillo - OVERVIEW - ======== - Main Menu Dialog Active Window class + OVERVIEW + ======== + Main Menu Dialog Active Window class */ #include "MemDebug.h" @@ -50,17 +50,17 @@ extern const char* versionInfo; // +--------------------------------------------------------------------+ MenuDlg::MenuDlg(Screen* s, FormDef& def, MenuScreen* mgr) - : FormWindow(s, 0, 0, s->Width(), s->Height()), - manager(mgr), btn_start(0), - btn_campaign(0), btn_mission(0), btn_player(0), btn_multi(0), - btn_mod(0), btn_tac(0), - btn_options(0), btn_controls(0), btn_quit(0), - version(0), description(0), stars(0), campaign(0) +: FormWindow(s, 0, 0, s->Width(), s->Height()), +manager(mgr), btn_start(0), +btn_campaign(0), btn_mission(0), btn_player(0), btn_multi(0), +btn_mod(0), btn_tac(0), +btn_options(0), btn_controls(0), btn_quit(0), +version(0), description(0), stars(0), campaign(0) { - stars = Starshatter::GetInstance(); - campaign = Campaign::GetCampaign(); + stars = Starshatter::GetInstance(); + campaign = Campaign::GetCampaign(); - Init(def); + Init(def); } MenuDlg::~MenuDlg() @@ -72,94 +72,94 @@ MenuDlg::~MenuDlg() void MenuDlg::RegisterControls() { - if (btn_start) - return; - - btn_start = (Button*) FindControl(120); - btn_campaign = (Button*) FindControl(101); - btn_mission = (Button*) FindControl(102); - btn_player = (Button*) FindControl(103); - btn_multi = (Button*) FindControl(104); - btn_video = (Button*) FindControl(111); - btn_options = (Button*) FindControl(112); - btn_controls = (Button*) FindControl(113); - btn_quit = (Button*) FindControl(114); - btn_mod = (Button*) FindControl(115); - btn_tac = (Button*) FindControl(116); - - if (btn_start) { - REGISTER_CLIENT(EID_CLICK, btn_start, MenuDlg, OnStart); - REGISTER_CLIENT(EID_MOUSE_ENTER, btn_start, MenuDlg, OnButtonEnter); - REGISTER_CLIENT(EID_MOUSE_EXIT, btn_start, MenuDlg, OnButtonExit); - } - - if (btn_campaign) { - REGISTER_CLIENT(EID_CLICK, btn_campaign, MenuDlg, OnCampaign); - REGISTER_CLIENT(EID_MOUSE_ENTER, btn_campaign, MenuDlg, OnButtonEnter); - REGISTER_CLIENT(EID_MOUSE_EXIT, btn_campaign, MenuDlg, OnButtonExit); - } - - if (btn_mission) { - REGISTER_CLIENT(EID_CLICK, btn_mission, MenuDlg, OnMission); - REGISTER_CLIENT(EID_MOUSE_ENTER, btn_mission, MenuDlg, OnButtonEnter); - REGISTER_CLIENT(EID_MOUSE_EXIT, btn_mission, MenuDlg, OnButtonExit); - } - - if (btn_player) { - REGISTER_CLIENT(EID_CLICK, btn_player, MenuDlg, OnPlayer); - REGISTER_CLIENT(EID_MOUSE_ENTER, btn_player, MenuDlg, OnButtonEnter); - REGISTER_CLIENT(EID_MOUSE_EXIT, btn_player, MenuDlg, OnButtonExit); - } - - if (btn_multi) { - REGISTER_CLIENT(EID_CLICK, btn_multi, MenuDlg, OnMultiplayer); - REGISTER_CLIENT(EID_MOUSE_ENTER, btn_multi, MenuDlg, OnButtonEnter); - REGISTER_CLIENT(EID_MOUSE_EXIT, btn_multi, MenuDlg, OnButtonExit); - } - - if (btn_video) { - REGISTER_CLIENT(EID_CLICK, btn_video, MenuDlg, OnVideo); - REGISTER_CLIENT(EID_MOUSE_ENTER, btn_video, MenuDlg, OnButtonEnter); - REGISTER_CLIENT(EID_MOUSE_EXIT, btn_video, MenuDlg, OnButtonExit); - } - - if (btn_options) { - REGISTER_CLIENT(EID_CLICK, btn_options, MenuDlg, OnOptions); - REGISTER_CLIENT(EID_MOUSE_ENTER, btn_options, MenuDlg, OnButtonEnter); - REGISTER_CLIENT(EID_MOUSE_EXIT, btn_options, MenuDlg, OnButtonExit); - } - - if (btn_controls) { - REGISTER_CLIENT(EID_CLICK, btn_controls, MenuDlg, OnControls); - REGISTER_CLIENT(EID_MOUSE_ENTER, btn_controls, MenuDlg, OnButtonEnter); - REGISTER_CLIENT(EID_MOUSE_EXIT, btn_controls, MenuDlg, OnButtonExit); - } - - if (btn_mod) { - REGISTER_CLIENT(EID_CLICK, btn_mod, MenuDlg, OnMod); - REGISTER_CLIENT(EID_MOUSE_ENTER, btn_mod, MenuDlg, OnButtonEnter); - REGISTER_CLIENT(EID_MOUSE_EXIT, btn_mod, MenuDlg, OnButtonExit); - } - - if (btn_tac) { - REGISTER_CLIENT(EID_CLICK, btn_tac, MenuDlg, OnTacReference); - REGISTER_CLIENT(EID_MOUSE_ENTER, btn_tac, MenuDlg, OnButtonEnter); - REGISTER_CLIENT(EID_MOUSE_EXIT, btn_tac, MenuDlg, OnButtonExit); - } - - if (btn_quit) { - REGISTER_CLIENT(EID_CLICK, btn_quit, MenuDlg, OnQuit); - REGISTER_CLIENT(EID_MOUSE_ENTER, btn_quit, MenuDlg, OnButtonEnter); - REGISTER_CLIENT(EID_MOUSE_EXIT, btn_quit, MenuDlg, OnButtonExit); - } - - version = FindControl(100); - - if (version) { - version->SetText(versionInfo); - } - - description = FindControl(202); + if (btn_start) + return; + + btn_start = (Button*) FindControl(120); + btn_campaign = (Button*) FindControl(101); + btn_mission = (Button*) FindControl(102); + btn_player = (Button*) FindControl(103); + btn_multi = (Button*) FindControl(104); + btn_video = (Button*) FindControl(111); + btn_options = (Button*) FindControl(112); + btn_controls = (Button*) FindControl(113); + btn_quit = (Button*) FindControl(114); + btn_mod = (Button*) FindControl(115); + btn_tac = (Button*) FindControl(116); + + if (btn_start) { + REGISTER_CLIENT(EID_CLICK, btn_start, MenuDlg, OnStart); + REGISTER_CLIENT(EID_MOUSE_ENTER, btn_start, MenuDlg, OnButtonEnter); + REGISTER_CLIENT(EID_MOUSE_EXIT, btn_start, MenuDlg, OnButtonExit); + } + + if (btn_campaign) { + REGISTER_CLIENT(EID_CLICK, btn_campaign, MenuDlg, OnCampaign); + REGISTER_CLIENT(EID_MOUSE_ENTER, btn_campaign, MenuDlg, OnButtonEnter); + REGISTER_CLIENT(EID_MOUSE_EXIT, btn_campaign, MenuDlg, OnButtonExit); + } + + if (btn_mission) { + REGISTER_CLIENT(EID_CLICK, btn_mission, MenuDlg, OnMission); + REGISTER_CLIENT(EID_MOUSE_ENTER, btn_mission, MenuDlg, OnButtonEnter); + REGISTER_CLIENT(EID_MOUSE_EXIT, btn_mission, MenuDlg, OnButtonExit); + } + + if (btn_player) { + REGISTER_CLIENT(EID_CLICK, btn_player, MenuDlg, OnPlayer); + REGISTER_CLIENT(EID_MOUSE_ENTER, btn_player, MenuDlg, OnButtonEnter); + REGISTER_CLIENT(EID_MOUSE_EXIT, btn_player, MenuDlg, OnButtonExit); + } + + if (btn_multi) { + REGISTER_CLIENT(EID_CLICK, btn_multi, MenuDlg, OnMultiplayer); + REGISTER_CLIENT(EID_MOUSE_ENTER, btn_multi, MenuDlg, OnButtonEnter); + REGISTER_CLIENT(EID_MOUSE_EXIT, btn_multi, MenuDlg, OnButtonExit); + } + + if (btn_video) { + REGISTER_CLIENT(EID_CLICK, btn_video, MenuDlg, OnVideo); + REGISTER_CLIENT(EID_MOUSE_ENTER, btn_video, MenuDlg, OnButtonEnter); + REGISTER_CLIENT(EID_MOUSE_EXIT, btn_video, MenuDlg, OnButtonExit); + } + + if (btn_options) { + REGISTER_CLIENT(EID_CLICK, btn_options, MenuDlg, OnOptions); + REGISTER_CLIENT(EID_MOUSE_ENTER, btn_options, MenuDlg, OnButtonEnter); + REGISTER_CLIENT(EID_MOUSE_EXIT, btn_options, MenuDlg, OnButtonExit); + } + + if (btn_controls) { + REGISTER_CLIENT(EID_CLICK, btn_controls, MenuDlg, OnControls); + REGISTER_CLIENT(EID_MOUSE_ENTER, btn_controls, MenuDlg, OnButtonEnter); + REGISTER_CLIENT(EID_MOUSE_EXIT, btn_controls, MenuDlg, OnButtonExit); + } + + if (btn_mod) { + REGISTER_CLIENT(EID_CLICK, btn_mod, MenuDlg, OnMod); + REGISTER_CLIENT(EID_MOUSE_ENTER, btn_mod, MenuDlg, OnButtonEnter); + REGISTER_CLIENT(EID_MOUSE_EXIT, btn_mod, MenuDlg, OnButtonExit); + } + + if (btn_tac) { + REGISTER_CLIENT(EID_CLICK, btn_tac, MenuDlg, OnTacReference); + REGISTER_CLIENT(EID_MOUSE_ENTER, btn_tac, MenuDlg, OnButtonEnter); + REGISTER_CLIENT(EID_MOUSE_EXIT, btn_tac, MenuDlg, OnButtonExit); + } + + if (btn_quit) { + REGISTER_CLIENT(EID_CLICK, btn_quit, MenuDlg, OnQuit); + REGISTER_CLIENT(EID_MOUSE_ENTER, btn_quit, MenuDlg, OnButtonEnter); + REGISTER_CLIENT(EID_MOUSE_EXIT, btn_quit, MenuDlg, OnButtonExit); + } + + version = FindControl(100); + + if (version) { + version->SetText(versionInfo); + } + + description = FindControl(202); } // +--------------------------------------------------------------------+ @@ -167,10 +167,10 @@ MenuDlg::RegisterControls() void MenuDlg::Show() { - FormWindow::Show(); + FormWindow::Show(); - if (btn_multi && Starshatter::UseFileSystem()) - btn_multi->SetEnabled(false); + if (btn_multi && Starshatter::UseFileSystem()) + btn_multi->SetEnabled(false); } void @@ -183,78 +183,78 @@ MenuDlg::ExecFrame() void MenuDlg::OnStart(AWEvent* event) { - if (description) description->SetText(""); - stars->StartOrResumeGame(); + if (description) description->SetText(""); + stars->StartOrResumeGame(); } void MenuDlg::OnCampaign(AWEvent* event) { - if (description) description->SetText(""); - manager->ShowCmpSelectDlg(); + if (description) description->SetText(""); + manager->ShowCmpSelectDlg(); } void MenuDlg::OnMission(AWEvent* event) { - if (description) description->SetText(""); - manager->ShowMsnSelectDlg(); + if (description) description->SetText(""); + manager->ShowMsnSelectDlg(); } void MenuDlg::OnPlayer(AWEvent* event) { - if (description) description->SetText(""); - manager->ShowPlayerDlg(); + if (description) description->SetText(""); + manager->ShowPlayerDlg(); } void MenuDlg::OnMultiplayer(AWEvent* event) { - if (description) description->SetText(""); - manager->ShowNetClientDlg(); + if (description) description->SetText(""); + manager->ShowNetClientDlg(); } void MenuDlg::OnVideo(AWEvent* event) { - if (description) description->SetText(""); - manager->ShowVidDlg(); + if (description) description->SetText(""); + manager->ShowVidDlg(); } void MenuDlg::OnOptions(AWEvent* event) { - if (description) description->SetText(""); - manager->ShowOptDlg(); + if (description) description->SetText(""); + manager->ShowOptDlg(); } void MenuDlg::OnControls(AWEvent* event) { - if (description) description->SetText(""); - manager->ShowCtlDlg(); + if (description) description->SetText(""); + manager->ShowCtlDlg(); } void MenuDlg::OnMod(AWEvent* event) { - if (description) description->SetText(""); - manager->ShowModDlg(); + if (description) description->SetText(""); + manager->ShowModDlg(); } void MenuDlg::OnTacReference(AWEvent* event) { - if (description) description->SetText(""); - stars->OpenTacticalReference(); + if (description) description->SetText(""); + stars->OpenTacticalReference(); } void MenuDlg::OnQuit(AWEvent* event) { - if (description) description->SetText(""); - manager->ShowExitDlg(); + if (description) description->SetText(""); + manager->ShowExitDlg(); } // +--------------------------------------------------------------------+ @@ -262,15 +262,15 @@ MenuDlg::OnQuit(AWEvent* event) void MenuDlg::OnButtonEnter(AWEvent* event) { - ActiveWindow* src = event->window; + ActiveWindow* src = event->window; - if (src && description) - description->SetText(src->GetAltText()); + if (src && description) + description->SetText(src->GetAltText()); } void MenuDlg::OnButtonExit(AWEvent* event) { - if (description) - description->SetText(""); + if (description) + description->SetText(""); } -- cgit v1.1