void ShowOptions(void);
#ifdef NO_GUI
+
+extern char *wxBuffer; // we must init it, otherwise tex2rtf will crash
+
int main(int argc, char **argv)
#else
wxMenuBar *menuBar = NULL;
}
#ifdef NO_GUI
+ wxBuffer = new char[1500];
+ // this is done in wxApp, but NO_GUI version doesn't call it :-(
+
if (!InputFile || !OutputFile)
{
cout << "Tex2RTF: input or output file is missing.\n";
ShowOptions();
exit(1);
}
+
#endif
if (InputFile)
{
// Return the main frame window
return TRUE;
#else
+ delete[] wxBuffer;
return FALSE;
#endif
}
+#ifndef NO_GUI
int MyApp::OnExit()
{
wxNode *node = CustomMacroList.First();
MacroDefs.Clear();
#ifdef __WXMSW__
delete TheTex2RTFServer;
+ wxDDECleanUp();
#endif
delete HelpInstance;
return 0;
}
-
+#endif
void ShowOptions(void)
{
char buf[100];
}
else if (OkToClose)
{
-#ifdef __WXMSW__
- delete TheTex2RTFServer;
- wxDDECleanUp();
-#endif
this->Destroy();
}
}
char extensionBuf[10];
char wildBuf[10];
strcpy(wildBuf, "*.");
- char *path = NULL;
+ wxString path;
if (OutputFile)
path = wxPathOnly(OutputFile);
else if (InputFile)
}
else if (strcmp(firstArg, "EXIT") == 0)
{
- if (frame && frame->OnClose())
- delete frame;
+ if (frame) frame->Close();
}
else if (strcmp(firstArg, "MINIMIZE") == 0 || strcmp(firstArg, "ICONIZE") == 0)
{
#endif
+#ifndef NO_GUI
+#ifndef __WXGTK__
+//void wxObject::Dump(ostream& str)
+//{
+// if (GetClassInfo() && GetClassInfo()->GetClassName())
+// str << GetClassInfo()->GetClassName();
+// else
+// str << "unknown object class";
+//}
+#endif
+#endif