Skip to content

Commit

Permalink
Updated article with version 2.0 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
snakefoot committed May 1, 2012
1 parent a4ed933 commit bebec7d
Showing 1 changed file with 30 additions and 8 deletions.
38 changes: 30 additions & 8 deletions Documentation/CGridListCtrlEx.htm
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<span id="ArticleContent">

<ul class="download">
<li><a href="CGridListCtrlEx/CGridListCtrlEx.zip">Download source code - 76.96 KB</a> </li>
<li><a href="cgridlistctrlex.zip">Download source code - 76.96 KB</a> </li>

<li><a href="CGridListCtrlEx/CGridListCtrlEx_Demo.zip">Download demo - 754.33 KB</a> </li>
<li><a href="cgridlistctrlex_demo.zip">Download demo - 754.33 KB</a> </li>
</ul>

<h2>Introduction</h2>
Expand All @@ -29,12 +30,11 @@ <h2>Introduction</h2>
<li><a href="clistctrl_persist_state.aspx">Persist column width, position and visibility</a> </li>

<li><a href="http://www.codeproject.com/KB/shell/explorerdragdrop.aspx">OLE Drag and Drop</a> (includes reordering of items) </li>

</ul>

<p>This article demonstrates how to use <code>CGridListCtrlEx</code>, which implements all the above features while maintaining the Windows XP/Vista look.</p>

<p><img width="497" height="292" alt="screenshot.png" src="CGridListCtrlEx/screenshot.png" complete="true" /></p>
<p><img width="497" height="292" alt="screenshot.png" src="screenshot.png" complete="true" /></p>

<p>The <a href="http://code.google.com/p/cgridlistctrlex/">Google Code - CGridListCtrlEx</a> can be used if wanting SubVersion access, and there is also <a href="http://cgridlistctrlex.googlecode.com/svn/trunk/Doxygen/html/index.html">Doxygen Documentation</a>.</p>

Expand Down Expand Up @@ -106,6 +106,17 @@ <h4>Formatting Cells/Subitems</h4>

<p>If we want to change the foreground/background color or the font style (bold, italic, underline), then we can override the methods <code>CGridListCtrlEx::OnDisplayCellColor()</code> and <code>CGridListCtrlEx::OnDisplayCellFont()</code>.</p>

<pre lang="C++">bool MyGridCtrl::OnDisplayCellColor(int nRow, int nCol, COLORREF&amp; textColor, COLORREF&amp; backColor)
{
if (nRow == 3 && nCol == 3)
{
textColor = RGB(0,255,0);
backColor = RGB(0,0,255);
return true; // I want to override the color of this cell
}
return false; // Use default color
}</pre>

<h4>Displaying Cell/Subitem Images</h4>

<p>The <code>CGridListCtrlEx</code> enables the extended style <code>LVS_EX_SUBITEMIMAGES</code> by default, but one is still required to attach a <code>CImageList</code> using <code>CListCtrl::SetImageList()</code>.</p>
Expand Down Expand Up @@ -214,7 +225,6 @@ <h2>Using the Code</h2>
<ul>
<li><code>CGridColumnTraitText</code> - Implements cell formatting
<ul>

<li><code>CGridColumnTraitImage</code> - Implements cell editing by switching between images (can mimic a checkbox)
<ul>
<li><code>CGridColumnTraitEdit</code> - Implements cell editing with <code>CEdit</code> </li>
Expand All @@ -230,7 +240,6 @@ <h2>Using the Code</h2>
</li>

<li><code>CGridRowTrait</code> - Specifies the interface of a row trait

<ul>
<li><code>CGridRowTraitText</code> - Implements row formatting </li>

Expand All @@ -240,7 +249,6 @@ <h2>Using the Code</h2>

<li><code>CViewConfigSection</code> - Abstract interface for persisting column setup
<ul>

<li><code>CViewConfigSectionWinApp</code> - Implements the interface and can switch between multiple column setups. </li>
</ul>
</li>
Expand Down Expand Up @@ -351,7 +359,6 @@ <h2>History</h2>

<li><strong>Version 1.8</strong> (2010-10-01)
<ul>

<li>Made <code>CGridColumnTraitImage</code> a base class for all editor column traits, so they all can mimic checkbox support </li>

<li>Implemented multiple selection checkbox support, so checkboxes are flipped for all selected rows </li>
Expand All @@ -371,6 +378,21 @@ <h2>History</h2>
<li>Removed <code>CGridColumnManager</code> and moved <code>LoadState</code>/<code>SaveState </code>into <code>CGridListCtrlEx</code> (breaking change) </li>
</ul>
</li>

<li><strong>Version 2.0</strong> (2012-05-01)
<ul>
<li>Added copy/paste support for <code>CDateTimeCtrl</code> editor (<code>DTS_APPCANPARSE</code>)</li>

<li>When having grouped by column, then column header click now sorts instead of grouping by column</li>

<li>Changed the row sorting to be case insensitive by default</li>

<li>Fixed bug where cell editor discarded changes performed using the mouse (copy/paste using context menu)</li>

<li>Fixed several compiler warnings, and small bugs</li>
</ul>
</li>

</ul>

</span>

0 comments on commit bebec7d

Please sign in to comment.