Jump to content

concept assistance needed


Recommended Posts

I have started work on making a add-on for the AutoIt help file. Now before you start flaming me, hear me out. Let me make one thing clear from the start: THIS WILL NOT MAKE ANY CHANGES DIRECTLY TO THE HELP FILE. I have no intention of tampering with the CHM file, nor will I entertain the idea of it. With that said, let me continue..

One big pet peeve I have with the help file is that you can't add a note to a help file entry. I also like to be able to add a code example to the entry. The best way to describe what I'm wanting to do is think of a text book. You want to be able to write in it, highlight text that you feel is important, and so forth. How I'm thinking the thing will work:

1. A tool bar will be used that will sit to the right of the Print button. This will allow for the tool bar to be moved in case the "hide/show" button is clicked.

2. Any information that is added will be put in a INI file. This will allow for any updates to the help file, while keeping the information you added intact.

3. In referencing the information in the help file, I plan to use the header on the right pane as a reference point. Example: The header has "Function Reference" for text, and the command is listed as "ControlClick". The INI entry would be listed as:

  • Section - [Function Reference - ControlClick]
  • Key - note = "anything you like"
  • Key - code1 = "path to first example.au3 file, key - code2 = "path to second example.au3 file, and so forth.
  • Key - highlight1 = "text that is highlighted", Key - highlight2 = "text that is highlighted" and so forth
4. The buttons to be present on the tool bar are:
  • Add comments - This will let you add a comment to the current item being displayed. This information will be displayed in a GUI that will allow for you to edit. If a comment was added to a item, the button will display "Edit comments"
  • Add code example - This will allow for you to add a code example. You will first have to save the example to a au3 file. Then click "add code example", and point to where the file is. It would be a good idea to have a folder in the AutoIt directory specific to this task.
  • View code examples - This will allow for you to view any code examples you have added for the item currently being displayed. If there are no items listed, the button will be grayed out. If you select a code example, it will open in your editor for review.
  • Highlight - This will allow for you to highlight any text in the item listed.
  • Function - Someone provided you a cool function, and you want to catalog it. You have to save it as a au3 in the include folder, then you can add notes on what it does, and examples on how to use.
I suspect the tough problem will be making the highlight tool. Also, if someone has a idea of what else would be good to add or a better way to do it, let me know. As always, if someone wants to help, by all means please do! I'm not the best at coding, and I can use all the assistance I can get.
Link to comment
Share on other sites

  • Replies 42
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Bump....I would think someone would have dropped a comment about this..... :D

Displaying your annotations inside the HTML Help will actually be pretty easy. Creating an interface allowing you to select text, add and store annotations will be much more complex although doable.

You can interact with the HTML Help control using IE.au3 T2.0 e.g.:

#include <IE.au3>
$oIE = _IE_Attach("AutoItHelp", "embedded")
_IELinkClickByText($oIE, "Aut2Exe")oÝ÷ Ù.q©ëy§máÓ0·ë¢kaz zȧ©òÁ¬¬w%¹Ø§«­¢+ØÀÌØíÍ!Q50ô}%  ½åI!Q50 ÀÌØí½%¤

You can register navigation cmplete events on the document that will allow you to sense when a new page is loaded and take appropriate action...

Just some ideas to start with.

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

Thanks Dale, this will help alot.

This actually makes a good example. Here is is cleaner, event driven and commented. Feel free to slice and dice and use as your own... It reacts to helppage display changes and if it inserts custom annotation text when the page matches a section or function you have specified. Putting together an interface for saving an annotation for the currently displayed page would be pretty simple as well.

#include <IE.au3>
    
; Start the Helpfile if necessary
If Not WinExists("AutoIt Help") Then
    Run("hh.exe " & @ProgramFilesDir & "\AutoIt3\beta\AutoIt.chm")
    WinWait("AutoIt Help")
EndIf
    
; Get the window handle
Local $hAutoItHelp = WinGetHandle("AutoIt Help")
    
; Attach with IE.au3
Local $oIE = _IEAttach ($hAutoItHelp, "embedded")
    
; Set up an event sink so that we can trigger on page loads
$oEvent = ObjEvent($oIE, "Evt_")
    
; The inital page load is already done... refresh so that event fires
_IEAction($oIE, "refresh")
    
; Exit is the window closes
While WinExists($hAutoItHelp)
    Sleep(500)
WEnd
    
Exit
    
Func Evt_onload()
    ; This function will be fired whenever a new help page loads
    
    ; Get a reference to the first H1 tag, then its text
    Local $o_object = @COM_EventObj
    Local $oSection = _IETagNameGetCollection ($o_object, "h1", 0)
    Local $sSectionText = $oSection.innerText
    
    ; When Section is "Function Reference", the next element is the function name
    ; Get a reference to the function name, then its text
    Local $oFunction = $oSection.nextSibling
    Local $sFunctionText = $oFunction.innerText
    
    Switch $sSectionText
        Case "Introduction"
            Annotate($oSection, "This is an example of helpfile annotation through AutoIt and IE.au3")
        Case "Software License"
            Annotate($oSection, "It doesn't get any better than this...")
        Case "Function Reference"
            Switch $sFunctionText
                Case "HotKeySet"
                    Annotate($oFunction, "Function Reference, Keyboard Control, HotKeySet" & _
                    "<p>HotKeySet is a very useful function...")
                Case "Send"
                    Annotate($oFunction, "Stuff about Send<p>Send(foobar)")
                Case Else
                    ;;;;
            EndSwitch
        Case Else
            ;;;
    EndSwitch
EndFunc   ;==>Evt_onload

Func Annotate(ByRef $o_object, $s_text)
    Local $sHTML = ""
    $sHTML &= "<table width=100% bgcolor=yellow>"
    $sHTML &= "<tr bgcolor=blue>"
    $sHTML &= "<td><font size=+1 color=white>Custom Annotation</font></td>"
    $sHTML &= "</tr>"
    $sHTML &= "<tr>"
    $sHTML &= "<td>" & $s_text & "</td>"
    $sHTML &= "</tr>"
    $sHTML &= "</table>"
    $o_object.insertAdjacentHTML ("AfterEnd", $sHTML)
    Return 1
EndFunc   ;==>Annotate

Dale

Edit: Improve formatting, use refresh instead of calling event routine

Edited by DaleHohm

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

Maaan, this one is to impressive to be true. I don't have words. Thanks Dale.

So all that has to be done to create a collaborating environment is to have a editor like @vollyman has suggested and then have a option to post your notes to a wiki.

The managing application could have a option to download notes from the wiki. Or at least tags showing that there is a note about the page.

I have wrapped up some controls to play with. Fare from finished and polished, but maybe something to get people creative. :D

; FILENAME: chmNotes.au3
; PURPOSE: Add simple editor to chm files
; TODO: Controls are not redrwaing properly. Probably a style/styleex combination thing or
; TODO: 
#include <GUIConstants.au3>
#include <IE.au3>

Opt("WinTitleMatchMode", 4)
Opt("GUIResizeMode",$GUI_DOCKBOTTOM+$GUI_DOCKHEIGHT)
Opt("RunErrorsFatal", 0)

Global $gHelpPathName = @ProgramFilesDir & "\AutoIt3\beta\AutoIt.chm" 
; TODO: Get titlebar height from system
; TODO: Get top of $memo
; TODO: Coordinate offsets and sizes with values in GUISetup
Global $gOffY = -23, $gOffX= 0, $gOffWidth = 0, $gOffHeight = 210 + $gOffY
Main()
Exit

Func Main() 
   ; Create the gui and get a window handel
   Local $hMe = WinGetHandle(GUISetup())
   ; Wrap up help window
   Local $hAIHelp = HelpSetup("AutoIt Help", $gHelpPathName, $hMe)
   local $i
   While 1; WinExists("AutoIt Help")
       $msg = GuiGetMsg()
       Switch $msg
         Case $GUI_EVENT_CLOSE
           ExitLoop
         Case $GUI_EVENT_MAXIMIZE, $GUI_EVENT_RESIZED, $GUI_EVENT_RESTORE
            $mySize =WinGetClientSize($hMe)
            WinMove($hAIHelp,"", $gOffX, $gOffY, $mySize[0] - $gOffWidth, $mySize[1] - $gOffHeight )           
         Case Else
              ;;;;;;;
       EndSwitch
   WEnd
EndFunc  ;==>Main()


Func GUISetup($state=@SW_SHOW)
   Local $height=@DesktopHeight-100, $width = @DesktopWidth/2
   Local $toplimit = $height - 200
   Global $gForm1 = GUICreate("CHM Notes", $width , $height, 10, 10, BitOr($WS_OVERLAPPEDWINDOW, $WS_SIZEBOX, $WS_CLIPSIBLINGS, $WS_CLIPCHILDREN, $WS_SIZEBOX))
   Global $gchkPublic = GUICtrlCreateCheckbox("Public", 5, $toplimit - 5, 105, 25)
   Global $gcmdSave = GUICtrlCreateButton("cmdSave", 5, $toplimit + 105 + (2*25 + 2*5) , 113, 25)
   Global $gcmdCancel = GUICtrlCreateButton("cmdCancel", 5, $toplimit + 105 + (1*25 + 1*5), 113, 25)
   
   Global $gctlMemo = GUICtrlCreateEdit("", 120, $toplimit - 5, $width - 130, $height - $toplimit - 10, -1, $WS_EX_CLIENTEDGE + $WS_EX_TRANSPARENT)
   GUICtrlSetData($gctlMemo, "ctlMemo")
   GUISetState(@SW_SHOW)
   Return $gForm1
EndFunc   ;==>GUISetup

Func HelpSetup($title, $runString, $hMe)
   ; Start the Helpfile if necessary

   Local $PidOrName
   If Not WinExists($title) Then
      $PidOrName = $runString
   Else 
      $PidOrName = WinGetProcess($title)
   EndIf
   Local $mySize =WinGetClientSize($hMe) 
   ; Get the window handle
   Local $hAutoItHelp = NavEmbedApp($PidOrName, $hMe, $gOffX, $gOffY, $mySize[0] - $gOffWidth, $mySize[1] - $gOffHeight )   
      
   ; Attach with IE.au3
   Local $oIE = _IEAttach ($hAutoItHelp, "embedded")
      
   ; Set up an event sink so that we can trigger on page loads
   $oEvent = ObjEvent($oIE, "Evt_")
      
   ; The inital page load is already done... refresh so that event fires
   _IEAction($oIE, "refresh")
   Return $hAutoItHelp
EndFunc   ;==> HelpSetup

Func Evt_onload()
    ; This function will be fired whenever a new help page loads
   
    ; Get a reference to the first H1 tag, then its text
    Local $o_object = @COM_EventObj
    Local $oSection = _IETagNameGetCollection ($o_object, "h1", 0)
    Local $sSectionText = $oSection.innerText
   
    ; When Section is "Function Reference", the next element is the function name
    ; Get a reference to the function name, then its text
    Local $oFunction = $oSection.nextSibling
    Local $sFunctionText = $oFunction.innerText
   
    Switch $sSectionText
        Case "Introduction"
            Annotate($oSection, "This is an example of helpfile annotation through AutoIt and IE.au3")
        Case "Software License"
            Annotate($oSection, "It doesn't get any better than this...")
        Case "Function Reference"
            Switch $sFunctionText
                Case "HotKeySet"
                    Annotate($oFunction, "Function Reference, Keyboard Control, HotKeySet" & _
                    "<p>HotKeySet is a very useful function...")
                Case "Send"
                    Annotate($oFunction, "Stuff about Send<p>Send(foobar)")
                Case Else
                    ;;;;
            EndSwitch
        Case Else
            ;;;
    EndSwitch
EndFunc   ;==>Evt_onload
   
Func Annotate(ByRef $o_object, $s_text)
    Local $sHTML = ""
    $sHTML &= "<table width=100% bgcolor=yellow>"
    $sHTML &= "<tr bgcolor=blue>"
    $sHTML &= "<td><font size=+1 color=white>Custom Annotation</font></td>"
    $sHTML &= "</tr>"
    $sHTML &= "<tr>"
    $sHTML &= "<td>" & $s_text & "</td>"
    $sHTML &= "</tr>"
    $sHTML &= "</table>"
    $o_object.insertAdjacentHTML ("AfterEnd", $sHTML)
    Return 1
EndFunc   ;==>Annotate 
 ; ==== NavEmbedApp -   Load application inside your own window adn constrain it to
;                   Your applications window.
;   $appPathName:   The application to load inside your window
;   $hGUI:          Window handel to the window you want the app confined by.
;   $left:          left constraint.
;   $top:           top constraint.
;   $width:         width constraint.
;   $height:        height contraint.

Func NavEmbedApp($appPathName, $hGUI, $left=0, $top=0, $width=200, $height=200)
    ; TODO: How about existsing windows
    if ProcessExists($appPathName) Then 
      $PID = $appPathName
    Else 
      $PID    = Run($appPathName, "", @SW_HIDE)
    Endif 
    if $PID = 0 then 
        ErrLog("Could not embed: " & $appPathName,1, "NavEmbedApp")
        Exit
    Endif
    $hWnd    = 0
    $stPID    = DllStructCreate("int")

    Do
        $WinList = WinList()
        For $i = 1 To $WinList[0][0]
            If $WinList[$i][0] <> "" Then
                DllCall("user32.dll", "int", "GetWindowThreadProcessId", "hwnd", $WinList[$i][1], "ptr", DllStructGetPtr($stPID))
                If DllStructGetData($stPID, 1) = $PID Then
                    $hWnd = $WinList[$i][1]
                    ExitLoop
                EndIf
            EndIf
        Next
        Sleep(100)
    Until $hWnd <> 0

    $stPID = 0

    If $hWnd <> 0 Then
        $nExStyle = DllCall("user32.dll", "int", "GetWindowLong", "hwnd", $hWnd, "int", -20)
        $nExStyle = $nExStyle[0]
        DllCall("user32.dll", "int", "SetWindowLong", "hwnd", $hWnd, "int", -20, "int", BitOr($nExStyle, $WS_EX_MDICHILD))
        DllCall("user32.dll", "int", "SetParent", "hwnd", $hWnd, "hwnd", $hGUI)    
        WinSetState($hWnd, "", @SW_SHOW)
        WinMove($hWnd, "", $left, $top, $width, $height)
    EndIf
    Return $hWnd 
EndFunc
 
Func ErrLog($msg, $error, $CallingFunc="", $FailingFunc="", $Module=@ScriptName, $ScriptLine=@ScriptLineNumber )
   ConsoleWrite("ErrorLog: erl:=" & $ScriptLine & ", " & $msg & " [" & $CallingFunc & "::" & $FailingFunc & "]" & @LF)
EndFunc

EDIT: Updated to refelct changes in @DaleHohm's changes in code post above.

Edited by Uten
Link to comment
Share on other sites

I'm glad the experienced coders are taking interest in this. I was trying to explain the concept to my wife, and I also came up with another reason for this: I will code something, and get some help in doing it. 3 months later, I'm in the forum again hunting down what I did, if I remember what I did (my wife claims I have the memory of a nat) Having the ability to save the information in this format I propose would make it much easier.

Link to comment
Share on other sites

...I also came up with another reason for this: I will code something, and get some help in doing it. 3 months later, I'm in the forum again hunting down what I did, if I remember what I did (my wife claims I have the memory of a nat) Having the ability to save the information in this format I propose would make it much easier.

I've done that, going back to look in this forum for something previously found. Annotation of the help file is an interesting idea. Keep in mind the technique will have to survive constantly replacing the primary help file as the Betas get churned out... :-)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Maaan, this one is to impressive to be true. I don't have words. Thanks Dale.

Yeah, it is pretty cool isn't it :D It's the DllCall routines for attaching to an embedded control that Larry/Valik wrote that make it possible.

You'll want to take a look back at the code I posted as I updated it after you took your snapshot... significant, but easy changes... instead of calling the onload function manually I do a refresh and instead of using $oIE as a global variable I use the @COM_EventObj macro in the event routine. Much cleaner and also it appears to be more reliable.

Dale

Edit: typos

Edited by DaleHohm

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

@PsaltyDS: The technique I came up with should allow for changes to the help file for the most part. If a command gets a name change, that will be a problem. The user will need to go into the ini to rename it to fix. The only big headache will be the highlight tool, and that will take some trial and error to see if I can get that working. I've never tried to make something like that, so it should be fun.

Link to comment
Share on other sites

  • 4 weeks later...
  • Moderators

Let me know if this is worth pursuing further?

This allows you to:

1. Create a comment for each function.

2. Add your own custom example for each function.

Requirements:

Latest IE.au3

Latest Beta

#include <IE.au3>
#include <File.au3>

Global _
        $oIE, _
        $oButton1, $oParent, _
        $sInstallPath = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt", "betaInstallDir"), _
        $sExamplePath = $sInstallPath & "\Examples\Helpfile\Examples\", _
        $sCommentPath = $sInstallPath & "\Examples\Helpfile\Comments\"

HotKeySet("{Esc}", "_Exit")

; Create the directory stores if they don't already exist
DirCreate($sExamplePath)
DirCreate($sCommentPath)

; Check to see that the helpfile is open
If Not WinExists("AutoIt Help") Then
    Run("hh.exe " & $sInstallPath & "\AutoIt.chm", $sInstallPath)
    WinWait("AutoIt Help")
EndIf
WinActivate("AutoIt Help")
WinWaitActive("AutoIt Help")

; Register the IE.au3 Error Handler
_IEErrorHandlerRegister ()

; Attach to the helpfile browser window
$oIE = _IEAttach ("AutoIt Help", "Embedded")
If Not IsObj($oIE) Then
    MsgBox(48, "Error", "Could not attach to the help file.")
    Exit
EndIf

; Set up an event sink so that we can trigger on page loads
$oEvent = ObjEvent($oIE, "Evt_")

; The inital page load is already done... refresh so that event fires
_IEAction ($oIE, "refresh")

; Keep the script running as long as $oIE is a browser object
While __IEIsObjType ($oIE, "browserdom")
    Sleep(50)
WEnd

Func Evt_onload()
    
    ; This function will be fired whenever a new help page loads
    
    ; Get a reference to the first H1 tag, then its text
    Local $o_object = @COM_EventObj
    Local $oSection = _IETagNameGetCollection ($o_object, "h1", 0)
    Local $sSectionName = $oSection.innerText
    
    ; When Section is "Function Reference", the next element is the function name
    ; Get a reference to the function name, then its text
    Local $oFunction = $oSection.nextSibling
    Local $sFuncName = $oFunction.innerText
    
    ; Get a reference to the "Open this Script" button
    ; Then get a reference to its parent which is the codebox
    $oButton1 = _IETagNameGetCollection ($oIE, "OBJECT", 0)
    $oParent = $oButton1.parentElement
    
    Switch $sSectionName
        Case "Introduction"
            Annotate($oSection, "This is an example of helpfile annotation through AutoIt and IE.au3")
        Case "Software License"
            Annotate($oSection, "It doesn't get any better than this...")
        Case "Function Reference", "Keyword Reference"
            Annotate($oSection, "This script allows you to do two things...<br><br>" & _
                    "1. Create a comment for each function.<br>" & _
                    "2. Add your own custom example for each function.")
            _CreateFiles($sFuncName)
            _CreateComment($sFuncName)
            _CreateExample($sFuncName)
        Case Else
            ;;;
    EndSwitch
EndFunc   ;==>Evt_onload

Func _CreateFiles($s_FuncName)
    $sExampleFile = $sExamplePath & $s_FuncName & "_Custom.au3"
    $sCommentFile = $sCommentPath & $s_FuncName & ".txt"
    If Not FileExists($sExampleFile) Then
        _FileCreate($sExampleFile)
    EndIf
    If Not FileExists($sCommentFile) Then
        _FileCreate($sCommentFile)
    EndIf
EndFunc   ;==>_CreateFiles

Func _CreateExample($s_FuncName)
    ; Create a new element to hold the button
    $oButton2 = $oIE.document.createElement ("")
    
    ; Build the HTML for the button
    If Not IsObj($oButton2) Then Return 0
    $sHTML = "&nbsp;"
    $sHTML &= '<OBJECT id=hhctrl type="application/x-oleobject" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11" width=58 height=57>'
    $sHTML &= '<PARAM name="Command" value="ShortCut">'
    $sHTML &= '<PARAM name="Button" value="Text:Open Custom Script">'
    $sHTML &= '<PARAM name="Item1" value=",Examples\HelpFile\Examples\' & $s_FuncName & '_Custom.au3,">'
    $sHTML &= '</OBJECT>'
    With $oButton2
        .innerHTML = $sHTML
    EndWith
    ; Insert the button as the next child of the codebox
    If Not IsObj($oParent) Then Return 0
    $oParent.appendChild ($oButton2)
    
    Return 1
EndFunc   ;==>_CreateExample

Func _CreateComment($s_FuncName)
    ; Create a new element to hold the codebox
    $oComment = $oIE.document.createElement ("")
    
    ; Gather previous comments if they exist
    $sCommentFile = $sCommentPath & $s_FuncName & ".txt"
    $sFuncComment = FileRead($sCommentFile)
    If @error Then $sFuncComment = ""
    
    ; Build the HTML for the commentbox
    If Not IsObj($oComment) Then Return 0
    $sHTML = ''
    $sHTML &= '<p><b>Comment</b></p>'
    $sHTML &= '<p class="codebox">'
    $sHTML &= '<br>'
    $sHTML &= $sFuncComment
    $sHTML &= '<br><br>'
    $sHTML &= '<OBJECT id=hhctrl type="application/x-oleobject" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11" width=58 height=57>'
    $sHTML &= '<PARAM name="Command" value="ShortCut">'
    $sHTML &= '<PARAM name="Button" value="Text:Add Comment">'
    $sHTML &= '<PARAM name="Item1" value=",Examples\HelpFile\Comments\' & $s_FuncName & '.txt,">'
    $sHTML &= '</OBJECT>'
    With $oComment
        .innerHTML = $sHTML
    EndWith
    
    ; Insert the commentbox after the codebox
    If Not IsObj($oParent) Then Return 0
    $oParent.insertAdjacentElement ("afterEnd", $oComment)
    
    Return 1
EndFunc   ;==>_CreateComment

Func Annotate(ByRef $o_object, $s_text)
    Local $sHTML = ""
    $sHTML &= "<table width=100% bgcolor=yellow>"
    $sHTML &= "<tr bgcolor=blue>"
    $sHTML &= "<td><font size=+1 color=white>Custom Annotation</font></td>"
    $sHTML &= "</tr>"
    $sHTML &= "<tr>"
    $sHTML &= "<td>" & $s_text & "</td>"
    $sHTML &= "</tr>"
    $sHTML &= "</table><br>"
    $o_object.insertAdjacentHTML ("AfterEnd", $sHTML)
    Return 1
EndFunc   ;==>Annotate

Func _Exit()
    Exit
EndFunc   ;==>_Exit

Edit: Fixed having to manually start the help file.

Edited by big_daddy
Link to comment
Share on other sites

To be honest, I got sidetracked by other stuff, and hadn't looked into this for a while. This is wonderful work, but I'm getting errors when I run it. I was looking to see if someone had done something like this already with a custom helpfile reader. I didn't have much luck, but what I did notice was Val had a web page open in an AutoIt window. I thought about how hard it would be to have a helpfile viewer that did what we wanted. The errors I got when I tested it:

>C:\Program Files\AutoIt3\SciTE\CompileAU3\CompileAU3.exe /beta /AU3Check /in "C:\Documents and Settings\user\Desktop\New Folder\helpfileExtra.au3"
>Running AU3Check C:\Program Files\AutoIt3\SciTE\Defs\Unstable\Au3Check\au3check.dat

C:\Documents and Settings\user\Desktop\New Folder\helpfileExtra.au3(59,66) : ERROR: _IETagNameGetCollection() called with wrong number of args.

Local $oSection = _IETagNameGetCollection ($o_object, "h1", 0)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\IE.au3(1187,52) : REF: definition of _IETagNameGetCollection().

Func _IETagNameGetCollection($o_object, $s_TagName)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Documents and Settings\user\Desktop\New Folder\helpfileExtra.au3(69,59) : ERROR: _IETagNameGetCollection() called with wrong number of args.

$oButton1 = _IETagNameGetCollection ($oIE, "OBJECT", 0)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Program Files\AutoIt3\Include\IE.au3(1187,52) : REF: definition of _IETagNameGetCollection().

Func _IETagNameGetCollection($o_object, $s_TagName)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Documents and Settings\user\Desktop\New Folder\helpfileExtra.au3(33,26) : ERROR: _IEErrorHandlerRegister(): undefined function.

_IEErrorHandlerRegister ()

~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Documents and Settings\user\Desktop\New Folder\helpfileExtra.au3(49,40) : ERROR: __IEIsObjType(): undefined function.

While __IEIsObjType ($oIE, "browserdom")

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Documents and Settings\user\Desktop\New Folder\helpfileExtra.au3 - 4 error(s), 0 warning(s)

>AU3Check Ended with Error(s).

>Exit code: 0 Time: 0.839

 

Edited by Jon
Code formatting
Link to comment
Share on other sites

  • Moderators

To be honest, I got sidetracked by other stuff, and hadn't looked into this for a while. This is wonderful work, but I'm getting errors when I run it. I was looking to see if someone had done something like this already with a custom helpfile reader. I didn't have much luck, but what I did notice was Val had a web page open in an AutoIt window. I thought about how hard it would be to have a helpfile viewer that did what we wanted. The errors I got when I tested it:

Like the requirements say, you need the latest version of IE.au3.
Link to comment
Share on other sites

Something I would like thats similar is user comments added to the online language refrence.

The PHP language reference has an online verison that lets anyone add their comments post example of weird code behaviour, work arrounds for bugs.. whatever.

A lot of time if I was having a particular problem with some PHP syntax, someone else would have already explained what is going wrong and how to fix it in one of the comments.

Link to comment
Share on other sites

  • Moderators

14.4? My god, I can walk to the developer of the site/product and put his information on CD and walk back home faster :D

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • Moderators

@Bigdaddy: I'm running the latest beta, and I downloaded IE.au3 from your link Not sure why it is bombing on my rig. I'm on 14.4 right now, but I should be able to test on a different rig when I get home. I think this laptop is nutty..

That should be all you need. However by the errors you posted before I'm possitive its somehow using an older version of IE.au3.
Link to comment
Share on other sites

@Bigdaddy: I'm running the latest beta, and I downloaded IE.au3 from your link Not sure why it is bombing on my rig. I'm on 14.4 right now, but I should be able to test on a different rig when I get home. I think this laptop is nutty..

Try the _IEVersionInfo() function... if running in SciTe it will display a console message with the version information. If running outside SciTe, use the array it returns to get the version info.

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

Create an account or sign in to comment

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

Create an account

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

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

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