Commit Graph

17639 Commits

Author SHA1 Message Date
Vadim Zeitlin
058c085b21 Use wxVector<> in wxTreebookPage implementation
No real changes, just replace the use of a macro-based array with
wxVector<>.
2018-03-31 01:45:01 +02:00
Vadim Zeitlin
bb492b99bd Don't include wx/treectrl.h from wx/treebook.h any more
Remove an unnecessary header dependency. This is not completely
backwards-compatible as it would break any code relying on getting e.g.
wxTextCtrl declaration after including wx/treebook.h, but, hopefully,
there shouldn't be that much such code out there and fixing it shouldn't
be difficult.

If either of these assumptions turns out to be false, this commit can
always be reverted later.
2018-03-31 01:45:00 +02:00
Vadim Zeitlin
b97ea90f4f Add default value for MakeConfigFileName() 2nd argument
Make it possible to call wxStandardPaths::MakeConfigFileName() without
explicitly specifying the convention to use, to make it conform to the
documentation (previously this only worked when calling the
wxStandardPathsBase version of the method).

Closes #18106.
2018-03-17 17:17:05 +01:00
Paul Cornett
05454e778c Build fix for GTK+ < 2.18
Broken by 986f61f33e
2018-03-12 10:06:23 -07:00
Vadim Zeitlin
e5a1a29e77 Fix wxGTK build with glib < 2.32 and streamline the code a bit
Define g_signal_handlers_disconnect_by_data() if it's not available,
i.e. when using glib older than 2.32 where it was added, to fix the
build under old systems such as CentOS 6 broken by the changes of
8278f7b618 (see #18084).

Also use it elsewhere instead of g_signal_handlers_disconnect_matched()
as it's more readable.

Closes https://github.com/wxWidgets/wxWidgets/pull/760
2018-03-11 22:22:45 +01:00
VZ
e183b6d382
Fix miscellaneous build warnings
See https://github.com/wxWidgets/wxWidgets/pull/755
2018-03-07 18:25:32 +01:00
Maarten Bent
3b9aeaeb2f More use of wxOVERRIDE 2018-03-06 23:31:01 +01:00
Vadim Zeitlin
1f7a8a82c3 Round, rather than truncate, in wxSize and wxPoint operations
It seems to make more sense to round the result to int rather than to
truncate it when scaling wxSize or wxPoint coordinates by a floating
point number.
2018-03-06 16:08:01 +01:00
Vadim Zeitlin
bec7c9a161 Don't truncate to int in wxRealPoint::operator*()
wxRealPoint uses double coordinates and it makes no sense to truncate
the result of scaling it to int -- this was almost certainly a
copy-and-paste error due to copying the code of the corresponding
wxPoint method.
2018-03-06 16:06:35 +01:00
Vadim Zeitlin
9774d92e91 Change wxSize::Scale() to take double, not float
There doesn't seem to be any reason to use float here when double is
used everywhere else.

Moreover, the (implicit) conversion of int to float is not always
lossless, and resulted in -Wconversion warnings from g++ 7, which
disappear when using doubles.
2018-03-06 16:01:45 +01:00
Vadim Zeitlin
1540361e75 Avoid warnings about conversion to wxUint16 in wxUniChar code
This conversion is intentional, so suppress the -Wconversion warning
given by g++ 7 (if this warning is enabled) with an explicit cast.
2018-03-06 16:00:47 +01:00
Stefan Csomor
0fc53016a9 making NSString conversion functions available in private.h 2018-02-28 21:08:27 +01:00
Stefan Csomor
6b3b05e5f7 fixing classname 2018-02-28 16:24:43 +01:00
Stefan Csomor
a7505356a4 supporting Window Menu as Carbon did 2018-02-28 16:10:33 +01:00
Vadim Zeitlin
cc8fccf0bc Make wxVector reverse iterators conform to iterator requirements
This is similar to a recent commit adding the missing typedefs to wxList
iterators and defines the types required by the iterator concept in
wxVector::reverse_iterator and const_reverse_iterator classes (simple
iterators are just pointers and are already covered by the standard
iterator_traits specialization).
2018-02-23 16:14:03 +01:00
Vadim Zeitlin
382a5a156e Use ptrdiff_t as wxVector::difference_type instead of size_t
difference_type must be signed, using size_t was clearly a mistake.
2018-02-23 16:10:07 +01:00
Vadim Zeitlin
7e0ca8357e Also remove wxList::const_iterator::const_reference typedef
This typedef is redundant with the "reference" one and doesn't seem to
be used anywhere.

As with the previous commit, this one could be reverted later if it
turns out it does break any existing code, but this seems unlikely.
2018-02-23 16:03:36 +01:00
Vadim Zeitlin
9edf06794e Remove ptr_type typedef from wxList iterator classes
This typedef is completely redundant with pointer_type which had been
also available in these classes since the very beginning and seems to
have been meant to be private originally, so it should be safe to just
remove it, especially because I couldn't find any existing code using
it.

If we do find such code in the wild later, this commit could be reverted
as it's not really indispensable.
2018-02-23 16:03:33 +01:00
Vadim Zeitlin
fdbe357e4b Make wxList iterators conform to input iterator requirements
Define "pointer", "reference", "difference_type" and "iterator_category"
typedefs to ensure that wxList iterator classes are seen as iterators by
the standard library in C++11 and later, as otherwise standard container
template ctors taking iterators couldn't be used with them because
they're only available if input iterator requirements are satisfied.

This notably fixes creation of std::list from wxList iterators; add a
test which didn't compile before to show it.
2018-02-23 16:00:06 +01:00
Vadim Zeitlin
0d5378fb84 Remove unnecessary "list" typedef from wxList iterators
This typedef was simply never used and, as it was private, removing it
shouldn't result in any compatibility problems.
2018-02-23 14:21:05 +01:00
Maarten Bent
3d427a1af1 Fix wxWebView::RunScript() with string containing backslashes
Escape backslashes in wxJSScriptWrapper to allow strings with
backslashes in them to work again -- this was broken while implementing
support for returning values from JavaScript to C++.

See https://github.com/wxWidgets/wxWidgets/pull/741
2018-02-22 13:44:00 +01:00
Tobias Taschner
dd2d62c703 Suppress size event when IsMaximized is called on OSX
IsMaximized internally calls [NSWindow isZoomed] which triggers a
windowWillResize call. Resize events will be ignored while calling
isZoomed.

Closes #17407.

See https://github.com/wxWidgets/wxWidgets/pull/740
2018-02-21 17:08:45 +01:00
Vadim Zeitlin
2ec2837f6d Update version to 3.1.2
Run misc/scripts/inc_release and rebake.
2018-02-20 00:08:01 +01:00
Hugo Elias
28bf0e8687 Add wxIMAGE_OPTION_GIF_TRANSPARENCY for GIF image loading
Allow to keep the originally defined transparent pixels colour instead
of replacing it with bright pink (which is still the default behaviour).

Closes #18014.
2018-02-16 16:28:33 +01:00
Vadim Zeitlin
1ebc28787c Merge branch 'zip64-fix'
Notably fix ZIP64 creation with individual files larger than 4GB.

See https://github.com/wxWidgets/wxWidgets/pull/730
2018-02-16 16:03:32 +01:00
Tobias Taschner
29f5eeb69d
Fix ZIP64 creation with individual files larger 4GB
If single files larger than 4GB where added the recorded file sizes
in the local file header where not updated correctly. Additionally
recorded file sizes in the central directory where in the wrong order
making it impossible to extract.

To enable adding files with unknown size which might be larger than 4GB
the new method wxZipOutputStream::SetFormat() is added.

Additionally a check has been added in case a file larger 4GB has been
written without ZIP64 info.
2018-02-15 20:01:13 +01:00
Robin Dunn
c27f1536ba Fix InheritsForegroundColour method name 2018-02-10 13:00:19 -08:00
Robin Dunn
6cdf29760d Fix conflict in macro and class name 2018-02-10 13:00:19 -08:00
Vadim Zeitlin
a957df3fc1 Add missing wxOVERRIDE for overridden GtkGetValueFromString
This fixes a (harmless) warning in clang wxGTK builds.
2018-02-06 13:29:32 +01:00
Vadim Zeitlin
eee4f5969f Merge branch 'dvc-more-fixes'
More, mostly event-related, wxDataViewCtrl fixes.

See https://github.com/wxWidgets/wxWidgets/pull/718
2018-02-05 14:04:42 +01:00
Scott Talbert
1f2173b9be Fix custom scheme handling in wxWebView WebKit2 implementation
The custom scheme handling implementation had been inherited from the
original WebKit1 implementation.  It attempted to intercept navigation
and resource load requests and then inject the resources.  It seems that
this method doesn't work in WebKit2, but fortunately, there is native
support in WebKit2 for custom URI schemes through the
webkit_web_context_register_uri_scheme() API.

Also extend wxGtkError to allow creating it from an existing GError
object as a side-effect of these changes.

See https://github.com/wxWidgets/wxWidgets/pull/716
2018-02-05 14:04:41 +01:00
Vadim Zeitlin
33cbefd739 Send wxEVT_DATAVIEW_ITEM_EDITING_DONE for all renderers in wxGTK
Previously this event was not sent for the standard renderers, such as
wxDataViewTextRenderer, at all in wxGTK because the base class
FinishEditing() class didn't do anything if m_editorCtrl was null, as it
was always the case for non-custom renderers.

Fix this by refactoring the base class code in yet another way and
extracting the part which can be reused by both the generic and GTK
implementation in a new DoHandleEditingDone() function and call it from
wxGTK code.

Finally, check "editing-canceled" property to also correctly generate
the event with IsEditCancelled() returning true when editing is canceled
by e.g. pressing Esc in a standard renderer too.

And, as a final bonus, this makes the (just introduced) slightly
artificial DoFinishOrCancelEditing() unnecessary, so it can be removed,
without reintroducing any code duplication.

See #17835.
2018-02-05 01:05:16 +01:00
Vadim Zeitlin
a00b8dec8b Reduce code duplication in wxGTK wxDataViewRenderer classes
The code was more complicated than necessary, with the base class
providing both virtual GtkOnCellChanged() and GtkOnTextEdited() that
were both overridden to achieve the same thing, namely customizing how
the value entered by user is converted to wxVariant, in different
derived classes.

Make GtkOnTextEdited() non-virtual and remove GtkOnCellChanged()
completely and add a new simple GtkGetValueFromString() which is called
from GtkOnTextEdited() to do the conversion.

This removes the existing code duplication and will make it simpler to
modify this code in the future, without changing the behaviour.
2018-02-05 00:01:52 +01:00
Vadim Zeitlin
1e3e5b7253 Send wxEVT_DATAVIEW_ITEM_EDITING_DONE after cancelling too
Previously this event was not sent at all if editing the item was
cancelled, e.g. by pressing Esc.

Do send it now from the generic implementation and update the sample to
show this event.

See #17835.
2018-02-04 22:58:03 +01:00
Vadim Zeitlin
7e3d28e79f Rename wxDataViewEvent::SetEditCanceled() and remove its argument
This method should be only used when the edit is really cancelled, so it
doesn't need to take a boolean argument.

It should also use the same spelling as IsEditCancelled() (and for
consistency with the rest of wxWidgets API which uses British English).

Also remove this method from the documentation, it is not part of the
public API.
2018-02-04 22:36:14 +01:00
Vadim Zeitlin
77231f5907 Make wxDataViewRendererBase::DestroyEditControl() private
This method is only supposed to be used by this class and not any
derived classes, so prevent it from being used accidentally.

No real changes.
2018-02-04 22:20:22 +01:00
Vadim Zeitlin
48fb2b42b1 Send wxEVT_DATAVIEW_COLUMN_REORDERED in generic wxDataViewCtrl
Simply translate wxEVT_HEADER_END_REORDER into this event, which was
previously only sent by the macOS version.

GtkTreeView doesn't seem to support column drag-and-drop at all, so this
event is still never generated by wxGTK.

Closes #14297.
2018-02-04 15:45:23 +01:00
Vadim Zeitlin
af78ad3b49 Add wxDataViewCtrlBase::SetAlternateRowColour()
Previously this method was only available in the generic wxDataViewCtrl,
move it to the base class to make it possible calling it in portable
code and document it.

Closes #14617.
2018-02-04 15:27:02 +01:00
Vadim Zeitlin
da4e125db4 Merge branch 'dvc-misc'
Several bug fixes to (mostly generic, but not only) wxDataViewCtrl.

See https://github.com/wxWidgets/wxWidgets/pull/715
2018-02-04 15:11:48 +01:00
Vadim Zeitlin
5b8670f3ca Merge branch 'gtk-combo-focus'
Fix spurious focus loss events for wxGTK comboboxes.

See https://github.com/wxWidgets/wxWidgets/pull/714
2018-02-04 14:52:27 +01:00
Vadim Zeitlin
508a409f7e Suppress focus loss on opening combobox popup in wxGTK
Make GTKHandleFocusOut() virtual and override it in wxChoice in order to
avoid generating wxEVT_KILL_FOCUS events when the combobox dropdown
button is clicked.

This is important because it allows fatal problems when using a
combobox-based in-place editor in wxDataViewCtrl as getting these events
totally broke the UI before.

See #17034.
2018-02-04 14:51:58 +01:00
Vadim Zeitlin
3a16250303 Don't make inert toggle/choice wxDataViewCtrl cell editable in wxOSX
Don't disable all inert renderers as this results in ugly "disabled"
look for some of them (see 6e885992f5),
but do disable the renderers that would be editable otherwise, such as
wxDataViewChoiceRenderer and wxDataViewToggleRenderer, in wxOSX as it
shouldn't be possible to change value of the inert cells.

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

Closes #18056.
2018-02-04 00:35:11 +01:00
Vadim Zeitlin
f7e592b335 Use wxVector for storing wxDataViewTreeStoreNodes
Replace the use of wxList macros with wxVector.

Also make wxDataViewTreeStore::Compare() slightly more efficient by
iterating over the children list only once instead of doing it twice.
2018-02-04 00:14:31 +01:00
Vadim Zeitlin
bb0a2952b1 Replace macros with wxVector<> for wxDataViewModelNotifiers
Don't use deprecated macro-based linked list class, use wxVector<>
instead for m_notifiers.

Also make it private, as it should have been from the beginning.
2018-02-04 00:14:31 +01:00
Vadim Zeitlin
fd73ae1623 Add wxHD_BITMAP_ON_RIGHT style to wxHeaderCtrl
Implement this style for wxMSW to allow putting the column images on the
right side, for consistency with wxMSW wxListCtrl.

See #13350.
2018-02-04 00:14:28 +01:00
mikek
945cec4be1 Refresh generic wxDataViewCtrl after disabling it
Grey the control out immediately, instead of waiting until the next
refresh to do it.

Closes #17887.
2018-02-04 00:14:13 +01:00
Vadim Zeitlin
a995af6029 Merge branch 'render-vert-gauge'
Allow using DrawRender() for vertical gauges too #712.

See https://github.com/wxWidgets/wxWidgets/pull/712
2018-02-04 00:12:26 +01:00
Vadim Zeitlin
1148b2e0fe Make GTKHandleDeferredFocusOut() non-static
Slightly simplify the code by making it a member function.

No real changes.
2018-02-03 23:56:44 +01:00
Vadim Zeitlin
5f8f60107a Allow using wxRendererNative::DrawGauge() for vertical gauges too
It was unexpected that this method could only be used for horizontal
gauges, so make it work for the vertical ones if wxCONTROL_SPECIAL flag
is specified.

Update MSW and generic implementations and the render sample to show a
vertical gauge as well.
2018-02-03 18:46:17 +01:00
Vadim Zeitlin
fa41d06cce Fix some harmless gcc 7 -Wimplicit-fallthrough warnings
Add wxFALLTHROUGH to avoid the warnings where fall-through is actually
desired.
2018-02-03 18:22:45 +01:00