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.
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.
Trying to give all the remaining space after allocating enough to the
other columns to the first one doesn't work well with wxDataViewCtrl,
which tries to do the same thing, but with the last column, so we
actually get some strange mix of behaviours, with both the first and
last columns changing size after the control itself is resized.
Stop fighting with wxDataViewCtrl and just let it to its own thing.
Closes#17476.
Reduce the number of calls to GetLineStart() in generic wxDataViewCtrl
code and thus slightly improve its performance when variable line height
is used.
See https://github.com/wxWidgets/wxWidgets/pull/438
Declare the variables just before using them (and also initialize them
at the same time); use more readable variable names; fix braces style
and add a comment explaining why do we do all this in the first place.
No real changes.