[NEW_FEATURE]
- Add line wrap methods. - Make folding margin hidable. - One set of settings are applied in 2 scintilla controls. git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@643 f5eea248-9336-0410-98b8-ebc06183d4e3remotes/x64
parent
e0773602b2
commit
a3d71483ef
|
@ -174,7 +174,7 @@ LRESULT Notepad_plus::init(HWND hwnd)
|
|||
_activeView = MAIN_VIEW;
|
||||
|
||||
const ScintillaViewParams & svp1 = pNppParam->getSVP(SCIV_PRIMARY);
|
||||
const ScintillaViewParams & svp2 = pNppParam->getSVP(SCIV_SECOND);
|
||||
//const ScintillaViewParams & svp2 = pNppParam->getSVP(SCIV_SECOND);
|
||||
|
||||
int tabBarStatus = nppGUI._tabStatus;
|
||||
_toReduceTabBar = ((tabBarStatus & TAB_REDUCE) != 0);
|
||||
|
@ -192,12 +192,12 @@ LRESULT Notepad_plus::init(HWND hwnd)
|
|||
|
||||
// Configuration of 2 scintilla views
|
||||
_mainEditView.showMargin(ScintillaEditView::_SC_MARGE_LINENUMBER, svp1._lineNumberMarginShow);
|
||||
_subEditView.showMargin(ScintillaEditView::_SC_MARGE_LINENUMBER, svp2._lineNumberMarginShow);
|
||||
_subEditView.showMargin(ScintillaEditView::_SC_MARGE_LINENUMBER, svp1._lineNumberMarginShow);
|
||||
_mainEditView.showMargin(ScintillaEditView::_SC_MARGE_SYBOLE, svp1._bookMarkMarginShow);
|
||||
_subEditView.showMargin(ScintillaEditView::_SC_MARGE_SYBOLE, svp2._bookMarkMarginShow);
|
||||
_subEditView.showMargin(ScintillaEditView::_SC_MARGE_SYBOLE, svp1._bookMarkMarginShow);
|
||||
|
||||
_mainEditView.showIndentGuideLine(svp1._indentGuideLineShow);
|
||||
_subEditView.showIndentGuideLine(svp2._indentGuideLineShow);
|
||||
_subEditView.showIndentGuideLine(svp1._indentGuideLineShow);
|
||||
|
||||
::SendMessage(hwnd, NPPM_INTERNAL_SETCARETWIDTH, 0, 0);
|
||||
::SendMessage(hwnd, NPPM_INTERNAL_SETCARETBLINKRATE, 0, 0);
|
||||
|
@ -207,37 +207,41 @@ LRESULT Notepad_plus::init(HWND hwnd)
|
|||
|
||||
//Marker Margin config
|
||||
_mainEditView.setMakerStyle(svp1._folderStyle);
|
||||
_subEditView.setMakerStyle(svp2._folderStyle);
|
||||
_subEditView.setMakerStyle(svp1._folderStyle);
|
||||
|
||||
//Line wrap method
|
||||
_mainEditView.setWrapMode(svp1._lineWrapMethod);
|
||||
_subEditView.setWrapMode(svp1._lineWrapMethod);
|
||||
|
||||
_mainEditView.execute(SCI_SETCARETLINEVISIBLE, svp1._currentLineHilitingShow);
|
||||
_subEditView.execute(SCI_SETCARETLINEVISIBLE, svp2._currentLineHilitingShow);
|
||||
_subEditView.execute(SCI_SETCARETLINEVISIBLE, svp1._currentLineHilitingShow);
|
||||
|
||||
_mainEditView.execute(SCI_SETCARETLINEVISIBLEALWAYS, true);
|
||||
_subEditView.execute(SCI_SETCARETLINEVISIBLEALWAYS, true);
|
||||
|
||||
_mainEditView.wrap(svp1._doWrap);
|
||||
_subEditView.wrap(svp2._doWrap);
|
||||
_subEditView.wrap(svp1._doWrap);
|
||||
|
||||
_mainEditView.execute(SCI_SETEDGECOLUMN, svp1._edgeNbColumn);
|
||||
_mainEditView.execute(SCI_SETEDGEMODE, svp1._edgeMode);
|
||||
_subEditView.execute(SCI_SETEDGECOLUMN, svp2._edgeNbColumn);
|
||||
_subEditView.execute(SCI_SETEDGEMODE, svp2._edgeMode);
|
||||
_subEditView.execute(SCI_SETEDGECOLUMN, svp1._edgeNbColumn);
|
||||
_subEditView.execute(SCI_SETEDGEMODE, svp1._edgeMode);
|
||||
|
||||
_mainEditView.showEOL(svp1._eolShow);
|
||||
_subEditView.showEOL(svp2._eolShow);
|
||||
_subEditView.showEOL(svp1._eolShow);
|
||||
|
||||
_mainEditView.showWSAndTab(svp1._whiteSpaceShow);
|
||||
_subEditView.showWSAndTab(svp2._whiteSpaceShow);
|
||||
_subEditView.showWSAndTab(svp1._whiteSpaceShow);
|
||||
|
||||
_mainEditView.showWrapSymbol(svp1._wrapSymbolShow);
|
||||
_subEditView.showWrapSymbol(svp2._wrapSymbolShow);
|
||||
_subEditView.showWrapSymbol(svp1._wrapSymbolShow);
|
||||
|
||||
_mainEditView.performGlobalStyles();
|
||||
_subEditView.performGlobalStyles();
|
||||
|
||||
_zoomOriginalValue = _pEditView->execute(SCI_GETZOOM);
|
||||
_mainEditView.execute(SCI_SETZOOM, svp1._zoom);
|
||||
_subEditView.execute(SCI_SETZOOM, svp2._zoom);
|
||||
_subEditView.execute(SCI_SETZOOM, svp1._zoom);
|
||||
|
||||
::SendMessage(hwnd, NPPM_INTERNAL_SETMULTISELCTION, 0, 0);
|
||||
|
||||
|
@ -1740,35 +1744,6 @@ void Notepad_plus::setUniModeText()
|
|||
_statusBar.setText(uniModeTextString.c_str(), STATUSBAR_UNICODE_TYPE);
|
||||
}
|
||||
|
||||
int Notepad_plus::getFolderMarginStyle() const
|
||||
{
|
||||
if (::GetMenuState(_mainMenuHandle, IDM_VIEW_FOLDERMAGIN_SIMPLE, MF_BYCOMMAND) == MF_CHECKED)
|
||||
return IDM_VIEW_FOLDERMAGIN_SIMPLE;
|
||||
|
||||
if (::GetMenuState(_mainMenuHandle, IDM_VIEW_FOLDERMAGIN_ARROW, MF_BYCOMMAND) == MF_CHECKED)
|
||||
return IDM_VIEW_FOLDERMAGIN_ARROW;
|
||||
|
||||
if (::GetMenuState(_mainMenuHandle, IDM_VIEW_FOLDERMAGIN_CIRCLE, MF_BYCOMMAND) == MF_CHECKED)
|
||||
return IDM_VIEW_FOLDERMAGIN_CIRCLE;
|
||||
|
||||
if (::GetMenuState(_mainMenuHandle, IDM_VIEW_FOLDERMAGIN_BOX, MF_BYCOMMAND) == MF_CHECKED)
|
||||
return IDM_VIEW_FOLDERMAGIN_BOX;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Notepad_plus::getFolderMaginStyleIDFrom(folderStyle fStyle) const
|
||||
{
|
||||
switch (fStyle)
|
||||
{
|
||||
case FOLDER_STYLE_SIMPLE : return IDM_VIEW_FOLDERMAGIN_SIMPLE;
|
||||
case FOLDER_STYLE_ARROW : return IDM_VIEW_FOLDERMAGIN_ARROW;
|
||||
case FOLDER_STYLE_CIRCLE : return IDM_VIEW_FOLDERMAGIN_CIRCLE;
|
||||
case FOLDER_STYLE_BOX : return IDM_VIEW_FOLDERMAGIN_BOX;
|
||||
default : return FOLDER_TYPE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Notepad_plus::charAdded(TCHAR chAdded)
|
||||
{
|
||||
|
@ -1932,39 +1907,43 @@ void Notepad_plus::MaintainIndentation(TCHAR ch)
|
|||
}
|
||||
}
|
||||
}
|
||||
void Notepad_plus::specialCmd(int id, int param)
|
||||
void Notepad_plus::specialCmd(int id/*, int param*/)
|
||||
{
|
||||
if ((param != 1) && (param != 2)) return;
|
||||
//if ((param != 1) && (param != 2)) return;
|
||||
|
||||
NppParameters *pNppParam = NppParameters::getInstance();
|
||||
ScintillaEditView *pEditView = (param == 1)?&_mainEditView:&_subEditView;
|
||||
//ScintillaEditView *pEditView = (param == 1)?&_mainEditView:&_subEditView;
|
||||
|
||||
switch (id)
|
||||
{
|
||||
case IDM_VIEW_LINENUMBER:
|
||||
case IDM_VIEW_SYMBOLMARGIN:
|
||||
//case IDM_VIEW_DOCCHANGEMARGIN:
|
||||
case IDM_VIEW_FOLDERMAGIN:
|
||||
case IDM_VIEW_DOCCHANGEMARGIN:
|
||||
{
|
||||
int margin;
|
||||
if (id == IDM_VIEW_LINENUMBER)
|
||||
margin = ScintillaEditView::_SC_MARGE_LINENUMBER;
|
||||
else if (id == IDM_VIEW_SYMBOLMARGIN)
|
||||
else //if (id == IDM_VIEW_SYMBOLMARGIN)
|
||||
margin = ScintillaEditView::_SC_MARGE_SYBOLE;
|
||||
/*
|
||||
else if (id == IDM_VIEW_DOCCHANGEMARGIN)
|
||||
{
|
||||
margin = ScintillaEditView::_SC_MARGE_MODIFMARKER;
|
||||
}
|
||||
*/
|
||||
|
||||
else
|
||||
margin = ScintillaEditView::_SC_MARGE_FOLDER;
|
||||
|
||||
if (pEditView->hasMarginShowed(margin))
|
||||
pEditView->showMargin(margin, false);
|
||||
*/
|
||||
if (_mainEditView.hasMarginShowed(margin))
|
||||
{
|
||||
_mainEditView.showMargin(margin, false);
|
||||
_subEditView.showMargin(margin, false);
|
||||
}
|
||||
else
|
||||
pEditView->showMargin(margin);
|
||||
|
||||
{
|
||||
_mainEditView.showMargin(margin);
|
||||
_subEditView.showMargin(margin);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1972,20 +1951,23 @@ void Notepad_plus::specialCmd(int id, int param)
|
|||
case IDM_VIEW_FOLDERMAGIN_ARROW:
|
||||
case IDM_VIEW_FOLDERMAGIN_CIRCLE:
|
||||
case IDM_VIEW_FOLDERMAGIN_BOX:
|
||||
case IDM_VIEW_FOLDERMAGIN:
|
||||
{
|
||||
int checkedID = getFolderMarginStyle();
|
||||
if (checkedID == id) return;
|
||||
folderStyle fStyle = (id == IDM_VIEW_FOLDERMAGIN_SIMPLE)?FOLDER_STYLE_SIMPLE:\
|
||||
((id == IDM_VIEW_FOLDERMAGIN_ARROW)?FOLDER_STYLE_ARROW:\
|
||||
((id == IDM_VIEW_FOLDERMAGIN_CIRCLE)?FOLDER_STYLE_CIRCLE:FOLDER_STYLE_BOX));
|
||||
pEditView->setMakerStyle(fStyle);
|
||||
(id == IDM_VIEW_FOLDERMAGIN_ARROW)?FOLDER_STYLE_ARROW:\
|
||||
(id == IDM_VIEW_FOLDERMAGIN_CIRCLE)?FOLDER_STYLE_CIRCLE:\
|
||||
(id == IDM_VIEW_FOLDERMAGIN)?FOLDER_STYLE_NONE:FOLDER_STYLE_BOX;
|
||||
|
||||
_mainEditView.setMakerStyle(fStyle);
|
||||
_subEditView.setMakerStyle(fStyle);
|
||||
break;
|
||||
}
|
||||
|
||||
case IDM_VIEW_CURLINE_HILITING:
|
||||
{
|
||||
COLORREF colour = pNppParam->getCurLineHilitingColour();
|
||||
pEditView->setCurrentLineHiLiting(!_pEditView->isCurrentLineHiLiting(), colour);
|
||||
_mainEditView.setCurrentLineHiLiting(!_pEditView->isCurrentLineHiLiting(), colour);
|
||||
_subEditView.setCurrentLineHiLiting(!_pEditView->isCurrentLineHiLiting(), colour);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -2009,14 +1991,16 @@ void Notepad_plus::specialCmd(int id, int param)
|
|||
default :
|
||||
mode = EDGE_NONE;
|
||||
}
|
||||
pEditView->execute(SCI_SETEDGEMODE, mode);
|
||||
_mainEditView.execute(SCI_SETEDGEMODE, mode);
|
||||
_subEditView.execute(SCI_SETEDGEMODE, mode);
|
||||
break;
|
||||
}
|
||||
|
||||
case IDM_SETTING_EDGE_SIZE :
|
||||
{
|
||||
ValueDlg nbColumnEdgeDlg;
|
||||
ScintillaViewParams & svp = (ScintillaViewParams &)pNppParam->getSVP(param == 1?SCIV_PRIMARY:SCIV_SECOND);
|
||||
//ScintillaViewParams & svp = (ScintillaViewParams &)pNppParam->getSVP(param == 1?SCIV_PRIMARY:SCIV_SECOND);
|
||||
ScintillaViewParams & svp = (ScintillaViewParams &)pNppParam->getSVP(SCIV_PRIMARY);
|
||||
nbColumnEdgeDlg.init(_pPublicInterface->getHinst(), _preference.getHSelf(), svp._edgeNbColumn, TEXT("Nb of column:"));
|
||||
nbColumnEdgeDlg.setNBNumber(3);
|
||||
|
||||
|
@ -2028,10 +2012,22 @@ void Notepad_plus::specialCmd(int id, int param)
|
|||
if (size != -1)
|
||||
{
|
||||
svp._edgeNbColumn = size;
|
||||
pEditView->execute(SCI_SETEDGECOLUMN, size);
|
||||
_mainEditView.execute(SCI_SETEDGECOLUMN, size);
|
||||
_subEditView.execute(SCI_SETEDGECOLUMN, size);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case IDM_VIEW_LWDEF:
|
||||
case IDM_VIEW_LWALIGN:
|
||||
case IDM_VIEW_LWINDENT:
|
||||
{
|
||||
int mode = (id == IDM_VIEW_LWALIGN)?SC_WRAPINDENT_SAME:\
|
||||
(id == IDM_VIEW_LWINDENT)?SC_WRAPINDENT_INDENT:SC_WRAPINDENT_FIXED;
|
||||
_mainEditView.execute(SCI_SETWRAPINDENTMODE, mode);
|
||||
_subEditView.execute(SCI_SETWRAPINDENTMODE, mode);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2851,16 +2847,8 @@ void Notepad_plus::bookmarkNext(bool forwardScan)
|
|||
_pEditView->execute(SCI_GOTOLINE, nextLine);
|
||||
}
|
||||
|
||||
void Notepad_plus::dynamicCheckMenuAndTB() const
|
||||
void Notepad_plus::staticCheckMenuAndTB() const
|
||||
{
|
||||
// Visibility of 3 margins
|
||||
checkMenuItem(IDM_VIEW_LINENUMBER, _pEditView->hasMarginShowed(ScintillaEditView::_SC_MARGE_LINENUMBER));
|
||||
checkMenuItem(IDM_VIEW_SYMBOLMARGIN, _pEditView->hasMarginShowed(ScintillaEditView::_SC_MARGE_SYBOLE));
|
||||
checkMenuItem(IDM_VIEW_FOLDERMAGIN, _pEditView->hasMarginShowed(ScintillaEditView::_SC_MARGE_FOLDER));
|
||||
|
||||
// Folder margin style
|
||||
checkFolderMarginStyleMenu(getFolderMaginStyleIDFrom(_pEditView->getFolderStyle()));
|
||||
|
||||
// Visibility of invisible characters
|
||||
bool wsTabShow = _pEditView->isInvisibleCharsShown();
|
||||
bool eolShow = _pEditView->isEolVisible();
|
||||
|
@ -2894,25 +2882,19 @@ void Notepad_plus::dynamicCheckMenuAndTB() const
|
|||
checkMenuItem(IDM_VIEW_INDENT_GUIDE, b);
|
||||
_toolBar.setCheck(IDM_VIEW_INDENT_GUIDE, b);
|
||||
|
||||
// Edge Line
|
||||
int mode = int(_pEditView->execute(SCI_GETEDGEMODE));
|
||||
checkMenuItem(IDM_VIEW_EDGEBACKGROUND, (MF_BYCOMMAND | ((mode == EDGE_NONE)||(mode == EDGE_LINE))?MF_UNCHECKED:MF_CHECKED) != 0);
|
||||
checkMenuItem(IDM_VIEW_EDGELINE, (MF_BYCOMMAND | ((mode == EDGE_NONE)||(mode == EDGE_BACKGROUND))?MF_UNCHECKED:MF_CHECKED) != 0);
|
||||
|
||||
// Current Line Highlighting
|
||||
checkMenuItem(IDM_VIEW_CURLINE_HILITING, _pEditView->isCurrentLineHiLiting());
|
||||
|
||||
// Wrap
|
||||
b = _pEditView->isWrap();
|
||||
checkMenuItem(IDM_VIEW_WRAP, b);
|
||||
_toolBar.setCheck(IDM_VIEW_WRAP, b);
|
||||
checkMenuItem(IDM_VIEW_WRAP_SYMBOL, _pEditView->isWrapSymbolVisible());
|
||||
}
|
||||
|
||||
void Notepad_plus::dynamicCheckMenuAndTB() const
|
||||
{
|
||||
//Format conversion
|
||||
enableConvertMenuItems(_pEditView->getCurrentBuffer()->getFormat());
|
||||
checkUnicodeMenuItems(/*_pEditView->getCurrentBuffer()->getUnicodeMode()*/);
|
||||
|
||||
//Syncronized scrolling
|
||||
checkUnicodeMenuItems();
|
||||
}
|
||||
|
||||
void Notepad_plus::enableConvertMenuItems(formatType f) const
|
||||
|
@ -3200,23 +3182,8 @@ bool Notepad_plus::doStreamComment()
|
|||
|
||||
bool Notepad_plus::saveScintillaParams(bool whichOne)
|
||||
{
|
||||
ScintillaViewParams svp;
|
||||
ScintillaEditView *pView = (whichOne == SCIV_PRIMARY)?&_mainEditView:&_subEditView;
|
||||
|
||||
svp._lineNumberMarginShow = pView->hasMarginShowed(ScintillaEditView::_SC_MARGE_LINENUMBER);
|
||||
svp._bookMarkMarginShow = pView->hasMarginShowed(ScintillaEditView::_SC_MARGE_SYBOLE);
|
||||
//svp._docChangeStateMarginShow = pView->hasMarginShowed(ScintillaEditView::_SC_MARGE_MODIFMARKER);
|
||||
svp._indentGuideLineShow = pView->isShownIndentGuide();
|
||||
svp._folderStyle = pView->getFolderStyle();
|
||||
svp._currentLineHilitingShow = pView->isCurrentLineHiLiting();
|
||||
svp._wrapSymbolShow = pView->isWrapSymbolVisible();
|
||||
svp._doWrap = pView->isWrap();
|
||||
svp._edgeMode = int(pView->execute(SCI_GETEDGEMODE));
|
||||
svp._edgeNbColumn = int(pView->execute(SCI_GETEDGECOLUMN));
|
||||
svp._zoom = int(pView->execute(SCI_GETZOOM));
|
||||
svp._whiteSpaceShow = pView->isInvisibleCharsShown();
|
||||
svp._eolShow = pView->isEolVisible();
|
||||
|
||||
NppParameters * pNppParam = NppParameters::getInstance();
|
||||
ScintillaViewParams & svp = (ScintillaViewParams &)pNppParam->getSVP(SCIV_PRIMARY);
|
||||
return (NppParameters::getInstance())->writeScintillaParams(svp, whichOne);
|
||||
}
|
||||
|
||||
|
@ -3271,7 +3238,6 @@ bool Notepad_plus::switchToFile(BufferID id)
|
|||
if (i != -1)
|
||||
{
|
||||
switchEditViewTo(iView);
|
||||
//_pDocTab->activateAt(i);
|
||||
activateBuffer(id, currentView());
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -401,7 +401,7 @@ private:
|
|||
|
||||
|
||||
BOOL notify(SCNotification *notification);
|
||||
void specialCmd(int id, int param);
|
||||
void specialCmd(int id);
|
||||
void command(int id);
|
||||
|
||||
//Document management
|
||||
|
@ -465,6 +465,7 @@ private:
|
|||
void checkModifiedDocument();
|
||||
|
||||
void getMainClientRect(RECT & rc) const;
|
||||
void staticCheckMenuAndTB() const;
|
||||
void dynamicCheckMenuAndTB() const;
|
||||
void enableConvertMenuItems(formatType f) const;
|
||||
void checkUnicodeMenuItems() const;
|
||||
|
@ -483,14 +484,6 @@ private:
|
|||
void setLanguage(LangType langType);
|
||||
enum LangType menuID2LangType(int cmdID);
|
||||
|
||||
int getFolderMarginStyle() const;
|
||||
|
||||
void checkFolderMarginStyleMenu(int id2Check) const {
|
||||
::CheckMenuRadioItem(_mainMenuHandle, IDM_VIEW_FOLDERMAGIN_SIMPLE, IDM_VIEW_FOLDERMAGIN_BOX, id2Check, MF_BYCOMMAND);
|
||||
};
|
||||
|
||||
int getFolderMaginStyleIDFrom(folderStyle fStyle) const;
|
||||
|
||||
void checkMenuItem(int itemID, bool willBeChecked) const {
|
||||
::CheckMenuItem(_mainMenuHandle, itemID, MF_BYCOMMAND | (willBeChecked?MF_CHECKED:MF_UNCHECKED));
|
||||
};
|
||||
|
|
|
@ -76,6 +76,8 @@ void Notepad_plus_Window::init(HINSTANCE hInst, HWND parent, const TCHAR *cmdLin
|
|||
throw std::runtime_error("Notepad_plus_Window::init : CreateWindowEx() function return null");
|
||||
}
|
||||
|
||||
_notepad_plus_plus_core.staticCheckMenuAndTB();
|
||||
|
||||
gNppHWND = _hSelf;
|
||||
|
||||
// In setting the startup window position, take into account that the last-saved
|
||||
|
|
|
@ -492,7 +492,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
|||
{
|
||||
if ((lParam == 1) || (lParam == 2))
|
||||
{
|
||||
specialCmd(LOWORD(wParam), lParam);
|
||||
specialCmd(LOWORD(wParam));
|
||||
}
|
||||
else
|
||||
command(LOWORD(wParam));
|
||||
|
@ -1375,7 +1375,6 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
|
|||
|
||||
_lastRecentFileList.saveLRFL();
|
||||
saveScintillaParams(SCIV_PRIMARY);
|
||||
saveScintillaParams(SCIV_SECOND);
|
||||
saveGUIParams();
|
||||
saveUserDefineLangs();
|
||||
saveShortcuts();
|
||||
|
|
|
@ -842,8 +842,10 @@ void Notepad_plus::command(int id)
|
|||
::CheckMenuItem(_mainMenuHandle, IDM_VIEW_ALL_CHARACTERS, MF_BYCOMMAND | MF_UNCHECKED);
|
||||
::CheckMenuItem(_mainMenuHandle, IDM_VIEW_TAB_SPACE, MF_BYCOMMAND | (isChecked?MF_CHECKED:MF_UNCHECKED));
|
||||
_toolBar.setCheck(IDM_VIEW_ALL_CHARACTERS, false);
|
||||
_pEditView->showEOL(false);
|
||||
_pEditView->showWSAndTab(isChecked);
|
||||
_mainEditView.showEOL(false);
|
||||
_mainEditView.showWSAndTab(isChecked);
|
||||
_subEditView.showEOL(false);
|
||||
_subEditView.showWSAndTab(isChecked);
|
||||
break;
|
||||
}
|
||||
case IDM_VIEW_EOL:
|
||||
|
@ -853,8 +855,10 @@ void Notepad_plus::command(int id)
|
|||
::CheckMenuItem(_mainMenuHandle, IDM_VIEW_EOL, MF_BYCOMMAND | (isChecked?MF_CHECKED:MF_UNCHECKED));
|
||||
::CheckMenuItem(_mainMenuHandle, IDM_VIEW_ALL_CHARACTERS, MF_BYCOMMAND | MF_UNCHECKED);
|
||||
_toolBar.setCheck(IDM_VIEW_ALL_CHARACTERS, false);
|
||||
_pEditView->showEOL(isChecked);
|
||||
_pEditView->showWSAndTab(false);
|
||||
_mainEditView.showEOL(isChecked);
|
||||
_subEditView.showEOL(isChecked);
|
||||
_mainEditView.showWSAndTab(false);
|
||||
_subEditView.showWSAndTab(false);
|
||||
break;
|
||||
}
|
||||
case IDM_VIEW_ALL_CHARACTERS:
|
||||
|
@ -863,14 +867,16 @@ void Notepad_plus::command(int id)
|
|||
::CheckMenuItem(_mainMenuHandle, IDM_VIEW_EOL, MF_BYCOMMAND | MF_UNCHECKED);
|
||||
::CheckMenuItem(_mainMenuHandle, IDM_VIEW_TAB_SPACE, MF_BYCOMMAND | MF_UNCHECKED);
|
||||
::CheckMenuItem(_mainMenuHandle, IDM_VIEW_ALL_CHARACTERS, MF_BYCOMMAND | (isChecked?MF_CHECKED:MF_UNCHECKED));
|
||||
_pEditView->showInvisibleChars(isChecked);
|
||||
_mainEditView.showInvisibleChars(isChecked);
|
||||
_subEditView.showInvisibleChars(isChecked);
|
||||
_toolBar.setCheck(IDM_VIEW_ALL_CHARACTERS, isChecked);
|
||||
break;
|
||||
}
|
||||
|
||||
case IDM_VIEW_INDENT_GUIDE:
|
||||
{
|
||||
_pEditView->showIndentGuideLine(!_pEditView->isShownIndentGuide());
|
||||
_mainEditView.showIndentGuideLine(!_pEditView->isShownIndentGuide());
|
||||
_subEditView.showIndentGuideLine(!_pEditView->isShownIndentGuide());
|
||||
_toolBar.setCheck(IDM_VIEW_INDENT_GUIDE, _pEditView->isShownIndentGuide());
|
||||
checkMenuItem(IDM_VIEW_INDENT_GUIDE, _pEditView->isShownIndentGuide());
|
||||
break;
|
||||
|
@ -879,14 +885,16 @@ void Notepad_plus::command(int id)
|
|||
case IDM_VIEW_WRAP:
|
||||
{
|
||||
bool isWraped = !_pEditView->isWrap();
|
||||
_pEditView->wrap(isWraped);
|
||||
_mainEditView.wrap(isWraped);
|
||||
_subEditView.wrap(isWraped);
|
||||
_toolBar.setCheck(IDM_VIEW_WRAP, isWraped);
|
||||
checkMenuItem(IDM_VIEW_WRAP, isWraped);
|
||||
break;
|
||||
}
|
||||
case IDM_VIEW_WRAP_SYMBOL:
|
||||
{
|
||||
_pEditView->showWrapSymbol(!_pEditView->isWrapSymbolVisible());
|
||||
_mainEditView.showWrapSymbol(!_pEditView->isWrapSymbolVisible());
|
||||
_subEditView.showWrapSymbol(!_pEditView->isWrapSymbolVisible());
|
||||
checkMenuItem(IDM_VIEW_WRAP_SYMBOL, _pEditView->isWrapSymbolVisible());
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -3405,10 +3405,12 @@ void NppParameters::feedGUIParameters(TiXmlNode *node)
|
|||
{
|
||||
feedScintillaParam(SCIV_PRIMARY, element);
|
||||
}
|
||||
/*
|
||||
else if (!lstrcmp(nm, TEXT("ScintillaSecondaryView")))
|
||||
{
|
||||
feedScintillaParam(SCIV_SECOND, element);
|
||||
}
|
||||
*/
|
||||
else if (!lstrcmp(nm, TEXT("Backup")))
|
||||
{
|
||||
int i;
|
||||
|
@ -3621,6 +3623,20 @@ void NppParameters::feedScintillaParam(bool whichOne, TiXmlNode *node)
|
|||
_svp[whichOne]._folderStyle = FOLDER_STYLE_ARROW;
|
||||
else if (!lstrcmp(nm, TEXT("simple")))
|
||||
_svp[whichOne]._folderStyle = FOLDER_STYLE_SIMPLE;
|
||||
else if (!lstrcmp(nm, TEXT("none")))
|
||||
_svp[whichOne]._folderStyle = FOLDER_STYLE_NONE;
|
||||
}
|
||||
|
||||
// Line Wrap method
|
||||
nm = element->Attribute(TEXT("lineWrapMethod"));
|
||||
if (nm)
|
||||
{
|
||||
if (!lstrcmp(nm, TEXT("default")))
|
||||
_svp[whichOne]._lineWrapMethod = LINEWRAP_DEFAULT;
|
||||
else if (!lstrcmp(nm, TEXT("aligned")))
|
||||
_svp[whichOne]._lineWrapMethod = LINEWRAP_ALIGNED;
|
||||
else if (!lstrcmp(nm, TEXT("indent")))
|
||||
_svp[whichOne]._lineWrapMethod = LINEWRAP_INDENT;
|
||||
}
|
||||
|
||||
// Current Line Highlighting State
|
||||
|
@ -3804,8 +3820,14 @@ bool NppParameters::writeScintillaParams(const ScintillaViewParams & svp, bool w
|
|||
(scintNode->ToElement())->SetAttribute(TEXT("indentGuideLine"), svp._indentGuideLineShow?TEXT("show"):TEXT("hide"));
|
||||
const TCHAR *pFolderStyleStr = (svp._folderStyle == FOLDER_STYLE_SIMPLE)?TEXT("simple"):
|
||||
(svp._folderStyle == FOLDER_STYLE_ARROW)?TEXT("arrow"):
|
||||
(svp._folderStyle == FOLDER_STYLE_CIRCLE)?TEXT("circle"):TEXT("box");
|
||||
(svp._folderStyle == FOLDER_STYLE_CIRCLE)?TEXT("circle"):
|
||||
(svp._folderStyle == FOLDER_STYLE_NONE)?TEXT("none"):TEXT("box");
|
||||
(scintNode->ToElement())->SetAttribute(TEXT("folderMarkStyle"), pFolderStyleStr);
|
||||
|
||||
const TCHAR *pWrapMethodStr = (svp._lineWrapMethod == LINEWRAP_ALIGNED)?TEXT("aligned"):
|
||||
(svp._lineWrapMethod == LINEWRAP_INDENT)?TEXT("indent"):TEXT("default");
|
||||
(scintNode->ToElement())->SetAttribute(TEXT("lineWrapMethod"), pWrapMethodStr);
|
||||
|
||||
(scintNode->ToElement())->SetAttribute(TEXT("currentLineHilitingShow"), svp._currentLineHilitingShow?TEXT("show"):TEXT("hide"));
|
||||
(scintNode->ToElement())->SetAttribute(TEXT("wrapSymbolShow"), svp._wrapSymbolShow?TEXT("show"):TEXT("hide"));
|
||||
(scintNode->ToElement())->SetAttribute(TEXT("Wrap"), svp._doWrap?TEXT("yes"):TEXT("no"));
|
||||
|
|
|
@ -750,13 +750,15 @@ struct NppGUI
|
|||
struct ScintillaViewParams
|
||||
{
|
||||
ScintillaViewParams() : _lineNumberMarginShow(true), _bookMarkMarginShow(true),\
|
||||
_folderStyle(FOLDER_STYLE_BOX), _indentGuideLineShow(true),\
|
||||
_folderStyle(FOLDER_STYLE_BOX), _foldMarginShow(true), _indentGuideLineShow(true),\
|
||||
_currentLineHilitingShow(true), _wrapSymbolShow(false), _doWrap(false),\
|
||||
_zoom(0), _whiteSpaceShow(false), _eolShow(false){};
|
||||
_zoom(0), _whiteSpaceShow(false), _eolShow(false), _lineWrapMethod(LINEWRAP_ALIGNED){};
|
||||
bool _lineNumberMarginShow;
|
||||
bool _bookMarkMarginShow;
|
||||
//bool _docChangeStateMarginShow;
|
||||
folderStyle _folderStyle; //"simple", TEXT("arrow"), TEXT("circle") and "box"
|
||||
folderStyle _folderStyle; //"simple", "arrow", "circle", "box" and "none"
|
||||
lineWrapMethod _lineWrapMethod;
|
||||
bool _foldMarginShow;
|
||||
bool _indentGuideLineShow;
|
||||
bool _currentLineHilitingShow;
|
||||
bool _wrapSymbolShow;
|
||||
|
|
|
@ -1098,7 +1098,11 @@ void ScintillaEditView::defineDocType(LangType typeDoc)
|
|||
}
|
||||
}
|
||||
|
||||
showMargin(_SC_MARGE_FOLDER, isNeededFolderMarge(typeDoc));
|
||||
NppParameters *pNppParam = NppParameters::getInstance();
|
||||
ScintillaViewParams & svp = (ScintillaViewParams &)pNppParam->getSVP(SCIV_PRIMARY);
|
||||
if (svp._folderStyle != FOLDER_STYLE_NONE)
|
||||
showMargin(_SC_MARGE_FOLDER, isNeededFolderMarge(typeDoc));
|
||||
|
||||
switch (typeDoc)
|
||||
{
|
||||
case L_C :
|
||||
|
@ -2036,8 +2040,9 @@ void ScintillaEditView::performGlobalStyles()
|
|||
foldfgColor = style._bgColor;
|
||||
foldbgColor = style._fgColor;
|
||||
}
|
||||
ScintillaViewParams & svp = (ScintillaViewParams &)_pParameter->getSVP(SCIV_PRIMARY);
|
||||
for (int j = 0 ; j < NB_FOLDER_STATE ; j++)
|
||||
defineMarker(_markersArray[FOLDER_TYPE][j], _markersArray[_folderStyle][j], foldfgColor, foldbgColor);
|
||||
defineMarker(_markersArray[FOLDER_TYPE][j], _markersArray[svp._folderStyle][j], foldfgColor, foldbgColor);
|
||||
/*
|
||||
COLORREF unsavedChangebgColor = liteRed;
|
||||
i = stylers.getStylerIndexByName(TEXT("Unsaved change marker"));
|
||||
|
|
|
@ -191,7 +191,7 @@ class ScintillaEditView : public Window
|
|||
public:
|
||||
ScintillaEditView()
|
||||
: Window(), _pScintillaFunc(NULL),_pScintillaPtr(NULL),
|
||||
_folderStyle(FOLDER_STYLE_BOX), _lineNumbersShown(false), _wrapRestoreNeeded(false)
|
||||
_lineNumbersShown(false), _wrapRestoreNeeded(false)
|
||||
{
|
||||
++_refCount;
|
||||
};
|
||||
|
@ -321,14 +321,28 @@ public:
|
|||
void marginClick(int position, int modifiers);
|
||||
|
||||
void setMakerStyle(folderStyle style) {
|
||||
if (_folderStyle == style)
|
||||
return;
|
||||
_folderStyle = style;
|
||||
for (int i = 0 ; i < NB_FOLDER_STATE ; i++)
|
||||
defineMarker(_markersArray[FOLDER_TYPE][i], _markersArray[style][i], white, grey);
|
||||
bool display;
|
||||
if (style == FOLDER_STYLE_NONE)
|
||||
{
|
||||
style = FOLDER_STYLE_BOX;
|
||||
display = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
display = true;
|
||||
}
|
||||
for (int i = 0 ; i < NB_FOLDER_STATE ; i++)
|
||||
defineMarker(_markersArray[FOLDER_TYPE][i], _markersArray[style][i], white, grey);
|
||||
showMargin(ScintillaEditView::_SC_MARGE_FOLDER, display);
|
||||
};
|
||||
|
||||
folderStyle getFolderStyle() {return _folderStyle;};
|
||||
|
||||
void setWrapMode(lineWrapMethod meth) {
|
||||
int mode = (meth == LINEWRAP_ALIGNED)?SC_WRAPINDENT_SAME:\
|
||||
(meth == LINEWRAP_INDENT)?SC_WRAPINDENT_INDENT:SC_WRAPINDENT_FIXED;
|
||||
execute(SCI_SETWRAPINDENTMODE, mode);
|
||||
};
|
||||
|
||||
|
||||
void showWSAndTab(bool willBeShowed = true) {
|
||||
execute(SCI_SETVIEWWS, willBeShowed?SCWS_VISIBLEALWAYS:SCWS_INVISIBLE);
|
||||
|
@ -627,7 +641,7 @@ protected:
|
|||
//Store the current buffer so it can be retrieved later
|
||||
BufferID _currentBufferID;
|
||||
Buffer * _currentBuffer;
|
||||
folderStyle _folderStyle;
|
||||
|
||||
NppParameters *_pParameter;
|
||||
int _codepage;
|
||||
bool _lineNumbersShown;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#ifndef SCINTILLA_REF_H
|
||||
#define SCINTILLA_REF_H
|
||||
|
||||
enum folderStyle {FOLDER_TYPE, FOLDER_STYLE_SIMPLE, FOLDER_STYLE_ARROW, FOLDER_STYLE_CIRCLE, FOLDER_STYLE_BOX};
|
||||
enum folderStyle {FOLDER_TYPE, FOLDER_STYLE_SIMPLE, FOLDER_STYLE_ARROW, FOLDER_STYLE_CIRCLE, FOLDER_STYLE_BOX, FOLDER_STYLE_NONE};
|
||||
enum lineWrapMethod {LINEWRAP_DEFAULT, LINEWRAP_ALIGNED, LINEWRAP_INDENT};
|
||||
|
||||
#endif //SCINTILLA_REF_H
|
||||
|
|
|
@ -66,34 +66,35 @@ IDD_PREFERENCE_MARGEIN_BOX DIALOGEX 0, 0, 455, 185
|
|||
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
|
||||
FONT 8, "MS Shell Dlg", 0, 0, 0x1
|
||||
BEGIN
|
||||
GROUPBOX "Folder Margin Style",IDC_FMS_GB_STATIC,60,69,149,42,BS_CENTER
|
||||
CONTROL "Simple",IDC_RADIO_SIMPLE,"Button",BS_AUTORADIOBUTTON | WS_GROUP,69,82,59,10
|
||||
CONTROL "Arrow",IDC_RADIO_ARROW,"Button",BS_AUTORADIOBUTTON,69,96,60,10
|
||||
CONTROL "Circle tree",IDC_RADIO_CIRCLE,"Button",BS_AUTORADIOBUTTON,142,82,62,10
|
||||
CONTROL "Box tree",IDC_RADIO_BOX,"Button",BS_AUTORADIOBUTTON,142,96,61,10
|
||||
CONTROL "Display line number",IDC_CHECK_LINENUMBERMARGE,
|
||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,61,117,141,10
|
||||
CONTROL "Display bookmark",IDC_CHECK_BOOKMARKMARGE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,61,129,150,10
|
||||
CONTROL "Enable current line highlighting",IDC_CHECK_CURRENTLINEHILITE,
|
||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,61,141,129,10
|
||||
CONTROL "Show vertical edge",IDC_CHECK_SHOWVERTICALEDGE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,240,81,122,10
|
||||
RTEXT "Number of columns :",IDC_NBCOLONE_STATIC,235,129,83,8
|
||||
LTEXT "0",IDC_COLONENUMBER_STATIC,325,128,18,8
|
||||
GROUPBOX "Vertical Edge Settings",IDC_VES_GB_STATIC,229,69,148,77,BS_CENTER
|
||||
CONTROL "Line mode",IDC_RADIO_LNMODE,"Button",BS_AUTORADIOBUTTON,243,97,91,10
|
||||
CONTROL "Background mode",IDC_RADIO_BGMODE,"Button",BS_AUTORADIOBUTTON,243,111,91,10
|
||||
GROUPBOX "",IDC_STATIC,48,54,350,118,0,WS_EX_DLGMODALFRAME | WS_EX_CLIENTEDGE
|
||||
COMBOBOX IDC_COMBO_SCINTILLAVIEWCHOIX,167,51,96,40,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
GROUPBOX "Caret Settings",IDC_CARETSETTING_STATIC,51,5,199,40,BS_CENTER
|
||||
LTEXT "Width :",IDC_WIDTH_STATIC,55,24,37,8,0,WS_EX_RIGHT
|
||||
COMBOBOX IDC_WIDTH_COMBO,94,22,40,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
LTEXT "Blink rate :",IDC_BLINKRATE_STATIC,166,17,50,8
|
||||
CONTROL "",IDC_CARETBLINKRATE_SLIDER,"msctls_trackbar32",TBS_AUTOTICKS | TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,161,29,67,13
|
||||
LTEXT "S",IDC_CARETBLINKRATE_S_STATIC,230,29,12,8
|
||||
LTEXT "F",IDC_CARETBLINKRATE_F_STATIC,149,29,12,8,0,WS_EX_RIGHT
|
||||
GROUPBOX "Multi-Editing Settings",IDC_MULTISELECTION_GB_STATIC,258,5,140,40,BS_CENTER
|
||||
CONTROL "Enable (Ctrl+Mouse click/selection)",IDC_CHECK_MULTISELECTION,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,266,22,130,10
|
||||
|
||||
GROUPBOX "Folder Margin Style",IDC_FMS_GB_STATIC,44,48,83,89,BS_CENTER
|
||||
CONTROL "Simple",IDC_RADIO_SIMPLE,"Button",BS_AUTORADIOBUTTON | WS_GROUP,53,61,59,10
|
||||
CONTROL "Arrow",IDC_RADIO_ARROW,"Button",BS_AUTORADIOBUTTON,53,75,60,10
|
||||
CONTROL "Circle tree",IDC_RADIO_CIRCLE,"Button",BS_AUTORADIOBUTTON,53,90,62,10
|
||||
CONTROL "None",IDC_RADIO_FOLDMARGENONE,"Button",BS_AUTORADIOBUTTON,53,119,61,10
|
||||
CONTROL "Box tree",IDC_RADIO_BOX,"Button",BS_AUTORADIOBUTTON,53,104,61,10
|
||||
CONTROL "Display line number",IDC_CHECK_LINENUMBERMARGE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,296,111,141,10
|
||||
CONTROL "Display bookmark",IDC_CHECK_BOOKMARKMARGE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,296,124,150,10
|
||||
CONTROL "Enable current line highlighting",IDC_CHECK_CURRENTLINEHILITE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,296,137,129,10
|
||||
CONTROL "Show vertical edge",IDC_CHECK_SHOWVERTICALEDGE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,151,60,122,10
|
||||
RTEXT "Number of columns :",IDC_NBCOLONE_STATIC,146,108,83,8
|
||||
LTEXT "0",IDC_COLONENUMBER_STATIC,236,107,18,8
|
||||
GROUPBOX "Vertical Edge Settings",IDC_VES_GB_STATIC,140,48,148,77,BS_CENTER
|
||||
CONTROL "Line mode",IDC_RADIO_LNMODE,"Button",BS_AUTORADIOBUTTON,154,76,91,10
|
||||
CONTROL "Background mode",IDC_RADIO_BGMODE,"Button",BS_AUTORADIOBUTTON,154,90,91,10
|
||||
GROUPBOX "Caret Settings",IDC_CARETSETTING_STATIC,44,5,199,40,BS_CENTER
|
||||
LTEXT "Width :",IDC_WIDTH_STATIC,48,24,37,8,0,WS_EX_RIGHT
|
||||
COMBOBOX IDC_WIDTH_COMBO,87,22,40,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
LTEXT "Blink rate :",IDC_BLINKRATE_STATIC,159,17,50,8
|
||||
CONTROL "",IDC_CARETBLINKRATE_SLIDER,"msctls_trackbar32",TBS_AUTOTICKS | TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,154,29,67,13
|
||||
LTEXT "S",IDC_CARETBLINKRATE_S_STATIC,223,29,12,8
|
||||
LTEXT "F",IDC_CARETBLINKRATE_F_STATIC,142,29,12,8,0,WS_EX_RIGHT
|
||||
GROUPBOX "Multi-Editing Settings",IDC_MULTISELECTION_GB_STATIC,251,5,140,40,BS_CENTER
|
||||
CONTROL "Enable (Ctrl+Mouse click/selection)",IDC_CHECK_MULTISELECTION,
|
||||
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,259,22,130,10
|
||||
GROUPBOX "Line Wrap",IDC_LW_GB_STATIC,299,48,92,56,BS_CENTER
|
||||
CONTROL "Default",IDC_RADIO_LWDEF,"Button",BS_AUTORADIOBUTTON | WS_GROUP,309,61,59,10
|
||||
CONTROL "Aligned",IDC_RADIO_LWALIGN,"Button",BS_AUTORADIOBUTTON,309,75,60,10
|
||||
CONTROL "Indent",IDC_RADIO_LWINDENT,"Button",BS_AUTORADIOBUTTON,309,89,62,10
|
||||
END
|
||||
|
||||
IDD_PREFERENCE_SETTING_BOX DIALOGEX 0, 0, 455, 185
|
||||
|
|
|
@ -328,19 +328,24 @@ BOOL CALLBACK BarsDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
void MarginsDlg::changePanelTo(int index)
|
||||
|
||||
void MarginsDlg::initScintParam()
|
||||
{
|
||||
NppParameters *pNppParam = NppParameters::getInstance();
|
||||
const ScintillaViewParams & svp = pNppParam->getSVP(index?SCIV_SECOND:SCIV_PRIMARY);
|
||||
const ScintillaViewParams & svp = pNppParam->getSVP(SCIV_PRIMARY);
|
||||
|
||||
::SendDlgItemMessage(_hSelf, IDC_RADIO_BOX, BM_SETCHECK, FALSE, 0);
|
||||
::SendDlgItemMessage(_hSelf, IDC_RADIO_CIRCLE, BM_SETCHECK, FALSE, 0);
|
||||
::SendDlgItemMessage(_hSelf, IDC_RADIO_ARROW, BM_SETCHECK, FALSE, 0);
|
||||
::SendDlgItemMessage(_hSelf, IDC_RADIO_SIMPLE, BM_SETCHECK, FALSE, 0);
|
||||
::SendDlgItemMessage(_hSelf, IDC_RADIO_FOLDMARGENONE, BM_SETCHECK, FALSE, 0);
|
||||
|
||||
int id = 0;
|
||||
switch (svp._folderStyle)
|
||||
{
|
||||
case FOLDER_STYLE_NONE:
|
||||
id = IDC_RADIO_FOLDMARGENONE;
|
||||
break;
|
||||
case FOLDER_STYLE_BOX:
|
||||
id = IDC_RADIO_BOX;
|
||||
break;
|
||||
|
@ -355,6 +360,19 @@ void MarginsDlg::changePanelTo(int index)
|
|||
}
|
||||
::SendDlgItemMessage(_hSelf, id, BM_SETCHECK, TRUE, 0);
|
||||
|
||||
switch (svp._lineWrapMethod)
|
||||
{
|
||||
case LINEWRAP_ALIGNED:
|
||||
id = IDC_RADIO_LWALIGN;
|
||||
break;
|
||||
case LINEWRAP_INDENT:
|
||||
id = IDC_RADIO_LWINDENT;
|
||||
break;
|
||||
default : // LINEWRAP_DEFAULT
|
||||
id = IDC_RADIO_LWDEF;
|
||||
}
|
||||
::SendDlgItemMessage(_hSelf, id, BM_SETCHECK, TRUE, 0);
|
||||
|
||||
::SendDlgItemMessage(_hSelf, IDC_CHECK_LINENUMBERMARGE, BM_SETCHECK, svp._lineNumberMarginShow, 0);
|
||||
::SendDlgItemMessage(_hSelf, IDC_CHECK_BOOKMARKMARGE, BM_SETCHECK, svp._bookMarkMarginShow, 0);
|
||||
::SendDlgItemMessage(_hSelf, IDC_CHECK_CURRENTLINEHILITE, BM_SETCHECK, svp._currentLineHilitingShow, 0);
|
||||
|
@ -374,6 +392,7 @@ void MarginsDlg::changePanelTo(int index)
|
|||
|
||||
}
|
||||
|
||||
|
||||
BOOL CALLBACK MarginsDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM)
|
||||
{
|
||||
NppParameters *pNppParam = NppParameters::getInstance();
|
||||
|
@ -400,12 +419,8 @@ BOOL CALLBACK MarginsDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM)
|
|||
::SendMessage(::GetDlgItem(_hSelf, IDC_CARETBLINKRATE_SLIDER),TBM_SETPAGESIZE, 0, BLINKRATE_INTERVAL);
|
||||
int blinkRate = (nppGUI._caretBlinkRate==0)?BLINKRATE_SLOWEST:nppGUI._caretBlinkRate;
|
||||
::SendMessage(::GetDlgItem(_hSelf, IDC_CARETBLINKRATE_SLIDER),TBM_SETPOS, TRUE, blinkRate);
|
||||
|
||||
::SendDlgItemMessage(_hSelf, IDC_COMBO_SCINTILLAVIEWCHOIX, CB_ADDSTRING, 0, (LPARAM)TEXT("Primary View"));
|
||||
::SendDlgItemMessage(_hSelf, IDC_COMBO_SCINTILLAVIEWCHOIX, CB_ADDSTRING, 0, (LPARAM)TEXT("Second View"));
|
||||
::SendDlgItemMessage(_hSelf, IDC_COMBO_SCINTILLAVIEWCHOIX, CB_SETCURSEL, 0, 0);
|
||||
|
||||
changePanelTo(SCIV_PRIMARY);
|
||||
|
||||
initScintParam();
|
||||
|
||||
ETDTProc enableDlgTheme = (ETDTProc)pNppParam->getEnableThemeDlgTexture();
|
||||
if (enableDlgTheme)
|
||||
|
@ -427,9 +442,8 @@ BOOL CALLBACK MarginsDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM)
|
|||
|
||||
case WM_COMMAND :
|
||||
{
|
||||
int i = ::SendDlgItemMessage(_hSelf, IDC_COMBO_SCINTILLAVIEWCHOIX, CB_GETCURSEL, 0, 0);
|
||||
ScintillaViewParams & svp = (ScintillaViewParams &)pNppParam->getSVP(i?SCIV_SECOND:SCIV_PRIMARY);
|
||||
int iView = i + 1;
|
||||
ScintillaViewParams & svp = (ScintillaViewParams &)pNppParam->getSVP(SCIV_PRIMARY);
|
||||
int iView = 1;
|
||||
switch (wParam)
|
||||
{
|
||||
case IDC_CHECK_LINENUMBERMARGE:
|
||||
|
@ -469,6 +483,10 @@ BOOL CALLBACK MarginsDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM)
|
|||
::SendMessage(_hParent, WM_COMMAND, IDM_VIEW_FOLDERMAGIN_BOX, iView);
|
||||
return TRUE;
|
||||
|
||||
case IDC_RADIO_FOLDMARGENONE:
|
||||
svp._folderStyle = FOLDER_STYLE_NONE;
|
||||
::SendMessage(_hParent, WM_COMMAND, IDM_VIEW_FOLDERMAGIN, iView);
|
||||
return TRUE;
|
||||
|
||||
case IDC_CHECK_SHOWVERTICALEDGE:
|
||||
{
|
||||
|
@ -514,6 +532,21 @@ BOOL CALLBACK MarginsDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
case IDC_RADIO_LWDEF:
|
||||
svp._lineWrapMethod = LINEWRAP_DEFAULT;
|
||||
::SendMessage(_hParent, WM_COMMAND, IDM_VIEW_LWDEF, iView);
|
||||
return TRUE;
|
||||
|
||||
case IDC_RADIO_LWALIGN:
|
||||
svp._lineWrapMethod = LINEWRAP_ALIGNED;
|
||||
::SendMessage(_hParent, WM_COMMAND, IDM_VIEW_LWALIGN, iView);
|
||||
return TRUE;
|
||||
|
||||
case IDC_RADIO_LWINDENT:
|
||||
svp._lineWrapMethod = LINEWRAP_INDENT;
|
||||
::SendMessage(_hParent, WM_COMMAND, IDM_VIEW_LWINDENT, iView);
|
||||
return TRUE;
|
||||
|
||||
default :
|
||||
switch (HIWORD(wParam))
|
||||
{
|
||||
|
@ -521,11 +554,6 @@ BOOL CALLBACK MarginsDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM)
|
|||
{
|
||||
switch (LOWORD(wParam))
|
||||
{
|
||||
case IDC_COMBO_SCINTILLAVIEWCHOIX :
|
||||
{
|
||||
changePanelTo(i);
|
||||
return TRUE;
|
||||
}
|
||||
case IDC_WIDTH_COMBO:
|
||||
{
|
||||
nppGUI._caretWidth = ::SendDlgItemMessage(_hSelf, IDC_WIDTH_COMBO, CB_GETCURSEL, 0, 0);
|
||||
|
|
|
@ -78,7 +78,7 @@ public :
|
|||
private :
|
||||
URLCtrl _verticalEdgeLineNbColVal;
|
||||
BOOL CALLBACK run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam);
|
||||
void changePanelTo(int index);
|
||||
void initScintParam();
|
||||
};
|
||||
|
||||
struct LangID_Name
|
||||
|
|
|
@ -68,7 +68,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|||
#define IDC_RADIO_LNMODE (IDD_PREFERENCE_MARGEIN_BOX + 12)
|
||||
#define IDC_RADIO_BGMODE (IDD_PREFERENCE_MARGEIN_BOX + 13)
|
||||
#define IDC_CHECK_CURRENTLINEHILITE (IDD_PREFERENCE_MARGEIN_BOX + 14)
|
||||
#define IDC_COMBO_SCINTILLAVIEWCHOIX (IDD_PREFERENCE_MARGEIN_BOX + 15)
|
||||
//#define IDC_COMBO_SCINTILLAVIEWCHOIX (IDD_PREFERENCE_MARGEIN_BOX + 15)
|
||||
|
||||
#define IDC_CARETSETTING_STATIC (IDD_PREFERENCE_MARGEIN_BOX + 16)
|
||||
#define IDC_WIDTH_STATIC (IDD_PREFERENCE_MARGEIN_BOX + 17)
|
||||
|
@ -80,6 +80,13 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|||
#define IDC_CHECK_DOCCHANGESTATEMARGE (IDD_PREFERENCE_MARGEIN_BOX + 23)
|
||||
#define IDC_MULTISELECTION_GB_STATIC (IDD_PREFERENCE_MARGEIN_BOX + 24)
|
||||
#define IDC_CHECK_MULTISELECTION (IDD_PREFERENCE_MARGEIN_BOX + 25)
|
||||
|
||||
#define IDC_RADIO_FOLDMARGENONE (IDD_PREFERENCE_MARGEIN_BOX + 26)
|
||||
|
||||
#define IDC_LW_GB_STATIC (IDD_PREFERENCE_MARGEIN_BOX + 27)
|
||||
#define IDC_RADIO_LWDEF (IDD_PREFERENCE_MARGEIN_BOX + 28)
|
||||
#define IDC_RADIO_LWALIGN (IDD_PREFERENCE_MARGEIN_BOX + 29)
|
||||
#define IDC_RADIO_LWINDENT (IDD_PREFERENCE_MARGEIN_BOX + 30)
|
||||
|
||||
#define IDD_PREFERENCE_SETTING_BOX 6300 //(IDD_PREFERENCE_BOX + 300)
|
||||
#define IDC_TABSETTING_GB_STATIC (IDD_PREFERENCE_SETTING_BOX + 1)
|
||||
|
|
|
@ -201,6 +201,9 @@
|
|||
#define IDM_VIEW_DRAWTABBAR_VERTICAL (IDM_VIEW + 43)
|
||||
#define IDM_VIEW_DRAWTABBAR_MULTILINE (IDM_VIEW + 44)
|
||||
#define IDM_VIEW_DOCCHANGEMARGIN (IDM_VIEW + 45)
|
||||
#define IDM_VIEW_LWDEF (IDM_VIEW + 46)
|
||||
#define IDM_VIEW_LWALIGN (IDM_VIEW + 47)
|
||||
#define IDM_VIEW_LWINDENT (IDM_VIEW + 48)
|
||||
|
||||
#define IDM_VIEW_FOLD (IDM_VIEW + 50)
|
||||
#define IDM_VIEW_FOLD_1 (IDM_VIEW_FOLD + 1)
|
||||
|
@ -303,10 +306,10 @@
|
|||
#define IDM_LANG_C (IDM_LANG + 2)
|
||||
#define IDM_LANG_CPP (IDM_LANG + 3)
|
||||
#define IDM_LANG_JAVA (IDM_LANG + 4)
|
||||
#define IDM_LANG_HTML (IDM_LANG + 5)
|
||||
#define IDM_LANG_HTML (IDM_LANG + 5)
|
||||
#define IDM_LANG_XML (IDM_LANG + 6)
|
||||
#define IDM_LANG_JS (IDM_LANG + 7)
|
||||
#define IDM_LANG_PHP (IDM_LANG + 8)
|
||||
#define IDM_LANG_PHP (IDM_LANG + 8)
|
||||
#define IDM_LANG_ASP (IDM_LANG + 9)
|
||||
#define IDM_LANG_CSS (IDM_LANG + 10)
|
||||
#define IDM_LANG_PASCAL (IDM_LANG + 11)
|
||||
|
|
Loading…
Reference in New Issue