Feature #984

CodeEditor features

Added by Iñaki Zabala about 9 years ago. Updated over 8 years ago.

Status:ApprovedStart date:02/13/2015
Priority:NormalDue date:
Assignee:Miroslav Fidler% Done:

0%

Category:CodeEditorSpent time:-
Target version:Release 2015.2

Description

Hello Mirek

I would like you to add these features to CodeEditor:

- To let the user to add new syntax:
In CSyntax.h, to make LoadSyntax() public.

- To add CTRL-Mouse wheel to zoom text
To add MouseWheel():

void CodeEditor::MouseWheel(Point p, int zdelta, dword keyFlags) {
if (keyFlags & K_CTRL)
ZoomFont(sgn(zdelta));
else
LineEdit::MouseWheel(p, zdelta, keyFlags);
}

void CodeEditor::ZoomFont(int d) { // Added
if(d != 0) {
int h = font.GetCy();
int q = font.GetHeight();
while(font.GetCy() == h && (d < 0 ? font.GetCy() > 5 : font.GetCy() < 40))
font.Height(q += d);
} else
font.Height(16);
SetFont(font);
bar.Refresh();
}

- To add CTRL-F, CTRL-H
In CodeEditor::Key, to add
case K_CTRL_F:
FindReplace(sel, true, false);
break;
case K_CTRL_H:
FindReplace(sel, true, true);
break;

Best regards
Koldo

History

#1 Updated by Zbigniew Rebacz about 9 years ago

Hello Koldo,

You can use "pre" tag to format your code on redmine:

<pre>

</pre>

To syntax highlight use "code class="cpp"" declaration.

More information:
http://www.redmine.org/projects/redmine/wiki/RedmineTextFormatting

#2 Updated by Iñaki Zabala about 9 years ago

Thank you!

#3 Updated by Miroslav Fidler over 8 years ago

  • Target version set to Release 2015.2

#4 Updated by Miroslav Fidler over 8 years ago

  • Status changed from New to Approved

Also available in: Atom PDF