[CHANGE_BEHAVIOUR] Change the horizontal scroll behaviour from dynamic one to static one.

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@133 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
donho 2008-02-19 22:42:31 +00:00
parent 62cfd070bf
commit 0e32dd48f4
3 changed files with 16 additions and 16 deletions

View File

@ -1913,7 +1913,7 @@ BOOL Notepad_plus::notify(SCNotification *notification)
case SCN_UPDATEUI: case SCN_UPDATEUI:
braceMatch(); braceMatch();
_pEditView->recalcHorizontalScrollbar(); //_pEditView->recalcHorizontalScrollbar();
// To update the line and the col status // To update the line and the col status
updateStatusBar(); updateStatusBar();
break; break;
@ -3123,9 +3123,6 @@ void Notepad_plus::command(int id)
_pEditView->wrap(isWraped); _pEditView->wrap(isWraped);
_toolBar.setCheck(IDM_VIEW_WRAP, isWraped); _toolBar.setCheck(IDM_VIEW_WRAP, isWraped);
checkMenuItem(IDM_VIEW_WRAP, isWraped); checkMenuItem(IDM_VIEW_WRAP, isWraped);
//if (!isWraped){
// _pEditView->recalcHorizontalScrollbar();
//}
break; break;
} }
case IDM_VIEW_WRAP_SYMBOL: case IDM_VIEW_WRAP_SYMBOL:

View File

@ -107,7 +107,8 @@ void ScintillaEditView::init(HINSTANCE hInst, HWND hPere)
execute(SCI_SETPROPERTY, reinterpret_cast<WPARAM>("fold.html"), reinterpret_cast<LPARAM>("1")); execute(SCI_SETPROPERTY, reinterpret_cast<WPARAM>("fold.html"), reinterpret_cast<LPARAM>("1"));
execute(SCI_SETPROPERTY, reinterpret_cast<WPARAM>("fold.comment"), reinterpret_cast<LPARAM>("1")); execute(SCI_SETPROPERTY, reinterpret_cast<WPARAM>("fold.comment"), reinterpret_cast<LPARAM>("1"));
execute(SCI_SETPROPERTY, reinterpret_cast<WPARAM>("fold.preprocessor"), reinterpret_cast<LPARAM>("1")); execute(SCI_SETPROPERTY, reinterpret_cast<WPARAM>("fold.preprocessor"), reinterpret_cast<LPARAM>("1"));
execute(SCI_SETFOLDFLAGS, 16, 0); execute(SCI_SETFOLDFLAGS, 16);
execute(SCI_SETSCROLLWIDTHTRACKING, true);
_pParameter = NppParameters::getInstance(); _pParameter = NppParameters::getInstance();
@ -165,15 +166,15 @@ LRESULT ScintillaEditView::scintillaNew_Proc(HWND hwnd, UINT Message, WPARAM wPa
//Have to perform the scroll first, because the first/last line do not get updated untill after the scroll has been parsed //Have to perform the scroll first, because the first/last line do not get updated untill after the scroll has been parsed
LRESULT scrollResult = ::CallWindowProc(_scintillaDefaultProc, hwnd, Message, wParam, lParam); LRESULT scrollResult = ::CallWindowProc(_scintillaDefaultProc, hwnd, Message, wParam, lParam);
recalcHorizontalScrollbar(); //recalcHorizontalScrollbar();
return scrollResult; return scrollResult;
break; break;
} }
case WM_VSCROLL : case WM_VSCROLL :
{ {
if (LOWORD(wParam) == SB_ENDSCROLL) //if (LOWORD(wParam) == SB_ENDSCROLL)
recalcHorizontalScrollbar(); //recalcHorizontalScrollbar();
break; break;
} }
} }
@ -986,7 +987,7 @@ char * ScintillaEditView::activateDocAt(int index)
execute(SCI_SETEOLMODE, _buffers[_currentIndex]._format); execute(SCI_SETEOLMODE, _buffers[_currentIndex]._format);
::SendMessage(_hParent, NPPM_INTERNAL_DOCSWITCHIN, 0, (LPARAM)_hSelf); ::SendMessage(_hParent, NPPM_INTERNAL_DOCSWITCHIN, 0, (LPARAM)_hSelf);
recalcHorizontalScrollbar(); //Update scrollbar after switching file //recalcHorizontalScrollbar(); //Update scrollbar after switching file
return _buffers[_currentIndex]._fullPathName; return _buffers[_currentIndex]._fullPathName;
} }
@ -1029,7 +1030,7 @@ void ScintillaEditView::collapse(int level2Collapse, bool mode)
execute(SCI_TOGGLEFOLD, line); execute(SCI_TOGGLEFOLD, line);
} }
} }
recalcHorizontalScrollbar(); //Update scrollbar after folding //recalcHorizontalScrollbar(); //Update scrollbar after folding
} }
void ScintillaEditView::foldCurrentPos(bool mode) void ScintillaEditView::foldCurrentPos(bool mode)
@ -1051,7 +1052,7 @@ void ScintillaEditView::foldCurrentPos(bool mode)
if ((execute(SCI_GETFOLDEXPANDED, headerLine) != 0) != mode) if ((execute(SCI_GETFOLDEXPANDED, headerLine) != 0) != mode)
execute(SCI_TOGGLEFOLD, headerLine); execute(SCI_TOGGLEFOLD, headerLine);
recalcHorizontalScrollbar(); //Update scrollbar after folding //recalcHorizontalScrollbar(); //Update scrollbar after folding
} }
void ScintillaEditView::foldAll(bool mode) void ScintillaEditView::foldAll(bool mode)
@ -1066,7 +1067,7 @@ void ScintillaEditView::foldAll(bool mode)
if ((execute(SCI_GETFOLDEXPANDED, line) != 0) != mode) if ((execute(SCI_GETFOLDEXPANDED, line) != 0) != mode)
execute(SCI_TOGGLEFOLD, line); execute(SCI_TOGGLEFOLD, line);
} }
recalcHorizontalScrollbar(); //Update scrollbar after folding //recalcHorizontalScrollbar(); //Update scrollbar after folding
} }
// return the index to close then (argument) the index to activate // return the index to close then (argument) the index to activate
@ -1196,7 +1197,7 @@ void ScintillaEditView::marginClick(int position, int modifiers)
execute(SCI_TOGGLEFOLD, lineClick, 0); execute(SCI_TOGGLEFOLD, lineClick, 0);
} }
} }
recalcHorizontalScrollbar(); //Update scrollbar after folding //recalcHorizontalScrollbar(); //Update scrollbar after folding
} }
void ScintillaEditView::expand(int &line, bool doExpand, bool force, int visLevels, int level) void ScintillaEditView::expand(int &line, bool doExpand, bool force, int visLevels, int level)
@ -1250,7 +1251,7 @@ void ScintillaEditView::expand(int &line, bool doExpand, bool force, int visLeve
line++; line++;
} }
} }
recalcHorizontalScrollbar(); //Update scrollbar after folding //recalcHorizontalScrollbar(); //Update scrollbar after folding
} }
void ScintillaEditView::makeStyle(const char *lexerName, const char **keywordArray) void ScintillaEditView::makeStyle(const char *lexerName, const char **keywordArray)
@ -1702,6 +1703,7 @@ void ScintillaEditView::columnReplace(const ColumnModeInfo & cmi, const char ch)
execute(SCI_REPLACETARGET, -1, (LPARAM)str.c_str()); execute(SCI_REPLACETARGET, -1, (LPARAM)str.c_str());
} }
} }
/*
//This method recalculates the horizontal scrollbar based //This method recalculates the horizontal scrollbar based
//on the current visible text and styler. //on the current visible text and styler.
void ScintillaEditView::recalcHorizontalScrollbar() void ScintillaEditView::recalcHorizontalScrollbar()
@ -1737,7 +1739,7 @@ void ScintillaEditView::recalcHorizontalScrollbar()
if (currentLength != maxPixel) //And if it is not the same if (currentLength != maxPixel) //And if it is not the same
execute(SCI_SETSCROLLWIDTH, maxPixel); //update it execute(SCI_SETSCROLLWIDTH, maxPixel); //update it
} }
*/
void ScintillaEditView::foldChanged(int line, int levelNow, int levelPrev) void ScintillaEditView::foldChanged(int line, int levelNow, int levelPrev)
{ {
if (levelNow & SC_FOLDLEVELHEADERFLAG) if (levelNow & SC_FOLDLEVELHEADERFLAG)

View File

@ -68,7 +68,8 @@ static void goToCenter(HWND hwnd)
//If window coordinates are all zero(ie,window is minimised),then assign desktop as the parent window. //If window coordinates are all zero(ie,window is minimised),then assign desktop as the parent window.
if(rc.left == 0 && rc.right == 0 && rc.top == 0 && rc.bottom == 0) if(rc.left == 0 && rc.right == 0 && rc.top == 0 && rc.bottom == 0)
{ {
hParent = ::GetDesktopWindow(); //hParent = ::GetDesktopWindow();
::ShowWindow(hParent, SW_SHOWNORMAL);
::GetClientRect(hParent,&rc); ::GetClientRect(hParent,&rc);
} }