Syntax Editor Problem within a splitter |
Post Reply |
Author | |
Italo
Groupie Joined: 10 December 2003 Location: United States Status: Offline Points: 83 |
Post Options
Thanks(0)
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 |
|
Italo
Groupie Joined: 10 December 2003 Location: United States Status: Offline Points: 83 |
Post Options
Thanks(0)
|
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
|
|
sserge
Moderator Group Joined: 01 December 2004 Status: Offline Points: 1297 |
Post Options
Thanks(0)
|
Hi Italo,
Thanks for your solution. For the nearest update we'll definitely implement this or similar solution. -- WBR, Serge |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |