Commit Graph

3358 Commits

Author SHA1 Message Date
Vadim Zeitlin
b53e9e2006 Rename wxStaticText::Do[SG]etLabel() to WX[SG]etVisibleLabel()
The names of these methods were confusing because they implied that they
were the actual implementations of the public [SG]etLabel(), while this
wasn't at all the case.

Give them then ames describing what they really do and also update the
comments to hopefully be more clear.

No real changes.
2019-06-19 18:15:57 +02:00
Jan Knepper
a4f2303361 Use closesocket() for closing sockets under MSW
If accepting a socket connection failed, wxSocketImpl::Accept() used
close() to close the socket even under MSW, but it can be only used for
the file descriptors there and closesocket() must be used instead for
the sockets.

Add new (private) wxCloseSocket define and use it both here, to fix the
bug, and elsewhere to make the code more clear.

Closes #18407.
2019-06-03 22:31:37 +02:00
PB
357108d3cd Remove the last remnants of Windows CE related code
Remove the last few bits of code supporting Windows CE.
2019-05-18 08:40:03 +02:00
Vadim Zeitlin
02adddfa1a Merge branch 'wxlistctrl-virtual-checkboxes' of https://github.com/MaartenBent/wxWidgets
Add support for checkboxes to virtual wxListCtrl too.

See https://github.com/wxWidgets/wxWidgets/pull/1315
2019-05-10 01:39:33 +02:00
Vadim Zeitlin
998097b3a4 Merge branch 'col-dialog-current'
Add events for current colour change in wxColourDialog and
wxColourPickerCtrl.

See https://github.com/wxWidgets/wxWidgets/pull/1301
2019-05-10 01:31:18 +02:00
Maarten Bent
ceaf2aa803 Move virtual stub functions to wxListCtrlBase 2019-05-05 14:23:44 +02:00
QuentinC
413abb066e Allow retrieving current filter from wxFileDialog extra controls
Add wxFileDialog::GetCurrentlySelectedFilterIndex() similar to the
existing GetCurrentlySelectedFilename(), which can be used to retrieve
the index of the currently selected filter and update the state of the
extra controls in wxFileDialog accordingly.

Implement this for wxMSW only by updating the internally stored value
from the native CDN_TYPECHANGE notification and also generating a
wxEVT_UPDATE_UI event to allow the extra controls to update themselves.

Closes https://github.com/wxWidgets/wxWidgets/pull/1310
2019-05-02 19:53:05 +02:00
Vadim Zeitlin
bf3f84c867 Compilation fix for TempHWNDSetter in wxQt
Fix wxQt build after 2aef6570bb:
TempHWNDSetter can only be defined when using wxMSW.
2019-04-26 13:11:43 +02:00
Vadim Zeitlin
2aef6570bb Add TempHWNDSetter RAII helper to wxMSW and use it
No real changes, just replace pairs of SetHWND(hwnd)/SetHWND(0) calls
with the use of TempHWNDSetter.
2019-04-25 17:12:41 +02:00
Vadim Zeitlin
84dc4707d7 Fix horizontal scrollbar handling for wxCheckListBox in wxMSW
The scrollbar wasn't shown when the control became only slightly more
narrow than its contents, resulting in truncation of the rightmost part
of the strings shown in it.

Fix this by accounting for the check box explicitly in wxListBox
SetHorizontalExtent() method using the new MSWGetFullItemSize() helper
which is also used to avoid code duplication between wxCheckListBox
MSWOnMeasure() and DoGetBestClientSize() methods.

Closes #18377.
2019-04-22 14:57:55 +02:00
Vadim Zeitlin
5488a1438f Globally replace vadim@wxwindows.org with vadim@wxwidgets.org
The old email address is invalid since many years and shouldn't be used
any longer.

No real changes.
2019-04-22 14:12:05 +02:00
Vadim Zeitlin
35c16935f1 Send wxEVT_COLOUR_CHANGED from wxColourDialog under MSW
Add support for a new event sent by wxColourDialog, currently only under
MSW, when the colour currently selected in it changes.

Based on work by Trylz, see https://github.com/wxWidgets/wxWidgets/pull/1219
2019-04-21 01:53:14 +02:00
Vadim Zeitlin
9cbc1a5fbf Merge branch 'msw-tbar-resize'
Many fixes for wxToolBar (re)sizing in wxMSW, partially addressing
toolbar size changes since the previous wxWidgets versions.

See https://github.com/wxWidgets/wxWidgets/pull/1241

Closes #18294.
2019-03-29 19:16:40 +01:00
Vadim Zeitlin
23ddf26571 Fix bug with wxRadioButton state changing unexpectedly in wxMSW
In wxMSW, a focused wxRadioButton is always checked, which meant that
checking a wxRadioButton while focus was not in the window containing it
and later giving the focus to that window could uncheck it by giving
focus to another wxRadioButton that had had it previously.

Fix this by adding WXSetPendingFocus() to wxMSW wxWindow and calling it
from wxRadioButton::SetValue() to ensure that when the focus is
regained, it goes to the newly checked radio button and not some other
one.

This replaces the previously used, for the same purpose, wxMSW-specific
wxTopLevelWindow::SetLastFocus(), so while this solution is not exactly
pretty, it's not worse than we had before, while being more generic.

Also add a unit test checking that things work correctly in the scenario
described above.

Closes https://github.com/wxWidgets/wxWidgets/pull/1257

Closes #18341.
2019-03-18 18:29:19 +01:00
exprosic
7a2d9d0d10 Fix compilation of MFC support code in MSVS conformance mode
Allow the code to be compilable with /permissive-, which is on by
default in VS2017.

Closes https://github.com/wxWidgets/wxWidgets/pull/1263
2019-03-18 18:11:42 +01:00
Vadim Zeitlin
7c8ba45705 Reuse helper MSWGetFittingtSizeForControl() in a couple of places
Refactor the code to reuse the same function for determining the size
needed by an embedded control in the toolbar, including its label.
2019-02-24 18:19:49 +01:00
Vadim Zeitlin
82857cfa9d Add small helper function to wxMSW wxToolBar code
Encapsulate the logic for deciding whether we should show the labels for
the embedded controls or not in a small helper function, to make it
simpler to change it in the future if needed and also to have a single
place to explain why do we do what we do now.

No real changes.
2019-02-24 02:04:55 +01:00
Vadim Zeitlin
8fbca5cb70 Remove all trailing spaces
No real changes, just clean up sources by removing trailing spaces from
all the non-generated files.

This should hopefully avoid future commits mixing significant changes
with insignificant whitespace ones.
2019-01-30 17:35:54 +01:00
New Pagodi
07f64c3b75 Add wxPU_CONTAINS_CONTROLS style for wxPopupWindow
This restores the default behavior of a popup window in MSW to the
behavior it had before 56c4191168. The new
flag added by this commit can be used to give the popup window the
behavior from after that commit, i.e. choose the implementation using a
WS_POPUP window rather than the default one using a WS_CHILD of the
desktop.

The old behavior kept the popup from taking focus from its parent window
but left some controls not working. The new behavior has the popup take
focus and lets all controls work.

Closes https://github.com/wxWidgets/wxWidgets/pull/1123
2019-01-28 00:48:16 +01:00
Tomay
8deb2cf0bb Add wxUSE_WINSOCK2 wxMSW option to include winsock2.h
Including <winsock.h> and <winsock2.h> is incompatible and if the
application wants to use the latter, it may be convenient to define
wxUSE_WINSOCK2 when building wxWidgets instead of having to work around
winsock.h implicit inclusion from include/wx/msw/wrapwin.h.

Closes https://github.com/wxWidgets/wxWidgets/pull/1122
2019-01-28 00:34:34 +01:00
Chilau He
3aa6aec620 Add wxWebViewIE::MSWSetEmulationLevel()
This extends and replaces MSWSetModernEmulationLevel() by allowing a
more fine-grained choice of the emulation level used by wxWebViewIE.

Closes https://github.com/wxWidgets/wxWidgets/pull/1133
2019-01-14 23:25:14 +01:00
Vadim Zeitlin
ee352d79c8 Merge branch 'ipc-dde-fixes'
wxIPC fixes when using DDE

See https://github.com/wxWidgets/wxWidgets/pull/1098

Closes #17900.
2019-01-04 14:12:53 +01:00
Vadim Zeitlin
9a8ef599d2 Remove apparently never used wxMSWDCImpl::m_canvas
This member field doesn't seem referenced anywhere (even not to
initialize it), so it can't possibly be useful for anything and can be
just removed.
2018-12-29 03:48:15 +01:00
Vadim Zeitlin
20cb47c1c4 Send Unicode data as UTF-8 text when using DDE-based IPC
This is a more hackish but more compatible solution to the problem of
data sent using wxIPC_UTF8TEXT format being simply lost when using DDE
for IPC classes. We must use CF_TEXT for the DDE to pass our data, but
we can try to decode it as UTF-8 in the client and assume it was sent in
this format if it worked. This obviously suffers from false positives as
any ASCII string will still be assumed to be UTF-8, but there shouldn't
be any real harm coming from this.

This change also makes sending data in wxIPC_UTF{16,32}TEXT formats work
as well by converting it to UTF-8.

Update the sample to call Advise() with both wxIPC_UTF{8,16}TEXT formats
and remove the now unnecessary wxDDEConnection::m_dataType member.

Closes #17900.
2018-12-27 00:26:29 +01:00
Vadim Zeitlin
09bf235a59 Revert "Fix passing Unicode strings via wxIPC when using DDE"
This reverts commit c657fd3d61 because
changing the format of DDE advise requests/replies is not a good idea:
other applications (those using previous versions of wxWidgets or even
not using wxWidgets at all) may rely on getting data in real CF_TEXT
format rather than in one of text formats preceded by the extra byte
containing the actual format and the previous commit would have silently
broken this.

Another fix for #17900 will be implemented instead.
2018-12-26 23:20:52 +01:00
Vadim Zeitlin
c657fd3d61 Fix passing Unicode strings via wxIPC when using DDE
wxIPC API doesn't map well onto DDE, as we don't have wxIPCFormat
parameter in StartAdvise() but do allow specifying the format when
calling Advise() itself, whereas DDE requires specifying the format when
establishing the advise loop and the data always must use this format
later.

Because of this, we have to pass the actual format with the data itself
instead of relying on DDE formats support. This has the advantage of
allowing wxIPC_UTF8TEXT to work, while previously it didn't and
couldn't, as DDE only supports the standard (or custom, but registered)
clipboard formats and it wasn't one of them. Of course, this also has a
disadvantage of having to make another copy of the data, but this seems
unavoidable.

This change allow Advise() overload taking wxString to work, including
for non-ASCII strings, as shown by the update to the IPC sample. It also
makes wxDDEConnection::m_dataType unnecessary, as we must always use the
format passed to DDE callback anyhow when handling XTYP_ADVREQ.

Closes #17900.
2018-12-24 01:42:12 +01:00
Vadim Zeitlin
089eeea3ef Fix wxMSW build with wxUSE_UXTHEME==0
Make wxUxThemeIsActive() available even in this case to fix compilation
in some places and add the unavoidable preprocessor checks in other
ones.

Closes #18207.
2018-12-08 20:24:05 +01:00
Maarten Bent
3bab07edcf Fix some build warnings
private field 'm_dwCookie' is not used
'return' will never be executed
result of comparison of unsigned enum expression < 0 is always false
'FlushDC' overrides a member function but is not marked 'override'
potentially uninitialized local variable 'bound' used
2018-11-25 21:29:38 +01:00
jbbbms
87195cf3ea Put wxDECLARE_EVENT_TABLE at the end of wxTextCtrl declaration
This fixes the access specifier effectively used for the members
following these macros, as it's changed to "public" inside them, meaning
that e.g. m_privateContextMenu was actually public even though it was
ostensibly declared in the private section and the intention was for it
to be private.

Closes #16038.
2018-11-10 23:37:33 +01:00
Vadim Zeitlin
56c4191168 Reimplement wxPopupWindow as a WS_POPUP window under MSW
Don't use the child window of the desktop window for popup windows under
MSW, while this worked in simplest cases, it didn't allow having
functional controls inside a wxPopupWindow as e.g. wxTextCtrl didn't
accept input it at all if created as a child of such window.

Instead, switch to using a top-level window, with WS_POPUP style, and
fix the problem with the loss of activation by explicitly pretending to
still be active in the owner window when losing activation to our own
popup (thanks to Barmak Shemirani for providing this solution).

Also use an MSW-specific and much simpler implementation of detecting
when the popup should be dismissed in wxPopupTransientWindow: instead of
capturing mouse or tracking focus, just react to activation loss
directly.

Add a wxTextCtrl to the popup in samples/popup to show that editing it
works now.
2018-10-20 22:50:46 +02:00
Vadim Zeitlin
713a7ab895 Move wxUSE_ENH_METAFILE check inside wx/msw/enhmeta.h itself
This is more consistent with the other headers, which are safe to
include even when the corresponding feature is turned off.

Also remove the now redundant wxUSE_ENH_METAFILE checks in the source
code including this header.

See https://github.com/wxWidgets/wxWidgets/pull/951
2018-09-26 14:47:45 +02:00
Vadim Zeitlin
a02ed536e6 Add support for more than 4 joystick buttons under MSW
Use polling thread instead of relying on MM_JOYXXX events to allow
receiving events from all the supported buttons.

See https://github.com/wxWidgets/wxWidgets/pull/942

Closes #1142.
2018-09-25 01:03:58 +02:00
Vadim Zeitlin
1833c3d8e4 Add wxBitmap::operator=(wxImage) to wxMSW to resolve amboguities
Code doing "bitmap = image" compiled in the other ports, but not in
wxMSW with WXWIN_COMPATIBILITY_3_0==1 as there was an ambiguity between
converting wxImage to wxBitmap, as intended, or converting wxImage to
wxCursor and then assigning it to wxBitmap using operator=(wxCursor)
overload.

Resolve this ambiguity by providing operator=() overload taking wxImage
directly.

This fixes widgets sample compilation under MSW after the changes of
455a45f5a8

See https://github.com/wxWidgets/wxWidgets/pull/946
2018-09-23 15:51:26 +02:00
Vadim Zeitlin
2ee322b667 Slightly simplify the previous commits
Remove SetWindowMenuLabelTranslated() which was only called once and so
didn't seem to be worth having. Also get rid of WINDOW_MENU_LABEL for
the same reason: it was used only once and imposed the use of
gettext_noop() which is not needed any longer.

Rename GetWindowMenuLabelTranslated() to have a MSW prefix in order to
indicate that it's a private MSW function and not part of the public wx
API.

Also renamed "Translated" to "Current" to (hopefully) more clearly
indicate why do we need to keep this variable.
2018-09-18 00:13:35 +02:00
utelle
9a9176a1be Change storage of window menu label translation
Use member variable instead of global variable
2018-09-18 00:05:50 +02:00
Vadim Zeitlin
1f435261f6 Merge branch 'more-qt-win-build-fixes' of https://github.com/catalinr/wxWidgets
Miscellaneous fixes for building wxQt under MSW.

See https://github.com/wxWidgets/wxWidgets/pull/918
2018-09-17 23:26:27 +02:00
Vadim Zeitlin
6401c2e956 Merge branch 'font-fixes'
Complete support for fractional point sizes and font weights other than
light/bold.

Also harmonize wxFont API and implementation among all ports (fixing
compilation of those of them that were broken by recent changes).

See https://github.com/wxWidgets/wxWidgets/pull/919
2018-09-17 22:58:56 +02:00
Vadim Zeitlin
f69dbaa1ae Introduce MSW ARM64 support
This is a preliminary ARM64 platform support for wxWidgets at "it
compiles" stage. This will allow building and testing wxWidgets based
apps for oncoming Windows 10 ARM64.

Requirements:
- Visual Studio 2017 Update 4 or later with Visual C++ compilers and
  libraries for ARM64 component installed

Building:
1. Open command prompt.
2. Change directory to build\msw subfolder.
3. Run "C:\Program Files (x86)\Microsoft Visual
   Studio\2017\Community\VC\Auxiliary\Build\vcvarsamd64_arm64.bat" once.
4. Use `nmake TARGET_CPU=ARM64 ...` to build required flavor of wxWidget
   libraries.

Notes:
1. Building of *.sln/*.vcxproj files does not support ARM64 yet. This
   requires to hardcode Windows SDK to 10.0.15063.0 or later in
   *.vcxproj files, which would render them non-compilable in older
   Visual Studio versions. Microsoft is aware of this issue and is
   planning a fix in the next version of Visual Studio.
2. wxmsw31ud_gl.dll does not build yet. Awaiting Microsoft to deliver
   missing opengl32.lib for ARM64. Please, specify USE_OPENGL=0.

Closes https://github.com/wxWidgets/wxWidgets/pull/923
2018-09-17 22:34:32 +02:00
Vadim Zeitlin
9627798496 More steps towards using wxFontInfo in all ports
Replace AccountForCompatValues() with InfoFromLegacyParams() which
directly constructs wxFontInfo from the old-style parameters, applying
all the compatibility hacks internally.

There are no real changes in this commit, just simplify the code further
and make wxFontInfo more central.
2018-09-17 15:24:41 +02:00
Vadim Zeitlin
34e01aa62d Change wxFontRefData ctor to take wxFontInfo in wxMSW
Apply the same change as was done for wxGTK in the previous commit to
wxMSW too, for the same reasons.
2018-09-17 15:24:41 +02:00
Vadim Zeitlin
c98879e379 Add wxFont::SetFractionalPointSize()
Changing SetPointSize() argument type from int to float wasn't 100%
backwards-compatible as it notably started resulting in warnings (from
at least MSVC) about conversions from int to float in the existing code.

To avoid these warnings and for symmetry with GetFractionalPointSize(),
add SetFractionalPointSize() taking float argument and preserve the
argument of type int in SetPointSize() for compatibility.

SetPointSize() is now just a wrapper forwarding to the more general
SetFractionalPointSize().

Notice that the other ports still remain broken, this commit only
updates the currently working wxGTK, wxMac and wxMSW.
2018-09-17 15:24:40 +02:00
Vadim Zeitlin
19caf034c3 Fix build problem with MSVS 2005 in wx/msw/uxtheme.h
Avoid conflict with the incomplete MENUPARTS enum defined in the SDK
header included with this compiler.

Closes #18217.
2018-09-13 00:08:36 +02:00
Artur Wieczorek
26ee45e4a5 Deprecate wxBitmap::SetWidth/Height/Size/Depth, wxIcon::SetSize functions
wxBitmap and wxIcon dimensions and colour depth are determined during creation so using all these functions could lead to inconsistencies.
2018-09-12 22:02:56 +02:00
Artur Wieczorek
5115fe31ef Set HICON and its parameters in one call
To avoid separate calls to SetSize() function after calling SetHICON() use newly implemented InitFromHICON() function which allows set HICON together with its parameters in one call.
2018-09-12 22:02:56 +02:00
Artur Wieczorek
97f73acddb Set HBITMAP and its parameters in one call
To avoid separate calls to SetWidth/Height/Size/Depth functions after calling SetHBITMAP() use newly implemented InitFromHBITMAP() function which allows to set HBITMAP together with its parameters in one call.
2018-09-12 22:02:56 +02:00
Josue Andrade Gomes
0bd8fe91e7 Fire wxEVT_WEBVIEW_NAVIGATING when redirecting
When using IE wxWebView backend, this event wasn't generated as expected
when the client was redirected.

Fix this by using DOCHOSTUIFLAG_ENABLE_REDIRECT_NOTIFICATION flag.

Closes https://github.com/wxWidgets/wxWidgets/pull/893
2018-09-11 14:32:14 +02:00
Vadim Zeitlin
8ff36f98f3 Move {Get,Set}Weight() implementations to wxFontBase
Implement these methods in the base class in terms of
{Get,Set}NumericWeight() in order to avoid having to do it for each
platform.

No real changes.
2018-09-06 03:13:23 +02:00
Vadim Zeitlin
967ff67459 Merge branch 'adv-merge'
Move the entire contents of wxAdv library into wxCore.

In the future, wxAdv will disappear entirely, but for now keep it as an
empty placeholder to allow the existing make/project files to work.

See https://github.com/wxWidgets/wxWidgets/pull/900
2018-09-02 15:43:02 +02:00
Stefan Csomor
4580cdb9ad
Extending wxFont API & OSX Core Text Implementation (#877)
* Switch to pure Core Text Implementation, Start extended Font API

* mac fixes

* First msw implementation

* Fixing paste error

* fixing typo

* Rearranging lines to former fallthrough order

* Blind fixes for covering new abstract methods

* Blind gtk implementations

* Fixing according to travis ..

* Removing method defined in base

* formatting adaptions

* Extending the schema definition for new weights

* fixing typo, using wxRound, other fixes according to comments

* changes according to suggestions

* fixing init order, before the init of m_info was overridden by Init()

* redo

* redo

* redo

* Cleanup

Removing obsolete code snippets, proper traces for font names

* Moving common code

Only the Get/SetNumericWeight calls should now be implemented in the native part, the ‚old‘ Get/SetWeight are common code and use the numeric counterparts.

* Updating docs

* commit wa missing changes.txt

* Doc fixes

* Full stops added
2018-09-01 19:42:18 +02:00
Vadim Zeitlin
3ffa651a34 Move wxAdv library contents into wxCore
This basically removes the "adv" library, even though it's still
preserved for compatibility with user make/project files referring to
it.

It is done because the distinction between "adv" and "core" was never
really clear (e.g. why wxTreeCtrl was in core but wxTreeListCtrl in
adv?) and it prevented some core classes from using adv ones.
2018-08-27 21:13:04 +02:00