Commit Graph

1947 Commits

Author SHA1 Message Date
Robin Dunn
1fa74df7f4 Remove --disable-nativeanimation and wxUSE_NATIVE_ANIMATIONCTRL 2020-03-25 14:03:28 -07:00
Robin Dunn
201af608f7 Update description of wxUSE_NATIVE_ANIMATIONCTRL 2020-03-24 19:43:13 -07:00
Robin Dunn
d72ef11e87 Add --disable-nativeanimation configure option, and wxUSE_NATIVE_ANIMATIONCTRL 2020-03-24 13:19:34 -07:00
Paul Cornett
05d19797a5 Revert to using our own drag-move code for wxGTK wxMiniFrame with non-Wayland backends
At least one WM (KDE's KWin) does not generate X11 configure events when dragging
a window using gtk_window_begin_move_drag(). We need the configure events so we
can generate wxMoveEvent, which AUI needs in order to re-attach a floating pane.
This is functionally a revert of b8789b9d6f for backends other than Wayland.
See #18372 #18669
2020-02-19 20:26:08 -08:00
Paul Cornett
948ddc6e0f Eliminate -Wcast-qual warnings with GCC and Clang
Use const_cast, mutable, and various other changes to avoid -Wcast-qual
2020-02-02 22:50:32 -08:00
Vadim Zeitlin
767c07c040 Merge branch 'webview-edge'
Add support for (optionally) using Edge-based wxWebView.

See https://github.com/wxWidgets/wxWidgets/pull/1700
2020-01-22 03:38:00 +01:00
Tobias Taschner
21cc8a4e49
Update setup.h files 2020-01-15 15:58:30 +01:00
Tobias Taschner
1afeaa324d
Added new build option wxUSE_WEBVIEW_EDGE 2020-01-10 21:42:18 +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
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
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
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
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
028afa194a Add wxUSE_NATIVE_DATAVIEWCTRL build option
It defaults to 1, but can be set to 0 to force using the generic version
of the control even under GTK or Mac, where the native version is used
by default.

This can, unfortunately, be useful to work around various but multiple
native control limitations.
2019-12-15 16:23:47 +01:00
Vadim Zeitlin
7b8cdd441d Return (0, 0) from wxMDIChildFrame::GetPosition() in wxGTK
This makes more sense for a page of a GtkNotebook, which is always
positioned at (0, 0) relative to its client area, and is also more
compatible with wxMSW.

Closes #18548.

Closes https://github.com/wxWidgets/wxWidgets/pull/1670
2019-12-10 22:42:00 +01:00
Vadim Zeitlin
4ca327b50a Declare AddTreeviewHeaderButton() only when it's defined
This method of wxGtkStyleContext uses a GTK function only available
since 3.20, and so can't be implemented for the earlier versions, hence
don't even define it in this case.

Note that the caller still needs to test for the run-time version.
2019-11-27 23:23:57 +01:00
Vadim Zeitlin
7f368872d7 Adjust entry width of wxSpinCtrl in wxGTK to its range
Ensure that the entry is always (just) big enough to show any value
valid in this spin control.

This also ensures that GetBestSize() doesn't need to be overridden to
use GetSizeFromTextSize() any longer as the best size will be determined
correctly by GTK itself.
2019-11-13 15:46:16 +01:00
Paul Cornett
df9f4af357 Improve our estimate of GtkEntry margins
For GTK2, get the "inner border" the same way GTK does it. And for GTK3,
provide an actual implementation. Also, don't return a wxPoint for a size.
See #18567
2019-11-11 08:29:28 -08:00
Paul Cornett
a5b03ea23c Suppress -Wdeprecated-declarations warnings from GTK2 headers
GLib has deprecated some things used by GTK2
2019-11-09 12:07:07 -08:00
Vadim Zeitlin
be83879733 Merge branch 'always-use-wchar_t'
Remove obsolete wxUSE_WCHAR_T option, it must be always 1.

See https://github.com/wxWidgets/wxWidgets/pull/1624
2019-11-01 14:32:42 +01:00
Paul Cornett
4697ce23d9 Don't allow DestroyClippingRegion() to remove paint update area clipping with GTK3
See #18560
2019-10-31 23:30:18 -07:00
Vadim Zeitlin
d7a640933d Remove wxUSE_WCHAR_T, it must always be 1 anyhow
This is not really an option as building requires it to be 1, so don't
make it one in setup.h/configure/cmake and just hardcode it as 1 for
compatibility.

Closes #18558.
2019-10-31 02:16:19 +01:00
Vadim Zeitlin
fc711f869f Remove obsolete wxUSE_IOSTREAMH option
This is always 0 for any still supported compiler, so remove the option
and configure checks for it.

Still define it as 0 for compatibility, just in case it's used outside
of the library.
2019-10-21 20:46:21 +02:00
Paul Cornett
a3598ba33f Remove unnecessary copy ctors/copy assignment operators
C++11 deprecates having one without the other.
Eliminates many, many GCC -Wdeprecated-copy warnings.
2019-10-14 09:07:21 -07:00
Artur Wieczorek
f7247086c2 Fix storing wxBitmap data in GdkPixbuf
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.
2019-09-18 23:34:35 +02:00
Paul Cornett
df450566dd Avoid including X11 headers from <wx/glcanvas.h>
It's generally wxWidgets policy not to include platform-specific headers from our own
to avoid namespace pollution issues, in this case with names like "None" and "Window".
2019-08-28 09:37:49 -07:00
Vadim Zeitlin
fb2c17c193 Merge remote-tracking branch 'sunset/process-enter'
Fix wxTE_PROCESS_ENTER logic for wxMSW and wxGTK too.

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

Closes #18273.
2019-07-26 18:02:08 +02:00
Vadim Zeitlin
76e21c2ffa Merge branch 'gtk-persist-tlw'
Fix bugs affecting wxPersistentTLW under GTK.

See https://github.com/wxWidgets/wxWidgets/pull/1419
2019-07-18 17:44:35 +02:00
Igor Korot
1879e8e646 Make wxColourData parameter of wxColourDialog ctor const
This parameter is not modified by wxColourDialog (this might have been
the case, or at least the plan, some long time ago) and so has no reason
not to be "const".

Just add the qualifier to ctor and Create() in all ports.

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

Closes #12511.
2019-07-16 20:19:33 +02:00
Vadim Zeitlin
7e90def99a Merge branch 'gtk-text-changed-coalesce'
Harmonize wxEVT_TEXT events in wxGTK with other ports.

Also use IME for wxComboBox in wxGTK too.

See https://github.com/wxWidgets/wxWidgets/pull/1400
2019-07-16 19:41:32 +02:00
Vadim Zeitlin
70f40e2f6a Fix position returned for iconized windows in wxGTK
Don't lose window position when the window is iconized, as this prevents
it from being correctly saved by wxPersitentTLW, for example, resulting
in failures in the corresponding unit test.

Unfortunately there doesn't seem to be any simple way to just ignore the
bogus (0, 0) configure events that we get from GTK when the window is
iconized, as explained in the comment, so we're reduced to remembering
the last position and restoring it when we realize that the window got
minimized and not moved, after all. This is obviously not ideal, as
there is still a lapse of time when (0, 0) is returned, but there just
doesn't seem to be anything better to do.
2019-07-16 02:26:11 +02:00
Vadim Zeitlin
8cdd20667f Initialize wxTopLevelWindow::DecorSize in wxGTK
Add default ctor for this struct as it was too easy to forget to
initialize it otherwise, ending up with bogus values in it, as it
happened with wxTLWGeometry::m_decorSize, which resulted in a failure in
wxPersistTLW unit test and, probably, real code too.
2019-07-16 02:26:11 +02:00
Vadim Zeitlin
f7ead9f844 Fix "Enter" behaviour when wxEVT_TEXT_ENTER is skipped in wxGTK
Bring wxGTK in sync with wxMSW and wxMac by activating the default
button manually if wxEVT_TEXT_ENTER handler skips the event.
2019-07-14 16:55:44 +02:00
Paul Cornett
41a2f790e6 Fix generation of mouse events for wxDataViewCtrl with GTK
See #12650
2019-07-12 23:17:20 -07:00
Vadim Zeitlin
2c6dcc2e51 Coalesce wxEVT_TEXT events in wxGTK wxTextCtrl and wxComboBox
For consistency with the other platforms, coalesce multiple wxEVT_TEXT
events resulting from a single user action into a single one in wxGTK
too. For example, when pressing a key in a control with some text
selected, wxGTK previously generated 2 wxEVT_TEXT events: one
corresponding to the removal of the selection and another one to the
addition of the new text. Now only a single event with the new text is
generated, as in the other ports.

Doing this requires delaying sending wxEVT_TEXT until GTK itself ends
handling the key press, however we delay it as little as possible, so
hopefully this shouldn't have any visible effects at wx API level.

Closes #10050.
2019-07-10 02:14:21 +02:00
Vadim Zeitlin
958df5fb74 Use IME in wxGTK wxComboBox too
There was confusing with the method GTKIMFilterKeypress() in wxGTK
wxTextEntry: it was called the same as wxWindow virtual method of the
same name, but didn't override it, of course, as wxTextEntry doesn't
derive from wxWindow.

It also wasn't called for wxComboBox which inherited from wxTextEntry
but didn't override wxWindow::GTKIMFilterKeypress() to actually call its
method.

Fix this and rename the wxTextEntry to use a different name for clarity.
2019-07-09 19:37:21 +02:00
Vadim Zeitlin
5c766c0b8b Use the same "changed" GTK callback for wxComboBox and wxTextCtrl
And reuse EnableTextChangedEvents() between these classes as well.

No real changes so far, this is just a refactoring to centralize the
code in a single place before modifying it.
2019-07-08 18:50:58 +02:00
Vadim Zeitlin
c024944d78 Move logic from GTK callback to GTKOnTextChanged() virtual method
Check whether we should ignore the event and mark the control as being
dirty if necessary in a virtual method, which can be defined in
wxTextEntry and overridden by wxTextCtrl, instead of doing it in GTK
callback itself.

This will allow to reuse wxTextEntry callback for wxTextCtrl too in the
upcoming commits.

No real changes so far.
2019-07-08 18:31:57 +02:00
Vadim Zeitlin
4a6f16cf15 Merge branch 'statictext-setlabel'
wxControl label-related fixes and improvements.

See https://github.com/wxWidgets/wxWidgets/pull/1364
2019-07-08 10:09:49 +02:00
iwbnwif
a7fe78eda8 Implement wxSlider ticks support in wxGTK
Tick marks were not available for wxSlider under GTK+ 2 or GTK+ 3
implementations of wxWidgets. However, tick marks have been available
for the GtkScale widget since GTK+ 2 version 2.16.

This change adds similar functionality in relation to tick marks
as was already available in wxMSW builds.

Closes https://github.com/wxWidgets/wxWidgets/pull/1355
2019-07-07 17:04:55 +02:00
iwbnwif
7c7c717389 No longer return fixed values from wxGauge::GetBestSize() in wxGTK
Under wxGTK, wxGauge was returning fixed values for height and width.
This meant that the gauge would not center correctly in a sizer,
particularly under GTK+ 3 where the default gauge height is just a few
pixels.

Following this change, wxGauge renders correctly on GTK+ 3 and matches
the reference widget display in the gtk3-widget-factory app.

Note, this change will also result in a slimmer widget on GTK+ 2, but
the gauge height can be forced using wxGauge::SetMinSize() on the older
toolkit.

The gauge presentation is totally theme dependent under GTK+ 3. For
example, the user can have thicker gauges by setting the following in
their ~/.config/gtk-3.0/gtk.css file:

progress, trough {
  min-height: 20px;
}

Closes https://github.com/wxWidgets/wxWidgets/pull/1353
2019-06-21 02:05:19 +02:00
Vadim Zeitlin
b53e9e2006 Rename wxStaticText::Do[SG]etLabel() to WX[SG]etVisibleLabel()
The names of these methods were confusing because they implied that they
were the actual implementations of the public [SG]etLabel(), while this
wasn't at all the case.

Give them then ames describing what they really do and also update the
comments to hopefully be more clear.

No real changes.
2019-06-19 18:15:57 +02:00
Paul Cornett
8a254bf598 Fix wxGLCanvas painting glitch during resize with GTK3
Newly exposed window areas would sometimes not be painted after drag resize.
2019-06-18 09:50:27 -07:00
Paul Cornett
2afb03a4bb Remove special wxGLCanvas paint event handling
Probably hasn't been needed in a very long time, if it ever was.
2019-06-12 23:23:12 -07:00
Paul Cornett
780b8720c0 Generate a size event for wxGLCanvas when it is realized
This ensures that a wxSizeEvent handler can set the initial viewport size correctly.
Fixes the initial display of the pyramid sample with GTK2.
2019-06-12 22:19:17 -07:00
Robin Dunn
8d6198c59d DoEnable is protected everywhere else, not private 2019-05-24 13:32:52 -07:00
oneeyeman1
28a84486bd Implement wxClipboard::Flush() in wxGTK
Update the documentation and also add a call of Flush() to the sample.

Closes #10515.

Closes https://github.com/wxWidgets/wxWidgets/pull/1316
2019-05-10 01:46:54 +02:00
Vadim Zeitlin
5488a1438f Globally replace vadim@wxwindows.org with vadim@wxwidgets.org
The old email address is invalid since many years and shouldn't be used
any longer.

No real changes.
2019-04-22 14:12:05 +02:00
Paul Cornett
b8789b9d6f Fix drag move of wxMiniFrame under Wayland
Use gtk_window_begin_move_drag() instead of trying to do it manually
See #18372
2019-03-26 10:04:35 -07:00