wxWindows 2.0 for Windows Change Log
------------------------------------
+Alpha 17, November 22nd 1998
+----------------------------
+
+- More documentation updates, especially for
+ wxLayoutWindow classes and debugging facilities.
+- Changed wxDebugContext to use wxDebugLog instead
+ of wxTrace.
+- Now supports VC++ 6.0, and hopefully BC++ 5.0.
+ However, DLL support may be broken for BC++ since
+ VC++ 6 required changing of WXDLLEXPORT keyword
+ position.
+- Numerous miscellaneous changes.
+
Alpha 16, September 8th 1998
----------------------------
# ifdef WXMAKINGDLL
# define WXDLLEXPORT __declspec( dllexport )
# define WXDLLEXPORT_DATA(type) __declspec( dllexport ) type
-# define WXDLLEXPORT_CTORFN __declspec( dllexport )
+# define WXDLLEXPORT_CTORFN // __declspec( dllexport )
# elif defined(WXUSINGDLL)
# define WXDLLEXPORT __declspec( dllimport )
# define WXDLLEXPORT_DATA(type) __declspec( dllimport ) type
// ----------------------------------------------------------------------------
// functions
// ----------------------------------------------------------------------------
-bool WXDLLEXPORT wxFileExists(const wxString& filename);
+WXDLLEXPORT bool wxFileExists(const wxString& filename);
#define FileExists wxFileExists
// does the path exist? (may have or not '/' or '\\' at the end)
-bool WXDLLEXPORT wxPathExists(const char *pszPathName);
+WXDLLEXPORT bool wxPathExists(const char *pszPathName);
#define wxDirExists wxPathExists
#define DirExists wxDirExists
-bool WXDLLEXPORT wxIsAbsolutePath(const wxString& filename);
+WXDLLEXPORT bool wxIsAbsolutePath(const wxString& filename);
#define IsAbsolutePath wxIsAbsolutePath
// Get filename
-char* WXDLLEXPORT wxFileNameFromPath(char *path);
-wxString WXDLLEXPORT wxFileNameFromPath(const wxString& path);
+WXDLLEXPORT char* wxFileNameFromPath(char *path);
+WXDLLEXPORT wxString wxFileNameFromPath(const wxString& path);
#define FileNameFromPath wxFileNameFromPath
// Get directory
-char* WXDLLEXPORT wxPathOnly(char *path);
-wxString WXDLLEXPORT wxPathOnly(const wxString& path);
+WXDLLEXPORT char* wxPathOnly(char *path);
+WXDLLEXPORT wxString wxPathOnly(const wxString& path);
#define PathOnly wxPathOnly
// wxString version
-wxString WXDLLEXPORT wxRealPath(const wxString& path);
+WXDLLEXPORT wxString wxRealPath(const wxString& path);
-void WXDLLEXPORT wxDos2UnixFilename(char *s);
+WXDLLEXPORT void wxDos2UnixFilename(char *s);
#define Dos2UnixFilename wxDos2UnixFilename
-void WXDLLEXPORT wxUnix2DosFilename(char *s);
+WXDLLEXPORT void wxUnix2DosFilename(char *s);
#define Unix2DosFilename wxUnix2DosFilename
// Strip the extension, in situ
-void WXDLLEXPORT wxStripExtension(char *buffer);
-void WXDLLEXPORT wxStripExtension(wxString& buffer);
+WXDLLEXPORT void wxStripExtension(char *buffer);
+WXDLLEXPORT void wxStripExtension(wxString& buffer);
// Get a temporary filename, opening and closing the file.
-char* WXDLLEXPORT wxGetTempFileName(const wxString& prefix, char *buf = (char *) NULL);
+WXDLLEXPORT char* wxGetTempFileName(const wxString& prefix, char *buf = (char *) NULL);
// Expand file name (~/ and ${OPENWINHOME}/ stuff)
-char* WXDLLEXPORT wxExpandPath(char *dest, const char *path);
+WXDLLEXPORT char* wxExpandPath(char *dest, const char *path);
// Contract w.r.t environment (</usr/openwin/lib, OPENWHOME> -> ${OPENWINHOME}/lib)
// and make (if under the home tree) relative to home
// [caller must copy-- volatile]
-char* WXDLLEXPORT wxContractPath (const wxString& filename,
+WXDLLEXPORT char* wxContractPath (const wxString& filename,
const wxString& envname = "", const wxString& user = "");
// Destructive removal of /./ and /../ stuff
-char* WXDLLEXPORT wxRealPath(char *path);
+WXDLLEXPORT char* wxRealPath(char *path);
// Allocate a copy of the full absolute path
-char* WXDLLEXPORT wxCopyAbsolutePath(const wxString& path);
+WXDLLEXPORT char* wxCopyAbsolutePath(const wxString& path);
// Get first file name matching given wild card.
// Flags are reserved for future use.
#define wxFILE 1
#define wxDIR 2
-char* WXDLLEXPORT wxFindFirstFile(const char *spec, int flags = wxFILE);
-char* WXDLLEXPORT wxFindNextFile(void);
+WXDLLEXPORT char* wxFindFirstFile(const char *spec, int flags = wxFILE);
+WXDLLEXPORT char* wxFindNextFile(void);
// Does the pattern contain wildcards?
-bool WXDLLEXPORT wxIsWild(const wxString& pattern);
+WXDLLEXPORT bool wxIsWild(const wxString& pattern);
// Does the pattern match the text (usually a filename)?
// If dot_special is TRUE, doesn't match * against . (eliminating
// `hidden' dot files)
-bool WXDLLEXPORT wxMatchWild(const wxString& pattern, const wxString& text, bool dot_special = TRUE);
+WXDLLEXPORT bool wxMatchWild(const wxString& pattern, const wxString& text, bool dot_special = TRUE);
// Concatenate two files to form third
-bool WXDLLEXPORT wxConcatFiles(const wxString& file1, const wxString& file2, const wxString& file3);
+WXDLLEXPORT bool wxConcatFiles(const wxString& file1, const wxString& file2, const wxString& file3);
// Copy file1 to file2
-bool WXDLLEXPORT wxCopyFile(const wxString& file1, const wxString& file2);
+WXDLLEXPORT bool wxCopyFile(const wxString& file1, const wxString& file2);
// Remove file
-bool WXDLLEXPORT wxRemoveFile(const wxString& file);
+WXDLLEXPORT bool wxRemoveFile(const wxString& file);
// Rename file
-bool WXDLLEXPORT wxRenameFile(const wxString& file1, const wxString& file2);
+WXDLLEXPORT bool wxRenameFile(const wxString& file1, const wxString& file2);
// Get current working directory.
// If buf is NULL, allocates space using new, else
// copies into buf.
// IMPORTANT NOTE getcwd is know not to work under some releases
// of Win32s 1.3, according to MS release notes!
-char* WXDLLEXPORT wxGetWorkingDirectory(char *buf = (char *) NULL, int sz = 1000);
+WXDLLEXPORT char* wxGetWorkingDirectory(char *buf = (char *) NULL, int sz = 1000);
// Set working directory
-bool WXDLLEXPORT wxSetWorkingDirectory(const wxString& d);
+WXDLLEXPORT bool wxSetWorkingDirectory(const wxString& d);
// Make directory
-bool WXDLLEXPORT wxMkdir(const wxString& dir);
+WXDLLEXPORT bool wxMkdir(const wxString& dir);
// Remove directory. Flags reserved for future use.
-bool WXDLLEXPORT wxRmdir(const wxString& dir, int flags = 0);
+WXDLLEXPORT bool wxRmdir(const wxString& dir, int flags = 0);
// separators in file names
#define FILE_SEP_EXT '.'
{ return c == FILE_SEP_PATH_DOS || c == FILE_SEP_PATH_UNIX; }
// does the string ends with path separator?
-bool WXDLLEXPORT wxEndsWithPathSeparator(const char *pszFileName);
+WXDLLEXPORT bool wxEndsWithPathSeparator(const char *pszFileName);
// split the full path into path (including drive for DOS), name and extension
// (understands both '/' and '\\')
-void WXDLLEXPORT wxSplitPath(const char *pszFileName,
+WXDLLEXPORT void wxSplitPath(const char *pszFileName,
wxString *pstrPath,
wxString *pstrName,
wxString *pstrExt);
// find a file in a list of directories, returns false if not found
-bool WXDLLEXPORT wxFindFileInPath(wxString *pStr, const char *pszPath, const char *pszFile);
+WXDLLEXPORT bool wxFindFileInPath(wxString *pStr, const char *pszPath, const char *pszFile);
// ----------------------------------------------------------------------------
// classes
char* m_clientData;
};
-wxString WXDLLEXPORT wxGetSingleChoice(const wxString& message, const wxString& caption,
+WXDLLEXPORT wxString wxGetSingleChoice(const wxString& message, const wxString& caption,
int n, const wxString *choices, wxWindow *parent = (wxWindow *) NULL,
int x = -1, int y = -1, bool centre = TRUE,
int width = wxCHOICE_WIDTH, int height = wxCHOICE_HEIGHT);
-wxString WXDLLEXPORT wxGetSingleChoice(const wxString& message, const wxString& caption,
+WXDLLEXPORT wxString wxGetSingleChoice(const wxString& message, const wxString& caption,
int n, char *choices[], wxWindow *parent = (wxWindow *) NULL,
int x = -1, int y = -1, bool centre = TRUE,
int width = wxCHOICE_WIDTH, int height = wxCHOICE_HEIGHT);
// Same as above but gets position in list of strings, instead of string,
// or -1 if no selection
-int WXDLLEXPORT wxGetSingleChoiceIndex(const wxString& message, const wxString& caption,
+WXDLLEXPORT int wxGetSingleChoiceIndex(const wxString& message, const wxString& caption,
int n, const wxString *choices, wxWindow *parent = (wxWindow *) NULL,
int x = -1, int y = -1, bool centre = TRUE,
int width = wxCHOICE_WIDTH, int height = wxCHOICE_HEIGHT);
-int WXDLLEXPORT wxGetSingleChoiceIndex(const wxString& message, const wxString& caption,
+WXDLLEXPORT int wxGetSingleChoiceIndex(const wxString& message, const wxString& caption,
int n, char *choices[], wxWindow *parent = (wxWindow *) NULL,
int x = -1, int y = -1, bool centre = TRUE,
int width = wxCHOICE_WIDTH, int height = wxCHOICE_HEIGHT);
// Return client data instead
-char* WXDLLEXPORT wxGetSingleChoiceData(const wxString& message, const wxString& caption,
+WXDLLEXPORT char* wxGetSingleChoiceData(const wxString& message, const wxString& caption,
int n, const wxString *choices, char **client_data,
wxWindow *parent = (wxWindow *) NULL, int x = -1, int y = -1,
bool centre = TRUE,
int width = wxCHOICE_WIDTH, int height = wxCHOICE_HEIGHT);
-char* WXDLLEXPORT wxGetSingleChoiceData(const wxString& message, const wxString& caption,
+WXDLLEXPORT char* wxGetSingleChoiceData(const wxString& message, const wxString& caption,
int n, char *choices[], char **client_data,
wxWindow *parent = (wxWindow *) NULL, int x = -1, int y = -1,
bool centre = TRUE,
int width = wxCHOICE_WIDTH, int height = wxCHOICE_HEIGHT);
/*
-int WXDLLEXPORT wxGetMultipleChoice(const wxString& message, const wxString& caption,
+WXDLLEXPORT int wxGetMultipleChoice(const wxString& message, const wxString& caption,
int n, const wxString *choices,
int nsel, int * selection,
wxWindow *parent = NULL, int x = -1 , int y = -1, bool centre = TRUE,
// ----------------------------------------------------------------------------
// global functions
// ----------------------------------------------------------------------------
-wxLocale* WXDLLEXPORT wxGetLocale();
+WXDLLEXPORT wxLocale* wxGetLocale();
// get the translation of the string in the current locale
-inline WXDLLEXPORT const char *wxGetTranslation(const char *sz)
+inline const char *wxGetTranslation(const char *sz)
{
wxLocale *pLoc = wxGetLocale();
return pLoc == (wxLocale *) NULL ? sz : pLoc->GetString(sz);
// ----------------------------------------------------------------------------
// return the last system error code
-unsigned long WXDLLEXPORT wxSysErrorCode();
+WXDLLEXPORT unsigned long wxSysErrorCode();
// return the error message for given (or last if 0) error code
-const char* WXDLLEXPORT wxSysErrorMsg(unsigned long nErrCode = 0);
+WXDLLEXPORT const char* wxSysErrorMsg(unsigned long nErrCode = 0);
// ----------------------------------------------------------------------------
// debug only logging functions: use them with API name and error code
void * operator new (size_t size, char * fileName, int lineNum);
void operator delete (void * buf);
-// VC++ 6.0
-#if _MSC_VER >= 1200
-void operator delete(void *buf, char*, int);
-#endif
-
#if !( defined (_MSC_VER) && (_MSC_VER <= 1020) )
void * operator new[] (size_t size, char * fileName, int lineNum);
void operator delete[] (void * buf);
#endif
+// VC++ 6.0
+#if _MSC_VER >= 1200
+void operator delete(void *buf, char*, int);
+void operator delete[](void *buf, char*, int);
+#endif
+
#endif
#endif
#include "wx/list.h"
-bool WXDLLEXPORT wxOpenClipboard(void);
-bool WXDLLEXPORT wxClipboardOpen(void);
-bool WXDLLEXPORT wxCloseClipboard(void);
-bool WXDLLEXPORT wxEmptyClipboard(void);
-bool WXDLLEXPORT wxIsClipboardFormatAvailable(int dataFormat);
-bool WXDLLEXPORT wxSetClipboardData(int dataFormat, wxObject *obj, int width = 0, int height = 0);
-wxObject* WXDLLEXPORT wxGetClipboardData(int dataFormat, long *len = NULL);
-int WXDLLEXPORT wxEnumClipboardFormats(int dataFormat);
-int WXDLLEXPORT wxRegisterClipboardFormat(char *formatName);
-bool WXDLLEXPORT wxGetClipboardFormatName(int dataFormat, char *formatName, int maxCount);
+WXDLLEXPORT bool wxOpenClipboard(void);
+WXDLLEXPORT bool wxClipboardOpen(void);
+WXDLLEXPORT bool wxCloseClipboard(void);
+WXDLLEXPORT bool wxEmptyClipboard(void);
+WXDLLEXPORT bool wxIsClipboardFormatAvailable(int dataFormat);
+WXDLLEXPORT bool wxSetClipboardData(int dataFormat, wxObject *obj, int width = 0, int height = 0);
+WXDLLEXPORT wxObject* wxGetClipboardData(int dataFormat, long *len = NULL);
+WXDLLEXPORT int wxEnumClipboardFormats(int dataFormat);
+WXDLLEXPORT int wxRegisterClipboardFormat(char *formatName);
+WXDLLEXPORT bool wxGetClipboardFormatName(int dataFormat, char *formatName, int maxCount);
/* The following is Matthew Flatt's implementation of the MSW
* side of generic clipboard functionality.
};
/* Initialize wxTheClipboard. Can be called repeatedly */
-void WXDLLEXPORT wxInitClipboard(void);
+WXDLLEXPORT void wxInitClipboard(void);
/* The clipboard */
WXDLLEXPORT_DATA(extern wxClipboard*) wxTheClipboard;
#define wxFILE_MUST_EXIST 0x0010
// File selector - backward compatibility
-char* WXDLLEXPORT wxFileSelector(const char *message = wxFileSelectorPromptStr, const char *default_path = NULL,
+WXDLLEXPORT char* wxFileSelector(const char *message = wxFileSelectorPromptStr, const char *default_path = NULL,
const char *default_filename = NULL, const char *default_extension = NULL,
const char *wildcard = wxFileSelectorDefaultWildcardStr, int flags = 0,
wxWindow *parent = NULL, int x = -1, int y = -1);
// An extended version of wxFileSelector
-char* WXDLLEXPORT wxFileSelectorEx(const char *message = wxFileSelectorPromptStr, const char *default_path = NULL,
+WXDLLEXPORT char* wxFileSelectorEx(const char *message = wxFileSelectorPromptStr, const char *default_path = NULL,
const char *default_filename = NULL, int *indexDefaultExtension = NULL,
const char *wildcard = wxFileSelectorDefaultWildcardStr, int flags = 0,
wxWindow *parent = NULL, int x = -1, int y = -1);
// Generic file load dialog
-char* WXDLLEXPORT wxLoadFileSelector(const char *what, const char *extension, const char *default_name = NULL, wxWindow *parent = NULL);
+WXDLLEXPORT char* wxLoadFileSelector(const char *what, const char *extension, const char *default_name = NULL, wxWindow *parent = NULL);
// Generic file save dialog
-char* WXDLLEXPORT wxSaveFileSelector(const char *what, const char *extension, const char *default_name = NULL, wxWindow *parent = NULL);
+WXDLLEXPORT char* wxSaveFileSelector(const char *what, const char *extension, const char *default_name = NULL, wxWindow *parent = NULL);
#endif
// _WX_FILEDLG_H_
// define the array of list box items
#include <wx/dynarray.h>
+
+ #undef WXDLLEXPORTLOCAL
+ #define WXDLLEXPORTLOCAL WXDLLEXPORT
WX_DEFINE_ARRAY(wxOwnerDrawn *, wxListBoxItemsArray);
+ #undef WXDLLEXPORTLOCAL
+ #define WXDLLEXPORTLOCAL
+
#endif
// forward decl for GetSelections()
// array of notebook pages
typedef wxWindow WXDLLEXPORT wxNotebookPage; // so far, any window can be a page
+
+#undef WXDLLEXPORTLOCAL
+#define WXDLLEXPORTLOCAL WXDLLEXPORT
+
WX_DEFINE_ARRAY(wxNotebookPage *, wxArrayPages);
+#undef WXDLLEXPORTLOCAL
+#define WXDLLEXPORTLOCAL
+
// ----------------------------------------------------------------------------
// notebook events
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxFont ;
-void WXDLLEXPORT wxGetCharSize(WXHWND wnd, int *x, int *y,wxFont *the_font);
-void WXDLLEXPORT wxSliderEvent(WXHWND control, WXWORD wParam, WXWORD pos);
-wxWindow* WXDLLEXPORT wxFindWinFromHandle(WXHWND hWnd);
-void WXDLLEXPORT wxScrollBarEvent(WXHWND hbar, WXWORD wParam, WXWORD pos);
+WXDLLEXPORT void wxGetCharSize(WXHWND wnd, int *x, int *y,wxFont *the_font);
+WXDLLEXPORT void wxSliderEvent(WXHWND control, WXWORD wParam, WXWORD pos);
+WXDLLEXPORT wxWindow* wxFindWinFromHandle(WXHWND hWnd);
+WXDLLEXPORT void wxScrollBarEvent(WXHWND hbar, WXWORD wParam, WXWORD pos);
WXDLLEXPORT_DATA(extern HICON) wxSTD_FRAME_ICON;
WXDLLEXPORT_DATA(extern HICON) wxSTD_MDIPARENTFRAME_ICON;
WXDLLEXPORT_DATA(extern HICON) wxDEFAULT_MDICHILDFRAME_ICON;
WXDLLEXPORT_DATA(extern HFONT) wxSTATUS_LINE_FONT;
-extern HINSTANCE WXDLLEXPORT wxGetInstance();
-void WXDLLEXPORT wxFillLogFont(LOGFONT *logFont, wxFont *font);
-wxFont WXDLLEXPORT wxCreateFontFromLogFont(LOGFONT *logFont); // , bool createNew = TRUE);
+WXDLLEXPORT HINSTANCE wxGetInstance();
+WXDLLEXPORT void wxFillLogFont(LOGFONT *logFont, wxFont *font);
+WXDLLEXPORT wxFont wxCreateFontFromLogFont(LOGFONT *logFont); // , bool createNew = TRUE);
#ifdef __GNUWIN32__
# define CASTWNDPROC (long unsigned)
#endif
#if wxUSE_PENWIN
-void WXDLLEXPORT wxRegisterPenWin(void);
-void WXDLLEXPORT wxCleanUpPenWin(void);
-void WXDLLEXPORT wxEnablePenAppHooks (bool hook);
+WXDLLEXPORT void wxRegisterPenWin(void);
+WXDLLEXPORT void wxCleanUpPenWin(void);
+WXDLLEXPORT void wxEnablePenAppHooks (bool hook);
#endif
#if wxUSE_ITSY_BITSY
wxSubclassedGenericControlProc(WXHWND hWnd, WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
// Find maximum size of window/rectangle
-extern void WXDLLEXPORT wxFindMaxSize(WXHWND hwnd, RECT *rect);
+WXDLLEXPORT extern void wxFindMaxSize(WXHWND hwnd, RECT *rect);
// List of scrollbar controls
WXDLLEXPORT_DATA(extern wxList) wxScrollBarList;
WXDLLEXPORT_DATA(extern char*) wxBuffer;
WXDLLEXPORT_DATA(extern HINSTANCE) wxhInstance;
-wxWindow* WXDLLEXPORT wxFindControlFromHandle(WXHWND hWnd);
-void WXDLLEXPORT wxAddControlHandle(WXHWND hWnd, wxWindow *item);
+WXDLLEXPORT wxWindow* wxFindControlFromHandle(WXHWND hWnd);
+WXDLLEXPORT void wxAddControlHandle(WXHWND hWnd, wxWindow *item);
// Safely get the window text (i.e. without using fixed size buffer)
-extern wxString WXDLLEXPORT wxGetWindowText(WXHWND hWnd);
+WXDLLEXPORT extern wxString wxGetWindowText(WXHWND hWnd);
// Does this window style specify any border?
-inline bool WXDLLEXPORT wxStyleHasBorder(long style)
+inline bool wxStyleHasBorder(long style)
{
return (style & (wxSIMPLE_BORDER | wxRAISED_BORDER |
wxSUNKEN_BORDER | wxDOUBLE_BORDER)) != 0;
#define wxUSE_AUTOTRANS 1
// Define wxTString
-#define wxUSE_POSTSCRIPT 1
+#define wxUSE_POSTSCRIPT 0
// 0 for no PostScript device context
#define wxUSE_AFM_FOR_POSTSCRIPT 0
// 1 to use font metric files in GetTextExtent
inline bool wxWindow::IsBeingDeleted(void) { return m_isBeingDeleted; }
// Window specific (so far)
-wxWindow* WXDLLEXPORT wxGetActiveWindow(void);
+WXDLLEXPORT wxWindow* wxGetActiveWindow(void);
WXDLLEXPORT_DATA(extern wxList) wxTopLevelWindows;
-int WXDLLEXPORT wxCharCodeMSWToWX(int keySym);
-int WXDLLEXPORT wxCharCodeWXToMSW(int id, bool *IsVirtual);
+WXDLLEXPORT int wxCharCodeMSWToWX(int keySym);
+WXDLLEXPORT int wxCharCodeWXToMSW(int id, bool *IsVirtual);
// Allocates control ids
-int WXDLLEXPORT NewControlId(void);
+WXDLLEXPORT int NewControlId(void);
#endif
// _WX_WINDOW_H_
static wxHashTable* sm_classTable;
};
-wxObject* WXDLLEXPORT wxCreateDynamicObject(const char *name);
+WXDLLEXPORT wxObject* wxCreateDynamicObject(const char *name);
#ifdef wxUSE_SERIAL
-wxObject* WXDLLEXPORT wxCreateStoredObject( wxInputStream& stream );
+WXDLLEXPORT wxObject* wxCreateStoredObject( wxInputStream& stream );
#endif
#define DECLARE_DYNAMIC_CLASS(name) \
};// ps_action = PS_PREVIEW;
// PostScript printer settings
-void WXDLLEXPORT wxSetPrinterCommand(const char *cmd);
-void WXDLLEXPORT wxSetPrintPreviewCommand(const char *cmd);
-void WXDLLEXPORT wxSetPrinterOptions(const char *flags);
-void WXDLLEXPORT wxSetPrinterOrientation(int orientation);
-void WXDLLEXPORT wxSetPrinterScaling(double x, double y);
-void WXDLLEXPORT wxSetPrinterTranslation(long x, long y);
-void WXDLLEXPORT wxSetPrinterMode(int mode);
-void WXDLLEXPORT wxSetPrinterFile(const char *f);
-void WXDLLEXPORT wxSetAFMPath(const char *f);
+WXDLLEXPORT void wxSetPrinterCommand(const char *cmd);
+WXDLLEXPORT void wxSetPrintPreviewCommand(const char *cmd);
+WXDLLEXPORT void wxSetPrinterOptions(const char *flags);
+WXDLLEXPORT void wxSetPrinterOrientation(int orientation);
+WXDLLEXPORT void wxSetPrinterScaling(double x, double y);
+WXDLLEXPORT void wxSetPrinterTranslation(long x, long y);
+WXDLLEXPORT void wxSetPrinterMode(int mode);
+WXDLLEXPORT void wxSetPrinterFile(const char *f);
+WXDLLEXPORT void wxSetAFMPath(const char *f);
// Get current values
-char* WXDLLEXPORT wxGetPrinterCommand(void);
-char* WXDLLEXPORT wxGetPrintPreviewCommand(void);
-char* WXDLLEXPORT wxGetPrinterOptions(void);
-int WXDLLEXPORT wxGetPrinterOrientation(void);
-void WXDLLEXPORT wxGetPrinterScaling(double* x, double* y);
-void WXDLLEXPORT wxGetPrinterTranslation(long *x, long *y);
-int WXDLLEXPORT wxGetPrinterMode(void);
-char* WXDLLEXPORT wxGetPrinterFile(void);
-char* WXDLLEXPORT wxGetAFMPath(void);
+WXDLLEXPORT char* wxGetPrinterCommand(void);
+WXDLLEXPORT char* wxGetPrintPreviewCommand(void);
+WXDLLEXPORT char* wxGetPrinterOptions(void);
+WXDLLEXPORT int wxGetPrinterOrientation(void);
+WXDLLEXPORT void wxGetPrinterScaling(double* x, double* y);
+WXDLLEXPORT void wxGetPrinterTranslation(long *x, long *y);
+WXDLLEXPORT int wxGetPrinterMode(void);
+WXDLLEXPORT char* wxGetPrinterFile(void);
+WXDLLEXPORT char* wxGetAFMPath(void);
/*
* PostScript print setup information
void operator=(wxPrintSetupData& data);
};
-extern wxPrintSetupData* WXDLLEXPORT wxThePrintSetupData;
-extern void WXDLLEXPORT wxInitializePrintSetupData(bool init = TRUE);
+WXDLLEXPORT_DATA(extern wxPrintSetupData*) wxThePrintSetupData;
+WXDLLEXPORT extern void wxInitializePrintSetupData(bool init = TRUE);
/*
* Again, this only really needed for non-Windows platforms
virtual void ClearTable();
};
-extern void WXDLLEXPORT wxInitializeResourceSystem();
-extern void WXDLLEXPORT wxCleanUpResourceSystem();
+WXDLLEXPORT extern void wxInitializeResourceSystem();
+WXDLLEXPORT extern void wxCleanUpResourceSystem();
WXDLLEXPORT_DATA(extern wxResourceTable*) wxDefaultResourceTable;
-extern long WXDLLEXPORT wxParseWindowStyle(const wxString& style);
+WXDLLEXPORT extern long wxParseWindowStyle(const wxString& style);
class WXDLLEXPORT wxMenuBar;
class WXDLLEXPORT wxMenu;
class WXDLLEXPORT wxBitmap;
class WXDLLEXPORT wxIcon;
-extern wxBitmap WXDLLEXPORT wxResourceCreateBitmap(const wxString& resource, wxResourceTable *table = (wxResourceTable *) NULL);
-extern wxIcon WXDLLEXPORT wxResourceCreateIcon(const wxString& resource, wxResourceTable *table = (wxResourceTable *) NULL);
-extern wxMenuBar* WXDLLEXPORT wxResourceCreateMenuBar(const wxString& resource, wxResourceTable *table = (wxResourceTable *) NULL, wxMenuBar *menuBar = (wxMenuBar *) NULL);
-extern wxMenu* WXDLLEXPORT wxResourceCreateMenu(const wxString& resource, wxResourceTable *table = (wxResourceTable *) NULL);
-extern bool WXDLLEXPORT wxResourceParseData(const wxString& resource, wxResourceTable *table = (wxResourceTable *) NULL);
-extern bool WXDLLEXPORT wxResourceParseFile(const wxString& filename, wxResourceTable *table = (wxResourceTable *) NULL);
-extern bool WXDLLEXPORT wxResourceParseString(char* s, wxResourceTable *table = (wxResourceTable *) NULL);
-extern void WXDLLEXPORT wxResourceClear(wxResourceTable *table = (wxResourceTable *) NULL);
+WXDLLEXPORT extern wxBitmap wxResourceCreateBitmap(const wxString& resource, wxResourceTable *table = (wxResourceTable *) NULL);
+WXDLLEXPORT extern wxIcon wxResourceCreateIcon(const wxString& resource, wxResourceTable *table = (wxResourceTable *) NULL);
+WXDLLEXPORT extern wxMenuBar* wxResourceCreateMenuBar(const wxString& resource, wxResourceTable *table = (wxResourceTable *) NULL, wxMenuBar *menuBar = (wxMenuBar *) NULL);
+WXDLLEXPORT extern wxMenu* wxResourceCreateMenu(const wxString& resource, wxResourceTable *table = (wxResourceTable *) NULL);
+WXDLLEXPORT extern bool wxResourceParseData(const wxString& resource, wxResourceTable *table = (wxResourceTable *) NULL);
+WXDLLEXPORT extern bool wxResourceParseFile(const wxString& filename, wxResourceTable *table = (wxResourceTable *) NULL);
+WXDLLEXPORT extern bool wxResourceParseString(char* s, wxResourceTable *table = (wxResourceTable *) NULL);
+WXDLLEXPORT extern void wxResourceClear(wxResourceTable *table = (wxResourceTable *) NULL);
// Register XBM/XPM data
-extern bool WXDLLEXPORT wxResourceRegisterBitmapData(const wxString& name, char bits[], int width, int height, wxResourceTable *table = (wxResourceTable *) NULL);
-extern bool WXDLLEXPORT wxResourceRegisterBitmapData(const wxString& name, char **data, wxResourceTable *table = (wxResourceTable *) NULL);
+WXDLLEXPORT extern bool wxResourceRegisterBitmapData(const wxString& name, char bits[], int width, int height, wxResourceTable *table = (wxResourceTable *) NULL);
+WXDLLEXPORT extern bool wxResourceRegisterBitmapData(const wxString& name, char **data, wxResourceTable *table = (wxResourceTable *) NULL);
#define wxResourceRegisterIconData wxResourceRegisterBitmapData
/*
* Resource identifer code: #define storage
*/
-extern bool WXDLLEXPORT wxResourceAddIdentifier(const wxString& name, int value, wxResourceTable *table = (wxResourceTable *) NULL);
-extern int WXDLLEXPORT wxResourceGetIdentifier(const wxString& name, wxResourceTable *table = (wxResourceTable *) NULL);
+WXDLLEXPORT extern bool wxResourceAddIdentifier(const wxString& name, int value, wxResourceTable *table = (wxResourceTable *) NULL);
+WXDLLEXPORT extern int wxResourceGetIdentifier(const wxString& name, wxResourceTable *table = (wxResourceTable *) NULL);
#endif
#endif
typedef wxInputStream& (*__wxInputManip)(wxInputStream&);
typedef wxOutputStream& (*__wxOutputManip)(wxOutputStream&);
-wxOutputStream& WXDLLEXPORT wxEndL(wxOutputStream& o_stream);
+WXDLLEXPORT wxOutputStream& wxEndL(wxOutputStream& o_stream);
// ---------------------------------------------------------------------------
// Stream buffer
# endif
#endif
-istream& WXDLLEXPORT operator>>(istream& is, wxString& str);
+WXDLLEXPORT istream& operator>>(istream& is, wxString& str);
#endif //std::string compatibility
#define wxToLower(C) (((C) >= 'A' && (C) <= 'Z')? (C) - 'A' + 'a': (C))
// Return a string with the current date/time
-wxString WXDLLEXPORT wxNow(void);
+WXDLLEXPORT wxString wxNow(void);
// Make a copy of this string using 'new'
-char* WXDLLEXPORT copystring(const char *s);
+WXDLLEXPORT char* copystring(const char *s);
// Generate a unique ID
-long WXDLLEXPORT wxNewId(void);
+WXDLLEXPORT long wxNewId(void);
#define NewId wxNewId
// Ensure subsequent IDs don't clash with this one
-void WXDLLEXPORT wxRegisterId(long id);
+WXDLLEXPORT void wxRegisterId(long id);
#define RegisterId wxRegisterId
// Return the current ID
-long WXDLLEXPORT wxGetCurrentId(void);
+WXDLLEXPORT long wxGetCurrentId(void);
// Useful buffer
WXDLLEXPORT_DATA(extern char*) wxBuffer;
WXDLLEXPORT_DATA(extern const char*) wxDoubleToStringStr;
// Various conversions
-void WXDLLEXPORT StringToFloat(char *s, float *number);
-char* WXDLLEXPORT FloatToString(float number, const char *fmt = wxFloatToStringStr);
-void WXDLLEXPORT StringToDouble(char *s, double *number);
-char* WXDLLEXPORT DoubleToString(double number, const char *fmt = wxDoubleToStringStr);
-void WXDLLEXPORT StringToInt(char *s, int *number);
-void WXDLLEXPORT StringToLong(char *s, long *number);
-char* WXDLLEXPORT IntToString(int number);
-char* WXDLLEXPORT LongToString(long number);
+WXDLLEXPORT void StringToFloat(char *s, float *number);
+WXDLLEXPORT char* FloatToString(float number, const char *fmt = wxFloatToStringStr);
+WXDLLEXPORT void StringToDouble(char *s, double *number);
+WXDLLEXPORT char* DoubleToString(double number, const char *fmt = wxDoubleToStringStr);
+WXDLLEXPORT void StringToInt(char *s, int *number);
+WXDLLEXPORT void StringToLong(char *s, long *number);
+WXDLLEXPORT char* IntToString(int number);
+WXDLLEXPORT char* LongToString(long number);
// Matches string one within string two regardless of case
-bool WXDLLEXPORT StringMatch(char *one, char *two, bool subString = TRUE, bool exact = FALSE);
+WXDLLEXPORT bool StringMatch(char *one, char *two, bool subString = TRUE, bool exact = FALSE);
// A shorter way of using strcmp
#define wxStringEq(s1, s2) (s1 && s2 && (strcmp(s1, s2) == 0))
// Convert 2-digit hex number to decimal
-int WXDLLEXPORT wxHexToDec(const wxString& buf);
+WXDLLEXPORT int wxHexToDec(const wxString& buf);
// Convert decimal integer to 2-character hex string
-void WXDLLEXPORT wxDecToHex(int dec, char *buf);
-wxString WXDLLEXPORT wxDecToHex(int dec);
+WXDLLEXPORT void wxDecToHex(int dec, char *buf);
+WXDLLEXPORT wxString wxDecToHex(int dec);
// Execute another program. Returns 0 if there was an error, a PID otherwise.
-long WXDLLEXPORT wxExecute(char **argv, bool sync = FALSE,
+WXDLLEXPORT long wxExecute(char **argv, bool sync = FALSE,
wxProcess *process = (wxProcess *) NULL);
-long WXDLLEXPORT wxExecute(const wxString& command, bool sync = FALSE,
+WXDLLEXPORT long wxExecute(const wxString& command, bool sync = FALSE,
wxProcess *process = (wxProcess *) NULL);
#define wxSIGTERM 1
-int WXDLLEXPORT wxKill(long pid, int sig=wxSIGTERM);
+WXDLLEXPORT int wxKill(long pid, int sig=wxSIGTERM);
// Execute a command in an interactive shell window
// If no command then just the shell
-bool WXDLLEXPORT wxShell(const wxString& command = "");
+WXDLLEXPORT bool wxShell(const wxString& command = "");
// Sleep for nSecs seconds under UNIX, do nothing under Windows
-void WXDLLEXPORT wxSleep(int nSecs);
+WXDLLEXPORT void wxSleep(int nSecs);
// Get free memory in bytes, or -1 if cannot determine amount (e.g. on UNIX)
-long WXDLLEXPORT wxGetFreeMemory(void);
+WXDLLEXPORT long wxGetFreeMemory(void);
// Consume all events until no more left
-void WXDLLEXPORT wxFlushEvents(void);
+WXDLLEXPORT void wxFlushEvents(void);
/*
* Network and username functions.
*/
// Get eMail address
-bool WXDLLEXPORT wxGetEmailAddress(char *buf, int maxSize);
+WXDLLEXPORT bool wxGetEmailAddress(char *buf, int maxSize);
// Get hostname.
-bool WXDLLEXPORT wxGetHostName(char *buf, int maxSize);
+WXDLLEXPORT bool wxGetHostName(char *buf, int maxSize);
// Get user ID e.g. jacs
-bool WXDLLEXPORT wxGetUserId(char *buf, int maxSize);
+WXDLLEXPORT bool wxGetUserId(char *buf, int maxSize);
// Get user name e.g. Julian Smart
-bool WXDLLEXPORT wxGetUserName(char *buf, int maxSize);
+WXDLLEXPORT bool wxGetUserName(char *buf, int maxSize);
/*
* Strip out any menu codes
*/
-char* WXDLLEXPORT wxStripMenuCodes(char *in, char *out = (char *) NULL);
-wxString WXDLLEXPORT wxStripMenuCodes(const wxString& str);
+WXDLLEXPORT char* wxStripMenuCodes(char *in, char *out = (char *) NULL);
+WXDLLEXPORT wxString wxStripMenuCodes(const wxString& str);
// Find the window/widget with the given title or label.
// Pass a parent to begin the search from, or NULL to look through
// all windows.
-wxWindow* WXDLLEXPORT wxFindWindowByLabel(const wxString& title, wxWindow *parent = (wxWindow *) NULL);
+WXDLLEXPORT wxWindow* wxFindWindowByLabel(const wxString& title, wxWindow *parent = (wxWindow *) NULL);
// Find window by name, and if that fails, by label.
-wxWindow* WXDLLEXPORT wxFindWindowByName(const wxString& name, wxWindow *parent = (wxWindow *) NULL);
+WXDLLEXPORT wxWindow* wxFindWindowByName(const wxString& name, wxWindow *parent = (wxWindow *) NULL);
// Returns menu item id or -1 if none.
-int WXDLLEXPORT wxFindMenuItemId(wxFrame *frame, const wxString& menuString, const wxString& itemString);
+WXDLLEXPORT int wxFindMenuItemId(wxFrame *frame, const wxString& menuString, const wxString& itemString);
// A debugging stream buffer.
// Under Windows, this writes to the Windows debug output.
#define wxMin(a,b) (((a) < (b)) ? (a) : (b))
// Yield to other apps/messages
-bool WXDLLEXPORT wxYield(void);
+WXDLLEXPORT bool wxYield(void);
// Format a message on the standard error (UNIX) or the debugging
// stream (Windows)
-void WXDLLEXPORT wxDebugMsg(const char *fmt ...) ;
+WXDLLEXPORT void wxDebugMsg(const char *fmt ...) ;
// Sound the bell
-void WXDLLEXPORT wxBell(void) ;
+WXDLLEXPORT void wxBell(void) ;
// Get OS version
-int WXDLLEXPORT wxGetOsVersion(int *majorVsn= (int *) NULL,int *minorVsn= (int *) NULL) ;
+WXDLLEXPORT int wxGetOsVersion(int *majorVsn= (int *) NULL,int *minorVsn= (int *) NULL) ;
// Set the cursor to the busy cursor for all windows
class WXDLLEXPORT wxCursor;
WXDLLEXPORT_DATA(extern wxCursor*) wxHOURGLASS_CURSOR;
-void WXDLLEXPORT wxBeginBusyCursor(wxCursor *cursor = wxHOURGLASS_CURSOR);
+WXDLLEXPORT void wxBeginBusyCursor(wxCursor *cursor = wxHOURGLASS_CURSOR);
// Restore cursor to normal
-void WXDLLEXPORT wxEndBusyCursor(void);
+WXDLLEXPORT void wxEndBusyCursor(void);
// TRUE if we're between the above two calls
-bool WXDLLEXPORT wxIsBusy(void);
+WXDLLEXPORT bool wxIsBusy(void);
/* Error message functions used by wxWindows */
// Non-fatal error (continues)
WXDLLEXPORT_DATA(extern const char*) wxInternalErrorStr;
-void WXDLLEXPORT wxError(const wxString& msg, const wxString& title = wxInternalErrorStr);
+WXDLLEXPORT void wxError(const wxString& msg, const wxString& title = wxInternalErrorStr);
// Fatal error (exits)
WXDLLEXPORT_DATA(extern const char*) wxFatalErrorStr;
-void WXDLLEXPORT wxFatalError(const wxString& msg, const wxString& title = wxFatalErrorStr);
+WXDLLEXPORT void wxFatalError(const wxString& msg, const wxString& title = wxFatalErrorStr);
// Reading and writing resources (eg WIN.INI, .Xdefaults)
#if wxUSE_RESOURCES
-bool WXDLLEXPORT wxWriteResource(const wxString& section, const wxString& entry, const wxString& value, const wxString& file = "");
-bool WXDLLEXPORT wxWriteResource(const wxString& section, const wxString& entry, float value, const wxString& file = "");
-bool WXDLLEXPORT wxWriteResource(const wxString& section, const wxString& entry, long value, const wxString& file = "");
-bool WXDLLEXPORT wxWriteResource(const wxString& section, const wxString& entry, int value, const wxString& file = "");
-
-bool WXDLLEXPORT wxGetResource(const wxString& section, const wxString& entry, char **value, const wxString& file = "");
-bool WXDLLEXPORT wxGetResource(const wxString& section, const wxString& entry, float *value, const wxString& file = "");
-bool WXDLLEXPORT wxGetResource(const wxString& section, const wxString& entry, long *value, const wxString& file = "");
-bool WXDLLEXPORT wxGetResource(const wxString& section, const wxString& entry, int *value, const wxString& file = "");
+WXDLLEXPORT bool wxWriteResource(const wxString& section, const wxString& entry, const wxString& value, const wxString& file = "");
+WXDLLEXPORT bool wxWriteResource(const wxString& section, const wxString& entry, float value, const wxString& file = "");
+WXDLLEXPORT bool wxWriteResource(const wxString& section, const wxString& entry, long value, const wxString& file = "");
+WXDLLEXPORT bool wxWriteResource(const wxString& section, const wxString& entry, int value, const wxString& file = "");
+
+WXDLLEXPORT bool wxGetResource(const wxString& section, const wxString& entry, char **value, const wxString& file = "");
+WXDLLEXPORT bool wxGetResource(const wxString& section, const wxString& entry, float *value, const wxString& file = "");
+WXDLLEXPORT bool wxGetResource(const wxString& section, const wxString& entry, long *value, const wxString& file = "");
+WXDLLEXPORT bool wxGetResource(const wxString& section, const wxString& entry, int *value, const wxString& file = "");
#endif // wxUSE_RESOURCES
// Get current Home dir and copy to dest (returns pstr->c_str())
-const char* WXDLLEXPORT wxGetHomeDir(wxString *pstr);
+WXDLLEXPORT const char* wxGetHomeDir(wxString *pstr);
// Get the user's home dir (caller must copy--- volatile)
// returns NULL is no HOME dir is known
-char* WXDLLEXPORT wxGetUserHome(const wxString& user = "");
+WXDLLEXPORT char* wxGetUserHome(const wxString& user = "");
// Check whether this window wants to process messages, e.g. Stop button
// in long calculations.
-bool WXDLLEXPORT wxCheckForInterrupt(wxWindow *wnd);
+WXDLLEXPORT bool wxCheckForInterrupt(wxWindow *wnd);
void WXDLLEXPORT wxGetMousePosition( int* x, int* y );
// MSW only: get user-defined resource from the .res file.
// Returns NULL or newly-allocated memory, so use delete[] to clean up.
#ifdef __WXMSW__
-extern const char* WXDLLEXPORT wxUserResourceStr;
-char* WXDLLEXPORT wxLoadUserResource(const wxString& resourceName, const wxString& resourceType = wxUserResourceStr);
+WXDLLEXPORT extern const char* wxUserResourceStr;
+WXDLLEXPORT char* wxLoadUserResource(const wxString& resourceName, const wxString& resourceType = wxUserResourceStr);
#endif
// X only
#define wxRELEASE_NUMBER 0
#define wxVERSION_STRING "wxWindows 2.0"
#define wxVERSION_NUMBER (wxMAJOR_VERSION * 1000) + (wxMINOR_VERSION * 100) + wxRELEASE_NUMBER
-#define wxBETA_NUMBER 13
+#define wxBETA_NUMBER 17
#define wxVERSION_FLOAT float(wxMAJOR_VERSION + (wxMINOR_VERSION/10.0) + (wxRELEASE_NUMBER/100.0) + (wxBETA_NUMBER/10000.0))
#endif
#include "wx/setup.h" // Which features to include - user editable
#include "wx/defs.h"
#include "wx/string.h"
+#include "wx/log.h"
#include "wx/window.h"
#include "wx/panel.h"
#include "wx/frame.h"
#include "wx/dcmemory.h"
#include "wx/dcprint.h"
#include "wx/dcscreen.h"
-#include "wx/postscrp.h"
#include "wx/button.h"
#include "wx/bmpbuttn.h"
#include "wx/checkbox.h"
WXDLLEXPORT_DATA(extern wxExprErrorHandler) currentwxExprErrorHandler;
-WXDLLEXPORT_DATA(extern "C" FILE*) yyin;
+extern "C" WXDLLEXPORT_DATA(FILE*) yyin;
-extern "C" int WXDLLEXPORT yyparse(void);
+extern "C" WXDLLEXPORT int yyparse(void);
typedef enum {
wxExprNull,
// Function call-style interface - some more convenience wrappers/unwrappers
// Make a call
-wxExpr* WXDLLEXPORT wxExprMakeCall(const wxString& functor ...);
+WXDLLEXPORT wxExpr* wxExprMakeCall(const wxString& functor ...);
#define wxExprMakeInteger(x) (new wxExpr((long)x))
#define wxExprMakeReal(x) (new wxExpr((double)x))
#define wxExprMake(x) (new wxExpr(x))
// Checks functor
-bool WXDLLEXPORT wxExprIsFunctor(wxExpr *expr, const wxString& functor);
+WXDLLEXPORT bool wxExprIsFunctor(wxExpr *expr, const wxString& functor);
// Temporary variable for communicating between wxexpr.cpp and YACC/LEX
WXDLLEXPORT_DATA(extern wxExprDatabase*) thewxExprDatabase;
// YACC/LEX can leave memory lying around...
-extern "C" int WXDLLEXPORT wxExprCleanUp();
+extern "C" WXDLLEXPORT int wxExprCleanUp();
#endif
# Set WXDIR for your system
WXDIR = $(WXWIN)
-WXUSINGDLL=0
+WXUSINGDLL=1
!include $(WXDIR)\src\ntwxwin.mak
# Set WXDIR for your system
WXDIR = $(WXWIN)
-WXUSINGDLL=0
+WXUSINGDLL=1
!include $(WXDIR)\src\ntwxwin.mak
{
wxString str;
+/* Let's disable TimeStamp and see if anyone complains.
+ * If not, we'll remove it, since it's probably unlikely
+ * to ever be used. -- JACS 22/11/98
if ( !IsEmpty(m_szTimeFormat) ) {
char szBuf[128];
time_t timeNow;
strftime(szBuf, WXSIZEOF(szBuf), m_szTimeFormat, ptmNow);
str = szBuf;
}
+*/
return str;
}
{
wxString strTime = TimeStamp();
- #if defined(__WIN32__) && !defined(__WXSTUBS__)
+ #if (defined(__WIN32__) || defined(__WIN16__)) && !defined(__WXSTUBS__)
// don't prepend debug/trace here: it goes to the debug window
// anyhow, but do put a timestamp
OutputDebugString(strTime + szString + "\n\r");
#include "wx/app.h"
#endif
+#include <wx/log.h>
#include <stdlib.h>
#if wxUSE_IOSTREAMH
*/
void wxMemStruct::ErrorMsg (const char * mesg)
{
- wxTrace("wxWindows memory checking error: %s\n", mesg);
+ wxLogDebug("wxWindows memory checking error: %s", mesg);
PrintNode ();
// << m_fileName << ' ' << m_lineNum << endl;
*/
void wxMemStruct::ErrorMsg ()
{
- wxTrace("wxWindows over/underwrite memory error: \n");
+ wxLogDebug("wxWindows over/underwrite memory error:");
PrintNode ();
// cerr << m_fileName << ' ' << m_lineNum << endl;
{
wxObject *obj = (wxObject *)m_actualData;
wxClassInfo *info = obj->GetClassInfo();
-/*
- if (info && info->GetClassName())
- wxTrace("%s", info->GetClassName());
- else
- wxTrace("Object");
-
- if (m_fileName)
- wxTrace(" (%s %d)", m_fileName, (int)m_lineNum);
- wxTrace(" at $%lX, size %d\n", (long)GetActualData(), (int)RequestSize());
-*/
// Let's put this in standard form so IDEs can load the file at the appropriate
// line
+ wxString msg("");
+
if (m_fileName)
- wxTrace("%s(%d): ", m_fileName, (int)m_lineNum);
+ msg.Printf("%s(%d): ", m_fileName, (int)m_lineNum);
if (info && info->GetClassName())
- wxTrace("%s", info->GetClassName());
+ msg += info->GetClassName();
else
- wxTrace("object");
+ msg += "object";
+
+ wxString msg2;
+ msg2.Printf(" at $%lX, size %d", (long)GetActualData(), (int)RequestSize());
+ msg += msg2;
- wxTrace(" at $%lX, size %d\n", (long)GetActualData(), (int)RequestSize());
+ wxLogDebug(msg);
}
else
{
+ wxString msg("");
+
if (m_fileName)
- wxTrace("%s(%d): ", m_fileName, (int)m_lineNum);
- wxTrace("non-object data");
- wxTrace(" at $%lX, size %d\n", (long)GetActualData(), (int)RequestSize());
+ msg.Printf("%s(%d): ", m_fileName, (int)m_lineNum);
+ msg += ("non-object data");
+ wxString msg2;
+ msg2.Printf(" at $%lX, size %d\n", (long)GetActualData(), (int)RequestSize());
+ msg += msg2;
+
+ wxLogDebug(msg);
}
}
{
wxObject *obj = (wxObject *)m_actualData;
+ wxString msg("");
if (m_fileName)
- wxTrace("%s(%d): ", m_fileName, (int)m_lineNum);
+ msg.Printf("%s(%d): ", m_fileName, (int)m_lineNum);
+
+ /* TODO: We no longer have a stream (using wxLogDebug) so we can't dump it.
+ * Instead, do what wxObject::Dump does.
+ * What should we do long-term, eliminate Dumping? Or specify
+ * that MyClass::Dump should use wxLogDebug? Ugh.
obj->Dump(wxDebugContext::GetStream());
- wxTrace(" at $%lX, size %d", (long)GetActualData(), (int)RequestSize());
- wxTrace("\n");
+ */
+
+ if (obj->GetClassInfo() && obj->GetClassInfo()->GetClassName())
+ msg += obj->GetClassInfo()->GetClassName();
+ else
+ msg += "unknown object class";
+
+ wxString msg2("");
+ msg2.Printf(" at $%lX, size %d", (long)GetActualData(), (int)RequestSize());
+ msg += msg2;
+
+ wxLogDebug(msg);
}
else
{
+ wxString msg("");
if (m_fileName)
- wxTrace("%s(%d): ", m_fileName, (int)m_lineNum);
- wxTrace("non-object data");
- wxTrace(" at $%lX, size %d\n", (long)GetActualData(), (int)RequestSize());
+ msg.Printf("%s(%d): ", m_fileName, (int)m_lineNum);
+
+ wxString msg2("");
+ msg2.Printf("non-object data at $%lX, size %d", (long)GetActualData(), (int)RequestSize() );
+ msg += msg2;
+ wxLogDebug(msg);
}
}
else {
// Can't use the error routines as we have no recognisable object.
#ifndef __WXGTK__
- wxTrace("Can't verify memory struct - all bets are off!\n");
+ wxLogDebug("Can't verify memory struct - all bets are off!");
#endif
}
return 0;
void wxDebugContext::SetStream(ostream *str, streambuf *buf)
{
-/*
- if (str)
- {
- char buff[128];
- sprintf(buff, "SetStream (1): str is %ld", (long) str);
- MessageBox(NULL, buff, "Memory", MB_OK);
- }
-*/
-
if (m_debugStream)
{
m_debugStream->flush();
}
else
{
-/*
- char buf[40];
- sprintf(buf, "SetFile: str is %ld", (long) str);
- MessageBox(NULL, buf, "Memory", MB_OK);
-*/
SetStream(str);
return TRUE;
}
for (wxMemStruct * st = from; st != 0; st = st->m_next)
{
void* data = st->GetActualData();
- if ((data != (void*)m_debugStream) && (data != (void*) m_streamBuf))
+// if ((data != (void*)m_debugStream) && (data != (void*) m_streamBuf))
+ if (data != (void*) wxLog::GetActiveTarget())
{
(st->*func) ();
}
bool wxDebugContext::PrintList (void)
{
#ifdef __WXDEBUG__
- if (!HasStream())
- return FALSE;
+// if (!HasStream())
+// return FALSE;
TraverseList ((PmSFV)&wxMemStruct::PrintNode, (checkPoint ? checkPoint->m_next : (wxMemStruct*)NULL));
bool wxDebugContext::Dump(void)
{
#ifdef __WXDEBUG__
- if (!HasStream())
- return FALSE;
+// if (!HasStream())
+// return FALSE;
if (TRUE)
{
{
appNameStr = wxTheApp->GetAppName();
appName = (char*) (const char*) appNameStr;
- wxTrace("----- Memory dump of %s at %s -----\n", appName, WXSTRINGCAST wxNow() );
+ wxLogDebug("----- Memory dump of %s at %s -----", appName, WXSTRINGCAST wxNow() );
}
else
{
- wxTrace( "----- Memory dump -----\n" );
+ wxLogDebug( "----- Memory dump -----" );
}
}
TraverseList ((PmSFV)&wxMemStruct::Dump, (checkPoint ? checkPoint->m_next : (wxMemStruct*)NULL));
- wxTrace( "\n\n" );
+ wxLogDebug( "" );
+ wxLogDebug( "" );
return TRUE;
#else
bool wxDebugContext::PrintStatistics(bool detailed)
{
#ifdef __WXDEBUG__
- if (!HasStream())
- return FALSE;
+// if (!HasStream())
+// return FALSE;
if (TRUE)
{
{
appNameStr = wxTheApp->GetAppName();
appName = (char*) (const char*) appNameStr;
- wxTrace("----- Memory statistics of %s at %s -----\n", appName, WXSTRINGCAST wxNow() );
+ wxLogDebug("----- Memory statistics of %s at %s -----", appName, WXSTRINGCAST wxNow() );
}
else
{
- wxTrace( "----- Memory statistics -----\n" );
+ wxLogDebug( "----- Memory statistics -----" );
}
}
for (st = from; st != 0; st = st->m_next)
{
void* data = st->GetActualData();
- if (detailed && (data != (void*)m_debugStream) && (data != (void*) m_streamBuf))
+// if (detailed && (data != (void*)m_debugStream) && (data != (void*) m_streamBuf))
+ if (detailed && (data != (void*) wxLog::GetActiveTarget()))
{
char *className = "nonobject";
if (st->m_isObject && st->GetActualData())
stats->totalSize += st->RequestSize();
}
- if ((data != (void*)m_debugStream) && (data != (void*) m_streamBuf))
+// if ((data != (void*)m_debugStream) && (data != (void*) m_streamBuf))
+ if (data != (void*) wxLog::GetActiveTarget())
{
totalSize += st->RequestSize();
if (st->m_isObject)
{
while (list)
{
- wxTrace("%ld objects of class %s, total size %ld\n",
+ wxLogDebug("%ld objects of class %s, total size %ld",
list->instanceCount, list->instanceClass, list->totalSize);
wxDebugStatsStruct *old = list;
list = old->next;
free((char *)old);
}
- wxTrace("\n");
+ wxLogDebug("");
}
SetDebugMode(currentMode);
- wxTrace("Number of object items: %ld\n", noObjectNodes);
- wxTrace("Number of non-object items: %ld\n", noNonObjectNodes);
- wxTrace("Total allocated size: %ld\n", totalSize);
- wxTrace("\n\n");
+ wxLogDebug("Number of object items: %ld", noObjectNodes);
+ wxLogDebug("Number of non-object items: %ld", noNonObjectNodes);
+ wxLogDebug("Total allocated size: %ld", totalSize);
+ wxLogDebug("");
+ wxLogDebug("");
return TRUE;
#else
bool wxDebugContext::PrintClasses(void)
{
- if (!HasStream())
- return FALSE;
+// if (!HasStream())
+// return FALSE;
if (TRUE)
{
{
appNameStr = wxTheApp->GetAppName();
appName = (char*) (const char*) appNameStr;
- wxTrace("----- Classes in %s -----\n", appName);
+ wxLogDebug("----- Classes in %s -----", appName);
}
}
info = (wxClassInfo *)node->Data();
if (info->GetClassName())
{
- wxTrace("%s ", info->GetClassName());
-
- if (info->GetBaseClassName1() && !info->GetBaseClassName2())
- wxTrace("is a %s", info->GetBaseClassName1());
- else if (info->GetBaseClassName1() && info->GetBaseClassName2())
- wxTrace("is a %s, %s", info->GetBaseClassName1(), info->GetBaseClassName2());
- if (info->GetConstructor())
- wxTrace(": dynamic\n");
- else
- wxTrace("\n");
+ wxString msg(info->GetClassName());
+ msg += " ";
+
+ if (info->GetBaseClassName1() && !info->GetBaseClassName2())
+ {
+ msg += "is a ";
+ msg += info->GetBaseClassName1();
+ }
+ else if (info->GetBaseClassName1() && info->GetBaseClassName2())
+ {
+ msg += "is a ";
+ msg += info->GetBaseClassName1() ;
+ msg += ", ";
+ msg += info->GetBaseClassName2() ;
+ }
+ if (info->GetConstructor())
+ msg += ": dynamic";
+
+ wxLogDebug(msg);
}
node = wxClassInfo::sm_classTable->Next();
n ++;
}
- wxTrace("\nThere are %d classes derived from wxObject.\n\n\n", n);
+ wxLogDebug("");
+ wxLogDebug("There are %d classes derived from wxObject.", n);
+ wxLogDebug("");
+ wxLogDebug("");
return TRUE;
}
for (wxMemStruct * st = from; st != 0; st = st->m_next)
{
void* data = st->GetActualData();
- if ((data != (void*)m_debugStream) && (data != (void*) m_streamBuf))
+// if ((data != (void*)m_debugStream) && (data != (void*) m_streamBuf))
+ if (data != (void*) wxLog::GetActiveTarget())
n ++;
}
#if _MSC_VER >= 1200
void operator delete(void* pData, char* /* fileName */, int /* lineNum */)
{
- ::operator delete(pData);
+// ::operator delete(pData);
+ // JACS 21/11/1998: surely we need to call wxDebugFree?
+ wxDebugFree(pData, FALSE);
+}
+// New operator 21/11/1998
+void operator delete[](void* pData, char* /* fileName */, int /* lineNum */)
+{
+ wxDebugFree(pData, TRUE);
}
#endif
char * buf = (char *) malloc(wxDebugContext::TotSize (size));
if (!buf) {
- wxTrace("Call to malloc (%ld) failed.\n", (long)size);
+ wxLogDebug("Call to malloc (%ld) failed.", (long)size);
return 0;
}
wxMemStruct * st = (wxMemStruct *)buf;
wxClassInfo::InitializeClasses();
+ /* Debug stream no longer used
#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
streambuf* sBuf = new wxDebugStreamBuf;
ostream* oStr = new ostream(sBuf) ;
wxDebugContext::SetStream(oStr, sBuf);
-
#endif
+*/
if (!wxTheApp)
{
wxDELETE(wxTheApp);
- wxLog *oldLog = wxLog::SetActiveTarget( NULL );
- if (oldLog) delete oldLog;
-
wxClassInfo::CleanUpClasses();
delete[] wxBuffer;
if (wxDebugContext::CountObjectsLeft() > 0)
{
- wxTrace("There were memory leaks.\n");
+ wxLogDebug("There were memory leaks.\n");
wxDebugContext::Dump();
wxDebugContext::PrintStatistics();
}
- wxDebugContext::SetStream(NULL, NULL);
+// wxDebugContext::SetStream(NULL, NULL);
#endif
+ wxLog *oldLog = wxLog::SetActiveTarget( NULL );
+ if (oldLog) delete oldLog;
+
+
return retValue;
}
wxClassInfo::InitializeClasses();
+ /* Debug stream no longer used
#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
streambuf* sBuf = new wxDebugStreamBuf;
ostream* oStr = new ostream(sBuf) ;
wxDebugContext::SetStream(oStr, sBuf);
-
#endif
+*/
if (!wxTheApp)
{
wxDELETE(wxTheApp);
- wxLog *oldLog = wxLog::SetActiveTarget( NULL );
- if (oldLog) delete oldLog;
-
wxClassInfo::CleanUpClasses();
delete[] wxBuffer;
if (wxDebugContext::CountObjectsLeft() > 0)
{
- wxTrace("There were memory leaks.\n");
+ wxLogDebug("There were memory leaks.\n");
wxDebugContext::Dump();
wxDebugContext::PrintStatistics();
}
- wxDebugContext::SetStream(NULL, NULL);
+// wxDebugContext::SetStream(NULL, NULL);
#endif
+ wxLog *oldLog = wxLog::SetActiveTarget( NULL );
+ if (oldLog) delete oldLog;
+
+
return retValue;
}
wxBuffer = new char[BUFSIZ + 512];
#endif
+/* No longer used
#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
streambuf* sBuf = new wxDebugStreamBuf;
wxDebugContext::SetStream(oStr, sBuf);
#endif
+*/
wxClassInfo::InitializeClasses();
wxClassInfo::CleanUpClasses();
+ delete wxTheApp;
+ wxTheApp = NULL;
+
+#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
+ // At this point we want to check if there are any memory
+ // blocks that aren't part of the wxDebugContext itself,
+ // as a special case. Then when dumping we need to ignore
+ // wxDebugContext, too.
+ if (wxDebugContext::CountObjectsLeft() > 0)
+ {
+ wxLogDebug("There were memory leaks.\n");
+ wxDebugContext::Dump();
+ wxDebugContext::PrintStatistics();
+ }
+// wxDebugContext::SetStream(NULL, NULL);
+#endif
+
// do it as the very last thing because everything else can log messages
wxLog::DontCreateOnDemand();
// do it as the very last thing because everything else can log messages
wxApp::CleanUp();
- delete wxTheApp;
- wxTheApp = NULL;
-
-#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
- // At this point we want to check if there are any memory
- // blocks that aren't part of the wxDebugContext itself,
- // as a special case. Then when dumping we need to ignore
- // wxDebugContext, too.
- if (wxDebugContext::CountObjectsLeft() > 0)
- {
- wxTrace("There were memory leaks.\n");
- wxDebugContext::Dump();
- wxDebugContext::PrintStatistics();
- }
- wxDebugContext::SetStream(NULL, NULL);
-#endif
-
return retValue;
};
#endif // debug build under MS VC++
*/
+
+// 22/11/98: we're converting to wxLogDebug instead of wxTrace,
+// so these are now obsolete.
+
+#if 0
#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
#if defined(_WINDLL)
streambuf* sBuf = NULL;
ostream* oStr = new ostream(sBuf) ;
wxDebugContext::SetStream(oStr, sBuf);
#endif // wxUSE_MEMORY_TRACING
+#endif
wxClassInfo::InitializeClasses();
wxClassInfo::CleanUpClasses();
+ delete wxTheApp;
+ wxTheApp = NULL;
+
+#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
+ // At this point we want to check if there are any memory
+ // blocks that aren't part of the wxDebugContext itself,
+ // as a special case. Then when dumping we need to ignore
+ // wxDebugContext, too.
+ if (wxDebugContext::CountObjectsLeft() > 0)
+ {
+ wxLogDebug("There were memory leaks.");
+ wxDebugContext::Dump();
+ wxDebugContext::PrintStatistics();
+ }
+// wxDebugContext::SetStream(NULL, NULL);
+#endif
+
// do it as the very last thing because everything else can log messages
wxLog::DontCreateOnDemand();
delete wxLog::SetActiveTarget(NULL);
wxApp::CleanUp();
- delete wxTheApp;
- wxTheApp = NULL;
-
-#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
- // At this point we want to check if there are any memory
- // blocks that aren't part of the wxDebugContext itself,
- // as a special case. Then when dumping we need to ignore
- // wxDebugContext, too.
- if (wxDebugContext::CountObjectsLeft() > 0)
- {
- wxTrace("There were memory leaks.\n");
- wxDebugContext::Dump();
- wxDebugContext::PrintStatistics();
- }
- wxDebugContext::SetStream(NULL, NULL);
-#endif
-
return retValue;
#ifndef __WXDEBUG__ // catch exceptions only in release build
}
if (!old)
return FALSE;
- RECT rect = lpDIS->rcItem;
-
int x = lpDIS->rcItem.left;
int y = lpDIS->rcItem.top;
int width = lpDIS->rcItem.right - x;
if (!old)
return FALSE;
- RECT rect = lpDIS->rcItem;
-
int x = lpDIS->rcItem.left;
int y = lpDIS->rcItem.top;
int width = lpDIS->rcItem.right - x;
return (wxBusyCursorCount > 0);
}
-const char* WXDLLEXPORT wxGetHomeDir(wxString *pstr)
+const char* wxGetHomeDir(wxString *pstr)
{
wxString& strDir = *pstr;
# If you set wxUSE_IOSTREAMH to 0, remove -Dtry=__try -Dexcept=__except -Dleave=__leave -Dfinally=__finally
WINFLAGS=-c -W3 -Dtry=__try -Dexcept=__except -Dleave=__leave -Dfinally=__finally -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -DWIN32 -D__WIN32__ $(WINVERSION)
#WINLINKFLAGS=/NODEFAULTLIB /INCREMENTAL:NO /NOLOGO -align:0x1000 -machine:$(CPU) -subsystem:windows,$(APPVER)
-WINLINKFLAGS=/INCREMENTAL:NO /NOLOGO -align:0x1000 -machine:$(CPU) -subsystem:windows,$(APPVER)
+WINLINKFLAGS=/INCREMENTAL:NO /NOLOGO -machine:$(CPU) -subsystem:windows,$(APPVER)
#WINLIBS=kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib libc.lib oldnames.lib\
# comctl32.lib ctl3d32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib # libci.lib # libci.lib required for VC++ 4.2
WINLIBS=kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib oldnames.lib\
wxBuffer = new char[BUFSIZ + 512];
#endif
+/* No longer used
#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
streambuf* sBuf = new wxDebugStreamBuf;
ostream* oStr = new ostream(sBuf) ;
wxDebugContext::SetStream(oStr, sBuf);
-
#endif
+*/
wxClassInfo::InitializeClasses();
wxClassInfo::CleanUpClasses();
+ delete wxTheApp;
+ wxTheApp = NULL;
+
+#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
+ // At this point we want to check if there are any memory
+ // blocks that aren't part of the wxDebugContext itself,
+ // as a special case. Then when dumping we need to ignore
+ // wxDebugContext, too.
+ if (wxDebugContext::CountObjectsLeft() > 0)
+ {
+ wxTrace("There were memory leaks.\n");
+ wxDebugContext::Dump();
+ wxDebugContext::PrintStatistics();
+ }
+// wxDebugContext::SetStream(NULL, NULL);
+#endif
+
// do it as the very last thing because everything else can log messages
wxLog::DontCreateOnDemand();
// do it as the very last thing because everything else can log messages
wxApp::CleanUp();
- delete wxTheApp;
- wxTheApp = NULL;
-
-#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
- // At this point we want to check if there are any memory
- // blocks that aren't part of the wxDebugContext itself,
- // as a special case. Then when dumping we need to ignore
- // wxDebugContext, too.
- if (wxDebugContext::CountObjectsLeft() > 0)
- {
- wxTrace("There were memory leaks.\n");
- wxDebugContext::Dump();
- wxDebugContext::PrintStatistics();
- }
- wxDebugContext::SetStream(NULL, NULL);
-#endif
-
return retValue;
};