minor changes a bit everywhere + a small wxLog change (Enable()/IsEnabled()

added) + wxTimer member vars are made protected again (but a friend decl
added for the callback)


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@831 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
1998-10-14 23:53:24 +00:00
parent 2d0a075d90
commit c085e33398
22 changed files with 457 additions and 543 deletions

View File

@@ -75,13 +75,20 @@ public:
// ctor
wxLog();
// these functions allow to completely disable all log messages
// is logging disabled now?
static bool IsEnabled() { return ms_doLog; }
// change the flag state, return the previous one
static bool EnableLogging(bool doIt = TRUE)
{ bool doLogOld = ms_doLog; ms_doLog = doIt; return doLogOld; }
// sink function
static void OnLog(wxLogLevel level, const char *szString)
{
wxLog *pLogger = GetActiveTarget();
if ( pLogger )
{
pLogger->DoLog(level, szString);
if ( IsEnabled() ) {
wxLog *pLogger = GetActiveTarget();
if ( pLogger )
pLogger->DoLog(level, szString);
}
}
@@ -99,10 +106,8 @@ public:
// get current log target, will call wxApp::CreateLogTarget() to create one
// if none exists
static wxLog *GetActiveTarget();
// change log target, pLogger = NULL disables logging. if bNoFlashOld is true,
// the old log target isn't flashed which might lead to loss of messages!
// returns the previous log target
static wxLog *SetActiveTarget(wxLog *pLogger, bool bNoFlashOld = FALSE);
// change log target, pLogger may be NULL
static wxLog *SetActiveTarget(wxLog *pLogger);
// functions controlling the default wxLog behaviour
// verbose mode is activated by standard command-line '-verbose' option
@@ -151,6 +156,7 @@ private:
// static variables
// ----------------
static wxLog *ms_pLogger; // currently active log sink
static bool ms_doLog; // FALSE => all logging disabled
static bool ms_bAutoCreate; // automatically create new log targets?
static wxTraceMask ms_ulTraceMask; // controls wxLogTrace behaviour
};
@@ -293,12 +299,11 @@ void Foo() {
class WXDLLEXPORT wxLogNull
{
public:
// ctor saves old log target, dtor restores it
wxLogNull() { m_pPrevLogger = wxLog::SetActiveTarget((wxLog *)NULL, TRUE); }
~wxLogNull() { (void)wxLog::SetActiveTarget(m_pPrevLogger); }
wxLogNull() { m_flagOld = wxLog::EnableLogging(FALSE); }
~wxLogNull() { (void)wxLog::EnableLogging(m_flagOld); }
private:
wxLog *m_pPrevLogger; // old log target
bool m_flagOld; // the previous value of the wxLog::ms_doLog
};
// ============================================================================

View File

@@ -57,7 +57,7 @@ class WXDLLEXPORT wxApp: public wxEvtHandler
void OnEndSession(wxCloseEvent& event);
void OnQueryEndSession(wxCloseEvent& event);
// Generic
// Generic
virtual bool OnInit() { return FALSE; };
// No specific tasks to do here.
@@ -67,6 +67,10 @@ class WXDLLEXPORT wxApp: public wxEvtHandler
virtual int OnRun() { return MainLoop(); };
virtual int OnExit() { return 0; }
// called when a fatal exception occurs, this function should take care not
// to do anything which might provoke a nested exception!
virtual void OnFatalException() { }
inline void SetPrintMode(int mode) { m_printMode = mode; }
inline int GetPrintMode() const { return m_printMode; }

View File

@@ -6,7 +6,7 @@
// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_PRIVATE_H_
@@ -52,18 +52,18 @@ wxFont WXDLLEXPORT wxCreateFontFromLogFont(LOGFONT *logFont); // , bool createNe
# endif
#endif
#if !defined(APIENTRY) // NT defines APIENTRY, 3.x not
#if !defined(APIENTRY) // NT defines APIENTRY, 3.x not
#define APIENTRY FAR PASCAL
#endif
#ifdef __WIN32__
#define _EXPORT /**/
#else
#define _EXPORT _export
typedef signed short int SHORT ;
#endif
#if !defined(__WIN32__) // 3.x uses FARPROC for dialogs
#if !defined(__WIN32__) // 3.x uses FARPROC for dialogs
#define DLGPROC FARPROC
#endif
@@ -104,7 +104,7 @@ VOID WINAPI ibAdjustWindowRect( HWND hWnd, LPRECT lprc ) ;
* Decide what window classes we're going to use
* for this combination of CTl3D/FAFA settings
*/
#define STATIC_CLASS "STATIC"
#define STATIC_FLAGS (SS_LEFT|WS_CHILD|WS_VISIBLE)
#define CHECK_CLASS "BUTTON"
@@ -151,8 +151,15 @@ void WXDLLEXPORT wxAddControlHandle(WXHWND hWnd, wxWindow *item);
// Safely get the window text (i.e. without using fixed size buffer)
extern wxString WXDLLEXPORT wxGetWindowText(WXHWND hWnd);
// Does this window style specify any border?
inline bool WXDLLEXPORT wxStyleHasBorder(long style)
{
return (style & (wxSIMPLE_BORDER | wxRAISED_BORDER |
wxSUNKEN_BORDER | wxDOUBLE_BORDER)) != 0;
}
#if !defined(__WIN32__) && !defined(WS_EX_CLIENTEDGE)
#define WS_EX_CLIENTEDGE 0
#define WS_EX_CLIENTEDGE 0
#endif
#endif

View File

@@ -203,40 +203,12 @@ private:
wxRegKey(const wxRegKey& key); // not implemented
wxRegKey& operator=(const wxRegKey& key); // not implemented
WXHKEY m_hKey, // our handle
WXHKEY m_hKey, // our handle
m_hRootKey; // handle of the top key (i.e. StdKey)
wxString m_strKey; // key name (relative to m_hRootKey)
MUTABLE long m_dwLastError; // last error (0 if none)
};
// ----------------------------------------------------------------------------
// high level functions working with the registry
// ----------------------------------------------------------------------------
// file extensions and MIME types
// ------------------------------
// Look for and return the extension (with leading '.') which corresponds to
// MIME type strMimeType in pExt.
//
// Return value: true if MIME type was found, false otherwise
bool GetExtensionFromMimeType(wxString *pExt, const wxString& strMimeType);
// Look for MIME type of the given extension, return TRUE if found.
bool GetMimeTypeFromExtension(wxString *pMimeType, const wxString& strExt);
// Get file type from extension (it's not the same thing: for example, for
// the extension .txt the default file type is txtfile), return FALSE if not
// found.
bool GetFileTypeFromExtension(wxString *pFileType, const wxString& strExt);
// Get the default icon from file type
class wxIcon;
bool GetFileTypeIcon(wxIcon *pIcon, const wxString& strFileType);
// Get the description of files of this type
bool GetFileTypeDescription(wxString *pDesc, const wxString& strFileType);
#endif //_REGISTRY_H

View File

@@ -79,7 +79,7 @@
#define wxUSE_SCROLLBAR 1
// Define 1 to compile contributed wxScrollBar class
#define wxUSE_XPM_IN_X 1
#define wxUSE_XPM_IN_MSW 0
#define wxUSE_XPM_IN_MSW 1
// Define 1 to support the XPM package in wxBitmap,
// separated by platform. If 1, you must link in
// the XPM library to your applications.
@@ -90,7 +90,7 @@
#define wxUSE_IMAGE_LOADING_IN_MSW 1
// Use dynamic DIB loading/saving code in utils/dib under MSW.
#define wxUSE_RESOURCE_LOADING_IN_MSW 0
#define wxUSE_RESOURCE_LOADING_IN_MSW 1
// Use dynamic icon/cursor loading/saving code
// under MSW.
#define wxUSE_WX_RESOURCES 1
@@ -114,12 +114,12 @@
#define wxUSE_DYNAMIC_CLASSES 1
// If 1, enables provision of run-time type information.
// NOW MANDATORY: don't change.
#define wxUSE_MEMORY_TRACING 1
#define wxUSE_MEMORY_TRACING 0
// If 1, enables debugging versions of wxObject::new and
// wxObject::delete *IF* WXDEBUG is also defined.
// WARNING: this code may not work with all architectures, especially
// if alignment is an issue.
#define wxUSE_DEBUG_CONTEXT 1
#define wxUSE_DEBUG_CONTEXT 0
// If 1, enables wxDebugContext, for
// writing error messages to file, etc.
// If WXDEBUG is not defined, will still use
@@ -128,7 +128,7 @@
// since you may well need to output
// an error log in a production
// version (or non-debugging beta)
#define wxUSE_GLOBAL_MEMORY_OPERATORS 1
#define wxUSE_GLOBAL_MEMORY_OPERATORS 0
// In debug mode, cause new and delete to be redefined globally.
// If this causes problems (e.g. link errors), set this to 0.
@@ -139,7 +139,7 @@
#define wxUSE_C_MAIN 0
// Set to 1 to use main.c instead of main.cpp (UNIX only)
#define wxUSE_ODBC 1
#define wxUSE_ODBC 0
// Define 1 to use ODBC classes
#define wxUSE_IOSTREAMH 1
@@ -199,7 +199,7 @@
#define wxUSE_PENWINDOWS 0
// Set to 1 to use PenWindows
#define wxUSE_OWNER_DRAWN 0
#define wxUSE_OWNER_DRAWN 1
// Owner-drawn menus and listboxes
#define wxUSE_NATIVE_STATUSBAR 1

View File

@@ -20,6 +20,8 @@
class WXDLLEXPORT wxTimer : public wxObject
{
friend void wxProcessTimer(wxTimer& timer);
public:
wxTimer();
~wxTimer();
@@ -34,7 +36,7 @@ public:
int Interval() const { return milli; };
bool OneShot() const { return oneShot; }
public:
protected:
bool oneShot ;
int milli ;
int lastMilli ;

View File

@@ -96,9 +96,9 @@ WXCURSOR_BLANK CURSOR DISCARDABLE "wx/msw/blank.cur"
// Default Icons
//
wxDEFAULT_FRAME ICON "wx/msw/std.ico"
wxDEFAULT_MDIPARENTFRAME ICON "wx/msw/mdi.ico"
wxDEFAULT_MDICHILDFRAME ICON "wx/msw/child.ico"
//wxDEFAULT_FRAME ICON "wx/msw/std.ico"
//wxDEFAULT_MDIPARENTFRAME ICON "wx/msw/mdi.ico"
//wxDEFAULT_MDICHILDFRAME ICON "wx/msw/child.ico"
//////////////////////////////////////////////////////////////////////////////
//