Button to close the chm

This forum is for all Flare issues related to the Microsoft HTML Help target.
This target produces "CHM" files in the output.
Post Reply
Sharpras
Sr. Propeller Head
Posts: 138
Joined: Fri May 05, 2006 10:17 am
Location: Redmond, WA

Button to close the chm

Post by Sharpras »

How do I create a button for the user to close (exit) the chm? I image it must be a shortcut control but I've not found any help for the parameters to be sent or the "standard windows message."
Windows XP, Flare 4.0, HTML help, need not work over a network.

Thanks,
Roger
Data I/O
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Button to close the chm

Post by LTinker68 »

If it's for HTML Help then it can't work over the network.

Are you saying you want to create a custom button that says something like "Close Help" and you want to know how to format the command?
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Pete Lees
Sr. Propeller Head
Posts: 150
Joined: Thu Feb 09, 2006 12:33 pm
Location: Bracknell, Berkshire, UK

Re: Button to close the chm

Post by Pete Lees »

Hi, Roger,

If you can make a topic file like the one below the target of your custom toolbar button, the help window will close when the user clicks the button.

Code: Select all

<html>
<body onload="JavaScript:Close.Click()">

   <object id="Close" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">
      <param name="Command" value="Close">
   </object>

</body> 
</html>
And see also this discussion in another forum for ways to make the help window close when the user presses the Esc key:

http://www.adobe.com/cfusion/webforums/ ... id=1339304

Pete
Sharpras
Sr. Propeller Head
Posts: 138
Joined: Fri May 05, 2006 10:17 am
Location: Redmond, WA

Re: Button to close the chm

Post by Sharpras »

Lisa, you got it. That's what I want.

Pete, I think what you are suggesting is a new topic that closes the help when that topic opens. I am putting the 'Close' button in a topic rather than in the button bar, but that shouldn't make a difference. I tried your suggestion (copying your code into the page via the internal editor) and when I attempt to save the new topic I get this error message: [XML: The 'param" start tag on line 9 does not lmatch the end tab of 'object'. Line 10, position 7.]
KevinDAmery
Propellus Maximus
Posts: 1985
Joined: Tue Jan 23, 2007 8:18 am
Location: Darn, I knew I was around here somewhere...

Re: Button to close the chm

Post by KevinDAmery »

Did you copy everything? Specifically, you would need to add the java script declaration in the Body tag plus the entire object tag group. The error you're quoting makes it sound like the opening object tag isn't there.
Until next time....
Image
Kevin Amery
Certified MAD for Flare
Pete Lees
Sr. Propeller Head
Posts: 150
Joined: Thu Feb 09, 2006 12:33 pm
Location: Bracknell, Berkshire, UK

Re: Button to close the chm

Post by Pete Lees »

Here's an alternative version, which adds a Close button to your topic content.

Code: Select all

<html>
<body>

<-- The rest of your topic content... -->

<object id="hhctrl" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">
   <param name="Command" value="Close">
   <param name="Button" value="Text:Close">
</object>

</body>
</html>
Like the earlier version, this uses the Close command of the HTML Help ActiveX control to close the window. I don't think that any other script or control can achieve the same result.

No idea why you were getting the error message, unless it's because the Flare editor assumes that the <param> tag requires an end-tag (which it doesn't). Still, it doesn't do any harm to close the parameter with a forward slash in the same tag (<param name="Command" value="Close"/>).

Pete
Last edited by Pete Lees on Tue Oct 14, 2008 10:02 am, edited 1 time in total.
doc_guy
Propellus Maximus
Posts: 1979
Joined: Tue Nov 28, 2006 11:18 am
Location: Crossroads of the West
Contact:

Re: Button to close the chm

Post by doc_guy »

XML won't validate unless EVERY opening tag has a closing tag. So, yes, the <param> will need a closing slash to be valid XML.

That is why in Flare, you never see a <br> element. You always see a <br /> element. Same applies to the <param> element.
Paul Pehrson
My Blog

Image
doc_guy
Propellus Maximus
Posts: 1979
Joined: Tue Nov 28, 2006 11:18 am
Location: Crossroads of the West
Contact:

Re: Button to close the chm

Post by doc_guy »

So, for the sake of clarity, use the following example:

Code: Select all

<html>
<body>

<-- The rest of your topic content... -->

<object id="hhctrl" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">
   <param name="Command" value="Close" />
   <param name="Button" value="Text:Close" />
</object>

</body>
</html>
and see if that works.
Paul Pehrson
My Blog

Image
Sharpras
Sr. Propeller Head
Posts: 138
Joined: Fri May 05, 2006 10:17 am
Location: Redmond, WA

Re: Button to close the chm

Post by Sharpras »

Yes. It works perfectly. That could otherwise have taken my days to figure out. I wish MadCap Flare's Help could point to resources like this.

Thanks, Pete and Paul.

Roger
doc_guy
Propellus Maximus
Posts: 1979
Joined: Tue Nov 28, 2006 11:18 am
Location: Crossroads of the West
Contact:

Re: Button to close the chm

Post by doc_guy »

Ah, but if the help system had the info, then we wouldn't have anything to do in the forums! :) Glad it worked.
Paul Pehrson
My Blog

Image
Richard Ferrell
Propellus Maximus
Posts: 840
Joined: Mon May 01, 2006 10:11 am
Location: Inside California

Re: Button to close the chm

Post by Richard Ferrell »

Thanks for the suggestion, Normally Custom Javascript and buttons would be out side the scope of support, as there are many different ways to do something like this, and it would be very difficult to support.

I will submit a feature request to our dev team for more support for custom buttons and scripts.
Richard Ferrell

Certified Madcap Trainer
Image
Sharpras
Sr. Propeller Head
Posts: 138
Joined: Fri May 05, 2006 10:17 am
Location: Redmond, WA

Re: Button to close the chm

Post by Sharpras »

Richard Ferrell wrote: I will submit a feature request to our dev team for more support for custom buttons and scripts.
That would be great-- at least for a few common features like close buttons, open a second chm, printing several or all pages in chm, or whatever folks request often.

Roger
Post Reply