Code folding menu options and window focus

General Discussion on RSyntaxTextArea.

Moderator: robert

Code folding menu options and window focus

Postby Tom K. » Thu Mar 29, 2012 9:49 pm

I've noticed that the popup menu folding options have no effect unless you
first set the focus on the RSyntaxTextArea/TextEditorPane window.

I forced this to happen in my own application by overriding the conveniently provided
configurePopupMenu method (see below) but thought you might want to consider
doing this explicitly in the base code.

java code:

class ScriptTextEditorPane extends TextEditorPane {

@Override
protected void configurePopupMenu(JPopupMenu arg) {

super.configurePopupMenu(arg);

// Set the focus so that the folding menu options
// always take effect.
this.requestFocusInWindow();
}

}


Keep up the great work!
Tom K.
Tom K.
 

Re: Code folding menu options and window focus

Postby robert » Thu Apr 05, 2012 1:11 pm

Thanks Tom, I'll take a look into it.
User avatar
robert
 
Posts: 760
Joined: Sat May 10, 2008 5:16 pm

Re: Code folding menu options and window focus

Postby robert » Sun Apr 15, 2012 4:27 am

Fixed in SVN revision 471. The editor now receives focus on RMB presses if not already focused.
User avatar
robert
 
Posts: 760
Joined: Sat May 10, 2008 5:16 pm


Return to Open Discussion

Who is online

Users browsing this forum: No registered users and 3 guests

cron