Jump to content

Add File Linker to ISN Autoit Studio


DevMode
 Share

Recommended Posts

Hello
I'm using isn autoit studio for a long time and tried to add some plugins, but the existing SDK is very limited
So I modified the original code

I added linking external files with the project
I know that the file name appears in the project tree, but the file is not found in the project folder

3.PNG.3432bdeebab7b6d13a9f64f4c16d9689.PNG

 

2.PNG.7e9ff97e774f36326130eda4a3b66d2a.PNG

ADD Item in Context Menu for add new Linker

Global $TreeviewContextMenu_Item_Linker = _GUICtrlCreateODMenuItem("Linker", $TreeviewContextMenu_Item8, $smallIconsdll, 998) ;Projektbaum aktualisieren

 

add Event in _InputCheck

Case $TreeviewContextMenu_Item_Linker
            _Linker()

 

add _Linker Function for add New Linker and update .isn file

#Region ; DevMode
Func _Linker()
    If $Offenes_Projekt = "" Then Return -1
    If Not IsHWnd($Current_TVExplorer_TreeView) Then Return -1
    Local $Treeview = $Current_TVExplorer_TreeView
    If _GUICtrlTreeView_GetSelection($Treeview) = 0 Then Return
    $FileSet = FileOpenDialog("Setect Linker",'','Autoit File(*.au3;)|All File(*.*)')
    If FileExists($FileSet) Then
        Dim $szDrive, $szDir, $szFName, $szExt
        _PathSplit($FileSet, $szDrive, $szDir, $szFName, $szExt)
        $LinkerName = InputBox("Add New Linker","Plese enter Linker Name",$szFName&$szExt)
        If $LinkerName = "" Then Return
        _GUICtrlTreeView_AddChild($hWndTreeview, _GUICtrlTreeView_GetFirstItem($hWndTreeview),'=>'&$LinkerName)
        $NewLinker = $FileSet&'%'&$LinkerName
        $OldLinkers = IniRead($Pfad_zur_Project_ISN, "ISNPROJECT_TODOLISTDATA", "Linker", "")
        IniWrite($Pfad_zur_Project_ISN, "ISNPROJECT_TODOLISTDATA", "Linker",$OldLinkers&'|'&$NewLinker)
    EndIf

    Sleep(250)
    $Projektbaum_ist_bereit = 1
EndFunc   ;==>_Erstelle_kopie_von_markierter_datei

#EndRegion

 

add _LinkerOpen for open file in Editor

Func _LinkerOpen($LinkerName)
    $Linkes = IniRead($Pfad_zur_Project_ISN, "ISNPROJECT_TODOLISTDATA", "Linker", "")
        $sLinker = StringSplit($Linkes,'|')

        For $p = 1 To $sLinker[0]
            If $sLinker[$p] = "" Then ContinueLoop
                $fLinker = StringSplit($sLinker[$p],'%')
            If $fLinker[0] = 2 And $LinkerName = $fLinker[2] Then
                Try_to_opten_file($fLinker[1])
            EndIf
        Next
EndFunc

add Load Linker 

Func _Load_Project($Foldername)
    .......
    $RDC_Main_Thread = _RDC_Create($Offenes_Projekt, 1, BitOR($FILE_NOTIFY_CHANGE_FILE_NAME, $FILE_NOTIFY_CHANGE_DIR_NAME), 0, $Studiofenster)
    $RDC_UDFs_Thread = _RDC_Create(_ISN_Variablen_aufloesen($UDFs_Folder), 1, BitOR($FILE_NOTIFY_CHANGE_FILE_NAME, $FILE_NOTIFY_CHANGE_DIR_NAME), 0, $Studiofenster)
    _Reload_Ruleslots()
    _Aktualisiere_oder_erstelle_Projektbaum($Offenes_Projekt)

    _GUICtrlTVExplorer_Expand($hWndTreeview)

    #Region Load Linker DevMode
        $Linkes = IniRead($Pfad_zur_Project_ISN, "ISNPROJECT_TODOLISTDATA", "Linker", "")
        $sLinker = StringSplit($Linkes,'|')

        For $p = 1 To $sLinker[0]
            If $sLinker[$p] = "" Then ContinueLoop
                $fLinker = StringSplit($sLinker[$p],'%')
            If $fLinker[0] = 2 Then
                _GUICtrlTreeView_AddChild($hWndTreeview, _GUICtrlTreeView_GetFirstItem($hWndTreeview),'=>'&$fLinker[2])
            EndIf
        Next

    #EndRegion


    ;Set focus to the first item in the treeview
    ......
EndFunc   ;==>_Load_Project
Func _Update_Treeview()

    ......
    #Region Load Linker DevMode
        $Linkes = IniRead($Pfad_zur_Project_ISN, "ISNPROJECT_TODOLISTDATA", "Linker", "")
        $sLinker = StringSplit($Linkes,'|')

        For $p = 1 To $sLinker[0]
            If $sLinker[$p] = "" Then ContinueLoop
                $fLinker = StringSplit($sLinker[$p],'%')
            If $fLinker[0] = 2 Then
                _GUICtrlTreeView_AddChild($hWndTreeview, _GUICtrlTreeView_GetFirstItem($hWndTreeview),'=>'&$fLinker[2])
            EndIf
        Next

    #EndRegion

EndFunc   ;==>_Update_Treeview

Also I needed to add some modifications because by clicking on the file in the project tree the item . is deleted

 

Edit File ISN_Studio_WindowMessages.au3 , Function _ISN_WM_NOTIFY_TVExplorer

Case -3 ; NM_DBLCLK
            $Current_TVExplorer_TreeView = $hTV
;~              If $tvData[$Index][28] Then
;~                  ExitLoop
;~              EndIf
                $tPOINT = _WinAPI_GetMousePos(1, $hTV)
                $tTVHTI = _GUICtrlTreeView_HitTestEx($hTV, DllStructGetData($tPOINT, 1), DllStructGetData($tPOINT, 2))
                $hItem = DllStructGetData($tTVHTI, 'Item')
                If BitAND(DllStructGetData($tTVHTI, 'Flags'), $TVHT_ONITEM) Then
                    $text = _GUICtrlTreeView_GetText($Current_TVExplorer_TreeView, $hItem )
                    If StringLeft($text,2) = "=>" Then Return _LinkerOpen(StringTrimLeft($text,2)) ; DevMode
                    $path = _TV_GetPath($Index, $hItem)
                    If Not _WinAPI_PathIsDirectory($path) Then
                        _TV_Send(6, $Index, $hItem)
                    EndIf
                EndIf

Edit File ISN_UDF_TVExplorer.au3 , Function _TV_Send

Func _TV_Send($iDummy, $iIndex, $hItem, $fDirect = 0, $lParam = 0)
    IF BitAND($ISNDebugConsole_SpecialLogs, $ISNDebugConsole_SpecialLogs_TVExplorer) then
       _Write_ISN_Debug_Console("TVExplorer try to send "&$iDummy&" to index "&$iIndex&" and hItem "&$hItem , $ISN_Debug_Console_Errorlevel_Info)
       _Write_ISN_Debug_Console("DummyControl Handle: "&$tvData[$iIndex][$iDummy], $ISN_Debug_Console_Errorlevel_Info)
    Endif
    Local $wParam = _WinAPI_MakeLong($iDummy, $iIndex)
    If $hItem <> -1 Then
        $tvData[$iIndex][$iDummy + 17] = $hItem
    EndIf
    If $fDirect Then
       IF BitAND($ISNDebugConsole_SpecialLogs, $ISNDebugConsole_SpecialLogs_TVExplorer) then _Write_ISN_Debug_Console("TVExplorer try _TV_Dummy with wparam "&$wParam&" and lparam "&$lParam , $ISN_Debug_Console_Errorlevel_Info)
        _TV_Dummy($wParam, $lParam)
    Else
        IF BitAND($ISNDebugConsole_SpecialLogs, $ISNDebugConsole_SpecialLogs_TVExplorer) then _Write_ISN_Debug_Console("TVExplorer try GUICtrlSendToDummy with handle "&$tvData[$iIndex][$iDummy]&" and wparam "&$wParam , $ISN_Debug_Console_Errorlevel_Info)
        
        If StringLeft(_GUICtrlTreeView_GetText($Current_TVExplorer_TreeView, $hItem ),2) = "=>" Then Return 1 ; DevMode
        
        If Not GUICtrlSendToDummy($tvData[$iIndex][$iDummy], $wParam) Then
           IF BitAND($ISNDebugConsole_SpecialLogs, $ISNDebugConsole_SpecialLogs_TVExplorer) then _Write_ISN_Debug_Console("TVExplorer _TV_Send STOPPED at GUICtrlSendToDummy! Let´s ReCreate the DummyControls..." , $ISN_Debug_Console_Errorlevel_Warning)
                _ISN_ReCreateTVExplorerDummyControls($iIndex)
              If Not GUICtrlSendToDummy($tvData[$iIndex][$iDummy], $wParam) Then
                 IF BitAND($ISNDebugConsole_SpecialLogs, $ISNDebugConsole_SpecialLogs_TVExplorer) then _Write_ISN_Debug_Console("TVExplorer _TV_Send STOPPED again at GUICtrlSendToDummy! ReCreate failed!" , $ISN_Debug_Console_Errorlevel_Critical)
                 Return 0
              Endif
        EndIf
    EndIf
    Return 1
EndFunc   ;==>_TV_Send

 

Please ISI360 add this feature to the official software

Also, if possible, add the project to GitHub so that we can help it develop the program

 

Complied Autoit_Studio.a3x

Autoit_Studio.a3x

 

 

Edited by DevMode

dongel.png

Link to comment
Share on other sites

  • DevMode changed the title to Add File Linker to ISN Autoit Studio

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

×
×
  • Create New...