Style from Delphi Seattle-10

Please post all questions and comments regarding Help & Manual 7 here.

Moderators: Alexander Halser, Tim Green

Style from Delphi Seattle-10

Unread postby robinski » Sat Jul 23, 2016 6:57 pm

Hello.

I've just upgraded to H&M 7.1. basic, and am rewriting the local help for a Delphi app. I've started to put a "wire frame" together with context sensitive calls from the Delphi app. So far so good... and I thought it was pretty cool that the "style" in my app carried into the CHM file. However, it was too good to be true. The table of contents text disappears and the toolbar icons get clipped. Is there something I can turn off to ignore the Delphi styles?

If I launch the help on it's own ... all is OK. Any assistance greatly appreciated.

image0007.jpg
You do not have the required permissions to view the files attached to this post. This may mean that you can't view them at all, or it may just mean that you need to log into the forum to view them.
robinski
 
Posts: 14
Joined: Fri Jul 22, 2016 7:21 pm
Location: Whistler, BC Canada

Re: Style from Delphi Seattle-10

Unread postby Tim Green » Mon Jul 25, 2016 9:07 am

Hi Rob,

I'm not sure how you've achieved what you show in your screenshot but it is supposed to be physically impossible -- so congratulations on being the first to reach the peak of Everest. 8) Nothing outside the topic pane can be styled at all, because those are all components of the Microsoft HTML Help viewer, which is a non-configurable Windows component that hasn't been updated since it was introduced with Windows 98. So even though it's amazing that you appear to have managed this, it's also very likely that whatever you have done will cause all kinds of errors.

If I launch the help on it's own ... all is OK. Any assistance greatly appreciated.

Then it has to do with something in your calls from your app. What version of Delphi are you using? Delphi has included native support for HTML Help CHM files ever since D2005, so you just need to consult the Delphi documentation for information on making calls to your CHM files.

You can still download the old EHS components for interfacing with CHM from our Delphi page if you want, but this is really only needed for very old versions of Delphi without native CHM support:

http://www.helpandmanual.com/downloads_delphi.html

If you want a fully styled help with more features and support for context help you can try the new EWriter format in Help+Manual 7. This combines the benefits of both CHM and WebHelp and eliminates most of the disadvantages. The restriction is that you can only make calls to topics and anchors in topics from your application. You don't get the additional API features of CHM, but you do get a fully skinnable interface and full support for JavaScript and CSS because you are using the current IE 11 WebView instead of the crippled IE7/8 version that the CHM viewer works with. See here for more details:

http://www.helpandmanual.com/help/index ... writer.htm
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
User avatar
Tim Green
Site Admin
 
Posts: 19068
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany

Re: Style from Delphi Seattle-10

Unread postby robinski » Mon Jul 25, 2016 4:47 pm

Hi Tim.

I've been credited with doing a few programming things that were "impossible"... but this one was totally unintentional. I simply included the "Vcl.HTMLHelpViewer" into the main form; assigned a "Help Context" property value matching the H&M value; pressed the F1 key and... well you saw the evidence.

The version is "Delphi 10 - Seattle". There is a newer one, "Delphi 10 - Berlin"... but it seems new version come out faster than I can handle. I'll post this information on the Delphi forum and see what reaction I get there.

I didn't really think about the age of the CHM format. Just been used to working with this from Delphi 7 days. I'll read up on the other formats available in H&M. I do need a context sensitive help structure, and have no objection to changing formats if I've got that box checked.

Cheers,
R
robinski
 
Posts: 14
Joined: Fri Jul 22, 2016 7:21 pm
Location: Whistler, BC Canada

Re: Style from Delphi Seattle-10

Unread postby robinski » Mon Jul 25, 2016 7:50 pm

OK Tim.

I'm sold on the eBook format. I guessing I have to have the app forms trap the F1 key and shell to the EXE help file generated. Correct? The only thing I'm a bit baffled on is how I locate the parameters passed to the help file:

my_ebook.exe "index.html"
my_ebook.exe "this_page.html#anchor"
my_ebook.exe "subfolder/anotherpage.html"


I can't seem to find the HTML references in the authoring pages.
robinski
 
Posts: 14
Joined: Fri Jul 22, 2016 7:21 pm
Location: Whistler, BC Canada

Re: Style from Delphi Seattle-10

Unread postby Martin Wynne » Mon Jul 25, 2016 9:32 pm

robinski wrote:I can't seem to find the HTML references in the authoring pages.

Hi Robin,

See: http://help.ec-software.com/index.html? ... writer.htm

EWriter is great. :) Here's a topic from me with some code for Delphi: https://helpman.it-authoring.com/viewto ... =1&t=14334

regards,

Martin.
User avatar
Martin Wynne
 
Posts: 2168
Joined: Mon May 12, 2003 3:21 pm
Location: West of the Severn, UK

Re: Style from Delphi Seattle-10

Unread postby robinski » Mon Jul 25, 2016 10:37 pm

Thanks Martin & Tim.

Each answer I'm getting has me doing back flips.

I'm super impressed with the separation of the eBook from the viewer. I just created an empty project (no TOC elements) and published it as an EXE file. I'll give some thought to the extension of the ebook, but followed the .ebk guideline and got the results expected. this will make distributing updated help much cleaner than trying to use the routine I wrote to download updated app executables.

Your sample code shows the content parameter to load on the shellexecute(). Where do I find reference those elements in the H&M authouring setup?

Also ... I will give H&M the recognition it deserves in the help file with a link to their web site, but I need to replace the H&M icon in the header with mine and refer to our web site. How can I do this?

Cheers,
R
robinski
 
Posts: 14
Joined: Fri Jul 22, 2016 7:21 pm
Location: Whistler, BC Canada

Re: Style from Delphi Seattle-10

Unread postby Martin Wynne » Mon Jul 25, 2016 11:28 pm

robinski wrote:Where do I find reference those elements in the H&M authouring setup?

I'm not sure what you are asking? To open a specific page, use this as the calling parameter:

Code: Select all
path/my_data_package.ebk "index.html?topic_id.htm"

where topic_id in the URL is the, er, Topic ID, for the H&M topic to be opened. :) You can find and edit it by clicking the Topic Options tab to the left of the editor. With some changes -- I always lower case the entire topic ID and change all spaces to underscores, so that I always know the page URL. There is some disagreement about this, I'm not too sure what HM7 does by default nowadays -- I've been asking for automatic lower-casing for years. Tim can provide the official chapter and verse. There is an option in the HTML Export Options for what to do with spaces, underscores and hyphens in Topic IDs.

Alternatively, if you have been using CHM, you can use the context number instead of the page URL. It's all in the Help.

I need to replace the H&M icon in the header with mine and refer to our web site. How can I do this?

Which skin are you using? Do you have the Premium Pack add-on?

regards,

Martin.
User avatar
Martin Wynne
 
Posts: 2168
Joined: Mon May 12, 2003 3:21 pm
Location: West of the Severn, UK

Re: Style from Delphi Seattle-10

Unread postby robinski » Mon Jul 25, 2016 11:52 pm

Thanks Martin.

I think you've explained it to me ... I'm hoping I'll be able to use the "Help Context" ID... as that makes the shellexecute() parameter definition a lot easier in the app. Yes: RTFM --- just gotta dig deeper.

I just chose one of the "default" skins (WebHelp, iFrames Responsive, Blue.hmskin) that I thought would look good. I didn't purchase the Premium Pack add-on.

Cheers,
R
robinski
 
Posts: 14
Joined: Fri Jul 22, 2016 7:21 pm
Location: Whistler, BC Canada

Re: Style from Delphi Seattle-10

Unread postby Martin Wynne » Tue Jul 26, 2016 12:12 am

robinski wrote:I'm hoping I'll be able to use the "Help Context" ID... as that makes the shellexecute() parameter definition a lot easier in the app.

If you say so. :) I find human-readable page URLs a lot less prone to error. But H&M can export a Context ID map file.

Here are Tim's notes for using the context numbers in EWriter:
_____________

Code: Select all
my_viewer.exe "<path>\mybook.ebk" 20600

//or

my_viewer.exe "<path>\mybook.ebk" "index.html?contextid=20600"

Important: When using only the context number as the parameter you must do this without quotes.
_____________

From this help page: http://help.ec-software.com/index.html? ... ctions.htm

I just chose one of the "default" skins (WebHelp, iFrames Responsive, Blue.hmskin) that I thought would look good.

Those skins are edited directly in H&M. I will load that one up and find the header settings in the templates for you.

regards,

Martin.
User avatar
Martin Wynne
 
Posts: 2168
Joined: Mon May 12, 2003 3:21 pm
Location: West of the Severn, UK

Re: Style from Delphi Seattle-10

Unread postby robinski » Tue Jul 26, 2016 12:27 am

Thanks Martin.

I tried one of the premium templates, and see it's got a different layout. I might have to look at buying the set.

I've got a pretty good context ID map from the previous setup ... so it's no big deal for me to implement the setup. If the templates are "editable" ... that would be great! I could alter it to suite my needs.

Cheers,
R
robinski
 
Posts: 14
Joined: Fri Jul 22, 2016 7:21 pm
Location: Whistler, BC Canada

Re: Style from Delphi Seattle-10

Unread postby Martin Wynne » Tue Jul 26, 2016 12:28 am

So your Delphi code would be:

Code: Select all
viewer_str:='path\my_viewer.exe';
content_str:='"path\mybook.ebk" 20600';   // note the space in front of 20600

// or content_str:='"path\mybook.ebk" "index.html?contextid=20600"'; // note the space

if ShellExecute(0,'open',PChar(viewer_str),PChar(content_str),nil,SW_SHOWNORMAL)<=32
  then ShowMessage('Sorry, unable to start the Help viewer.');

Martin.
User avatar
Martin Wynne
 
Posts: 2168
Joined: Mon May 12, 2003 3:21 pm
Location: West of the Severn, UK

Re: Style from Delphi Seattle-10

Unread postby Martin Wynne » Tue Jul 26, 2016 12:31 am

robinski wrote:If the templates are "editable" ... that would be great! I could alter it to suite my needs.

Everything in H&M is editable. :)

Martin.
User avatar
Martin Wynne
 
Posts: 2168
Joined: Mon May 12, 2003 3:21 pm
Location: West of the Severn, UK

Re: Style from Delphi Seattle-10

Unread postby Martin Wynne » Tue Jul 26, 2016 1:01 am

Here you go. Copy the .hmskin file to somewhere on your computer where you can edit it. Open it in H&M and go to the Text Variables:

hm_skin_edit.png

Double-click on the values to edit them.

If you create your own logo image you need to add the image file to the Baggage Files, so that it gets included in the output:

hm_skin_baggage.png

Save the edited skin (preferably with a modified name). Open your project and change the skin setting to use the edited file.

Martin.
You do not have the required permissions to view the files attached to this post. This may mean that you can't view them at all, or it may just mean that you need to log into the forum to view them.
User avatar
Martin Wynne
 
Posts: 2168
Joined: Mon May 12, 2003 3:21 pm
Location: West of the Severn, UK

Re: Style from Delphi Seattle-10

Unread postby robinski » Tue Jul 26, 2016 5:16 am

Brilliant.

I've just got to make sure my png logo is size appropriate.
robinski
 
Posts: 14
Joined: Fri Jul 22, 2016 7:21 pm
Location: Whistler, BC Canada

Re: Style from Delphi Seattle-10

Unread postby Tim Green » Tue Jul 26, 2016 8:33 am

Hi Martin and Rob,

Great stuff! Just as an appetizer: In the upcoming 3.2 I'm adding a user URL parameters object to the EWriter skins. This will enable you to pass parameters to your help via the URL, which you will then have in a userParams object that will include a userParams.userParamsCount integer property so you know how many you have. Since the arguments are read in the Layout template you need to be able to pass them to the topic pages in the topic iFrame. You do this by saving your values in cookies, which are effectively session variables in EWriter (they never live beyond the current session), using the integrated cookie functions that are already in the skin scripts.

But there's more: You can use this to build dynamic topics on the basis of invisible content snippets that you can store in the book. You do this by creating topic files without TOC entries in the Topic Files section with an underscore in front of their ID, which keeps them out of the search. You then choose them on the basis if your URL parameters and load them into placeholder DIVs on the topic page using the simple jQuery .load() method, which is also directly available.

You could also hide and display content in the topic displayed on the basis of URL parameters. Since the variables are in session cookies this would also continue to work during the rest of the browsing session, as the cookie values continue to be available and would be read when every topic is loaded. :mrgreen:
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
User avatar
Tim Green
Site Admin
 
Posts: 19068
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany

Next

Return to Help & Manual 7 Forum

Who is online

Users browsing this forum: No registered users and 1 guest

cron