diff --git a/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.aps b/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.aps index 14e898ba8..115d65915 100644 Binary files a/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.aps and b/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.aps differ diff --git a/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.cpp b/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.cpp index d1c566792..6c7750718 100644 --- a/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.cpp +++ b/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.cpp @@ -64,7 +64,6 @@ BOOL CALLBACK WordStyleDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lPar { _lsArray = (NppParameters::getInstance())->getLStylerArray(); _globalStyles = (NppParameters::getInstance())->getGlobalStylers(); - ::SendDlgItemMessage(_hSelf, IDC_LANGUAGES_LIST, LB_ADDSTRING, 0, (LPARAM)"Global Styles"); // All the lexers @@ -190,18 +189,28 @@ BOOL CALLBACK WordStyleDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lPar break; case IDCANCEL : - if (_isDirty) - { - _lsArray = (NppParameters::getInstance())->getLStylerArray(); - _globalStyles = (NppParameters::getInstance())->getGlobalStylers(); - _isDirty = false; - setVisualFromStyleList(); - } - ::EnableWindow(::GetDlgItem(_hSelf, IDOK), FALSE); - ::EnableWindow(::GetDlgItem(_hSelf, IDC_SAVECLOSE_BUTTON), !_isSync); - display(false); - return TRUE; + //::MessageBox(NULL, "cancel", "", MB_OK); + if (_isDirty) + { + //::MessageBox(NULL, "dirty", "", MB_OK); + LexerStylerArray & lsArray = (NppParameters::getInstance())->getLStylerArray(); + StyleArray & globalStyles = (NppParameters::getInstance())->getGlobalStylers(); + globalStyles = _globalStyles = _gstyles2restored; + lsArray = _lsArray = _styles2restored; + + _isDirty = false; + setVisualFromStyleList(); + ::SendMessage(_hParent, WM_UPDATESCINTILLAS, 0, 0); + + } + //else + //::MessageBox(NULL, "no dirty", "", MB_OK); + //::EnableWindow(::GetDlgItem(_hSelf, IDOK), FALSE); + ::EnableWindow(::GetDlgItem(_hSelf, IDC_SAVECLOSE_BUTTON), !_isSync); + display(false); + return TRUE; +/* case IDOK : //_isDirty == true; { LexerStylerArray & lsa = (NppParameters::getInstance())->getLStylerArray(); @@ -216,7 +225,7 @@ BOOL CALLBACK WordStyleDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lPar ::SendMessage(_hParent, WM_UPDATESCINTILLAS, 0, 0); return TRUE; } - +*/ case IDC_SAVECLOSE_BUTTON : { if (_isDirty) @@ -690,7 +699,7 @@ void WordStyleDlg::apply() globalStyles = _globalStyles; ::EnableWindow(::GetDlgItem(_hSelf, IDOK), FALSE); - _isDirty = false; + //_isDirty = false; _isSync = false; ::SendMessage(_hParent, WM_UPDATESCINTILLAS, 0, 0); } \ No newline at end of file diff --git a/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.h b/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.h index 8b56e411c..fa54c8766 100644 --- a/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.h +++ b/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.h @@ -74,14 +74,25 @@ public : void doDialog(bool isRTL = false) { if (!isCreated()) + { create(IDD_STYLER_DLG, isRTL); + _styles2restored = (NppParameters::getInstance())->getLStylerArray(); + _gstyles2restored = (NppParameters::getInstance())->getGlobalStylers(); + //::MessageBox(NULL, "", "gogogogo", MB_OK); + } + + if (!::IsWindowVisible(_hSelf)) + { + _styles2restored = (NppParameters::getInstance())->getLStylerArray(); + _gstyles2restored = (NppParameters::getInstance())->getGlobalStylers(); + //::MessageBox(NULL, "", "gogogogo", MB_OK); + } display(); }; virtual void redraw() const { _pFgColour->redraw(); _pBgColour->redraw(); - //StaticDialog::redraw(); ::InvalidateRect(_hStyleInfoStaticText, NULL, TRUE); ::UpdateWindow(_hStyleInfoStaticText); }; @@ -112,6 +123,9 @@ private : LexerStylerArray _lsArray; StyleArray _globalStyles; + LexerStylerArray _styles2restored; + StyleArray _gstyles2restored; + ColourStaticTextHooker colourHooker; bool _isDirty; @@ -166,7 +180,7 @@ private : }; long notifyDataModified() { _isDirty = true; - ::EnableWindow(::GetDlgItem(_hSelf, IDOK), TRUE); + //::EnableWindow(::GetDlgItem(_hSelf, IDOK), TRUE); ::EnableWindow(::GetDlgItem(_hSelf, IDC_SAVECLOSE_BUTTON), TRUE); return TRUE; } diff --git a/PowerEditor/src/WinControls/Preference/preference.rc b/PowerEditor/src/WinControls/Preference/preference.rc index f01a2022f..fd907b840 100644 --- a/PowerEditor/src/WinControls/Preference/preference.rc +++ b/PowerEditor/src/WinControls/Preference/preference.rc @@ -176,7 +176,7 @@ BEGIN CTEXT "Top",IDC_MT_STATIC,197,46,54,8 LTEXT "Right",IDC_MR_STATIC,257,78,29,8 CTEXT "Bottom",IDC_MB_STATIC,197,111,54,8 - GROUPBOX "Marge Setting (Unit:mm)",IDC_MARGESETTINGS_STATIC,153, + GROUPBOX "Margin Setting (Unit:mm)",IDC_MARGESETTINGS_STATIC,153, 32,144,96,BS_CENTER END diff --git a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp index 0d74960ab..8b3a28af8 100644 --- a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp +++ b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp @@ -31,6 +31,7 @@ BOOL CALLBACK PreferenceDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lPa _printSettingsDlg.init(_hInst, _hSelf); _printSettingsDlg.create(IDD_PREFERENCE_PRINT_BOX); + _printSettings2Dlg.init(_hInst, _hSelf); _printSettings2Dlg.create(IDD_PREFERENCE_PRINT2_BOX); @@ -45,7 +46,7 @@ BOOL CALLBACK PreferenceDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lPa _wVector.push_back(DlgInfo(&_defaultNewDocDlg, "New Document", "NewDoc")); _wVector.push_back(DlgInfo(&_fileAssocDlg, "File Association", "FileAssoc")); _wVector.push_back(DlgInfo(&_langMenuDlg, "Language Menu", "LangMenu")); - _wVector.push_back(DlgInfo(&_printSettingsDlg, "Print - Colour and Marge", "Print1")); + _wVector.push_back(DlgInfo(&_printSettingsDlg, "Print - Colour and Margin", "Print1")); _wVector.push_back(DlgInfo(&_printSettings2Dlg, "Print - Header and Footer", "Print2")); _wVector.push_back(DlgInfo(&_backupDlg, "Backup", "Backup")); _wVector.push_back(DlgInfo(&_settingsDlg, "MISC", "MISC"));