Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Syntax Edit
  New Posts New Posts RSS Feed - Syntax Editor Problem within a splitter
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Syntax Editor Problem within a splitter

 Post Reply Post Reply
Author
Message
Italo View Drop Down
Groupie
Groupie


Joined: 10 December 2003
Location: United States
Status: Offline
Points: 83
Post Options Post Options   Thanks (0) Thanks(0)   Quote Italo Quote  Post ReplyReply Direct Link To This Post Topic: Syntax Editor Problem within a splitter
    Posted: 03 January 2007 at 2:14pm

While using the syntax editor within a splitter control I noticed the following problems.

 

1.                  While resizing the splitter the control is not repainting correctly.

a.       A thick border is being drawn.

b.      The control doesn’t repaint correctly.

 

 

 

2.                  The scrollbars are being set for the parent of the control, which is the splitter. This is not what I need, because my splitter has the syntax editor on the first row and another control on the second.

 

 

How can I fix these problems?

 

Thanks,

Italo

 

Back to Top
Italo View Drop Down
Groupie
Groupie


Joined: 10 December 2003
Location: United States
Status: Offline
Points: 83
Post Options Post Options   Thanks (0) Thanks(0)   Quote Italo Quote  Post ReplyReply Direct Link To This Post Posted: 05 January 2007 at 2:00pm

Here's how I was able to fix this:

 

For the first problem, just add UpdateWindow(); as the last line in CXTPSyntaxEditCtrl::OnSize

 

 

The second problem do as following:

 

Add support to CXTPSyntaxEditView to subclass the edit control

 

1.         Replace CXTPSyntaxEditCtrl m_wndEditCtrl; with CXTPSyntaxEditCtrl *m_pwndEditCtrl; in CXTPSyntaxEditView.h

2.         Replace all m_wndEditCtrl with m_pwndEditCtrl in CXTPSyntaxEditView.cpp

3.         Replace line 751 with    return *m_pwndEditCtrl; in CXTPSyntaxEditView.cpp

4.         Add the following method to CXTPSyntaxEditView

 

      virtual CXTPSyntaxEditCtrl* OnCreateSyntaxEditCtrl() const

      {

            CXTPSyntaxEditCtrl* pCtrl = new CXTPSyntaxEditCtrl();

            ASSERT_VALID( pCtrl );

            return pCtrl;

      }

 

5.         Replace line 344 in with CXTPSyntaxEditView.cpp

 

      m_pwndEditCtrl = OnCreateSyntaxEditCtrl();

      ASSERT_VALID( m_pwndEditCtrl );

      m_bScrollBars = m_bScrollBars || !m_pwndEditCtrl->CreateScrollbarOnParent();

      if( !m_pwndEditCtrl->Create(this, m_bScrollBars, m_bScrollBars, pDataManager, pContext))

      {

            TRACE0("Failed to create edit control.\n");

            return -1;

      }

 

6.         Add delete m_pwndEditCtrl; to the CXTPSyntaxEditView destructor

 

 

 

Prevent the control from adding a scrollbar to a parent splitter.

 

1.         Add the following method to CXTPSyntaxEditCtrl

 

virtual bool CreateScrollbarOnParent() const { return true; }

 

 

2.         Replace the lines 2952, 2964, 2978, 2992, 3004, 3016, 3028, 3040, 3052, 3066, 3080, 3094, and 3106 in CXTPSyntaxEditCtrl.cpp with:

 

if( pParentWnd != NULL && CreateScrollbarOnParent() )

 

3.         Replace the following line in CXTPSyntaxEditView.cpp

           

            761 - if( pSplitterWnd != NULL && m_pwndEditCtrl->CreateScrollbarOnParent() )

      900 - if (!pSplitterWnd || !m_pwndEditCtrl->CreateScrollbarOnParent() )

      1295 - if (pSplitterWnd && m_pwndEditCtrl->CreateScrollbarOnParent() )

     

 

4.         Create a class that subclasses CXTPSyntaxEditCtrl, override CreateScrollbarOnParent, in the view override OnCreateSyntaxEditCtrl to return a instance of your edit control.

 
 

Can someone from CodeJock please implement this or something similar?

 
Thanks,
Italo

 

 
 
 
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: 05 January 2007 at 2:55pm
Hi Italo,

Thanks for your solution. For the nearest update we'll definitely implement this or similar solution.

--
WBR,
Serge
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.203 seconds.