AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Active GoTo v4
Goto page Previous  1, 2, 3, 4, 5, 6  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
toralf



Joined: 31 Jan 2005
Posts: 3841
Location: Bremen, Germany

PostPosted: Fri Dec 08, 2006 12:17 pm    Post subject: Reply with quote

foom wrote:
Great great great. Will you support seperate checkboxes in the future or do you dislike the idea?
Currently I see no benefit that justifies them, the interface will get more checkboxes, which will be too many for my taste (And I like GUIs!). Handling will get worse too. Please work with the current version if you feel after a month that you still miss it, we'll have to find a way to make it work smoothly. A combobox is no option for instance, radio buttons neither. But maybe you have an idea. There are many states that should be covered:
SHOW:
- all
- subroutines
- functions
- hotkeys
- hotstrings

Of cause you could combine the hotstuff to one item.
Of if you have individual checkboxes for each it will decrease to three CheckBoxes:
- subroutines
- functions
- hotstuff
I compressed two of them in a single checkbox. And I rarely use them. Please see for yourself how often you use such a feature. Searching is much faster then togglingthrough the checkbox.

Quote:
I have a couple of questions. You parse the file from disk because its hard to get the text directly from the editor? Is that right? What exactly is the problem here? Editors behave to different to find a solution that works on all?
Methods to get the text from window is slow and not reliable. At least that is what has been said and I couldn't prove it wrong. Rajat came up with the idea to just get it from disc. And since it is fast it doesn't matter to my any more. But if you know a better solution, post a prototype.
_________________
Ciao
toralf
Back to top
View user's profile Send private message Send e-mail Visit poster's website
foom



Joined: 19 Apr 2006
Posts: 386

PostPosted: Fri Dec 08, 2006 1:06 pm    Post subject: Reply with quote

Here are two proposals on how it could look. One is without offset. I see that it can be usefull for very long scripts but filtering should be able to cut the amount of entries so that you don't lose the overview even on 5000+ lines scripts. well its just a proposal.
Code:
#SingleInstance force
Gui, Margin, 2, 2
Gui,Add,Edit,w120 r1 ,
Gui,Add,Checkbox,x+4 yp+4,Show Only
Gui,Add,CheckBox,x2 y30,Label
Gui,Add,CheckBox,x+2,Func
Gui,Add,CheckBox,x+2,HKey
Gui,Add,CheckBox,x+2,HString
Gui,Show, center,Proposal2
Gui,2:Margin, 2, 2
Gui,2:Add,Edit,w120 r1 ,
Gui,2:Add,Checkbox,x+4 yp+4,Show Only
Gui,2:Add,CheckBox,x2 y30,L
Gui,2:Add,CheckBox,x+2,F
Gui,2:Add,CheckBox,x+2,HK
Gui,2:Add,CheckBox,x+2,HS
Gui,2:Add,Text,x+2,Offset:
Gui,2:Add,Edit,x+2 yp-3 w35 r1
Gui,2:Show, center,Proposal

toralf wrote:
But if you know a better solution, post a prototype.

I allready started to investigate it but i have to wait until Chris responds to this.
http://www.autohotkey.com/forum/topic14768.html
Back to top
View user's profile Send private message
toralf



Joined: 31 Jan 2005
Posts: 3841
Location: Bremen, Germany

PostPosted: Fri Dec 08, 2006 3:03 pm    Post subject: Reply with quote

I saw that post.

Thanks for the proposals. What would be the functionality behind the "Show Only" CheckBox? Same as current Filter?
_________________
Ciao
toralf
Back to top
View user's profile Send private message Send e-mail Visit poster's website
foom



Joined: 19 Apr 2006
Posts: 386

PostPosted: Fri Dec 08, 2006 11:24 pm    Post subject: Reply with quote

toralf wrote:
I saw that post.

Can you confirm the bug?

toralf wrote:
What would be the functionality behind the "Show Only" CheckBox? Same as current Filter?
Yeah i just renamed it. Filter felt somehow nondescriptive. Razz

Btw do the other editors support goto thru the commandline? Because ConTEXT does. ConTEXT.exe c:\path\to\file.ahk /gColumn:Line.
Back to top
View user's profile Send private message
toralf



Joined: 31 Jan 2005
Posts: 3841
Location: Bremen, Germany

PostPosted: Sat Dec 09, 2006 9:32 am    Post subject: Reply with quote

not that I know of. Can you test it? is it fast? I will look at PSPad.
_________________
Ciao
toralf
Back to top
View user's profile Send private message Send e-mail Visit poster's website
toralf



Joined: 31 Jan 2005
Posts: 3841
Location: Bremen, Germany

PostPosted: Sat Dec 09, 2006 9:46 am    Post subject: Reply with quote

I had a look at the documentation of SciTE and PSPad. They both seem to support a GoTo command line parameter. But they normally combine them with an open document command line parameter. Besides that ActiceGoTo must know the path to the editor exe I wonder what happens if such an open and goto command line will react on a document which has changed since last save. Will it discrad the changes, open it again and goto that line. That would be a desaster. How should the editor know to which window it should apply the goto if you have more then one instance running. Will it open another instance?
It seems more complicated and errorprone to me then the current approach. And I do not mind the short flickering of the goto window with the current approach.
_________________
Ciao
toralf
Back to top
View user's profile Send private message Send e-mail Visit poster's website
foom



Joined: 19 Apr 2006
Posts: 386

PostPosted: Sat Dec 09, 2006 11:32 am    Post subject: Reply with quote

toralf wrote:
I had a look at the documentation of SciTE and PSPad. They both seem to support a GoTo command line parameter. But they normally combine them with an open document command line parameter. Besides that ActiceGoTo must know the path to the editor exe I wonder what happens if such an open and goto command line will react on a document which has changed since last save. Will it discrad the changes, open it again and goto that line. That would be a desaster.

The document is not saved nor reloaded if you use this command on context or notepad++. The editors will detect that the file is allready open and just jump to the line.
toralf wrote:
How should the editor know to which window it should apply the goto if you have more then one instance running. Will it open another instance?

Well in ConTEXT and Notepad++ you cannot open a document twice.
toralf wrote:
It seems more complicated and errorprone to me then the current approach. And I do not mind the short flickering of the goto window with the current approach.

Well i just wanted to mention it incase you didn't kow and might like it. On my hand, if the time comes i'll investigate it further.
Back to top
View user's profile Send private message
foom



Joined: 19 Apr 2006
Posts: 386

PostPosted: Sat Dec 09, 2006 5:05 pm    Post subject: Reply with quote

Ok now that Chris has shown me my stupidity i investigated the issue on getting text from the control rather than reading a file.
It turns out its pretty easy in case of context and notepad++ and SciTE(probably other scintilla based editors too).
Code:
mbutton::
;;;;Note TrayTip shows only the first  265 characters.
traytip,, % GetTextFromControl()
return

GetTextFromControl()
{
    WinGet, ProcName , ProcessName, A
    if ProcName = Notepad.exe
        ControlGetText, text ,Edit1, A
    else if ProcName = ConTEXT.exe
        ControlGetText, text ,TConTEXTSynEdit1, A
    else if regexmatch(ProcName, "i)(?:Sc(?:\d+|iTE))|(?:notepad(?:\+\+|2)).exe")
        ControlGetText, text ,Scintilla1, A
    return (text ? text : "")
}

Edit:
Added more editors. The only one that is missing from the ones you support is pspad.
Back to top
View user's profile Send private message
toralf



Joined: 31 Jan 2005
Posts: 3841
Location: Bremen, Germany

PostPosted: Sun Dec 10, 2006 12:30 am    Post subject: Reply with quote

I tried it shortly with PSPad. One problem that occurs is that the code text has different ClassNN for each tab (PSPad opens multiple files in tabs) and depending on if the log window has been opened or not they start with TPSSynEdit1 or TPSSynEdit2. From there on I get NNs that change or stay constant when I flip around the tabs. Very funny, but not reliable.

I will test to use command line parameter for goto.
_________________
Ciao
toralf
Back to top
View user's profile Send private message Send e-mail Visit poster's website
foom



Joined: 19 Apr 2006
Posts: 386

PostPosted: Sun Dec 10, 2006 11:45 am    Post subject: Reply with quote

Well P"o"SPad just sucks. Tested it and its not possible to get reliable info.
If log is not shown the control is PSSynEdit1
If its shown the important control is PSSynEdit2
If you open the FTP window it is PSSynEdit3
I suspect this goes on whenever you open a new window that uses the PSSynEdit class. But acctual Edits where you type your code in are not causing this behavior.
I am thinking about a fallback mode where if active editor is PSPad then read the file from disk else get text from control.
Or one could use mouse get pose and check if its a PSSynEdit under the mouse, and use this control. This has 2 disadvantages. 1.)If mouse is over the log window you get wrong text. 2.) If mouse is over an other controlclass then PSSynEdit you get not info at all.

Regarding the commandline issue.
I tested a bit with scite and this editor is not usable with this. It opens new instances of itself and stuff.
How about creating a function that uses different way depending on the editor?
Back to top
View user's profile Send private message
newrui
Guest





PostPosted: Tue Jan 16, 2007 2:17 pm    Post subject: Reply with quote

May we have support for EditPlus? Or could you show me how to add it myself?

I tried to add the following, it recognizes EditPlus but doesn't grab any functions/subs.

Code:
EditorTitelRegEx =         
  (LTrim Comments
    ^PSPad(?: - \[)?(?P<Name>.*?)(?P<UnSaved> \*)?(?: R/O)?\]?$   ;PSPad
    ^(?P<Name>.*?) (?P<UnSaved>[-*]) SciTE$                       ;SciTE
    ^Notepad\+\+ - (?P<Name>.*?)$                                 ;Notepad++
    ^(?P<UnSaved>\*)?(?P<Name>.*?)(?: \(Read only\))? - Notepad2$ ;Notepad2
    ^ConTEXT(?: - \[)?(?P<Name>.*?)(?P<UnSaved> \*?#?)?(?: \[ReadOnly\])?\]?$ ;ConTEXT
    EditPlus                                                      ;EditPlus
  )
;Class or Window Title of GoTo Window for the different editors
GotoWinClassOrTitle =     
  (LTrim Comments
     ahk_class TfGotoLine     ;PSPad
     ahk_class #32770         ;SciTE
     ahk_class #32770         ;Notepad++
     ahk_class #32770         ;Notepad2
     ahk_class TForm          ;ConTEXT
     ahk_class #32770         ;EditPlus
  )
;ShortCut for GoTo in Editor, in case it is different from Ctrl+g
GotoShortCut =
  (LTrim Comments
     ^g     ;PSPad
     ^g     ;SciTE
     ^g     ;Notepad++
     ^g     ;Notepad2
     ^g     ;ConTEXT
     ^g     ;EditPlus
  )
Back to top
toralf



Joined: 31 Jan 2005
Posts: 3841
Location: Bremen, Germany

PostPosted: Tue Jan 16, 2007 4:31 pm    Post subject: Reply with quote

Dear newrui,

You have to write an RegEx (the strings in EditorTitelRegEx) for the Title of your EditPlus Editor. The title has to contain the full path of the currently opened file. Otherwise it will not work.

If you have no experience with it, please post the exact titles of:
1) When the editor is open and has no file open, or it is empty
2) When a saved file is open
3) When the file got changed but isn't saved yet.
4) When a file that is read only is open
From these title we can dereive the RegEx for EditPlus.
_________________
Ciao
toralf
Back to top
View user's profile Send private message Send e-mail Visit poster's website
newrui
Guest





PostPosted: Wed Jan 17, 2007 2:00 pm    Post subject: Reply with quote

Hello Toralf,

I just started learning RegEx, but I have a hard time comprehending a long string of RegEx and figuring out what it is that Active GoTo is looking for. I'd appreciate a little help Smile

1) EditPlus or ahk_class Afx:400000:8:10011:0:7800917
2) EditPlus - [C:\Tools.AHK]
3) EditPlus - [C:\Tools.AHK *]
4) EditPlus - [C:\Tools.AHK] (same but the tab browsing icon looks different)

Let me know if i can offer further info.

Thanks!

Ray
Back to top
toralf



Joined: 31 Jan 2005
Posts: 3841
Location: Bremen, Germany

PostPosted: Wed Jan 17, 2007 7:59 pm    Post subject: Reply with quote

Then please try this:
Code:
^EditPlus(?: - \[)?(?P<Name>.*?)(?P<UnSaved> \*)?\]?$   ;EditPlus
Please post the result
_________________
Ciao
toralf
Back to top
View user's profile Send private message Send e-mail Visit poster's website
newrui
Guest





PostPosted: Thu Jan 18, 2007 1:34 pm    Post subject: Reply with quote

toralf wrote:
Then please try this:
Code:
^EditPlus(?: - \[)?(?P<Name>.*?)(?P<UnSaved> \*)?\]?$   ;EditPlus
Please post the result


Thanks! It works!

I do have a small favor to ask though. In the next update, may we have a toggle setting for just functions and subroutines? Also can we have Active GoTo to remember that setting for next session?
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page Previous  1, 2, 3, 4, 5, 6  Next
Page 5 of 6

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group