-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from littletijn/new-welcome
New welcome screen and prevent Spooky View getting transparent
- Loading branch information
Showing
23 changed files
with
303 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
#include "stdafx.h" | ||
#include "CIntroDialog.h" | ||
#include <WindowsX.h> | ||
#include "ISettingsManager.h" | ||
#include "SpookyView.h" | ||
|
||
CIntroDialog::CIntroDialog(HINSTANCE hInstance, HWND hParent) : CModelessDialog(hInstance, hParent) | ||
{ | ||
}; | ||
|
||
BOOL CIntroDialog::SetupDialog() | ||
{ | ||
key = IDD_INTRO; | ||
this->dialogResource = MAKEINTRESOURCE(IDD_INTRO); | ||
return TRUE; | ||
} | ||
|
||
INT_PTR CALLBACK CIntroDialog::DlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) | ||
{ | ||
switch (message) | ||
{ | ||
case WM_INITDIALOG: | ||
SetupWindow(hDlg); | ||
return TRUE; | ||
case WM_COMMAND: | ||
switch (LOWORD(wParam)) { | ||
case IDCANCEL: | ||
case IDCLOSE: | ||
ApplyChoice(); | ||
DestroyWindow(hDlg); | ||
return TRUE; | ||
case IDC_BUTTON_INTRO_SETTINGS: | ||
if (!cSettingsDialog) | ||
{ | ||
cSettingsDialog = std::make_unique<CSettingsDialog>(this->hInstance, mainHwnd); | ||
} | ||
if (!cSettingsDialog->hasInitInstance()) | ||
{ | ||
cSettingsDialog->InitInstance(); | ||
} | ||
else | ||
{ | ||
cSettingsDialog->SetForeground(); | ||
} | ||
break; | ||
case IDC_BUTTON_SETUP_APPS: | ||
if (!cSetupDialog) | ||
{ | ||
cSetupDialog = std::make_unique<CSetupDialog>(this->hInstance, mainHwnd); | ||
} | ||
if (!cSetupDialog->hasInitInstance()) | ||
{ | ||
cSetupDialog->InitInstance(); | ||
} | ||
else | ||
{ | ||
cSetupDialog->SetForeground(); | ||
} | ||
break; | ||
} | ||
break; | ||
} | ||
return FALSE; | ||
} | ||
|
||
void CIntroDialog::SetupWindow(HWND hDlg) | ||
{ | ||
//Set font of header | ||
ZeroMemory(&introFont, sizeof(LOGFONT)); | ||
introFont.lfHeight = 20; | ||
introFont.lfWeight = FW_BOLD; | ||
HFONT hFont = CreateFontIndirect(&introFont); | ||
if ((HFONT)0 != hFont) | ||
{ | ||
HWND introStaticText = GetDlgItem(hDlg, ID_STATIC_INTRO_TITLE); | ||
SetWindowFont(introStaticText, hFont, TRUE); | ||
} | ||
//Set state of checkbox | ||
HWND skipIntroCheckbox = GetDlgItem(hDlg, IDC_SKIP_INTRO_CHECKBOX); | ||
BOOL skipValue = settingsManager->GetSkipWelcome(); | ||
if (skipValue == 1) | ||
{ | ||
Button_SetCheck(skipIntroCheckbox, TRUE); | ||
} | ||
} | ||
|
||
void CIntroDialog::ApplyChoice() | ||
{ | ||
HWND skipIntroCheckbox = GetDlgItem(hWnd, IDC_SKIP_INTRO_CHECKBOX); | ||
settingsManager->SetSkipWelcome(Button_GetCheck(skipIntroCheckbox)); | ||
} | ||
|
||
void CIntroDialog::setSkipWelcomeCheckbox(BOOL state) | ||
{ | ||
HWND skipIntroCheckbox = GetDlgItem(hWnd, IDC_SKIP_INTRO_CHECKBOX); | ||
Button_SetCheck(skipIntroCheckbox, state); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#ifndef CINTRODIALOG_H | ||
#define CINTRODIALOG_H | ||
|
||
#include "CModelessDialog.h" | ||
|
||
class CIntroDialog :public CModelessDialog | ||
{ | ||
public: | ||
CIntroDialog(HINSTANCE hInstance, HWND hParent); | ||
INT_PTR CALLBACK DlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam); | ||
void setSkipWelcomeCheckbox(BOOL state); | ||
protected: | ||
BOOL SetupDialog(); | ||
LOGFONT introFont; | ||
void SetupWindow(HWND hDlg); | ||
void ApplyChoice(); | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.