Click here to Skip to main content
15,891,744 members
Articles / Desktop Programming / MFC

UMLEditor - revisiting the vector editor

Rate me:
Please Sign up or sign in to vote.
4.99/5 (156 votes)
5 Jul 2006Public Domain8 min read 377.3K   37.1K   326  
An UML editor with code-generation capabilities derived from CDiagramEditor.
<html>
<head>
<style>
body{font-size: 10pt;color: black;font-family: Verdana, Helvetica, Arial, sans-serif;background-color: #ffffff}
p{font-size: 10pt;color: black;font-family: Verdana, Helvetica, Arial, sans-serif;}
h2{font-size: 13pt;color: #ff9900;font-family: Verdana, Helvetica, Arial, sans-serif;font-weight: bold;}
h3{color: #ff9900;font-weight: bold;font-size: 11pt;font-family: Arial, sans-serif;}
table{background-color:#f0f0ff;}
td{font-size: 10pt;color: black;font-family: Verdana, Helvetica, Arial, sans-serif;padding:4px;}
pre{padding-right: 7pt;padding-left: 7pt;padding-bottom: 7pt;font: 9pt 'Courier New', Courier, mono;width: 100%;padding-top: 7pt;white-space: pre;background-color: #fbedbb}
code{color: #990000;font-family: 'Courier New', Courier, mono;}
A:link{text-decoration: none}
A:visited{text-decoration: none}
A:active{text-decoration: underline}
A:hover{text-decoration: underline}
A.top:link{font-size:8pt;color:red;font-family:Verdana,Helvetica,Arial,sans-serif;}
A.top:visited{font-size:8pt;color:red;font-family:Verdana,Helvetica,Arial,sans-serif;}
A.top:active{font-size:8pt;color:red;font-family:Verdana,Helvetica,Arial,sans-serif;}
A.top:hoover{font-size:8pt;color:red;font-family:Verdana,Helvetica,Arial,sans-serif;}
</style>
</head>
<body>
<h2>CClassOperationPropertyDialog</h2><h3>Overview</h3>
<blockquote>
<b>Purpose</b><br>
<code>CClassOperationPropertyDialog</code>, derived from <code>CDialog</code>, encapsulates the operation property dialog.<br>
<p><b>Description</b><br>
This is a straight <code>CDialog</code>-derived class. The class uses <code>CExListBox</code> for the parameter listbox. This listbox allow dragging items to other positions, as well as deleting by pressing DEL.<br>
<p><b>Usage</b><br>
Call <code>SetOperation</code> to set the operation being edited. To create a new operation, do nothing as an operation will be created automatically. <code>GetOperation</code> returns the new/edited operation.
<p><a class='top' href='index.html'>[back to the index page]</a>
</blockquote>
<a name='contents'></a><h3>Contents</h3>
<b>- C -</b><br>
<a href='#CClassOperationPropertyDialogCWndpParent/NULL/'>CClassOperationPropertyDialog(CWnd* pParent /*=NULL*/)</a><br>
<p>
<b>- D -</b><br>
<a href='#DoDataExchangeCDataExchangepDX'>DoDataExchange(CDataExchange* pDX)</a><br>
<p>
<b>- F -</b><br>
<a href='#FillParameterList'>FillParameterList()</a><br>
<p>
<b>- G -</b><br>
<a href='#GetOperationconst'>GetOperation() const</a><br>
<p>
<b>- O -</b><br>
<a href='#OnButtonAdd'>OnButtonAdd()</a><br>
<a href='#OnButtonPropertyList'>OnButtonPropertyList()</a><br>
<a href='#OnCheckConst'>OnCheckConst()</a><br>
<a href='#OnInitDialog'>OnInitDialog()</a><br>
<a href='#OnListboxDblClickWPARAMLPARAM'>OnListboxDblClick( WPARAM, LPARAM )</a><br>
<a href='#OnListboxDeleteWPARAMLPARAM'>OnListboxDelete( WPARAM, LPARAM )</a><br>
<a href='#OnOK'>OnOK()</a><br>
<p>
<b>- S -</b><br>
<a href='#SetOperationCOperationoperation'>SetOperation( COperation* operation )</a><br>
<p><h3>Functions</h3><hr>
<code><b><a name='CClassOperationPropertyDialogCWndpParent/NULL/'></a>CClassOperationPropertyDialog(CWnd* pParent /*=NULL*/)</b></code>
<blockquote>
<b>Description</b><br>
Constructor
<br><b>Access</b><br>
Public
<br><br><b>Parameters</b><br>
<code>CWnd* pParent </code> -  Dialog parent<br>
<b>Returns</b><br>
void
<br><br><b>Usage</b><br>
Call to edit or add operations to a class object.<p>
<a class='top' href='#contents'>[back to the contents]</a>&nbsp;<a class='top' href='index.html'>[back to the index page]</a></p>
</blockquote>
<hr>
<code><b><a name='DoDataExchangeCDataExchangepDX'></a>void DoDataExchange(CDataExchange* pDX)</b></code>
<blockquote>
<b>Description</b><br>
Data-exchange handler
<br><b>Access</b><br>
Protected
<br><br><b>Parameters</b><br>
<code>CDataExchange* pDX </code> -  Pointer to exchange object<br>
<b>Returns</b><br>
void
<br><br><b>Usage</b><br>
Called from MFC to exchange and validate dialog data.<p>
<a class='top' href='#contents'>[back to the contents]</a>&nbsp;<a class='top' href='index.html'>[back to the index page]</a></p>
</blockquote>
<hr>
<code><b><a name='FillParameterList'></a>void FillParameterList()</b></code>
<blockquote>
<b>Description</b><br>
Helper to fill the parameter listbox.
<br><b>Access</b><br>
Private
<br><br><b>Parameters</b><br>
none<br>
<b>Returns</b><br>
void
<br><br><b>Usage</b><br>
Call to refill the listbox.<p>
<a class='top' href='#contents'>[back to the contents]</a>&nbsp;<a class='top' href='index.html'>[back to the index page]</a></p>
</blockquote>
<hr>
<code><b><a name='GetOperationconst'></a>COperation* GetOperation() const</b></code>
<blockquote>
<b>Description</b><br>
Get the operation being created/edited.
<br><b>Access</b><br>
Public
<br><br><b>Parameters</b><br>
none<br>
<b>Returns</b><br>
<code>COperation* </code> -  Pointer to edited/new operation
<br><br><b>Usage</b><br>
Call to get the resulting <code>COperation</code>. Caller takes ownership of the memory.<p>
<a class='top' href='#contents'>[back to the contents]</a>&nbsp;<a class='top' href='index.html'>[back to the index page]</a></p>
</blockquote>
<hr>
<code><b><a name='OnButtonAdd'></a>void OnButtonAdd()</b></code>
<blockquote>
<b>Description</b><br>
Handler for the Add (parameter) button. The parameter dialog is displayed.
<br><b>Access</b><br>
Protected
<br><br><b>Parameters</b><br>
none<br>
<b>Returns</b><br>
void
<br><br><b>Usage</b><br>
Called from MFC<p>
<a class='top' href='#contents'>[back to the contents]</a>&nbsp;<a class='top' href='index.html'>[back to the index page]</a></p>
</blockquote>
<hr>
<code><b><a name='OnButtonPropertyList'></a>void OnButtonPropertyList()</b></code>
<blockquote>
<b>Description</b><br>
Handler for the property list button. Displays the property list dialog.
<br><b>Access</b><br>
Protected
<br><br><b>Parameters</b><br>
none<br>
<b>Returns</b><br>
void
<br><br><b>Usage</b><br>
Called from MFC<p>
<a class='top' href='#contents'>[back to the contents]</a>&nbsp;<a class='top' href='index.html'>[back to the index page]</a></p>
</blockquote>
<hr>
<code><b><a name='OnCheckConst'></a>void OnCheckConst()</b></code>
<blockquote>
<b>Description</b><br>
Handler for the const checkbox. A <code>{query}</code>- property is added to the object if the checkbox value is <code>TRUE</code>, removed otherwise.
<br><b>Access</b><br>
Protected
<br><br><b>Parameters</b><br>
none<br>
<b>Returns</b><br>
void
<br><br><b>Usage</b><br>
Called from MFC.<p>
<a class='top' href='#contents'>[back to the contents]</a>&nbsp;<a class='top' href='index.html'>[back to the index page]</a></p>
</blockquote>
<hr>
<code><b><a name='OnInitDialog'></a>BOOL OnInitDialog()</b></code>
<blockquote>
<b>Description</b><br>
Handler for the <code>WM_INITDIALOG</code> message. Sets internal data and creates an operation if none is submitted through <code>SetOperation</code>.
<br><b>Access</b><br>
Protected
<br><br><b>Parameters</b><br>
none<br>
<b>Returns</b><br>
<code>BOOL </code> -  Always <code>TRUE</code>
<br><br><b>Usage</b><br>
Called from MFC<p>
<a class='top' href='#contents'>[back to the contents]</a>&nbsp;<a class='top' href='index.html'>[back to the index page]</a></p>
</blockquote>
<hr>
<code><b><a name='OnListboxDblClickWPARAMLPARAM'></a>LRESULT OnListboxDblClick( WPARAM, LPARAM )</b></code>
<blockquote>
<b>Description</b><br>
Handler for the registered message when <code>rwm_EXLISTBOX_DBLCLICK</code> is sent from the <code>CExListBox</code> (a line is double clicked). The currently selected parameter is edited.
<br><b>Access</b><br>
Protected
<br><br><b>Parameters</b><br>
<code>WPARAM id </code> -  Not used<br><code>LPARAM  </code> -  Not used<br>
<b>Returns</b><br>
<code>LRESULT  </code> -  Always 0
<br><br><b>Usage</b><br>
Called from MFC. The edit/add parameter dialog is displayed, allowing the selected parameter to be edited.<p>
<a class='top' href='#contents'>[back to the contents]</a>&nbsp;<a class='top' href='index.html'>[back to the index page]</a></p>
</blockquote>
<hr>
<code><b><a name='OnListboxDeleteWPARAMLPARAM'></a>LRESULT OnListboxDelete( WPARAM, LPARAM )</b></code>
<blockquote>
<b>Description</b><br>
Handler for the registered message when <code>rwm_EXLISTBOX_DELETE</code> is sent from the <code>CExListBox</code> (DEL is pressed in the listbox). Deletes the currently selected line.
<br><b>Access</b><br>
Protected
<br><br><b>Parameters</b><br>
<code>WPARAM id </code> -  Not used<br><code>LPARAM  </code> -  Not used<br>
<b>Returns</b><br>
<code>LRESULT  </code> -  Always 0
<br><br><b>Usage</b><br>
Called from MFC.<p>
<a class='top' href='#contents'>[back to the contents]</a>&nbsp;<a class='top' href='index.html'>[back to the index page]</a></p>
</blockquote>
<hr>
<code><b><a name='OnOK'></a>void OnOK()</b></code>
<blockquote>
<b>Description</b><br>
Handler for the OK-button. Error checks and updates the operation.
<br><b>Access</b><br>
Protected
<br><br><b>Parameters</b><br>
none<br>
<b>Returns</b><br>
void
<br><br><b>Usage</b><br>
Called from MFC<p>
<a class='top' href='#contents'>[back to the contents]</a>&nbsp;<a class='top' href='index.html'>[back to the index page]</a></p>
</blockquote>
<hr>
<code><b><a name='SetOperationCOperationoperation'></a>void SetOperation( COperation* operation )</b></code>
<blockquote>
<b>Description</b><br>
Set the operation being edited.
<br><b>Access</b><br>
Public
<br><br><b>Parameters</b><br>
<code>COperation* operation </code> -  Operation to use<br>
<b>Returns</b><br>
void
<br><br><b>Usage</b><br>
Call to set an operation to edit. If not called, a new operation will be created.<p>
<a class='top' href='#contents'>[back to the contents]</a>&nbsp;<a class='top' href='index.html'>[back to the index page]</a></p>
</blockquote>
<hr>
<b><small>Copyright 2004 Johan Rosengren Abstrakt Mekanik AB</small></b>
</body>
</html>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under A Public Domain dedication


Written By
Software Developer (Senior) Abstrakt Mekanik AB
Sweden Sweden
45 years old, married, three kids.

Started with computers more than 20 years ago on a CBM-64.

Read Theoretical Philosophy at the University of Lund.

Working as a C++ consultant developer.

Science-fiction freak. Enjoy vintage punkrock.

Comments and Discussions