Commit Graph

67961 Commits

Author SHA1 Message Date
Vadim Zeitlin
1250eac850 Don't use GUI 3rd party libraries for non-GUI libraries
Don't use include paths for jpeg, png and tiff libraries when building
non-GUI projects, such as base, net or xml, and don't make these
libraries depend on the GUI 3rd party libraries neither.

No real changes, just simplify things a bit.
2020-02-11 23:19:31 +01:00
Vadim Zeitlin
ec091c9f2b Don't override CFLAGS etc in configure-generated makefile
CPPFLAGS, CFLAGS, CXXFLAGS and LDFLAGS are supposed to be under
user-control and putting configure-determined options in them broke
something as simple as running "make CXXFLAGS=-Wno-some-extra-warning"
because this overrode the CXXFLAGS set by configure and required for
build.

Improve this by using WX_*FLAGS in the generated makefile and leaving
the user-controlled FLAGS alone. This is still not ideal as running
"configure CFLAGS=-DFOO" and then "make CFLAGS=-DBAR" will define both
FOO and BAR, as configure copies CFLAGS to WX_CFLAGS, and so setting it
on make command line won't override it, as it should, but this should be
a much more rare and also much less severe problem, so we should be able
to live with it for now.

Normally this commit shouldn't result in any user-visible changes, i.e.
it shouldn't break any previously working scenarios and only make some
previously broken ones work.
2020-02-11 23:19:31 +01:00
Vadim Zeitlin
13b0981eb9 Get rid of WXCONFIG_ONLY_CPPFLAGS variable in configure
This variable was set and used exactly once, so just remove it to
simplify things.

No real changes.
2020-02-11 23:19:30 +01:00
Kvaz1r
6697b576b2 Close AUI MDI children when the parent frame is closed
This ensures that the parent frame doesn't close if any of the children
can't be closed and also that all children are closed before the parent
if they do agree to close.

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

Closes #15170.
2020-02-11 22:41:26 +01:00
Vadim Zeitlin
789858a4d9 Merge branch 'secret-service-check'
Check if secret service can be used under Unix.

See https://github.com/wxWidgets/wxWidgets/pull/1733
2020-02-11 22:36:03 +01:00
Vadim Zeitlin
b18169a0e4 Merge branch 'paint-debug'
Detect invalid use of wxPaintDC/wxPaintEvent better.

See https://github.com/wxWidgets/wxWidgets/pull/1732
2020-02-11 22:35:33 +01:00
Vadim Zeitlin
697d494caa Merge branch 'grid-attr-smart-ptr'
Use smart pointers in wxGrid code.

See https://github.com/wxWidgets/wxWidgets/pull/1731
2020-02-11 22:35:03 +01:00
Vadim Zeitlin
1d4aaba963 Merge branch 'ribbon-imagelist'
Use image list in wxRibbonBar.

See https://github.com/wxWidgets/wxWidgets/pull/1730
2020-02-11 22:34:13 +01:00
Vadim Zeitlin
a37e15ff1f Merge branch 'webview-js-escape'
Fix JS strings escaping in wxWebView.

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

Closes #18602.
2020-02-11 22:32:51 +01:00
Vadim Zeitlin
8fcf46f65c Forbid creation of wxPaintEvent objects from user code
This doesn't work anyhow, so it's better to prevent the code doing this
from compiling instead of getting run-time asserts or worse.

Also simplify construction of these events inside wxWidgets by passing
the window itself to the ctor instead of passing just its ID and calling
SetEventObject() separately later.

For consistency, do the same thing for wxNcPaintEvent too.
2020-02-10 23:03:01 +01:00
Vadim Zeitlin
f7f90a6111 Mention that wxSecretStore ctor can block
At least under Unix it can show a dialog asking to create a new key
ring.
2020-02-10 18:27:38 +01:00
Vadim Zeitlin
5a454d373b Optionally return error message from wxSecretStore::IsOk()
This allows to give at least some explanation about why the secrets
can't be stored to the user, e.g. they could search for a message such
as

The name org.freedesktop.secrets was not provided by any .service files

to find out that gnome-keyring package needs to be installed on their
system.

Note that this change means that under Unix an attempt to connect to the
secret service is now made when wxSecretStore is constructed and not
just when it's used for the first time, as before.
2020-02-10 18:23:59 +01:00
Vadim Zeitlin
fd84892e62 Use secret_service_clear_sync() in wxSecretStore
There doesn't seem to be any reason to use secret_service_xxx()
functions for Save() and Load(), but use simple API function
secret_password_clearv_sync() for Delete().

Use the equivalent function from the same API layer for it too instead.
2020-02-10 18:01:09 +01:00
Vadim Zeitlin
b680ba9596 Explicitly document that wxPaintEvent ctor must not be used
Objects of this type are only supposed to be created by wxWidgets
itself and not by user code.
2020-02-10 13:42:03 +01:00
Vadim Zeitlin
452c8dcfa3 Check that wxPaintDC is created correctly in code using wxMSW
Creating wxPaintDC for a window outside of any wxEVT_PAINT handler
already resulted in assert failures and crash due to using the empty
wxDidCreatePaintDC stack, but the assert message was not really clear,
so improve it by stating explicitly that wxPaintDC can only be created
from wxEVT_PAINT handlers.

Also check that wxPaintDC is being created for the correct window: this
wasn't detected at all before, but could still result in a lot of grief,
so check for this too.

Finally, create a new private header with the paint data stack variable
declaration instead of using "extern" to declare it manually in wxDC
code.
2020-02-10 13:39:08 +01:00
Vadim Zeitlin
f6158bc343 Remove wxHAS_PAINT_DEBUG and code guarded by it
This doesn't seem to actually be doing anything useful, as it only
checks that wxPaintDCImpl is not created without creating wxPaintDC
which is impossible to do accidentally anyhow.

This will be replaced by a more useful check in the next commit.
2020-02-10 13:14:08 +01:00
Artur Wieczorek
5fb7f89b14 Don't use vestor::data() to get access to the raw vector data
This method is available since C++ 11 so it can't be used currently.
2020-02-09 23:12:08 +01:00
Artur Wieczorek
55daa7103e Implement wxD2DGradientStopsHelper as a wxD2DResourceHolder
There is a dedicated template class wxD2DResourceHolder<T> to support
managing backend D2D resources and wxD2DGradientStopsHelper should be
derived from wxD2DResourceHolder<ID2D1GradientStopCollection> for the
sake of consistency with other D2D resource holders.
2020-02-09 20:46:40 +01:00
Artur Wieczorek
c7c3f337c2 Check index value with CHECK_MSG to avoid crashes 2020-02-09 20:39:06 +01:00
Artur Wieczorek
0b7f1e7e91 Always show label of unspecified value item while drawing popup menu
The label of "unspecified value" shouldn't be displayed in the edit field
but it should always be shown on the popup menu list.
2020-02-09 20:38:07 +01:00
Artur Wieczorek
687f679705 Fix creating wxPGChoiceAndButtonEditor controls
Since wxPGChoiceAndButtonEditor derives from wxPGChoiceEditor so making
a call to the base class virtual function CreateControls() from the child
CreateControls() is legitimate and more clean than calling to this
function in the another instance of the base class wxPGChoiceEditor
(which may not exists).
2020-02-09 20:34:09 +01:00
Artur Wieczorek
9dbd3b4946 Use ctor with default argument instead of providing specialized ctor
We can use 2-parameter ctor with default NULL value for second parameter
instead of providing a special 1-paramater ctor.
2020-02-09 20:31:58 +01:00
Artur Wieczorek
f2f9cbe619 Get rid of unused wxPGWindowList ctor
There is no use case for wxPGWindowList initialiazed with NULL data.
2020-02-09 20:19:52 +01:00
Paul Cornett
edc47d8fed Fix appearance of GTK3 single-line wxTextCtrl with non-default background
...and more text than will fit. See #18663
2020-02-09 08:13:01 -08:00
Vadim Zeitlin
2e64ba6d6e Also add wxGridCellEditorPtr and wxGridCellRendererPtr
This is similar to the previous commit and replaces manual calls to
DecRef() on the renderers/editors with the use of smart pointers for
them too.
2020-02-08 15:14:24 +01:00
Vadim Zeitlin
5f34b1749e Use wxGridCellAttrPtr instead of manual DecRef() calls
Provide GetAttrPtr() and GetCellAttrPtr() convenience functions that can
be used instead of the original Ptr-less versions to avoid the need to
manually call DecRef() on the returned wxGridCellAttr pointers.

No real changes, just simplify the code and make it safer.
2020-02-08 14:55:36 +01:00
Ilya Sinitsyn
e0c09c8438 Only overflow left-aligned cells in wxGrid
Doing it for cells using a different alignment doesn't work correctly
and it's not clear whether it really makes sense, so just don't do it at
all for now.

Closes https://github.com/wxWidgets/wxWidgets/pull/1726
2020-02-07 19:35:35 +01:00
Ilya Sinitsyn
a40acbb28e Add CanOverflow function to wxGridCellAttr
Add function to determine whether the cell will draw the overflowed text
to neighbour cells. Note that only left aligned cells currently can overflow.
2020-02-07 19:34:50 +01:00
Vadim Zeitlin
ad552d2117 Always use wxRibbonBar image lists in wxRibbonButtonBar
Assume that we can always rely on being a child of wxRibbonBar, and
always use its image lists.
2020-02-07 19:29:04 +01:00
Vadim Zeitlin
10c49631a3 Store any number of image lists in wxRibbonBar, not just two
The same wxRibbonBar can use multiple button bars with different icon
sizes, so 2 image lists are not enough. But OTOH there is no need to
distinguish between small and large images neither, so 2 may be also 1
too many.

Instead, use however many image lists we need, depending on the size.
For now, just store them in a vector and use linear search in it,
instead of using a map or, maybe, sorted vector, as we suppose there are
never going to be more than a couple of elements in this vector anyhow.
2020-02-07 19:21:33 +01:00
Vadim Zeitlin
18e8a68c1b Move code accessing bitmaps to wxRibbonButtonBarButtonBase too
This also improves encapsulation and allows to avoid duplicating calls
to DrawButtonBarButton().
2020-02-07 19:11:52 +01:00
Vadim Zeitlin
c6b3a6f2b4 Handle image lists in wxRibbonButtonBarButtonBase too
This makes more sense and also allows SetButtonIcon() to work with them.
2020-02-07 18:22:08 +01:00
Vadim Zeitlin
5a30886696 Move bitmap-related functions to wxRibbonButtonBarButtonBase
Improve encapsulation by making the function setting the members of a
class a member of the same class, instead of doing it outside of it.
2020-02-07 18:11:47 +01:00
Vadim Zeitlin
533fd61c5e Rename wxRibbonButtonBarButtonBase members to use m_ prefix
This will avoid conflict with the function parameters with the same
names in the upcoming commits.

No real changes yet.
2020-02-07 18:09:12 +01:00
Vadim Zeitlin
bd90e484cb Initialize image list positions in ctor
Also add a comment explaining how these indices work.
2020-02-07 17:52:54 +01:00
Vadim Zeitlin
d0fb1c973e Use correct type for image list position field
It's just an int and not a coordinate.
2020-02-07 17:49:41 +01:00
Vadim Zeitlin
557843c504 Remove wxRibbonButtonBar::m_ownerRibbonBar
There is already a function returning the containing ribbon bar, so just
use it instead.
2020-02-07 17:47:15 +01:00
Vadim Zeitlin
884c3a2dc2 Use wxImageList in wxRibbonBar unconditionally
There shouldn't be any reason not to do it other than possible bugs in
wxImageList itself, that should be fixed there.
2020-02-07 17:44:08 +01:00
Vadim Zeitlin
714fefb3e5 Use DLL export macro in wxImageList forward declaration
Do it if only for consistency.
2020-02-07 17:30:28 +01:00
wxBen
23ebbb139d Optionally support using wxImageList in wxRibbonBar
This allows to avoid consuming too many bitmap resources.

Closes #18657.
2020-02-07 17:25:34 +01:00
Ilya Sinitsyn
249e5add7e Redraw overflowed wxGrid cells to update the background
Before drawing the overflowing text we need to redraw the cells it
overflows into to avoid visual artefacts, that could appear even just
due to drawing new text over the same existing text due to
anti-aliasing. E.g. the text in the cell B2 in the grid sample visibly
changed appearance when repeatedly switching the current cell from A1 to
A2 and back again, just due to redrawing A2 contents.

Closes https://github.com/wxWidgets/wxWidgets/pull/1729
2020-02-07 00:12:01 +01:00
Vadim Zeitlin
a2b39f782b Don't call gtk_disable_setlocale() more than once
This is useless and just results in GTK warnings.
2020-02-06 15:59:45 +01:00
Kvaz1r
5663157674 Fix link between flags and buttons in wxAuiManager
Don't store the buttons used by a pane separately, but take them
directly from the flags, as this ensures that updating the pane flags,
e.g. by calling CloseButton(false), really removes the corresponding
button.

This also makes wxAuiPaneButton helper completely unnecessary, so just
remove it to simplify the code.

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

Closes #18223.
2020-02-05 16:02:51 +01:00
Vadim Zeitlin
f21c7f2d49 Add a test for C++ comments in code passed to RunScript()
This used to be broken, check that it does work now.
2020-02-05 15:55:50 +01:00
Vadim Zeitlin
a26e81ccb1 Remove test for \v escaping in wxWebView::RunScript()
This escape character doesn't seem to be handled by IE in the default
emulation mode and it's not worth complicating the test code just to
test for it, so simply remove it from the test.
2020-02-05 15:40:27 +01:00
Vadim Zeitlin
b7547dbd27 Don't use Hungarian notation for variables
Rename a variable to remove the ugly "sz" prefix.

Also don't use "s_" prefix for non-static variables.
2020-02-05 15:37:27 +01:00
nns52k
24c56a413b Fix string escaping in JS code in wxWebView
For example, a newline was escaped to be a backslash followed by a
newline, but it actually shall be a backslash followed by a character
'n'. It seemed okay with most of codes until in the case that C++ style
comments, i.e. single line comments, in the JavaScript codes. If the
newline characters are not escaped correctly, the JavaScript interpreter
will ignore everything that goes after the single line comments because
the interpreter obviously cannot find the newline where it's supposed to
stop treating codes as comments.
2020-02-05 15:35:17 +01:00
Vadim Zeitlin
4526765f8f Remove extra semicolons to avoid gcc -Wpedantic warnings
Another fix after 00cdab77c5
2020-02-05 15:20:26 +01:00
Vadim Zeitlin
3f49942051 Fully qualify std::nullptr_t
Fix a stupid mistake from 00cdab77c5
2020-02-05 15:19:33 +01:00
Vadim Zeitlin
00cdab77c5 Define wxStrtox() overloads taking nullptr
Instead of specializing wxStrtoxCharType and then testing whether endptr
is null, just define separate, and simpler, overloads of wxStrtox()
functions taking nullptr_t -- we can avoid the unnecessary test
completely in this case, as nullptr is, by definition, always null
anyhow.

Also add a test of using wxStrtol() with nullptr too.

This should fix the build with older gcc and MSVS versions.
2020-02-05 03:54:25 +01:00