Jump to content

Figlet Tool for SciTE


Myicq
 Share

Recommended Posts

I personally like to make (large) headers in my code which makes it simpler for me to navigate quickly. There was the FigLet tool already, but it was not integrated into the editor.

I modified it a little and present here my first try of example script.

Features: [version 1.01]

  • Settings via ini file
  • Will ignore non-English characters and replace by user-defined
  • User-definable comment style when inserting
  • Auto-insert at cursor point in SciTE (thanks to Jon for help with this !)

My idea of the tool is to bind it to a key, to very quickly be able to insert banners, already commented out.

I would really appreaciate any comments on this. You are welcome to make / suggest additions + improvements.

Edit: attached zip.au3.

;~    #######                                    #######
;~    #        #   ####   #       ######  #####     #      ####    ####   #
;~    #        #  #    #  #       #         #       #     #    #  #    #  #
;~    #####    #  #       #       #####     #       #     #    #  #    #  #
;~    #        #  #  ###  #       #         #       #     #    #  #    #  #
;~    #        #  #    #  #       #         #       #     #    #  #    #  #
;~    #        #   ####   ######  ######    #       #      ####    ####   ######
;~
;~    #######                             #                            ###  #######   #####
;~    #         ####   #####             # #    #    #  #####   ####    #      #     #     #
;~    #        #    #  #    #           #   #   #    #    #    #    #   #      #           #
;~    #####    #    #  #    #          #     #  #    #    #    #    #   #      #      #####
;~    #        #    #  #####           #######  #    #    #    #    #   #      #           #
;~    #        #    #  #   #           #     #  #    #    #    #    #   #      #     #     #
;~    #         ####   #    #          #     #   ####     #     ####   ###     #      #####
;~
;~  _   _                   _                 __      _____  __
;~ | | | |                 (_)               /  |    |  _  |/  |
;~ | | | |  ___  _ __  ___  _   ___   _ __   `| |    | |/' |`| |
;~ | | | | / _ \| '__|/ __|| | / _ \ | '_ \   | |    |  /| | | |
;~ \ \_/ /|  __/| |   \__ \| || (_) || | | | _| |_ _ \ |_/ /_| |_
;~  \___/  \___||_|   |___/|_| \___/ |_| |_| \___/(_) \___/ \___/
;~
#include <Array.au3>
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <File.au3>
#include <GUIComboBox.au3>
#include <GUIConstantsEx.au3>
#include <WinAPI.au3>
#include <WindowsConstants.au3>
#include <Zip.au3>

Global $gInputText, $gComboFont, $gEditSignature, $gCurrentFont = "", $gSelFont, $gCommentStyle, $gUnknownReplace
Global $gFontData, $gFontMetaData[10], $gFontDir = @ScriptDir & "\fonts\"

_Main()

Exit

Func _Main()
    ; Create and show GUI
    GUICreate("AutoFiglet", 810, 426, -1, -1, BitOR($WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU, $WS_SIZEBOX))
    GUICtrlCreateLabel("Text line", 8, 8, 550, 16)
    GUICtrlSetResizing(-1, BitOR($GUI_DOCKHEIGHT, $GUI_DOCKTOP, $GUI_DOCKLEFT))
    $gInputText = GUICtrlCreateInput("", 8, 28, 550, 20)
    GUICtrlSetResizing(-1, BitOR($GUI_DOCKHEIGHT, $GUI_DOCKTOP, $GUI_DOCKLEFT))
    $gEditSignature = GUICtrlCreateEdit("", 8, 56, 794, 320, BitOR($ES_AUTOVSCROLL, $WS_HSCROLL, $ES_WANTRETURN))
    GUICtrlSetResizing(-1, BitOR($GUI_DOCKRIGHT, $GUI_DOCKLEFT, $GUI_DOCKTOP, $GUI_DOCKBOTTOM))
    GUICtrlSetFont(-1, 9, 400, 0, "Courier New")
    Local $btnGenerate = GUICtrlCreateButton("Generate", 680, 384, 122, 32, $BS_DEFPUSHBUTTON)
    GUICtrlSetResizing(-1, BitOR($GUI_DOCKRIGHT, $GUI_DOCKBOTTOM, $GUI_DOCKHEIGHT, $GUI_DOCKWIDTH))
    GUISetState(@SW_SHOW)

    ; setup selected font
    $gSelFont = IniRead(@ScriptDir & "\figlet.ini", "figlet", "font", "banner")
    ; does font exist ? No, set to "banner"
    If Not FileExists($gFontDir & "\" & $gSelFont & ".zip") Then
        $gSelFont = "banner"
    EndIf

    ; setup comment style
    $gCommentStyle = IniRead(@ScriptDir & "\figlet.ini", "figlet", "comment", ";" & @TAB)
    $gCommentStyle = StringReplace($gCommentStyle, "\t", @TAB)


    ; setup unknown replacement
    $gUnknownReplace = IniRead(@ScriptDir & "\figlet.ini", "figlet", "unknown", "space")
    $gUnknownReplace = StringReplace($gUnknownReplace, "space", " ")
    $gUnknownReplace = StringReplace($gUnknownReplace, "question", "?")
    $gUnknownReplace = StringReplace($gUnknownReplace, "none", "")

    ; initially load the font
    _LoadFont($gSelFont)

    ; WM_COMMAND will tell us when the text has changed
    GUIRegisterMsg($WM_COMMAND, "_WmCommand")

    Local $nMsg
    While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
            Case $GUI_EVENT_CLOSE
                ExitLoop
            Case $btnGenerate
;~                 _SciTE_InsertText($figlet)
                $figlet = GUICtrlRead($gEditSignature)

                ; Comment out for AutoIT
                $figlet = StringRegExpReplace($figlet, "(?m)^.", $gCommentStyle)

                ; fix for insertion into SciTE
                ; thanks to Jos for help on this!!
                $figlet = StringReplace($figlet, @CRLF, "\r")
                _SciTE_InsertText($figlet)
                Exit
        EndSwitch
    WEnd

    ; Discard GUI
    GUIDelete()
EndFunc   ;==>_Main

Func _WmCommand($hWndGUI, $msgID, $wParam, $lParam)
    If $lParam = GUICtrlGetHandle($gInputText) Then
        If _WinAPI_HiWord($wParam) = $EN_CHANGE Then
;~             _Display(GUICtrlRead($gInputText), GUICtrlRead($gComboFont))
            _Display(GUICtrlRead($gInputText), $gCurrentFont)
        EndIf
    EndIf
EndFunc   ;==>_WmCommand

Func _Display($sText, $sFontName)
    Local $i, $j, $sChar, $sOutput = ""

    _LoadFont($sFontName)
    For $i = 1 To $gFontMetaData[2]
        For $j = 1 To StringLen($sText)
            $sChar = StringMid($sText, $j, 1)
            ; need to handle English (figlet compatible) chars only...
            If StringRegExp($sChar, "(?i)[a-z0-9[:punct:]\s]") Then
                $sOutput &= _GetCharacter($sChar, $i)
            Else
                ; handle replacement with nothing...
                if stringlen($gUnknownReplace) >0 then
                    $sOutput &= _GetCharacter($gUnknownReplace, $i)
                EndIf

            EndIf
        Next
        $sOutput &= @CRLF
    Next
    GUICtrlSetData($gEditSignature, $sOutput)
EndFunc   ;==>_Display

Func _LoadFont($sFontName)
    If $sFontName = $gCurrentFont Then Return

    Local $aTemp, $sTemp, $nUBound, $sFileLocation = $gFontDir & $sFontName & ".flf", $fTemp = False

    ; Try and unzip it first
    FileCopy($sFileLocation, @TempDir & "\" & $sFontName & ".zip")
    _Zip_UnzipAll(@TempDir & "\" & $sFontName & ".zip", @TempDir)
    If @error = 0 Then
        ; It unzipped OK so let's flag the temporary file
        $fTemp = True
        $sFileLocation = @TempDir & "\" & $sFontName & ".flf"
    EndIf
    FileDelete(@TempDir & "\" & $sFontName & ".zip")

    ; Read in the figlet font in to out array
    _FileReadToArray($sFileLocation, $gFontData)
    $aTemp = StringSplit($gFontData[1], " ", 2) ; Split the first line at spaces
    $nUBound = UBound($aTemp) ; Remember how many parameters we have
    $sTemp = $aTemp[0] ; This contains the signature and the hard blank character
    $gFontMetaData[0] = StringLeft($sTemp, StringLen($sTemp) - 1) ; Signature
    $gFontMetaData[1] = StringRight($sTemp, 1) ; Hard blank
    $gFontMetaData[2] = Number($aTemp[1]) ; Height of each letter
    ;$gFontMetaData[3] = Number($aTemp[2])
    ;$gFontMetaData[4] = Number($aTemp[3])
    ;$gFontMetaData[5] = Number($aTemp[4])
    $gFontMetaData[6] = Number($aTemp[5])
    ;If ($nUBound > 6) Then $gFontMetaData[7] = Number($aTemp[6])
    ;If ($nUBound > 7) Then $gFontMetaData[8] = Number($aTemp[7])
    ;If ($nUBound > 8) Then $gFontMetaData[9] = Number($aTemp[8])
    ;If ($gFontMetaData[0] <> "flf2a") Then Return SetError(1, 0, $sFontName & " is not a valid font")
    If $fTemp Then FileDelete($sFileLocation)
    $gCurrentFont = $sFontName
EndFunc   ;==>_LoadFont

Func _GetCharacter($sChar, $nLine)
    Local $nStart = $gFontMetaData[6] + ((Asc($sChar) - 32) * $gFontMetaData[2]), $sTemp
    $sTemp = $gFontData[$nStart + $nLine + 1]
    $sTemp = StringReplace($sTemp, StringRight($sTemp, 1), "")
    $sTemp = StringReplace($sTemp, $gFontMetaData[1], " ")
    Return $sTemp
EndFunc   ;==>_GetCharacter


; ========================================================================================
Func _SciTE_InsertText($sString)
    Return _SciTE_Send_Command(0, WinGetHandle("DirectorExtension"), "insert:" & $sString)
EndFunc   ;==>_SciTE_InsertText

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
 

A ini-file for settings:

[figlet]
; name of font file without extension
; if not existing or not found, font is "banner"
font=banner

; default style of commenting
; use \t for tab
comment=;~\t

; value of unknown
; use  space | question | none
unknown=none
 

Zip.au3

Edited by Myicq

I am just a hobby programmer, and nothing great to publish right now.

Link to comment
Share on other sites

 

"L:Figlet_Tool_for_SciTe.au3"(33,10) : error: can't open include file <Zip.au3>.

#include <Zip.au3>

 

Please attach this file or do a link.

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

Spoiler

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

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

Link to comment
Share on other sites

 

>"C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "L:Figlet_Tool_for_SciTe.au3" /UserParams    

+>01:34:16 Starting AutoIt3Wrapper v.2.1.2.29 SciTE v.3.3.6.0 ;  Keyboard:00000415  OS:WIN_7/Service Pack 1  CPU:X64 OS:X64    Environment(Language:0415  Keyboard:00000415  OS:WIN_7/Service Pack 1  CPU:X64 OS:X64)
>Running AU3Check (3.3.9.5)  from:C:Program Files (x86)AutoIt3
+>01:34:17 AU3Check ended.rc:0
>Running:(3.3.8.1):C:Program Files (x86)AutoIt3autoit3.exe "L:Figlet_Tool_for_SciTe.au3"    
--> Press Ctrl+Alt+F5 to Restart or Ctrl+Break to Stop
L:Figlet_Tool_for_SciTe.au3 (154) : ==> Subscript used with non-Array variable.:
$aTemp = StringSplit($gFontData[1], " ", 2)
$aTemp = StringSplit($gFontData^ ERROR
->01:34:17 AutoIt3.exe ended.rc:1
>Exit code: 1    Time: 0.648
 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

Spoiler

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

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

Link to comment
Share on other sites

I do not know French but I understood enough

Service d'envoi de fichiers http://dl.free.fr

EDIT:

nothing happen

no one files download

Edited by mlipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

Spoiler

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

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

Link to comment
Share on other sites

I do not know French but I understood enough

Service d'envoi de fichiers http://dl.free.fr

EDIT:

nothing happen

no one files download

 

may be you're subject to some access restrictions...

Go to http://www.jave.de/figlet/fonts.html and get figletfonts40.zip

Decompress it an rename it to fonts

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

Link to comment
Share on other sites

                                                                                                           
 #    #  ######  #####    ####   #          #####   ######    ##    #    #   ####    ####   #    #  #####  
 ##  ##  #       #    #  #    #  #          #    #  #        #  #   #    #  #    #  #    #  #    #  #    # 
 # ## #  #####   #    #  #       #          #####   #####   #    #  #    #  #       #    #  #    #  #    # 
 #    #  #       #####   #       #          #    #  #       ######  #    #  #       #    #  #    #  #####  
 #    #  #       #   #   #    #  #          #    #  #       #    #  #    #  #    #  #    #  #    #  #      
 #    #  ######  #    #   ####   #          #####   ######  #    #   ####    ####    ####    ####   #      
                                                                                                           
 
 
 

EDIT: second example:

  #          ##   
 ###           #  
  #             # 
      #####     # 
  #             # 
 ###           #  
  #          ##   
                  
Edited by mlipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

Spoiler

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

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

Link to comment
Share on other sites

#     #                  ###                                                                             
     #   #    ####   #    #  ###  #####   ######      #    #  ######  #        ####    ####   #    #  ###### 
      # #    #    #  #    #   #   #    #  #           #    #  #       #       #    #  #    #  ##  ##  #      
       #     #    #  #    #  #    #    #  #####       #    #  #####   #       #       #    #  # ## #  #####  
       #     #    #  #    #       #####   #           # ## #  #       #       #       #    #  #    #  #      
       #     #    #  #    #       #   #   #           ##  ##  #       #       #    #  #    #  #    #  #      
       #      ####    ####        #    #  ######      #    #  ######  ######   ####    ####   #    #  ######

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

Link to comment
Share on other sites

I wonder why before, did gave me extra line spacing.

 #     #                                                                                                
 ##   ##  ######  #####    ####   #      #####   ######    ##    #    #   ####    ####   #    #  #####  
 # # # #  #       #    #  #    #  #      #    #  #        #  #   #    #  #    #  #    #  #    #  #    # 
 #  #  #  #####   #    #  #       #      #####   #####   #    #  #    #  #       #    #  #    #  #    # 
 #     #  #       #####   #       #      #    #  #       ######  #    #  #       #    #  #    #  #####  
 #     #  #       #   #   #    #  #      #    #  #       #    #  #    #  #    #  #    #  #    #  #      
 #     #  ######  #    #   ####   #      #####   ######  #    #   ####    ####    ####    ####   #      
                                                                                                        
 

EDIT:

and again

but when I "PASTE" text to forum all is OK

Edited by mlipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

Spoiler

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

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

Link to comment
Share on other sites

  • Will ignore non-English characters and replace by user-defined

Can you describe some more ?

for example   Polish char     Ć ć

 
  • User-definable comment style when inserting

Can you do a GUI (ie. combobox or something like that) ?

 

 

  • Auto-insert at cursor point in SciTE (thanks to Jon for help with this !)

Is it button "Generate" ? 

Why script end after using them ?

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

Spoiler

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

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

Link to comment
Share on other sites

-.                       .-.  _  .--.      .-.  .-.       _              .-. .-.      _  .-. 
     :                      .' `.:_;: .-'      : :  : :      :_;            .'.'.' `.    :_;.' `.
     `-.  .--.  .--.  .-..-.`. .'.-.: `; .-..-.: :  : :      .-. .--. ,-.,-.`-' `. .'    .-.`. .'
     .; :' '_.'' .; ; : :; : : : : :: :  : :; :: :_ : :_     : :`._-.': ,. :     : :     : : : : 
    .__.'`.__.'`.__,_;`.__.' :_; :_;:_;  `.__.'`.__;`.__;    :_;`.__.':_;:_;     :_;     :_; :_;

I have tried some other fonts but result is unreadable... :ermm:

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

Link to comment
Share on other sites

@mlipok

Try this modified version :

;~    #######                                    #######
;~    #        #   ####   #       ######  #####     #      ####    ####   #
;~    #        #  #    #  #       #         #       #     #    #  #    #  #
;~    #####    #  #       #       #####     #       #     #    #  #    #  #
;~    #        #  #  ###  #       #         #       #     #    #  #    #  #
;~    #        #  #    #  #       #         #       #     #    #  #    #  #
;~    #        #   ####   ######  ######    #       #      ####    ####   ######
;~
;~    #######                             #                            ###  #######   #####
;~    #         ####   #####             # #    #    #  #####   ####    #      #     #     #
;~    #        #    #  #    #           #   #   #    #    #    #    #   #      #           #
;~    #####    #    #  #    #          #     #  #    #    #    #    #   #      #      #####
;~    #        #    #  #####           #######  #    #    #    #    #   #      #           #
;~    #        #    #  #   #           #     #  #    #    #    #    #   #      #     #     #
;~    #         ####   #    #          #     #   ####     #     ####   ###     #      #####
;~
;~  _   _                   _                 __      _____  __
;~ | | | |                 (_)               /  |    |  _  |/  |
;~ | | | |  ___  _ __  ___  _   ___   _ __   `| |    | |/' |`| |
;~ | | | | / _ \| '__|/ __|| | / _ \ | '_ \   | |    |  /| | | |
;~ \ \_/ /|  __/| |   \__ \| || (_) || | | | _| |_ _ \ |_/ /_| |_
;~  \___/  \___||_|   |___/|_| \___/ |_| |_| \___/(_) \___/ \___/
;~

#Region    ;************ Includes ************
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#Include <ComboConstants.au3>
#include <EditConstants.au3>
#include <WinAPI.au3>
#Include <Array.au3>
#include <File.au3>
#include <Zip.au3>
#EndRegion ;************ Includes ************

Global $hGui, $gInputText, $idComboFonts, $gEditSignature, $gCurrentFont = "", $gSelFont, $gCommentStyle, $gUnknownReplace
Global $gFontData, $gFontMetaData[10], $gFontDir = @ScriptDir & "\fonts\"

; Create and show GUI
$hGui = GUICreate("AutoFiglet", 810, 426, -1, -1, BitOR($WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU, $WS_SIZEBOX))
GUICtrlCreateLabel("Text line", 8, 8, 550, 16)
GUICtrlSetResizing(-1, BitOR($GUI_DOCKHEIGHT, $GUI_DOCKTOP, $GUI_DOCKLEFT))
$gInputText = GUICtrlCreateInput("", 8, 28, 550, 20)
GUICtrlSetResizing(-1, BitOR($GUI_DOCKHEIGHT, $GUI_DOCKTOP, $GUI_DOCKLEFT))
$gEditSignature = GUICtrlCreateEdit("", 8, 56, 794, 320, BitOR($ES_AUTOVSCROLL, $WS_HSCROLL, $ES_WANTRETURN))
GUICtrlSetResizing(-1, BitOR($GUI_DOCKRIGHT, $GUI_DOCKLEFT, $GUI_DOCKTOP, $GUI_DOCKBOTTOM))
GUICtrlSetFont(-1, 9, 400, 0, "Courier New")
$aFontList = _FileListToArray ( $gFontDir, '*flf', 1 )
$sFontList = _ArrayToString ( $aFontList, '|', 1)
$sFontList = StringReplace ( $sFontList, '.flf', '' )
$idComboFonts = GUICtrlCreateCombo ( "banner", 20, 384, 100, 20 ) ; create first item
GUICtrlSetData(-1, $sFontList, "banner" ) ; add other item snd set a new default
Local $btnGenerate = GUICtrlCreateButton("Generate", 680, 384, 122, 32, $BS_DEFPUSHBUTTON)
GUICtrlSetResizing(-1, BitOR($GUI_DOCKRIGHT, $GUI_DOCKBOTTOM, $GUI_DOCKHEIGHT, $GUI_DOCKWIDTH))
GUISetState(@SW_SHOW)
; setup selected font
$gSelFont = IniRead(@ScriptDir & "\figlet.ini", "figlet", "font", "banner")
; does font exist ? No, set to "banner"
If Not FileExists($gFontDir & "\" & $gSelFont & ".zip") Then $gSelFont = 'fuzzy';"banner"
; setup comment style
$gCommentStyle = IniRead(@ScriptDir & "\figlet.ini", "figlet", "comment", ";" & @TAB)
$gCommentStyle = StringReplace($gCommentStyle, "\t", @TAB)
; setup unknown replacement
$gUnknownReplace = IniRead(@ScriptDir & "\figlet.ini", "figlet", "unknown", "space")
$gUnknownReplace = StringReplace($gUnknownReplace, "space", " ")
$gUnknownReplace = StringReplace($gUnknownReplace, "question", "?")
$gUnknownReplace = StringReplace($gUnknownReplace, "none", "")
; initially load the font
;~ _LoadFont($gSelFont)
; WM_COMMAND will tell us when the text has changed
GUIRegisterMsg($WM_COMMAND, "_WmCommand")
Local $nMsg

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            ExitLoop
        Case $btnGenerate
            $figlet = GUICtrlRead($gEditSignature)
            ; Comment out for AutoIT
            $figlet = StringRegExpReplace($figlet, "(?m)^.", $gCommentStyle)
            ; fix for insertion into SciTE
            ; thanks to Jos for help on this!!
            $figlet = StringReplace($figlet, @CRLF, "\r")
            $sSaveFilePath = @TempDir & '\' & @YEAR & @MON & @MDAY & @HOUR & @MIN & @SEC & '.au3'
            FileWrite ( $sSaveFilePath, '' )
            _SciTE_Send_Command ( $hGui, WinGetHandle ( 'DirectorExtension' ), 'open:' & StringReplace ( $sSaveFilePath, '\', '\\' ) )
            _SciTE_InsertText($figlet)
    EndSwitch
WEnd

; Discard GUI
GUIDelete()

Func _Display($sText, $sFontName)
    Local $i, $j, $sChar, $sOutput = ""
    _LoadFont ( $sFontName )
    For $i = 1 To $gFontMetaData[2]
        For $j = 1 To StringLen($sText)
            $sChar = StringMid($sText, $j, 1)
            ; need to handle English (figlet compatible) chars only...
            If StringRegExp($sChar, "(?i)[a-z0-9[:punct:]\s]") Then
                $sOutput &= _GetCharacter($sChar, $i)
            Else
                ; handle replacement with nothing...
                if stringlen($gUnknownReplace) >0 then
                    $sOutput &= _GetCharacter($gUnknownReplace, $i)
                EndIf
            EndIf
        Next
        $sOutput &= @CRLF
    Next
    GUICtrlSetData($gEditSignature, $sOutput)
EndFunc   ;==>_Display

Func _GetCharacter($sChar, $nLine)
    Local $nStart = $gFontMetaData[6] + ((Asc($sChar) - 32) * $gFontMetaData[2]), $sTemp
    $sTemp = $gFontData[$nStart + $nLine + 1]
    $sTemp = StringReplace($sTemp, StringRight($sTemp, 1), "")
    $sTemp = StringReplace($sTemp, $gFontMetaData[1], " ")
    Return $sTemp
EndFunc   ;==>_GetCharacter

Func _LoadFont($sFontName)
    If $sFontName = $gCurrentFont Then Return
    Local $aTemp, $sTemp, $nUBound, $sFileLocation = $gFontDir & $sFontName & ".flf", $fTemp = False
    ; Try and unzip it first
    FileCopy($sFileLocation, @TempDir & "\" & $sFontName & ".zip")
    _Zip_UnzipAll(@TempDir & "\" & $sFontName & ".zip", @TempDir)
    If @error = 0 Then
        ; It unzipped OK so let's flag the temporary file
        $fTemp = True
        $sFileLocation = @TempDir & "\" & $sFontName & ".flf"
    EndIf
    FileDelete(@TempDir & "\" & $sFontName & ".zip")
    ; Read in the figlet font in to out array
    _FileReadToArray($sFileLocation, $gFontData)
    $aTemp = StringSplit($gFontData[1], " ", 2) ; Split the first line at spaces
    $nUBound = UBound($aTemp) ; Remember how many parameters we have
    $sTemp = $aTemp[0] ; This contains the signature and the hard blank character
    $gFontMetaData[0] = StringLeft($sTemp, StringLen($sTemp) - 1) ; Signature
    $gFontMetaData[1] = StringRight($sTemp, 1) ; Hard blank
    $gFontMetaData[2] = Number($aTemp[1]) ; Height of each letter
    ;$gFontMetaData[3] = Number($aTemp[2])
    ;$gFontMetaData[4] = Number($aTemp[3])
    ;$gFontMetaData[5] = Number($aTemp[4])
    $gFontMetaData[6] = Number($aTemp[5])
    ;If ($nUBound > 6) Then $gFontMetaData[7] = Number($aTemp[6])
    ;If ($nUBound > 7) Then $gFontMetaData[8] = Number($aTemp[7])
    ;If ($nUBound > 8) Then $gFontMetaData[9] = Number($aTemp[8])
    ;If ($gFontMetaData[0] <> "flf2a") Then Return SetError(1, 0, $sFontName & " is not a valid font")
    If $fTemp Then FileDelete($sFileLocation)
    $gCurrentFont = $sFontName
EndFunc   ;==>_LoadFont

Func _SciTE_InsertText($sString)
    Return _SciTE_Send_Command(0, WinGetHandle("DirectorExtension"), "insert:" & $sString)
EndFunc   ;==>_SciTE_InsertText

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
    $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 _WmCommand ( $hWnd, $iMsg, $wParam, $lParam )
    Switch $hWnd
        Case $hGui
            Switch $lParam
                Case GUICtrlGetHandle($gInputText), GUICtrlGetHandle ( $idComboFonts )
                    Switch _WinAPI_HiWord($wParam)
                        Case $EN_CHANGE, $CBN_SELCHANGE
                            _Display(GUICtrlRead($gInputText), GUICtrlRead($idComboFonts))
                    EndSwitch
            EndSwitch
    EndSwitch
    Return $GUI_RUNDEFMSG
EndFunc   ;==>_WmCommand

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

Link to comment
Share on other sites

 

::::'######:::'#######:::'#######::'##::::::::::

:::'##... ##:'##.... ##:'##.... ##: ##::::::::::
::: ##:::..:: ##:::: ##: ##:::: ##: ##::::::::::
::: ##::::::: ##:::: ##: ##:::: ##: ##::::::::::
::: ##::::::: ##:::: ##: ##:::: ##: ##::::::::::
::: ##::: ##: ##:::: ##: ##:::: ##: ##::::::::::
:::. ######::. #######::. #######:: ########::::
::::......::::.......::::.......:::........:::::
 
::::'######:::'#######:::'#######::'##::::::::::
:::'##... ##:'##.... ##:'##.... ##: ##::::::::::
::: ##:::..:: ##:::: ##: ##:::: ##: ##::::::::::
::: ##::::::: ##:::: ##: ##:::: ##: ##::::::::::
::: ##::::::: ##:::: ##: ##:::: ##: ##::::::::::
::: ##::: ##: ##:::: ##: ##:::: ##: ##::::::::::
:::. ######::. #######::. #######:: ########::::
::::......::::.......::::.......:::........:::::
 
 
::::'######:::'#######:::'#######::'##::::::::::
:::'##... ##:'##.... ##:'##.... ##: ##::::::::::
::: ##:::..:: ##:::: ##: ##:::: ##: ##::::::::::
::: ##::::::: ##:::: ##: ##:::: ##: ##::::::::::
::: ##::::::: ##:::: ##: ##:::: ##: ##::::::::::
::: ##::: ##: ##:::: ##: ##:::: ##: ##::::::::::
:::. ######::. #######::. #######:: ########::::
::::......::::.......::::.......:::........:::::
Edited by mlipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

Spoiler

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

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

Link to comment
Share on other sites

,ad8888ba,   88                       88                                                 88  88  88                         88               88  
    d8"'    `"8b  88                       88                                                 88  ""  88                         ""    ,d         88  
    8'            88                       88                                                 88      88                               88         88  
    8             88  ,adPPYYba,   ,adPPYb,88      8b       d8   ,adPPYba,   88       88      88  88  88   ,d8    ,adPPYba,      88  MM88MMM      88  
    8      88888  88  ""     `Y8  a8"    `Y88      `8b     d8'  a8"     "8a  88       88      88  88  88 ,a8"    a8P_____88      88    88         88  
    8,        88  88  ,adPPPPP88  8b       88       `8b   d8'   8b       d8  88       88      88  88  8888[      8PP"""""""      88    88         ""  
    Y8a.    .a88  88  88,    ,88  "8a,   ,d88        `8b,d8'    "8a,   ,a8"  "8a,   ,a88      88  88  88`"Yba,   "8b,   ,aa      88    88,        aa  
     `"Y88888P"   88  `"8bbdP"Y8   `"8bbdP"Y8          Y88'      `"YbbdP"'    `"YbbdP'Y8      88  88  88   `Y8a   `"Ybbd8"'      88    "Y888      88  
                                                       d8'                                                                                            
                                                      d8'

^_^

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

Link to comment
Share on other sites

I like this 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

Spoiler

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

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

Link to comment
Share on other sites

___   ___    ________      ___ __ __    ________  ______   _________  ______   ______        __  __   ______     ______      __      
/__/\ /__/\  /_______/\    /__//_//_/\  /_______/\/_____/\ /________/\/_____/\ /_____/\      /_/\/_/\ /_____/\   /_____/\    /__/\    
\::\ \\  \ \ \__.::._\/    \::\| \| \ \ \__.::._\/\::::_\/_\__.::.__\/\::::_\/_\:::_ \ \     \:\ \:\ \\::::_\/_  \:::__\/    \.:\ \   
 \::\/_\ .\ \   \::\ \      \:.      \ \   \::\ \  \:\/___/\  \::\ \   \:\/___/\\:(_) ) )_    \:\ \:\ \\:\/___/\    /: /      \::\ \  
  \:: ___::\ \  _\::\ \__    \:.\-/\  \ \  _\::\ \__\_::._\:\  \::\ \   \::___\/_\: __ `\ \    \:\ \:\ \\::___\/_  /::/___     \__\/_ 
   \: \ \\::\ \/__\::\__/\    \. \  \  \ \/__\::\__/\ /____\:\  \::\ \   \:\____/\\ \ `\ \ \    \:\_\:\ \\:\____/\/_:/____/\     /__/\
    \__\/ \::\/\________\/     \__\/ \__\/\________\/ \_____\/   \__\/    \_____\/ \_\/ \_\/     \_____\/ \_____\/\_______\/     \__\/

:D

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

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

×
×
  • Create New...