* Replay: removed redundant window update when using "Browse" (fix #585)

This commit is contained in:
ansstuff 2013-03-17 13:45:41 +00:00
parent 1f64a4ef1a
commit c952bc86d2
1 changed files with 11 additions and 11 deletions

View File

@ -611,8 +611,8 @@ BOOL CALLBACK ReplayDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lP
return FALSE; return FALSE;
case WM_COMMAND: case WM_COMMAND:
if(HIWORD(wParam) == EN_CHANGE) if (HIWORD(wParam) == EN_CHANGE)
{ {
if (LOWORD(wParam) == IDC_EDIT_STOPFRAME) // Check if Stop movie at value has changed if (LOWORD(wParam) == IDC_EDIT_STOPFRAME) // Check if Stop movie at value has changed
{ {
if (stopframeWasEditedByUser) if (stopframeWasEditedByUser)
@ -624,20 +624,18 @@ BOOL CALLBACK ReplayDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lP
else else
stopframeWasEditedByUser = true; stopframeWasEditedByUser = true;
} }
} }
if(HIWORD(wParam) == CBN_SELCHANGE) if (HIWORD(wParam) == CBN_SELCHANGE)
{ {
UpdateReplayDialog(hwndDlg); UpdateReplayDialog(hwndDlg);
} } else if(HIWORD(wParam) == CBN_CLOSEUP)
else if(HIWORD(wParam) == CBN_CLOSEUP)
{ {
LONG lCount = SendDlgItemMessage(hwndDlg, IDC_COMBO_FILENAME, CB_GETCOUNT, 0, 0); LONG lCount = SendDlgItemMessage(hwndDlg, IDC_COMBO_FILENAME, CB_GETCOUNT, 0, 0);
LONG lIndex = SendDlgItemMessage(hwndDlg, IDC_COMBO_FILENAME, CB_GETCURSEL, 0, 0); LONG lIndex = SendDlgItemMessage(hwndDlg, IDC_COMBO_FILENAME, CB_GETCURSEL, 0, 0);
if (lIndex != CB_ERR && lIndex == lCount-1) if (lIndex != CB_ERR && lIndex == lCount-1)
SendMessage(hwndDlg, WM_COMMAND, (WPARAM)IDOK, 0); // send an OK notification to open the file browser SendMessage(hwndDlg, WM_COMMAND, (WPARAM)IDOK, 0); // send an OK notification to open the file browser
} } else
else
{ {
int wID = LOWORD(wParam); int wID = LOWORD(wParam);
switch(wID) switch(wID)
@ -691,14 +689,15 @@ BOOL CALLBACK ReplayDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lP
{ {
// select already existing string // select already existing string
SendDlgItemMessage(hwndDlg, IDC_COMBO_FILENAME, CB_SETCURSEL, lOtherIndex, 0); SendDlgItemMessage(hwndDlg, IDC_COMBO_FILENAME, CB_SETCURSEL, lOtherIndex, 0);
} else { UpdateReplayDialog(hwndDlg);
} else
{
SendDlgItemMessage(hwndDlg, IDC_COMBO_FILENAME, CB_INSERTSTRING, lIndex, (LPARAM)relative); SendDlgItemMessage(hwndDlg, IDC_COMBO_FILENAME, CB_INSERTSTRING, lIndex, (LPARAM)relative);
SendDlgItemMessage(hwndDlg, IDC_COMBO_FILENAME, CB_SETCURSEL, lIndex, 0); SendDlgItemMessage(hwndDlg, IDC_COMBO_FILENAME, CB_SETCURSEL, lIndex, 0);
//UpdateReplayDialog(hwndDlg); - this call would be redundant, because the update is always triggered by CBN_SELCHANGE message anyway
} }
// restore focus to the dialog // restore focus to the dialog
SetFocus(GetDlgItem(hwndDlg, IDC_COMBO_FILENAME)); SetFocus(GetDlgItem(hwndDlg, IDC_COMBO_FILENAME));
UpdateReplayDialog(hwndDlg);
} }
abort: abort:
@ -728,6 +727,7 @@ BOOL CALLBACK ReplayDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lP
return TRUE; return TRUE;
} }
} }
return FALSE;
case WM_CTLCOLORSTATIC: case WM_CTLCOLORSTATIC:
if ((HWND)lParam == GetDlgItem(hwndDlg, IDC_LABEL_CURRCHECKSUM)) if ((HWND)lParam == GetDlgItem(hwndDlg, IDC_LABEL_CURRCHECKSUM))