Report Control - DrawGlyph not centering
Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=3530
Printed Date: 09 November 2025 at 11:40pm Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com
Topic: Report Control - DrawGlyph not centering
Posted By: Warren
Subject: Report Control - DrawGlyph not centering
Date Posted: 18 January 2006 at 10:05am
Refering to this image:

The checkboxes in my report control are drawing horizontally
left-aligned, instead of horizontally centered, even when I have
specified:
pColumn->SetAlignment(DT_CENTER);
I believe the issue is in:
int CXTPReportPaintManager::DrawGlyph(CDC* pDC, CRect rcColumn, int iIcon)
in the lines:
POINT ptIcon;
ptIcon.x = rcColumn.left + 1;
ptIcon.y = rcColumn.top + (szColumn.cy - szImage.cy) /2;
I checked the Report Control sample, and the vertical centering works fine.
Mabe the best solution would be to check the SetAlignment flag, if that's not too much work ?!?
Thanks
Warren
P.S. Obviously this is not a critical bug - but it would be nice to have it fixed at some point.
|
Replies:
Posted By: sserge
Date Posted: 18 January 2006 at 12:52pm
Hi Warren,
Thanks for your notes, we've already reviewed this piece of functionality for the next version of the toolkit. Alignment flag will be a binary combination of the following flags for setting text and icon alignments independently:
enum XTPEnumColumnIconAlignment { xtpColumnTextLeft = DT_LEFT, // Aligns text to the left. xtpColumnTextCenter = DT_CENTER, // Centers text horizontally in the column. xtpColumnTextRight = DT_RIGHT, // Aligns text to the right. xtpColumnTextVCenter = DT_VCENTER,// Centers text vertically. xtpColumnTextWordBreak = DT_WORDBREAK, // Breaks words. Lines are automatically broken between words if a word would extend past the edge of the rectangle. A carriage return-line feed sequence also breaks the line.
xtpColumnTextMask = 0xFF, // A mask for text alignment styles.
xtpColumnIconLeft = 0x00100000, // Aligns icon to the left. xtpColumnIconCenter = 0x00200000, // Centers icon horizontally in the column. xtpColumnIconRight = 0x00400000, // Aligns icon to the right.
xtpColumnIconMask = 0x00F00000 // A mask for icon alignment styles. };
|
We suppose that would be enough for a flexible customization.
-- WBR, Serge
|
Posted By: Warren
Date Posted: 18 January 2006 at 12:59pm
Yes, that looks good to me.
Warren
|
|