Some stubs includes removed from wxMotif; wxNotebook sample hack to make it display;

changes to defs.h and memory.h etc. for Solaris compilation


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1173 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
1998-12-11 16:09:06 +00:00
parent 92976ab62b
commit 5dcf05ae08
28 changed files with 96 additions and 45 deletions

View File

@@ -15,7 +15,11 @@ wxWindows 2.0 for Motif installation
- Edit src/make.env to change options according to your local - Edit src/make.env to change options according to your local
environment. In particular, change WXDIR to where wxWindows is environment. In particular, change WXDIR to where wxWindows is
found on your system. found on your system, or set the WXWIN environment variable
before compilation, e.g.:
export WXWIN=/home/jacs/wx2
Later, there will be a better makefile system Later, there will be a better makefile system
and/or alternate make.env files as per wxWindows 1.68. and/or alternate make.env files as per wxWindows 1.68.
Please feel free to contribute settings files for your environment. Please feel free to contribute settings files for your environment.

View File

@@ -50,7 +50,7 @@ __BORLANDC__ Borland C++
__WATCOMC__ Watcom C++ __WATCOMC__ Watcom C++
__SYMANTECC__ Symantec C++ __SYMANTECC__ Symantec C++
__VISUALC__ VC++ __VISUALC__ VC++
__SUNCC__ __SUNCC__ Sun CC
__XLC__ ?? compiler __XLC__ ?? compiler
wxWindows modes: wxWindows modes:

View File

@@ -41,6 +41,14 @@
#endif #endif
#endif #endif
#if defined(sun) || defined(__SUN__)
# if !defined(__GNUG__)
# ifndef __SUNCC__
# define __SUNCC__
# endif
# endif
#endif
// suppress some Visual C++ warnings // suppress some Visual C++ warnings
#ifdef _MSC_VER #ifdef _MSC_VER
# pragma warning(disable:4244) // cobversion from double to float # pragma warning(disable:4244) // cobversion from double to float
@@ -114,6 +122,9 @@
#define bool unsigned int #define bool unsigned int
#elif defined(__BORLANDC__) && (__BORLANDC__ < 0x500) #elif defined(__BORLANDC__) && (__BORLANDC__ < 0x500)
typedef unsigned int bool; typedef unsigned int bool;
#elif defined(__SUNCC__)
// If we use int, we get identically overloaded functions in config.cpp
typedef unsigned char bool;
#endif #endif
#if ( defined(_MSC_VER) && (_MSC_VER <= 800) ) || defined(__GNUWIN32__) #if ( defined(_MSC_VER) && (_MSC_VER <= 800) ) || defined(__GNUWIN32__)

View File

@@ -53,17 +53,25 @@ void wxDebugFree(void * buf, bool isVect = FALSE);
#undef new #undef new
#endif #endif
#if defined(__SUNCC__)
#define wxUSE_ARRAY_MEMORY_OPERATORS 0
#elif !( defined (_MSC_VER) && (_MSC_VER <= 1020) ) || defined( __MWERKS__)
#define wxUSE_ARRAY_MEMORY_OPERATORS 1
#else
#define wxUSE_ARRAY_MEMORY_OPERATORS 0
#endif
// Added JACS 25/11/98: needed for some compilers // Added JACS 25/11/98: needed for some compilers
void * operator new (size_t size); void * operator new (size_t size);
#if !( defined (_MSC_VER) && (_MSC_VER <= 1020) ) || defined( __MWERKS__) #if wxUSE_ARRAY_MEMORY_OPERATORS
void * operator new[] (size_t size); void * operator new[] (size_t size);
#endif #endif
void * operator new (size_t size, char * fileName, int lineNum); void * operator new (size_t size, char * fileName, int lineNum);
void operator delete (void * buf); void operator delete (void * buf);
#if !( defined (_MSC_VER) && (_MSC_VER <= 1020) ) || defined( __MWERKS__) #if wxUSE_ARRAY_MEMORY_OPERATORS
void * operator new[] (size_t size, char * fileName, int lineNum); void * operator new[] (size_t size, char * fileName, int lineNum);
void operator delete[] (void * buf); void operator delete[] (void * buf);
#endif #endif

View File

@@ -197,15 +197,18 @@ class WXDLLEXPORT wxObject
#endif #endif
// Cause problems for VC++ // Cause problems for VC++
#ifndef _MSC_VER // #ifndef _MSC_VER
#if !defined(_MSC_VER) && wxUSE_ARRAY_MEMORY_OPERATORS
void * operator new[] (size_t size, char * fileName = NULL, int lineNum = 0); void * operator new[] (size_t size, char * fileName = NULL, int lineNum = 0);
void operator delete[] (void * buf); void operator delete[] (void * buf);
#endif #endif
/*
#ifdef __MWERKS__ #ifdef __MWERKS__
void * operator new[] (size_t size, char * fileName , int lineNum = 0); void * operator new[] (size_t size, char * fileName , int lineNum = 0);
void operator delete[] (void * buf); void operator delete[] (void * buf);
#endif #endif
*/
#endif #endif

View File

@@ -44,6 +44,13 @@ bool MyApp::OnInit(void)
#else #else
frame = new MyFrame((wxFrame*) NULL, -1, (char *) "Notebook", wxPoint(-1, -1), wxSize(365, 390), wxDEFAULT_FRAME_STYLE); frame = new MyFrame((wxFrame*) NULL, -1, (char *) "Notebook", wxPoint(-1, -1), wxSize(365, 390), wxDEFAULT_FRAME_STYLE);
// Problem with Motif whereby it doesn't size properly unless
// you set the size again (to a different size than before,
// since SetSize is optimized)
#ifdef __WXMOTIF__
frame->SetSize(-1, -1, 370, 390);
#endif
return TRUE; return TRUE;
#endif #endif
} }
@@ -82,7 +89,7 @@ void MyApp::InitTabView(wxNotebook* notebook, wxWindow* window)
(void)new wxButton(panel1, -1, "Press me", wxPoint(10, 10)); (void)new wxButton(panel1, -1, "Press me", wxPoint(10, 10));
(void)new wxTextCtrl(panel1, -1, "1234", wxPoint(10, 40), wxSize(120, 150)); (void)new wxTextCtrl(panel1, -1, "1234", wxPoint(10, 40), wxSize(120, 150));
notebook->AddPage(panel1, "Cat"); notebook->AddPage(panel1, "Cat", TRUE);
wxPanel *panel2 = new wxPanel(notebook, -1); wxPanel *panel2 = new wxPanel(notebook, -1);
panel2->SetBackgroundColour(wxColour("BLUE")); panel2->SetBackgroundColour(wxColour("BLUE"));

View File

@@ -965,7 +965,7 @@ void * operator new (size_t size)
#endif #endif
} }
#if !( defined (_MSC_VER) && (_MSC_VER <= 1020) ) #if wxUSE_ARRAY_MEMORY_OPERATORS
void * operator new[] (size_t size) void * operator new[] (size_t size)
{ {
#ifdef NO_DEBUG_ALLOCATION #ifdef NO_DEBUG_ALLOCATION
@@ -976,7 +976,7 @@ void * operator new[] (size_t size)
} }
#endif #endif
#if !( defined (_MSC_VER) && (_MSC_VER <= 1020) ) #if wxUSE_ARRAY_MEMORY_OPERATORS
void * operator new[] (size_t size, char * fileName, int lineNum) void * operator new[] (size_t size, char * fileName, int lineNum)
{ {
#ifdef NO_DEBUG_ALLOCATION #ifdef NO_DEBUG_ALLOCATION
@@ -1011,7 +1011,7 @@ void operator delete[](void* pData, char* /* fileName */, int /* lineNum */)
} }
#endif #endif
#if !( defined (_MSC_VER) && (_MSC_VER <= 1020) ) #if wxUSE_ARRAY_MEMORY_OPERATORS
void operator delete[] (void * buf) void operator delete[] (void * buf)
{ {

View File

@@ -125,7 +125,7 @@ void wxObject::operator delete(void* pData, char* /* fileName */, int /* lineNum
#endif #endif
// Cause problems for VC++ - crashes // Cause problems for VC++ - crashes
#ifndef _MSC_VER #if !defined(_MSC_VER) && wxUSE_ARRAY_MEMORY_OPERATORS
void * wxObject::operator new[] (size_t size, char * fileName, int lineNum) void * wxObject::operator new[] (size_t size, char * fileName, int lineNum)
{ {
return wxDebugAlloc(size, fileName, lineNum, TRUE, TRUE); return wxDebugAlloc(size, fileName, lineNum, TRUE, TRUE);

View File

@@ -127,7 +127,7 @@ wxExtHelpController::LoadFile(const wxString& ifile)
file = ifile; file = ifile;
if(! wxDirExists(file)) if(! wxDirExists(file))
return false; return FALSE;
mapFile << file << WXEXTHELP_SEPARATOR << WXEXTHELP_MAPFILE; mapFile << file << WXEXTHELP_SEPARATOR << WXEXTHELP_MAPFILE;
} }
@@ -135,7 +135,7 @@ wxExtHelpController::LoadFile(const wxString& ifile)
mapFile = m_MapFile; mapFile = m_MapFile;
if(! wxFileExists(mapFile)) if(! wxFileExists(mapFile))
return false; return FALSE;
DeleteList(); DeleteList();
m_MapList = new wxList; m_MapList = new wxList;
@@ -143,7 +143,7 @@ wxExtHelpController::LoadFile(const wxString& ifile)
FILE *input = fopen(mapFile.c_str(),"rt"); FILE *input = fopen(mapFile.c_str(),"rt");
if(! input) if(! input)
return false; return FALSE;
do do
{ {
if(fgets(buffer,WXEXTHELP_BUFLEN,input) && *buffer != WXEXTHELP_COMMENTCHAR) if(fgets(buffer,WXEXTHELP_BUFLEN,input) && *buffer != WXEXTHELP_COMMENTCHAR)
@@ -171,7 +171,7 @@ wxExtHelpController::LoadFile(const wxString& ifile)
fclose(input); fclose(input);
m_MapFile = file; // now it's valid m_MapFile = file; // now it's valid
return true; return TRUE;
} }
bool bool
@@ -196,7 +196,7 @@ wxExtHelpController::CallBrowser(wxString const &relativeURL)
<< WXEXTHELP_SEPARATOR << relativeURL << ")"; << WXEXTHELP_SEPARATOR << relativeURL << ")";
success = wxExecute(command); success = wxExecute(command);
if(success != 0 ) // returns PID on success if(success != 0 ) // returns PID on success
return true; return TRUE;
} }
} }
command = m_BrowserName; command = m_BrowserName;
@@ -209,7 +209,7 @@ bool
wxExtHelpController::DisplayContents(void) wxExtHelpController::DisplayContents(void)
{ {
if(! m_NumOfEntries) if(! m_NumOfEntries)
return false; return FALSE;
wxBusyCursor b; // display a busy cursor wxBusyCursor b; // display a busy cursor
return KeywordSearch(""); return KeywordSearch("");
} }
@@ -218,7 +218,7 @@ bool
wxExtHelpController::DisplaySection(int sectionNo) wxExtHelpController::DisplaySection(int sectionNo)
{ {
if(! m_NumOfEntries) if(! m_NumOfEntries)
return false; return FALSE;
wxBusyCursor b; // display a busy cursor wxBusyCursor b; // display a busy cursor
wxNode *node = m_MapList->First(); wxNode *node = m_MapList->First();
@@ -230,7 +230,7 @@ wxExtHelpController::DisplaySection(int sectionNo)
return CallBrowser(entry->url); return CallBrowser(entry->url);
node = node->Next(); node = node->Next();
} }
return false; return FALSE;
} }
bool bool
@@ -243,7 +243,7 @@ bool
wxExtHelpController::KeywordSearch(const wxString& k) wxExtHelpController::KeywordSearch(const wxString& k)
{ {
if(! m_NumOfEntries) if(! m_NumOfEntries)
return false; return FALSE;
wxBusyCursor b; // display a busy cursor wxBusyCursor b; // display a busy cursor
wxString *choices = new wxString[m_NumOfEntries]; wxString *choices = new wxString[m_NumOfEntries];
@@ -282,7 +282,7 @@ wxExtHelpController::KeywordSearch(const wxString& k)
else if(idx == 0) else if(idx == 0)
{ {
wxMessageBox(_("No entries found.")); wxMessageBox(_("No entries found."));
rc = false; rc = FALSE;
} }
else else
{ {
@@ -292,7 +292,7 @@ wxExtHelpController::KeywordSearch(const wxString& k)
if(idx != -1) if(idx != -1)
rc = CallBrowser(urls[idx]); rc = CallBrowser(urls[idx]);
else else
rc = false; rc = FALSE;
} }
delete[] urls; delete[] urls;
delete[] choices; delete[] choices;
@@ -304,7 +304,7 @@ wxExtHelpController::KeywordSearch(const wxString& k)
bool bool
wxExtHelpController::Quit(void) wxExtHelpController::Quit(void)
{ {
return true; return TRUE;
} }
void void

View File

@@ -8,7 +8,7 @@
########################### Programs ################################# ########################### Programs #################################
# Replace this with your own path if necessary # Replace this with your own path if necessary
WXDIR = $(wx) WXDIR = $(WXWIN)
# C++ compiler # C++ compiler
CC = g++ CC = g++

View File

@@ -14,7 +14,7 @@
#pragma implementation "colordlg.h" #pragma implementation "colordlg.h"
#endif #endif
#include "wx/stubs/colordlg.h" #include "wx/motif/colordlg.h"
#if !USE_SHARED_LIBRARY #if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxColourDialog, wxDialog) IMPLEMENT_DYNAMIC_CLASS(wxColourDialog, wxDialog)

View File

@@ -478,7 +478,7 @@ int wxDialog::ShowModal()
XEvent event; XEvent event;
// Loop until we signal that the dialog should be closed // Loop until we signal that the dialog should be closed
while ((wxModalShowingStack.Number() > 0) && (bool)wxModalShowingStack.First()->Data()) while ((wxModalShowingStack.Number() > 0) && ((int)(wxModalShowingStack.First()->Data()) != 0))
{ {
// XtAppProcessEvent((XtAppContext) wxTheApp->GetAppContext(), XtIMAll); // XtAppProcessEvent((XtAppContext) wxTheApp->GetAppContext(), XtIMAll);

View File

@@ -14,7 +14,7 @@
#pragma implementation "fontdlg.h" #pragma implementation "fontdlg.h"
#endif #endif
#include "wx/stubs/fontdlg.h" #include "wx/motif/fontdlg.h"
#include "wx/cmndata.h" #include "wx/cmndata.h"
#if !USE_SHARED_LIBRARY #if !USE_SHARED_LIBRARY

View File

@@ -13,7 +13,7 @@
#pragma implementation "helpxxxx.h" #pragma implementation "helpxxxx.h"
#endif #endif
#include "wx/stubs/helpxxxx.h" #include "wx/motif/helpxxxx.h"
#include <string.h> #include <string.h>

View File

@@ -13,7 +13,7 @@
#pragma implementation "imaglist.h" #pragma implementation "imaglist.h"
#endif #endif
#include "wx/stubs/imaglist.h" #include "wx/motif/imaglist.h"
#if !USE_SHARED_LIBRARY #if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxImageList, wxObject) IMPLEMENT_DYNAMIC_CLASS(wxImageList, wxObject)

View File

@@ -13,8 +13,8 @@
#pragma implementation "listctrl.h" #pragma implementation "listctrl.h"
#endif #endif
#include "wx/stubs/textctrl.h" #include "wx/motif/textctrl.h"
#include "wx/stubs/listctrl.h" #include "wx/motif/listctrl.h"
#if !USE_SHARED_LIBRARY #if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxListCtrl, wxControl) IMPLEMENT_DYNAMIC_CLASS(wxListCtrl, wxControl)

View File

@@ -16,7 +16,7 @@
#include "wx/object.h" #include "wx/object.h"
#include "wx/string.h" #include "wx/string.h"
#include "wx/dc.h" #include "wx/dc.h"
#include "wx/stubs/metafile.h" #include "wx/motif/metafile.h"
#include "wx/clipbrd.h" #include "wx/clipbrd.h"
extern bool wxClipboardIsOpen; extern bool wxClipboardIsOpen;

View File

@@ -13,7 +13,7 @@
#pragma implementation "msgdlg.h" #pragma implementation "msgdlg.h"
#endif #endif
#include "wx/stubs/msgdlg.h" #include "wx/motif/msgdlg.h"
#if !USE_SHARED_LIBRARY #if !USE_SHARED_LIBRARY
IMPLEMENT_CLASS(wxMessageDialog, wxDialog) IMPLEMENT_CLASS(wxMessageDialog, wxDialog)

View File

@@ -400,11 +400,21 @@ void wxNotebook::OnIdle(wxIdleEvent& event)
{ {
static bool s_bFirstTime = TRUE; static bool s_bFirstTime = TRUE;
if ( s_bFirstTime ) { if ( s_bFirstTime ) {
/*
wxSize sz(GetSize());
sz.x ++;
SetSize(sz);
sz.x --;
SetSize(sz);
*/
/*
wxSize sz(GetSize()); wxSize sz(GetSize());
wxSizeEvent sizeEvent(sz, GetId()); wxSizeEvent sizeEvent(sz, GetId());
sizeEvent.SetEventObject(this); sizeEvent.SetEventObject(this);
GetEventHandler()->ProcessEvent(sizeEvent); GetEventHandler()->ProcessEvent(sizeEvent);
Refresh(); Refresh();
*/
s_bFirstTime = FALSE; s_bFirstTime = FALSE;
} }
event.Skip(); event.Skip();

View File

@@ -13,8 +13,8 @@
#pragma implementation "print.h" #pragma implementation "print.h"
#endif #endif
#include "wx/stubs/print.h" #include "wx/motif/print.h"
#include "wx/stubs/printdlg.h" #include "wx/motif/printdlg.h"
#if !USE_SHARED_LIBRARY #if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxPrinter, wxPrinterBase) IMPLEMENT_DYNAMIC_CLASS(wxPrinter, wxPrinterBase)

View File

@@ -14,7 +14,7 @@
#endif #endif
#include "wx/object.h" #include "wx/object.h"
#include "wx/stubs/printdlg.h" #include "wx/motif/printdlg.h"
#include "wx/dcprint.h" #include "wx/dcprint.h"
// Use generic page setup dialog: use your own native one if one exists. // Use generic page setup dialog: use your own native one if one exists.

View File

@@ -17,7 +17,7 @@
// headers // headers
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
#include "wx/stubs/statusbr.h" #include "wx/motif/statusbr.h"
#if !USE_SHARED_LIBRARY #if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxStatusBarXX, wxStatusBar); IMPLEMENT_DYNAMIC_CLASS(wxStatusBarXX, wxStatusBar);

View File

@@ -13,8 +13,8 @@
#pragma implementation "treectrl.h" #pragma implementation "treectrl.h"
#endif #endif
#include "wx/stubs/textctrl.h" #include "wx/motif/textctrl.h"
#include "wx/stubs/treectrl.h" #include "wx/motif/treectrl.h"
#if !USE_SHARED_LIBRARY #if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxTreeCtrl, wxControl) IMPLEMENT_DYNAMIC_CLASS(wxTreeCtrl, wxControl)

View File

@@ -34,10 +34,14 @@
#include <netdb.h> #include <netdb.h>
#include <signal.h> #include <signal.h>
#ifdef __SVR4__ #if defined(__SVR4__) && !defined(__HPUX__)
#include <sys/systeminfo.h> #include <sys/systeminfo.h>
#endif #endif
#if (defined(__SUNCC__) || defined(__CLCC__))
#include <sysent.h>
#endif
#include <Xm/Xm.h> #include <Xm/Xm.h>
#include "wx/motif/private.h" #include "wx/motif/private.h"
@@ -57,7 +61,7 @@ extern wxList wxTopLevelWindows;
// Get full hostname (eg. DoDo.BSn-Germany.crg.de) // Get full hostname (eg. DoDo.BSn-Germany.crg.de)
bool wxGetHostName(char *buf, int maxSize) bool wxGetHostName(char *buf, int maxSize)
{ {
#if defined(SVR4) && !defined(__hpux) #if defined(__SVR4__) && !defined(__HPUX__)
return (sysinfo (SI_HOSTNAME, buf, maxSize) != -1); return (sysinfo (SI_HOSTNAME, buf, maxSize) != -1);
#else /* BSD Sockets */ #else /* BSD Sockets */
char name[255]; char name[255];
@@ -487,7 +491,7 @@ void wxXMergeDatabases (wxApp * theApp, Display * display)
size_t len; size_t len;
environment = GetIniFile (filename, NULL); environment = GetIniFile (filename, NULL);
len = strlen (environment); len = strlen (environment);
#if defined(SVR4) && !defined(__hpux) #if defined(__SVR4__) && !defined(__HPUX__)
(void) sysinfo (SI_HOSTNAME, environment + len, 1024 - len); (void) sysinfo (SI_HOSTNAME, environment + len, 1024 - len);
#else #else
(void) gethostname (environment + len, 1024 - len); (void) gethostname (environment + len, 1024 - len);

View File

@@ -36,11 +36,11 @@
#else #else
#if defined(_AIX) || defined(__xlC__) #if defined(__AIX__) || defined(__xlC__)
#include <sys/socket.h> #include <sys/socket.h>
#include <sys/select.h> #include <sys/select.h>
#else #else
#ifndef DG #ifndef __DATA_GENERAL__
#include <sys/syscall.h> #include <sys/syscall.h>
#endif #endif
#endif #endif

View File

@@ -15,7 +15,7 @@
#include "wx/object.h" #include "wx/object.h"
#include "wx/string.h" #include "wx/string.h"
#include "wx/stubs/wave.h" #include "wx/motif/wave.h"
wxWave::wxWave() wxWave::wxWave()
: m_waveData(NULL), m_waveLength(0), m_isResource(FALSE) : m_waveData(NULL), m_waveLength(0), m_isResource(FALSE)

View File

@@ -680,6 +680,10 @@ bool wxAutomationObject::ConvertOleToVariant(const VARIANTARG& oleVariant, wxVar
variant.MakeNull(); variant.MakeNull();
break; break;
} }
case VT_EMPTY:
{
break; // Ignore Empty Variant, used only during destruction of objects
}
default: default:
{ {
wxLogError("wxAutomationObject::ConvertOleToVariant: Unknown variant value type"); wxLogError("wxAutomationObject::ConvertOleToVariant: Unknown variant value type");

View File

@@ -52,7 +52,7 @@ bool wxMetaFile::SetClipboard(int width, int height)
bool wxMetaFile::Play(wxDC *dc) bool wxMetaFile::Play(wxDC *dc)
{ {
// TODO // TODO
return false; return FALSE;
} }
/* /*