[Ttssh2-commit] [5779] dirnamebox マクロコマンドを追加

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2015年 2月 13日 (金) 17:57:41 JST


Revision: 5779
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/5779
Author:   maya
Date:     2015-02-13 17:57:40 +0900 (Fri, 13 Feb 2015)
Log Message:
-----------
dirnamebox マクロコマンドを追加
  http://sourceforge.jp/ticket/browse.php?group_id=1412&tid=34696

Modified Paths:
--------------
    trunk/teraterm/common/helpid.h
    trunk/teraterm/ttpmacro/ttl.c
    trunk/teraterm/ttpmacro/ttmparse.c
    trunk/teraterm/ttpmacro/ttmparse.h

-------------- next part --------------
Modified: trunk/teraterm/common/helpid.h
===================================================================
--- trunk/teraterm/common/helpid.h	2015-02-13 08:34:51 UTC (rev 5778)
+++ trunk/teraterm/common/helpid.h	2015-02-13 08:57:40 UTC (rev 5779)
@@ -190,6 +190,7 @@
 #define HlpMacroCommandCygConnect       92130
 #define HlpMacroCommandDelpassword      92011
 #define HlpMacroCommandDirname          92188
+#define HlpMacroCommandDirnameBox       92214
 #define HlpMacroCommandDisconnect       92012
 #define HlpMacroCommandDispstr          92149
 #define HlpMacroCommandDo               92126

Modified: trunk/teraterm/ttpmacro/ttl.c
===================================================================
--- trunk/teraterm/ttpmacro/ttl.c	2015-02-13 08:34:51 UTC (rev 5778)
+++ trunk/teraterm/ttpmacro/ttl.c	2015-02-13 08:57:40 UTC (rev 5779)
@@ -3322,6 +3322,44 @@
 	return Err;
 }
 
+WORD TTLDirnameBox()
+{
+	TStrVal Title;
+	WORD Err, ValType;
+	TVarId VarId;
+	char buf[MAX_PATH];
+	TStrVal InitDir = "";
+	BOOL ret;
+
+	Err = 0;
+	GetStrVal(Title, &Err);
+	if (Err != 0) return Err;
+
+	// get 2nd arg(optional) if given
+	if (CheckParameterGiven()) { // initdir
+		GetStrVal(InitDir, &Err);
+		if (Err != 0) return Err;
+	}
+
+	if ((Err == 0) && (GetFirstChar() != 0))
+		Err = ErrSyntax;
+	if (Err != 0) return Err;
+
+	SetInputStr("");
+	if (CheckVar("inputstr", &ValType, &VarId) &&
+		(ValType == TypString)) {
+		if (doSelectFolder(HMainWin, buf, sizeof(buf), InitDir, Title)) {
+			SetInputStr(buf);
+			ret = 1;
+		}
+		else {
+			ret = 0;
+		}
+		SetResult(ret);
+	}
+	return Err;
+}
+
 #define IdMsgBox 1
 #define IdYesNoBox 2
 #define IdStatusBox 3
@@ -5900,6 +5938,8 @@
 			Err = TTLDelPassword(); break;
 		case RsvDirname:
 			Err = TTLDirname(); break;
+		case RsvDirnameBox:
+			Err = TTLDirnameBox(); break;
 		case RsvDisconnect:
 			Err = TTLDisconnect(); break;
 		case RsvDispStr:

Modified: trunk/teraterm/ttpmacro/ttmparse.c
===================================================================
--- trunk/teraterm/ttpmacro/ttmparse.c	2015-02-13 08:34:51 UTC (rev 5778)
+++ trunk/teraterm/ttpmacro/ttmparse.c	2015-02-13 08:57:40 UTC (rev 5779)
@@ -205,6 +205,7 @@
 		else if (_stricmp(Str,"dispstr")==0) *WordId = RsvDispStr;
 		else if (_stricmp(Str,"do")==0) *WordId = RsvDo;
 		else if (_stricmp(Str,"dirname")==0) *WordId = RsvDirname;
+		else if (_stricmp(Str, "dirnamebox") == 0) *WordId = RsvDirnameBox;
 		break;
 	case 'e':
 		if (_stricmp(Str,"else")==0) *WordId = RsvElse;

Modified: trunk/teraterm/ttpmacro/ttmparse.h
===================================================================
--- trunk/teraterm/ttpmacro/ttmparse.h	2015-02-13 08:34:51 UTC (rev 5778)
+++ trunk/teraterm/ttpmacro/ttmparse.h	2015-02-13 08:57:40 UTC (rev 5779)
@@ -243,6 +243,7 @@
 #define RsvLogAutoClose 211
 #define RsvUptime		212
 #define RsvGetModemStatus	213
+#define RsvDirnameBox   214
 
 #define RsvOperator     1000
 #define RsvBNot         1001



Ttssh2-commit メーリングリストの案内
Back to archive index