Author Topic: SlickEdit Bug / Questions  (Read 1012 times)

RobertH2

  • Community Member
  • Posts: 20
  • Hero Points: 1
SlickEdit Bug / Questions
« on: April 09, 2015, 04:01:54 am »
SlickEdit Bug / Questions:

1. I have a toolbar button that toggles another toolbar on and off. When turning it back on, it does not return to its last position. It always gets put after the top main toolbar. What I want to do is toggle a toolbar(s) with less frequently used commands, but have it return to where it was last docked.

2. When a Minus sign is displayed for Selective Display (the code is unfolded) there is no indication of the lines that will fold within this block. Not such a big deal in a program code files (although very nice to have), but I'm often editing text documents. Is there a way to show an indication of lines that will be re-folded?

3. Is there a toggle command that will fold/unfold all lines in the current Selective Display? The "show_all" command removes the all folds and the "plusminus" command only toggles the current block. Again not such a big deal for program code files, though nice, but very useful for text documents.

4. Can the Plus and Minus Selective Display icons be enlarged? I have a large monitor and these indicators are minuscule.

5. Is there a command/macro to toggle (reassign) keys to the mouse buttons? The current default behaviour of the forward and back mouse buttons to jump between files is nice and I want to use it sometimes. But I also want to use them for Undo/Redo. A toggle command to reassign the keys would be perfect.


Version: SlickEdit 2014 (v19.0.1.1 64-bit)
Emulation: Brief
OS: Windows 8.1

hs2

  • Senior Community Member
  • Posts: 2733
  • Hero Points: 285
Re: SlickEdit Bug / Questions
« Reply #1 on: April 09, 2015, 06:50:35 am »
@RobertH2: I can only say something related to 3. and 5.
3. 'expand_all'
5. I've only used static key bindings until now, but 'bind_to_key' should allow changing bindings of [optional modifiers + ]ForwardButtonDn, BackButtonDn dynamically.
Means I'd try to change just the commands bound to the keys/mouse buttons.

Good luck, HS2

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 4536
  • Hero Points: 349
Re: SlickEdit Bug / Questions
« Reply #2 on: April 09, 2015, 12:57:56 pm »
1. SlickEdit currently uses Qt's toolbar docking code. We plan to write our own toolbar docking code for v20. Hopefully, we can do better than Qt in regard to this.

2. No, not yet.

4. No. There are only Icon size settings for toolbar buttons right now. You could try changing the icons sizes yourself but this would require building the state file or writing a macro to load them. Not trivial. Also, things might go wonky if you only changed the size of some of the icons in the gutter. There are a bunch of them (bookmarks, break points, etc.).

5. It would be easier to use a Ctrl or Shift to get alternate function instead of toggling bindings which sounds confusing but is doable.

Graeme

  • Senior Community Member
  • Posts: 2210
  • Hero Points: 272
Re: SlickEdit Bug / Questions
« Reply #3 on: April 09, 2015, 01:43:56 pm »
What command do you use to toggle the toolbar on/off - toggle-defs seems to bring the defs toolwindow up in the same place if it's docked.

Not sure if this is what hs2 is suggesting but in case you're serious about switching mouse button operation you could do it like this.

Code: [Select]
#include "slick.sh"

#pragma option(strictsemicolons,on)
#pragma option(strict,on)
#pragma option(autodecl,off)
#pragma option(strictparens,on)


static boolean mouse_button_mode;

_command void switch_my_mousebutton_mode() name_info(',')
{
   mouse_button_mode = !mouse_button_mode;
   message(mouse_button_mode ? "back mode active" : "undo mode active");
}

_command void my_backbutton_down() name_info(',')
{
   if (mouse_button_mode) {
      back();
   }
   else
      undo();
}


_command void my_fwdbutton_down() name_info(',')
{
   if (mouse_button_mode) {
      forward();
   }
   else
      redo();
}


hs2

  • Senior Community Member
  • Posts: 2733
  • Hero Points: 285
Re: SlickEdit Bug / Questions
« Reply #4 on: April 09, 2015, 03:10:41 pm »
@Graeme: Not exactly :) I thought of re-binding the mouse events with bind_to_key but this might be an overkill.
I think your approach is better.
HS2

RobertH2

  • Community Member
  • Posts: 20
  • Hero Points: 1
Re: SlickEdit Bug / Questions
« Reply #5 on: April 10, 2015, 01:34:31 am »
@hs2

Thanks a lot for your help! I was able to get the non-destructive fold/unfold to work with the following code. I set up the "IsCollasped" variable as a boolean at the start of my custom macro file.

{
   if (IsCollasped) {
      expand_all();   IsCollasped=false;
   } else {
      collapse_all();   IsCollasped=true;
   }
}

I could not get the bind_to_key to work without bringing up the UI key assignment form and I wanted the key swapping to occur by just clicking a button. Clark came up with a better solution (see below).



@Clark

Thanks for your reply!

For item 2. 'Unfold line block connectors', do you have an rough ETA, (weeks, months, next year, etc)? This is an important feature for me, and one that an end-user can not code around.

For item 5. 'Dynamically remapping keys/mouse buttons', thanks for your suggestion, I did not know you could use key modifiers on mouse buttons, and this made for a much better solution... Thanks!



@Graeme

Thanks for taking the time with the code example! I have not tested it yet because I went with Clarks suggestion of using a key modifier with the mouse click. However I'm very interested and will test your code out later.

The 'toggle-defs' command brings up the 'defs toolwindow' as you said, but what I wanted was to toggle one/many toolbars. You can do this by finding the name of the toolbar, in my case "tbform4". Then the commands:

   toggle_toolbar('tbform4');
   tbHide('tbform4');
   tbShow('tbform4');

will toggle, hide or show the named toolbar. The only problem with these commands is they don't put the toolbar back to its last position, but instead, in my case, display it after the first toolbar.

Thank you all very much for your replies and help! Much appreciated...


RobertH2

  • Community Member
  • Posts: 20
  • Hero Points: 1
Re: SlickEdit Bug / Questions
« Reply #6 on: April 10, 2015, 04:35:23 pm »
@ Graeme

Thanks so much! I really liked your solution to this problem. Instead of remapping the keys, remapping the commands... very cool! I can see using this technique in other problems.

Thanks again for your efforts!