Skip to content

Commit

Permalink
モデル変更時に推奨の分割サイズに戻すようにした
Browse files Browse the repository at this point in the history
  • Loading branch information
lltcggie committed Oct 24, 2018
1 parent d7c9da5 commit 8823bb3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
9 changes: 9 additions & 0 deletions waifu2x-caffe-gui/MainDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2738,6 +2738,15 @@ void DialogEvent::CheckCUDNN(HWND hWnd, WPARAM wParam, LPARAM lParam, LPVOID lpD
}
}

void DialogEvent::OnModelChange(HWND hWnd, WPARAM wParam, LPARAM lParam, LPVOID lpData)
{
if (HIWORD(wParam) == CBN_SELCHANGE)
{
OnSetInputFilePath();
UpdateAddString(hWnd, wParam, lParam, lpData);
}
}

LRESULT DialogEvent::OnSetInputFilePath(const TCHAR * tPath)
{
HWND hWnd = GetDlgItem(dh, IDC_EDIT_INPUT);
Expand Down
2 changes: 2 additions & 0 deletions waifu2x-caffe-gui/MainDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ class DialogEvent

void CheckCUDNN(HWND hWnd, WPARAM wParam, LPARAM lParam, LPVOID lpData);

void OnModelChange(HWND hWnd, WPARAM wParam, LPARAM lParam, LPVOID lpData);

LRESULT OnSetInputFilePath(const TCHAR *tPath);

LRESULT OnSetInputFilePath();
Expand Down
3 changes: 2 additions & 1 deletion waifu2x-caffe-gui/Source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ int WINAPI WinMain(HINSTANCE hInstance,
cDialog.SetCommandCallBack(SetClassFunc(DialogEvent::UpdateAddString, &cDialogEvent), NULL, IDC_RADIONOISE_LEVEL1);
cDialog.SetCommandCallBack(SetClassFunc(DialogEvent::UpdateAddString, &cDialogEvent), NULL, IDC_RADIONOISE_LEVEL2);
cDialog.SetCommandCallBack(SetClassFunc(DialogEvent::UpdateAddString, &cDialogEvent), NULL, IDC_RADIONOISE_LEVEL3);
cDialog.SetCommandCallBack(SetClassFunc(DialogEvent::UpdateAddString, &cDialogEvent), NULL, IDC_COMBO_MODEL);
cDialog.SetCommandCallBack(SetClassFunc(DialogEvent::UpdateAddString, &cDialogEvent), NULL, IDC_CHECK_TTA);
cDialog.SetCommandCallBack(SetClassFunc(DialogEvent::UpdateAddString, &cDialogEvent), NULL, IDC_COMBO_OUTPUT_DEPTH);

Expand All @@ -93,6 +92,8 @@ int WINAPI WinMain(HINSTANCE hInstance,
cDialog.SetCommandCallBack(SetClassFunc(DialogEvent::LangChange, &cDialogEvent), NULL, IDC_COMBO_LANG);
cDialog.SetCommandCallBack(SetClassFunc(DialogEvent::OutExtChange, &cDialogEvent), NULL, IDC_COMBO_OUT_EXT);

cDialog.SetCommandCallBack(SetClassFunc(DialogEvent::OnModelChange, &cDialogEvent), NULL, IDC_COMBO_MODEL);

// ダイアログのイベントで実行する関数の登録
cDialog.SetEventCallBack(SetClassFunc(DialogEvent::Create, &cDialogEvent), NULL, WM_INITDIALOG);
cDialog.SetEventCallBack(SetClassFunc(DialogEvent::OnDialogEnd, &cDialogEvent), NULL, WM_CLOSE);
Expand Down

0 comments on commit 8823bb3

Please sign in to comment.