Commit Graph

65412 Commits

Author SHA1 Message Date
Artur Wieczorek
c112c20d5f Optimize calculating position of the right edge of the last cell
Cell widths are invariant during the drawing so calculation can be done once, not on every loop.
2018-12-26 11:37:31 +01:00
Artur Wieczorek
5c0acce694 Hide editor button while column splitter is being dragged
Main editor and its button (secondary editor) should be both hidden while dragging the splitter because it's misleading when one part of the property editor disappears and another part remains visible.
2018-12-26 11:36:12 +01:00
Artur Wieczorek
5366a1dfbb Iterate over all items of wxVector with column widths with iterator 2018-12-26 11:35:19 +01:00
Artur Wieczorek
b3563b690c Access last element of wxVector with dedicated method
Use reference returned by back() method instead of referencing by the index of the last element.
2018-12-26 11:34:26 +01:00
Artur Wieczorek
7f29ab97df Optimize calculating column widths
Use iterative algorithm instead of recursive one to adjust column widths.
2018-12-26 11:33:10 +01:00
Artur Wieczorek
e74e345e04 Use dedicated function to check if array of selected properties is empty 2018-12-26 11:32:09 +01:00
Artur Wieczorek
d85a03b561 Don't make unnecessary calls to the member function
Use already obtained reference to the list of selected properties instead of retrieving the list by calling GetSelectedProperties() function.
2018-12-26 11:31:21 +01:00
Artur Wieczorek
6c36554ae1 Get rid of unnecessary variable in wxPropertyGrid 2018-12-26 11:30:29 +01:00
Artur Wieczorek
e9b45f19f9 Fix index of dragged splitter sent with EVT_PG_COL_DRAGGING
Re-centering the splitter with mouse double-click works only if we have two columns so only splitter 0 can be clicked.
2018-12-26 11:29:40 +01:00
Artur Wieczorek
1042521706 Refresh wxPropertGrid after resetting column sizes
Grid needs to be redrawn with new splitters positions.

Closes #18312.
2018-12-26 11:28:17 +01:00
Jeff Bland
2937369869 CMake: Fix monolithic build
Monolithic build regressed with commit
815d288c4fedba044a9863c883d6dd9f53526668 "Set wx-config base, gui and
built libraries".

The code queries each possible target name and creates lists of the
valid targets. In the monolithic build, none of the normal target names
exist, so the list is empty. The empty list is then passed to STRIP,
causing cmake to fail due to not having enough arguments.

By quoting the STRIP params we can pass an empty argument and thus
prevent the error of not-enough arguments.

See https://github.com/wxWidgets/wxWidgets/pull/1100
2018-12-25 18:50:06 +01:00
Cătălin Răceanu
a207862210 SetValue() on 'single' radio button must not reset others
Radio buttons with wxRB_SINGLE style are not set initially. When
getting set, the code attempts to unset other radio buttons that do not
have wxRB_GROUP | wxRB_SINGLE style.

Closes https://github.com/wxWidgets/wxWidgets/pull/1099
2018-12-24 16:14:49 +01:00
Richard Smith
0fbf87d11b Split single/multi line behaviour in Qt wxTextCtrl
Introduce wxQtEdit class and wxQtMultiLineEdit and wxQtSingleLineEdit
derived classes instead of using ifs in many wxTextCtrl methods, making
the code more clear and maintainable.

Also fix some wxTextCtrl-related unit test failures with wxQt and
disable some other ones which still don't pass.

Closes https://github.com/wxWidgets/wxWidgets/pull/1039
2018-12-24 01:52:07 +01:00
Artur Wieczorek
3b6fcbab6d Update wxPGArrayEditorDialog docs 2018-12-24 00:05:23 +01:00
Artur Wieczorek
1e69a898c2 Use quotes and not angle brackets around the includes of wxWidgets itself 2018-12-24 00:01:31 +01:00
Artur Wieczorek
79b71cf4ff Scale bitmap to wxPropertyGrid's row height
By design only bitmaps lower than row height are displayed within the cells.
Because on every platform default row height can vary so bitmap has to be explicitly scaled to the row height to ensure that it will be initially displayed on every platform.

Closes #18310.
2018-12-24 00:00:14 +01:00
Vadim Zeitlin
270ad54abe Revert all recent changes to wxTranslations
The latest changes to wxTranslations::AddCatalog() behaviour were not
backwards-compatible and also had other problem, so revert them for now,
even if this means that #18227 has to be reopened.

This is a combination of the following commits:

----

Revert "Fix regression in wxTranslations::AddCatalog()"

This reverts commit 14e905858d.

See #18297.

----

Revert "Fix crash in translations code when no translations are found"

This reverts commit 80904d1bc7.

See #18299.

----

Revert "Rename new wxTranslations method to GetAcceptableTranslations()"

This reverts commit 20b02d6169.

----

Revert "Load catalogs for all preferred languages, if they exist"

This reverts commit 2d784da2ee.

----

Revert "Allow getting all usable translations languages"

This reverts commit 5d08e404c7.

----

See #18227, #18300.

Closes #18302.
2018-12-23 17:33:49 +01:00
Vadim Zeitlin
2c737bfbc0 Revert change to m_order assignment in wxRearrangeList::Create()
This partially reverts 7e1b64a2eb as it
broke wxRearrangeList because assigning to m_order[n] used an
out-of-range index.

Another possible fix would be to replace reserve() call added in that
commit with resize(), but there doesn't seem to be any advantage in
assigning elements one by one, rather than all at once, as it had been
done before, so just revert this change instead.

See #17836.
2018-12-23 17:12:26 +01:00
chris2oph
a6dc3c78ab Really add items to the listbox in wxQt wxListBox::Create()
The initial choices were just ignored, do add them to the Qt listbox
now.

Closes https://github.com/wxWidgets/wxWidgets/pull/1094
2018-12-23 17:09:59 +01:00
Sebastian Walderich
e9cbbede00 Implement wxAuiNotebook::GetBestSize()
Compute the best size of the notebook, taking into account all the
different layout possibilities, and add a test checking that this works
as expected.

Closes https://github.com/wxWidgets/wxWidgets/pull/1085
2018-12-23 17:05:09 +01:00
Vadim Zeitlin
d3eb5b38aa Don't crash when drawing 0-sized wxAuiTabContainer in debug build
Attempting to create a bitmap with 0 width or height results in an
assertion failure, which is fatal, as it happens in wxEVT_PAINT handler
and so quickly results in reentering it and asserting again and
recursive assert failures terminate the application.

Just avoid doing it, there is nothing to paint anyhow if the associated
rectangle is empty.

See https://github.com/wxWidgets/wxWidgets/pull/1085
2018-12-23 17:05:09 +01:00
Maarten Bent
db4c983881 CMake: Add missing stc and wxscintilla compile flags
This fixes absence of highlighting and folding in CMake builds.

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

Closes #18306.
2018-12-23 15:21:13 +01:00
Artur Wieczorek
7e297ee667 Compilation fix for PCH-less build
Include the header required by newly implemented
wxPGArrayEditorDialog::SetNewButtonText.
2018-12-23 11:28:40 +01:00
Artur Wieczorek
b252d1660d Cleanup wxPGArrayEditorDialog docs 2018-12-23 11:04:03 +01:00
Artur Wieczorek
0fbc4cd6ab Allow setting custom tooltip text for "New" button in wxPGArrayEditorDialog
Ability to change the tooltip can be useful if standard text "New item" is not descriptive enough.
2018-12-23 11:03:46 +01:00
Artur Wieczorek
686380c331 Initialize all wxPGArrayEditorDialog members in ctor
Initialize members of wxPGArrayEditorDialog class in its Init() method to have just created object in well-defined state.
2018-12-23 11:01:05 +01:00
Artur Wieczorek
8432726ba8 Make string literal wxChar* string
This macro parameter is passed to wxArrayStringProperty::OnButtonClick() parameter of wxChar* type. char* string interpreted in this function as a wxChar* string results in obtaining invalid Unicode characters.
This fixes a regression introduced in b70ed2d8c8.

Closes #18307.
2018-12-23 11:00:35 +01:00
Pavel Pimenov
9c77e0b2a5 Remove unused variables
This fixes PVS Studio static analyzer warnings:

V808 'errMsg' object of 'wxString' type was created but was not utilized. docview.cpp 1182
V808 'search' object of 'wxString' type was created but was not utilized. dirctrlg.cpp 697
V808 'filename' object of 'wxString' type was created but was not utilized. dirctrlg.cpp 697

(see full report at http://www.fly-server.ru/pvs-studio/wxWidgets-core/)

Closes https://github.com/wxWidgets/wxWidgets/pull/1096
2018-12-21 17:45:26 +01:00
Vadim Zeitlin
54f96392be Merge branch 'qt_fix_button_crash' of https://github.com/GeoTeric/wxWidgets
Fix crashes when loading wxButton from XRC in wxQt

See https://github.com/wxWidgets/wxWidgets/pull/1091
2018-12-21 17:44:49 +01:00
Vadim Zeitlin
622deec262 Replace wxSizer::RecalcSizes() with RepositionChildren()
The new method takes minimal size just computed by RecalcSizes() as its
argument making it unnecessary to store it as a member variable in the derived
classes such as wx{Box,FlexGrid}Sizer.

The old method can still be overridden for compatibility and by the derived
class that don't need minimal size when updating children.
2018-12-20 23:36:51 +01:00
Pavel Kalugin
7d9675472d Refine documentation related to wxTimePickerCtrl
Specify event types, corresponding to EVT_TIME_CHANGED and
EVT_DATE_CHANGED macros, and update 'see also' sections.
2018-12-20 19:00:42 +01:00
Vadim Zeitlin
9877f207d1 Merge branch 'dvc-last-col-resize'
Improve resizing of the last column in generic wxDataViewCtrl.

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

Closes #18295.
2018-12-20 18:57:48 +01:00
Graham Dawes
57b636b2d4 Fix for NULL pixmap when setting button icon in wxQT 2018-12-20 10:33:01 +00:00
Graham Dawes
bc4d3a4554 Initialise m_qtPushButton in wxAnyButton's constructor. 2018-12-20 08:06:46 +00:00
Jay Nabonne
c6d3b9c0b9 Fix background colour used by DrawEllipse() in wxQt
wxDC::DrawEllipse() used to use the text background for filling the
ellipses drawn with transparent pen, for some reason. According to
f9b28cd4325f42936d3122bfe7c847354bbbfee9 which changed this (this commit
was part of df13791078 merge done with
svn), this was done for compatibility with wxGTK, but wxGTK definitely
doesn't do it now and apparently never did, so there must have been some
mistake.

Simply remove the extra code using the text background for consistency
with this method behaviour in the other ports and also other methods
behaviour in the same port.

Closes https://github.com/wxWidgets/wxWidgets/pull/1087
2018-12-19 23:19:12 +01:00
Jay Nabonne
c47c7de5ea Allow overriding the label for stock buttons in wxQt
Stock label should only be used if passed label is empty. Otherwise,
passed label should override the default value.

Closes https://github.com/wxWidgets/wxWidgets/pull/1086
2018-12-19 13:46:20 +01:00
Graham Dawes
ae20edb539 Fix several problem with wxMemoryDC in wxQt
Under wxQT, wxMemoryDC was previously rendering to a temporary image
which was only being blitted back to the original wxBitmap when either
the DC wx destroyed or a new bitmap was selected (via SelectObject).

With these change wxMemoryDCImpl now draws directly to the bitmap
managed by wxBitmap, this makes the behaviour more consistent with the
MSW and GTK implementations.

Closes https://github.com/wxWidgets/wxWidgets/pull/1083
2018-12-19 13:44:52 +01:00
Tomasz Słodkowicz
80904d1bc7 Fix crash in translations code when no translations are found
Fix another regression in wxTranslations in 3.1.2 and check that the
vector of acceptable translations is not empty before using its first
element.

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

Closes #18299.
2018-12-18 04:50:47 +01:00
Tomasz Słodkowicz
14e905858d Fix regression in wxTranslations::AddCatalog()
Do load the catalog corresponding to the language of "msgid" strings in
the source code, only skip the languages strictly less preferred than
it.

This avoids incompatibilities with pre-3.1.2 behaviour and avoids
breaking existing applications relying on the old behaviour.

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

Closes #18297.
2018-12-18 04:50:07 +01:00
Graham Dawes
b0eca3bdde Fix some more uninitialised wxCairoContext fields in wxQt
Closes https://github.com/wxWidgets/wxWidgets/pull/1084
2018-12-17 17:46:38 +01:00
Vadim Zeitlin
50e098437d Document lack of custom editors in Mac wxDataViewCtrl
wxDataViewCustomRenderer::CreateEditorCtrl() is currently never called
there.
2018-12-17 14:07:12 +01:00
Vadim Zeitlin
f9028845d8 Merge branch 'cmake-install' of https://github.com/MaartenBent/wxWidgets
Install wxrc on all platforms and other fixes, including better support
for external libraries.

See https://github.com/wxWidgets/wxWidgets/pull/1072
2018-12-16 23:58:04 +01:00
Vadim Zeitlin
5b2e992947 Document wxThread::Delete() behaviour more precisely
Delete() doesn't (and can't, under Unix) wait for the detached threads,
although it does do it under MSW (but arguably shouldn't), so it can't
retrieve the thread exit code there.

Document that its "rc" argument is only useful with joinable threads.

Closes #18240.
2018-12-16 00:02:07 +01:00
Vadim Zeitlin
8856715d2d Use wxVector instead of wxList for wxDataViewCtrl columns storage
As wxDataViewColumnList was never public, it should be fine to not
define it any more and use a vector instead.

This makes the code more clear and also marginally more efficient.
2018-12-15 14:43:47 +01:00
Vadim Zeitlin
2340a16d18 Allow increasing the size of the last column in wxDataViewCtrl
Previously, the last column couldn't be effectively resized at all, as
its size was always automatically set to the remaining width of the
window after subtracting the widths of all the previous columns. Now
this is only done if this remaining width is greater than the width
given to the column by the user or by the program.

Effectively, this means that the user can now drag-resize the column to
increase its size (at the price of showing the horizontal scrollbar).

See #18295.
2018-12-15 14:27:52 +01:00
Graham Dawes
8fa32a40a9 Fix m_qtPainter not being initialised in wxCairoContext ctor
For some reason one of the overloads of the c'tor left the m_qtPainter
field set to NULL rather than asking the wxDC for it's painter.

The rest of the class assumes the painter is not NULL.

Closes https://github.com/wxWidgets/wxWidgets/pull/1075
2018-12-14 17:41:55 +01:00
Vadim Zeitlin
68bb67c009 Revert "Prevent the user from resizing the last wxDataViewCtrl column"
This reverts commit 24054c95d8 as it
actually should be possible to increase the size of the last column,
even if this shows the horizontal scroll bar.
2018-12-13 23:46:25 +01:00
Vadim Zeitlin
24054c95d8 Prevent the user from resizing the last wxDataViewCtrl column
This is useless as this column will be automatically expanded to fill
all the available space anyhow.

See #18295.
2018-12-13 23:42:15 +01:00
Vadim Zeitlin
841c14c37c Fix expanding last wxDataViewCtrl column in the generic version
The code added in 4156e1a5c9 didn't quite
work correctly because it used the old size of the window, before it was
resized, and not the new size. This was almost unnoticeable when
drag-resizing the window, but very noticeable when maximizing the
containing TLW, as could be seen on the 3rd page of the dataview sample,
for example, where the last column kept its size instead of expanding.

See #13904, #18295.
2018-12-13 18:50:18 +01:00
Graham Dawes
db15e99884 Fix wxBitmap::GetRawData() in wxQt
This method used to return a dangling pointer to a temporary buffer,
which resulted in a crash when using it, e.g. in the unit test.

Fix this by keeping a QImage as a member in wxBitmapRefData, so that the
pointer to its data remain valid until UngetRawData() is called.

Also check that GetRawData() returns a non-null pointer in the test.

Closes https://github.com/wxWidgets/wxWidgets/pull/1067
2018-12-13 15:24:54 +01:00