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.
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.
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
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.
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.
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.
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).
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.
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.
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.
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
Allow to keep the originally defined transparent pixels colour instead
of replacing it with bright pink (which is still the default behaviour).
Closes#18014.
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.
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
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.
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.
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.
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.
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.
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.
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.
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/707Closes#18056.
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.
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.
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.