some really minor changes (the most important one: small memory hole in

wxList plugged)


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1384 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 1999-01-12 23:44:03 +00:00
parent a0abb8a882
commit 09914df7b8
5 changed files with 54 additions and 31 deletions

View File

@ -1,11 +1,10 @@
\section{Log classes overview}\label{wxlogoverview}
Classes: \helpref{wxLog}{wxlog}
%\helpref{wxLogStderr}{wxlogstderr},%
%\helpref{wxLogOstream}{wxlogostream}, \helpref{wxLogTextCtrl}{wxlogtextctrl},%
%\helpref{wxLogWindow}{wxlogwindow}, \helpref{wxLogGui}{wxloggui},%
%\helpref{wxLogNull}{wxlognull}%
Classes: \helpref{wxLog}{wxlog}\\
\helpref{wxLogStderr}{wxlogstderr},\\
\helpref{wxLogOstream}{wxlogostream}, \helpref{wxLogTextCtrl}{wxlogtextctrl},\\
\helpref{wxLogWindow}{wxlogwindow}, \helpref{wxLogGui}{wxloggui},\\
\helpref{wxLogNull}{wxlognull}
This is a general overview of logging classes provided by wxWindows. The word
logging here has a broad sense, including all of the program output, not only
@ -126,8 +125,8 @@ clear the log, close it completely or save all messages to file.
\item{\bf wxLogNull} The last log class is quite particular: it doesn't do
anything. The objects of this class may be instantiated to (temporarily)
suppress output of {\it wxLogXXX()} functions. As an example, trying to open a
non-existing file will usually provoke an error message, but if you for some
reason it's unwanted, just use this construction:
non-existing file will usually provoke an error message, but if for some
reasons it's unwanted, just use this construction:
{\small
\begin{verbatim}

View File

@ -301,12 +301,15 @@ size_t wxFile::Write(const void *pBuf, size_t nCount)
bool wxFile::Flush()
{
if ( IsOpened() ) {
// @@@ fsync() is not ANSI (BSDish)
// if ( fsync(m_fd) == -1 ) { // TODO
if (wxTrue) {
wxLogSysError(_("can't flush file descriptor %d"), m_fd);
return FALSE;
}
#if defined(_MSC_VER) || wxHAVE_FSYNC
if ( fsync(m_fd) == -1 )
{
wxLogSysError(_("can't flush file descriptor %d"), m_fd);
return FALSE;
}
#else // no fsync
// just do nothing
#endif // fsync
}
return TRUE;

View File

@ -120,6 +120,11 @@ wxNodeBase::~wxNodeBase()
// compatibility with old code
if ( m_list != NULL )
{
if ( m_list->m_keyType == wxKEY_STRING )
{
free(m_key.string);
}
m_list->DetachNode(this);
}
}
@ -348,6 +353,8 @@ void wxListBase::DoDeleteNode(wxNodeBase *node)
node->DeleteData();
}
// so that the node knows that it's being deleted by the list
node->m_list = NULL;
delete node;
}

View File

@ -559,17 +559,33 @@ bool wxResourceInterpretResources(wxResourceTable& table, wxExprDatabase& db)
return TRUE;
}
static char *g_ValidControlClasses[] = { "wxButton", "wxBitmapButton", "wxMessage",
"wxStaticText", "wxStaticBitmap", "wxText", "wxTextCtrl", "wxMultiText",
"wxListBox", "wxRadioBox", "wxRadioButton", "wxCheckBox", "wxBitmapCheckBox",
"wxGroupBox", "wxStaticBox", "wxSlider", "wxGauge", "wxScrollBar",
"wxChoice", "wxComboBox" } ;
static int g_ValidControlClassesCount = sizeof(g_ValidControlClasses) / sizeof(char *) ;
static const char *g_ValidControlClasses[] =
{
"wxButton",
"wxBitmapButton",
"wxMessage",
"wxStaticText",
"wxStaticBitmap",
"wxText",
"wxTextCtrl",
"wxMultiText",
"wxListBox",
"wxRadioBox",
"wxRadioButton",
"wxCheckBox",
"wxBitmapCheckBox",
"wxGroupBox",
"wxStaticBox",
"wxSlider",
"wxGauge",
"wxScrollBar",
"wxChoice",
"wxComboBox"
};
static bool wxIsValidControlClass(const wxString& c)
{
int i;
for ( i = 0; i < g_ValidControlClassesCount; i++)
for ( size_t i = 0; i < WXSIZEOF(g_ValidControlClasses); i++ )
{
if ( c == g_ValidControlClasses[i] )
return TRUE;

View File

@ -17,7 +17,7 @@
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
@ -39,11 +39,11 @@
#endif
#if wxUSE_OWNER_DRAWN
#include "wx/ownerdrw.h"
#include "wx/ownerdrw.h"
#endif
#if wxUSE_DRAG_AND_DROP
#include "wx/msw/ole/droptgt.h"
#include "wx/msw/ole/droptgt.h"
#endif
#include "wx/menuitem.h"
@ -82,7 +82,7 @@
#endif
#ifdef __WXDEBUG__
const char *wxGetMessageName(int message);
const char *wxGetMessageName(int message);
#endif //__WXDEBUG__
#define WINDOW_MARGIN 3 // This defines sensitivity of Leave events
@ -841,7 +841,6 @@ LRESULT APIENTRY _EXPORT wxWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARA
wxWndHook = NULL;
wnd->m_hWnd = (WXHWND) hWnd;
}
// wxDebugMsg("hWnd = %d, m_hWnd = %d, msg = %d\n", hWnd, m_hWnd, message);
// Stop right here if we don't have a valid handle
// in our wxWnd object.
@ -866,17 +865,16 @@ LRESULT APIENTRY _EXPORT wxWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARA
// Should probably have a test for 'genuine' NT
#if defined(__WIN32__)
#define DIMENSION_TYPE short
#define DIMENSION_TYPE short
#else
#define DIMENSION_TYPE int
#define DIMENSION_TYPE int
#endif
// Main Windows 3 window proc
long wxWindow::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
{
wxASSERT( m_lastMsg == message &&
m_lastWParam == wParam &&
m_lastLParam == lParam );
m_lastWParam == wParam && m_lastLParam == lParam );
#ifdef __WXDEBUG__
wxLogTrace(wxTraceMessages, "Processing %s(%lx, %lx)",