Commit Graph

16800 Commits

Author SHA1 Message Date
Paul Cornett
f95fd11e08 Allow drawing HiDPI bitmaps with GTK3
1. Override wxWindow::GetContentScaleFactor() to use gdk_window_get_scale_factor()
   when available, and to use correct scale (1.0) otherwise, as wxDC::GetPPI()
   (used by overridden method) is not properly implemented for wxGTK
2. Record scale in wxBitmap(wxImage&) ctor and wxBitmap::CreateScaled()
3. Adjust cairo scale for drawing bitmap, and (inversely) for drawing on bitmap
2016-02-14 13:12:52 -08:00
Vadim Zeitlin
90eae99cd6 Use strict UTF-8 conversion in wxSafeConvertXXX() functions
It doesn't make sense to use any fallbacks when converting to/from UTF-8 and
this wasn't even done consistently as only wxSafeConvertWX2MB() used
MAP_INVALID_UTF8_TO_OCTAL, but not wxSafeConvertMB2WX().

More importantly, UTF-8 conversion can never fail for a valid Unicode string,
so there is no need for any fall backs.
2016-02-13 17:03:47 +01:00
Vadim Zeitlin
fe850fccc5 Fix "open mode" variables naming convention in wxTextFile
Start variable name with lower case letters for consistency.

No real changes.
2016-02-13 13:46:25 +01:00
Rebel_X
35f35ea407 Clean up wxMSW tooltip window on library shutdown
Not doing this prevented the tooltips from working correctly if the library
was shut down and reinitialized again, so add a module ensuring this is done.

Closes #17360.
2016-02-13 12:55:17 +01:00
Vadim Zeitlin
d7d5bcaae6 Merge fixes for Unicode support in wxFileSystem::FindFirst()
Closes #11404.
2016-02-13 12:32:46 +01:00
Vadim Zeitlin
bfbdd37a1a Merge native MSW appearance for AUI toolbars
Closes https://github.com/wxWidgets/wxWidgets/pull/200
2016-02-13 12:31:49 +01:00
Vadim Zeitlin
314630945a Fix wxURI::Unescape() to work with Unicode strings
Such strings are not really URIs as they should have been encoded if they were
but we can obtain them from e.g. wxFileSystem::FindFirst(), so handle them
correctly here as it's simpler than checking all the places where Unescape()
is called.

Add a unit test checking that decoding an URI containing both Unicode and
percent-encoded Unicode characters works correctly.
2016-02-13 04:01:27 +01:00
Vadim Zeitlin
d1085c0182 Update WINVER and _WIN32_WINNT to use Windows 10 SDK values
This allows to see the declarations of the functions new in Windows 8.x and 10
if they're available.
2016-02-12 18:58:42 +01:00
Tobias Taschner
49b82e72f2 Add native wxAuiToolbarArt for MSW.
Using UXTheme or generic fallback for executables without manifest.
2016-02-10 20:40:45 +01:00
Tobias Taschner
c8c9f56e0c Prepare platform dependent wxAuiDefaultToolBarArt. 2016-02-10 20:40:30 +01:00
Tobias Taschner
abe10b8c00 Fix wxBase build under OS X
Due to recent changes in utils, stdpath and the removal of carbon, building on
OS X was broken by various compiler errors and linker issues.

Closes https://github.com/wxWidgets/wxWidgets/pull/210
2016-02-10 16:12:20 +01:00
Vadim Zeitlin
f8bfab5284 Replace out of date comment before wx/windowid.h inclusion
No real changes, just remove the nonsensical comment from wx/defs.h which
completely lost its meaning since wxWindowID typedef was replaced by a class 8
years ago in cf2810aa39.
2016-02-10 00:06:41 +01:00
Vadim Zeitlin
d50abc2d3e Make wxWS_EX_VALIDATE_RECURSIVELY default (and only) behaviour
In practice, almost everybody using validators also seems to use this style,
so make it the default (this hadn't been done when it was originally
introduced because of compatibility concerns, but now, 15+ years later, it's
probably safe enough to change this).
2016-02-09 23:38:23 +01:00
wxBen
526a627fa8 Allow customizing wxRibbon highlight colours
Add wxRIBBON_ART_BUTTON_BAR_LABEL_XXX settings.

Closes #16784.
2016-02-08 02:28:00 +01:00
Vadim Zeitlin
026659297b Fix path/URL confusion in wxLaunchDefaultBrowser()
Add a helper wxLaunchBrowserParams struct with clearly distinct "url" and
"path" fields and GetPathOrURL() accessor which returns whichever is
appropriate.

This makes the code more clear and ensures that we never pass URLs (but only
file paths) to xdg-open under Unix as it doesn't handle them.

See #17227.
2016-02-07 19:32:18 +01:00
Vadim Zeitlin
53bd62a23a Remove more unused wxOSX/Carbon headers
These should have been removed in 5ba67c67e4 too.
2016-02-07 14:20:45 +01:00
Paul Cornett
fc8d3f6fba Implement wxTextEntryBase::Clear() using Remove() instead of SetValue()
This avoids problems with SetValue() overrides not doing the intended thing
(for example wxComboBox). See #16654
2016-02-06 21:43:43 -08:00
Lauri Nurmi
4281cb4daa Use enums, not typedef enums, in all public headers. 2016-02-07 01:11:25 +02:00
Vadim Zeitlin
57fa59b81c Merge branch 'listctrl-checkboxes-generic' of https://github.com/MaartenBent/wxWidgets
Implement checkboxes support for the generic version of wxListCtrl too so it's
not available under all platforms.
2016-02-06 19:18:58 +01:00
Vadim Zeitlin
7a8684a8bd Add RAII wrapper for GTKDisableEvents/GTKEnableEvents() calls
Ensure GTKEnableEvents() is called automatically on scope exit whenever
GTKDisableEvents() is called.

This fixes a couple of potential bugs where GTKEnableEvents() could be not
called if wxCHECK() condition failed and makes the code shorter and safer.
2016-02-06 19:13:35 +01:00
Vadim Zeitlin
6768695d14 Extract wxGtkTreePath from src/gtk/dataview.cpp
Put this class into its own header so that it could be reused from other
places.

No real changes.
2016-02-06 19:13:35 +01:00
Andreas Falkenhahn
6a01623a80 Add wxListBox::GetTopItem() and GetCountPerPage()
Implement these methods for all the major ports, add them to the widgets
sample and documentation.

Closes #17189.
2016-02-06 19:13:35 +01:00
Maarten Bent
7dd65abaf7 Implemented checking checkboxes. 2016-02-06 17:20:40 +01:00
Maarten Bent
415292c614 Implemented logic. 2016-02-06 17:12:56 +01:00
Paul Cornett
413d7c220c Fix running with GTK+ 2.22 or earlier when built with 2.24
Previous versions define gdk_window_get_visual as gdk_drawable_get_visual
2016-02-05 23:14:48 -08:00
Vadim Zeitlin
3631a2d142 Merge branch listctrl-with-checkboxes
Add support for native checkboxes to wxMSW wxListCtrl.

Closes https://github.com/wxWidgets/wxWidgets/pull/153
2016-02-06 01:20:01 +01:00
Maarten Bent
90386df305 Notify Windows shell about file associations changes
This is documented as being required in the MSDN and, in practice, is
necessary for Windows to update the icon cache and show the new icon.

Closes https://github.com/wxWidgets/wxWidgets/pull/195
2016-02-06 00:56:46 +01:00
Vadim Zeitlin
a2ecb7a320 Don't test for old compilers in C++11 mode in configure
This makes configure faster when C++11 is enabled by avoiding spending time on
compiling unnecessary checks in this case.
2016-02-06 00:16:10 +01:00
Tim Kosse
dc48f595b3 Need to include wx/vector.h, otherwise wxVector is undeclared if configured with --disable-precom-headers --disable-any. 2016-02-05 10:07:09 +01:00
Vadim Zeitlin
cb26668204 Don't destroy the native window in wxNativeWindow itself by default
Leave ownership of the native window to the user code as it may want to reuse
it for some other purpose and provide an explicit Disown() function that can
be called if the user really wants wxWidgets to take ownership of the native
window.

In particular, this avoids problems when using ARC under OS X which resulted
in a double "release" before.
2016-02-04 18:46:47 +01:00
Vadim Zeitlin
536defd91c Get rid of TARGET_CARBON as well
Don't define this symbol in configure and don't test for it.

Also remove a stray reference to wxUSE_OSX_CARBON not removed by the previous
commit.
2016-02-03 18:18:37 +01:00
Tobias Taschner
5ba67c67e4 Remove wxOSX/Carbon support.
Cocoa has been the default toolkit in wxWidgets for a long time. There is really no good reason to use Carbon in 2016 and this removes a lot of unused and unmaintained code.
2016-02-01 13:48:48 +01:00
Vadim Zeitlin
8581f6851e Fix handling of wxGA_PROGRESS in wxGauge under MSW
This was broken by the refactoring during the addition of OS X implementation
of wxAppProgressIndicator in 11a5b83e2c, restore
this functionality by explicitly calling the code initializing the progress
indicator in wxGaugeBase from wxMSW implementation.

Closes #17301.
2016-01-31 20:11:06 +01:00
Artur Wieczorek
1237e932ad Fix setting wxBK_HITTEST_xxx flags in wxNotebook::HitTest
The state represented by TCHT_ONITEM Win API flag is not a superposition
TCHT_ONITEMICON and TCHT_ONITLABEL states but it represents a separate state.
The fact that binary value of TCHT_ONITEM is bitwise-OR operation on
TCHT_ONITEMICON and TCHT_ONITEMLABEL doesn't matter here. The same applies to
wxBK_HITTEST_xxx flags where state represented by wxBK_HITTEST_ONITEM is not a
superposition of wxBK_HITTEST_ONICON and wxBK_HITTEST_ONLABEL.

Add note to wxBookCtrl::HitTest documentation that wxBK_HITTEST_ONICON,
wxBK_HITTEST_ONLABEL, wxBK_HITTEST_ONITEM are mutually exclusive bits.

See https://github.com/wxWidgets/wxWidgets/pull/159
2016-01-31 03:06:33 +01:00
Vadim Zeitlin
a016e6b896 Allow suppressing warnings from wxImage::LoadFile()
Add wxImage::SetLoadFlags() and static SetDefaultLoadFlags() to allow
suppressing the warning messages that can be logged when loading some files,
notably PNG ones with invalid sRGB profiles which, unfortunately, seem to be
rather common and result in annoying warnings about them with libpng 1.6+.

Closes #15331.
2016-01-31 02:22:55 +01:00
Vadim Zeitlin
bc8293a9e5 Update wxMenu::UpdateUI() parameter comment and documentation
The argument to this method should basically just never be used, so while we
still keep it for compatibility (because it doesn't cost anything to do it),
make it clear that it should never be specified in the new code and, also,
that this function is actually only used inside wxWidgets and shouldn't be
normally called from outside of the library at all.
2016-01-30 21:39:09 +01:00
Kinaou Herve
38cd4b4769 Don't make wxAuiFloatingFrame root of a top navigation domain
This allows the accelerators associated with it to propagate to the parent
frame, which is what we want to happen in practice.

Closes #16870.
2016-01-30 18:41:18 +01:00
Zane U. Ji
71dfb3b414 Fix invisible captions in high contrast mode
Don't use black text on dark background.

Closes #16186.
2016-01-30 18:27:10 +01:00
Vadim Zeitlin
5dd5d68e67 Revert "Fix fields initialization in wxCommandEvent copy ctor."
This reverts commit 62763ad541 which seems to
have been completely unnecessary as the fields had been already initialized
and this commit actually broke initialization of the propagation level of the
copied wxCommandEvent objects.

Add a unit test proving that things do work.

Closes #16739.
2016-01-30 05:02:54 +01:00
Vadim Zeitlin
585b49474d Restore sending wxEVT_CONTEXT_MENU for wxTE_RICH controls in wxMSW
Since the changes to use IRichEditOleCallback in wxMSW wxTextCtrl (i.e.
bd650ec3d9 in master), wxEVT_CONTEXT_MENU was
not sent for it any more as the control consumed it after using the callback.

Send the event manually before the default handling takes place to fix this.
2016-01-30 01:03:32 +01:00
Vadim Zeitlin
b4d835090f Merge branch 'bitmap_image_conversion' of https://github.com/a-wi/wxWidgets
Closes #14582.
2016-01-30 00:05:19 +01:00
Vadim Zeitlin
fbe7fc85b2 Suppress harmless warning in a standard header with VC14
imagehlp.h from 8.1 SDK contains an extraneous "typedef" in an enum
declaration which results in several warnings when building, avoid them.
2016-01-29 22:35:17 +01:00
Vadim Zeitlin
0dc57e9e23 Avoid 1px gaps between consecutive underlined words in wxHTML
At least when using standard fonts under MSW, the underlines under the
consecutive words didn't overlap, resulting in ugly gaps between them when
using more than one word as the link text, for example.

Work around this by drawing an extra, slightly offset, underlined space when
the previous cell was drawn underlined.
2016-01-29 17:19:29 +01:00
Vadim Zeitlin
96f5a24f6d Consider g++ ABI up to 1010 to be compatible with 1002
This is not completely true, but the changes in the versions 9 and 10 of g++
ABI don't (seem to?) affect wxWidgets, so allow using later versions of the
compiler for building the code using the libraries created using earlier ones.
2016-01-24 21:18:54 +01:00
mgimenez
78b19e6811 Add wxTextEntryDialog::ForceUpper()
Just forward it to wxTextCtrll::ForceUpper().

Closes #17291.
2016-01-22 14:41:06 +01:00
Artur Wieczorek
a99e58e074 Add method to convert wxDIB to wxImage enforcing alpha channel values (wxMSW).
wxDIB::ConvertToImage called with Convert_AlphaAuto converts wxDIB to wxImage with automatic checking if 32 bpp DIB contains real alpha values (legacy way).
When it is called with Convert_AlphaAlwaysIf32bpp then automatic checking is disabled and 32 bpp DIB is unconditionally converted to ARGB wxImage.
2016-01-21 17:31:48 +01:00
Tobias Taschner
58c7e6d54f Add wxStaticBitmap::SetScaleMode() to control bitmap display size
This allows a bitmap to scale with the size of the wxStaticBitmap control.
Scaling can be controlled to fill the control with or without changing the
bitmaps aspect ratio.
2016-01-20 18:55:14 +01:00
Paul Cornett
03aae8254f remove unused private member variables 2016-01-16 11:04:27 -08:00
Paul Cornett
e5e3f6fffa remove useless wxMax(), an unsigned value is never less than 0 2016-01-16 10:59:02 -08:00
Paul Cornett
56701052eb remove const from pass-by-value parameters 2016-01-16 10:55:01 -08:00