TitleDialog.cpp
上传用户:zhoushen
上传日期:2022-06-15
资源大小:84k
文件大小:2k
- // TitleDialog.cpp : implementation file
- //
- #include "stdafx.h"
- #include "CaptionDemo.h"
- #include "TitleDialog.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CTitleDialog dialog
- CTitleDialog::CTitleDialog(CWnd* pParent /*=NULL*/)
- : CDialog(CTitleDialog::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CTitleDialog)
- m_TitleEdit = _T("");
- //}}AFX_DATA_INIT
- }
- void CTitleDialog::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CTitleDialog)
- DDX_Text(pDX, IDC_TITLE_EDIT, m_TitleEdit);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(CTitleDialog, CDialog)
- //{{AFX_MSG_MAP(CTitleDialog)
- ON_BN_CLICKED(ID_EXAMPLE_TITLE_BUTTON, OnExampleTitleButton)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- void CTitleDialog::SetTitleText(CString& title)
- {
- m_TitleEdit = title;
- }
- CString CTitleDialog::GetTitleText() const
- {
- return m_TitleEdit;
- }
- /////////////////////////////////////////////////////////////////////////////
- // CTitleDialog message handlers
- void CTitleDialog::OnExampleTitleButton()
- {
- m_TitleEdit = _T("An exceedingly long title that will almost certainly require wrapping of "
- "the window caption in order to be fully visible, and possibly will be too "
- "long even for a wrapped caption to display its complete text, and will continue "
- "on beyond the visible caption area");
- UpdateData(FALSE);
- }
- void CTitleDialog::OnOK()
- {
- UpdateData();
-
- CDialog::OnOK();
- }