Commit Graph

64480 Commits

Author SHA1 Message Date
Naser Buhamad
5a877535a8 Take menu bar into account for wxFrame client size in wxQt
Subtract the height of the menu bar too, just as we already did for the
status bar.
2018-06-22 14:30:28 +02:00
Paul Cornett
6d40b7fce7 Remove garbage characters and trailing whitespace 2018-06-21 21:28:34 -07:00
Paul Cornett
bdad8c4619 Remove garbage characters and trailing whitespace 2018-06-21 21:25:46 -07:00
Vadim Zeitlin
cf20a9ced5 Fix bug with showing TLW in wxMSW when restoring its geometry
Since the changes of 6ae7aa4443, the
windows were shown when their geometry was restored as a side effect of
calling ::SetWindowPlacement(). This was unexpected and resulted in
flicker on startup, so fix this by explicitly passing SW_HIDE to
SetWindowPlacement() if the window is currently hidden and storing the
real show command inside wxTLW itself, where it will be used when it's
finally shown.
2018-06-22 03:25:43 +02:00
Vadim Zeitlin
3518f1a7d8 Use a single wxTopLevelWindow::m_showCmd flag in wxMSW
This single field replaces m_iconized and m_maximizeOnShow which were
not really independent and will make it simpler to schedule either
maximizing or maximizing the window later, when it can't be done
immediately because the window is hidden, in the following commit.
2018-06-22 03:23:31 +02:00
Vadim Zeitlin
f03d655b1a Enable running TLW activation unit tests in CI environments
Hopefully the previous commit fixed it under AppVeyor.
2018-06-22 02:44:40 +02:00
Vadim Zeitlin
a8c1ae7058 Fix TLW activation unit test
Ensure that another TLW is active before calling ShowWithoutActivating()
as otherwise the newly shown window would be considered active, even if
it actually isn't, because it contains the current focus.
2018-06-22 02:43:23 +02:00
Stefan Csomor
c6523f016e Dark Mode Patches
thanks to dkulp,
see https://github.com/wxWidgets/wxWidgets/pull/840
see #18146
2018-06-21 20:22:53 +02:00
Vadim Zeitlin
c0be6a38c4 Merge branch 'gtk-entry-hittest'
Implement wxTextCtrl::HitTest() for single line controls in wxGTK.

See https://github.com/wxWidgets/wxWidgets/pull/826
2018-06-21 16:08:16 +02:00
Vadim Zeitlin
9cc2dbc9f1 Merge branches 'svgdc-clip' and 'fix-dc-clipper-restore'
Various clipping-related fixes.

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

See https://github.com/wxWidgets/wxWidgets/pull/836
2018-06-21 16:07:59 +02:00
pavel-t
710474c634 Allow configuring showing printing dialog in wxHtmlEasyPrinting
Add wxHtmlEasyPrinting::SetPromptMode() to allow suppressing the
"prompt" shown by wxPrinter::Print() when it's called from this class
code.

Closes https://github.com/wxWidgets/wxWidgets/pull/838
2018-06-21 16:03:38 +02:00
Vadim Zeitlin
01cd3cc019 Fix image unit test compilation when wxUSE_GIF==0
Don't compile GIF-related test cases and don't add GIF image handler in
this build configuration.
2018-06-20 18:15:38 +02:00
Vadim Zeitlin
abce91f967 Remove dynarray.cpp source file
After the recent dynamic array macros refactoring, there was no
implementation of wxBaseArray any more and only wxArrayString-related
code remained in this file, so just move the latter to arrstr.cpp, where
it should have been put from the beginning (except that this code
probably predates arrstr.cpp addition), and remove the old file
entirely.
2018-06-20 13:59:03 +02:00
Vadim Zeitlin
3e078d509c Remove WXDLLIMPEXP_CORE from wxArrayTreeItemIds declaration
This class doesn't have any non-inline methods and so doesn't need to be
exported from the DLL.

This also avoids warnings in MSVC DLL build about using non
dll-interface class wxArrayTreeItemIdsBase as base for dll-interface
class wxArrayTreeItemIds (C4275).
2018-06-20 13:52:50 +02:00
Stefan Csomor
c58d7755a1 Dark Mode for non native toolbar
see #18146
2018-06-19 21:50:34 +02:00
Stefan Csomor
dcd012184a Dark Mode for wxPropertyGrid
see #18146, thanks to dkulp
2018-06-19 21:49:15 +02:00
Tobias Taschner
778bccbf12 Include macOS 10.14 name in wxGetOsDescription() 2018-06-19 18:15:40 +02:00
Vadim Zeitlin
c5530b1abf Switch to using DoGetClippingRect() instead of DoGetClippingBox()
The new method returns a boolean flag which indicates whether there is
any clipping region or not and so is preferable to using the old one and
checking its return value to determine this, which can't be done
reliably.
2018-06-19 00:20:47 +02:00
Vadim Zeitlin
43ce00b5bd Call base class version from overridden DestroyClippingRegion()
No real changes, just call wxDCImpl::DestroyClippingRegion() from
the overridden versions in the derived classes instead of calling
ResetClipping(): this makes the code more clear as it follows the usual
pattern of the derived class doing something first and then forwarding
to the base class.

Also, as ResetClipping() is not really useful, add a comment documenting
that it shouldn't be used in the new code.
2018-06-19 00:17:43 +02:00
Vadim Zeitlin
110ace680b Remove unnecessary calls from wxDCImpl ctor
There is no need to call neither ResetBoundingBox() nor ResetClipping()
when the variables they reset had just been initialized to the same
values in the ctor initializer list.
2018-06-19 00:17:43 +02:00
Vadim Zeitlin
070336470f Make wxSVGFileDC::GetClippingBox() actually work
wxSVGFileDCImpl class uses the default, i.e. inherited from wxDCImpl,
implementation of this method, but for it to work, the clipping box
coordinates stored in wxDCImpl need to be updated when the clipping
region changes or is destroyed and this wasn't done before.

Fix this now and add a unit test verifying that this indeed works.
2018-06-18 17:11:16 +02:00
Vadim Zeitlin
6a442d2723 Remove unnecessary clipping virtual methods from wxSVGFileDCImpl
These methods seem to be useless as they're never called, only the
corresponding DoXXX() methods are used by wxDC.
2018-06-18 17:07:14 +02:00
Vadim Zeitlin
350867939a Add bool return value for wxDC::GetClippingBox()
Determining whether there is an actual clipping region or not is not
that simple, as shown by the recent problems in wxDCClipper code, so
return a boolean value indicating this from GetClippingBox() directly,
instead of requiring the caller to find it out on their own.

This simplifies wxDCClipper code, as well as any other code calling
GetClippingBox(), at the price of some extra complexity in wxDCImpl
itself, which seems to be worth it.
2018-06-18 14:39:11 +02:00
Vadim Zeitlin
e13904308f Add convenient tags for clipping box unit tests
No real changes, just replace the old CppUnit test registration macros
with wxREGISTER_UNIT_TEST_WITH_TAGS() which allows to specify the tags
explicitly and use "clip" as the tag for all the tests here to allow
running all of them (and just them) by specifying "[clip]" on the test
program command line.
2018-06-18 10:54:26 +02:00
Vadim Zeitlin
119dce5eb8 Fix check for existing clipping region in wxDCClipper
wxDC::GetClippingBox() is actually supposed to return a rectangle equal
to the total wxDC area and not an empty rectangle if there is no
clipping box at all, so avoid restoring the old clipping region
unnecessarily in this case too: even if it should be harmless, it's
still unnecessarily inefficient and, in practice, this is not really
harmless neither as wxPdfDC (from the third party wxPdfDocument library)
doesn't handle having a clipping region set when adding a new page
correctly and so using wxDCClipper broke PDF generation.

This fixes another fallout from 2a8c290e0d

See #13834.
2018-06-18 10:21:59 +02:00
Vadim Zeitlin
fe0f9fefe4 Refactor wxDCClipper ctors to use a common Init() method
No changes, this is just a pure refactoring to facilitate the upcoming
change which won't have to be done in all these ctors any more.
2018-06-18 10:18:34 +02:00
Stefan Csomor
805db8baa8 Dark Mode for wxRenderer for HeaderButtons and Sashes
see #18146
2018-06-17 18:39:01 +02:00
Stefan Csomor
d2aafff4a2 Second part of support for Dark Mode for wxRibbon, use flat appearance starting from 10.10
see #18146
2018-06-17 17:32:11 +02:00
Stefan Csomor
12f8e4b5c3 First part of support for Dark Mode for wxRibbon
see #18146
2018-06-16 10:44:27 +02:00
Stefan Csomor
60c1a4be8b Fixing implementation of wxSYS_COLOUR_INACTIVECAPTIONTEXT 2018-06-16 10:36:46 +02:00
Stefan Csomor
caa2fde425 added missing override 2018-06-15 10:06:17 +02:00
Vadim Zeitlin
7da13b273c Fix wxOSX compilation problem due to missing wx/settings.h
Include the header required by the code using wxSystemSettings added in
5091d87825

See #18146.
2018-06-14 22:33:53 +02:00
Stefan Csomor
56d125041f Use built-in conversion to CGColorRef where available 2018-06-14 20:11:26 +02:00
Stefan Csomor
5091d87825 Support Dark Mode for Status Bar
see #18146
2018-06-14 20:09:37 +02:00
Paul Cornett
016a506eee add GtkWidgetPath wrapper class 2018-06-14 10:41:27 -07:00
Naser Buhamad
1adc3ba4ee Fix menu bar background colour in wxQt
wxMenuBar is a native, not generic, window, so pass "false" to
PostCreation() to use the correct colours for it.
2018-06-13 23:53:58 +02:00
Stefan Csomor
9cef8282ab Supporting Appearance Mode change under macOS 10.14
The system color functions depend on the current appearance, this is not automatically set to the effective appearance (that can be changed during runtime via the system preferences), added a helper class to make sure the correct version is used for retrieval.
2018-06-13 23:02:50 +02:00
Stefan Csomor
ebe70d2af0 Adding macOS 10.14 constant 2018-06-13 18:58:05 +02:00
Stefan Csomor
2acda98337 Fixing NSColor value for wxSYS_COLOUR_WINDOW
controlBackgroundColor should be used as a background for large controls like lists etc. this corresponds to the usage of wxSYS_COLOUR_WINDOW, thanks to dkulp
2018-06-12 23:14:44 +02:00
Václav Slavík
cd02c548f4 Implement wxEVT_SYS_COLOUR_CHANGED in wxOSX (#832)
Starting with macOS 10.14 Mojave, system colors can change dynamically
when the user switches between light and dark modes. Detect this by
observing the effectiveAppearance property and emit
wxSysColourChangedEvent accordingly.

See #18146.
2018-06-12 20:27:50 +02:00
Vadim Zeitlin
f4d4545873 Explicitly disable all warnings from windows.h for MSVC
While Windows headers compile without warnings at maximal warning level,
they still contain some warnings which are disabled by default, but can
be enabled explicitly, such as C4668.

Make life simpler for the user code doing this by avoiding giving these
warnings from the Platform SDK headers as it doesn't cost much to do
this from wxMSW itself, while doing it from the user code is nontrivial.
2018-06-12 19:52:26 +02:00
Stefan Csomor
71bb680a93 Using NSColor System Colours
Removing the old HITheme Constants for the last two wx system colours, first step for Dark Mode support, see https://trac.wxwidgets.org/ticket/18146
2018-06-11 22:38:05 +02:00
Vadim Zeitlin
93edcaef20 Fix wrong function pointer casts in dynamic arrays code
Don't cast function pointers of incompatible types, this resulted in gcc
8 -Wcast-function-type warnings and could hide real errors.

To fix this, overload wxBaseArray::Sort() to accept either the "legacy"
sort function compatible with qsort() or a function compatible with
std::sort(), as it seems both variants could be used before. Also make
the type of the latter function customizable via a new optional Sorter
template parameter in wxBaseArray in order to allow wxSortedArrayString
to specify its own variant of it, taking (const) references instead of
values.

This complicates things, but should preserve compatibility while being
type-safe and, also, allows to simplify _WX_DEFINE_SORTED_TYPEARRAY_2 by
not passing the sort function signature to it any more.
2018-06-10 23:51:13 +02:00
Vadim Zeitlin
6294511a4e Merge branch 'gcc8-msw-warns'
Fix tons of warnings given by default by gcc 8, potentially fixing some
real problems in Win64 build in the process.

See https://github.com/wxWidgets/wxWidgets/pull/822
2018-06-10 23:41:05 +02:00
Vadim Zeitlin
0d176db96d Merge branch 'array-less-macros'
Use templates to implement the legacy dynamic array classes as much as
possible instead of doing it in macros.

This makes the code much more maintainable and readable as well as
easier to debug.

It also allows to avoid casts between function pointers of incompatible
types, which triggered many -Wcast-function-type warnings from g++ 8.
2018-06-10 22:56:03 +02:00
Vadim Zeitlin
96d9616201 Merge branch 'html-print-cleanup'
Simplify wxHTML pagination code and make it easier to reuse from
applications.

See https://github.com/wxWidgets/wxWidgets/pull/817
2018-06-10 14:56:33 +02:00
Vadim Zeitlin
64fc4dc6cd Merge branch 'aui-docview'
Make it possible to easily use AUI classes instead of the standard MDI
docview frames.

Also fix a few old and dirty hacks in AUI code.

See https://github.com/wxWidgets/wxWidgets/pull/808
2018-06-10 14:53:39 +02:00
Maarten
ce903da798 Fix glitch in AUI frame with standard wxToolbar
When the height of the AUI toolbar pane is higher than the wxToolbar, the extra
area shows a glitch. This happens because the paint handler never draws on this
area. Clearing the DC of the frame with the AUI background colour fixes this.

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

Closes #18138
2018-06-08 19:17:22 +02:00
Paul Cornett
b839388c82 Avoid GLib warning "couldn't find weak ref" with wxBitmapComboBox
Should have been part of c391cfd617
2018-06-06 09:09:12 -07:00
Paul Cornett
102be6a3cc Add GtkStyleContext helper class
Manages ownership of GtkStyleContext and GtkWidgetPath, provides functions
for creating and querying style contexts.
2018-06-05 09:21:25 -07:00