[NEW_FEATURE] refine the styles configurator : cancel all modifications if the style configurator dialog is not closed while quit Notepad++.

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@25 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
donho 2007-09-05 23:51:57 +00:00
parent 315e38d7cd
commit 16d7ca3406
4 changed files with 11 additions and 4 deletions

View File

@ -6652,6 +6652,9 @@ LRESULT Notepad_plus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
const NppGUI & nppgui = pNppParam->getNppGUI();
if (::IsWindowVisible(_configStyleDlg.getHSelf()))
_configStyleDlg.restoreGlobalOverrideValues();
Session currentSession;
if (nppgui._rememberLastSession)
getCurrentOpenedFiles(currentSession);

View File

@ -402,7 +402,7 @@ private:
ColumnEditorDlg _colEditorDlg;
WordStyleDlg _configStyleDlg;
PreferenceDlg _preference;
// a handle list of all the Notepad++ dialogs
vector<HWND> _hModelessDlgs;

View File

@ -199,11 +199,10 @@ BOOL CALLBACK WordStyleDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lPar
//::MessageBox(NULL, "dirty", "", MB_OK);
LexerStylerArray & lsArray = (NppParameters::getInstance())->getLStylerArray();
StyleArray & globalStyles = (NppParameters::getInstance())->getGlobalStylers();
GlobalOverride & gOverride = (NppParameters::getInstance())->getGlobalOverrideStyle();
globalStyles = _globalStyles = _gstyles2restored;
lsArray = _lsArray = _styles2restored;
gOverride = _gOverride2restored;
restoreGlobalOverrideValues();
_isDirty = false;
setVisualFromStyleList();

View File

@ -98,6 +98,11 @@ public :
::InvalidateRect(_hStyleInfoStaticText, NULL, TRUE);
::UpdateWindow(_hStyleInfoStaticText);
};
void restoreGlobalOverrideValues() {
GlobalOverride & gOverride = (NppParameters::getInstance())->getGlobalOverrideStyle();
gOverride = _gOverride2restored;
};
void apply();