Skip to content

Commit

Permalink
Fix #262
Browse files Browse the repository at this point in the history
  • Loading branch information
katahiromz committed Aug 2, 2024
1 parent c89d829 commit 43200c0
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 16 deletions.
2 changes: 1 addition & 1 deletion EGA
Submodule EGA updated 2 files
+5 −0 ega.cpp
+2 −2 ega.hpp
1 change: 1 addition & 0 deletions HISTORY-ID.txt
Original file line number Diff line number Diff line change
Expand Up @@ -319,3 +319,4 @@
- Separated x86 and x64 settings.
- Fixed misinterpretation of open filter index.
- v.5.8.5 (2024-XX-YY)
- Improved EGA console usability.
1 change: 1 addition & 0 deletions HISTORY-ITA.txt
Original file line number Diff line number Diff line change
Expand Up @@ -319,3 +319,4 @@
- Impostazioni x86 e x64 separate.
- Risolta errata interpretazione apertura indice filtro.
- v.5.8.5 (DD.MM.2024)
- Improved EGA console usability.
1 change: 1 addition & 0 deletions HISTORY-JPN.txt
Original file line number Diff line number Diff line change
Expand Up @@ -663,3 +663,4 @@
- x86とx64の設定を分離。
- 「開く」フィルターの解釈間違いを修正。
- v.5.8.5 (2024-XX-YY)
- Improved EGA console usability.
1 change: 1 addition & 0 deletions HISTORY-KOR.txt
Original file line number Diff line number Diff line change
Expand Up @@ -320,3 +320,4 @@
- x86 및 x64 설정을 분리합니다.
- 열린 필터 인덱스의 잘못된 해석을 수정했습니다.
- v.5.8.5 (2024-XX-YY)
- Improved EGA console usability.
1 change: 1 addition & 0 deletions HISTORY-PTB.txt
Original file line number Diff line number Diff line change
Expand Up @@ -319,3 +319,4 @@
- Separated x86 and x64 settings.
- Fixed misinterpretation of open filter index.
- v.5.8.5 (2024-XX-YY)
- Improved EGA console usability.
1 change: 1 addition & 0 deletions HISTORY.txt
Original file line number Diff line number Diff line change
Expand Up @@ -319,3 +319,4 @@
- Separated x86 and x64 settings.
- Fixed misinterpretation of open filter index.
- v.5.8.5 (2024-XX-YY)
- Improved EGA console usability.
14 changes: 12 additions & 2 deletions src/MEgaDlg.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,26 @@ using namespace EGA;
class MEgaDlg;
static HWND s_hwndEga = NULL;
static BOOL s_bEnter = FALSE;
extern HWND g_hMainWnd;

static bool EGA_dialog_input(char *buf, size_t buflen)
{
if (buf == NULL && buflen == 0)
{
SendMessageW(s_hwndEga, WM_COMMAND, IDCONTINUE, 0);
return true;
}

while (!s_bEnter || !::IsWindowVisible(s_hwndEga))
{
Sleep(100);
}
s_bEnter = FALSE;

WCHAR szTextW[260];
WCHAR szTextW[512];
GetDlgItemTextW(s_hwndEga, edt2, szTextW, ARRAYSIZE(szTextW));

char szTextA[260];
char szTextA[512];
WideCharToMultiByte(CP_UTF8, 0, szTextW, -1, szTextA, ARRAYSIZE(szTextA), NULL, NULL);

StringCchCopyA(buf, buflen, szTextA);
Expand Down Expand Up @@ -198,6 +205,9 @@ class MEgaDlg : public MDialogBase
s_bEnter = FALSE;
::ShowWindow(hwnd, SW_HIDE);
break;
case IDCONTINUE:
SendMessageW(g_hMainWnd, WM_COMMAND, ID_REFRESHALL, 0);
break;
case psh1:
OnPsh1(hwnd);
break;
Expand Down
16 changes: 3 additions & 13 deletions src/RisohEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ void DoSetFileModified(BOOL bModified)
s_bModified = bModified;
}

static HWND s_hMainWnd = NULL;
HWND g_hMainWnd = NULL;
static INT s_ret = 0;

enum IMPORT_RESULT
Expand Down Expand Up @@ -10417,7 +10417,7 @@ void MMainWnd::OnDestroy(HWND hwnd)
DestroyWindow(m_splitter1);
DestroyWindow(m_splitter2);

s_hMainWnd = NULL;
g_hMainWnd = NULL;

// post WM_QUIT message to quit the application
PostQuitMessage(0);
Expand Down Expand Up @@ -14494,7 +14494,7 @@ BOOL MMainWnd::OnCreate(HWND hwnd, LPCREATESTRUCT lpCreateStruct)

m_id_list_dlg.m_hMainWnd = hwnd; // set the main window to the ID list window

s_hMainWnd = hwnd;
g_hMainWnd = hwnd;
m_nShowMode = SHOW_CODEONLY;

DoLoadLangInfo(); // load the language information
Expand Down Expand Up @@ -16488,8 +16488,6 @@ EGA::arg_t MMainWnd::RES_delete(const EGA::args_t& args)
SelectTV(NULL, FALSE);
}

PostMessageW(s_hMainWnd, WM_COMMAND, ID_REFRESHALL, 0);

return make_arg<AstInt>(ret);
}

Expand Down Expand Up @@ -16545,8 +16543,6 @@ EGA::arg_t MMainWnd::RES_clone_by_name(const EGA::args_t& args)
if (!found.empty())
DoSetFileModified(TRUE);

PostMessageW(s_hMainWnd, WM_COMMAND, ID_REFRESHALL, 0);

return make_arg<AstInt>(!found.empty());
}

Expand Down Expand Up @@ -16648,8 +16644,6 @@ EGA::arg_t MMainWnd::RES_clone_by_lang(const EGA::args_t& args)
if (!found2.empty())
DoSetFileModified(TRUE);

PostMessageW(s_hMainWnd, WM_COMMAND, ID_REFRESHALL, 0);

return make_arg<AstInt>(!found2.empty());
}

Expand Down Expand Up @@ -16705,7 +16699,6 @@ EGA::arg_t MMainWnd::RES_set_binary(const EGA::args_t& args)
ret = 1;

DoSetFileModified(TRUE);
PostMessageW(s_hMainWnd, WM_COMMAND, ID_REFRESHALL, 0);

return make_arg<AstInt>(ret);
}
Expand Down Expand Up @@ -16799,7 +16792,6 @@ EGA::arg_t MMainWnd::RES_set_text(EGA::arg_t arg0, EGA::arg_t arg1, EGA::arg_t a
--g_bNoGuiMode;

DoSetFileModified(TRUE);
PostMessageW(s_hMainWnd, WM_COMMAND, ID_REFRESHALL, 0);

return make_arg<AstInt>(ret);
}
Expand Down Expand Up @@ -16966,7 +16958,6 @@ EGA::arg_t MMainWnd::RES_str_set(EGA::arg_t arg0, EGA::arg_t arg1, EGA::arg_t ar
}

DoSetFileModified(TRUE);
PostMessageW(s_hMainWnd, WM_COMMAND, ID_REFRESHALL, 0);

return make_arg<AstInt>(1); // success
}
Expand Down Expand Up @@ -17015,7 +17006,6 @@ EGA::arg_t MMainWnd::RES_unload_resh(const EGA::args_t& args)
UnloadResourceH(m_hwnd);

DoSetFileModified(TRUE);
PostMessageW(s_hMainWnd, WM_COMMAND, ID_REFRESHALL, 0);

return make_arg<AstInt>(1);
}
Expand Down

0 comments on commit 43200c0

Please sign in to comment.