PreviousNextTracker indexSee it online !

(119/212) 328 - ShortCut OptionPane:mouse wheel + modifiers bound to actions

I would be nice to add this feature. Zooming by pressing CTR button and scrolling mouse.

Submitted *anonymous - 2010-01-17 22:07:54 Assigned
Priority 5 Labels core
Status open Group None
Resolution None

Comments

2010-01-18 02:09:24
daleanson

Here's a couple of macros that I use to "zoom" (increase/decrease the font size of) the text area. I have them assigned to Ctrl + = and Ctrl + -, which is the same key combination that Firefox uses to increase or decrease the font size. Just save these to your ~/.jedit/macros directory, then go to Utilities - Global Options - Shortcuts to assign the keyboard shortcuts. I don't know how these could be assigned to mouse actions.

Inc_Font.bsh:

public void incFont() {
java.awt.Font font = textArea.getPainter().getFont();
String name = font.getName();
int size = font.getSize() + 1;
int style = font.getStyle();
font = new Font( name, style, size );
SwingUtilities.invokeLater(
new Runnable() {
public void run() {
jEdit.setFontProperty( "view.font", font );
org.gjt.sp.jedit.EditBus.send(new org.gjt.sp.jedit.msg.PropertiesChanged(null));
}
}
);
}

incFont();

----------

Dec_Font.bsh:

public void decFont() {
java.awt.Font font = textArea.getPainter().getFont();
String name = font.getName();
int size = font.getSize();
size = size > 1 ? size - 1 : 1;
int style = font.getStyle();
font = new Font( name, style, size );
SwingUtilities.invokeLater(
new Runnable() {
public void run() {
jEdit.setFontProperty( "view.font", font );
org.gjt.sp.jedit.EditBus.send(new org.gjt.sp.jedit.msg.PropertiesChanged(null));
}
}
);
}

decFont();

2010-01-18 03:23:30
ezust

There are macros already that let you increase/decrease font size, under "Macros/Interface", which also increase/decrease the console and gutter font sizes.

But as far as I know, there is no way to bind the mouse wheel to actions in jEdit, is there?

It would be nice if we could bind wheel movements and ctrl+wheel movements to any action or macro, like we can with other keystrokes.

2010-01-18 03:26:29
ezust

- **labels**: 1026105 --> core
- **summary**: mouse wheel + modifiers bound to actions --> ShortCut OptionPane:mouse wheel + modifiers bound to actions

2014-03-18 18:54:09.401000
ezust

Related ticket: https://sourceforge.net/p/jedit/feature-requests/476/