Adding breakpoints

Questions on using RSyntaxTextArea should go here.

Moderator: robert

Adding breakpoints

Postby orenshk » Mon Aug 10, 2009 7:44 am

Hello,

I'm writing a debugger and want to implement breakpoint toggling. The highlighted text is shown in an RTextScrollPane, with setIconRowHeaderEnabled(true).
I tried attaching a mouselistner to the gutter with no effect, the mouse events are completely ignored.


Thanks!
Oren
orenshk
 

Re: Adding breakpoints

Postby robert » Mon Aug 10, 2009 1:01 pm

Hi Oren,

There's unfortunately currently no way to intercept mouse events in the icon area. The only way to do this at the moment is through API, so you'd have to have a menu item or some other custom UI for "Toggle Breakpoint," and do something like this:

Code: Select all
Gutter g = ...;
GutterIconInfo info = gutter.addLineTrackingIcon(line, myBreakpointIcon);
breakpoints.add(info);


I know that it would be a common request to be able to respond to mouse clicks in the icon area for things like breakpoints, so I can add this easily enough.
User avatar
robert
 
Posts: 796
Joined: Sat May 10, 2008 5:16 pm

Re: Adding breakpoints

Postby Guest » Mon Aug 10, 2009 9:53 pm

Hey Robert, thanks for the quick reply!

In the meantime, i've found sort of a hack by attaching the mouse listener to the Gutter's IconRowHeader and getting the line number from the event's location and the textArea's lineHeight. It's not pretty but it works.
Guest
 

Re: Adding breakpoints

Postby robert » Tue Aug 18, 2009 3:42 am

I've added RFE 2839374 on SourceForge so this isn't forgotten.
User avatar
robert
 
Posts: 796
Joined: Sat May 10, 2008 5:16 pm


Return to Help

Who is online

Users browsing this forum: No registered users and 3 guests

cron