Author Topic: Help Plugin  (Read 15442 times)

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1442
    • CenizaSOFT
Help Plugin
« on: July 23, 2005, 06:07:38 am »
I would like to inform you I just committed today's work in the help plugin to CVS.

It's still Windows only (HLP and CHM help files) but the idea is to make it crossplatform any time soon.

I'm also getting used to the old code and making some changes here and there.

There have been some bugfixes and now you can sort your helpfiles in the order you want.

When a help file is called without a keyword it'll be launched with the associated application.

The hashmap used in the previous revision was changed to a vector. This can slightly decrease performance for some tasks and increase it for others, but now the help files can be sorted as you like. You shouldn't notice any performance impact because of it.

Any comments are welcomed.

Oh, yeah, why not? A screenshot :)



[edit]
Ok, even better, I just uploaded another CVS binary snapshot with the new help_plugin so you can test it.

This release is 30% bigger but was compiled with optimizations and no debugging (previous releases were compiled with debugging and stripped later). I hope the compiler had really made a good job on it.
[/edit]

Offline darklordsatan

  • Almost regular
  • **
  • Posts: 132
    • http://eviltrend.sf.net
Help Plugin
« Reply #1 on: July 23, 2005, 03:39:36 pm »
Looking good son.

Crossplatform? I think that is implicit. I'd try it myself on Linux, but my slackware box isnt available ATM, and Im not able to connect to the cvs to check out how you're doing it (or is it in the "Every now and then Code::Blocks CVS binary snapshots"?)

Quote from: Writing online help for wxWidgets applications Tutorial

Deciding on a help format
With so many different help formats available, you may be wondering which is best for you. The following clarifies some of the pros and cons, and you can also look at the 'help' sample in the wxWidgets distribution which demonstrates a variety of formats and help controllers.

Unix

If you want all the power of HTML for your help files, then you may consider using plain HTML files on Unix (invoked by wxExtHelpController). However, the formatting of most help files doesn't need to be very complex and so a better approach would be to use the internal wxHTML help system and wxHtmlHelpController. You may have problems using this system under Motif in 256 colour mode, related to the XPM icons used in the viewer, so you could try the simpler wxHelpControllerHtml instead which is still powered by wxHTML.

Accessing help from an application
Sometimes one can rely on wxHelpController being aliased to the standard help system for that platform (wxHTML help for Unix, WinHelp for Windows). To use a different help controller than the standard one, you have to include the file for that controller and create an object using the relevant class name (e.g. 'wxCHMHelpController') rather than simply using 'wxHelpController'. Please see the wxHelpController documentation in the wxWidgets manual for details.

To create and initialize a help controller:
Code: [Select]

  helpController = new wxCHMHelpController;
  helpController->Initialize("myfile");

To access the contents, use code like the following:
Code: [Select]

  helpController->LoadFile("myapp");
  helpController->DisplayContents();

To access a particular section, use code like the following:
Code: [Select]

  helpController->LoadFile("myapp");
  helpController->DisplaySection("Diagram cards");

DisplaySection has different meanings for different help controllers, but for most controllers it does a keyword search. It can also be used to display a particular HTML file within the help file, for example in MS HTML Help.

To clean up as the application is ending:
Code: [Select]

  helpController->Quit();
  delete helpController;


Offline Bourricot

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: Help Plugin
« Reply #2 on: July 26, 2005, 04:07:08 pm »
Nice work  :D.


Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1442
    • CenizaSOFT
Re: Help Plugin
« Reply #3 on: July 27, 2005, 10:26:56 am »
Ok, I'm trying to commit the newest help_plugin but CVS is having problems or something. I'll keep trying anyway.

I'll also make another CVS binary snapshot including the latest help_plugin and the changes to get Find working when you open a single file (those are in the "Suggestions before next release" thread).

Now you can use anything you want as help file: HTML, PDF, TXT, ... Anything!, as far as it be associated with some program. There's where the crossplatform help plugin begins.

As usual, more bugfixes, and as usual, again, they're all related to m_LastSel when ListChange is called.

Well, I'll have to try to commit it later, CVS is refusing to work.

Now, time to release the snapshot!

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: Help Plugin
« Reply #4 on: July 28, 2005, 04:05:14 pm »
the help-plugin looks nice, but it doesn't work here by me.

the .hlp and .chm file which i've set up are existing on my harddrive and the path is correct,
but somehow does the start command not work.

my system:
WinXP SP2
wxWidgets 2.6.1
CodeBlocks 1.0 cvs - HEAD

screenshots:

configure plugin


launching the help-file


error message(s) after closing CodeBlocks



any hints, what's wrong ?

Offline darklordsatan

  • Almost regular
  • **
  • Posts: 132
    • http://eviltrend.sf.net
Re: Help Plugin
« Reply #5 on: July 28, 2005, 05:42:28 pm »
From what I see, basically it would mean you have no associations to launch .hlp neither .chm (although its weird).
Ceniza, could you show the code you use to call the respective associated app?

Offline zieQ

  • Almost regular
  • **
  • Posts: 155
Re: Help Plugin
« Reply #6 on: July 28, 2005, 06:16:55 pm »
Humm, seems the command issued is "start filename.chm". This does not work in my command prompt neither.
"start" should be replace by "cmd /c" I think.

To confirm this assertion, tiwag, could you type the "d:\...\wx.chm" command on a command prompt and see what happens ?

Offline darklordsatan

  • Almost regular
  • **
  • Posts: 132
    • http://eviltrend.sf.net
Re: Help Plugin
« Reply #7 on: July 28, 2005, 06:25:07 pm »
Humm, seems the command issued is "start filename.chm". This does not work in my command prompt neither.
"start" should be replace by "cmd /c" I think.

To confirm this assertion, tiwag, could you type the "d:\...\wx.chm" command on a command prompt and see what happens ?
what is the code made to execute the "start filename.chm"?

BTW, "start" does work on my system. What OS are you using?
« Last Edit: July 28, 2005, 06:28:27 pm by darklordsatan »

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1442
    • CenizaSOFT
Re: Help Plugin
« Reply #8 on: July 28, 2005, 06:46:08 pm »
Hmmm, I used start because it worked on both my XP box and a 98 one too, but it was changed in the latest version that I got to commit about 10 hours ago for a nicer method, so the bug I introduced is already fixed.

I recommend you to try with the latest CVS version or the latest binary snapshot in my site. It should work now :)

Offline zieQ

  • Almost regular
  • **
  • Posts: 155
Re: Help Plugin
« Reply #9 on: July 28, 2005, 06:52:40 pm »
what is the code made to execute the "start filename.chm"?

BTW, "start" does work on my system. What OS are you using?

Win2K, "start" open a new command shell but do not launch the browser associated to filename.chm

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Help Plugin
« Reply #10 on: July 28, 2005, 07:26:34 pm »
Does "cmd" work in win98?

Offline darklordsatan

  • Almost regular
  • **
  • Posts: 132
    • http://eviltrend.sf.net
Re: Help Plugin
« Reply #11 on: July 28, 2005, 07:35:02 pm »
Does "cmd" work in win98?

IIRC, nope. On win98 it was "command"

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1442
    • CenizaSOFT
Re: Help Plugin
« Reply #12 on: July 28, 2005, 08:27:33 pm »
I said it was fixed already :)

And no, cmd won't work in Windows 98.

I just checked and found why start worked in my XP box: I have it in my PATH from an old Windows 98 installation. But anyway, and again, IT'S FIXED ALREADY :wink:

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: Help Plugin
« Reply #13 on: July 29, 2005, 04:22:53 am »
@Ceniza,
thanks, i'll try the newest cvs soon

[edit]
works nice now with the latest cvs version -
thanks
[/edit]
« Last Edit: July 29, 2005, 09:40:28 am by tiwag »

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1442
    • CenizaSOFT
Re: Help Plugin
« Reply #14 on: July 29, 2005, 10:43:16 am »
Quote from: tiwag
works nice now with the latest cvs version -
thanks

Glad to read it :)

I hope the plugin be stable and usable enough 'cause I'll be back in college next week and won't have as much free time as I had in vacations (I wonder why :P)

I hope Code::Blocks compile without troubles under Linux so I can start working in the crossplatform code (have you noticed how crossplatform is commonly considered just both Windows and Linux?).