2007-03-27 17:47:10 +00:00
|
|
|
/*
|
|
|
|
* CiderPress
|
|
|
|
* Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved.
|
|
|
|
* See the file LICENSE for distribution terms.
|
|
|
|
*/
|
|
|
|
/*
|
|
|
|
* Support for EditCommentDialog.
|
|
|
|
*/
|
|
|
|
#include "stdafx.h"
|
|
|
|
#include "EditCommentDialog.h"
|
|
|
|
#include "HelpTopics.h"
|
|
|
|
|
|
|
|
BEGIN_MESSAGE_MAP(EditCommentDialog, CDialog)
|
2014-11-03 16:26:53 -08:00
|
|
|
ON_BN_CLICKED(IDC_COMMENT_DELETE, OnDelete)
|
|
|
|
ON_WM_HELPINFO()
|
|
|
|
ON_COMMAND(IDHELP, OnHelp)
|
2007-03-27 17:47:10 +00:00
|
|
|
END_MESSAGE_MAP()
|
|
|
|
|
|
|
|
|
2014-11-21 13:18:20 -08:00
|
|
|
BOOL EditCommentDialog::OnInitDialog(void)
|
2007-03-27 17:47:10 +00:00
|
|
|
{
|
2014-11-21 13:18:20 -08:00
|
|
|
/*
|
|
|
|
* If this is a new comment, don't show the delete button.
|
|
|
|
*/
|
2014-11-03 16:26:53 -08:00
|
|
|
if (fNewComment) {
|
|
|
|
CWnd* pWnd = GetDlgItem(IDC_COMMENT_DELETE);
|
|
|
|
pWnd->EnableWindow(FALSE);
|
|
|
|
}
|
2007-03-27 17:47:10 +00:00
|
|
|
|
2014-11-03 16:26:53 -08:00
|
|
|
return CDialog::OnInitDialog();
|
2007-03-27 17:47:10 +00:00
|
|
|
}
|
|
|
|
|
2014-11-21 13:18:20 -08:00
|
|
|
void EditCommentDialog::DoDataExchange(CDataExchange* pDX)
|
2007-03-27 17:47:10 +00:00
|
|
|
{
|
2014-11-03 16:26:53 -08:00
|
|
|
DDX_Text(pDX, IDC_COMMENT_EDIT, fComment);
|
2007-03-27 17:47:10 +00:00
|
|
|
}
|
|
|
|
|
2014-11-21 13:18:20 -08:00
|
|
|
void EditCommentDialog::OnDelete(void)
|
2007-03-27 17:47:10 +00:00
|
|
|
{
|
2014-11-03 16:26:53 -08:00
|
|
|
CString question, title;
|
|
|
|
int result;
|
2007-03-27 17:47:10 +00:00
|
|
|
|
2014-11-03 16:26:53 -08:00
|
|
|
title.LoadString(IDS_EDIT_COMMENT);
|
|
|
|
question.LoadString(IDS_DEL_COMMENT_OK);
|
|
|
|
result = MessageBox(question, title, MB_OKCANCEL | MB_ICONQUESTION);
|
|
|
|
if (result == IDCANCEL)
|
|
|
|
return;
|
2007-03-27 17:47:10 +00:00
|
|
|
|
2014-11-03 16:26:53 -08:00
|
|
|
EndDialog(kDeleteCommentID);
|
2007-03-27 17:47:10 +00:00
|
|
|
}
|
|
|
|
|
2014-11-21 13:18:20 -08:00
|
|
|
BOOL EditCommentDialog::OnHelpInfo(HELPINFO* lpHelpInfo)
|
2007-03-27 17:47:10 +00:00
|
|
|
{
|
2014-11-03 16:26:53 -08:00
|
|
|
WinHelp((DWORD) lpHelpInfo->iCtrlId, HELP_CONTEXTPOPUP);
|
|
|
|
return TRUE; // yes, we handled it
|
2007-03-27 17:47:10 +00:00
|
|
|
}
|
|
|
|
|
2014-11-21 13:18:20 -08:00
|
|
|
void EditCommentDialog::OnHelp(void)
|
2007-03-27 17:47:10 +00:00
|
|
|
{
|
2014-11-03 16:26:53 -08:00
|
|
|
WinHelp(HELP_TOPIC_EDIT_COMMENT, HELP_CONTEXT);
|
2007-03-27 17:47:10 +00:00
|
|
|
}
|