55#include " ResourceIds.hpp"
66#include " CommandIds.hpp"
77
8- static bool MessageBoxYesNo (HWND hwnd, LPCWSTR text , LPCWSTR caption)
8+ static bool UnsavedChangesContinue (HWND hwnd, LPCWSTR caption)
99{
10- int result = MessageBox (hwnd, text, caption, MB_ICONWARNING | MB_YESNO);
10+ std::wstring text = L" You have made some changes that are not saved.\n Would you like to continue?" ;
11+ int result = MessageBox (hwnd, text.c_str (), caption, MB_ICONWARNING | MB_YESNO);
1112 return (result == IDYES);
1213}
1314
@@ -30,7 +31,7 @@ void Application::Init (HWND hwnd)
3031void Application::New (HWND hwnd)
3132{
3233 if (nodeEditor.NeedToSave ()) {
33- bool result = MessageBoxYesNo (hwnd, L" You have made some changes that are not saved. Would you like to start new file? " , L" New File" );
34+ bool result = UnsavedChangesContinue (hwnd, L" New File" );
3435 if (!result) {
3536 return ;
3637 }
@@ -41,7 +42,7 @@ void Application::New (HWND hwnd)
4142void Application::Open (HWND hwnd)
4243{
4344 if (nodeEditor.NeedToSave ()) {
44- bool result = MessageBoxYesNo (hwnd, L" You have made some changes that are not saved. Would you like to open file? " , L" Open File" );
45+ bool result = UnsavedChangesContinue (hwnd, L" Open File" );
4546 if (!result) {
4647 return ;
4748 }
@@ -66,7 +67,7 @@ void Application::Save (HWND hwnd)
6667bool Application::Close (HWND hwnd)
6768{
6869 if (nodeEditor.NeedToSave ()) {
69- return MessageBoxYesNo (hwnd, L" You have made some changes that are not saved. Would you like to quit? " , L" Quit" );
70+ return UnsavedChangesContinue (hwnd, L" Quit" );
7071 }
7172 return true ;
7273}
0 commit comments