Commit Graph

59124 Commits

Author SHA1 Message Date
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
Vadim Zeitlin
c2e18d75e5 Fix wxCALL_FOR_EACH() to work with more than 2 arguments with MSVC.
Due to a bug in MSVC handling of __VA_ARGS__ (see
https://connect.microsoft.com/VisualStudio/feedback/details/380090/variadic-macro-replacement)
wxCALL_FOR_EACH() didn't work correctly as long as more than two arguments
were used with it.

Work around the bug by protecting __VA_ARGS__ from being incorrectly passed as
a single token to the macro being called on every step: this was already done
for wxCALL_FOR_EACH itself with wxCALL_FOR_EACH_, but we need to do it for all
the helper macros too.

Also add a test checking that this does, actually, work.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77689 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-14 00:59:53 +00:00
Vadim Zeitlin
da5edc0fc1 Fix crash in wxMDIParentFrame dtor after taskbar branch merge.
wxFrame::m_taskBarButton needs to be initialized in its Init(), not Create(),
which is not necessarily used by the derived classes such as wxMDIParentFrame,
resulting in a guaranteed crash when deleting an uninitialized pointer later
in wxFrame dtor.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77688 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-14 00:59:48 +00:00
Artur Wieczorek
8474dc6489 Fix vertical positioning of text field in the combo box editor associated with wxPG property under wxMSW.
Vertical position of text field in wxOwnerDrawnComboBox control (instantiated at property selection) doesn't need any special adjustment.

Closes #16556.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77687 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-13 20:45:37 +00:00
Vadim Zeitlin
1447a23c83 Accept "default" as font family value in XRC.
Map it to wxFONTFAMILY_DEFAULT, just as we do for all other wxFontFamily enum
elements.

Closes #16549.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77686 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-12 11:31:25 +00:00
Vadim Zeitlin
c8e27bcaf7 Simplify Direct2D DLLs loading code a little.
Bail out earlier: if d2d1.dll is not there, it doesn't make sense to try to
load dwrite.dll.

Also use Load() return value directly instead of ignoring it and then checking
for IsLoaded().

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77684 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-11 20:33:27 +00:00
Vadim Zeitlin
7dec99c0a8 Suppress error messages when checking for Direct2D availability.
Use wxDL_QUIET flag when loading Direct2D DLLs as we're prepared to handle
their absence and don't need to show error messages if they're not available.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77683 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-11 20:33:24 +00:00
Vadim Zeitlin
9ecf317092 Implement strike-through support in wxFont in wxOSX.
Implement support for this attribute in wxOSX too.

Closes #16547.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77682 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-11 17:05:33 +00:00
Vadim Zeitlin
6f10cd1982 Fix error message about ChangeWindowMessageFilter() on startup under XP.
Use wxDynamicLibrary::RawGetSymbol() (from inside wxDL_INIT_FUNC() macro)
instead of GetSymbol() to avoid the error message which was given every time a
new wxFrame was created after wxTaskBarButton changes under XP as
ChangeWindowMessageFilter() function is not available in it.

Also simplify the code a little and don't make pfnChangeWindowMessageFilter
static, we don't need to keep it around.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77681 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-11 17:05:29 +00:00
Vadim Zeitlin
b59176869a Fix Direct2D code compilation in non-Unicode build.
DirectWrite GDI interop only works with Unicode LOGFONTW, so use it explicitly
instead of LOGFONT which is LOGFONTA in non-Unicode build.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77680 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-11 11:37:10 +00:00
Vadim Zeitlin
56d51c311a Fix wxUSE_GRAPHICS_DIRECT2D definition in setup.h files.
Define it in wx/msw/setup_inc.h and not in wx/msw/setup0.h itself to ensure
that it survives the regeneration of this file using build/update-setup-h.

Also only set wxUSE_GRAPHICS_DIRECT2D to 1 for VC10+ and not VC9 as the latter
lacks Direct2D header in its default SDK version.

Finally also update comments to explain the various settings more clearly and
remove outdated information (wxGraphicsContext is not experimental any more).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77669 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-10 16:52:28 +00:00
Vadim Zeitlin
c2d70a0340 Convert Direct2D source file to Unix EOL format.
No other changes.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77668 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-10 16:52:24 +00:00
Vadim Zeitlin
1643a7dd51 Use ID2D1Bitmap instead of ID2D1Image.
ID2D1Image is not defined in v7.0A platform SDK used by VC10 and doesn't seem
to be needed here as we are only working with ID2D1Bitmaps (deriving from
ID2D1Image) anyhow.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77667 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-10 16:52:16 +00:00
Vadim Zeitlin
8734eb3732 Don't use enum name for qualifying enum element.
This is a non-standard MSVC extension and can't be done in standard C++.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77666 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-10 16:52:13 +00:00
Vadim Zeitlin
ab3977ddc3 Remove PI definition from Direct2D wxGraphicsContext code.
The line defining PI didn't compile with VC10 because atan(1) is ambiguous
(argument could be float, double or long double). And it was not needed anyhow
as PI was not used anywhere (and if it were, we should be just using M_PI from
wx/math.h anyhow), so simply remove it.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77665 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-10 16:52:10 +00:00
Vadim Zeitlin
91b7aab4c2 Fix build with g++ 3.4 with -pedantic[-errors] option.
The use of variadic macros results in a warning/error if -pedantic[-errors]
is used when compiling C++98 code as they are only formally part of C99 (or
C++11). With g++ 4 and later, this can be avoided by using -Wno-variadic-macros
option, but it doesn't exist in g++ 3, so a nasty workaround in the header
itself is required: mark it as system header in order to fix compilation.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77664 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-10 16:52:08 +00:00
Vadim Zeitlin
39da0824d3 Don't skip wxHtmlContainerCell layout, even when the width is 0.
This ensures that wxHtmlContainerCell height is set to some reasonable value
instead of 0 and fixes infinite loop which occurred in some circumstances in
wxGTL when trying to allocate size for wxHtmlListBox as it oscillated between
having a vertical scrollbar with bigger width and not having it with smaller
width. The latter was wrong as decreasing the width to 0 didn't really obviate
the need for the vertical scrollbar and was just an artefact due to not
setting wxHtmlContainerCell height at all in this case.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77663 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-10 16:52:04 +00:00
Vadim Zeitlin
1addaeaa75 Add wxUIActionSimulator::Select().
Add a helper to select an item in a wxChoice, wxComboBox, wxListBox or similar.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77662 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-10 16:52:01 +00:00
Vadim Zeitlin
c4470b8a48 Fix crash in unit tests after TextEntryTestCase::Editable().
The class TextEventHandler added in r77057 (see #3901) setup an event handler
which wasn't disconnected when the handler was destroyed, which resulted in a
crash later as the window it was connected to continued to exist and generate
wxEVT_TEXT events.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77661 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-09-10 16:51:56 +00:00