Commit Graph

65326 Commits

Author SHA1 Message Date
Vadim Zeitlin
dfd03f5fee Don't refresh wxStaticText if its label didn't really change
Optimize calling SetLabel() with the same label as the current one, this
seems to happen quite often in practice and results in flicker, so check
for it explicitly.
2017-07-16 02:36:07 +02:00
sbrowne
4e2684c155 Avoid flicker when size of wxStaticText doesn't change in wxMSW
Don't do anything if wxStaticText::DoSetSize() is called with the same
size as the control already uses, this only results in flicker.

Closes #17075.
2017-07-16 02:28:16 +02:00
sbrowne
66c5762ab9 Fix check for unchanged size in MSW wxWindow::DoSetSize()
Adjust the size and position we're about to set before comparing them
with the current ones, otherwise the result of the comparison could be
wrong when width and/or height are -1.

See #17075.
2017-07-16 02:22:46 +02:00
Paul Cornett
a9c1f17131 Fix creating cursor from XBM data with GTK3, see #17916 2017-07-15 11:52:01 -07:00
Lauri Nurmi
05ced5ce01 Handle stand-alone weekday and month names in macOS date formats
macOS returns "cccc" (stand-alone weekday name) as a part of the
preferred date+time format for Finnish, and possiblly others. This was
not handled at all by wxTranslateFromUnicodeFormat(), and the user
saw the raw "cccc".

Similarly, handle stand-alone month name ("LLLL").

Closes https://github.com/wxWidgets/wxWidgets/pull/518
2017-07-15 18:08:21 +02:00
Stefan Csomor
175c62d3f3 Using 'new-style' AssertMacros to support compilation for macOS 10.3 and iOS 11
To avoid collisions with boost and c++ standard library using the assert macros starting with two underscores is the default under these new SDKs. Since they already existed in our minimum deploment SDK we can switch them safely.
2017-07-15 13:30:59 +02:00
Kolya Kosenko
a770cd8d79 Fix wxIconBundle::AddIcon() compilation in wxGTK/Win32
This function doesn't compile currently because CreateFromHICON() is
wxMSW-only, so disable it it to at least let wxGTK compile for now, even
if the real solution would be to implement CreateFromHICON() for wxGTK
too.

Closes #17875.
2017-07-13 23:02:03 +02:00
Steve Browne
31ba2d4ca3 Fix setting foreground color for several controls in wxOSX
This allows setting color of wxStaticBox, wxCheckBox, wxRadioButton and
any other controls that use NSBox and NSButton to work.

Closes #16284.

Closes https://github.com/wxWidgets/wxWidgets/pull/489
2017-07-11 23:51:30 +02:00
Vadim Zeitlin
a0f9ab3e6d Merge branch 'preferences-sample'
Try to improve the sample and make it more realistic/representative of
the real world applications.
2017-07-11 23:46:36 +02:00
Vadim Zeitlin
101509eb4b Simplify platform differences handling in the preferences sample
Use an alternative and arguably simpler (at least with real-life
applications, where settings are somewhat more complex) way of handling
the differences between platforms in the preferences sample: instead of
executing completely different code under different platforms, always
update the local copy of the settings immediately and just propagate, or
not, it to the application-level settings depending on the current
platform.

This costs an extra copy of the settings object on each change, but this
shouldn't be a problem in practice, and OTOH results in using mostly the
same code under all platforms, reducing the probability of
platform-specific bugs and avoiding any code duplication between the
event handlers and TransferDataFromWindow().
2017-07-11 23:46:27 +02:00
Vadim Zeitlin
552c942a76 Actually show settings changing in the preferences sample
Make the sample slightly more realistic by adding a MySettings struct whose
fields are updated the dialog and also make it more visual by showing the
current values of (some) settings on the screen.
2017-07-11 23:23:32 +02:00
Vadim Zeitlin
6de9a284a7 Use Bind() instead of Connect() in preferences sample
This makes the code shorter and more clear.
2017-07-11 23:23:32 +02:00
Vadim Zeitlin
18f3992801 Just fix a typo in the preferences sample
"Use" and not "User".
2017-07-11 23:23:32 +02:00
Vadim Zeitlin
aaae5ef702 Merge branch 'better-mac-32bit-fix'
Re-enable alignment support for wxDataViewCtrl cells in wxOSX which was
previously disabled just to allow the library to compile in 32 bits.

Closes https://github.com/wxWidgets/wxWidgets/pull/377
2017-07-11 23:16:49 +02:00
Vadim Zeitlin
aa8c9e1b86 Remove wxCFDictKeyToInt which became unused after recent changes
75831d232c removed all references to this
function, but left the function itself, resulting in -Wunused-function clang
warnings (and compiling an unused function, of course).
2017-07-11 23:16:33 +02:00
Vadim Zeitlin
a5bcf1dafd Fix wxOSX view comparison callback signature for older SDKs
Take NSView* in the callback used by [NSView sortSubviewsUsingFunction:context:]
only when using 10.12 SDK, but not when using earlier ones, as the callback
was still taking just "id" in them.
2017-07-11 23:16:28 +02:00
Vadim Zeitlin
e851db7e9e Avoid -Wexpansion-to-defined clang warning in wxOSX
Define wxCLRDLGG_USE_PREVIEW_WITH_ALPHA as either 0 or 1 instead of using an
expression involving "defined" for it as the latter provoked many clang
-Wexpansion-to-defined warnings, which were harmless but very annoying.
2017-07-11 23:16:28 +02:00
Vadim Zeitlin
467c48841f Rename wxTextFieldCell members once again
Use underscores on them to show that they are different from properties or
local variables (in pure Objective C they would actually start with
underscores, but this is not a good idea in C++ code) and avoid conflict
between a member name and "wxAlignment" type name, which was confusing.
2017-07-11 23:16:14 +02:00
Vadim Zeitlin
a326da369b No real changes, just remove leading underscore from variables
Now that these variables are in a public header, don't use leading underscores
for them, if only for consistency with all the others.
2017-07-11 23:16:13 +02:00
Vadim Zeitlin
1c0ecec225 Better fix for 32 bit wxOSX build
Instead of disabling vertical alignment support in wxDataViewCtrl, move the
private variables to the header file: this is supported by all versions of the
Objective-C runtime, including the old one used for 32 bit applications,
unlike the new way based on declaring the variable in an anonymous extension.

This replaces the changes of 22216b70e7.
2017-07-11 23:16:13 +02:00
Artur Wieczorek
3105134548 Don't attempt to get CTM if CGContext is NULL
When wxMacCoreGraphicsContext is constructed with CGContext==NULL, initial
transformation matrix can be assumed as an identity matrix.
2017-07-09 14:49:44 +02:00
Artur Wieczorek
796ffb3671 Initialize variable holding initial transformation matrix
When wxMacCoreGraphicsContext is created for wxGraphicsRenderer, initial transformation matrix is just an identity matrix.
2017-07-09 10:13:40 +02:00
mikek
2d8657d37c Fix escaping/unescaping in wxLongStringProperty
wxPropertyGrid::ExpandEscapeSequences() function should convert all valid
escape sequences (\r, \n, \t, \\) to the corresponding single characters
(CR, LF, TAB, backslash, accordingly) and
wxPropertyGrid::CreateEscapeSequences() function should do the reverse
operation and convert these raw characters to the corresponding escape
sequences.

Closes #17896.
2017-07-06 23:14:08 +02:00
Vadim Zeitlin
5292f77ab4 Check for window best size in wxPersistentTLW
Ensure that the restored size is at least equal to the best size of the
window to avoid cutting off parts of it in (a common) case when a newer
version of the program adds new UI elements, thus increasing the window
best size and possibly making the previously stored size too small.
2017-07-06 15:22:10 +02:00
Vadim Zeitlin
7092b1112e Fix caching of wxFONTSTYLE_SLANT fonts in wxTheFontList in wxMSW
Creating a font with wxFONTSTYLE_SLANT results in a font whose
GetStyle() returned wxFONTSTYLE_ITALIC, so it was never found in the
cache, resulting in, effectively, leaking memory and GDI handles because
each new call to wxFontList::FindOrCreateFont(...wxFONTSTYLE_SLANT)
created a new font.

Fix this by just hardcoding that wxFONTSTYLE_SLANT is wxFONTSTYLE_ITALIC
under MSW, this is ugly but avoids backwards incompatible (and not
obviously correct) change of making wxFont::GetStyle() return
wxFONTSTYLE_SLANT if the font was created using this style.

Notice that wxFont::GetStyle() does behave like this in wxOSX currently,
so there is an inconsistency between ports here. It would arguably be
better to make wxOSX behave like wxMSW because the actual font is really
italic and not slant/oblique and if we do this, the preprocessor
condition in this commit should be extended to cover wxOSX too.

Closes #17903.
2017-07-06 15:01:00 +02:00
Vadim Zeitlin
b158385c47 Fix completely broken default button handling in wxMSW
The logic in wxButton::{Set,Unset}TmpDefault() didn't work at all when
the temporary button was the same as the permanent default button as the
code made the same button non-default immediately after making it
default (or vice versa). In particular, this ensured that default button
was never highlighted correctly (at least after the first focus change)
in dialogs containing a single button only.

Fix this by simply skipping modification of the old default button if it
was the same one as the new default button.
2017-07-06 14:43:27 +02:00
Bryan Petty
ed173ed91e Use HTTPS with Trac links. 2017-07-04 13:15:14 -06:00
Artur Wieczorek
823f75c739 Enable selecting opacity in generic wxColourPicker
This is implmentation of the feature which is already implemented in
the native wxColourPicker under wxGTK.
2017-07-03 22:48:30 +02:00
Artur Wieczorek
a29815e19a Allow turning on/off opacity selector in wxColourDialog (wxOSX)
This feature to show/hide alpha values and opacity selector (slider) is
already implemented under wxGTK and for generic wxColourDialog.
For the sake of backward compatibility, this feature is enabled here by
default (through the corresponding property of wxColourData).
2017-07-03 22:48:04 +02:00
VZ
294436c8bb Improve wxBasicString and fix memory leaks when using it
Improve and extend wxBasicString API and fix multiple BSTR leaks in due to
confusingly named Get() method in the old API.

Closes #17889.
2017-07-03 02:28:37 +02:00
arturs
715608fe6a Return (0,0,0,0) rectangle if clipping region is empty
When clipping region is empty, CGContextGetClipBoundingBox() returns (+Inf,+Inf,0,0) rectangle but we need to return (0,0,0,0) rectangle in this case.

See #17609.
2017-07-02 15:06:06 +02:00
Artur Wieczorek
c55bbdf700 Fix setting wxGCDC clipping region with device coordinates (wxOSX)
Currently region given in device coordinates is decomposed into the stripes which are next transformed to the logical coordinates required by underlying wxGraphicsContext::Clip() function. Some of these stripes given in device coordinates can have 1-pixel height what after transformation to logical coordinates can give zero-height stripes (after rounding). This can lead to the situation that in the region transformed to logical coordinates some stripes can disappear and final transformed region shape is different from the source shape (it has gaps).
To fix this issue device coordinates of the region are not manually transformed to the logical coordinates but instead wxGraphicsContext's is temporarily set to the state where its logical coordinates are equivalent to device coordinates and thus clipping region can be applied directly.
Solution for wxMSW, wxGTK is implemented in ea8cb7a24a.

Closes #17609.
2017-07-02 14:43:50 +02:00
Artur Wieczorek
a9fcfe1085 Fix getting/setting transformation matrix (wxOSX)
Transformation settings already applied to the source objects (CGContext, wxWindow) and inherited by wxGraphicsContext should be considered as a baseline transformation matrix for wxGC and shouldn't be exposed through e.g. GetTransform() function (like it's done in Cairo or Direct2D). To report only transformations explicitly applied to wxGC by calls to the corresponding wxGC functions, we need to store initial CTM (in a dedicated variable) and "subtract" it from the actual transformation settings.

See #17609.
2017-07-02 14:31:00 +02:00
Artur Wieczorek
6b4be47a7a Fix retrieving clipping box after changing wxGCDC coordinates (wxOSX)
Member data containing clipping box have to be updated not only when the clipping region is explicitly changed by SetClippingRegion()/DestroyClippingRegion() but also when existing wxGraphicsContext is associated with wxGCDC using SetGraphicsContext() or when wxGCDC coordinates are transformed with SetDeviceOrigin(), SetLogicalOrigin(), SetUserScale() or SetLogicalScale().
When any of these functions is called then clipping box data are marked as invalid and retrieved from underlying graphics context using wxGraphicsContext::GetClipBox() at nearest call to GetClippingBox().
Solution for wxMSW, wxGTK was implemented in 98714ea452.

See #17646.
2017-07-02 13:55:53 +02:00
Artur Wieczorek
214ed20697 Fix wxGCDC::Clear (wxOSX)
If underlying graphics context is rotated then drawing a rectangle with origin at (0,0) doesn't cover all the drawing area. To draw over entire area we need to get extents of the actual clipping region (with applied all transformations) and use it as coordinates of the drawn rectangle.
Solution for wxMSW and wxGTK was implemented in 12eaa61212eaa61930.

See #17636.
2017-07-02 13:46:18 +02:00
Artur Wieczorek
f311807112 Handle EVT_CONTEXT_MENU directly in wxSTC (wxOSX)
A simulation of context menu event by handling directly EVT_RIGHT_UP was implemented in wxSTC in 451c5cc7b9, but later on, EVT_CONTEXT_MENU generation in wxOSX was fixed in 524c47aa3a so  simulation is no longer necessary and this event can be directly handled in wxSTC.
2017-07-02 13:02:13 +02:00
PB
6725a0a1b8 Fix BSTR leaks in wxAMMediaBackend and wxWMP10MediaBackend. 2017-07-01 13:07:59 +02:00
PB
ca3f919da9 Make wxBasicString safer and easier to use as a BSTR RAII wrapper. 2017-07-01 12:50:24 +02:00
Stefano D. Mtangoo
2971930ab8 Fix wx/textcompleter.h compilation when it's the first included header
Explicitly include the required headers instead of relying on them being already included.

Closes https://github.com/wxWidgets/wxWidgets/pull/513
2017-06-29 17:17:01 +02:00
Jouk
94ebaca432 Adding src/common/stringops.cpp for compilation on OpenVMS 2017-06-29 16:29:39 +02:00
Stefan Csomor
d9ba8f7fa1 Minimum code for triggering wxEVT_DATAVIEW_ITEM_START_EDITING event, see #479
The version with calling the base class resulted in always vetoing unless there was a custom renderer which had CreateEditorCtrl implemented.
2017-06-29 11:23:49 +02:00
VZ
326e8b3064 Add documentation for wxImageHandler derivations
This makes it possible to wrap these classes automatically

It also documents wxGIFHandler::SaveAnimation() which wasn't previously
documented at all, even implicitly and so closes #16424.

Closes https://github.com/wxWidgets/wxWidgets/pull/511
2017-06-29 02:33:27 +02:00
Stefan Csomor
12d8f69190 Keep icon when text is changed
Copied over code from the generic implementation to make things work properly - the icon got lost before.
2017-06-28 10:29:49 +02:00
Stefan Csomor
8d78887a22 Clean up setters, they take the ownership, so no need to retain and autorelease 2017-06-28 10:28:04 +02:00
Stefan Csomor
1902c5ceb8 Document iOS 9 as minimum deployment version. 2017-06-28 09:17:36 +02:00
Stefan Csomor
62052e365e Do not offset coordinates in case of filling 2017-06-28 07:34:53 +02:00
Stefan Csomor
a6ba2245ef Redo Use implicit wxColour to wxBrush conversion 2017-06-28 07:22:54 +02:00
Stefan Csomor
1985fca987 Merge branch 'master' of https://github.com/wxWidgets/wxWidgets 2017-06-28 07:21:51 +02:00
Stefan Csomor
46742a6043 Use implicit conversion from wxColour to wxBrush 2017-06-28 07:12:57 +02:00
Oliver Smith
b8f83725ed Fix D2D wxGraphics build with wxUSE_UNICODE==0
Revert one of the changes of 5520702674 which
replaced direct check with a call to lstrlen() which seems to be unneeded and
doesn't compile in non-Unicode build.
2017-06-28 02:53:46 +02:00