| 56 |
#include "asprintf.h" |
#include "asprintf.h" |
| 57 |
#include "win32helper.h" |
#include "win32helper.h" |
| 58 |
#include "themedlg.h" |
#include "themedlg.h" |
| 59 |
|
#include "theme.h" |
| 60 |
|
|
| 61 |
const mouse_cursor_t MouseCursor[] = { |
const mouse_cursor_t MouseCursor[] = { |
| 62 |
{"ARROW", IDC_ARROW}, |
{"ARROW", IDC_ARROW}, |
| 67 |
}; |
}; |
| 68 |
#define MOUSE_CURSOR_MAX (sizeof(MouseCursor)/sizeof(MouseCursor[0]) - 1) |
#define MOUSE_CURSOR_MAX (sizeof(MouseCursor)/sizeof(MouseCursor[0]) - 1) |
| 69 |
|
|
|
void CVisualPropPageDlg::SetupRGBbox(int index) |
|
|
{ |
|
|
COLORREF Color = ts.ANSIColor[index]; |
|
|
BYTE c; |
|
|
|
|
|
c = GetRValue(Color); |
|
|
SetDlgItemNum(IDC_COLOR_RED, c); |
|
|
|
|
|
c = GetGValue(Color); |
|
|
SetDlgItemNum(IDC_COLOR_GREEN, c); |
|
|
|
|
|
c = GetBValue(Color); |
|
|
SetDlgItemNum(IDC_COLOR_BLUE, c); |
|
|
} |
|
|
|
|
| 70 |
// CGeneralPropPageDlg ダイアログ |
// CGeneralPropPageDlg ダイアログ |
| 71 |
|
|
| 72 |
CGeneralPropPageDlg::CGeneralPropPageDlg(HINSTANCE inst) |
CGeneralPropPageDlg::CGeneralPropPageDlg(HINSTANCE inst) |
| 606 |
} |
} |
| 607 |
|
|
| 608 |
// CVisualPropPageDlg ダイアログ |
// CVisualPropPageDlg ダイアログ |
| 609 |
|
class CVisualPropPageDlg : public TTCPropertyPage |
| 610 |
|
{ |
| 611 |
|
public: |
| 612 |
|
CVisualPropPageDlg(HINSTANCE inst); |
| 613 |
|
virtual ~CVisualPropPageDlg(); |
| 614 |
|
private: |
| 615 |
|
void OnInitDialog(); |
| 616 |
|
void OnOK(); |
| 617 |
|
HBRUSH OnCtlColor(HDC hDC, HWND hWnd); |
| 618 |
|
enum { IDD = IDD_TABSHEET_VISUAL }; |
| 619 |
|
BOOL OnCommand(WPARAM wParam, LPARAM lParam); |
| 620 |
|
void OnHScroll(UINT nSBCode, UINT nPos, HWND pScrollBar); |
| 621 |
|
void SetupRGBbox(int index); |
| 622 |
|
void OnHelp(); |
| 623 |
|
CTipWin* TipWin; |
| 624 |
|
COLORREF ANSIColor[16]; |
| 625 |
|
}; |
| 626 |
|
|
| 627 |
CVisualPropPageDlg::CVisualPropPageDlg(HINSTANCE inst) |
CVisualPropPageDlg::CVisualPropPageDlg(HINSTANCE inst) |
| 628 |
: TTCPropertyPage(inst, CVisualPropPageDlg::IDD) |
: TTCPropertyPage(inst, CVisualPropPageDlg::IDD) |
| 643 |
TipWin = NULL; |
TipWin = NULL; |
| 644 |
} |
} |
| 645 |
|
|
| 646 |
|
void CVisualPropPageDlg::SetupRGBbox(int index) |
| 647 |
|
{ |
| 648 |
|
COLORREF Color = ANSIColor[index]; |
| 649 |
|
BYTE c; |
| 650 |
|
|
| 651 |
|
c = GetRValue(Color); |
| 652 |
|
SetDlgItemNum(IDC_COLOR_RED, c); |
| 653 |
|
|
| 654 |
|
c = GetGValue(Color); |
| 655 |
|
SetDlgItemNum(IDC_COLOR_GREEN, c); |
| 656 |
|
|
| 657 |
|
c = GetBValue(Color); |
| 658 |
|
SetDlgItemNum(IDC_COLOR_BLUE, c); |
| 659 |
|
} |
| 660 |
|
|
| 661 |
// CVisualPropPageDlg メッセージ ハンドラ |
// CVisualPropPageDlg メッセージ ハンドラ |
| 662 |
|
|
| 663 |
void CVisualPropPageDlg::OnInitDialog() |
void CVisualPropPageDlg::OnInitDialog() |
| 755 |
} |
} |
| 756 |
|
|
| 757 |
// (5)ANSI color |
// (5)ANSI color |
| 758 |
|
for (int i = 0; i < 16; i++) { |
| 759 |
|
ANSIColor[i] = ts.ANSIColor[i]; |
| 760 |
|
} |
| 761 |
for (int i = 0 ; i < 16 ; i++) { |
for (int i = 0 ; i < 16 ; i++) { |
| 762 |
char buf[4]; |
char buf[4]; |
| 763 |
_snprintf_s(buf, sizeof(buf), _TRUNCATE, "%d", i); |
_snprintf_s(buf, sizeof(buf), _TRUNCATE, "%d", i); |
| 939 |
int r, g, b; |
int r, g, b; |
| 940 |
|
|
| 941 |
sel = GetCurSel(IDC_ANSI_COLOR); |
sel = GetCurSel(IDC_ANSI_COLOR); |
| 942 |
if (sel < 0 || sel > _countof(ts.ANSIColor)-1) { |
if (sel < 0 || sel > _countof(ANSIColor)-1) { |
| 943 |
return TRUE; |
return TRUE; |
| 944 |
} |
} |
| 945 |
|
|
| 973 |
SetDlgItemNum(IDC_COLOR_BLUE, b); |
SetDlgItemNum(IDC_COLOR_BLUE, b); |
| 974 |
} |
} |
| 975 |
|
|
| 976 |
// OK を押さなくても設定が保存されている |
ANSIColor[sel] = RGB(r, g, b); |
|
ts.ANSIColor[sel] = RGB(r, g, b); |
|
| 977 |
|
|
| 978 |
::InvalidateRect(GetDlgItem(IDC_SAMPLE_COLOR), NULL, TRUE); |
::InvalidateRect(GetDlgItem(IDC_SAMPLE_COLOR), NULL, TRUE); |
| 979 |
} |
} |
| 1162 |
ts.EtermLookfeel.BGFastSizeMove = GetCheck(IDC_CHECK_FAST_SIZE_MOVE); |
ts.EtermLookfeel.BGFastSizeMove = GetCheck(IDC_CHECK_FAST_SIZE_MOVE); |
| 1163 |
ts.EtermLookfeel.BGNoCopyBits = GetCheck(IDC_CHECK_FLICKER_LESS_MOVE); |
ts.EtermLookfeel.BGNoCopyBits = GetCheck(IDC_CHECK_FLICKER_LESS_MOVE); |
| 1164 |
|
|
| 1165 |
|
// ANSI Color |
| 1166 |
|
TColorTheme color; |
| 1167 |
|
// 色(デフォルト色)を設定 |
| 1168 |
|
for (i = 0; i < 16; i++) { |
| 1169 |
|
ts.ANSIColor[i] = ANSIColor[i]; |
| 1170 |
|
} |
| 1171 |
|
// デフォルト色を設定する |
| 1172 |
|
ThemeGetColorDefault(&color); |
| 1173 |
|
ThemeSetColor(&color); |
| 1174 |
|
|
| 1175 |
if (flag_changed) { |
if (flag_changed) { |
| 1176 |
// re-launch |
// re-launch |
| 1177 |
// RestartTeraTerm(GetSafeHwnd(), &ts); |
// RestartTeraTerm(GetSafeHwnd(), &ts); |