Commit Graph

67564 Commits

Author SHA1 Message Date
Vadim Zeitlin
f13085441c Add wxGridFitMode and functions working with it
Replace "bool overflow" flag with a class allowing to specify the same
overflow/clipping behaviour currently, but also allowing to extend it,
notable to add ellipsization support, in the future.

Preserve the existing API by reimplementing it in terms of the new one.

Also update the same to demonstrate a cell which always overflows,
independently of the default cell behaviour.
2020-01-11 18:02:12 +01:00
Vadim Zeitlin
325408f062 Make wxGridCellAttr ctor taking a single argument explicit
There doesn't seem to be any reason for allowing to implicitly convert
wxGridCellAttr pointer to wxGridCellAttr object.
2020-01-11 14:05:09 +01:00
Vadim Zeitlin
59111e0d11 Suppress warnings due to use of deprecated WebKit functions
This is not the best solution, but getting dozens of lines of warnings
when compiling this file is not great neither and there doesn't seem to
be anything else to do about this.
2020-01-10 19:20:26 +01:00
Lauri Nurmi
09e0b3927b Fix building tests when configured with --disable-log
Add missing wxUSE_LOG checks to wxTextCtrl test and disable wxLog test
entirely when wxUSE_LOG==0.

Closes https://github.com/wxWidgets/wxWidgets/pull/1703
2020-01-10 16:38:41 +01:00
Igor Korot
b8d689422f Check item index in wxListCtrl::GetItemState() in wxMSW too
This was already the case in the generic version, but wxMSW one just
silently returned 0 for invalid item index.

Make it consistent with the other platforms and SetItemState() by
checking the index in it too.

Closes https://github.com/wxWidgets/wxWidgets/pull/1702
2020-01-10 16:36:12 +01:00
Ian McInerney
64ac20536a Remove event macros expansions from the documentation
The expansions do not really add anything to the documentation
page, and can be confusing at first.

Closes https://github.com/wxWidgets/wxWidgets/pull/1701
2020-01-10 16:30:20 +01:00
Vadim Zeitlin
7dd0ad9a0d Merge branch 'composite-contextmenu-event'
Fix event object and ID of wxEVT_CONTEXT_MENU sent from parts of a
composite control.

See https://github.com/wxWidgets/wxWidgets/pull/1698
2020-01-09 23:27:17 +01:00
Vadim Zeitlin
e3eb05df72 Skip not handled mouse events in wxGrid code
Unhandled mouse events should be skipped. Otherwise wxEVT_CONTEXT_MENU
event couldn't be generated by right clicking anywhere inside wxGrid and
could be only generated for the main grid part (but not the labels) by
pressing Shift-F10 under MSW.

Closes https://github.com/wxWidgets/wxWidgets/pull/1697
2020-01-09 23:26:46 +01:00
Vadim Zeitlin
52ae67ef86 Replace dynamic casts with virtual wxWindow::WXGetTextEntry()
Instead of checking for all text-like controls one by one in
wxCommandEvent::GetString(), call a virtual function checking for this.

This is simpler, less error-prone and faster -- at the cost of
increasing the vtbl size of all wxWindow-derived classes.

Closes https://github.com/wxWidgets/wxWidgets/pull/1696
2020-01-09 23:25:49 +01:00
Mitrik Sicilian
20ecab6268 Remove redundant const from Mac wxDataFormat methods return type
No real changes, but useless top-level const in the return type resulted
in -Wignored-qualifiers warning (if it was enabled).

Closes #18646.
2020-01-09 22:43:12 +01:00
Vadim Zeitlin
db5cf010d7 Improve wxLIST_STATE_DONTCARE documentation
Don't say that it's MSW-specific because it's just a symbolic name for
0, and is used under all platforms if no other flags are set.
2020-01-09 16:28:00 +01:00
Ian McInerney
9b974b5dd1 Fix error in OSX dataview attribute setting
Fix saving background colour of the cell before changing it.

Closes https://github.com/wxWidgets/wxWidgets/pull/1699
2020-01-09 04:04:13 +01:00
Vadim Zeitlin
9ec0511924 Add a test of catching wxEVT_CONTEXT_MENU to the grid sample
Verify that these events are seen as coming from the grid itself after
the changes of the previous commit.
2020-01-07 18:22:09 +01:00
Vadim Zeitlin
52416931a4 Send wxEVT_CONTEXT_MENU to the main window of composite controls
This is important to allow catching the context menu events from the
composite control children at the main window level using the main
window ID: previously, these events used the (typically auto-generated
internally) ID of the child window, which was an implementation detail
and prevented the code binding to these events using the ID of e.g.
wxListCtrl itself from working under the other platforms, where
wxListCtrl is a generic composite window, even if it worked under MSW,
where wxListCtrl is native.
2020-01-07 18:22:09 +01:00
Vadim Zeitlin
3a09975465 Create WXSendContextMenuEvent() helper function
Put common code from all the different ports into it.

This is not very useful right now, but it will allow to change this
function once, instead of applying the same change to all ports, in the
upcoming commit.
2020-01-07 18:22:09 +01:00
Steve Browne
bb14c5f69b Preserve mask when copying wxBitmapRefData to avoid crashes
This crash was introduced in 2d15218c9d
and could happens inside wxBitmap::MSWBlendMaskWithAlpha() because the
code checked for a mask and alpha, but the mask could be lost after
AllocExclusive().

In practice, this happened e.g. when using 16-bit color as is the case
for Windows 7 Hyper-V VMs.

Closes https://github.com/wxWidgets/wxWidgets/pull/1695
2020-01-07 16:56:50 +01:00
Vadim Zeitlin
d52331046c Merge branch 'gtk-srchctrl'
Add native wxSearchCtrl implementation for wxGTK.

Closes https://github.com/wxWidgets/wxWidgets/pull/1688
2020-01-07 03:22:52 +01:00
Vadim Zeitlin
b2ab6c99e4 Fix wxCommandEvent::GetString() for wxSearchCtrl events
wxEVT_TEXT events generated by native wxSearchCtrl implementations
always returned an empty string, as wxSearchCtrl was not recognized by
the special hack inside wxCommandEvent::GetString() which retrieved the
text on demand.

Fix this by adding yet another special case for this. This is not ideal,
but should do for now.
2020-01-07 03:22:39 +01:00
Vadim Zeitlin
826cc882dc Merge branch 'gtk-srchctrl'
Add native wxSearchCtrl implementation for wxGTK.

Closes https://github.com/wxWidgets/wxWidgets/pull/1688
2020-01-07 03:16:02 +01:00
Vadim Zeitlin
2635360f3c Mention GTK native version in wxSearchCtrl documentation
Document some of the (minor) limitations of the native implementation as
well as its existence itself.
2020-01-07 03:15:39 +01:00
Vadim Zeitlin
d62b79a11b Fix wxCommandEvent::GetString() for wxSearchCtrl events
wxEVT_TEXT events generated by native wxSearchCtrl implementations
always returned an empty string, as wxSearchCtrl was not recognized by
the special hack inside wxCommandEvent::GetString() which retrieved the
text on demand.

Fix this by adding yet another special case for this. This is not ideal,
but should do for now.
2020-01-07 03:15:39 +01:00
ali kettab
c904e27376 Update widgets sample 2020-01-07 03:15:39 +01:00
ali kettab
020b6ebcb8 Derive from wxTextEntry instead of wxTextCtrlBase 2020-01-07 03:15:39 +01:00
AliKet
c09db9c23d Add native wxSearchCtrl for GTK+ port 2020-01-07 03:15:35 +01:00
PB
1b93041d6e Improve wxRegKey documentation
Expand the class description.

Fix and improve the code example.

Closes https://github.com/wxWidgets/wxWidgets/pull/1693
2020-01-07 02:39:33 +01:00
PB
53df59a14a Add wxTrac-related instruction to how-to-release.md
Note that the version for the next release must be
increased in wxTrac example queries.

Closes https://github.com/wxWidgets/wxWidgets/pull/1692
2020-01-06 01:05:39 +01:00
Kvaz1r
a23b3783b6 Add precondition checks to operations in the listctrl sample
Avoid showing assert failures in debug builds if a menu item not
applicable in the current state is selected and just show an error
instead.

Closes #18572.

Closes https://github.com/wxWidgets/wxWidgets/pull/1694
2020-01-06 00:47:26 +01:00
Vadim Zeitlin
89be9ac316 Fix comment for wxUSE_NATIVE_DATAVIEWCTRL in setup.h
The values of the option in the comment were inversed when it was added
in 028afa194a, fix this now.
2020-01-03 18:05:02 +01:00
Paul Cornett
833ae03c6a Draw bitmap in disabled state when wxStaticBitmap control is not enabled on GTK3
See #18638
2019-12-29 09:14:08 -08:00
Paul Cornett
8db62d179c Move code for creating a disabled bitmap to wxBitmap
To allow using it from multiple places
2019-12-29 09:08:40 -08:00
Vadim Zeitlin
dda052d38a Fix activation loss when hiding floating frame TLW in wxMSW
Generalize the fix of d6fb86a81c and
explicitly activate the parent when a TLW with wxFRAME_FLOAT_ON_PARENT
style is hidden or minimized and not only when it is destroyed.

Closes #18535.
2019-12-29 16:47:49 +01:00
Ian McInerney
577faedb65 Fix docs for wxDEPRECATED_MSG macro
Add the missing macro definition.

Closes https://github.com/wxWidgets/wxWidgets/pull/1689
2019-12-29 15:37:13 +01:00
Vadim Zeitlin
8b90073c83 Send kill focus events to modal dialogs earlier in wxGTK
Ensure that the dialog is still alive when it gets the kill focus event
for its child which had focus just before the dialog was closed (or any
other events generated by this child when it detects that it's losing
focus, such as wxEVT_SPINCTRL) by resetting focus when the dialog is
being hidden and not when it's being destroyed.

This makes the events order more consistent with wxMSW but also, most
importantly, safer, as wxEVT_KILL_FOCUS handlers could previously easily
reference the fields of an already half-destroyed wxDialog-derived
object by the time they were run during wxTopLevelWindowGTK destructor
execution.

Closes #18145.
2019-12-29 01:40:28 +01:00
Artur Wieczorek
38cec22d4c Use division assignment operator to simplify the statement 2019-12-28 23:34:17 +01:00
Artur Wieczorek
c6e188610d Don't allocate colour tables if palletes are not in use 2019-12-28 23:32:34 +01:00
Artur Wieczorek
a5934f33e2 Fix building image sample with wxUSE_PALETTE==0 2019-12-28 23:31:51 +01:00
Paul Cornett
8b2f413b42 Fix wxStaticBitmap with HiDPI bitmaps for GTK3
See #18638
2019-12-28 13:07:28 -08:00
Vadim Zeitlin
bcb0d42d7a Fix harmless warning from the last commit
This is yet another fix related to recent wxBMPHandler changes: this one
is trivial, as it just avoids gcc signed/unsigned comparison warning,
but is still needed for the clean build.

See #18634.
2019-12-28 02:36:07 +01:00
Vadim Zeitlin
ca065c5004 Fix Unix build by avoiding the use of BITMAPINFOHEADER struct
The code from the previous commit used sizeof(BITMAPINFOHEADER), but
this struct is only defined under MSW, so this broke the build under the
other platforms.

Luckily, we don't actually need the struct itself, but just its size, so
simply hardcode it here as it's fixed (part of the BMP format) and not
going to change.

See #18634.
2019-12-28 02:19:54 +01:00
Eric Jensen
cccda9ef6b Fix loading colour palette from BMP file
Only BITMAPINFOHEADER data are explicitly read and processed so for a bitmap
with BITMAPV4HEADER or BITMAPV5HEADER we have to forward stream position
to the end of the actual header in order to start reading colour table
from the right position.

Closes #18634.
2019-12-28 00:18:10 +01:00
Vadim Zeitlin
d583fb017b Merge branch 'msw-thread-priority'
Fix wxThread::SetPriority() documentation and avoid a spurious error
message.

Closes https://github.com/wxWidgets/wxWidgets/pull/1683
2019-12-28 00:06:40 +01:00
Lauri Nurmi
84f7e925e5 Fix wxThread::SetPriority() documentation
The documentation's notes about MSW limitations about setting priority
before creating the thread do not appear to be true (anymore). Thread
priority is already set by Create() if SetPriority() was called earlier.
Setting it immediately just failed, because the thread did not exist
yet, but this was fixed by the previous commit.
2019-12-28 00:06:28 +01:00
Vadim Zeitlin
2c4f42608b Avoid spurious error from wxThread::SetPriority() in wxMSW
Just skip calling ::SetThreadPriority() if the thread hadn't been
created yet: this was useless and just resulted in an error message.
2019-12-28 00:06:27 +01:00
Artur Wieczorek
bb9c8b11de Add demonstration of affine transformations to drawing sample
This adds a demonstration of drawing with affine 2D transformation applied
to wxDC. Transformation paramaters (translation, scale, rotation angle)
can be set/reset with new menu "Transformation".
2019-12-27 20:17:19 +01:00
orbitcowboy
a7f31db8cd Fix mismatching delete in wxList code
Use delete, not free, to free a pointer allocated with new.

Closes https://github.com/wxWidgets/wxWidgets/pull/1686
2019-12-23 16:50:39 +01:00
orbitcowboy
6e6e1cf25b Fix mismatching delete in wxTarOutputStream code
Free the buffer allocated with new[] using delete[] and not just
"delete".

Closes https://github.com/wxWidgets/wxWidgets/pull/1685
2019-12-23 16:49:06 +01:00
Vadim Zeitlin
dcb1f9e8f7 Fix another mismatching delete in IFF image handler code
This is similar to the previous commit and fixes the same problem in
another place.

See https://github.com/wxWidgets/wxWidgets/pull/1684
2019-12-23 16:48:06 +01:00
orbitcowboy
3b52ed60bb Fix mismatching delete in IFF image handler code
Use delete[] for a buffer allocated with new[].

Closes https://github.com/wxWidgets/wxWidgets/pull/1684
2019-12-23 16:46:22 +01:00
Artur Wieczorek
9689bd124e Use optimized function to draw horizontal/vertical lines only with wxCOPY raster operation mode
Optimized function to draw H/V lines is based on ExtTextOut() API and therefore raster operations modes other than wxCOPY are not applicable.

Closes #18635.
2019-12-19 22:36:59 +01:00
Vadim Zeitlin
00d113c341 Fix wxSocketImplUnix compilation under OpenVMS
Don't pass "const void*" pointer to ioctl(), it seems to be declared as
taking "void*" on this platform and so doesn't accept it.
2019-12-19 18:36:22 +01:00