misc/afm/*.afm
+src/gtk/dcps.cpp
+
src/motif/*.cpp
src/motif/*.c
src/motif/*.h
src/makesl.env
src/makeprog.sl
src/ntwxwin.mak
+src/maketwin.env
+src/makeprog.twn
src/makefile.bcc
src/makefile.dos
src/makefile.nt
- Use wxImage to load other formats into wxBitmaps, such as PNG, BMP.
+- Printing dialogs need some tidying.
+
Low Priority
------------
when implemented as extra bitmap handlers, the code won't be linked
unless needed. Update: see if wxImage can handle these formats.
-- Print/preview framework in print.cpp (see wxGTK).
-
- Enhance event handling such that you override e.g. left-click
and unless you call the base OnMouseEvent, the click won't be
sent to the button. Required for Dialog Editor.
http://agnes.dida.physik.uni-essen.de/~janjaap/mingw32/index.html
- See also http://web.ukonline.co.uk/julian.smart/wxwin/gnuwin32.htm
+TWIN32 and gcc on Linux
+-----------------------
+
+The wxWindows 2 for Windows port may be compiled using
+the TWIN32 emulator package from www.willows.com. However,
+TWIN32 is by no means finished so this should be taken as
+something to think about for the future, rather than
+a tool for writing products with.
+
+Use makefile.twn in much the same way as makefile.g95, as
+described above. Not all sample makefiles are supplied yet.
+
Notes
-----
#define __WIN95__
#endif
+#if defined(TWIN32) && !defined(__TWIN32__)
+#define __TWIN32__
+#endif
+
#endif // wxMSW
// Make sure the environment is set correctly
#endif
#if ( defined(_MSC_VER) && (_MSC_VER <= 800) ) || defined(__GNUWIN32__) || (defined(__BORLANDC__) && defined(__WIN16__)) || defined(__SC__) || defined(__SALFORDC__)
- #define byte unsigned char
+// Not a good idea, because later system files (e.g. windows.h)
+// may try to define it. Use wxByte instead.
+// #define byte unsigned char
#endif
+typedef unsigned char wxByte;
typedef short int WXTYPE;
typedef int wxWindowID;
// Error codes
// ----------------------------------------------------------------------------
+#ifdef ERR_PARAM
+#undef ERR_PARAM
+#endif
+
/// Standard error codes
enum ErrCode
{
#pragma interface "wave.h"
#endif
-#ifndef byte
-#define byte unsigned char
-#endif
-
#include "wx/object.h"
#ifndef AUDIODEV
public:
wxWave();
wxWave(const wxString& fileName, bool isResource = FALSE);
- wxWave(int size, const byte* data);
+ wxWave(int size, const wxByte* data);
~wxWave();
public:
// Create from resource or file
bool Create(const wxString& fileName, bool isResource = FALSE);
// Create from data
- bool Create(int size, const byte* data);
+ bool Create(int size, const wxByte* data);
bool IsOk() const { return (m_waveData ? TRUE : FALSE); };
bool Play(bool async = TRUE, bool looped = FALSE);
bool Free();
private:
- byte* m_waveData;
+ wxByte* m_waveData;
int m_waveLength;
bool m_isResource;
#pragma interface "wave.h"
#endif
-#ifndef byte
-#define byte unsigned char
-#endif
-
#include "wx/object.h"
#ifndef AUDIODEV
public:
wxWave();
wxWave(const wxString& fileName, bool isResource = FALSE);
- wxWave(int size, const byte* data);
+ wxWave(int size, const wxByte* data);
~wxWave();
public:
// Create from resource or file
bool Create(const wxString& fileName, bool isResource = FALSE);
// Create from data
- bool Create(int size, const byte* data);
+ bool Create(int size, const wxByte* data);
bool IsOk() const { return (m_waveData ? TRUE : FALSE); };
bool Play(bool async = TRUE, bool looped = FALSE);
bool Free();
private:
- byte* m_waveData;
+ wxByte* m_waveData;
int m_waveLength;
bool m_isResource;
inline wxPalette *GetColourMap(void) const { return GetPalette(); }
void SetColourMap(wxPalette *cmap) { SetPalette(*cmap); };
#endif
- inline wxPalette* GetPalette(void) const { return (M_BITMAPDATA ? (& M_BITMAPDATA->m_bitmapPalette) : NULL); }
+ inline wxPalette* GetPalette(void) const { return (M_BITMAPDATA ? (& M_BITMAPDATA->m_bitmapPalette) : (wxPalette*) NULL); }
void SetPalette(const wxPalette& palette);
- inline wxMask *GetMask(void) const { return (M_BITMAPDATA ? M_BITMAPDATA->m_bitmapMask : NULL); }
+ inline wxMask *GetMask(void) const { return (M_BITMAPDATA ? M_BITMAPDATA->m_bitmapMask : (wxMask*) NULL); }
void SetMask(wxMask *mask) ;
inline wxBitmap& operator = (const wxBitmap& bitmap) { if (*this == bitmap) return (*this); Ref(bitmap); return *this; }
void SetHBITMAP(WXHBITMAP bmp);
inline WXHBITMAP GetHBITMAP(void) const { return (M_BITMAPDATA ? M_BITMAPDATA->m_hBitmap : 0); }
inline void SetSelectedInto(wxDC *dc) { if (M_BITMAPDATA) M_BITMAPDATA->m_selectedInto = dc; }
- inline wxDC *GetSelectedInto(void) const { return (M_BITMAPDATA ? M_BITMAPDATA->m_selectedInto : NULL); }
+ inline wxDC *GetSelectedInto(void) const { return (M_BITMAPDATA ? M_BITMAPDATA->m_selectedInto : (wxDC*) NULL); }
bool FreeResource(bool force = FALSE);
// Creates a bitmap that matches the device context's depth, from
inline int GetJoin() const { return (M_PENDATA ? M_PENDATA->m_join : 0); };
inline int GetCap() const { return (M_PENDATA ? M_PENDATA->m_cap : 0); };
inline int GetDashes(wxDash **ptr) const {
- *ptr = (M_PENDATA ? M_PENDATA->m_dash : NULL); return (M_PENDATA ? M_PENDATA->m_nbDash : 0);
+ *ptr = (M_PENDATA ? M_PENDATA->m_dash : (wxDash*) NULL); return (M_PENDATA ? M_PENDATA->m_nbDash : 0);
}
- inline wxBitmap *GetStipple() const { return (M_PENDATA ? (& M_PENDATA->m_stipple) : NULL); };
+ inline wxBitmap *GetStipple() const { return (M_PENDATA ? (& M_PENDATA->m_stipple) : (wxBitmap*) NULL); };
// Internal
bool RealizeResource();
#endif
#if defined(__WIN95__) && defined(__WXDEBUG__) && wxUSE_DBWIN32
+
+#ifndef __TWIN32__
#ifdef OutputDebugString
#undef OutputDebugString
#endif
#define OutputDebugString OutputDebugStringW95
+#endif
+
extern void OutputDebugStringW95(const char*, ...);
#endif
#define wxUSE_OWNER_DRAWN 0
#endif
+#ifdef __TWIN32__
+
+#undef wxUSE_THREADS
+#define wxUSE_THREADS 0
+
+#undef wxUSE_DBWIN32
+#define wxUSE_DBWIN32 0
+
+#undef wxUSE_ODBC
+#define wxUSE_ODBC 0
+
+#endif
+
// Minimal setup e.g. for compiling small utilities
#define MINIMAL_WXWINDOWS_SETUP 0
const wxString& name = wxToolBarNameStr);
// Call default behaviour
- void OnPaint(wxPaintEvent& event) { Default() ; }
- void OnSize(wxSizeEvent& event) { Default() ; }
- void OnKillFocus(wxFocusEvent& event) { Default() ; }
+ void OnPaint(wxPaintEvent& WXUNUSED(event)) { Default() ; }
+ void OnSize(wxSizeEvent& WXUNUSED(event)) { Default() ; }
+ void OnKillFocus(wxFocusEvent& WXUNUSED(event)) { Default() ; }
void OnMouseEvent(wxMouseEvent& event);
// Handle wxToolBar95 events
public:
wxWave();
wxWave(const wxString& fileName, bool isResource = FALSE);
- wxWave(int size, const byte* data);
+ wxWave(int size, const wxByte* data);
~wxWave();
public:
// Create from resource or file
bool Create(const wxString& fileName, bool isResource = FALSE);
// Create from data
- bool Create(int size, const byte* data);
+ bool Create(int size, const wxByte* data);
bool IsOk() const { return (m_waveData ? TRUE : FALSE); };
bool Play(bool async = TRUE, bool looped = FALSE) const;
bool Free();
private:
- byte* m_waveData;
+ wxByte* m_waveData;
int m_waveLength;
bool m_isResource;
};
// Does this window want to accept keyboard focus?
virtual bool AcceptsFocus() const;
- virtual void PrepareDC( wxDC &dc ) {};
+ virtual void PrepareDC( wxDC& WXUNUSED(dc) ) {};
public:
////////////////////////////////////////////////////////////////////////
//// IMPLEMENTATION
inline void wxWindow::SetId(int id) { m_windowId = id; }
inline wxWindow *wxWindow::GetParent() const { return m_windowParent; }
inline void wxWindow::SetParent(wxWindow *p) { m_windowParent = p; }
-inline wxWindow *wxWindow::GetGrandParent() const { return (m_windowParent ? m_windowParent->m_windowParent : NULL); }
+inline wxWindow *wxWindow::GetGrandParent() const { return (m_windowParent ? m_windowParent->m_windowParent : (wxWindow*) NULL); }
inline wxList& wxWindow::GetChildren() const { return (wxList&) *m_children; }
inline wxFont& wxWindow::GetFont() const { return (wxFont&) m_windowFont; }
inline wxString wxWindow::GetName() const { return m_windowName; }
//
//
-#if defined( __GNUWIN32__ ) || defined(__MWERKS__)
+#if (defined( __GNUWIN32__ ) && !defined(__TWIN32__)) || defined(__MWERKS__)
#include <wx/msw/gnuwin32/winresrc.h>
#else
#include <windows.h>
# endif
#endif
-#ifdef __WXGTK__
+#if defined(__WXGTK__) || defined(__WXMOTIF__)
// wxGTK has its own wxPostscriptDC
#undef FindResource
#endif
+#ifdef LoadAccelerators
+#undef LoadAccelerators
+#endif
+
#else
// always include this file (under Unix it's generated by configure)
#include "wx/setup.h"
$(CC) -c $(CPPFLAGS) -o $@ minimal.$(SRCSUFF)
$(OBJDIR)/minimal_resources.o: minimal.rc
- $(RESCOMP) -i minimal.rc -o $(OBJDIR)/minimal_resources.o $(RESFLAGS)
+ $(RESCOMP) $(RCINPUTSWITCH) minimal.rc $(RCOUTPUTSWITCH) $(OBJDIR)/minimal_resources.o $(RESFLAGS)
clean:
rm -f $(OBJECTS) minimal$(GUISUFFIX).exe core *.rsc *.res
dc.DrawLine(0, 0, 200, 200);
dc.DrawLine(200, 0, 0, 200);
- wxIcon my_icon( wxICON(mondrian) );
+ wxIcon my_icon = wxICON(mondrian) ;
dc.DrawIcon( my_icon, 100, 100);
}
#endif
#ifdef __GNUWIN32__
+#ifndef __TWIN32__
#include <sys/unistd.h>
+#endif
+
#define stricmp strcasecmp
#endif
#ifdef _MSC_VER
#include <io.h>
#endif
-#ifdef __GNUWIN32__
+#if defined(__GNUWIN32__) && !defined(__TWIN32__)
#include <sys/unistd.h>
#endif
IMPLEMENT_DYNAMIC_CLASS(wxPrintPaperType, wxObject)
#endif
-#ifndef __WXGTK__
+#if !defined(__WXGTK__) && !defined(__WXMOTIF__)
// these should move into wxPostscriptDC:
double UnderlinePosition = 0.0F;
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
+#ifndef __WXMOTIF__
#ifdef __GNUG__
#pragma implementation
#pragma interface
#endif
+#endif
#include "wx/defs.h"
#include "wx/image.h"
#include "wx/log.h"
+#include <math.h>
+
+#ifdef __WXGTK__
#include "gdk/gdk.h"
#include "gtk/gtk.h"
+#endif
//-----------------------------------------------------------------------------
// start and end of document/page
if (!font.Ok()) return;
m_font = font;
-
+
+#ifdef __WXGTK__
char *name = wxTheFontNameDirectory->GetPostScriptName( m_font.GetFamily(),
m_font.GetWeight(),
m_font.GetStyle() );
<< "/" << name << " findfont\n"
<< YLOG2DEVREL(font.GetPointSize())
<< " scalefont setfont\n";
+#else
+ char buf[100];
+ const char *name;
+ const char *style = "";
+ int Style = m_font.GetStyle ();
+ int Weight = m_font.GetWeight ();
+
+ switch (m_font.GetFamily ())
+ {
+ case wxTELETYPE:
+ case wxMODERN:
+ name = "/Courier";
+ break;
+ case wxSWISS:
+ name = "/Helvetica";
+ break;
+ case wxROMAN:
+// name = "/Times-Roman";
+ name = "/Times"; // Altered by EDZ
+ break;
+ case wxSCRIPT:
+ name = "/Zapf-Chancery-MediumItalic";
+ Style = wxNORMAL;
+ Weight = wxNORMAL;
+ break;
+ default:
+ case wxDEFAULT: // Sans Serif Font
+ name = "/LucidaSans";
+ }
+
+ if (Style == wxNORMAL && (Weight == wxNORMAL || Weight == wxLIGHT))
+ {
+ if (m_font.GetFamily () == wxROMAN)
+ style = "-Roman";
+ else
+ style = "";
+ }
+ else if (Style == wxNORMAL && Weight == wxBOLD)
+ style = "-Bold";
+
+ else if (Style == wxITALIC && (Weight == wxNORMAL || Weight == wxLIGHT))
+ {
+ if (m_font.GetFamily () == wxROMAN)
+ style = "-Italic";
+ else
+ style = "-Oblique";
+ }
+ else if (Style == wxITALIC && Weight == wxBOLD)
+ {
+ if (m_font.GetFamily () == wxROMAN)
+ style = "-BoldItalic";
+ else
+ style = "-BoldOblique";
+ }
+ else if (Style == wxSLANT && (Weight == wxNORMAL || Weight == wxLIGHT))
+ {
+ if (m_font.GetFamily () == wxROMAN)
+ style = "-Italic";
+ else
+ style = "-Oblique";
+ }
+ else if (Style == wxSLANT && Weight == wxBOLD)
+ {
+ if (m_font.GetFamily () == wxROMAN)
+ style = "-BoldItalic";
+ else
+ style = "-BoldOblique";
+ }
+ else
+ style = "";
+
+ strcpy (buf, name);
+ strcat (buf, style);
+ *m_pstream << buf << " findfont\n";
+ // *m_pstream << (m_font.GetPointSize() * m_scaleFactor) << " scalefont setfont\n";
+ // No scale factor in this implementation?
+ *m_pstream << (m_font.GetPointSize()) << " scalefont setfont\n";
+#endif
}
void wxPostScriptDC::SetPen( const wxPen& pen )
Create(sFileName, isResource);
}
-wxWave::wxWave(int size, const byte* data)
+wxWave::wxWave(int size, const wxByte* data)
: m_waveLength(0), m_isResource(FALSE), m_waveData(NULL)
{
Create(size, data);
m_waveLength = (int) fileWave.Length();
- m_waveData = new byte[m_waveLength];
+ m_waveData = new wxByte[m_waveLength];
if (!m_waveData)
{
return FALSE;
}
}
-bool wxWave::Create(int size, const byte* data)
+bool wxWave::Create(int size, const wxByte* data)
{
Free();
m_isResource = FALSE;
m_waveLength=size;
- m_waveData = new byte[size];
+ m_waveData = new wxByte[size];
if (!m_waveData)
{
return FALSE;
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
+#ifndef __WXMOTIF__
#ifdef __GNUG__
#pragma implementation
#pragma interface
#endif
+#endif
#include "wx/defs.h"
#include "wx/image.h"
#include "wx/log.h"
+#include <math.h>
+
+#ifdef __WXGTK__
#include "gdk/gdk.h"
#include "gtk/gtk.h"
+#endif
//-----------------------------------------------------------------------------
// start and end of document/page
if (!font.Ok()) return;
m_font = font;
-
+
+#ifdef __WXGTK__
char *name = wxTheFontNameDirectory->GetPostScriptName( m_font.GetFamily(),
m_font.GetWeight(),
m_font.GetStyle() );
<< "/" << name << " findfont\n"
<< YLOG2DEVREL(font.GetPointSize())
<< " scalefont setfont\n";
+#else
+ char buf[100];
+ const char *name;
+ const char *style = "";
+ int Style = m_font.GetStyle ();
+ int Weight = m_font.GetWeight ();
+
+ switch (m_font.GetFamily ())
+ {
+ case wxTELETYPE:
+ case wxMODERN:
+ name = "/Courier";
+ break;
+ case wxSWISS:
+ name = "/Helvetica";
+ break;
+ case wxROMAN:
+// name = "/Times-Roman";
+ name = "/Times"; // Altered by EDZ
+ break;
+ case wxSCRIPT:
+ name = "/Zapf-Chancery-MediumItalic";
+ Style = wxNORMAL;
+ Weight = wxNORMAL;
+ break;
+ default:
+ case wxDEFAULT: // Sans Serif Font
+ name = "/LucidaSans";
+ }
+
+ if (Style == wxNORMAL && (Weight == wxNORMAL || Weight == wxLIGHT))
+ {
+ if (m_font.GetFamily () == wxROMAN)
+ style = "-Roman";
+ else
+ style = "";
+ }
+ else if (Style == wxNORMAL && Weight == wxBOLD)
+ style = "-Bold";
+
+ else if (Style == wxITALIC && (Weight == wxNORMAL || Weight == wxLIGHT))
+ {
+ if (m_font.GetFamily () == wxROMAN)
+ style = "-Italic";
+ else
+ style = "-Oblique";
+ }
+ else if (Style == wxITALIC && Weight == wxBOLD)
+ {
+ if (m_font.GetFamily () == wxROMAN)
+ style = "-BoldItalic";
+ else
+ style = "-BoldOblique";
+ }
+ else if (Style == wxSLANT && (Weight == wxNORMAL || Weight == wxLIGHT))
+ {
+ if (m_font.GetFamily () == wxROMAN)
+ style = "-Italic";
+ else
+ style = "-Oblique";
+ }
+ else if (Style == wxSLANT && Weight == wxBOLD)
+ {
+ if (m_font.GetFamily () == wxROMAN)
+ style = "-BoldItalic";
+ else
+ style = "-BoldOblique";
+ }
+ else
+ style = "";
+
+ strcpy (buf, name);
+ strcat (buf, style);
+ *m_pstream << buf << " findfont\n";
+ // *m_pstream << (m_font.GetPointSize() * m_scaleFactor) << " scalefont setfont\n";
+ // No scale factor in this implementation?
+ *m_pstream << (m_font.GetPointSize()) << " scalefont setfont\n";
+#endif
}
void wxPostScriptDC::SetPen( const wxPen& pen )
Create(sFileName, isResource);
}
-wxWave::wxWave(int size, const byte* data)
+wxWave::wxWave(int size, const wxByte* data)
: m_waveLength(0), m_isResource(FALSE), m_waveData(NULL)
{
Create(size, data);
m_waveLength = (int) fileWave.Length();
- m_waveData = new byte[m_waveLength];
+ m_waveData = new wxByte[m_waveLength];
if (!m_waveData)
{
return FALSE;
}
}
-bool wxWave::Create(int size, const byte* data)
+bool wxWave::Create(int size, const wxByte* data)
{
Free();
m_isResource = FALSE;
m_waveLength=size;
- m_waveData = new byte[size];
+ m_waveData = new wxByte[size];
if (!m_waveData)
{
return FALSE;
MAKE=make
# LEX
-LEX=flex.exe -t -L
+LEX=flex -t -L
-# YACC. byacc or bison
-# YACC=byacc.exe
-YACC=bison.exe
+# YACC. yacc or bison
+# YACC=yacc
+YACC=bison
-# Resource compiler
+# Settings for Cyginw/Mingw32
RESCOMP=windres.exe
+RCINPUTSWITCH=-i
+RCOUTPUTSWITCH=-o
+RCINCSWITCH=--include-dir
+RCDEFSWITCH=--define
-RESFLAGS=--include-dir $(WXDIR)/include --define __WIN32__ --define __WIN95__ --define __GNUWIN32__
+RESFLAGS=$(RCINCSWITCH) $(WXDIR)/include $(RCDEFSWITCH) __WIN32__ $(RCDEFSWITCH) __WIN95__ $(RCDEFSWITCH) __GNUWIN32__
########################## Compiler flags #############################
#COMPLIBS=-lgcc
# Compiler or system-specific include paths
-COMPPATHS=
+COMPPATHS=-I$(TWINDIR)/include -DTWIN32 -D__TWIN32__
########################## Directories ###############################
# You shouldn't need to change these...
CPPFLAGS = $(XINCLUDE) $(INC) $(OPTIONS) $(GUI) $(DEBUGFLAGS) $(WARN) $(OPT)
CFLAGS = $(XINCLUDE) $(INC) $(OPTIONS) $(GUI) $(DEBUGFLAGS) $(WARN) $(OPT)
-LDFLAGS = -Wl,--subsystem,windows -mwindows -L$(WXDIR)/lib
+WINDOWSLDFLAGS=-Wl,--subsystem,windows -mwindows
+LDFLAGS = $(WINDOWSLDFLAGS) -L$(WXDIR)/lib
.SUFFIXES: .rc .$(RESSUFF) .$(RSCSUFF) .cpp .c
dc.cpp \
dcclient.cpp \
dcmemory.cpp \
+ dcps.cpp \
dcscreen.cpp \
dialog.cpp \
dnd.cpp \
if (m_hAccel)
{
// This function not available in WIN16
-#ifndef __WIN16__
+#if !defined(__WIN16__) && !defined(__TWIN32__)
DestroyAcceleratorTable((HACCEL) m_hAccel);
#endif
}
m_refData = new wxAcceleratorRefData;
HACCEL hAccel =
-#ifdef __WIN32__
+#if defined(__WIN32__) && !defined(__TWIN32__)
#ifdef UNICODE
::LoadAcceleratorsW(wxGetInstance(), (const char *)resource);
#else
wxAcceleratorTable::wxAcceleratorTable(int n, const wxAcceleratorEntry entries[])
{
// Not available in WIN16
-#ifndef __WIN16__
+#if !defined(__WIN16__) && !defined(__TWIN32__)
m_refData = new wxAcceleratorRefData;
ACCEL* arr = new ACCEL[n];
#include <string.h>
#include <ctype.h>
-#if defined(__WIN95__) && !defined(__GNUWIN32__)
+#if (defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__)
#include <commctrl.h>
#endif
char wxPanelClassName[] = "wxPanelClass";
char wxCanvasClassName[] = "wxCanvasClass";
-HICON wxSTD_FRAME_ICON = NULL;
-HICON wxSTD_MDICHILDFRAME_ICON = NULL;
-HICON wxSTD_MDIPARENTFRAME_ICON = NULL;
+HICON wxSTD_FRAME_ICON = (HICON) NULL;
+HICON wxSTD_MDICHILDFRAME_ICON = (HICON) NULL;
+HICON wxSTD_MDIPARENTFRAME_ICON = (HICON) NULL;
-HICON wxDEFAULT_FRAME_ICON = NULL;
-HICON wxDEFAULT_MDICHILDFRAME_ICON = NULL;
-HICON wxDEFAULT_MDIPARENTFRAME_ICON = NULL;
+HICON wxDEFAULT_FRAME_ICON = (HICON) NULL;
+HICON wxDEFAULT_MDICHILDFRAME_ICON = (HICON) NULL;
+HICON wxDEFAULT_MDIPARENTFRAME_ICON = (HICON) NULL;
-HBRUSH wxDisableButtonBrush = 0;
+HBRUSH wxDisableButtonBrush = (HBRUSH) 0;
LRESULT APIENTRY wxWndProc(HWND, UINT, WPARAM, LPARAM);
long wxApp::sm_lastMessageTime = 0;
-#ifdef __WIN95__
- static HINSTANCE gs_hRichEdit = NULL;
+#if defined(__WIN95__) && !defined(__TWIN32__)
+#define wxUSE_RICHEDIT 1
+#else
+#define wxUSE_RICHEDIT 0
+#endif
+
+#if wxUSE_RICHEDIT
+ static HINSTANCE gs_hRichEdit = (HINSTANCE) NULL;
#endif
//// Initialize
#if defined(__WIN95__)
InitCommonControls();
+
+#if wxUSE_RICHEDIT
gs_hRichEdit = LoadLibrary("RICHED32.DLL");
- if (gs_hRichEdit == NULL)
+ if (gs_hRichEdit == (HINSTANCE) NULL)
{
wxMessageBox("Could not initialise Rich Edit DLL");
}
+#endif
+
#endif
int iMsg = 96;
wndclass.cbClsExtra = 0;
wndclass.cbWndExtra = sizeof( DWORD ); // was 4
wndclass.hInstance = wxhInstance;
- wndclass.hIcon = NULL; // wxSTD_FRAME_ICON;
- wndclass.hCursor = LoadCursor( NULL, IDC_ARROW );
+ wndclass.hIcon = (HICON) NULL; // wxSTD_FRAME_ICON;
+ wndclass.hCursor = LoadCursor( (HINSTANCE) NULL, IDC_ARROW );
wndclass.hbrBackground = (HBRUSH)(COLOR_APPWORKSPACE+1) ;
// wndclass.hbrBackground = GetStockObject( WHITE_BRUSH );
wndclass.lpszMenuName = NULL;
wndclass1.cbClsExtra = 0;
wndclass1.cbWndExtra = sizeof( DWORD ); // was 4
wndclass1.hInstance = wxhInstance;
- wndclass1.hIcon = NULL; // wxSTD_MDIPARENTFRAME_ICON;
- wndclass1.hCursor = LoadCursor( NULL, IDC_ARROW );
+ wndclass1.hIcon = (HICON) NULL; // wxSTD_MDIPARENTFRAME_ICON;
+ wndclass1.hCursor = LoadCursor( (HINSTANCE) NULL, IDC_ARROW );
// wndclass1.hbrBackground = (HBRUSH)(COLOR_APPWORKSPACE+1) ;
- wndclass1.hbrBackground = NULL;
+ wndclass1.hbrBackground = (HBRUSH) NULL;
wndclass1.lpszMenuName = NULL;
wndclass1.lpszClassName = wxMDIFrameClassName;
wndclass4.cbClsExtra = 0;
wndclass4.cbWndExtra = sizeof( DWORD ); // was 4
wndclass4.hInstance = wxhInstance;
- wndclass4.hIcon = NULL; // wxSTD_MDICHILDFRAME_ICON;
- wndclass4.hCursor = LoadCursor( NULL, IDC_ARROW );
+ wndclass4.hIcon = (HICON) NULL; // wxSTD_MDICHILDFRAME_ICON;
+ wndclass4.hCursor = LoadCursor( (HINSTANCE) NULL, IDC_ARROW );
// TODO: perhaps this should be NULL so that Windows doesn't
// paint the background itself (would OnEraseBackground duplicate
// this?)
wndclass2.cbClsExtra = 0;
wndclass2.cbWndExtra = sizeof( DWORD ); // was 4
wndclass2.hInstance = wxhInstance;
- wndclass2.hIcon = NULL;
- wndclass2.hCursor = NULL;
+ wndclass2.hIcon = (HICON) NULL;
+ wndclass2.hCursor = (HCURSOR) NULL;
// wndclass2.hbrBackground = (HBRUSH)(COLOR_BTNFACE+1) ;
wndclass2.hbrBackground = (HBRUSH) GetStockObject( LTGRAY_BRUSH );
wndclass2.lpszMenuName = NULL;
wndclass3.cbClsExtra = 0;
wndclass3.cbWndExtra = sizeof( DWORD ); // was 4
wndclass3.hInstance = wxhInstance;
- wndclass3.hIcon = NULL;
- wndclass3.hCursor = NULL;
+ wndclass3.hIcon = (HICON) NULL;
+ wndclass3.hCursor = (HCURSOR) NULL;
// wndclass3.hbrBackground = (HBRUSH)(COLOR_WINDOW+1) ;
- wndclass3.hbrBackground = NULL;
+ wndclass3.hbrBackground = (HBRUSH) NULL;
wndclass3.lpszMenuName = NULL;
wndclass3.lpszClassName = wxCanvasClassName;
if (!RegisterClass( &wndclass3))
wxSetKeyboardHook(FALSE);
#ifdef __WIN95__
- if (gs_hRichEdit != NULL)
+
+#if wxUSE_RICHEDIT
+ if (gs_hRichEdit != (HINSTANCE) NULL)
FreeLibrary(gs_hRichEdit);
#endif
+#endif
+
#if wxUSE_PENWINDOWS
wxCleanUpPenWin();
#endif
// Try translations first; find the youngest window with
// a translation table.
- for (hWnd = msg->hwnd; hWnd != NULL; hWnd = ::GetParent(hWnd))
+ for (hWnd = msg->hwnd; hWnd != (HWND) NULL; hWnd = ::GetParent(hWnd))
{
wxWindow *wnd = wxFindWinFromHandle((WXHWND) hWnd);
if (wnd)
}
// Anyone for a non-translation message? Try youngest descendants first.
- for (hWnd = msg->hwnd; hWnd != NULL; hWnd = ::GetParent(hWnd))
+ for (hWnd = msg->hwnd; hWnd != (HWND) NULL; hWnd = ::GetParent(hWnd))
{
wxWindow *wnd = wxFindWinFromHandle((WXHWND) hWnd);
if (wnd)
}
}
-void wxApp::OnEndSession(wxCloseEvent& event)
+void wxApp::OnEndSession(wxCloseEvent& WXUNUSED(event))
{
if (GetTopWindow())
GetTopWindow()->Close(TRUE);
// For some reason, with MSVC++ 1.5, WinMain isn't linked in properly
// if in a separate file. So include it here to ensure it's linked.
-#if (defined(_MSC_VER) && !defined(__WIN32__)) || defined(__GNUWIN32__)
+#if (defined(_MSC_VER) && !defined(__WIN32__)) || (defined(__GNUWIN32__) && !defined(__TWIN32__))
#include "main.cpp"
#endif
wxTheBitmapList->DeleteObject(this);
}
-bool wxBitmap::FreeResource(bool force)
+bool wxBitmap::FreeResource(bool WXUNUSED(force))
{
if ( !M_BITMAPDATA )
return FALSE;
}
else
{
- HDC dc = GetDC(NULL);
+ HDC dc = GetDC((HWND) NULL);
M_BITMAPDATA->m_hBitmap = (WXHBITMAP) CreateCompatibleBitmap(dc, w, h);
- ReleaseDC(NULL, dc);
+ ReleaseDC((HWND) NULL, dc);
M_BITMAPDATA->m_depth = wxDisplayDepth();
}
if (M_BITMAPDATA->m_hBitmap)
{
wxMemoryDC memDC;
wxBitmap tmpBitmap(this->GetWidth(), this->GetHeight(), dc.GetDepth());
- HPALETTE hPal = NULL;
+ HPALETTE hPal = (HPALETTE) NULL;
LPBITMAPINFO lpDib;
- void *lpBits = NULL;
+ void *lpBits = (void*) NULL;
/*
wxASSERT( this->GetPalette() && this->GetPalette()->Ok() && (this->GetPalette()->GetHPALETTE() != 0) );
IMPLEMENT_DYNAMIC_CLASS(wxBitmapHandler, wxObject)
-bool wxBitmapHandler::Create(wxBitmap *bitmap, void *data, long type, int width, int height, int depth)
+bool wxBitmapHandler::Create(wxBitmap *WXUNUSED(bitmap), void *WXUNUSED(data), long WXUNUSED(type), int WXUNUSED(width), int WXUNUSED(height), int WXUNUSED(depth))
{
return FALSE;
}
-bool wxBitmapHandler::LoadFile(wxBitmap *bitmap, const wxString& name, long type,
- int desiredWidth, int desiredHeight)
+bool wxBitmapHandler::LoadFile(wxBitmap *WXUNUSED(bitmap), const wxString& WXUNUSED(name), long WXUNUSED(type),
+ int WXUNUSED(desiredWidth), int WXUNUSED(desiredHeight))
{
return FALSE;
}
-bool wxBitmapHandler::SaveFile(wxBitmap *bitmap, const wxString& name, int type, const wxPalette *palette)
+bool wxBitmapHandler::SaveFile(wxBitmap *WXUNUSED(bitmap), const wxString& WXUNUSED(name), int WXUNUSED(type), const wxPalette *WXUNUSED(palette))
{
return FALSE;
}
};
IMPLEMENT_DYNAMIC_CLASS(wxBMPResourceHandler, wxBitmapHandler)
-bool wxBMPResourceHandler::LoadFile(wxBitmap *bitmap, const wxString& name, long flags,
- int desiredWidth, int desiredHeight)
+bool wxBMPResourceHandler::LoadFile(wxBitmap *bitmap, const wxString& name, long WXUNUSED(flags),
+ int WXUNUSED(desiredWidth), int WXUNUSED(desiredHeight))
{
// TODO: load colourmap.
M_BITMAPHANDLERDATA->m_hBitmap = (WXHBITMAP) ::LoadBitmap(wxGetInstance(), name);
};
IMPLEMENT_DYNAMIC_CLASS(wxBMPFileHandler, wxBitmapHandler)
-bool wxBMPFileHandler::LoadFile(wxBitmap *bitmap, const wxString& name, long flags,
- int desiredWidth, int desiredHeight)
+bool wxBMPFileHandler::LoadFile(wxBitmap *bitmap, const wxString& name, long WXUNUSED(flags),
+ int WXUNUSED(desiredWidth), int WXUNUSED(desiredHeight))
{
#if wxUSE_IMAGE_LOADING_IN_MSW
wxPalette *palette = NULL;
#endif
}
-bool wxBMPFileHandler::SaveFile(wxBitmap *bitmap, const wxString& name, int type, const wxPalette *pal)
+bool wxBMPFileHandler::SaveFile(wxBitmap *bitmap, const wxString& name, int WXUNUSED(type), const wxPalette *pal)
{
#if wxUSE_IMAGE_LOADING_IN_MSW
wxPalette *actualPalette = (wxPalette *)pal;
return (WXHANDLE) M_BRUSHDATA->m_hBrush;
}
-bool wxBrush::FreeResource(bool force)
+bool wxBrush::FreeResource(bool WXUNUSED(force))
{
if (M_BRUSHDATA && (M_BRUSHDATA->m_hBrush != 0))
{
{
wxBitmap *wxBM = (wxBitmap *)obj;
- HDC hdcMem = CreateCompatibleDC(NULL);
- HDC hdcSrc = CreateCompatibleDC(NULL);
+ HDC hdcMem = CreateCompatibleDC((HDC) NULL);
+ HDC hdcSrc = CreateCompatibleDC((HDC) NULL);
HBITMAP old = (HBITMAP) ::SelectObject(hdcSrc, (HBITMAP) wxBM->GetHBITMAP());
HBITMAP hBitmap = CreateCompatibleBitmap(hdcSrc,
wxBM->GetWidth(), wxBM->GetHeight());
{
#if wxUSE_IMAGE_LOADING_IN_MSW
HBITMAP hBitmap=(HBITMAP) ((wxBitmap *)obj)->GetHBITMAP();
- HANDLE hDIB=BitmapToDIB(hBitmap,NULL); // NULL==uses system palette
+ HANDLE hDIB=BitmapToDIB(hBitmap,(HPALETTE) NULL); // NULL==uses system palette
bool success = (::SetClipboardData(CF_DIB,hDIB) != 0);
#else
bool success=FALSE;
if (!hBitmap)
return NULL;
- HDC hdcMem = CreateCompatibleDC(NULL);
- HDC hdcSrc = CreateCompatibleDC(NULL);
+ HDC hdcMem = CreateCompatibleDC((HDC) NULL);
+ HDC hdcSrc = CreateCompatibleDC((HDC) NULL);
HBITMAP old = (HBITMAP) ::SelectObject(hdcSrc, hBitmap);
GetObject(hBitmap, sizeof(BITMAP), (LPSTR)&bm);
void wxClipboard::Clear()
{
+#if wxUSE_DRAG_AND_DROP
wxNode* node = m_data.First();
while (node)
{
node = node->Next();
}
m_data.Clear();
+#endif
}
bool wxClipboard::Open()
custColours[i] = RGB(m_colourData.custColours[i].Red(), m_colourData.custColours[i].Green(), m_colourData.custColours[i].Blue());
chooseColorStruct.lStructSize = sizeof(CHOOSECOLOR);
- chooseColorStruct.hwndOwner = (HWND) (m_dialogParent ? (HWND) m_dialogParent->GetHWND() : NULL);
+ chooseColorStruct.hwndOwner = (HWND) (m_dialogParent ? (HWND) m_dialogParent->GetHWND() : (HWND) NULL);
chooseColorStruct.rgbResult = RGB(m_colourData.dataColour.Red(), m_colourData.dataColour.Green(), m_colourData.dataColour.Blue());
chooseColorStruct.lpCustColors = custColours;
#include "wx/msw/private.h"
-#if defined(__WIN95__) && !defined(__GNUWIN32__)
+#if (defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__)
#include <commctrl.h>
#endif
#include <io.h>
#include <windows.h>
+#ifndef __TWIN32__
#ifdef __GNUWIN32__
#include "wx/msw/gnuwin32/extra.h"
#endif
+#endif
#include "wx/msw/curicop.h"
#include "wx/msw/curico.h"
{ HICON hIcon;
HANDLE hDIB;
- if( (hDIB = ReadIcon(szFileName, W, H)) == NULL)
+ if( (hDIB = ReadIcon(szFileName, W, H)) == (HANDLE) NULL)
// read the icon DIB from file
- return NULL;
+ return (HICON) NULL;
hIcon = MakeIcon( hDIB, hInst); // create an icon from DIB
GlobalFree( hDIB);
return hIcon;
{ HANDLE hDIB; // Handle to DIB memory
HICON hIcon; // Handle to Icon
- if( (hDIB = ReadCur( szFileName, NULL, W, H)) == NULL)
+ if( (hDIB = ReadCur( szFileName, NULL, W, H)) == (HANDLE) NULL)
// Read cursor DIB
- return NULL;
+ return (HICON) NULL;
hIcon = MakeIcon( hDIB, hInst); // make icon from cursor DIB
GlobalFree( hDIB);
return hIcon;
++nDirEntries;
if((cbHead != sizeof( ICONFILEHEADER)) || (cbRes != sizeof( ICONFILERES)))
- return NULL;
-
+ return (HANDLE) NULL;
// Verify that it's an .ICON file
if( iconFileHead.wResourceType != 1)
- return NULL;
+ return (HANDLE) NULL;
// inserted by P.S.
while( (nDirEntries < iconFileHead.wResourceCount) &&
{
cbRes = _lread( hFile, (LPSTR )&iconFileRes, sizeof( ICONFILERES));
if(cbRes != sizeof( ICONFILERES))
- return NULL;
+ return (HANDLE) NULL;
else
++nDirEntries;
}
// Allocate and lock memory to read in the DIB
hDIB = GlobalAlloc(GHND, iconFileRes.dwDIBSize);
- if(hDIB == NULL)
- return NULL;
+ if(hDIB == (HANDLE) NULL)
+ return (HANDLE) NULL;
+
#ifdef __WINDOWS_386__
lpDIB = (LPBITMAPINFO)MK_FP32(GlobalLock(hDIB));
#else
if( (DWORD )cbBits != iconFileRes.dwDIBSize)
{
GlobalFree( hDIB);
- return NULL;
+ return (HANDLE) NULL;
}
return hDIB;
}
dwBmpSize = (DWORD )(bmpXor.bmWidthBytes * bmpXor.bmHeight * bmpXor.bmPlanes);
hXorDDB = GlobalAlloc( GHND, dwBmpSize);
- if(hXorDDB == NULL)
+ if(hXorDDB == (HANDLE) NULL)
{
// clean up before quitting
DeleteObject( hbmXor);
DeleteDC( hDC);
GlobalUnlock( hDIB);
- return NULL;
+ return (HICON) NULL;
}
#ifdef __WINDOWS_386__
POINT ptHotSpot;
// read cur DIB from file
- if( (hDIB = ReadCur( szFileName, (LPPOINT )&ptHotSpot, W, H)) == NULL)
- return NULL;
+ if( (hDIB = ReadCur( szFileName, (LPPOINT )&ptHotSpot, W, H)) == (HANDLE) NULL)
+ return (HCURSOR) NULL;
hCursor = MakeCursor( hDIB, (LPPOINT )&ptHotSpot, hInst);//create cur from DIB
if(XHot != 0)
*XHot = ptHotSpot.x;
HANDLE hDIB;
POINT ptHotSpot;
- if( (hDIB = ReadIcon( szFileName, W, H)) == NULL)
+ if( (hDIB = ReadIcon( szFileName, W, H)) == (HANDLE) NULL)
//read icon file to get icon DIB
- return NULL;
+ return (HCURSOR) NULL;
// Set the hot spot of the cursor
ptHotSpot.x = XHot;
ptHotSpot.y = YHot;
++nDirEntries;
if((cbHead != sizeof( CURFILEHEADER)) || (cbRes != sizeof( CURFILERES)))
- return NULL;
+ return (HANDLE) NULL;
// Verify that it's an .CUR file
if ((curFileRes.bReserved1 != 0) || (curFileHead.wResourceType != 2))
- return NULL;
+ return (HANDLE) NULL;
// following added by P.S.
while( (nDirEntries < curFileHead.wResourceCount) &&
{
cbRes = _lread( hFile, (LPSTR )&curFileRes, sizeof( CURFILERES));
if(cbRes != sizeof( CURFILERES))
- return NULL;
+ return (HANDLE) NULL;
else
++nDirEntries;
}
// Allocate & lock memory to read in the DIB
hDIB = GlobalAlloc(GHND, curFileRes.dwDIBSize);
- if(hDIB == NULL)
- return NULL;
+ if(hDIB == (HANDLE) NULL)
+ return (HANDLE) NULL;
#ifdef __WINDOWS_386__
lpDIB = (LPBITMAPINFO )MK_FP32(GlobalLock(hDIB));
{
GlobalUnlock( hDIB);
GlobalFree( hDIB);
- return NULL;
+ return (HANDLE) NULL;
}
- if(lpptHotSpot != NULL) // If it is necessary to know the hot spot
+ if(lpptHotSpot != (LPPOINT) NULL) // If it is necessary to know the hot spot
{
lpptHotSpot->x = (int )curFileRes.wXHotspot;
lpptHotSpot->y = (int )curFileRes.wYHotspot;
dwLen = bi.biSize + PaletteSize((LPSTR)&bi);
- hdc = GetDC( NULL);
+ hdc = GetDC( (HWND) NULL);
hdib = GlobalAlloc( GHND, dwLen);
- if (hdib == NULL)
+ if (hdib == (HANDLE) NULL)
{
- ReleaseDC( NULL, hdc);
- return NULL;
+ ReleaseDC( (HWND) NULL, hdc);
+ return (HBITMAP) NULL;
}
#ifdef __WINDOWS_386__
else
{
GlobalFree( hdib);
- ReleaseDC( NULL, hdc);
- return NULL;
+ ReleaseDC( (HWND) NULL, hdc);
+ return (HBITMAP) NULL;
}
// Call GetDIBits with a NON-NULL lpBits parameter, to actually
(LPBITMAPINFO)lpbi, DIB_RGB_COLORS) == 0)
{
GlobalUnlock( hdib);
- hdib = NULL;
- ReleaseDC( NULL, hdc);
- return NULL;
+ hdib = (HANDLE) NULL;
+ ReleaseDC( (HWND) NULL, hdc);
+ return (HBITMAP) NULL;
}
// Finally, create a monochrome DDB, and put the DIB into
GlobalUnlock( hdib);
GlobalFree( hdib);
- ReleaseDC(NULL, hdc);
+ ReleaseDC((HWND) NULL, hdc);
return hbmMono;
}
dwBmpSize = (DWORD )(bmpXor.bmWidthBytes * bmpXor.bmHeight * bmpXor.bmPlanes);
hXorDDB = GlobalAlloc( GHND, dwBmpSize);
- if(hXorDDB == NULL)
+ if(hXorDDB == (HANDLE) NULL)
{ // clean up before quitting
DeleteObject( hbmXor);
DeleteDC( hDC);
GlobalUnlock( hDIB);
- return NULL;
+ return (HCURSOR) NULL;
}
#ifdef __WINDOWS_386__
lpXorDDB = (LPSTR)MK_FP32(GlobalLock( hXorDDB));
NPSTR andBits;
NPSTR xorBits;
- hDC = GetDC(NULL);
+ hDC = GetDC((HWND) NULL);
hDCColor = CreateCompatibleDC(hDC);
hDCMono = CreateCompatibleDC(hDC);
hAndBmp = CreateCompatibleBitmap(hDCMono, 32, 32);
NPSTR andBits;
NPSTR xorBits;
- hDC = GetDC(NULL);
+ hDC = GetDC((HWND) NULL);
hDCColor = CreateCompatibleDC(hDC);
hDCMono = CreateCompatibleDC(hDC);
hAndBmp = CreateCompatibleBitmap(hDCMono, 32, 32);
DeleteDC(hDCMono);
DeleteObject(hAndBmp);
DeleteObject(hXorBmp);
- ReleaseDC(NULL, hDC);
+ ReleaseDC((HWND) NULL, hDC);
#ifndef __WIN32__
LocalUnlock(LocalHandle((WORD) andBits));
LocalUnlock(LocalHandle((WORD) xorBits));
switch (cursor_type)
{
case wxCURSOR_WAIT:
- M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_WAIT);
+ M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor((HINSTANCE) NULL, IDC_WAIT);
break;
case wxCURSOR_IBEAM:
- M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_IBEAM);
+ M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor((HINSTANCE) NULL, IDC_IBEAM);
break;
case wxCURSOR_CROSS:
- M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_CROSS);
+ M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor((HINSTANCE) NULL, IDC_CROSS);
break;
case wxCURSOR_SIZENWSE:
- M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_SIZENWSE);
+ M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor((HINSTANCE) NULL, IDC_SIZENWSE);
break;
case wxCURSOR_SIZENESW:
- M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_SIZENESW);
+ M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor((HINSTANCE) NULL, IDC_SIZENESW);
break;
case wxCURSOR_SIZEWE:
- M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_SIZEWE);
+ M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor((HINSTANCE) NULL, IDC_SIZEWE);
break;
case wxCURSOR_SIZENS:
- M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_SIZENS);
+ M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor((HINSTANCE) NULL, IDC_SIZENS);
break;
case wxCURSOR_CHAR:
{
- M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_ARROW);
+ M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor((HINSTANCE) NULL, IDC_ARROW);
break;
}
case wxCURSOR_HAND:
}
case wxCURSOR_LEFT_BUTTON:
{
- M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_ARROW);
+ M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor((HINSTANCE) NULL, IDC_ARROW);
break;
}
case wxCURSOR_RIGHT_BUTTON:
{
- M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_ARROW);
+ M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor((HINSTANCE) NULL, IDC_ARROW);
break;
}
case wxCURSOR_MIDDLE_BUTTON:
{
- M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_ARROW);
+ M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor((HINSTANCE) NULL, IDC_ARROW);
break;
}
case wxCURSOR_SIZING:
}
default:
case wxCURSOR_ARROW:
- M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_ARROW);
+ M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor((HINSTANCE) NULL, IDC_ARROW);
break;
}
}
// FreeResource(TRUE);
}
-bool wxCursor::FreeResource(bool force)
+bool wxCursor::FreeResource(bool WXUNUSED(force))
{
if (M_CURSORDATA && M_CURSORDATA->m_hCursor && M_CURSORDATA->m_destroyCursor)
{
m_oldPalette = 0;
}
- m_palette = m_palette;
+ m_palette = palette;
if (!m_palette.Ok())
{
double radius = (double)sqrt(dx*dx+dy*dy) ;;
if (x1==x2 && x2==y2)
{
- DrawEllipse(xc,yc,(double)(radius*2.0),(double)(radius*2)) ;
+ DrawEllipse(xc,yc,(long)(radius*2.0),(long)(radius*2.0)) ;
return ;
}
void wxDC::DrawIcon(const wxIcon& icon, long x, long y)
{
-#if defined(__WIN32__) && !defined(__SC__)
+#if defined(__WIN32__) && !defined(__SC__) && !defined(__TWIN32__)
::DrawIconEx((HDC) m_hDC, XLOG2DEV(x), YLOG2DEV(y), (HICON) icon.GetHICON(),
icon.GetWidth(), icon.GetHeight(), 0, 0, DI_NORMAL);
#else
if (m_font.Ok() && m_font.GetResourceHandle())
{
HFONT f = (HFONT) ::SelectObject((HDC) m_hDC, (HFONT) m_font.GetResourceHandle());
- if (f == NULL)
+ if (f == (HFONT) NULL)
{
wxDebugMsg("::SelectObject failed in wxDC::SetFont.");
}
#else
#ifdef UNICODE
::StartDocW((HDC) m_hDC, &docinfo);
+#else
+#ifdef __TWIN32__
+ ::StartDoc((HDC) m_hDC, &docinfo);
#else
::StartDocA((HDC) m_hDC, &docinfo);
#endif
#endif
+#endif
#ifndef __WIN16__
if (ret <= 0)
static void wx_spline_draw_point_array(wxDC *dc)
{
- dc->DrawLines(&wx_spline_point_list, (double)0.0, (double)0.0);
+ dc->DrawLines(&wx_spline_point_list, 0, 0);
wxNode *node = wx_spline_point_list.First();
while (node)
{
wxMemoryDC::wxMemoryDC(void)
{
- m_hDC = (WXHDC) ::CreateCompatibleDC(NULL);
+ m_hDC = (WXHDC) ::CreateCompatibleDC((HDC) NULL);
m_ok = (m_hDC != 0);
m_bOwnsDC = TRUE;
PRINTDLG pd;
pd.lStructSize = sizeof( PRINTDLG );
- pd.hwndOwner=NULL;
+ pd.hwndOwner=(HWND) NULL;
pd.hDevMode=(HANDLE)NULL;
pd.hDevNames=(HANDLE)NULL;
pd.Flags=PD_RETURNDC | PD_NOSELECTION | PD_NOPAGENUMS;
// Create a DC representing the whole screen
wxScreenDC::wxScreenDC(void)
{
- m_hDC = (WXHDC) ::GetDC(NULL);
+ m_hDC = (WXHDC) ::GetDC((HWND) NULL);
m_hDCCount ++;
}
wxScreenDC::~wxScreenDC(void)
{
SelectOldObjects(m_hDC);
- ::ReleaseDC(NULL, (HDC) m_hDC);
+ ::ReleaseDC((HWND) NULL, (HDC) m_hDC);
m_hDC = 0;
m_hDCCount --;
}
#include "wx/msw/private.h"
#include "wx/dde.h"
+#ifndef __TWIN32__
#ifdef __GNUWIN32__
#include "wx/msw/gnuwin32/extra.h"
#endif
+#endif
#include <windows.h>
#include <ddeml.h>
m_serviceName = server_name;
HSZ serviceName = DdeCreateStringHandle(DDEIdInst, (char*) (const char *)server_name, CP_WINANSI);
- if (DdeNameService(DDEIdInst, serviceName, NULL, DNS_REGISTER) == 0)
+ if (DdeNameService(DDEIdInst, serviceName, (HSZ) NULL, DNS_REGISTER) == 0)
{
DDEPrintError();
return FALSE;
HSZ topic_atom = DdeCreateStringHandle(DDEIdInst, (char*) (const char *)topic, CP_WINANSI);
HCONV hConv = DdeConnect(DDEIdInst, serviceName, topic_atom, (PCONVCONTEXT)NULL);
- if (hConv == NULL)
- return NULL;
+ if (hConv == (HCONV) NULL)
+ return (wxConnectionBase*) NULL;
else
{
wxDDEConnection *connection = (wxDDEConnection*) OnMakeConnection();
m_connections.Append(connection);
return connection;
}
- else return NULL;
+ else return (wxConnectionBase*) NULL;
}
}
err = "Unrecognised error type.";
break;
}
- MessageBox(NULL, (LPCSTR)err, "DDE Error", MB_OK | MB_ICONINFORMATION);
+ MessageBox((HWND) NULL, (LPCSTR)err, "DDE Error", MB_OK | MB_ICONINFORMATION);
}
#endif
#include "wx/msw/dib.h"
+#ifndef __TWIN32__
#ifdef __GNUWIN32__
#include "wx/msw/gnuwin32/extra.h"
#endif
+#endif
#ifndef SEEK_CUR
/* flags for _lseek */
dwLen = bi.biSize + PaletteSize(&bi);
- hdc = GetDC(NULL);
+ hdc = GetDC((HWND) NULL);
hpal = SelectPalette(hdc, hpal, FALSE);
RealizePalette(hdc);
GlobalUnlock(hdib);
hdib = NULL;
SelectPalette(hdc, hpal, FALSE);
- ReleaseDC(NULL, hdc);
+ ReleaseDC((HWND) NULL, hdc);
return NULL;
}
#include "wx/msw/gauge95.h"
#include "wx/msw/private.h"
-#if defined(__WIN95__) && !defined(__GNUWIN32__)
+#if (defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__)
#include <commctrl.h>
#endif
#include "wx/msw/imaglist.h"
#include "wx/msw/private.h"
-#ifndef __GNUWIN32__
+#if (defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__)
#include <commctrl.h>
#endif
// 'bitmap'.
int wxImageList::Add(const wxBitmap& bitmap, const wxColour& maskColour)
{
+#ifdef __TWIN32__
+ wxFAIL_MSG("ImageList_AddMasked not implemented in TWIN32");
+ return -1;
+#else
HBITMAP hBitmap1 = (HBITMAP) bitmap.GetHBITMAP();
COLORREF colorRef = PALETTERGB(maskColour.Red(), maskColour.Green(), maskColour.Blue());
return ImageList_AddMasked((HIMAGELIST) GetHIMAGELIST(), hBitmap1, colorRef);
+#endif
}
// Adds a bitmap and mask from an icon.
// 'bitmap' and 'mask'.
bool wxImageList::Replace(int index, const wxBitmap& bitmap, const wxBitmap& mask)
{
+#ifdef __TWIN32__
+ wxFAIL_MSG("ImageList_Replace not implemented in TWIN32");
+ return FALSE;
+#else
HBITMAP hBitmap1 = (HBITMAP) bitmap.GetHBITMAP();
HBITMAP hBitmap2 = 0;
if ( mask.Ok() )
hBitmap2 = (HBITMAP) mask.GetHBITMAP();
return (ImageList_Replace((HIMAGELIST) GetHIMAGELIST(), index, hBitmap1, hBitmap2) != 0);
+#endif
}
/* Not supported by Win95
// Removes the image at the given index.
bool wxImageList::Remove(int index)
{
+#ifdef __TWIN32__
+ wxFAIL_MSG("ImageList_Replace not implemented in TWIN32");
+ return FALSE;
+#else
return (ImageList_Remove((HIMAGELIST) GetHIMAGELIST(), index) != 0);
+#endif
}
// Remove all images
bool wxImageList::Draw(int index, wxDC& dc, int x, int y,
int flags, bool solidBackground)
{
+#ifdef __TWIN32__
+ wxFAIL_MSG("ImageList_Replace not implemented in TWIN32");
+ return FALSE;
+#else
HDC hDC = (HDC) dc.GetHDC();
if ( !hDC )
return FALSE;
return (ImageList_Draw((HIMAGELIST) GetHIMAGELIST(), index, hDC,
x, y, style) != 0);
+#endif
}
#endif
typedef UINT MMRESULT;
#endif
+#ifndef __TWIN32__
#ifdef __GNUWIN32__
#include <wx/msw/gnuwin32/extra.h>
#endif
+#endif
// Why doesn't BC++ have joyGetPosEx?
-#if !defined(__WIN32__) || defined(__BORLANDC__)
+#if !defined(__WIN32__) || defined(__BORLANDC__) || defined(__TWIN32__)
#define NO_JOYGETPOSEX
#endif
int wxJoystick::GetNumberAxes(void) const
{
-#ifdef __WIN32__
+#if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
return 0;
int wxJoystick::GetMaxButtons(void) const
{
-#ifdef __WIN32__
+#if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
return 0;
int wxJoystick::GetMaxAxes(void) const
{
-#ifdef __WIN32__
+#if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
return 0;
int wxJoystick::GetRudderMin(void) const
{
-#ifdef __WIN32__
+#if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
return 0;
int wxJoystick::GetRudderMax(void) const
{
-#ifdef __WIN32__
+#if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
return 0;
int wxJoystick::GetUMin(void) const
{
-#ifdef __WIN32__
+#if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
return 0;
int wxJoystick::GetUMax(void) const
{
-#ifdef __WIN32__
+#if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
return 0;
int wxJoystick::GetVMin(void) const
{
-#ifdef __WIN32__
+#if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
return 0;
int wxJoystick::GetVMax(void) const
{
-#ifdef __WIN32__
+#if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
return 0;
bool wxJoystick::HasRudder(void) const
{
-#ifdef __WIN32__
+#if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
return FALSE;
bool wxJoystick::HasZ(void) const
{
-#ifdef __WIN32__
+#if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
return FALSE;
bool wxJoystick::HasU(void) const
{
-#ifdef __WIN32__
+#if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
return FALSE;
bool wxJoystick::HasV(void) const
{
-#ifdef __WIN32__
+#if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
return FALSE;
bool wxJoystick::HasPOV(void) const
{
-#ifdef __WIN32__
+#if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
return FALSE;
bool wxJoystick::HasPOV4Dir(void) const
{
-#ifdef __WIN32__
+#if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
return FALSE;
bool wxJoystick::HasPOVCTS(void) const
{
-#ifdef __WIN32__
+#if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
return FALSE;
#include <windows.h>
#include <windowsx.h>
+#ifndef __TWIN32__
#ifdef __GNUWIN32__
#include <wx/msw/gnuwin32/extra.h>
#endif
+#endif
#ifdef GetCharWidth
#undef GetCharWidth
#include "wx/msw/private.h"
-#ifndef __GNUWIN32__
+#if (defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__)
#include <commctrl.h>
#endif
+#ifndef __TWIN32__
#ifdef __GNUWIN32__
#include "wx/msw/gnuwin32/extra.h"
#endif
+#endif
static void wxConvertToMSWListItem(const wxListCtrl *ctrl, wxListItem& info, LV_ITEM& tvItem);
static void wxConvertFromMSWListItem(const wxListCtrl *ctrl, wxListItem& info, LV_ITEM& tvItem, HWND getFullInfo = 0);
#if !defined(_WINDLL)
+#ifdef __TWIN32__
+
+extern "C"
+BOOL PASCAL WinMain(HANDLE hInstance, HANDLE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
+
+#else
+
#ifdef __WATCOMC__
int PASCAL
#else
int APIENTRY
#endif
- WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR m_lpCmdLine, int nCmdShow )
+ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow )
+#endif
+// __TWIN32__
+
{
- return wxEntry((WXHINSTANCE) hInstance, (WXHINSTANCE) hPrevInstance, m_lpCmdLine, nCmdShow);
+ return wxEntry((WXHINSTANCE) hInstance, (WXHINSTANCE) hPrevInstance, lpCmdLine, nCmdShow);
}
#endif
# Replace yacc with bison if you run into compilation
# problems with y_tab.c.
+
$(COMMDIR)/y_tab.c: $(COMMDIR)/parser.y
$(YACC) -o $(COMMDIR)/y_tab.c $(COMMDIR)/parser.y
-# mv y.tab.c $(COMMDIR)/y_tab.c
+# If you use e.g. gcc on Unix, uncomment these lines
+# and comment out the above.
+#$(COMMDIR)/y_tab.c: $(COMMDIR)/parser.y
+# $(YACC) $(COMMDIR)/parser.y
+# mv y.tab.c $(COMMDIR)/y_tab.c
# Extra targets
rcparser:
#include "wx/minifram.h"
#include "wx/msw/private.h"
+#ifndef __TWIN32__
#ifdef __GNUWIN32__
#include "wx/msw/gnuwin32/extra.h"
#endif
+#endif
#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxMiniFrame, wxFrame)
if (hWndNext)
child = CreateWindowFromHWND(this, (WXHWND) hWndNext);
- while (hWndNext != NULL)
+ while (hWndNext != (HWND) NULL)
{
hWndNext = ::GetWindow(hWndNext, GW_HWNDNEXT);
if (hWndNext)
#else
#ifdef UNICODE
GetClassNameW((HWND) hWnd, buf, 256);
+#else
+#ifdef __TWIN32__
+ GetClassName((HWND) hWnd, buf, 256);
#else
GetClassNameA((HWND) hWnd, buf, 256);
#endif
+#endif
#endif
wxString str(buf);
{
win = new wxScrollBar;
}
-#if defined(__WIN95__)
+#if defined(__WIN95__) && !defined(__TWIN32__)
else if (str == "MSCTLS_UPDOWN32")
{
win = new wxSpinButton;
#include <windowsx.h> // for SetWindowFont
+#ifndef __TWIN32__
#ifdef __GNUWIN32__
#include "wx/msw/gnuwin32/extra.h"
-#else //!GnuWin32
+#endif
+#endif
+
+#if !defined(__GNUWIN32__) || defined(__TWIN32__)
#include <commctrl.h>
#endif
// Win32 GDI functions and not wxWindows ones. Might help to whoever decides to
// port this code to X. (VZ)
-#if defined(__WIN32__) && !defined(__SC__)
+#if defined(__WIN32__) && !defined(__SC__) && !defined(__TWIN32__)
#define O_DRAW_NATIVE_API // comments below explain why I use it
#endif
ulong *pnMaxValueLen) const
#endif
{
-#ifdef __WIN32__
+#if defined(__WIN32__) && !defined(__TWIN32__)
m_dwLastError = ::RegQueryInfoKey
(
(HKEY) m_hKey,
if ( !Open() )
return FALSE;
- #ifdef __WIN32__
+#if defined(__WIN32__) && !defined(__TWIN32__)
m_dwLastError = RegDeleteValue((HKEY) m_hKey, (char*) (const char*) szValue);
if ( m_dwLastError != ERROR_SUCCESS ) {
wxLogSysError(m_dwLastError, _("can't delete value '%s' from key '%s'"),
#ifdef __WIN32__
bool wxRegKey::SetValue(const char *szValue, long lValue)
{
+#ifdef __TWIN32__
+ wxFAIL_MSG("RegSetValueEx not implemented by TWIN32");
+ return FALSE;
+#else
if ( CONST_CAST Open() ) {
m_dwLastError = RegSetValueEx((HKEY) m_hKey, szValue, (DWORD) RESERVED, REG_DWORD,
(RegString)&lValue, sizeof(lValue));
wxLogSysError(m_dwLastError, _("can't set value of '%s'"),
GetFullName(this, szValue));
return FALSE;
+#endif
}
bool wxRegKey::QueryValue(const char *szValue, long *plValue) const
bool wxRegKey::SetValue(const char *szValue, const wxString& strValue)
{
if ( CONST_CAST Open() ) {
- #ifdef __WIN32__
+#if defined( __WIN32__) && !defined(__TWIN32__)
m_dwLastError = RegSetValueEx((HKEY) m_hKey, szValue, (DWORD) RESERVED, REG_SZ,
(RegString)strValue.c_str(),
strValue.Len() + 1);
if ( lIndex == -1 )
return FALSE;
- #ifdef __WIN32__
+#if defined( __WIN32__) && !defined(__TWIN32__)
char szValueName[1024]; // @@ use RegQueryInfoKey...
DWORD dwValueLen = WXSIZEOF(szValueName);
wxFont wxSystemSettings::GetSystemFont(int index)
{
HFONT hFont = (HFONT) ::GetStockObject(index);
- if ( hFont != NULL )
+ if ( hFont != (HFONT) NULL )
{
LOGFONT lf;
if ( ::GetObject(hFont, sizeof(LOGFONT), &lf) != 0 )
#include "wx/msw/slider95.h"
#include "wx/msw/private.h"
-#if defined(__WIN95__) && !defined(__GNUWIN32__)
+#if (defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__)
#include <commctrl.h>
#endif
#include "wx/wx.h"
#endif
-#if defined(__WIN95__)
+// Can't resolve reference to CreateUpDownControl in
+// TWIN32, but could probably use normal CreateWindow instead.
+
+#if defined(__WIN95__) && !defined(__TWIN32__)
#include "wx/spinbutt.h"
#include "wx/msw/private.h"
-#ifndef __GNUWIN32__
+#if !defined(__GNUWIN32__) || defined(__TWIN32__)
#include <commctrl.h>
#endif
#include <windows.h>
#include <windowsx.h>
-#if !defined(__GNUWIN32__)
+#if !defined(__GNUWIN32__) || defined(__TWIN32__)
#include <commctrl.h>
#endif
#include <windows.h>
-#ifndef __GNUWIN32__
+#if (defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__)
#include <commctrl.h>
#endif
+#ifndef __TWIN32__
#ifdef __GNUWIN32__
#include "wx/msw/gnuwin32/extra.h"
#endif
+#endif
#include "wx/msw/dib.h"
#include "wx/msw/tabctrl.h"
#include "wx/utils.h"
#endif
-#ifdef __WIN95__
+#if defined(__WIN95__) && !defined(__TWIN32__)
#include <windows.h>
#include <string.h>
#include <wx/msw/taskbar.h>
#include <wx/msw/private.h>
+#ifndef __TWIN32__
#ifdef __GNUWIN32__
#include <wx/msw/gnuwin32/extra.h>
#endif
+#endif
#ifdef __SALFORDC__
#include <shellapi.h>
#include <windows.h>
-#ifndef __GNUWIN32__
+#if (defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__)
#include <commctrl.h>
#endif
+#ifndef __TWIN32__
#ifdef __GNUWIN32__
#include "wx/msw/gnuwin32/extra.h"
#endif
+#endif
#include "wx/msw/dib.h"
#include "wx/tbar95.h"
#include <string.h>
-#if defined(__WIN95__) && !defined(__GNUWIN32__)
+#if defined(__WIN95__) && !defined(__TWIN32__)
+#define wxUSE_RICHEDIT 1
+#else
+#define wxUSE_RICHEDIT 0
+#endif
+
+#if wxUSE_RICHEDIT && !defined(__GNUWIN32__)
#include <richedit.h>
#endif
msStyle |= ES_PASSWORD;
char *windowClass = "EDIT";
-#if defined(__WIN95__)
+#if wxUSE_RICHEDIT
if ( m_windowStyle & wxTE_MULTILINE )
{
msStyle |= ES_AUTOVSCROLL;
// If we're in Win95, and we want a simple 2D border,
// then make it an EDIT control instead.
-#if defined(__WIN95__)
+#if wxUSE_RICHEDIT
if (m_windowStyle & wxSIMPLE_BORDER)
{
windowClass = "EDIT";
}
#endif
-#if defined(__WIN95__)
+#if wxUSE_RICHEDIT
if (m_isRich)
{
// Have to enable events
#else
#ifdef UNICODE
GetClassNameW((HWND) hWnd, buf, 256);
+#else
+#ifdef __TWIN32__
+ GetClassName((HWND) hWnd, buf, 256);
#else
GetClassNameA((HWND) hWnd, buf, 256);
#endif
+#endif
#endif
wxString str(buf);
{
HWND hWnd = (HWND) GetHWND();
#ifdef __WIN32__
-#if defined(__WIN95__)
+#if wxUSE_RICHEDIT
if ( m_isRich)
{
CHARRANGE range;
long wxTextCtrl::GetInsertionPoint(void) const
{
-#if defined(__WIN95__)
+#if wxUSE_RICHEDIT
if (m_isRich)
{
CHARRANGE range;
// For Rich Edit controls. Do we need it?
#if 0
-#if defined(__WIN95__)
+#if wxUSE_RICHEDIT
bool wxTextCtrl::MSWNotify(WXWPARAM wParam, WXLPARAM lParam)
{
wxCommandEvent event(0, m_windowId);
#include "wx/msw/private.h"
-#ifndef __GNUWIN32__
+#if (defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__)
#include <commctrl.h>
#endif
#include "wx/msw/private.h"
#include "wx/timer.h"
+#include "wx/intl.h"
#include <windows.h>
#endif
#endif //GNUWIN32
-#ifdef __GNUWIN32__
+#if defined(__GNUWIN32__) && !defined(__TWIN32__)
#include <sys/unistd.h>
#include <sys/stat.h>
#endif //GNUWIN32
// Get full hostname (eg. DoDo.BSn-Germany.crg.de)
bool wxGetHostName(char *buf, int maxSize)
{
-#ifdef __WIN32__
+#if defined(__WIN32__) && !defined(__TWIN32__)
DWORD nSize = maxSize;
return (::GetComputerName(buf, &nSize) != 0);
#else
// Get user ID e.g. jacs
bool wxGetUserId(char *buf, int maxSize)
{
-#if defined(__WIN32__) && !defined(__win32s__)
+#if defined(__WIN32__) && !defined(__win32s__) && !defined(__TWIN32__)
// VZ: why should it be so complicated??
#if 0
// Get free memory in bytes, or -1 if cannot determine amount (e.g. on UNIX)
long wxGetFreeMemory(void)
{
-#if defined(__WIN32__) && !defined(__BORLANDC__)
+#if defined(__WIN32__) && !defined(__BORLANDC__) && !defined(__TWIN32__)
MEMORYSTATUS memStatus;
memStatus.dwLength = sizeof(MEMORYSTATUS);
GlobalMemoryStatus(&memStatus);
{
wxString& strDir = *pstr;
- #ifdef __UNIX__
+ #if defined(__UNIX__) && !defined(__TWIN32__)
const char *szHome = getenv("HOME");
if ( szHome == NULL ) {
// we're homeless...
char *wxLoadUserResource(const wxString& resourceName, const wxString& resourceType)
{
char *s = NULL;
-#ifndef __WIN32__
+#if !defined(__WIN32__) || defined(__TWIN32__)
HRSRC hResource = ::FindResource(wxGetInstance(), WXSTRINGCAST resourceName, WXSTRINGCAST resourceType);
#else
#ifdef UNICODE
// Return TRUE if we have a colour display
bool wxColourDisplay(void)
{
- HDC dc = ::GetDC(NULL);
+ HDC dc = ::GetDC((HWND) NULL);
bool flag;
int noCols = GetDeviceCaps(dc, NUMCOLORS);
if ((noCols == -1) || (noCols > 2))
flag = TRUE;
else
flag = FALSE;
- ReleaseDC(NULL, dc);
+ ReleaseDC((HWND) NULL, dc);
return flag;
}
// Returns depth of screen
int wxDisplayDepth(void)
{
- HDC dc = ::GetDC(NULL);
+ HDC dc = ::GetDC((HWND) NULL);
int planes = GetDeviceCaps(dc, PLANES);
int bitsPerPixel = GetDeviceCaps(dc, BITSPIXEL);
int depth = planes*bitsPerPixel;
- ReleaseDC(NULL, dc);
+ ReleaseDC((HWND) NULL, dc);
return depth;
}
// Get size of display
void wxDisplaySize(int *width, int *height)
{
- HDC dc = ::GetDC(NULL);
+ HDC dc = ::GetDC((HWND) NULL);
*width = GetDeviceCaps(dc, HORZRES); *height = GetDeviceCaps(dc, VERTRES);
- ReleaseDC(NULL, dc);
+ ReleaseDC((HWND) NULL, dc);
}
bool wxDirExists(const wxString& dir)
http://ftp.digital.com/pub/micro/NT/WinSite/programr/dbwin32.zip
*/
-#if !defined(__MWERKS__) && !defined(__SALFORDC__)
+#if !defined(__MWERKS__) && !defined(__SALFORDC__) && !defined(__TWIN32__)
#include <process.h>
#endif
*/
#ifdef _UNICODE
::OutputDebugStringW(achBuffer);
+#else
+#ifdef __TWIN32__
+ ::OutputDebugString(achBuffer);
#else
::OutputDebugStringA(achBuffer);
+#endif
#endif
/* bail if it's not Win95 */
#endif
#ifdef __GNUWIN32__
+#ifndef __TWIN32__
#include <sys/unistd.h>
#include <sys/stat.h>
#endif
+#endif
#ifdef __WIN32__
#include <io.h>
if (command == "")
return 0;
-#ifdef __WIN32__
+#if defined(__WIN32__) && !defined(__TWIN32__)
char * cl;
char * argp;
int clen;
#include <mmsystem.h>
#endif
+#ifndef __TWIN32__
#ifdef __GNUWIN32__
#include "wx/msw/gnuwin32/extra.h"
#endif
+#endif
wxWave::wxWave()
: m_waveData(NULL), m_waveLength(0), m_isResource(FALSE)
Create(sFileName, isResource);
}
-wxWave::wxWave(int size, const byte* data)
+wxWave::wxWave(int size, const wxByte* data)
: m_waveData(NULL), m_waveLength(0), m_isResource(FALSE)
{
Create(size, data);
m_isResource = TRUE;
HRSRC hresInfo;
-#ifdef __WIN32__
+#if defined(__WIN32__) && !defined(__TWIN32__)
hresInfo = ::FindResourceA((HMODULE) wxhInstance, fileName, "WAVE");
#else
hresInfo = ::FindResource((HMODULE) wxhInstance, fileName, "WAVE");
if (waveData)
{
- m_waveData= (byte*)::LockResource(waveData);
+ m_waveData= (wxByte*)::LockResource(waveData);
m_waveLength = (int) ::SizeofResource((HMODULE) wxhInstance, hresInfo);
}
m_waveLength = (int) fileWave.Length();
- m_waveData = (byte*)::GlobalLock(::GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE, m_waveLength));
+ m_waveData = (wxByte*)::GlobalLock(::GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE, m_waveLength));
if (!m_waveData)
return FALSE;
}
}
-bool wxWave::Create(int size, const byte* data)
+bool wxWave::Create(int size, const wxByte* data)
{
Free();
m_isResource = FALSE;
m_waveLength=size;
- m_waveData = (byte*)::GlobalLock(::GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE, m_waveLength));
+ m_waveData = (wxByte*)::GlobalLock(::GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE, m_waveLength));
if (!m_waveData)
return FALSE;
#include <windowsx.h>
#endif
+#ifndef __TWIN32__
#ifdef __GNUWIN32__
#include <wx/msw/gnuwin32/extra.h>
#endif
+#endif
#ifdef GetCharWidth
#undef GetCharWidth
{
// adding NULL hWnd is (first) surely a result of an error and
// (secondly) breaks menu command processing
- wxCHECK_RET( hWnd != NULL, "attempt to add a NULL hWnd to window list" );
+ wxCHECK_RET( hWnd != (HWND) NULL, "attempt to add a NULL hWnd to window list" );
if ( !wxWinHandleList->Find((long)hWnd) )
wxWinHandleList->Append((long)hWnd, win);
{
wxTheKeyboardHookProc = MakeProcInstance((FARPROC) wxKeyboardHook, wxGetInstance());
wxTheKeyboardHook = SetWindowsHookEx(WH_KEYBOARD, (HOOKPROC) wxTheKeyboardHookProc, wxGetInstance(),
-#ifdef __WIN32__
+#if defined(__WIN32__) && !defined(__TWIN32__)
GetCurrentThreadId());
// (DWORD)GetCurrentProcess()); // This is another possibility. Which is right?
#else