Commit Graph

66323 Commits

Author SHA1 Message Date
Vadim Zeitlin
2ce16cba08 Implement wxTreeCtrl::GetFirstChild() in terms of GetNextChild()
This makes the code slightly simpler, as there is just one function
instead of two, and also changes the meaning of the value stored in the
cookie parameter as a side effect: previously, it was the index of the
last retrieved item, while now it's the index of the next item to
retrieve.

The difference is not huge, but the latter is more usual and, more
importantly, avoids a stack overflow due to infinite recursion in the
treectrl sample, which assumed that cookie is never null after a
successful call to GetFirstChild(). The code in the sample is arguably
incorrect, as the cookie is supposed to be opaque, but it's still better
to avoid crashing, especially because similar code is almost certainly
present in user code if it was copied from the sample.
2019-06-29 20:49:47 +02:00
Vadim Zeitlin
21b2eef7e5 Make platform test slightly more readable
Also add a comment explaining what are we doing here.

And fix the #endif comment to match the updated #if condition.

No real changes.
2019-06-29 20:49:47 +02:00
Vadim Zeitlin
32e3846e27 Remove private headers from the public headers list
Private headers should not be installed and so must not be included in
the HDR variables in the file lists.
2019-06-29 20:49:47 +02:00
Vadim Zeitlin
a20cb4f680 Make new source file non-executable 2019-06-29 20:49:47 +02:00
Vadim Zeitlin
44634cbf90 Merge branch 'qt_tree_control' of https://github.com/GeoTeric/wxWidgets into qt-fixes
See https://github.com/wxWidgets/wxWidgets/pull/1225
2019-06-29 20:49:25 +02:00
Artur Wieczorek
a4ba437aeb Fix handling wxHeaderCtrlSimple events in widgets sample
Generic implementation of wxHeaderCtrlSimple processes EVT_HEADER_xxx internally so we cannot block processing these events in our handlers.
2019-06-29 11:16:31 +02:00
Artur Wieczorek
ec56795572 Fix recursion in calling const getters
We have to explicitly call non-const getter to avoid recursive calls of the const getter.
2019-06-29 11:16:30 +02:00
Artur Wieczorek
d55cf1fc1f Fix marking wxPGIterator template class with dllexport/import attributes
It's not allowed to mark the class template. Only explicit instantiation can be marked with dllexport/import attributes.
2019-06-29 11:16:29 +02:00
Artur Wieczorek
d0a61a09ec Make validation helper functions private in all numeric wxPG properties
wxUIntProperty::DoValidation() is already declared as private and the same access level should be applied to DoValidation() in other numeric properties because these functions are helpers intended for internal use only.
2019-06-29 11:16:01 +02:00
Artur Wieczorek
48adc38bbb Refactor code for numeric validation in numeric wxPG properties
Move template function NumericValidation() to wxNumericProperty because all data necessary to validate the value are available here: acceptable value range, SpinCtrl editor value wrapping mode, etc.
2019-06-29 11:13:14 +02:00
Artur Wieczorek
69632371e3 Implement wxNumericProperty as a base class for all wxPG numeric properties
All numeric properties (wxIntProperty, wxUIntProperty, wxFloatProperty) share some features (like specific attributes, numeric validation, SpinCtrl editor support) so for the sake of clear design it would be good to derive them from the common base class (wxNumericProperty) in which all shared functions are implemented. This class is not intended to be instantiated so it's an abstract class.
2019-06-29 11:13:13 +02:00
Artur Wieczorek
bd1b5c4111 Simplify calls for numeric validation
Instantiate NumericValidation() template directly for required data type in DoValidation() and avoid this way intermediate conversions to another data types.
2019-06-29 11:12:41 +02:00
Artur Wieczorek
e96bc37066 Refactor template function to validate numeric wxPG properties
Duplicating the code of the entire NumericValidation() template function just for one specialization (for double value type) seems to be an overkill. Only small fraction of the code (to round the validated value) is really dependent on the value type and this part can be moved to the template function GetRoundedValue() which in turn can be specialized as required.
2019-06-29 11:12:40 +02:00
Artur Wieczorek
dbb727a716 Use dedicated function to check if the mouse button is pressed 2019-06-29 11:12:39 +02:00
Artur Wieczorek
7a5fbbc06f Use separate event handlers to handle various mouse events in wxPGSpinButton
One common event handler for all mouse events is less readable than code split into separate handlers dedicated to specific event type.
2019-06-29 11:12:38 +02:00
Artur Wieczorek
8c0a210a75 Make wxPGProperty an abstract class
wxPGProperty is intended to be only a base class for property classes and therefore shouldn't be instantiated directly.
2019-06-29 11:11:35 +02:00
Artur Wieczorek
315ff49136 Fix setting column widths after changing the page in wxPropertyGridManager
Whenever page is changed header column widths have to be adjusted and all columns have to updated.
2019-06-29 11:08:45 +02:00
Ilya Sinitsyn
feacaf8714 Use wxWindow as a control for wxGridCellEditor
Use wxWindow instead of wxControl in wxGridCellEditor to allow using
any window as an editor control, as it doesn't need to be a wxControl.

Closes https://github.com/wxWidgets/wxWidgets/pull/1370
2019-06-28 16:47:56 +02:00
laptabrok
ea68934b8e Work around problems with wxGLCanvas resizing under macOS 10.14.5
This OS update has broken resizing of NSOpenGLView, which worked
correctly up until to 10.14.4.

Work around it by preventing the default implementation of update from
being executed. It's not clear why should it help with the problem, but
it does.

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

Closes #18402.
2019-06-28 14:11:01 +02:00
Dummy
668f74f4d9 Fix regression in wxDC::GetPPI().y under GTK 2
This fixes a typo in 3dc16a7419 which
prevented m_mm_to_pix_y from ever being set to non-zero value.

Closes #18425.
2019-06-28 13:55:45 +02:00
Walter Cheuk
9aef9e59fc Traditional Chinese translations update from Walter Cheuk 2019-06-28 13:42:33 +02:00
Vadim Zeitlin
906fc891c8 Disable LZMA support when --disable-sys-libs is used
It seems better to disable LZMA rather than silently building the
binaries depending on an external library when we were explicitly
requested not to do it.
2019-06-27 16:18:20 +02:00
Vadim Zeitlin
789d374650 Fix line numbers in stack traces under macOS
The last digit was truncated as the code discarded the trailing "\n"
which wasn't really there, as ReadLine() helper function already removed
it, and so ended up removing the last digit of the line number,
resulting in mostly plausibly looking but completely wrong line
information in the assert dialog.
2019-06-27 16:12:26 +02:00
Anton Triest
584e2715eb Add XRC handlers for wxDataViewCtrl and related classes
The same handler is also used for wxDataViewListCtrl and
wxDataViewTreeCtrl.

Closes #18424.
2019-06-27 12:39:53 +02:00
Vadim Zeitlin
6ee5184171 Check window validity in wxNonOwnedWindow::Update() in wxMac too
This was already done in the other functions, but not this one,
resulting in a crash if it was called for an object with null m_nowpeer
(e.g. before it's created or when it's not a real wxNonOwnedWindow
object as when it's a subobject of wxTDIChildFrame).

See #18423.
2019-06-26 18:37:31 +02:00
Razvan Macovei
7f768eda2d Fix wxMDIChildFrame screen position in TDI-based implementations
This notably fixes the problem with wxAuiMDIChildFrame::GetScreenRect()
returning the wrong window position since the changes of
c1bcf16eb9.

Closes #18423.
2019-06-26 18:04:16 +02:00
Vadim Zeitlin
8afa383097 Use PlatformToolsetVersion in MSVC binaries usage instructions
This should work for any compiler version, at the cost of being slightly
less clear.

Closes #18422.
2019-06-25 17:00:27 +02:00
Vadim Zeitlin
fb2f5916b2 Add backticks around more symbols in MSW install docs
No real changes, just use backticks more consistently and extensively.
2019-06-24 18:28:25 +02:00
Vadim Zeitlin
60a8ceb57c Fix more occurrences of $(variables) eaten by Doxygen
This replaces and extends the previous commit by using `$var` instead of
`$(var)` when this makes sense and using the ugly workaround for Doxygen
expanding environment variables even inside Markdown backticks elsewhere.

Also use backticks around more strings.
2019-06-24 18:19:23 +02:00
Vadim Zeitlin
a5d7f95877 Preserve "$wxwin" verbatim in Doxygen output
It turns out that Doxygen expands $(VAR) into the actual value of the
VAR environment variable on the machine where it runs, which is
definitely not what we want in the instructions telling people to use
"$wxwin" in their projects, so remove the parentheses to prevent Doxygen
from expanding it.

Another alternative would be to escape "$" with a backslash, but this
would make the source markdown file uglier.
2019-06-24 02:37:46 +02:00
Igor Korot
b383d539b5 Make png2c script compatible with Python 3 too
Use print() and byte strings to make the code compatible with Python 3,
while also keeping it compatible with Python 2 (>= 2.6, at least).

Closes https://github.com/wxWidgets/wxWidgets/pull/1348
2019-06-21 02:13:46 +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
e081d2210f Make wx/richtext/richtextstyledlg.h self-sufficient
Don't require including wx/dialog.h before including this one.

Closes #18420.
2019-06-20 16:06:36 +02:00
Graham Dawes
a8257855c3 Fix mismatched malloc/delete in wxQt wxApp
m_qtArgv elements are allocated using wxStrdupA(), so must be free()d
and not deleted.

Closes https://github.com/wxWidgets/wxWidgets/pull/1363
2019-06-20 16:00:35 +02:00
Vadim Zeitlin
61e84dc2fa Ignore MSVC linker warnings about empty object files
A number of object files in wxCore can end up being empty due to the
corresponding wxUSE_XXX options being set to 0. This is normal and
getting tons of warnings from MSVC during the build about it wasn't
helpful.

It turns out that these warnings can be suppressed by using the
undocumented, but described at

http://www.geoffchappell.com/studies/msvc/link/link/options/ignore.htm

"/ignore" option, so do this to finally get a clean build.
2019-06-20 01:54:01 +02:00
Vadim Zeitlin
8f47728fd2 Merge branch 'grid-appearance-fixes'
Draw row/columns labels better in the disabled state and improve
appearance of wxGrids with a border.

See https://github.com/wxWidgets/wxWidgets/pull/1358
2019-06-19 16:44:16 +02:00
Mick Waites
af5b122b2b Stop multiple selection changed messages being sent when calling DeleteChildren on a TreeItem. 2019-06-19 14:05:31 +01: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
Vadim Zeitlin
5b525ed201 Advise using a border with a wxGrid not showing column/row labels
In this case a border can be useful to visually separate the grid from
the surrounding area as without it there is no separation at all.
2019-06-18 00:58:51 +02:00
Vadim Zeitlin
18956125d3 Fix copy-and-pasto in wxGrid::HideColLabels() documentation
The old sentence didn't make sense for this function.
2019-06-18 00:55:16 +02:00
Artur Wieczorek
c5d73f819a Keep track of wxHeaderCtrl events in widgets sample 2019-06-16 19:52:42 +02:00
Artur Wieczorek
2a24991110 Use wxVector<> instead of macro-based wxArray 2019-06-16 19:51:52 +02:00
Artur Wieczorek
f4e37e57e4 Get rid of unnecessary const casts
A pointer to unqualified type are converted implicitly to a more cv-qualified type.
2019-06-16 19:50:57 +02:00
Artur Wieczorek
b064608c2a Use const_cast to change the constness 2019-06-16 19:50:08 +02:00
Artur Wieczorek
2ebdfb7a40 Remove obsoleted comments 2019-06-16 19:49:01 +02:00
Artur Wieczorek
efefc97aac Use template instead of macro to generate wxPropertyGridIterator class 2019-06-16 19:47:33 +02:00
Artur Wieczorek
98c1b057e8 Use standard wxVariant instead of wxPropertyGrid-specific WXVARIANT
There is no need to use WXVARIANT for data types directly supported by wxVariant.
2019-06-16 19:46:44 +02:00
Artur Wieczorek
d404ff02a1 Support tooltips in wxPropertyGrid if support for tooltips enabled is globally 2019-06-16 19:45:40 +02:00
Artur Wieczorek
8c187ffc7a Get rid of commented out and unused macro definitions 2019-06-16 19:45:39 +02:00
Artur Wieczorek
6c437d12ab Get rid of iteration macros in wxPropertyGridPageState
Replace these macros with code they substituted for the sake of readability.
2019-06-16 19:45:39 +02:00