Commit Graph

997 Commits

Author SHA1 Message Date
Vadim Zeitlin
b3e726faed Refactor MSW gesture events initialization
Don't repeat the same code for initializing events in several different
functions but put it in a helper InitGestureEvent() function and just
call it from the event-specific handlers.
2017-11-21 17:25:55 +01:00
Vadim Zeitlin
989dd36405 Style fixes in the MSW gestures code
No real changes, just reformat code and comments to fit in 80 column
lines.
2017-11-21 16:12:37 +01:00
Vadim Zeitlin
daf19c652c Use WinStruct<> to initialize GESTUREINFO
This is more concise and clear than initializing it manually.
2017-11-21 16:12:35 +01:00
Vadim Zeitlin
7ffb897810 Remove unnecessary assignments in WM_GESTURE handler code
The "processed" flag is false by default, no need to explicitly reset
it, this was just confusing.
2017-11-21 16:12:32 +01:00
Vadim Zeitlin
59f428d25e Slightly simplify GestureFuncs code
Document that the users of this class always must call IsOk() first, as
they already do, and remove the checks for ms_gestureSymbolsLoaded and
calls to LoadGestureSymbols() from all the other methods, which are
unnecessary in this case.
2017-11-21 16:12:30 +01:00
Vadim Zeitlin
bf929f9868 Use wxLoadedDLL for loading user32.dll dynamically
This avoids unnecessarily loading and unloading (except that it's not
really unloaded) a DLL which is always available anyhow.
2017-11-21 16:05:33 +01:00
prashantkn94
261b04b5a3 Merge multi-touch gestures event branch
This is a squashed commit of the SOC2017_GESTURES branch from
https://github.com/prashantkn94/wxWidgets.git

Closes https://github.com/wxWidgets/wxWidgets/pull/551
2017-11-17 18:06:06 +01:00
Vadim Zeitlin
677051b6e7 Remove hack with TLW focus reset from wxWindowMSW dtor
This shouldn't be needed any more, after the previous commit which
replaces the raw pointer to the focused child in wxTopLevelWindowMSW
with a safe weak reference.
2017-10-27 18:20:09 +02:00
Artur Wieczorek
2c69d27c0d Directly generate EVT_CONTEXT_MENU when Applications (Menu) key is pressed
WM_CONTEXTMENU message is generated directly by the system when the user presses and releases the VK_APPS key so there is no need to do this by emulating right mouse button click.

Closes #17969.
2017-10-09 16:14:50 +02:00
Artur Wieczorek
52d6b0ae85 Don't discard all current input processing flags in response to WM_GETDLGCODE
Some current input processing flags, like DLGC_HASSETSEL, should be retained because they are in use (in wxWindowMSW::SetFocusFromKbd() for instance).

Closes #17945.
2017-09-06 12:34:20 +02:00
sbrowne
66c5762ab9 Fix check for unchanged size in MSW wxWindow::DoSetSize()
Adjust the size and position we're about to set before comparing them
with the current ones, otherwise the result of the comparison could be
wrong when width and/or height are -1.

See #17075.
2017-07-16 02:22:46 +02:00
Catalin
e118c918ce Redefine MAPVK_VK_TO_CHAR, missing from XP 64-bit and tdm32-gcc-5.1.0 2017-03-27 18:39:20 +02:00
Catalin
511ec44743 Remove old checks
AW_XXX <https://msdn.microsoft.com/en-us/library/windows/desktop/ms632669(v=vs.85).aspx>
MAPVK_VK_TO_CHAR <https://msdn.microsoft.com/en-us/library/windows/desktop/ms646307(v=vs.85).aspx>
TME_LEAVE <https://msdn.microsoft.com/en-us/library/windows/desktop/ms645604(v=vs.85).aspx>
WM_MOUSELEAVE <https://msdn.microsoft.com/en-us/library/windows/desktop/ms645615(v=vs.85).aspx>
2017-03-05 15:39:31 +02:00
Catalin
8d387fafe5 Remove checks for MM_JOY1MOVE, VK_APPS, ENDSESSION_LOGOFF, PBT_APMRESUMEAUTOMATIC, JOY_BUTTON1, SM_SWAPBUTTON.
<https://msdn.microsoft.com/en-us/library/dd757352(v=vs.85).aspx>
<https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx>
<https://msdn.microsoft.com/en-us/library/windows/desktop/aa376890(v=vs.85).aspx>
<https://msdn.microsoft.com/en-us/library/windows/desktop/aa372718(v=vs.85).aspx>
<https://msdn.microsoft.com/en-us/library/dd757110(v=vs.85).aspx>
2017-03-05 03:12:14 +02:00
Cătălin Răceanu
3a02672de8 Use MIIM_FTYPE rather than MIIM_TYPE in wxMSW
There is no need to use the old symbol any more now that we don't support
Windows 9x any longer.
2017-02-24 15:36:46 +01:00
Cătălin Răceanu
933e3e6fc5 Remove compile-time checks for always defined WM_XXX in wxMSW
The symbols in question are present at least since XP, and most of them since
Windows 2000, so remove preprocessor checks for them, they shouldn't be needed
when any remotely current compiler/SDK.
2017-02-22 23:17:56 +01:00
Cătălin Răceanu
1a1519bd68 Don't check if WM_XBUTTONxxx are defined in wxMSW code
This is not necessary any longer, we don't support Windows CE any more and
these constants are available since Windows 2000 in the desktop Windows SDKs.
2017-02-21 14:55:27 +01:00
Vadim Zeitlin
d15bbcacd2 Merge branch 'rmv_symbols_3' of https://github.com/catalinr/wxWidgets
Remove obsolete mentions of Windows 9x, Windows CE and OS/2.
2017-02-20 17:46:45 +01:00
Václav Slavík
e99abe513a Fix wxFULL_REPAINT_ON_RESIZE handling in wxMSW
Fix regression introduced in d4e595adb0
where the wxFULL_REPAINT_ON_RESIZE flag was accidentally ignored in most cases.
2017-01-06 14:33:24 +01:00
Paul Cornett
42b2675806 Fix build error with wxUSE_DRAG_AND_DROP==0 2016-12-22 22:12:45 -08:00
Vadim Zeitlin
d4e595adb0 Add wxWindow::CreateUsingMSWClass() helper function
This method allows to use the Windows class to use for the window being
created instead of always using "wxWindow" or "wxWindowNR".

This can be useful to make it possible to handle some windows specially from
outside the application, e.g. use specific class names for accessibility
purposes as will be done by the next commit.
2016-12-18 22:39:06 +01:00
Vadim Zeitlin
097f8a7f14 Refactor code finding the name of the windows class to use in wxMSW
Determine which class name to use in MSWCreate() caller instead of doing it
partly there and partly in MSWCreate() itself, which used to add the "NR"
suffix if necessary -- now it doesn't do this any more and just really created
the window using the given class.

No real changes, just prepare for future enhancements.
2016-12-18 22:39:02 +01:00
Paul Cornett
9b19a6e529 use wxOVERRIDE in wxMSW sources 2016-09-23 07:59:11 -07:00
Vadim Zeitlin
9e27a1ca3a Make wxSIZE_FORCE_EVENT work if only position changed in wxMSW
If the position changed but the size didn't, we just call Win32 API for
updating the window geometry but it didn't generate WM_SIZE in this case, so
even when wxSIZE_FORCE_EVENT was used, no wxSizeEvent was sent.
2016-06-08 02:31:19 +02:00
Václav Slavík
a0805d32eb MSW: Fix dialog default positions under RTL locales
Toplevel windows use their parent's coordinate system as the reference
frame, not desktop's, so need to be adjusted accordingly if its
mirrored. Without these changes, default-positioned wxDialogs would end
to the right side of the parent window's right border (instead of being
slightly inside the window) and changing their size would move them as
well.
2016-04-23 14:49:01 +02:00
Vadim Zeitlin
bac5975b02 Merge branch 'rtl-fixes'
Fix appearance of wxNotebook children background when using RTL locales.
2016-04-10 20:51:33 +02:00
Vadim Zeitlin
169fb2c7f5 Fix background for children of windows with RTL layout in wxMSW
To correctly compute the brush origin offset for painting background of a
child in a window using RTL layout, we need to offset it by the child origin
i.e. its _right_ top corner in this case and not the left top corner as we did
before.

Conveniently, although not very explicitly, MapWindowPoints() already takes
care of this for us if we just pass it both the left and right points, but we
wrongly passed it only a single one, so it couldn't work its magic in this
case.

Change this to fix the drawing artefacts which appeared over wxNotebook
children with transparent background (e.g. wxStaticText) due to the use of
wrong origin before.
2016-04-08 23:17:24 +02:00
Vadim Zeitlin
5368c72d37 Fix wxMSW build with wxUSE_DEFERRED_SIZING==0
Don't define BeginRepositioningChildren() and EndRepositioningChildren() at
all in this case instead of defining them as "do nothing" functions because
BeginRepositioningChildren() still needs to return a bool, so the old code
didn't compile and we would need to add another "#else" to fix this -- instead
make it simpler by just not compiling at all in this case.
2016-04-08 22:22:22 +02:00
Catalin
33ad41a745 Removed obsolete symbols from comments. 2016-02-21 20:12:18 +02:00
Vadim Zeitlin
99a1526ee3 Factor out methods for clicking the default button in wxMSW
This will make it possible to reproduce the default "Enter" key functionality
from elsewhere.

Almost no changes yet, the only minor change is that we now wouldn't try to
"click" any windows using DLGC_DEFPUSHBUTTON dialog code but which are not
really buttons -- but then this shouldn't ever happen anyhow.
2016-02-20 17:07:04 +01:00
Vadim Zeitlin
f74379c751 Avoid duplicate wxEVT_UPDATE_UI for popup menus
Don't call wxMenu::UpdateUI() explicitly in wxMSW, wxGTK and wxOSX code before
showing the popup menu as it is also called when any menu is opened from
port-independent wxFrameBase wxEVT_MENU_OPEN handler, resulting in two events
being generated.

But also don't send the events from wxFrameBase handler only to the frame
itself, by explicitly passing "source" argument to wxMenu::UpdateUI(), as this
prevented the event from being sent to the window popping up the menu. By just
omitting this parameter we ensure that this event is sent to the right window.

Closes #17352 (but notice that there are still duplicate events under OS X,
see #17354).
2016-01-30 17:35:42 +01:00
Vadim Zeitlin
0220d86ef4 Fix missing wxContextMenuEvent for wxTreeCtrl in wxMSW
This reverts 54753c3d75 and (partially)
dbd5b2ce42 (leaving the unit test added by it)
and implements yet another fix for the original problem of duplicate
wxContextMenuEvents generated in wxMSW which doesn't break the generation of
wxContextMenuEvents entirely in wxTreeCtrl.

wxTreeCtrl is special as its DefWindowProc() sends WM_CONTEXTMENU directly to
its parent, and not to the control itself, when handling WM_RBUTTONUP, so the
code checking that WM_CONTEXTMENU was not coming from one of the window own
children added in dbd5b2 filtered out all messages from it completely. As it's
probably not the only control behaving in this way, abandon the idea of the
message origin check and instead set things up so that we still pass the
message to DefWindowProc() (because not doing it breaks built-in context menus
in wxTextCtrl, for example), but don't do anything when the message is
propagated upwards from it.

This should ensure that we only process the message once in MSWHandleMessage()
of the first window which gets it, whether it's the original window or its
parent, which ensures the event propagation on wxWidgets side of things, but
prevents it being done by Windows itself.

See #13683.
2016-01-30 04:43:45 +01:00
Maarten Bent
3b98570f57 Miscellaneous improvements to the multimedia keys support
Simplified mapping keys on Windows.

Handle multimedia keys in the keyboard, text and treetest samples.

Ignore multimedia keys in wxRichTextCtrl.
2016-01-20 18:56:03 +01:00
Jens Göpfert
abd46cb99a Add support for multimedia keys to wxMSW and wxGTK
Add WXK_XXX constants for the standard multimedia keys and generate events
corresponding to them under wxGTK and wxMSW.

Closes https://github.com/wxWidgets/wxWidgets/pull/157
2016-01-08 23:22:24 +01:00
Armel Asselin
271fbce876 Handle VK_OEM_8 key in wxMSW too
This key is not present on all keyboards but we do need to handle on those
where it is used.

Closes #17272.
2015-12-01 01:21:02 +01:00
Vadim Zeitlin
7c82b9a504 Really fix MSW message logging with wxDEBUG_LEVEL>=2
Now the code not only compiles, but also actually works, unlike before when %p
was used with non-pointer types.

Closes #17095.
2015-11-16 03:00:36 +01:00
Vadim Zeitlin
fdbed751dc Fix MSVC wxMSW build with wxDEBUG_LEVEL>=2
This was broken since 39ad820bee which added
wxSEH_TRY to wxWndProc() which uses a local object with dtor when
wxDEBUG_LEVEL>=2 and so broke its compilation with MSVC which doesn't allow
the use of dtors in functions also using SEH.

Closes #17095.
2015-11-15 01:10:02 +01:00
Vadim Zeitlin
88408d536f Avoid bogus debug errors from wxWindow::SetId() in wxMSW
::SetWindowLong() can return 0 even if no error occurred but the previous
value of the ID just was 0, so we need to examine the last error to know
whether there really was an error -- and also to reset it to 0 before calling
the function as it wouldn't reset it if it succeeds, it only sets it if it
fails.
2015-11-15 00:56:05 +01:00
Ian Langworth
c739671796 Ensure that AdjustStaticBoxZOrder is always defined
Fix the build in wxUSE_STATBOX=0 and wxUSE_DRAG_AND_DROP=0 case:
AdjustStaticBoxZOrder() must still be defined as it's also used in
DragAcceptFiles().

Closes https://github.com/wxWidgets/wxWidgets/pull/111
2015-10-08 13:48:39 +02:00
Tobias Taschner
bf0461bde7 Remove dynamic loading of AnimateWindow.
API is available since Win2k.
2015-09-27 19:10:49 +02:00
Tobias Taschner
8282c1be0f Remove Windows CE support
Windows CE doesn't seem to be supported by Microsoft any longer. Last CE
release was in early 2013 and the PocketPC and Smartphone targets supported by
wxWidgets are long gone.

The build files where already removed in an earlier cleanup this commit
removes all files, every #ifdef and all documentation regarding the Windows CE
support.

Closes https://github.com/wxWidgets/wxWidgets/pull/81
2015-09-23 00:52:30 +02:00
Vadim Zeitlin
8d6a2b3921 Don't send wxActivateEvent for minimized windows in wxMSW
Unexpectedly, minimizing the window by clicking on its taskbar icon resulted
in a wxActivateEvent. This broke the focus handling in wxTLW and resulted in
debug messages about ::SetFocus() failure whenever the window was minimized in
this way.

It also seems that other existing code doesn't take into account the
possibility of getting an "active" activation event when the window is
minimized and this doesn't happen in the other ports, so don't send this event
in wxMSW neither.

Closes #17128.
2015-09-04 16:23:13 +02:00
Tobias Taschner
f1abb351af 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.
2015-08-27 11:00:16 +02:00
Tobias Taschner
388e82e70c Remove MSW code targeted at versions prior to WinXP.
In 3.1 WinXP is required so remove checks and code for prior versions.
2015-08-06 09:44:20 +02:00
Vadim Zeitlin
39ad820bee Check for Win32 exceptions inside our WindowProc().
Don't let unhandled Win32 (i.e. structured) exceptions escape from wxWndProc()
as they can just disappear into thin air when running under WOW64 as 32 bit
exceptions can't propagate through 64 bit kernel. So catch them immediately
and pass them to the global handler while we have the chance to do it, as
we're never going to get it in the outer __try/__catch block in wxEntry() in
src/msw/main.cpp.

In particular, this allows to catch crashes in wxEVT_PAINT handlers, such as
the one in debughlp sample, again.

Closes #16656.
2015-07-27 02:30:40 +02:00
Paul Cornett
36e31e515e avoid shadowed variable warnings with VS2015 2015-07-24 20:56:11 -07:00
Leland Lucius
6a435345f5 Fix accessibility support in wxMSW.
Return the correct result from handing WM_GETOBJECT message.

See #17058.
2015-07-06 23:55:41 +02:00
Vadim Zeitlin
73119a37ae Remove obsolete _EXPORT macro not used under Win32.
This was a leftover from bad old Win16 days.
2015-07-05 16:55:26 +02:00
Vadim Zeitlin
30b523d1f2 Remove redundant tests for __WIN32__ in wxMSW code.
This is always defined, Win16 is not supported since ages and Win64 defines
both __WIN32__ and __WIN64__.
2015-07-05 16:55:25 +02:00
Dimitri Schoolwerth
8f8d58d193 Use wx-prefixed macros throughout the repository.
Change {DECLARE,IMPLEMENT}_*CLASS and {DECLARE,BEGIN,END}_EVENT_TABLE
occurrences to use the wx-prefixed version of the macros.
2015-04-23 22:00:35 +04:00