Author Topic: Codewright style activation of windows  (Read 8628 times)

jorick

  • Senior Community Member
  • Posts: 341
  • Hero Points: 15
Codewright style activation of windows
« on: June 26, 2008, 01:41:00 pm »
I'm a previous Codewright user and I'm used to the editor activating a window and moving the cursor to the click location with only one click.  SlickEdit, on the other hand, activates the window but doesn't move the cursor.  A second click is required to do that.

This is very confusing to me, especially when I'm working with two windows, cutting and pasting text between them.  I'll sometimes forget the extra click and the pasted text will go into the wrong location.  Or I'll forget that I'm already in the window and triple click a word and end up selecting the entire line.  I can't seem to get used to this.

Is there any way to have SlickEdit move the cursor to the click location when the focus moves to a new window?  Also, can that be done when focus moves from a different program to SlickEdit?  I don't see any options setting to do this.

jph

  • Community Member
  • Posts: 41
  • Hero Points: 0
Re: Codewright style activation of windows
« Reply #1 on: June 26, 2008, 02:43:57 pm »
Actually, I like the current behavior, which lets me click on a window to give it focus without having to worry about changing where I was editing.  So I would request that if a change were made, it be configurable.

jimlangrunner

  • Senior Community Member
  • Posts: 360
  • Hero Points: 31
  • Jim Lang - always a student.
Re: Codewright style activation of windows
« Reply #2 on: June 26, 2008, 03:09:32 pm »
I'm a former CodeWright user as well, and there are quite a few things that I miss.  I've found that most of the things I miss I've found workarounds for or have learned to live with the change.  After 3 years, it's a lot easier to live with Slick as it is. 

I'll second jpb's comment and state that I like the current behavior.  It's how most other software that I use works (try that in Word, for instance) and I'm big for consistency in my apps.

That said, there are quite a few macro wizards in the forums that may know how to modify Slick's behavior with a macro to cause the behavior you desire.

jim.

jorick

  • Senior Community Member
  • Posts: 341
  • Hero Points: 15
Re: Codewright style activation of windows
« Reply #3 on: July 02, 2008, 12:54:17 pm »
Any macro wizards out there that can help me?  Thanks!

MindprisM

  • Senior Community Member
  • Posts: 127
  • Hero Points: 8
Re: Codewright style activation of windows
« Reply #4 on: July 12, 2008, 10:31:14 pm »
This should work:


file: C:\SlickEdit2007\macros\stdprocs.e
insert code line below:   // INSERT THE LINE BELOW
Code: [Select]
void _on_got_focus()
{
   if (command_state()) {
      if (p_object==OI_TEXT_BOX) {
         if (p_window_id==_cmdline ||
             !p_auto_select || p_ReadOnly || p_style==PSCBO_NOEDIT ||
             !def_focus_select
             ) return;
         p_MouseActivate=MA_NOACTIVATEANDEAT;
         _set_sel(1,length(p_text)+1);
      }
      ArgumentCompletionTerminate();
      return;
   }
   ArgumentCompletionTerminate();
   // INSERT THE LINE BELOW
   p_MouseActivate=MA_ACTIVATE;
<original function continues...>

load the modified file <macro,load module>

MindprisM

  • Senior Community Member
  • Posts: 127
  • Hero Points: 8
Re: Codewright style activation of windows
« Reply #5 on: July 12, 2008, 10:35:20 pm »
Change it back with:
p_MouseActivate=MA_NOACTIVATEANDEAT;

jorick

  • Senior Community Member
  • Posts: 341
  • Hero Points: 15
Re: Codewright style activation of windows
« Reply #6 on: July 25, 2008, 02:53:51 pm »
Sorry for the delay but I didn't realize that there was a reply.

The change you suggested works when I change from an application back into SlickEdit (thanks!  :) ), but it doesn't work between SlickEdit windows.  Is there another place I can change to allow mouse clicks to be applied between SlickEdit windows?

(I clicked "Notify me of replies" so I'll know when there's a reply.)

jorick

  • Senior Community Member
  • Posts: 341
  • Hero Points: 15
Re: Codewright style activation of windows
« Reply #7 on: September 19, 2008, 03:53:44 pm »
I really need a solution to this problem.  This bug is starting to cost me time at work.

I double clicked in an unselected window to select a word that I wanted to copy.  However, since the window was unselected, it really required a triple click to select the word.  Instead of copying the word, it somehow copied half the source file.  I went back to the first window and did a paste but didn't see exactly what was pasted.  I then moved to a different part of the file and continued editing.

I didn't see any problem until I tried to compile.  I got numerous errors and only after a few minutes of searching did I find that what I copied was not what I pasted.  It took quite a while to determine what was real code and what was accidentally pasted.  Even now, I'm not sure if my source code is totally fixed (it compiles but some parts may be out of date).

This is nonstandard operation.  Every other editor I've ever used would change the focus and process the mouse click at the same time.  I use SlickEdit along with a number of IDE editors, and I cannot learn to add a mouse click in SlickEdit when I change edit windows.  The above mentioned fix only applies when I switch to SlickEdit from another application.  It doesn't work between windows within SlickEdit.

Please, somebody tell me how to get SlickEdit to process the click when I switch edit windows.

Rodney

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 736
  • Hero Points: 47
Re: Codewright style activation of windows
« Reply #8 on: September 19, 2008, 04:14:10 pm »
We snuck a feature in to the 13.0.2 update that allows you to turn on "Place cursor on focus click" from Options>Editing>Editor Windows. It is, of course, off by default.

This is not a macro fix, so you will have to be on v13 and patched up to 13.0.2 to get this feature.

--rodney

jorick

  • Senior Community Member
  • Posts: 341
  • Hero Points: 15
Re: Codewright style activation of windows
« Reply #9 on: September 22, 2008, 01:58:50 pm »
THANKYOUTHANKYOUTHANKYOU!!!

This is exactly what I need!

You guys are great!

xj97

  • Community Member
  • Posts: 21
  • Hero Points: 1
Re: Codewright style activation of windows
« Reply #10 on: September 22, 2008, 03:45:46 pm »
I actually liked the new Slick version of this behavior better, but it's cool to have the option to play with.

BUT, what I do miss is having a file I'm dragging over to Slick open up in the window that the mouse is over when I release the button (Codewright did this, if I recall correctly).  :)  Slick stuffs the file into the last activated window.  Maybe there is an existing way to remedy this?

b