Skip to content

Commit

Permalink
Terminal setup ダイアログに coding タブへのショートカットを追加 #84
Browse files Browse the repository at this point in the history
  • Loading branch information
zmatsuo committed Apr 20, 2024
1 parent bb8c98e commit 415c5f3
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 16 deletions.
1 change: 1 addition & 0 deletions teraterm/common/tt_res.h
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@
#define ID_SETUP_TCPIP 50360
#define ID_SETUP_GENERAL 50370
#define ID_SETUP_ADDITIONALSETTINGS 50375
#define ID_SETUP_ADDITIONALSETTINGS_CODING 50376
#define ID_SETUP_SAVE 50380
#define ID_SETUP_RESTORE 50390
#define ID_OPEN_SETUP 50391
Expand Down
14 changes: 13 additions & 1 deletion teraterm/teraterm/addsetting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1970,6 +1970,18 @@ CAddSettingPropSheetDlg::~CAddSettingPropSheetDlg()

void CAddSettingPropSheetDlg::SetStartPage(Page page)
{
int start_page = page == DefaultPage ? 0: 7;
int start_page;
switch (page) {
case DefaultPage:
default:
start_page = 0;
break;
case CodingPage:
start_page = 6;
break;
case FontPage:
start_page = 7;
break;
}
TTCPropSheetDlg::SetStartPage(start_page);
}
1 change: 1 addition & 0 deletions teraterm/teraterm/addsetting.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ class CAddSettingPropSheetDlg: public TTCPropSheetDlg
~CAddSettingPropSheetDlg();
enum Page {
DefaultPage,
CodingPage,
FontPage,
};
void SetStartPage(Page page);
Expand Down
12 changes: 7 additions & 5 deletions teraterm/teraterm/vtwin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4235,16 +4235,14 @@ void CVTWindow::OnEditCancelSelection()
ChangeSelectRegion();
}

void CVTWindow::OpenExternalSetup(int page)
void CVTWindow::OpenExternalSetup(CAddSettingPropSheetDlg::Page page)
{
CAddSettingPropSheetDlg::Page additional_page =
page == 0 ? CAddSettingPropSheetDlg::DefaultPage : CAddSettingPropSheetDlg::FontPage;
BOOL old_use_unicode_api = UnicodeDebugParam.UseUnicodeApi;
SetDialogFont(ts.DialogFontNameW, ts.DialogFontPoint, ts.DialogFontCharSet,
ts.UILanguageFileW, "Tera Term", "DLG_TAHOMA_FONT");
CAddSettingPropSheetDlg CAddSetting(m_hInst, HVTWin);
CAddSetting.SetTreeViewMode(ts.ExperimentalTreeProprtySheetEnable);
CAddSetting.SetStartPage(additional_page);
CAddSetting.SetStartPage(page);
INT_PTR ret = CAddSetting.DoModal();
if (ret == IDOK) {
ChangeWin();
Expand All @@ -4265,7 +4263,7 @@ void CVTWindow::OpenExternalSetup(int page)
// (2008.5.12 maya) changed to PropertySheet
void CVTWindow::OnExternalSetup()
{
OpenExternalSetup(0);
OpenExternalSetup(CAddSettingPropSheetDlg::DefaultPage);
}

void CVTWindow::OnSetupTerminal()
Expand Down Expand Up @@ -5325,6 +5323,10 @@ LRESULT CVTWindow::Proc(UINT msg, WPARAM wp, LPARAM lp)
case ID_EDIT_SELECTALL: OnEditSelectAllBuffer(); break;
case ID_EDIT_SELECTSCREEN: OnEditSelectScreenBuffer(); break;
case ID_SETUP_ADDITIONALSETTINGS: OnExternalSetup(); break;
case ID_SETUP_ADDITIONALSETTINGS_CODING: {
OpenExternalSetup(CAddSettingPropSheetDlg::CodingPage);
break;
}
case ID_SETUP_TERMINAL: OnSetupTerminal(); break;
case ID_SETUP_WINDOW: OnSetupWindow(); break;
case ID_SETUP_FONT: OnSetupFont(); break;
Expand Down
3 changes: 2 additions & 1 deletion teraterm/teraterm/vtwin.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include "tmfc.h"
#include "unicode_test.h"
#include "tipwin.h"
#include "addsetting.h"

class CVTWindow : public TTCFrameWnd
{
Expand Down Expand Up @@ -237,7 +238,7 @@ class CVTWindow : public TTCFrameWnd

private:
void CodePopup(int client_x, int client_y);
void OpenExternalSetup(int page);
void OpenExternalSetup(CAddSettingPropSheetDlg::Page page);
void SetColor();
};
#endif
Expand Down
8 changes: 4 additions & 4 deletions teraterm/ttpdlg/dlg_res.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,12 @@
#define IDC_WINLISTLIST 1201
#define IDC_WINLISTCLOSE 1202
#define IDC_WINLISTHELP 1299
#define IDC_STATIC -1
#define IDC_GENLANUI_LABEL -1
#define IDC_GENLANGUI_LABEL -1
#define IDC_GENLANUI_LABEL 1300
#define IDC_GENLANGUI_LABEL 1301
#define IDC_OPEN_CODING 1302

// Next default values for new objects
//
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NO_MFC 1
Expand Down
5 changes: 5 additions & 0 deletions teraterm/ttpdlg/termdlg.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
#include "ttlib_charset.h"
#include "asprintf.h"
#include "ttwinman.h"
#include "tttext.h"
#include "tt_res.h"

#include "ttdlg.h"

Expand Down Expand Up @@ -227,6 +229,9 @@ static INT_PTR CALLBACK TermDlg(HWND Dialog, UINT Message, WPARAM wParam, LPARAM
SetDropDownList(Dialog, IDC_TERMKOUT, kanji_out_list, n);
}
}

TTTextMenu(Dialog, IDC_OPEN_CODING, NULL, HVTWin, ID_SETUP_ADDITIONALSETTINGS_CODING);

CenterWindow(Dialog, GetParent(Dialog));
return TRUE;
}
Expand Down
8 changes: 3 additions & 5 deletions teraterm/ttpdlg/ttpdlg.rc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ END
// Dialog
//

IDD_TERMDLG DIALOGEX 20, 20, 254, 139
IDD_TERMDLG DIALOGEX 20, 20, 254, 152
STYLE DS_SETFONT | DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Tera Term: Terminal setup"
FONT 14, "System", 0, 0, 0x0
Expand Down Expand Up @@ -88,6 +88,7 @@ BEGIN
DEFPUSHBUTTON "OK",IDOK,209,10,40,14,WS_GROUP
PUSHBUTTON "Cancel",IDCANCEL,209,30,40,14
PUSHBUTTON "&Help",IDC_TERMHELP,209,54,40,14
LTEXT "Click to open coding tab in Additional Settings dialog",IDC_OPEN_CODING,7,140,242,8
END

IDD_SERIALDLG DIALOGEX 20, 20, 234, 214
Expand Down Expand Up @@ -307,13 +308,10 @@ END
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO
BEGIN
IDD_TERMDLGK, DIALOG
BEGIN
END

IDD_TERMDLG, DIALOG
BEGIN
RIGHTMARGIN, 249
BOTTOMMARGIN, 148
END

IDD_SERIALDLG, DIALOG
Expand Down

0 comments on commit 415c5f3

Please sign in to comment.