Commit Graph

60734 Commits

Author SHA1 Message Date
Vadim Zeitlin
10daded3e9 Fix UnbindFromHandler() test compilation with C++98
Can't declare classes inside the function as they must have external linkage
to be usable with Bind().

Fixes the build after 99d9a81e28, see #17229.
2015-12-08 15:22:01 +01:00
Vadim Zeitlin
60c2b96aef Add support for "forceupper" attribute to wxTextCtrl in XRC
Call ForceUpper() if this attribute is specified.

Currently this is done only for wxTextCtrl but could be extended to wxComboBox
later too if necessary.
2015-12-08 03:02:49 +01:00
Vadim Zeitlin
69b66e9e2e Add wxTextEntry::ForceUpper()
Allow automatically converting lower-case letters entered into wxTextCtrl to
upper-case equivalents. Provide generic fallback and implement the method
natively for all the major platforms.

Also update the text sample to show it in action.
2015-12-08 03:02:46 +01:00
Vadim Zeitlin
99d9a81e28 Fix crash when unbinding event handlers from other handlers
Calling Unbind() on another handler from the currently executing handler which
had been bound after (and hence executed before) the handler being unbound
resulted in a crash previously as the iterators used in the loop over all
dynamic event handlers became invalid.

Fix this by storing the dynamic event table entries in a vector instead of a
list (which is also more memory and speed efficient anyhow) and null the
deleted entries instead of removing them to avoid invalidating the iterators
and only really remove them once we finish iterating.

Closes #17229.
2015-12-08 03:02:37 +01:00
Vadim Zeitlin
929b077894 Remove comments and declarations copy-pasted from wxMSW
Mentioning MSW-specific styles in wxOSX or wxQt code doesn't make sense.

Closes https://github.com/wxWidgets/wxWidgets/pull/146
2015-12-07 14:37:34 +01:00
Paul Cornett
cc48c42e17 remove no-longer-needed OnInternalIdle() override 2015-12-06 20:24:59 -08:00
Paul Cornett
84a77c0c32 remove unused global variable 2015-12-06 20:20:27 -08:00
Paul Cornett
d4d209dd39 Fix generation of wxEVT_ACTIVATE_APP
Avoid spurious events when showing most native dialogs
See #17260
2015-12-06 20:10:32 -08:00
Vadim Zeitlin
d77f7f0fe3 Merge improvements to wxGenericCalendarCtrl mouse handling
Closes https://github.com/wxWidgets/wxWidgets/pull/143
2015-12-06 19:46:29 +01:00
Vadim Zeitlin
84e2492ea4 Handle all wxCalendarHitTestResult elements in a switch
This ensures that the compiler will warn us if a new wxCAL_HITTEST_XXX is
added but forgotten to be handled here.
2015-12-06 19:46:16 +01:00
Vadim Zeitlin
f417248434 Don't call event handler from another handler
We advise people to not call the event handlers directly, so don't show bad
example in our own code and just handle double clicks directly instead of
forwarding them to the single click handler. Alternatively, we could just
handle both events in the same handler.
2015-12-06 19:46:15 +01:00
Vadim Zeitlin
b4b6975bad Fix jagged indentation in wxGenericCalendarCtrl mouse code
No real changes.
2015-12-06 19:46:14 +01:00
Lauri Nurmi
773690203e Handle all consecutive clicks on generic calendar month buttons
Without handling the double click event, some (or all, on OS X) of the
following clicks in a rapid series of clicks are ignored. This makes changing
the month unnecessarily slow.
2015-12-06 19:46:08 +01:00
Artur Wieczorek
c239160d33 Optimize AlphaBlt() to reset the minimal amount of pixels
Modify the loop fixing alpha channel value in order to increase speed when
ARGB bitmap is drawn on 0RGB DIB bitmap or 32-bit DDB bitmap.

Closes #16766.
2015-12-06 17:32:50 +01:00
Vadim Zeitlin
530276ec6a Fix crash in graphics benchmark
Set the GL context pointer deleted in the frame dtor to NULL to ensure we
don't crash on exit when not using OpenGL.
2015-12-06 17:31:24 +01:00
Artur Wieczorek
7ddb522ec2 Extend benchmarks of drawing bitmaps on wxMemoryDC
Extended tests to determine speed of drawing RGB/ARGB bitmaps on target
bitmaps with different colour depths (RGB/0RGB/ARGB/system default).

See #16766.
2015-12-06 17:24:37 +01:00
Vadim Zeitlin
3fa5d92bc2 Build graphics benchmark too
Added the graphics benchmark to the bakefile, which didn't build it before,
for some reason.
2015-12-06 17:24:35 +01:00
Vadim Zeitlin
332dc81167 Fix case of <shlwapi.h> includes
Don't use upper-case file names, while MSW itself is case-insensitive, wxMSW
can be also cross-compiled and then the wrong case results in compilation
errors.

Closes #17279.
2015-12-06 03:43:28 +01:00
Vadim Zeitlin
be38f5a051 Don't mention DEFINE_EVENT_TYPE() in the documentation
This old macro is not documented, only wxDEFINE_EVENT_TYPE() is, so link to
the latter rather than the former.
2015-12-06 03:43:27 +01:00
Vadim Zeitlin
7b90ac6a65 Use GetPartialTextExtents() in wxHTML under all platforms
Call wxDC::GetPartialTextExtents() once instead of calling GetTextExtent() for
each letter in a loop in wxHtmlWordCell code. This is more efficient and more
precise and was done for wxOSX since 89e94a4bff
10+ years ago, but for some reason wasn't done for the other platforms.
2015-12-06 03:43:27 +01:00
Maarten Bent
5f2ccde269 Fix AppVeyor mingw build with USE_GUI=1
Closes #142
2015-12-05 16:00:29 -07:00
Paul Cornett
9cf8232ba8 check for macro '__sun' rather than 'sun', see #17258 2015-12-03 21:37:32 -08:00
Maarten
cb159db8bf Show continuous integration results in readme.
Show Travis and AppVeyor build results of the master branch in the
readme (and project page). Use images from shields.io so shields
look the same and a label can be added.

Closes #140
2015-12-03 21:38:00 -07:00
Catalin
f61627fc7e Remove obsolete symbols from the samples
Mostly don't mention OS/2 in the comments about the icons.

Also replace a couple of occurrences of "wxWindows" with "wxWidgets".

Closes https://github.com/wxWidgets/wxWidgets/pull/138
2015-12-03 22:11:04 +01:00
Catalin
71ad2d64ef Remove obsolete symbols and platforms from the documentation
Don't mention pre-XP Windows versions and other obsolete platforms such as
OS/2 and the symbols which were only useful for them.

Closes https://github.com/wxWidgets/wxWidgets/pull/137
2015-12-03 22:05:55 +01:00
Cătălin Răceanu
c43fa10c74 Fix drop down combobox flags in the widgets sample
Combine, not replace, combobox option flags when creating a drop down one,
otherwise all the others flags were simply ignored.

Closes https://github.com/wxWidgets/wxWidgets/pull/136
2015-12-03 21:30:04 +01:00
Catalin
2c84f37054 Remove obsolete symbols from overviews and install notes
Don't mention Windows 95, OS/2 and SGI.

Closes https://github.com/wxWidgets/wxWidgets/pull/135
2015-12-03 21:26:31 +01:00
Wacek Gocki
4e49638a6c Handle wxELLIPSIZE_NONE gracefully in wxControl::Ellipsize()
Since 44bcc3a723 wxRendererGeneric::DrawItemText()
could call Ellipsize() with wxELLIPSIZE_NONE mode, resulting in an assert.

Fix this by just not doing anything in this case.

Closes #125.
2015-12-03 17:10:25 +01:00
JulianSmart
1bb714b9df Added dcprint.h include 2015-12-03 11:20:28 +00:00
Vadim Zeitlin
9bcafd02f4 Revert "Optimize drawing of small bitmaps with alpha in wxMSW"
This reverts commit d04e256993 because it
results in crashes due to writing out of bounds of the bitmap: nothing
guarantees that the entire (x, y, dstWidth, dstHeight) rectangle fits in the
destination bitmap and so the code of this commit could merrily overflow it
and did it as could be seen e.g. in the HTML test sample after scrolling
around a little.

See #16766.
2015-12-03 03:41:25 +01:00
Kinaou Hervé
d3931ea660 Add support for CSS "color", "size" and "font" to wxHTML <font>
Simply map them to the existing HTML parameters, just as we already do for a
few other styles.

Closes #16773.
2015-12-02 23:53:00 +01:00
Vadim Zeitlin
0ed580f451 Fix modifying file type associations under MSW as non-admin
The existing code tried writing to HKEY_CLASSES_ROOT which doesn't work, in
general, for normal, i.e. non administrator, users, under any post-XP versions
of Windows.

Fix it to write to HKEY_CURRENT_USER\Software\Classes, which is the part of
HKEY_CLASSES_ROOT for the current user and to which we do have write access,
and only continue to use HKEY_CLASSES_ROOT itself for reading.
2015-12-02 23:15:25 +01:00
Vadim Zeitlin
058e35c0ec Remove commented out code from wxMSW wxMimeTypesManager
Just clean up; we don't need all this old and unused code in this file.
2015-12-02 23:01:06 +01:00
Vadim Zeitlin
09e7dc290c Fix Cygwin build with wxUSE_STL==1
Use explicit c_str() when calling Cygwin functions taking char* or void*
instead of relying on implicit conversions.
2015-12-02 16:58:39 +01:00
JulianSmart
d0dc318b9d Set the default back to using the native progress dialog 2015-12-01 20:25:10 +00:00
Armel Asselin
271fbce876 Handle VK_OEM_8 key in wxMSW too
This key is not present on all keyboards but we do need to handle on those
where it is used.

Closes #17272.
2015-12-01 01:21:02 +01:00
JulianSmart
075ef6551e Made the generic progress dialog the default for wxMSW until we have corrected two kinds of seizure-inducing flicker 2015-11-30 23:07:34 +00:00
JulianSmart
125f09f495 Add test for wxUSE_IMAGE 2015-11-30 21:53:25 +00:00
JulianSmart
1d9903456c Save reallocating a bitmap object 2015-11-30 15:30:34 +00:00
Vadim Zeitlin
6cd37dd3c8 Don't eat ampersands in wxDataViewCtrl and similar controls items
Fix the call to wxControl::Ellipsize() inside DrawItemText() added in
b7a89f8746 (see #16414) which removed all
ampersands from the string with the default flags to not do it.

Closes #17269.
2015-11-30 00:08:06 +01:00
JulianSmart
f8bc9abfc4 Work around poor image scaling on WIN32, especially on HiDPI displays where all images without size specification will be scaled 2015-11-29 20:01:10 +00:00
JulianSmart
c3ae2fc54a Use content scale factor to make wxHTML DPI-aware 2015-11-29 19:36:14 +00:00
JulianSmart
78fe0ac3d8 Fix for breakage with multiple books 2015-11-29 19:29:04 +00:00
Gavs64
ab95207c78 Fix message boxes with wxYES_NO|wxCANCEL style in wxMSW
Windows CE code removal in 8282c1be0f (see
https://github.com/wxWidgets/wxWidgets/pull/81) broke message boxes showing
"Yes", "No" and "Cancel" buttons at once, add accidentally removed code back.

Closes https://github.com/wxWidgets/wxWidgets/pull/139
2015-11-29 16:22:16 +01:00
Artur Wieczorek
2db2db7044 Merge pull request #134 from a-wi/pg_draw_colours_alpha_fix
Fix build failures on some platforms after 7be75892.
2015-11-29 13:54:36 +01:00
Artur Wieczorek
0d30db33e1 Fix build failures on some platforms after 7be75892.
Add header files to have full declarations of wxMemoryDC and wxMetafileDC which are apparently necessary on some platforms for wxDynamicCast.
2015-11-29 09:25:19 +01:00
Artur Wieczorek
7be75892a3 Fixed drawing colours with alpha in wxSystemColourProperty (wxPG).
For systems which don't support drawing with alpha on standard DC (like e.g. Win, GTK2) there is necessary to use graphics context for this purposes.
2015-11-27 21:36:21 +01:00
Vadim Zeitlin
9990959c99 Get rid of unnecessary wxColour::InitFromComponents() in wxOSX
This method was confusing and dangerous as it didn't actually initialize the
wxColour object because it didn't set its m_cgColour and so attempting to use
wxColour "initialized" using this method resulted in a crash whenever its
GetPixel(), GetCGColor() or CreateCGColor() methods were called.

Just merge this function with InitCGColorRef() which is the only remaining
place where it's used after rewriting wxColour(NSColor) ctor.
2015-11-27 00:19:37 +01:00
Vadim Zeitlin
10162b79fc Handle pattern colours in wxColour ctor from NSColor
Some colours returned in wxSystemSettingsNative::GetColour() can't be
represented in RGBA color space as they use patterns, which explained why the
compilation fix for 10.7 SDK in 56ebe6dfac
resulted in run-time crashes.

Add code to support converting such NSColor objects to CGColorRef via
NSImage, CGImageRef and CGPatternRef to make things really work.

See #17141
2015-11-27 00:06:25 +01:00
Vadim Zeitlin
3fc74d5a0f Fix wxColour(NSColor) ctor and use it in wxOSX code
wxColour ctor from NSColor added in b478f24288
didn't work correctly as it didn't initialize wxColour::m_cgColour and so any
attempts to use the colour created by it resulted in an immediate crash (so
the code added in 16671f229a likely didn't work
neither).

It also assumed that the NSColor given to it was always in the RGBA colorspace
and crashed if it wasn't (so 56ebe6dfac fixed
compilation at the price of making the code crash at run-time). Now explicitly
request the RGBA colorspace and leave the colour uninitialized, which is
better than crashing, if it can't be obtained.

After making this ctor safe to use, there is no reason to reproduce its logic
in wxColourDialog and wxFontDialog, so just use it from there.

Also make the ctor explicit as it's a non-trivial operation which shouldn't be
performed implicitly and document that it doesn't take ownership of NSColor,
unlike the similar ctor from CGColorRef.
2015-11-26 23:57:29 +01:00