RecalcScrollBars - Doesn't. |
Post Reply |
Author | |
Algae
Senior Member Joined: 08 January 2007 Location: United States Status: Offline Points: 217 |
Post Options
Thanks(1)
Posted: 27 December 2015 at 2:52pm |
This problem has been around for awhile.
RecalculateScrollBars fails to adjust Horizontally after loading more than one file. The thumb size is wrong and the horizontal scroll area does not change. The Culprit! void CXTPSyntaxEditCtrl::_RecalcHScrollMaxWidth() { CRect rcText = m_pDrawTextProcessor->GetTextRect(); int nPageX = rcText.Width(); int nMaxX = m_pDrawTextProcessor->GetRowsMaxWidth(); nMaxX += max(nPageX/4, m_pDrawTextProcessor->GetTextMetrics().tmAveCharWidth * 20); nMaxX = max(nMaxX, rcText.Width() * 2); // Replace this line // m_nHScrollMaxWidth = max(nMaxX, m_nHScrollMaxWidth); // with this and things start to work. m_nHScrollMaxWidth = nMaxX; } The value of GetRowsMaxWidth() seems to be the right "max" if the text is > client rect width. I have tested a few scenarios with the change and the scrolling appears to function normally. To Reproduce: 1. Use a Static Unicode build. 2. Use a dialog containing a SyntaxEditCtrl. I used this method to add the control to the dialog: VERIFY(m_ctrlSynEdit.SubclassDlgItem(IDC_SYNTAX_EDIT, this)); 3. Load a file that has a really long text line (not wrapped). Result: Both scrollbars are calculated properly.Load another file with shorter lines than the first file. Do not perform any scrolling. Result: The Vertical scrollbar calculates properly but the Horizontal scrollbar does not change. It is still way beyond the text extent of the newly loaded file.Load another file with only one short line. Result: The Horizontal scrollbar still does not change. I compared 16.26 against v17.0.0.081715 Beta and it looks pretty much the same so I would say - Not Fixed yet. Some other issues with control in dialog. 1. Doesn't appear to support mouse wheel, you have to add your own handler. 2. Context menu handling is clunky and you have to put a lot of effort into making one work. Most would expect context menu handling to be more like an Edit Box. 3. The schema handling is not well explained anywhere that I know of. 4. Syntax colors do not always display correctly. It's hit or miss. I would suggest adding some finishing touches to the editor and provide a dialog based example to the toolkit to bring it to the level of quality expected for CJ controls. |
|
olebed
Admin Group Joined: 01 July 2014 Location: Ukraine Status: Offline Points: 841 |
Post Options
Thanks(0)
|
Hello Algae,
Thank you for bringing this to our attention. The fix of _RecalcHScrollMaxWidth() will be available in the next beta or final release. I will look at other issues later. Regards, Oleksandr Lebed |
|
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 |