Small fixes for Tex2RTF but alas, we still get memory problems.

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
This commit is contained in:
Julian Smart
2000-03-10 11:18:22 +00:00
parent 0a5835068c
commit 3f8e5072f7
12 changed files with 68 additions and 30 deletions

View File

@@ -1,6 +1,6 @@
\section{\class{wxIndividualLayoutConstraint}}\label{wxindividuallayoutconstraint} \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. as one of eight possible constraints that a window can be involved in.
Constraints are initially set to have the relationship wxUnconstrained, 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} \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 Constrains this edge or dimension to be to a percentage of the given window, with an
optional margin. optional margin.

View File

@@ -1228,11 +1228,6 @@ enum wxStretch
// id for a separator line in the menu (invalid for normal item) // id for a separator line in the menu (invalid for normal item)
#define wxID_SEPARATOR (-1) #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 // Standard menu IDs
#define wxID_LOWEST 4999 #define wxID_LOWEST 4999

View File

@@ -428,6 +428,9 @@
* *
*/ */
// Make settings compatible with MFC
#define wxUSE_MFC 0
#define wxUSE_OLE 1 #define wxUSE_OLE 1
// drag-and-drop, clipboard, OLE Automation // drag-and-drop, clipboard, OLE Automation
@@ -510,6 +513,19 @@
#define wxUSE_DEBUG_NEW_ALWAYS 0 #define wxUSE_DEBUG_NEW_ALWAYS 0
#endif #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) #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 // Can't use OLE drag and drop in Windows 3.1 because we don't know how
// to implement UUIDs // to implement UUIDs

View File

@@ -28,7 +28,7 @@
#ifdef WX_PRECOMP #ifdef WX_PRECOMP
// include standard Windows headers // include standard Windows headers
#ifdef __WXMSW__ #if defined(__WXMSW__) && !wxUSE_MFC
#include <windows.h> #include <windows.h>
#include "wx/msw/winundef.h" #include "wx/msw/winundef.h"
#endif #endif

View File

@@ -26,14 +26,26 @@
// initially as the main frame, and allows wxWindows frames to be // initially as the main frame, and allows wxWindows frames to be
// created subsequently: // 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 // (2) Restore the MFC code to create a window in InitInstance, and remove
// creation of CDummyWindow. // creation of CDummyWindow.
// //
// IMPORTANT NOTE: to compile this sample, you must first edit // IMPORTANT NOTES:
// wx/src/msw/wx_main.cc, set NOWINMAIN to 1, and remake wxWindows //
// (it only needs to recompile wx_main.cc). // (1) You need to set wxUSE_MFC to 1 in include/wx/msw/setup.h, which switches
// This eliminates the duplicate WinMain function which MFC implements. // 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". // For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h" #include "wx/wxprec.h"
@@ -331,14 +343,13 @@ void MyCanvas::OnMouseEvent(wxMouseEvent& event)
{ {
wxClientDC dc(this); wxClientDC dc(this);
dc.SetPen(* wxBLACK_PEN); dc.SetPen(* wxBLACK_PEN);
long x, y; wxPoint pos = event.GetPosition();
event.Position(&x, &y);
if (xpos > -1 && ypos > -1 && event.Dragging()) if (xpos > -1 && ypos > -1 && event.Dragging())
{ {
dc.DrawLine(xpos, ypos, x, y); dc.DrawLine(xpos, ypos, pos.x, pos.y);
} }
xpos = x; xpos = pos.x;
ypos = y; ypos = pos.y;
} }
BEGIN_EVENT_TABLE(MyChild, wxFrame) BEGIN_EVENT_TABLE(MyChild, wxFrame)

View File

@@ -30,6 +30,9 @@
#include "wx/tokenzr.h" #include "wx/tokenzr.h"
// Required for wxIs... functions
#include <ctype.h>
// ============================================================================ // ============================================================================
// implementation // implementation
// ============================================================================ // ============================================================================

View File

@@ -52,6 +52,9 @@
#include "wx/grid.h" #include "wx/grid.h"
#include "wx/generic/gridsel.h" #include "wx/generic/gridsel.h"
// Required for wxIs... functions
#include <ctype.h>
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// array classes // array classes
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@@ -1199,6 +1199,7 @@ void wxExit()
wxLogError(_("Fatal error: exiting")); wxLogError(_("Fatal error: exiting"));
wxApp::CleanUp(); wxApp::CleanUp();
exit(0);
} }
// Yield to incoming messages // Yield to incoming messages
@@ -1223,7 +1224,8 @@ bool wxYield()
} }
// If they are pending events, we must process them. // If they are pending events, we must process them.
wxTheApp->ProcessPendingEvents(); if (wxTheApp)
wxTheApp->ProcessPendingEvents();
// let the logs be flashed again // let the logs be flashed again
wxLog::Resume(); wxLog::Resume();

View 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("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("MdiVC", "mdi", dir + wxString("/samples/mdi"), wxStringList("mdi.cpp", "mdi.h", 0));
GenerateSample("MemcheckVC", "memcheck", dir + wxString("/samples/memcheck"), wxStringList("memcheck.cpp", 0)); GenerateSample("MemcheckVC", "memcheck", dir + wxString("/samples/memcheck"), wxStringList("memcheck.cpp", 0));
// Note: MFC sample will be different. // Don't always generate this project since it has to be tweaked by hand.
GenerateSample("MfcVC", "mfc", dir + wxString("/samples/mfc"), wxStringList("mfctest.cpp", "mfctest.h", 0)); // 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("MiniframVC", "test", dir + wxString("/samples/minifram"), wxStringList("test.cpp", "test.h", 0));
GenerateSample("MinimalVC", "minimal", dir + wxString("/samples/minimal"), wxStringList("minimal.cpp", 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)); GenerateSample("NativdlgVC", "nativdlg", dir + wxString("/samples/nativdlg"), wxStringList("nativdlg.cpp", "nativdlg.h", "resource.h", 0));

View File

@@ -241,6 +241,7 @@ bool MyApp::OnInit()
else else
{ {
OnError("Incorrect argument for -charset"); OnError("Incorrect argument for -charset");
return FALSE;
} }
} }
} }
@@ -254,6 +255,7 @@ bool MyApp::OnInit()
ShowOptions(); ShowOptions();
exit(1); exit(1);
#endif #endif
return FALSE;
} }
} }
@@ -854,7 +856,7 @@ void OnError(char *msg)
cerr << "Error: " << msg << "\n"; cerr << "Error: " << msg << "\n";
cerr.flush(); cerr.flush();
#else #else
if (isInteractive) if (isInteractive && frame)
(*frame->textWindow) << "Error: " << msg << "\n"; (*frame->textWindow) << "Error: " << msg << "\n";
else else
#ifdef __UNIX__ #ifdef __UNIX__
@@ -876,7 +878,7 @@ void OnInform(char *msg)
cout << msg << "\n"; cout << msg << "\n";
cout.flush(); cout.flush();
#else #else
if (isInteractive) if (isInteractive && frame)
(*frame->textWindow) << msg << "\n"; (*frame->textWindow) << msg << "\n";
else else
#ifdef __WXMSW__ #ifdef __WXMSW__

View File

@@ -1,17 +1,22 @@
; Tex2RTF initialisation file
runTwice = yes runTwice = yes
titleFontSize = 12 titleFontSize = 12
authorFontSize = 10 authorFontSize = 10
chapterFontSize = 12 chapterFontSize = 12
sectionFontSize = 12 sectionFontSize = 12
subsectionFontSize = 12 subsectionFontSize = 12
; RTF only
headerRule = yes headerRule = yes
footerRule = yes footerRule = yes
useHeadingStyles = yes useHeadingStyles = yes
contentsDepth = 2
listItemIndent=40 listItemIndent=40
truncateFilenames = FALSE
winHelpContents = yes winHelpContents = yes
winHelpVersion = 4 ; 3 for Windows 3.x, 4 for Windows 95 winHelpVersion = 3 ; 3 for Windows 3.x, 4 for Windows 95
generateHPJ = true generateHPJ = no
\overview [2] { \image{}{books.bmp}\helpref{#1}{#2}} htmlBrowseButtons = bitmap
; Some stuff winHelpTitle = "Help Demo Document"
truncateFilenames = yes
combineSubSections = yes
htmlIndex = yes
htmlFrameContents = no
htmlWorkshopFiles = yes

View File

@@ -1569,7 +1569,8 @@ void Tex2RTFYield(bool force)
yieldCount = 0; yieldCount = 0;
if (yieldCount == 0) if (yieldCount == 0)
{ {
wxYield(); if (wxTheApp)
wxYield();
yieldCount = 10; yieldCount = 10;
} }
yieldCount --; yieldCount --;