Commit Graph

59142 Commits

Author SHA1 Message Date
Vadim Zeitlin
43c99ef613 Refactor: create src/univ/anybutton.cpp.
Extract and pull the common functions from wxButton and wxToggleButton to
wxAnyButton in wxUniv too.

Also make wxToggleButton inherit from wxToggleButtonBase correctly

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77759 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-23 17:38:47 +00:00
Paul Cornett
16601713a4 cairo_image_surface_get_{width,height} have been available in cairo since version 1.0
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77758 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-23 16:37:15 +00:00
Vadim Zeitlin
7172fdc01b Fix wxCompositeWindow compilation after the latest change.
SetSize() doesn't have any dependent parameters so call it via an explicit
"this->" to make it work with standard conforming compilers (and not MSVC).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77757 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-21 11:51:10 +00:00
Vadim Zeitlin
f24d204984 Update layout of wxCompositeWindow on layout direction change.
The children layout will almost always depend on the layout direction, so redo
it when the latter changes.

In particular, this fixes changing the layout of wxSpinCtrlDouble under MSW.

See #11583.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77756 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-21 01:41:27 +00:00
Vadim Zeitlin
81ec161949 Fix setting layout direction for wxSpinCtrl in wxMSW.
Position the spin control components (the button and the text) correctly for
the current layout.

Also update the layout of the text explicitly.

See #11583.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77755 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-21 01:41:22 +00:00
Vadim Zeitlin
e5755015e7 Fix setting layout direction for wxComboBox in wxMSW.
The EDIT control used by the native combobox is different from normal EDIT
controls and has to be handled specially.

We also need to explicitly forward WS_EX_LAYOUTRTL to the dropdown window as
it doesn't inherit it from the combobox itself automatically.

See #11583.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77754 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-21 01:41:17 +00:00
Vadim Zeitlin
da41c5d9bb Don't leak global objects in Direct2D code.
Ensure that all globals are freed on library shutdown by using a module just
to perform this cleanup.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77753 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-21 01:41:14 +00:00
Vadim Zeitlin
db73e480ef Don't call CoInitializeEx() from Direct2D code.
This is unnecessary, COM is already initialized on the application startup and
Direct2D can't be used before that anyhow.

This also fixes lack of matching CoUninitialize() call.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77752 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-21 01:41:10 +00:00
Vadim Zeitlin
b49d49435d Document wxWindow::HitTest().
This is not a very useful method, but by providing at least some documentation
for it, we prevent it from inheriting the docs for the next method, which have
nothing to do with it.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77751 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-20 22:12:20 +00:00
Vadim Zeitlin
7cccbaa15e Fix double release in wxGLCanvas code.
The change in r77701 was partially wrong, we shouldn't release Objective-C
object if initializing it failed.

See #16555.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77750 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-20 22:07:52 +00:00
Vadim Zeitlin
51791822a1 Avoid integer overflow/wraparound in wxString::Mid().
Don't compare nLength with "nFirst + nCount" as this could wrap around.

Compare nCount with maximal allowed count, after ensuring that nFirst itself
is valid first, instead.

Closes #16572.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77749 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-20 22:07:48 +00:00
Vadim Zeitlin
4d561bf02c Use wxMulDivInt32() instead of multiplying and dividing ints with doubles.
This is mostly done to avoid warnings about converting the result of
multiplying and dividing an int by doubles back to int, but is also more
correct as wxMulDivInt32() rounds the result correctly instead of truncating
the fractional part, and is also a tiny bit more efficient under MSW where the
native ::MulDiv() is available.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77748 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-20 22:07:45 +00:00
Vadim Zeitlin
8ad1e2698f Make wxTextCtrlOleCallback destructor virtual to avoid g++ warnings.
This class doesn't really need a virtual dtor as it's never used
polymorphically, but add it to avoid g++ warnings about it.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77747 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-20 22:07:42 +00:00
Vadim Zeitlin
58a7d6338c Fix harmless g++ warning about "using NULL in arithmetic".
::SetThreadExecutionState() returns a DWORD, which is not a pointer, so
compare its return value with 0, not NULL.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77746 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-20 22:07:40 +00:00
Vadim Zeitlin
c5ee5b8ea7 Don't use wxMSW wxAppProgressIndicator if wxUSE_TASKBARBUTTON==0.
This class requires wxTaskBarButton to be really implemented, so there is no
need to even define the MSW-specific version of it if wxUSE_TASKBARBUTTON is 0
anyhow.

This fixes a compilation problem with wxUSE_TASKBARBUTTON==0 but, more
importantly, just makes more sense.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77745 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-20 22:07:37 +00:00
Vadim Zeitlin
4944c44676 Show the message of unexpected message boxes in wxTestingModalHook.
This is more informative than showing just the title and we can do it for the
message boxes and it's worth handling them specially just because they are so
common.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77744 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-20 22:07:34 +00:00
Vadim Zeitlin
66640e67d6 Allow customizing unexpected dialogs description in wxTestingModalHook.
Extract creation of the message describing an unexpected dialog in a separate
virtual method in order to allow customizing it, notably in order to add more
useful description of custom application dialogs.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77743 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-20 22:07:31 +00:00
Vadim Zeitlin
6cf30c433c Mention the title of the unexpected dialog in wxTestingModalHook.
It's not very helpful to just say that an unexpected dialog was shown, using
its title provides at least some hint as to what dialog it was.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77742 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-20 22:07:29 +00:00
Vadim Zeitlin
c39f3db6a6 Return the caption from wxMessageDialog::GetTitle().
It was unexpected that wxMessageDialog::GetTitle() returned empty string even
when non-empty caption, which is just another word for title, was specified.

Implement GetTitle() as synonym for GetCaption() and also provide SetTitle()
for consistency.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77741 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-20 22:07:26 +00:00
Artur Wieczorek
c1741cf677 Use wxPropertyGrid::HasInternalFlag() function to check internal flags.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77739 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-20 19:57:47 +00:00
Artur Wieczorek
a3611b8190 Fix manual selection of custom colour item for wxColourProperty and wxSystemColourProperty in wxPG.
If keyword 'custom' is entered into the edit field of wxColourProperty or wxSystemColourProperty (with wxPGEditor_ComboBox) then dialog box to query for custom colour should be invoked. Afterwards, when control value is updated, its selection index should be also updated respectively.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77738 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-20 19:46:25 +00:00
Robin Dunn
fe7301b6b0 Oops, a '{' got lost somewhere from the last commit...
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77737 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-19 23:56:13 +00:00
Robin Dunn
b25a6a4bb6 I'm not totally sure when they were added, but the cairo_image_surface_get_[width|height] functions are not available in cairo 1.10.2.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77735 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-19 23:28:43 +00:00
Jouk Jansen
22d4c8b2c7 Synchronizing setup.h_vms with setup.h.in
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77724 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-18 14:52:33 +00:00
Julian Smart
4f4258cfdc Implemented vertical image alignment.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77722 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-18 14:39:49 +00:00
Vadim Zeitlin
13e0edb380 Document wxGraphicsContext::CreateBitmapFromNativeBitmap() ownership rules.
Mention that it takes ownership of the native bitmap passed to it.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77719 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-18 00:01:35 +00:00
Vadim Zeitlin
a35527e0e1 Fix crash when creating wxGraphicsBitmap from cairo_surface_t.
Initialize m_buffer to avoid crashes when deleting it in Cairo-based
wxGraphicsContext implementation for bitmaps created from the native ones.

Don't leave the bitmap size uninitialized neither, this might not result in
crashes, but is definitely wrong as well.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77718 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-18 00:01:31 +00:00
Vadim Zeitlin
2db02f4dc2 Update information about wxOSX/Cocoa in the platform overview.
Mention that OS X 10.7 is now required and that Cocoa is preferred to Carbon
now.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77717 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-17 10:15:47 +00:00
Stefan Csomor
5bf74fb2e5 fixing #16564, partly reverting r76426
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77715 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-16 16:04:20 +00:00
Peter Most
12e989bdf3 Re-added wxQtPointer smart pointer for easier memory management.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77714 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-16 12:50:57 +00:00
Vadim Zeitlin
cde3018236 Don't define wxUSE_GRAPHICS_GDIPLUS as 1 by default.
Define it and wxUSE_GRAPHICS_DIRECT2D, when it's supposed to be enabled, as
wxUSE_GRAPHICS_CONTEXT instead. This ensures they are set to 0 if the use of
wxGraphicsContext is entirely disabled, as is the case when using MinGW under
MSW by default for example.

Closes #16558.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77711 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-15 17:27:50 +00:00
Vadim Zeitlin
36367a650a Remove wrong freshness check from build/update-setup-h script.
This didn't work correctly if a header was updated from its corresponding
setup0.h first as it was then newer than include/wx/msw/setup_inc.h even
though it had been older than it at the start of the script execution.

Just keep things simple and get rid of the check.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77710 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-15 17:27:46 +00:00
Vadim Zeitlin
2a5d51c08f Get rid of IsOk() accessor in Cairo implementation code.
This was quite useless as m_ok flag was public anyhow, just use it directly.

Incidentally closes #16560.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77709 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-15 16:01:52 +00:00
Vadim Zeitlin
9648f36903 Portuguese translations update from @mansil.
Closes PR #16.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77708 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-15 12:04:08 +00:00
Vadim Zeitlin
ad1ff55184 Always include wxGA_PROGRESS in wxGauge styles enumeration.
It can still be used even if it's not available under the current platform.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77707 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-14 23:58:29 +00:00
Vadim Zeitlin
28516f5643 Make wxAppProgressIndicator actually usable.
First of all, do define it under non-MSW platforms.

Second, don't crash in it when running under XP where wxTaskBarButton is not
available.

Also add IsAvailable() method to check for its availability explicitly and add
a demonstration of this class to the dialogs sample.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77706 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-14 23:58:26 +00:00
Vadim Zeitlin
03e245091f Use factory function for wxTaskBarButton creation.
This allows to encapsulate checking for errors, which should be handled when
using this class as task bar buttons API is not available under Windows XP.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77705 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-14 23:58:22 +00:00
Vadim Zeitlin
76aa6d5db7 Revert "Avoid generating wxEVT_MENU_OPEN and CLOSE for disabled menus in wxMSW."
The check for top level menus being disabled added in r77657 is broken as it's
used, with the expectedly bad consequences, for non top level menus as well,
as can be seen by opening any submenu, so revert it.

See #2168.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77704 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-14 23:58:17 +00:00
Vadim Zeitlin
4c1a2a51ef Don't crash under XP in the taskbar button sample.
Refuse to run if the taskbar button API is not available.

This wouldn't make much sense anyhow and is the simplest thing to do.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77703 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-14 23:58:14 +00:00
Vadim Zeitlin
938f19b739 Update progress immediately in the taskbar button sample.
Handle all scroll events instead of just wxEVT_SCROLL_CHANGED which was
probably done accidentally.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77702 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-14 23:58:12 +00:00
Vadim Zeitlin
3d09a6efc2 Request hardware accelerated GL under OS X only if it's available.
Otherwise wxGLCanvas creation just fails completely when it isn't, e.g. when
running inside a VM.

Closes #16555.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77701 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-14 23:08:30 +00:00
Vadim Zeitlin
6d0f27a4cc Blind fix to wxiOS build after strike-through fixes.
This should correct build breakage caused by r77695.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77700 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-14 23:08:27 +00:00
Stefan Csomor
f5d6be6d86 fixing memory leak
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77697 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-14 18:11:38 +00:00
Artur Wieczorek
44be806ac6 Use special code to identify custom colour in wxPG.
There is already defined a special code (wxPG_COLOUR_CUSTOM) to identify custom colour in wxColourProperty and wxSystemColourProperty but in practice item representing this colour is identified either by position (it is assumed it as always last item) or by fixed text label. This inconsistency makes the code unclear and can lead to problems (see workaround r76627).
Now, only wxPG_COLOUR_CUSTOM code is used to identify custom colour and hence "custom colour" item doesn't need to be the last item in the collection and doesn't need to have a fixed text label (like "Custom").


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77696 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-14 17:07:08 +00:00
Vadim Zeitlin
79fb4e2250 Fixes to wxFont strike-through support in wxOSX.
Don't create strike-through fonts by default.

Also add support for strike-through in wxCarbon.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77695 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-14 11:17:54 +00:00
Vadim Zeitlin
c3dd247c1e Return to using GDI+ by default in wxGraphicsContext under MSW.
Unfortunately Direct2D-based wxGraphicsRenderer is not ready for use yet as it
doesn't draw lines with width 0, which are commonly used.

The code using it in GetDefaultRenderer() will need to be restored when this
bug is fixed.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77694 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-14 01:00:14 +00:00
Vadim Zeitlin
4d16d86821 Fix memory leak when creating new Direct2D-based wxGraphicsContext.
ID2D1DCRenderTarget was leaked every time a wxD2DContext was created because a
raw pointer was given to wxCOMPtr<> which didn't take its ownership.

Use wxCOMPtr instead of the raw pointer to fix this and also fix more rare but
still possible leak in case of error.

This fixes out of memory errors and crashes in the drawing sample after a few
seconds of constant window resizing/repainting.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77693 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-14 01:00:11 +00:00
Vadim Zeitlin
dc6830bded Allow selecting wxGraphicsRenderer to use in the drawing sample.
In particular, allow switching between GDI+ and Direct2D under Windows, which
is very convenient for comparing the rendering results.

This can also be useful when using Cairo.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77692 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-14 01:00:09 +00:00
Vadim Zeitlin
04fd25a730 Split screen selection in a separate menu in the drawing sample.
No real changes, just make the "File" menu (which was also renamed to
"Drawing" as it has nothing to do with files) less long by splitting off the
screen selection in a separate menu.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77691 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-14 01:00:00 +00:00
Vadim Zeitlin
6cea553fa3 Avoid creating wxGraphicsContext in the drawing sample unnecessarily.
This is not only wasteful, but creating a Direct2D surface associated with a
wxDC makes it impossible to paint on the DC using GDI functions, so this
completely broke the initial display in the sample.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77690 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-14 00:59:56 +00:00