Browse Source

allow escape to close message box prompts

Scott Brogden 2 months ago
parent
commit
1b8cfcc861
8 changed files with 14 additions and 10 deletions
  1. 2 0
      CP_Main.rc
  2. 1 1
      src/AdvGeneral.cpp
  3. 2 2
      src/CopyProperties.cpp
  4. 1 1
      src/DeleteClipData.cpp
  5. 2 2
      src/MainFrm.cpp
  6. 3 1
      src/OptionsGeneral.cpp
  7. 1 1
      src/OptionsStats.cpp
  8. 2 2
      src/QPasteWnd.cpp

+ 2 - 0
CP_Main.rc

@@ -203,6 +203,7 @@ BEGIN
         MENUITEM "Show Startup Message",        ID_FIRST_SHOWSTARTUPMESSAGE
         MENUITEM "Global Hot Keys",             ID_FIRST_GLOBALHOTKEYS
         MENUITEM "Delete Clip Data",            ID_FIRST_DELETECLIPDATA
+        MENUITEM SEPARATOR
         MENUITEM "Delete All Non Used Clips",   ID_FIRST_DELETEALLNONUSEDCLIPS
         MENUITEM SEPARATOR
         MENUITEM "Backup Database",             ID_FIRST_BACKUPDATABASE
@@ -443,6 +444,7 @@ BEGIN
         MENUITEM "Show Startup Message",        ID_FIRST_SHOWSTARTUPMESSAGE
         MENUITEM "Global Hot Keys",             ID_MENU_GLOBALHOTKEYS32933
         MENUITEM "Delete Clip Data",            ID_MENU_DELETECLIPDATA32934
+        MENUITEM SEPARATOR
         MENUITEM "Delete All Non Used Clips",   ID_MENU_DELETEALLNONUSEDCLIPS
         MENUITEM SEPARATOR
         MENUITEM "Backup Database",             ID_MENU_BACKUPDATABASE

+ 1 - 1
src/AdvGeneral.cpp

@@ -976,7 +976,7 @@ void CAdvGeneral::OnSize(UINT nType, int cx, int cy)
 void CAdvGeneral::OnBnClickedBtCompactAndRepair()
 {
 	auto msg = theApp.m_Language.GetString("CompactRepairWarning", "Warning this can take quite a long time and require up to double the hard drive space as your current database size, Continue?");
-	int ret = MessageBox(msg, _T("Ditto"), MB_YESNO);
+	int ret = MessageBox(msg, _T("Ditto"), MB_YESNOCANCEL);
 
 	if (ret == IDYES)
 	{

+ 2 - 2
src/CopyProperties.cpp

@@ -322,7 +322,7 @@ void CCopyProperties::OnOK()
 
 				if(CheckGlobalHotKey(clip) == FALSE)
 				{
-					if(MessageBox(_T("Error registering global hot key\n\nContinue?"), _T(""), MB_YESNO|MB_ICONWARNING) == IDNO)
+					if(MessageBox(_T("Error registering global hot key\n\nContinue?"), _T(""), MB_YESNOCANCEL |MB_ICONWARNING) != IDYES)
 					{
 						return;
 					}
@@ -330,7 +330,7 @@ void CCopyProperties::OnOK()
 
 				if(CheckMoveToGroupGlobalHotKey(clip) == FALSE)
 				{
-					if(MessageBox(_T("Error registering global move to group hot key\n\nContinue?"), _T(""), MB_YESNO|MB_ICONWARNING) == IDNO)
+					if(MessageBox(_T("Error registering global move to group hot key\n\nContinue?"), _T(""), MB_YESNOCANCEL |MB_ICONWARNING) != IDYES)
 					{
 						return;
 					}

+ 1 - 1
src/DeleteClipData.cpp

@@ -569,7 +569,7 @@ void CDeleteClipData::ApplyDelete()
 	if (m_applyingDelete)
 		return;
 
-	if (MessageBox(_T("Delete selected items?  This cannot be undone!"), _T(""), MB_YESNO | MB_ICONWARNING) == IDYES)
+	if (MessageBox(_T("Delete selected items?  This cannot be undone!"), _T(""), MB_YESNOCANCEL | MB_ICONWARNING) == IDYES)
 	{
 		m_clipList.EnableWindow(FALSE);
 		m_applyingDelete = true;

+ 2 - 2
src/MainFrm.cpp

@@ -1502,8 +1502,8 @@ LRESULT CMainFrame::OnRestoreDb(WPARAM wParam, LPARAM lParam)
 
 void CMainFrame::OnFirstDeleteallnonusedclips()
 {
-	int nRet = MessageBox(theApp.m_Language.GetString("Delete_All_Non_Used_Clips", "Delete all clips that are not groups, in groups, marked as never auto delete, has a shortcut key or marked as sticky.\r\n\r\nThis cannot be undone."), _T("Ditto"), MB_YESNO | MB_TOPMOST);
-	if (nRet == IDNO)
+	int nRet = MessageBox(theApp.m_Language.GetString("Delete_All_Non_Used_Clips", "Delete all clips that are not groups, in groups, marked as never auto delete, has a shortcut key or marked as sticky.\r\n\r\nThis cannot be undone."), _T("Ditto"), MB_YESNOCANCEL | MB_TOPMOST);
+	if (nRet != IDYES)
 	{
 		return;
 	}

+ 3 - 1
src/OptionsGeneral.cpp

@@ -268,7 +268,7 @@ BOOL COptionsGeneral::OnApply()
 			CString cs;
 			cs.Format(_T("The database %s does not exist.\n\nCreate a new database?"), resolvedPath);
 
-			if(MessageBox(cs, _T("Ditto"), MB_YESNO) == IDYES)
+			if(MessageBox(cs, _T("Ditto"), MB_YESNOCANCEL) == IDYES)
 			{
 				// -- create a new one
 				if(CreateDB(resolvedPath))
@@ -279,7 +279,9 @@ BOOL COptionsGeneral::OnApply()
 					MessageBox(_T("Error Creating Database"));
 			}
 			else
+			{
 				return FALSE;
+			}
 		}
 		else
 		{

+ 1 - 1
src/OptionsStats.cpp

@@ -135,7 +135,7 @@ void COptionsStats::OnResetCounts()
 
 void COptionsStats::OnRemoveAll() 
 {
-	if(MessageBox(theApp.m_Language.GetString("Remove_All", "This will remove all Copy Entries!\n\nContinue?"), _T("Warning"), MB_YESNO) == IDYES)
+	if(MessageBox(theApp.m_Language.GetString("Remove_All", "This will remove all Copy Entries!\n\nContinue?"), _T("Warning"), MB_YESNOCANCEL) == IDYES)
 	{
 		if( DeleteAllIDs() )
 		{

+ 2 - 2
src/QPasteWnd.cpp

@@ -7795,10 +7795,10 @@ bool CQPasteWnd::DoDeleteAllNonUsedClips()
 	bool bStartValue = m_bHideWnd;
 	m_bHideWnd = false;
 
-	int nRet = MessageBox(theApp.m_Language.GetString("Delete_All_Non_Used_Clips", "Delete all clips that are not groups, in groups, marked as never auto delete, has a shortcut key or marked as sticky.\r\n\r\nThis cannot be undone."), _T("Ditto"), MB_YESNO | MB_TOPMOST);
+	int nRet = MessageBox(theApp.m_Language.GetString("Delete_All_Non_Used_Clips", "Delete all clips that are not groups, in groups, marked as never auto delete, has a shortcut key or marked as sticky.\r\n\r\nThis cannot be undone."), _T("Ditto"), MB_YESNOCANCEL | MB_TOPMOST);
 
 	m_bHideWnd = bStartValue;
-	if (nRet == IDNO)
+	if (nRet != IDYES)
 	{
 		return false;
 	}