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

scmno****@osdn***** scmno****@osdn*****
2019年 10月 7日 (月) 23:37:58 JST


Revision: 8273
          https://osdn.net/projects/ttssh2/scm/svn/commits/8273
Author:   zmatsuo
Date:     2019-10-07 23:37:58 +0900 (Mon, 07 Oct 2019)
Log Message:
-----------
ヘルプの表示をリクエストする側がヘルプIDを指定するようにした

- ダイアログが WM_USER_DLGHELP2 メッセージを投げるとき WPARAM に 0 が入っていると従来どおりの動作
  - ダイアログを表示する前に WM_USER_DLGHELP2 を受信時に表示するヘルプIDを設定しておく
- WPARAM に ヘルプID を指定すると、そのヘルプが表示される
- r8017, r8225

Revision Links:
--------------
    https://osdn.net/projects/ttssh2/scm/svn/commits/8017
    https://osdn.net/projects/ttssh2/scm/svn/commits/8225

Modified Paths:
--------------
    trunk/teraterm/teraterm/tekwin.cpp
    trunk/teraterm/teraterm/vtwin.cpp
    trunk/teraterm/ttpdlg/ttdlg.c
    trunk/teraterm/ttpfile/ttfile.c
    trunk/ttssh2/ttxssh/ttxssh.c

-------------- next part --------------
Modified: trunk/teraterm/teraterm/tekwin.cpp
===================================================================
--- trunk/teraterm/teraterm/tekwin.cpp	2019-10-07 13:33:14 UTC (rev 8272)
+++ trunk/teraterm/teraterm/tekwin.cpp	2019-10-07 14:37:58 UTC (rev 8273)
@@ -636,7 +636,7 @@
 
 LRESULT CTEKWindow::OnDlgHelp(WPARAM wParam, LPARAM lParam)
 {
-	DWORD help_id = (wParam == 0) ? HelpId : wParam;
+	DWORD help_id = (wParam == 0) ? HelpId : (DWORD)wParam;
 	OpenHelp(HH_HELP_CONTEXT, HelpId, ts.UILanguageFile);
 	return 0;
 }
@@ -783,7 +783,7 @@
 		// HELPMSGSTRING message \x8E\x9E
 		//		wp = dialog handle
 		//		lp = initialization structure
-		OnDlgHelp(wp, lp);
+		OnDlgHelp(HelpId, 0);
 		return 0;
 	}
 	switch(msg)

Modified: trunk/teraterm/teraterm/vtwin.cpp
===================================================================
--- trunk/teraterm/teraterm/vtwin.cpp	2019-10-07 13:33:14 UTC (rev 8272)
+++ trunk/teraterm/teraterm/vtwin.cpp	2019-10-07 14:37:58 UTC (rev 8273)
@@ -3685,7 +3685,7 @@
 
 LRESULT CVTWindow::OnDlgHelp(WPARAM wParam, LPARAM lParam)
 {
-	DWORD help_id = (wParam == 0) ? HelpId : wParam;
+	DWORD help_id = (wParam == 0) ? HelpId : (DWORD)wParam;
 	OpenHelp(HH_HELP_CONTEXT, help_id, ts.UILanguageFile);
 	return 0;
 }
@@ -6309,7 +6309,7 @@
 		// HELPMSGSTRING message \x8E\x9E
 		//		wp = dialog handle
 		//		lp = initialization structure
-		OnDlgHelp(0, 0);
+		OnDlgHelp(HelpId, 0);
 		return 0;
 	}
 	switch(msg)

Modified: trunk/teraterm/ttpdlg/ttdlg.c
===================================================================
--- trunk/teraterm/ttpdlg/ttdlg.c	2019-10-07 13:33:14 UTC (rev 8272)
+++ trunk/teraterm/ttpdlg/ttdlg.c	2019-10-07 14:37:58 UTC (rev 8273)
@@ -50,6 +50,7 @@
 #include "tipwin.h"
 #include "comportinfo.h"
 #include "codeconv.h"
+#include "helpid.h"
 
 // Oniguruma: Regular expression library
 #define ONIG_EXTERN extern
@@ -281,9 +282,9 @@
 			return TRUE;
 
 		case WM_COMMAND:
+			ts = (PTTSet)GetWindowLongPtr(Dialog,DWLP_USER);
 			switch (LOWORD(wParam)) {
 				case IDOK:
-					ts = (PTTSet)GetWindowLongPtr(Dialog,DWLP_USER);
 
 					if ( ts!=NULL ) {
 						int width, height;
@@ -421,9 +422,31 @@
 					}
 					break;
 
-				case IDC_TERMHELP:
-					PostMessage(GetParent(Dialog),WM_USER_DLGHELP2,0,0);
+				case IDC_TERMHELP: {
+					WPARAM HelpId;
+					switch (ts->Language) {
+					case IdJapanese:
+						HelpId = HlpSetupTerminalJa;
+						break;
+					case IdEnglish:
+						HelpId = HlpSetupTerminalEn;
+						break;
+					case IdKorean:
+						HelpId = HlpSetupTerminalKo;
+						break;
+					case IdRussian:
+						HelpId = HlpSetupTerminalRu;
+						break;
+					case IdUtf8:
+						HelpId = HlpSetupTerminalUtf8;
+						break;
+					default:
+						HelpId = HlpSetupTerminal;
+						break;
+					}
+					PostMessage(GetParent(Dialog),WM_USER_DLGHELP2,HelpId,0);
 					break;
+				}
 			}
 	}
 	return FALSE;
@@ -941,9 +964,11 @@
 					}
 					break;
 
-				case IDC_WINHELP:
-					PostMessage(GetParent(Dialog),WM_USER_DLGHELP2,0,0);
+				case IDC_WINHELP: {
+					const WPARAM HelpId = ts->VTFlag > 0 ? HlpSetupWindow : HlpTEKSetupWindow;
+					PostMessage(GetParent(Dialog),WM_USER_DLGHELP2,HelpId,0);
 					break;
+				}
 			}
 			break;
 
@@ -1077,9 +1102,9 @@
 			return TRUE;
 
 		case WM_COMMAND:
+			ts = (PTTSet)GetWindowLongPtr(Dialog,DWLP_USER);
 			switch (LOWORD(wParam)) {
 				case IDOK:
-					ts = (PTTSet)GetWindowLongPtr(Dialog,DWLP_USER);
 					if ( ts!=NULL ) {
 						WORD w;
 
@@ -1104,8 +1129,17 @@
 					EndDialog(Dialog, 0);
 					return TRUE;
 
-				case IDC_KEYBHELP:
-					PostMessage(GetParent(Dialog),WM_USER_DLGHELP2,0,0);
+				case IDC_KEYBHELP: {
+					WPARAM HelpId;
+					if (ts->Language==IdRussian) {
+						HelpId = HlpSetupKeyboardRuss;
+					}
+					else {
+						HelpId = HlpSetupKeyboard;
+					}
+					PostMessage(GetParent(Dialog),WM_USER_DLGHELP2,HelpId,0);
+					break;
+				}
 			}
 	}
 	return FALSE;
@@ -1514,7 +1548,7 @@
 					return TRUE;
 
 				case IDC_SERIALHELP:
-					PostMessage(GetParent(Dialog),WM_USER_DLGHELP2,0,0);
+					PostMessage(GetParent(Dialog),WM_USER_DLGHELP2,HlpSetupSerialPort,0);
 					return TRUE;
 
 				case IDC_SERIALPORT:
@@ -1771,7 +1805,7 @@
 					break;
 
 				case IDC_TCPIPHELP:
-					PostMessage(GetParent(Dialog),WM_USER_DLGHELP2,0,0);
+					PostMessage(GetParent(Dialog),WM_USER_DLGHELP2,HlpSetupTCPIP,0);
 					break;
 			}
 	}
@@ -2002,7 +2036,8 @@
 					break;
 
 				case IDC_HOSTHELP:
-					PostMessage(GetParent(Dialog),WM_USER_DLGHELP2,0,0);
+					PostMessage(GetParent(Dialog),WM_USER_DLGHELP2,HlpFileNewConnection,0);
+					break;
 			}
 	}
 	return FALSE;
@@ -2158,7 +2193,8 @@
 					return TRUE;
 
 				case IDC_DIRHELP:
-					PostMessage(GetParent(Dialog),WM_USER_DLGHELP2,0,0);
+					PostMessage(GetParent(Dialog),WM_USER_DLGHELP2,HlpFileChangeDir,0);
+					break;
 			}
 	}
 	return FALSE;
@@ -2967,7 +3003,8 @@
 					return TRUE;
 
 				case IDC_GENHELP:
-					PostMessage(GetParent(Dialog),WM_USER_DLGHELP2,0,0);
+					PostMessage(GetParent(Dialog),WM_USER_DLGHELP2,HlpSetupGeneral,0);
+					break;
 			}
 			break;
 
@@ -3053,7 +3090,8 @@
 					break;
 
 				case IDC_WINLISTHELP:
-					PostMessage(GetParent(Dialog),WM_USER_DLGHELP2,0,0);
+					PostMessage(GetParent(Dialog),WM_USER_DLGHELP2,HlpWindowWindow,0);
+					break;
 			}
 	}
 	return FALSE;

Modified: trunk/teraterm/ttpfile/ttfile.c
===================================================================
--- trunk/teraterm/ttpfile/ttfile.c	2019-10-07 13:33:14 UTC (rev 8272)
+++ trunk/teraterm/ttpfile/ttfile.c	2019-10-07 14:37:58 UTC (rev 8273)
@@ -882,8 +882,10 @@
 			}
 			return TRUE;
 		case IDC_GETFNHELP:
-			if (fv!=NULL)
-			PostMessage(fv->HMainWin,WM_USER_DLGHELP2,0,0);
+			if (fv!=NULL) {
+				// \x8CĂяo\x82\xB5\x8C\xB3\x82\xAA\x83w\x83\x8B\x83vID\x82\xF0\x8F\x80\x94\x{142DC2}\xE9
+				PostMessage(fv->HMainWin,WM_USER_DLGHELP2,0,0);
+			}
 			break;
 		}
 	}

Modified: trunk/ttssh2/ttxssh/ttxssh.c
===================================================================
--- trunk/ttssh2/ttxssh/ttxssh.c	2019-10-07 13:33:14 UTC (rev 8272)
+++ trunk/ttssh2/ttxssh/ttxssh.c	2019-10-07 14:37:58 UTC (rev 8273)
@@ -1634,7 +1634,7 @@
 			break;
 
 		case IDC_HOSTHELP:
-			PostMessage(GetParent(dlg), WM_USER_DLGHELP2, 0, 0);
+			PostMessage(GetParent(dlg), WM_USER_DLGHELP2, HlpFileNewConnection, 0);
 		}
 	}
 	return FALSE;


Ttssh2-commit メーリングリストの案内