Commit Graph

17663 Commits

Author SHA1 Message Date
Vadim Zeitlin
24e06054fc Remove wxAuiMDIChildFrame::DoShow()
This method is confusing as it's not used for implementing Show(), which
is the usual naming convention when both Foo() and DoFoo() members
exist, and gives no clear indication about what does it really do.

Just call wxWindow::Show() directly instead.

Also create the wxAuiMDIChildFrame window hidden from the beginning,
instead of creating it in a visible state and then hiding it.
2018-05-13 02:45:40 +02:00
Vadim Zeitlin
ceee16c01a Remove sizing hacks from wxAuiMDIChildFrame
There doesn't seem to be any reason for overriding DoSetSize() and
DoMoveWindow(), so just stop doing it.

Notice that this was already changed for wxGTK many years ago in
a94476deb9 and there is no reason to use
different code wxGTK and other ports.
2018-05-13 02:44:18 +02:00
Vadim Zeitlin
c1bcf16eb9 Derive wxAuiMDIChildFrame from wxFrame for consistency
Make it easier to use AUI-based MDI child frame class instead of
normal wxMDIChildFrame itself by inheriting it from the same base class.

This also allows to get rid of duplicate stubs in wxAuiMDIChildFrame.
2018-05-13 02:41:58 +02:00
Vadim Zeitlin
826ab19ac9 Add missing wxUSE_MDI check to wxAUI MDI header
The implementation file already checked for both wxUSE_AUI && wxUSE_MDI,
but wx/aui/tabmdi.h didn't check the value of the latter -- do it now.
2018-05-13 02:41:58 +02:00
Vadim Zeitlin
f53923dd31 Left-align wxSpinCtrl contents by default
The default alignment of the text in wxSpinCtrl was changed to "right"
in 7e4952db83, which added alignment
support (see #10621), but this made it inconsistent with the native
up-down control under MSW and, perhaps more importantly, with spin
controls created from XRC as the default style was never modified there
and did not include wxALIGN_RIGHT.

Resolve this inconsistency by reverting to left-aligning the text by
default.
2018-05-12 19:14:00 +02:00
Frédéric Bron
232d123f8d Remove the separator static line in wxGenericCollapsiblePane
The horizontal static line was added to separate the button from the
child window when visible, but this didn't seem very useful and looked
bad and was inconsistent with the native GTK+ implementation as well as
similar controls commonly used under MSW (wxOSX already disabled the
static line use).

Just remove it to make things simpler and better looking.

Closes https://github.com/wxWidgets/wxWidgets/pull/804
2018-05-12 19:10:28 +02:00
Paul Cornett
9bfa890480 Build fixes for __WXUNIVERSAL__==1 2018-05-11 10:16:49 -07:00
Vadim Zeitlin
2e8516c5fe Merge branch 'MoveOutsideShortInterval' of https://github.com/catalinr/wxWidgets
Allow using positions in the entire int range for window positions under
MSW, and not just those in (slightly less than) short range, that are
supported by the native API.

Closes #4262.

Closes https://github.com/wxWidgets/wxWidgets/pull/779
2018-05-02 23:19:11 +02:00
Maarten Bent
59c37cb5eb Show correct save path when using compressed debug report
The compressed report location could be set to a different location from
the one shown in the dialog.

Closes #17176.

Closes https://github.com/wxWidgets/wxWidgets/pull/797
2018-05-02 15:36:11 +02:00
Vadim Zeitlin
6ae7aa4443 Fix saving/restoring window position for maximized windows
Save both the normal window geometry and its maximized position instead
of saving just its current position. This fixes restoring geometry of
the maximized windows as previously they were always restored on the
primary monitor, as their original position was lost.

Use the native {Get,Set}WindowPlacement() functions for a MSW-specific
wxTLWGeometry implementation to achieve this.

Closes #16335.
2018-04-29 20:35:44 +02:00
Vadim Zeitlin
d97c055514 Introduce platform-dependent wxTLWGeometry class
Previously, TLW geometry was implicitly defined as just its position,
size and the maximized/iconized state by wxPersistentTLW code. This
already wasn't enough for wxGTK which added the decoration sizes to the
geometry being saved/restored, but this had to be done using conditional
compilation, which was not ideal. And it didn't allow using an entirely
different geometry representation as will be done for wxMSW soon.

Change the code to use wxTLWGeometry class defining the geometry, as
used by the current port, explicitly and move wxPersistentTLW logic into
it, as wxPersistentXXX classes are supposed to be very simple, which
wasn't really the case.

Also provide public SaveGeometry() and RestoreToGeometry() methods in
wxTopLevelWindow, which can be useful even to people not using
wxPersistentTLW for whatever reason.

There should be no changes in behaviour so far.
2018-04-29 19:51:10 +02:00
Vadim Zeitlin
f04a46364c Remove useless forward declaration of wxTopLevelWindowBase
This class is fully declared just below, so there is no need to
forward-declare it.
2018-04-29 19:43:22 +02:00
Cătălin Răceanu
578474526f fix window position under MSW when limited by short range 2018-04-18 20:19:45 +03:00
Jan Niklas Hasse
496da2e550 Remove trailing whitespace from several files
No real changes.

See https://github.com/wxWidgets/wxWidgets/pull/787
2018-04-18 15:45:42 +02:00
Jan Niklas Hasse
8d02384792 Use wxString() instead of "" for empty strings
This will allow this code to work even when implicit conversion from
"const char*" is disabled in wxString and is already marginally more
efficient even now.

See https://github.com/wxWidgets/wxWidgets/pull/782
2018-04-17 22:32:25 +02:00
Vadim Zeitlin
e38866d3a6 Merge branch 'lzma'
Add support for using externally available liblzma via new
wxLZMA{Input,Output}Stream classes.

Closes https://github.com/wxWidgets/wxWidgets/pull/771
2018-04-06 15:41:36 +02:00
Vadim Zeitlin
1cdb384d7b Add wxLZMAClassFactory for run-time LZMA stream creation
This should allow handling .xz files in wxFileSystem, for example.
2018-04-06 15:39:55 +02:00
Vadim Zeitlin
50b102ffd2 Add wxLZMAOutputStream for compressing data using LZMA
As liblzma API is similar to zlib API, this class is also close to
wxZlibOutputStream, except that it uses reusable functions instead of
repeating their code.
2018-04-06 15:39:55 +02:00
Vadim Zeitlin
e66ade1b84 Factor out reusable part of wxLZMAInputStream into wxLZMAData
No changes yet, this is a pure refactoring in preparation for adding
wxLZMAOutputStream.
2018-04-06 15:39:55 +02:00
Vadim Zeitlin
af7e2901fe Add wxLZMAInputStream for decompressing data in XZ format
No compression support yet.
2018-04-06 15:39:55 +02:00
Vadim Zeitlin
311b2aee5f Check for liblzma headers in configure too and add wxUSE_LIBLZMA
Prepare for using liblzma in wxWidgets code by adding the necessary
option and updating the configure check for it (which had been already
present due to libtiff possible dependency on liblzma).

No real changes yet.
2018-04-06 15:39:39 +02:00
Vadim Zeitlin
bee28c2730 Use wxVector<> for wxBookCtrlBase::m_pages array
Get rid of another macro-based array in favour of wxVector<>.

No real changes.
2018-03-31 01:45:10 +02:00
Vadim Zeitlin
02a92e23f3 Reuse wxBookCtrlBase::DoSetSelection() in wxTreebook too
Avoid duplicating base class DoSetSelection() implementation in
wxTreebook, just extend it slightly by using DoGetNonNullPage() to allow
using a (sub-)page if the page associated to the selected item is null
and reuse it.

Also get rid of wxTreebook::m_actualSelection, it seems completely
unnecessary to bother keeping and updating it when we can just find it
whenever we need (which actually seems to only have been the case in the
now removed DoSetSelection() implementation anyhow).

As a side effect of this, wxTreebook pages should now be sizer correctly
when switching to them as DoSetSelection() in the base class does call
SetSize() on the page before showing it, unlike the previously used
version in wxTreebook, which omitted this call for some reason.

There should be no other user-visible changes.

Closes #4379.
2018-03-31 01:45:06 +02:00
Vadim Zeitlin
af6a61e3a0 Update wxBookCtrlBase::m_selection outside UpdateSelectedPage()
Change m_selection in wxBookCtrlBase::DoSetSelection() itself instead of
requiring all the derived class overriding do it in their overridden
UpdateSelectedPage().

No real changes, this is just a small simplification.
2018-03-31 01:45:05 +02:00
Vadim Zeitlin
058c085b21 Use wxVector<> in wxTreebookPage implementation
No real changes, just replace the use of a macro-based array with
wxVector<>.
2018-03-31 01:45:01 +02:00
Vadim Zeitlin
bb492b99bd Don't include wx/treectrl.h from wx/treebook.h any more
Remove an unnecessary header dependency. This is not completely
backwards-compatible as it would break any code relying on getting e.g.
wxTextCtrl declaration after including wx/treebook.h, but, hopefully,
there shouldn't be that much such code out there and fixing it shouldn't
be difficult.

If either of these assumptions turns out to be false, this commit can
always be reverted later.
2018-03-31 01:45:00 +02:00
Vadim Zeitlin
b97ea90f4f Add default value for MakeConfigFileName() 2nd argument
Make it possible to call wxStandardPaths::MakeConfigFileName() without
explicitly specifying the convention to use, to make it conform to the
documentation (previously this only worked when calling the
wxStandardPathsBase version of the method).

Closes #18106.
2018-03-17 17:17:05 +01:00
Paul Cornett
05454e778c Build fix for GTK+ < 2.18
Broken by 986f61f33e
2018-03-12 10:06:23 -07:00
Vadim Zeitlin
e5a1a29e77 Fix wxGTK build with glib < 2.32 and streamline the code a bit
Define g_signal_handlers_disconnect_by_data() if it's not available,
i.e. when using glib older than 2.32 where it was added, to fix the
build under old systems such as CentOS 6 broken by the changes of
8278f7b618 (see #18084).

Also use it elsewhere instead of g_signal_handlers_disconnect_matched()
as it's more readable.

Closes https://github.com/wxWidgets/wxWidgets/pull/760
2018-03-11 22:22:45 +01:00
VZ
e183b6d382
Fix miscellaneous build warnings
See https://github.com/wxWidgets/wxWidgets/pull/755
2018-03-07 18:25:32 +01:00
Maarten Bent
3b9aeaeb2f More use of wxOVERRIDE 2018-03-06 23:31:01 +01:00
Vadim Zeitlin
1f7a8a82c3 Round, rather than truncate, in wxSize and wxPoint operations
It seems to make more sense to round the result to int rather than to
truncate it when scaling wxSize or wxPoint coordinates by a floating
point number.
2018-03-06 16:08:01 +01:00
Vadim Zeitlin
bec7c9a161 Don't truncate to int in wxRealPoint::operator*()
wxRealPoint uses double coordinates and it makes no sense to truncate
the result of scaling it to int -- this was almost certainly a
copy-and-paste error due to copying the code of the corresponding
wxPoint method.
2018-03-06 16:06:35 +01:00
Vadim Zeitlin
9774d92e91 Change wxSize::Scale() to take double, not float
There doesn't seem to be any reason to use float here when double is
used everywhere else.

Moreover, the (implicit) conversion of int to float is not always
lossless, and resulted in -Wconversion warnings from g++ 7, which
disappear when using doubles.
2018-03-06 16:01:45 +01:00
Vadim Zeitlin
1540361e75 Avoid warnings about conversion to wxUint16 in wxUniChar code
This conversion is intentional, so suppress the -Wconversion warning
given by g++ 7 (if this warning is enabled) with an explicit cast.
2018-03-06 16:00:47 +01:00
Stefan Csomor
0fc53016a9 making NSString conversion functions available in private.h 2018-02-28 21:08:27 +01:00
Stefan Csomor
6b3b05e5f7 fixing classname 2018-02-28 16:24:43 +01:00
Stefan Csomor
a7505356a4 supporting Window Menu as Carbon did 2018-02-28 16:10:33 +01:00
Vadim Zeitlin
cc8fccf0bc Make wxVector reverse iterators conform to iterator requirements
This is similar to a recent commit adding the missing typedefs to wxList
iterators and defines the types required by the iterator concept in
wxVector::reverse_iterator and const_reverse_iterator classes (simple
iterators are just pointers and are already covered by the standard
iterator_traits specialization).
2018-02-23 16:14:03 +01:00
Vadim Zeitlin
382a5a156e Use ptrdiff_t as wxVector::difference_type instead of size_t
difference_type must be signed, using size_t was clearly a mistake.
2018-02-23 16:10:07 +01:00
Vadim Zeitlin
7e0ca8357e Also remove wxList::const_iterator::const_reference typedef
This typedef is redundant with the "reference" one and doesn't seem to
be used anywhere.

As with the previous commit, this one could be reverted later if it
turns out it does break any existing code, but this seems unlikely.
2018-02-23 16:03:36 +01:00
Vadim Zeitlin
9edf06794e Remove ptr_type typedef from wxList iterator classes
This typedef is completely redundant with pointer_type which had been
also available in these classes since the very beginning and seems to
have been meant to be private originally, so it should be safe to just
remove it, especially because I couldn't find any existing code using
it.

If we do find such code in the wild later, this commit could be reverted
as it's not really indispensable.
2018-02-23 16:03:33 +01:00
Vadim Zeitlin
fdbe357e4b Make wxList iterators conform to input iterator requirements
Define "pointer", "reference", "difference_type" and "iterator_category"
typedefs to ensure that wxList iterator classes are seen as iterators by
the standard library in C++11 and later, as otherwise standard container
template ctors taking iterators couldn't be used with them because
they're only available if input iterator requirements are satisfied.

This notably fixes creation of std::list from wxList iterators; add a
test which didn't compile before to show it.
2018-02-23 16:00:06 +01:00
Vadim Zeitlin
0d5378fb84 Remove unnecessary "list" typedef from wxList iterators
This typedef was simply never used and, as it was private, removing it
shouldn't result in any compatibility problems.
2018-02-23 14:21:05 +01:00
Maarten Bent
3d427a1af1 Fix wxWebView::RunScript() with string containing backslashes
Escape backslashes in wxJSScriptWrapper to allow strings with
backslashes in them to work again -- this was broken while implementing
support for returning values from JavaScript to C++.

See https://github.com/wxWidgets/wxWidgets/pull/741
2018-02-22 13:44:00 +01:00
Tobias Taschner
dd2d62c703 Suppress size event when IsMaximized is called on OSX
IsMaximized internally calls [NSWindow isZoomed] which triggers a
windowWillResize call. Resize events will be ignored while calling
isZoomed.

Closes #17407.

See https://github.com/wxWidgets/wxWidgets/pull/740
2018-02-21 17:08:45 +01:00
Vadim Zeitlin
2ec2837f6d Update version to 3.1.2
Run misc/scripts/inc_release and rebake.
2018-02-20 00:08:01 +01:00
Hugo Elias
28bf0e8687 Add wxIMAGE_OPTION_GIF_TRANSPARENCY for GIF image loading
Allow to keep the originally defined transparent pixels colour instead
of replacing it with bright pink (which is still the default behaviour).

Closes #18014.
2018-02-16 16:28:33 +01:00
Vadim Zeitlin
1ebc28787c Merge branch 'zip64-fix'
Notably fix ZIP64 creation with individual files larger than 4GB.

See https://github.com/wxWidgets/wxWidgets/pull/730
2018-02-16 16:03:32 +01:00
Tobias Taschner
29f5eeb69d
Fix ZIP64 creation with individual files larger 4GB
If single files larger than 4GB where added the recorded file sizes
in the local file header where not updated correctly. Additionally
recorded file sizes in the central directory where in the wrong order
making it impossible to extract.

To enable adding files with unknown size which might be larger than 4GB
the new method wxZipOutputStream::SetFormat() is added.

Additionally a check has been added in case a file larger 4GB has been
written without ZIP64 info.
2018-02-15 20:01:13 +01:00