Hi there,
To come straight to the point, I would like to know how to have scintilla to work with CSplitterWnd (in MFC).
The splitter itself create its own scrollbar and show the little divider on the corner, so the GUI looks like the screenshot below (with extra scrollbars).
(This is a demo application built from CScintillaView with a few lines modification)
I know we can use SCI_SETVSCROLLBAR/SCI_SETHSCROLLBAR to hide scintilla's scrollbar, but still the scroll of splitter cannot update its position correctly.
One solution for this would be to have scintilla send notification to its parent window in ScintillaWin::SetScrollInfo/ScintillaWin::GetScrollInfo, e.g.:
SCNotification sc = {0}; sc.nmhdr.code = SCN_SETSCROLLINFO; sc.nBar = nBar; sc.lpsi = (void*) lpsi;
NotifyParent(sc); return ::SetScrollInfo(MainHWND(), nBar, lpsi, bRedraw);}
bool ScintillaWin::GetScrollInfo(int nBar, LPSCROLLINFO lpsi) {
SCNotification sc = {0}; sc.nmhdr.code = SCN_GETSCROLLINFO; sc.lpsi = (void*) lpsi; sc.nBar = nBar; NotifyParent(sc);
return ::GetScrollInfo(MainHWND(), nBar, lpsi) ? true : false;}
What do you think?
if (horizontalScrollBarVisible && trackLineWidth && (view.lineWidthMaxSeen > scrollWidth)) { if (FineTickerAvailable()) { scrollWidth = view.lineWidthMaxSeen; if (!FineTickerRunning(tickWiden)) { FineTickerStart(tickWiden, 50, 5); } }}