Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - Bug in CXTPReportFilterEditControl
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Bug in CXTPReportFilterEditControl

 Post Reply Post Reply
Author
Message
Sergio View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 September 2006
Status: Offline
Points: 216
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sergio Quote  Post ReplyReply Direct Link To This Post Topic: Bug in CXTPReportFilterEditControl
    Posted: 18 April 2008 at 10:41am
Hi,
 
The Filter Edit control of the Report Control behaves strangely: it erases its border and it positions the text badly.
 
There's a bug here :
 
void CXTPReportFilterEditControl::OnPaint()
{
      CPaintDC dc(this); // device context for painting
      ...
It must be : CClientDC dc(this);
 
Please fix it in the next release of Codejock.
 
Regards,
Sergio
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 18 April 2008 at 1:22pm
Think it was already changed.
 
Here is last version:
 
void CXTPReportFilterEditControl::OnPaint()
{
 if (GetWindowTextLength() == 0 && ::GetFocus() != m_hWnd)
 {
  CPaintDC dc(this); // device context for painting
  CXTPFontDC autoFont(&dc, GetFont(), GetXtremeColor(COLOR_GRAYTEXT));
  // show hint text
  CString  strText = GetHint();
  CRect rc;
  GetClientRect(&rc);
  dc.FillSolidRect(rc, GetXtremeColor(COLOR_WINDOW));
  CRect rcText;
  GetRect(&rcText);
  dc.DrawText(strText, rcText, DT_SINGLELINE | DT_VCENTER | DT_NOPREFIX | DT_EDITCONTROL);
 }
 else
 {
  Default();
 }
}
 
ps. Never use CClientDC in WM_PAINT handler.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Sergio View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 September 2006
Status: Offline
Points: 216
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sergio Quote  Post ReplyReply Direct Link To This Post Posted: 21 April 2008 at 4:14am
Ok, thank you, here is the code of my version :
 
void CXTPReportFilterEditControl::OnPaint()
{
     CPaintDC dc(this); // device context for painting
     CString strText;
     GetWindowText(strText);
     CXTPFontDC autoFont(&dc, GetFont());
     if(GetFocus() == this || !strText.IsEmpty())
     {
          // edit is focused or not empty, show edit text
          autoFont.SetColor(GetXtremeColor(COLOR_WINDOWTEXT));
     }
     else
     {
          // show hint text
          strText = GetHint();
          autoFont.SetColor(GetXtremeColor(COLOR_GRAYTEXT));
     }
     CRect rc;
     GetClientRect(&rc);
     dc.FillSolidRect(rc, GetXtremeColor(COLOR_WINDOW));
     dc.DrawText(strText, rc, DT_SINGLELINE | DT_VCENTER | DT_NOPREFIX);
     // Do not call CEdit::OnPaint() for painting messages
}
The "Default();" call is missing here ---> it paints text on the whole control (no margins and borders/client area)...
 
We will upgrade.
 
Regards,
Sergio
Back to Top
Sergio View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 September 2006
Status: Offline
Points: 216
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sergio Quote  Post ReplyReply Direct Link To This Post Posted: 30 June 2008 at 4:58am
Hi,
 
Thank you, we just upgraded to the version 12.0.0 and it works fine now !
 
 
Sergio
Back to Top
vijay kumar View Drop Down
Newbie
Newbie
Avatar

Joined: 28 August 2007
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote vijay kumar Quote  Post ReplyReply Direct Link To This Post Posted: 30 June 2008 at 5:04pm
Can someone provide me the documentation on using the CXTPReportFilterEditControl. The help document doesn't help me enough...
 
 
Vijay
Vijay Kumar,
India
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.160 seconds.