Commit fe498f9a authored by claes's avatar claes

Tag <classlink> added to xtthelp file

parent 836980fb
/* /*
* Proview $Id: cnv_xtthelptohtml.cpp,v 1.4 2007-05-24 14:51:19 claes Exp $ * Proview $Id: cnv_xtthelptohtml.cpp,v 1.5 2008-04-11 16:30:45 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -119,7 +119,7 @@ void *CnvXtthelpToHtml::insert( navh_eItemType item_type, char *text1, ...@@ -119,7 +119,7 @@ void *CnvXtthelpToHtml::insert( navh_eItemType item_type, char *text1,
"<TITLE>" << endl << "<TITLE>" << endl <<
"Generated Documentation (Untitled)" << endl << "Generated Documentation (Untitled)" << endl <<
"</TITLE>" << endl << "</TITLE>" << endl <<
"<LINK REL =\"stylesheet\" TYPE=\"text/css\" HREF=\"pwr_css.css\" TITLE=\"Style\">" << endl << "<LINK REL =\"stylesheet\" TYPE=\"text/css\" HREF=\"../pcss.css\" TITLE=\"Style\">" << endl <<
"</HEAD>" << endl << "</HEAD>" << endl <<
//"<H2>" << text1 << "</H2><BR>" << endl << //"<H2>" << text1 << "</H2><BR>" << endl <<
"<P>" << endl; "<P>" << endl;
...@@ -141,8 +141,8 @@ void *CnvXtthelpToHtml::insert( navh_eItemType item_type, char *text1, ...@@ -141,8 +141,8 @@ void *CnvXtthelpToHtml::insert( navh_eItemType item_type, char *text1,
if ( !cf) if ( !cf)
break; break;
if ( strcmp( link, "") != 0) {
pwr_tFileName fname; pwr_tFileName fname;
if ( strcmp( link, "") != 0) {
if ( strncmp( link, "$web:", 5) == 0) { if ( strncmp( link, "$web:", 5) == 0) {
if ( strncmp( &link[5], "$pwrp_web/", 10) == 0) if ( strncmp( &link[5], "$pwrp_web/", 10) == 0)
...@@ -150,6 +150,20 @@ void *CnvXtthelpToHtml::insert( navh_eItemType item_type, char *text1, ...@@ -150,6 +150,20 @@ void *CnvXtthelpToHtml::insert( navh_eItemType item_type, char *text1,
else else
strcpy( fname, &link[5]); strcpy( fname, &link[5]);
} }
else if ( strncmp( link, "$class:", 7) == 0) {
char *s;
// Get prefix from file
strcpy( fname, "./orm/");
s = strrchr( file_name, '/');
if ( s)
strcat( fname, s+1);
s = strchr( fname, '_');
if ( s)
*(s+1) = 0;
strcat( fname, &link[7]);
strcat( fname, ".html");
}
else if ( (strstr( link, ".htm") != 0) || else if ( (strstr( link, ".htm") != 0) ||
(strstr( link, ".pdf") != 0)) { (strstr( link, ".pdf") != 0)) {
strcpy( fname, link); strcpy( fname, link);
...@@ -162,11 +176,14 @@ void *CnvXtthelpToHtml::insert( navh_eItemType item_type, char *text1, ...@@ -162,11 +176,14 @@ void *CnvXtthelpToHtml::insert( navh_eItemType item_type, char *text1,
strcat( fname, link_bookmark); strcat( fname, link_bookmark);
} }
} }
if ( !in_table)
cf->f << "<A HREF=\"" << fname << "\">"; cf->f << "<A HREF=\"" << fname << "\">";
} }
else if ( bookmark) { else if ( bookmark) {
if ( in_table) {
cf->f << "</TABLE>" << endl; cf->f << "</TABLE>" << endl;
in_table = 0; in_table = 0;
}
cf->f << "<A NAME=\"" << bookmark << "\">"; cf->f << "<A NAME=\"" << bookmark << "\">";
} }
...@@ -178,7 +195,12 @@ void *CnvXtthelpToHtml::insert( navh_eItemType item_type, char *text1, ...@@ -178,7 +195,12 @@ void *CnvXtthelpToHtml::insert( navh_eItemType item_type, char *text1,
cf->f << "<BR>" << endl; cf->f << "<BR>" << endl;
} }
else { else {
cf->f << "<TR><TD>" << text1; cf->f << "<TR><TD>";
if ( strcmp( link, "") != 0)
cf->f << "<A HREF=\"" << fname << "\">";
else if ( bookmark != 0)
cf->f << "<A NAME=\"" << bookmark << "\">";
cf->f << text1;
if ( strcmp( text2, "") != 0 || strcmp( text3, "") != 0) { if ( strcmp( text2, "") != 0 || strcmp( text3, "") != 0) {
for ( i = 0; i < (int)(CNV_TAB - strlen(text1)); i++) for ( i = 0; i < (int)(CNV_TAB - strlen(text1)); i++)
cf->f << "&nbsp;"; cf->f << "&nbsp;";
...@@ -189,11 +211,11 @@ void *CnvXtthelpToHtml::insert( navh_eItemType item_type, char *text1, ...@@ -189,11 +211,11 @@ void *CnvXtthelpToHtml::insert( navh_eItemType item_type, char *text1,
cf->f << "&nbsp;&nbsp;</TD><TD>" << text3; cf->f << "&nbsp;&nbsp;</TD><TD>" << text3;
} }
} }
cf->f << "</TD></TR>";
if ( strcmp( link, "") != 0 || bookmark) if ( strcmp( link, "") != 0 || bookmark)
cf->f << "</A>" << endl; cf->f << "</A>" << endl;
else else
cf->f << endl; cf->f << endl;
cf->f << "</TD></TR>";
} }
return NULL; return NULL;
} }
...@@ -210,6 +232,20 @@ void *CnvXtthelpToHtml::insert( navh_eItemType item_type, char *text1, ...@@ -210,6 +232,20 @@ void *CnvXtthelpToHtml::insert( navh_eItemType item_type, char *text1,
else else
strcpy( fname, &link[5]); strcpy( fname, &link[5]);
} }
else if ( strncmp( link, "$class:", 7) == 0) {
char *s;
// Get prefix from file
strcpy( fname, "./orm/");
s = strrchr( file_name, '/');
if ( s)
strcat( fname, s+1);
s = strchr( fname, '_');
if ( s)
*(s+1) = 0;
strcat( fname, &link[7]);
strcat( fname, ".html");
}
else if ( (strstr( link, ".htm") != 0) || else if ( (strstr( link, ".htm") != 0) ||
(strstr( link, ".pdf") != 0)) { (strstr( link, ".pdf") != 0)) {
strcpy( fname, link); strcpy( fname, link);
...@@ -255,11 +291,11 @@ void *CnvXtthelpToHtml::insert( navh_eItemType item_type, char *text1, ...@@ -255,11 +291,11 @@ void *CnvXtthelpToHtml::insert( navh_eItemType item_type, char *text1,
cf->f << "&nbsp;&nbsp;</B></TD><TD><B>" << text3; cf->f << "&nbsp;&nbsp;</B></TD><TD><B>" << text3;
} }
} }
cf->f << "</B></TD></TR>";
if ( strcmp( link, "") != 0 || bookmark) if ( strcmp( link, "") != 0 || bookmark)
cf->f << "</A>" << endl; cf->f << "</A>" << endl;
else else
cf->f << endl; cf->f << endl;
cf->f << "</B></TD></TR>";
} }
return NULL; return NULL;
} }
......
/** /**
* Proview $Id: co_nav_help.cpp,v 1.11 2008-02-27 06:24:37 claes Exp $ * Proview $Id: co_nav_help.cpp,v 1.12 2008-04-11 16:30:45 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -373,6 +373,37 @@ int NavHelp::help( char *help_key, char *help_bookmark, ...@@ -373,6 +373,37 @@ int NavHelp::help( char *help_key, char *help_bookmark,
link_filename_p = link_filename; link_filename_p = link_filename;
} }
} }
else if ( (s = strstr( line, "<classlink>")) || (s = strstr( line, "<CLASSLINK>")))
{
help_remove_spaces( s + 11, link);
*s = 0;
link_nr = dcli_parse( link, ",", "", (char *)link_part,
sizeof( link_part) / sizeof( link_part[0]),
sizeof( link_part[0]), 0);
if ( link_nr == 1)
{
strcpy( link, "$class:");
help_remove_spaces( link_part[0], &link[7]);
strcpy( link_bookmark, "");
link_filename_p = file_name;
}
else if ( link_nr == 2)
{
strcpy( link, "$class:");
help_remove_spaces( link_part[0], &link[7]);
help_remove_spaces( link_part[1], link_bookmark);
link_filename_p = file_name;
}
else if ( link_nr > 2)
{
strcpy( link, "$class:");
help_remove_spaces( link_part[0], &link[7]);
help_remove_spaces( link_part[1], link_bookmark);
help_remove_spaces( link_part[2], link_filename);
link_filename_p = link_filename;
}
}
else else
{ {
strcpy( link, ""); strcpy( link, "");
......
/** /**
* Proview $Id: co_xhelpnav.cpp,v 1.12 2008-02-27 06:24:37 claes Exp $ * Proview $Id: co_xhelpnav.cpp,v 1.13 2008-04-11 16:30:45 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -1018,6 +1018,11 @@ void *xhelpnav_help_insert_cb( void *ctx, navh_eItemType item_type, char *text1, ...@@ -1018,6 +1018,11 @@ void *xhelpnav_help_insert_cb( void *ctx, navh_eItemType item_type, char *text1,
navh_eHelpFile file_type, int help_index, char *bm) navh_eHelpFile file_type, int help_index, char *bm)
{ {
CoXHelpNav *xhelpnav = (CoXHelpNav *)ctx; CoXHelpNav *xhelpnav = (CoXHelpNav *)ctx;
char *llink = 0;
if ( link && strncmp( link, "$class:", 7) == 0)
llink = link + 7;
else if ( link)
llink = link;
if ( xhelpnav->init_help) { if ( xhelpnav->init_help) {
xhelpnav->brow_pop(); xhelpnav->brow_pop();
...@@ -1033,7 +1038,7 @@ void *xhelpnav_help_insert_cb( void *ctx, navh_eItemType item_type, char *text1, ...@@ -1033,7 +1038,7 @@ void *xhelpnav_help_insert_cb( void *ctx, navh_eItemType item_type, char *text1,
trim( text2); trim( text2);
trim( text3); trim( text3);
HItemHelp *item = new HItemHelp( xhelpnav->brow, "help", text1, text2, text3, HItemHelp *item = new HItemHelp( xhelpnav->brow, "help", text1, text2, text3,
link, bookmark, file_name, file_type, help_index, llink, bookmark, file_name, file_type, help_index,
NULL, flow_eDest_IntoLast); NULL, flow_eDest_IntoLast);
return item->node; return item->node;
} }
...@@ -1043,7 +1048,7 @@ void *xhelpnav_help_insert_cb( void *ctx, navh_eItemType item_type, char *text1, ...@@ -1043,7 +1048,7 @@ void *xhelpnav_help_insert_cb( void *ctx, navh_eItemType item_type, char *text1,
trim( text2); trim( text2);
trim( text3); trim( text3);
HItemHelpBold *item = new HItemHelpBold( xhelpnav->brow, "help", text1, text2, HItemHelpBold *item = new HItemHelpBold( xhelpnav->brow, "help", text1, text2,
text3, link, bookmark, file_name, file_type, help_index, text3, llink, bookmark, file_name, file_type, help_index,
NULL, flow_eDest_IntoLast); NULL, flow_eDest_IntoLast);
return item->node; return item->node;
} }
...@@ -1083,7 +1088,7 @@ void *xhelpnav_help_insert_cb( void *ctx, navh_eItemType item_type, char *text1, ...@@ -1083,7 +1088,7 @@ void *xhelpnav_help_insert_cb( void *ctx, navh_eItemType item_type, char *text1,
brow_AddAnnotPixmap( nc, 0, 0.2, 0.1, flow_eDrawType_Line, 2, 0); brow_AddAnnotPixmap( nc, 0, 0.2, 0.1, flow_eDrawType_Line, 2, 0);
brow_AddImage( nc, text1, 2, 0); brow_AddImage( nc, text1, 2, 0);
HItemHelpImage *item = new HItemHelpImage( xhelpnav->brow, "help", nc, HItemHelpImage *item = new HItemHelpImage( xhelpnav->brow, "help", nc,
link, bookmark, file_name, file_type, NULL, flow_eDest_IntoLast); llink, bookmark, file_name, file_type, NULL, flow_eDest_IntoLast);
return item->node; return item->node;
} }
default: default:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment