diff --git a/.editorconfig b/.editorconfig index 4507f4a3e..1e5ad7507 100644 --- a/.editorconfig +++ b/.editorconfig @@ -17,6 +17,7 @@ end_of_line = crlf charset = cp932 indent_style = space indent_size = 2 +trim_trailing_whitespace = true [*.md] end_of_line = crlf diff --git a/doc/en/html/about/history.html b/doc/en/html/about/history.html index 80cb16dd7..e95ed5dca 100644 --- a/doc/en/html/about/history.html +++ b/doc/en/html/about/history.html @@ -60,6 +60,12 @@

YYYY.MM.DD (Ver 5.4 not released yet)

  • Added skip Send file dialog setting.
  • Macro commands for sending and receiving files are also from File transfer folder.
  • ZMODEM send: CANFDX flag handling is implemented when receiving ZRINIT. While the receiver cannot receive data, the sender(Tera Term) can wait for the receiver. +
  • Additional settings - Serial Port tab
  • + @@ -410,15 +416,15 @@

    2019.12.7 (Ver 4.105)

    @@ -1870,7 +1876,7 @@

    2010.12.7 (Ver 4.68)

  • Bug fixes
  • added support for specifying any baud rate of the serial port connection.
  • diff --git a/doc/en/html/menu/setup-additional-serialport.html b/doc/en/html/menu/setup-additional-serialport.html new file mode 100644 index 000000000..80afe826f --- /dev/null +++ b/doc/en/html/menu/setup-additional-serialport.html @@ -0,0 +1,113 @@ + + + + + Additional settings / "Serial port" tab ([Setup] menu) + + + + + +

    Additional settings / "Serial port" tab ([Setup] menu)

    + +

    + Settings related to the serial port. + +

    +
    Port
    +
    + When the serial port is not connected, + Sets the default serial port for New connection Dialog. + A non existent serial port can be set. + New connection dialog does not show any non existent serial ports.
    + By default, maximum serial port number in the list is 256. It is configurable in MaxComPort setting. +

    + When the serial port is connected, + displays the serial port to which it is connected. +

    +
    + +
    Serial parameters
    +
    + Serial port parameters. + Choose the appropriate parameters for the modem or the host.
    + Whether the selected or specified settings are actually applied depends on serial port chip or driver. + +

    + When the serial port is not connected, + Sets the parameters for connecting to the serial port.
    + Use New connection when connecting to a serial port. +

    +

    + When the serial port is connected, + Set parameters for the connected serial port. +

    + +
    +
    Speed
    +
    + The Speed can be specified with any number. +
    + +
    Data
    +
    + 8 bit / 7 bit +

    + Note: If Data is 7 bit, the XMODEM, ZMODEM, B PLUS and Quick-VAN + protocols are disabled. +

    +
    + +
    Parity
    +
    + none / odd / even / mark / space +
    + +
    Stop bits
    +
    + 1 bit / 2 bit +
    + +
    Flow control
    +
    +
    +
    Xon/Xoff
    +
    + Software flow +

    + Note: If Flow control is Xon/Xoff, the XMODEM and Quick-VAN protocols are disabled. +

    +
    +
    RTS/CTS
    +
    + Hardware flow(RTS/CTS) +

    + Note: The "hardware" prior to version 4.104 applies to RTS/CTS. +

    +
    +
    DSR/DTR
    Hardware flow(DSR/DTR)
    +
    none
    No flow control
    +
    + +
    +
    +
    + +
    Transmit delay
    +
    + Time intervals between characters (lines) being sent, in milliseconds. + The unit is milliseconds. You can set the wait time per character (line). + If the modem or host drops characters when Tera Term sends a large number of characters, try setting an appropriate delay time. +
    + +
    Detail information of COM port
    +
    + The detail information of selected port is shown in the text box.
    + You can select all data by using CTRL+A. + You can scroll horizontally by using CTRL/SHIFT + wheel. +
    + +
    + + diff --git a/doc/en/html/menu/setup-additional.html b/doc/en/html/menu/setup-additional.html index 08e7895f6..f644b5efc 100644 --- a/doc/en/html/menu/setup-additional.html +++ b/doc/en/html/menu/setup-additional.html @@ -33,6 +33,7 @@

    tabs

  • "Terminal" Tab
  • "Window" Tab
  • +
  • "Serail Port" Tab
  • diff --git a/doc/en/html/menu/setup-serialport.html b/doc/en/html/menu/setup-serialport.html index 9815403c3..8418ec06f 100644 --- a/doc/en/html/menu/setup-serialport.html +++ b/doc/en/html/menu/setup-serialport.html @@ -10,71 +10,8 @@

    Serial port ([Setup] menu)

    - -

    "Serial port setup" dialog box

    - -
    - -
    OK button
    -
    - The label of OK button is changed according to the connection state.
    - Connect with New window ... Serial connection is launched with new window since TCP/IP connection is using.
    - New open ... Serial connection starts.
    - Close and New open ... Current COM port is closed and serial connection starts with new COM port.
    - New setting ... The setting of current COM port is changed.
    -
    - -
    Cancel button
    -
    - Discards the setting change and closes the dialog. -
    - -
    Help button
    -
    - Displays the help file. -
    - -
    Port
    -
    - Serial port to be used. By default, maximum serial port number in the list is 256. It is configurable in MaxComPort setting. -
    - -
    Speed, Data, Parity, Stop bits, Flow control
    -
    - Serial port parameters. Choose the appropriate parameters for - the modem or the host. -

    - The Speed can be specified with any number. Actually, the serial port driver may not reflect your speed. -

    -

    - Flow control can be configured in the following:
    - Xon/Xoff ... Software flow
    - RTS/CTS ... Hardware flow(RTS/CTS)
    - DSR/DTR ... Hardware flow(DSR/DTR)
    - none ... No flow control
    -

    -

    - Note: If Data is 7 bit, the XMODEM, ZMODEM, B PLUS and Quick-VAN - protocols are disabled. If Flow control is Xon/Xoff, the XMODEM - and Quick-VAN protocols are disabled. -

    -

    - Note: The "hardware" prior to version 4.104 applies to RTS/CTS. -

    -
    - -
    Transmit delay
    -
    - Time intervals between characters (lines) being sent, in milliseconds. -
    - -
    Detail information of COM port
    -
    - The detail information of selected port is shown in the text box.
    - You can select all data by using CTRL+A. - You can scroll horizontally by using CTRL/SHIFT + wheel. -
    - -
    +

    + Open Serial Port tab of Additional settings dialog. +

    diff --git a/doc/en/html/setup/teraterm-ini.html b/doc/en/html/setup/teraterm-ini.html index 6a7fb70c7..1bf1035f6 100644 --- a/doc/en/html/setup/teraterm-ini.html +++ b/doc/en/html/setup/teraterm-ini.html @@ -194,7 +194,7 @@

    Tera Term

    - BaudRate + BaudRate 9600 <- @@ -302,7 +302,7 @@

    Tera Term

    - ComPort + ComPort 1 <- @@ -386,7 +386,7 @@

    Tera Term

    - DataBit + DataBit 8 <- @@ -410,13 +410,13 @@

    Tera Term

    - DelayPerChar + DelayPerChar 0 <- - DelayPerLine + DelayPerLine 0 <- @@ -632,7 +632,7 @@

    Tera Term

    - FlowCtrl + FlowCtrl none <- @@ -974,7 +974,7 @@

    Tera Term

    - Parity + Parity none <- @@ -1154,7 +1154,7 @@

    Tera Term

    - StopBit + StopBit 1 <- diff --git a/doc/en/teraterm.hhc b/doc/en/teraterm.hhc index 7b02491a6..cd093ba54 100644 --- a/doc/en/teraterm.hhc +++ b/doc/en/teraterm.hhc @@ -533,6 +533,11 @@ +
  • + + + +
  • diff --git a/doc/en/teraterm.hhp b/doc/en/teraterm.hhp index 5f6c1a1ef..32009a9c6 100644 --- a/doc/en/teraterm.hhp +++ b/doc/en/teraterm.hhp @@ -133,6 +133,7 @@ HlpMenuSetupAdditionalCtrlSeq=html\menu\setup-additional-ctrlseq.html HlpMenuSetupAdditionalCygwin=html\menu\setup-additional-cygwin.html HlpMenuSetupAdditionalWindow=html\menu\setup-additional-window.html HlpMenuSetupAdditionalTerminal=html\menu\setup-additional-terminal.html +HlpMenuSetupAdditionalSerialPort=html\menu\setup-additional-serialport.html HlpMenuSetupThemeEditor=html\menu\setup-additional-visual-theme.html HlpMenuSetupSave=html\menu\setup-save.html HlpMenuSetupRestore=html\menu\setup-restore.html diff --git a/doc/ja/html/about/history.html b/doc/ja/html/about/history.html index e6285a315..d8ca8727e 100644 --- a/doc/ja/html/about/history.html +++ b/doc/ja/html/about/history.html @@ -60,6 +60,12 @@

    YYYY.MM.DD (Ver 5.4 not released yet)

  • ファイル送信ダイアログをスキップする設定を追加した。
  • ファイル送受信マクロコマンドもファイル転送用フォルダを起点とするようにした。
  • ZMODEM send: 受信 ZRINIT 内の CANFDX フラグの処理を実装した。受信側がデータを受信できない間、送信側(Tera Term)は受信側を待てるようになった。
  • +
  • Additional settings - Serial Port タブ
  • + @@ -410,15 +416,15 @@

    2019.12.7 (Ver 4.105)

    @@ -1869,7 +1875,7 @@

    2010.12.7 (Ver 4.68)

  • バグ修正
    • セキュリティ修正: DLL 読み込みに関する脆弱性を修正した。
    • -
    • [Setup]-[Serial port] ダイアログを表示したときに Baud rate が正しく選択されていない問題を修正した。
    • +
    • [Setup]-[Serial port] ダイアログを表示したときに Baud rate が正しく選択されていない問題を修正した。
    • Beep 設定が正しく読み込まれない問題を修正した。
    • DECALN (DEC Screen Alignment Test) 制御シーケンスで、スクロール領域をクリアするようにした。
    • ウィンドウタイトル/アイコンラベル報告要求に対して、空文字列を応答する設定が動作しない問題を修正した。
    • @@ -1951,7 +1957,7 @@

      2010.5.31 (Ver 4.66)

  • シリアルポート接続のボーレートを選択肢以外からも手入力出来るようにした。
      -
    • [Setup]-[Serial port]で任意のボーレートを指定できるようにした。
    • +
    • [Setup]-[Serial port]で任意のボーレートを指定できるようにした。
    • /BAUD オプションで任意のボーレートを指定できるようにした。
    • マクロコマンド "setbaud" の引数にボーレートの値を直接指定できるようにした。
  • diff --git a/doc/ja/html/menu/file-new.html b/doc/ja/html/menu/file-new.html index 2ae5c97ce..644bc0684 100644 --- a/doc/ja/html/menu/file-new.html +++ b/doc/ja/html/menu/file-new.html @@ -161,7 +161,7 @@

    TCP/IP

    Serial

    -
    Port
    +
    Port
    接続するシリアルポートをリストの中から選択してください。リストに表示されるシリアルポート番号の最大値はデフォルトで256となっています。また、利用可能なシリアルポートが存在しない場合は表示されません。MaxComPortで最大値を変更できます。
    diff --git a/doc/ja/html/menu/setup-additional-serialport.html b/doc/ja/html/menu/setup-additional-serialport.html new file mode 100644 index 000000000..4e0cfa255 --- /dev/null +++ b/doc/ja/html/menu/setup-additional-serialport.html @@ -0,0 +1,112 @@ + + + + + Additional settings / "Serial port" タブ ([Setup] メニュー) + + + + + +

    Additional settings / "Serial port" タブ ([Setup] メニュー)

    + +

    + シリアルポートに関連する設定を行います。 + +

    +
    Port
    +
    + シリアルポートに接続していないとき、 + New connection ダイアログ表示時のデフォルトシリアルポートを設定します。 + 設定時には存在しないシリアルポートを設定できます。 + New connection ダイアログでは存在しないシリアルポートは表示されません。
    + リストに表示されるシリアルポート番号の最大値はデフォルトで256となっています。MaxComPortで最大値を変更できます。
    +

    + シリアルポートに接続しているとき、 + 接続しているシリアルポートを表示します。 +

    +
    + +
    Serial parameters
    +
    + シリアルポートのパラメータです。 + 接続するモデム等の設定にあわせてください。
    + 選択・指定した設定が実際に反映されるかは、シリアルポートのチップ・ドライバの仕様によります。 + +

    + シリアルポートに接続していないとき、 + シリアルポートに接続する時のパラメータを設定します。
    + シリアルポートに接続する時はNew connectionを使用してください。 +

    +

    + シリアルポートに接続しているとき、 + 接続しているシリアルポートのパラメータを設定します。 +

    + +
    +
    Speed
    +
    + Speed は任意の数値を指定することができます。 +
    + +
    Data
    +
    + 8 bit / 7 bit +

    + 注: 7 bit のとき、XMODEM, ZMODEM, B-PLUS, Quick-VAN + によるファイル転送はできません。 +

    +
    + +
    Parity
    +
    + none / odd / even / mark / space +
    + +
    Stop bits
    +
    + 1 bit / 2 bit +
    + +
    Flow control
    +
    +
    +
    Xon/Xoff
    +
    + ソフトウェアフロー +

    + 注: Xon/Xoff にすると、XMODEM, Quick-VAN によるファイル転送はできません。 +

    +
    +
    RTS/CTS
    +
    + ハードウェアフロー(RTS/CTS) +

    + 注: バージョン4.104以前の"hardware"はRTS/CTSに該当します。 +

    +
    +
    DSR/DTR
    ハードウェアフロー(DSR/DTR)
    +
    none
    フロー制御なし
    +
    + +
    +
    +
    + +
    Transmit delay
    +
    + Tera Term が文字(行)を送出したあと次の文字(行)を送出するまでの待ち時間。 + 単位はミリ秒です。1文字(行)ごとの待ち時間を設定できます。
    + Tera Term から大量の文字を送出したときにモデムやホストが文字を取りこぼす場合には適当な待ち時間を設定してみてください。 +
    + +
    COMポートの詳細情報
    +
    + テキストボックスでは選択中のCOMポートに関する詳細情報を表示します。
    + CTRL+Aで全選択ができます。CTRL/SHIFT+ホイールで横スクロールができます。 +
    + +
    + + diff --git a/doc/ja/html/menu/setup-additional.html b/doc/ja/html/menu/setup-additional.html index 3394e71ae..23d130289 100644 --- a/doc/ja/html/menu/setup-additional.html +++ b/doc/ja/html/menu/setup-additional.html @@ -33,6 +33,7 @@
  • "Terminal" タブ
  • "Window" タブ
  • +
  • "Serail Port" タブ
  • diff --git a/doc/ja/html/menu/setup-serialport.html b/doc/ja/html/menu/setup-serialport.html index 72248a346..e3427be90 100644 --- a/doc/ja/html/menu/setup-serialport.html +++ b/doc/ja/html/menu/setup-serialport.html @@ -10,72 +10,8 @@

    Serial port ([Setup] メニュー)

    - -

    "Serial port setup" ダイアログボックス

    - -
    -
    OK button
    -
    - 現在の接続状態を見て、シリアル接続の動作を表します。
    - 新しいウィンドウで接続 ... TCP/IP接続中のため、新しいウィンドウでシリアル接続を行います。
    - 新規オープン ... シリアル接続を行います。
    - クローズ&新規オープン ... 現在開いているCOMポートを閉じて、新しいCOMポートでシリアル接続を行います。
    - 現在の接続を再設定 ... 現在開いているCOMポートの設定を変更します。
    -
    - -
    Cancel button
    -
    - 設定変更をキャンセルして、ダイアログを終了します。 -
    - -
    Help button
    -
    - ヘルプを表示します。 -
    - -
    Port
    -
    - 使用するポートです。リストに表示されるシリアルポート番号の最大値はデフォルトで256となっています。MaxComPortで最大値を変更できます。 -
    - -
    Speed, Data, Parity, Stop bits, Flow control
    -
    - シリアルポートのパラメータです。 - 接続するモデム等の設定にあわせてください。 -

    - Speed は任意の数値を指定することができます。選択・指定した設定が実際に反映されるかは、シリアルポートのチップ・ドライバの仕様によります。 -

    -

    - Flow controlは以下が設定できます。
    - Xon/Xoff ... ソフトウェアフロー
    - RTS/CTS ... ハードウェアフロー(RTS/CTS)
    - DSR/DTR ... ハードウェアフロー(DSR/DTR)
    - none ... フロー制御なし
    -

    -

    - 注: Data を 7 にすると、XMODEM, ZMODEM, B-PLUS, Quick-VAN - によるファイル転送はできません。 - また Flow control を Xon/Xoff にすると、XMODEM, Quick-VAN - によるファイル転送はできません。 -

    -

    - 注: バージョン4.104以前の"hardware"はRTS/CTSに該当します。 -

    -
    - -
    Transmit delay
    -
    - Tera Term が文字(行)を送出したあと次の文字(行)を送出するまでの待ち時間。 - 単位はミリ秒です。1文字(行)ごとの待ち時間を設定できます。
    - Tera Term から大量の文字を送出したときにモデムやホストが文字を取りこぼす場合には適当な待ち時間を設定してみてください。 -
    - -
    COMポートの詳細情報
    -
    - テキストボックスでは選択中のCOMポートに関する詳細情報を表示します。
    - CTRL+Aで全選択ができます。CTRL/SHIFT+ホイールで横スクロールができます。 -
    - -
    +

    + Additional settings の Serial port タブが開きます。 +

    diff --git a/doc/ja/html/setup/teraterm-ini.html b/doc/ja/html/setup/teraterm-ini.html index 9a89a6b58..891bd3f96 100644 --- a/doc/ja/html/setup/teraterm-ini.html +++ b/doc/ja/html/setup/teraterm-ini.html @@ -194,7 +194,7 @@

    Tera Term

    - BaudRate + BaudRate 9600 <- @@ -302,7 +302,7 @@

    Tera Term

    - ComPort + ComPort 1 <- @@ -386,7 +386,7 @@

    Tera Term

    - DataBit + DataBit 8 <- @@ -410,13 +410,13 @@

    Tera Term

    - DelayPerChar + DelayPerChar 0 <- - DelayPerLine + DelayPerLine 0 <- @@ -632,7 +632,7 @@

    Tera Term

    - FlowCtrl + FlowCtrl none <- @@ -974,7 +974,7 @@

    Tera Term

    - Parity + Parity none <- @@ -1154,7 +1154,7 @@

    Tera Term

    - StopBit + StopBit 1 <- diff --git a/doc/ja/teraterm.hhc b/doc/ja/teraterm.hhc index 8d7799331..6cb920063 100644 --- a/doc/ja/teraterm.hhc +++ b/doc/ja/teraterm.hhc @@ -556,6 +556,11 @@
    +
  • + + + +
  • diff --git a/doc/ja/teraterm.hhp b/doc/ja/teraterm.hhp index 33081cf7c..8e2b526a1 100755 --- a/doc/ja/teraterm.hhp +++ b/doc/ja/teraterm.hhp @@ -139,6 +139,7 @@ HlpMenuSetupAdditionalCtrlSeq=html\menu\setup-additional-ctrlseq.html HlpMenuSetupAdditionalCygwin=html\menu\setup-additional-cygwin.html HlpMenuSetupAdditionalWindow=html\menu\setup-additional-window.html HlpMenuSetupAdditionalTerminal=html\menu\setup-additional-terminal.html +HlpMenuSetupAdditionalSerialPort=html\menu\setup-additional-serialport.html HlpMenuSetupThemeEditor=html\menu\setup-additional-visual-theme.html HlpMenuSetupSave=html\menu\setup-save.html HlpMenuSetupRestore=html\menu\setup-restore.html diff --git a/installer/release/lang_utf8/English.lng b/installer/release/lang_utf8/English.lng index 9f0ed5ac6..843ae9e2c 100644 --- a/installer/release/lang_utf8/English.lng +++ b/installer/release/lang_utf8/English.lng @@ -1,6 +1,6 @@ サソ[Info] language=English -date=2025-01-04 by TeraTerm Project +date=2025-01-20 by TeraTerm Project contributor=- [Tera Term] @@ -376,7 +376,7 @@ DLG_ABOUT_TITLE=About Tera Term DLG_SELECT_DIR_TITLE=Select new directory DLG_GEN_TITLE=Tera Term: General setup -DLG_GEN_PORT=Default &port: +DLG_GEN_PORT=New &connection default DLG_GEN_LANG_UI=Language&UI: DLG_GEN_UILANG=UI &Language: @@ -397,7 +397,7 @@ DLG_KEYB_DISABLE=Disabled mode: DLG_KEYB_APPKEY=&Application Keypad DLG_KEYB_APPCUR=Application &Cursor -DLG_SERIAL_TITLE=Tera Term: Serial port setup and connection +DLG_SERIAL_TITLE=Serial port DLG_SERIAL_PORT=&Port: DLG_SERIAL_BAUD=Sp&eed: DLG_SERIAL_DATA=&Data: @@ -407,7 +407,6 @@ DLG_SERIAL_FLOW=&Flow control: DLG_SERIAL_DELAY=Transmit delay DLG_SERIAL_DELAYCHAR=msec/&char DLG_SERIAL_DELAYLINE=msec/&line -DLG_SERIAL_SPEED_TOOLTIP=You can directly specify a number DLG_SERIAL_OK_CONNECTION=Connect with &New window DLG_SERIAL_OK_OPEN=&New open DLG_SERIAL_OK_CLOSEOPEN=Close and &New open diff --git a/installer/release/lang_utf8/French.lng b/installer/release/lang_utf8/French.lng index 157893b74..7d575a431 100644 --- a/installer/release/lang_utf8/French.lng +++ b/installer/release/lang_utf8/French.lng @@ -1,6 +1,6 @@ サソ[Info] language=French -date=2025-01-04 by TeraTerm Project +date=2025-01-20 by TeraTerm Project contributor=Francois MOCQ (2010-07-21) [Tera Term] @@ -373,8 +373,9 @@ DLG_ABOUT_TITLE=A propos de Tera Term DLG_SELECT_DIR_TITLE=Selectionner un nouveau rテゥpertoire DLG_GEN_TITLE=Tera Term: Configuration gテゥnテゥrale -DLG_GEN_PORT=Port par dテゥfaut: +DLG_GEN_PORT=New &connection default DLG_GEN_LANG_UI=Language&UI: +DLG_GEN_UILANG=UI &Language: DLG_HOST_TITLE=Tera Term: Nouvelle connexion DLG_HOST_TCPIPHOST=Hテエte: @@ -393,7 +394,7 @@ DLG_KEYB_DISABLE=Dテゥvalider le mode: DLG_KEYB_APPKEY=Codes pavテゥ numテゥrique DLG_KEYB_APPCUR=Codes Curseur pavテゥ numテゥrique -DLG_SERIAL_TITLE=Tera Term: Serial port setup and connection +DLG_SERIAL_TITLE=Serial port DLG_SERIAL_PORT=&Port: DLG_SERIAL_BAUD=&Vitesse: DLG_SERIAL_DATA=&Donnテゥes: @@ -403,7 +404,6 @@ DLG_SERIAL_FLOW=Ctrl. de flux: DLG_SERIAL_DELAY=Dテゥlai de transmission DLG_SERIAL_DELAYCHAR=msec/&car DLG_SERIAL_DELAYLINE=msec/&ligne -DLG_SERIAL_SPEED_TOOLTIP=You can directly specify a number DLG_SERIAL_OK_CONNECTION=Connect with &New window DLG_SERIAL_OK_OPEN=&New open DLG_SERIAL_OK_CLOSEOPEN=Close and &New open diff --git a/installer/release/lang_utf8/German.lng b/installer/release/lang_utf8/German.lng index a53f46f94..bb05a7490 100644 --- a/installer/release/lang_utf8/German.lng +++ b/installer/release/lang_utf8/German.lng @@ -1,6 +1,6 @@ サソ[Info] language=German -date=2025-01-04 by TeraTerm Project +date=2025-01-20 by TeraTerm Project contributor=Frederik Schwarzer (2010-05-17) [Tera Term] @@ -373,7 +373,7 @@ DLG_ABOUT_TITLE=テ彙er Tera Term DLG_SELECT_DIR_TITLE=Neues Verzeichnis wテ、hlen DLG_GEN_TITLE=Tera-Grundeinstellungen -DLG_GEN_PORT=Standard-Port +DLG_GEN_PORT=New &connection default DLG_GEN_LANG_UI=Language&UI: DLG_HOST_TITLE=Tera Term: Neue Verbindung @@ -393,7 +393,7 @@ DLG_KEYB_DISABLE=Abschalten: DLG_KEYB_APPKEY=Anwendungs-Keypad DLG_KEYB_APPCUR=Anwendungs-Cursor -DLG_SERIAL_TITLE=Tera Term: Serial port setup and connection +DLG_SERIAL_TITLE=Serial port DLG_SERIAL_PORT=Port: DLG_SERIAL_BAUD=Sp&eed: DLG_SERIAL_DATA=Data: @@ -403,7 +403,6 @@ DLG_SERIAL_FLOW=Flow control: DLG_SERIAL_DELAY=Transmit delay DLG_SERIAL_DELAYCHAR=msec/char DLG_SERIAL_DELAYLINE=msec/line -DLG_SERIAL_SPEED_TOOLTIP=You can directly specify a number DLG_SERIAL_OK_CONNECTION=Connect with &New window DLG_SERIAL_OK_OPEN=&New open DLG_SERIAL_OK_CLOSEOPEN=Close and &New open diff --git a/installer/release/lang_utf8/Japanese.lng b/installer/release/lang_utf8/Japanese.lng index b3c0cbe10..4985e96d4 100644 --- a/installer/release/lang_utf8/Japanese.lng +++ b/installer/release/lang_utf8/Japanese.lng @@ -1,6 +1,6 @@ サソ[Info] language=Japanese(譌・譛ャ隱) -date=2025-01-04 by TeraTerm Project +date=2025-01-20 by TeraTerm Project contributor=- [Tera Term] @@ -376,7 +376,7 @@ DLG_ABOUT_TITLE=Tera Term 縺ォ縺、縺縺ヲ DLG_SELECT_DIR_TITLE=譁ー縺励>繝繧」繝ャ繧ッ繝医Μ繧帝∈謚槭@縺ヲ縺上□縺輔> DLG_GEN_TITLE=Tera Term: 蜈ィ闊ャ險ュ螳 -DLG_GEN_PORT=讓呎コ悶ョ繝昴シ繝(&P): +DLG_GEN_PORT=譁ー縺励>謗・邯壹ョ繝繝輔か繝ォ繝(&C): DLG_GEN_LANG_UI=險隱朸I(&U): DLG_GEN_UILANG=UI險隱(&L): @@ -397,7 +397,7 @@ DLG_KEYB_DISABLE=辟。蜉ケ蛹悶☆繧九Δ繝シ繝 DLG_KEYB_APPKEY=繧「繝励Μ繧ア繝シ繧キ繝ァ繝ウ繧ュ繝シ繝代ャ繝(&A) DLG_KEYB_APPCUR=繧「繝励Μ繧ア繝シ繧キ繝ァ繝ウ繧ォ繝シ繧ス繝ォ(&C) -DLG_SERIAL_TITLE=Tera Term: 繧キ繝ェ繧「繝ォ繝昴シ繝 險ュ螳壹→謗・邯 +DLG_SERIAL_TITLE=繧キ繝ェ繧「繝ォ繝昴シ繝 DLG_SERIAL_PORT=繝昴シ繝(&P): DLG_SERIAL_BAUD=繧ケ繝斐シ繝(&E): DLG_SERIAL_DATA=繝繝シ繧ソ(&D): @@ -407,7 +407,6 @@ DLG_SERIAL_FLOW=繝輔Ο繝シ蛻カ蠕。(&F): DLG_SERIAL_DELAY=騾∽ソ。驕蟒カ DLG_SERIAL_DELAYCHAR=繝溘Μ遘/蟄(&C) DLG_SERIAL_DELAYLINE=繝溘Μ遘/陦(&L) -DLG_SERIAL_SPEED_TOOLTIP=謨ー蛟、繧堤峩謗・蜈・蜉帙〒縺阪∪縺 DLG_SERIAL_OK_CONNECTION=譁ー縺励>繧ヲ繧」繝ウ繝峨え縺ァ謗・邯(&N) DLG_SERIAL_OK_OPEN=譁ー隕上が繝シ繝励Φ(&N) DLG_SERIAL_OK_CLOSEOPEN=繧ッ繝ュ繝シ繧コシ譁ー隕上が繝シ繝励Φ(&N) diff --git a/installer/release/lang_utf8/Korean.lng b/installer/release/lang_utf8/Korean.lng index 6590b9276..531f04a6b 100644 --- a/installer/release/lang_utf8/Korean.lng +++ b/installer/release/lang_utf8/Korean.lng @@ -1,6 +1,6 @@ サソ[Info] language=Korean -date=2025-01-04 by TeraTerm Project +date=2025-01-20 by TeraTerm Project contributor=Daehong Kim (2013-07-25) [Tera Term] @@ -373,7 +373,7 @@ DLG_ABOUT_TITLE=Tera Term乱 劇葺流 DLG_SELECT_DIR_TITLE=ヨ。懍垓 イス。罹・シ │晨葺┷囈 DLG_GEN_TITLE=Tera Term: 攵ー們└ -DLG_GEN_PORT=クーウク 小敢(&P): +DLG_GEN_PORT=New &connection default DLG_GEN_LANG_UI=UI 椋牟(&U): DLG_HOST_TITLE=Tera Term: ヨ 硫イー @@ -393,7 +393,7 @@ DLG_KEYB_DISABLE=ケ劈┳剩 ェィ糖: DLG_KEYB_APPKEY=牟伯ヲャシ擽 う肩糖(&A) DLG_KEYB_APPCUR=牟伯ヲャシ擽 サ、(&C) -DLG_SERIAL_TITLE=Tera Term: Serial port setup and connection +DLG_SERIAL_TITLE=Serial port DLG_SERIAL_PORT=小敢(&P): DLG_SERIAL_BAUD=鷺巡(&E): DLG_SERIAL_DATA=魂擽┣(&D): @@ -403,7 +403,6 @@ DLG_SERIAL_FLOW=攝ヲ懍牟(&F): DLG_SERIAL_DELAY=。ァ硫 DLG_SERIAL_DELAYCHAR=msec/&char DLG_SERIAL_DELAYLINE=msec/&line -DLG_SERIAL_SPEED_TOOLTIP=You can directly specify a number DLG_SERIAL_OK_CONNECTION=Connect with &New window DLG_SERIAL_OK_OPEN=&New open DLG_SERIAL_OK_CLOSEOPEN=Close and &New open diff --git a/installer/release/lang_utf8/Russian.lng b/installer/release/lang_utf8/Russian.lng index df21196cd..0f0ec520d 100644 --- a/installer/release/lang_utf8/Russian.lng +++ b/installer/release/lang_utf8/Russian.lng @@ -1,6 +1,6 @@ サソ[Info] language=Russian -date=2025-01-04 by TeraTerm Project +date=2025-01-20 by TeraTerm Project contributor=Ryumik Sergey (2017-07-19) [Tera Term] @@ -373,7 +373,7 @@ DLG_ABOUT_TITLE=ミ ミソムミセミウムミーミシミシミオ Tera Term DLG_SELECT_DIR_TITLE=ミ柘巾アムミームび ミスミセミイムτ ミソミーミソミコム DLG_GEN_TITLE=Tera Term: ミ榧アム禍クミオ ミスミームムびミセミケミコミク -DLG_GEN_PORT=&ミ渙セムム: +DLG_GEN_PORT=New &connection default DLG_GEN_LANG_UI=&ミッミキム巾コ ミシミオミスム: DLG_HOST_TITLE=Tera Term: ミ斷セミイミセミオ ムミセミオミエミクミスミオミスミクミオ @@ -393,7 +393,7 @@ DLG_KEYB_DISABLE=ミ籍サム袴ひオムミスミームひクミイミー: DLG_KEYB_APPKEY=&ミ湲ミクミシミオミスミクムび Keypad DLG_KEYB_APPCUR=ミ湲ミクミシミオミスミクムび &Cursor -DLG_SERIAL_TITLE=Tera Term: Serial port setup and connection +DLG_SERIAL_TITLE=Serial port DLG_SERIAL_PORT=&ミ渙セムム: DLG_SERIAL_BAUD=&ミ。ミコミセムミセムムび: DLG_SERIAL_DATA=&ミ頒ーミスミスム巾オ: @@ -403,7 +403,6 @@ DLG_SERIAL_FLOW=&ミ」ミソムミーミイミサミオミスミクミオ: DLG_SERIAL_DELAY=ミ厘ーミエミオムミカミコミー ミソミオムミオミエミームミク DLG_SERIAL_DELAYCHAR=ミシム/&ムミクミシミイミセミサ DLG_SERIAL_DELAYLINE=ミシム/&ムムびミセミコミー -DLG_SERIAL_SPEED_TOOLTIP=You can directly specify a number DLG_SERIAL_OK_CONNECTION=Connect with &New window DLG_SERIAL_OK_OPEN=&New open DLG_SERIAL_OK_CLOSEOPEN=Close and &New open diff --git a/installer/release/lang_utf8/Simplified Chinese.lng b/installer/release/lang_utf8/Simplified Chinese.lng index a5caf06d9..41d89a9a1 100644 --- a/installer/release/lang_utf8/Simplified Chinese.lng +++ b/installer/release/lang_utf8/Simplified Chinese.lng @@ -1,6 +1,6 @@ サソ[Info] language=Simplified Chinese -date=2025-01-04 by TeraTerm Project +date=2025-01-20 by TeraTerm Project contributor=LiShaohui (2017-04-11) [Tera Term] @@ -373,7 +373,7 @@ DLG_ABOUT_TITLE=蜈ウ莠 Tera Term DLG_SELECT_DIR_TITLE=騾画叫譁ー譁莉カ螟ケ DLG_GEN_TITLE=Tera Termシ壼クク隗隶セ鄂ョ -DLG_GEN_PORT=遶ッ蜿」(&P)シ +DLG_GEN_PORT=New &connection default DLG_GEN_LANG_UI=逡碁擇隸ュ險(&U)シ DLG_HOST_TITLE=Tera Termシ壽眠蟒コ霑樊磁 @@ -393,7 +393,7 @@ DLG_KEYB_DISABLE=遖∫畑讓。蠑擾シ DLG_KEYB_APPKEY=蠎皮畑髞ョ逶(&A) DLG_KEYB_APPCUR=蠎皮畑鮠譬(&C) -DLG_SERIAL_TITLE=Tera Term: Serial port setup and connection +DLG_SERIAL_TITLE=Serial port DLG_SERIAL_PORT=遶ッ蜿」(&P)シ DLG_SERIAL_BAUD=豈皮音邇(&E)シ DLG_SERIAL_DATA=謨ー謐ョ菴(&D)シ @@ -403,7 +403,6 @@ DLG_SERIAL_FLOW=豬驥乗而蛻カ(&F)シ DLG_SERIAL_DELAY=莨霎灘サカ霑 DLG_SERIAL_DELAYCHAR=豈ォ遘/蟄礼ャヲ DLG_SERIAL_DELAYLINE=豈ォ遘/陦 -DLG_SERIAL_SPEED_TOOLTIP=You can directly specify a number DLG_SERIAL_OK_CONNECTION=Connect with &New window DLG_SERIAL_OK_OPEN=&New open DLG_SERIAL_OK_CLOSEOPEN=Close and &New open diff --git a/installer/release/lang_utf8/Spanish.lng b/installer/release/lang_utf8/Spanish.lng index 93984ec07..6fde45684 100644 --- a/installer/release/lang_utf8/Spanish.lng +++ b/installer/release/lang_utf8/Spanish.lng @@ -1,6 +1,6 @@ サソ[Info] language=Spanish -date=2025-01-04 by TeraTerm Project +date=2025-01-20 by TeraTerm Project contributor=Filiberto Olguin Ascona (2022-05-26) [Tera Term] @@ -373,7 +373,7 @@ DLG_ABOUT_TITLE=About Tera Term DLG_SELECT_DIR_TITLE=Select new directory DLG_GEN_TITLE=Tera Term: General setup -DLG_GEN_PORT=Default &port: +DLG_GEN_PORT=New &connection default DLG_GEN_LANG_UI=Language&UI: DLG_HOST_TITLE=Tera Term: New connection @@ -393,7 +393,7 @@ DLG_KEYB_DISABLE=Disabled mode: DLG_KEYB_APPKEY=&Application Keypad DLG_KEYB_APPCUR=Application &Cursor -DLG_SERIAL_TITLE=Tera Term: Serial port setup +DLG_SERIAL_TITLE=Serial port DLG_SERIAL_PORT=&Port: DLG_SERIAL_BAUD=&Baud rate: DLG_SERIAL_DATA=&Data: @@ -403,7 +403,6 @@ DLG_SERIAL_FLOW=&Flow control: DLG_SERIAL_DELAY=Transmit delay DLG_SERIAL_DELAYCHAR=msec/&char DLG_SERIAL_DELAYLINE=msec/&line -DLG_SERIAL_SPEED_TOOLTIP=You can directly specify a number DLG_SERIAL_OK_CONNECTION=Connect with &New window DLG_SERIAL_OK_OPEN=&New open DLG_SERIAL_OK_CLOSEOPEN=Close and &New open diff --git a/installer/release/lang_utf8/Tamil.lng b/installer/release/lang_utf8/Tamil.lng index 7dab1184f..4e5e2a62d 100644 --- a/installer/release/lang_utf8/Tamil.lng +++ b/installer/release/lang_utf8/Tamil.lng @@ -1,6 +1,6 @@ サソ[Info] language=Tamil(牋、牋ョ牋ソ牋エ牘) -date=2025-01-04 by TeraTerm Project +date=2025-01-20 by TeraTerm Project contributor=牋、牋ソ牋游ッ財ョ游ョ、牘財ョ、牋セ牋イ牘 牋ェ牘≒ョ、牘≒ョェ牘財ョェ牋ソ牋歩ッ財ョ歩ョェ牘財ョェ牋游ッ財ョ游ョ、牘 (2024-02-24) [Tera Term] @@ -373,7 +373,7 @@ DLG_ABOUT_TITLE=牋、牘牋ー牋セ 牋ョ牘≒ョゥ牘謂ョ、牘財ョ、牘謂ョェ牘 牋ェ牋ア牘財ョア牋ソ DLG_SELECT_DIR_TITLE=牋ェ牘≒ョ、牋ソ牋ッ 牋歩ッ金ョェ牘財ョェ牋歩ョ、牘財ョ、牘謂ョ、牘 牋、牘牋ー牘財ョィ牘財ョ、牘牋游ッ≒ョ歩ッ財ョ歩ョオ牘≒ョョ牘 DLG_GEN_TITLE=牋、牘牋ー牋セ 牋ョ牘≒ョゥ牘: 牋ェ牘癌ョ、牘 牋牋ョ牘謂ョェ牘財ョェ牘 -DLG_GEN_PORT=牋牋ッ牋イ牘財ョェ牘≒ョィ牋ソ牋イ牘 &牋、牘≒ョア牘謂ョョ牘≒ョ歩ョョ牘: +DLG_GEN_PORT=New &connection default DLG_GEN_LANG_UI=牋ョ牘癌ョエ牋ソ 牋牋游ッ謂ョョ牘≒ョ歩ョョ牘: DLG_HOST_TITLE=牋、牘牋ー牋セ 牋ョ牘≒ョゥ牘: 牋ェ牘≒ョ、牋ソ牋ッ 牋牋」牘謂ョェ牘財ョェ牘 @@ -393,7 +393,7 @@ DLG_KEYB_DISABLE=牋ョ牘≒ョ游ョ歩ッ財ョ歩ョェ牘財ョェ牋游ッ財ョ 牋ェ牋ッ牋ゥ牘財ョョ牘≒ョア牘: DLG_KEYB_APPKEY=&牋ェ牋ッ牋ゥ牘財ョェ牋セ牋游ッ財ョ游ッ 牋オ牋ソ牋壟ッ謂ョェ牘財ョェ牋イ牋歩ッ DLG_KEYB_APPCUR=牋ェ牋ッ牋ゥ牘財ョェ牋セ牋游ッ &牋壟ョソ牋ョ牋ソ牋游ッ財ョ游ッ≒ョョ牘 牋歩ッ金ョ游ッ -DLG_SERIAL_TITLE=牋、牘牋ー牋セ 牋ョ牘≒ョゥ牘: 牋、牘癌ョ游ョー牘 牋、牘≒ョア牘謂ョョ牘≒ョ歩ョョ牘 牋牋ョ牘謂ョオ牘 牋ョ牋ア牘財ョア牘≒ョョ牘 牋牋」牘謂ョェ牘財ョェ牘 +DLG_SERIAL_TITLE=牋、牘癌ョ游ョー牘 牋、牘≒ョア牘謂ョョ牘≒ョ歩ョョ牘 DLG_SERIAL_PORT=&牋、牘≒ョア牘謂ョョ牘≒ョ歩ョョ牘: DLG_SERIAL_BAUD=牋オ牘牋歩ョョ牘: DLG_SERIAL_DATA=&牋、牋ー牋オ牘: @@ -403,7 +403,6 @@ DLG_SERIAL_FLOW=&牋内ョ游ッ財ョ游ョョ牘 牋歩ョ游ッ財ョ游ッ≒ョェ牘財ョェ牋セ牋游ッ: DLG_SERIAL_DELAY=牋牋ゥ牘≒ョェ牘財ョェ牘≒ョョ牘 牋、牋セ牋ョ牋、牋ョ牘 DLG_SERIAL_DELAYCHAR=牋ョ牋ソ牋ィ牘癌ョ游ョソ/&牋錫ョエ牘≒ョ、牘財ョ、牘 DLG_SERIAL_DELAYLINE=牋ョ牋ソ牋ィ牘癌ョ游ョソ/&牋オ牋ー牋ソ -DLG_SERIAL_SPEED_TOOLTIP=牋ィ牘牋吭ッ財ョ歩ョウ牘 牋ィ牘牋ー牋游ョソ牋ッ牋セ牋 牋錫ョ」牘財ョ」牘謂ョ歩ッ 牋歩ッ≒ョア牋ソ牋ェ牘財ョェ牋ソ牋游ョイ牋セ牋ョ牘 DLG_SERIAL_OK_CONNECTION=&牋ェ牘≒ョ、牋ソ牋ッ 牋壟ョセ牋ウ牋ー牋、牘財ョ、牘≒ョ游ョゥ牘 牋牋」牘謂ョ歩ッ財ョ歩ョオ牘≒ョョ牘 DLG_SERIAL_OK_OPEN=&牋ェ牘≒ョ、牋ソ牋ッ 牋、牋ソ牋ア牋ィ牘財ョ、牋、牘 DLG_SERIAL_OK_CLOSEOPEN=牋ョ牘もョ游ッ 牋ョ牋ア牘財ョア牘≒ョョ牘 &牋ェ牘≒ョ、牋ソ牋ッ 牋、牋ソ牋ア diff --git a/installer/release/lang_utf8/Traditional Chinese.lng b/installer/release/lang_utf8/Traditional Chinese.lng index 037184acf..ee8d24c67 100644 --- a/installer/release/lang_utf8/Traditional Chinese.lng +++ b/installer/release/lang_utf8/Traditional Chinese.lng @@ -1,6 +1,6 @@ サソ[Info] language=Traditional Chinese -date=2025-01-04 by TeraTerm Project +date=2025-01-20 by TeraTerm Project contributor=kikiqqp (2014-09-20) [Tera Term] @@ -373,7 +373,7 @@ DLG_ABOUT_TITLE=髣懈名 Tera Term DLG_SELECT_DIR_TITLE=驕ク謫譁ー譁莉カ螟セ DLG_GEN_TITLE=Tera Termシ夊ィュ螳夊ィュ螳 -DLG_GEN_PORT=遶ッ蜿」(&P)シ +DLG_GEN_PORT=New &connection default DLG_GEN_LANG_UI=逡碁擇隱櫁ィ(&U)シ DLG_HOST_TITLE=Tera Termシ壼サコ遶区眠騾」邱 @@ -393,7 +393,7 @@ DLG_KEYB_DISABLE=遖∫畑讓。蠑擾シ DLG_KEYB_APPKEY=菴ソ逕ィ骰オ逶、(&A) DLG_KEYB_APPCUR=菴ソ逕ィ貊鷹シ(&C) -DLG_SERIAL_TITLE=Tera Term: Serial port setup and connection +DLG_SERIAL_TITLE=Serial port DLG_SERIAL_PORT=遶ッ蜿」(&P)シ DLG_SERIAL_BAUD=菴榊騾溽紫(&E)シ DLG_SERIAL_DATA=雉譁吩ス榊(&D)シ @@ -403,7 +403,6 @@ DLG_SERIAL_FLOW=豬驥乗而蛻カ(&F)シ DLG_SERIAL_DELAY=蛯ウ霈ク蟒カ驕イ DLG_SERIAL_DELAYCHAR=豈ォ遘/蟄礼ャヲ DLG_SERIAL_DELAYLINE=豈ォ遘/陦 -DLG_SERIAL_SPEED_TOOLTIP=You can directly specify a number DLG_SERIAL_OK_CONNECTION=Connect with &New window DLG_SERIAL_OK_OPEN=&New open DLG_SERIAL_OK_CLOSEOPEN=Close and &New open diff --git a/teraterm/common/comportinfo.cpp b/teraterm/common/comportinfo.cpp index 532ce5627..aad37a797 100644 --- a/teraterm/common/comportinfo.cpp +++ b/teraterm/common/comportinfo.cpp @@ -90,6 +90,9 @@ #define INITGUID #include +// 1のとき、"COM%d" のみ検出する +#define DETECT_COM_ONLY 1 + /** * ポート名を取得 */ @@ -326,7 +329,7 @@ static ComPortInfo_t *ComPortInfoGetByGetSetupAPI(int *count) continue; } -#if 1 +#if DETECT_COM_ONLY // "COM%d" ではない場合、検出しない if (wcsncmp(port_name, L"COM", 3) != 0) { free(port_name); diff --git a/teraterm/common/dlglib_cpp.cpp b/teraterm/common/dlglib_cpp.cpp index 4043e3dd4..7c5949a0a 100644 --- a/teraterm/common/dlglib_cpp.cpp +++ b/teraterm/common/dlglib_cpp.cpp @@ -238,6 +238,7 @@ void ExpandCBWidth(HWND dlg, int ID) free(text); } max_width += GetSystemMetrics(SM_CXVSCROLL); // スクロールバーの幅も足し込んでおく + max_width += 2 * GetSystemMetrics( SM_CYFIXEDFRAME ); SendMessageW(hCtrlWnd, CB_SETDROPPEDWIDTH, max_width, 0); SelectObject(TmpDC, hFont); ReleaseDC(hCtrlWnd, TmpDC); diff --git a/teraterm/common/helpid.h b/teraterm/common/helpid.h index 865d595fb..fac178abd 100644 --- a/teraterm/common/helpid.h +++ b/teraterm/common/helpid.h @@ -164,6 +164,7 @@ #define HlpMenuSetupAdditionalCygwin 43032 #define HlpMenuSetupAdditionalWindow 43033 #define HlpMenuSetupAdditionalTerminal 43034 +#define HlpMenuSetupAdditionalSerialPort 43036 #define HlpMenuSetupSave 43013 #define HlpMenuSetupRestore 43014 #define HlpMenuSetupDir 43016 diff --git a/teraterm/teraterm/CMakeLists.txt b/teraterm/teraterm/CMakeLists.txt index b78cff74c..b9efd40f6 100644 --- a/teraterm/teraterm/CMakeLists.txt +++ b/teraterm/teraterm/CMakeLists.txt @@ -127,6 +127,8 @@ set(SRC_DIALOG resource.h sendfiledlg.cpp sendfiledlg.h + serial_pp.cpp + serial_pp.h setupdirdlg.cpp setupdirdlg.h tcpip_pp.cpp diff --git a/teraterm/teraterm/addsetting.cpp b/teraterm/teraterm/addsetting.cpp index d7ca15aa4..9bc3cd744 100644 --- a/teraterm/teraterm/addsetting.cpp +++ b/teraterm/teraterm/addsetting.cpp @@ -61,6 +61,7 @@ #include "tcpip_pp.h" #include "term_pp.h" #include "win_pp.h" +#include "serial_pp.h" #include "addsetting.h" @@ -1532,6 +1533,8 @@ CAddSettingPropSheetDlg::CAddSettingPropSheetDlg(HINSTANCE hInstance, HWND hPare AddPage(page); page = CreateTerminalPP(hInstance, hParentWnd, & ts); AddPage(page); + page = SerialPageCreate(hInstance, &ts); + AddPage(page); } page = CreateWinPP(hInstance, hParentWnd, &ts); AddPage(page); @@ -1571,6 +1574,9 @@ void CAddSettingPropSheetDlg::SetStartPage(Page page) start_page = 12; break; case WinPage: + start_page = 14; + break; + case SerialPortPage: start_page = 13; break; default: diff --git a/teraterm/teraterm/addsetting.h b/teraterm/teraterm/addsetting.h index 44290cf9b..e88b34320 100644 --- a/teraterm/teraterm/addsetting.h +++ b/teraterm/teraterm/addsetting.h @@ -57,6 +57,7 @@ class CAddSettingPropSheetDlg: public TTCPropSheetDlg GeneralPage, TermPage, WinPage, + SerialPortPage, }; void SetStartPage(Page page); @@ -79,6 +80,7 @@ typedef enum { GeneralPage, TermPage, WinPage, + SerialPortPage, } CAddSettingPropSheetDlgPage; typedef enum { diff --git a/teraterm/teraterm/externalsetup.cpp b/teraterm/teraterm/externalsetup.cpp index e99aa024e..a1caefa5f 100644 --- a/teraterm/teraterm/externalsetup.cpp +++ b/teraterm/teraterm/externalsetup.cpp @@ -90,6 +90,9 @@ static void ExternalSetupPreProcess(CAddSettingPropSheetDlgPage page) if (all || page == CAddSettingPropSheetDlgPage::WinPage) { ExternalSetupData.orgTitle = _strdup(ts.Title); } + if (all || page == CAddSettingPropSheetDlgPage::SerialPortPage) { + ; + } } /** @@ -159,6 +162,42 @@ static void ExternalSetupPostProcess(CAddSettingPropSheetDlgPage page, BOOL ok) free(ExternalSetupData.orgTitle); ExternalSetupData.orgTitle = NULL; } + if (all || page == CAddSettingPropSheetDlgPage::SerialPortPage) { + if (ok) { + if (ts.ComPort > 0) { + + if (cv.Ready && (cv.PortType != IdSerial)) { + // シリアル以外に接続中の場合 + // TODO cv.Ready と cv.Openの差は? +#if 0 + OpenNewComport(&ts); + return; +#endif + } + else if (!cv.Open) { + // 未接続の場合 +#if 0 + CommOpen(m_hWnd,&ts,&cv); +#endif + } + else { + // シリアルに接続中の場合 +#if 0 + if (ts.ComPort != cv.ComPort) { + // ポートを変更する + CommClose(&cv); + CommOpen(HVTWin,&ts,&cv); + } + else +#endif + { + // 通信パラメータを変更する + CommResetSerial(&ts, &cv, ts.ClearComBuffOnOpen); + } + } + } + } + } } /** @@ -286,3 +325,14 @@ void OpenSetupGeneral() BOOL r = (*SetupGeneral)(HVTWin,&ts); ExternalSetupPostProcess(CAddSettingPropSheetDlgPage::GeneralPage, r); } + +void OpenSetupSerialPort() +{ + if (! LoadTTDLG()) { + return; + } + ExternalSetupPreProcess(CAddSettingPropSheetDlgPage::SerialPortPage); + BOOL r = (*SetupSerialPort)(HVTWin, &ts); + ExternalSetupPostProcess(CAddSettingPropSheetDlgPage::SerialPortPage, r); +} + diff --git a/teraterm/teraterm/general_pp.cpp b/teraterm/teraterm/general_pp.cpp index 949f166d6..b1be6fc4f 100644 --- a/teraterm/teraterm/general_pp.cpp +++ b/teraterm/teraterm/general_pp.cpp @@ -307,27 +307,9 @@ void CGeneralPropPageDlg::OnInitDialog() } // default port - { - WORD w; - SendDlgItemMessageA(IDC_GENPORT, CB_ADDSTRING, 0, (LPARAM) "TCP/IP"); - for (w=1;w<=pts->MaxComPort;w++) { - char Temp[8]; - _snprintf_s(Temp, sizeof(Temp), _TRUNCATE, "COM%d", w); - SendDlgItemMessageA(IDC_GENPORT, CB_ADDSTRING, 0, (LPARAM)Temp); - } - if (pts->PortType==IdSerial) { - if (pts->ComPort <= pts->MaxComPort) { - w = pts->ComPort; - } - else { - w = 1; // COM1 - } - } - else { - w = 0; // TCP/IP - } - SendDlgItemMessageA(IDC_GENPORT, CB_SETCURSEL, w, 0); - } + SendDlgItemMessageA(IDC_GENPORT, CB_ADDSTRING, 0, (LPARAM)"TCP/IP"); + SendDlgItemMessageA(IDC_GENPORT, CB_ADDSTRING, 0, (LPARAM)"Serial"); + SendDlgItemMessageA(IDC_GENPORT, CB_SETCURSEL, (pts->PortType == IdSerial) ? 1 : 0, 0); // File transfer dir SetDlgItemTextW(IDC_FILE_DIR, pts->FileDirW); diff --git a/teraterm/teraterm/serial_pp.cpp b/teraterm/teraterm/serial_pp.cpp new file mode 100644 index 000000000..ac6313a79 --- /dev/null +++ b/teraterm/teraterm/serial_pp.cpp @@ -0,0 +1,529 @@ +/* + * Copyright (C) 1994-1998 T. Teranishi + * (C) 2024- TeraTerm Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* serial dialog */ + +#include +#include +#define _CRTDBG_MAP_ALLOC +#include +#include +#include + +#include "tttypes.h" +#include "ttlib.h" +#include "dlglib.h" +#include "dlg_res.h" +#include "comportinfo.h" +#include "helpid.h" +#include "asprintf.h" +#include "win32helper.h" +#include "compat_win.h" +#include "ttwinman.h" + +#include "serial_pp.h" + +// テンプレートの書き換えを行う +#define REWRITE_TEMPLATE + +// 存在するシリアルポートのみを表示する +//#define SHOW_ONLY_EXSITING_PORT TRUE +#define SHOW_ONLY_EXSITING_PORT FALSE // すべてのポートを表示する + +// ドロップダウンからポート表示を切り替え +//#define ENABLE_SWITCH_PORT_DISPLAY 1 +#define ENABLE_SWITCH_PORT_DISPLAY 0 + +// MaxComPortより大きなポートが存在するとき、MaxComPortをオーバーライドする +#define ENABLE_MAXCOMPORT_OVERRIDE 0 + +static const char *BaudList[] = { + "110","300","600","1200","2400","4800","9600", + "14400","19200","38400","57600","115200", + "230400", "460800", "921600", NULL}; +static const char *DataList[] = {"7 bit","8 bit",NULL}; +static const char *ParityList[] = {"none", "odd", "even", "mark", "space", NULL}; +static const char *StopList[] = {"1 bit", "2 bit", NULL}; +static const char *FlowList[] = {"Xon/Xoff", "RTS/CTS", "DSR/DTR", "none", NULL}; + +typedef struct { + PTTSet pts; + ComPortInfo_t *ComPortInfoPtr; + int ComPortInfoCount; + HINSTANCE hInst; + DLGTEMPLATE *dlg_templ; + int g_deltaSumSerialDlg; // マウスホイールのDelta累積用 + WNDPROC g_defSerialDlgEditWndProc; // Edit Controlのサブクラス化用 + BOOL show_all_port; +} SerialDlgData; + +/* + * シリアルポート設定ダイアログのテキストボックスにCOMポートの詳細情報を表示する。 + * @param port_index port_info[] のインデックス, -1のとき使用しない + * @param port_no ポート番号 "com%d", -1のとき使用しない + * @param port_name port_name ポート名 + */ +static void serial_dlg_set_comport_info(HWND dlg, SerialDlgData *dlg_data, int port_index, int port_no, const wchar_t *port_name) +{ + const wchar_t *text = L"This port does not exist now."; + if (port_index != -1) { + if (port_index < dlg_data->ComPortInfoCount ) { + const ComPortInfo_t *p = &dlg_data->ComPortInfoPtr[port_index]; + text = p->property; + } + } + else if (port_no != -1) { + const ComPortInfo_t *p = dlg_data->ComPortInfoPtr; + for (int i = 0; i < dlg_data->ComPortInfoCount; p++,i++) { + if (p->port_no == port_no) { + text = p->property; + break; + } + } + } + else if (port_name != NULL) { + const ComPortInfo_t *p = dlg_data->ComPortInfoPtr; + for (int i = 0; i < dlg_data->ComPortInfoCount; p++,i++) { + if (wcscmp(p->port_name, port_name) == 0) { + text = p->property; + break; + } + } + } + SetDlgItemTextW(dlg, IDC_SERIALTEXT, text); +} + +/* + * シリアルポート設定ダイアログのテキストボックスのプロシージャ + */ +static LRESULT CALLBACK SerialDlgEditWindowProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp) +{ + SerialDlgData *dlg_data = (SerialDlgData *)GetWindowLongPtrW(hWnd, GWLP_USERDATA); + + switch (msg) { + case WM_KEYDOWN: + // Edit control上で CTRL+A を押下すると、テキストを全選択する。 + if (wp == 'A' && GetKeyState(VK_CONTROL) < 0) { + PostMessage(hWnd, EM_SETSEL, 0, -1); + return 0; + } + break; + + case WM_MOUSEWHEEL: { + // CTRLorSHIFT + マウスホイールの場合、横スクロールさせる。 + WORD keys; + short delta; + BOOL page; + keys = GET_KEYSTATE_WPARAM(wp); + delta = GET_WHEEL_DELTA_WPARAM(wp); + page = keys & (MK_CONTROL | MK_SHIFT); + + if (page == 0) + break; + + dlg_data->g_deltaSumSerialDlg += delta; + + if (dlg_data->g_deltaSumSerialDlg >= WHEEL_DELTA) { + dlg_data->g_deltaSumSerialDlg -= WHEEL_DELTA; + SendMessage(hWnd, WM_HSCROLL, SB_PAGELEFT , 0); + } else if (dlg_data->g_deltaSumSerialDlg <= -WHEEL_DELTA) { + dlg_data->g_deltaSumSerialDlg += WHEEL_DELTA; + SendMessage(hWnd, WM_HSCROLL, SB_PAGERIGHT, 0); + } + + break; + } + } + return CallWindowProc(dlg_data->g_defSerialDlgEditWndProc, hWnd, msg, wp, lp); +} + +/** + * シリアルポートドロップダウンを設定する + * ITEMDATA + * 0... PortInfoの先頭からの番号 0からPortInfoCount-1まで + * -1 現在存在しないポート + * -2 "存在するポートのみ表示" + * -3 "全てのポートを表示" + */ +static void SetPortDrop(HWND hWnd, int id, SerialDlgData *dlg_data) +{ + PTTSet ts = dlg_data->pts; + BOOL show_all_port = dlg_data->show_all_port; + int max_com = ts->MaxComPort; + if (max_com < ts->ComPort) { + max_com = ts->ComPort; + } +#if ENABLE_MAXCOMPORT_OVERRIDE + if (dlg_data->ComPortInfoCount != 0) { + int max_exist_port = dlg_data->ComPortInfoPtr[dlg_data->ComPortInfoCount-1].port_no; + if (max_com < max_exist_port) { + max_com = max_exist_port; + } + } +#endif + if (dlg_data->ComPortInfoCount == 0) { + // ポートが存在していないときはすべて表示する + show_all_port = TRUE; + } + + // "COM%d" ではないポート + int port_index = 0; + int skip_count = 0; + const ComPortInfo_t *port_info = dlg_data->ComPortInfoPtr; + const ComPortInfo_t *p; + for (int i = 0; i < dlg_data->ComPortInfoCount; i++) { + p = port_info + port_index; + if (wcsncmp(p->port_name, L"COM", 3) == 0) { + break; + } + port_index++; + wchar_t *name; + if (p->friendly_name != NULL) { + aswprintf(&name, L"%s: %s", p->port_name, p->friendly_name); + } + else { + aswprintf(&name, L"%s: (no name, exists)", p->port_name); + } + LRESULT index = SendDlgItemMessageW(hWnd, id, CB_ADDSTRING, 0, (LPARAM)name); + free(name); + SendDlgItemMessageA(hWnd, id, CB_SETITEMDATA, index, i); + skip_count++; + } + + // 伝統的な "COM%d" + int sel_index = 0; + int com_count = 0; + BOOL all = show_all_port; + for (int i = 1; i <= max_com; i++) { + + wchar_t *com_name = NULL; + int item_data; + if (port_index < dlg_data->ComPortInfoCount) { + p = port_info + port_index; + if (p->port_no == i) { + // ComPortInfo で検出できたポート + item_data = port_index; + port_index++; + + if (p->friendly_name != NULL) { + aswprintf(&com_name, L"%s: %s", p->port_name, p->friendly_name); + } + else { + aswprintf(&com_name, L"%s: (no friendly name, exist)", p->port_name); + } + } + } + + if (com_name == NULL) { + // 検出できなかったポート(存在しないポート) + if (!all && (i != ts->ComPort)) { + // すべて表示しない + continue; + } + aswprintf(&com_name, L"COM%d", i); + item_data = -1; + } + + LRESULT index = SendDlgItemMessageW(hWnd, id, CB_ADDSTRING, 0, (LPARAM)com_name); + SendDlgItemMessageA(hWnd, id, CB_SETITEMDATA, index, item_data); + free(com_name); + com_count++; + + if (i == ts->ComPort) { + sel_index = com_count + skip_count; + } + } + + if (ENABLE_SWITCH_PORT_DISPLAY) { + if (show_all_port) { + LRESULT index = SendDlgItemMessageW(hWnd, id, CB_ADDSTRING, 0, (LPARAM)L""); + SendDlgItemMessageA(hWnd, id, CB_SETITEMDATA, index, -2); + } + else { + wchar_t *s; + aswprintf(&s, L"", max_com); + LRESULT index = SendDlgItemMessageW(hWnd, id, CB_ADDSTRING, 0, (LPARAM)s); + free(s); + SendDlgItemMessageA(hWnd, id, CB_SETITEMDATA, index, -3); + } + } + + ExpandCBWidth(hWnd, id); + if (dlg_data->ComPortInfoCount == 0) { + // COMポートなし + serial_dlg_set_comport_info(hWnd, dlg_data, -1, -1, NULL); + } + else { + if (cv.Open && (cv.PortType == IdSerial)) { + // 接続中の時は選択できないようにする + EnableWindow(GetDlgItem(hWnd, id), FALSE); + } + serial_dlg_set_comport_info(hWnd, dlg_data, -1, ts->ComPort, NULL); + } + SendDlgItemMessage(hWnd, id, CB_SETCURSEL, sel_index - 1, 0); // sel_index = 1 origin +} + +/* + * シリアルポート設定ダイアログ + * + * シリアルポート数が0の時は呼ばれない + */ +static INT_PTR CALLBACK SerialDlg(HWND Dialog, UINT Message, WPARAM wParam, LPARAM lParam) +{ + static const DlgTextInfo TextInfos[] = { + { IDC_SERIALPORT_LABEL, "DLG_SERIAL_PORT" }, + { IDC_SERIALBAUD_LEBAL, "DLG_SERIAL_BAUD" }, + { IDC_SERIALDATA_LABEL, "DLG_SERIAL_DATA" }, + { IDC_SERIALPARITY_LABEL, "DLG_SERIAL_PARITY" }, + { IDC_SERIALSTOP_LABEL, "DLG_SERIAL_STOP" }, + { IDC_SERIALFLOW_LABEL, "DLG_SERIAL_FLOW" }, + { IDC_SERIALDELAY, "DLG_SERIAL_DELAY" }, + { IDC_SERIALDELAYCHAR_LABEL, "DLG_SERIAL_DELAYCHAR" }, + { IDC_SERIALDELAYLINE_LABEL, "DLG_SERIAL_DELAYLINE" }, + }; + + switch (Message) { + case WM_INITDIALOG: { + + SerialDlgData *dlg_data = (SerialDlgData *)(((PROPSHEETPAGEW_V1 *)lParam)->lParam); + SetWindowLongPtrW(Dialog, DWLP_USER, (LPARAM)dlg_data); + PTTSet ts = dlg_data->pts; + + SetDlgTextsW(Dialog, TextInfos, _countof(TextInfos), ts->UILanguageFileW); + + SetPortDrop(Dialog, IDC_SERIALPORT, dlg_data); + // speed, baud rate + { + int i, sel; + SetDropDownList(Dialog, IDC_SERIALBAUD, BaudList, 0); + i = sel = 0; + while (BaudList[i] != NULL) { + if ((WORD)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); + + /* + * value display + * 1 IdFlowX 1 Xon/Xoff + * 2 IdFlowHard 2 RTS/CTS + * 3 IdFlowNone 4 none + * 4 IdFlowHardDsrDtr 3 DSR/DTR + */ + WORD Flow = ts->Flow; + if (Flow == 3) { + Flow = 4; + } + else if (Flow == 4) { + Flow = 3; + } + SetDropDownList(Dialog, IDC_SERIALFLOW, FlowList, Flow); + + SetDlgItemInt(Dialog,IDC_SERIALDELAYCHAR,ts->DelayPerChar,FALSE); + SendDlgItemMessage(Dialog, IDC_SERIALDELAYCHAR, EM_LIMITTEXT,4, 0); + + SetDlgItemInt(Dialog,IDC_SERIALDELAYLINE,ts->DelayPerLine,FALSE); + SendDlgItemMessage(Dialog, IDC_SERIALDELAYLINE, EM_LIMITTEXT,4, 0); + + CenterWindow(Dialog, GetParent(Dialog)); + + // Edit controlをサブクラス化する。 + dlg_data->g_deltaSumSerialDlg = 0; + SetWindowLongPtrW(GetDlgItem(Dialog, IDC_SERIALTEXT), GWLP_USERDATA, (LONG_PTR)dlg_data); + dlg_data->g_defSerialDlgEditWndProc = (WNDPROC)SetWindowLongPtrW( + GetDlgItem(Dialog, IDC_SERIALTEXT), + GWLP_WNDPROC, + (LONG_PTR)SerialDlgEditWindowProc); + + return TRUE; + } + case WM_NOTIFY: { + NMHDR *nmhdr = (NMHDR *)lParam; + SerialDlgData *data = (SerialDlgData *)GetWindowLongPtrW(Dialog, DWLP_USER); + PTTSet ts = data->pts; + switch (nmhdr->code) { + case PSN_APPLY: { + int w; + char Temp[128]; + Temp[0] = 0; + GetDlgItemTextA(Dialog, IDC_SERIALPORT, Temp, sizeof(Temp)-1); + if (strncmp(Temp, "COM", 3) == 0 && Temp[3] != '\0') { + ts->ComPort = (WORD)atoi(&Temp[3]); + } + + GetDlgItemTextA(Dialog, IDC_SERIALBAUD, Temp, sizeof(Temp)-1); + if (atoi(Temp) != 0) { + ts->Baud = (DWORD)atoi(Temp); + } + if ((w = (WORD)GetCurSel(Dialog, IDC_SERIALDATA)) > 0) { + ts->DataBit = w; + } + if ((w = (WORD)GetCurSel(Dialog, IDC_SERIALPARITY)) > 0) { + ts->Parity = w; + } + if ((w = (WORD)GetCurSel(Dialog, IDC_SERIALSTOP)) > 0) { + ts->StopBit = w; + } + if ((w = (WORD)GetCurSel(Dialog, IDC_SERIALFLOW)) > 0) { + /* + * display value + * 1 Xon/Xoff 1 IdFlowX + * 2 RTS/CTS 2 IdFlowHard + * 3 DSR/DTR 4 IdFlowHardDsrDtr + * 4 none 3 IdFlowNone + */ + WORD Flow = w; + if (Flow == 3) { + Flow = 4; + } + else if (Flow == 4) { + Flow = 3; + } + ts->Flow = Flow; + } + + ts->DelayPerChar = GetDlgItemInt(Dialog,IDC_SERIALDELAYCHAR,NULL,FALSE); + + ts->DelayPerLine = GetDlgItemInt(Dialog,IDC_SERIALDELAYLINE,NULL,FALSE); + + // TODO 削除 + // 全般タブの「標準のポート」でデフォルトの接続ポートを指定する + // ここでは指定しない + // ts->PortType = IdSerial; + + // ボーレートが変更されることがあるので、タイトル再表示の + // メッセージを飛ばすようにした。 (2007.7.21 maya) + PostMessage(GetParent(Dialog),WM_USER_CHANGETITLE,0,0); + + break; + } + case PSN_HELP: { + HWND vtwin = GetParent(GetParent(Dialog)); + PostMessage(vtwin, WM_USER_DLGHELP2, HlpMenuSetupAdditionalSerialPort, 0); + break; + } + } + break; + } + case WM_COMMAND: + switch (LOWORD(wParam)) { + case IDC_SERIALPORT: + if (HIWORD(wParam) == CBN_SELCHANGE) { + // リストからCOMポートが選択された + SerialDlgData *dlg_data = (SerialDlgData *)GetWindowLongPtrW(Dialog, DWLP_USER); + LRESULT sel = SendDlgItemMessageA(Dialog, IDC_SERIALPORT, CB_GETCURSEL, 0, 0); + int item_data = (int)SendDlgItemMessageA(Dialog, IDC_SERIALPORT, CB_GETITEMDATA, sel, 0); + if (item_data >= 0) { + // 詳細情報を表示する + serial_dlg_set_comport_info(Dialog, dlg_data, item_data, -1, NULL); + } + else if (item_data == -1) { + // 情報なしを表示する + serial_dlg_set_comport_info(Dialog, dlg_data, -1, -1, NULL); + } + else { + // 選択方法変更 + dlg_data->show_all_port = (item_data == -2) ? FALSE : TRUE; + SendDlgItemMessageA(Dialog, IDC_SERIALPORT, CB_RESETCONTENT, 0, 0); + SetPortDrop(Dialog, IDC_SERIALPORT, dlg_data); + } + break; + } + + return TRUE; + } + } + return FALSE; +} + +static UINT CALLBACK CallBack(HWND hwnd, UINT uMsg, struct _PROPSHEETPAGEW *ppsp) +{ + UINT ret_val = 0; + switch (uMsg) { + case PSPCB_CREATE: + ret_val = 1; + break; + case PSPCB_RELEASE: { + SerialDlgData *dlg_data = (SerialDlgData *)ppsp->lParam; + + free((void *)ppsp->pResource); + ppsp->pResource = NULL; + ComPortInfoFree(dlg_data->ComPortInfoPtr, dlg_data->ComPortInfoCount); + free(dlg_data); + ppsp->lParam = (LPARAM)NULL; + break; + } + default: + break; + } + return ret_val; +} + +HPROPSHEETPAGE SerialPageCreate(HINSTANCE inst, TTTSet *pts) +{ + SerialDlgData *Param = (SerialDlgData *)calloc(1, sizeof(SerialDlgData)); + Param->hInst = inst; + Param->pts = pts; + Param->ComPortInfoPtr = ComPortInfoGet(&Param->ComPortInfoCount); + Param->show_all_port = !SHOW_ONLY_EXSITING_PORT; + + PROPSHEETPAGEW_V1 psp = {}; + psp.dwSize = sizeof(psp); + psp.dwFlags = PSP_DEFAULT | PSP_USECALLBACK | PSP_USETITLE | PSP_HASHELP; + psp.hInstance = inst; + psp.pfnCallback = CallBack; + wchar_t *UIMsg; + GetI18nStrWW("Tera Term", "DLG_SERIAL_TITLE", + L"Serial port", pts->UILanguageFileW, &UIMsg); + psp.pszTitle = UIMsg; + psp.pszTemplate = MAKEINTRESOURCEW(IDD_SERIALDLG); +#if defined(REWRITE_TEMPLATE) + psp.dwFlags |= PSP_DLGINDIRECT; + Param->dlg_templ = TTGetDlgTemplate(inst, MAKEINTRESOURCEW(IDD_SERIALDLG)); + psp.pResource = Param->dlg_templ; +#endif + + psp.pfnDlgProc = SerialDlg; + psp.lParam = (LPARAM)Param; + + HPROPSHEETPAGE hpsp = CreatePropertySheetPageW((LPPROPSHEETPAGEW)&psp); + free(UIMsg); + return hpsp; +} diff --git a/teraterm/teraterm/serial_pp.h b/teraterm/teraterm/serial_pp.h new file mode 100644 index 000000000..afa53b41e --- /dev/null +++ b/teraterm/teraterm/serial_pp.h @@ -0,0 +1,39 @@ +/* + * (C) 2020- TeraTerm Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +HPROPSHEETPAGE SerialPageCreate(HINSTANCE inst, TTTSet *pts); + +#ifdef __cplusplus +} +#endif diff --git a/teraterm/teraterm/tekwin.cpp b/teraterm/teraterm/tekwin.cpp index 3f9acccbc..5d140813f 100644 --- a/teraterm/teraterm/tekwin.cpp +++ b/teraterm/teraterm/tekwin.cpp @@ -751,7 +751,7 @@ void CTEKWindow::OnSetupFont() return; } - (*TEKSetupFont)(&tk,&ts); + TEKSetupFont(&tk,&ts); } void CTEKWindow::OnVTWin() diff --git a/teraterm/teraterm/ttdialog.c b/teraterm/teraterm/ttdialog.c index 4e7719fb8..a26e15f21 100644 --- a/teraterm/teraterm/ttdialog.c +++ b/teraterm/teraterm/ttdialog.c @@ -34,7 +34,6 @@ #include "ttdlg.h" #include "ttdialog.h" -#include "ttwinman.h" PSetupTerminal SetupTerminal; PSetupWin SetupWin; diff --git a/teraterm/teraterm/ttermpro.rc b/teraterm/teraterm/ttermpro.rc index 771e8d7fd..d4f59fff5 100644 --- a/teraterm/teraterm/ttermpro.rc +++ b/teraterm/teraterm/ttermpro.rc @@ -66,7 +66,7 @@ BEGIN "Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,51,220,10 CONTROL "Change cursor shape with &IME state",IDC_CURSOR_CHANGE_IME, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,66,220,10 - CONTROL "Default &port:",IDC_GENPORT_LABEL,"Static",SS_LEFTNOWORDWRAP | WS_GROUP,10,106,91,11 + CONTROL "Default &port:",IDC_GENPORT_LABEL,"Static",SS_LEFTNOWORDWRAP | WS_GROUP,10,106,142,11 COMBOBOX IDC_GENPORT,21,118,52,58,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP GROUPBOX "Title format",IDC_TITLEFMT_GROUP,5,133,247,55 CONTROL "&Display host/port name",IDC_TITLEFMT_DISPHOSTNAME, diff --git a/teraterm/teraterm/ttermpro.v16.vcxproj b/teraterm/teraterm/ttermpro.v16.vcxproj index 3b11eed6d..456b3c43f 100644 --- a/teraterm/teraterm/ttermpro.v16.vcxproj +++ b/teraterm/teraterm/ttermpro.v16.vcxproj @@ -194,6 +194,7 @@ + @@ -272,6 +273,7 @@ + diff --git a/teraterm/teraterm/ttermpro.v16.vcxproj.filters b/teraterm/teraterm/ttermpro.v16.vcxproj.filters index 11d1061c7..e24dcb8f4 100644 --- a/teraterm/teraterm/ttermpro.v16.vcxproj.filters +++ b/teraterm/teraterm/ttermpro.v16.vcxproj.filters @@ -294,6 +294,9 @@ Source Files + + dialog + Source Files @@ -639,6 +642,9 @@ Header Files + + dialog + Header Files diff --git a/teraterm/teraterm/ttermpro.v17.vcxproj b/teraterm/teraterm/ttermpro.v17.vcxproj index 147d51ba4..89ebfa150 100644 --- a/teraterm/teraterm/ttermpro.v17.vcxproj +++ b/teraterm/teraterm/ttermpro.v17.vcxproj @@ -194,6 +194,7 @@ + @@ -272,6 +273,7 @@ + diff --git a/teraterm/teraterm/ttermpro.v17.vcxproj.filters b/teraterm/teraterm/ttermpro.v17.vcxproj.filters index 09df21672..7d2b3dcec 100644 --- a/teraterm/teraterm/ttermpro.v17.vcxproj.filters +++ b/teraterm/teraterm/ttermpro.v17.vcxproj.filters @@ -294,6 +294,9 @@ Source Files + + dialog + Source Files @@ -639,6 +642,9 @@ Header Files + + dialog + Header Files diff --git a/teraterm/teraterm/vtwin.cpp b/teraterm/teraterm/vtwin.cpp index 873bba132..15cc21b05 100644 --- a/teraterm/teraterm/vtwin.cpp +++ b/teraterm/teraterm/vtwin.cpp @@ -4307,39 +4307,7 @@ static void OpenNewComport(const TTTSet *pts) void CVTWindow::OnSetupSerialPort() { - BOOL Ok; - - HelpId = HlpSetupSerialPort; - if (! LoadTTDLG()) { - return; - } - SetDialogFont(ts.DialogFontNameW, ts.DialogFontPoint, ts.DialogFontCharSet, - ts.UILanguageFileW, "Tera Term", "DLG_SYSTEM_FONT"); - Ok = (*SetupSerialPort)(HVTWin, &ts); - - if (Ok && ts.ComPort > 0) { - /* - * TCP/IPによる接続中の場合は新規プロセスとして起動する。 - * New connectionからシリアル接続する動作と基本的に同じ動作となる。 - */ - if ( cv.Ready && (cv.PortType != IdSerial) ) { - OpenNewComport(&ts); - return; - } - - if (cv.Open) { - if (ts.ComPort != cv.ComPort) { - CommClose(&cv); - CommOpen(HVTWin,&ts,&cv); - } - else { - CommResetSerial(&ts, &cv, ts.ClearComBuffOnOpen); - } - } - else { - CommOpen(HVTWin,&ts,&cv); - } - } + OpenSetupSerialPort(); } void CVTWindow::OnSetupTCPIP() diff --git a/teraterm/ttpdlg/dlg_res.h b/teraterm/ttpdlg/dlg_res.h index e29452a07..4dd90a147 100644 --- a/teraterm/ttpdlg/dlg_res.h +++ b/teraterm/ttpdlg/dlg_res.h @@ -69,7 +69,6 @@ #define IDC_SERIALFLOW 406 #define IDC_SERIALDELAYCHAR 407 #define IDC_SERIALDELAYLINE 408 -#define IDC_SERIALHELP 499 #define IDD_TCPIPDLG 500 #define IDC_TCPIPHISTORY 507 #define IDC_TCPIPAUTOCLOSE 508 @@ -158,7 +157,7 @@ #define _APS_NO_MFC 1 #define _APS_NEXT_RESOURCE_VALUE 103 #define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1081 +#define _APS_NEXT_CONTROL_VALUE 1082 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif diff --git a/teraterm/ttpdlg/serialdlg.cpp b/teraterm/ttpdlg/serialdlg.cpp index 9cbb3db48..121d04595 100644 --- a/teraterm/ttpdlg/serialdlg.cpp +++ b/teraterm/ttpdlg/serialdlg.cpp @@ -29,431 +29,13 @@ /* serial dialog */ -#include -#include -#define _CRTDBG_MAP_ALLOC -#include -#include -#include - -#include "tttypes.h" -#include "ttlib.h" -#include "dlglib.h" -#include "ttcommon.h" -#include "dlg_res.h" -#include "tipwin.h" -#include "comportinfo.h" -#include "codeconv.h" -#include "helpid.h" -#include "asprintf.h" -#include "win32helper.h" -#include "compat_win.h" -#include "asprintf.h" -#include "ttwinman.h" +#include +#include "externalsetup.h" #include "ttdlg.h" -static const char *BaudList[] = - {"110","300","600","1200","2400","4800","9600", - "14400","19200","38400","57600","115200", - "230400", "460800", "921600", NULL}; - -typedef struct { - PTTSet pts; - ComPortInfo_t *ComPortInfoPtr; - int ComPortInfoCount; -} SerialDlgData; - -static const char *DataList[] = {"7 bit","8 bit",NULL}; -static const char *ParityList[] = {"none", "odd", "even", "mark", "space", NULL}; -static const char *StopList[] = {"1 bit", "2 bit", NULL}; -static const char *FlowList[] = {"Xon/Xoff", "RTS/CTS", "DSR/DTR", "none", NULL}; -static int g_deltaSumSerialDlg = 0; // マウスホイールのDelta累積用 -static WNDPROC g_defSerialDlgEditWndProc; // Edit Controlのサブクラス化用 -static WNDPROC g_defSerialDlgSpeedComboboxWndProc; // Combo-box Controlのサブクラス化用 -static TipWin *g_SerialDlgSpeedTip; - -/* - * シリアルポート設定ダイアログのOKボタンを接続先に応じて名称を切り替える。 - * 条件判定は OnSetupSerialPort() と合わせる必要がある。 - */ -static void serial_dlg_change_OK_button(HWND dlg, int portno, const wchar_t *UILanguageFileW) -{ - wchar_t *uimsg; - if ( cv.Ready && (cv.PortType != IdSerial) ) { - uimsg = TTGetLangStrW("Tera Term", - "DLG_SERIAL_OK_CONNECTION", - L"Connect with &New window", - UILanguageFileW); - } else { - if (cv.Open) { - if (portno != cv.ComPort) { - uimsg = TTGetLangStrW("Tera Term", - "DLG_SERIAL_OK_CLOSEOPEN", - L"Close and &New open", - UILanguageFileW); - } else { - uimsg = TTGetLangStrW("Tera Term", - "DLG_SERIAL_OK_RESET", - L"&New setting", - UILanguageFileW); - } - - } else { - uimsg = TTGetLangStrW("Tera Term", - "DLG_SERIAL_OK_OPEN", - L"&New open", - UILanguageFileW); - } - } - SetDlgItemTextW(dlg, IDOK, uimsg); - free(uimsg); -} - -/* - * シリアルポート設定ダイアログのテキストボックスにCOMポートの詳細情報を表示する。 - * - */ -static void serial_dlg_set_comport_info(HWND dlg, SerialDlgData *dlg_data, int port_index) -{ - if (port_index + 1 > dlg_data->ComPortInfoCount) { - SetDlgItemTextW(dlg, IDC_SERIALTEXT, NULL); - } - else { - const ComPortInfo_t *p = &dlg_data->ComPortInfoPtr[port_index]; - SetDlgItemTextW(dlg, IDC_SERIALTEXT, p->property); - } -} - -/* - * シリアルポート設定ダイアログのテキストボックスのプロシージャ - */ -static LRESULT CALLBACK SerialDlgEditWindowProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp) -{ - WORD keys; - short delta; - BOOL page; - - switch (msg) { - case WM_KEYDOWN: - // Edit control上で CTRL+A を押下すると、テキストを全選択する。 - if (wp == 'A' && GetKeyState(VK_CONTROL) < 0) { - PostMessage(hWnd, EM_SETSEL, 0, -1); - return 0; - } - break; - - case WM_MOUSEWHEEL: - // CTRLorSHIFT + マウスホイールの場合、横スクロールさせる。 - keys = GET_KEYSTATE_WPARAM(wp); - delta = GET_WHEEL_DELTA_WPARAM(wp); - page = keys & (MK_CONTROL | MK_SHIFT); - - if (page == 0) - break; - - g_deltaSumSerialDlg += delta; - - if (g_deltaSumSerialDlg >= WHEEL_DELTA) { - g_deltaSumSerialDlg -= WHEEL_DELTA; - SendMessage(hWnd, WM_HSCROLL, SB_PAGELEFT , 0); - } else if (g_deltaSumSerialDlg <= -WHEEL_DELTA) { - g_deltaSumSerialDlg += WHEEL_DELTA; - SendMessage(hWnd, WM_HSCROLL, SB_PAGERIGHT, 0); - } - - break; - } - return CallWindowProc(g_defSerialDlgEditWndProc, hWnd, msg, wp, lp); -} - -/* - * シリアルポート設定ダイアログのSPEED(BAUD)のプロシージャ - */ -static LRESULT CALLBACK SerialDlgSpeedComboboxWindowProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp) -{ - const int tooltip_timeout = 1000; // msec - int h; - int cx, cy; - RECT wr; - SerialDlgData *dlg_data = (SerialDlgData *)GetWindowLongPtr(hWnd, GWLP_USERDATA); - int frame_width; - - switch (msg) { - case WM_MOUSEMOVE: - // ツールチップを作成 - if (g_SerialDlgSpeedTip == NULL) { - const wchar_t *UILanguageFileW; - wchar_t *uimsg; - UILanguageFileW = dlg_data->pts->UILanguageFileW; - uimsg = TTGetLangStrW("Tera Term", - "DLG_SERIAL_SPEED_TOOLTIP", L"You can directly specify a number", UILanguageFileW); - g_SerialDlgSpeedTip = TipWinCreate(hInst, hWnd); - TipWinSetTextW(g_SerialDlgSpeedTip, uimsg); - - free(uimsg); - } - - // Combo-boxの左上座標を求める - GetWindowRect(hWnd, &wr); - - // ツールチップを表示する - TipWinGetWindowSize(g_SerialDlgSpeedTip, NULL, &h); - TipWinGetFrameSize(g_SerialDlgSpeedTip, &frame_width); - cx = wr.left; - cy = wr.top - (h + frame_width * 4); - TipWinSetPos(g_SerialDlgSpeedTip, cx, cy); - TipWinSetHideTimer(g_SerialDlgSpeedTip, tooltip_timeout); - if (!TipWinIsVisible(g_SerialDlgSpeedTip)) - TipWinSetVisible(g_SerialDlgSpeedTip, TRUE); - - break; - } - return CallWindowProc(g_defSerialDlgSpeedComboboxWndProc, hWnd, msg, wp, lp); -} - -/* - * シリアルポート設定ダイアログ - * - * シリアルポート数が0の時は呼ばれない - */ -static INT_PTR CALLBACK SerialDlg(HWND Dialog, UINT Message, WPARAM wParam, LPARAM lParam) -{ - static const DlgTextInfo TextInfos[] = { - { 0, "DLG_SERIAL_TITLE" }, - { IDC_SERIALPORT_LABEL, "DLG_SERIAL_PORT" }, - { IDC_SERIALBAUD_LEBAL, "DLG_SERIAL_BAUD" }, - { IDC_SERIALDATA_LABEL, "DLG_SERIAL_DATA" }, - { IDC_SERIALPARITY_LABEL, "DLG_SERIAL_PARITY" }, - { IDC_SERIALSTOP_LABEL, "DLG_SERIAL_STOP" }, - { IDC_SERIALFLOW_LABEL, "DLG_SERIAL_FLOW" }, - { IDC_SERIALDELAY, "DLG_SERIAL_DELAY" }, - { IDC_SERIALDELAYCHAR_LABEL, "DLG_SERIAL_DELAYCHAR" }, - { IDC_SERIALDELAYLINE_LABEL, "DLG_SERIAL_DELAYLINE" }, - { IDOK, "BTN_OK" }, - { IDCANCEL, "BTN_CANCEL" }, - { IDC_SERIALHELP, "BTN_HELP" }, - }; - SerialDlgData *dlg_data = (SerialDlgData *)GetWindowLongPtr(Dialog, DWLP_USER); - PTTSet ts = dlg_data == NULL ? NULL : dlg_data->pts; - int i, w, sel; - WORD Flow; - - switch (Message) { - case WM_INITDIALOG: - dlg_data = (SerialDlgData *)lParam; - SetWindowLongPtr(Dialog, DWLP_USER, lParam); - ts = dlg_data->pts; - - assert(dlg_data->ComPortInfoCount > 0); - SetDlgTextsW(Dialog, TextInfos, _countof(TextInfos), ts->UILanguageFileW); - - w = 0; - - for (i = 0; i < dlg_data->ComPortInfoCount; i++) { - ComPortInfo_t *p = dlg_data->ComPortInfoPtr + i; - wchar_t *EntNameW; - - // MaxComPort を越えるポートは表示しない - if (i > ts->MaxComPort) { - continue; - } - - aswprintf(&EntNameW, L"%s", p->port_name); - SendDlgItemMessageW(Dialog, IDC_SERIALPORT, CB_ADDSTRING, 0, (LPARAM)EntNameW); - free(EntNameW); - - if (p->port_no == ts->ComPort) { - w = i; - } - } - serial_dlg_set_comport_info(Dialog, dlg_data, w); - SendDlgItemMessage(Dialog, IDC_SERIALPORT, CB_SETCURSEL, w, 0); - - SetDropDownList(Dialog, IDC_SERIALBAUD, BaudList, 0); - i = sel = 0; - while (BaudList[i] != NULL) { - if ((WORD)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); - - /* - * value display - * 1 IdFlowX 1 Xon/Xoff - * 2 IdFlowHard 2 RTS/CTS - * 3 IdFlowNone 4 none - * 4 IdFlowHardDsrDtr 3 DSR/DTR - */ - Flow = ts->Flow; - if (Flow == 3) { - Flow = 4; - } - else if (Flow == 4) { - Flow = 3; - } - SetDropDownList(Dialog, IDC_SERIALFLOW, FlowList, Flow); - - SetDlgItemInt(Dialog,IDC_SERIALDELAYCHAR,ts->DelayPerChar,FALSE); - SendDlgItemMessage(Dialog, IDC_SERIALDELAYCHAR, EM_LIMITTEXT,4, 0); - - SetDlgItemInt(Dialog,IDC_SERIALDELAYLINE,ts->DelayPerLine,FALSE); - SendDlgItemMessage(Dialog, IDC_SERIALDELAYLINE, EM_LIMITTEXT,4, 0); - - CenterWindow(Dialog, GetParent(Dialog)); - - // Edit controlをサブクラス化する。 - g_deltaSumSerialDlg = 0; - g_defSerialDlgEditWndProc = (WNDPROC)SetWindowLongPtr( - GetDlgItem(Dialog, IDC_SERIALTEXT), - GWLP_WNDPROC, - (LONG_PTR)SerialDlgEditWindowProc); - - // Combo-box controlをサブクラス化する。 - SetWindowLongPtrW(GetDlgItem(Dialog, IDC_SERIALBAUD), GWLP_USERDATA, (LONG_PTR)dlg_data); - g_defSerialDlgSpeedComboboxWndProc = (WNDPROC)SetWindowLongPtr( - GetDlgItem(Dialog, IDC_SERIALBAUD), - GWLP_WNDPROC, - (LONG_PTR)SerialDlgSpeedComboboxWindowProc); - - // 現在の接続状態と新しいポート番号の組み合わせで、接続処理が変わるため、 - // それに応じてOKボタンのラベル名を切り替える。 - serial_dlg_change_OK_button(Dialog, dlg_data->ComPortInfoPtr[w].port_no, ts->UILanguageFileW); - - return TRUE; - - case WM_COMMAND: - switch (LOWORD(wParam)) { - case IDOK: - if ( ts!=NULL ) { - char Temp[128]; - memset(Temp, 0, sizeof(Temp)); - GetDlgItemText(Dialog, IDC_SERIALPORT, Temp, sizeof(Temp)-1); - if (strncmp(Temp, "COM", 3) == 0 && Temp[3] != '\0') { - ts->ComPort = (WORD)atoi(&Temp[3]); - } - - GetDlgItemText(Dialog, IDC_SERIALBAUD, Temp, sizeof(Temp)-1); - if (atoi(Temp) != 0) { - ts->Baud = (DWORD)atoi(Temp); - } - if ((w = (WORD)GetCurSel(Dialog, IDC_SERIALDATA)) > 0) { - ts->DataBit = w; - } - if ((w = (WORD)GetCurSel(Dialog, IDC_SERIALPARITY)) > 0) { - ts->Parity = w; - } - if ((w = (WORD)GetCurSel(Dialog, IDC_SERIALSTOP)) > 0) { - ts->StopBit = w; - } - if ((w = (WORD)GetCurSel(Dialog, IDC_SERIALFLOW)) > 0) { - /* - * display value - * 1 Xon/Xoff 1 IdFlowX - * 2 RTS/CTS 2 IdFlowHard - * 3 DSR/DTR 4 IdFlowHardDsrDtr - * 4 none 3 IdFlowNone - */ - Flow = w; - if (Flow == 3) { - Flow = 4; - } - else if (Flow == 4) { - Flow = 3; - } - ts->Flow = Flow; - } - - ts->DelayPerChar = GetDlgItemInt(Dialog,IDC_SERIALDELAYCHAR,NULL,FALSE); - - ts->DelayPerLine = GetDlgItemInt(Dialog,IDC_SERIALDELAYLINE,NULL,FALSE); - - ts->PortType = IdSerial; - - // ボーレートが変更されることがあるので、タイトル再表示の - // メッセージを飛ばすようにした。 (2007.7.21 maya) - PostMessage(GetParent(Dialog),WM_USER_CHANGETITLE,0,0); - } - - // ツールチップを廃棄する - if (g_SerialDlgSpeedTip) { - TipWinDestroy(g_SerialDlgSpeedTip); - g_SerialDlgSpeedTip = NULL; - } - - EndDialog(Dialog, 1); - return TRUE; - - case IDCANCEL: - // ツールチップを廃棄する - if (g_SerialDlgSpeedTip) { - TipWinDestroy(g_SerialDlgSpeedTip); - g_SerialDlgSpeedTip = NULL; - } - - EndDialog(Dialog, 0); - return TRUE; - - case IDC_SERIALHELP: - PostMessage(GetParent(Dialog),WM_USER_DLGHELP2,HlpSetupSerialPort,0); - return TRUE; - - case IDC_SERIALPORT: - if (HIWORD(wParam) == CBN_SELCHANGE) { - // リストからCOMポートが選択された - int portno; - sel = SendDlgItemMessage(Dialog, IDC_SERIALPORT, CB_GETCURSEL, 0, 0); - portno = dlg_data->ComPortInfoPtr[sel].port_no; // ポート番号 - - // 詳細情報を表示する - serial_dlg_set_comport_info(Dialog, dlg_data, sel); - - // 現在の接続状態と新しいポート番号の組み合わせで、接続処理が変わるため、 - // それに応じてOKボタンのラベル名を切り替える。 - serial_dlg_change_OK_button(Dialog, portno, ts->UILanguageFileW); - - break; - - } - - return TRUE; - } - } - return FALSE; -} - BOOL WINAPI _SetupSerialPort(HWND WndParent, PTTSet ts) { - BOOL r; - SerialDlgData *dlg_data = (SerialDlgData *)calloc(1, sizeof(*dlg_data)); - dlg_data->pts = ts; - dlg_data->ComPortInfoPtr = ComPortInfoGet(&dlg_data->ComPortInfoCount); - if (dlg_data->ComPortInfoCount == 0) { - static const TTMessageBoxInfoW info = { - "Tera Term", - "MSG_TT_NOTICE", L"Tera Term: Notice", - NULL, L"No serial port", - MB_ICONINFORMATION | MB_OK - }; - TTMessageBoxW(WndParent, &info, ts->UILanguageFileW); - return FALSE; // 変更しなかった - } - - r = (BOOL)TTDialogBoxParam(hInst, - MAKEINTRESOURCEW(IDD_SERIALDLG), - WndParent, SerialDlg, (LPARAM)dlg_data); - - ComPortInfoFree(dlg_data->ComPortInfoPtr, dlg_data->ComPortInfoCount); - free(dlg_data); - return r; + (void)ts; + return OpenExternalSetupTab(WndParent, SerialPortPage); } diff --git a/teraterm/ttpdlg/ttpdlg.rc b/teraterm/ttpdlg/ttpdlg.rc index 66bb6cb8a..1b294f4f4 100644 --- a/teraterm/ttpdlg/ttpdlg.rc +++ b/teraterm/ttpdlg/ttpdlg.rc @@ -77,32 +77,29 @@ BEGIN CONTROL "A&uto switch (VT<->TEK)",IDC_TERMAUTOSWITCH,"Button",BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,123,80,126,12 END -IDD_SERIALDLG DIALOGEX 20, 20, 234, 214 +IDD_SERIALDLG DIALOGEX 20, 20, 304, 215 STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION "Tera Term: Serial port setup and connection" -FONT 14, "System", 0, 0, 0x0 +FONT 8, "Tahoma", 400, 0, 0x0 BEGIN CONTROL "&Port:",IDC_SERIALPORT_LABEL,"Static",SS_LEFTNOWORDWRAP,15,9,54,8 - COMBOBOX IDC_SERIALPORT,75,7,48,52,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_SERIALPORT,75,7,62,52,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP CONTROL "Sp&eed:",IDC_SERIALBAUD_LEBAL,"Static",SS_LEFTNOWORDWRAP,15,24,54,8 - COMBOBOX IDC_SERIALBAUD,75,22,48,100,CBS_DROPDOWN | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_SERIALBAUD,75,22,62,100,CBS_DROPDOWN | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP CONTROL "&Data:",IDC_SERIALDATA_LABEL,"Static",SS_LEFTNOWORDWRAP,15,39,54,8 - COMBOBOX IDC_SERIALDATA,75,37,48,35,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_SERIALDATA,75,37,62,35,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP CONTROL "P&arity:",IDC_SERIALPARITY_LABEL,"Static",SS_LEFTNOWORDWRAP,15,54,54,8 - COMBOBOX IDC_SERIALPARITY,75,52,48,65,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_SERIALPARITY,75,52,62,65,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP CONTROL "&Stop bits:",IDC_SERIALSTOP_LABEL,"Static",SS_LEFTNOWORDWRAP,15,69,54,8 - COMBOBOX IDC_SERIALSTOP,75,67,48,40,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_SERIALSTOP,75,67,62,40,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP CONTROL "&Flow control:",IDC_SERIALFLOW_LABEL,"Static",SS_LEFTNOWORDWRAP,15,84,54,8 - COMBOBOX IDC_SERIALFLOW,75,82,48,53,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_SERIALFLOW,75,82,62,53,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP GROUPBOX "Transmit delay",IDC_SERIALDELAY,41,104,152,32 LTEXT "msec/&char",IDC_SERIALDELAYCHAR_LABEL,75,118,42,10 EDITTEXT IDC_SERIALDELAYCHAR,51,116,20,12,ES_AUTOHSCROLL | ES_NUMBER LTEXT "msec/&line",IDC_SERIALDELAYLINE_LABEL,146,118,42,10 EDITTEXT IDC_SERIALDELAYLINE,122,116,20,12,ES_AUTOHSCROLL | ES_NUMBER - DEFPUSHBUTTON "OK",IDOK,138,9,87,18,BS_CENTER | BS_MULTILINE | WS_GROUP - PUSHBUTTON "Cancel",IDCANCEL,138,38,87,16,BS_CENTER - PUSHBUTTON "&Help",IDC_SERIALHELP,138,64,86,16,BS_CENTER - EDITTEXT IDC_SERIALTEXT,10,141,212,70,ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY | WS_VSCROLL | WS_HSCROLL + EDITTEXT IDC_SERIALTEXT,10,141,254,70,ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY | WS_VSCROLL | WS_HSCROLL END IDD_TCPIPDLG DIALOGEX 20, 20, 260, 189 @@ -289,7 +286,10 @@ BEGIN IDD_SERIALDLG, DIALOG BEGIN - RIGHTMARGIN, 232 + RIGHTMARGIN, 302 + VERTGUIDE, 75 + VERTGUIDE, 137 + BOTTOMMARGIN, 214 END IDD_TCPIPDLG, DIALOG