Commit Graph

60360 Commits

Author SHA1 Message Date
Vadim Zeitlin
a788351eb6 Don't keep using invalid wxSound object in the sound sample.
If creating a sound object fails, delete it to ensure that it is recreated
later.

This fixes a minor bug: previously, if an invalid file was used as sound file,
only the first attempt to play it resulted in an error and all the subsequent
ones were just silently ignored. Now every attempt to play an invalid file
results in an error message, as expected.
2015-07-18 02:29:16 +02:00
Vadim Zeitlin
605149ed07 No real changes, just get rid of a variable in wxOSX wxSound code.
Don't define a variable which is used exactly once, testing for the async flag
directly is just as, or even more, readable and shorter.
2015-07-18 02:29:16 +02:00
Vadim Zeitlin
a6a3ad0d66 Fix wxSound::Create() and IsOk() return values in wxOSX.
Don't pretend that we created wxSound object successfully without actually
doing it: this means that now passing an invalid (e.g. non-existent or using
wrong format) file to wxSound::Create()/ctor will return false/result in
IsOk() returning false later, just as in the other ports.

It also means that playing a successfully created wxSound object won't give
any error messages, as unexpectedly happened before.
2015-07-18 02:29:16 +02:00
Artur Wieczorek
a0afc17c75 Use wxNullBitmap explicitly instead of wxPG_NULL_BITMAP.
wxPG_NULL_BITMAP macro is not useful because is used only once. In the rest of wxPG code wxNullBitmap is used explicitly many times so for the sake of consistency we can resign from using this macro.
2015-07-17 22:29:37 +02:00
Artur Wieczorek
15d8dae6ff Use IsOk() function to check whether wxBitmap is valid.
Use dedicated function instead of comparing wxBitmap instance with wxNullBitmap.
2015-07-17 22:26:38 +02:00
Vadim Zeitlin
78d09e2e90 Document and test wxDatePickerCtrl::SetRange() date-clamping behaviour.
Document that the current value of the control is adjusted if it doesn't lie
in the newly set range and add a unit test to check for this, now that it
actually passes under all platforms, after the previous commits.
2015-07-17 17:59:40 +02:00
Vadim Zeitlin
e3de2916bb Adjust the date in wxDatePickerCtrlGeneric after changing range.
Ensure that the current value remains between the lower and upper range
boundaries in the generic implementation, as it was already done by the MSW
one.
2015-07-17 17:59:40 +02:00
Vadim Zeitlin
fc3d2bac2a Avoid bogus assert after calling wxDatePickerCtrl::SetRange() in wxMSW.
If the old value didn't lie inside the new range, it was changed by the native
control internally but the value stored by wxDatePickerCtrl itself remained
unchanged, resulting in asserts later when the mismatch between them was
detected.

Closes #13189.
2015-07-17 17:59:40 +02:00
Vadim Zeitlin
f691e7e28d Fix wxMSW wxFontEnumerator::EnumerateEncodings() parameter handling.
This parameter is a face name, not a family name, and should be handled as
such, it was totally broken before due to a lot of confusion between face
names and family names in the code.

Closes #4715.
2015-07-17 16:10:20 +02:00
Vadim Zeitlin
b6fa548d80 Simplify wxWebViewIE code further by using wxSafeArray<>.
Use the existing class instead of using SAFEARRAY directly.

See f5d2bfa880.
2015-07-17 14:40:16 +02:00
Vadim Zeitlin
14f8c7e7e8 Check for wxUSE_ACTIVITYINDICATOR in the widgets sample.
This fixes the sample compilation with default configuration when using MinGW
as it uses wxUSE_GRAPHICS_CONTEXT=0 by default and so wxUSE_ACTIVITYINDICATOR
is turned off by default for it too.
2015-07-17 14:40:11 +02:00
Vadim Zeitlin
5ae3e4ff12 Fix wxTaskBarButton code compilation in ANSI mode.
Correctly declare SHStrDupW() as always producing a wide char string on output
and pass a wide string to wxStrlcpy() using a wide char buffer.

Closes #17033.
2015-07-17 14:40:01 +02:00
Vadim Zeitlin
5fabf7e60d Add a debug check for HTML tag handlers being available.
This helps to detect the situation when HTML tag handlers are not linked in at
all, as it can happen with MSVC when using static libraries, as this doesn't
prevent wxHTML from parsing HTML, it just doesn't render it correctly at all
and it can be difficult to understand why exactly does this happen, so try to
detect this situation and provide a hint.
2015-07-17 14:38:48 +02:00
Artur Wieczorek
403dd5673f Use enum instead of macros to represent wxPropertyGrid::DoSelectProperty flags. 2015-07-16 21:04:25 +02:00
Artur Wieczorek
4588acb21b Use wxEmptyString instead of dedicated wxPropertyGridInterface member variable. 2015-07-16 21:00:38 +02:00
Paul Cornett
8749496b15 Fix wxSpinButton best size for GTK+ 3.12 and later, closes #17051 2015-07-16 07:13:42 -07:00
Jouk
4b704d4193 Define also != operator, since find on OpenVMS-AXP needs it 2015-07-16 07:47:43 +02:00
Artur Wieczorek
79794391e9 Declare wxPG_DEFAULT_IMAGE_SIZE as wxDefaultSize constant.
wxDefaultSize is an equivalent of wxSize(-1,-1) but is more portable.
2015-07-15 21:45:27 +02:00
Artur Wieczorek
4398e20655 Use wxDefaultCoord instead of explicit -1 value while initializing wxSize and wxPoint variables. 2015-07-15 21:45:08 +02:00
Jouk
a8bf2abcd0 Add new files to makefiles for compilation on OpenVMS 2015-07-13 14:46:42 +02:00
Jouk
38dfd91ca2 suppress harmless warning when compiling on OpenVMS 2015-07-13 12:32:32 +02:00
Vadim Zeitlin
af7ed311ed Fix wx2stclen() return values after upgrade to Scintilla 3.5.5.
The fix to the length allocated for the buffer (which was off by 1) in
wx2stc() in 9f81ac16f0 exposed another bug,
which used to compensate for that one, in wx2stclen(), so fix it too.

See #16776.
2015-07-11 22:41:34 +02:00
Vadim Zeitlin
0e8999cb2f Prevent unwanted line break after "i.e." in wxFontFamily docs.
Escape the following space to prevent Doxygen from thinking that the period
after "e" ends the brief documentation.
2015-07-10 13:45:33 +02:00
Vadim Zeitlin
9be928d6fb Fix destruction of wxNativeContainerWindow in wxMSW.
WM_CLOSE was not processed at all for native windows wrapped by
wxNativeContainerWindow because we don't handle it ourselves at wxWindow level
but still mark it as processed in order to prevent DefWindowProc() from
destroying the window. Unfortunately this also prevented the original handler
for this message in the native window from being called.

Calling just the original handler and not the wxWidgets one is not ideal
neither but is much better as it allows to e.g. close MFC frames wrapped in
wxNativeContainerWindow whereas before this didn't work at all as WM_CLOSE was
completely ignored.

Also call the original handler for WM_DESTROY to avoid similar potential
problems with this message, even if it doesn't seem to create any with MFC.

Extend the mfc sample to show how a wxPanel can be embedded into the existing
CFrameWnd.
2015-07-09 20:49:05 +02:00
Vadim Zeitlin
394b04b7e4 Document wxDC::{Set,Get}Logical{Scale,Origin}() functions.
They are relatively important, especially the origin-related ones as
SetUserScale() can (should?) be used instead of SetLogicalScale(), but
SetLogicalOrigin() can be more convenient than SetDeviceOrigin(), so provide
at least skeletal documentation for them.
2015-07-09 19:20:43 +02:00
Vadim Zeitlin
3e1dcf552e Update HDC in wxDC::SetLogicalScale() in wxMSW.
Unlike the similar (identical?) SetUserScale(), this function didn't call
RealizeScaleAndOrigin(), add it now for consistency.

Closes #17053.
2015-07-09 19:13:44 +02:00
Vadim Zeitlin
1d8522301b Avoid ambiguity to wx-defined wchar_t comparisons in STC code.
Comparing wchar_t with int doesn't compile under OpenVMS because of

%CXX-E-AMBIGUOUSOPRFUN, more than one operator ">=" matches these operands:
            built-in operator "arithmetic >= arithmetic"
            function "operator>=(wchar_t, const wxUniChar &)"
            operand types are: wchar_t >= enum <unnamed>

Try to work around this by explicitly casting wchar_t to int.
2015-07-09 14:47:30 +02:00
Vadim Zeitlin
48338a304f Italian translations update from Roberto Boriotti. 2015-07-09 14:38:49 +02:00
Vadim Zeitlin
9c88e76752 Remove the never implemented wxPoint2D::SetPolarCoordinates().
This method was declared but never implemented, just remove it.

Closes #17065.
2015-07-09 14:38:49 +02:00
Vadim Zeitlin
d267735a2d Fix conflicting sizer flags in wxWizard under wxOSX.
Don't use wxGROW and wxALIGN_CENTRE together in a wxBoxSizer, this doesn't
make sense as the latter is just ignored.

Also use wxEXPAND instead of wxGROW for consistency with the flags elsewhere
in the same file.

Closes #17063.
2015-07-09 14:38:49 +02:00
Artur Wieczorek
7d77168936 Refactor: Use dedicated methods to manipulate wxRect members. 2015-07-07 21:56:17 +02:00
Leland Lucius
6a435345f5 Fix accessibility support in wxMSW.
Return the correct result from handing WM_GETOBJECT message.

See #17058.
2015-07-06 23:55:41 +02:00
Artur Wieczorek
98a4c40168 Use IsEmpty() function to check if wxRect represents empty rectangle. 2015-07-06 23:04:21 +02:00
Artur Wieczorek
9e77932278 Use wxBitmap::GetSize() to obtain size of the wxBitmap.
When assigning wxBitmap size to wxSize variable there is not necessary to assign bitmap width and height separately.
2015-07-06 22:13:23 +02:00
Artur Wieczorek
28e2e0f475 Removed unused local variable from wxPropertyGrid::GetPropertyRect 2015-07-06 21:50:23 +02:00
Artur Wieczorek
b2af64faaf Use variable of type wxEventType to store value returned by GetEventType function.
Since wxEvent::GetEventType() returns wxEventType value, the variable used to hold returned value should be also of this type.
2015-07-06 20:43:28 +02:00
Artur Wieczorek
6f3003c3e1 Fix drawing choice item bitmap when using wxPGEditor_Choice.
Horizontal alignment of bitmap associated with wxPGChoice item drawn in wxPGComboBox (in wxPropertyGrid::OnComboItemPaint) needs to be adjusted by 1 pixel (as it is already done for text label) in order to get the bitmap in the same position when wxPGComboBox is selected.
2015-07-05 21:17:35 +02:00
Artur Wieczorek
a253cdb413 Refactor wxPropertyGrid::OnComboItemPaint
Make the code more readable by reducing scope of some local variables, by simplifying their initialization, etc.
2015-07-05 21:14:50 +02:00
Vadim Zeitlin
b7f1ac40f4 Don't hard code the number of stack frames after wxOnAssert().
The number of frames between the code containing the assert and the code
generating the stack trace is not the same under different platforms and so
hardcoding 8 for it in wxAppTraitsBase::GetAssertStackTrace() worked for wxMSW
but not e.g. wxGTK.

Instead, just ignore all frames up to and including the one for wxOnAssert()
itself. This makes the code work correctly on all platforms and it also won't
need to be modified whenever any extra functions are added/removed
(wxGTK-specific code in utilsgtk.cpp used wrong number of frames too, even
though it was presumably correct once before).
2015-07-05 18:39:37 +02:00
Vadim Zeitlin
6c43aa90b6 Fix for PCH-less build of wxProtocol after recent changes.
Include wx/app.h in protocol.cpp, don't include it in http.cpp which doesn't
need it any more.

See #17031.
2015-07-05 17:50:02 +02:00
Vadim Zeitlin
610076aabd Merge branch with the changes upgrading to Scintilla 3.5.5.
Closes #16776.
2015-07-05 17:00:36 +02:00
Vadim Zeitlin
9f81ac16f0 Fix wx2stc() conversion after upgrade to 3.5.5.
UTF8FromUTF16() now only NUL-terminates the string if there is enough space in
it for the trailing NUL, so pass the correct length of the buffer, including
the last byte reserved for this NUL to this function.

Also allocate one byte less in wxCharBuffer, it was adding 1 extra byte
unnecessarily.

See #16776.
2015-07-05 16:58:13 +02:00
Vadim Zeitlin
7ece217abc Remove unused file with obsolete PenWindows support.
This file was apparently never compiled in, just drop it, as well as the
mention of wxUSE_PENWINDOWS in the documentation.
2015-07-05 16:55:26 +02:00
Vadim Zeitlin
73119a37ae Remove obsolete _EXPORT macro not used under Win32.
This was a leftover from bad old Win16 days.
2015-07-05 16:55:26 +02:00
Vadim Zeitlin
30b523d1f2 Remove redundant tests for __WIN32__ in wxMSW code.
This is always defined, Win16 is not supported since ages and Win64 defines
both __WIN32__ and __WIN64__.
2015-07-05 16:55:25 +02:00
Vadim Zeitlin
d421373c2e Use blocking sockets from non-main threads in wxProtocol.
Non-blocking sockets can't work in worker threads without additional locking
as they generate events that can be dispatched from the main thread after the
socket object, created in the worker thread, is already destroyed, so don't
even attempt to use them if wxProtocol object is created from non-main thread.

Also simplify the code by removing the calls to SetFlags(), Notify() and
{Save,Restore}State() and simply put the socket from the beginning in
blocking, wait all mode that it needs to be in.

This, with the fixes in the previous commit, allows wxHTTP and wxFTP to work
from worker threads too.

Test using wxHTTP from a worker thread in the socket client sample.

Closes #17031.
2015-07-05 16:45:07 +02:00
Vadim Zeitlin
e18c8fd29a Never use events for blocking sockets under Unix.
Events are not needed for this kind of sockets, using wxSOCKET_BLOCK is
supposed to ensure that calling socket IO operations blocks until the bytes
are read/written without dispatching any events.

See #17031.
2015-07-05 16:45:07 +02:00
Vadim Zeitlin
c4df7fcf91 Remove accidentally checked in debugging code in Unix wxDir.
Undo the accidental change in c6c19dc580.

Closes #17052.
2015-07-04 19:45:38 +02:00
Vadim Zeitlin
82f3234d95 Avoid g++ 3.4.5 warning about wxMSWOwnerDrawnButtonBase dtor.
Fixing the warning for recent g++ versions introduced it for the old one, so
work around this inside our workaround.

See #17005.
2015-07-04 18:25:05 +02:00
Vadim Zeitlin
b7f3d0d752 Correct wxAuiNotebook::SetUniformBitmapSize() documentation.
This function used the same documentation as Split() for some reason, document
it correctly now.

Closes #17049.
2015-07-04 16:33:21 +02:00