Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Report Control - DrawGlyph not centering
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Report Control - DrawGlyph not centering

 Post Reply Post Reply
Author
Message
Warren View Drop Down
Groupie
Groupie
Avatar

Joined: 23 February 2005
Status: Offline
Points: 64
Post Options Post Options   Thanks (0) Thanks(0)   Quote Warren Quote  Post ReplyReply Direct Link To This Post Topic: Report Control - DrawGlyph not centering
    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.
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Warren View Drop Down
Groupie
Groupie
Avatar

Joined: 23 February 2005
Status: Offline
Points: 64
Post Options Post Options   Thanks (0) Thanks(0)   Quote Warren Quote  Post ReplyReply Direct Link To This Post Posted: 18 January 2006 at 12:59pm
Yes, that looks good to me.

Warren
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.031 seconds.