THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 07/06/2008 at 00:50, xxxxxxxx wrote:
Okay. Well, there isn't much to do about specific context (at the gadget level) but it can work at the tab group level nicely. So, here is a complete non-modal dialog class to show HTML help. Create an instance of this class, Open() as needed, and then call SetUrl(string) to show the appropriate HTML help:
> ////////////////////////////////////////////////////////////////
> // HelpDialog.cpp
> ////////////////////////////////////////////////////////////////
> // interPoser Pro Help Dialog Class
> ////////////////////////////////////////////////////////////////
> // V1.8.5 2008.06.07 Robert Templeton
> ////////////////////////////////////////////////////////////////
> #ifndef _HELPDIALOG_H_
> #define _HELPDIALOG_H_
>
> #include "customgui_htmlviewer.h"
>
> // CLASS: interPoserPro Help Dialog Info
> class HelpDialog : public GeDialog
> {
> private:
> HtmlViewerCustomGui* hvcg;
> public:
> //*---------------------------------------------------------------------------*
> HelpDialog()
> //*---------------------------------------------------------------------------*
> {
> hvcg = NULL;
> }
> // -- GeDialog Virtuals
> //*---------------------------------------------------------------------------*
> Bool CreateLayout()
> //*---------------------------------------------------------------------------*
> {
> // Call parent instance
> if (!GeDialog::CreateLayout()) return FALSE;
>
> // Dialog Title
> SetTitle(GeLoadString(IPPS_PLUGIN_NAME)+" "+GeLoadString(IPPS_PLUGIN_EDITION)+" Help");
>
> BaseContainer tbc;
> hvcg = (HtmlViewerCustomGui* )AddCustomGui(5000L,CUSTOMGUI_HTMLVIEWER,String(),BFH_SCALEFIT|BFV_SCALEFIT,0L,0L,tbc);
> if (!hvcg) return ErrorException::Throw(EE_DIALOG, GeLoadString(IPPERR_MEMORY_TEXT), "HelpDialog.CreateLayout.hvcg");
>
> return TRUE;
> }
> // -- General
> //*---------------------------------------------------------------------------*
> void SetUrl(const String& url)
> //*---------------------------------------------------------------------------*
> {
> if (!hvcg) return;
> hvcg->SetUrl(url, URL_ENCODING_UTF16);
> hvcg->DoAction(WEBPAGE_REFRESH);
> }
> };
>
> #endif // _HELPDIALOG_H_
Here is the general template for when a 'help' button is pushed:
> if (tab == GROUP_RTEXPLORER) ShowHelpDialog("http://www.kuroyumes-developmentzone.com/");
> ...
> //*---------------------------------------------------------------------------*
> void IPPDialog::ShowHelpDialog(const String& url)
> //*---------------------------------------------------------------------------*
> {
> if (!helpDialog->IsOpen()) helpDialog->Open(TRUE,0L,-1L,-1L,320L,320L);
> helpDialog->SetUrl(url);
> }
>
Note that this feature is only available in R10 and later.