Since Apple clang version 12 implicit function declarations by default
are (rightfully) an error resulting in failure to compile the configure
tests for libpng and zlib, which make implicit use of exit.
Fix by using return statements (another solution is including stdlib.h).
Slightly improve the maximum column width calculator by rounding up
the (non-integer) width of cells using ceil() instead of adding 1
unconditionally.
See #19003.
Adjust autosizing columns of wxDataViewCtrl when items are expanded
or collapsed through the UI as well.
Complements commit e89e76bb82.
See #14939.
See #19003.
Refactor common code and also for upcoming accessibility from
wxCocoaOutlineView.
Part of #19003.
Co-Authored-By: Dimitri Schoolwerth <dimitri@schoolwerth.com>
This provides the same information as wxGetCpuArchitectureName(), but is
consistent with the other wxPlatformInfo accessors, which also
correspond to the existing wxGetXXX() functions, and makes it more
convenient to use this information in the application code as now
everything is available via wxPlatformInfo instead of having to use
different functions for different pieces.
Calling SystemParametersInfoForDpi() with LOGFONTA parameter corrupted
the stack because this function only accepts LOGFONTW, i.e. it wrote
twice as much data into the provided buffer as the caller expected.
This could be fixed by allocating a temporary wide buffer and converting
back, but this doesn't seem to be worth it, so just disable the use of
the DPI-specific function in the ANSI build.
Closes#19002.
This results in various problems, including both the problems with
handling keyboard input (see #16840) and, even less expectedly,
graphical issues with flickering (see #18462).
Fixing or working around these issues doesn't seem to be easily
possible, but we can at least warn people about the problem.
Closes https://github.com/wxWidgets/wxWidgets/pull/2138
Add the #pragma to link with shlwapi in the same object file which uses
this function, as even though the same pragma was already present in
other files, they could be completely discarded by the linker resulting
in link errors about unresolved StrCmpLogicalW() later.
Also move the MinGW-specific function declaration to the top of the
file, near the inclusion of the header which would normally declare it.
The rect offset was correctly changed in 04a7a3f150 (Fix drawing outside
of the splitter sash under macOS, 2020-12-05), but its size was not. Fix
it too now.
See #18861.
As we don't use any special value for the inactive caption background,
use the same value as for normal caption text for inactive caption text
too.
This is almost certainly not ideal, but at least allows the tab labels
to be readable.
Closes#18988.
This should have been done together with the changes of 41410610ef
(Don't force wxPU_CONTAINS_CONTROLS on wxPopupTransientWindow,
2020-07-10) as without this style controls inside wxComboPopup couldn't
accept focus any more, which broke the previously working code.
There is no need to check if the control is a wxComboBox if it turns out
to already be a wxTextCtrl.
No real changes, just a micro-optimization and simplification.
To fix the problem with GetValue() not returning the updated value from
the event handlers, just set the new value forcefully ourselves before
generating the event rather than postponing sending the event.
This makes the event order under Mac consistent with those elsewhere,
i.e. wxEVT_COMBOBOX_CLOSEUP is now received after wxEVT_COMBOBOX there
too, and not before, as without this change.
See #18973.
In particular, don't map them to left mouse clicks because this is
really wrong.
Ideal would be to handle them in some way, but for now just throwing
them away is better than generating wrong events.
Closes#18967.
We need to adjust the indices of the currently selected items as we need
to keep the same items, not the same indices, selected after new items
insertion.
Closes#18902.
This seems to have been needed in the past (see #12365), but is not
needed any more and results in unexpectedly scrolling down to the last
inserted item, which is undesirable and inconsistent with the other
platforms.
Simply revert f58438058b (Show the first, not the last, inserted item in
wxListBox in wxOSX., 2010-11-05) to fix this.
Closes#18861.
Update the width when items are expanded and collapsed and also take the
expander width into account.
Change m_ModelNotifier type to avoid casts when calling wxOSX-specific
method on it.
Closes#14939.
Co-Authored-By: Vadim Zeitlin <vadim@wxwidgets.org>
This didn't work any more since IsShown() returned true even for
iconized windows, so we never did anything if all windows (and, in
particular, the only window) were (was) iconized.
Fix this by checking for IsIconized() first and IsShown() only if it
returns false because it seems that IsShown() is indeed supposed to
return true for iconized windows -- at least it also does it in wxMSW.
Closes#18998.
Co-Authored-By: Vadim Zeitlin <vadim@wxwidgets.org>
Add the usual handlers for '-', '+' and '*' keys. The last one is
especially convenient, as it does something that couldn't be easily done
at all interactively before.
This convenient method allows to expand all children of the item
recursively.
This is directly supported by both native implementations, so it makes
sense to have this in wxDataViewCtrl itself, even if it could be also
(less efficiently) implemented in the user code.
This code doesn't work (and probably doesn't compile) anyhow, but at
least try to do the right thing in it and override DoExpand() instead of
adding a virtual Expand() hiding the non-virtual version in the base
class.