Commit Graph

61422 Commits

Author SHA1 Message Date
Artur Wieczorek
c911f737e3 Implemented wxGraphicsContext created from wxEnhMetaFileDC for Cairo renderer (wxMSW). 2016-04-14 20:44:35 +02:00
Vadim Zeitlin
ba5a0a3878 Fix more typos in comments and wxFAIL messages
Closes https://github.com/wxWidgets/wxWidgets/pull/270
2016-04-14 16:08:28 +02:00
Marek Temnyak
d4460435d9 Make source string const in wxPropertyGrid escape sequence methods
Source string is not changed in {Expand,Create}EscapeSequences() methods, so
make it const.

Closes https://github.com/wxWidgets/wxWidgets/pull/271
2016-04-14 16:05:10 +02:00
Dimitri Schoolwerth
c6570770bc Fix signed/unsigned mismatch warning
When not using MinGW the value NO_ITEM (-1) is passed as an item count to
the macro ListView_ApproximateViewRect. While Windows/Platform SDKs since
at least 6.0a cast the argument to (only!) a WPARAM, older ones such as
5.0 don't which results in a signed/unsigned mismatch (converting -1 to
WPARAM, which is an UINT_PTR).

Fix by always casting to WPARAM when using ListView_ApproximateViewRect.
Also use a value of -1 again instead of NO_ITEM because the latter is a
bit of a misnomer in this case (as it refers to the total number of items
in the control) and to reduce the risk of the cast being removed in the
future as well as differentiate it from the MinGW headers issue.

Note that this is a different casting problem than with other ListView_XXX
macros such as ListView_GetNextItem (which cast to int first and then to
WPARAM) where casting to WPARAM results in a warning with WIN64 builds.
That situation does not apply to ListView_ApproximateViewRect.

Regression since 00c63cfd3a.
2016-04-13 23:58:04 +00:00
Dimitri Schoolwerth
faf26f3939 Fix crash when using default wxDataViewEvent ctor
Check the value of the wxDataViewCtrl pointer parameter in Init() instead
of unconditionally calling GetModel() on it. The default ctor of
wxDataViewEvent calls Init() with a null pointer.

This fixes the failing GUI tests with the XP buildbot slave.

Regression since 9829446755.

Also see #12649.
2016-04-13 18:33:04 +00:00
Vadim Zeitlin
adfc3c18c3 Merge branch 'datetime-compare'
Miscellaneous improvements to wxDateTime comparison operators.

Closes #17490.
2016-04-13 15:14:45 +02:00
Kevin B. McCarty
a922d576ec Use wxINT64_MIN for the value of invalid wxDateTime
Use 0xffffffffffffffff instead of the strange 0xffffffff00000000 that we used
before, for some reason.
2016-04-12 20:54:27 +02:00
Vadim Zeitlin
5e5d872150 Document wxDateTime comparison operators behaviour
Mention that they intentionally can't be used with invalid objects except for
the exact comparison.
2016-04-12 20:51:09 +02:00
Kevin B. McCarty
56aa94c61e Allow using wxDateTime::operator==() and !=() with invalid objects
Unlike the other operators, we comparing for equality has a well-defined
semantics even for invalid objects, so there doesn't seem any reason to not
allow it.
2016-04-12 20:50:09 +02:00
Kevin B. McCarty
fda904ea77 Implement wxDateTime::Is{EqualTo,{Earlier,Later}Than}() in terms of operators
Avoid duplicating the same code, even if it's trivial, in both places.

Notice that these functions are implemented in terms of operators and not vice
versa because we have no functions corresponding to operator<=() or
operator>=().
2016-04-12 20:45:15 +02:00
Kevin B. McCarty
d47efc42ff Remove redundant IsValid() checks from wxDateTime comparison methods
They're not necessary as GetValue() asserts when passed an invalid object
anyhow, there is no need to check for this twice.
2016-04-12 20:43:14 +02:00
orbitcowboy
e3f1423632 Fix typos in comments in C++ code
No real changes.

Closes https://github.com/wxWidgets/wxWidgets/pull/268
2016-04-12 17:15:23 +02:00
Vadim Zeitlin
c30fe114ee Fix handling of "%z" in format strings for MinGW in all cases
MinGW only supports "%z" directly when using ANSI stdio, but this is not
always the case (even if it often is, as just including any standard C++
header enables ANSI stdio as a side effect). Translate "%z" to "%I" for it as
well as for MSVC to ensure that it always works.

Closes #17492.
2016-04-12 17:11:49 +02:00
Vadim Zeitlin
2f35bda171 Fix handling of "%z" in format strings in 64 bit MSVC builds
ChangeFmtChar(), used only to replace "%z" with "%I" when using MSVC, was
buggy and forgot to increment the pointer to the next format character,
meaning that the "I" we wanted to insert into the format string was simply
lost, overwritten by the next character ("d", "u" or "x").

This actually didn't change anything in 32 bit builds, but it did result in
not using the correct size in 64 bit ones, e.g. using "%zx" with (size_t)-1
output only "ffffffff" instead of the correct "ffffffffffffffff".

See #17492.
2016-04-12 17:09:12 +02:00
Vadim Zeitlin
d62c535d4c Remove misleading test for __USE_MINGW_ANSI_STDIO
This test, added in 06458cb89f, is useless as it
doesn't matter what the value of __USE_MINGW_ANSI_STDIO when compiling the
library is, as the real wprintf() implemented used by wxPrintf() is chosen
depending on __USE_MINGW_ANSI_STDIO value when compiling the application as
wxPrintf() is defined inline.

Just remove it because "%ls" works in both cases anyhow, so always use it with
MinGW.
2016-04-12 16:44:16 +02:00
Artur Wieczorek
0ee25aaa76 Fixed creating Cairo bitmap from wxBitmap (wxMSW).
Iterating over bit values with wxAlphaPixelData sets the internal wxBitmap's "has alpha" flag but we want to left it unchanged so we have to save its original value and restore it afterward.
2016-04-11 18:06:42 +02:00
Vadim Zeitlin
bac5975b02 Merge branch 'rtl-fixes'
Fix appearance of wxNotebook children background when using RTL locales.
2016-04-10 20:51:33 +02:00
Vadim Zeitlin
eed5700a07 Refactor: remove wxNotebook::DoDrawBackground() in wxMSW
The code in QueryBgBitmap() and MSWPrintChild() is sufficiently different that
we can't easily reuse the drawing calls between them, so don't tie ourselves
in knots trying to do it, just duplicating these 2 calls in the 2 functions is
not that bad and the code is more clear.

No real changes.
2016-04-10 20:49:36 +02:00
Artur Wieczorek
c7e7c3873d Fixed determining wxCairoContext size (wxMSW).
Determine actual size of wxCairoContext created from native DC and HWND. This allows to report proper size of wxGraphicsContext created by wxGraphicsRenderer::CreateContextFromNativeContext / CreateContextFromNativeWindow.
2016-04-10 20:41:53 +02:00
Artur Wieczorek
c7a498a163 Fixed reporting transformation settings from wxGraphicsContext with Cairo renderer (GTK+ 3).
When wxGraphicsContext is created from wxWindowDC or wxMemoryDC then transformation settings applied initially to the underlying source Cairo context need to be stored (in a dedicated variable) in order to have ability to determine what transformations were applied to wxGC instance since its creation. Only these explicitly applied transformations are reported by GetTransform().

Closes #17491.
2016-04-10 20:40:33 +02:00
Artur Wieczorek
cc628f5e87 Fixed wxCairoContext::SetTransform
Actual transformation is a concatenation of internal (hidden) transformation and requested one.
2016-04-09 23:51:42 +02:00
Artur Wieczorek
42c08aae12 Fixed creating wxGraphicsContext from wxMemoryDC with Cairo renderer (wxMSW).
Create RGB Cairo surface as a fallback if we failed to create ARGB surface for 32bpp wxBitmap.
2016-04-09 23:47:58 +02:00
Artur Wieczorek
ac49e3829a Fixed inheriting wxWindowDC transformation settings by wxGraphicsContext with Cairo renderer (GTK+ 2).
When wxGraphicsContext is created from wxWindowDC then transformation settings already applied to the source wxWindowDC are not passed directly to the Cairo context through underlying GdkDrawable and therefore they need to be passed to the context explicitly.
These inherited transformation settings should be used only internally by wxGraphicsContext object and shouldn't be exposed through e.g. GetTransform() function and hence they are stored separately (in a dedicated variable) and "subtracted" from actual transformation settings for reporting purposes.

See #17491.
2016-04-09 23:46:29 +02:00
Vadim Zeitlin
0487a3d3f1 Use correct size for the notebook background bitmap in wxMSW
Using "r.x + r.width" didn't really make much sense, it just happened to be
close enough to the real value to not create any problems when using LTR
layout, but was wrong in RTL, resulting in visible vertical line being visible
in the notebook client area.

Fix this using the same GetThemeBackgroundExtent() for determining the bitmap
size as is used for drawing over it.
2016-04-08 23:17:26 +02:00
Vadim Zeitlin
169fb2c7f5 Fix background for children of windows with RTL layout in wxMSW
To correctly compute the brush origin offset for painting background of a
child in a window using RTL layout, we need to offset it by the child origin
i.e. its _right_ top corner in this case and not the left top corner as we did
before.

Conveniently, although not very explicitly, MapWindowPoints() already takes
care of this for us if we just pass it both the left and right points, but we
wrongly passed it only a single one, so it couldn't work its magic in this
case.

Change this to fix the drawing artefacts which appeared over wxNotebook
children with transparent background (e.g. wxStaticText) due to the use of
wrong origin before.
2016-04-08 23:17:24 +02:00
Vadim Zeitlin
5368c72d37 Fix wxMSW build with wxUSE_DEFERRED_SIZING==0
Don't define BeginRepositioningChildren() and EndRepositioningChildren() at
all in this case instead of defining them as "do nothing" functions because
BeginRepositioningChildren() still needs to return a bool, so the old code
didn't compile and we would need to add another "#else" to fix this -- instead
make it simpler by just not compiling at all in this case.
2016-04-08 22:22:22 +02:00
Artur Wieczorek
79b60780fe Fix MSVC14 warnings about a shadowed variable in the printing sample.
Just to suppress some harmless warnings.
2016-04-08 18:46:02 +02:00
Artur Wieczorek
c991c659c4 Fixed print preview in printing sample (wxGTK).
Under wxGTK print preview is created on wxMemoryDC and hence wxGraphicsContext should be created also for this kind of wxDC in MyApp::Draw.

Closes #17489.
2016-04-08 18:44:21 +02:00
scootergrisen
e7b4c19e42 Minor Danish translations update 2016-04-08 15:00:41 +02:00
Artur Wieczorek
4b6c0718e9 Fixed inheriting wxMemoryDC transformation settings by wxGraphicsContext with Cairo renderer (GTK+ 2).
When wxGraphicsContext is created from wxMemoryDC then transformation settings applied to the source wxMemoryDC are not passed directly to the Cairo context through underlying GdkDrawable and therefore they need to be passed to the context explicitly.
These inherited transformations settings should be used only internally by wxGraphicsContext object and shouldn't be exposed through e.g. GetTransform() function and hence they are stored separately (in a dedicated variable) and "subtracted" from actual transformation settings for reporting purposes.

Closes #17482.
2016-04-07 19:30:01 +02:00
Micha Ahrweiler
a374801465 Make OK button default in wxGTK wxMessageDialog by default
Under wxGTK the default button in wxMessageDialog with style wxOK was set to
"Cancel", whether the wxOK_DEFAULT style was specified or not.

Now it is set to "OK", as expected, and wxCANCEL_DEFAULT needs to be
explicitly specified to focus the "Cancel" one.

Closes https://github.com/wxWidgets/wxWidgets/pull/267
2016-04-07 15:54:58 +02:00
Jouk
7255a8fb7f Updated compile support for OpenVMS 2016-04-07 10:44:48 +02:00
Václav Slavík
22f0801378 Fix wxCheckListBox checkbox rendering under RTL
When running under a RTL locale, checkboxes should not be mirrored, but
should keep the same appearence in both RTL and LTR layouts.
2016-04-06 18:11:03 +02:00
Vadim Zeitlin
e209beed8e Really fix initial text selection in wxTextEntryDialog
Focus the text control after changing its value, this ensures that all text in
it is initially selected, allowing the user to easily replace it if necessary.

This was also the intention of bd9171c2ad, but
it was insufficient for wxGTK where changing the text control value seems to
reset its selection, unlike in wxMSW where the selection is preserved.

See https://github.com/wxWidgets/wxWidgets/pull/266
2016-04-06 03:42:20 +02:00
Artur Wieczorek
b4ffe734c1 Fixed inheriting wxMemoryDC transformation settings by wxGraphicsContext with Cairo renderer (wxMSW).
When wxGraphicsContext is created from wxMemoryDC with selected 32bppp wxBitmap then transformation settings applied to the source wxMemoryDC are not passed directly to the Cairo context through underlying HDC and therefore they need to be passed to the context explicitly.
These inherited transformations settings should be used only internally by wxGraphicsContext object and shouldn't be exposed through e.g. GetTransform() function and hence they are stored separately (in a dedicated variable) and "subtracted" from actual transformation settings for reporting purposes.

See #17482.
2016-04-05 23:46:33 +02:00
mbaschnitzi
bd9171c2ad Fix selection of given value in wxTextEntryDialog
The given value in wxTextEntryDialog was not preselected as it was likely intended by the code because the SelectAll-Method of the wxTextCtrl was called before the value was set. Now the SelectAll-Method is called after setting the value in wxTextEntryDialog::TransferDataToWindow.
2016-04-05 09:57:22 +02:00
Vadim Zeitlin
7465237353 Improve wxSpinCtrl best size computation in wxGTK
Don't hardcode completely arbitrary width of 95px for the text part, but
compute it from the values this control is actually used for.
2016-04-03 18:04:26 +02:00
Vadim Zeitlin
25c9b032a8 Don't call CacheBestSize() from DoGetBestSize() implementations
This is unnecessary, wxWindow::GetBestSize() already does this, so calling it
from DoGetBestSize() called by it too is just useless.
2016-04-03 18:04:26 +02:00
Vadim Zeitlin
c1cd1e01b5 Fix wxSpinCtrl best size calculation for GTK+ 3
Don't hard code the width of spin buttons in wxGTK, this more or less worked
for GTK+ 2 (at least with the default theme, it was perfectly possible that it
also didn't work with some other ones), but not at all with GTK+ 3 where the
buttons are much wider than the hardcoded value.

Instead, do the same thing as wxSpinButton wxGTK implementation already does
and force the GTK+ widget to compute its preferred size as we need it, i.e.
without taking the text width into account, by forcing the width of the text
entry to 0.

Notice that for GTK+ 3.12+ we also need to set the max width to 0 as well to
prevent the entry from making itself big enough for that many characters,
see #17051.
2016-04-03 18:04:26 +02:00
Vadim Zeitlin
d8b92580bc Remove @since annotations for new Scintilla GetDirectXXX() methods
This partially undoes 0a3057b83c which wrongly
modified the generated interface/wx/stc/stc.h file, as these changes were lost
after regenerating it again.

Unfortunately it doesn't seem possible to have @since annotations for the
Scintilla methods currently, ideally the generator script should be modified
to allow this, somehow.

See #17481.
2016-04-03 17:44:54 +02:00
New Pagodi
0a3057b83c Add GetDirect{Function,Pointer}() methods to wxStyledTextCtrl
These methods can be useful when working with dynamic lexers.

Closes #17481.
2016-04-03 15:50:21 +02:00
New Pagodi
a6e249ea1a Add support for loading external lexers to wxStyledTextCtrl
Implement Scintilla DynamicLibraryImpl and generate LoadLexerLibrary() and
GetLexerLanguage().

Closes #17480.
2016-04-03 15:47:48 +02:00
Artur Wieczorek
ae1a332d1f Fix value returned by wxBitmap::GetDepth() in wxMSW
Some operations on wxBitmap involve converting the internal representation
from DIB to DDB, and when this is done it can happen that the resulting DDB
will have different colour depth than source DIB because CreateDIBitmap()
Windows API which is used for conversion purposes can create DDB with
"whatever bit depth your reference DC is".

Therefore after every operation which directly or indirectly employs
CreateDIBitmap() it is necessary to update respective data member with the
actual color depth of the obtained DDB.

Closes #17479.
Closes https://github.com/wxWidgets/wxWidgets/pull/265
2016-04-03 15:31:18 +02:00
Iwbnwif Yiw
8006c4fed1 Improve wxDataViewModel::Compare() documentation
Document the function parameters and return value.

Closes #17477.
2016-04-03 15:27:28 +02:00
Iwbnwif Yiw
1765794015 Fix wxRegEx example in the documentation
Fix typos and make the code actually compile.

Closes #17475.
2016-04-02 18:52:23 +02:00
Vadim Zeitlin
8baaa652ef Merge branch 'dvc': miscellaneous wxDataViewCtrl-related fixes 2016-04-02 01:09:06 +02:00
Steve Browne
ceaa840d7b Restore cwd even if wxFileDialog is cancelled in wxMSW
Sometimes the file dialog changes the current directory even if it is
cancelled, so restore it in any case, not only after successful return.

Closes https://github.com/wxWidgets/wxWidgets/pull/263
2016-04-01 03:37:13 +02:00
Artur Wieczorek
cb14859d10 Fixed drawing on wxMemoryDC with Cairo (wxMSW).
When Cairo surface is created from 32bpp wxBitmap then there is necessary to provide a location of its bit values to cairo_image_surface_create_for_data function and hence bitmap selected into wxMemoryDC has to be converted to DIB, if it is not a DIB already.
Moreover, if 32bpp bitmap doesn't contain real transparency data (is 0RGB bitmap) then its alpha values have to be corrected and set to wxALPHA_OPAQUE value (255).

Closes #17469.
2016-03-31 19:40:08 +02:00
İsmail Dönmez
467dc72fc2 Check for C/POSIX locale just after we truncate language string
This way we can correctly detect C.UTF-8 as C locale.

Closes https://github.com/wxWidgets/wxWidgets/pull/262
2016-03-30 15:38:13 +02:00
Jouk
ab0a64f0fb Update OpenVMS setup 2016-03-30 12:01:39 +02:00