Develop and Download Open Source Software

Browse Subversion Repository

Annotation of /branches/ttcomtester/teraterm/teraterm/debug_pp.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 8771 - (hide annotations) (download) (as text)
Tue May 12 14:32:44 2020 UTC (3 years, 11 months ago) by zmatsuo
Original Path: trunk/teraterm/teraterm/debug_pp.cpp
File MIME type: text/x-c++src
File size: 4177 byte(s)
fontプロパティーページ追加

- Unicode/ANSI API切り替え
  - ANSI API使用時、文字コード変換に使用するコードページを変更できる
  - debugプロパティーページのUnicode/ANSI API切り替えを削除
- VTfont切り替えはすぐに設定に反映する
  - 今の所、[設定]/[フォント] から切り替えたときと同じ動作
- ANSI API利用時
  - 表示できない文字を表示
    - 半角時 '?'
    - 全角時 '?_'
- 未実装
  - フォント間
  - プロポーショナルフォント
1 doda 8445 /*
2 zmatsuo 8750 * (C) 2019-2020 TeraTerm Project
3 doda 8445 * All rights reserved.
4     *
5     * Redistribution and use in source and binary forms, with or without
6     * modification, are permitted provided that the following conditions
7     * are met:
8     *
9     * 1. Redistributions of source code must retain the above copyright
10     * notice, this list of conditions and the following disclaimer.
11     * 2. Redistributions in binary form must reproduce the above copyright
12     * notice, this list of conditions and the following disclaimer in the
13     * documentation and/or other materials provided with the distribution.
14     * 3. The name of the author may not be used to endorse or promote products
15     * derived from this software without specific prior written permission.
16     *
17     * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
18     * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19     * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20     * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
21     * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22     * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23     * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24     * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25     * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26     * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27     */
28    
29     /* debug property page */
30    
31     #include <stdio.h>
32    
33     #include "tmfc.h"
34     #include "tt_res.h"
35     #include "debug_pp.h"
36     #include "../common/tt_res.h"
37     #include "unicode_test.h"
38     #include "dlglib.h"
39     #include "compat_win.h"
40 zmatsuo 8749 #include "setting.h"
41 doda 8445
42 zmatsuo 8761 CDebugPropPage::CDebugPropPage(HINSTANCE inst)
43     : TTCPropertyPage(inst, IDD_TABSHEET_DEBUG)
44 doda 8445 {
45     }
46    
47     CDebugPropPage::~CDebugPropPage()
48     {
49     }
50    
51     static const struct {
52     WORD key_code;
53     const char *key_str;
54     } key_list[] = {
55     {VK_CONTROL, "VT_CONTROL"},
56     {VK_SHIFT, "VK_SHIFT"},
57     };
58    
59     void CDebugPropPage::OnInitDialog()
60     {
61     // popup
62     SetCheck(IDC_DEBUG_POPUP_ENABLE, UnicodeDebugParam.CodePopupEnable);
63 zmatsuo 8467 for (int i = 0; i < (int)_countof(key_list); i++) {
64 doda 8445 SendDlgItemMessage(IDC_DEBUG_POPUP_KEY1, CB_ADDSTRING, 0, (LPARAM)key_list[i].key_str);
65     SendDlgItemMessage(IDC_DEBUG_POPUP_KEY2, CB_ADDSTRING, 0, (LPARAM)key_list[i].key_str);
66     if (UnicodeDebugParam.CodePopupKey1 == key_list[i].key_code) {
67     SendDlgItemMessageA(IDC_DEBUG_POPUP_KEY1, CB_SETCURSEL, i, 0);
68     }
69     if (UnicodeDebugParam.CodePopupKey2 == key_list[i].key_code) {
70     SendDlgItemMessageA(IDC_DEBUG_POPUP_KEY2, CB_SETCURSEL, i, 0);
71     }
72     }
73    
74     // console button
75     const char *caption;
76     HWND hWnd = pGetConsoleWindow();
77     if (hWnd == NULL) {
78     caption = "Open console window";
79     } else {
80     if (::IsWindowVisible(hWnd)) {
81     caption = "Hide console window";
82     } else {
83     caption = "Show console window";
84     }
85     }
86     SetDlgItemTextA(IDC_DEBUG_CONSOLE_BUTTON, caption);
87     }
88    
89     BOOL CDebugPropPage::OnCommand(WPARAM wParam, LPARAM)
90     {
91     switch (wParam) {
92     case IDC_DEBUG_CONSOLE_BUTTON | (BN_CLICKED << 16): {
93     const char *caption;
94     HWND hWnd = pGetConsoleWindow();
95     if (hWnd == NULL) {
96     FILE *fp;
97     AllocConsole();
98     freopen_s(&fp, "CONOUT$", "w", stdout);
99     freopen_s(&fp, "CONOUT$", "w", stderr);
100     caption = "Hide console window";
101     hWnd = pGetConsoleWindow();
102     HMENU hmenu = GetSystemMenu(hWnd, FALSE);
103     RemoveMenu(hmenu, SC_CLOSE, MF_BYCOMMAND);
104     }
105     else {
106     if (::IsWindowVisible(hWnd)) {
107     ::ShowWindow(hWnd, SW_HIDE);
108     caption = "Show console window";
109     }
110     else {
111     ::ShowWindow(hWnd, SW_SHOW);
112     caption = "Hide console window";
113     }
114     }
115     SetDlgItemTextA(IDC_DEBUG_CONSOLE_BUTTON, caption);
116     break;
117     }
118     default:
119     break;
120     }
121     return FALSE;
122     }
123    
124     void CDebugPropPage::OnOK()
125     {
126     UnicodeDebugParam.CodePopupEnable = GetCheck(IDC_DEBUG_POPUP_ENABLE);
127     int i = GetCurSel(IDC_DEBUG_POPUP_KEY1);
128     UnicodeDebugParam.CodePopupKey1 = key_list[i].key_code;
129     i = GetCurSel(IDC_DEBUG_POPUP_KEY2);
130     UnicodeDebugParam.CodePopupKey2 = key_list[i].key_code;
131     }

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26