gtk_settings_set_long_property() is no longer available. The properties
"gtk-enable-tooltips" and "gtk-tooltip-timeout" are ignored since GTK+
3.10, so just don't compile that code with GTK+4.
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.
This reverts commit 41f6f17d01 ("return 0
(meaning the file is not seekable, as the docs now explain) instead of
4KB for the files in sysfs under Linux") as it seems to be wrong to
return a value different from what "ls -l" or "stat" return here and the
original problem was solved in a better way in the previous commit.
See #9965.
Closes#17818.
There is nothing special about wxTextFile justifying having code for
dealing with non-seekable files in it, so put this code into wxFile
itself and just call its ReadAll() method from here.
This is a better fix than 41f6f17d01
originally applied (and which is going to be reverted next) as it
doesn't break wxFile::Length() for these files and also avoids
triggering an assert if the file we're trying to read was truncated by
another process in the meanwhile -- which can happen and doesn't
indicate a programming error and so shouldn't result in an assert.
Also add a unit test checking that this really works.
See #3802, #8354, #9965.
Calling this function with an unseekable file, such as any file under
/sys on Linux systems, would previously just hang as the loop condition
was never satisfied when length was -1.
Fix this by checking for this case and using a different approach by
extending the buffer we read the data into as we go instead of
preallocating it all at once.
See #9965.
If the event handler destroys the wxWindow, then the subsequent call to SetupCursor(event) will miserably fail .
Moved setting the cursor before the event is handled.
This requires slightly more work, but ensures that we don't leave any
traces of running the tests in the system registry or file system, as we
can just call DeleteAll() on the config object after finishing with it.
It seems better to organize the tests in different files and just
provide a common fixture-like class to reuse functionality.
Also use this as an opportunity to rewrite the tests to use Catch
directly instead of using CppUnit-compatible macros.
Finally, actually build these tests as part of the test suite.
GtkStock names are used for GTK+2, theme names for GTK+3 and later.
Theme replacements for stock items are those used by GTK+, from
gtk+-3.22.26/gtk/deprecated/gtkiconfactory.c. The list is as it was
prior to 4862884e, with no additions, deletions or other changes.
This could be unexpected as it seems reasonable that the model won't be
ever asked about the value of a cell if it's not going to appear in it
anyhow -- however it could still happen during the column width
computation in the generic wxDataViewCtrl implementation.
Fix this in a minimally invasive way by just skipping the call to
GetValue() in this case.
Don't use gtk_tree_view_set_rules_hint() in GTK+4, it's not available.
It is also deprecated in GTK+3 since 3.14, and the documentation advises
to not use it at all, but I will leave the decision about whether to
remove it entirely to someone else.
Support the GTK+4 API for adding buttons to dialogs (via __WXGTK4__):
- set_icon_name() instead of image_new_from_stock()/set_image()
- gtk_box_pack_end() takes only two parameters
GTK+3 deprecates GTK_STOCK_CANCEL and GTK_STOCK_SAVE etc. and GTK+4
removes them entirely. The API documentation recommends using the
strings "Cancel" and "Save" instead, use them (or the appropriate
translation.)
In GTK+4 gtk_init_check() takes no arguments, while in GTK+3 you could
pass argc/argv.
I'm not quite sure how to pass any arguments to GTK+4, so just call
gtk_init_check() in GTK+4.
GTK+4 does not support the gdk_screen_get_monitor_scale_factor() API
(since gdk has become more backend independent.)
Use gtk_widget_get_scale_factor() API instead on the app top window.
TODO: This does not solve the multi-monitor problem, for that it would
be necessary to use the scale factor of the widget on which the action
is being peformed.
Add autoconf and bakefile support for detecting and using GTK+4, similar
to how GTK+3 is detected and used.
GTK+3 is checked for first before GTK+4, this can be overridden in
`./configure` using `--with-gtk=4`.
With GTK+4 the `__WXGTK4__` `#define` is also set in `setup.h.in`.
This commit does not regenerate any files.
Apparently, in some situations the left edge of the first tab is not
drawn when it's not selected under Windows 10. While it doesn't seem to
affect all the systems (and couldn't be reproduced here), drawing the
left edge explicitly shouldn't do any harm and should fix the problem
for the systems that are affected by it, so just do it always.
Closes#17714.
With larger fonts, there is an excessive gap between the box and the first (and last) radio button.
Instead of using the dynamic character size, use the fixed size of the radio button to determine this height.