[perl-win32-gui-users] Using HTML help within A Win32-GUI app

2006-02-17 Thread Jeremy White

Hi,

Would it be of use for anyone to know how to integrate an Win32-GUI app with 
a MS HTML help system? If so, I could create a set of steps on how this is 
done.


Cheers,

jez.





[perl-win32-gui-users] HTML help - an example

2006-02-17 Thread Jeremy White

All,

The below is a "rough and ready" guide to building a MS HTML help system for 
your application. It will show you how to generate the .chm file, and how to 
link to it from your GUI application. I've included a zip folder containing 
all the example files you'll need.


The MS HTML system is based on a single .chm file, it's kind of like a zip 
folder with all the HTML contained within it. To create the .chm file you 
have to download free tools from Microsoft:


http://msdn.microsoft.com/library/default.asp?url=/library/en-us/htmlhelp/html/hwMicrosoftHTMLHelpDownloads.asp

You need HtmlHelp.exe, download and install. The key file is hhc.exe which 
'compiles' your html files into a .chm file. Copy hhc.exe and place it in 
the same folder as the files in the attached zip. There is plenty of 
documentation on the MS site to explain the actual details, but:


To build the .chm, hhc.exe needs to have 4 files as well as your HTML 
documentation:


.hhp file which contains the options and all the HTML files to be included 
in your help file (any images will be included automatically)
.hhc file which contains the table of contents for your help system (the 
tree on the left of the help system) the TOC is itself HTML.
.h file which contains numeric constants to identify topics (these constants 
are used within your GUI)

.ali file which maps the numeric constants to actual HTML pages.

Typically you'll generate these files automatically from your documentation. 
Once you've got these files, you now build your .chm file:


cd to the dir with the example zipped files then:

hhc.exe help.hhp

Now run gui.pl in the same folder, it'll bring up a window with a few 
buttons. When you click on the button, the html help system automatically 
opens and goes to the correct topic. You can create as many topics as you 
like - it's quite flexible. When you distribute your app, you just need the 
.chm file.


Cheers,

jez.





[perl-win32-gui-users] HTML help - an example (the files)

2006-02-17 Thread Jeremy White

Hotmail isn't allowing zip files...

All files attached.



TableofContents.hhc
Description: Binary data
Page 4Some help here
Page 3Some help here
Page 2Some help here
Page 1Some help here

IDH_Page1=Page1.html
IDH_Page2=Page2.html
IDH_Page3=Page3.html
IDH_Page4=Page4.html



Help.hhp
Description: Binary data

#define IDH_Page1  1003
#define IDH_Page2  1004
#define IDH_Page3  1005
#define IDH_Page4  1006


gui.pl
Description: Binary data


Re: [perl-win32-gui-users] Using HTML help within A Win32-GUI app

2006-02-17 Thread Octavian Rasnita
Are you asking? Of course it would be great to let us know.
Thank you very very much!

Teddy

- Original Message - 
From: "Jeremy White" <[EMAIL PROTECTED]>
To: 
Sent: Friday, February 17, 2006 6:25 PM
Subject: [perl-win32-gui-users] Using HTML help within A Win32-GUI app


> Hi,
>
> Would it be of use for anyone to know how to integrate an Win32-GUI app
with
> a MS HTML help system? If so, I could create a set of steps on how this is
> done.
>
> Cheers,
>
> jez.
>
>
>
>
> ---
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log
files
> for problems?  Stop!  Download the new AJAX search engine that makes
> searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
> ___
> Perl-Win32-GUI-Users mailing list
> Perl-Win32-GUI-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users
> http://perl-win32-gui.sourceforge.net/
>
>
> -- 
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.375 / Virus Database: 267.15.10/263 - Release Date: 2/16/2006
>
>




RE: [perl-win32-gui-users] Using HTML help within A Win32-GUI app

2006-02-17 Thread Glenn Munroe
Jez,

I've toyed with this, so I'd find it useful. Bring 'em on!

Glenn

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Jeremy White
Sent: Friday, 17 February, 2006 17:25
To: perl-win32-gui-users@lists.sourceforge.net
Subject: [perl-win32-gui-users] Using HTML help within A Win32-GUI app

Hi,

Would it be of use for anyone to know how to integrate an Win32-GUI app
with a MS HTML help system? If so, I could create a set of steps on how
this is done.

Cheers,

jez.




---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log
files for problems?  Stop!  Download the new AJAX search engine that
makes searching your log files as easy as surfing the  web.  DOWNLOAD
SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
___
Perl-Win32-GUI-Users mailing list
Perl-Win32-GUI-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users
http://perl-win32-gui.sourceforge.net/



[perl-win32-gui-users] Re: HTML help - an example with context help

2006-02-17 Thread Robert May

Jez,

Very nice.  Here's a modification to your gui.pl that

(1) fixes needing to run the the script with the current working 
directory the same as the location of the chm file - in this example the 
perl script needs to be in the same directory as the chm file.


(2) Adds context help: click the '?' icon in the title bar, then one of 
the buttons, or tab to one of the buttons (to give it focus) and hit 'F1'


[crashes on exit with Win32::GUI v1.03, but that is fixed in CVS.]

Regards,
Rob.

#!perl -w
use strict;
use warnings;

#use lib qw( C:/Development/Work/Win32-GUI/blib/arch
#C:/Development/Work/Win32-GUI/blib/lib );
use Win32::GUI;

use Win32::OLE ();
use Win32::OLE::Const ();
use File::Basename;

#Get the current working dir
my $helpfile = dirname($0) . "/Help.chm";

#Define the same contants that are used in the help system
sub IDH_Page1() {1003};
sub IDH_Page2() {1004};
sub IDH_Page3() {1005};
sub IDH_Page4() {1006};

sub WM_HELP() {83}

# Create the main window
my $mainwindow = Win32::GUI::DialogBox->new(
-name   => "Window",
-title  => "HTML help example",
-pos=> [100,100],
-size   => [400,400],
);
$mainwindow->UserData(IDH_Page1);

$mainwindow->AddButton (
-name   => 'Help',
-text   => 'Help',
-height => 20,
-width  => 60,
-top=> 2,
-left   => 60,
-tip=> 'Help page 1',
-tabstop => 1,
-onClick => sub {ShowHelp(IDH_Page1)},
)->UserData(IDH_Page3);

$mainwindow->AddButton (
-name   => 'Help2',
-text   => 'Help 2',
-height => 20,
-width  => 60,
-top=> 24,
-left   => 60,
-tip=> 'Help page 2',
-tabstop => 1,
-onClick => sub {ShowHelp(IDH_Page2)},
)->UserData(IDH_Page4);

$mainwindow->Hook(WM_HELP, \&contextHelp);
$mainwindow->Show();

#Enter the message processing loop
Win32::GUI::Dialog();
exit(0);

sub ShowHelp {
  #show the help for this ID
  my $id=shift;
  Win32::OLE::Const::_ShowHelpContext($helpfile,$id);
  return 1;
}

sub contextHelp
{
my ( $obj, $wparam, $lparam, $type, $msgcode ) = @_;
return unless $type == 0;
return unless $msgcode == WM_HELP;

# See MSDN HELPINFO structure
my ($cbSize, $iContextType, $ctrlId, $handle, $dwContextId, $x, $y)=
  unpack("IiiLLll", unpack("P28", pack("L",$lparam)));

return unless $cbSize == 28;
return unless $iContextType == 1;

my $win = Win32::GUI::GetWindowObject($handle);
return unless $win;

ShowHelp($win->UserData());

return 0;
}
__END__



Jeremy White wrote:

All,

The below is a "rough and ready" guide to building a MS HTML help system 
for your application. It will show you how to generate the .chm file, 
and how to link to it from your GUI application. I've included a zip 
folder containing all the example files you'll need.


The MS HTML system is based on a single .chm file, it's kind of like a 
zip folder with all the HTML contained within it. To create the .chm 
file you have to download free tools from Microsoft:


http://msdn.microsoft.com/library/default.asp?url=/library/en-us/htmlhelp/html/hwMicrosoftHTMLHelpDownloads.asp 



You need HtmlHelp.exe, download and install. The key file is hhc.exe 
which 'compiles' your html files into a .chm file. Copy hhc.exe and 
place it in the same folder as the files in the attached zip. There is 
plenty of documentation on the MS site to explain the actual details, but:


To build the .chm, hhc.exe needs to have 4 files as well as your HTML 
documentation:


.hhp file which contains the options and all the HTML files to be 
included in your help file (any images will be included automatically)
.hhc file which contains the table of contents for your help system (the 
tree on the left of the help system) the TOC is itself HTML.
.h file which contains numeric constants to identify topics (these 
constants are used within your GUI)

.ali file which maps the numeric constants to actual HTML pages.

Typically you'll generate these files automatically from your 
documentation. Once you've got these files, you now build your .chm file:


cd to the dir with the example zipped files then:

hhc.exe help.hhp

Now run gui.pl in the same folder, it'll bring up a window with a few 
buttons. When you click on the button, the html help system 
automatically opens and goes to the correct topic. You can create as 
many topics as you like - it's quite flexible. When you distribute your 
app, you just need the .chm file.


Cheers,

jez.




---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log 
files

for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
___
Perl-Win32-GUI-Users mailing list
Perl-Win32-GUI-Users@lists.sourceforge.ne