CodeEditor: Improved for 'independent' (from theide) operation (thanks koldo) #984

git-svn-id: svn://ultimatepp.org/upp/trunk@8993 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2015-10-08 18:34:06 +00:00
parent 7b0c88a007
commit 48624d46db
3 changed files with 24 additions and 1 deletions

View file

@ -866,6 +866,12 @@ bool CodeEditor::Key(dword code, int count) {
}
bool sel = code & K_SHIFT;
switch(code & ~K_SHIFT) {
case K_CTRL_F:
FindReplace(sel, true, false);
break;
case K_CTRL_H:
FindReplace(sel, true, true);
break;
case K_F3:
if(sel)
FindPrev();
@ -1001,6 +1007,21 @@ void CodeEditor::PutI(WithDropChoice<EditString>& edit)
<<= THISBACK1(SetI, &edit);
}
void CodeEditor::MouseWheel(Point p, int zdelta, dword keyFlags) {
if(keyFlags & K_CTRL) {
Font f = GetFont();
int h = f.GetCy();
int q = f.GetHeight();
int d = sgn(zdelta);
while(f.GetCy() == h && (d < 0 ? f.GetCy() > 5 : f.GetCy() < 40))
f.Height(q += d);
SetFont(f);
EditorBarLayout();
}
else
LineEdit::MouseWheel(p, zdelta, keyFlags);
}
CodeEditor::CodeEditor() {
bracket_flash = false;
highlight_bracket_pos0 = 0;