socket-related files in src/msw/makefile.g95.
- Set your WXWIN variable to where wxWindows is installed.
- For Cygwin/Mingw32, use forward slashes in the path, not backslashes.
+ *** IMPORTANT: For Cygwin/Mingw32, use forward slashes in the path, not
+ backslashes.
- Use the makefile.g95 files for compiling wxWindows and samples,
e.g.:
void operator=(const wxPrintSetupData& setupData);
#endif
-#ifdef __WXMSW__
+#if defined(__WXMSW__)
// Convert to/from the DEVMODE structure
void ConvertToNative();
void ConvertFromNative();
// Windows using PostScript print/preview)
// ----------------------------------------------------------------------------
+#if wxUSE_POSTSCRIPT
class WXDLLEXPORT wxGenericPrintDialog : public wxDialog
{
DECLARE_DYNAMIC_CLASS(wxGenericPrintDialog)
wxPrintData& GetPrintData() { return m_printData; }
#endif // wxUSE_POSTSCRIPT
};
+#endif
+ // wxUSE_POSTSCRIPT
class WXDLLEXPORT wxGenericPageSetupDialog : public wxDialog
{
void Resume() { m_state = Continue; }
/// Callback for optional abort button
- void OnCancel(wxEvent& WXUNUSED(event)) { m_state = Canceled; }
+ void OnCancel(wxCommandEvent& WXUNUSED(event)) { m_state = Canceled; }
/// callback to disable "hard" window closing
void OnClose(wxCloseEvent& event);
// ctor & dtor
wxDataObject();
- ~wxDataObject();
+ virtual ~wxDataObject();
// pure virtuals to override
// get the best suited format for our data
virtual bool IsSupportedFormat(wxDataFormat format) const
{ return format == wxDF_BITMAP; }
virtual size_t GetDataSize() const
- { wxASSERT(false); return 0; } // BEMIMP
+ { wxASSERT(FALSE); return 0; } // BEMIMP
virtual void GetDataHere(void *pBuf) const
- { wxASSERT(false); } // BEMIMP
+ { wxASSERT(FALSE); } // BEMIMP
private:
wxBitmap m_bitmap;
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
+/* THIS SHOULD NOT BE USED since you might include it once e.g. in window.h,
+ * then again _AFTER_ you've included windows.h, in which case it won't work
+ * a 2nd time -- JACS
#ifndef _WX_WINUNDEF_H_
#define _WX_WINUNDEF_H_
+ */
// windows.h #defines the following identifiers which are also used in wxWin
#ifdef StartDoc
#undef StartDoc
- #ifdef __MINGW32__
+ #ifdef __GNUWIN32__
#define DOCINFOW DOCINFO
#define DOCINFOA DOCINFO
#endif
// #undef GetNextChild
//endif
-#endif // _WX_WINUNDEF_H_
+// #endif // _WX_WINUNDEF_H_
+
typedef void (wxEvtHandler::*wxNotebookEventFunction)(wxNotebookEvent&);
+// Truncation in 16-bit BC++ means we need to define these differently
+#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, \
NULL \
},
+#endif
+
// ----------------------------------------------------------------------------
// wxNotebook class itself
// ----------------------------------------------------------------------------
#endif
#elif defined(__GNUWIN32__) && !defined(__MINGW32__) // Cygwin (not Mingw32) doesn't have wcslen.h, needed in buffer.h
#define wxUSE_WCHAR_T 0
+ #elif defined(__BORLANDC__) // WIN16 BC++
+ #define wxUSE_WCHAR_T 0
+ #elif defined(__WATCOMC__)
+ #define wxUSE_WCHAR_T 0
#else
// add additional compiler checks if this fails
#define wxUSE_WCHAR_T 1
#define wxSetlocale setlocale
// string.h functions
-#define wxStricmp strcasecmp
+// #define wxStricmp strcasecmp
+
+// Taken from string.h since it tests for platform more correctly
+// portable strcasecmp/_stricmp
+inline int WXDLLEXPORT wxStricmp(const char *psz1, const char *psz2)
+{
+#if defined(__VISUALC__) || ( defined(__MWERKS__) && defined(__INTEL__) )
+ return _stricmp(psz1, psz2);
+#elif defined(__SC__)
+ return _stricmp(psz1, psz2);
+#elif defined(__SALFORDC__)
+ return stricmp(psz1, psz2);
+#elif defined(__BORLANDC__)
+ return stricmp(psz1, psz2);
+#elif defined(__WATCOMC__)
+ return stricmp(psz1, psz2);
+#elif defined(__UNIX__) || defined(__GNUWIN32__)
+ return strcasecmp(psz1, psz2);
+#elif defined(__MWERKS__) && !defined(__INTEL__)
+ register char c1, c2;
+ do {
+ c1 = tolower(*psz1++);
+ c2 = tolower(*psz2++);
+ } while ( c1 && (c1 == c2) );
+
+ return c1 - c2;
+#else
+ // almost all compilers/libraries provide this function (unfortunately under
+ // different names), that's why we don't implement our own which will surely
+ // be more efficient than this code (uncomment to use):
+ /*
+ register char c1, c2;
+ do {
+ c1 = tolower(*psz1++);
+ c2 = tolower(*psz2++);
+ } while ( c1 && (c1 == c2) );
+
+ return c1 - c2;
+ */
+
+ #error "Please define string case-insensitive compare for your OS/compiler"
+#endif // OS/compiler
+}
+
// #define wxStrtok strtok_r // this needs a configure check
// leave the rest to defaults below
#endif
}
-#if defined(__WXMSW__) && defined(__WIN32__)
+#if defined(__WXMSW__) // && defined(__WIN32__)
+#ifdef __WIN32__
static wxString wxGetPrintDlgError()
{
DWORD err = CommDlgExtendedError();
}
return msg;
}
-
-
+#endif
void wxPrintData::ConvertToNative()
{
//// Collation
+#ifndef __WIN16__
devMode->dmCollate = (m_printCollate ? DMCOLLATE_TRUE : DMCOLLATE_FALSE);
devMode->dmFields |= DM_COLLATE;
+#endif
//// Number of copies
//// Collation
+#ifndef __WIN16__
if (devMode->dmFields & DM_COLLATE)
{
if (devMode->dmCollate == DMCOLLATE_TRUE)
else
m_printCollate = FALSE;
}
+#endif
//// Number of copies
#ifdef __GNUWIN32__
pd->lStructSize = 66 ;
#else
-#endif
pd->lStructSize = sizeof(PRINTDLG);
+#endif
pd->hwndOwner = (HWND)NULL;
pd->hDevMode = NULL; // Will be created by PrintDlg
pd->hDevNames = NULL; // Ditto
}
else
#ifdef __WXMSW__
+#ifdef __WIN32__
OutputDebugString((LPCTSTR)buffer) ;
+#else
+ OutputDebugString((const char*) buffer) ;
+#endif
#else
fprintf(stderr, buffer);
#endif
}
else
#ifdef __WXMSW__
+#ifdef __WIN32__
OutputDebugString((LPCTSTR)buffer) ;
+#else
+ OutputDebugString((const char*) buffer) ;
+#endif
#else
fprintf(stderr, buffer);
#endif
#include "wx/gdicmn.h"
#include "wx/intl.h"
#include "wx/imaglist.h"
+#include "wx/icon.h"
#include "wx/generic/dirdlgg.h"
#include <wx/log.h>
#include <wx/settings.h>
#include <wx/generic/imaglist.h>
-#include <wx/generic/notebook.h>
+#include <wx/notebook.h>
#include <wx/dcclient.h>
// ----------------------------------------------------------------------------
m_tabView->SetViewRect(rect);
- m_tabView->Layout();
+ m_tabView->LayoutTabs();
// Need to do it a 2nd time to get the tab height with
// the new view width, since changing the view width changes the
m_tabView->SetViewRect(rect);
- m_tabView->Layout();
+ m_tabView->LayoutTabs();
if (!force && (rect == oldRect))
return FALSE;
// wxWin macros
// ----------------------------------------------------------------------------
+#if !USE_SHARED_LIBRARY
+
#if wxUSE_POSTSCRIPT
-#if !USE_SHARED_LIBRARY
IMPLEMENT_CLASS(wxGenericPrintDialog, wxDialog)
IMPLEMENT_CLASS(wxGenericPrintSetupDialog, wxDialog)
- IMPLEMENT_CLASS(wxGenericPageSetupDialog, wxDialog)
BEGIN_EVENT_TABLE(wxGenericPrintDialog, wxDialog)
EVT_BUTTON(wxID_OK, wxGenericPrintDialog::OnOK)
EVT_BUTTON(wxPRINTID_SETUP, wxGenericPrintDialog::OnSetup)
EVT_RADIOBOX(wxPRINTID_RANGE, wxGenericPrintDialog::OnRange)
END_EVENT_TABLE()
+#endif
+
+ IMPLEMENT_CLASS(wxGenericPageSetupDialog, wxDialog)
BEGIN_EVENT_TABLE(wxGenericPageSetupDialog, wxDialog)
EVT_BUTTON(wxPRINTID_SETUP, wxGenericPageSetupDialog::OnPrinter)
extern wxPrintPaperDatabase *wxThePrintPaperDatabase;
+#if wxUSE_POSTSCRIPT
+
// ============================================================================
// implementation
// ============================================================================
#ifdef __WXMSW__
#include <windows.h>
-
-#ifdef DrawText
-#undef DrawText
-#endif
-
+#include "wx/msw/winundef.h"
#endif
#if !USE_SHARED_LIBRARY
size_t count = children.Count();
for (size_t n=(size_t)(index+1); n<count; ++n)
- if (TagAllChildrenUntilLast(children[n], last_item, select)) return true;
+ if (TagAllChildrenUntilLast(children[n], last_item, select)) return TRUE;
return TagNextChildren(parent, last_item, select);
}
crt_item->SetHilight(select);
RefreshLine(crt_item);
- if (crt_item==last_item) return true;
+ if (crt_item==last_item) return TRUE;
if (crt_item->HasChildren())
{
wxArrayTreeItems& children = crt_item->GetChildren();
size_t count = children.Count();
for ( size_t n = 0; n < count; ++n )
- if (TagAllChildrenUntilLast(children[n], last_item, select)) return true;
+ if (TagAllChildrenUntilLast(children[n], last_item, select)) return TRUE;
}
- return false;
+ return FALSE;
}
void wxTreeCtrl::SelectItemRange(wxGenericTreeItem *item1, wxGenericTreeItem *item2)
// to keep going anyhow !!!
if (is_single)
{
- unselect_others=true;
- extended_select=false;
+ unselect_others=TRUE;
+ extended_select=FALSE;
}
wxGenericTreeItem *item = itemId.m_pItem;
}
else
{
- bool select=true; // the default
+ bool select=TRUE; // the default
// Check if we need to toggle hilight (ctrl mode)
if (!unselect_others)
//static
void wxCaretBase::SetBlinkTime(int milliseconds)
{
+#ifdef __WIN16__
+ ::SetCaretBlinkTime(milliseconds) ;
+#else
if ( !::SetCaretBlinkTime(milliseconds) )
{
wxLogLastError("SetCaretBlinkTime");
}
+#endif
}
// ---------------------------------------------------------------------------
if ( !m_hasCaret )
{
+#ifdef __WIN16__
+ ::CreateCaret(GetWinHwnd(GetWindow()), 0, m_width, m_height) ;
+ m_hasCaret = TRUE;
+#else
if ( !::CreateCaret(GetWinHwnd(GetWindow()), 0, m_width, m_height) )
{
wxLogLastError("CreateCaret");
{
m_hasCaret = TRUE;
}
+#endif
}
return m_hasCaret;
{
m_hasCaret = FALSE;
+#ifdef __WIN16__
+ ::DestroyCaret() ;
+#else
if ( !::DestroyCaret() )
{
wxLogLastError("DestroyCaret");
}
+#endif
}
}
(void)MSWCreateCaret();
}
+#ifdef __WIN16__
+ ::ShowCaret(GetWinHwnd(GetWindow())) ;
+#else
if ( !::ShowCaret(GetWinHwnd(GetWindow())) )
{
wxLogLastError("ShowCaret");
}
+#endif
}
void wxCaret::DoHide()
{
if ( m_hasCaret )
{
+#ifdef __WIN16__
+ ::HideCaret(GetWinHwnd(GetWindow())) ;
+#else
if ( !::HideCaret(GetWinHwnd(GetWindow())) )
{
wxLogLastError("HideCaret");
}
+#endif
}
}
{
if ( m_hasCaret )
{
+#ifdef __WIN16__
+ ::SetCaretPos(m_x, m_y) ;
+#else
if ( !::SetCaretPos(m_x, m_y) )
{
wxLogLastError("SetCaretPos");
}
+#endif
}
//else: we don't have caret right now, nothing to do (this does happen)
}
long y2 = (y+height);
(void)RoundRect(GetHdc(), XLOG2DEV(x), YLOG2DEV(y), XLOG2DEV(x2),
- YLOG2DEV(y2), 2*XLOG2DEV(radius), 2*YLOG2DEV(radius));
+ YLOG2DEV(y2), (int) (2*XLOG2DEV(radius)), (int)( 2*YLOG2DEV(radius)));
CalcBoundingBox(x, y);
CalcBoundingBox(x2, y2);
// created in resopnse to WM_PAINT message - doing this from elsewhere is a
// common programming error among wxWindows programmers and might lead to
// very subtle and difficult to debug refresh/repaint bugs.
- extern bool g_isPainting = FALSE;
+ bool g_isPainting = FALSE;
#endif // __WXDEBUG__
// ===========================================================================
#include "wx/dcmemory.h"
#include <windows.h>
+#include "wx/msw/winundef.h"
#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxMemoryDC, wxDC)
* This will produce a big PCH file.
*/
-#if defined(__BORLANDC__)
-#if !(defined(__WIN32__) || defined(__NT__) || defined(__WIN32__))
-#pragma hdrfile "c:\wx\src\msw\wx.pch"
-#endif
-
-#pragma hdrstart
-#endif
-
#include "wx/wxprec.h"
#ifdef __BORLANDC__
COMMONOBJS = \
$(COMMDIR)\config.obj \
$(COMMDIR)\cmndata.obj \
+ $(COMMDIR)\dcbase.obj \
$(COMMDIR)\docview.obj \
$(COMMDIR)\docmdi.obj \
$(COMMDIR)\dynarray.obj \
$(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF)
<<
+$(COMMDIR)/dcbase.obj: $*.$(SRCSUFF)
+ cl @<<
+$(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF)
+<<
+
$(COMMDIR)/docview.obj: $*.$(SRCSUFF)
cl @<<
$(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF)
gdicmn.obj &
image.obj &
imagpng.obj &
- imagjpeg.obj &
intl.obj &
ipcbase.obj &
helpbase.obj &
sckfile.obj &
sckipc.obj &
sckstrm.obj &
+ sckint.obj &
url.obj &
http.obj &
protocol.obj &
wxchar.obj
# Can't compile these yet under Watcom C++
+# imagjpeg.obj &
# odbc.obj &
# db.obj &
# dbtable.obj &
*$(CCC) $(CPPFLAGS) $(IFLAGS) $<
imagpng.obj: $(COMMDIR)\imagpng.cpp
- *$(CCC) $(CPPFLAGS) $(IFLAGS) $<
+ *$(CCC) $(CPPFLAGS) -i=..\png -i=..\zlib $(IFLAGS) $<
imagjpeg.obj: $(COMMDIR)\imagjpeg.cpp
*$(CCC) $(CPPFLAGS) $(IFLAGS) $<
socket.obj: $(COMMDIR)\socket.cpp
*$(CCC) $(CPPFLAGS) $(IFLAGS) $<
+sckint.obj: $(COMMDIR)\sckint.cpp
+ *$(CCC) $(CPPFLAGS) $(IFLAGS) $<
+
sckaddr.obj: $(COMMDIR)\sckaddr.cpp
*$(CCC) $(CPPFLAGS) $(IFLAGS) $<
rgbText = SetTextColor( hDC, rgbText ) ;
SetBkMode( hDC, nBkMode ) ;
+#ifdef __WIN16__
+ GlobalFreePtr( (unsigned int) lpsz ) ;
+#else
GlobalFreePtr( lpsz ) ;
+#endif
}
}
case VT_BOOL:
{
#if defined(__WATCOMC__) || (defined(_MSC_VER) && (_MSC_VER <= 1000)) //GC
+#ifndef HAVE_BOOL // Can't use bool operator if no native bool type
+ variant = (long) (oleVariant.bool != 0);
+#else
variant = (bool) (oleVariant.bool != 0);
+#endif
#else
variant = (bool) (oleVariant.boolVal != 0);
#endif
void wxTextCtrl::AdjustSpaceLimit()
{
+#ifndef __WIN16__
unsigned int len = ::GetWindowTextLength(GetHwnd()),
limit = ::SendMessage(GetHwnd(), EM_GETLIMITTEXT, 0, 0);
if ( len > limit )
else
::SendMessage(GetHwnd(), EM_LIMITTEXT, limit, 0);
}
+#endif
}
// For Rich Edit controls. Do we need it?
#endif // wxUSE_RESOURCES
// ---------------------------------------------------------------------------
-// helper functiosn for showing a "busy" cursor
+// helper functions for showing a "busy" cursor
// ---------------------------------------------------------------------------
-extern HCURSOR gs_wxBusyCursor = 0; // new, busy cursor
-static HCURSOR gs_wxBusyCursorOld = 0; // old cursor
+HCURSOR gs_wxBusyCursor = 0; // new, busy cursor
+HCURSOR gs_wxBusyCursorOld = 0; // old cursor
static int gs_wxBusyCursorCount = 0;
// Set the cursor to the busy cursor for all windows
void wxWindow::UnpackCtlColor(WXWPARAM wParam, WXLPARAM lParam,
WXWORD *nCtlColor, WXHDC *hdc, WXHWND *hwnd)
{
- *control = (WXHWND)LOWORD(lParam);
+ *hwnd = (WXHWND)LOWORD(lParam);
*nCtlColor = (int)HIWORD(lParam);
*hdc = (WXHDC)wParam;
}
break;
case WM_GETMINMAXINFO:
- processed = HandleGetMinMaxInfo((LPMINMAXINFO)lParam);
+ processed = HandleGetMinMaxInfo((MINMAXINFO*)lParam);
break;
case WM_SETCURSOR:
# Makefile : Builds PNG library for Watcom C++, WIN32
WXDIR = ..\..
+EXTRACPPFLAGS=-i=..\zlib
!include $(WXDIR)\src\makewat.env
cleanall: clean
-#accel.obj: $(MSWDIR)\accel.cpp
-# *$(CCC) $(CPPFLAGS) $(IFLAGS) $<
-
-