Changes for 16-bit BC++ (not there yet), GnuWin32; typetest sample

fixed; some documentation fixes


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1271 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
1998-12-28 12:35:49 +00:00
parent 754330c05f
commit 6244848856
85 changed files with 1475 additions and 1064 deletions

View File

@@ -129,7 +129,7 @@
typedef unsigned char bool;
#endif
#if ( defined(_MSC_VER) && (_MSC_VER <= 800) ) || defined(__GNUWIN32__)
#if ( defined(_MSC_VER) && (_MSC_VER <= 800) ) || defined(__GNUWIN32__) || (defined(__BORLANDC__) && defined(__WIN16__))
#define byte unsigned char
#endif

View File

@@ -187,8 +187,15 @@ const wxEventType wxEVT_COMMAND_LIST_ITEM_ACTIVATED = wxEVT_FIRST + 715;
/* Tab and notebook control event types */
const wxEventType wxEVT_COMMAND_TAB_SEL_CHANGED = wxEVT_FIRST + 800;
const wxEventType wxEVT_COMMAND_TAB_SEL_CHANGING = wxEVT_FIRST + 801;
#if defined(__BORLANDC__) && defined(__WIN16__)
// For 16-bit BC++, these 2 are identical (truncated)
const wxEventType wxEVT_COMMAND_NB_PAGE_CHANGED = wxEVT_FIRST + 802;
const wxEventType wxEVT_COMMAND_NB_PAGE_CHANGING = wxEVT_FIRST + 803;
#else
const wxEventType wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED = wxEVT_FIRST + 802;
const wxEventType wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING = wxEVT_FIRST + 803;
#endif
const wxEventType wxEVT_USER_FIRST = wxEVT_FIRST + 2000;

View File

@@ -29,6 +29,10 @@
#define off_t _off_t
#endif
#if defined(__BORLANDC__) && defined(__WIN16__)
typedef long off_t;
#endif
const off_t wxInvalidOffset = (off_t)-1;
typedef enum {
@@ -85,7 +89,7 @@ WXDLLEXPORT char* wxExpandPath(char *dest, const char *path);
// and make (if under the home tree) relative to home
// [caller must copy-- volatile]
WXDLLEXPORT char* wxContractPath (const wxString& filename,
const wxString& envname = "", const wxString& user = "");
const wxString& envname = wxEmptyString, const wxString& user = wxEmptyString);
// Destructive removal of /./ and /../ stuff
WXDLLEXPORT char* wxRealPath(char *path);

View File

@@ -82,7 +82,7 @@ class WXDLLEXPORT wxDirDialog: public wxDialog
public:
wxDirDialog(wxWindow *parent,
const wxString& message = wxFileSelectorPromptStr,
const wxString& defaultPath = "",
const wxString& defaultPath = wxEmptyString,
long style = 0, const wxPoint& pos = wxDefaultPosition);
inline void SetMessage(const wxString& message) { m_message = message; }
inline void SetPath(const wxString& path) { m_path = path; }

View File

@@ -226,6 +226,29 @@ protected:
// ----------------------------------------------------------------------------
typedef void (wxEvtHandler::*wxNotebookEventFunction)(wxNotebookEvent&);
// Because of name truncation!
#if defined(__BORLANDC__) && defined(__WIN16__)
#define EVT_NOTEBOOK_PAGE_CHANGED(id, fn) \
{ \
wxEVT_COMMAND_NB_PAGE_CHANGED, \
id, \
-1, \
(wxObjectEventFunction)(wxEventFunction)(wxNotebookEventFunction) &fn, \
NULL \
},
#define EVT_NOTEBOOK_PAGE_CHANGING(id, fn) \
{ \
wxEVT_COMMAND_NB_PAGE_CHANGING, \ \
id, \
-1, \
(wxObjectEventFunction)(wxEventFunction)(wxNotebookEventFunction) &fn, \
NULL \
},
#else
#define EVT_NOTEBOOK_PAGE_CHANGED(id, fn) \
{ \
wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, \
@@ -244,4 +267,6 @@ typedef void (wxEvtHandler::*wxNotebookEventFunction)(wxNotebookEvent&);
NULL \
},
#endif
#endif // _WX_NOTEBOOK_H_

View File

@@ -16,6 +16,12 @@
#pragma interface "treectrl.h"
#endif
#ifdef __WXMSW__
WXDLLEXPORT_DATA(extern const char*) wxTreeCtrlNameStr;
#else
#define wxTreeCtrlNameStr "wxTreeCtrl"
#endif
#include "wx/defs.h"
#include "wx/string.h"
#include "wx/object.h"
@@ -201,7 +207,7 @@ public:
const wxSize& size = wxDefaultSize,
long style = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT,
const wxValidator &validator = wxDefaultValidator,
const wxString& name = "wxTreeCtrl")
const wxString& name = wxTreeCtrlNameStr)
{
Create(parent, id, pos, size, style, validator, name);
}
@@ -213,7 +219,7 @@ public:
const wxSize& size = wxDefaultSize,
long style = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT,
const wxValidator &validator = wxDefaultValidator,
const wxString& name = "wxTreeCtrl");
const wxString& name = wxTreeCtrlNameStr);
// accessors
// ---------

View File

@@ -289,7 +289,7 @@ protected:
private:
// helpers
// common part of all ctors
void Init(wxKeyType keyType);
void Init(wxKeyType keyType = wxKEY_NONE);
// common part of copy ctor and assignment operator
void DoCopy(const wxListBase& list);
// common part of all Append()s

View File

@@ -39,7 +39,7 @@ protected:
int m_filterIndex;
public:
wxFileDialog(wxWindow *parent, const wxString& message = wxFileSelectorPromptStr,
const wxString& defaultDir = "", const wxString& defaultFile = "", const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
const wxString& defaultDir = wxEmptyString, const wxString& defaultFile = wxEmptyString, const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
long style = 0, const wxPoint& pos = wxDefaultPosition);
inline void SetMessage(const wxString& message) { m_message = message; }

View File

@@ -22,6 +22,7 @@
WXDLLEXPORT_DATA(extern const char*) wxFrameNameStr;
WXDLLEXPORT_DATA(extern const char*) wxToolBarNameStr;
WXDLLEXPORT_DATA(extern const char*) wxStatusLineNameStr;
class WXDLLEXPORT wxMenuBar;
class WXDLLEXPORT wxStatusBar;
@@ -102,7 +103,7 @@ public:
// Create status line
virtual wxStatusBar* CreateStatusBar(int number=1, long style = wxST_SIZEGRIP, wxWindowID id = 0,
const wxString& name = "statusBar");
const wxString& name = wxStatusLineNameStr);
inline wxStatusBar *GetStatusBar() const { return m_frameStatusBar; }
inline void SetStatusBar(wxStatusBar *statusBar) { m_frameStatusBar = statusBar; }
virtual void PositionStatusBar(void);

View File

@@ -41,14 +41,26 @@ WXDLLEXPORT wxFont wxCreateFontFromLogFont(LOGFONT *logFont); // , bool createNe
# define CASTWNDPROC (long unsigned)
#else
# ifdef __BORLANDC__
# ifdef __WIN32__
# define CASTWNDPROC
# else
typedef int (pascal * WndProcCast) ();
# define CASTWNDPROC (WndProcCast)
# endif
# else
# if defined (__WIN32__) && defined(STRICT)
typedef long (_stdcall * WndProcCast) (HWND, unsigned int, unsigned int, long);
# define CASTWNDPROC (WndProcCast)
# elif defined(__WIN16__)
# ifdef __BORLANDC__
typedef int (pascal * WndProcCast) ();
# define CASTWNDPROC (WndProcCast)
# else
typedef int (PASCAL * WndProcCast) ();
# define CASTWNDPROC (WndProcCast)
# endif
# else
# define CASTWNDPROC
# endif

View File

@@ -54,7 +54,7 @@ public:
// If toggle is TRUE, the button toggles between the two states.
wxToolBarTool *AddTool(int toolIndex, const wxBitmap& bitmap, const wxBitmap& pushedBitmap = wxNullBitmap,
bool toggle = FALSE, long xPos = -1, long yPos = -1, wxObject *clientData = NULL,
const wxString& helpString1 = "", const wxString& helpString2 = "");
const wxString& helpString1 = wxEmptyString, const wxString& helpString2 = wxEmptyString);
void DrawTool(wxDC& dc, wxMemoryDC& memDc, wxToolBarTool *tool);

View File

@@ -708,9 +708,11 @@ public:
/// find first n characters of sz
size_t find(const char* sz, size_t nStart = 0, size_t n = npos) const;
#endif
// Gives a duplicate symbol (presumably a case-insensitivity problem)
#if !defined(__BORLANDC__)
/// find the first occurence of character ch after nStart
size_t find(char ch, size_t nStart = 0) const;
#endif
// wxWin compatibility
inline bool Contains(const wxString& str) const { return Find(str) != -1; }

View File

@@ -36,7 +36,7 @@ class WXDLLEXPORT wxToolBarTool: public wxObject
public:
wxToolBarTool(int theIndex = 0, const wxBitmap& bitmap1 = wxNullBitmap, const wxBitmap& bitmap2 = wxNullBitmap,
bool toggle = FALSE, long xPos = -1, long yPos = -1,
const wxString& shortHelpString = "", const wxString& longHelpString = "");
const wxString& shortHelpString = wxEmptyString, const wxString& longHelpString = wxEmptyString);
~wxToolBarTool ();
inline void SetSize( long w, long h ) { m_width = w; m_height = h; }
inline long GetWidth () const { return m_width; }
@@ -86,7 +86,7 @@ class WXDLLEXPORT wxToolBarBase : public wxControl
// If toggle is TRUE, the button toggles between the two states.
virtual wxToolBarTool *AddTool(int toolIndex, const wxBitmap& bitmap, const wxBitmap& pushedBitmap = wxNullBitmap,
bool toggle = FALSE, long xPos = -1, long yPos = -1, wxObject *clientData = NULL,
const wxString& helpString1 = "", const wxString& helpString2 = "");
const wxString& helpString1 = wxEmptyString, const wxString& helpString2 = wxEmptyString);
virtual void AddSeparator(void);
virtual void ClearTools(void);

View File

@@ -112,7 +112,7 @@ WXDLLEXPORT int wxKill(long pid, int sig=wxSIGTERM);
// Execute a command in an interactive shell window
// If no command then just the shell
WXDLLEXPORT bool wxShell(const wxString& command = "");
WXDLLEXPORT bool wxShell(const wxString& command = wxEmptyString);
// Sleep for nSecs seconds under UNIX, do nothing under Windows
WXDLLEXPORT void wxSleep(int nSecs);
@@ -243,15 +243,15 @@ WXDLLEXPORT void wxFatalError(const wxString& msg, const wxString& title = wxFat
// Reading and writing resources (eg WIN.INI, .Xdefaults)
#if wxUSE_RESOURCES
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 wxWriteResource(const wxString& section, const wxString& entry, const wxString& value, const wxString& file = wxEmptyString);
WXDLLEXPORT bool wxWriteResource(const wxString& section, const wxString& entry, float value, const wxString& file = wxEmptyString);
WXDLLEXPORT bool wxWriteResource(const wxString& section, const wxString& entry, long value, const wxString& file = wxEmptyString);
WXDLLEXPORT bool wxWriteResource(const wxString& section, const wxString& entry, int value, const wxString& file = wxEmptyString);
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 = "");
WXDLLEXPORT bool wxGetResource(const wxString& section, const wxString& entry, char **value, const wxString& file = wxEmptyString);
WXDLLEXPORT bool wxGetResource(const wxString& section, const wxString& entry, float *value, const wxString& file = wxEmptyString);
WXDLLEXPORT bool wxGetResource(const wxString& section, const wxString& entry, long *value, const wxString& file = wxEmptyString);
WXDLLEXPORT bool wxGetResource(const wxString& section, const wxString& entry, int *value, const wxString& file = wxEmptyString);
#endif // wxUSE_RESOURCES
// Get current Home dir and copy to dest (returns pstr->c_str())
@@ -259,7 +259,7 @@ WXDLLEXPORT const char* wxGetHomeDir(wxString *pstr);
// Get the user's home dir (caller must copy--- volatile)
// returns NULL is no HOME dir is known
WXDLLEXPORT char* wxGetUserHome(const wxString& user = "");
WXDLLEXPORT char* wxGetUserHome(const wxString& user = wxEmptyString);
// Check whether this window wants to process messages, e.g. Stop button
// in long calculations.