*
* @brief Implementation of PropEditor propertysheet
*/
-// ID line follows -- this is updated by SVN
-// $Id$
#include "stdafx.h"
-#include "merge.h"
#include "PropEditor.h"
#include "OptionsDef.h"
#include "OptionsMgr.h"
#include "OptionsPanel.h"
-#include "DDXHelper.h"
#ifdef _DEBUG
#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
#endif
/** @brief Maximum size for tabs in spaces. */
, m_nTabSize(0)
, m_bAutomaticRescan(false)
, m_bAllowMixedEol(false)
+, m_bCopyFullLine(false)
, m_bViewLineDifferences(false)
, m_bBreakOnWords(false)
, m_nBreakType(0)
+, m_nRenderingMode(0)
{
}
DDX_Check(pDX, IDC_HILITE_CHECK, m_bHiliteSyntax);
DDX_Radio(pDX, IDC_PROP_INSERT_TABS, m_nTabType);
DDX_Text(pDX, IDC_TAB_EDIT, m_nTabSize);
+ DDV_MaxChars(pDX, std::to_string(m_nTabSize).c_str(), 2);
DDX_Check(pDX, IDC_AUTOMRESCAN_CHECK, m_bAutomaticRescan);
DDX_Check(pDX, IDC_MIXED_EOL, m_bAllowMixedEol);
+ // m_bCopyFullLine currently is only a hidden option
+ // > it is used here in PropEditor.cpp, because otherwise it doesn't get saved to the registry
DDX_Check(pDX, IDC_VIEW_LINE_DIFFERENCES, m_bViewLineDifferences);
DDX_Radio(pDX, IDC_EDITOR_CHARLEVEL, m_bBreakOnWords);
DDX_CBIndex(pDX, IDC_BREAK_TYPE, m_nBreakType);
DDX_Text(pDX, IDC_BREAK_CHARS, m_breakChars);
+ DDX_CBIndex(pDX, IDC_RENDERING_MODE, m_nRenderingMode);
//}}AFX_DATA_MAP
}
-BEGIN_MESSAGE_MAP(PropEditor, CDialog)
+BEGIN_MESSAGE_MAP(PropEditor, OptionsPanel)
//{{AFX_MSG_MAP(PropEditor)
ON_BN_CLICKED(IDC_VIEW_LINE_DIFFERENCES, OnLineDiffControlClicked)
ON_BN_CLICKED(IDC_EDITOR_CHARLEVEL, OnLineDiffControlClicked)
m_bAutomaticRescan = GetOptionsMgr()->GetBool(OPT_AUTOMATIC_RESCAN);
m_bHiliteSyntax = GetOptionsMgr()->GetBool(OPT_SYNTAX_HIGHLIGHT);
m_bAllowMixedEol = GetOptionsMgr()->GetBool(OPT_ALLOW_MIXED_EOL);
+ m_bCopyFullLine = GetOptionsMgr()->GetBool(OPT_COPY_FULL_LINE);
m_bViewLineDifferences = GetOptionsMgr()->GetBool(OPT_WORDDIFF_HIGHLIGHT);
m_bBreakOnWords = GetOptionsMgr()->GetBool(OPT_BREAK_ON_WORDS);
m_nBreakType = GetOptionsMgr()->GetInt(OPT_BREAK_TYPE);
- m_breakChars = GetOptionsMgr()->GetString(OPT_BREAK_SEPARATORS).c_str();
+ m_breakChars = GetOptionsMgr()->GetString(OPT_BREAK_SEPARATORS);
+ m_nRenderingMode = GetOptionsMgr()->GetInt(OPT_RENDERING_MODE) + 1;
}
/**
GetOptionsMgr()->SaveOption(OPT_TAB_TYPE, (int)m_nTabType);
GetOptionsMgr()->SaveOption(OPT_AUTOMATIC_RESCAN, m_bAutomaticRescan);
GetOptionsMgr()->SaveOption(OPT_ALLOW_MIXED_EOL, m_bAllowMixedEol);
+ GetOptionsMgr()->SaveOption(OPT_COPY_FULL_LINE, m_bCopyFullLine);
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_WORDDIFF_HIGHLIGHT, m_bViewLineDifferences);
+ GetOptionsMgr()->SaveOption(OPT_BREAK_ON_WORDS, m_bBreakOnWords);
GetOptionsMgr()->SaveOption(OPT_BREAK_TYPE, m_nBreakType);
GetOptionsMgr()->SaveOption(OPT_BREAK_SEPARATORS, String(m_breakChars));
+ GetOptionsMgr()->SaveOption(OPT_RENDERING_MODE, m_nRenderingMode - 1);
}
/**
*/
BOOL PropEditor::OnInitDialog()
{
- theApp.TranslateDialog(m_hWnd);
- CPropertyPage::OnInitDialog();
+ OptionsPanel::OnInitDialog();
- CEdit * pEdit = (CEdit *) GetDlgItem(IDC_TAB_EDIT);
-
- // Limit max text of tabsize to 2 chars
- if (pEdit != NULL)
- pEdit->SetLimitText(2);
-
- LoadBreakTypeStrings();
+ LoadComboBoxStrings();
UpdateDataToWindow();
UpdateLineDiffControls();
+#ifndef _WIN64
+ EnableDlgItem(IDC_RENDERING_MODE, false);
+#endif
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
/**
* @brief Load strings (from resource) into combobox for break type
*/
-void PropEditor::LoadBreakTypeStrings()
+void PropEditor::LoadComboBoxStrings()
{
CComboBox * cbo = (CComboBox *)GetDlgItem(IDC_BREAK_TYPE);
cbo->AddString(_("Break at whitespace").c_str());
cbo->AddString(_("Break at whitespace or punctuation").c_str());
+ cbo = (CComboBox *)GetDlgItem(IDC_RENDERING_MODE);
+ cbo->AddString(_("GDI").c_str());
+ cbo->AddString(_("DirectWrite Default").c_str());
+ cbo->AddString(_("DirectWrite Aliased").c_str());
+ cbo->AddString(_("DirectWrite GDI Classic").c_str());
+ cbo->AddString(_("DirectWrite GDI Natural").c_str());
+ cbo->AddString(_("DirectWrite Natural").c_str());
+ cbo->AddString(_("DirectWrite Natural Symmetric").c_str());
}
/**
UpdateLineDiffControls();
}
-/**
- * @brief Shortcut to enable or disable a control
- * @param [in] item ID of dialog control to enable/disable.
- * @param [in] enable if true control is enabled, else disabled.
- */
-void PropEditor::EnableDlgItem(int item, bool enable)
-{
- GetDlgItem(item)->EnableWindow(!!enable);
-}
-
/**
* @brief Update availability of line difference controls
*/
{
UpdateDataFromWindow();
// Can only choose char/word level if line differences are enabled
- EnableDlgItem(IDC_EDITOR_CHARLEVEL, !!m_bViewLineDifferences);
- EnableDlgItem(IDC_EDITOR_WORDLEVEL, !!m_bViewLineDifferences);
+ EnableDlgItem(IDC_EDITOR_CHARLEVEL, m_bViewLineDifferences);
+ EnableDlgItem(IDC_EDITOR_WORDLEVEL, m_bViewLineDifferences);
// Can only choose break type if line differences are enabled & we're breaking on words
- EnableDlgItem(IDC_BREAK_TYPE, !!m_bViewLineDifferences);
+ EnableDlgItem(IDC_BREAK_TYPE, m_bViewLineDifferences);
}
/**
*/
void PropEditor::OnEnKillfocusTabEdit()
{
- CEdit * pEdit = (CEdit *)GetDlgItem(IDC_TAB_EDIT);
- String valueAsText;
- pEdit->GetWindowText(PopString(valueAsText));
- int value = 0;
- try { value = string_stoi(valueAsText); } catch (...) {};
+ unsigned value = GetDlgItemInt(IDC_TAB_EDIT);
if (value < 1 || value > MAX_TABSIZE)
{
- String msg = string_format_string1(
+ String msg = strutils::format_string1(
_("Value in Tab size -field is not in range WinMerge accepts.\n\nPlease use values 1 - %1."),
- string_to_str(MAX_TABSIZE));
+ strutils::to_str(MAX_TABSIZE));
AfxMessageBox(msg.c_str(), MB_ICONWARNING);
}
}