Commit Graph

39762 Commits

Author SHA1 Message Date
Vadim Zeitlin
7542632302 Fix keyboard event key codes when using Wayland
Correct the confusion between compile- and run-time checks for X11.

Closes #17848.
2017-04-26 22:30:36 +02:00
Jouk
0c748453e7 make compile work again when wxUSE_UNICODE is not defined 2017-04-26 11:24:33 +02:00
Artur Wieczorek
37ecd7b760 Fix displaying labels of wxRadioBox items
Labels containing mnemonic prefixes (&) and literal underscore characters
have to be converted to the proper GTK labels where underscore
characters act as mnemonic markers. If label contains mnemonic then
dedicated function gtk_radio_button_new_with_mnemonic() should be used
to create radio button item.

Closes #17419.
2017-04-25 18:15:34 +02:00
Lauri Nurmi
148e8971c7 Fix the integer value in events generated by generic wxSpinCtrl
This notably fixes the problem with changing the year using spin control
arrows under macOS, where this control is used as part of
wxGenericCalendarCtrl, as not having the correct value in the event object
resulted in bogus events with dates in the year 0 there.

Closes http://trac.wxwidgets.org/ticket/17193
2017-04-25 13:08:14 +02:00
Vadim Zeitlin
b502a5c44d Fix wxMotif build after recent argv changes
Update wxMotif too after 70a499f635.
2017-04-23 16:20:13 +02:00
Scott Talbert
cbe0a1f049 Add support for WebKit2GTK+ in wxWebView 2017-04-22 20:00:48 +01:00
Vadim Zeitlin
9c35db85d1 Use symbolic constant for DST shift
No real changes, just use DST_OFFSET constant instead of 3600 and remove the
"FIXME" comments as we're not actually going to fix anything here but will
just continue to assume 1 hour shift for DST.
2017-04-19 17:07:44 +02:00
Vadim Zeitlin
f6d9d7962e Revert wrong fix for wxDateTime timezone conversion to/from local
This reverts commit aaddf6be7f as it broke
handling of dates when local time zone is BST, whose offset not counting DST
is 0, as for UTC, but which still should be handled as local timezone,
see #17220.

With the current wxDateTime handling of time zones, FromTimezone(Local)
doesn't make much sense anyhow, so abandon attempts to try making it work as
to really do it we need to specify the time zone being converted from too, as
explained in the second point of #10445.

See #16585.
2017-04-19 17:07:44 +02:00
Metallicow
8c8d8c4d3a Fix "ont" (instead of "one") typo in wxSTC
Correct "ont" to "one" in several places.
2017-04-18 12:25:46 +02:00
Jens Göpfert
7e530e23e1 Update selection in wxAuiNotebook correctly after tab move
Update the selected state of the tab with the index corresponding to the old
index of the tab which was moved.

Closes #16605.
2017-04-18 03:36:16 +02:00
Artur Wieczorek
06963940fb Change current font only if new graphics font is successfully created
If new graphics font couldn't be created successfully there is no need
to reset current font by updating it to wxNullGraphicsFont.

Closes #17790.
2017-04-17 18:57:31 +02:00
Artur Wieczorek
7f9453dfdf Handle unsuccessful creation of graphics font in Direct2D
Apparently, DirectWrite fonts can be created only from TrueType fonts and
therefore only such fonts can be used with Direct2D-based wxGraphicsContext.
When unsuported GDI font is passed to CreateFont() then no graphics font is
created and this unsuccessful attempt is signalled by returning
wxNullGraphicsFont. This null object can be used in e.g. wxGC::SetFont()
to check if font was actually created.

See #17790.
2017-04-17 18:57:02 +02:00
Vadim Zeitlin
5bf8fb1879 Fix fatal bug in the last commit: restore setting argc
Initialization of wxApp::argc was mistakenly removed, breaking the code
iterating over wxApp::argv from 0 to it.

See https://github.com/wxWidgets/wxWidgets/pull/462
2017-04-16 18:06:03 +02:00
Vadim Zeitlin
70a499f635 Don't rely on argv being NULL-terminated under MSW
Since the changes of c9a458bfe8 ("Use Win32
::CommandLineToArgvW() to tokenize command line"), this is not guaranteed any
more as this Win32 function doesn't necessarily ensure it under older MSW
versions such as XP.

Just use "argc" explicitly instead of relying on this in wxCmdLineArgsArray to
fix crashing under XP.
2017-04-16 17:50:22 +02:00
Lauri Nurmi
4cdc1f5ba8 Compilation fix for narrowing conversions in XBM files in wxMotif
The same fix as in commit 3704547684 for ticket #12575.
2017-04-15 14:31:30 +02:00
Artur Wieczorek
0ac0f4b259 Fix wxMemoryDC::Blit() with itself as source in wxGTK3
Drawing on the Cairo surface itself can give invalid results when source and destination regions overlap.
To avoid this problem we have to copy actual source surface to the temporary one and use this copy in drawing operations.

Closes #17666.
2017-04-14 09:33:20 +02:00
Artur Wieczorek
d0a07b665f Fix MSVC14 warnings about shadowed variables in wxSTC
Just to suppress harmless warnings.
2017-04-09 21:29:31 +02:00
Václav Slavík
2132ff0291 Fix wxTextWrapper::Wrap with widthMax=-1
Fix regression introduced in cb2474f where Wrap() stopped treating
negative widthMax as documented, i.e. not doing any wrapping at all and
only respecting newlines.
2017-04-09 14:14:49 +02:00
Kevin B. McCarty
69110bd470 Fix spurious scrolling with deeply nested control
The original ticket #9563 about children inside a wxScrolledWindow being
scrolled, instead of just handling the mouse click (e.g. by toggling the
checkbox), was fixed some time ago when the child was a direct child of
wxPanel. However the same problem still existed when the child was inside
another window which was itself a child of wxPanel.

Generalize the fix by ignoring the child focus event if any of the window
ancestors passes our check instead of checking only the window itself.

Closes #17154.
2017-04-07 19:08:18 +02:00
Václav Slavík
60bd6842e4 Fix handling of ampersands in wxDataViewCtrl markup
Handle "&" in exactly the same way as "&" in wxMarkupParser, i.e. do not
map the former to "&&" to prevent it from being interpreted as a mnemonic as
this is incompatible with using markup for anything but the control labels,
e.g. for wxDataViewCtrl items text, in which mnemonics are not recognized.
And even when using markup for control labels, it was a questionable decision
as it's really not clear at all why should the XML entity and the raw
character itself be handled differently.

Also split wxMarkupText into two classes, wxMarkupText that handles
mnemonics in the markup (which is typically a label) and a very
similar, but not derived, wxItemMarkupText that handles mnemonics-less
markup for list etc. items, uses DrawItemText() and supports
ellipsizing.

Illustrate the use of ampersands in the dataview sample.
2017-04-07 18:45:39 +02:00
Vadim Zeitlin
0e2f6f6ec0 No changes, just fix a typo in a comment in wxMarkupText code
Also remove a couple of trailing spaces.
2017-04-07 18:45:39 +02:00
Václav Slavík
166f5c0abb Fix "unknown keyboard accel" with 1-char translations
wxAcceleratorEntry::ParseAccel() incorrectly assumes that every
single-character accelerator must be a direct character code. But
that's not true, a human-friendly name for a key (e.g. "Down") may be
translated with a single character in some languages (or because a
translator decides to use a Unicode arrow…).

Amend the test to check if the character is a 7bit ASCII one. That
would be extremely unlikely to be a translation.
2017-04-05 13:52:36 +02:00
Vadim Zeitlin
200ea47519 Fix harmless recently introduced warning in wxOSX
Add an explicit cast to suppress "NSString may not respond to 'string'"
warning from clang given since d1c5f107a1.
2017-04-04 06:54:56 -07:00
Václav Slavík
1fb0b9c01f wxOSX: Don't tighten truncated markup in wxDataViewCtrl
Starting with OS X 10.10, rich text is automatically tightened if it
doesn't fit and needs to be ellipsized, in an effort to fit more text
on screen. This is not desirable in wxDataViewCtrl where the cells may
display texts of varying lengths, some tightened and some not.
Explicitly disable this functionality to have consistent appearance.
2017-04-04 14:30:33 +02:00
Vadim Zeitlin
404f0f8587 Hide wxChoice before destroying it with GTK+ 3
This works around GTK+ critical error messages that we get otherwise with GTK+
since the change done in its commit 7401794de6b084fea469af297b7c144724b8492c
which appeared in 3.22.8 release and is still present in the latest version.

These messages happen because gtk_combo_box_popdown() ends up being called
during the widget destruction if it's still shown, so just hide the combobox
before destroying it to avoid them.

Closes https://github.com/wxWidgets/wxWidgets/pull/449
2017-04-02 22:48:19 +02:00
Vadim Zeitlin
e9ce55e000 Fix wxRmdir() with non-ASCII paths
Don't apply at best unnecessary, and actually harmful, as it uses a wrong
conversion, fn_str() when calling wxRmDir() which takes wxString.

Update unit tests to check that wxRmdir() now works with non-ASCII filenames
too.

Closes #17644.
2017-04-01 19:12:27 +02:00
jprotopopov
9b1afaa7a6 Don't crash in wxFFile::Eof() and Error() if file is closed
Assert and return false instead, this is more developer-friendly.

Add unit tests to check that these functions really work as expected when
called on a closed file.

Closes #17828.
2017-04-01 18:43:13 +02:00
Václav Slavík
d1c5f107a1 Fix crash with Vietnamese input method on macOS 2017-03-31 19:08:57 +02:00
orbitcowboy
15ae00d7a2 Declare a local variable in filefn.cpp as const
No real changes, just make a variable which is set only once const.
2017-03-31 14:09:58 +02:00
Artur Wieczorek
72e67d0c52 Fix layout and size of vertical wxSlider (wxMSW)
Correct positioning of min/max labels to prevent them to be drawn outside the control.
Use size of enabled labels to adjust the size of the slider control.

Closes #17829.
2017-03-29 20:42:24 +02:00
Catalin
e118c918ce Redefine MAPVK_VK_TO_CHAR, missing from XP 64-bit and tdm32-gcc-5.1.0 2017-03-27 18:39:20 +02:00
Prince David
f375293704 Fix wxSVGFileDC build with wxUSE_MARKUP==0
Just add the missing wxUSE_MARKUP checks.
2017-03-27 00:27:09 +02:00
Paul Cornett
493643477c Fix typo: CFStringref --> CFStringRef 2017-03-24 08:33:01 -07:00
Tim Kosse
a2b04536d3 Create empty wxCFStringRef and not null one if conversion fails
If the passed string cannot be represented in the target encoding in the
wxCFStringRef constructor, create a reference to an empty string instead of a
null ref. Most users of wxCFStringRef cannot handle a null wxCFStringRef.

Closes #17825.
2017-03-23 14:07:37 +01:00
Artur Wieczorek
6861a15607 Handle EVT_CONTEXT_MENU directly in wxSTC (wxGTK)
A simulation of context menu event by handling directly EVT_RIGHT_UP was implemented in wxSTC in ddf2da08b5, but later on, EVT_CONTEXT_MENU generation in wxGTK was fixed in ac103441d1 so  simulation is no longer necessary and this event can be directly handled in wxSTC.
2017-03-17 17:15:06 +01:00
Artur Wieczorek
c8cb673aa2 Propagate EVT_CONTEXT_MENU if standard Scintilla context menu wasn't displayed, cont.
Add missing modifications in stc.cpp template for cbbd7b44b2.
2017-03-17 17:14:39 +01:00
Artur Wieczorek
cbbd7b44b2 Propagate EVT_CONTEXT_MENU if standard Scintilla context menu wasn't displayed
EVT_CONTEXT_MENU event should be consumed in the event handler only if Scintilla context menu was actually displayed.
2017-03-16 23:36:54 +01:00
Artur Wieczorek
6aa5d07229 Use wxCharBuffer instead of wxMemoryBuffer in wxSTC
To simplify the code, use wxCharBuffer objects to store a NUL-terminated Scintilla strings.
2017-03-15 21:06:14 +01:00
Artur Wieczorek
3ec5e06dff Use wxSwap() function to swap values of variables 2017-03-15 21:02:24 +01:00
Vadim Zeitlin
0cc5b6e97e Fix wxGTK build in non-Unicode mode
Use wxGTK_CONV_FONT() and wxGTK_CONV_BACK_FONT() macros instead of implicitly
using "m_font" which doesn't exist in wxTextEntry, which is not a wxWindow.
2017-03-15 13:38:37 +01:00
Vadim Zeitlin
3eda902331 Merge branch 'more-xdg-dirs'
Add possibility to use wxStandardPaths and, hence, wxFileConfig, in
XDG-compliant (but backwards-incompatible) mode.

Closes #17727.
2017-03-15 00:49:11 +01:00
Vadim Zeitlin
6a8b0c1d0e Merge branch 'unicode-cmdline-args'
Handle Unicode command line arguments in console applications with compilers
other than MSVC too.

Closes #14580.
2017-03-15 00:33:40 +01:00
New Pagodi
91a2869b0e Extend FindText() to return end position of matched text in wxSTC
New 5th parameter of FindText() can be used to receive the end position of matched text returned by SCI_FINDTEXT API.

Closes #17305.
Closes https://github.com/wxWidgets/wxWidgets/pull/23
2017-03-13 20:21:41 +01:00
New Pagodi
187c4692c8 Fix regression in mouse click event handling in wxSTC
In EVT_RIGHT_DOWN event handler introduced in 68888ca0a2 we need to propagate event to process it further in EVT_RIGHT_UP handler. This is important especially for wxGTK and wxOSX where EVT_RIGHT_UP is used to generate a context menu event.

Closes #17817.
2017-03-12 17:03:36 +01:00
VZ
edb72282a4 Merge pull request #431 from catalinr/rmv_old_Win_define_checks
Remove checks for several old symbols and defines present in XP and later SDKs.
2017-03-11 17:56:56 +01:00
Vadim Zeitlin
c9a458bfe8 Use Win32 ::CommandLineToArgvW() to tokenize command line
Use the standard function in Unicode build instead of our own emulation, it
should give better results and is marginally more efficient as it does fewer
heap allocations than our own wxCmdLineParser::ConvertStringToArgs().
2017-03-11 03:41:25 +01:00
Vadim Zeitlin
5b74044c3e Use Unicode command line when not using wmain() under Windows
While we use wmain() for the compilers that provide it since the changes of
bfa78c63b9, we still didn't handle Unicode
command line arguments not representable in the current Windows code page
correctly when using other compilers (e.g. MinGW).

Now use Win32 ::GetCommandLine() function for them and parse the command line
ourselves instead of relying on non-Unicode-friendly main() arguments which
can't represent arbitrary Unicode strings when not using UTF-8 (which is never
the case under Windows).
2017-03-11 03:41:23 +01:00
Vadim Zeitlin
3ad54f2852 Iterate over wxTextFile without using indices
Using iterator methods is less error-prone (there is no danger of using an
invalid index) and slightly shorter and more clear too.
2017-03-09 18:06:33 +01:00
Vadim Zeitlin
058f8c3c0f Use wxFileName instead of manipulating strings directly
Prefer to use wxFileName ctor to string concatenation.
2017-03-09 18:04:44 +01:00
Vadim Zeitlin
214aac6fd6 Avoid calling wxGetenv() twice unnecessarily
Use wxGetEnv() helper function which allows to write the code in more natural
and (slightly) more efficient way.

No real changes.
2017-03-09 18:02:14 +01:00