Watcom C++ fixup in tbar95.cpp; removed WXWIN_COMPATIBILITY for 'old' menu

constructor and event handling; added wxString version of wxGetTempFileName


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4552 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
1999-11-14 14:41:30 +00:00
parent 021e0f2105
commit c0ab6adfed
16 changed files with 37 additions and 20 deletions

View File

@@ -1,3 +1,5 @@
include/wx/wxchar.h include/wx/wxchar.h
include/wx/msw/setup.h include/wx/msw/setup.h
samples/dnd/*.wxr samples/dnd/*.wxr
src/unix/fontutil.cpp
src/common/fontmap.cpp

View File

@@ -5,7 +5,7 @@ set dest=%src\deliver
set wise=0 set wise=0
Rem Set this to the required patch version Rem Set this to the required patch version
set version=01 set version=02
if "%src" == "" goto usage if "%src" == "" goto usage
if "%dest" == "" goto usage if "%dest" == "" goto usage

View File

@@ -102,6 +102,22 @@ wxWINDOWS VERSION: wxWindows 2.1.11
PLATFORMS: Windows + Python 1.5 PLATFORMS: Windows + Python 1.5
DATE IDENTIFIED: 10/11/1999 DATE IDENTIFIED: 10/11/1999
IDENTIFIED BY: A.T.Hofkamp IDENTIFIED BY: A.T.Hofkamp
DATE FIXED: 11/11/1999
FIXED BY: Vaclav Slavik
BUG NUMBER: 6
SHORT DESCRIPTION: MSWindows Paths in include files
DETAILS: I may be wrong, but it looks like all the paths in the
include files are based on a unix system. The problem is when
you go to compile VC++6 can't find any of the other includes it
needs. [Note from JACS: VC++ accepts forward slashes so
there must be a setup problem.]
WORKAROUND: Change all the paths in the includes
wxWINDOWS VERSION: 2.1.11
PLATFORMS: wxMSW
DATE IDENTIFIED: 11/11/1999
IDENTIFIED BY: Mark A Russell <markarussell@earthlink.net>
---------------------------END OF BUGLIST------------------------- ---------------------------END OF BUGLIST-------------------------

View File

@@ -148,6 +148,8 @@ if the buffer is NULL.
\func{char*}{wxGetTempFileName}{\param{const wxString\& }{prefix}, \param{char* }{buf=NULL}} \func{char*}{wxGetTempFileName}{\param{const wxString\& }{prefix}, \param{char* }{buf=NULL}}
\func{bool}{wxGetTempFileName}{\param{const wxString\& }{prefix}, \param{wxString\& }{buf}}
Makes a temporary filename based on {\it prefix}, opens and closes the file, Makes a temporary filename based on {\it prefix}, opens and closes the file,
and places the name in {\it buf}. If {\it buf} is NULL, new store and places the name in {\it buf}. If {\it buf} is NULL, new store
is allocated for the temporary filename using {\it new}. is allocated for the temporary filename using {\it new}.

View File

@@ -98,9 +98,11 @@ WXDLLEXPORT void wxStripExtension(wxString& buffer);
// Get a temporary filename, opening and closing the file. // Get a temporary filename, opening and closing the file.
WXDLLEXPORT wxChar* wxGetTempFileName(const wxString& prefix, wxChar *buf = (wxChar *) NULL); WXDLLEXPORT wxChar* wxGetTempFileName(const wxString& prefix, wxChar *buf = (wxChar *) NULL);
WXDLLEXPORT bool wxGetTempFileName(const wxString& prefix, wxString& buf);
// Expand file name (~/ and ${OPENWINHOME}/ stuff) // Expand file name (~/ and ${OPENWINHOME}/ stuff)
WXDLLEXPORT wxChar* wxExpandPath(wxChar *dest, const wxChar *path); WXDLLEXPORT wxChar* wxExpandPath(wxChar *dest, const wxChar *path);
WXDLLEXPORT bool wxExpandPath(wxString& dest, const wxChar *path);
// Contract w.r.t environment (</usr/openwin/lib, OPENWHOME> -> ${OPENWINHOME}/lib) // Contract w.r.t environment (</usr/openwin/lib, OPENWHOME> -> ${OPENWINHOME}/lib)
// and make (if under the home tree) relative to home // and make (if under the home tree) relative to home

View File

@@ -77,13 +77,11 @@ public:
// TODO: virtual void SetTitle(const wxString& title); // TODO: virtual void SetTitle(const wxString& title);
#if WXWIN_COMPATIBILITY
wxMenu(const wxString& title, const wxFunction func) wxMenu(const wxString& title, const wxFunction func)
: wxMenuBase(title) : wxMenuBase(title)
{ {
Callback(func); Callback(func);
} }
#endif // WXWIN_COMPATIBILITY
// implementation // implementation
int FindMenuIdByMenuItem( GtkWidget *menuItem ) const; int FindMenuIdByMenuItem( GtkWidget *menuItem ) const;

View File

@@ -77,13 +77,11 @@ public:
// TODO: virtual void SetTitle(const wxString& title); // TODO: virtual void SetTitle(const wxString& title);
#if WXWIN_COMPATIBILITY
wxMenu(const wxString& title, const wxFunction func) wxMenu(const wxString& title, const wxFunction func)
: wxMenuBase(title) : wxMenuBase(title)
{ {
Callback(func); Callback(func);
} }
#endif // WXWIN_COMPATIBILITY
// implementation // implementation
int FindMenuIdByMenuItem( GtkWidget *menuItem ) const; int FindMenuIdByMenuItem( GtkWidget *menuItem ) const;

View File

@@ -175,12 +175,12 @@ public:
{ return FindItem(itemId, itemMenu); } { return FindItem(itemId, itemMenu); }
wxList& GetItems() const { return (wxList &)m_items; } wxList& GetItems() const { return (wxList &)m_items; }
#endif // WXWIN_COMPATIBILITY
// wxWin 1.6x compatible menu event handling // wxWin 1.6x compatible menu event handling
wxFunction GetCallback() const { return m_callback; } wxFunction GetCallback() const { return m_callback; }
void Callback(const wxFunction func) { m_callback = func; } void Callback(const wxFunction func) { m_callback = func; }
wxFunction m_callback; wxFunction m_callback;
#endif // WXWIN_COMPATIBILITY
// unlike FindItem(), this function doesn't recurse but only looks through // unlike FindItem(), this function doesn't recurse but only looks through
// our direct children and also may return the index of the found child if // our direct children and also may return the index of the found child if

View File

@@ -47,13 +47,11 @@ public:
bool ProcessCommand(wxCommandEvent& event); bool ProcessCommand(wxCommandEvent& event);
#if WXWIN_COMPATIBILITY
wxMenu(const wxString& title, const wxFunction func) wxMenu(const wxString& title, const wxFunction func)
: wxMenuBase(title) : wxMenuBase(title)
{ {
Callback(func); Callback(func);
} }
#endif // WXWIN_COMPATIBILITY
//// Motif-specific //// Motif-specific
WXWidget GetButtonWidget() const { return m_buttonWidget; } WXWidget GetButtonWidget() const { return m_buttonWidget; }

View File

@@ -52,13 +52,11 @@ public:
// MSW-specific // MSW-specific
bool ProcessCommand(wxCommandEvent& event); bool ProcessCommand(wxCommandEvent& event);
#if WXWIN_COMPATIBILITY
wxMenu(const wxString& title, const wxFunction func) wxMenu(const wxString& title, const wxFunction func)
: wxMenuBase(title) : wxMenuBase(title)
{ {
Callback(func); Callback(func);
} }
#endif // WXWIN_COMPATIBILITY
// implementation only from now on // implementation only from now on
// ------------------------------- // -------------------------------

View File

@@ -612,7 +612,6 @@ wxChar *wxExpandPath(wxChar *buf, const wxChar *name)
return wxRealPath(buf); return wxRealPath(buf);
} }
/* Contract Paths to be build upon an environment variable /* Contract Paths to be build upon an environment variable
component: component:
@@ -1220,6 +1219,18 @@ wxChar *wxGetTempFileName(const wxString& prefix, wxChar *buf)
#endif #endif
} }
bool wxGetTempFileName(const wxString& prefix, wxString& buf)
{
wxChar buf2[512];
if (wxGetTempFileName(prefix, buf2) != (wxChar*) NULL)
{
buf = buf2;
return TRUE;
}
else
return FALSE;
}
// Get first file name matching given wild card. // Get first file name matching given wild card.
#ifdef __UNIX__ #ifdef __UNIX__

View File

@@ -469,13 +469,11 @@ static void gtk_menu_clicked_callback( GtkWidget *widget, wxMenu *menu )
event.SetEventObject( menu ); event.SetEventObject( menu );
event.SetInt(id ); event.SetInt(id );
#if WXWIN_COMPATIBILITY
if (menu->GetCallback()) if (menu->GetCallback())
{ {
(void) (*(menu->GetCallback())) (*menu, event); (void) (*(menu->GetCallback())) (*menu, event);
return; return;
} }
#endif // WXWIN_COMPATIBILITY
if (menu->GetEventHandler()->ProcessEvent(event)) if (menu->GetEventHandler()->ProcessEvent(event))
return; return;

View File

@@ -469,13 +469,11 @@ static void gtk_menu_clicked_callback( GtkWidget *widget, wxMenu *menu )
event.SetEventObject( menu ); event.SetEventObject( menu );
event.SetInt(id ); event.SetInt(id );
#if WXWIN_COMPATIBILITY
if (menu->GetCallback()) if (menu->GetCallback())
{ {
(void) (*(menu->GetCallback())) (*menu, event); (void) (*(menu->GetCallback())) (*menu, event);
return; return;
} }
#endif // WXWIN_COMPATIBILITY
if (menu->GetEventHandler()->ProcessEvent(event)) if (menu->GetEventHandler()->ProcessEvent(event))
return; return;

View File

@@ -162,14 +162,12 @@ bool wxMenu::ProcessCommand(wxCommandEvent & event)
{ {
bool processed = FALSE; bool processed = FALSE;
#if WXWIN_COMPATIBILITY
// Try a callback // Try a callback
if (m_callback) if (m_callback)
{ {
(void) (*(m_callback)) (*this, event); (void) (*(m_callback)) (*this, event);
processed = TRUE; processed = TRUE;
} }
#endif // WXWIN_COMPATIBILITY
// Try the menu's event handler // Try the menu's event handler
if ( !processed && GetEventHandler()) if ( !processed && GetEventHandler())

View File

@@ -432,14 +432,12 @@ bool wxMenu::ProcessCommand(wxCommandEvent & event)
{ {
bool processed = FALSE; bool processed = FALSE;
#if WXWIN_COMPATIBILITY
// Try a callback // Try a callback
if (m_callback) if (m_callback)
{ {
(void)(*(m_callback))(*this, event); (void)(*(m_callback))(*this, event);
processed = TRUE; processed = TRUE;
} }
#endif // WXWIN_COMPATIBILITY
// Try the menu's event handler // Try the menu's event handler
if ( !processed && GetEventHandler()) if ( !processed && GetEventHandler())

View File

@@ -399,7 +399,7 @@ bool wxToolBar95::CreateTools()
delete [] buttons; delete [] buttons;
// TBBUTTONINFO struct declaration is missing from mingw32 headers // TBBUTTONINFO struct declaration is missing from mingw32 headers
#ifndef __GNUWIN32__ #if !defined(__GNUWIN32__) && !defined(__WATCOMC__)
// adjust the controls size to fit nicely in the toolbar // adjust the controls size to fit nicely in the toolbar
size_t nControls = controlIds.GetCount(); size_t nControls = controlIds.GetCount();
for ( size_t nCtrl = 0; nCtrl < nControls; nCtrl++ ) for ( size_t nCtrl = 0; nCtrl < nControls; nCtrl++ )