diff --git a/uppsrc/CodeEditor/CSyntax.h b/uppsrc/CodeEditor/CSyntax.h index 5696f03d5..258fb9fde 100644 --- a/uppsrc/CodeEditor/CSyntax.h +++ b/uppsrc/CodeEditor/CSyntax.h @@ -39,7 +39,6 @@ protected: int highlight; // subtype (temporary) TODO - static int LoadSyntax(const char *keywords[], const char *names[]); static int InitUpp(const char **q); static void InitKeywords(); static const wchar *DoComment(HighlightOutput& hls, const wchar *p, const wchar *e); @@ -63,6 +62,8 @@ protected: bool CheckRightBracket(CodeEditor& e, int pos, int& bpos0, int& bpos); public: + static int LoadSyntax(const char *keywords[], const char *names[]); + enum HighlightType { HIGHLIGHT_NONE = -1, HIGHLIGHT_CPP = 0, HIGHLIGHT_USC, HIGHLIGHT_JAVA, HIGHLIGHT_T, HIGHLIGHT_CALC, HIGHLIGHT_LAY, HIGHLIGHT_SCH, HIGHLIGHT_SQL, HIGHLIGHT_CS, diff --git a/uppsrc/CodeEditor/CodeEditor.cpp b/uppsrc/CodeEditor/CodeEditor.cpp index c6bafb7ce..aa9ef29fa 100644 --- a/uppsrc/CodeEditor/CodeEditor.cpp +++ b/uppsrc/CodeEditor/CodeEditor.cpp @@ -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& 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; diff --git a/uppsrc/CodeEditor/CodeEditor.h b/uppsrc/CodeEditor/CodeEditor.h index c6ec08e91..4f1d052a4 100644 --- a/uppsrc/CodeEditor/CodeEditor.h +++ b/uppsrc/CodeEditor/CodeEditor.h @@ -191,6 +191,7 @@ public: virtual Image CursorImage(Point p, dword keyflags); virtual void Serialize(Stream& s); virtual void MouseLeave(); + virtual void MouseWheel(Point p, int zdelta, dword keyFlags); protected: virtual void HighlightLine(int line, Vector& h, int pos);