[ttssh2-commit] [10535] シリアル名のプルダウン文字幅をExpandCBWidth()で設定するようにした

アーカイブの一覧に戻る
scmno****@osdn***** scmno****@osdn*****
2023年 1月 25日 (水) 22:53:49 JST


Revision: 10535
          https://osdn.net/projects/ttssh2/scm/svn/commits/10535
Author:   zmatsuo
Date:     2023-01-25 22:53:49 +0900 (Wed, 25 Jan 2023)
Log Message:
-----------
シリアル名のプルダウン文字幅をExpandCBWidth()で設定するようにした

Modified Paths:
--------------
    trunk/teraterm/ttpdlg/ttdlg.c

-------------- next part --------------
Modified: trunk/teraterm/ttpdlg/ttdlg.c
===================================================================
--- trunk/teraterm/ttpdlg/ttdlg.c	2023-01-25 13:53:40 UTC (rev 10534)
+++ trunk/teraterm/ttpdlg/ttdlg.c	2023-01-25 13:53:49 UTC (rev 10535)
@@ -1718,6 +1718,7 @@
 				GetHNRec->PortType = IdTCPIP;
 				DisableDlgItem(Dialog,IDC_HOSTSERIAL,IDC_HOSTSERIAL);
 			}
+			ExpandCBWidth(Dialog, IDC_HOSTCOM);
 
 			SetRB(Dialog,GetHNRec->PortType,IDC_HOSTTCPIP,IDC_HOSTSERIAL);
 
@@ -1788,29 +1789,6 @@
 					break;
 				}
 
-				case IDC_HOSTCOM:
-					if(HIWORD(wParam) == CBN_DROPDOWN) {
-						HWND hostcom = GetDlgItem(Dialog, IDC_HOSTCOM);
-						int count = SendMessage(hostcom, CB_GETCOUNT, 0, 0);
-						int i, len, max_len = 0;
-						char *lbl;
-						HDC TmpDC = GetDC(hostcom);
-						SIZE s;
-						for (i=0; i<count; i++) {
-							len = SendMessage(hostcom, CB_GETLBTEXTLEN, i, 0);
-							lbl = (char *)calloc(len+1, sizeof(char));
-							SendMessage(hostcom, CB_GETLBTEXT, i, (LPARAM)lbl);
-							GetTextExtentPoint32(TmpDC, lbl, len, &s);
-							if (s.cx > max_len) {
-								max_len = s.cx;
-							}
-							free(lbl);
-						}
-						SendMessage(hostcom, CB_SETDROPPEDWIDTH,
-						            max_len + GetSystemMetrics(SM_CXVSCROLL), 0);
-					}
-					break;
-
 				case IDC_HOSTHELP:
 					PostMessage(GetParent(Dialog),WM_USER_DLGHELP2,HlpFileNewConnection,0);
 					break;


ttssh2-commit メーリングリストの案内
アーカイブの一覧に戻る