X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d12e353663f9a2fc28b26e6468716f6a01b85595..ab85e6cd0021eba5d95c1e1e52187a6f256b06de:/utils/HelpGen/src/HelpGen.cpp?ds=sidebyside diff --git a/utils/HelpGen/src/HelpGen.cpp b/utils/HelpGen/src/HelpGen.cpp index 64d917bd4e..dc7cd096c7 100644 --- a/utils/HelpGen/src/HelpGen.cpp +++ b/utils/HelpGen/src/HelpGen.cpp @@ -55,6 +55,7 @@ #include #include #include + #include #endif // WX_PRECOMP #include @@ -73,6 +74,20 @@ // just a copy of argv static char **g_argv = NULL; +class HelpGenApp: public wxApp +{ +public: + HelpGenApp() {}; + +#if wxUSE_GUI + bool OnInit(); +#else + int OnRun(); +#endif +}; + +IMPLEMENT_APP(HelpGenApp); + // ----------------------------------------------------------------------------- // private functions // ----------------------------------------------------------------------------- @@ -421,10 +436,10 @@ private: static void usage() { wxString prog = g_argv[0]; - wxString basename = prog.BeforeLast('/'); + wxString basename = prog.AfterLast('/'); #ifdef __WXMSW__ if ( !basename ) - basename = prog.BeforeLast('\\'); + basename = prog.AfterLast('\\'); #endif if ( !basename ) basename = prog; @@ -452,11 +467,21 @@ static void usage() " mode specific options are:\n" " -p do check parameter names (not done by default)\n" "\n", basename.c_str(), basename.c_str()); - +#ifndef wxUSE_GUI exit(1); +#endif } +/* int main(int argc, char **argv) +{ +*/ + +#if wxUSE_GUI +bool HelpGenApp::OnInit() +#else +int HelpGenApp::OnRun() +#endif { enum { @@ -634,7 +659,7 @@ int main(int argc, char **argv) wxLogError("Can't complete diff."); // failure - return 1; + return false; } DocManager docman(paramNames); @@ -654,7 +679,7 @@ int main(int argc, char **argv) docman.DumpDifferences(ctxTop); } - return 0; + return false; } // ----------------------------------------------------------------------------- @@ -764,7 +789,7 @@ void HelpGenVisitor::VisitClass( spClass& cl ) // the file name is built from the class name by removing the leading "wx" // if any and converting it to the lower case - wxString filename = m_directoryOut; + wxString filename; if ( name(0, 2) == "wx" ) { filename << name.c_str() + 2; } @@ -774,6 +799,7 @@ void HelpGenVisitor::VisitClass( spClass& cl ) filename.MakeLower(); filename += ".tex"; + filename.Prepend(m_directoryOut); if ( !m_overwrite && wxFile::Exists(filename) ) { wxLogError("Won't overwrite existing file '%s' - please use '-f'.", @@ -1914,6 +1940,26 @@ static const char *GetCurrentTime(const char *timeFormat) /* $Log$ + Revision 1.12 2000/10/09 13:53:33 juliansmart + Doc corrections; added HelpGen project files + + Revision 1.11 2000/07/15 19:50:42 cvsuser + merged 2.2 branch + + Revision 1.10.2.2 2000/03/27 15:33:10 VZ + don't trasnform output dir name to lower case + + Revision 1.10 2000/03/11 10:05:23 VS + now compiles with wxBase + + Revision 1.9 2000/01/16 13:25:21 VS + compilation fixes (gcc) + + Revision 1.8 1999/09/13 14:29:39 JS + + Made HelpGen into a wxWin app (still uses command-line args); moved includes + into src for simplicity; added VC++ 5 project file + Revision 1.7 1999/02/21 22:32:32 VZ 1. more C++ parser fixes - now it almost parses wx/string.h a) #if/#ifdef/#else (very) limited support