Commit e242c482 authored by claes's avatar claes

Java class menu in alpha order

parent e2ec3b14
/* /*
* Proview $Id: cnv_wbltohtml.cpp,v 1.14 2007-09-25 11:15:50 claes Exp $ * Proview $Id: cnv_wbltohtml.cpp,v 1.15 2008-03-03 11:01:09 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
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <iostream.h> #include <iostream.h>
#include <fstream.h> #include <fstream.h>
#include <vector.h>
#include <float.h> #include <float.h>
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
...@@ -356,6 +357,8 @@ int CnvWblToHtml::close() ...@@ -356,6 +357,8 @@ int CnvWblToHtml::close()
"</HTML>" << endl; "</HTML>" << endl;
fp_html_index.close(); fp_html_index.close();
print_all_menu();
fp_js_all << fp_js_all <<
"])" << endl << "])" << endl <<
"}" << endl; "}" << endl;
...@@ -463,14 +466,11 @@ int CnvWblToHtml::class_exec() ...@@ -463,14 +466,11 @@ int CnvWblToHtml::class_exec()
"<A HREF=\"" << html_file_name << ".html\" TARGET=\"classFrame\">" << ctx->rw->class_name << "</A>" << endl << "<A HREF=\"" << html_file_name << ".html\" TARGET=\"classFrame\">" << ctx->rw->class_name << "</A>" << endl <<
"<BR>" << endl; "<BR>" << endl;
// Add into AllClasses js file cnv_mentry mentry;
if ( !js_all_first) strcpy( mentry.name, ctx->rw->class_name);
fp_js_all << ","; strcpy( mentry.file, html_file_name);
else strcat( mentry.file, ".html");
js_all_first = false; all_classes.push_back( mentry);
fp_js_all <<
"[\"" << ctx->rw->class_name << "\",\"" << html_file_name << ".html\"]" << endl;
// Add into group file // Add into group file
for ( int i = 0; i < ctx->rw->doc_group_cnt; i++) { for ( int i = 0; i < ctx->rw->doc_group_cnt; i++) {
...@@ -1106,13 +1106,11 @@ int CnvWblToHtml::typedef_exec() ...@@ -1106,13 +1106,11 @@ int CnvWblToHtml::typedef_exec()
"<BR>" << endl; "<BR>" << endl;
// Add into AllClasses js file // Add into AllClasses js file
if ( !js_all_first) cnv_mentry mentry;
fp_js_all << ","; strcpy( mentry.name, ctx->rw->class_name);
else strcpy( mentry.file, html_file_name);
js_all_first = false; strcat( mentry.file, ".html");
all_types.push_back( mentry);
fp_js_all <<
"[\"" << ctx->rw->class_name << "\",\"" << html_file_name << ".html\"]" << endl;
// Add into group file // Add into group file
for ( int i = 0; i < ctx->rw->doc_group_cnt; i++) { for ( int i = 0; i < ctx->rw->doc_group_cnt; i++) {
...@@ -1306,6 +1304,53 @@ int CnvWblToHtml::typedef_close() ...@@ -1306,6 +1304,53 @@ int CnvWblToHtml::typedef_close()
void CnvWblToHtml::print_all_menu()
{
// Sort
for ( unsigned int i = all_types.size() - 1; i > 0; i--) {
for ( unsigned int j = 0; j < i; j++) {
if ( !(all_types[j] < all_types[j+1])) {
cnv_mentry mi = all_types[j+1];
all_types[j+1] = all_types[j];
all_types[j] = mi;
}
}
}
for ( unsigned int i = all_classes.size() - 1; i > 0; i--) {
for ( unsigned int j = 0; j < i; j++) {
if ( !(all_classes[j] < all_classes[j+1])) {
cnv_mentry mi = all_classes[j+1];
all_classes[j+1] = all_classes[j];
all_classes[j] = mi;
}
}
}
for ( unsigned int i = 0; i < all_types.size(); i++) {
// Add into AllClasses js file
if ( !js_all_first)
fp_js_all << ",";
else
js_all_first = false;
fp_js_all <<
"[\"" << all_types[i].name << "\",\"" << all_types[i].file << "\"]" << endl;
}
for ( unsigned int i = 0; i < all_classes.size(); i++) {
// Add into AllClasses js file
if ( !js_all_first)
fp_js_all << ",";
else
js_all_first = false;
fp_js_all <<
"[\"" << all_classes[i].name << "\",\"" << all_classes[i].file << "\"]" << endl;
}
}
/* /*
* Proview $Id: cnv_wbltohtml.h,v 1.4 2005-11-14 16:11:23 claes Exp $ * Proview $Id: cnv_wbltohtml.h,v 1.5 2008-03-03 11:01:09 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
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
extern "C" { extern "C" {
#endif #endif
#include <vector.h>
#include "pwr.h" #include "pwr.h"
#include "cnv_readwbl.h" #include "cnv_readwbl.h"
#include "cnv_wblto.h" #include "cnv_wblto.h"
...@@ -33,6 +34,16 @@ using namespace std; ...@@ -33,6 +34,16 @@ using namespace std;
class CnvReadWbl; class CnvReadWbl;
class cnv_mentry {
public:
cnv_mentry() {}
bool operator<( const cnv_mentry& x) {
return (strcmp( name, x.name) < 0);
}
char name[32];
pwr_tFileName file;
};
class CnvWblToHtml : public CnvWblTo { class CnvWblToHtml : public CnvWblTo {
public: public:
CnvWblToHtml( CnvCtx *cnv_ctx) : ctx(cnv_ctx), CnvWblToHtml( CnvCtx *cnv_ctx) : ctx(cnv_ctx),
...@@ -53,6 +64,8 @@ class CnvWblToHtml : public CnvWblTo { ...@@ -53,6 +64,8 @@ class CnvWblToHtml : public CnvWblTo {
bool js_all_first; bool js_all_first;
bool js_group_first[80]; bool js_group_first[80];
bool cdp_created; bool cdp_created;
vector<cnv_mentry> all_types;
vector<cnv_mentry> all_classes;
int init( char *first); int init( char *first);
int close(); int close();
...@@ -71,6 +84,7 @@ class CnvWblToHtml : public CnvWblTo { ...@@ -71,6 +84,7 @@ class CnvWblToHtml : public CnvWblTo {
int class_open() { return html_class_open;} int class_open() { return html_class_open;}
int index_open() { return html_index_open;} int index_open() { return html_index_open;}
void create_cdp_file( char *volume_name, char *class_name, char *attr_typeref); void create_cdp_file( char *volume_name, char *class_name, char *attr_typeref);
void print_all_menu();
}; };
......
/* /*
* Proview $Id: co_convert.cpp,v 1.14 2007-06-29 10:01:06 claes Exp $ * Proview $Id: co_convert.cpp,v 1.15 2008-03-03 11:01: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
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <iostream.h> #include <iostream.h>
#include <fstream.h> #include <fstream.h>
#include <vector.h>
extern "C" { extern "C" {
#include "pwr.h" #include "pwr.h"
......
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