Click here to Skip to main content
13,590,480 members
Click here to Skip to main content

Stats

1.8M views
54.8K downloads
444 bookmarked
Posted 3 Sep 2008
Licenced CPOL

CGridListCtrlEx - Grid Control Based on CListCtrl

, 16 Mar 2015
A custom draw CListCtrl with subitem editing and formatting
CGridListCtrlEx
DemoApplication
res
CGridListCtrlEx.ico
FLGDEN.ICO
FLGFRAN.ICO
FLGGERM.ICO
FLGGREEC.ico
FLGSPAIN.ICO
FLGSWED.ICO
Documentation
CGridListCtrlEx
screenshot.png
vs2003
CGridListCtrlEx.vcproj
vs2005
CGridListCtrlEx.vcproj
vs2008
CGridListCtrlEx.vcproj
vs6
CGridListCtrlEx.dsp
CGridListCtrlEx.dsw
Release
CGridListCtrlEx.exe
msvcp120.dll
msvcr120.dll
CGridListCtrlEx.ico
FLGDEN.ICO
FLGFRAN.ICO
FLGGERM.ICO
FLGGREEC.ico
FLGSPAIN.ICO
FLGSWED.ICO
screenshot.png
Doxygen
Doxyfile
html
arrowdown.png
arrowright.png
bc_s.png
bdwn.png
class_c_grid_column_trait.png
class_c_grid_column_trait_combo.png
class_c_grid_column_trait_date_time.png
class_c_grid_column_trait_edit.png
class_c_grid_column_trait_hyper_link.png
class_c_grid_column_trait_image.png
class_c_grid_column_trait_multiline_edit.png
class_c_grid_column_trait_text.png
class_c_grid_editor_combo_box.png
class_c_grid_editor_combo_box_edit.png
class_c_grid_editor_date_time_ctrl.png
class_c_grid_editor_text.png
class_c_grid_list_ctrl_ex.png
class_c_grid_list_ctrl_groups.png
class_c_grid_multiline_editor_text.png
class_c_grid_row_trait.png
class_c_grid_row_trait_text.png
class_c_grid_row_trait_x_p.png
class_c_view_config_section.png
class_c_view_config_section_default.png
class_c_view_config_section_default_1_1_c_view_config_section_local.png
class_c_view_config_section_profiles.png
class_c_view_config_section_win_app.png
closed.png
doc.png
doxygen.png
folderclosed.png
folderopen.png
ftv2blank.png
ftv2cl.png
ftv2doc.png
ftv2folderclosed.png
ftv2folderopen.png
ftv2lastnode.png
ftv2link.png
ftv2mlastnode.png
ftv2mnode.png
ftv2mo.png
ftv2node.png
ftv2ns.png
ftv2plastnode.png
ftv2pnode.png
ftv2splitbar.png
ftv2vertline.png
nav_f.png
nav_g.png
nav_h.png
open.png
search
close.png
mag_sel.png
search_l.png
search_m.png
search_r.png
splitbar.png
sync_off.png
sync_on.png
tab_a.png
tab_b.png
tab_h.png
tab_s.png
CGridListCtrlEx.vcproj
CGridListCtrlEx.vcproj
CGridListCtrlEx.vcproj
CGridListCtrlEx.dsp
CGridListCtrlEx.dsw
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>CGridListCtrlEx: CGridEditorText Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">CGridListCtrlEx
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a> &#124;
<a href="class_c_grid_editor_text-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">CGridEditorText Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>CEdit for inplace edit. For internal use by <a class="el" href="class_c_grid_column_trait_edit.html" title="CGridColumnTraitEdit implements a CEdit as cell-editor. ">CGridColumnTraitEdit</a>.  
 <a href="class_c_grid_editor_text.html#details">More...</a></p>
<div class="dynheader">
Inheritance diagram for CGridEditorText:</div>
<div class="dyncontent">
 <div class="center">
  <img src="class_c_grid_editor_text.png" usemap="#CGridEditorText_map" alt=""/>
  <map id="CGridEditorText_map" name="CGridEditorText_map">
<area href="class_c_grid_multiline_editor_text.html" title="CEdit for inplace edit. For internal use by CGridColumnTraitMultilineEdit. " alt="CGridMultilineEditorText" shape="rect" coords="0,112,148,136"/>
</map>
 </div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a6e8138b65a70f44a87b5eb05301460ad"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6e8138b65a70f44a87b5eb05301460ad"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_grid_editor_text.html#a6e8138b65a70f44a87b5eb05301460ad">CGridEditorText</a> (int nRow, int nCol)</td></tr>
<tr class="memdesc:a6e8138b65a70f44a87b5eb05301460ad"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="class_c_grid_editor_text.html" title="CEdit for inplace edit. For internal use by CGridColumnTraitEdit. ">CGridEditorText</a> - Constructor. <br /></td></tr>
<tr class="separator:a6e8138b65a70f44a87b5eb05301460ad"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8e811f383b21d7a53e6245f584a8fd69"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_grid_editor_text.html#a8e811f383b21d7a53e6245f584a8fd69">EndEdit</a> (bool bSuccess)</td></tr>
<tr class="memdesc:a8e811f383b21d7a53e6245f584a8fd69"><td class="mdescLeft">&#160;</td><td class="mdescRight">The cell value editor was closed and the entered should be saved.  <a href="#a8e811f383b21d7a53e6245f584a8fd69">More...</a><br /></td></tr>
<tr class="separator:a8e811f383b21d7a53e6245f584a8fd69"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:a6f099dde071e9337d7a3812b1729301c"><td class="memItemLeft" align="right" valign="top">afx_msg void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_grid_editor_text.html#a6f099dde071e9337d7a3812b1729301c">OnKillFocus</a> (CWnd *pNewWnd)</td></tr>
<tr class="memdesc:a6f099dde071e9337d7a3812b1729301c"><td class="mdescLeft">&#160;</td><td class="mdescRight">WM_KILLFOCUS message handler called when CEdit is loosing focus to other control.  <a href="#a6f099dde071e9337d7a3812b1729301c">More...</a><br /></td></tr>
<tr class="separator:a6f099dde071e9337d7a3812b1729301c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a679c3d5b1c15dbc0967dd89da8c79030"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a679c3d5b1c15dbc0967dd89da8c79030"></a>
afx_msg void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_grid_editor_text.html#a679c3d5b1c15dbc0967dd89da8c79030">OnEnChange</a> ()</td></tr>
<tr class="memdesc:a679c3d5b1c15dbc0967dd89da8c79030"><td class="mdescLeft">&#160;</td><td class="mdescRight">EN_CHANGE notification handler to monitor text modifications. <br /></td></tr>
<tr class="separator:a679c3d5b1c15dbc0967dd89da8c79030"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a38db61360ea15403850012d6be8b5fa3"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_grid_editor_text.html#a38db61360ea15403850012d6be8b5fa3">PostNcDestroy</a> ()</td></tr>
<tr class="memdesc:a38db61360ea15403850012d6be8b5fa3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Called by the default OnNcDestroy (WM_NCDESTROY) message handler, when CEdit window has been be destroyed.  <a href="#a38db61360ea15403850012d6be8b5fa3">More...</a><br /></td></tr>
<tr class="separator:a38db61360ea15403850012d6be8b5fa3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a791e42a109ebd39ee596308948acaa9e"><td class="memItemLeft" align="right" valign="top">virtual BOOL&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_grid_editor_text.html#a791e42a109ebd39ee596308948acaa9e">PreTranslateMessage</a> (MSG *pMsg)</td></tr>
<tr class="memdesc:a791e42a109ebd39ee596308948acaa9e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Hook to proces windows messages before they are dispatched.  <a href="#a791e42a109ebd39ee596308948acaa9e">More...</a><br /></td></tr>
<tr class="separator:a791e42a109ebd39ee596308948acaa9e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9270ec5c4fc564e5108d87cf74faa024"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9270ec5c4fc564e5108d87cf74faa024"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>DECLARE_MESSAGE_MAP</b> ()</td></tr>
<tr class="separator:a9270ec5c4fc564e5108d87cf74faa024"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr class="memitem:ac991ed7e1921f1a2916a1ead32747aec"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac991ed7e1921f1a2916a1ead32747aec"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_grid_editor_text.html#ac991ed7e1921f1a2916a1ead32747aec">m_Row</a></td></tr>
<tr class="memdesc:ac991ed7e1921f1a2916a1ead32747aec"><td class="mdescLeft">&#160;</td><td class="mdescRight">The index of the row being edited. <br /></td></tr>
<tr class="separator:ac991ed7e1921f1a2916a1ead32747aec"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2cbd737d92e3a6c39071ba87631b28e5"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2cbd737d92e3a6c39071ba87631b28e5"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_grid_editor_text.html#a2cbd737d92e3a6c39071ba87631b28e5">m_Col</a></td></tr>
<tr class="memdesc:a2cbd737d92e3a6c39071ba87631b28e5"><td class="mdescLeft">&#160;</td><td class="mdescRight">The index of the column being edited. <br /></td></tr>
<tr class="separator:a2cbd737d92e3a6c39071ba87631b28e5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae970b83db3084016f7f29404f8369eba"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae970b83db3084016f7f29404f8369eba"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_grid_editor_text.html#ae970b83db3084016f7f29404f8369eba">m_Completed</a></td></tr>
<tr class="memdesc:ae970b83db3084016f7f29404f8369eba"><td class="mdescLeft">&#160;</td><td class="mdescRight">Ensure the editor only reacts to a single close event. <br /></td></tr>
<tr class="separator:ae970b83db3084016f7f29404f8369eba"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af9debb990b92dd17c637b20f0a93d4d9"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af9debb990b92dd17c637b20f0a93d4d9"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_grid_editor_text.html#af9debb990b92dd17c637b20f0a93d4d9">m_Modified</a></td></tr>
<tr class="memdesc:af9debb990b92dd17c637b20f0a93d4d9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Register if text was modified while the editor was open. <br /></td></tr>
<tr class="separator:af9debb990b92dd17c637b20f0a93d4d9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a237f9c053e3e4ba0346a67f68ad1ba85"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a237f9c053e3e4ba0346a67f68ad1ba85"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_c_grid_editor_text.html#a237f9c053e3e4ba0346a67f68ad1ba85">m_InitialModify</a></td></tr>
<tr class="memdesc:a237f9c053e3e4ba0346a67f68ad1ba85"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initial text modication should not set that the editor text was modified. <br /></td></tr>
<tr class="separator:a237f9c053e3e4ba0346a67f68ad1ba85"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>CEdit for inplace edit. For internal use by <a class="el" href="class_c_grid_column_trait_edit.html" title="CGridColumnTraitEdit implements a CEdit as cell-editor. ">CGridColumnTraitEdit</a>. </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a8e811f383b21d7a53e6245f584a8fd69"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void CGridEditorText::EndEdit </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>bSuccess</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>The cell value editor was closed and the entered should be saved. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">bSuccess</td><td>Should the entered cell value be saved </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a6f099dde071e9337d7a3812b1729301c"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void CGridEditorText::OnKillFocus </td>
          <td>(</td>
          <td class="paramtype">CWnd *&#160;</td>
          <td class="paramname"><em>pNewWnd</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>WM_KILLFOCUS message handler called when CEdit is loosing focus to other control. </p>
<p>Used register that cell value editor should close.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pNewWnd</td><td>Pointer to the window that receives the input focus (may be NULL or may be temporary). </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a38db61360ea15403850012d6be8b5fa3"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void CGridEditorText::PostNcDestroy </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Called by the default OnNcDestroy (WM_NCDESTROY) message handler, when CEdit window has been be destroyed. </p>
<p>Used to delete the inplace CEdit editor object as well. This is necessary when the CEdit is created dynamically. </p>

</div>
</div>
<a class="anchor" id="a791e42a109ebd39ee596308948acaa9e"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">BOOL CGridEditorText::PreTranslateMessage </td>
          <td>(</td>
          <td class="paramtype">MSG *&#160;</td>
          <td class="paramname"><em>pMsg</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Hook to proces windows messages before they are dispatched. </p>
<p>Catch keyboard events that can should cause the cell value editor to close</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pMsg</td><td>Points to a MSG structure that contains the message to process </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Nonzero if the message was translated and should not be dispatched; 0 if the message was not translated and should be dispatched. </dd></dl>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.9.1
</small></address>
</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 The Code Project Open License (CPOL)

Share

About the Author

Rolf Kristensen
Software Developer
Denmark Denmark
No Biography provided

You may also be interested in...

Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web02-2016 | 2.8.180618.1 | Last Updated 16 Mar 2015
Article Copyright 2008 by Rolf Kristensen
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid