Print Page | Close Window

Syntax Editor Problem within a splitter

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Syntax Edit
Forum Description: Topics Related to Codejock Syntax Edit
URL: http://forum.codejock.com/forum_posts.asp?TID=5974
Printed Date: 21 November 2024 at 12:49pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Syntax Editor Problem within a splitter
Posted By: Italo
Subject: Syntax Editor Problem within a splitter
Date 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

 




Replies:
Posted By: Italo
Date 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

 

 
 
 


Posted By: sserge
Date 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



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net