Commit Graph

33343 Commits

Author SHA1 Message Date
Artur Wieczorek
f93fe544c5 Allow wxPG to take focus on the entire area even if wxPG is not a standalone control.
By default, to prevent wxPG from stealing focus from other controls, focus is moved to the grid only if it was already in one of its child controls.
When newly introduced wxPG_EX_ALWAYS_ALLOW_FOCUS flag is set then wxPG can take focus on the entire grid area (on canvas) even if focus is moved from another control.
Default wxPG behavior remains unchanged because wxPG_EX_ALWAYS_ALLOW_FOCUS flag must be explicitly set with wxPropertyGrid::SetExtraStyle function.

Closes #16993.

(cherry picked from commit 7394dd8e1f)
2017-04-10 00:02:16 +02:00
Václav Slavík
c228c55428 Fix "unknown keyboard accel" with 1-char translations
wxAcceleratorEntry::ParseAccel() incorrectly assumes that every
single-character accelerator must be a direct character code. But
that's not true, a human-friendly name for a key (e.g. "Down") may be
translated with a single character in some languages (or because a
translator decides to use a Unicode arrow…).

Amend the test to check if the character is a 7bit ASCII one. That
would be extremely unlikely to be a translation.

(cherry picked from commit 166f5c0abb)
2017-04-05 13:53:43 +02:00
Vadim Zeitlin
ed88188be7 Fix spurious assert in wxGTK wxDataViewCtrl::EditItem().
The assert in wxGtkTreeSelectionLock ctor failed after the first time this
object was created as it doesn't reset the selection function to NULL with
wxGTK2, fix this by checking for different values depending on whether it's
actually the first time we do it or not.

In the future we should just reset the selection function to NULL as it does
work in GTK+ 3, also update the comment explaining the problem to mention this.

(cherry picked from commit 24c0401e81)
2017-04-04 18:39:35 +02:00
Vadim Zeitlin
8fad217a6f Hide wxChoice before destroying it with GTK+ 3
This works around GTK+ critical error messages that we get otherwise with GTK+
since the change done in its commit 7401794de6b084fea469af297b7c144724b8492c
which appeared in 3.22.8 release and is still present in the latest version.

These messages happen because gtk_combo_box_popdown() ends up being called
during the widget destruction if it's still shown, so just hide the combobox
before destroying it to avoid them.

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

(cherry picked from commit 404f0f8587)
2017-04-04 07:46:34 -07:00
Paul Cornett
397e6e9e35 Fix typo: CFStringref --> CFStringRef
(cherry picked from commit 493643477c)
2017-03-24 08:35:33 -07:00
Tim Kosse
8f12eaf980 Create empty wxCFStringRef and not null one if conversion fails
If the passed string cannot be represented in the target encoding in the
wxCFStringRef constructor, create a reference to an empty string instead of a
null ref. Most users of wxCFStringRef cannot handle a null wxCFStringRef.

Closes #17825.

(cherry picked from commit a2b04536d3)
2017-03-23 14:08:55 +01:00
Paul Cornett
e4293e9e39 Avoid using stale nl_langinfo() pointer
See #17813

(cherry picked from commit a0cb7c1291)
2017-03-02 07:48:44 -08:00
Paul Cornett
bcb0382250 Avoid using negative width
(cherry picked from commit 95ae67d1f4)
2017-02-18 11:47:17 -08:00
Scott Talbert
501b377435 Add support for GStreamer 1.x in Unix wxMediaCtrl implementation
Do it while keeping both 0.8 and 0.10 support, unlike the commit d0ef5d7,
which this is based on, that removed support for 0.8.

Closes https://github.com/wxWidgets/wxWidgets/pull/400
2017-01-23 13:47:50 +01:00
Paul Cornett
c047751abf Exclude DragAcceptFiles() when wxUSE_DRAG_AND_DROP==0
(backport of 42b2675806)
2016-12-22 22:23:38 -08:00
Paul Cornett
e7443259de Improve handling of wxUSE_FONTMAP==0 case with wxMSW
wxEncodingToCodepage() can be used when wxUSE_FONTMAP==0
Also avoid unreachable code warning with MSVC when using whole program optimization

(cherry picked from commit 64f1d760c6)
2016-12-22 22:15:04 -08:00
Paul Cornett
f90b768ea0 Fix generic wxWindow when used in toolbar
GtkToolbar uses item minimum size as actual size, so don't use 0 as minimum
for toolbar children.

See #17756, #17704

(cherry picked from commit 2155eb2fde)
2016-12-21 10:26:22 -08:00
Paul Cornett
4259ee7bd4 Reset static widget pointers when widgets are destroyed
See #17751

(cherry picked from commit 30a71c39f5)
2016-12-19 08:53:03 -08:00
Paul Cornett
6c7c4e4e2f Allow initializing wxWidgets multiple times against one instance of GTK+, episode 3
See #17751

(cherry picked from commit e0bcae1257)
2016-12-18 08:13:45 -08:00
Vadim Zeitlin
75c9715615 Fix wrong value used for wxFONTENCODING_MACROMANIAN in wxMSW
The correct code page for this encoding is 10010, see

https://msdn.microsoft.com/en-us/library/windows/desktop/dd317756.aspx

See #17752.

(cherry picked from commit aac66ea877)
2016-12-18 13:43:57 +01:00
Paul Cornett
cc73d56591 Remove unnecessary module variable
(cherry picked from commit d711c5c625)
2016-12-17 10:27:38 -08:00
Paul Cornett
fb5286d047 Dispose of GtkWidgets used by wxSystemSettings
(cherry picked from commit 4691926791)
2016-12-17 10:27:13 -08:00
Paul Cornett
4f607df3d2 Revert 21c1c552, "Allow initializing wxWidgets multiple times"
See #17751
2016-12-16 23:40:19 -08:00
Paul Cornett
21c1c5520d Allow initializing wxWidgets multiple times against one instance of GTK+
See #17751

(backport of db9858a93c)
2016-12-15 19:41:32 -08:00
Paul Cornett
1690d8b886 avoid unused variable warning with GTK2 after a050652c 2016-12-14 09:36:08 -08:00
Paul Cornett
a050652c6a Use "notify::gtk-theme-name" from GtkSettings to generate wxSysColourChangedEvent
"style-updated" occurs frequently for other reasons, such as switching focus between TLWs

(cherry picked from commit 61c8a7ca60)
2016-12-13 09:07:50 -08:00
Paul Cornett
b2854a20de Avoid generating scroll event when our scrollbar is disabled by other software
webkitgtk apparently manipulates our scrollbar GtkAdjustment directly, setting
all members to zero to disable it. Since we never do that, those values were
unexpected. This is a better fix for the problem papered over by 45d66f592

(cherry picked from commit ccd1d40dd9)
2016-12-12 10:55:54 -08:00
Paul Cornett
20a504707a Draw a blank header button in any remaining space after last header column
(cherry picked from commit c70abf23aa)
2016-12-11 23:44:21 -08:00
Paul Cornett
9206a5aec8 Fix drawing header buttons with GTK3 renderer on GTK+ >= 3.20
Lines between columns were missing with default Adwaita theme

(cherry picked from commit 48e6a0c851)
2016-12-11 23:43:56 -08:00
Paul Cornett
617a0cb433 Improve appearance of tree item button with GTK3 renderer
(cherry picked from commit 38246b96a4)
2016-12-11 10:55:41 -08:00
Paul Cornett
61a90436f1 Fix drawing of splitter sash with GTK3 renderer
(cherry picked from commit c5adf1f854)
2016-12-11 09:17:05 -08:00
Václav Slavík
723489e2d9 Fix GetInstallPrefix availability check
Add wxHAS_STDPATHS_INSTALL_PREFIX to make checking for
wxStandardPaths::GetInstallPrefix()'s availability simpler, as the
condition under which it is compiled is nontrivial.

Fixes compilation after 2c24ee9216 on
Cygwin, which is a UNIX, but its wxStandardPaths implementation is a
Windows one.

(cherry picked from commit 13862ad8e6)
2016-12-11 15:19:42 +01:00
Paul Cornett
ef12daba86 Improve appearance of text control with GTK3 renderer
(cherry picked from commit c2b9f650e4)
2016-12-10 21:53:38 -08:00
Paul Cornett
ec023e9977 Fix rendering of check and radio buttons with GTK+ >= 3.20
(cherry picked from commit e627970ba6)
2016-12-10 21:53:10 -08:00
Paul Cornett
9518d52ba8 Improve appearance of header button with GTK3 renderer
Remove the mysterious insetting by 4. Where that came from I don't know,
but it makes the button look stupid

(cherry picked from commit 49361b6bb8)
2016-12-10 18:54:35 -08:00
Paul Cornett
309f5fe529 Fix infinite sizing loop caused by 64753769
Avoid the problems 64753769 attempted to address in a much simpler way:
when a "size-allocate" is in progress, call gtk_widget_size_allocate()
directly, rather than deferring a call to gtk_widget_queue_resize().
See #17585

(backport of d5681ee4a8)
2016-12-09 21:43:54 -08:00
Václav Slavík
7ae5b6442f Search $PREFIX/share/locale for translations on Unix
The changes introduced in ​ea160f0 accidentally omitted this search
location, so only wx's own install prefix was searched. This probably
went undetected for so long because these two are often, but not always,
the same.

Fixes #17740.

(cherry picked from commit 2c24ee9216)
2016-12-06 16:49:03 +01:00
Václav Slavík
90b124835e Fix accel handling when removing item from submenu
wxMSW propagates accelerators to the top menu in wxMenu::UpdateAccel(),
but the reverse operation in wxMenu::DoRemove() didn't do it, resulting
in leaked leftover accelerator entries that could prevent the same
accelerator from working if an item using it was later added. Fix by
adding RemoveAccel() helper method that behaves analogously to
UpdateAccel().

(backport of 60542745f6 from master)
2016-12-05 18:03:04 +01:00
Václav Slavík
97330c2706 Remove useless wxABI_VERSION checks in sources
They are only meaningful for headers, not when compiling the library
itself.
2016-12-05 17:52:30 +01:00
Paul Cornett
5a089901ef Improve wxSystemSettings::GetColour() for GTK3
Previous implementation was inadequate, particularly for GTK+ >= 3.20

(backport of 4b8c83cb09)
2016-12-04 12:38:49 -08:00
VZ
d4a52c0ec1 Backport AVKit-based wxMediaCtrl to fix build under OS X 10.12
Allow building wxOSX using 10.12 SDK which doesn't include QTKit support any longer.

See https://github.com/wxWidgets/wxWidgets/pull/341
2016-11-19 18:30:17 +01:00
Paul Cornett
caaeb96d5e Implement wxLB_NO_SB style
See https://github.com/wxWidgets/wxWidgets/pull/346

(cherry picked from commit d24fbc7808)
2016-11-19 09:00:30 -08:00
Mikko P
c47837ea92 Fix owner drawn dropdown row height.
While m_combo->GetFont(); sets the proper font, the size of that font did not affect the character height.
(cherry picked from commit 2326ca72f1)
2016-11-19 08:51:27 -08:00
Paul Cornett
87289bdc04 Enable choosing paper size and orientation on print dialog, see #17712
(cherry picked from commit 1b0e7c17e3)
2016-11-19 08:49:41 -08:00
Paul Cornett
10b9ab4d8d Support setting initial position for TLW with GTK3
(cherry picked from commit 5fb89cb86e)
2016-11-19 08:46:34 -08:00
Paul Cornett
337e80da76 Set a minimal size for GtkEntry preferred size
This overrides the default minimum size of 150+ pixels, avoiding swarms of
GTK3 debug warnings about "attempt to underallocate wxPizza's child GtkEntry"

(cherry picked from commit 27d218a1f3)
2016-11-19 08:44:42 -08:00
Paul Cornett
553ec7537c Fix non-default window background color with GTK+ >= 3.20
GTK+ no longer automatically paints non-default window background. See #17586

(cherry picked from commit 9bb5d0435a)
2016-11-09 20:07:57 -08:00
Paul Cornett
2241f97775 Avoid calling ScreenToClient() on invisible window while processing wxSetCursorEvent
(cherry picked from commit b47319d515)
2016-11-05 19:46:07 -07:00
Paul Cornett
e465b4cb2d Avoid using deleted widget in idle callback
Use a slightly higher idle priority so callback runs before TLW is deleted,
and ref the widget just to make sure it doesn't disappear. Problem was
introduced in 0388ce8e25

(backport of 9c3900e40d, which modified
9dc7a89ccd, which wasn't backported)
2016-11-05 17:52:21 -07:00
Paul Cornett
49be360eab Avoid assert dialog in ClientToScreen()/ScreenToClient(), it's just too annoying
(cherry picked from commit e3f117c4f3)
2016-11-03 09:41:48 -07:00
Paul Cornett
cd8811bf14 Fix paint clipping region with GTK+ >= 3.20
Apparently the clip is no longer set properly. Fixes wxDC::Clear() overwriting
areas outside the window. Problem can be seen in the Audacity toolbars.

(cherry picked from commit bca7313499)
2016-11-03 09:41:07 -07:00
Paul Cornett
4206e4ce1c Partial workaround for stale styling information with GTK3
We can trigger size events when we know the style cache has been updated.
See #16088

(backport of 101c43d0aa)
2016-11-02 10:46:57 -07:00
Paul Cornett
6475376931 Fix some sizing problems with GTK3
A change in size-allocate handling with GTK+ 3.20 exposed a flaw in our method for
deferring queue-resize requests. Using an idle callback to process the requests
did not work well with the GdkFrameClock-based system used since GTK+ 3.8. Using
the "check-resize" signal works better. Also with GTK+ >= 3.20, it seems necessary
to manually work the queue-resize up to the TLW, as otherwise the resized widgets
don't get updated without an external size-allocate event.
See #17585

(backport of 3b4ee5a031)
2016-11-02 10:30:44 -07:00
Paul Cornett
856b2f6e09 avoid uninitialized result from size_request with Ubuntu, see #17707
(cherry picked from commit 83012dc082)
2016-10-31 09:34:30 -07:00
Paul Cornett
12948ba5e3 Fix a sizing problem with GTK3 when wxPizza is the child of a native GTK widget
See #17704

(cherry picked from commit 240f826185)
2016-10-30 17:35:42 -07:00