|
5 | 5 | * Date: 27/09/2008 9:15 AM |
6 | 6 | * |
7 | 7 | * Change log: |
| 8 | + * v2.9.2 |
| 9 | + * 2016-06-02 JPP - CalculateImageWidth() no longer adds 2 to the image width |
| 10 | + * 2016-05-29 JPP - Fix calculation of cell edit boundaries on TreeListView controls |
8 | 11 | * v2.9 |
9 | 12 | * 2015-08-22 JPP - Allow selected row back/fore colours to be specified for each row |
10 | 13 | * 2015-06-23 JPP - Added ColumnButtonRenderer plus general support for Buttons |
11 | 14 | * 2015-06-22 JPP - Added BaseRenderer.ConfigureItem() and ConfigureSubItem() to easily allow |
12 | 15 | * other renderers to be chained for use within a primary renderer. |
13 | 16 | * - Lots of tightening of hit tests and edit rectangles |
14 | | - * 2015-05-15 JPP - Handle renderering an Image when that Image is returned as an aspect. |
| 17 | + * 2015-05-15 JPP - Handle rendering an Image when that Image is returned as an aspect. |
15 | 18 | * v2.8 |
16 | 19 | * 2014-09-26 JPP - Dispose of animation timer in a more robust fashion. |
17 | 20 | * 2014-05-20 JPP - Handle rendering disabled rows |
@@ -305,7 +308,7 @@ public Rectangle? CellPadding { |
305 | 308 | private Rectangle? cellPadding; |
306 | 309 |
|
307 | 310 | /// <summary> |
308 | | - /// Gets the horiztonal alignment of the column |
| 311 | + /// Gets the horizontal alignment of the column |
309 | 312 | /// </summary> |
310 | 313 | [Browsable(false)] |
311 | 314 | public HorizontalAlignment CellHorizontalAlignment |
@@ -825,7 +828,7 @@ protected virtual Size CalculatePrimaryCheckBoxSize(Graphics g) { |
825 | 828 | /// <returns></returns> |
826 | 829 | protected virtual int CalculateImageWidth(Graphics g, object imageSelector) |
827 | 830 | { |
828 | | - return this.CalculateImageSize(g, imageSelector).Width + 2; |
| 831 | + return this.CalculateImageSize(g, imageSelector).Width; |
829 | 832 | } |
830 | 833 |
|
831 | 834 | /// <summary> |
@@ -909,7 +912,7 @@ protected virtual Size CalculateTextSize(Graphics g, string txt, int width) |
909 | 912 | return TextRenderer.MeasureText(g, txt, this.Font, proposedSize, NormalTextFormatFlags); |
910 | 913 | } |
911 | 914 |
|
912 | | - // Using GDI+ renderering |
| 915 | + // Using GDI+ rendering |
913 | 916 | using (StringFormat fmt = new StringFormat()) { |
914 | 917 | fmt.Trimming = StringTrimming.EllipsisCharacter; |
915 | 918 | SizeF sizeF = g.MeasureString(txt, this.Font, width, fmt); |
@@ -1319,7 +1322,7 @@ protected virtual void StandardHitTest(Graphics g, OlvListViewHitTestInfo hti, R |
1319 | 1322 | width = this.CalculateImageWidth(g, this.GetImageSelector()); |
1320 | 1323 | Rectangle rTwo = r; |
1321 | 1324 | rTwo.Width = width; |
1322 | | - // g.DrawRectangle(Pens.Red, rTwo); |
| 1325 | + //g.DrawRectangle(Pens.Red, rTwo); |
1323 | 1326 | if (rTwo.Contains(x, y)) { |
1324 | 1327 | if (this.Column != null && (this.Column.Index > 0 && this.Column.CheckBoxes)) |
1325 | 1328 | hti.HitTestLocation = HitTestLocation.CheckBox; |
@@ -1362,12 +1365,12 @@ protected virtual Rectangle StandardGetEditRectangle(Graphics g, Rectangle cellB |
1362 | 1365 | Size checkBoxSize = this.CalculatePrimaryCheckBoxSize(g); |
1363 | 1366 | int imageWidth = this.CalculateImageWidth(g, this.GetImageSelector()); |
1364 | 1367 |
|
1365 | | - int width = checkBoxSize.Width + imageWidth; |
| 1368 | + int width = checkBoxSize.Width + imageWidth + 2; |
1366 | 1369 |
|
1367 | 1370 | // Indent the primary column by the required amount |
1368 | | - if (this.ListItem.IndentCount > 0) { |
| 1371 | + if (this.ColumnIsPrimary && this.ListItem.IndentCount > 0) { |
1369 | 1372 | int indentWidth = this.ListView.SmallImageSize.Width * this.ListItem.IndentCount; |
1370 | | - width += indentWidth; |
| 1373 | + editControlBounds.X += indentWidth; |
1371 | 1374 | } |
1372 | 1375 |
|
1373 | 1376 | editControlBounds.X += width; |
@@ -3496,7 +3499,7 @@ public Color DescriptionColorOrDefault { |
3496 | 3499 | /// Gets or sets the number of pixels that will be left between the image and the text |
3497 | 3500 | /// </summary> |
3498 | 3501 | [Category("ObjectListView"), |
3499 | | - Description("The number of pixels that that will be left between the image and the text"), |
| 3502 | + Description("The number of pixels that will be left between the image and the text"), |
3500 | 3503 | DefaultValue(4)] |
3501 | 3504 | public int ImageTextSpace |
3502 | 3505 | { |
|
0 commit comments