TBC Macros and Extensions

 View Only
Expand all | Collapse all

what program do you use to create help files (.CHM)?

  • 1.  what program do you use to create help files (.CHM)?

    Posted 10-24-2021 23:37
    .CHM seems to be a rather old/outdated format and the downloads for Microsofts HTML Help Workshop seem to be broken and refer in circles.

    Any tip on a lightweight/freeware program to create decent looking help files for my macros.

    ------------------------------
    Ronny Schneider
    ------------------------------


  • 2.  RE: what program do you use to create help files (.CHM)?

    Posted 10-25-2021 00:05
    Hi Ronny,

    indeed .chm is pretty old and I would rather recommend to create .html instead.

    I've used in the past Frontpage or NVU but in the meantime I rather ditectly use the code itself in Visual Studio or even Notepad ++.

    I don't create too complicated help pages for my macros, so it's enough working direct on the html code.

    Here you are an example: Bautools-Makros für Trimble Business Center

    Do you know how to directly open a bookmark of your html when tapping F1 with your macro open? If not let me know and I'll post it later when I get to the office


    If you want, you can take it as base to build your own one.

    Regards,
    Fernando

    ------------------------------
    Fernando Calvo
    calvo@calvo-geospatial.com
    ------------------------------



  • 3.  RE: what program do you use to create help files (.CHM)?

    Posted 10-25-2021 16:56

    As Fernando posted, I would recommend creating HTML file/s alongside your TML files.

    In your TML's Setup() method, you can specify the path to your help file in CmdData.HelpFile="your file path here"

    If it starts with "https:" it will launch the default browser.

    I think support for a local HTML was added too - perhaps that's what Fernando was mentioning.  I haven't played with that specifically - so don't know if just a relative path to an HTML file, or whether it uses the "file://" prefix to specify an exact path (not relative).

    Using HTML has the advantage that if you later need to post your help online (like posting in the forums for example), hopefully you can copy/paste portions of it out.


    I had expected for TMLs to just link to forum posts or online webpages - but it's true there are disadvantages: no offline access, access uses bandwidth, the single Help page may conflict w/ the version installed, etc.



    ------------------------------
    Quan Mueller
    Revenant Solutions - TML Development
    ------------------------------



  • 4.  RE: what program do you use to create help files (.CHM)?

    Posted 10-25-2021 23:08
    Thanks guys.
    In the meanwhile I think the easiest way to create a simple HTML page the WYSIWYG way is to use MS Word.

    In worst case I can still compile them with the MS HTML Help Workshop to .CHM. I found a link in an archive in a forum.

    But a single HTML page in each macro folder would be better. But setting cmdData.HelpFile with https:// seems to require an actual webserver, can't point to a local file.
    Using "file://" doesn't open the HTML or i.e. a PDF.


    ------------------------------
    Ronny Schneider
    ------------------------------



  • 5.  RE: what program do you use to create help files (.CHM)?

    Posted 10-26-2021 02:27
    Hi,

    another option is to add a "?" help button to your form and open it from there i.e. with the following code which works both for .html´s and .pdf´s:

    webbrowser.open('file://' + os.path.realpath(self.macroFileFolder + "\\report.html"))
    webbrowser.open('file://' + os.path.realpath(self.macroFileFolder + "\\Test.pdf"))

    I think I`ll add both options to my macros as some customers don´t have internet access the whole time.

    Regards,
    Fernando

    ------------------------------
    Fernando Calvo
    calvo@calvo-geospatial.com
    ------------------------------



  • 6.  RE: what program do you use to create help files (.CHM)?

    Posted 10-27-2021 00:16
    Thanks Fernando,

    just to add for other, you have to add to your imports
    import webbrowser​

    you'll have to define self.macroFileFolder in def __init__
    class SCR_ABReportElevationDifference(StackPanel): # this inherits from the WPF StackPanel control
        def __init__(self, currentProject, macroFileFolder):
            with StreamReader (macroFileFolder + r"\SCR_ABReportElevationDifference.xaml") as s:
                wpf.LoadComponent (self, s)
            self.currentProject = currentProject
            self.macroFileFolder = macroFileFolder​

    and in "def Onload" I added
    buttons[2].Content = "Help"
    buttons[2].Visibility = Visibility.Visible
    buttons[2].Click += self.HelpClicked

    the button-click is then handled as follows
        def HelpClicked(self, cmd, e):
            webbrowser.open('file://' + os.path.realpath(self.macroFileFolder + "\\" + type(self).__name__+".htm"))

    That way I can just copy and paste it to all macros and name the help HTML file the same as the macro.
    type(self).__name__
    
    retrives the macro name from the class definition
    
    class SCR_ABReportElevationDifference(StackPanel): # this inherits from the WPF StackPanel control

    Keeps it uniform. I've got all my macros grouped in subfolders, which correspond to the menu tabs and groups on the tab.



    ------------------------------
    Ronny Schneider
    ------------------------------



  • 7.  RE: what program do you use to create help files (.CHM)?

    Posted 10-28-2021 08:46
    Instead of forcing the web browser, another (better ?) option is to let "windows" decide how to display / open the file (doc, html, pdf, url, csv, etc).

    from System.Diagnostics import Process, ProcessStartInfo
    Process.Start( ProcessStartInfo( filename ) )

    Peter

    ------------------------------
    Peter Kistler
    ------------------------------



  • 8.  RE: what program do you use to create help files (.CHM)?

    Posted 10-28-2021 23:51
    Thanks Peter,
    I'll give that one a try on the weekend.

    ------------------------------
    Ronny Schneider
    ------------------------------