⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 umlclasspropertydialog.cpp

📁 uml编辑器很牛
💻 CPP
字号:
/* ==========================================================================
	Class :			CUMLClassPropertyDialog

	Author :		Johan Rosengren, Abstrakt Mekanik AB

	Date :			2004-06-21

	Purpose :		"CUMLClassPropertyDialog" derives from "CDiagramPropertyDlg", 
					used by "CUMLEntity"-derived objects to edit the object 
					attributes.

	Description :	A standard Class-Wizard created dialog box class.

	Usage :			In the "CUMLEntity"-derived class, add a member of 
					the "CUMLInterfacePropertyDialog"-derived class, and call 
					"SetPropertyDialog" in the constructor.

					The dialog is displayed as a modeless dialog. The 
					editor will hide the dialog automatically when another
					object is selected, no special Close-button is 
					necessary.

					The dialog template with the resource id 
					"IDD_UML_DIALOG_PROPERTY_CLASS" 
					must be added to the project.

   ========================================================================*/

#include "stdafx.h"
#include "UMLClassPropertyDialog.h"
#include "UMLEntityClass.h"
#include "ClassAttributePropertyDialog.h"
#include "ClassOperationPropertyDialog.h"
#include "PropertyListEditorDialog.h"
#include "ClassDisplayPropertyDialog.h"
#include "GetterSetterDialog.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CUMLClassPropertyDialog dialog

CUMLClassPropertyDialog::CUMLClassPropertyDialog(CWnd* pParent /*=NULL*/)
	: CDiagramPropertyDlg(CUMLClassPropertyDialog::IDD, pParent)
/* ============================================================
	Function :		CUMLClassPropertyDialog::CUMLClassPropertyDialog
	Description :	Constructor
	Access :		Public
					
	Return :		void
	Parameters :	CWnd* pParent	-	Dialog parent

	Usage :			

   ============================================================*/
{

	//{{AFX_DATA_INIT(CUMLClassPropertyDialog)
	m_name = _T("");
	m_stereotype = _T("");
	m_propertylist = _T("");
	//}}AFX_DATA_INIT

}

void CUMLClassPropertyDialog::DoDataExchange(CDataExchange* pDX)
/* ============================================================
	Function :		CUMLClassPropertyDialog::DoDataExchange
	Description :	MFC data exchange handler.
	Access :		Protected

	Return :		void
	Parameters :	CDataExchange* pDX	-	Pointer to exchange object
					
	Usage :			Called from MFC to exchange and validate 
					dialog data.

   ============================================================*/
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CUMLClassPropertyDialog)
	DDX_Control(pDX, IDC_LIST_OPERATIONS, m_operation);
	DDX_Control(pDX, IDC_LIST_ATTRIBUTES, m_attribute);
	DDX_Control(pDX, IDC_EDIT_NAME, m_nameCtrl);
	DDX_Text(pDX, IDC_EDIT_NAME, m_name);
	DDX_Text(pDX, IDC_COMBO_STEREOTYPE, m_stereotype);
	DDX_Text(pDX, IDC_EDIT_PROPERTY_LIST, m_propertylist);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CUMLClassPropertyDialog, CDialog)
	//{{AFX_MSG_MAP(CUMLClassPropertyDialog)
	ON_BN_CLICKED(IDC_BUTTON_ADD_ATTRIBUTE, OnButtonAddAttribute)
	ON_BN_CLICKED(IDC_BUTTON_ADD_OPERATION, OnButtonAddOperation)
	ON_BN_CLICKED(IDC_BUTTON_FONT, OnButtonFont)
	ON_BN_CLICKED(IDC_BUTTON_COLOR, OnButtonColor)
	ON_BN_CLICKED(IDC_BUTTON_PROPERTY_LIST, OnButtonPropertyList)
	ON_BN_CLICKED(IDC_BUTTON_AUTO_GENERATE, OnButtonAutoGenerate)
	ON_BN_CLICKED(IDC_BUTTON_VISIBILITY, OnButtonVisibility)
	ON_BN_CLICKED(IDC_BUTTON_AUTO_GENERATE2, OnButtonAutoGenerate2)
	//}}AFX_MSG_MAP
	ON_REGISTERED_MESSAGE(rwm_EXLISTBOX_DBLCLICK, OnListboxDblClick)
	ON_REGISTERED_MESSAGE(rwm_EXLISTBOX_DELETE, OnListboxDelete)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CUMLClassPropertyDialog message handlers

void CUMLClassPropertyDialog::OnOK() 
/* ============================================================
	Function :		CUMLClassPropertyDialog::OnOK
	Description :	Handler for the dialog OK-button.
	Access :		Protected

	Return :		void
	Parameters :	none

	Usage :			Called from MFC.

   ============================================================*/
{

	CUMLEntityClass* uml = static_cast< CUMLEntityClass* >( GetEntity() );

	UpdateData();
	if( m_name.IsEmpty() )
	{
		AfxMessageBox( IDS_UML_CLASS_MUST_HAVE_A_NAME );
		m_nameCtrl.SetFocus();
		return;
	}

	uml->SetTitle( m_name );
	uml->SetBkColor( m_color );
	uml->SetFont( m_font );

	m_stereotype.Remove( _TCHAR( '

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -