l3ill

SnippetBrowser1.0 w/ Search/FindinFile/Syntax Hiliting...

19 posts in this topic

#1 ·  Posted (edited)

This is a little project I started knowing it was over my head to intentionally raise my own experience bar.
Pretty Simple Concept and its finally working like I want it to.
 
The Basic Idea:
 
An exe you copy into your Snippet folder and run from there with a shortcut ( or w/out ).
 
Top Part of GUI
Get Files - Creates a ListView of all au3 file in the WorkingDir ~ >_RecFileListToArray Thanks M23 !!
Clear - clears last search otherwise new search/GetFiles is appended (gets full quick)
File Search - search through the WorkingDir for a Keyword ~ >_FindInFile Thanks guinness !!
Far Right is a label with the Path of your Working Directory
 
Bottom Part    All of these commands work with The Selected File Path From top part:
Text Search - searches though preview window for text like F3 (find next) Thanks M23 !!
Open in SciTE - Duh...
Preview - Shows Preview of Selected File Path in Bottom window with Syntax Hi Liting ~ >RESH Thanks Beege
Throw String - Experimental, Sends Selected Text to last Cursor Position in active tab in SciTE
                         (now works w' multiple lines) Only works with one line...  >Thanks Jos, guinness 
 
Everything you need to try it is in the zip file.
Constructive Critics and Suggestions are welcome ;-)
 
Some Pics:
 
sb_tut.gif
 
 
Here you see a search for Text in File "@ScriptDir". All the files that have this in them will be listed
Then search through the Preview for each instance of "@ScriptDir" until you find the one you want.
 
sb_tut_srch.gif

 

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=SnippetBrowserIcon.ico
#AutoIt3Wrapper_UseUpx=n
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#cs ----------------------------------------------------------------------------
    SnippetBrowser1.0.2
    AutoIt Version: 3.3.10.0

    Author: Bill

    Script Function:
    Snippet Browser with Search and Syntax Hi-Liting
#ce ----------------------------------------------------------------------------
#Region ;==================#includes
#include <Array.au3>
#include <File.au3>
#include <ButtonConstants.au3>
#include <GuiButton.au3>
#include <EditConstants.au3>
#include <GuiEdit.au3>
#include <GuiRichEdit.au3>
#include <GUIConstantsEx.au3>
#include <Constants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <ListviewConstants.au3>
#include <GuiListView.au3>
#include <GUIToolTip.au3>
#include "_FindInFile.au3"
#include "RESH.au3"
#EndRegion ;==================#includes
Global $sBlistView, $sString, $aColorTable
Global $sLastSearch = ""
Global $iSearchStart = 0
Global $sFolder = @ScriptDir ; works as browser in any folder you put the script in
#Region ;==================GUI
$Form1 = GUICreate("SnippetBrowser", 810, 680, 246, 140)
$hToolTip = _GUIToolTip_Create(0)
$Input1 = GUICtrlCreateInput("Search_Files", 10, 16, 160, 21)
$sBlistView = GUICtrlCreateListView("Path", 10, 45, 790, 253, BitOR($LVS_SINGLESEL, $LVS_SHOWSELALWAYS))
_GUICtrlListView_SetColumnWidth($sBlistView, 0, 770)
$search = GUICtrlCreateButton("File Search", 190, 14, 81, 25)
$searchTip = GUICtrlGetHandle($search)
_GUIToolTip_AddTool($hToolTip, 0, "Search Through Working Dir for Text in File", $searchTip)
$ClearAll = GUICtrlCreateButton("Clear", 290, 14, 81, 25)
$ClearAllTip = GUICtrlGetHandle($ClearAll)
_GUIToolTip_AddTool($hToolTip, 0, "Clear List View of Last Search", $ClearAllTip)
$getFiles = GUICtrlCreateButton("Get Files", 390, 14, 81, 25)
$getFilesTip = GUICtrlGetHandle($getFiles)
_GUIToolTip_AddTool($hToolTip, 0, "Populate List View with AutoIT Files from Working Dir", $getFilesTip)
GUICtrlSetState($getFiles, $GUI_DEFBUTTON)
$Input2 = GUICtrlCreateInput("Search_Text", 10, 306, 160, 21)
$showSelected = GUICtrlCreateButton("Preview", 390, 305, 81, 25)
$showSelectedTip = GUICtrlGetHandle($showSelected)
_GUIToolTip_AddTool($hToolTip, 0, "Shows Preview of Selected Path", $showSelectedTip)
$textSearch = GUICtrlCreateButton("Text Search", 190, 305, 81, 25)
$textSearchTip = GUICtrlGetHandle($textSearch)
_GUIToolTip_AddTool($hToolTip, 0, "Search Through Preview for Text", $textSearchTip)
$label1 = GUICtrlCreateLabel($sFolder, 485, 20, 315, 25)
GUICtrlSetTip(-1, "Working Directory: " & $sFolder, "", 0, 2)
GUICtrlSetData($label1, $sFolder)
$openSelected = GUICtrlCreateButton("Open in SciTE", 290, 305, 81, 25)
$openSelectedTip = GUICtrlGetHandle($openSelected)
_GUIToolTip_AddTool($hToolTip, 0, "Open Selected Path in SciTE", $openSelectedTip)
$throwString = GUICtrlCreateButton("Throw String", 490, 305, 81, 25)
$throwStringTip = GUICtrlGetHandle($throwString)
_GUIToolTip_AddTool($hToolTip, 0, "Sends Selected String to wherever your cursor was blinking in SciTE", $throwStringTip)
$iCheckbox = GUICtrlCreateCheckbox("Tool Tips Off", 600, 305, 185, 25)
$hEdit = _GUICtrlRichEdit_Create($Form1, "", 10, 336, 790, 310, BitOR($ES_MULTILINE, $WS_VSCROLL, $WS_HSCROLL, $ES_AUTOVSCROLL))
_GUICtrlRichEdit_SetBkColor($hEdit, 0xEFEFEF)
GUISetState(@SW_SHOW, $Form1)
#EndRegion ;==================GUI

#Region ; ==================while loop
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $iCheckbox
            If _IsChecked($iCheckbox) Then
                _GUIToolTip_Deactivate($hToolTip)
            Else
                _GUIToolTip_Activate($hToolTip)
            EndIf
        Case $getFiles ;~ Populates ListView with Files from Working Directory~
            _getFiles()
        Case $throwString ;~ Takes Selected text and sends it to open SciTE Window where Cursor was~
            $editSelTest = _GUICtrlRichEdit_IsTextSelected($hEdit)
            If $editSelTest = True Then
                $sString = _GUICtrlRichEdit_GetSelText($hEdit) & @CRLF
                _SciTE_InsertText($sString)
            Else
                MsgBox(0, "error!", "Nothing Selected")
            EndIf
        Case $openSelected ;~ Opens Selected Path in SciTE Editor (New Tab)~
            _openSelected()
        Case $showSelected ;~ Previews Selected Path in Preview Window with Syntax Hiliting (RESH.au3)~Thanks Beege! ~
            _showSelected()
        Case $ClearAll ;~ Empties ListView of foundPaths to Make Room for New Search~
            _GUICtrlListView_DeleteAllItems($sBlistView)
        Case $search ;~ Searches Working Directory for "Text in File" Thanks guinness !~
            _search()
        Case $textSearch ;~ Searches Preview for Text ~ Keep Clicking to Find Next ~ Thanks Melba23 ~
            $sSearchTerm = GUICtrlRead($Input2)
            If $sSearchTerm Then
                ; If new search then reset start
                If $sSearchTerm <> $sLastSearch Then
                    $iSearchStart = 0
                    $sLastSearch = $sSearchTerm
                EndIf
                _GUICtrlRichEdit_SetSel($hEdit, $iSearchStart, $iSearchStart)
                $iIndex = _GUICtrlRichEdit_FindText($hEdit, $sSearchTerm)
                _GUICtrlRichEdit_SetSel($hEdit, $iIndex, $iIndex + StringLen($sSearchTerm))
                $iSearchStart = $iIndex + StringLen($sSearchTerm)
            EndIf
    EndSwitch
WEnd
#EndRegion ; ==================while loop

#Region ; ==================functions
Func _getFiles() ;~ Populates ListView with Files from Working Directory~
    Local $FileList_A =  _FileListToArrayRec(@ScriptDir, "*au3", 1, 1, 0, 2)
    For $i = 1 To $FileList_A[0]
        _GUICtrlListView_AddItem($sBlistView, $FileList_A[$i] & @LF)
        ConsoleWrite("$FileList_A[$i]: " & $FileList_A[$i] & @CR)
    Next
EndFunc   ;==>_getFiles

Func _showSelected() ;~ Previews Selected Path in Preview Window with Syntax Hiliting (RESH.au3)~Thanks Beege! ~
    Local Enum $iMacros, $iStrings, $iSpecial, $iComments, $iVariables, $iOperators, $iNumbers, $iKeywords, _
            $iUDFs, $iSendKeys, $iFunctions, $iPreProc, $iComObjects
    Local $aColorTable[13]
    ;notice values can be either 0x or #
    $aColorTable[$iMacros] = '#808000'
    $aColorTable[$iStrings] = 0xFF0000
    $aColorTable[$iSpecial] = '#DC143C'
    $aColorTable[$iComments] = '#008000'
    $aColorTable[$iVariables] = '#5A5A5A'
    $aColorTable[$iOperators] = '#FF8000'
    $aColorTable[$iNumbers] = 0x0000FF
    $aColorTable[$iKeywords] = '#0000FF'
    $aColorTable[$iUDFs] = '#0080FF'
    $aColorTable[$iSendKeys] = '#808080'
    $aColorTable[$iFunctions] = '#000090'
    $aColorTable[$iPreProc] = '#808000'
    $aColorTable[$iComObjects] = 0x993399
    Local $iSelect = _GUICtrlListView_GetSelectedIndices($sBlistView, True)
    If $iSelect[0] > 0 Then
        Local $sSelect = StringTrimRight(_GUICtrlListView_GetItemText($sBlistView, $iSelect[1]), 1)
        _GUICtrlRichEdit_SetText($hEdit, FileRead($sSelect))
        _RESH_SetColorTable($aColorTable)
        _RESH_SyntaxHighlight($hEdit)

    Else
        MsgBox(0, "", "Nothing Selected")
    EndIf
EndFunc   ;==>_showSelected

Func _openSelected() ;~ Opens Selected Path in SciTE Editor (New Tab)~
    Local $iSelect = _GUICtrlListView_GetSelectedIndices($sBlistView, True)
    If $iSelect[0] > 0 Then
        Local $sSelect = StringTrimRight(_GUICtrlListView_GetItemText($sBlistView, $iSelect[1]), 1)
        Return _SciTE_Send_Command(0, WinGetHandle("DirectorExtension"), 'open:' & StringReplace($sSelect, '\', '\\'))
    Else
        MsgBox(0, "", "Nothing Selected")
    EndIf
EndFunc   ;==>_openSelected

Func _search() ;~ Searches Working Directory for "Text in File" Thanks guinness !~
    Local $aArray = _FindInFile(GUICtrlRead($Input1), $sFolder, '*.au3')
    $rows = UBound($aArray)
    For $i = 0 To $rows - 1
        GUICtrlCreateListViewItem($aArray[$i] & @LF, $sBlistView)
    Next
EndFunc   ;==>_search

Func _SciTE_InsertText($sString)
    $sString = StringReplace($sString, '\', '\\')
    _SciTE_ReplaceMarcos($sString)
    Return _SciTE_Send_Command(0, WinGetHandle('DirectorExtension'), 'insert:' & $sString)
EndFunc   ;==>_SciTE_InsertText

Func _SciTE_ReplaceMarcos(ByRef $sString)
    $sString = StringReplace($sString, @TAB, '\t')
    $sString = StringReplace($sString, @CR, '\r')
    $sString = StringReplace($sString, @LF, '\n')
EndFunc   ;==>_SciTE_ReplaceMarcos

Func _SciTE_Send_Command($hHandle, $hSciTE, $sString)
    Local $ilParam, $tData
    If StringStripWS($sString, 8) = "" Then
        Return SetError(2, 0, 0) ; String is blank.
    EndIf
    $sString = ":" & Dec(StringTrimLeft($hHandle, 2)) & ":" & $sString
    ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $sString = ' & $sString & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console
    $tData = DllStructCreate("char[" & StringLen($sString) + 1 & "]") ; wchar
    DllStructSetData($tData, 1, $sString)
    $ilParam = DllStructCreate("ptr;dword;ptr") ; ulong_ptr;dword;ptr
    DllStructSetData($ilParam, 1, 1) ; $ilParam, 1, 1
    DllStructSetData($ilParam, 2, DllStructGetSize($tData))
    DllStructSetData($ilParam, 3, DllStructGetPtr($tData))
    _SendMessage($hSciTE, $WM_COPYDATA, $hHandle, DllStructGetPtr($ilParam))
    Return Number(Not @error)
EndFunc   ;==>_SciTE_Send_Command

Func _IsChecked($iControlID)
    Return BitAND(GUICtrlRead($iControlID), $GUI_CHECKED) = $GUI_CHECKED
EndFunc   ;==>_IsChecked
#EndRegion ; ==================functions


 
SnippetBrowser1.0.zip
SnippetBrowser_1.0.1.zip   ~   update: 14 Dec 2013
SnippetBrowser_1.0.1.zip   ~   update: 18 Dec 2013 
SnippetBrowser_1.0.2.zip   ~   update: 26 Dec 2013
Bill

post-56351-0-97561800-1386870674_thumb.j

post-56351-0-63608400-1386870810_thumb.j

Edited by l3ill
3 people like this

Share this post


Link to post
Share on other sites



Func _SciTE_Send_Command($hWnd, $hSciTE, $sString)
    If StringStripWS($sString, $STR_STRIPALL) = '' Then
        Return SetError(2, 0, 0) ; String is blank.
    EndIf
    $sString = ':' & Dec(StringTrimLeft($hWnd, 2)) & ':' & $sString
    Local $tData = DllStructCreate('char[' & StringLen($sString) + 1 & ']') ; wchar
    DllStructSetData($tData, 1, $sString)

    Local Const $tagCOPYDATASTRUCT = 'ptr;dword;ptr' ; ';ulong_ptr;dword;ptr'
    Local $tCOPYDATASTRUCT = DllStructCreate($tagCOPYDATASTRUCT)
    DllStructSetData($tCOPYDATASTRUCT, 1, 1)
    DllStructSetData($tCOPYDATASTRUCT, 2, DllStructGetSize($tData))
    DllStructSetData($tCOPYDATASTRUCT, 3, DllStructGetPtr($tData))
    _SendMessage($hSciTE, $WM_COPYDATA, $hWnd, DllStructGetPtr($tCOPYDATASTRUCT))
    Return Number(Not @error)
EndFunc   ;==>_SciTE_Send_Command
Func _SciTE_InsertText($sString)
    ; $sString = _GUICtrlRichEdit_GetSelText($hEdit) << Do this on line 77, not in this wrapper function.
    Return _SciTE_Send_Command(0, WinGetHandle("DirectorExtension"), "insert:" & $sString)
EndFunc   ;==>_SciTE_InsertText

Nice idea. Here are a couple of updates to some of those function(s)...

Also you're passing $sString to _SciTE_InsertText() on line 77, but you're not actually declaring it. Try not to use Global variables if you can, which from what I can see you don't need to use any in this script. Plus, my username is missing another n. --_0

 


_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_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 parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

Thanks guinness,

  sorry about msp your un, I am pretty sure that was a Tidy error :ermm:

And thanks for the updates / suggestions will fix ASAP.

While Ive got yer attention, I was curious as to how would you go about fixing the Throw String Func to:

  • Add a carriage return after pasting ( as to prepare for next paste w/out need to change windows )
  • Ability to select and throw more than one line @ a time.

That whole function was a CCP and the part of my script that I dont fully comprehend.

cya,

Bill

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

All of these functions can be found in SciTE Jump under SciTE.au3.

Open in SciTE, don't use ShellExecute, instead use..

Func _SciTE_Open($sFilePath)
    Return _SciTE_Send_Command(0, WinGetHandle("DirectorExtension"), 'open:' & StringReplace($sFilePath, '\', '\\'))
EndFunc   ;==>_SciTE_Open

Ideally WinGetHandle("DirectorExtension") should be a Global variable or something. You can see how I do it in SciTE.au3.

Why not just append @CRLF to $sString = _GUICtrlRichEdit_GetSelText($hEdit) & @CRLF and then pass $sString to _SciTE_InsertText()? Then with your final problem, can you do multi selection in an edit control? Find out the answer by searching around a little.

I didn't give you that insert text did I? As it's wrong >>

Func _SciTE_InsertText($sString)
    $sString = StringReplace($sString, '\', '\\')
    _SciTE_ReplaceMarcos($sString)
    Return _SciTE_Send_Command(0, WinGetHandle('DirectorExtension'), 'insert:' & $sString)
EndFunc   ;==>_SciTE_InsertText

Func _SciTE_ReplaceMarcos(ByRef $sString)
    $sString = StringReplace($sString, @TAB, '\t')
    $sString = StringReplace($sString, @CR, '\r')
    $sString = StringReplace($sString, @LF, '\n')
EndFunc   ;==>_SciTE_ReplaceMarcos
Edited by guinness

_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_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 parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

Feature Request: Use modern colour scheme instead of the old one.


_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_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 parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

 

Why not just append @CRLF to $sString = _GUICtrlRichEdit_GetSelText($hEdit) & @CRLF and then pass $sString to _SciTE_InsertText

:idea:  Sad.  I actually thought about trying that and then didnt because I couldnt allow myself to believe it could be that simple.

 

()? Then with your final problem, can you do multi selection in an edit control? Find out the answer by searching around a little.

 

Yes. Multiselection is possible but now it only throws the first line. I will study up on this... these 2 things were on the ToDo list for an update down the road along with an ADDSNIPPET func.

 

Feature Request: Use modern colour scheme instead of the old one.

 

Would gladly Oblige...but I have no idea what you mean... :

Edit: are you referring to the syntax hilites?

Thanks for your time!

Bill

Edited by billo

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Yeah, I meant for the highlighting in RESH. Also see my edit above with a fix to the insert text function. I am working on a snippet holder for SciTE Jump over Christmas by the way.

Edit: Then I again I might not, but all the functions are there, it's just a matter of putting the pieces together.

Edited by guinness

_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_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 parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

OK, but you can see it wasn't escaping TAB, CR, LF and . My updated version stripped from SciTE Jump can do this.


_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_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 parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites
---------------------------
AutoIt Error
---------------------------
Line 468  (File "C:UsersDOCDesktopSnippetBrowser1.0RESH.au3"):
 
Local $aRet = DllCallAddress('uint', DllStructGetPtr($tMem), 'struct*', $tRevIndex, 'struct*', $tSource, 'struct*', $tOutput, 'uint', (@AutoItX64 ? $iLen : $iLen / 4))
Local $aRet = DllCallAddress('uint', DllStructGetPtr($tMem), 'struct*', $tRevIndex, 'struct*', $tSource, 'struct*', $tOutput, 'uint', (@AutoItX64 ^ ERROR
 
Error: Unable to parse line.
---------------------------
OK   
---------------------------

Share this post


Link to post
Share on other sites

DjForfun,

You need the Beta version to run that new ternary syntax. ;)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

To do list:

 

Feature Request: Use modern colour scheme instead of the old one.

Done

Updated Functions Insert and Open ( updates from guinness ~ Thanks !) 

Done

Add Carriage Return Function to Throw String

Could not get it to work with the suggested solution

And finally decided against it because most of the time I am nesting a one-liner in between two other lines

Multi-Line Throw String

coming soon...maybe

P.S. also updated all MSP guinness' :P  ...( I think...) :ermm:

Edited by billo

Share this post


Link to post
Share on other sites

P.S. also updated all MSP guinness' :P  ...( I think...) :ermm:

Still mistakes there with my name. Plus it's Beege not Beeje.

I also tried my suggestion of $sString = _GUICtrlRichEdit_GetSelText($hEdit) & @CRLF and it worked for me. Unless I misunderstood your point billo.


_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_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 parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

Still mistakes there with my name. Plus it's Beege not Beeje.

 

I also tried my suggestion of $sString = _GUICtrlRichEdit_GetSelText($hEdit) & @CRLF and it worked for me. Unless I misunderstood your point billo.

Okay, I think thats all of them...

Yes your right. it does work. I had added it quickly to test it before uploading not planning on it being part of this update.

Turns out I added it to the wrong line  :ermm: Got lost in my own code :oops:

No of course that has never happened to anyone but me, I know :whistle:  

Share this post


Link to post
Share on other sites

#17 ·  Posted (edited)

Directions to add a shortcut to your Scite Tools Menu:

Click on "Options" and choose Open au3.properties

post-56351-0-89036600-1387745368_thumb.j

Scroll down to about line #265 and find the highest numbered Tool, in this case "# 34 Generate UDF header"

Insert the following: (important !! change the path to match your own)

# 40 SnippetBrowser
command.40.$(au3)="I:\G_bkp_05.03.11\Desktop\Autoit Snippets\SnippetBrowser.exe"
command.name.40.$(au3)=SnippetBrowser
command.shortcut.40.*.au3=Ctrl+Alt+S
command.subsystem.40.$(au3)=2
command.save.before.40.$(au3)=2
command.quiet.40.$(au3)=1

Should look like this:

post-56351-0-72750000-1387745868_thumb.j

Save and restart SciTE

SnippetBrowser is now startable from the Tool Menu or by Keyboard Shortcut Ctrl+Alt+S

Edited by l3ill

Share this post


Link to post
Share on other sites

Somewhat Larger update:

Added Updated RESH file fixed a small bug with the IniRead Highlighting ~ once again... Thanks Beege!

Added New _FileListToArrayRec to replace the one that needed the extra UDF - Still M23's work 

Added Turn Off Tool Tips ChecBox -  they get pesky after a while...

Updated the pics with Animated GIFS to see better how it works.

Share this post


Link to post
Share on other sites

I had followed the instructions setforth in this post. however it will not let me save the au3.properties.. Any suggestions?

Share this post


Link to post
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