Browse Source

[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
pull/343/head^2
donho 17 years ago
parent
commit
16d7ca3406
  1. 3
      PowerEditor/src/Notepad_plus.cpp
  2. 2
      PowerEditor/src/Notepad_plus.h
  3. 5
      PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.cpp
  4. 5
      PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.h

3
PowerEditor/src/Notepad_plus.cpp

@ -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);

2
PowerEditor/src/Notepad_plus.h

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

5
PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.cpp

@ -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();

5
PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.h

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

Loading…
Cancel
Save