Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - Border not painted correctly
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Border not painted correctly

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

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Topic: Border not painted correctly
    Posted: 04 August 2006 at 12:59pm
I've been playing a bit with the report control and it worked just fine until I put it inside a tab control. Not sure if it's important, but I have a quite advanced window hierarchy:
I have a view with a splitter. In this splitter one of the panes is another view with a tab control (CXTPTabControl). This tab control has a number of views. Now, finally, in one of these views I have a report control.
 
Please note that ALL (all views, frames and tabs) my windows have the WS_CLIPCHILDREN | WS_CLIPSIBLINGS style enabled. Also, my report control has the WS_EX_STATICEDGE style. My report controls look OK in other windows, but not inside my tab control!
 
PROBLEM:
The border of the report control is not painted correctly. I tried disabling the skinning engine, but with no success. What am I doing wrong?
 
Screenshot of the borderless report control:
 
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: 04 August 2006 at 1:49pm
Hi,
Show some code - how you create report, what styles, etc.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Posted: 04 August 2006 at 2:21pm

void CMyView::OnInitialUpdate()
{
    CXTResizeFormView::OnInitialUpdate();

    if (m_bInitDone)
        return;

    SetResize(IDC_REPORT_SHORTQUESTIONS, SZ_TOP_LEFT, SZ_TOP_RIGHT);
   
    // SetScaleToFitSize(CSize(1, 1));
   
    m_reportShortQuestions.ModifyStyle(0, WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_TABSTOP);
    m_reportShortQuestions.ModifyStyleEx(0, WS_EX_STATICEDGE);
    m_reportShortQuestions.GetReportHeader()->AllowColumnReorder(FALSE);
    m_reportShortQuestions.GetReportHeader()->AllowColumnSort(FALSE);
    m_reportShortQuestions.GetReportHeader()->AllowColumnResize(FALSE);
    m_reportShortQuestions.GetReportHeader()->AllowColumnRemove(FALSE);
    m_reportShortQuestions.FocusSubItems(TRUE);
   
    m_reportShortQuestions.AddColumn(new CXTPReportColumn(0, _T("Fråga"), 200));

    CXTPReportColumn *pColumnYes = new CXTPReportColumn(1, _T("Ja"), 28);
    CXTPReportColumn *pColumnNo = new CXTPReportColumn(2, _T("Nej"), 28);
    CXTPReportColumn *pColumnUnknown = new CXTPReportColumn(3, _T("Okänt"), 28);

    pColumnYes->SetAlignment(xtpColumnIconCenter);
    pColumnYes->SetHeaderAlignment(DT_CENTER);
    pColumnNo->SetAlignment(xtpColumnIconCenter);
    pColumnNo->SetHeaderAlignment(DT_CENTER);
    pColumnUnknown->SetAlignment(xtpColumnIconCenter);
    pColumnUnknown->SetHeaderAlignment(DT_CENTER);
   
    m_reportShortQuestions.AddColumn(pColumnYes);
    m_reportShortQuestions.AddColumn(pColumnNo);
    m_reportShortQuestions.AddColumn(pColumnUnknown);

    const int NUM_SHORT = 16;
    for (int i = 0; i < NUM_SHORT; i++)
        m_reportShortQuestions.AddRecord(new CShortQuestionRecord(i + 1, szShortQuestions));
   
    m_reportShortQuestions.SetMultipleSelection(FALSE);
    m_reportShortQuestions.Populate();

    m_bInitDone = TRUE;
}

 
Should I strip my project and send you a sample where the error is present, or can you find the error by looking at the code above?
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Posted: 04 August 2006 at 2:45pm
I made a test project which demonstrates the problem.
 
Please take a look.
 
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: 04 August 2006 at 4:14pm
Hi,
 
m_reportShortQuestions.ModifyStyleEx(0, WS_EX_STATICEDGE, SWP_FRAMECHANGED);
 
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Posted: 04 August 2006 at 4:23pm
Hah! You're da man!
 
Thank you for your fast response!
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.173 seconds.