Commit Graph

62794 Commits

Author SHA1 Message Date
Artur Wieczorek
6395e7805a Fix repositioning of active property editor in wxPG
When there is open an editor for some property and in the same time
wxPropertyGrid layout is changed (due to the adding or removing a property,
sorting), it is necessary to recalculate the actual position of the active
editor to display it in the cell dedicated for the edited property. Under
some platforms the position of the edit control is shifted within the cell
and we have to take this shift into account in repositioning process.
Because actual value of the shift depends on the platform and on
the particular control, it is convenient to determine actual shift when
the editor is created and use this value whenever repositioning is done.

Close #17912.
2017-07-16 19:38:08 +02:00
Artur Wieczorek
dd9c08447e Fix positioning of ComboBoxEditor in wxPG (wxOSX)
Position of the combo box editor associated with properties having custom
bitmaps like e.g. ColourProperty, needs to be adjusted in order to display
edited text at the same position as the text which is displayed as
a property value prior to the editing.
2017-07-16 19:13:37 +02:00
Artur Wieczorek
836bbcbfcb Fix positioning of TextCtrlEditor in wxPG (wxOSX)
Position of the editor associated with properties like StringProperty,
IntProperty, etc. needs to be adjusted in order to display edited text
at the same position as the text which is displayed as a property value
prior to the editing.
2017-07-16 19:12:20 +02:00
Artur Wieczorek
9994288688 Fix positioning of ComboBoxEditor in wxPG (wxGTK)
Position of the combo box editor associated with properties having custom
bitmaps like e.g. ColourProperty, needs to be adjusted in order to display
edited text at the same position as the text which is displayed as
a property value prior to the editing.
2017-07-16 19:09:18 +02:00
Artur Wieczorek
3212f7eab9 Fix positioning of TextCtrlEditor in wxPG (wxGTK)
Position of the editor associated with properties like StringProperty,
IntProperty, etc. needs to be adjusted in order to display edited text
string at the same position as the text which is displayed as a property
value prior to the editing.
2017-07-16 19:03:38 +02:00
Artur Wieczorek
afdb7eca87 Use quotes and not angle brackets around the includes of wxWidgets itself 2017-07-16 18:31:54 +02:00
Paul Cornett
a03c2ef4e0 Fix wxComboBox entry sizing with GTK+ >= 3.20, see #17852 2017-07-16 09:09:06 -07:00
Vadim Zeitlin
bde5e535dc Merge branch 'more-msw-ignore'
Ignore MSW build directories for more compilers.
2017-07-16 16:04:49 +02:00
Vadim Zeitlin
a07013a6f1 Tab navigation improvements for wxOSX
Closes #17341.

Closes https://github.com/wxWidgets/wxWidgets/pull/493
2017-07-16 15:59:48 +02:00
Vadim Zeitlin
16fdbb4e97 Credit ikamakj for the tab navigation fixes in wxOSX
See the description of https://github.com/wxWidgets/wxWidgets/pull/493.
2017-07-16 15:58:27 +02:00
Vadim Zeitlin
4defd593dc Compilation fix for wxOSX when not using PCH
Explicitly include wx/containr.h in a header using wxNavigationEnabled.
2017-07-16 15:57:54 +02:00
Vadim Zeitlin
de3087c0de Tab navigation improvements for wxOSX
Closes https://github.com/wxWidgets/wxWidgets/pull/493
2017-07-16 15:52:38 +02:00
Vadim Zeitlin
d34dd2f92f Ignore build directories under tests/benchmarks 2017-07-16 15:47:04 +02:00
Vadim Zeitlin
5456345bb9 Ignore more bakefile-generated MSVS solutions under tests
This covers test_vc*.sln too.
2017-07-16 15:46:11 +02:00
Vadim Zeitlin
c0199ccfd2 Ignore samples, demos, tests build directories for all compilers
Generalize the "vc_msw*" exclusions under the other directories
(samples, demos, tests, utils) to all compilers and versions, like it
was already done for the directories under build/msw.
2017-07-16 15:43:14 +02:00
Vadim Zeitlin
05e7916938 Ignore build/msw/wx_local.props file
It is supposed to be used for local installation only and never be
checked in.
2017-07-16 15:34:14 +02:00
Vadim Zeitlin
d52c86fa63 Add another email address for Steve Browne
Ensure that "git log --use-mailmap" shows committer email consistently.
2017-07-16 15:22:05 +02:00
Steve Browne
1525e84e56 Fix unwanted refreshes when setting size of wxChoice in wxMSW
The window was still resized even if its size didn't really change,
which, in particular, unexpectedly resulted in closing its drop down if
it was shown.

Fix this by moving the code dealing with the different interpretation of
the control height between wxMSW and MSW (for the former, it's just the
height of the visible part, while for the latter it includes drop down
as well), from wxChoice::DoSetSize() to DoMoveWindow(). This allows the
base class DoSetSize() to correctly filter out calls not really changing
the size, while still setting the height correctly when it does change.

See #17075.

See https://github.com/wxWidgets/wxWidgets/pull/389
2017-07-16 15:17:03 +02:00
Vadim Zeitlin
0bae199ffe Merge branch 'msw-locale'
Fixes for setting locale under MSW when using older compilers and minor
simplifications and optimizations in wxLocale code.

See https://github.com/wxWidgets/wxWidgets/pull/517
2017-07-16 15:04:16 +02:00
Vadim Zeitlin
019e9d041f Fix setting locale under MSW when using locale name
Previously, all MSW-specific stuff like calling SetThreadLocale() and
SetThreadUILanguage() was only done when initializing wxLocale from a
wxLanguage value, but not when using a string name for it.

Fix this by implicitly calling Init(wxLanguage) from Init(wxString) if
we can find the language corresponding to the given name, and if the
other parameter is not incompatible with it.
2017-07-16 15:03:24 +02:00
Vadim Zeitlin
8cb4e70064 Refactor wxLocale initialization code
Don't call wxSetlocale() in DoInit() any more, this was redundant when
it was called from Init(wxLanguage) overload.

Add new DoCommonPostInit() called from both Init() overloads after
setting the locale in whichever way they do it to avoid code
duplication.

As a side effect of this change, the error message given if the locale
can't be set is the same now independently of the ctor/Init() overload
used (previously it differed depending on whether a wxLanguage or the
name of the language as string was passed) and it's always logged using
wxLogWarning() and not it in one case and wxLogError() in the other one.
2017-07-16 15:03:22 +02:00
Vadim Zeitlin
2deca99789 Don't duplicate "ret" flag in wxLocale::Init()
Simplify the code by just using "retloc != NULL" as success indicator
until the call to DoInit() instead of keeping a separate "bool ret"
variable in sync with "retloc".
2017-07-16 15:03:20 +02:00
Vadim Zeitlin
8713d73466 Avoid at least some unnecessary setlocale() calls
Instead of calling wxLanguageInfo::GetLocaleName(), which called
setlocale() at least thrice (first to query the current locale, second
to try to change it and third to restore the original locale) and then
calling setlocale() again if it succeeded, use the new TrySetLocale()
method which calls setlocale() just once and doesn't require calling it
again in the caller.

This makes the code slightly more efficient but, more importantly,
shorter and more clear.
2017-07-16 15:03:17 +02:00
Vadim Zeitlin
1003cf3e92 Remove unnecessary c_str() calls in wxLocale code
Pass wxString directly to wxLogWarning(), there is no need for c_str()
since wx 3.0 any more.
2017-07-16 15:03:15 +02:00
Vadim Zeitlin
9104e6fc9a Avoid unnecessary copies in wxLocale code
Micro-optimization: don't copy the strings unnecessarily when using just
a const reference is sufficient.
2017-07-16 15:03:12 +02:00
Vadim Zeitlin
ca3d86155c Get rid of another unused variable in wxLocale::Init()
This one was defined and used only once, just remove it completely.
2017-07-16 15:03:10 +02:00
Vadim Zeitlin
2d170d1bb6 Get rid of common "locale" variable in wxLocale::Init()
Try to make code less confusing by avoiding defining a variable in
platform-independent part of the code and then actually using it only in
platform-specific code.
2017-07-16 15:03:08 +02:00
Vadim Zeitlin
9b387434a0 Remove unnecessary checks for wxLANGUAGE_DEFAULT
Simplify the code by not checking for language == wxLANGUAGE_DEFAULT in
wxLocale::Init(): this can't happen because we use the system language
when passed wxLANGUAGE_DEFAULT as parameter and return false immediately
if we can't determine the system language.
2017-07-16 15:03:05 +02:00
Vadim Zeitlin
7836dfbc77 Make wxLanguageInfo::GetLocaleName() consistent across platforms
Check that the locale can be indeed set to the given string in Unix
version too, there doesn't seem to be any good reason to do it for MSW
only.
2017-07-16 15:03:03 +02:00
Vadim Zeitlin
2e2682116f Try to return valid name from MSW wxLanguageInfo::GetLocaleName()
Check if setlocale() really works with the name of the returned locale
and return empty string if it doesn't.

This fixes problem with setting locale when using old MSVC or MinGW CRT
under new (Vista+) MSW versions, as the CRT doesn't support the locale
names returned by LOCALE_SNAME and we need to fall back on
LOCALE_SENGLANGUAGE.
2017-07-16 15:03:00 +02:00
Vadim Zeitlin
a2056d7314 Fix 32 bit wxOSX build after wrong merge
Correct wrong merge of 1c0ecec225, the
checks for __LP64__ should have been removed in the merge commit
aaae5ef702 but were mistakenly left in.

See https://github.com/wxWidgets/wxWidgets/pull/377
2017-07-16 14:54:28 +02:00
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