Commit Graph

68114 Commits

Author SHA1 Message Date
Vadim Zeitlin
d6906719f4 Map different email addresses of Rick S to the same person 2020-04-18 00:42:43 +02:00
Rick S
14717af39c Restore wxMenu::Break() functionality in wxMSW
This was broken in da319a87cd (Make wxMSW owner drawn menu item code
more clear and correct., 2014-03-27) for non-owner-drawn menus.

Closes #18692.
2020-04-18 00:42:27 +02:00
Vadim Zeitlin
cfe8c0dea7 Use dotted pens in wxGenericTreeCtrl everywhere
There hopefully isn't any reason preventing us from using dotted pens 20
years after the commit 00e12320ca (Some debug code. Removed flicker form
wxTreeCtrl. Changes.txt update., 1999-12-22) disabling them because they
were "too slow under XFree86" was made.
2020-04-18 00:25:44 +02:00
Anton Triest
e604d01302 Use appropriate system colour for lines in wxGenericTreeCtrl
Native control seems to use wxSYS_COLOUR_GRAYTEXT, so follow it in the
generic one.

Closes #18710.

Co-authored-by: pb101 <pb101@trac.wxwidgets.org>
2020-04-18 00:18:00 +02:00
Vadim Zeitlin
42a756d5fe Merge branches 'auidemo' and 'auibarmsw' of mimi89999/wxWidgets
Improve appearance of disabled AUI buttons

Use wxSYS_COLOUR_GRAYTEXT for the disabled buttons, it works better in
non-default themes.

Also show how a disabled button looks like in the aui sample.

See https://github.com/wxWidgets/wxWidgets/pull/1801

See https://github.com/wxWidgets/wxWidgets/pull/1803
2020-04-17 23:56:54 +02:00
Maarten Bent
4072c0634b Scale all sizers and spacers on a DPI change
Do not only scale the first sizer of a window, but scale all its child
sizers and spacers recursively.

Closes https://github.com/wxWidgets/wxWidgets/pull/1804

See #18649.
2020-04-16 15:07:57 +02:00
Vadim Zeitlin
f1714b3d69 Merge branches 'fix-autoconf-libdir-order' and 'autoconf-avoid-libinotify-freebsd'
Fix issues with FreeBSD build: use just built, instead of already
installed, libraries (this one is not really FreeBSD specific) and use
kqueue even if sys/inotify.h is available but inotify itself isn't (at
least without linking with an extra library).

Closes #18729.
2020-04-16 15:02:12 +02:00
Vadim Zeitlin
e5d03323f9 Rename wxGridBlockCoords::ContainsCell/Block() to just Contains()
These methods do the same thing, so it seems better to use the same name
for them.

This is not really a backwards-incompatible change, as these methods
were just added in the parent commit, so nobody is using them yet.
2020-04-15 18:37:06 +02:00
Vadim Zeitlin
a5a7641616 Merge branch 'grid-selection-refactoring'
Completely overhauled selection handling in wxGrid.

Make various ways of extending selection (using Shift-arrow keys,
Ctrl-Shift-arrows, Shift-click etc) work as expected from the user point
of view instead of producing various bizarre results. Also improve
row/column header click selection as well as Ctrl/Shift-Space handling.

Internally, store selection as just a vector of blocks, independently of
the selection mode, and provide a simple API for iterating over it which
remains usable even with selections containing millions of cells (as
long as they're still composed of only a few blocks, which is the case
in practice).

Add more tests and add display of the current selection to the sample.

See https://github.com/wxWidgets/wxWidgets/pull/1772
2020-04-15 18:10:08 +02:00
Vadim Zeitlin
0fe1146b19 Cache the result of inotify check in configure
Wrap AC_LINK_IFELSE() in AC_CACHE_CHECK() to skip it if the result is
already cached.
2020-04-15 18:04:56 +02:00
Oliver Kiddle
1eaa510c05 Check usability of inotify before selecting it
A libinotify compatibility library exists for BSD systems. If this
was installed, configure would find sys/inotify.h but the build
would fail to link unless the library was added to the link line.
By also checking for inotify_init() this problem can be avoided.

Given that there is native support for kqueue, there is no need
to handle linking with libinotify.
2020-04-15 17:28:09 +02:00
mimi89999
bc886c1e09
Change AUI bar on msw to use wxSYS_COLOUR_GRAYTEXT for disabled buttons 2020-04-15 16:18:44 +02:00
Vadim Zeitlin
44c3e626b3 Extend current selection on {Ctrl,Shift}-Space
Extend the existing selection instead of adding a new block, as there is
no reason to keep the old selection as a separate block, when it's
always a subblock of the new one, and doing it resulted in wrong
behaviour when selecting 2 horizontally adjacent cells, pressing
Ctrl-Space and then pressing Shift-Left deselected the rightmost
selected column but still left its single cell, which was part of the
originally selected block, selected, which was surprising and looked
wrong.
2020-04-15 16:16:00 +02:00
Vadim Zeitlin
ae499c43f1 Don't set focus to unfocusable windows in wxGTK
Restore IsFocusable() check that was commented out, without any real
explanation, by c7bfb76a2c (A number of focus handling improvements:
Left clicking on a window only focuses the window if not processed.
wxControlContainer::SetFocus moved to wxControlContainerBase so that a
container now focuses the first child even on wxGTK. wxAuiBook is now a
container, need for correct navigation on wxGTK., 2007-08-18).

This is needed to avoid giving focus on click to the windows that
explicitly override AcceptsFocus() to return false, as e.g.
wxGridColLabelWindow and other wxGrid subwindow classes do. From the
user point of view, previously clicking on a grid row/column label just
disabled the user of arrow keys, which was very inconvenient (and didn't
happen under MSW).
2020-04-15 16:02:43 +02:00
mimi89999
87171a103a
Add disabled auibar item to auidemo 2020-04-15 14:33:09 +02:00
Vadim Zeitlin
47d881b683 Fix order of -L options in autoconf makefiles
Put linker flags determined by configure after -L$(LIBDIRNAME) option
pointing to the directory containing the libraries being built, to
ensure that we link with these libraries rather than any wx libraries
globally installed in the system, as could be the case since the changes
of ec091c9f2b (Don't override CFLAGS etc in configure-generated
makefile, 2020-02-02).

See #18729.
2020-04-15 02:33:53 +02:00
mimi89999
697bd07441 Change AUI to use system caption text color on all platforms
Don't hardcode black colour, it results in unreadable text when the
theme uses dark background. Note that this was already done under Mac,
but this commit does it under all platforms.

Also improve the contrast of various other colours when using
non-default background, this notably drastically improves readability of
the button labels when using the standard MSW "high contrast" mode.

Closes https://github.com/wxWidgets/wxWidgets/pull/1791
2020-04-15 02:19:25 +02:00
Vadim Zeitlin
fe7de63730 Merge branch 'default-keyword' of git://github.com/MaartenBent/wxWidgets
Remove wxMEMBER_DEFAULT and just "= default" instead.

See https://github.com/wxWidgets/wxWidgets/pull/1794
2020-04-15 02:17:06 +02:00
Konstantin S. Matveyev
4d7000d3d4 Add missing Mac headers to the file list
Add wx/osx/core/dataview.h and wx/osx/core/mimetype.h and reorder the
files alphabetically.

Closes https://github.com/wxWidgets/wxWidgets/pull/1797
2020-04-15 02:15:18 +02:00
Vadim Zeitlin
548d27afd2 Remove unused UNIV_PLATFORM_{SRC,HDR} from build/files too
This should have been part of 2c7924dd2e (Remove the now unused
UNIV_PLATFORM_{SRC,HDR} variables, 2020-03-25) but was forgotten there.
2020-04-15 02:14:16 +02:00
Vadim Zeitlin
51ea80b701 Allow selecting rows/columns in row-or-column selection mode
Don't blankly forbid selecting any blocks at all in this mode, this
didn't really make any sense.

Moreover, SelectBlock() not doing anything prevented wxGrid code
handling {Ctrl,Shift}-Space from doing anything in this mode and, worse,
broke the logic of DeselectBlock() which relied on using SelectBlock()
to select the remaining parts of the selection, so this commit fixes
using Ctrl-click for deselecting rows or columns in this selection mode,
which was previously completely broken.
2020-04-15 00:03:37 +02:00
Vadim Zeitlin
3ebc76eea5 Always explicitly set split orientation in DeselectBlock()
No real changes, just make the code more clear by always explicitly
selecting either wxHORIZONTAL or wxVERTICAL instead of default for the
former for no good reason (by symmetry, it is not a better choice than
wxVERTICAL).

Also list all wxGridSelection enum elements in the switch over selection
mode to avoid warnings about not handling wxGridSelectRows.
2020-04-15 00:01:56 +02:00
Artur Wieczorek
871a7db022 Improve wxPropertyGrid text editor layout under wxOSX
Text editor field can be slightly longer
to be displayed closer to the editor button.
2020-04-14 20:50:31 +02:00
Artur Wieczorek
c34440ffee Fix positioning wxPropertyGrid editor button
Button should be shifted by width, not by height
value.
2020-04-14 20:50:06 +02:00
Vadim Zeitlin
5d90688723 Fix extending selection starting from unselected current cell
Unselected current cell should always be considered as the current
selection block to extend, as it doesn't make sense to extend any other
block (perhaps selected on another side of the grid) when pressing
Shift-arrow.

This scenario could be achieved by selecting a block and Ctrl-clicking a
cell (either inside or outside the selection) twice and then extending
it using Shift-arrow keys. Previously, this behaved in a strange way,
combining the corner of the selected block with the target of the
movement, whereas now this just starts selecting a new block from the
current cell as expected.
2020-04-14 18:51:23 +02:00
Vadim Zeitlin
ddaa5b5e02 Make wxGridSelection::IsInSelection() const
There is really no reason for it not to be.
2020-04-14 18:50:06 +02:00
Vadim Zeitlin
945718ef5f Fix documented return type of wxGridBlockCoords::ContainsBlock()
This should have been part of 791a9e68ae (Rename and simplify
wxGridBlockCoords::ContainsBlock(), 2020-04-05).
2020-04-14 18:07:47 +02:00
Vadim Zeitlin
ed767ed324 Make Ctrl/Shift-Space apply to all cells of the current selection
This provides a convenient way to select multiple lines and is
consistent with the operation of these keys in spreadsheet programs.
2020-04-13 21:59:44 +02:00
Vadim Zeitlin
4cde93cc82 Optimize test for the row/column selection
Use wxGridSelection::IsInSelection() instead of GetSelectedRows/Cols()
which can be much slower as they need to produce an array containing
indices of all the selected rows/columns.
2020-04-13 21:45:54 +02:00
Vadim Zeitlin
ee0b70a3a9 Disable extending selection with Ctrl-drag for rows/columns too
Don't extend the selection if the anchor line is not selected, as this
doesn't work correctly because the entire selection logic supposes the
anchor itself is selected and, moreover, it's not really clear how could
it would otherwise.

This commit does the same thing for rows/columns as the grandparent
commit did to the cells. Unfortunately a somewhat cleaner solution of
the parent commit can't be easily applied to the existing rows/columns
code and it's arguably not worth changing it in depth just for this.
2020-04-13 21:41:40 +02:00
Vadim Zeitlin
e6186f73a6 Implement alternative solution to Ctrl-drag problem
This commit doesn't change the behaviour compared to the previous one,
but provides an alternative implementation of the same goal, which seems
preferable: instead of not extending the selection while Ctrl-dragging,
just don't enter dragging mode, i.e. don't capture the mouse and don't
set m_isDragging to true, if we start it from a previously selected, and
hence currently deselected, cell.
2020-04-13 21:33:55 +02:00
Artur Wieczorek
eec0fd271f Don't display cell image if wxPGProperty image exists 2020-04-13 19:47:54 +02:00
Artur Wieczorek
799f245149 Delete cached wxImageFileProperty bitmap if required size changed
Rescaled bitmap should be cached as long as the required size remains
unchanged.
2020-04-13 19:47:50 +02:00
Artur Wieczorek
f31b9b27f4 Rescale wxPGProperty bitmap while drawing
Property bitmap should be stored in its original size and rescaling
to the required size should be done only while drawing the property.
This way bitmap size will always fit to the actual wxPG line height.
2020-04-13 19:47:47 +02:00
Artur Wieczorek
b039ff1822 Adjust bitmap size to the wxPropertyGrid cell size
Bitmap inserted into the wxPG cell should be automatically rescaled while
drawing to let us using bitmaps of any size.
2020-04-13 19:47:37 +02:00
Maarten Bent
9039340da9 Revert default-member changes, only keep and use wxHAS_MEMBER_DEFAULT 2020-04-13 19:44:04 +02:00
Artur Wieczorek
1a3dc3fae6 Avoid using negative button height 2020-04-13 19:25:27 +02:00
Artur Wieczorek
f4ded62bc4 Implement wxBitmapButon without inner border as wxPG editor button under wxGTK
Editor buttons with reduced padding will let us to display slightly bigger
bitmaps.
2020-04-13 19:25:13 +02:00
Artur Wieczorek
c1bb80987f Improve implementation of wxBU_EXACTFIT style for wxButton under wxGTK2
We can reduce padding to make the button smaller and more adjusted
to the contents size.
2020-04-13 19:23:27 +02:00
Vadim Zeitlin
52d1b86bbd Don't allow drag-extending selection from deselected cell
Dragging in a grid with Ctrl key pressed starting from a previously
selected cell behaved very counterintuitively if not downright wrongly,
as the selection logic assumes that the selection anchor itself is
always selected, which wasn't true in this case.

Solve the problem by just not extending the selection at all when
starting to drag from a deselected cell. This means that Ctrl-dragging
doesn't do anything any more, but it's not a huge loss and to make it
work well while still allowing to use Ctrl-click to toggle the cell
selection, we'd need to implement a whole new and different
drag-deselect mode, as is done in Microsoft Excel 2016 (note that the
previous versions of Excel don't implement Ctrl-dragging neither).
2020-04-13 18:46:54 +02:00
Vadim Zeitlin
6d4df74a03 Simplify and improve wxGrid::DoGridCellDrag() return value logic
Remove the "performDefault" variable which didn't really seem to help,
as the actual meaning of the return value is whether we should start
drag-selecting or not and the name of this variable didn't reflect this
anyhow.

Return false if we are over an invalid cell: this shouldn't change
anything when we're already dragging, but would prevent us from starting
to drag from an invalid cell which seems more correct, even if it's not
clear if this can happen in practice.

Also move hiding the edit control inside "isFirstDrag" check, there is
no reason to do it on every drag.
2020-04-13 18:37:47 +02:00
Vadim Zeitlin
abd9aaa431 Stop setting current cell on first Ctrl-drag event
This is not necessary any longer as the current cell is changed on
Ctrl-click since the previous commit.

This commit is best viewed ignoring whitespace.
2020-04-13 17:53:41 +02:00
Vadim Zeitlin
39d0c21a81 Do make Ctrl-clicked cell current
There isn't really any valid reason to ever set the current cell to the
corner of a block remaining after breaking up the currently selected
block after the deselection of the just clicked cell, so don't do it.

Just set the current cell to the clicked cell, whether it's selected or
not.
2020-04-13 17:48:15 +02:00
Maarten Bent
1448b210b8 Use macros to define default copy constructor and assignment operator 2020-04-13 17:46:32 +02:00
PB
56915f30ae Fix broken non-Unicode MSW build
Add a missing parenthesis in a non-Unicode StartDoc() definition which
was forgotten in 948ddc6e0f (Eliminate -Wcast-qual warnings with GCC and
Clang, 2020-02-02).

Closes https://github.com/wxWidgets/wxWidgets/pull/1795
2020-04-13 16:41:33 +02:00
Vadim Zeitlin
da84a25311 Make the line whose header was Ctrl-clicked current
This is more consistent with Ctrl-clicking cells.

It also slightly improves behaviour when Ctrl-dragging mouse over the
range of selected lines, although it's still somewhat surprising.
2020-04-13 14:47:44 +02:00
Vadim Zeitlin
62cb90b455 Avoid horizontal scrolling when pressing Shift-Page Up/Down
Scroll the new end of selection into view only vertically, it would be
unexpected for the vertical Page Up/Down movement to scroll the grid
horizontally.
2020-04-13 14:21:07 +02:00
Vadim Zeitlin
033f006722 Refresh the grid correctly when the selection mode changes
Update the cells that had to be deselected due to the selection mode
change.

This used to work, but the refresh was lost during a previous
refactoring.
2020-04-13 14:18:11 +02:00
Vadim Zeitlin
ba2772b810 Disallow shrinking rows/columns in row-or-column selection mode
Fix the check for disallowing changing block rows/columns to take into
account the row-or-column selection mode too.
2020-04-13 01:50:44 +02:00
Vadim Zeitlin
b8c3c60316 Allow extending selection using Shift-Page Up/Down keys
Also make Page Up/Down themselves work consistently with the other
cursor movement keys and clear current selection if they move the
cursor.

Even though DoMoveCursorByPage() is simpler than DoMoveCursorByBlock(),
still factor out AdvanceByPage() for consistency with AdvanceByBlock()
and because it still makes the code more clear.
2020-04-13 01:23:25 +02:00