Remove MicroWindows support.

MicroWindows (aka Nano-X) support hasn’t been updated since 2010 and last work for it in wxWidgets happened more than 10 years ago.
This commit is contained in:
Tobias Taschner
2015-08-27 10:17:32 +02:00
parent 5f75b7506f
commit f1abb351af
49 changed files with 77 additions and 1845 deletions

44
configure vendored
View File

@@ -1084,7 +1084,6 @@ with_mac
with_wine with_wine
with_msw with_msw
with_directfb with_directfb
with_microwin
with_x11 with_x11
with_qt with_qt
enable_nanox enable_nanox
@@ -2309,7 +2308,6 @@ Optional Packages:
--with-wine use Wine --with-wine use Wine
--with-msw use MS-Windows --with-msw use MS-Windows
--with-directfb use DirectFB --with-directfb use DirectFB
--with-microwin use MicroWindows
--with-x11 use X11 --with-x11 use X11
--with-qt use Qt --with-qt use Qt
--with-libpng use libpng (PNG image format) --with-libpng use libpng (PNG image format)
@@ -3823,13 +3821,12 @@ USE_ALPHA=
NEEDS_D_REENTRANT_FOR_R_FUNCS=0 NEEDS_D_REENTRANT_FOR_R_FUNCS=0
ALL_TOOLKITS="GTK OSX_CARBON OSX_COCOA OSX_IPHONE MICROWIN MOTIF MSW X11 DFB QT" ALL_TOOLKITS="GTK OSX_CARBON OSX_COCOA OSX_IPHONE MOTIF MSW X11 DFB QT"
DEFAULT_wxUSE_GTK=0 DEFAULT_wxUSE_GTK=0
DEFAULT_wxUSE_OSX_CARBON=0 DEFAULT_wxUSE_OSX_CARBON=0
DEFAULT_wxUSE_OSX_COCOA=0 DEFAULT_wxUSE_OSX_COCOA=0
DEFAULT_wxUSE_OSX_IPHONE=0 DEFAULT_wxUSE_OSX_IPHONE=0
DEFAULT_wxUSE_MICROWIN=0
DEFAULT_wxUSE_MOTIF=0 DEFAULT_wxUSE_MOTIF=0
DEFAULT_wxUSE_MSW=0 DEFAULT_wxUSE_MSW=0
DEFAULT_wxUSE_X11=0 DEFAULT_wxUSE_X11=0
@@ -3840,7 +3837,6 @@ DEFAULT_DEFAULT_wxUSE_GTK=0
DEFAULT_DEFAULT_wxUSE_OSX_CARBON=0 DEFAULT_DEFAULT_wxUSE_OSX_CARBON=0
DEFAULT_DEFAULT_wxUSE_OSX_COCOA=0 DEFAULT_DEFAULT_wxUSE_OSX_COCOA=0
DEFAULT_DEFAULT_wxUSE_OSX_IPHONE=0 DEFAULT_DEFAULT_wxUSE_OSX_IPHONE=0
DEFAULT_DEFAULT_wxUSE_MICROWIN=0
DEFAULT_DEFAULT_wxUSE_MOTIF=0 DEFAULT_DEFAULT_wxUSE_MOTIF=0
DEFAULT_DEFAULT_wxUSE_MSW=0 DEFAULT_DEFAULT_wxUSE_MSW=0
DEFAULT_DEFAULT_wxUSE_X11=0 DEFAULT_DEFAULT_wxUSE_X11=0
@@ -4550,12 +4546,6 @@ if test "${with_directfb+set}" = set; then :
fi fi
# Check whether --with-microwin was given.
if test "${with_microwin+set}" = set; then :
withval=$with_microwin; wxUSE_MICROWIN="$withval" CACHE_MICROWIN=1 TOOLKIT_GIVEN=1
fi
# Check whether --with-x11 was given. # Check whether --with-x11 was given.
if test "${with_x11+set}" = set; then : if test "${with_x11+set}" = set; then :
withval=$with_x11; wxUSE_X11="$withval" wxUSE_UNIVERSAL="yes" CACHE_X11=1 TOOLKIT_GIVEN=1 withval=$with_x11; wxUSE_X11="$withval" wxUSE_UNIVERSAL="yes" CACHE_X11=1 TOOLKIT_GIVEN=1
@@ -4702,7 +4692,7 @@ if test "$wxUSE_GUI" = "yes"; then
NUM_TOOLKITS=`expr ${wxUSE_GTK:-0} + ${wxUSE_OSX_CARBON:-0} \ NUM_TOOLKITS=`expr ${wxUSE_GTK:-0} + ${wxUSE_OSX_CARBON:-0} \
+ ${wxUSE_OSX_COCOA:-0} + ${wxUSE_OSX_IPHONE:-0} + ${wxUSE_DFB:-0} \ + ${wxUSE_OSX_COCOA:-0} + ${wxUSE_OSX_IPHONE:-0} + ${wxUSE_DFB:-0} \
+ ${wxUSE_MICROWIN:-0} + ${wxUSE_MOTIF:-0} + ${wxUSE_MSW:-0} \ + ${wxUSE_MOTIF:-0} + ${wxUSE_MSW:-0} \
+ ${wxUSE_X11:-0} + ${wxUSE_QT:-0}` + ${wxUSE_X11:-0} + ${wxUSE_QT:-0}`
@@ -24735,36 +24725,6 @@ $as_echo "yes" >&6; }
fi fi
fi fi
if test "$wxUSE_MICROWIN" = 1; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for MicroWindows" >&5
$as_echo_n "checking for MicroWindows... " >&6; }
if test "x$MICROWINDOWS" = x ; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
$as_echo "not found" >&6; }
as_fn_error $? "Cannot find MicroWindows library. Make sure MICROWINDOWS is set." "$LINENO" 5
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MICROWINDOWS" >&5
$as_echo "$MICROWINDOWS" >&6; }
fi
if test -f $MICROWINDOWS/lib/libmwin.a; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: MicroWindows' libraries found." >&5
$as_echo "MicroWindows' libraries found." >&6; }
else
as_fn_error $? "Cannot find MicroWindows libraries, make sure they are compiled." "$LINENO" 5
fi
TOOLKIT_INCLUDE="-I$MICROWINDOWS/include"
GUI_TK_LIBRARY="-L$MICROWINDOWS/lib -lmwin -lmwengine -mwfonts -mwdrivers -mwinlib"
wxUSE_UNIVERSAL="yes"
TOOLKIT=MICROWIN
GUIDIST=MICROWIN_DIST
TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__WXMSW__ -D__WIN95__ -D__WIN32__ -DMWIN -DMICROWIN_NOCONTROLS -DMICROWIN_TODO=1"
fi
if test "$wxUSE_X11" = 1 -o "$wxUSE_MOTIF" = 1; then if test "$wxUSE_X11" = 1 -o "$wxUSE_MOTIF" = 1; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for X" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X" >&5
$as_echo_n "checking for X... " >&6; } $as_echo_n "checking for X... " >&6; }

View File

@@ -99,7 +99,7 @@ NEEDS_D_REENTRANT_FOR_R_FUNCS=0
dnl the list of all available toolkits dnl the list of all available toolkits
dnl dnl
dnl update NUM_TOOLKITS calculation below when adding a new toolkit here! dnl update NUM_TOOLKITS calculation below when adding a new toolkit here!
ALL_TOOLKITS="GTK OSX_CARBON OSX_COCOA OSX_IPHONE MICROWIN MOTIF MSW X11 DFB QT" ALL_TOOLKITS="GTK OSX_CARBON OSX_COCOA OSX_IPHONE MOTIF MSW X11 DFB QT"
dnl NB: these wxUSE_XXX constants have value of 0 or 1 unlike all the other ones dnl NB: these wxUSE_XXX constants have value of 0 or 1 unlike all the other ones
dnl which are either yes or no dnl which are either yes or no
@@ -107,7 +107,6 @@ DEFAULT_wxUSE_GTK=0
DEFAULT_wxUSE_OSX_CARBON=0 DEFAULT_wxUSE_OSX_CARBON=0
DEFAULT_wxUSE_OSX_COCOA=0 DEFAULT_wxUSE_OSX_COCOA=0
DEFAULT_wxUSE_OSX_IPHONE=0 DEFAULT_wxUSE_OSX_IPHONE=0
DEFAULT_wxUSE_MICROWIN=0
DEFAULT_wxUSE_MOTIF=0 DEFAULT_wxUSE_MOTIF=0
DEFAULT_wxUSE_MSW=0 DEFAULT_wxUSE_MSW=0
DEFAULT_wxUSE_X11=0 DEFAULT_wxUSE_X11=0
@@ -121,7 +120,6 @@ DEFAULT_DEFAULT_wxUSE_GTK=0
DEFAULT_DEFAULT_wxUSE_OSX_CARBON=0 DEFAULT_DEFAULT_wxUSE_OSX_CARBON=0
DEFAULT_DEFAULT_wxUSE_OSX_COCOA=0 DEFAULT_DEFAULT_wxUSE_OSX_COCOA=0
DEFAULT_DEFAULT_wxUSE_OSX_IPHONE=0 DEFAULT_DEFAULT_wxUSE_OSX_IPHONE=0
DEFAULT_DEFAULT_wxUSE_MICROWIN=0
DEFAULT_DEFAULT_wxUSE_MOTIF=0 DEFAULT_DEFAULT_wxUSE_MOTIF=0
DEFAULT_DEFAULT_wxUSE_MSW=0 DEFAULT_DEFAULT_wxUSE_MSW=0
DEFAULT_DEFAULT_wxUSE_X11=0 DEFAULT_DEFAULT_wxUSE_X11=0
@@ -433,7 +431,6 @@ AC_ARG_WITH(mac, [ --with-mac same as --with-osx], [wxUS
AC_ARG_WITH(wine, [ --with-wine use Wine], [wxUSE_WINE="$withval" CACHE_WINE=1]) AC_ARG_WITH(wine, [ --with-wine use Wine], [wxUSE_WINE="$withval" CACHE_WINE=1])
AC_ARG_WITH(msw, [ --with-msw use MS-Windows], [wxUSE_MSW="$withval" CACHE_MSW=1 TOOLKIT_GIVEN=1]) AC_ARG_WITH(msw, [ --with-msw use MS-Windows], [wxUSE_MSW="$withval" CACHE_MSW=1 TOOLKIT_GIVEN=1])
AC_ARG_WITH(directfb, [ --with-directfb use DirectFB], [wxUSE_DFB="$withval" wxUSE_UNIVERSAL="yes" CACHE_DFB=1 TOOLKIT_GIVEN=1]) AC_ARG_WITH(directfb, [ --with-directfb use DirectFB], [wxUSE_DFB="$withval" wxUSE_UNIVERSAL="yes" CACHE_DFB=1 TOOLKIT_GIVEN=1])
AC_ARG_WITH(microwin, [ --with-microwin use MicroWindows], [wxUSE_MICROWIN="$withval" CACHE_MICROWIN=1 TOOLKIT_GIVEN=1])
AC_ARG_WITH(x11, [ --with-x11 use X11], [wxUSE_X11="$withval" wxUSE_UNIVERSAL="yes" CACHE_X11=1 TOOLKIT_GIVEN=1]) AC_ARG_WITH(x11, [ --with-x11 use X11], [wxUSE_X11="$withval" wxUSE_UNIVERSAL="yes" CACHE_X11=1 TOOLKIT_GIVEN=1])
AC_ARG_WITH(qt, [ --with-qt use Qt], [wxUSE_QT="$withval" CACHE_QT=1 TOOLKIT_GIVEN=1]) AC_ARG_WITH(qt, [ --with-qt use Qt], [wxUSE_QT="$withval" CACHE_QT=1 TOOLKIT_GIVEN=1])
WX_ARG_ENABLE(nanox, [ --enable-nanox use NanoX], wxUSE_NANOX) WX_ARG_ENABLE(nanox, [ --enable-nanox use NanoX], wxUSE_NANOX)
@@ -490,7 +487,7 @@ if test "$wxUSE_GUI" = "yes"; then
dnl this? what about using ALL_TOOLKITS? TODO) dnl this? what about using ALL_TOOLKITS? TODO)
NUM_TOOLKITS=`expr ${wxUSE_GTK:-0} + ${wxUSE_OSX_CARBON:-0} \ NUM_TOOLKITS=`expr ${wxUSE_GTK:-0} + ${wxUSE_OSX_CARBON:-0} \
+ ${wxUSE_OSX_COCOA:-0} + ${wxUSE_OSX_IPHONE:-0} + ${wxUSE_DFB:-0} \ + ${wxUSE_OSX_COCOA:-0} + ${wxUSE_OSX_IPHONE:-0} + ${wxUSE_DFB:-0} \
+ ${wxUSE_MICROWIN:-0} + ${wxUSE_MOTIF:-0} + ${wxUSE_MSW:-0} \ + ${wxUSE_MOTIF:-0} + ${wxUSE_MSW:-0} \
+ ${wxUSE_X11:-0} + ${wxUSE_QT:-0}` + ${wxUSE_X11:-0} + ${wxUSE_QT:-0}`
@@ -2915,32 +2912,6 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config
) )
fi fi
if test "$wxUSE_MICROWIN" = 1; then
AC_MSG_CHECKING(for MicroWindows)
if test "x$MICROWINDOWS" = x ; then
AC_MSG_RESULT(not found)
AC_MSG_ERROR([Cannot find MicroWindows library. Make sure MICROWINDOWS is set.])
else
AC_MSG_RESULT($MICROWINDOWS)
fi
if test -f $MICROWINDOWS/lib/libmwin.a; then
AC_MSG_RESULT(MicroWindows' libraries found.)
else
AC_MSG_ERROR([Cannot find MicroWindows libraries, make sure they are compiled.])
fi
TOOLKIT_INCLUDE="-I$MICROWINDOWS/include"
GUI_TK_LIBRARY="-L$MICROWINDOWS/lib -lmwin -lmwengine -mwfonts -mwdrivers -mwinlib"
wxUSE_UNIVERSAL="yes"
TOOLKIT=MICROWIN
GUIDIST=MICROWIN_DIST
TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__WXMSW__ -D__WIN95__ -D__WIN32__ -DMWIN -DMICROWIN_NOCONTROLS -DMICROWIN_TODO=1"
fi
dnl common part of X11 and Motif port checks dnl common part of X11 and Motif port checks
if test "$wxUSE_X11" = 1 -o "$wxUSE_MOTIF" = 1; then if test "$wxUSE_X11" = 1 -o "$wxUSE_MOTIF" = 1; then
dnl use standard macros to check for X headers/libs, this brings dnl use standard macros to check for X headers/libs, this brings

View File

@@ -1,86 +0,0 @@
diff -rbu2 ../microwindows-0.89pre8.orig/src/config ./src/config
--- ../microwindows-0.89pre8.orig/src/config Fri Dec 21 14:07:18 2001
+++ ./src/config Fri Dec 21 14:14:37 2001
@@ -47,7 +47,7 @@
#
####################################################################
-OPTIMIZE = Y
-DEBUG = N
-VERBOSE = N
+OPTIMIZE = N
+DEBUG = Y
+VERBOSE = Y
####################################################################
@@ -191,5 +191,5 @@
#
####################################################################
-ERASEMOVE = Y
+ERASEMOVE = N
UPDATEREGIONS = Y
@@ -216,5 +216,5 @@
# X Window screen, mouse and kbd drivers
-X11 = N
+X11 = Y
ifeq ($(X11), Y)
diff -rbu2 ../microwindows-0.89pre8.orig/src/mwin/winevent.c ./src/mwin/winevent.c
--- ../microwindows-0.89pre8.orig/src/mwin/winevent.c Fri Dec 21 14:07:21 2001
+++ ./src/mwin/winevent.c Fri Dec 21 14:10:59 2001
@@ -167,5 +167,5 @@
/* then possibly send user mouse message*/
- if(hittest == HTCLIENT) {
+ if(hittest == HTCLIENT || hwnd == GetCapture()) {
pt.x = cursorx;
pt.y = cursory;
Only in ./src/mwin: winevent.c~
diff -rbu2 ../microwindows-0.89pre8.orig/src/mwin/winuser.c ./src/mwin/winuser.c
--- ../microwindows-0.89pre8.orig/src/mwin/winuser.c Fri Dec 21 14:07:21 2001
+++ ./src/mwin/winuser.c Fri Dec 21 14:10:59 2001
@@ -137,7 +137,11 @@
}
+/*
+ * A helper function for sharing code between PeekMessage and GetMessage
+ */
+
BOOL WINAPI
-PeekMessage(LPMSG lpMsg, HWND hwnd, UINT uMsgFilterMin, UINT uMsgFilterMax,
- UINT wRemoveMsg)
+PeekMessageHelper(LPMSG lpMsg, HWND hwnd, UINT uMsgFilterMin, UINT uMsgFilterMax,
+ UINT wRemoveMsg, BOOL returnIfEmptyQueue)
{
HWND wp;
@@ -146,4 +150,8 @@
/* check if no messages in queue*/
if(mwMsgHead.head == NULL) {
+ /* Added by JACS so it doesn't reach MwSelect */
+ if (returnIfEmptyQueue)
+ return FALSE;
+
#if PAINTONCE
/* check all windows for pending paint messages*/
@@ -177,4 +185,12 @@
BOOL WINAPI
+PeekMessage(LPMSG lpMsg, HWND hwnd, UINT uMsgFilterMin, UINT uMsgFilterMax,
+ UINT wRemoveMsg)
+{
+ /* Never wait in MwSelect: pass TRUE */
+ return PeekMessageHelper(lpMsg, hwnd, uMsgFilterMin, uMsgFilterMax, wRemoveMsg, TRUE);
+}
+
+BOOL WINAPI
GetMessage(LPMSG lpMsg,HWND hwnd,UINT wMsgFilterMin,UINT wMsgFilterMax)
{
@@ -183,5 +199,6 @@
* so this code will work
*/
- while(!PeekMessage(lpMsg, hwnd, wMsgFilterMin, wMsgFilterMax,PM_REMOVE))
+ /* Always wait in MwSelect if there are messages: pass FALSE */
+ while(!PeekMessageHelper(lpMsg, hwnd, wMsgFilterMin, wMsgFilterMax,PM_REMOVE, FALSE))
continue;
return lpMsg->message != WM_QUIT;

View File

@@ -1,340 +0,0 @@
wxMicroWindows port
===================
Warning: As of 2007-07-17 this port probably doesn't build any more.
Please don't expect it to work out of the box currently.
Julian Smart 2001-12-08
This is a port of wxWidgets to MicroWindows, under Linux.
Widgets are supplied by the wxUniversal project, while the
underlying port uses the Windows ports with small modifications
for the MicroWindows API.
=== NOTE: ===
Current efforts are being concentrated on a port to Nano-X,
which potentially offers greater flexibility than the WIN32
API of MicroWindows, such as the ability to run multiple
Nano-X processes simultaneously. Please see
../docs/x11/readme-nanox.txt for information.
There are many things missing from MicroWindows that will
make the port quite limited for the time being.
In particular, only one WIN32 app may be run at a time.
Note that you can gain confidence in the WIN32/wxUniversal
combination by compiling wxUniversal under Windows using VC++,
using src/wxUniv.dsp. You can compile the minimal
and widgets samples in wxUniversal mode using the
UnivDebug and UnivRelease targets. Most of the code is shared
between this combination, and the wxMicroWindows port.
Installation
============
MicroWindows:
- unarchive MicroWindows 0.89pre8
- change 'config' to use X11 and any other options you feel fit.
Suggestions for changes to the defaults:
ERASEMOVE=N (otherwise moving windows will look messy)
X11=Y
OPTIMIZE=N
DEBUG=Y
VERBOSE=Y
Note: these are already applied by the patch below.
- apply microwindows.patches (from wxWidgets:
docs/microwin/microwindows.patches) to fix PeekMessage
and other issues. If the patch doesn't apply automatically,
you may need to apply it by hand, and the relevant changed
functions are given at the end of this file for convenience.
Example patch command:
% cd microwindows-0.89pre8.orig
% patch -p0 < ~/wx2/docs/microwin/microwindows.patches
- compile by typing 'make' from within the MicroWindows src directory
wxMicroWindows:
- Download wxMSW 2.3.4 or greater, or get it from CVS
- Many settings in include/wx/setup.h have to be disabled. As contents
of this file keeps changing, it's impossible to say what exactly should be
disabled but it probably makes sense to disable as much as possible
initially, make sure that the build works and then add features as needed.
- EITHER:
o set the MICROWINDOWS environment variable, e.g.:
% export MICROWINDOWS=/home/julians/local/microwindows/microwindows-0.89pre8/src
OR:
o change the TOP variable at the top of src/msw/makefile.mic
to reflect where MicroWindows is installed
- type 'make -f makefile.mic all' from src/msw. To clean, use
cleanwx and NOT clean since that will clean MicroWindows itself
- to make the sample, cd into samples/minimal, edit the TOP variable
(or set MICROWINDOWS) as before, and type 'make -f makefile.mic all'
Running 'minimal' runs the virtual MicroWindows desktop
and the minimal sample, since in a MicroWindows WIN32 application
they are one and the same binary.
Status
======
The minimal sample is almost fully-functional, apart from some
presentation issues (no menu borders and status bar in the wrong
place.
The widgets sample is crashing in DeleteObject (see notes below).
Implementation Notes
====================
wxMicroWindows is essentially the wxMSW port + wxUniversal
widgets. Lots of things in include/wx/univ/setup.h are switched
off to allow the port to compile. There are also #ifdefs
switching off further functionality, such as most wxBitmap
functions, pending proper implementation.
There are some WIN32 API functions not implemented by MicroWindows
that are instead stubbed out in include/wx/msw/microwin.c,
and 'implemented' in src/msw/microwin.c. Some of these functions
are important, some less so. They will need to be implemented
in due course. But implementing missing functionality in this way
is preferably to proliferating many #ifdefs in the
wxMSW/wxMicroWindows port itself.
Errors/warnings
===============
In file ../../src/msw/window.cpp at line 1294: 'UpdateWindow' failed with error 0x00000000 (Success).
- caused because there are no paint messages pending. Presumed
harmless.
In file ../../src/msw/dc.cpp at line 1838: 'BitBlt' failed with error 0x00000000 (Success).
- caused because the window isn't mapped, and MwPrepareDC in wingdi.c
fails (hwnd->unmapcount is non-zero). Presumed harmless.
Recursive paint problem, e.g. when clicking the 'Press Me!'
button in the widgets sample a few times, until the text control
is full.
- possibly the scrollbar is causing the text control to be
updated, which somehow effects the scrollbar, which causes
a window update, etc.
Sluggish updates.
- probably because many image to bitmap conversions are being
done on update, and bitmaps should probably be cached.
Things missing from MicroWindows that need to be worked around
==============================================================
wxImage/inline XPM/::CreateBitmap support
-----------------------------------------
This is the main obstacle to getting a good range
of widgets working, since wxUniversal uses inline XPMs
to implement most of the widgets.
See src/engine/devimage.c for routines for loading JPEGs,
XPMs etc. Unfortunately the XPM routines are also #ifdefed
for FILE_IO, even though for inline XPMs we don't need file I/O.
(Embedded systems tend not to have file I/O, anyway.)
Now, wxWidgets has its own XPM decoder, src/common/xpmdecod.cpp,
so in theory we don't need to use MicroWindows' code there.
wxImage can load an inline XPM, _but_ we need to convert to
a wxBitmap since this is what the widgets need.
There is no ::CreateBitmap or BITMAPINFO. (BMPs can be converted
to C using convbmp, then need to use Gr... functions.)
So how can we convert from wxImage to wxBitmap in MicroWindows?
Well, a simple-minded way would be to use CreateCompatibleBitmap
which returns an HBITMAP, select it into an HDC, and draw
the pixels from the wxImage to the HDC one by one with SetPixel.
This is now implemented, but there are problems with masks.
(a) masks have to be created at screen depth because BitBlt/GrDraw
can't cope with differing depths, and (b) masked blitting
is still not working (try enabling mask creation in
wxBitmap::CreateFromImage by setting USE_MASKS to 1).
Other missing features
----------------------
No ::GetKeyState (see include/wx/msw/private.h). Should probably use
GdOpenKeyboard/GdCloseKeyboard/GdReadKeyboard. Could perhaps emulate
GetKeyState this way.
No ::DestroyIcon, ::DestroyCursor - use ::DestroyObject instead?
Also no LoadCursor, LoadImage. So how do we make cursors? No ::SetCursor.
wxDC: no ::GetTextColor, ::GetBkColor, ::IntersectClipRect,
::GetClipBox
No ::SetMenu, so no menus or menubars (now implemented by
wxUniversal).
No ::GetObject so we can't get LOGFONT from an HFONT
in wxSystemSettings (worked around by passing HFONT to
the wxFont constructor).
Applying patches by hand
========================
The full altered functions are given below in case you have
to apply them by hand.
src/mwin/winevent.c
-------------------
A second test has been added to this line:
if(hittest == HTCLIENT || hwnd == GetCapture()) {
in MwTranslateMouseMessage below. This corrects a mouse message
bug.
/*
* Translate and deliver hardware mouse message to proper window.
*/
void
MwTranslateMouseMessage(HWND hwnd,UINT msg,int hittest)
{
POINT pt;
DWORD tick;
static UINT lastmsg = 0;
static HWND lasthwnd;
static DWORD lasttick;
static int lastx, lasty;
/* determine double click eligibility*/
if(msg == WM_LBUTTONDOWN || msg == WM_RBUTTONDOWN) {
tick = GetTickCount();
if((hwnd->pClass->style & CS_DBLCLKS) &&
msg == lastmsg && hwnd == lasthwnd &&
tick - lasttick < DBLCLICKSPEED &&
abs(cursorx-lastx) < mwSYSMETRICS_CXDOUBLECLK &&
abs(cursory-lasty) < mwSYSMETRICS_CYDOUBLECLK)
msg += (WM_LBUTTONDBLCLK - WM_LBUTTONDOWN);
lastmsg = msg;
lasthwnd = hwnd;
lasttick = tick;
lastx = cursorx;
lasty = cursory;
}
/*
* We always send nc mouse message
* unlike Windows, for HTCLIENT default processing
*/
PostMessage(hwnd, msg + (WM_NCMOUSEMOVE-WM_MOUSEMOVE), hittest,
MAKELONG(cursorx, cursory));
/* then possibly send user mouse message*/
if(hittest == HTCLIENT || hwnd == GetCapture()) {
pt.x = cursorx;
pt.y = cursory;
ScreenToClient(hwnd, &pt);
PostMessage(hwnd, msg, 0, MAKELONG(pt.x, pt.y));
}
}
winuser.c
---------
Part of PeekMessage has been factored out into PeekMessageHelper,
and used in PeekMessage and GetMessage. The three relevant functions
are:
/*
* A helper function for sharing code between PeekMessage and GetMessage
*/
BOOL WINAPI
PeekMessageHelper(LPMSG lpMsg, HWND hwnd, UINT uMsgFilterMin, UINT uMsgFilterMax,
UINT wRemoveMsg, BOOL returnIfEmptyQueue)
{
HWND wp;
PMSG pNxtMsg;
/* check if no messages in queue*/
if(mwMsgHead.head == NULL) {
/* Added by JACS so it doesn't reach MwSelect */
if (returnIfEmptyQueue)
return FALSE;
#if PAINTONCE
/* check all windows for pending paint messages*/
for(wp=listwp; wp; wp=wp->next) {
if(!(wp->style & WS_CHILD)) {
if(chkPaintMsg(wp, lpMsg))
return TRUE;
}
}
for(wp=listwp; wp; wp=wp->next) {
if(wp->style & WS_CHILD) {
if(chkPaintMsg(wp, lpMsg))
return TRUE;
}
}
#endif
MwSelect();
}
if(mwMsgHead.head == NULL)
return FALSE;
pNxtMsg = (PMSG)mwMsgHead.head;
if(wRemoveMsg & PM_REMOVE)
GdListRemove(&mwMsgHead, &pNxtMsg->link);
*lpMsg = *pNxtMsg;
if(wRemoveMsg & PM_REMOVE)
GdItemFree(pNxtMsg);
return TRUE;
}
BOOL WINAPI
PeekMessage(LPMSG lpMsg, HWND hwnd, UINT uMsgFilterMin, UINT uMsgFilterMax,
UINT wRemoveMsg)
{
/* Never wait in MwSelect: pass TRUE */
return PeekMessageHelper(lpMsg, hwnd, uMsgFilterMin, uMsgFilterMax, wRemoveMsg, TRUE);
}
BOOL WINAPI
GetMessage(LPMSG lpMsg,HWND hwnd,UINT wMsgFilterMin,UINT wMsgFilterMax)
{
/*
* currently MwSelect() must poll for VT switch reasons,
* so this code will work
*/
/* Always wait in MwSelect if there are messages: pass FALSE */
while(!PeekMessageHelper(lpMsg, hwnd, wMsgFilterMin, wMsgFilterMax,PM_REMOVE, FALSE))
continue;
return lpMsg->message != WM_QUIT;
}

View File

@@ -530,7 +530,7 @@ typedef short int WXTYPE;
/* wxCALLBACK should be used for the functions which are called back by */ /* wxCALLBACK should be used for the functions which are called back by */
/* Windows (such as compare function for wxListCtrl) */ /* Windows (such as compare function for wxListCtrl) */
#if defined(__WIN32__) && !defined(__WXMICROWIN__) #if defined(__WIN32__)
#define wxCALLBACK wxSTDCALL #define wxCALLBACK wxSTDCALL
#else #else
/* no stdcall under Unix nor Win16 */ /* no stdcall under Unix nor Win16 */
@@ -1140,7 +1140,6 @@ typedef wxUint32 wxDword;
#elif (defined(SIZEOF_LONG_LONG) && SIZEOF_LONG_LONG >= 8) || \ #elif (defined(SIZEOF_LONG_LONG) && SIZEOF_LONG_LONG >= 8) || \
defined(__GNUC__) || \ defined(__GNUC__) || \
defined(__CYGWIN__) || \ defined(__CYGWIN__) || \
defined(__WXMICROWIN__) || \
(defined(__DJGPP__) && __DJGPP__ >= 2) (defined(__DJGPP__) && __DJGPP__ >= 2)
#define wxLongLong_t long long #define wxLongLong_t long long
#define wxLongLongSuffix ll #define wxLongLongSuffix ll
@@ -3224,7 +3223,7 @@ typedef wxW64 long WXLPARAM;
typedef wxW64 long WXLRESULT; typedef wxW64 long WXLRESULT;
#endif #endif
#if defined(__GNUWIN32__) || defined(__WXMICROWIN__) #if defined(__GNUWIN32__)
typedef int (*WXFARPROC)(); typedef int (*WXFARPROC)();
#else #else
typedef int (__stdcall *WXFARPROC)(); typedef int (__stdcall *WXFARPROC)();

View File

@@ -347,7 +347,7 @@ public:
static int DoMustScroll(wxDialog* dialog, wxSize& windowSize, wxSize& displaySize); static int DoMustScroll(wxDialog* dialog, wxSize& windowSize, wxSize& displaySize);
}; };
#if defined(__WXUNIVERSAL__) && !defined(__WXMICROWIN__) #if defined(__WXUNIVERSAL__)
#include "wx/univ/dialog.h" #include "wx/univ/dialog.h"
#else #else
#if defined(__WXMSW__) #if defined(__WXMSW__)

View File

@@ -31,7 +31,7 @@
#include <dirent.h> #include <dirent.h>
#endif #endif
#if defined(__WINDOWS__) && !defined(__WXMICROWIN__) #if defined(__WINDOWS__)
#if !defined( __GNUWIN32__ ) && !defined(__WXWINCE__) && !defined(__CYGWIN__) #if !defined( __GNUWIN32__ ) && !defined(__WXWINCE__) && !defined(__CYGWIN__)
#include <direct.h> #include <direct.h>
#include <dos.h> #include <dos.h>

View File

@@ -251,7 +251,7 @@ protected:
}; };
// include the real class declaration // include the real class declaration
#if defined(__WXUNIVERSAL__) // && !defined(__WXMICROWIN__) #if defined(__WXUNIVERSAL__)
#include "wx/univ/frame.h" #include "wx/univ/frame.h"
#else // !__WXUNIVERSAL__ #else // !__WXUNIVERSAL__
#if defined(__WXMSW__) #if defined(__WXMSW__)

View File

@@ -1,234 +0,0 @@
/*
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/microwin.h
// Purpose: Extra implementation for MicroWindows
// Author: Julian Smart
// Created: 2001-05-31
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
*/
#ifndef _WX_MICROWIN_H_
#define _WX_MICROWIN_H_
/* Implemented by microwin.cpp */
#ifdef __cplusplus
extern "C" {
#endif
BOOL SetCursorPos(int x, int y);
HCURSOR SetCursor(HCURSOR hCursor);
/* Implemented with wrong number of args by MicroWindows */
/* so we need to use a different name */
int GetScrollPosWX (HWND hWnd, int iSBar);
BOOL ScrollWindow(HWND, int xAmount, int yAmount,
CONST RECT* lpRect, CONST RECT* lpClipRect);
HWND WindowFromPoint(POINT pt);
SHORT GetKeyState(int nVirtKey);
HWND SetParent(HWND hWndChild, HWND hWndNewParent);
VOID DragAcceptFiles(HWND, BOOL);
BOOL IsDialogMessage(HWND hWnd, MSG* msg);
DWORD GetMessagePos(VOID);
BOOL IsIconic(HWND hWnd);
int SetMapMode(HDC hDC, int mode);
int GetMapMode(HDC hDC);
HCURSOR LoadCursor(HINSTANCE hInst, int cursor);
DWORD GetModuleFileName(HINSTANCE hInst, LPSTR name, DWORD sz);
VOID DestroyIcon(HICON hIcon);
COLORREF GetTextColor(HDC hdc);
COLORREF GetBkColor(HDC hdc);
HPALETTE SelectPalette(HDC hdc, HPALETTE hPalette, BOOL b);
BOOL IntersectClipRect(HDC hdc, int x, int y,
int w, int h);
BOOL GetClipBox(HDC hdc, RECT* rect);
BOOL DrawIconEx(HDC hdc, int x, int y, HICON hIcon, int w, int h, UINT istepIfAniCur, HBRUSH hbrFlickerFreeDraw, UINT diFlags);
BOOL SetViewportExtEx(HDC hdc, int x, int y, LPSIZE lpSize);
BOOL SetViewportOrgEx(HDC hdc, int x, int y, LPPOINT lpPoint);
BOOL SetWindowExtEx(HDC hdc, int x, int y, LPSIZE lpSize);
BOOL SetWindowOrgEx(HDC hdc, int x, int y, LPPOINT lpSize);
BOOL ExtFloodFill(HDC hdc, int x, int y, COLORREF col, UINT flags);
int SetPolyFillMode(HDC hdc, int mode);
BOOL RoundRect(HDC hdc, int left, int top, int right, int bottom, int r1, int r2);
BOOL MaskBlt(HDC hdc, int x, int y, int w, int h,
HDC hDCSource, int xSrc, int ySrc, HBITMAP hBitmapMask, int xMask, int yMask, DWORD rop);
UINT RealizePalette(HDC hDC);
BOOL SetBrushOrgEx(HDC hdc, int xOrigin, int yOrigin, LPPOINT lpPoint);
int GetObject(HGDIOBJ hObj, int sz, LPVOID logObj);
/* For some reason these aren't defined in the headers */
BOOL EnableScrollBar (HWND hWnd, int iSBar, BOOL bEnable) ;
BOOL GetScrollPos (HWND hWnd, int iSBar, int* pPos);
BOOL GetScrollRange (HWND hWnd, int iSBar, int* pMinPos, int* pMaxPos);
BOOL SetScrollPos (HWND hWnd, int iSBar, int iNewPos);
BOOL SetScrollRange (HWND hWnd, int iSBar, int iMinPos, int iMaxPos);
BOOL SetScrollInfo (HWND hWnd, int iSBar,
LPCSCROLLINFO lpsi, BOOL fRedraw);
BOOL GetScrollInfo(HWND hWnd, int iSBar, LPSCROLLINFO lpsi);
BOOL ShowScrollBar (HWND hWnd, int iSBar, BOOL bShow);
HBITMAP WINAPI
CreateBitmap( int width, int height, int nPlanes, int bPP, LPCVOID lpData);
#ifdef __cplusplus
}
#endif
/*
* Key State Masks for Mouse Messages
*/
#ifndef MK_LBUTTON
#define MK_LBUTTON 0x0001
#define MK_RBUTTON 0x0002
#define MK_SHIFT 0x0004
#define MK_CONTROL 0x0008
#define MK_MBUTTON 0x0010
#endif
/*
* DrawIcon flags
*/
#ifndef DI_MASK
#define DI_MASK 0x0001
#define DI_IMAGE 0x0002
#define DI_NORMAL 0x0003
#define DI_COMPAT 0x0004
#define DI_DEFAULTSIZE 0x0008
#endif
/* TODO: May have to fake these message */
#ifndef WM_INITDIALOG
#define WM_INITDIALOG 0x0110
#endif
#ifndef WM_QUERYENDSESSION
#define WM_QUERYENDSESSION 0x0011
#endif
#ifndef WM_ENDSESSION
#define WM_ENDSESSION 0x0016
#endif
#ifndef WM_SETCURSOR
#define WM_SETCURSOR 0x0020
#endif
#ifndef WM_GETMINMAXINFO
#define WM_GETMINMAXINFO 0x0024
typedef struct tagMINMAXINFO {
POINT ptReserved;
POINT ptMaxSize;
POINT ptMaxPosition;
POINT ptMinTrackSize;
POINT ptMaxTrackSize;
} MINMAXINFO, *PMINMAXINFO, *LPMINMAXINFO;
#endif
#ifndef WM_SYSCOMMAND
#define WM_SYSCOMMAND 0x0112
#endif
#ifndef WM_SYSCOLORCHANGE
#define WM_SYSCOLORCHANGE 0x0015
#endif
#ifndef WM_QUERYNEWPALETTE
#define WM_QUERYNEWPALETTE 0x030F
#endif
#ifndef WM_PALETTEISCHANGING
#define WM_PALETTEISCHANGING 0x0310
#endif
#ifndef WM_PALETTECHANGED
#define WM_PALETTECHANGED 0x0311
#endif
#ifndef WM_NOTIFY
#define WM_NOTIFY 0x004E
#endif
#ifndef WM_DROPFILES
#define WM_DROPFILES 0x0233
#endif
#ifndef PALETTERGB
#define PALETTERGB RGB
#endif
#ifndef MM_TEXT
#define MM_TEXT 1
#define MM_LOMETRIC 2
#define MM_HIMETRIC 3
#define MM_LOENGLISH 4
#define MM_HIENGLISH 5
#define MM_TWIPS 6
#define MM_ISOTROPIC 7
#define MM_ANISOTROPIC 8
#endif
#ifndef SC_MAXIMIZE
#define SC_MINIMIZE 0xF020
#define SC_MAXIMIZE 0xF030
#endif
// TODO: all of them
#ifndef IDC_ARROW
#define IDC_ARROW 1
#endif
/*
* Standard Cursor IDs
*/
#ifndef MAKEINTRESOURCE
#define MAKEINTRESOURCE(r) r
#endif
#ifndef IDC_ARROW
#define IDC_ARROW MAKEINTRESOURCE(32512)
#define IDC_IBEAM MAKEINTRESOURCE(32513)
#define IDC_WAIT MAKEINTRESOURCE(32514)
#define IDC_CROSS MAKEINTRESOURCE(32515)
#define IDC_UPARROW MAKEINTRESOURCE(32516)
#define IDC_SIZE MAKEINTRESOURCE(32640) /* OBSOLETE: use IDC_SIZEALL */
#define IDC_ICON MAKEINTRESOURCE(32641) /* OBSOLETE: use IDC_ARROW */
#define IDC_SIZENWSE MAKEINTRESOURCE(32642)
#define IDC_SIZENESW MAKEINTRESOURCE(32643)
#define IDC_SIZEWE MAKEINTRESOURCE(32644)
#define IDC_SIZENS MAKEINTRESOURCE(32645)
#define IDC_SIZEALL MAKEINTRESOURCE(32646)
#define IDC_NO MAKEINTRESOURCE(32648) /* not in win3.1 */
#if(WINVER >= 0x0500)
#define IDC_HAND MAKEINTRESOURCE(32649)
#endif /* WINVER >= 0x0500 */
#define IDC_APPSTARTING MAKEINTRESOURCE(32650) /* not in win3.1 */
#if(WINVER >= 0x0400)
#define IDC_HELP MAKEINTRESOURCE(32651)
#endif /* WINVER >= 0x0400 */
#endif
/* ExtFloodFill style flags */
#define FLOODFILLBORDER 0
#define FLOODFILLSURFACE 1
/* PolyFill() Modes */
#define ALTERNATE 1
#define WINDING 2
#define POLYFILL_LAST 2
/* Quaternary raster codes */
#define MAKEROP4(fore,back) (DWORD)((((back) << 8) & 0xFF000000) | (fore))
/* Device Parameters for GetDeviceCaps() */
#define DRIVERVERSION 0 /* Device driver version */
#define TECHNOLOGY 2 /* Device classification */
#define HORZSIZE 4 /* Horizontal size in millimeters */
#define VERTSIZE 6 /* Vertical size in millimeters */
/* Ternary raster operations */
/* Now defined by MicroWindows */
#if 0
#define DSTINVERT (DWORD)0x00550009 /* dest = (NOT dest) */
#define WHITENESS (DWORD)0x00FF0062 /* dest = WHITE */
#define SRCERASE (DWORD)0x00440328 /* dest = source AND (NOT dest ) */
#define MERGEPAINT (DWORD)0x00BB0226 /* dest = (NOT source) OR dest */
#define SRCPAINT (DWORD)0x00EE0086 /* dest = source OR dest */
#define NOTSRCCOPY (DWORD)0x00330008 /* dest = (NOT source) */
#endif
#endif /* _WX_MICROWIN_H_ */

View File

@@ -15,11 +15,6 @@
#include "wx/msw/wrapwin.h" #include "wx/msw/wrapwin.h"
#ifdef __WXMICROWIN__
// Extra prototypes and symbols not defined by MicroWindows
#include "wx/msw/microwin.h"
#endif
#include "wx/log.h" #include "wx/log.h"
#if wxUSE_GUI #if wxUSE_GUI
@@ -144,11 +139,7 @@ extern LONG APIENTRY
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// a wrapper macro for ZeroMemory() // a wrapper macro for ZeroMemory()
#if !defined(__WXMICROWIN__)
#define wxZeroMemory(obj) ::ZeroMemory(&obj, sizeof(obj)) #define wxZeroMemory(obj) ::ZeroMemory(&obj, sizeof(obj))
#else
#define wxZeroMemory(obj) memset((void*) & obj, 0, sizeof(obj))
#endif
// This one is a macro so that it can be tested with #ifdef, it will be // This one is a macro so that it can be tested with #ifdef, it will be
// undefined if it cannot be implemented for a given compiler. // undefined if it cannot be implemented for a given compiler.

View File

@@ -17,7 +17,7 @@
#include "wx/msw/private.h" #include "wx/msw/private.h"
#include "wx/msw/missing.h" #include "wx/msw/missing.h"
#if wxUSE_COMMON_DIALOGS && !defined(__SMARTPHONE__) && !defined(__WXMICROWIN__) #if wxUSE_COMMON_DIALOGS && !defined(__SMARTPHONE__)
#include <commdlg.h> #include <commdlg.h>
#endif #endif

View File

@@ -95,7 +95,7 @@ def WriteTable(f, table):
// This table is generated by misc/languages/genlang.py // This table is generated by misc/languages/genlang.py
// When making changes, please put them into misc/languages/langtabl.txt // When making changes, please put them into misc/languages/langtabl.txt
#if !defined(__WIN32__) || defined(__WXMICROWIN__) #if !defined(__WIN32__)
#define SETWINLANG(info,lang,sublang) #define SETWINLANG(info,lang,sublang)

View File

@@ -1,85 +0,0 @@
##############################################################################
# Microwindows template Makefile
# Copyright (c) 2000 Martin Jolicoeur, Greg Haerr
##############################################################################
TOP=$(MICROWINDOWS)
ifeq "$(MICROWINDOWS)" ""
TOP=/home/julians/local/microwindows/microwindows-0.89pre8/src
endif
CONFIG = $(TOP)/config
WXDIR = ../..
OBJSUFF = o
SRCSUFF = cpp
WXLIB=$(WXDIR)/lib/libwx.a
AROPTIONS = ruv
RANLIB = ranlib
RM = rm -f
ZLIBLIB = $(WXDIR)/lib/libzlib.a
PNGLIB = $(WXDIR)/lib/libpng.a
JPEGLIB = $(WXDIR)/lib/libjpeg.a
TIFFLIB = $(WXDIR)/lib/libtiff.a
include $(CONFIG)
######################## Additional Flags section ############################
# Directories list for header files
INCLUDEDIRS += -I$(WXDIR)/include
# Defines for preprocessor
DEFINES += -DMWIN -D__WXMSW__ -D__WXMICROWIN__ -D__WXUNIVERSAL__ -D__WIN32__ -D__WIN95__ -DHAVE_BOOL -DMICROWIN_TODO=1 -D__UNIX__ -DHAVE_NANOSLEEP -DMICROWIN_NOCONTROLS -D__WXDEBUG__ -DwxSIZE_T_IS_UINT
# Compilation flags for C files OTHER than include directories
CFLAGS +=
# Preprocessor flags OTHER than defines
CPPFLAGS +=
# Linking flags
#LDFLAGS += -lwx -L$(WXDIR)/lib
LDFLAGS += $(WXLIB)
############################# targets section ################################
# If you want to create a library with the objects files, define the name here
LIBNAME =
# If we put it below OBJS=, Makefile.rules includes .depend
# and it continually looks for .c files to satisfy .o.cpp
# dependency. What's going on there?
include $(TOP)/Makefile.rules
# List of objects to compile
OBJS = minimal.o
all: minimal
######################### Makefile.rules section #############################
######################## Tools targets section ###############################
minimal: $(OBJS) $(MWINLIBS) $(WXLIB) $(TOP)/config
$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) -o $@ $(WXLIB) $(MWINLIBS) -lm
#.SUFFIXES: .cpp .cxx .c
#.c.o:
# $(CC) -c $(CFLAGS) $(CFLAGS) -o $@ $*.c
.cxx.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $*.cxx
.cpp.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $*.cpp
cleanwx:
-$(RM) *.o
-$(RM) minimal
wx:
@pushd $(WXDIR)/src/msw; make -f makefile.mic all; popd
wxfull:
@pushd $(WXDIR)/src/msw; make -f makefile.mic cleanwx all; popd

View File

@@ -1,87 +0,0 @@
##############################################################################
# Microwindows template Makefile
# Copyright (c) 2000 Martin Jolicoeur, Greg Haerr
# Licence: wxWindows Licence
##############################################################################
TOP=$(MICROWINDOWS)
ifeq "$(MICROWINDOWS)" ""
TOP=/home/julians/local/microwindows/microwindows-0.89pre8/src
endif
CONFIG = $(TOP)/config
WXDIR = ../..
OBJSUFF = o
SRCSUFF = cpp
WXLIB=$(WXDIR)/lib/libwx.a
AROPTIONS = ruv
RANLIB = ranlib
RM = rm -f
ZLIBLIB = $(WXDIR)/lib/libzlib.a
PNGLIB = $(WXDIR)/lib/libpng.a
JPEGLIB = $(WXDIR)/lib/libjpeg.a
TIFFLIB = $(WXDIR)/lib/libtiff.a
include $(CONFIG)
######################## Additional Flags section ############################
# Directories list for header files
INCLUDEDIRS += -I$(WXDIR)/include
# Defines for preprocessor
DEFINES += -DMWIN -D__WXMSW__ -D__WXMICROWIN__ -D__WXUNIVERSAL__ -D__WIN32__ -D__WIN95__ -DHAVE_BOOL -DMICROWIN_TODO=1 -D__UNIX__ -DHAVE_NANOSLEEP -DMICROWIN_NOCONTROLS -D__WXDEBUG__ -DwxSIZE_T_IS_UINT
# Compilation flags for C files OTHER than include directories
CFLAGS +=
# Preprocessor flags OTHER than defines
CPPFLAGS +=
# Linking flags
#LDFLAGS += -lwx -L$(WXDIR)/lib
LDFLAGS += $(WXLIB)
############################# targets section ################################
# If you want to create a library with the objects files, define the name here
LIBNAME =
# If we put it below OBJS=, Makefile.rules includes .depend
# and it continually looks for .c files to satisfy .o.cpp
# dependency. What's going on there?
include $(TOP)/Makefile.rules
# List of objects to compile
OBJS = widgets.o button.o combobox.o gauge.o listbox.o notebook.o radiobox.o slider.o spinbtn.o \
static.o textctrl.o
all: widgets
######################### Makefile.rules section #############################
######################## Tools targets section ###############################
widgets: $(OBJS) $(MWINLIBS) $(WXLIB) $(TOP)/config
$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) -o $@ $(WXLIB) $(MWINLIBS) -lm
#.SUFFIXES: .cpp .cxx .c
#.c.o:
# $(CC) -c $(CFLAGS) $(CFLAGS) -o $@ $*.c
.cxx.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $*.cxx
.cpp.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $*.cpp
cleanwx:
-$(RM) *.o
-$(RM) widgets
wx:
@pushd $(WXDIR)/src/msw; make -f makefile.mic all; popd
wxfull:
@pushd $(WXDIR)/src/msw; make -f makefile.mic cleanwx all; popd

View File

@@ -88,7 +88,7 @@
#endif #endif
#endif // wxUSE_EXCEPTIONS #endif // wxUSE_EXCEPTIONS
#if !defined(__WINDOWS__) || defined(__WXMICROWIN__) #if !defined(__WINDOWS__)
#include <signal.h> // for SIGTRAP used by wxTrap() #include <signal.h> // for SIGTRAP used by wxTrap()
#endif //Win/Unix #endif //Win/Unix
@@ -1128,7 +1128,7 @@ void wxAbort()
void wxTrap() void wxTrap()
{ {
#if defined(__WINDOWS__) && !defined(__WXMICROWIN__) #if defined(__WINDOWS__)
DebugBreak(); DebugBreak();
#elif defined(_MSL_USING_MW_C_HEADERS) && _MSL_USING_MW_C_HEADERS #elif defined(_MSL_USING_MW_C_HEADERS) && _MSL_USING_MW_C_HEADERS
Debugger(); Debugger();
@@ -1296,7 +1296,7 @@ static
bool DoShowAssertDialog(const wxString& msg) bool DoShowAssertDialog(const wxString& msg)
{ {
// under Windows we can show the dialog even in the console mode // under Windows we can show the dialog even in the console mode
#if defined(__WINDOWS__) && !defined(__WXMICROWIN__) #if defined(__WINDOWS__)
wxString msgDlg(msg); wxString msgDlg(msg);
// this message is intentionally not translated -- it is for developers // this message is intentionally not translated -- it is for developers

View File

@@ -23,7 +23,7 @@
#if wxUSE_FILE #if wxUSE_FILE
// standard // standard
#if defined(__WINDOWS__) && !defined(__GNUWIN32__) && !defined(__WXMICROWIN__) && !defined(__WXWINCE__) #if defined(__WINDOWS__) && !defined(__GNUWIN32__) && !defined(__WXWINCE__)
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
#define NOSERVICE #define NOSERVICE

View File

@@ -1013,7 +1013,7 @@ wxDoCopyFile(wxFile& fileIn,
bool bool
wxCopyFile (const wxString& file1, const wxString& file2, bool overwrite) wxCopyFile (const wxString& file1, const wxString& file2, bool overwrite)
{ {
#if defined(__WIN32__) && !defined(__WXMICROWIN__) #if defined(__WIN32__)
// CopyFile() copies file attributes and modification time too, so use it // CopyFile() copies file attributes and modification time too, so use it
// instead of our code if available // instead of our code if available
// //
@@ -1173,7 +1173,7 @@ bool wxMkdir(const wxString& dir, int perm)
// for the GNU compiler // for the GNU compiler
#elif (!(defined(__WINDOWS__) || defined(__DOS__))) || \ #elif (!(defined(__WINDOWS__) || defined(__DOS__))) || \
(defined(__GNUWIN32__) && !defined(__MINGW32__)) || \ (defined(__GNUWIN32__) && !defined(__MINGW32__)) || \
defined(__WINE__) || defined(__WXMICROWIN__) defined(__WINE__)
const wxChar *dirname = dir.c_str(); const wxChar *dirname = dir.c_str();
#if defined(MSVCRT) #if defined(MSVCRT)
wxUnusedVar(perm); wxUnusedVar(perm);
@@ -1478,7 +1478,7 @@ wxString wxGetOSDirectory()
{ {
#ifdef __WXWINCE__ #ifdef __WXWINCE__
return wxString(wxT("\\Windows")); return wxString(wxT("\\Windows"));
#elif defined(__WINDOWS__) && !defined(__WXMICROWIN__) #elif defined(__WINDOWS__)
wxChar buf[MAX_PATH]; wxChar buf[MAX_PATH];
if ( !GetWindowsDirectory(buf, MAX_PATH) ) if ( !GetWindowsDirectory(buf, MAX_PATH) )
{ {

View File

@@ -142,7 +142,7 @@ namespace
// small helper class which opens and closes the file - we use it just to get // small helper class which opens and closes the file - we use it just to get
// a file handle for the given file name to pass it to some Win32 API function // a file handle for the given file name to pass it to some Win32 API function
#if defined(__WIN32__) && !defined(__WXMICROWIN__) #if defined(__WIN32__)
class wxFileHandle class wxFileHandle
{ {
@@ -214,7 +214,7 @@ private:
// private functions // private functions
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
#if wxUSE_DATETIME && defined(__WIN32__) && !defined(__WXMICROWIN__) #if wxUSE_DATETIME && defined(__WIN32__)
// Convert between wxDateTime and FILETIME which is a 64-bit value representing // Convert between wxDateTime and FILETIME which is a 64-bit value representing
// the number of 100-nanosecond intervals since January 1, 1601 UTC. // the number of 100-nanosecond intervals since January 1, 1601 UTC.
@@ -616,7 +616,7 @@ wxFileName wxFileName::DirName(const wxString& dir, wxPathFormat format)
namespace namespace
{ {
#if defined(__WINDOWS__) && !defined(__WXMICROWIN__) #if defined(__WINDOWS__)
void RemoveTrailingSeparatorsFromPath(wxString& strPath) void RemoveTrailingSeparatorsFromPath(wxString& strPath)
{ {
@@ -651,7 +651,7 @@ wxFileSystemObjectExists(const wxString& path, int flags)
wxString strPath(path); wxString strPath(path);
#if defined(__WINDOWS__) && !defined(__WXMICROWIN__) #if defined(__WINDOWS__)
if ( acceptDir ) if ( acceptDir )
{ {
// Ensure that the path doesn't have any trailing separators when // Ensure that the path doesn't have any trailing separators when
@@ -930,7 +930,7 @@ static wxString wxCreateTempImpl(
i ++; i ++;
} }
#elif defined(__WINDOWS__) && !defined(__WXMICROWIN__) #elif defined(__WINDOWS__)
if (!::GetTempFileName(dir.t_str(), name.t_str(), 0, if (!::GetTempFileName(dir.t_str(), name.t_str(), 0,
wxStringBuffer(path, MAX_PATH + 1))) wxStringBuffer(path, MAX_PATH + 1)))
{ {
@@ -1240,7 +1240,7 @@ wxString wxFileName::GetTempDir()
{ {
#if defined(__WXWINCE__) #if defined(__WXWINCE__)
dir = CheckIfDirExists(wxT("\\temp")); dir = CheckIfDirExists(wxT("\\temp"));
#elif defined(__WINDOWS__) && !defined(__WXMICROWIN__) #elif defined(__WINDOWS__)
if ( !::GetTempPath(MAX_PATH, wxStringBuffer(dir, MAX_PATH + 1)) ) if ( !::GetTempPath(MAX_PATH, wxStringBuffer(dir, MAX_PATH + 1)) )
{ {
wxLogLastError(wxT("GetTempPath")); wxLogLastError(wxT("GetTempPath"));
@@ -2162,7 +2162,7 @@ wxString wxFileName::GetShortPath() const
{ {
wxString path(GetFullPath()); wxString path(GetFullPath());
#if defined(__WINDOWS__) && defined(__WIN32__) && !defined(__WXMICROWIN__) && !defined(__WXWINCE__) #if defined(__WINDOWS__) && defined(__WIN32__) && !defined(__WXWINCE__)
DWORD sz = ::GetShortPathName(path.t_str(), NULL, 0); DWORD sz = ::GetShortPathName(path.t_str(), NULL, 0);
if ( sz != 0 ) if ( sz != 0 )
{ {
@@ -2188,7 +2188,7 @@ wxString wxFileName::GetLongPath() const
wxString pathOut, wxString pathOut,
path = GetFullPath(); path = GetFullPath();
#if defined(__WIN32__) && !defined(__WXWINCE__) && !defined(__WXMICROWIN__) #if defined(__WIN32__) && !defined(__WXWINCE__)
#if wxUSE_DYNLIB_CLASS #if wxUSE_DYNLIB_CLASS
typedef DWORD (WINAPI *GET_LONG_PATH_NAME)(const wxChar *, wxChar *, DWORD); typedef DWORD (WINAPI *GET_LONG_PATH_NAME)(const wxChar *, wxChar *, DWORD);

View File

@@ -792,7 +792,7 @@ wxString wxLocale::GetSystemEncodingName()
{ {
wxString encname; wxString encname;
#if defined(__WIN32__) && !defined(__WXMICROWIN__) #if defined(__WIN32__)
// FIXME: what is the error return value for GetACP()? // FIXME: what is the error return value for GetACP()?
UINT codepage = ::GetACP(); UINT codepage = ::GetACP();
encname.Printf(wxS("windows-%u"), codepage); encname.Printf(wxS("windows-%u"), codepage);
@@ -849,7 +849,7 @@ wxString wxLocale::GetSystemEncodingName()
/* static */ /* static */
wxFontEncoding wxLocale::GetSystemEncoding() wxFontEncoding wxLocale::GetSystemEncoding()
{ {
#if defined(__WIN32__) && !defined(__WXMICROWIN__) #if defined(__WIN32__)
UINT codepage = ::GetACP(); UINT codepage = ::GetACP();
// wxWidgets only knows about CP1250-1257, 874, 932, 936, 949, 950 // wxWidgets only knows about CP1250-1257, 874, 932, 936, 949, 950

View File

@@ -40,7 +40,7 @@
// This table is generated by misc/languages/genlang.py // This table is generated by misc/languages/genlang.py
// When making changes, please put them into misc/languages/langtabl.txt // When making changes, please put them into misc/languages/langtabl.txt
#if !defined(__WIN32__) || defined(__WXMICROWIN__) #if !defined(__WIN32__)
#define SETWINLANG(info,lang,sublang) #define SETWINLANG(info,lang,sublang)

View File

@@ -1054,7 +1054,7 @@ static void wxLogWrap(FILE *f, const char *pszPrefix, const char *psz)
// get error code from syste // get error code from syste
unsigned long wxSysErrorCode() unsigned long wxSysErrorCode()
{ {
#if defined(__WINDOWS__) && !defined(__WXMICROWIN__) #if defined(__WINDOWS__)
return ::GetLastError(); return ::GetLastError();
#else //Unix #else //Unix
return errno; return errno;
@@ -1067,7 +1067,7 @@ const wxChar *wxSysErrorMsg(unsigned long nErrCode)
if ( nErrCode == 0 ) if ( nErrCode == 0 )
nErrCode = wxSysErrorCode(); nErrCode = wxSysErrorCode();
#if defined(__WINDOWS__) && !defined(__WXMICROWIN__) #if defined(__WINDOWS__)
static wxChar s_szBuf[1024]; static wxChar s_szBuf[1024];
// get error message from system // get error message from system

View File

@@ -164,7 +164,7 @@ void wxMessageOutputStderr::Output(const wxString& str)
void wxMessageOutputDebug::Output(const wxString& str) void wxMessageOutputDebug::Output(const wxString& str)
{ {
#if defined(__WINDOWS__) && !defined(__WXMICROWIN__) #if defined(__WINDOWS__)
wxString out(AppendLineFeedIfNeeded(str)); wxString out(AppendLineFeedIfNeeded(str));
out.Replace(wxT("\t"), wxT(" ")); out.Replace(wxT("\t"), wxT(" "));
out.Replace(wxT("\n"), wxT("\r\n")); out.Replace(wxT("\n"), wxT("\r\n"));

View File

@@ -77,7 +77,7 @@ typedef struct {
JSAMPLE *sample_range_limit, *srl_orig; JSAMPLE *sample_range_limit, *srl_orig;
} j_decompress; } j_decompress;
#if defined(__WINDOWS__) && !defined(__WXMICROWIN__) #if defined(__WINDOWS__)
#define JMETHOD(type,methodname,arglist) type (__cdecl methodname) arglist #define JMETHOD(type,methodname,arglist) type (__cdecl methodname) arglist
#else #else
#define JMETHOD(type,methodname,arglist) type (methodname) arglist #define JMETHOD(type,methodname,arglist) type (methodname) arglist

View File

@@ -35,7 +35,7 @@
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#if defined(__WIN32__) && !defined(__WXMICROWIN__) #if defined(__WIN32__)
#include "wx/msw/private.h" #include "wx/msw/private.h"
#include "wx/msw/missing.h" #include "wx/msw/missing.h"
#define wxHAVE_WIN32_MB2WC #define wxHAVE_WIN32_MB2WC

View File

@@ -104,7 +104,7 @@
// global variables // global variables
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
#if !defined(__WXMICROWIN__) && !defined(__WXWINCE__) #if !defined(__WXWINCE__)
extern void wxSetKeyboardHook(bool doIt); extern void wxSetKeyboardHook(bool doIt);
#endif #endif
@@ -613,9 +613,7 @@ bool wxApp::Initialize(int& argc_, wxChar **argv_)
// ensure that base cleanup is done if we return too early // ensure that base cleanup is done if we return too early
wxCallBaseCleanup callBaseCleanup(this); wxCallBaseCleanup callBaseCleanup(this);
#if !defined(__WXMICROWIN__)
InitCommonControls(); InitCommonControls();
#endif // !defined(__WXMICROWIN__)
#if defined(__SMARTPHONE__) || defined(__POCKETPC__) #if defined(__SMARTPHONE__) || defined(__POCKETPC__)
SHInitExtraControls(); SHInitExtraControls();
@@ -623,7 +621,7 @@ bool wxApp::Initialize(int& argc_, wxChar **argv_)
wxOleInitialize(); wxOleInitialize();
#if !defined(__WXMICROWIN__) && !defined(__WXWINCE__) #if !defined(__WXWINCE__)
wxSetKeyboardHook(true); wxSetKeyboardHook(true);
#endif #endif
@@ -730,7 +728,7 @@ void wxApp::CleanUp()
// class method first and only then do our clean up // class method first and only then do our clean up
wxAppBase::CleanUp(); wxAppBase::CleanUp();
#if !defined(__WXMICROWIN__) && !defined(__WXWINCE__) #if !defined(__WXWINCE__)
wxSetKeyboardHook(false); wxSetKeyboardHook(false);
#endif #endif

View File

@@ -484,7 +484,7 @@ static HBITMAP CreatePremultipliedDIBIfNeeded(HBITMAP hbmp)
bool wxBitmap::CopyFromIconOrCursor(const wxGDIImage& icon, bool wxBitmap::CopyFromIconOrCursor(const wxGDIImage& icon,
wxBitmapTransparency transp) wxBitmapTransparency transp)
{ {
#if !defined(__WXMICROWIN__) && !defined(__WXWINCE__) #if !defined(__WXWINCE__)
// it may be either HICON or HCURSOR // it may be either HICON or HCURSOR
HICON hicon = (HICON)icon.GetHandle(); HICON hicon = (HICON)icon.GetHandle();
@@ -587,7 +587,7 @@ bool wxBitmap::CopyFromIconOrCursor(const wxGDIImage& icon,
} }
return true; return true;
#else // __WXMICROWIN__ || __WXWINCE__ #else // __WXWINCE__
wxUnusedVar(icon); wxUnusedVar(icon);
wxUnusedVar(transp); wxUnusedVar(transp);
@@ -657,7 +657,6 @@ wxBitmap::~wxBitmap()
wxBitmap::wxBitmap(const char bits[], int width, int height, int depth) wxBitmap::wxBitmap(const char bits[], int width, int height, int depth)
{ {
#ifndef __WXMICROWIN__
wxBitmapRefData *refData = new wxBitmapRefData; wxBitmapRefData *refData = new wxBitmapRefData;
m_refData = refData; m_refData = refData;
@@ -716,7 +715,6 @@ wxBitmap::wxBitmap(const char bits[], int width, int height, int depth)
} }
SetHBITMAP((WXHBITMAP)hbmp); SetHBITMAP((WXHBITMAP)hbmp);
#endif
} }
wxBitmap::wxBitmap(int w, int h, const wxDC& dc) wxBitmap::wxBitmap(int w, int h, const wxDC& dc)
@@ -787,7 +785,6 @@ bool wxBitmap::DoCreate(int w, int h, int d, WXHDC hdc)
#endif // NEVER_USE_DIB #endif // NEVER_USE_DIB
{ {
#ifndef ALWAYS_USE_DIB #ifndef ALWAYS_USE_DIB
#ifndef __WXMICROWIN__
if ( d > 0 ) if ( d > 0 )
{ {
hbmp = ::CreateBitmap(w, h, 1, d, NULL); hbmp = ::CreateBitmap(w, h, 1, d, NULL);
@@ -799,7 +796,6 @@ bool wxBitmap::DoCreate(int w, int h, int d, WXHDC hdc)
GetBitmapData()->m_depth = d; GetBitmapData()->m_depth = d;
} }
else // d == 0, create bitmap compatible with the screen else // d == 0, create bitmap compatible with the screen
#endif // !__WXMICROWIN__
{ {
ScreenHDC dc; ScreenHDC dc;
hbmp = ::CreateCompatibleBitmap(dc, w, h); hbmp = ::CreateCompatibleBitmap(dc, w, h);
@@ -820,193 +816,6 @@ bool wxBitmap::DoCreate(int w, int h, int d, WXHDC hdc)
#if wxUSE_IMAGE #if wxUSE_IMAGE
// ----------------------------------------------------------------------------
// wxImage to/from conversions for Microwin
// ----------------------------------------------------------------------------
// Microwin versions are so different from normal ones that it really doesn't
// make sense to use #ifdefs inside the function bodies
#ifdef __WXMICROWIN__
bool wxBitmap::CreateFromImage(const wxImage& image, int depth, const wxDC& dc)
{
// Set this to 1 to experiment with mask code,
// which currently doesn't work
#define USE_MASKS 0
m_refData = new wxBitmapRefData();
// Initial attempt at a simple-minded implementation.
// The bitmap will always be created at the screen depth,
// so the 'depth' argument is ignored.
HDC hScreenDC = ::GetDC(NULL);
int screenDepth = ::GetDeviceCaps(hScreenDC, BITSPIXEL);
HBITMAP hBitmap = ::CreateCompatibleBitmap(hScreenDC, image.GetWidth(), image.GetHeight());
HBITMAP hMaskBitmap = NULL;
HBITMAP hOldMaskBitmap = NULL;
HDC hMaskDC = NULL;
unsigned char maskR = 0;
unsigned char maskG = 0;
unsigned char maskB = 0;
// printf("Created bitmap %d\n", (int) hBitmap);
if (hBitmap == NULL)
{
::ReleaseDC(NULL, hScreenDC);
return false;
}
HDC hMemDC = ::CreateCompatibleDC(hScreenDC);
HBITMAP hOldBitmap = ::SelectObject(hMemDC, hBitmap);
::ReleaseDC(NULL, hScreenDC);
// created an mono-bitmap for the possible mask
bool hasMask = image.HasMask();
if ( hasMask )
{
#if USE_MASKS
// FIXME: we should be able to pass bpp = 1, but
// GdBlit can't handle a different depth
#if 0
hMaskBitmap = ::CreateBitmap( (WORD)image.GetWidth(), (WORD)image.GetHeight(), 1, 1, NULL );
#else
hMaskBitmap = ::CreateCompatibleBitmap( hMemDC, (WORD)image.GetWidth(), (WORD)image.GetHeight());
#endif
maskR = image.GetMaskRed();
maskG = image.GetMaskGreen();
maskB = image.GetMaskBlue();
if (!hMaskBitmap)
{
hasMask = false;
}
else
{
hScreenDC = ::GetDC(NULL);
hMaskDC = ::CreateCompatibleDC(hScreenDC);
::ReleaseDC(NULL, hScreenDC);
hOldMaskBitmap = ::SelectObject( hMaskDC, hMaskBitmap);
}
#else
hasMask = false;
#endif
}
int i, j;
for (i = 0; i < image.GetWidth(); i++)
{
for (j = 0; j < image.GetHeight(); j++)
{
unsigned char red = image.GetRed(i, j);
unsigned char green = image.GetGreen(i, j);
unsigned char blue = image.GetBlue(i, j);
::SetPixel(hMemDC, i, j, PALETTERGB(red, green, blue));
if (hasMask)
{
// scan the bitmap for the transparent colour and set the corresponding
// pixels in the mask to BLACK and the rest to WHITE
if (maskR == red && maskG == green && maskB == blue)
::SetPixel(hMaskDC, i, j, PALETTERGB(0, 0, 0));
else
::SetPixel(hMaskDC, i, j, PALETTERGB(255, 255, 255));
}
}
}
::SelectObject(hMemDC, hOldBitmap);
::DeleteDC(hMemDC);
if (hasMask)
{
::SelectObject(hMaskDC, hOldMaskBitmap);
::DeleteDC(hMaskDC);
((wxBitmapRefData*)m_refData)->SetMask(hMaskBitmap);
}
SetWidth(image.GetWidth());
SetHeight(image.GetHeight());
SetDepth(screenDepth);
SetHBITMAP( (WXHBITMAP) hBitmap );
#if wxUSE_PALETTE
// Copy the palette from the source image
SetPalette(image.GetPalette());
#endif // wxUSE_PALETTE
return true;
}
wxImage wxBitmap::ConvertToImage() const
{
// Initial attempt at a simple-minded implementation.
// The bitmap will always be created at the screen depth,
// so the 'depth' argument is ignored.
// TODO: transparency (create a mask image)
if (!IsOk())
{
wxFAIL_MSG( wxT("bitmap is invalid") );
return wxNullImage;
}
wxImage image;
wxCHECK_MSG( IsOk(), wxNullImage, wxT("invalid bitmap") );
// create an wxImage object
int width = GetWidth();
int height = GetHeight();
image.Create( width, height );
unsigned char *data = image.GetData();
if( !data )
{
wxFAIL_MSG( wxT("could not allocate data for image") );
return wxNullImage;
}
HDC hScreenDC = ::GetDC(NULL);
HDC hMemDC = ::CreateCompatibleDC(hScreenDC);
::ReleaseDC(NULL, hScreenDC);
HBITMAP hBitmap = (HBITMAP) GetHBITMAP();
HBITMAP hOldBitmap = ::SelectObject(hMemDC, hBitmap);
int i, j;
for (i = 0; i < GetWidth(); i++)
{
for (j = 0; j < GetHeight(); j++)
{
COLORREF color = ::GetPixel(hMemDC, i, j);
unsigned char red = GetRValue(color);
unsigned char green = GetGValue(color);
unsigned char blue = GetBValue(color);
image.SetRGB(i, j, red, green, blue);
}
}
::SelectObject(hMemDC, hOldBitmap);
::DeleteDC(hMemDC);
#if wxUSE_PALETTE
// Copy the palette from the source image
if (GetPalette())
image.SetPalette(* GetPalette());
#endif // wxUSE_PALETTE
return image;
}
#endif // __WXMICROWIN__
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// wxImage to/from conversions // wxImage to/from conversions
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -1337,7 +1146,6 @@ wxBitmap wxBitmap::GetSubBitmapOfHDC( const wxRect& rect, WXHDC hdc ) const
wxBitmap ret( rect.width, rect.height, GetDepth() ); wxBitmap ret( rect.width, rect.height, GetDepth() );
wxASSERT_MSG( ret.IsOk(), wxT("GetSubBitmap error") ); wxASSERT_MSG( ret.IsOk(), wxT("GetSubBitmap error") );
#ifndef __WXMICROWIN__
// handle alpha channel, if any // handle alpha channel, if any
if (HasAlpha()) if (HasAlpha())
ret.UseAlpha(); ret.UseAlpha();
@@ -1378,7 +1186,6 @@ wxBitmap wxBitmap::GetSubBitmapOfHDC( const wxRect& rect, WXHDC hdc ) const
wxMask *mask = new wxMask((WXHBITMAP) hbmpMask); wxMask *mask = new wxMask((WXHBITMAP) hbmpMask);
ret.SetMask(mask); ret.SetMask(mask);
} }
#endif // !__WXMICROWIN__
return ret; return ret;
} }
@@ -1650,7 +1457,6 @@ wxMask::~wxMask()
// Create a mask from a mono bitmap (copies the bitmap). // Create a mask from a mono bitmap (copies the bitmap).
bool wxMask::Create(const wxBitmap& bitmap) bool wxMask::Create(const wxBitmap& bitmap)
{ {
#ifndef __WXMICROWIN__
wxCHECK_MSG( bitmap.IsOk() && bitmap.GetDepth() == 1, false, wxCHECK_MSG( bitmap.IsOk() && bitmap.GetDepth() == 1, false,
wxT("can't create mask from invalid or not monochrome bitmap") ); wxT("can't create mask from invalid or not monochrome bitmap") );
@@ -1675,10 +1481,6 @@ bool wxMask::Create(const wxBitmap& bitmap)
SelectObject(destDC, 0); SelectObject(destDC, 0);
DeleteDC(destDC); DeleteDC(destDC);
return true; return true;
#else
wxUnusedVar(bitmap);
return false;
#endif
} }
// Create a mask from a bitmap and a palette index indicating // Create a mask from a bitmap and a palette index indicating
@@ -1710,7 +1512,6 @@ bool wxMask::Create(const wxBitmap& bitmap, int paletteIndex)
// the transparent area // the transparent area
bool wxMask::Create(const wxBitmap& bitmap, const wxColour& colour) bool wxMask::Create(const wxBitmap& bitmap, const wxColour& colour)
{ {
#ifndef __WXMICROWIN__
wxCHECK_MSG( bitmap.IsOk(), false, wxT("invalid bitmap in wxMask::Create") ); wxCHECK_MSG( bitmap.IsOk(), false, wxT("invalid bitmap in wxMask::Create") );
if ( m_maskBitmap ) if ( m_maskBitmap )
@@ -1771,11 +1572,6 @@ bool wxMask::Create(const wxBitmap& bitmap, const wxColour& colour)
::DeleteDC(destDC); ::DeleteDC(destDC);
return ok; return ok;
#else // __WXMICROWIN__
wxUnusedVar(bitmap);
wxUnusedVar(colour);
return false;
#endif // __WXMICROWIN__/!__WXMICROWIN__
} }
wxBitmap wxMask::GetBitmap() const wxBitmap wxMask::GetBitmap() const
@@ -1959,7 +1755,6 @@ HCURSOR wxBitmapToHCURSOR(const wxBitmap& bmp, int hotSpotX, int hotSpotY)
HBITMAP wxInvertMask(HBITMAP hbmpMask, int w, int h) HBITMAP wxInvertMask(HBITMAP hbmpMask, int w, int h)
{ {
#ifndef __WXMICROWIN__
wxCHECK_MSG( hbmpMask, 0, wxT("invalid bitmap in wxInvertMask") ); wxCHECK_MSG( hbmpMask, 0, wxT("invalid bitmap in wxInvertMask") );
// get width/height from the bitmap if not given // get width/height from the bitmap if not given
@@ -2001,7 +1796,4 @@ HBITMAP wxInvertMask(HBITMAP hbmpMask, int w, int h)
::DeleteDC(hdcDst); ::DeleteDC(hdcDst);
return hbmpInvMask; return hbmpInvMask;
#else
return 0;
#endif
} }

View File

@@ -148,7 +148,7 @@ void wxBrushRefData::Free()
} }
} }
#if !defined(__WXMICROWIN__) && !defined(__WXWINCE__) #if !defined(__WXWINCE__)
static int TranslateHatchStyle(int style) static int TranslateHatchStyle(int style)
{ {
@@ -164,16 +164,16 @@ static int TranslateHatchStyle(int style)
} }
} }
#endif // !__WXMICROWIN__ && !__WXWINCE__ #endif // !__WXWINCE__
HBRUSH wxBrushRefData::GetHBRUSH() HBRUSH wxBrushRefData::GetHBRUSH()
{ {
if ( !m_hBrush ) if ( !m_hBrush )
{ {
#if !defined(__WXMICROWIN__) && !defined(__WXWINCE__) #if !defined(__WXWINCE__)
int hatchStyle = TranslateHatchStyle(m_style); int hatchStyle = TranslateHatchStyle(m_style);
if ( hatchStyle == -1 ) if ( hatchStyle == -1 )
#endif // !__WXMICROWIN__ && !__WXWINCE__ #endif // !__WXWINCE__
{ {
switch ( m_style ) switch ( m_style )
{ {

View File

@@ -39,12 +39,6 @@
#include "wx/msw/private.h" #include "wx/msw/private.h"
#include "wx/msw/missing.h" // IDC_HAND #include "wx/msw/missing.h" // IDC_HAND
// define functions missing in MicroWin
#ifdef __WXMICROWIN__
static inline void DestroyCursor(HCURSOR) { }
static inline void SetCursor(HCURSOR) { }
#endif // __WXMICROWIN__
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// private classes // private classes
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -217,15 +211,6 @@ wxCursor::wxCursor(const wxImage& image)
} }
#endif // wxUSE_IMAGE #endif // wxUSE_IMAGE
// MicroWin doesn't have support needed for the other ctors
#ifdef __WXMICROWIN__
wxCursor::InitFromStock(wxStockCursor WXUNUSED(cursor_type))
{
}
#else // !__WXMICROWIN__
wxCursor::wxCursor(const wxString& filename, wxCursor::wxCursor(const wxString& filename,
wxBitmapType kind, wxBitmapType kind,
int hotSpotX, int hotSpotX,
@@ -411,8 +396,6 @@ void wxCursor::InitFromStock(wxStockCursor idCursor)
} }
} }
#endif // __WXMICROWIN__/!__WXMICROWIN__
wxCursor::~wxCursor() wxCursor::~wxCursor()
{ {
} }

View File

@@ -92,16 +92,6 @@ using namespace wxMSWImpl;
#define MAKEROP4(fore,back) (DWORD)((((back) << 8) & 0xFF000000) | (fore)) #define MAKEROP4(fore,back) (DWORD)((((back) << 8) & 0xFF000000) | (fore))
#endif #endif
// apparently with MicroWindows it is possible that HDC is 0 so we have to
// check for this ourselves
#ifdef __WXMICROWIN__
#define WXMICROWIN_CHECK_HDC if ( !GetHDC() ) return;
#define WXMICROWIN_CHECK_HDC_RET(x) if ( !GetHDC() ) return x;
#else
#define WXMICROWIN_CHECK_HDC
#define WXMICROWIN_CHECK_HDC_RET(x)
#endif
wxIMPLEMENT_ABSTRACT_CLASS(wxMSWDCImpl, wxDCImpl); wxIMPLEMENT_ABSTRACT_CLASS(wxMSWDCImpl, wxDCImpl);
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
@@ -565,8 +555,6 @@ void wxMSWDCImpl::SelectOldObjects(WXHDC dc)
void wxMSWDCImpl::UpdateClipBox() void wxMSWDCImpl::UpdateClipBox()
{ {
WXMICROWIN_CHECK_HDC
RECT rect; RECT rect;
::GetClipBox(GetHdc(), &rect); ::GetClipBox(GetHdc(), &rect);
@@ -599,8 +587,6 @@ void wxMSWDCImpl::SetClippingHrgn(WXHRGN hrgn)
{ {
wxCHECK_RET( hrgn, wxT("invalid clipping region") ); wxCHECK_RET( hrgn, wxT("invalid clipping region") );
WXMICROWIN_CHECK_HDC
// note that we combine the new clipping region with the existing one: this // note that we combine the new clipping region with the existing one: this
// is compatible with what the other ports do and is the documented // is compatible with what the other ports do and is the documented
// behaviour now (starting with 2.3.3) // behaviour now (starting with 2.3.3)
@@ -669,8 +655,6 @@ void wxMSWDCImpl::DoSetDeviceClippingRegion(const wxRegion& region)
void wxMSWDCImpl::DestroyClippingRegion() void wxMSWDCImpl::DestroyClippingRegion()
{ {
WXMICROWIN_CHECK_HDC
if (m_clipping && m_hDC) if (m_clipping && m_hDC)
{ {
#if 1 #if 1
@@ -705,21 +689,14 @@ bool wxMSWDCImpl::CanDrawBitmap() const
bool wxMSWDCImpl::CanGetTextExtent() const bool wxMSWDCImpl::CanGetTextExtent() const
{ {
#ifdef __WXMICROWIN__
// TODO Extend MicroWindows' GetDeviceCaps function
return true;
#else
// What sort of display is it? // What sort of display is it?
int technology = ::GetDeviceCaps(GetHdc(), TECHNOLOGY); int technology = ::GetDeviceCaps(GetHdc(), TECHNOLOGY);
return (technology == DT_RASDISPLAY) || (technology == DT_RASPRINTER); return (technology == DT_RASDISPLAY) || (technology == DT_RASPRINTER);
#endif
} }
int wxMSWDCImpl::GetDepth() const int wxMSWDCImpl::GetDepth() const
{ {
WXMICROWIN_CHECK_HDC_RET(16)
return (int)::GetDeviceCaps(GetHdc(), BITSPIXEL); return (int)::GetDeviceCaps(GetHdc(), BITSPIXEL);
} }
@@ -729,8 +706,6 @@ int wxMSWDCImpl::GetDepth() const
void wxMSWDCImpl::Clear() void wxMSWDCImpl::Clear()
{ {
WXMICROWIN_CHECK_HDC
RECT rect; RECT rect;
if (m_window) if (m_window)
{ {
@@ -771,8 +746,6 @@ bool wxMSWDCImpl::DoFloodFill(wxCoord WXUNUSED_IN_WINCE(x),
#ifdef __WXWINCE__ #ifdef __WXWINCE__
return false; return false;
#else #else
WXMICROWIN_CHECK_HDC_RET(false)
bool success = (0 != ::ExtFloodFill(GetHdc(), XLOG2DEV(x), YLOG2DEV(y), bool success = (0 != ::ExtFloodFill(GetHdc(), XLOG2DEV(x), YLOG2DEV(y),
col.GetPixel(), col.GetPixel(),
style == wxFLOOD_SURFACE ? FLOODFILLSURFACE style == wxFLOOD_SURFACE ? FLOODFILLSURFACE
@@ -802,8 +775,6 @@ bool wxMSWDCImpl::DoFloodFill(wxCoord WXUNUSED_IN_WINCE(x),
bool wxMSWDCImpl::DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const bool wxMSWDCImpl::DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const
{ {
WXMICROWIN_CHECK_HDC_RET(false)
wxCHECK_MSG( col, false, wxT("NULL colour parameter in wxMSWDCImpl::GetPixel") ); wxCHECK_MSG( col, false, wxT("NULL colour parameter in wxMSWDCImpl::GetPixel") );
// get the color of the pixel // get the color of the pixel
@@ -816,8 +787,6 @@ bool wxMSWDCImpl::DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const
void wxMSWDCImpl::DoCrossHair(wxCoord x, wxCoord y) void wxMSWDCImpl::DoCrossHair(wxCoord x, wxCoord y)
{ {
WXMICROWIN_CHECK_HDC
wxCoord x1 = x-VIEWPORT_EXTENT; wxCoord x1 = x-VIEWPORT_EXTENT;
wxCoord y1 = y-VIEWPORT_EXTENT; wxCoord y1 = y-VIEWPORT_EXTENT;
wxCoord x2 = x+VIEWPORT_EXTENT; wxCoord x2 = x+VIEWPORT_EXTENT;
@@ -832,8 +801,6 @@ void wxMSWDCImpl::DoCrossHair(wxCoord x, wxCoord y)
void wxMSWDCImpl::DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2) void wxMSWDCImpl::DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2)
{ {
WXMICROWIN_CHECK_HDC
wxDrawLine(GetHdc(), XLOG2DEV(x1), YLOG2DEV(y1), XLOG2DEV(x2), YLOG2DEV(y2)); wxDrawLine(GetHdc(), XLOG2DEV(x1), YLOG2DEV(y1), XLOG2DEV(x2), YLOG2DEV(y2));
CalcBoundingBox(x1, y1); CalcBoundingBox(x1, y1);
@@ -860,8 +827,6 @@ void wxMSWDCImpl::DoDrawArc(wxCoord x1, wxCoord y1,
DoDrawEllipticArcRot( xc-r, yc-r, 2*r, 2*r, sa, ea ); DoDrawEllipticArcRot( xc-r, yc-r, 2*r, 2*r, sa, ea );
#else #else
WXMICROWIN_CHECK_HDC
wxBrushAttrsSetter cc(*this); // needed for wxSTIPPLE_MASK_OPAQUE handling wxBrushAttrsSetter cc(*this); // needed for wxSTIPPLE_MASK_OPAQUE handling
// treat the special case of full circle separately // treat the special case of full circle separately
@@ -909,7 +874,7 @@ void wxMSWDCImpl::DoDrawCheckMark(wxCoord x1, wxCoord y1,
wxCoord width, wxCoord height) wxCoord width, wxCoord height)
{ {
// cases when we don't have DrawFrameControl() // cases when we don't have DrawFrameControl()
#if defined(__SYMANTEC__) || defined(__WXMICROWIN__) #if defined(__SYMANTEC__)
return wxDCBase::DoDrawCheckMark(x1, y1, width, height); return wxDCBase::DoDrawCheckMark(x1, y1, width, height);
#else // normal case #else // normal case
wxCoord x2 = x1 + width, wxCoord x2 = x1 + width,
@@ -929,13 +894,11 @@ void wxMSWDCImpl::DoDrawCheckMark(wxCoord x1, wxCoord y1,
CalcBoundingBox(x1, y1); CalcBoundingBox(x1, y1);
CalcBoundingBox(x2, y2); CalcBoundingBox(x2, y2);
#endif // Microwin/Normal #endif // Normal
} }
void wxMSWDCImpl::DoDrawPoint(wxCoord x, wxCoord y) void wxMSWDCImpl::DoDrawPoint(wxCoord x, wxCoord y)
{ {
WXMICROWIN_CHECK_HDC
COLORREF color = 0x00ffffff; COLORREF color = 0x00ffffff;
if (m_pen.IsOk()) if (m_pen.IsOk())
{ {
@@ -953,8 +916,6 @@ void wxMSWDCImpl::DoDrawPolygon(int n,
wxCoord yoffset, wxCoord yoffset,
wxPolygonFillMode WXUNUSED_IN_WINCE(fillStyle)) wxPolygonFillMode WXUNUSED_IN_WINCE(fillStyle))
{ {
WXMICROWIN_CHECK_HDC
wxBrushAttrsSetter cc(*this); // needed for wxSTIPPLE_MASK_OPAQUE handling wxBrushAttrsSetter cc(*this); // needed for wxSTIPPLE_MASK_OPAQUE handling
// Do things less efficiently if we have offsets // Do things less efficiently if we have offsets
@@ -1005,8 +966,6 @@ wxMSWDCImpl::DoDrawPolyPolygon(int n,
#ifdef __WXWINCE__ #ifdef __WXWINCE__
wxDCImpl::DoDrawPolyPolygon(n, count, points, xoffset, yoffset, fillStyle); wxDCImpl::DoDrawPolyPolygon(n, count, points, xoffset, yoffset, fillStyle);
#else #else
WXMICROWIN_CHECK_HDC
wxBrushAttrsSetter cc(*this); // needed for wxSTIPPLE_MASK_OPAQUE handling wxBrushAttrsSetter cc(*this); // needed for wxSTIPPLE_MASK_OPAQUE handling
int i, cnt; int i, cnt;
for (i = cnt = 0; i < n; i++) for (i = cnt = 0; i < n; i++)
@@ -1051,8 +1010,6 @@ wxMSWDCImpl::DoDrawPolyPolygon(int n,
void wxMSWDCImpl::DoDrawLines(int n, const wxPoint points[], wxCoord xoffset, wxCoord yoffset) void wxMSWDCImpl::DoDrawLines(int n, const wxPoint points[], wxCoord xoffset, wxCoord yoffset)
{ {
WXMICROWIN_CHECK_HDC
// Do things less efficiently if we have offsets // Do things less efficiently if we have offsets
if (xoffset != 0 || yoffset != 0) if (xoffset != 0 || yoffset != 0)
{ {
@@ -1080,8 +1037,6 @@ void wxMSWDCImpl::DoDrawLines(int n, const wxPoint points[], wxCoord xoffset, wx
void wxMSWDCImpl::DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height) void wxMSWDCImpl::DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
{ {
WXMICROWIN_CHECK_HDC
wxBrushAttrsSetter cc(*this); // needed for wxSTIPPLE_MASK_OPAQUE handling wxBrushAttrsSetter cc(*this); // needed for wxSTIPPLE_MASK_OPAQUE handling
wxCoord x2 = x + width; wxCoord x2 = x + width;
@@ -1117,8 +1072,6 @@ void wxMSWDCImpl::DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord h
void wxMSWDCImpl::DoDrawRoundedRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius) void wxMSWDCImpl::DoDrawRoundedRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius)
{ {
WXMICROWIN_CHECK_HDC
wxBrushAttrsSetter cc(*this); // needed for wxSTIPPLE_MASK_OPAQUE handling wxBrushAttrsSetter cc(*this); // needed for wxSTIPPLE_MASK_OPAQUE handling
// Now, a negative radius value is interpreted to mean // Now, a negative radius value is interpreted to mean
@@ -1151,8 +1104,6 @@ void wxMSWDCImpl::DoDrawRoundedRectangle(wxCoord x, wxCoord y, wxCoord width, wx
void wxMSWDCImpl::DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height) void wxMSWDCImpl::DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
{ {
WXMICROWIN_CHECK_HDC
wxBrushAttrsSetter cc(*this); // needed for wxSTIPPLE_MASK_OPAQUE handling wxBrushAttrsSetter cc(*this); // needed for wxSTIPPLE_MASK_OPAQUE handling
// +1 below makes the ellipse more similar to other platforms. // +1 below makes the ellipse more similar to other platforms.
@@ -1186,8 +1137,6 @@ void wxMSWDCImpl::DoDrawSpline(const wxPointList *points)
// B2 = (2*P1 + P2)/3 // B2 = (2*P1 + P2)/3
// B3 = P2 // B3 = P2
WXMICROWIN_CHECK_HDC
wxASSERT_MSG( points, wxT("NULL pointer to spline points?") ); wxASSERT_MSG( points, wxT("NULL pointer to spline points?") );
const size_t n_points = points->GetCount(); const size_t n_points = points->GetCount();
@@ -1270,8 +1219,6 @@ void wxMSWDCImpl::DoDrawEllipticArc(wxCoord x,wxCoord y,wxCoord w,wxCoord h,doub
DoDrawEllipticArcRot( x, y, w, h, sa, ea ); DoDrawEllipticArcRot( x, y, w, h, sa, ea );
#else #else
WXMICROWIN_CHECK_HDC
wxBrushAttrsSetter cc(*this); // needed for wxSTIPPLE_MASK_OPAQUE handling wxBrushAttrsSetter cc(*this); // needed for wxSTIPPLE_MASK_OPAQUE handling
wxCoord x2 = x + w; wxCoord x2 = x + w;
@@ -1316,8 +1263,6 @@ void wxMSWDCImpl::DoDrawEllipticArc(wxCoord x,wxCoord y,wxCoord w,wxCoord h,doub
void wxMSWDCImpl::DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y) void wxMSWDCImpl::DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y)
{ {
WXMICROWIN_CHECK_HDC
wxCHECK_RET( icon.IsOk(), wxT("invalid icon in DrawIcon") ); wxCHECK_RET( icon.IsOk(), wxT("invalid icon in DrawIcon") );
// Check if we are printing: notice that it's not enough to just check for // Check if we are printing: notice that it's not enough to just check for
@@ -1343,8 +1288,6 @@ void wxMSWDCImpl::DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y)
void wxMSWDCImpl::DoDrawBitmap( const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask ) void wxMSWDCImpl::DoDrawBitmap( const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask )
{ {
WXMICROWIN_CHECK_HDC
wxCHECK_RET( bmp.IsOk(), wxT("invalid bitmap in wxMSWDCImpl::DrawBitmap") ); wxCHECK_RET( bmp.IsOk(), wxT("invalid bitmap in wxMSWDCImpl::DrawBitmap") );
int width = bmp.GetWidth(), int width = bmp.GetWidth(),
@@ -1490,8 +1433,6 @@ void wxMSWDCImpl::DoDrawText(const wxString& text, wxCoord x, wxCoord y)
return; return;
} }
WXMICROWIN_CHECK_HDC
// prepare for drawing the text // prepare for drawing the text
wxTextColoursChanger textCol(GetHdc(), *this); wxTextColoursChanger textCol(GetHdc(), *this);
@@ -1520,8 +1461,6 @@ void wxMSWDCImpl::DoDrawRotatedText(const wxString& text,
wxCoord x, wxCoord y, wxCoord x, wxCoord y,
double angle) double angle)
{ {
WXMICROWIN_CHECK_HDC
// we test that we have some font because otherwise we should still use the // we test that we have some font because otherwise we should still use the
// "else" part below to avoid that DrawRotatedText(angle = 180) and // "else" part below to avoid that DrawRotatedText(angle = 180) and
// DrawRotatedText(angle = 0) use different fonts (we can't use the default // DrawRotatedText(angle = 0) use different fonts (we can't use the default
@@ -1534,7 +1473,6 @@ void wxMSWDCImpl::DoDrawRotatedText(const wxString& text,
return; return;
} }
#ifndef __WXMICROWIN__
// NB: don't take DEFAULT_GUI_FONT (a.k.a. wxSYS_DEFAULT_GUI_FONT) // NB: don't take DEFAULT_GUI_FONT (a.k.a. wxSYS_DEFAULT_GUI_FONT)
// because it's not TrueType and so can't have non zero // because it's not TrueType and so can't have non zero
// orientation/escapement under Win9x // orientation/escapement under Win9x
@@ -1597,7 +1535,6 @@ void wxMSWDCImpl::DoDrawRotatedText(const wxString& text,
y += (wxCoord)(h*cos(rad)); y += (wxCoord)(h*cos(rad));
CalcBoundingBox(x, y); CalcBoundingBox(x, y);
CalcBoundingBox(x + wxCoord(w*cos(rad)), y - wxCoord(w*sin(rad))); CalcBoundingBox(x + wxCoord(w*cos(rad)), y - wxCoord(w*sin(rad)));
#endif
} }
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
@@ -1608,8 +1545,6 @@ void wxMSWDCImpl::DoDrawRotatedText(const wxString& text,
void wxMSWDCImpl::DoSelectPalette(bool realize) void wxMSWDCImpl::DoSelectPalette(bool realize)
{ {
WXMICROWIN_CHECK_HDC
// Set the old object temporarily, in case the assignment deletes an object // Set the old object temporarily, in case the assignment deletes an object
// that's not yet selected out. // that's not yet selected out.
if (m_oldPalette) if (m_oldPalette)
@@ -1663,8 +1598,6 @@ void wxMSWDCImpl::InitializePalette()
void wxMSWDCImpl::SetFont(const wxFont& font) void wxMSWDCImpl::SetFont(const wxFont& font)
{ {
WXMICROWIN_CHECK_HDC
if ( font == m_font ) if ( font == m_font )
return; return;
@@ -1701,8 +1634,6 @@ void wxMSWDCImpl::SetFont(const wxFont& font)
void wxMSWDCImpl::SetPen(const wxPen& pen) void wxMSWDCImpl::SetPen(const wxPen& pen)
{ {
WXMICROWIN_CHECK_HDC
if ( pen == m_pen ) if ( pen == m_pen )
return; return;
@@ -1739,8 +1670,6 @@ void wxMSWDCImpl::SetPen(const wxPen& pen)
void wxMSWDCImpl::SetBrush(const wxBrush& brush) void wxMSWDCImpl::SetBrush(const wxBrush& brush)
{ {
WXMICROWIN_CHECK_HDC
if ( brush == m_brush ) if ( brush == m_brush )
return; return;
@@ -1801,8 +1730,6 @@ void wxMSWDCImpl::SetBrush(const wxBrush& brush)
void wxMSWDCImpl::SetBackground(const wxBrush& brush) void wxMSWDCImpl::SetBackground(const wxBrush& brush)
{ {
WXMICROWIN_CHECK_HDC
m_backgroundBrush = brush; m_backgroundBrush = brush;
if ( m_backgroundBrush.IsOk() ) if ( m_backgroundBrush.IsOk() )
@@ -1813,8 +1740,6 @@ void wxMSWDCImpl::SetBackground(const wxBrush& brush)
void wxMSWDCImpl::SetBackgroundMode(int mode) void wxMSWDCImpl::SetBackgroundMode(int mode)
{ {
WXMICROWIN_CHECK_HDC
m_backgroundMode = mode; m_backgroundMode = mode;
// SetBackgroundColour now only refers to text background // SetBackgroundColour now only refers to text background
@@ -1823,8 +1748,6 @@ void wxMSWDCImpl::SetBackgroundMode(int mode)
void wxMSWDCImpl::SetLogicalFunction(wxRasterOperationMode function) void wxMSWDCImpl::SetLogicalFunction(wxRasterOperationMode function)
{ {
WXMICROWIN_CHECK_HDC
m_logicalFunction = function; m_logicalFunction = function;
SetRop(m_hDC); SetRop(m_hDC);
@@ -1887,8 +1810,6 @@ void wxMSWDCImpl::EndPage()
wxCoord wxMSWDCImpl::GetCharHeight() const wxCoord wxMSWDCImpl::GetCharHeight() const
{ {
WXMICROWIN_CHECK_HDC_RET(0)
TEXTMETRIC lpTextMetric; TEXTMETRIC lpTextMetric;
GetTextMetrics(GetHdc(), &lpTextMetric); GetTextMetrics(GetHdc(), &lpTextMetric);
@@ -1898,8 +1819,6 @@ wxCoord wxMSWDCImpl::GetCharHeight() const
wxCoord wxMSWDCImpl::GetCharWidth() const wxCoord wxMSWDCImpl::GetCharWidth() const
{ {
WXMICROWIN_CHECK_HDC_RET(0)
TEXTMETRIC lpTextMetric; TEXTMETRIC lpTextMetric;
GetTextMetrics(GetHdc(), &lpTextMetric); GetTextMetrics(GetHdc(), &lpTextMetric);
@@ -1936,17 +1855,6 @@ void wxMSWDCImpl::DoGetTextExtent(const wxString& string, wxCoord *x, wxCoord *y
wxCoord *descent, wxCoord *externalLeading, wxCoord *descent, wxCoord *externalLeading,
const wxFont *font) const const wxFont *font) const
{ {
#ifdef __WXMICROWIN__
if (!GetHDC())
{
if (x) *x = 0;
if (y) *y = 0;
if (descent) *descent = 0;
if (externalLeading) *externalLeading = 0;
return;
}
#endif // __WXMICROWIN__
wxASSERT_MSG( !font || font->IsOk(), wxT("invalid font in wxMSWDCImpl::GetTextExtent") ); wxASSERT_MSG( !font || font->IsOk(), wxT("invalid font in wxMSWDCImpl::GetTextExtent") );
wxTextMeasure txm(GetOwner(), font); wxTextMeasure txm(GetOwner(), font);
@@ -2023,8 +1931,6 @@ void wxMSWDCImpl::RealizeScaleAndOrigin()
void wxMSWDCImpl::SetMapMode(wxMappingMode mode) void wxMSWDCImpl::SetMapMode(wxMappingMode mode)
{ {
WXMICROWIN_CHECK_HDC
m_mappingMode = mode; m_mappingMode = mode;
if ( mode == wxMM_TEXT ) if ( mode == wxMM_TEXT )
@@ -2082,8 +1988,6 @@ void wxMSWDCImpl::SetMapMode(wxMappingMode mode)
void wxMSWDCImpl::SetUserScale(double x, double y) void wxMSWDCImpl::SetUserScale(double x, double y)
{ {
WXMICROWIN_CHECK_HDC
if ( x == m_userScaleX && y == m_userScaleY ) if ( x == m_userScaleX && y == m_userScaleY )
return; return;
@@ -2095,8 +1999,6 @@ void wxMSWDCImpl::SetUserScale(double x, double y)
void wxMSWDCImpl::SetAxisOrientation(bool xLeftRight, void wxMSWDCImpl::SetAxisOrientation(bool xLeftRight,
bool yBottomUp) bool yBottomUp)
{ {
WXMICROWIN_CHECK_HDC
int signX = xLeftRight ? 1 : -1, int signX = xLeftRight ? 1 : -1,
signY = yBottomUp ? -1 : 1; signY = yBottomUp ? -1 : 1;
@@ -2110,8 +2012,6 @@ void wxMSWDCImpl::SetAxisOrientation(bool xLeftRight,
void wxMSWDCImpl::SetLogicalOrigin(wxCoord x, wxCoord y) void wxMSWDCImpl::SetLogicalOrigin(wxCoord x, wxCoord y)
{ {
WXMICROWIN_CHECK_HDC
if ( x == m_logicalOriginX && y == m_logicalOriginY ) if ( x == m_logicalOriginX && y == m_logicalOriginY )
return; return;
@@ -2123,8 +2023,6 @@ void wxMSWDCImpl::SetLogicalOrigin(wxCoord x, wxCoord y)
// For use by wxWidgets only, unless custom units are required. // For use by wxWidgets only, unless custom units are required.
void wxMSWDCImpl::SetLogicalScale(double x, double y) void wxMSWDCImpl::SetLogicalScale(double x, double y)
{ {
WXMICROWIN_CHECK_HDC
wxDCImpl::SetLogicalScale(x,y); wxDCImpl::SetLogicalScale(x,y);
RealizeScaleAndOrigin(); RealizeScaleAndOrigin();
@@ -2132,8 +2030,6 @@ void wxMSWDCImpl::SetLogicalScale(double x, double y)
void wxMSWDCImpl::SetDeviceOrigin(wxCoord x, wxCoord y) void wxMSWDCImpl::SetDeviceOrigin(wxCoord x, wxCoord y)
{ {
WXMICROWIN_CHECK_HDC
if ( x == m_deviceOriginX && y == m_deviceOriginY ) if ( x == m_deviceOriginX && y == m_deviceOriginY )
return; return;
@@ -2238,8 +2134,6 @@ bool wxMSWDCImpl::DoStretchBlit(wxCoord xdest, wxCoord ydest,
{ {
wxCHECK_MSG( source, false, wxT("wxMSWDCImpl::Blit(): NULL wxDC pointer") ); wxCHECK_MSG( source, false, wxT("wxMSWDCImpl::Blit(): NULL wxDC pointer") );
WXMICROWIN_CHECK_HDC_RET(false)
wxMSWDCImpl *implSrc = wxDynamicCast( source->GetImpl(), wxMSWDCImpl ); wxMSWDCImpl *implSrc = wxDynamicCast( source->GetImpl(), wxMSWDCImpl );
if ( !implSrc ) if ( !implSrc )
{ {
@@ -2547,8 +2441,6 @@ bool wxMSWDCImpl::DoStretchBlit(wxCoord xdest, wxCoord ydest,
void wxMSWDCImpl::GetDeviceSize(int *width, int *height) const void wxMSWDCImpl::GetDeviceSize(int *width, int *height) const
{ {
WXMICROWIN_CHECK_HDC
if ( width ) if ( width )
*width = ::GetDeviceCaps(GetHdc(), HORZRES); *width = ::GetDeviceCaps(GetHdc(), HORZRES);
if ( height ) if ( height )
@@ -2557,8 +2449,6 @@ void wxMSWDCImpl::GetDeviceSize(int *width, int *height) const
void wxMSWDCImpl::DoGetSizeMM(int *w, int *h) const void wxMSWDCImpl::DoGetSizeMM(int *w, int *h) const
{ {
WXMICROWIN_CHECK_HDC
// if we implement it in terms of DoGetSize() instead of directly using the // if we implement it in terms of DoGetSize() instead of directly using the
// results returned by GetDeviceCaps(HORZ/VERTSIZE) as was done before, it // results returned by GetDeviceCaps(HORZ/VERTSIZE) as was done before, it
// will also work for wxWindowDC and wxClientDC even though their size is // will also work for wxWindowDC and wxClientDC even though their size is
@@ -2587,8 +2477,6 @@ void wxMSWDCImpl::DoGetSizeMM(int *w, int *h) const
wxSize wxMSWDCImpl::GetPPI() const wxSize wxMSWDCImpl::GetPPI() const
{ {
WXMICROWIN_CHECK_HDC_RET(wxSize(0,0))
int x = ::GetDeviceCaps(GetHdc(), LOGPIXELSX); int x = ::GetDeviceCaps(GetHdc(), LOGPIXELSX);
int y = ::GetDeviceCaps(GetHdc(), LOGPIXELSY); int y = ::GetDeviceCaps(GetHdc(), LOGPIXELSY);

View File

@@ -623,10 +623,6 @@ int wxDisplayFactoryMSW::GetFromWindow(const wxWindow *window)
void wxClientDisplayRect(int *x, int *y, int *width, int *height) void wxClientDisplayRect(int *x, int *y, int *width, int *height)
{ {
#if defined(__WXMICROWIN__)
*x = 0; *y = 0;
wxDisplaySize(width, height);
#else
// Determine the desktop dimensions minus the taskbar and any other // Determine the desktop dimensions minus the taskbar and any other
// special decorations... // special decorations...
RECT r; RECT r;
@@ -636,5 +632,4 @@ void wxClientDisplayRect(int *x, int *y, int *width, int *height)
if (y) *y = r.top; if (y) *y = r.top;
if (width) *width = r.right - r.left; if (width) *width = r.right - r.left;
if (height) *height = r.bottom - r.top; if (height) *height = r.bottom - r.top;
#endif
} }

View File

@@ -93,10 +93,8 @@ private:
// private functions // private functions
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
#ifndef __WXMICROWIN__
int CALLBACK wxFontEnumeratorProc(LPLOGFONT lplf, LPTEXTMETRIC lptm, int CALLBACK wxFontEnumeratorProc(LPLOGFONT lplf, LPTEXTMETRIC lptm,
DWORD dwStyle, LPARAM lParam); DWORD dwStyle, LPARAM lParam);
#endif
// ============================================================================ // ============================================================================
// implementation // implementation
@@ -145,7 +143,6 @@ bool wxFontEnumeratorHelper::SetEncoding(wxFontEncoding encoding)
void wxFontEnumeratorHelper::DoEnumerate() void wxFontEnumeratorHelper::DoEnumerate()
{ {
#ifndef __WXMICROWIN__
HDC hDC = ::GetDC(NULL); HDC hDC = ::GetDC(NULL);
#ifdef __WXWINCE__ #ifdef __WXWINCE__
@@ -163,7 +160,6 @@ void wxFontEnumeratorHelper::DoEnumerate()
#endif // WinCE/!WinCE #endif // WinCE/!WinCE
::ReleaseDC(NULL, hDC); ::ReleaseDC(NULL, hDC);
#endif
} }
bool wxFontEnumeratorHelper::OnFont(const LPLOGFONT lf, bool wxFontEnumeratorHelper::OnFont(const LPLOGFONT lf,
@@ -266,7 +262,6 @@ bool wxFontEnumerator::EnumerateEncodings(const wxString& facename)
// Windows callbacks // Windows callbacks
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
#ifndef __WXMICROWIN__
int CALLBACK wxFontEnumeratorProc(LPLOGFONT lplf, LPTEXTMETRIC lptm, int CALLBACK wxFontEnumeratorProc(LPLOGFONT lplf, LPTEXTMETRIC lptm,
DWORD WXUNUSED(dwStyle), LPARAM lParam) DWORD WXUNUSED(dwStyle), LPARAM lParam)
{ {
@@ -286,6 +281,5 @@ int CALLBACK wxFontEnumeratorProc(LPLOGFONT lplf, LPTEXTMETRIC lptm,
return fontEnum->OnFont(lplf, lptm); return fontEnum->OnFont(lplf, lptm);
} }
#endif
#endif // wxUSE_FONTENUM #endif // wxUSE_FONTENUM

View File

@@ -201,7 +201,6 @@ wxFontEncoding wxGetFontEncFromCharSet(int cs)
fontEncoding = wxFONTENCODING_MAX; fontEncoding = wxFONTENCODING_MAX;
break; break;
#if !defined(__WXMICROWIN__)
case EASTEUROPE_CHARSET: case EASTEUROPE_CHARSET:
fontEncoding = wxFONTENCODING_CP1250; fontEncoding = wxFONTENCODING_CP1250;
break; break;
@@ -262,8 +261,6 @@ wxFontEncoding wxGetFontEncFromCharSet(int cs)
fontEncoding = wxFONTENCODING_MACROMAN; fontEncoding = wxFONTENCODING_MACROMAN;
break; break;
#endif // Win32
case OEM_CHARSET: case OEM_CHARSET:
fontEncoding = wxFONTENCODING_CP437; fontEncoding = wxFONTENCODING_CP437;
break; break;

View File

@@ -462,7 +462,7 @@ void wxFrame::AttachMenuBar(wxMenuBar *menubar)
void wxFrame::InternalSetMenuBar() void wxFrame::InternalSetMenuBar()
{ {
#if defined(__WXMICROWIN__) || defined(__WXWINCE__) #if defined(__WXWINCE__)
// Nothing // Nothing
#else #else
if ( !::SetMenu(GetHwnd(), (HMENU)m_hMenu) ) if ( !::SetMenu(GetHwnd(), (HMENU)m_hMenu) )
@@ -564,7 +564,7 @@ void wxFrame::OnSysColourChanged(wxSysColourChangedEvent& event)
bool wxFrame::ShowFullScreen(bool show, long style) bool wxFrame::ShowFullScreen(bool show, long style)
{ {
// TODO-CE: add support for CE // TODO-CE: add support for CE
#if !defined(__WXMICROWIN__) && !defined(__WXWINCE__) #if !defined(__WXWINCE__)
if ( IsFullScreen() == show ) if ( IsFullScreen() == show )
return false; return false;
@@ -637,7 +637,7 @@ bool wxFrame::ShowFullScreen(bool show, long style)
} }
#endif // wxUSE_STATUSBAR #endif // wxUSE_STATUSBAR
} }
#endif // !defined(__WXMICROWIN__) && !defined(__WXWINCE__) #endif // !defined(__WXWINCE__)
return wxFrameBase::ShowFullScreen(show, style); return wxFrameBase::ShowFullScreen(show, style);
} }
@@ -848,7 +848,7 @@ bool wxFrame::MSWDoTranslateMessage(wxFrame *frame, WXMSG *pMsg)
bool wxFrame::HandleSize(int WXUNUSED(x), int WXUNUSED(y), WXUINT id) bool wxFrame::HandleSize(int WXUNUSED(x), int WXUNUSED(y), WXUINT id)
{ {
#if !defined(__WXMICROWIN__) && !defined(__WXWINCE__) #if !defined(__WXWINCE__)
switch ( id ) switch ( id )
{ {
case SIZE_RESTORED: case SIZE_RESTORED:
@@ -1001,7 +1001,7 @@ WXLRESULT wxFrame::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lPara
} }
break; break;
#if !defined(__WXMICROWIN__) && !defined(__WXWINCE__) #if !defined(__WXWINCE__)
case WM_QUERYDRAGICON: case WM_QUERYDRAGICON:
{ {
const wxIcon& icon = GetIcon(); const wxIcon& icon = GetIcon();
@@ -1011,7 +1011,7 @@ WXLRESULT wxFrame::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lPara
processed = rc != 0; processed = rc != 0;
} }
break; break;
#endif // !__WXMICROWIN__ #endif // !__WXWINCE__
} }
#if wxUSE_TASKBARBUTTON #if wxUSE_TASKBARBUTTON
if ( message == wxMsgTaskbarButtonCreated ) if ( message == wxMsgTaskbarButtonCreated )

View File

@@ -64,8 +64,6 @@ WX_DEFINE_LIST(wxGDIImageHandlerList)
// private classes // private classes
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
#ifndef __WXMICROWIN__
// all image handlers are declared/defined in this file because the outside // all image handlers are declared/defined in this file because the outside
// world doesn't have to know about them (but only about wxBITMAP_TYPE_XXX ids) // world doesn't have to know about them (but only about wxBITMAP_TYPE_XXX ids)
@@ -221,8 +219,6 @@ wxIMPLEMENT_DYNAMIC_CLASS(wxPNGResourceHandler, wxBitmapHandler);
// private functions // private functions
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
#endif
// __MICROWIN__
// ============================================================================ // ============================================================================
// implementation // implementation
@@ -338,7 +334,6 @@ void wxGDIImage::CleanUpHandlers()
void wxGDIImage::InitStandardHandlers() void wxGDIImage::InitStandardHandlers()
{ {
#ifndef __WXMICROWIN__
AddHandler(new wxBMPResourceHandler); AddHandler(new wxBMPResourceHandler);
AddHandler(new wxBMPFileHandler); AddHandler(new wxBMPFileHandler);
AddHandler(new wxICOFileHandler); AddHandler(new wxICOFileHandler);
@@ -346,11 +341,8 @@ void wxGDIImage::InitStandardHandlers()
#if wxUSE_PNG_RESOURCE_HANDLER #if wxUSE_PNG_RESOURCE_HANDLER
AddHandler(new wxPNGResourceHandler); AddHandler(new wxPNGResourceHandler);
#endif // wxUSE_PNG_RESOURCE_HANDLER #endif // wxUSE_PNG_RESOURCE_HANDLER
#endif
} }
#ifndef __WXMICROWIN__
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// wxBitmap handlers // wxBitmap handlers
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -688,5 +680,3 @@ wxSize wxGetHiconSize(HICON WXUNUSED_IN_WINCE(hicon))
return size; return size;
} }
#endif // __WXMICROWIN__

View File

@@ -49,7 +49,7 @@
#include "wx/msw/private.h" // needs to be before #include <commdlg.h> #include "wx/msw/private.h" // needs to be before #include <commdlg.h>
#if wxUSE_COMMON_DIALOGS && !defined(__WXMICROWIN__) #if wxUSE_COMMON_DIALOGS
#include <commdlg.h> #include <commdlg.h>
#endif #endif

View File

@@ -52,9 +52,7 @@ void wxIconRefData::Free()
{ {
if ( m_hIcon ) if ( m_hIcon )
{ {
#ifndef __WXMICROWIN__
::DestroyIcon((HICON) m_hIcon); ::DestroyIcon((HICON) m_hIcon);
#endif
m_hIcon = 0; m_hIcon = 0;
} }
@@ -113,7 +111,6 @@ wxObjectRefData *wxIcon::CloneRefData(const wxObjectRefData *dataOrig) const
void wxIcon::CopyFromBitmap(const wxBitmap& bmp) void wxIcon::CopyFromBitmap(const wxBitmap& bmp)
{ {
#ifndef __WXMICROWIN__
HICON hicon = wxBitmapToHICON(bmp); HICON hicon = wxBitmapToHICON(bmp);
if ( !hicon ) if ( !hicon )
{ {
@@ -124,7 +121,6 @@ void wxIcon::CopyFromBitmap(const wxBitmap& bmp)
SetHICON((WXHICON)hicon); SetHICON((WXHICON)hicon);
SetSize(bmp.GetWidth(), bmp.GetHeight()); SetSize(bmp.GetWidth(), bmp.GetHeight());
} }
#endif // __WXMICROWIN__
} }
void wxIcon::CreateIconFromXpm(const char* const* data) void wxIcon::CreateIconFromXpm(const char* const* data)

View File

@@ -54,10 +54,6 @@
#define DllMain DllEntryPoint #define DllMain DllEntryPoint
#endif // __BORLANDC__ #endif // __BORLANDC__
#if defined(__WXMICROWIN__)
#define HINSTANCE HANDLE
#endif
// defined in common/init.cpp // defined in common/init.cpp
extern int wxEntryReal(int& argc, wxChar **argv); extern int wxEntryReal(int& argc, wxChar **argv);
extern int wxEntryCleanupReal(int& argc, wxChar **argv); extern int wxEntryCleanupReal(int& argc, wxChar **argv);

View File

@@ -1,364 +0,0 @@
/*
/////////////////////////////////////////////////////////////////////////////
// Name: src/msw/microwin.cpp
// Purpose: Extra implementation for MicroWindows
// Author: Julian Smart
// Created: 2001-05-31
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
*/
#include "mwtypes.h"
#include "windows.h"
#include "wintern.h"
#include "device.h"
#include "wx/msw/microwin.h"
void GdMoveCursor(MWCOORD x, MWCOORD y);
void MwSetCursor(HWND wp, PMWCURSOR pcursor);
BOOL SetCursorPos(int x, int y)
{
GdMoveCursor(x, y);
return TRUE;
}
HCURSOR SetCursor(HCURSOR hCursor)
{
/* TODO */
return 0;
}
int GetScrollPosWX (HWND hWnd, int iSBar)
{
int pos = 0;
if (GetScrollPos(hWnd, iSBar, & pos))
return pos;
else
return 0;
}
BOOL ScrollWindow(HWND hWnd, int xAmount, int yAmount,
CONST RECT* lpRect, CONST RECT* lpClipRect)
{
/* TODO */
return FALSE;
}
HWND WindowFromPoint(POINT pt)
{
/* TODO */
return 0;
}
SHORT GetKeyState(int nVirtKey)
{
/* TODO */
return 0;
}
HWND SetParent(HWND hWndChild, HWND hWndNewParent)
{
/* TODO */
return 0;
}
VOID DragAcceptFiles(HWND hWnd, BOOL b)
{
/* TODO */
}
BOOL IsDialogMessage(HWND hWnd, MSG* msg)
{
/* TODO */
return FALSE;
}
DWORD GetMessagePos(VOID)
{
/* TODO */
return 0;
}
BOOL IsIconic(HWND hWnd)
{
/* TODO */
return FALSE;
}
int SetMapMode(HDC hDC, wxMappingMode mode)
{
return MM_TEXT;
}
wxMappingMode GetMapMode(HDC hDC)
{
return MM_TEXT;
}
HCURSOR LoadCursor(HINSTANCE hInst, int cursor)
{
/* TODO */
return 0;
}
DWORD GetModuleFileName(HINSTANCE hInst, LPSTR name, DWORD sz)
{
/* TODO */
name[0] = 0;
return 0;
}
VOID DestroyIcon(HICON hIcon)
{
/* TODO */
}
COLORREF GetTextColor(HDC hdc)
{
if (!hdc)
return CLR_INVALID;
return hdc->textcolor ;
}
COLORREF GetBkColor(HDC hdc)
{
if (!hdc)
return CLR_INVALID;
return hdc->bkcolor ;
}
HPALETTE SelectPalette(HDC hdc, HPALETTE hPalette, BOOL b)
{
/* TODO */
return 0;
}
BOOL IntersectClipRect(HDC hdc, int x, int y,
int right, int bottom)
{
/* TODO */
HRGN rgn = CreateRectRgn(x, y, right, bottom);
BOOL ret = (ExtSelectClipRgn(hdc, rgn, RGN_AND) != ERROR);
DeleteObject(rgn);
return ret;
}
BOOL GetClipBox(HDC hdc, RECT* rect)
{
MWCLIPREGION* r;
MWRECT mwrect;
if (!hdc->region)
return FALSE;
r = ((MWRGNOBJ*) hdc->region)->rgn;
GdGetRegionBox(r, & mwrect);
rect->left = mwrect.left;
rect->top = mwrect.top;
rect->right = mwrect.right;
rect->bottom = mwrect.bottom;
return TRUE;
}
BOOL DrawIconEx(HDC hdc, int x, int y, HICON hIcon, int w, int h, UINT istepIfAniCur, HBRUSH hbrFlickerFreeDraw, UINT diFlags)
{
/* TODO */
return FALSE;
}
BOOL SetViewportExtEx(HDC hdc, int x, int y, LPSIZE lpSize)
{
/* TODO */
return FALSE;
}
BOOL SetViewportOrgEx(HDC hdc, int x, int y, LPPOINT lpPoint)
{
/* TODO */
return FALSE;
}
BOOL SetWindowExtEx(HDC hdc, int x, int y, LPSIZE lpSize)
{
/* TODO */
return FALSE;
}
BOOL SetWindowOrgEx(HDC hdc, int x, int y, LPPOINT lpSize)
{
/* TODO */
return FALSE;
}
BOOL ExtFloodFill(HDC hdc, int x, int y, COLORREF col, UINT flags)
{
/* TODO */
return FALSE;
}
int SetPolyFillMode(HDC hdc, int mode)
{
/* TODO */
return 0;
}
BOOL RoundRect(HDC hdc, int left, int top, int right, int bottom, int r1, int r2)
{
/* TODO */
return Rectangle(hdc, left, top, right, bottom);
}
BOOL MaskBlt(HDC hdc, int x, int y, int w, int h,
HDC hDCSource, int xSrc, int ySrc, HBITMAP hBitmapMask, int xMask, int yMask, DWORD rop)
{
/* TODO */
return FALSE;
}
UINT RealizePalette(HDC hDC)
{
/* TODO */
return 0;
}
BOOL SetBrushOrgEx(HDC hdc, int xOrigin, int yOrigin, LPPOINT lpPoint)
{
/* TODO */
return FALSE;
}
int GetObject(HGDIOBJ hObj, int sz, LPVOID logObj)
{
if (sz == sizeof(LOGFONT))
{
LOGFONT* logFont = (LOGFONT*) logObj;
MWFONTINFO fi;
HFONT hFont = (HFONT) hObj;
GdGetFontInfo(((MWFONTOBJ*) hFont)->pfont, &fi);
/* FIXME many items are guessed for the time being*/
logFont->lfHeight = fi.height;
/* reversed for kaffe port
logFont->tmAscent = fi.height - fi.baseline;
logFont->tmDescent= fi.baseline;
*/
logFont->lfWidth = fi.widths['x'];
logFont->lfWeight = FW_NORMAL;
logFont->lfEscapement = 0;
logFont->lfOrientation = 0;
logFont->lfOutPrecision = OUT_OUTLINE_PRECIS;
logFont->lfClipPrecision = CLIP_DEFAULT_PRECIS;
logFont->lfQuality = DEFAULT_QUALITY;
logFont->lfItalic = 0;
logFont->lfUnderline = 0;
logFont->lfStrikeOut = 0;
/* note that win32 has the TMPF_FIXED_PITCH flags REVERSED...*/
logFont->lfPitchAndFamily = fi.fixed?
FF_DONTCARE: (FF_DONTCARE | TMPF_FIXED_PITCH);
logFont->lfCharSet = OEM_CHARSET;
/* TODO I don't know how to get the font name. May
* test for different font classes.
*/
logFont->lfFaceName[0] = 0;
#if 0
strncpy(logFont->lfFaceName, ??, sizeof(logFont->lfFaceName));
#endif
return sz;
}
else
{
return 0;
}
}
/* Not in wingdi.c in earlier versions of MicroWindows */
#if 0
HBITMAP WINAPI
CreateCompatibleBitmap(HDC hdc, int nWidth, int nHeight)
{
MWBITMAPOBJ *hbitmap;
int size;
int linelen;
if(!hdc)
return NULL;
nWidth = MWMAX(nWidth, 1);
nHeight = MWMAX(nHeight, 1);
/* calc memory allocation size and linelen from width and height*/
if(!GdCalcMemGCAlloc(hdc->psd, nWidth, nHeight, 0, 0, &size, &linelen))
return NULL;
/* allocate gdi object*/
hbitmap = (MWBITMAPOBJ *)GdItemAlloc(sizeof(MWBITMAPOBJ)-1+size);
if(!hbitmap)
return NULL;
hbitmap->hdr.type = OBJ_BITMAP;
hbitmap->hdr.stockobj = FALSE;
hbitmap->width = nWidth;
hbitmap->height = nHeight;
/* create compatible with hdc*/
hbitmap->planes = hdc->psd->planes;
hbitmap->bpp = hdc->psd->bpp;
hbitmap->linelen = linelen;
hbitmap->size = size;
return (HBRUSH)hbitmap;
}
#endif
/* Attempt by JACS to create arbitrary bitmap
* TODO: make use of lpData
*/
HBITMAP WINAPI
CreateBitmap( int nWidth, int nHeight, int nPlanes, int bPP, LPCVOID lpData)
{
MWBITMAPOBJ *hbitmap;
int size;
int linelen;
HDC hScreenDC;
hScreenDC = GetDC(NULL);
nWidth = MWMAX(nWidth, 1);
nHeight = MWMAX(nHeight, 1);
/* calc memory allocation size and linelen from width and height*/
if(!GdCalcMemGCAlloc(hScreenDC->psd, nWidth, nHeight, nPlanes, bPP, &size, &linelen))
{
ReleaseDC(NULL, hScreenDC);
return NULL;
}
ReleaseDC(NULL, hScreenDC);
/* allocate gdi object*/
hbitmap = (MWBITMAPOBJ *)GdItemAlloc(sizeof(MWBITMAPOBJ)-1+size);
if(!hbitmap)
return NULL;
hbitmap->hdr.type = OBJ_BITMAP;
hbitmap->hdr.stockobj = FALSE;
hbitmap->width = nWidth;
hbitmap->height = nHeight;
/* create with specified parameters */
hbitmap->planes = nPlanes;
hbitmap->bpp = bPP;
hbitmap->linelen = linelen;
hbitmap->size = size;
/* TODO: copy data */
return (HBRUSH)hbitmap;
}

View File

@@ -35,7 +35,7 @@
#define M_PENDATA ((wxPenRefData*)m_refData) #define M_PENDATA ((wxPenRefData*)m_refData)
// Win32 has ExtCreatePen() but WinCE doesn't // Win32 has ExtCreatePen() but WinCE doesn't
#if !defined(__WXMICROWIN__) && !defined(__WXWINCE__) #if !defined(__WXWINCE__)
#define wxHAVE_EXT_CREATE_PEN #define wxHAVE_EXT_CREATE_PEN
#endif #endif

View File

@@ -48,7 +48,7 @@ public:
wxRegionRefData(const wxRegionRefData& data) : wxGDIRefData() wxRegionRefData(const wxRegionRefData& data) : wxGDIRefData()
{ {
#if !defined(__WXMICROWIN__) && !defined(__WXWINCE__) #if !defined(__WXWINCE__)
DWORD noBytes = ::GetRegionData(data.m_region, 0, NULL); DWORD noBytes = ::GetRegionData(data.m_region, 0, NULL);
RGNDATA *rgnData = (RGNDATA*) new char[noBytes]; RGNDATA *rgnData = (RGNDATA*) new char[noBytes];
::GetRegionData(data.m_region, noBytes, rgnData); ::GetRegionData(data.m_region, noBytes, rgnData);
@@ -120,7 +120,7 @@ wxRegion::wxRegion(const wxRect& rect)
wxRegion::wxRegion(size_t n, const wxPoint *points, wxPolygonFillMode fillStyle) wxRegion::wxRegion(size_t n, const wxPoint *points, wxPolygonFillMode fillStyle)
{ {
#if defined(__WXMICROWIN__) || defined(__WXWINCE__) #if defined(__WXWINCE__)
wxUnusedVar(n); wxUnusedVar(n);
wxUnusedVar(points); wxUnusedVar(points);
wxUnusedVar(fillStyle); wxUnusedVar(fillStyle);

View File

@@ -159,14 +159,7 @@ wxFont wxCreateFontFromStockObject(int index)
{ {
wxNativeFontInfo info; wxNativeFontInfo info;
info.lf = lf; info.lf = lf;
// Under MicroWindows we pass the HFONT as well
// because it's hard to convert HFONT -> LOGFONT -> HFONT
// It's OK to delete stock objects, the delete will be ignored.
#ifdef __WXMICROWIN__
font.Create(info, (WXHFONT) hFont);
#else
font.Create(info); font.Create(info);
#endif
} }
else else
{ {
@@ -335,10 +328,6 @@ static const int gs_metricsMap[] =
// Get a system metric, e.g. scrollbar size // Get a system metric, e.g. scrollbar size
int wxSystemSettingsNative::GetMetric(wxSystemMetric index, wxWindow* WXUNUSED(win)) int wxSystemSettingsNative::GetMetric(wxSystemMetric index, wxWindow* WXUNUSED(win))
{ {
#ifdef __WXMICROWIN__
// TODO: probably use wxUniv themes functionality
return 0;
#else // !__WXMICROWIN__
wxCHECK_MSG( index > 0 && (size_t)index < WXSIZEOF(gs_metricsMap), 0, wxCHECK_MSG( index > 0 && (size_t)index < WXSIZEOF(gs_metricsMap), 0,
wxT("invalid metric") ); wxT("invalid metric") );
@@ -363,7 +352,6 @@ int wxSystemSettingsNative::GetMetric(wxSystemMetric index, wxWindow* WXUNUSED(w
} }
return rc; return rc;
#endif // __WXMICROWIN__/!__WXMICROWIN__
} }
bool wxSystemSettingsNative::HasFeature(wxSystemFeature index) bool wxSystemSettingsNative::HasFeature(wxSystemFeature index)

View File

@@ -63,17 +63,6 @@
#define ICON_SMALL 0 #define ICON_SMALL 0
#endif #endif
// ----------------------------------------------------------------------------
// stubs for missing functions under MicroWindows
// ----------------------------------------------------------------------------
#ifdef __WXMICROWIN__
// static inline bool IsIconic(HWND WXUNUSED(hwnd)) { return false; }
static inline bool IsZoomed(HWND WXUNUSED(hwnd)) { return false; }
#endif // __WXMICROWIN__
// NB: wxDlgProc must be defined here and not in dialog.cpp because the latter // NB: wxDlgProc must be defined here and not in dialog.cpp because the latter
// is not included by wxUniv build which does need wxDlgProc // is not included by wxUniv build which does need wxDlgProc
LONG APIENTRY LONG APIENTRY
@@ -426,10 +415,6 @@ bool wxTopLevelWindowMSW::CreateDialog(const void *dlgTemplate,
const wxPoint& pos, const wxPoint& pos,
const wxSize& size) const wxSize& size)
{ {
#ifdef __WXMICROWIN__
// no dialogs support under MicroWin yet
return CreateFrame(title, pos, size);
#else // !__WXMICROWIN__
// static cast is valid as we're only ever called for dialogs // static cast is valid as we're only ever called for dialogs
wxWindow * const wxWindow * const
parent = static_cast<wxDialog *>(this)->GetParentForModalDialog(); parent = static_cast<wxDialog *>(this)->GetParentForModalDialog();
@@ -504,7 +489,6 @@ bool wxTopLevelWindowMSW::CreateDialog(const void *dlgTemplate,
#endif #endif
return true; return true;
#endif // __WXMICROWIN__/!__WXMICROWIN__
} }
bool wxTopLevelWindowMSW::CreateFrame(const wxString& title, bool wxTopLevelWindowMSW::CreateFrame(const wxString& title,
@@ -1180,7 +1164,6 @@ void wxTopLevelWindowMSW::SetIcons(const wxIconBundle& icons)
bool wxTopLevelWindowMSW::EnableCloseButton(bool enable) bool wxTopLevelWindowMSW::EnableCloseButton(bool enable)
{ {
#if !defined(__WXMICROWIN__)
// get system (a.k.a. window) menu // get system (a.k.a. window) menu
HMENU hmenu = GetSystemMenu(GetHwnd(), FALSE /* get it */); HMENU hmenu = GetSystemMenu(GetHwnd(), FALSE /* get it */);
if ( !hmenu ) if ( !hmenu )
@@ -1207,7 +1190,6 @@ bool wxTopLevelWindowMSW::EnableCloseButton(bool enable)
wxLogLastError(wxT("DrawMenuBar")); wxLogLastError(wxT("DrawMenuBar"));
} }
#endif #endif
#endif // !__WXMICROWIN__
return true; return true;
} }

View File

@@ -56,7 +56,7 @@
#include <winsock.h> #include <winsock.h>
#endif #endif
#if !defined(__GNUWIN32__) && !defined(__WXMICROWIN__) && !defined(__WXWINCE__) #if !defined(__GNUWIN32__) && !defined(__WXWINCE__)
#include <direct.h> #include <direct.h>
#include <dos.h> #include <dos.h>
@@ -86,7 +86,7 @@
#include <lm.h> #include <lm.h>
#endif // USE_NET_API #endif // USE_NET_API
#if !defined(__WXMICROWIN__) && !defined(__WXWINCE__) #if !defined(__WXWINCE__)
#ifndef __UNIX__ #ifndef __UNIX__
#include <io.h> #include <io.h>
#endif #endif
@@ -106,7 +106,7 @@
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// In the WIN.INI file // In the WIN.INI file
#if (!defined(USE_NET_API) && !defined(__WXWINCE__)) || defined(__WXMICROWIN__) #if (!defined(USE_NET_API) && !defined(__WXWINCE__))
static const wxChar WX_SECTION[] = wxT("wxWindows"); static const wxChar WX_SECTION[] = wxT("wxWindows");
#endif #endif
@@ -153,7 +153,7 @@ bool wxGetHostName(wxChar *buf, int maxSize)
// get full hostname (with domain name if possible) // get full hostname (with domain name if possible)
bool wxGetFullHostName(wxChar *buf, int maxSize) bool wxGetFullHostName(wxChar *buf, int maxSize)
{ {
#if !defined( __WXMICROWIN__) && wxUSE_DYNLIB_CLASS && wxUSE_SOCKETS #if wxUSE_DYNLIB_CLASS && wxUSE_SOCKETS
// TODO should use GetComputerNameEx() when available // TODO should use GetComputerNameEx() when available
// we don't want to always link with Winsock DLL as we might not use it at // we don't want to always link with Winsock DLL as we might not use it at
@@ -229,7 +229,7 @@ bool wxGetFullHostName(wxChar *buf, int maxSize)
} }
} }
} }
#endif // !__WXMICROWIN__ #endif // wxUSE_DYNLIB_CLASS && wxUSE_SOCKETS
return wxGetHostName(buf, maxSize); return wxGetHostName(buf, maxSize);
} }
@@ -1300,8 +1300,6 @@ wxOperatingSystemId wxGetOsVersion(int *verMaj, int *verMin)
#if defined(__WXWINCE__) #if defined(__WXWINCE__)
s_version.os = wxOS_WINDOWS_CE; s_version.os = wxOS_WINDOWS_CE;
#elif defined(__WXMICROWIN__)
s_version.os = wxOS_WINDOWS_MICRO;
#else // "normal" desktop Windows system, use run-time detection #else // "normal" desktop Windows system, use run-time detection
switch ( info.dwPlatformId ) switch ( info.dwPlatformId )
{ {
@@ -1454,7 +1452,6 @@ extern WXDLLIMPEXP_BASE long wxEncodingToCharset(wxFontEncoding encoding)
case wxFONTENCODING_CP1252: case wxFONTENCODING_CP1252:
return ANSI_CHARSET; return ANSI_CHARSET;
#if !defined(__WXMICROWIN__)
// The following four fonts are multi-byte charsets // The following four fonts are multi-byte charsets
case wxFONTENCODING_CP932: case wxFONTENCODING_CP932:
return SHIFTJIS_CHARSET; return SHIFTJIS_CHARSET;
@@ -1494,7 +1491,6 @@ extern WXDLLIMPEXP_BASE long wxEncodingToCharset(wxFontEncoding encoding)
case wxFONTENCODING_CP874: case wxFONTENCODING_CP874:
return THAI_CHARSET; return THAI_CHARSET;
#endif // !__WXMICROWIN__
case wxFONTENCODING_CP437: case wxFONTENCODING_CP437:
return OEM_CHARSET; return OEM_CHARSET;

View File

@@ -45,7 +45,7 @@
#include <ctype.h> #include <ctype.h>
#if !defined(__GNUWIN32__) && !defined(__WXMICROWIN__) && !defined(__WXWINCE__) #if !defined(__GNUWIN32__) && !defined(__WXWINCE__)
#include <direct.h> #include <direct.h>
#include <dos.h> #include <dos.h>
#endif #endif
@@ -54,7 +54,7 @@
#include <sys/stat.h> #include <sys/stat.h>
#endif #endif
#if !defined(__WXMICROWIN__) && !defined(__WXWINCE__) #if !defined(__WXWINCE__)
#ifndef __UNIX__ #ifndef __UNIX__
#include <io.h> #include <io.h>
#endif #endif

View File

@@ -62,9 +62,7 @@ void wxBeginBusyCursor(const wxCursor *cursor)
if ( gs_wxBusyCursorCount++ == 0 ) if ( gs_wxBusyCursorCount++ == 0 )
{ {
gs_wxBusyCursor = (HCURSOR)cursor->GetHCURSOR(); gs_wxBusyCursor = (HCURSOR)cursor->GetHCURSOR();
#ifndef __WXMICROWIN__
gs_wxBusyCursorOld = ::SetCursor(gs_wxBusyCursor); gs_wxBusyCursorOld = ::SetCursor(gs_wxBusyCursor);
#endif
} }
//else: nothing to do, already set //else: nothing to do, already set
} }
@@ -77,9 +75,7 @@ void wxEndBusyCursor()
if ( --gs_wxBusyCursorCount == 0 ) if ( --gs_wxBusyCursorCount == 0 )
{ {
#ifndef __WXMICROWIN__
::SetCursor(gs_wxBusyCursorOld); ::SetCursor(gs_wxBusyCursorOld);
#endif
gs_wxBusyCursorOld = 0; gs_wxBusyCursorOld = 0;
} }
} }
@@ -123,10 +119,6 @@ void wxGetMousePosition( int* x, int* y )
// Return true if we have a colour display // Return true if we have a colour display
bool wxColourDisplay() bool wxColourDisplay()
{ {
#ifdef __WXMICROWIN__
// MICROWIN_TODO
return true;
#else
// this function is called from wxDC ctor so it is called a *lot* of times // this function is called from wxDC ctor so it is called a *lot* of times
// hence we optimize it a bit but doing the check only once // hence we optimize it a bit but doing the check only once
// //
@@ -143,7 +135,6 @@ bool wxColourDisplay()
} }
return s_isColour != 0; return s_isColour != 0;
#endif
} }
// Returns depth of screen // Returns depth of screen
@@ -156,41 +147,22 @@ int wxDisplayDepth()
// Get size of display // Get size of display
void wxDisplaySize(int *width, int *height) void wxDisplaySize(int *width, int *height)
{ {
#ifdef __WXMICROWIN__
RECT rect;
HWND hWnd = GetDesktopWindow();
::GetWindowRect(hWnd, & rect);
if ( width )
*width = rect.right - rect.left;
if ( height )
*height = rect.bottom - rect.top;
#else // !__WXMICROWIN__
ScreenHDC dc; ScreenHDC dc;
if ( width ) if ( width )
*width = ::GetDeviceCaps(dc, HORZRES); *width = ::GetDeviceCaps(dc, HORZRES);
if ( height ) if ( height )
*height = ::GetDeviceCaps(dc, VERTRES); *height = ::GetDeviceCaps(dc, VERTRES);
#endif // __WXMICROWIN__/!__WXMICROWIN__
} }
void wxDisplaySizeMM(int *width, int *height) void wxDisplaySizeMM(int *width, int *height)
{ {
#ifdef __WXMICROWIN__
// MICROWIN_TODO
if ( width )
*width = 0;
if ( height )
*height = 0;
#else
ScreenHDC dc; ScreenHDC dc;
if ( width ) if ( width )
*width = ::GetDeviceCaps(dc, HORZSIZE); *width = ::GetDeviceCaps(dc, HORZSIZE);
if ( height ) if ( height )
*height = ::GetDeviceCaps(dc, VERTSIZE); *height = ::GetDeviceCaps(dc, VERTSIZE);
#endif
} }
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
@@ -214,8 +186,6 @@ wxString WXDLLEXPORT wxGetWindowClass(WXHWND hWnd)
{ {
wxString str; wxString str;
// MICROWIN_TODO
#ifndef __WXMICROWIN__
if ( hWnd ) if ( hWnd )
{ {
int len = 256; // some starting value int len = 256; // some starting value
@@ -236,7 +206,6 @@ wxString WXDLLEXPORT wxGetWindowClass(WXHWND hWnd)
} }
} }
} }
#endif // !__WXMICROWIN__
return str; return str;
} }

View File

@@ -107,10 +107,8 @@
#include <string.h> #include <string.h>
#if !defined(__WXMICROWIN__) #include <shellapi.h>
#include <shellapi.h> #include <mmsystem.h>
#include <mmsystem.h>
#endif
#include <windowsx.h> #include <windowsx.h>
@@ -273,14 +271,6 @@ static wxWindowMSW *FindWindowForMouseEvent(wxWindowMSW *win, int *x, int *y);
// wrapper around BringWindowToTop() API // wrapper around BringWindowToTop() API
static inline void wxBringWindowToTop(HWND hwnd) static inline void wxBringWindowToTop(HWND hwnd)
{ {
#ifdef __WXMICROWIN__
// It seems that MicroWindows brings the _parent_ of the window to the top,
// which can be the wrong one.
// activate (set focus to) specified window
::SetFocus(hwnd);
#endif
// raise top level parent to top of z order // raise top level parent to top of z order
if (!::SetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE)) if (!::SetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE))
{ {
@@ -931,17 +921,12 @@ namespace
inline int GetScrollPosition(HWND hWnd, int wOrient) inline int GetScrollPosition(HWND hWnd, int wOrient)
{ {
#ifdef __WXMICROWIN__
return ::GetScrollPosWX(hWnd, wOrient);
#else
WinStruct<SCROLLINFO> scrollInfo; WinStruct<SCROLLINFO> scrollInfo;
scrollInfo.cbSize = sizeof(SCROLLINFO); scrollInfo.cbSize = sizeof(SCROLLINFO);
scrollInfo.fMask = SIF_POS; scrollInfo.fMask = SIF_POS;
::GetScrollInfo(hWnd, wOrient, &scrollInfo ); ::GetScrollInfo(hWnd, wOrient, &scrollInfo );
return scrollInfo.nPos; return scrollInfo.nPos;
#endif
} }
inline UINT WXOrientToSB(int orient) inline UINT WXOrientToSB(int orient)
@@ -1555,9 +1540,7 @@ bool wxWindowMSW::Reparent(wxWindowBase *parent)
static inline void SendSetRedraw(HWND hwnd, bool on) static inline void SendSetRedraw(HWND hwnd, bool on)
{ {
#ifndef __WXMICROWIN__
::SendMessage(hwnd, WM_SETREDRAW, (WPARAM)on, 0); ::SendMessage(hwnd, WM_SETREDRAW, (WPARAM)on, 0);
#endif
} }
void wxWindowMSW::DoFreeze() void wxWindowMSW::DoFreeze()
@@ -1617,7 +1600,7 @@ void wxWindowMSW::Update()
wxLogLastError(wxT("UpdateWindow")); wxLogLastError(wxT("UpdateWindow"));
} }
#if !defined(__WXMICROWIN__) && !defined(__WXWINCE__) #if !defined(__WXWINCE__)
// just calling UpdateWindow() is not enough, what we did in our WM_PAINT // just calling UpdateWindow() is not enough, what we did in our WM_PAINT
// handler needs to be really drawn right now // handler needs to be really drawn right now
(void)::GdiFlush(); (void)::GdiFlush();
@@ -2864,7 +2847,7 @@ wxWindowMSW::MSWHandleMessage(WXLRESULT *result,
break; break;
#endif // !__WXWINCE__ #endif // !__WXWINCE__
#if !defined(__WXMICROWIN__) && !defined(__WXWINCE__) #if !defined(__WXWINCE__)
case WM_ACTIVATEAPP: case WM_ACTIVATEAPP:
// This implicitly sends a wxEVT_ACTIVATE_APP event // This implicitly sends a wxEVT_ACTIVATE_APP event
wxTheApp->SetActive(wParam != 0, FindFocus()); wxTheApp->SetActive(wParam != 0, FindFocus());
@@ -2970,28 +2953,6 @@ wxWindowMSW::MSWHandleMessage(WXLRESULT *result,
case WM_XBUTTONDBLCLK: case WM_XBUTTONDBLCLK:
#endif // wxHAS_XBUTTON #endif // wxHAS_XBUTTON
{ {
#ifdef __WXMICROWIN__
// MicroWindows seems to ignore the fact that a window is
// disabled. So catch mouse events and throw them away if
// necessary.
wxWindowMSW* win = this;
for ( ;; )
{
if (!win->IsEnabled())
{
processed = true;
break;
}
win = win->GetParent();
if ( !win || win->IsTopLevel() )
break;
}
if ( processed )
break;
#endif // __WXMICROWIN__
int x = GET_X_LPARAM(lParam), int x = GET_X_LPARAM(lParam),
y = GET_Y_LPARAM(lParam); y = GET_Y_LPARAM(lParam);
@@ -3080,7 +3041,7 @@ wxWindowMSW::MSWHandleMessage(WXLRESULT *result,
HIWORD(lParam), HIWORD(lParam),
wParam); wParam);
break; break;
#endif // __WXMICROWIN__ #endif // MM_JOY1MOVE
case WM_COMMAND: case WM_COMMAND:
{ {
@@ -3306,7 +3267,6 @@ wxWindowMSW::MSWHandleMessage(WXLRESULT *result,
// CTLCOLOR messages are sent by children to query the parent for their // CTLCOLOR messages are sent by children to query the parent for their
// colors // colors
#ifndef __WXMICROWIN__
case WM_CTLCOLORMSGBOX: case WM_CTLCOLORMSGBOX:
case WM_CTLCOLOREDIT: case WM_CTLCOLOREDIT:
case WM_CTLCOLORLISTBOX: case WM_CTLCOLORLISTBOX:
@@ -3322,7 +3282,6 @@ wxWindowMSW::MSWHandleMessage(WXLRESULT *result,
processed = HandleCtlColor(&rc.hBrush, (WXHDC)hdc, (WXHWND)hwnd); processed = HandleCtlColor(&rc.hBrush, (WXHDC)hdc, (WXHWND)hwnd);
} }
break; break;
#endif // !__WXMICROWIN__
case WM_SYSCOLORCHANGE: case WM_SYSCOLORCHANGE:
// the return value for this message is ignored // the return value for this message is ignored
@@ -3522,7 +3481,7 @@ wxWindowMSW::MSWHandleMessage(WXLRESULT *result,
} }
break; break;
#if !defined(__WXMICROWIN__) && !defined(__WXWINCE__) #if !defined(__WXWINCE__)
case WM_INITMENUPOPUP: case WM_INITMENUPOPUP:
processed = HandleMenuPopup(wxEVT_MENU_OPEN, (WXHMENU)wParam); processed = HandleMenuPopup(wxEVT_MENU_OPEN, (WXHMENU)wParam);
break; break;
@@ -3540,7 +3499,7 @@ wxWindowMSW::MSWHandleMessage(WXLRESULT *result,
case WM_UNINITMENUPOPUP: case WM_UNINITMENUPOPUP:
processed = HandleMenuPopup(wxEVT_MENU_CLOSE, (WXHMENU)wParam); processed = HandleMenuPopup(wxEVT_MENU_CLOSE, (WXHMENU)wParam);
break; break;
#endif // !__WXMICROWIN__ #endif // !__WXWINCE__
#endif // wxUSE_MENUS && !defined(__WXUNIVERSAL__) #endif // wxUSE_MENUS && !defined(__WXUNIVERSAL__)
#ifndef __WXWINCE__ #ifndef __WXWINCE__
@@ -3855,7 +3814,6 @@ bool wxWindowMSW::MSWCreate(const wxChar *wclass,
bool wxWindowMSW::HandleNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) bool wxWindowMSW::HandleNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
{ {
#ifndef __WXMICROWIN__
LPNMHDR hdr = (LPNMHDR)lParam; LPNMHDR hdr = (LPNMHDR)lParam;
HWND hWnd = hdr->hwndFrom; HWND hWnd = hdr->hwndFrom;
wxWindow *win = wxFindWinFromHandle(hWnd); wxWindow *win = wxFindWinFromHandle(hWnd);
@@ -3889,9 +3847,6 @@ bool wxWindowMSW::HandleNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
// by default, handle it ourselves // by default, handle it ourselves
return MSWOnNotify(idCtrl, lParam, result); return MSWOnNotify(idCtrl, lParam, result);
#else // __WXMICROWIN__
return false;
#endif
} }
#if wxUSE_TOOLTIPS #if wxUSE_TOOLTIPS
@@ -4196,10 +4151,10 @@ bool wxWindowMSW::HandleInitDialog(WXHWND WXUNUSED(hWndFocus))
bool wxWindowMSW::HandleDropFiles(WXWPARAM wParam) bool wxWindowMSW::HandleDropFiles(WXWPARAM wParam)
{ {
#if defined (__WXMICROWIN__) || defined(__WXWINCE__) #if defined(__WXWINCE__)
wxUnusedVar(wParam); wxUnusedVar(wParam);
return false; return false;
#else // __WXMICROWIN__ #else // __WXWINCE__
HDROP hFilesInfo = (HDROP) wParam; HDROP hFilesInfo = (HDROP) wParam;
// Get the total number of files dropped // Get the total number of files dropped
@@ -4241,7 +4196,6 @@ bool wxWindowMSW::HandleSetCursor(WXHWND WXUNUSED(hWnd),
short nHitTest, short nHitTest,
int WXUNUSED(mouseMsg)) int WXUNUSED(mouseMsg))
{ {
#ifndef __WXMICROWIN__
// the logic is as follows: // the logic is as follows:
// 0. if we're busy, set the busy cursor (even for non client elements) // 0. if we're busy, set the busy cursor (even for non client elements)
// 1. don't set custom cursor for non client area of enabled windows // 1. don't set custom cursor for non client area of enabled windows
@@ -4319,7 +4273,6 @@ bool wxWindowMSW::HandleSetCursor(WXHWND WXUNUSED(hWnd),
// cursor set, stop here // cursor set, stop here
return true; return true;
} }
#endif // __WXMICROWIN__
// pass up the window chain // pass up the window chain
return false; return false;
@@ -4560,8 +4513,6 @@ bool wxWindowMSW::HandleDisplayChange()
return HandleWindowEvent(event); return HandleWindowEvent(event);
} }
#ifndef __WXMICROWIN__
bool wxWindowMSW::HandleCtlColor(WXHBRUSH *brush, WXHDC hDC, WXHWND hWnd) bool wxWindowMSW::HandleCtlColor(WXHBRUSH *brush, WXHDC hDC, WXHWND hWnd)
{ {
#if !wxUSE_CONTROLS || defined(__WXUNIVERSAL__) #if !wxUSE_CONTROLS || defined(__WXUNIVERSAL__)
@@ -4579,8 +4530,6 @@ bool wxWindowMSW::HandleCtlColor(WXHBRUSH *brush, WXHDC hDC, WXHWND hWnd)
return *brush != NULL; return *brush != NULL;
} }
#endif // __WXMICROWIN__
bool wxWindowMSW::HandlePaletteChanged(WXHWND hWndPalChange) bool wxWindowMSW::HandlePaletteChanged(WXHWND hWndPalChange)
{ {
#if wxUSE_PALETTE #if wxUSE_PALETTE
@@ -6708,13 +6657,11 @@ extern wxWindow *wxGetWindowFromHWND(WXHWND hWnd)
// FIXME: this is clearly not the best way to do it but I think we'll // FIXME: this is clearly not the best way to do it but I think we'll
// need to change HWND <-> wxWindow code more heavily than I can // need to change HWND <-> wxWindow code more heavily than I can
// do it now to fix it // do it now to fix it
#ifndef __WXMICROWIN__
if ( ::GetWindow(hwnd, GW_OWNER) ) if ( ::GetWindow(hwnd, GW_OWNER) )
{ {
// it's a dialog box, don't go upwards // it's a dialog box, don't go upwards
break; break;
} }
#endif
hwnd = ::GetParent(hwnd); hwnd = ::GetParent(hwnd);
win = wxFindWinFromHandle(hwnd); win = wxFindWinFromHandle(hwnd);
@@ -6723,7 +6670,7 @@ extern wxWindow *wxGetWindowFromHWND(WXHWND hWnd)
return win; return win;
} }
#if !defined(__WXMICROWIN__) && !defined(__WXWINCE__) #if !defined(__WXWINCE__)
// Windows keyboard hook. Allows interception of e.g. F1, ESCAPE // Windows keyboard hook. Allows interception of e.g. F1, ESCAPE
// in active frames and dialogs, regardless of where the focus is. // in active frames and dialogs, regardless of where the focus is.
@@ -6813,7 +6760,7 @@ void wxSetKeyboardHook(bool doIt)
} }
} }
#endif // !__WXMICROWIN__ #endif // !__WXWINCE__
#if wxDEBUG_LEVEL >= 2 #if wxDEBUG_LEVEL >= 2
const wxChar *wxGetMessageName(int message) const wxChar *wxGetMessageName(int message)

View File

@@ -301,9 +301,5 @@ bool wxFrame::Enable(bool enable)
{ {
if (!wxFrameBase::Enable(enable)) if (!wxFrameBase::Enable(enable))
return false; return false;
#ifdef __WXMICROWIN__
if (m_frameMenuBar)
m_frameMenuBar->Enable(enable);
#endif
return true; return true;
} }

View File

@@ -43,7 +43,7 @@
#define WXDEBUG_SCROLLBAR #define WXDEBUG_SCROLLBAR
#endif #endif
#if defined(WXDEBUG_SCROLLBAR) && defined(__WXMSW__) && !defined(__WXMICROWIN__) #if defined(WXDEBUG_SCROLLBAR) && defined(__WXMSW__)
#include "wx/msw/private.h" #include "wx/msw/private.h"
#endif #endif
@@ -627,7 +627,7 @@ void wxScrollBar::UpdateThumb()
dc.DrawRectangle(rect); dc.DrawRectangle(rect);
// under Unix we use "--sync" X option for this // under Unix we use "--sync" X option for this
#if defined(__WXMSW__) && !defined(__WXMICROWIN__) #if defined(__WXMSW__)
::GdiFlush(); ::GdiFlush();
::Sleep(200); ::Sleep(200);
#endif // __WXMSW__ #endif // __WXMSW__

View File

@@ -51,7 +51,7 @@
#define WXDEBUG_REFRESH #define WXDEBUG_REFRESH
#endif #endif
#if defined(WXDEBUG_REFRESH) && defined(__WXMSW__) && !defined(__WXMICROWIN__) #if defined(WXDEBUG_REFRESH) && defined(__WXMSW__)
#include "wx/msw/private.h" #include "wx/msw/private.h"
#endif #endif
@@ -477,7 +477,7 @@ void wxWindow::Refresh(bool eraseBackground, const wxRect *rect)
dc.DrawRectangle(rectWin); dc.DrawRectangle(rectWin);
// under Unix we use "--sync" X option for this // under Unix we use "--sync" X option for this
#if defined(__WXMSW__) && !defined(__WXMICROWIN__) #if defined(__WXMSW__)
::GdiFlush(); ::GdiFlush();
::Sleep(200); ::Sleep(200);
#endif // __WXMSW__ #endif // __WXMSW__