[Ttssh2-commit] [4103] シリアルのボーレートをドロップダウンリストからドロップダウンにしたときに、SetDlgItemInt するだけで CB_SETCURSEL を投げていなかったのを修正

svnno****@sourc***** svnno****@sourc*****
2010年 9月 15日 (水) 21:06:12 JST


Revision: 4103
          http://sourceforge.jp/projects/ttssh2/svn/view?view=rev&revision=4103
Author:   maya
Date:     2010-09-15 21:06:12 +0900 (Wed, 15 Sep 2010)

Log Message:
-----------
シリアルのボーレートをドロップダウンリストからドロップダウンにしたときに、SetDlgItemInt するだけで CB_SETCURSEL を投げていなかったのを修正
  http://sourceforge.jp/ticket/browse.php?group_id=1412&tid=23207

Modified Paths:
--------------
    trunk/doc/en/html/about/history.html
    trunk/doc/ja/html/about/history.html
    trunk/teraterm/ttpdlg/ttdlg.c


-------------- next part --------------
Modified: trunk/doc/en/html/about/history.html
===================================================================
--- trunk/doc/en/html/about/history.html	2010-09-13 07:07:46 UTC (rev 4102)
+++ trunk/doc/en/html/about/history.html	2010-09-15 12:06:12 UTC (rev 4103)
@@ -47,6 +47,7 @@
 
   <li>Bug fixes
     <ul>
+      <!--li><a href="../menu/setup-serialport.html">[Setup]-[Serial port]</a> ƒ_ƒCƒAƒƒO‚ð•\Ž¦‚µ‚½‚Æ‚«‚É Baud rate ‚ª³‚µ‚­‘I‘ð‚³‚ê‚Ä‚¢‚È‚¢–â‘è‚ðC³‚µ‚½B</li-->
       <li><a href="../setup/teraterm-term.html#beep">Beep setting</a> does not work.</li>
       <!-- li>DECALN (DEC Screen Alignment Test) §ŒäƒV[ƒPƒ“ƒX‚ŁAƒXƒNƒ[ƒ‹—̈æ‚ðƒNƒŠƒA‚·‚é‚悤‚É‚µ‚½B</li -->
     </ul>

Modified: trunk/doc/ja/html/about/history.html
===================================================================
--- trunk/doc/ja/html/about/history.html	2010-09-13 07:07:46 UTC (rev 4102)
+++ trunk/doc/ja/html/about/history.html	2010-09-15 12:06:12 UTC (rev 4103)
@@ -47,6 +47,7 @@
 
   <li>ƒoƒOC³
     <ul>
+      <li><a href="../menu/setup-serialport.html">[Setup]-[Serial port]</a> ƒ_ƒCƒAƒƒO‚ð•\Ž¦‚µ‚½‚Æ‚«‚É Baud rate ‚ª³‚µ‚­‘I‘ð‚³‚ê‚Ä‚¢‚È‚¢–â‘è‚ðC³‚µ‚½B</li>
       <li><a href="../setup/teraterm-term.html#beep">Beep Ý’è</a>‚ª³‚µ‚­“ǂݍž‚Ü‚ê‚È‚¢–â‘è‚ðC³‚µ‚½B</li>
       <li>DECALN (DEC Screen Alignment Test) §ŒäƒV[ƒPƒ“ƒX‚ŁAƒXƒNƒ[ƒ‹—̈æ‚ðƒNƒŠƒA‚·‚é‚悤‚É‚µ‚½B</li>
     </ul>

Modified: trunk/teraterm/ttpdlg/ttdlg.c
===================================================================
--- trunk/teraterm/ttpdlg/ttdlg.c	2010-09-13 07:07:46 UTC (rev 4102)
+++ trunk/teraterm/ttpdlg/ttdlg.c	2010-09-15 12:06:12 UTC (rev 4103)
@@ -1291,7 +1291,7 @@
 BOOL CALLBACK SerialDlg(HWND Dialog, UINT Message, WPARAM wParam, LPARAM lParam)
 {
 	PTTSet ts;
-	int i, w;
+	int i, w, sel;
 	char Temp[128];
 	WORD ComPortTable[MAXCOMPORT];
 	static char *ComPortDesc[MAXCOMPORT];
@@ -1411,7 +1411,19 @@
 			SendDlgItemMessage(Dialog, IDC_SERIALPORT, CB_SETCURSEL, w, 0);
 
 			SetDropDownList(Dialog, IDC_SERIALBAUD, BaudList, 0);
-			SetDlgItemInt(Dialog, IDC_SERIALBAUD, ts->Baud, FALSE);
+			i = sel = 0;
+			while (BaudList[i] != NULL) {
+				if (atoi(BaudList[i]) == ts->Baud) {
+					SendDlgItemMessage(Dialog, IDC_SERIALBAUD, CB_SETCURSEL, i, 0);
+					sel = 1;
+					break;
+				}
+				i++;
+			}
+			if (!sel) {
+				SetDlgItemInt(Dialog, IDC_SERIALBAUD, ts->Baud, FALSE);
+			}
+
 			SetDropDownList(Dialog, IDC_SERIALDATA, DataList, ts->DataBit);
 			SetDropDownList(Dialog, IDC_SERIALPARITY, ParityList, ts->Parity);
 			SetDropDownList(Dialog, IDC_SERIALSTOP, StopList, ts->StopBit);



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