-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCfg_othr.cpp
More file actions
137 lines (122 loc) · 3.63 KB
/
Cfg_othr.cpp
File metadata and controls
137 lines (122 loc) · 3.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
// cfg_othr.cpp : implementation file
// IDD_CFG_OTHERS
#include "stdafx.h"
#include "resource.h"
#include "cfg_othr.h"
#include "lightdlg.h"
#include "structs.h"
#include "detmail.h"
#include "floating.h"
#ifdef _DEBUG
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif
extern LangID LANG_ID;
extern CLightDlg *gpMain;
extern detmail gMailer;
extern floating gFloating;
extern _gconfig gc;
static char DlgName[]="IDD_CFG_OTHERS";
// ==============================================
cfg_oth::cfg_oth(CWnd* pParent ) : CSAPrefsSubDlg(cfg_oth::IDD, pParent)
// ==============================================
, m_mintotray(FALSE)
{
//{{AFX_DATA_INIT(cfg_oth)
m_convert_latin = FALSE;
m_hidecmd = FALSE;
m_no_reminder = FALSE;
m_notooltips = FALSE;
// m_blink_scroll = FALSE;
//}}AFX_DATA_INIT
}
// ==============================================
void cfg_oth::DoDataExchange(CDataExchange* pDX)
// ==============================================
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(cfg_oth)
DDX_Check(pDX, IDC_CONVERT_LATIN, m_convert_latin);
DDX_Check(pDX, IDC_HIDE_CMD_WINDOW, m_hidecmd);
DDX_Check(pDX, IDC_NO_NL_REMINDER, m_no_reminder);
DDX_Check(pDX, IDC_NO_TOOLTIPS, m_notooltips);
// DDX_Check(pDX, IDC_ROLLEN_LIGHT, m_blink_scroll);
//}}AFX_DATA_MAP
DDX_Check(pDX, IDC_MINTOTRAY, m_mintotray);
}
BEGIN_MESSAGE_MAP(cfg_oth, CDialog)
//{{AFX_MSG_MAP(cfg_oth)
ON_BN_CLICKED(IDHELP, OnHelp)
ON_WM_HELPINFO()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
// =====================================================================
LPCSTR cfg_oth::GetName(void) {return DlgName;}
// =====================================================================
// ==============================================
BOOL cfg_oth::OnInitDialog()
// ==============================================
{
int lng[]={
IDC_NO_TOOLTIPS,
IDC_ROLLEN_LIGHT,
IDC_CONVERT_LATIN,
IDC_NO_NL_REMINDER,
IDC_HIDE_CMD_WINDOW,
IDC_MINTOTRAY
};
CDialog::OnInitDialog();
set_dlg_language(this,DlgName,lng,sizeof(lng)/sizeof(int));
m_notooltips=get_cfg(CFG_COMMON,"NoTooltips",0);
m_blink_scroll=get_cfg(CFG_COMMON,"NoBlinkScrollLock",0);
m_no_reminder=get_cfg(CFG_COMMON,"NoNLReminder",0);
m_hidecmd=get_cfg(CFG_COMMON,"HideCmdWin",0);
m_mintotray=get_cfg(CFG_COMMON,"MinToTray",0);
if (LANG_ID==LANG_GER) // only for Germans
{
m_convert_latin=get_cfg(CFG_COMMON,"ConvertLatin",0);
GetDlgItem(IDC_CONVERT_LATIN)->ShowWindow(SW_SHOWNORMAL);
}
else
{
m_convert_latin=0;
GetDlgItem(IDC_CONVERT_LATIN)->ShowWindow(SW_HIDE);
}
UpdateData(0);
return TRUE;
}
// ==============================================
void cfg_oth::OnOK()
// ==============================================
{
UpdateData(1);
gc.NoBlinkScrollLock=m_blink_scroll;
set_cfg(CFG_COMMON,"NoBlinkScrollLock",gc.NoBlinkScrollLock);
gc.NoTooltips=m_notooltips;
set_cfg(CFG_COMMON,"NoTooltips",gc.NoTooltips);
set_cfg(CFG_COMMON,"ConvertLatin",m_convert_latin);
set_cfg(CFG_COMMON,"NoNLReminder",m_no_reminder);
set_cfg(CFG_COMMON,"HideCmdWin",m_hidecmd);
gc.MinToTray=m_mintotray;
set_cfg(CFG_COMMON,"MinToTray",gc.MinToTray);
gpMain->EnableToolTips();
gpMain->tip.Activate(!gc.NoTooltips);
gFloating.EnableToolTips(!gc.NoTooltips);
gFloating.tip.Activate(!gc.NoTooltips);
gMailer.tip.Activate(!gc.NoTooltips);
if(m_bCloseOnOk)
CDialog::OnOK();
}
// ==============================================
void cfg_oth::OnHelp()
// ==============================================
{
WinHelp(VHELP_CFG_OTHERS);
}
// ==============================================
BOOL cfg_oth::OnHelpInfo(HELPINFO* pHelpInfo)
// ==============================================
{
OnHelp();
return TRUE;
}