Jump to content

SciTE Hopper 0.1 Jump to Any line by one click !!


Ashalshaikh
 Share

Recommended Posts

Hi ..

First! I started learning English in the past few months ... If there are some mistakes , Excuse me for this ...

Updated 19 September 2010

SciTE Hopper 0.1

SciTE Hopper make you can do more with less time , it's make you jump hundreds lines by one click , with convenient interface ,

SciTE Hopper can choose perfect positions on the screen !!

it refresh automatically ...

All functions and regions will be in the list ...

Just one click to jump !!

Features

It's Fast !!

--- Checked 6000 Line in 800 millisecond

Compatible with SciTE window !!

--- Measure the program window and show compatible Window with it

---And it can follow SciTE state .

Adjustable

---SciTE Hopper has many options..

One-Click to jump

Show anchor in the middle of the screen

---Version 0.1 show anchor in the middle of screen !!

Speed

The test was on file has 6005 line ,Checking took :

-- Version 0.1 (Newest Version).

------ 724.20636583522 milliseconds = 0.72 second !!

For test 2-3.

------ 823.192941227742 milliseconds = 0.82 second

For test 1.

------ 361073.553741173 milliseconds = 6 minutes ;) !!

What is New ?

-- Better GUI

-- Options

-- Automatic Position and Height value

-- Follow SciTE state .!!

-- You can set height

-- Go to line function

-- Removed Auto Anchors Sort

-- Hide Anchor by add //

-- Many bugs have been fixed -- See Changelog

-- More speed !!!!

-- Less wrongs

-- You can delete user anchors

Example Au3 script

You can test SciTE Hopper with this script

#Region == Anchors --[ Do not change any thing ]----
;0xDD48678F1B44555F7592262D34AF2BA3|Anchor 2 |This is Anchor 2
;0x870578CC6DD69E2E7A98190EC0D5C76B|Anchor 1|This is Anchor 1
#EndRegion == Anchors --[ Do not change any thing ]----












#Region Var //
$msg = 'Script for test'
#EndRegion Var




























;#---- Anchor (0x870578CC6DD69E2E7A98190EC0D5C76B) -----------------






















#Region msgbox
_msgbox($msg)
#EndRegion msgbox
























;#---- Anchor (0xDD48678F1B44555F7592262D34AF2BA3) -----------------


























Func _msgbox($msg)
    MsgBox(0, '', $msg)
    _msgbox1($msg & ' 1' )
EndFunc






























Func _msgbox1($msg) ;//
    MsgBox(0, '', $msg)
EndFunc

pic :-

Posted Image

New Help File !!

-- For Ver : Version 0.1

-- Language : English

-- Author : Ashalshaikh

-- Translator : Th3 MMA

-- Date : September 2010

pic :

Download :-

- Here

SciTE Hopper 0.1.rar

- Box.net

---- http://www.box.net/shared/caqxvzphb1

-------- au3 file + help file

ChangeLog

Change log of SciTE Hopper
Version 0.1 --> Date : 19 September 2010
    Improved : Refresh Button text to refresh
    Improved : checking the anchors to check all anchors in the same time 
    Improved : add every icon one time in the imagelist
    Improved : Change GUI Controls postions.
    Added : Go To Line
    Added : Delete User Anchor
    Added : Hide Anchors by add //
    Added : The options
    Added : Cleaning the list if the SciTE does not exist
    Added : Cleaning the list if you switch SciTE to Untitled file
    Fixed : User anchor is placed exactly at the cursor position - even if the cursor is in the middle of a line
    Fixed : Black background of the List Icons
        Thanks taiete
    Fixed : SciTE Hopper stops if you switch SciTE to file does not have any line
    Fixed : SciTE Hopper sometimes adds the anchor info outsid the User Anchors Region
    Fixed : SciTE Hopper stops working if ther is some empty line inside UserAnchors Region.
    Removed : Anchors automatic sorting
    
For test 3 --> Date : 12 September 2010 - 04:41 PM
    Fixed : SciTE Hopper stops working if you switch SciTE to file does not have User Anchors
        Thanks guinness
    Fixed : Jumping to User Anchors does not work
    Fixed : Searching.

For test 2 --> Date : 12 September 2010 - 02:51 PM
    improved: chenge FileReadLine to _FileReadToArray for more speed.
        Thanks Melba23
    improved : Changed jump to Func Anchors via FileReadLine To (SciTE Find) 
    Fixed : missing window if SciTE Hopper runing with SciTE minimized window.
        Thanks wakillon
    Added : Search Anchor box but it is not working.
    Added : Refresh Button (( R ))
    Added : List Icons 
For test 1 --> Date : 11 September 2010 - 03:18 PM
    First Version

To Do List

  • Make SciTE UDF !! --> Done . click here ;)
  • Make user can add types of anchors :)
  • Make HotKeys
  • Verify that options file exists
  • check the validity of the options file
  • check existing name & des before add new user anchor
  • check existing user Anchor before jump
  • Add auto sort option enable/disable
  • Add button to add Hopper to tools menu --> By : Melb32

Edit : 20 sept --> add link to SciTE UDF & write new item to to do list.

-----------------------------------

Old post

if you work with large script .. now you can jump rapidly !!

SciTE Hopper ..

Now Movement is rapidly !!!Jump to Any line faster !! good Addition

Now it's just for test !!

Pic

Posted Image

There are three kinds of Anchors:-

1 ) User Anchor .

---------you can insert anchor on any line ..

---------How can i make one ?

------------------1) click on any line you want in SciTE.

------------------2) click on insert anchor.

------------------3) write the name and description for this anchor

------------------4) click on Ok !!

2) Functions Anchors !!

---------SciTE Hopper check 'Func'

2) Regions Anchors !!

---------SciTE Hopper check 'Regions'

How can I jump to Anchor ?

---------Just click on its name on list or select it and click on 'go there' button

*) SciTE Hopper recheck Anchors if :

---------size of au3 script changes .. so if you want to update lists just press Ctrl+s !

---------you add new User Anchor.

---------you change SciTe Tab

*) Do not use same name and description for two User Anchors !!

*) SciTE Hopper Window will be in the right side automatically !!

New Version !! Here

SciTE Hopper .. For test 3

click here to know new things in (for test 2)

SciTE Hopper for test 2

Code : (( Now just for test ))

;=======================================================
;SciTE Hopper ::: just for test
;By : Ashalshaikh : Ahmad Alshaikh ..
;tested with Autoit v3.3.6.1
;=======================================================

#include <SendMessage.au3>
#include <Array.au3>
#include <file.au3>
#include <GuiTreeView.au3>
#include <Crypt.au3>
If Not ProcessExists('SciTE.exe') Then
    MsgBox(16, '', 'Run SciTE First')
    Exit
EndIf

$Pos = WinGetPos(WinGetHandle("[CLASS:SciTEWindow]"))
;Global $t_Pos = $Pos ;;; For Auto Move
$MainGUI = GUICreate("SciTE Hopper By : Ashalshaikh", 216, 447)
$about = GUICtrlCreateButton("About", 20, 2, 135, 25)
;~ GUIRegisterMsg(0x004E, '_GUI_Notifly_WunPos')
 If IsArray($Pos) Then WinMove($MainGUI, '', $Pos[0] + $Pos[2] - 250, $Pos[1] + 100)
WinSetOnTop($MainGUI, '', 1)
$TreeView = _GUICtrlTreeView_Create($MainGUI, 8, 72, 200, 297)
;~ $TreeView = GUICtrlCreateTreeView(8, 72, 153, 297)
$UserItem = _GUICtrlTreeView_Add($TreeView, 0, 'User (Custom)')
;~ GUICtrlSetColor(-1, 0x0000C0)
$Funcitem = _GUICtrlTreeView_Add($TreeView, 0, "Functions")
;~ GUICtrlSetColor(-1, 0x0000C0)
$Regionitem = _GUICtrlTreeView_Add($TreeView, 0, "#Regions")
$GoThere = GUICtrlCreateButton("Go there", 17, 376, 135, 25)
$InsertAnchor = GUICtrlCreateButton("Insert Anchor", 17, 40, 135, 25)
GUISetState(@SW_SHOW)

Global $tmpFile, $tmpSize, $tmpCode
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        case $about
MsgBox(64,"About","SciTE Hopper .. Fast Move !! " & @CRLF & "it is very helpfull with large scripts !!!" & @CRLF & @CRLF & "By : Ashalshaikh : Ahmad Alshaikh" & @CRLF & @CRLF & "This version only for testing.")

        Case -3
            Exit
        Case $GoThere
            $Code = _TreeViewGetSelectedCode($TreeView)
            If @error Then ContinueLoop
            _AnchorsMoveToAnc($tmpFile, $Code, @extended)
        Case $InsertAnchor
            Local $Code, $Name, $Des
            If _GetInfo($Code, $Name, $Des) = 0 Then ContinueLoop
            _AnchorsUserAncInsert($tmpFile, $Code, $Name, $Des)
    EndSwitch
    _Refresh()


    $Code = _TreeViewGetSelectedCode($TreeView)
    If @error Then ContinueLoop
    If $Code = $tmpCode Then ContinueLoop
    $tmpCode = $Code
    _AnchorsMoveToAnc($tmpFile, $Code, @extended)
WEnd

;~ Func _GUI_Notifly_WunPos($s, $SS, $rer, $er)
;~  Local $h = WinGetHandle("[CLASS:SciTEWindow]")
;~  Local $r_Pos = WinGetPos($h)
;~  If IsArray($r_Pos) And $r_Pos <> $t_Pos Then
;~      WinMove($MainGUI, '', $r_Pos[0] + $r_Pos[2] - 250, $r_Pos[1] + 100)
;~  EndIf
;~  $r_Pos = $t_Pos
;~ EndFunc   ;==>_GUI_Notifly_WunPos


Func _GetInfo(ByRef $Code, ByRef $Name, ByRef $Des)
    #Region ### START Koda GUI section ### Form=
    GUISetState(@SW_DISABLE, $MainGUI)
    $GetInfo = GUICreate("", 303, 115, Default, Default, Default, Default, $MainGUI)
    GUICtrlCreateLabel("Name : ", 8, 8, 41, 17)
    $NameInp = GUICtrlCreateInput("", 56, 8, 241, 21)
    GUICtrlCreateLabel("Description : ", 8, 36, 70, 17)
    $DesInp = GUICtrlCreateInput("", 80, 36, 217, 21)
    GUICtrlCreateLabel("Code :", 8, 64, 35, 17)
    $CodeInp = GUICtrlCreateInput("", 48, 64, 249, 21, 0x0800)
    $OkBut = GUICtrlCreateButton('Ok', 126.5, 90, 70, 20)

    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
            Case -3
                GUISetState(@SW_ENABLE, $MainGUI)
                GUIDelete($GetInfo)
                Return 0
            Case $OkBut

                $Code = GUICtrlRead($CodeInp)
                $Name = GUICtrlRead($NameInp)
                $Des = GUICtrlRead($DesInp)
                GUISetState(@SW_ENABLE, $MainGUI)
                GUIDelete($GetInfo)
                Return 1

        EndSwitch
GUICtrlSetData($CodeInp, _CodeGen(GUICtrlRead($NameInp), GUICtrlRead($DesInp)))
    WEnd
EndFunc   ;==>_GetInfo

Func _CodeGen($Name, $Des)
return _Crypt_HashData($Name& $Des,$CALG_MD5)
EndFunc   ;==>_CodeGen



Func _Refresh($Flag = 0) ;  0 = Func Refresh :: 1 = Manual Refresh
    #Region ____ Reading File ----------------------
    $File = _SciTEGetFilePath()
    If @error Then
        _GUICtrlTreeView_BeginUpdate($TreeView)
        _GUICtrlTreeView_DeleteAll($TreeView)
;~ $TreeView = GUICtrlCreateTreeView(8, 72, 153, 297)
        $UserItem = _GUICtrlTreeView_Add($TreeView, 0, 'User (Custom)')
;~ GUICtrlSetColor(-1, 0x0000C0)
        $Funcitem = _GUICtrlTreeView_Add($TreeView, 0, "Functions")
;~ GUICtrlSetColor(-1, 0x0000C0)
        $Regionitem = _GUICtrlTreeView_Add($TreeView, 0, "#Regions")
        _GUICtrlTreeView_EndUpdate($TreeView)
    EndIf
    If $tmpFile == $File And $tmpSize == FileGetSize($File) Then Return
;~  Switch @error
;~      Case 1
;~          MsgBox(16, '', 'SciTE windows missing')
;~          ContinueLoop
;~      Case 2
;~          MsgBox(16, '', 'Please Save your file first')
;~          ContinueLoop
;~      Case 3
;~          MsgBox(16, '', 'Your file is messing')
;~          ContinueLoop
;~  EndSwitch
    $tmpFile = $File
    $tmpSize = FileGetSize($File)
    _GUICtrlTreeView_BeginUpdate($TreeView)
    _GUICtrlTreeView_DeleteAll($TreeView)
;~ $TreeView = GUICtrlCreateTreeView(8, 72, 153, 297)
    $UserItem = _GUICtrlTreeView_Add($TreeView, 0, 'User (Custom)')
;~ GUICtrlSetColor(-1, 0x0000C0)
    $Funcitem = _GUICtrlTreeView_Add($TreeView, 0, "Functions")
;~ GUICtrlSetColor(-1, 0x0000C0)
    $Regionitem = _GUICtrlTreeView_Add($TreeView, 0, "#Regions")
    _GUICtrlTreeView_EndUpdate($TreeView)
    #EndRegion ____ Reading File ----------------------
    #Region ___ User Anchors --------------------------
    $AnchorArr = _AnchorsGetUserAnc($File)
;~  Switch @error
;~      Case 1
;~          MsgBox(16, '', 'There is no Anchors')
;~          ContinueLoop
;~      Case 2
;~          MsgBox(16, '', 'Error at Anchors writing')
;~          ContinueLoop
;~  EndSwitch
    If Not @error Then
        _GUICtrlTreeView_BeginUpdate($TreeView)
        For $i = 1 To $AnchorArr[0][0]
            Local $tmp_Cild = _GUICtrlTreeView_AddChild($TreeView, $UserItem, $AnchorArr[$i][1] & ' | ' & $AnchorArr[$i][2] & ' | ' & $AnchorArr[$i][0])
        Next
        _GUICtrlTreeView_EndUpdate($TreeView)
        #EndRegion ___ User Anchors --------------------------
    EndIf
    #Region __FuncAnchor ----------------------------
    $FuncAnchors = _AnchorsGetFuncAnc($File)
    _GUICtrlTreeView_BeginUpdate($TreeView)
    For $i = 1 To $FuncAnchors[0]
        _GUICtrlTreeView_AddChild($TreeView, $Funcitem, $FuncAnchors[$i])
    Next
    _GUICtrlTreeView_EndUpdate($TreeView)
    #EndRegion __FuncAnchor ----------------------------
    #Region __RegionAnchor ----------------------------
    $RegionAnchors = _AnchorsGetRegionAnc($File)
    _GUICtrlTreeView_BeginUpdate($TreeView)
    For $i = 1 To $RegionAnchors[0]
        _GUICtrlTreeView_AddChild($TreeView, $Regionitem, $RegionAnchors[$i])
    Next
    _GUICtrlTreeView_EndUpdate($TreeView)
    #EndRegion __RegionAnchor ----------------------------
EndFunc   ;==>_Refresh





Func _TreeViewGetSelectedCode($TreeView)
    Local $Text = _GUICtrlTreeView_GetText($TreeView, _GUICtrlTreeView_GetSelection($TreeView))
    If $Text = '' Then Return SetError(1)
    If $Text = 'User (Custom)' Then Return SetError(1)
    If $Text = 'Functions' Then Return SetError(1)
    If $Text = '#Regions' Then Return SetError(1)

    If StringRight($Text, 3) = ' #R' Then ;#Region Anchor
        Return SetExtended(2, StringTrimRight($Text, 3))
    ElseIf StringInStr($Text, ' | ') Then ;User Anchor
        Local $SS = StringSplit($Text, '|') ; ' | ' Space Between Info
;~      _ArrayDisplay ($SS)
        Return SetExtended(0, StringStripWS($SS[3], 3))
    Else ;Functions
        Return SetExtended(1, $Text)
    EndIf

EndFunc   ;==>_TreeViewGetSelectedCode

;#---- Anchor (023_00127) -----------------

Func _AnchorsMoveToAnc($File, $Code, $Flag = 0) ;$Flag = 0 : User Anchor .. $Flag = 1 : Func Anchor .. $Flag = 2 : #Region Anchor
    If $Flag = 0 Then
        _SciTEFind('Anchor (' & $Code & ')') ; Good !!
    ElseIf $Flag = 1 Then
        Local $OP = FileOpen($File, 0), $tLineCount = _FileCountLines($File), $ReturnArray, $tmpReturn = ''
        For $x = 1 To $tLineCount
            If StringInStr(FileReadLine($OP, $x), $Code) And StringLeft(FileReadLine($tmpFile, $x), 5) = 'Func ' Then
                Local $x
                ExitLoop
            EndIf
        Next
        If $x - 1 = $tLineCount Then Return SetError(1, 0, 0) ;Not found anchor
        _SciTEGoToLine($x)
    ElseIf $Flag = 2 Then
        _SciTEFind('#Region ' & $Code) ; Good !!
    EndIf
    MsgBox(64, 'Done', 'jumped', .5, $MainGUI)
EndFunc   ;==>_AnchorsMoveToAnc


Func _AnchorsUserAncInsert($File, $Code, $Name, $Des)
    _SciTEInsertText(@CRLF & ';#---- Anchor (' & $Code & ') -----------------' & @CRLF)
    _SciTESave()
    If StringInStr(FileRead($File), '#Region == Anchors --[ Do not change any thing ]----' & @CRLF) Then ;Exist Old Anchors
        Local $OP = FileOpen($File, 0)
        Local $tLineCount = _FileCountLines($File)
        For $x = 1 To $tLineCount
            If FileReadLine($OP, $x) = '#Region == Anchors --[ Do not change any thing ]----' Then
                Local $tStartLine = $x
                ExitLoop
            EndIf
        Next
        If $x - 1 = $tLineCount Then
            FileClose($OP)
            Return SetError(1, 0, 0) ;There is Some Problem
        EndIf
        _SciTEGoToLine($tStartLine + 1)
        _SciTEInsertText(';' & $Code & '|' & $Name & '|' & $Des & @CRLF)
        _SciTESave()
        _AnchorsMoveToAnc($File, $Code, 0)
    Else
        Local $OP = FileOpen($File, 0), $tArray = ''
        _SciTEGoToLine(1)
        _SciTEInsertText('#Region == Anchors --[ Do not change any thing ]----' & @CRLF & ';' & $Code & '|' & $Name & '|' & $Des & @CRLF & '#EndRegion == Anchors --[ Do not change any thing ]----' & @CRLF)
        _SciTESave()
        _AnchorsMoveToAnc($File, $Code, 0)
    EndIf
EndFunc   ;==>_AnchorsUserAncInsert

Func _AnchorsGetRegionAnc($File)
    Local $OP = FileOpen($File, 0), $tLineCount = _FileCountLines($File), $ReturnArray, $tmpReturn = '', $TmpLine
    For $x = 1 To $tLineCount
        $TmpLine = StringStripWS(FileReadLine($OP, $x), 3)
        If $TmpLine = '#Region == Anchors --[ Do not change any thing ]----' Then ContinueLoop
        If StringLeft($TmpLine, 8) = '#Region ' Then
            $tmpReturn &= '|' & StringTrimLeft($TmpLine, 8) & ' #R'
        EndIf
    Next
    FileClose($OP)
    $ReturnArray = StringSplit(StringTrimLeft($tmpReturn, 1), '|')
;~  _ArrayDisplay ($ReturnArray)
    _ArrayDelete($ReturnArray, 0)
;~      _ArrayDisplay ($ReturnArray)
    _ArraySort($ReturnArray)
;~      _ArrayDisplay ($ReturnArray)
    _ArrayInsert($ReturnArray, 0, UBound($ReturnArray))
;~      _ArrayDisplay ($ReturnArray)
    If $ReturnArray[0] = 1 And $ReturnArray[1] = '' Then $ReturnArray[0] = 0
    Return $ReturnArray
EndFunc   ;==>_AnchorsGetRegionAnc

Func _AnchorsGetFuncAnc($File)
    Local $OP = FileOpen($File, 0), $tLineCount = _FileCountLines($File), $ReturnArray, $tmpReturn = ''
    For $x = 1 To $tLineCount
        If StringLeft(FileReadLine($OP, $x), 4) = 'Func' Then
            Local $SS = StringSplit(StringTrimLeft(StringStripWS(FileReadLine($OP, $x), 3), 5), '(')
            If $SS[0] >= 1 Then $tmpReturn &= '|' & $SS[1]
        EndIf
    Next
    FileClose($OP)
    $ReturnArray = StringSplit(StringTrimLeft($tmpReturn, 1), '|')
    _ArrayDelete($ReturnArray, 0)
    _ArraySort($ReturnArray)
    _ArrayInsert($ReturnArray, 0, UBound($ReturnArray))
    If $ReturnArray[0] = 1 And $ReturnArray[1] = '' Then $ReturnArray[0] = 0
    Return $ReturnArray
EndFunc   ;==>_AnchorsGetFuncAnc

Func _AnchorsGetUserAnc($File)
    Local $OP = FileOpen($File, 0), $tArray = ''
    Local $tLineCount = _FileCountLines($File)
    For $x = 1 To $tLineCount
        If FileReadLine($OP, $x) = '#Region == Anchors --[ Do not change any thing ]----' Then
            Local $tStartLine = $x
            ExitLoop
        EndIf
    Next
    If $x - 1 = $tLineCount Then
        FileClose($OP)
        Return SetError(1, 0, 0) ;There is no Anchors
    EndIf
    For $x = $tStartLine To $tLineCount
        If FileReadLine($OP, $x) = '#EndRegion == Anchors --[ Do not change any thing ]----' Then
            Local $tEndLine = $x
            ExitLoop
        EndIf
    Next
    If $x - 1 = $tLineCount Then
        FileClose($OP)
        Return SetError(2, 0, 0) ;There is no End  (Error)
    EndIf
    Local $ReturnArray[($tEndLine) - ($tStartLine)][3]
    Local $t = 1
    For $x = $tStartLine + 1 To $tEndLine - 1
        Local $SS = StringSplit(FileReadLine($OP, $x), '|')
        $ReturnArray[$t][0] = StringTrimLeft($SS[1], 1)
        $ReturnArray[$t][1] = $SS[2]
        $ReturnArray[$t][2] = $SS[3]
        $t += 1
    Next
    $ReturnArray[0][0] = UBound($ReturnArray) - 1
    FileClose($OP)
    Return $ReturnArray
EndFunc   ;==>_AnchorsGetUserAnc


;#---- Anchor (026_0018E) -----------------
Func _SciTESave()
    _SciTEWinActivate()
    Send('^s')
EndFunc   ;==>_SciTESave

Func _SciTEWinActivate()
    Local $Scite_hwnd = WinGetHandle("[CLASS:SciTEWindow]")
    Do
        WinActivate($Scite_hwnd, '')
    Until WinActive($Scite_hwnd) <> 0
EndFunc   ;==>_SciTEWinActivate

Func _SciTEGetFilePath()
    Local $tTitle = WinGetTitle("[CLASS:SciTEWindow]"), $tSplitBy = '*'
    If @error Then Return SetError(1, 0, 0) ; Window Not Exists
    If StringInStr($tTitle, 'Untitled') Then Return SetError(2, 0, 0) ; Not File
    If StringInStr($tTitle, '- SciTE') Then $tSplitBy = '-'
    Local $SS = StringSplit($tTitle, $tSplitBy)
    If StringRight($SS[1], 1) = ' ' Then $SS[1] = StringTrimRight($SS[1], 1)
    If FileExists($SS[1]) Then Return $SS[1]
    Return SetError(3, 0, 0)
EndFunc   ;==>_SciTEGetFilePath

Func _SciTEFind($String)
    Local $Scite_hwnd = WinGetHandle("DirectorExtension")
    _SciTE_Send_Command(0, $Scite_hwnd, "find:" & $String)
EndFunc   ;==>_SciTEFind

Func _SciTEGoToLine($LineName)
    Local $Scite_hwnd = WinGetHandle("DirectorExtension")
    _SciTE_Send_Command(0, $Scite_hwnd, "goto:" & $LineName)
EndFunc   ;==>_SciTEGoToLine

Func _SciTEInsertText($DataToInsert)
    ;----------------------------------------------------------------------------------------------
    ;----------------------------------------------------------------------------------------------
    Opt("WinSearchChildren", 1)
    Local $Scite_hwnd = WinGetHandle("DirectorExtension")
    $DataToInsert = StringReplace($DataToInsert, "\", "\\")
    $DataToInsert = StringReplace($DataToInsert, @TAB, "\t")
    $DataToInsert = StringReplace($DataToInsert, @CRLF, "\r\n")
    _SciTE_Send_Command(0, $Scite_hwnd, "insert:" & $DataToInsert)
EndFunc   ;==>_SciTEInsertText

Func _SciTE_Send_Command($My_Hwnd, $Scite_hwnd, $sCmd)
    ;----------------------------------------------------------------------------------------------
    ;----------------------------------------------------------------------------------------------
    Local $CmdStruct = DllStructCreate('Char[' & StringLen($sCmd) + 1 & ']')
    If @error Then Return
    DllStructSetData($CmdStruct, 1, $sCmd)
    Local $COPYDATA = DllStructCreate('Ptr;DWord;Ptr')
    DllStructSetData($COPYDATA, 1, 1)
    DllStructSetData($COPYDATA, 2, StringLen($sCmd) + 1)
    DllStructSetData($COPYDATA, 3, DllStructGetPtr($CmdStruct))
    $sss = _SendMessage($Scite_hwnd, 0x004A, $My_Hwnd, DllStructGetPtr($COPYDATA), 0, "hwnd", "ptr")
    $CmdStruct = 0
    Return $sss
EndFunc   ;==>_SciTE_Send_Command

You Can test it with Any Script .. !!

Thanks

Edited by Ashalshaikh
Link to comment
Share on other sites

  • Replies 77
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Thanks for sharing!

Normally I always list all my function names at the top of my scripts (one of my programs helps me do that), and use SciTE's Function Jump hotkey (usually via my Toolbar For Any button after highlighting the desired function name - either at the top, or from wherever I have it written). Your addon does more than that it seems, and sounds promising, so I'll check it out when I can.

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Link to comment
Share on other sites

Thanks for sharing!

Normally I always list all my function names at the top of my scripts (one of my programs helps me do that), and use SciTE's Function Jump hotkey (usually via my Toolbar For Any button after highlighting the desired function name - either at the top, or from wherever I have it written). Your addon does more than that it seems, and sounds promising, so I'll check it out when I can.

Thank you ..

Yes , Now (SciTE Hopper) is very simple and has few functions .. As I said earlier it is now only for testing .. Later i'll add more functions , to become a very useful tool

Thanks again

Edited by Ashalshaikh
Link to comment
Share on other sites

Great work!

I find myself scrolling up and down between functions, all the time. This makes things a lot quicker and easier!

Pitty it can't be built into SciTE.

Thanks

John Morrison

AKA

Storm-E

Link to comment
Share on other sites

Great idea and works very well !

I will have rather called Scite Jumper ! Posted Image

very convenient for long script, I adopt it today !

Thanks a lot !

Great work!

I find myself scrolling up and down between functions, all the time. This makes things a lot quicker and easier!

Pitty it can't be built into SciTE.

Thanks

John Morrison

AKA

Storm-E

This makes me very happy .. ;)

Thank you for the test ..

I will start to fix some slow problems such as checking and jumping with the anchors function)

and add some of the other functions such as 'Delete Anchor' , 'find anchor' and other things.

Thanks again

((Finally, I wrote an useful tool)) :)

Edited by Ashalshaikh
Link to comment
Share on other sites

  • Moderators

Ashalshaikh,

That is very nice and very useful script! ;)

Could I make a suggestion?

It currently takes 43 secs to read in a 4500 line script when I switch SciTE tabs. ;)

Rather than read the file 3 times when you are searching for the User, Function and Region anchors, why not read the file into an array with _FileReadIntoArray within the _Refresh function and then pass that array to the searching functions? That way you do not use FileReadLine (which is very slow), but only loop through the array elements. I am sure you will find that the process of reading in a new file when you change tabs will be much quicker if you do it that way. :P

Please ask if you need any help to implement this (although I am sure you will not!). :)

M23

Edit: The same is true for the other places in the script where you use FileReadLine. o:)

Edited by Melba23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Ashalshaikh,

That is very nice and very useful script! ;)

Could I make a suggestion?

Thanks .. :)

Sure, I'll be happy with that, especially from someone like you

It currently takes 43 secs to read in a 4500 line script when I switch SciTE tabs. o:)

Rather than read the file 3 times when you are searching for the User, Function and Region anchors, why not read the file into an array with _FileReadIntoArray within the _Refresh function and then pass that array to the searching functions? That way you do not use FileReadLine (which is very slow), but only loop through the array elements. I am sure you will find that the process of reading in a new file when you change tabs will be much quicker if you do it that way. :party:

That's what I really need, i know now why the problem of slow

Because the script file was read three times ;):P

This advice is very important ! . Thanks so much ز

Please ask if you need any help to implement this (although I am sure you will not!). o:)

M23

Edit: The same is true for the other places in the script where you use FileReadLine. :D

thanks again

Link to comment
Share on other sites

I just try to run it compiled but it remains in the taskbar !

I don't see any compile conditions in script Posted Image

*Sorry i just understand scite should not be in taskbar too !

If you intend to be 'SciTE Hopper' not in the taskbar, then this is something simple

But it seems to me that you talk about a problem .. I really do not understand exactly what you say .. :)

As I said before I started learning English a few months only ;)

Link to comment
Share on other sites

If you intend to be 'SciTE Hopper' not in the taskbar, then this is something simple

But it seems to me that you talk about a problem .. I really do not understand exactly what you say .. :)

As I said before I started learning English a few months only ;)

I want to say that

if i run Scite Hopper compiled

and if scite editor is minimized

then scite hopper is blocked in taskbar...

AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts

Link to comment
Share on other sites

I want to say that

if i run Scite Hopper compiled

and if scite editor is minimized

then scite hopper is blocked in taskbar...

Yes, now I understand what you say

This is simple problem.

Problem because this code

$Pos = WinGetPos(WinGetHandle("[CLASS:SciTEWindow]"))
$MainGUI = GUICreate("SciTE Hopper By : Ashalshaikh", 216, 447)
If IsArray($Pos) Then WinMove($MainGUI, '', $Pos[0] + $Pos[2] - 250, $Pos[1] + 100)
WinSetOnTop($MainGUI, '', 1)

it makes window in the right side auto .. !! thanks so much for help .. i will fix it soon

Edited by Ashalshaikh
Link to comment
Share on other sites

New SciTE Hopper : for test 2 !!

Changes :-

-------- it's much more faster !!

---------------- changed : method of reading au3 file

------------------------ Thanks Melba23

---------------- changed : method of jumping with Func Anchors

-------- Fixed : this problem #12 #13

---------------- now it checks SciTE Window State !!

------------------------ Thanks wakillon

-------- Added : Search box !!

---------------- search for Anchor !!

---------------- Auto Search.

---------------- Problem : with search results !! I will solve it with test 3 ;)

-------- Added : Refresh Button (( R ))

---------------- you can use it After searching

-------- Added : List Icons

---------------- I know it is ugly :) , but I will change it later

---------------- I will add enable/disable option

pics :

Posted Image

Posted Image

New SciTE Hopper : for test 3 !!

Major mistakes have been fixed

;=======================================================
;SciTE Hopper for test 2
;now you can jump to any line by 1 click !!
;By : Ashalshaikh : Ahmad Alshaikh"
;Thanks to :
;          CodeWizard Author : for SciTE Control Functions"
;          Koda(form designer) Authors
;          Melba23  :: now it's faster !!
;          wakillon
;tested with Autoit v3.3.6.1
;link : http://www.autoitscript.com/forum/index.php?showtopic=119544
;=======================================================

(( Now just for test ))

Deleted

Thanks .. !! ;)

Edited by Ashalshaikh
Link to comment
Share on other sites

Excellent! But when I have more than 1 tab open and I moved to the second tab I receive Line 259: Subscript used with non-Array variable. So I put _ArrayDisplay()in the function _AnchorsGetUserAnc() and on initial start it worked fine, but once I moved to the second tab an array isn't declared again, as _ArrayDisplay() didn't show.

Edited by guinness

UDF List:

 
_AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

Excellent! But when I have more than 1 tab open and I moved to the second tab I receive Line 259: Subscript used with non-Array variable. So I put _ArrayDisplay()in the function _AnchorsGetUserAnc() and on initial start it worked fine, but once I moved to the second tab an array isn't declared again, as _ArrayDisplay() didn't show.

thanks .. yes . it's Major error !!

I Fix it And two others ..Now I write the new version Reply

Thanks Again

Link to comment
Share on other sites

SciTE Hopper .. For test 3

to see all features :

----SciTE Hopper .. For test 1

----SciTE Hopper .. For test 2

Major mistakes have been fixed :-

-------- This problem#15

---------------- Occur if there is no User Anchors

------------------------ Thanks guinness

-------- Jumping to User Anchors does not work

Now the search for anchors work very well ;)

(( Now just for test ))

;=======================================================
;SciTE Hopper  for test 3
;now you can jump to any line by 1 click !!
;By : Ashalshaikh : Ahmad Alshaikh"
;Thanks to :
;          CodeWizard Author : for SciTE Control Functions"
;          Koda(form designer) Authors
;          Melba23  :: now it's faster !!
;          wakillon
;          guinness
;tested with Autoit v3.3.6.1
;link : http://www.autoitscript.com/forum/index.php?showtopic=119544
;=======================================================

SciTE Hopper.au3

Edited by Ashalshaikh
Link to comment
Share on other sites

Used the version in the first post and no problem so far!

UDF List:

 
_AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...