Don't assume that all Vista and later systems support DTM_GETIDEALSIZE,
this is not the case under Wine even when it's emulating a Vista+
Windows version and trusting DTM_GETIDEALSIZE to always return the right
value resulted in these controls having 0 size and not being shown at
all when running wxWidgets programs under Wine.
See https://bugs.winehq.org/show_bug.cgi?id=44680
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 completes changes of 0873abb836 which
replaced manual layout code with sizers, but broke layout after
recreating the control in the process.
This change notably fixes the control becoming invisible, due to having
the default too small size, in non-report modes.
Clearing this style by calling SetWindowStyleFlag() could reset
WS_EX_CONTROLPARENT extended flags bit, breaking the invariant that the
parent of any window with this bit set has it as well and resulting in
hangs due to infinite loops inside Windows own code iterating over the
controls.
Prevent this from happening by always preserving this style bit if it
was previously set in MSWUpdateStyle(). This is a bit ugly, but there
doesn't seem to be any obviously better way to do it.
Closes#18091.
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
Buildbot configuration was redone in pure Python (see master.cfg in
https://github.com/wxWidgets/buildbot repository) since several years
already, there is no need to keep these obsolete files.
This sample shows usage of wxArchiveStream and wxArchiveFactory.
It also allows for easy testing of wxArchiveStream implementations
outside of the unit tests.
See https://github.com/wxWidgets/wxWidgets/pull/730
@code tag must be used to make the code readable and using @example
seems to be unnecessary and just results in the creation of an extra
"Examples" page in the documentation containing only this example and an
absolute path (apparently not affected by STRIP_FROM_PATH) to
interface/wx/dataview.h file itself in the generated documentation.
Using @subpage multiple times with the pages we wanted to just link to
resulted in them appearing twice in the tree shown in the CHM file.
Just use @ref when a link is wanted instead.
This seems better than requiring yet another environment variable to be
defined, and should work reliably as Doxygen is always run from
docs/doxygen directory.
Leave WXWIDGETS in STRIP_FROM_INC_PATH which doesn't seem to be used
anywhere anyhow -- and so, perhaps, should be removed entirely?
When not using double buffering, double-clicking to select text in the
control results in crashes.
Avoid this by using double-buffering under Mac, even though it shouldn't
be necessary.
This reverts the changes of cb799483b7
under Mac.
See #18085.
This notably fixes the use of TAB in wxStyledTextCtrl, where it's
supposed to be handled by the control itself and not as a navigation
key, but is more general than this.
Fixes a regression from 8bca6deda3.
Closes#17999.
Don't overwrite the current window style with the style that it had when
AutoComplete() was called in wxGTK code, just turn wxTE_PROCESS_ENTER
off or on, without touching the other bits.
This still can result in setting wxTE_PROCESS_ENTER bit itself
unexpectedly if it somehow is changed while the completion popup is
shown, but this shouldn't happen often (if ever) in practice and, at
least, the other bits are preserved no matter what.
See https://github.com/wxWidgets/wxWidgets/pull/729
Recent changes resulted in crashes when handling grab-notify signal in
an already deleted object.
Fix this by disconnecting our grab-notify handler when destroying the
object, unless the entire associated wxTextEntry is being destroyed (in
which case no such signals risk to be generated anyhow).
In order to be able to do this safely, store the widget to whose signal
we had connected and check that the widget is still valid before
disconnecting. This also allows to simplify the code by getting rid of
DisableCompletion() and just doing the cleanup in dtor.
Closes#18084.
This prevented them from being used for their usual purposes, e.g. F4
didn't open the combobox dropdown under MSW, which was annoying as it
made testing more difficult.
Just stop using the accelerators, especially as they could be only used
for less than half of pages anyhow.
Custom auto-completers didn't work for wxComboBox as it didn't generate
wxEVT_AFTER_CHAR event that the completion code in wxTextEntry relies on
to make them work.
Add this event generation to wxComboBox::MSWProcessEditMsg() to fix
this.
Closes https://github.com/wxWidgets/wxWidgets/pull/732
No real changes, just avoid calling ShouldForwardFromEditToCombo() in
MSWProcessEditMsg() because this function is only called when the
message should be forwarded.
Also make the comment about the return value more clear.