It's unexpected that decreasing the width of the control makes the last
column diminish in size until nothing (at least if it's minimum size was
not set), instead of showing horizontal scrollbar, so prevent this from
happening by considering the initial column width as being "manually
set", which prevents the code from making the column narrower than it
automatically.
This seems to make sense and is consistent with the handling of initial
size, which becomes "best", and hence "minimal", size of the control,
for wxWindow.
Closes#18343.
DoGetBestSize() actually calculated the best client size and not the
full size, as it didn't take the pane border into account.
Fix this in the simplest possible way, by just renaming the function to
DoGetBestClientSize() instead.
This ensures that the pane is actually big enough to show its contents,
without cutting off the text shown in its header.
Closes#18515.
In the function wxMask::OSXCreate() to create a mask image, data copying
from the supplied memory buffer was not actually implemented and therefore
created mask was invalid.
Closes#18513.
Fix the row heights after a DPI change and adjust the column widths.
Use DPIChangedEvent instead of MSWUpdateFontOnDPIChange because the child
controls (m_clientArea, m_headerArea) need to update their font sizes first.
These control are drawn using a wxDC. When the DPI changes, call SetFont
to update the font of the wxDC. First call wxListBoxBase::SetFont() so
m_font is updated to the new DPI, then use this font in the wxDC.
For wxCheckListBox update the margins to fit the changed checkbox size.
The control seems to somehow react to DPI changes on its own (which is
rather mysterious as we don't forward WM_DPICHANGED to it, so it's not
really clear how does it do it, but it does) and changing its font is
worse than useless, as it's not just redundant, but also resets all the
styles used inside the control and so is really undesirable.
Hence override the just added MSWUpdateFontOnDPIChange() to do nothing
for rich edit controls, while still updating the font for the plain EDIT
ones (which is required as they don't scale correctly on their own).
Fix position of spin control in wxSpinCtrlDouble after DPI change
The old size of the control was used to determine the position. Use GetBestSize
instead, which will return the correct size.
Some native dialogs do not scale correctly (color picker, font picker,
open file with custom controls). ALl other native dialogs do scale correctly
(open file, open directory, find replace, print).
Change the DPI Awareness Context temporarily to SystemAware, so Windows handles
the scaling.
The previous commit fixed accelerators support in wxQt for the items
created in XRC, but not for those created directly in the code, as
wxMenuItem::SetItemLabel() is not called in this case.
Refactor the code to extract UpdateShortcutsFromLabel() from
SetItemLabel() and call the new function both from there and from
wxMenuItem ctor, to ensure that the accelerators are taken into account
in any case.
This commit is best viewed with "git diff --color-moved".
See https://github.com/wxWidgets/wxWidgets/pull/1544
Doing this under all platforms results in too many false positives,
which can't be avoided currently, e.g. even if an application uses "Tab"
as an accelerator only under MSW, these messages still appear (in debug
builds, but this is more than sufficient for them to be annoying).
For now, restrict the messages to wxGTK only. In the future we could
revert to giving them under all platforms if we provide some way of
disabling them, e.g. qualifying accelerators with "[port]" or "[!port]"
string before them.
This partially reverts 6596f5a98d, see
https://github.com/wxWidgets/wxWidgets/pull/1505
Closes https://github.com/wxWidgets/wxWidgets/pull/1566
Override DoEnable() in wxGrid instead of Enable() to ensure that the
grid is shown appropriately for its current state whenever either it or
its parent is disabled.
Note that this also fixes the bug with only the main grid window being
refreshed, but not the row/column headers, which also need to be.
These events use a different convention from all the other ones in Qt
and need to be ignored, rather than accepted, to prevent the default
action from occurring.
And these events are also sent to disabled windows, which are never
supposed to receive them in wx API.
Closes https://github.com/wxWidgets/wxWidgets/pull/1371
Under wxGTK+2 bitmap data with mask and without it (raw) should be stored
in the separate GdkPixbuf buffers - just like it's done in wxGTK+3. These
two buffers are necessary because only GdkPixbuf with raw bitmap data
(original, non-masked) should be copied when wxBitmapRefData instance is
cloned e.g. in SetMask(). GdkPixbuf with masked data is not copied and is
created on first use in wxBitmap::GetPixbuf().
Closes#18508.
See #18498.
This makes it possible to get the appropriate column width from outside
the class, as GetColumn() itself is currently protected and so the
existing overload couldn't easily used.
Add wxGrid::DisableHidingColumns() method which can be used to prevent
wxHeaderCtrl from allowing the user to hide columns interactively, which
is something it allows to do by default, unlike the "built-in" wxGrid
header.
Also add EnableHidingColumns() and CanHideColumns() for consistency with
the other similar methods.
Closes https://github.com/wxWidgets/wxWidgets/pull/1554
For 32 bpp wxBitmap with both alpha channel and mask we have to apply mask on our own while drawing the bitmap because MaskBlt() API doesn't work properly with 32 bpp RGBA bitmaps. To do so we need to create a temporary bitmap with copy of original RGB data and with alpha channel being a superposition of the original alpha values and the mask.
See #18498.
Having 2 different overloads might have been useful for Carbon
implementation, but as they do exactly the same thing in the Cocoa
version, leave only one of them -- and don't pass it the item, or items,
being deleted as they're not used anyhow.
No real changes.
This notably allows to support wxLC_VIRTUAL style.
Also implement support for checkboxes, improve in-place editing and
implement many other methods and missing functionality (e.g. send the
expected events now).
Closes https://github.com/wxWidgets/wxWidgets/pull/1229
Avoid calling wxGrid::SetCurrentCell(0, 0) when the grid has no columns
or rows, as it doesn't have any cells then and doing this logically
fails the precondition assert in GetColPos().
Also refactor all 6 different snippets calling SetCurrentCell() in
Redimension() into a single function to simplify the code and make it
more maintainable.
Add a unit test verifying that this works as intended.
Closes https://github.com/wxWidgets/wxWidgets/pull/1546
This allows calling the base class version from the derived classes and
also, at least as importantly, make sure that the function is actually
documented as private functions are not extracted by Doxygen by default.
Closes#16749.
Closes https://github.com/wxWidgets/wxWidgets/pull/1543
Calling wxGrid::{Insert,Delete}{Rows,Cols}() from wxEVT_GRID_CELL_CHANGE
event handler resulted in infinite recursion because it tried to hide
the grid editor control again, which resulted in another CELL_CHANGE
event being generated and so on.
Break this infinite recursion in the usual way, i.e. by updating the
state of wxGrid before invoking the user-defined event handler.
This required separating SaveEditControlValue() in 2 functions, the main
one retaining IsCellEditControlEnabled() check for compatibility, and
the new DoSaveEditControlValue() that can be called even after disabling
the editor.
Closes#2287.
Closes https://github.com/wxWidgets/wxWidgets/pull/1540
Since the changes of 04f7f1fd32 (frozen
rows/columns implementation), RefreshBlock() could call GetColPos() with
an invalid index. This didn't matter most of the time as the function
simply returned the same index as long as the columns were using their
natural order, but resulted in a crash due to an out of bound access to
m_colAt array as soon as they were reordered.
Fix this by avoiding using invalid indices in RefreshBlock() and, more
generally, improving its precondition check and making the assumptions
about the input parameters more clear. Also add a defensive check to
GetColPos() itself.
Finally, add a unit test exercising this code.
Closes https://github.com/wxWidgets/wxWidgets/pull/1536
Add UpdateText() and UpdateLabel() updating the text (i.e. possibly
containing markup) or the label (just plain text) shown in the window.
Closes#14743.
Closes https://github.com/Kvaz1r/wxWidgets.git BusyInfoUpdateText14743