#include "OptionsDef.h"
#include "OptionsMgr.h"
#include "OptionsPanel.h"
+#include "DDXHelper.h"
#ifdef _DEBUG
#define new DEBUG_NEW
*/
PropEditor::PropEditor(COptionsMgr *optionsMgr)
: OptionsPanel(optionsMgr, PropEditor::IDD)
-, m_bHiliteSyntax(FALSE)
+, m_bHiliteSyntax(false)
, m_nTabType(-1)
, m_nTabSize(0)
-, m_bAutomaticRescan(FALSE)
-, m_bAllowMixedEol(FALSE)
-, m_bViewLineDifferences(FALSE)
-, m_bBreakOnWords(FALSE)
+, m_bAutomaticRescan(false)
+, m_bAllowMixedEol(false)
+, m_bViewLineDifferences(false)
+, m_bBreakOnWords(false)
, m_nBreakType(0)
{
}
m_nTabSize = MAX_TABSIZE;
GetOptionsMgr()->SaveOption(OPT_TAB_SIZE, (int)m_nTabSize);
GetOptionsMgr()->SaveOption(OPT_TAB_TYPE, (int)m_nTabType);
- GetOptionsMgr()->SaveOption(OPT_AUTOMATIC_RESCAN, m_bAutomaticRescan == TRUE);
- GetOptionsMgr()->SaveOption(OPT_ALLOW_MIXED_EOL, m_bAllowMixedEol == TRUE);
- GetOptionsMgr()->SaveOption(OPT_SYNTAX_HIGHLIGHT, m_bHiliteSyntax == TRUE);
+ GetOptionsMgr()->SaveOption(OPT_AUTOMATIC_RESCAN, m_bAutomaticRescan);
+ GetOptionsMgr()->SaveOption(OPT_ALLOW_MIXED_EOL, m_bAllowMixedEol);
+ GetOptionsMgr()->SaveOption(OPT_SYNTAX_HIGHLIGHT, m_bHiliteSyntax);
GetOptionsMgr()->SaveOption(OPT_WORDDIFF_HIGHLIGHT, !!m_bViewLineDifferences);
GetOptionsMgr()->SaveOption(OPT_BREAK_ON_WORDS, !!m_bBreakOnWords);
GetOptionsMgr()->SaveOption(OPT_BREAK_TYPE, m_nBreakType);
void PropEditor::LoadBreakTypeStrings()
{
CComboBox * cbo = (CComboBox *)GetDlgItem(IDC_BREAK_TYPE);
- cbo->AddString(theApp.LoadString(IDS_BREAK_ON_WHITESPACE).c_str());
- cbo->AddString(theApp.LoadString(IDS_BREAK_ON_PUNCTUATION).c_str());
+ cbo->AddString(_("Break at whitespace").c_str());
+ cbo->AddString(_("Break at whitespace or punctuation").c_str());
}
/**
void PropEditor::OnEnKillfocusTabEdit()
{
CEdit * pEdit = (CEdit *)GetDlgItem(IDC_TAB_EDIT);
- CString valueAsText;
- pEdit->GetWindowText(valueAsText);
- int value = _ttoi(valueAsText);
-
+ String valueAsText;
+ pEdit->GetWindowText(PopString(valueAsText));
+ int value = 0;
+ try { value = string_stoi(valueAsText); } catch (...) {};
if (value < 1 || value > MAX_TABSIZE)
{
- String num = string_format(_T("%d"), MAX_TABSIZE);
- String msg = LangFormatString1(IDS_OPTIONS_INVALID_TABSIZE, num.c_str());
+ String msg = string_format_string1(
+ _("Value in Tab size -field is not in range WinMerge accepts.\n\nPlease use values 1 - %1."),
+ string_to_str(MAX_TABSIZE));
AfxMessageBox(msg.c_str(), MB_ICONWARNING);
}
}