]> git.saurik.com Git - wxWidgets.git/commitdiff
Small fixes for Tex2RTF but alas, we still get memory problems.
authorJulian Smart <julian@anthemion.co.uk>
Fri, 10 Mar 2000 11:18:22 +0000 (11:18 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Fri, 10 Mar 2000 11:18:22 +0000 (11:18 +0000)
Added wxUSE_MFC setting (doesn't include windows.h, removes own memory
tracing); added include <ctype.h> in case where PCH isn't used;
wxExit now exits :-)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6587 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

12 files changed:
docs/latex/wx/ilayout.tex
include/wx/defs.h
include/wx/msw/setup0.h
include/wx/wxprec.h
samples/mfc/mfctest.cpp
src/common/tokenzr.cpp
src/generic/grid.cpp
src/msw/app.cpp
utils/projgen/makeproj.cpp
utils/tex2rtf/src/tex2rtf.cpp
utils/tex2rtf/src/tex2rtf.ini
utils/tex2rtf/src/texutils.cpp

index 9bbe08e3d9eb213e139da9789418e4048df343e5..6f88daa94b30b87f27aac27ad6e754d3ee44aa07 100644 (file)
@@ -1,6 +1,6 @@
 \section{\class{wxIndividualLayoutConstraint}}\label{wxindividuallayoutconstraint}
 
-Objects of this class are stored in the wxIndividualLayoutConstraint class
+Objects of this class are stored in the wxLayoutConstraint class
 as one of eight possible constraints that a window can be involved in.
 
 Constraints are initially set to have the relationship wxUnconstrained,
@@ -105,7 +105,7 @@ optional margin. Implicitly, this is relative to the left edge of the other wind
 
 \membersection{wxIndividualLayoutConstraint::PercentOf}
 
-\func{void}{PercentOf}{\param{wxWindow *}{otherWin}, \param{wxEdge}{ edge}, \param{int}{ margin = 0}}
+\func{void}{PercentOf}{\param{wxWindow *}{otherWin}, \param{wxEdge}{ edge}, \param{int}{ per}}
 
 Constrains this edge or dimension to be to a percentage of the given window, with an
 optional margin.
index 0e5280b83f7140ecaa6da1b2b781870d3a9fb8a3..bd68bd96991c32b18a0d35dbd103452560dcb378 100644 (file)
@@ -1228,11 +1228,6 @@ enum wxStretch
 // id for a separator line in the menu (invalid for normal item)
 #define wxID_SEPARATOR (-1)
 
-// this one is for compatibility only, don't use in new code
-#ifndef ID_SEPARATOR
-    #define ID_SEPARATOR    wxID_SEPARATOR
-#endif
-
 // Standard menu IDs
 #define wxID_LOWEST             4999
 
index 4c08a48dc651ec8295e0b21324f9d68dc359b253..869c5ba0ab7a0e5b996c0a21b20b55cdef148bd2 100644 (file)
  *
  */
 
+// Make settings compatible with MFC
+#define wxUSE_MFC           0
+
 #define wxUSE_OLE           1
                                 // drag-and-drop, clipboard, OLE Automation
 
 #define wxUSE_DEBUG_NEW_ALWAYS          0
 #endif
 
+// MFC duplicates these operators
+#if wxUSE_MFC
+#undef  wxUSE_GLOBAL_MEMORY_OPERATORS
+#define wxUSE_GLOBAL_MEMORY_OPERATORS   0
+
+#undef  wxUSE_DEBUG_NEW_ALWAYS
+#define wxUSE_DEBUG_NEW_ALWAYS          0
+
+#ifndef _MBCS
+// #define _MBCS
+#endif
+#endif
+
 #if (!defined(WIN32) && !defined(__WIN32__)) || (defined(__GNUWIN32__) && !wxUSE_NORLANDER_HEADERS)
 // Can't use OLE drag and drop in Windows 3.1 because we don't know how
 // to implement UUIDs
index 6f28387b898cbb5f1e42a997ff6e4a1ee4b5bf81..a1a2a865e09f4d286c6c33daf9ace3e840161770 100644 (file)
@@ -28,7 +28,7 @@
 #ifdef WX_PRECOMP
 
 // include standard Windows headers
-#ifdef __WXMSW__
+#if defined(__WXMSW__) && !wxUSE_MFC
     #include <windows.h>
     #include "wx/msw/winundef.h"
 #endif
index 91ed30dbdcc24af6c5dc5c12fbd0f534ea18f171..ab1e42de2ea0a38db2276e3071775182495f446d 100644 (file)
 // initially as the main frame, and allows wxWindows frames to be
 // created subsequently:
 //
-// (1) Make MyApp::OnInit return NULL, not create a window.
+// (1) Make MyApp::OnInit return FALSE, not creating a window.
 // (2) Restore the MFC code to create a window in InitInstance, and remove
 //     creation of CDummyWindow.
 //
-// IMPORTANT NOTE: to compile this sample, you must first edit
-// wx/src/msw/wx_main.cc, set NOWINMAIN to 1, and remake wxWindows
-// (it only needs to recompile wx_main.cc).
-// This eliminates the duplicate WinMain function which MFC implements.
+// IMPORTANT NOTES:
+//
+// (1) You need to set wxUSE_MFC to 1 in include/wx/msw/setup.h, which switches
+// off some debugging features and also removes the windows.h inclusion
+// in wxprec.h (MFC headers don't like this to have been included previously).
+// Then recompile wxWindows and this sample.
+//
+// (2) 10/3/2000, wxWindows 2.1.14: unfortunately there is an assert when
+// the sample tries to create an MFC window. Any suggestions welcome. It may be
+// a problem with conflicting project settings. Ignoring the assert (several times)
+// allows the sample to continue. In release mode the asserts don't happen.
+//
+// (3) I can't get the sample to link using a static MFC library, only the DLL
+// version. Perhaps someone else is a wizard at working out the required settings
+// in the wxWin library and the sample; then debugging the assert problem may be
+// easier.
 
 // For compilers that support precompilation, includes "wx/wx.h".
 #include "wx/wxprec.h"
@@ -331,14 +343,13 @@ void MyCanvas::OnMouseEvent(wxMouseEvent& event)
 {
     wxClientDC dc(this);
     dc.SetPen(* wxBLACK_PEN);
-    long x, y;
-    event.Position(&x, &y);
+    wxPoint pos = event.GetPosition();
     if (xpos > -1 && ypos > -1 && event.Dragging())
     {
-        dc.DrawLine(xpos, ypos, x, y);
+        dc.DrawLine(xpos, ypos, pos.x, pos.y);
     }
-    xpos = x;
-    ypos = y;
+    xpos = pos.x;
+    ypos = pos.y;
 }
 
 BEGIN_EVENT_TABLE(MyChild, wxFrame)
index 64f49e5822f465ff504d1a628ce48faf1fbc25ac..b6272da149a720dcff508821acfa7b6aa53053ac 100644 (file)
@@ -30,6 +30,9 @@
 
 #include "wx/tokenzr.h"
 
+// Required for wxIs... functions
+#include <ctype.h>
+
 // ============================================================================
 // implementation
 // ============================================================================
index 196891b59aa74dda06c5e455173adbc5a2fda3d8..741a9b7ae2ac0b67b46065867280b6faef02188c 100644 (file)
@@ -52,6 +52,9 @@
 #include "wx/grid.h"
 #include "wx/generic/gridsel.h"
 
+// Required for wxIs... functions
+#include <ctype.h>
+
 // ----------------------------------------------------------------------------
 // array classes
 // ----------------------------------------------------------------------------
index 42f473f2f58122cd21c0d6939b6869f0af212281..7b445e7df2a5ea75578a4a01be8715d069c505e1 100644 (file)
@@ -1199,6 +1199,7 @@ void wxExit()
     wxLogError(_("Fatal error: exiting"));
 
     wxApp::CleanUp();
+    exit(0);
 }
 
 // Yield to incoming messages
@@ -1223,7 +1224,8 @@ bool wxYield()
     }
 
     // If they are pending events, we must process them.
-    wxTheApp->ProcessPendingEvents();
+    if (wxTheApp)
+        wxTheApp->ProcessPendingEvents();
 
     // let the logs be flashed again
     wxLog::Resume();
index 76827a299fc7807f8155f1d1bf7e09d64137df48..7c31c2fe9d551e43dadb356f9b658a4e975b38c4 100644 (file)
@@ -268,8 +268,8 @@ void MyApp::GenerateSamples(const wxString& dir)
     GenerateSample("ListctrlVC", "listtest", dir + wxString("/samples/listctrl"), wxStringList("listtest.cpp", "listtest.h", 0));
     GenerateSample("MdiVC", "mdi", dir + wxString("/samples/mdi"), wxStringList("mdi.cpp", "mdi.h", 0));
     GenerateSample("MemcheckVC", "memcheck", dir + wxString("/samples/memcheck"), wxStringList("memcheck.cpp", 0));
-    // Note: MFC sample will be different.
-    GenerateSample("MfcVC", "mfc", dir + wxString("/samples/mfc"), wxStringList("mfctest.cpp", "mfctest.h", 0));
+    // Don't always generate this project since it has to be tweaked by hand.
+    // GenerateSample("MfcVC", "mfctest", dir + wxString("/samples/mfc"), wxStringList("mfctest.cpp", "mfctest.h", 0));
     GenerateSample("MiniframVC", "test", dir + wxString("/samples/minifram"), wxStringList("test.cpp", "test.h", 0));
     GenerateSample("MinimalVC", "minimal", dir + wxString("/samples/minimal"), wxStringList("minimal.cpp", 0));
     GenerateSample("NativdlgVC", "nativdlg", dir + wxString("/samples/nativdlg"), wxStringList("nativdlg.cpp", "nativdlg.h", "resource.h", 0));
index 5b1bf16c6735dfc74228e43cc74ef7965e39162d..fd069479dcaa32cd8c8c4773b7334cd442a64686 100644 (file)
@@ -241,6 +241,7 @@ bool MyApp::OnInit()
         else
         {
           OnError("Incorrect argument for -charset");
+          return FALSE;
         }
       }
     }
@@ -254,6 +255,7 @@ bool MyApp::OnInit()
       ShowOptions();
       exit(1);
 #endif
+      return FALSE;
     }
   }
 
@@ -854,7 +856,7 @@ void OnError(char *msg)
   cerr << "Error: " << msg << "\n";
   cerr.flush();
 #else
-  if (isInteractive)
+  if (isInteractive && frame)
     (*frame->textWindow) << "Error: " << msg << "\n";
   else
 #ifdef __UNIX__
@@ -876,7 +878,7 @@ void OnInform(char *msg)
   cout << msg << "\n";
   cout.flush();
 #else
-  if (isInteractive)
+  if (isInteractive && frame)
     (*frame->textWindow) << msg << "\n";
   else
 #ifdef __WXMSW__
index 48800d37db46651d0b79465ac95c284f1e9bce76..414eed45fa44167a61d354946497fdb2f90ef2b9 100644 (file)
@@ -1,17 +1,22 @@
+; Tex2RTF initialisation file
 runTwice = yes
 titleFontSize = 12
 authorFontSize = 10
 chapterFontSize = 12
 sectionFontSize = 12
 subsectionFontSize = 12
-; RTF only
 headerRule = yes
 footerRule = yes
 useHeadingStyles = yes
+contentsDepth = 2
 listItemIndent=40
-truncateFilenames = FALSE
 winHelpContents = yes
-winHelpVersion = 4 ; 3 for Windows 3.x, 4 for Windows 95
-generateHPJ = true
-\overview [2] { \image{}{books.bmp}\helpref{#1}{#2}}
-; Some stuff
\ No newline at end of file
+winHelpVersion = 3 ; 3 for Windows 3.x, 4 for Windows 95
+generateHPJ = no
+htmlBrowseButtons = bitmap
+winHelpTitle = "Help Demo Document"
+truncateFilenames = yes
+combineSubSections = yes
+htmlIndex = yes
+htmlFrameContents = no
+htmlWorkshopFiles = yes
index 5746339422b5fe604775474feb50d794bcf5c5dd..eec52b6db1acb44889a56ed88a144b29e6c99d1a 100644 (file)
@@ -1569,7 +1569,8 @@ void Tex2RTFYield(bool force)
     yieldCount = 0;
   if (yieldCount == 0)
   {
-    wxYield();
+    if (wxTheApp)
+        wxYield();
     yieldCount = 10;
   }
   yieldCount --;