• R/O
  • SSH
  • HTTPS

ttssh2: Commit


Commit MetaInfo

Revision8273 (tree)
Time2019-10-07 23:37:58
Authorzmatsuo

Log Message

ヘルプの表示をリクエストする側がヘルプIDを指定するようにした

- ダイアログが WM_USER_DLGHELP2 メッセージを投げるとき WPARAM に 0 が入っていると従来どおりの動作

- ダイアログを表示する前に WM_USER_DLGHELP2 を受信時に表示するヘルプIDを設定しておく

- WPARAM に ヘルプID を指定すると、そのヘルプが表示される
- r8017, r8225

Change Summary

Incremental Difference

--- trunk/teraterm/teraterm/tekwin.cpp (revision 8272)
+++ trunk/teraterm/teraterm/tekwin.cpp (revision 8273)
@@ -636,7 +636,7 @@
636636
637637 LRESULT CTEKWindow::OnDlgHelp(WPARAM wParam, LPARAM lParam)
638638 {
639- DWORD help_id = (wParam == 0) ? HelpId : wParam;
639+ DWORD help_id = (wParam == 0) ? HelpId : (DWORD)wParam;
640640 OpenHelp(HH_HELP_CONTEXT, HelpId, ts.UILanguageFile);
641641 return 0;
642642 }
@@ -783,7 +783,7 @@
783783 // HELPMSGSTRING message 時
784784 // wp = dialog handle
785785 // lp = initialization structure
786- OnDlgHelp(wp, lp);
786+ OnDlgHelp(HelpId, 0);
787787 return 0;
788788 }
789789 switch(msg)
--- trunk/teraterm/teraterm/vtwin.cpp (revision 8272)
+++ trunk/teraterm/teraterm/vtwin.cpp (revision 8273)
@@ -3685,7 +3685,7 @@
36853685
36863686 LRESULT CVTWindow::OnDlgHelp(WPARAM wParam, LPARAM lParam)
36873687 {
3688- DWORD help_id = (wParam == 0) ? HelpId : wParam;
3688+ DWORD help_id = (wParam == 0) ? HelpId : (DWORD)wParam;
36893689 OpenHelp(HH_HELP_CONTEXT, help_id, ts.UILanguageFile);
36903690 return 0;
36913691 }
@@ -6309,7 +6309,7 @@
63096309 // HELPMSGSTRING message 時
63106310 // wp = dialog handle
63116311 // lp = initialization structure
6312- OnDlgHelp(0, 0);
6312+ OnDlgHelp(HelpId, 0);
63136313 return 0;
63146314 }
63156315 switch(msg)
--- trunk/teraterm/ttpdlg/ttdlg.c (revision 8272)
+++ trunk/teraterm/ttpdlg/ttdlg.c (revision 8273)
@@ -50,6 +50,7 @@
5050 #include "tipwin.h"
5151 #include "comportinfo.h"
5252 #include "codeconv.h"
53+#include "helpid.h"
5354
5455 // Oniguruma: Regular expression library
5556 #define ONIG_EXTERN extern
@@ -281,9 +282,9 @@
281282 return TRUE;
282283
283284 case WM_COMMAND:
285+ ts = (PTTSet)GetWindowLongPtr(Dialog,DWLP_USER);
284286 switch (LOWORD(wParam)) {
285287 case IDOK:
286- ts = (PTTSet)GetWindowLongPtr(Dialog,DWLP_USER);
287288
288289 if ( ts!=NULL ) {
289290 int width, height;
@@ -421,9 +422,31 @@
421422 }
422423 break;
423424
424- case IDC_TERMHELP:
425- PostMessage(GetParent(Dialog),WM_USER_DLGHELP2,0,0);
425+ case IDC_TERMHELP: {
426+ WPARAM HelpId;
427+ switch (ts->Language) {
428+ case IdJapanese:
429+ HelpId = HlpSetupTerminalJa;
430+ break;
431+ case IdEnglish:
432+ HelpId = HlpSetupTerminalEn;
433+ break;
434+ case IdKorean:
435+ HelpId = HlpSetupTerminalKo;
436+ break;
437+ case IdRussian:
438+ HelpId = HlpSetupTerminalRu;
439+ break;
440+ case IdUtf8:
441+ HelpId = HlpSetupTerminalUtf8;
442+ break;
443+ default:
444+ HelpId = HlpSetupTerminal;
445+ break;
446+ }
447+ PostMessage(GetParent(Dialog),WM_USER_DLGHELP2,HelpId,0);
426448 break;
449+ }
427450 }
428451 }
429452 return FALSE;
@@ -941,9 +964,11 @@
941964 }
942965 break;
943966
944- case IDC_WINHELP:
945- PostMessage(GetParent(Dialog),WM_USER_DLGHELP2,0,0);
967+ case IDC_WINHELP: {
968+ const WPARAM HelpId = ts->VTFlag > 0 ? HlpSetupWindow : HlpTEKSetupWindow;
969+ PostMessage(GetParent(Dialog),WM_USER_DLGHELP2,HelpId,0);
946970 break;
971+ }
947972 }
948973 break;
949974
@@ -1077,9 +1102,9 @@
10771102 return TRUE;
10781103
10791104 case WM_COMMAND:
1105+ ts = (PTTSet)GetWindowLongPtr(Dialog,DWLP_USER);
10801106 switch (LOWORD(wParam)) {
10811107 case IDOK:
1082- ts = (PTTSet)GetWindowLongPtr(Dialog,DWLP_USER);
10831108 if ( ts!=NULL ) {
10841109 WORD w;
10851110
@@ -1104,8 +1129,17 @@
11041129 EndDialog(Dialog, 0);
11051130 return TRUE;
11061131
1107- case IDC_KEYBHELP:
1108- PostMessage(GetParent(Dialog),WM_USER_DLGHELP2,0,0);
1132+ case IDC_KEYBHELP: {
1133+ WPARAM HelpId;
1134+ if (ts->Language==IdRussian) {
1135+ HelpId = HlpSetupKeyboardRuss;
1136+ }
1137+ else {
1138+ HelpId = HlpSetupKeyboard;
1139+ }
1140+ PostMessage(GetParent(Dialog),WM_USER_DLGHELP2,HelpId,0);
1141+ break;
1142+ }
11091143 }
11101144 }
11111145 return FALSE;
@@ -1514,7 +1548,7 @@
15141548 return TRUE;
15151549
15161550 case IDC_SERIALHELP:
1517- PostMessage(GetParent(Dialog),WM_USER_DLGHELP2,0,0);
1551+ PostMessage(GetParent(Dialog),WM_USER_DLGHELP2,HlpSetupSerialPort,0);
15181552 return TRUE;
15191553
15201554 case IDC_SERIALPORT:
@@ -1771,7 +1805,7 @@
17711805 break;
17721806
17731807 case IDC_TCPIPHELP:
1774- PostMessage(GetParent(Dialog),WM_USER_DLGHELP2,0,0);
1808+ PostMessage(GetParent(Dialog),WM_USER_DLGHELP2,HlpSetupTCPIP,0);
17751809 break;
17761810 }
17771811 }
@@ -2002,7 +2036,8 @@
20022036 break;
20032037
20042038 case IDC_HOSTHELP:
2005- PostMessage(GetParent(Dialog),WM_USER_DLGHELP2,0,0);
2039+ PostMessage(GetParent(Dialog),WM_USER_DLGHELP2,HlpFileNewConnection,0);
2040+ break;
20062041 }
20072042 }
20082043 return FALSE;
@@ -2158,7 +2193,8 @@
21582193 return TRUE;
21592194
21602195 case IDC_DIRHELP:
2161- PostMessage(GetParent(Dialog),WM_USER_DLGHELP2,0,0);
2196+ PostMessage(GetParent(Dialog),WM_USER_DLGHELP2,HlpFileChangeDir,0);
2197+ break;
21622198 }
21632199 }
21642200 return FALSE;
@@ -2967,7 +3003,8 @@
29673003 return TRUE;
29683004
29693005 case IDC_GENHELP:
2970- PostMessage(GetParent(Dialog),WM_USER_DLGHELP2,0,0);
3006+ PostMessage(GetParent(Dialog),WM_USER_DLGHELP2,HlpSetupGeneral,0);
3007+ break;
29713008 }
29723009 break;
29733010
@@ -3053,7 +3090,8 @@
30533090 break;
30543091
30553092 case IDC_WINLISTHELP:
3056- PostMessage(GetParent(Dialog),WM_USER_DLGHELP2,0,0);
3093+ PostMessage(GetParent(Dialog),WM_USER_DLGHELP2,HlpWindowWindow,0);
3094+ break;
30573095 }
30583096 }
30593097 return FALSE;
--- trunk/teraterm/ttpfile/ttfile.c (revision 8272)
+++ trunk/teraterm/ttpfile/ttfile.c (revision 8273)
@@ -882,8 +882,10 @@
882882 }
883883 return TRUE;
884884 case IDC_GETFNHELP:
885- if (fv!=NULL)
886- PostMessage(fv->HMainWin,WM_USER_DLGHELP2,0,0);
885+ if (fv!=NULL) {
886+ // 呼び出し元がヘルプIDを準備する
887+ PostMessage(fv->HMainWin,WM_USER_DLGHELP2,0,0);
888+ }
887889 break;
888890 }
889891 }
--- trunk/ttssh2/ttxssh/ttxssh.c (revision 8272)
+++ trunk/ttssh2/ttxssh/ttxssh.c (revision 8273)
@@ -1634,7 +1634,7 @@
16341634 break;
16351635
16361636 case IDC_HOSTHELP:
1637- PostMessage(GetParent(dlg), WM_USER_DLGHELP2, 0, 0);
1637+ PostMessage(GetParent(dlg), WM_USER_DLGHELP2, HlpFileNewConnection, 0);
16381638 }
16391639 }
16401640 return FALSE;
Show on old repository browser