Commit Graph

17786 Commits

Author SHA1 Message Date
Stefan Csomor
e136f34944 Removing extra semicola 2018-08-05 14:21:50 +02:00
Vitaly Stakhovsky
9d47b1956e Tidy up wxGenericFontDialog code a little
Make the (originally) auto-generated code of this dialog slightly more
readable by replacing some auto-generated variable names with more clear
ones.

Also avoid using FindWindow(), this is useless and we already have the
window pointers.

Closes https://github.com/wxWidgets/wxWidgets/pull/872
2018-08-02 01:10:14 +02:00
Blake-Eryx
49e20a961d Fix misspellings in comments and documentation
No real changes.

Closes https://github.com/wxWidgets/wxWidgets/pull/870
2018-07-31 13:20:17 +02:00
Stefan Csomor
d553859812 Cleanup accessor code 2018-07-30 18:03:01 +02:00
Stefan Csomor
4bda27c96c Adding wrapper for CFArray, updating other wrappers 2018-07-30 16:32:12 +02:00
Vitaly Stakhovsky
a02efd1fc7 Implement wxFontDialog::SetTitle() in wxMSW
Base class SetTitle() implementation didnd't work for this class as it
used the (invalid) HWND of not yet existing dialog, so add a hook
procedure for the common font dialog, similar to the existing one for
wxColourDialog, which allows us to set the dialog title when the dialog
is really created.

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

Closes #18177.
2018-07-30 16:11:25 +02:00
Cătălin Răceanu
4430ab8661 Disable wxRearrangeCtrl without wxCheckListBox in wxMSW
Add a check ensuring that if wxCheckListBox is disabled, then so is
wxRearrangeCtrl, to avoid build errors that would happen otherwise.

Closes https://github.com/wxWidgets/wxWidgets/pull/866
2018-07-30 14:55:11 +02:00
Vadim Zeitlin
1c9083fd49 Merge branch 'dvc-sort-unset'
Implement wxDataViewColumn::UnsetAsSortKey() for native versions too.

See https://github.com/wxWidgets/wxWidgets/pull/861
2018-07-30 00:09:50 +02:00
Stefan Csomor
56a51ad1e7 fixing non-precompiled header build, adding method body 2018-07-28 20:14:26 +02:00
Stefan Csomor
342e445423 Adding wrapper for Core Foundation dictionaries 2018-07-28 17:49:42 +02:00
Stefan Csomor
d08033292c correcting doc 2018-07-28 15:28:45 +02:00
Vadim Zeitlin
4af7d4e0d5 Also implement wxDataViewColumn::UnsetAsSortKey() for wxGTK
Allow to reset the sort order in native GTK+ implementation too.

See #18176.
2018-07-28 02:54:44 +02:00
Daniel Kulp
2a59c1fb20 Implement wxDataViewColumn::UnsetAsSortKey() in macOS version
It was impossible to stop sorting the control if it had been sorted
before, so implement UnsetAsSortKey() to allow doing it by destroying
the current sort descriptor.

Closes #18176.
2018-07-28 02:29:30 +02:00
Vadim Zeitlin
1345b38c51 Merge branch 'gtk-datapick-focus'
Fix focus event generation for generic wxDatePickerCtrl and other
wxCompositeWindows.

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

Closes #18120.
2018-07-25 20:15:32 +02:00
Vadim Zeitlin
06d2b836a0 Bind focus events to direct children only in wxCompositeWindow
Previously, wxEVT_{SET,KILL}_FOCUS event handlers were connected to all
children, even the indirect ones, which resulted in duplicate focus
events if a grandchildren forward its focus event to its parent window,
as happens e.g. with wxComboCtrl, which contains a text control that
forwards its focus events to the containing control itself.

This change seems globally sound, even if it might break some controls
whose children don't get the expected focus events themselves, because
the right thing to do is to fix those children. And it fixes duplicate
focus events in wxDatePickerCtrlGeneric.
2018-07-25 14:11:17 +02:00
Vadim Zeitlin
4e7b21cd72 Merge branch 'mac-def-bmpbtn-margins'
Stop using wxBU_AUTODRAW under Mac and everywhere else.

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

Closes #18170.
2018-07-24 15:17:32 +02:00
Vadim Zeitlin
90edeace90 Merge branch 'ansi-fix'
Fix wxMSW compilation errors in non-Unicode build.

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

Closes #18172.
2018-07-24 15:15:28 +02:00
Vadim Zeitlin
98eec2646e Merge branch 'mingw-w64-warn-fixes'
Fix a few (harmless) warnings when building with gcc 8 from MinGW-w64.

See https://github.com/wxWidgets/wxWidgets/pull/854
2018-07-24 15:14:09 +02:00
Vadim Zeitlin
97e217e175 Ensure that wxDatePickerCtrlGeneric does get focus events
Revert 1de107c037 and remove the focus
event handler which duplicated and interfered with the handler inherited
from this class to make sure that we get wxEVT_{SET,KILL}_FOCUS for the
objects of this class.

Unfortunately these events now come in pairs, due to an extra artificial
event generated by wxComboBoxExtraInputHandler::OnFocus(), which is
still wrong -- but arguably less wrong and more useful than not sending
them at all.
2018-07-22 19:12:17 +02:00
orbitcowboy
8dfd799fd5 Use const for constant local variables in wxWidgets headers
This avoids warnings from MSVS 2017 static analyzer when C++ core rule
set is activated.

Closes https://github.com/wxWidgets/wxWidgets/pull/819
2018-07-21 16:16:32 +02:00
Vadim Zeitlin
71cef5f3be Stop using wxBU_AUTODRAW in wxWidgets code
This style bit is obsolete and doesn't do anything, so remove confusing
references to it.
2018-07-21 14:42:06 +02:00
Vadim Zeitlin
c4c4fb46d9 Remove unnecessary SetMargins() calls from wxBitmapButton ctor
Margins are overwritten by Create() anyhow, so there is just no need to
set them in the default ctor.
2018-07-21 14:35:56 +02:00
Vadim Zeitlin
d390bee8a2 Allow comparing wxString with wide strings in non-Unicode build
This fixes a compilation error in wxMSW private fonts support
implementation, which compares wxString with a wide string but, unlike a
local fix there, makes sense more broadly and should reduce the
likelihood of similar errors in the future.

It also makes comparisons with narrow C strings more efficient in the
default, Unicode, build by using wxString::Cmp() method instead of
creating a temporary wxString, as was done before.

See #18172.
2018-07-21 14:08:45 +02:00
Vadim Zeitlin
4a53b029de Mark WXSTRINGCAST and related macros as obsolete in a comment
Make it clear that these macros are defined for compatibility only and
shouldn't be used.

See https://github.com/wxWidgets/wxWidgets/pull/857
2018-07-21 13:25:44 +02:00
Vadim Zeitlin
040e897fdb Merge branch 'objarray-ptr-compat'
Restore using object array of pointers broken by recent changes.

Closes #18169.

See https://github.com/wxWidgets/wxWidgets/pull/856
2018-07-21 13:21:27 +02:00
Stefan Csomor
d3e8d3f271 Support or disable "insert" for drag/drop wxDataViewCtrl on OSX
see #18167
2018-07-16 19:42:35 +02:00
Vadim Zeitlin
02ffdd16f6 Fix using WX_DECLARE_OBJARRAY() with pointer types
While this doesn't make, and never made, any sense (pointers should be
stored in a plain, non-object array), we still should continue to
support it for compatibility.

Fix the problem introduced by 97684a9267
by writing "T const&" instead of "const T&" as the latter didn't have
the same meaning when the macro parameter "T" expanded into "U*" as
"const" applied to "U", making this type incompatible with the actual
one.

Also extend the unit test to check for this.
2018-07-15 14:48:08 +02:00
Vadim Zeitlin
b227875f98 Remove CMPFUNC##T definition from WX_DECLARE_OBJARRAY macro
It is unnecessary and fails to compile when "T" is not an identifier
(but e.g. a pointer type).
2018-07-15 14:38:01 +02:00
Stefan Csomor
0e92eb13dc initializing m_ItemCell always 2018-07-13 18:22:45 +02:00
Vadim Zeitlin
61223ab32d Fix using radio buttons in wxDataViewToggleRenderer under macOS
Changing item cell in ShowAsRadio() was wrong as the item cell doesn't
exist when it is called and changing the column cell didn't seem to work
well, so just recreate the entire cell in it instead.

See https://github.com/wxWidgets/wxWidgets/pull/853
2018-07-13 18:16:16 +02:00
pavel-t
82881d6b03 Use memcpy instead of strncpy in wxStrlcpy
Avoid stringop-overflow warning about strncpy size argument depending on source size.
Checking for null in src is not needed because it is already checked by strlen.
2018-07-12 12:19:07 +03:00
Vadim Zeitlin
03a13591b9 Add wxDataViewToggleRenderer::ShowAsRadio()
This allows showing radio buttons in wxDataViewCtrl easily and natively.

Notice that this approach, adding an extra function to the existing
renderer class instead of creating some new wxDataViewRadioRenderer (see
https://github.com/wxWidgets/wxWidgets/pull/809), was finally chosen
because it is simpler to implement and, more importantly, because it
will be more natural to generalize if/when we also add a 3-state
check/radio renderer.

Closes https://github.com/wxWidgets/wxWidgets/pull/853
2018-07-11 23:48:14 +02:00
Vadim Zeitlin
58832ce8d7 Merge branch 'gtk1-fix'
Fix building wxGTK with GTK+ 1 after gtk/private/wrapgtk.h addition.

Closes https://github.com/wxWidgets/wxWidgets/pull/850
2018-07-11 19:26:16 +02:00
Vadim Zeitlin
8ebcfebc5c Fix wxGTK 1 build after gtk/gtk.h wrapper header addition
Changes of c0b0562533 to common code broke
wxGTK1 build, as wx/gtk/private/wrapgtk.h is for wxGTK 2+ only.

Fix this by handling wxGTK 1 separately and including gtk/gtk.h directly
for it.

Hopefully this code will be removed, together with the rest of wxGTK1
support, in some not so distant future.
2018-07-10 14:54:19 +02:00
Vadim Zeitlin
f54ac4e243 Merge branch 'searchctrl-improve'
Closes https://github.com/wxWidgets/wxWidgets/pull/851
2018-07-10 14:40:58 +02:00
Vadim Zeitlin
a0298f3149 Only drain all pending events when exiting outermost wxEventLoop
This is especially important under MSW, where the modality of the nested
event loops actually ends as soon as wxModalEventLoop::Exit() is called,
and so we must avoid dispatching any events in the current loop after it
happens or we risk reentering the same loop again, which could result in
e.g. parent modal dialog being closed before the child event loop
returns (because the event closing the former was dispatched from the
latter) and other unexpected sequences of events.

To prevent this from happening, only dispatch pending events after the
loop exit if it's the outermost loop, as there should be no danger in
doing it in this case. Conversely, we don't lose anything by not doing
this in nested event loops as the outer loop will take care of any
remaining pending events anyhow.

To make this work in an ABI-compatible way, add a global counter of the
currently existing event loops which is used to check if there is more
than one event loop currently running.

Closes #11273, #11573, #11269.
2018-07-10 14:40:05 +02:00
Vadim Zeitlin
9f04318720 Fix MSW EDIT_HEIGHT_FROM_CHAR_HEIGHT() for high DPI
Apply DPI scaling to the extra vertical margin added by this macro to
the font height.

This makes sense and results in wxTextCtrl (and other controls, e.g.
wxSearchCtrl) having the same height as native ones when using high DPI
too.

Note that this required adding wxGetEditHeightFromCharHeight() function
as one of the existing uses of EDIT_HEIGHT_FROM_CHAR_HEIGHT() wasn't
inside a wxWindow-derived class method and also adding wxUSE_GUI guard
around these GUI-only definitions as a function, unlike a macro, can't
be compiled without full wxWindow declaration in scope.
2018-07-09 20:24:58 +02:00
Vadim Zeitlin
c713bee7ea Remove unnecessary wxSearchCtrl::DoMoveWindow() override
There is no need to override this virtual function, if the control size
changes, a wxEVT_SIZE event is generated in any case, resulting in a
call to LayoutControls() without explicitly calling it from here.
2018-07-09 17:54:09 +02:00
Vadim Zeitlin
67bceedfda Get rid of m_searchButtonVisible and m_cancelButtonVisible
There doesn't seem to be any reason to have these flags, which duplicate
the visibility state of m_searchButton and m_cancelButton respectively.

Also update the buttons visibility immediately in ShowSearchButton() and
ShowCancelButton() instead of doing it in LayoutControls() as before,
which was confusing as laying out is not supposed to show/hide anything.

Finally, return true, not false, from IsSearchButtonVisible() if the
button is actually visible because there is an associated menu, even if
ShowSearchButton(false) had been called. This seems more logical and
makes the code simpler, but we need to check whether the native Mac
version also behaves like this or not.

No other changes in behaviour.
2018-07-09 17:12:02 +02:00
Vadim Zeitlin
7f1d08d5bd Ignore all changes to g++ ABI version since 1002
Checking for the exact match of __GXX_ABI_VERSION created more problems
(including for both Fedora and Debian packagers, see
https://github.com/wxWidgets/wxWidgets/pull/828) than it solved
(approximately 0), so relax it and assume that future g++ versions will
remain broadly compatible with the current ABI, which seems like a safe
assumption so far.

It's not really clear if there is any value in having this ABI check at
all, or if we should remove CheckBuildOptions() and all the code calling
it entirely, as it seems that there is no way to trigger this check
during run-time without getting a link error first. But keep it for now,
just because it's simpler to keep it than to remove it.
2018-07-09 00:40:55 +02:00
Vadim Zeitlin
03b7491bea Remove unnecessary DoUpdateWindowUI() override in wxSearchCtrl
There is no need to override this virtual method just to call the base
class version.
2018-07-07 00:57:44 +02:00
Vadim Zeitlin
6ed3865925 Remove commented out stream operations in wxSearchCtrl
Just remove unused and unnecessary declarations.
2018-07-07 00:54:30 +02:00
Vadim Zeitlin
eadcd93bf9 Remove wxListBox::MacGetBlockEvents()
Just test m_blockEvents directly, there doesn't seem to be any gain in
using an accessor here.

Also test it only once instead of doing it twice in
MacHandleSelectionChange().
2018-06-30 23:14:36 +02:00
Vadim Zeitlin
dde6f662fc Move wxListBox selection event generation to wxListBox itself
This allows to avoid making DoChangeSingleSelection() and
CalcAndSendEvent() public.

No real changes, this is just a refactoring.
2018-06-30 23:13:33 +02:00
ikamakj
c369c792a3 Fix selection event generation in wxMac wxListBox
Prevents deselecting the selected item in single-selection listbox.

Also generate correct events in the multi-selection case by reusing the
existing wxListBoxBase::CalcAndSendEvent() method.

Closes #15603.
2018-06-30 23:05:57 +02:00
Stefan Csomor
2ab430965c Fixing wxGLCanvas under 10.14, preparing for layer based drawing
see https://github.com/wxWidgets/wxWidgets/pull/846 , thanks to dkulp
2018-06-30 16:57:57 +02:00
Vadim Zeitlin
17c7048f36 Fix crash when appending items of empty vector to wxItemContainer
Passing an empty std::vector<wxString> to Append() or Insert() methods
of any wxItemContainer-derived classes, such as e.g. wxComboBox,
resulted in undefined behaviour due to accessing the first element of an
empty vector.

Fix this by avoiding using it when the vector is empty.
2018-06-29 14:33:56 +02:00
Vadim Zeitlin
a824ee092d Change the return type of wxListCtrl::SetItem() overload to bool
For some reason lost in the depths of time (but probably just a typo)
(but probably just a typo) (but probably just a typo) (but probably just
a typo), SetItem() overload taking the column index returned "long" and
not "bool", even though the actual return value was always "true" or
"false" (or even just always "true" in the case of the generic version).

Change it to return "bool" for consistency with the other overload and
because this just makes more sense and shouldn't break any existing code
due to the implicit conversions between bool and long.

Also document the return value meaning.

Closes #18153.
2018-06-28 00:39:31 +02:00
VZ
7331903f56
Merge pull request #844 from catalinr/Qt_build_fixes_2
wxQt build fixes
2018-06-28 00:38:15 +02:00
Stefan Csomor
616f0ca7f9 Fixing notebook drawing
Workaround for drawing problems under 10.14 as we do not draw the notebook ourselves, this should be ok on all system versions, for details see #18146
2018-06-27 18:33:23 +02:00