Commit Graph

17639 Commits

Author SHA1 Message Date
Vadim Zeitlin
648cfe0743 Fix TAB navigation for wxDatePickerCtrl in wxGTK
Inherit from wxNavigationEnabled<> to make navigation work correctly in
wxGTK.
2018-01-30 21:35:20 +01:00
Vadim Zeitlin
1de107c037 Derive wxDatePickerCtrlGeneric from wxCompositeWindowSettersOnly
This class doesn't need the extra focus-related features of
wxCompositeWindow.
2018-01-30 19:53:54 +01:00
Vadim Zeitlin
27cad5e04d Fix TAB navigation with wxComboCtrl in non-MSW ports
Derive wxGenericComboCtrl from wxNavigationEnabled<> to make TAB work
correctly when the focus was on it, otherwise it didn't move it
correctly to the next control.

This notably allows TAB to cycle through all the controls in the "combo"
sample whereas previously it stopped on reaching the combo control with
the list popup with wxGTK.
2018-01-30 19:53:54 +01:00
Vadim Zeitlin
3825baf708 Remove wx/dcbuffer.h dependency from wx/generic/combo.h
This header doesn't really need to be included from here and it was done
solely in order to get the value of wxALWAYS_NATIVE_DOUBLE_BUFFER from
it.

Move the code using this macro in the .cpp file instead.
2018-01-30 19:45:32 +01:00
Vadim Zeitlin
ae8bc4e263 Merge branch 'search-events'
Harmonize the behaviour across platforms.

Also fix ChangeValue() for this control.

And finally rename the events to use simpler names.

See https://github.com/wxWidgets/wxWidgets/pull/699
2018-01-30 14:12:30 +01:00
Vadim Zeitlin
94620f6c59 Use simple wxEVT_SEARCH[_CANCEL] names for wxSearchCtrl events
The old wxEVT_SEARCHCTRL_{SEARCH,CANCEL}_BTN event names were unwieldy
and misleading because both of these events can be generated without
using the buttons, but by pressing Enter or Esc (the latter currently
works under macOS only, but this could change in the future).
2018-01-30 02:03:48 +01:00
Vadim Zeitlin
58ac3d3690 Fix wxSearchCtrl::ChangeValue() to actually change value
This was broken because wxSearchCtrl inherited the base class version of
ChangeValue() which didn't really work for it due to the poor way in
which wxTextEntry is designed (see #18071).

Closes #16998.
2018-01-29 19:35:09 +01:00
Paul Cornett
e1481385c5 Avoid use of uninitialized point size in wxFontInfo
See #18070
2018-01-29 09:49:51 -08:00
Vadim Zeitlin
99dea2e2e0 Remove unnecessary wxSearchCtrl::OnSetFocus()
This was useless as wxCompositeWindow, from which the generic
wxSearchCtrl derives, already sets focus to its first child and, since
the last commit, even harmful as it now resulted in calls to SetFocus()
from inside wxEVT_SET_FOCUS handler which is forbidden at least under
MSW.

See #15569.
2018-01-29 18:45:45 +01:00
Vadim Zeitlin
3b40ff0d41 Send wxEVT_SET_FOCUS for composite window when a child gets focus
wxCompositeWindow already connected to child wxEVT_KILL_FOCUS events and
generated the same event for the composite window itself, but didn't do
it for wxEVT_SET_FOCUS, resulting in not getting these events for the
main window as expected. E.g. this resulted in never getting any
wxEVT_SET_FOCUS events for wxSearchCtrl when using its generic version
(i.e. not under Mac).

Fix this by connecting to wxEVT_SET_FOCUS events for the children too.
Note that this relies on having a correct "previously focused window" in
these events, if this doesn't work reliably for some ports, we might
need to maintain a "bool m_hasFocus" field in wxCompositeWindow itself
instead.

Also note that we might avoid having all this code in wxCompositeWindow
if we translated the underlying native focus event to wxFocusEvents for
both the real window and its GetMainWindowOfCompositeControl() if it's
different. This could potentially be simpler and would definitely be
more efficient, but would require more changes.

Closes #15569.
2018-01-29 18:45:39 +01:00
Vadim Zeitlin
72790218cb Fix wrongly restoring clipping region in wxDCClipper
The change of 2a8c290e0d was wrong as it
unconditionally restored m_oldClipRect in dtor, even when it was empty,
indicating that no clipping had been in effect when wxDCClipper was
constructed. This totally broke all the code using wxDCClipper, notably
generic wxListCtrl which wasn't repainted correctly at all.

Fix this by checking if the clipping rectangle is not empty before
restoring it, this should work as well as we can make it without having
GetClippingRegion() that could return an invalid region if no clipping
is in effect.

See #13834.

Closes #18066.
2018-01-29 15:36:21 +01:00
Vadim Zeitlin
a184914242 Merge branch 'search-desctext'
wxSearchCtrl fixes for wxMSW and add "hint" property to its XRC handler.

See https://github.com/wxWidgets/wxWidgets/pull/691
2018-01-28 16:14:10 +01:00
Vadim Zeitlin
f063dde4f5 Merge branch 'gtk-dyn-autocomplete'
Implement dynamic wxTextEntry autocompletion for wxGTK.

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

Closes #18061.
2018-01-27 19:28:09 +01:00
Vadim Zeitlin
1d45a8e50a Merge branch 'gtk-dc-ppi'
Return display DPI from display-related wxDC classes in wxGTK3.

See https://github.com/wxWidgets/wxWidgets/pull/680
2018-01-27 19:25:30 +01:00
Vadim Zeitlin
160647aaf2 Fix processing of pending events in mixed MFC/wx applications
ProcessPendingEvents() was never called when using MFC event loop,
meaning that queued events were never processed, so that using
CallAfter() didn't work.

Fix this and also ensure that these events are processed soon enough by
also implementing WakeUpIdle() for such applications, as wxWakeUpIdle()
didn't do anything neither for them.
2018-01-27 18:58:13 +01:00
Vadim Zeitlin
8ee3394e5e Declare wxSearchCtrl::{Set,Get}DescriptiveText() in the base class
Fix a trivial "TODO" remaining from 2.8 days and declare the functions
that are part of the public control API as pure virtuals in the base
class.

No real changes.
2018-01-27 13:38:47 +01:00
Vadim Zeitlin
02f2159aea Split wxTextAutoCompleteData in two subclasses
Doing two different things in the same class, using m_isDynamicCompleter
to determine which kind of completion is used, was not very clear, so
create two simple classes each of which does one and one thing only and
create the one we need in wxTextEntry methods.

Note that wxTextAutoCompleteDynamic can assume to always have a valid
wxTextCompleter as otherwise no wxTextAutoCompleteData is needed at all,
which results in more simplifications.

There should be no changes in behaviour.
2018-01-27 01:17:50 +01:00
AliKet
18983cf538 Implement dynamic auto-completion for wxGTK
Make completion using custom wxTextCompleter work in wxGTK too.

Closes #18061.
2018-01-26 23:43:34 +01:00
VZ
9554f878b2
Add support for using Direct2D in wxStyledTextCtrl
Use D2D if available, notably for better ligatures support.

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

Closes #17804.
2018-01-26 15:09:35 +01:00
Vadim Zeitlin
b1e59a6d60 Add wxFloatingPointValidator::SetFactor()
This allows displaying values in percents (or also currency units and
subunits, for example) without changing the actually stored value.
2018-01-26 14:39:57 +01:00
New Pagodi
b936bfe85e Add Direct2D support to wxSTC 2018-01-25 16:07:54 -06:00
Vadim Zeitlin
f836d430e9 Merge branch 'dvc-delete-all'
Fix crashes when deleting all items from wxTreeListCtrl in wxGTK3.

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

Closes #18045.
2018-01-25 19:39:55 +01:00
Vadim Zeitlin
ee0dd4edb1 Replace wxGTKCairoDCImpl::m_{width,height} with m_size
This allows to avoid initializing the variables to 0 in all the
overloaded ctors: wxSize default ctor already does it.

It's also more convenient to use GetScaledSize() rather than assigning
m_width and m_height separately, even if the rest of the code is broadly
unchanged.
2018-01-25 14:56:43 +01:00
Vadim Zeitlin
4c8e701d84 Remove wxGTKCairoDCImpl ctor taking dummy int
We can reuse another ctor taking wxWindow* instead. Although this does
require an ugly cast, it's more explicit than just passing 0 which
could, in principle, match both the ctor taking wxWindow* and another
one taking double, and so is still preferable.
2018-01-25 14:56:43 +01:00
Vadim Zeitlin
0be81cb34b Add wxGTKCairoDCImpl::SetSize() helper
Avoid repeating gdk_window_get_{width,height}() calls in several places.
2018-01-25 14:56:43 +01:00
Vadim Zeitlin
a1cb2eb12a Also return display DPI from wxScreenDC in wxGTK3
This is similar to the previous commit and is done for the same reasons:
screen DC needs to use the same DPI as the screen itself, instead of the
default Cairo 72 DPI.
2018-01-25 14:56:43 +01:00
Vadim Zeitlin
4ad1a3d969 Return display PPI from wxDC::GetPPI() in wxGTK3
For wxDC associated with a window, such as wx{Window,Client,Paint}DC,
this method should return the window PPI, not the hard coded 72 DPI of
Cairo graphics context.

This still doesn't work correctly when using multiple monitors with
different DPI settings, but is still a (modest) improvement.
2018-01-25 14:35:11 +01:00
Vadim Zeitlin
afe0e776b9 Remove confusing "base_type" typedef from wxGTK3 wxDC code
This typedef isn't really useful in base class initializer lists and it
wasn't really used anywhere else.
2018-01-25 14:32:49 +01:00
Vadim Zeitlin
56511118d9 Merge branch 'cxx11-abi-fix'
Avoid ABI issues when building the library in C++98 mode and the
application using C++11 due to using different unordered containers.

Closes #18034.
2018-01-25 13:50:21 +01:00
Vadim Zeitlin
0cea0a67f1 Use RAII SelectionEventsSuppressor in wxGTK wxDataViewCtrl code
This is simpler and safer than always remembering to call
GtkDisableSelectionEvents() and GtkEnableSelectionEvents() in pairs.

No real changes.
2018-01-24 23:09:29 +01:00
Vadim Zeitlin
4a37f2dd15 Merge branch 'win_uxtheme_restructure' of https://github.com/TcT2k/wxWidgets
Don't load theme functions dynamically as it's not necessary any longer.

See https://github.com/wxWidgets/wxWidgets/pull/572
2018-01-24 00:24:38 +01:00
Vadim Zeitlin
9364690c0e Correct check for <windows.h> inclusion to fix MinGW build
MinGW compiler predefines WIN32, meaning that wx/msw/winundef.h was
always included from wx/defs.h, even when it was completely unnecessary.
This was just inefficient, but harmless, until the changes of
042d922e88 which broke MinGW compilation
as wxUSE_UNICODE_WINDOWS_H was incorrectly defined during the very first
inclusion of wx/msw/winundef.h, before _UNICODE could be defined
correctly by windows.h.

Fix this by checking whether windows.h was really already included.
2018-01-23 17:53:18 +01:00
Vadim Zeitlin
ff1fe53d66 Merge branch 'statbox-any-label'
Add support for using any wxWindow (and not just the equivalent of
wxStaticText) as wxStaticBox label.

See https://github.com/wxWidgets/wxWidgets/pull/650
2018-01-23 15:45:46 +01:00
Vadim Zeitlin
3cbfe25fa6 Merge branch 'mfc'
A bunch of improvements for applications using both wxWidgets and MFC.
2018-01-23 15:39:00 +01:00
Tobias Taschner
2d064ea3b9
Move UXTheme symbol definitions for Vista+ to msw/uxtheme.h
Remove various definitions and symbol declarations from
numerous files using msw/uxtheme.h to a single file.
When possible vssym32.h is included from the Windows SDK.
For older SDKs tmschema.h is included and missing symbols
are defined in msw/uxtheme.h.
2018-01-22 00:53:21 +01:00
Tobias Taschner
ddceaab001
Remove MSW wxUxThemeEngine class
This undocumented "private" class was used for various windows UxTheme
functions which are available since WinXP. As wxWidgets 3.1 is XP+ it
does not make sense anymore to load the theme functions dynamically.
2018-01-22 00:51:11 +01:00
Stefan Csomor
ce90336dff Fixing popup windows with a modal dialog as parent
When having a certain creation sequence, these popup windows were not focused correctly, see https://github.com/wxWidgets/wxWidgets/pull/672 , commit d2265136e359df4d14054860a68bbc7f4910279d , revert this change if problems arise to see whether this is a recursion
2018-01-21 20:41:52 +01:00
Stefan Csomor
aae23be946 Fixing xcode build after xlocale.h include change
see commit e723bb2ee4
2018-01-21 17:33:50 +01:00
Vadim Zeitlin
e723bb2ee4 Try to fix macOS build using cmake after xlocale changes
Commit bc13119494 removed the inclusion of
xlocale.h because it is not (and never was) needed under Linux with
glibc, but it is still needed under macOS, so this (silently) disabled
wxXLocale support under Mac when using configure and broke the build
when using cmake.

Fix both problems by using xlocale.h only if it's available, both in
configure and in cmake.
2018-01-21 16:49:26 +01:00
Tobias Taschner
d6b88ca399 Add footer text and icon to wxRichMessageDialog
The underlying Windows TaskDialog supports adding an additional footer
to the message dialog. This makes the native functionality available
and implements it in the generic version.

See https://github.com/wxWidgets/wxWidgets/pull/573
2018-01-20 16:53:13 +01:00
Vadim Zeitlin
bc13119494 Don't check for non-standatd xlocale.h in configure
Testing for xlocale.h was due to a misunderstanding, this header wasn't
supposed to define locale_t which is defined by locale.h itself and was
just some internal glibc header which was removed in its 2.26 release,
see

https://sourceware.org/glibc/wiki/Release/2.26#Removal_of_.27xlocale.h.27

Stop checking for it in configure and also don't always define
wxUSE_XLOCALE but only do it if the configure test succeeded.
2018-01-20 13:47:21 +01:00
Vadim Zeitlin
a67f4b8254 Don't pretend static box with enabled label is disabled
Trying to be smart by setting m_isEnabled to false in
wxStaticBox::Enable() without actually disabling the box itself (because
it can't be done if its label window is to remain enabled) didn't really
work. For example, it was impossible to TAB to a checkbox label of the
box when it was disabled, because keyboard navigation (correctly)
doesn't recurse into disabled windows and there could be similar
problems with any other code iterating over windows and skipping over
the disabled ones.

So, finally, simplify things and keep m_isEnabled in sync with the real
box state, even if this, counter-intuitively, means that IsEnabled() on
the box returns true after calling Enable(false) on it.

This also reverts 4ee35cf5ee569b6ee6c7d0d5702484d4d2a20f96 ("Don't
disable wxStaticBox children at wx level when disabling it") as we can't
avoid really disabling the children any more now that their parent is
not disabled: without this, their IsEnabled() would return true, i.e.
they wouldn't be disabled at all, from the program point of view. This
is unfortunate for the reasons that originally motivated that commit,
i.e. if some wxStaticBox child is disabled, disabling and re-enabling
the box will now re-enable this child, even if it shouldn't, but seems
impossible to avoid. The only possible alternative is to modify
IsEnabled() to add some wxStaticBox-specific hook to it, e.g. instead of
calling GetParent()->IsEnabled() there, we could call some now
AreChildrenEnable() method, which would delegate to IsEnabled() by
default but overridden in wxStaticBox. However this seems complicated,
and will add an extra virtual function call to all (frequently
happening) IsEnabled() calls.
2018-01-18 23:28:16 +01:00
Vadim Zeitlin
4839932227 Allow tabbing to the windows inside non-notebook wxBookCtrl
Remove wxBookCtrlBase::AcceptsFocus() returning false as it didn't make
any sense: even though wxBookCtrlBase doesn't, indeed, accept focus on
itself, it does accept it for its children and returning false prevented
the focus from ever getting inside it.

This fixes, for example, keyboard navigation in a window containing
wxSimplebook and TAB can now be used to move to the controls inside it
from the outside.

Also remove the now unnecessary AcceptsFocus() override which was just
undoing the damage of the base class method and is not needed any more.
2018-01-18 22:59:45 +01:00
Vadim Zeitlin
c6e445d40c Set focus to wxSimplebook contents when setting focus to it
This is more expected than simply doing nothing, as happened until now.
2018-01-18 22:59:42 +01:00
Stefan Csomor
a1cf0e1cd4 Removing manual focus handling
see https://github.com/wxWidgets/wxWidgets/pull/672 , commit 61b1a9a3533d4e16b2b7a9441e42766d8d9655c7 , revert this change if problems arise to see whether this is a recursion
2018-01-18 19:42:08 +01:00
Vadim Zeitlin
0a966eb145 Merge branch 'xrc-text-escape'
Miscellaneous improvements for handling mnemonics in XRC.

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

Closes #18033.
2018-01-18 00:23:18 +01:00
Vadim Zeitlin
35a0ba4fce Avoid crash on abnormal exit in wx+MFC combined applications
Reset m_pMainWnd in wxMFCApp::ExitInstance() to avoid crash when
deleting it again in OnMainWindowDestroyed() that could happen if
ExitInstance() was called not because the main window was closed (normal
case) but because wxApp::ExitMainLoop() was called, as it happens when
an unhandled exception is thrown.
2018-01-17 11:51:03 +01:00
Vadim Zeitlin
ca5e944a67 Merge branch 'mac'
Assorted macOS fixes, see https://github.com/wxWidgets/wxWidgets/pull/625
2018-01-14 18:51:31 +01:00
Vadim Zeitlin
0eb456f08e Revert "Fix wxTreeListCtrl under wxOSX"
This reverts commit 28f96bdff0 as it isn't
necessary any more after the fix in the previous commit.

See #17409.
2018-01-14 18:51:02 +01:00
Vadim Zeitlin
27c399adbe Remove wxALWAYS_SHOW_SB-related code from wxScrolled
There is no need to handle this style specially here, it's supposed to
be handled at wxWindow level and is, indeed, at least in all the major
ports.

So revert 2119b213e3 (see #13616) and the
workaround for it applied later for macOS (see #14856). And this also
removes the need for handling wx[HV]SCROLL in wxScrolled (see #17846).

Closes #14856, #17846.
2018-01-14 18:27:10 +01:00
Vadim Zeitlin
a6c1899092 Merge branch 'msw-wakeup-no-msg'
Restore using event objects, instead of posting WM_NULL messages, for
idle wakeup under MSW.
2018-01-14 13:38:04 +01:00
Martin Koegler
f6dddd9228 Use unordered_xxx classes detected by configure
When using configure, use the same family of hash sets/maps when
building wxWidgets and the applications using it as doing otherwise
results in ABI incompatibility.
2018-01-14 03:07:48 +01:00
Vadim Zeitlin
ebb06fbeaf Use wxTimeVal_t instead of timeval to fix 64 bit Cygwin problems
Due to the same problem with sizeof(long) mismatch as in the previous
commit, we can't use struct timeval, with its long fields, in 64 bit
Cygwin builds, and need to use __ms_timeval instead.

Add wxTimeVal_t type to hide this difference and update all code
compiled under MSW (there is no need to uglify Unix-only code using
timeval, as in wxSelectDispatcher, for example) to use it instead of
timeval.
2018-01-14 02:25:51 +01:00
Vadim Zeitlin
1261139bcb Fix wxSocket code compilation with Cygwin in 64 bits
Use __ms_u_long instead of just u_long with Cygwin to avoid mismatch
between (64 bit) Cygwin long and (still 32 bit, even in 64 bit build)
Windows API long.
2018-01-14 02:25:51 +01:00
Vadim Zeitlin
3c29b3d0ce Don't disable wxStaticBox children at wx level when disabling it
Calling Enable() on all children from wxStaticBox::Enable() was wrong,
the actual status of the child, returned by wxWindow::IsThisEnabled(),
is not supposed to change just because its parent was disabled.

Call NotifyWindowOnEnableChange() to avoid this, while still disabling
the children visually.
2018-01-13 23:56:37 +01:00
Vadim Zeitlin
2163b00b93 Move wxHAS_NATIVE_ENABLED_MANAGEMENT definition to the source file
There doesn't seem to be any need to have this symbol in the header,
when it's only used in NotifyWindowOnEnableChange() in wincmn.cpp.

No real changes.
2018-01-13 23:56:37 +01:00
Vadim Zeitlin
d617834eb9 Don't make wxEventLoop::WakeUpIdle() virtual
It just forwards to (virtual) WakeUp() and there should be no need to
ever override this method itself (nor even to keep it, except for
backwards compatibility).

No real changes.
2018-01-13 17:40:53 +01:00
Vadim Zeitlin
9b4759d7b6 Don't rely on getting WM_NULL messages in wxIdleWakeUpModule
Since the switch to using an event object for idle handling wakeup,
WM_NULLs are not being sent any longer, so wxIdleWakeUpModule didn't do
anything, resulting in pending event dispatching being paused while our
event loop was not running, as it happened, for example, while the
window was resized.

See #17579.
2018-01-13 17:33:09 +01:00
Vadim Zeitlin
91aed00288 Revert "Revert using an event object for waking up event loop in wxMSW"
This reverts commit ebb3a791b9,
effectively reapplying 6c40531fb7 once
again.

This breaks wake up when not running our own event loop once again
(see #17579), but this will be fixed in the next commit.
2018-01-13 15:23:30 +01:00
Vadim Zeitlin
52635cfc10 Reuse the same XRC function for all translations
Translate all strings in the new GetNodeText() function replacing the
old GetText() which was mostly used for translatable strings before --
except that <item> tag contents didn't use it because it also performed
string unescaping, not wanted for the control items, in addition to
translation.

Replace the old GetText() (while still keeping it for compatibility,
i.e. to avoid breaking any custom XRC handlers using it) with the new
function which is more flexible and can be used for all tags.

No real changes, this is just a refactoring.
2018-01-11 01:19:16 +01:00
Trylz
80f4c8cde3 Add XRC handler for wxSpinCtrlDouble
Create wxSpinCtrlDoubleXmlHandler class similar to the existing
wxSpinCtrlXmlHandler and update the XRC schema to account for it.
2018-01-10 17:44:32 +01:00
Vadim Zeitlin
e2a31ef3db Merge branch 'grid-clip'
See https://github.com/wxWidgets/wxWidgets/pull/648
2018-01-10 17:19:03 +01:00
Vadim Zeitlin
5def115f28 Extract common type definitions from wx/defs.h to wx/types.h
Fix the problem with compiling user code including wx/debug.h as the
first wxWidgets header under MSW. This ought to work, but didn't,
because wx/debug.h included wx/chartype.h without including wx/defs.h
(because there is already an inclusion in the other direction), which
defines SIZEOF_WCHAR_T required by wx/chartype.h, first.

Notice that we repurpose the existing but completely unused (no mentions
of it or the symbols defined in it anywhere neither in wxWidgets nor in
any of the code search engines) wx/types.h header as it has a fitting
name and this avoids having to add a new header and remove the existing
one.
2018-01-07 22:43:24 +01:00
Vadim Zeitlin
a6d677a0fe Check for correct window in wxNumValidatorBase::SetWindow()
Override SetWindow() to check that the validator is being associated
with the window of the correct type, this allows to trigger an assert
immediately if this is not the case, making it simpler to find the error
as the call to SetValitator() on the wrong window will be in the call
stack when this happens, unlike before when the assert would happen only
at some later time.
2018-01-07 01:26:53 +01:00
Vadim Zeitlin
bfcd51cb6a Make wxValidator::SetWindow() virtual
Allow overriding the method called when the validator is associated with
the window, this can be convenient to perform some initialization on the
validator instance actually used as it can't be done on the initially
created object itself because it will be cloned by SetValidator(),
creating a new instance.

Also change SetWindow() to take wxWindow instead of wxWindowBase, this
still requires the cast in wxWindow::SetValidator(), but it's better to
have it there rather than in wxValidator and use the simpler type in the
public function signature.
2018-01-07 01:25:10 +01:00
Vadim Zeitlin
1d037dd4c9 Don't disable wxStaticBox window label when disabling the box
This behaviour might be not completely intuitive, but it makes it much
simpler to handle the box state using a checkbox as the label control
(which is by far the most common case of using box window labels).

Notice that while we could add a separate EnableWithoutLabel() method to
wxStaticBox to make it possible to set the state of the box directly
relatively easily, it wouldn't help with using wxEVT_UPDATE_UI for
managing the box state indirectly as it relies on calling Enable() only.
And this solution does allow wxEVT_UPDATE_UI handlers for the box itself
to work (provided the handler takes care to check for the event object
being the box itself, as otherwise it would still disable the child
checkbox when its wxEVT_UPDATE_UI bubbles up to the box).
2018-01-07 01:14:17 +01:00
rmpowell77
af56ccd46f Use semicolons as statement separators in wxHTML code
This avoids (harmless in this, but not necessarily in the other, case)
clang warning: possible misuse of comma operator here [-Wcomma].

See https://github.com/wxWidgets/wxWidgets/pull/662
2018-01-06 17:37:20 +01:00
Vadim Zeitlin
48faeb65b3 Fix copy ctor in numeric validators classes
wxFloatingPointValidator and wxIntegerValidator copy ctor didn't copy
the associated window, so it was lost when the validator was Clone()'d.

Fix this by correctly using wxValidator copy ctor, instead of the
default one, in the copy ctor of the common wxNumValidatorBase base
class.
2018-01-04 21:39:57 +01:00
Vadim Zeitlin
f83d16aa46 Undefine min and max before using them in wx/valnum.h
Avoid problems when using this header in code also include <windows.h>
(and not doing it via wx/msw/wrapwin.h) by ensuring that min and max
used here are not defined as macros.
2017-12-26 04:29:42 +01:00
Vadim Zeitlin
5a949efc5c Fix sending wxEVT_TEXT_ENTER when using auto-completion in wxMSW
We need to explicitly generate this event from the char hook handler as
we don't get the normal WM_CHAR for it, it is apparently intercepted by
the window proc installed by the auto-completing code, so check if
wxTE_PROCESS_ENTER is used for the text entry and call a special new
MSWProcessSpecialKey() method to do the right thing if it is.

Similarly, handle Tab presses correctly if wxTE_PROCESS_TAB is used.

Closes #12613.
2017-12-25 19:29:25 +01:00
Vadim Zeitlin
fdf47e8e12 Fix colours and fonts of wxStaticBox label window in wxMSW
Inherit from wxCompositeWindowSettersOnly<> to make sure all the usual
setters, such as SetForegroundColour() and SetFont(), called on
wxStaticBox are propagated to the label window too.

However also prevent SetBackgroundColour() from being propagated
unnecessarily -- because the checkbox already inherits the parent
background colour by default in wxMSW anyhow -- and still override
SetFont() to adjust the label window position after the font change,
otherwise it could be truncated after increasing the font size, for
example.

Because of these issues, wxCompositeWindowSettersOnly is not ideally
suited for its use here, but on balance it still seems to be better to
use it rather than reimplement parts of its functionality here.
2017-12-24 22:38:10 +01:00
Vadim Zeitlin
329af399eb Factor out wxCompositeWindowSettersOnly class
Extract this class from wxCompositeWindow, as sometimes it can be
convenient to just define the setter functions to do the right thing for
a window containing sub-windows, but without dealing with focus too.

This will be used in wxMSW wxStaticBox in the next commit.
2017-12-24 22:38:10 +01:00
Vadim Zeitlin
687192d86a Add support for arbitrary window labels in wxStaticBox to wxMSW
Just reparent the label window and position it accordingly and, also,
avoid painting over it in MSW-specific code.
2017-12-24 22:38:10 +01:00
Vadim Zeitlin
59ca9b93a0 Make wxCompositeWindow ctor protected
As this class is only supposed to be used as a base class, its ctor
doesn't need to be, and hence ought not to be, public.

Also update an outdated comment stating that the ctor didn't do anything
when it, in fact, does perform an important task.
2017-12-24 22:38:10 +01:00
Vadim Zeitlin
598c62a267 Don't change wxCompositeWindow size from SetLayoutDirection()
Remove wxSIZE_AUTO from the SetSize() call, this was completely
unnecessary and unexpectedly (and wrongly) resized composite windows
managed by sizers as SetLayoutDirection() side-effect.
2017-12-24 22:38:10 +01:00
Vadim Zeitlin
91875045ac Don't make wxStaticBoxBase::GetBordersForSizer() inline
Move the function definition to the source file, there doesn't seem to
be any reason to keep it in the header.
2017-12-24 22:38:10 +01:00
Vadim Zeitlin
8c06a24da4 Move m_labelWin to wxStaticBoxBase itself
It will be reused by all platforms and is not specific to wxGTK.

This also means WXDestroyWithoutChildren() doesn't need to be virtual
any longer.
2017-12-24 22:38:10 +01:00
Vadim Zeitlin
7c849276f8 Add support for using arbitrary windows as wxStaticBox labels
This commit implements the new feature in wxGTK and updates the sample
and the documentation.
2017-12-24 22:38:10 +01:00
Vadim Zeitlin
29bd25b757 Add GTKDoApplyWidgetStyle() helper
This allows to call the protected wxWindowGTK::DoApplyWidgetStyle()
method when it's really necessary, e.g. when forwarding to it from
DoApplyWidgetStyle() implementation for another window.
2017-12-24 22:35:45 +01:00
Vadim Zeitlin
aa47c15abd Add WXDestroyWithoutChildren() and use it from wxStaticBoxSizer
Factor out the code from wxStaticBoxSizer dtor into a wxStaticBox method
to improve encapsulation: the static box knows better than another class
how to detach its children from it before destroying it.

No real changes yet.
2017-12-24 22:35:45 +01:00
Vadim Zeitlin
87afebd6f2 Inline wxStaticBox ctors in wxGTK
No real changes, just make the trivial ctors of this class inline for
consistency with the new ctor about to be added.
2017-12-24 22:35:45 +01:00
jonkraber
2a8c290e0d Restore previous clipping box in wxDCClipper
Remember the clipping box of the previously active clipping region in
wxDCClipper ctor and restore it in its dtor.

See #13834.
2017-12-24 15:46:57 +01:00
Paul Cornett
b573315e7f Add wx_is_at_least_gtk3() helper 2017-12-19 09:41:26 -08:00
Paul Cornett
b2ea617145 Avoid deprecated gtk_text_iter_begins_tag() 2017-12-17 21:51:36 -08:00
Paul Cornett
ba4da9fdf9 Use "new" GDK keysym names
Old names are no longer available with GTK+4
2017-12-17 21:51:16 -08:00
kathoum
f1dfb27cb1 Use the same ABI version string for MSVS 2017 as for MSVS 2015
MSVS 2017 (which uses _MSC_VER from 1910 to 1912 currently) is
ABI-compatible with MSVS 2015 (_MSC_VER 1900), so do allow linking code
compiled with one of them with the library built by the other one.

Closes #18024.
2017-12-16 15:57:02 +01:00
Vadim Zeitlin
ed23de08c7 Minor clean up of wxPersistentDataViewCtrl
Add another helper function, make variables const when possible, fix
some small style problems.

No real changes.
2017-12-15 15:26:32 +01:00
Vadim Zeitlin
e5b12b5bc8 Merge branch 'dvc-persist' from iwbnwif
See https://github.com/wxWidgets/wxWidgets/pull/541
2017-12-15 14:10:01 +01:00
Vadim Zeitlin
6c7e5a9200 Allow attaching a wxWindow to CWnd later in wxMFCWnd
When using two-step creation, as when loading from resources, for
example, it can be convenient to create wxMFCWnd as part of the (parent)
wxWindow object, but only attach it to the real HWND later, once it
becomes available.
2017-12-12 18:46:29 +01:00
Vadim Zeitlin
44c31d2700 Destroy MFC main window when its wx counterpart is destroyed
This avoids using m_pMainWnd after its HWND becomes invalid, as this
resulted in assert failures from CWnd::WalkPreTranslateTree() called
with this HWND as its hWndStop argument from PreTranslateMessage() which
was used to pre-translate a WM_NULL message the application sometimes
received while closing down.
2017-12-12 17:20:36 +01:00
Vadim Zeitlin
636219bd35 Always pre-process messages for wx windows in mixed wx/MFC apps
Still use the active event loop if there is one, just in case it
customizes messages pre-processing, but fall back on the standard
pre-processing code even if there is no active wx event loop and we're
only running the MFC one, as without doing this there are just too many
things that don't work (e.g. menu accelerators didn't work at all in
mixed wx/MFC applications previously).
2017-12-11 22:06:13 +01:00
Vadim Zeitlin
3960e630f1 Make it possible to use an existing base class for wxMFCWinApp
When porting an existing MFC codebase to wxWidgets, it may be useful to
continue using the existing CWinApp-derived application class, so allow
deriving wxMFCApp from it instead of always deriving it from CWinApp
itself.
2017-12-11 21:03:18 +01:00
Vadim Zeitlin
042d922e88 Allow predefining wxUSE_UNICODE_WINDOWS_H in wxMSW builds
This can be used in order to use normal Unicode build of wxWidgets with
an application that needs to use ANSI versions of Win32 functions, e.g.
because it doesn't compile with UNICODE defined.
2017-12-11 21:03:18 +01:00
Vadim Zeitlin
9dd83933f3 Remove redundant sections from wx/msw/winundef.h
Somehow we redefined GetFirstChild() and GetNextSibling() twice in a row
for the last ~18 years.
2017-12-11 21:03:17 +01:00
Vadim Zeitlin
acf53800fc Extract reusable part of the MFC sample in a header
Allow reusing this functionality from outside the library, it can he
useful if an MFC window needs to be embedded into a wx application (or
vice versa).

Also use a better wxEntryStart() overload as a side effect, this should,
in particular, fix the problem with command line arguments processing in
mixed MFC/wx applications pointed out in a comment in the sample
previously.
2017-12-11 21:03:17 +01:00
Maarten Bent
6168e44846 Remove unused defines from private wxMSW header 2017-12-10 23:23:30 +01:00
Maarten Bent
f696d035a6 Remove unused variables from wxRadioBox
These variables never got assigned a value.
2017-12-10 23:23:29 +01:00
Maarten Bent
febd929f0f Improve wxRadioBox width on wxMSW
Do not use 'RADIO_SIZE 20' as the fixed width of the radio button, but use the actual width as returned by wxRendererNative.
wxRendererNative has no GetRadioButtonSize, so for now use GetCheckBoxSize. It returns the same sizes.
Also add a half character width to account for the space between the button and the label.
There is no need to add extra width to the label of the static box.

Closes #18010.
2017-12-10 23:22:13 +01:00
Vadim Zeitlin
b5d0a291a5 Merge branch 'msw-double-buffer'
Improve double-buffering support in wxMSW wxListCtrl and optionally use
it in wxTreeCtrl too.

Closes https://github.com/wxWidgets/wxWidgets/pull/636
2017-12-10 17:47:31 +01:00
Steve Browne
ef91e5ecbe Implement wxTreeCtrl::SetDoubleBuffered() in MSW wxTreeCtrl
Also don't erase background when the control is double-buffered because
it's not necessary and can cause flicker.

See https://github.com/wxWidgets/wxWidgets/pull/374
2017-12-10 17:47:26 +01:00