dlg.m_strParam = strutils::to_str(nRealLine + 1);
dlg.m_nFile = (pDoc->m_nBuffers < 3) ? (m_nThisPane == 1 ? 2 : 0) : m_nThisPane;
dlg.m_nGotoWhat = 0;
+ dlg.m_nFiles = pDoc->m_nBuffers;
if (dlg.DoModal() == IDOK)
{
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(WMGotoDlg)
protected:
+ virtual BOOL OnInitDialog() override;
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
{
}
+/**
+ * @brief Initialize the dialog.
+ * @return Always TRUE.
+ */
+BOOL WMGotoDlg::Impl::OnInitDialog()
+{
+ LangTranslateDialog(m_hWnd);
+ CDialog::OnInitDialog();
+
+ if (m_p->m_nFiles < 3)
+ EnableDlgItem(IDC_WMGOTO_FILEMIDDLE, false);
+
+ return TRUE;
+}
+
void WMGotoDlg::Impl::DoDataExchange(CDataExchange* pDX)
{
CTrDialog::DoDataExchange(pDX);
WMGotoDlg::WMGotoDlg()
- : m_pimpl(new WMGotoDlg::Impl(this)), m_nFile(-1), m_nGotoWhat(-1) {}
+ : m_pimpl(new WMGotoDlg::Impl(this)), m_nFile(-1), m_nGotoWhat(-1), m_nFiles(-1) {}
WMGotoDlg::~WMGotoDlg() = default;
int WMGotoDlg::DoModal() { return static_cast<int>(m_pimpl->DoModal()); }
String m_strParam; /**< Line/difference number. */
int m_nFile; /**< Target file number. */
int m_nGotoWhat; /**< Goto line or difference? */
+ int m_nFiles; /**< Number of files being compared. */
private:
WMGotoDlg(const WMGotoDlg &) = delete;
WMGotoDlg & operator=(const WMGotoDlg &) = delete;