make the Enter a Comment edit box default to disabled so people are less inclined to enter useless comments

This commit is contained in:
Chris Danford
2006-02-23 16:27:16 +00:00
parent 663f13e70b
commit 6b5231cbf0
4 changed files with 35 additions and 12 deletions
+19 -2
View File
@@ -7,6 +7,7 @@
#include "smpackage.h"
#include "EnterComment.h"
#include "archutils/Win32/DialogUtil.h"
#include ".\entercomment.h"
#ifdef _DEBUG
#define new DEBUG_NEW
@@ -21,6 +22,7 @@ static char THIS_FILE[] = __FILE__;
EnterComment::EnterComment(CWnd* pParent /*=NULL*/)
: CDialog(EnterComment::IDD, pParent)
, m_bDontAsk(FALSE)
, m_bShowAComment(FALSE)
{
//{{AFX_DATA_INIT(EnterComment)
// NOTE: the ClassWizard will add member initialization here
@@ -35,6 +37,7 @@ void EnterComment::DoDataExchange(CDataExchange* pDX)
DDX_Control(pDX, IDC_EDIT, m_edit);
//}}AFX_DATA_MAP
DDX_Check(pDX, IDC_DONTASK, m_bDontAsk);
DDX_Check(pDX, IDC_SHOW_A_COMMENT, m_bShowAComment);
}
BOOL EnterComment::OnInitDialog()
@@ -44,6 +47,8 @@ BOOL EnterComment::OnInitDialog()
// TODO: Add extra initialization here
DialogUtil::LocalizeDialogAndContents( *this );
OnBnClickedShowAComment();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
@@ -51,6 +56,7 @@ BOOL EnterComment::OnInitDialog()
BEGIN_MESSAGE_MAP(EnterComment, CDialog)
//{{AFX_MSG_MAP(EnterComment)
//}}AFX_MSG_MAP
ON_BN_CLICKED(IDC_SHOW_A_COMMENT, OnBnClickedShowAComment)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
@@ -60,11 +66,22 @@ void EnterComment::OnOK()
{
// TODO: Add extra validation here
m_edit.GetWindowText( m_sEnteredComment );
UpdateData( TRUE );
if( m_bShowAComment )
m_edit.GetWindowText( m_sEnteredComment );
CDialog::OnOK();
}
void EnterComment::OnBnClickedShowAComment()
{
UpdateData( TRUE );
// TODO: Add your control notification handler code here
GetDlgItem( IDC_EDIT )->EnableWindow( m_bShowAComment );
}
/*
* (c) 2002-2005 Chris Danford
* All rights reserved.
@@ -88,4 +105,4 @@ void EnterComment::OnOK()
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
*/
+2
View File
@@ -44,6 +44,8 @@ protected:
DECLARE_MESSAGE_MAP()
public:
BOOL m_bDontAsk;
BOOL m_bShowAComment;
afx_msg void OnBnClickedShowAComment();
};
//{{AFX_INSERT_LOCATION}}
+2 -1
View File
@@ -90,6 +90,7 @@
#define IDC_STATIC_MESSAGE2 1068
#define IDC_STATIC_MESSAGE1 1069
#define IDC_STATIC_ICON 1070
#define IDC_SHOW_A_COMMENT 1071
// Next default values for new objects
//
@@ -97,7 +98,7 @@
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 155
#define _APS_NEXT_COMMAND_VALUE 32771
#define _APS_NEXT_CONTROL_VALUE 1071
#define _APS_NEXT_CONTROL_VALUE 1072
#define _APS_NEXT_SYMED_VALUE 104
#endif
#endif
+12 -9
View File
@@ -205,18 +205,21 @@ BEGIN
WS_EX_TRANSPARENT
END
IDD_ENTER_COMMENT DIALOGEX 0, 0, 312, 202
IDD_ENTER_COMMENT DIALOGEX 0, 0, 324, 203
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Add A Comment"
FONT 8, "MS Sans Serif", 0, 0, 0x1
BEGIN
LTEXT "This message will be displayed before a user installs your package.",
-1,7,7,219,12
EDITTEXT IDC_EDIT,17,24,232,155,ES_MULTILINE | ES_AUTOHSCROLL
DEFPUSHBUTTON "OK",IDOK,255,7,50,14
PUSHBUTTON "Cancel",IDCANCEL,255,24,50,14
LTEXT "You can add a message will be displayed before a user installs your package.",
IDC_STATIC,7,7,252,18
CONTROL "Show a comment",IDC_SHOW_A_COMMENT,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,19,39,185,12
EDITTEXT IDC_EDIT,17,53,232,123,ES_MULTILINE | ES_AUTOHSCROLL
CONTROL "Don't display this dialog in the future",IDC_DONTASK,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,181,145,11
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,185,145,11
DEFPUSHBUTTON "OK",IDOK,267,7,50,14
PUSHBUTTON "Cancel",IDCANCEL,267,24,50,14
GROUPBOX "Package Comment",IDC_STATIC,7,29,252,152
END
IDD_SHOW_COMMENT DIALOGEX 0, 0, 246, 186
@@ -419,9 +422,9 @@ BEGIN
IDD_ENTER_COMMENT, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 305
RIGHTMARGIN, 317
TOPMARGIN, 7
BOTTOMMARGIN, 195
BOTTOMMARGIN, 196
END
IDD_SHOW_COMMENT, DIALOG