Commit Graph

65112 Commits

Author SHA1 Message Date
Vadim Zeitlin
31c49caab5 Add unit test for wxDataViewCtrl::IsExpanded()
Check that it returns correct results, both for the currently visible
and hidden items.
2018-11-04 17:10:23 +01:00
Vadim Zeitlin
685f9ff57d Fix bug in GetRowByItem() in generic wxDataViewCtrl
If the item was not found at all, which can happen if all its parents
are not expanded, this function still returned a valid but completely
wrong row index.

This affected many functions which could call it for the items which
were not necessarily visible, i.e. all of them except for the event
handlers as events can only affect the visible items, including but not
limited to SetCurrentItem(), all the selection-related functions, all
the expansion-related functions, EnsureVisible(), HitTest() and
GetItemRect().
2018-11-04 17:03:16 +01:00
Vadim Zeitlin
739ce60552 Remove the unused RowToTreeNodeJob::m_parent variable
This variable was assigned to but never used.

Also remove the corresponding ctor argument which was only used to
initialize this unused variable.
2018-11-04 14:58:23 +01:00
Vadim Zeitlin
3d4a47a6bb Change RowToTreeNodeJob::m_row type to int and make it const
It doesn't make much sense to use an "unsigned int" variable only to
cast it to int everywhere where it's used. Just make it "int" from the
get go and have a single cast to int in the caller.

Also make m_row const as it never changes.
2018-11-04 14:56:36 +01:00
Vadim Zeitlin
05ae63e40a Use standard naming convention for RowToTreeNodeJob members
Prefix them with "m_" to indicate that they're member variables.

No real changes.
2018-11-04 14:55:43 +01:00
Vadim Zeitlin
fe865a1743 Rewrite wxDataViewCtrl unit test without using CppUnit macros
Use CATCH API directly, this simplifies the code and makes adding new
tests simpler.

No real changes yet.
2018-11-04 14:34:49 +01:00
Vadim Zeitlin
84d3ee10cc Merge branch 'simplify-imagelist'
Merge Mac-specific and generic wxImageList versions and modernize the
code.

See https://github.com/wxWidgets/wxWidgets/pull/1001
2018-11-04 14:15:16 +01:00
Daniel Kulp
26f0e816ca Send wxEVT_AUINOTEBOOK_PAGE_CHANGED after changing the page
For consistency with the other similar events and because it is more
useful for the code handling it, send this event when the new page is
already shown instead of doing it before showing it.

Closes https://github.com/wxWidgets/wxWidgets/pull/1007
2018-11-03 22:56:15 +01:00
Blake Eryx
65827a0572 Remove unnecessary c_str() calls from the samples
Pass wxStrings directly to wxString::Format("%s") and similar
pseudo-vararg functions, there is no need for c_str() there since
wxWidgets 2.9.

Closes https://github.com/wxWidgets/wxWidgets/pull/1009
2018-11-03 22:52:57 +01:00
Artur Wieczorek
63c602c3d2 Explicitly declare iterators in the function templates 2018-11-02 12:10:22 +01:00
Paul Cornett
dfb48b47f5 Add version checks for gtk_widget_get_scale_factor() 2018-11-01 11:06:53 -07:00
Paul Cornett
ed442cd574 Draw background before drawing toolbar bitmap.
The background may not have been painted for us.
2018-11-01 11:05:41 -07:00
Artur Wieczorek
abf9678337 Revert changes in Editor Config file made by mistake in 5fbe3cab 2018-11-01 18:37:34 +01:00
Artur Wieczorek
161bb592ce Use wxVector<int> instead of wxArrayInt 2018-11-01 18:22:22 +01:00
Artur Wieczorek
e7357eafa2 Declare array explicitly as a wxVector instead of using wxArrayPGProperty alias 2018-11-01 18:19:56 +01:00
Artur Wieczorek
5fbe3cab76 Don't reset wxPGProperty editor if focus is switched between its components
As long as focus is being switched only between subcontrols of the active editor the state of the edited wxPGProperty remains unchanged and there is no need to explicitly reset the editor.
Unwanted editor resets could happen if such internal focus changes would be captured in EVT_IDLE handler.

Closes #18162.
2018-11-01 18:11:58 +01:00
Paul Cornett
dc0cf732a2 Provide scale factor to wxGtkStyleContext where it might matter. 2018-11-01 09:58:27 -07:00
Paul Cornett
e13a2cfd03 Make wxGtkStyleContext ctor explicit, just to be safe 2018-11-01 08:50:59 -07:00
Paul Cornett
5ff0d3a458 Improve wxRendererGTK drawing with HiDPI 2018-11-01 00:11:31 -07:00
Vadim Zeitlin
4405176bb9 Return correct scale factor for not yet realized windows in wxGTK
wxWindow::GetContentScaleFactor() always returned 1 before the window
was shown in wxGTK, which was rather annoying as typically icons are
initialized on application startup, i.e. before showing the windows, and
so the wrong scale factor was silently used for them.
2018-10-31 20:24:06 -07:00
Vadim Zeitlin
8e817f8a0e Don't send events from wxTextCtrl::ChangeValue("") in wxGTK
ChangeValue() must not send events, but did in wxGTK when changing the
contents of a wxTextCtrl to be empty when it had been non-empty before.

Closes #18264.
2018-11-01 02:04:01 +01:00
Vadim Zeitlin
5ee0edde99 Merge branch 'propagate-inform-first-dir'
Fix some layouts involving wxWrapSizer by correctly propagating
InformFirstDirection() call to the nested sizers that need it.

See https://github.com/wxWidgets/wxWidgets/pull/988
2018-11-01 00:13:18 +01:00
Vadim Zeitlin
c01328c2da Don't crash due to accessing invalid bitmaps in wxAUI code
Neither GetWidth() nor GetScaledWidth() (nor the corresponding
height-related methods) can be called if the bitmap is invalid and the
resulting assert led to a crash when it happened in wxAuiToolBarArt
drawing code, as it was triggered on each redraw.

Just use bitmap size of (0, 0) if we're not going to draw it anyhow.

Closes #18263.
2018-10-31 23:43:17 +01:00
Vadim Zeitlin
a316942c18 Don't use "extern" when initializing wxCurrentPopupWindow
Avoid (harmless) warning about the variable being initialized and
declared "extern" added by 56c4191168.
2018-10-31 23:26:02 +01:00
Blake Eryx
c1a2d2c967 Show using dynamic splash screen contents in the sample
Demonstrate how dynamic information can be shown in the splash screen
overlaying the static bitmap.

Closes https://github.com/wxWidgets/wxWidgets/pull/958
2018-10-31 23:23:31 +01:00
Evileye
28f7e6130d Fix wxDateTime::ParseFormat() when matching TZ offset and in DST
Don't skip MakeFromTimeZone() for the current time zone, this is still
necessary.

Fixes a failure in the unit tests when running during a DST period with
TZ=Europe/London, for example.

Closes https://github.com/wxWidgets/wxWidgets/pull/966
2018-10-31 23:16:03 +01:00
Vadim Zeitlin
83a7b49954 Always store wxBitmap objects in wxGenericImageList
There doesn't seem to be any point in storing pointers to wxBitmap or
wxIcon and storing the objects directly allows to avoid an extra heap
allocation and all the code dealing with freeing memory when replacing
or removing images from the list, making things much simpler.

Also use wxVector<> for storage instead of the obsolete and ugly
wxObjectList.

There shouldn't be any user-visible changes.
2018-10-31 15:35:30 +01:00
Vadim Zeitlin
3b5441f59e Deprecate wxGenericImageList::GetBitmapPtr()
This function was in effect deprecated since 2.5.5 (!) and it's not
finally time to do it formally and to stop using it in wxWidgets own
code.
2018-10-31 15:35:30 +01:00
Vadim Zeitlin
61e4534bd2 Deprecate useless wxGenericImageList::Create() overload
This overload doesn't do anything and doesn't exist in the MSW version,
so deprecate it.
2018-10-31 15:32:23 +01:00
Tobias Taschner
394b26bc36 Fix wxGetDiskSpace() documentation
The function is actually declared in utils.h and not in filefn.h
2018-10-31 10:26:11 +01:00
Paul Cornett
8c99df373a Fix handling of scaled bitmaps in wxToolBar with GTK+3
We have to draw them ourselves to get the size right.
See #18225
2018-10-30 22:59:07 -07:00
Vadim Zeitlin
8a76b8072a Merge branch 'text-event-tests'
Improve and extend wxTextCtrl unit tests.

See https://github.com/wxWidgets/wxWidgets/pull/996
2018-10-31 02:27:16 +01:00
Václav Slavík
e5beb4e93f Improve wxDataViewMainWindow::RefreshRow speed
RefreshRow() is called very frequently, and in particular after every
ItemChanged notification. Calling GetEndOfLastCol() in it repeatedly is
extremely inefficient in presence of auto-sizing columns, and doesn't
make much sense anyway - controls with significant space unoccupied by
columns are rare, and rendering of such unused space is efficient (just
background erase). It is therefore more performant to simply refresh
the entire row instead of repeatedly and expensively calculating the
smallest rectangle that needs repainting.

Fixes previously wrong calculation of the refreshed rectangle in
RefreshRows() in the process.

Fixes major performance regression introduced in
77c7c80696.

Closes https://github.com/wxWidgets/wxWidgets/pull/970
2018-10-30 23:50:40 +01:00
Silent
6fff1c37b5 Avoid using mismatched translations for wxWizard buttons
Cache labels for "Next>" or "Finish" button in wxWizard so that their
translations stay consistent throughout wizard's lifetime: previously,
this button could use a label in a different language if the currently
used translations have changed since the wizard creation, as this label
was recreated on every page change, unlike the other labels which were
only translated once in the very beginning.

Closes https://github.com/wxWidgets/wxWidgets/pull/1000
2018-10-30 23:45:12 +01:00
Vadim Zeitlin
28e9ea6bd6 Simplify wxGenericImageList::Add() logic
Also improve the readability of the assert condition in it, this should
hopefully make it simpler to understand.

No real changes.
2018-10-30 22:40:48 +01:00
Vadim Zeitlin
26c6db4b90 Replace wxGenericImageList::m_{width,height} with m_size
Using a single wxSize variable is slightly simpler and shorter than
using 2 ints.

No real changes.
2018-10-30 22:01:32 +01:00
Stefan Csomor
9a05410470 Adding IsSolid to wxColour
Under macOS colors can be patterns, then accessors for RGB values are useless, IsSolid returns true if the color can be expressed in RGB values at all.
2018-10-30 20:53:35 +01:00
Vadim Zeitlin
c374eefd34 Fold wxOSX-specific wxImageList into generic version
Get rid of wxOSX wxImageList implementation as it was 99% identical to
the generic version and the non-identical parts should really have been
made part of the generic version too from the beginning.

Notably, use GetScaled{Width,Height}() in Add() method in the generic
version too now.
2018-10-30 16:28:07 +01:00
Vadim Zeitlin
a2a3518b71 Also remove wxImageList::Replace(wxIcon) overload from wxOSX
This one is harmless, unless Add() overload removed by the previous
commit, but still unnecessary.
2018-10-30 16:28:07 +01:00
VZ
3ab2bfd62a Remove unused wx/osx/icon.h header (#998)
This header isn't necessary any longer after the changes of
0bdd7e5f48
2018-10-30 09:34:19 +01:00
VZ
d118ca6c56 Remove wxImageList::Add() overload taking wxIcon from wxOSX (#997)
This is not necessary as wxIcon is implicitly convertible to wxBitmap
anyhow, so calling Add(icon) works using the existing Add(wxBitmap)
overload, and is actually harmful because of the wrong icon size check
in this function, which used physical bitmap size instead of the logical
(scaled) size.

Closes #18188.
2018-10-30 09:31:15 +01:00
Vadim Zeitlin
f3c148cd4a Verify that wxTextCtrl::ChangeValue("") doesn't generate events
Check that changing the value of an already empty control to empty
doesn't result in any events.

See #18264.
2018-10-30 01:35:32 +01:00
Vadim Zeitlin
602b4a6863 Run all wxTextEntry unit tests for wxTextCtrl too
Comment stated that InsertionPoint() didn't pass, but it was actually
already running (and passing) and the only excluded test was the
TextChangeEvents() one which really should pass for multiline controls
as well, so run it too.
2018-10-30 01:34:27 +01:00
Vadim Zeitlin
53f527726e Merge branch 'use-scrollbar-fixes'
Minor fixes, mostly add wxUSE_SCROLLBAR guards.

See https://github.com/wxWidgets/wxWidgets/pull/989
2018-10-29 23:15:39 +01:00
Vadim Zeitlin
9d717a1204 Replace wxUSE_DATEPICKCTRL with wxUSE_TIMEPICKCTRL in #endif too
Complete the change of 93d71116b7
2018-10-29 23:14:30 +01:00
Vadim Zeitlin
a34bedd7b5 Revert "Add guard over wxMSWDateControls"
This reverts commit f1fa6d5ea2 which
doesn't seem correct nor necessary.
2018-10-29 23:12:57 +01:00
Vadim Zeitlin
8890a25db3 Merge branch 'setup-h-cmake' of https://github.com/MaartenBent/wxWidgets
Fix issues with generating setup.h.in.

See https://github.com/wxWidgets/wxWidgets/pull/994
2018-10-29 15:18:43 +01:00
Vadim Zeitlin
ea8d65dc83 Merge branch 'cmake_misc' of https://github.com/TcT2k/wxWidgets
CMake documentation improvements and increase MSVC warnings level.

See https://github.com/wxWidgets/wxWidgets/pull/993
2018-10-29 15:16:54 +01:00
Tobias Taschner
18db61d568 Fix MSW wxCheckOsVersion() without manifest
Reimplement wxCheckOsVersion() to use wxGetOsVersion() on windows.

An executable without the Windows 8.1+ compatibility info in a
manifest would not detect the version based on the VerifyVersionInfo()
API previously used.

Closes https://github.com/wxWidgets/wxWidgets/pull/992
2018-10-29 15:15:41 +01:00
Vadim Zeitlin
5d06593ae1 Ensure that wxThread::Pause() suspends the thread immediately
Surprisingly, ::SuspendThread() doesn't actually do it, but only
schedules the thread for suspension in some undetermined near future.
This could result in problems as Pause() could exit, releasing the CS
protecting wxThread internal data in the main thread, and allowing the
worker thread to enter it (e.g. in its TestDestroy()) before being
actually suspended, meaning that the thread got suspended inside a CS,
which resulted in later deadlocks.

Fix this by calling ::GetThreadContext() which is supposed to ensure
that the scheduler does really suspend the thread before it returns (as
it's impossible to get the context of a thread while it's running).

Closes #18137.
2018-10-29 14:55:09 +01:00