Browse Source

[UPDATE] Remove apply button in Stylers configurator.

Now the visual effect is update immediately.


git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@19 f5eea248-9336-0410-98b8-ebc06183d4e3
pull/343/head^2
donho 17 years ago
parent
commit
dee59a4ce7
  1. 28
      PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.cpp
  2. 2
      PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.h
  3. 4
      PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.rc

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

@ -159,6 +159,7 @@ BOOL CALLBACK WordStyleDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lPar
{ {
updateUserKeywords(); updateUserKeywords();
notifyDataModified(); notifyDataModified();
apply();
} }
else if (editID == IDC_USER_EXT_EDIT) else if (editID == IDC_USER_EXT_EDIT)
{ {
@ -173,16 +174,19 @@ BOOL CALLBACK WordStyleDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lPar
case IDC_BOLD_CHECK : case IDC_BOLD_CHECK :
updateFontStyleStatus(BOLD_STATUS); updateFontStyleStatus(BOLD_STATUS);
notifyDataModified(); notifyDataModified();
apply();
break; break;
case IDC_ITALIC_CHECK : case IDC_ITALIC_CHECK :
updateFontStyleStatus(ITALIC_STATUS); updateFontStyleStatus(ITALIC_STATUS);
notifyDataModified(); notifyDataModified();
apply();
break; break;
case IDC_UNDERLINE_CHECK : case IDC_UNDERLINE_CHECK :
updateFontStyleStatus(UNDERLINE_STATUS); updateFontStyleStatus(UNDERLINE_STATUS);
notifyDataModified(); notifyDataModified();
apply();
break; break;
case IDCANCEL : case IDCANCEL :
@ -254,6 +258,7 @@ BOOL CALLBACK WordStyleDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lPar
GlobalOverride & glo = (NppParameters::getInstance())->getGlobalOverrideStyle(); GlobalOverride & glo = (NppParameters::getInstance())->getGlobalOverrideStyle();
glo.enableFg = (BST_CHECKED == ::SendDlgItemMessage(_hSelf, wParam, BM_GETCHECK, 0, 0)); glo.enableFg = (BST_CHECKED == ::SendDlgItemMessage(_hSelf, wParam, BM_GETCHECK, 0, 0));
notifyDataModified(); notifyDataModified();
apply();
return TRUE; return TRUE;
} }
@ -262,6 +267,7 @@ BOOL CALLBACK WordStyleDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lPar
GlobalOverride & glo = (NppParameters::getInstance())->getGlobalOverrideStyle(); GlobalOverride & glo = (NppParameters::getInstance())->getGlobalOverrideStyle();
glo.enableBg = (BST_CHECKED == ::SendDlgItemMessage(_hSelf, wParam, BM_GETCHECK, 0, 0)); glo.enableBg = (BST_CHECKED == ::SendDlgItemMessage(_hSelf, wParam, BM_GETCHECK, 0, 0));
notifyDataModified(); notifyDataModified();
apply();
return TRUE; return TRUE;
} }
@ -270,6 +276,7 @@ BOOL CALLBACK WordStyleDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lPar
GlobalOverride & glo = (NppParameters::getInstance())->getGlobalOverrideStyle(); GlobalOverride & glo = (NppParameters::getInstance())->getGlobalOverrideStyle();
glo.enableFont = (BST_CHECKED == ::SendDlgItemMessage(_hSelf, wParam, BM_GETCHECK, 0, 0)); glo.enableFont = (BST_CHECKED == ::SendDlgItemMessage(_hSelf, wParam, BM_GETCHECK, 0, 0));
notifyDataModified(); notifyDataModified();
apply();
return TRUE; return TRUE;
} }
case IDC_GLOBAL_FONTSIZE_CHECK : case IDC_GLOBAL_FONTSIZE_CHECK :
@ -277,6 +284,7 @@ BOOL CALLBACK WordStyleDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lPar
GlobalOverride & glo = (NppParameters::getInstance())->getGlobalOverrideStyle(); GlobalOverride & glo = (NppParameters::getInstance())->getGlobalOverrideStyle();
glo.enableFontSize = (BST_CHECKED == ::SendDlgItemMessage(_hSelf, wParam, BM_GETCHECK, 0, 0)); glo.enableFontSize = (BST_CHECKED == ::SendDlgItemMessage(_hSelf, wParam, BM_GETCHECK, 0, 0));
notifyDataModified(); notifyDataModified();
apply();
return TRUE; return TRUE;
} }
case IDC_GLOBAL_BOLD_CHECK : case IDC_GLOBAL_BOLD_CHECK :
@ -284,6 +292,7 @@ BOOL CALLBACK WordStyleDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lPar
GlobalOverride & glo = (NppParameters::getInstance())->getGlobalOverrideStyle(); GlobalOverride & glo = (NppParameters::getInstance())->getGlobalOverrideStyle();
glo.enableBold = (BST_CHECKED == ::SendDlgItemMessage(_hSelf, wParam, BM_GETCHECK, 0, 0)); glo.enableBold = (BST_CHECKED == ::SendDlgItemMessage(_hSelf, wParam, BM_GETCHECK, 0, 0));
notifyDataModified(); notifyDataModified();
apply();
return TRUE; return TRUE;
} }
@ -292,6 +301,7 @@ BOOL CALLBACK WordStyleDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lPar
GlobalOverride & glo = (NppParameters::getInstance())->getGlobalOverrideStyle(); GlobalOverride & glo = (NppParameters::getInstance())->getGlobalOverrideStyle();
glo.enableItalic = (BST_CHECKED == ::SendDlgItemMessage(_hSelf, wParam, BM_GETCHECK, 0, 0)); glo.enableItalic = (BST_CHECKED == ::SendDlgItemMessage(_hSelf, wParam, BM_GETCHECK, 0, 0));
notifyDataModified(); notifyDataModified();
apply();
return TRUE; return TRUE;
} }
case IDC_GLOBAL_UNDERLINE_CHECK : case IDC_GLOBAL_UNDERLINE_CHECK :
@ -299,6 +309,7 @@ BOOL CALLBACK WordStyleDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lPar
GlobalOverride & glo = (NppParameters::getInstance())->getGlobalOverrideStyle(); GlobalOverride & glo = (NppParameters::getInstance())->getGlobalOverrideStyle();
glo.enableUnderLine = (BST_CHECKED == ::SendDlgItemMessage(_hSelf, wParam, BM_GETCHECK, 0, 0)); glo.enableUnderLine = (BST_CHECKED == ::SendDlgItemMessage(_hSelf, wParam, BM_GETCHECK, 0, 0));
notifyDataModified(); notifyDataModified();
apply();
return TRUE; return TRUE;
} }
@ -312,10 +323,12 @@ BOOL CALLBACK WordStyleDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lPar
case IDC_FONT_COMBO : case IDC_FONT_COMBO :
updateFontName(); updateFontName();
notifyDataModified(); notifyDataModified();
apply();
break; break;
case IDC_FONTSIZE_COMBO : case IDC_FONTSIZE_COMBO :
updateFontSize(); updateFontSize();
notifyDataModified(); notifyDataModified();
apply();
break; break;
case IDC_LANGUAGES_LIST : case IDC_LANGUAGES_LIST :
{ {
@ -337,12 +350,14 @@ BOOL CALLBACK WordStyleDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lPar
{ {
updateColour(C_FOREGROUND); updateColour(C_FOREGROUND);
notifyDataModified(); notifyDataModified();
apply();
return TRUE; return TRUE;
} }
else if ((HWND)lParam == _pBgColour->getHSelf()) else if ((HWND)lParam == _pBgColour->getHSelf())
{ {
updateColour(C_BACKGROUND); updateColour(C_BACKGROUND);
notifyDataModified(); notifyDataModified();
apply();
return TRUE; return TRUE;
} }
else else
@ -666,3 +681,16 @@ void WordStyleDlg::create(int dialogID, bool isRTL)
} }
} }
void WordStyleDlg::apply()
{
LexerStylerArray & lsa = (NppParameters::getInstance())->getLStylerArray();
StyleArray & globalStyles = (NppParameters::getInstance())->getGlobalStylers();
lsa = _lsArray;
globalStyles = _globalStyles;
::EnableWindow(::GetDlgItem(_hSelf, IDOK), FALSE);
_isDirty = false;
_isSync = false;
::SendMessage(_hParent, WM_UPDATESCINTILLAS, 0, 0);
}

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

@ -86,6 +86,8 @@ public :
::UpdateWindow(_hStyleInfoStaticText); ::UpdateWindow(_hStyleInfoStaticText);
}; };
void apply();
private : private :

4
PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.rc

@ -54,8 +54,8 @@ BEGIN
LTEXT "User Define keywords",IDC_USER_KEYWORDS_STATIC,349,116,126,8 LTEXT "User Define keywords",IDC_USER_KEYWORDS_STATIC,349,116,126,8
LTEXT "+",IDC_PLUSSYMBOL_STATIC,335,142,8,8 LTEXT "+",IDC_PLUSSYMBOL_STATIC,335,142,8,8
PUSHBUTTON "Cancel",IDCANCEL,332,198,57,14 PUSHBUTTON "Cancel",IDCANCEL,332,198,57,14
PUSHBUTTON "Apply",IDOK,264,198,60,14 //PUSHBUTTON "Apply",IDOK,264,198,60,14
PUSHBUTTON "Save && Close",IDC_SAVECLOSE_BUTTON,188,198,69,14 PUSHBUTTON "Save && Close",IDC_SAVECLOSE_BUTTON,255,198,69,14
CONTROL "",IDC_SC_PERCENTAGE_SLIDER,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | NOT WS_VISIBLE | WS_TABSTOP,441,208,53,10 CONTROL "",IDC_SC_PERCENTAGE_SLIDER,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | NOT WS_VISIBLE | WS_TABSTOP,441,208,53,10
CONTROL "Transparency",IDC_SC_TRANSPARENT_CHECK,"Button", BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,431,197,63, 10 CONTROL "Transparency",IDC_SC_TRANSPARENT_CHECK,"Button", BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,431,197,63, 10
LISTBOX IDC_LANGUAGES_LIST,17,22,59,146,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP LISTBOX IDC_LANGUAGES_LIST,17,22,59,146,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP

Loading…
Cancel
Save