Commit Graph

66572 Commits

Author SHA1 Message Date
Ian McInerney
d82351ffa3 Add invalid keys to documentation 2019-08-04 21:49:33 +02:00
Ian McInerney
1eea919f13 Mark more keys as being invalid for GTK accelerator keys 2019-08-04 21:46:27 +02:00
Ian McInerney
a8af0c27af Add validity check before doing accelerator key creation 2019-08-04 21:45:59 +02:00
Ian McInerney
4d582eda57 Updated documentation to reflect invalid GTK keycodes 2019-08-04 21:25:49 +02:00
Ian McInerney
f3edad2761 Remove invalid GTK accelerator keys 2019-08-04 21:17:10 +02:00
Ian McInerney
891053792f Cleanup the GTK accelerator key creation
* Remove the accelerator text if the key is not created
* Fix naming of some GTK keycodes
2019-08-04 18:53:01 +02:00
Ian McInerney
17e8e9c015 Fix several accelerator key issues from unit tests
* Bad parsing of "Num " keys
* No parsing of NUMPAD_F keys
* Missing multiply key
* No case preservation on non-modifier accelerators
* No parsing of F13-24 keys
2019-08-04 18:48:50 +02:00
Ian McInerney
2cb96c16ff Add unit test for menu accelerator assignment 2019-08-04 18:41:06 +02:00
Ian McInerney
bdc301946f Upgrade accelerator entry unit tests
* Convert to the Catch framework
* Add a test for proper display name parsing
2019-08-04 18:24:16 +02:00
Ian McInerney
daae25753e Allow the use of the display name when creating accelerator keys 2019-08-04 18:22:55 +02:00
Vadim Zeitlin
235972bc6e Temporarily switch to using previous AppVeyor MSW image
The latest image uses msys2 gcc 9.1 which crashes while compiling our
tests, see e.g.

https://ci.appveyor.com/project/wxWidgets/wxwidgets/builds/26445788/job/ovajab6v4ltp5h70
2019-08-03 13:50:24 +02:00
Kvaz1r
a2f37a9ed5 Fix client coordinates mapping for wxSpinCtrl in wxMSW
Add MSWDoClientToScreen() and MSWDoScreenToClient() helpers and use them
with the correct HWND in DoClientToScreen() and DoScreenToClient()
overridden in wxSpinCtrl, i.e. the HWND of the "buddy" text control and
not the spin button, which is the main HWND of this control.

This notably fixes wxSpinCtrl::GetScreenPosition() which returned the
position of the spin button.

Closes https://github.com/wxWidgets/wxWidgets/pull/1454

Closes #18455.
2019-08-03 13:26:56 +02:00
ousnius
2a2fa8c5af Allow expanding environment variables in XRC file paths
Add a new flag wxXRC_USE_ENVVARS for wxXmlResourceFlags that triggers a
call to wxExpandEnvVars() for bitmap, icon and animation paths.

This flag is not set by default to avoid silently changing the behaviour
of existing applications.

Closes https://github.com/wxWidgets/wxWidgets/pull/1445
2019-07-31 23:57:40 +02:00
Robin Dunn
cd2e3dd2cf Various interface corrections 2019-07-31 12:18:55 -07:00
Igor Korot
a6b92cb313 Don't send EXPANDED in generic wxTreeCtrl if not really expanded
On demand expandable items can fail to be actually expanded when the
user attempts to expand them, but the generic version of wxTreeCtrl
still sent an EXPANDED event in this case, which wasn't useful and
differed from the native MSW version.

Fix this and only send the event if the item was really expanded.

Closes https://github.com/wxWidgets/wxWidgets/pull/1450

Closes #13886.
2019-07-31 01:05:48 +02:00
Vadim Zeitlin
47d58db2fb Restore, but deprecate, LOGFONT conversion functions in wxMSW
Even though these functions were declared in a header called private.h,
some code outside the library still used them, notably the popular
wxPdfDocument library.

So partially revert 72a225924d and these
functions back, and just mark them as deprecated for now.
2019-07-31 00:55:50 +02:00
Lauri Nurmi
4739b9dedd Add C++20-style starts_with()/ends_with() functions to wxString
C++20 introduces these two functions, along with some overloads, to
std::string. Add similar functions to wxString, which simply call the
already existing StartsWith() and EndsWith().

Closes https://github.com/wxWidgets/wxWidgets/pull/1452
2019-07-31 00:52:29 +02:00
oneeyeman1
a8c4cbee09 Fix new button appearance in already shown generic wxInfoBar
If the info bar is already shown, newly added buttons have to be relaid
out to appear correctly, so just add a call to Layout() in this case.

This makes the generic version work as the native GTK one, which already
handled this use case correctly.

Closes https://github.com/wxWidgets/wxWidgets/pull/1441

Closes #14120.
2019-07-29 14:47:42 +02:00
Maarten Bent
36ef28c8f3 Use wxPen pattern when drawing shapes in wxSVGFileDC
Fix drawing a rectangle with a dotted line, for example.

Closes https://github.com/wxWidgets/wxWidgets/pull/1446
2019-07-29 14:39:10 +02:00
Stefan Csomor
b0a173a460
Changed the Mac font implementation to use full font names instead of (#1416)
* Switch to using PostScriptNames internally, keeping font family name on public API

* solving roundTrip Problem of wxNativeFontInfo only
2019-07-28 14:41:55 +02:00
Daniel Kulp
b9d668e8f1 Fix recently introduced crash during wxGrid initialization
CellToGridWindow(), added by frozen rows/columns patch, returned NULL
when called with invalid row/col arguments and this could happen if any
of several methods using m_currentCellCoords were called during wxGrid
initialization, while m_currentCellCoords was still (-1, -1).

Fix this by testing for this case explicitly and returning the main grid
window, which is never NULL, instead.

Closes #18454.
2019-07-28 01:53:52 +02:00
Vadim Zeitlin
bcf604b5cb Disable wxTE_PROCESS_ENTER unit tests under wxGTK
wxUIActionSimulator doesn't work reliably there and doesn't work at all
when using Xvfb.
2019-07-26 19:29:00 +02:00
oneeyeman1
ab7ba98dbc Implement support for wxCB_SORT in wxOSX wxComboBox
Insert the item at the correct location when this style is specified.

Closes https://github.com/wxWidgets/wxWidgets/pull/1438
2019-07-26 18:19:47 +02:00
Vadim Zeitlin
fb2c17c193 Merge remote-tracking branch 'sunset/process-enter'
Fix wxTE_PROCESS_ENTER logic for wxMSW and wxGTK too.

See https://github.com/wxWidgets/wxWidgets/pull/1415

Closes #18273.
2019-07-26 18:02:08 +02:00
Vadim Zeitlin
9d92ba185c Fix truncating CJK mnemonics in control labels
13068d3603 introduced code for stripping
CJK mnemonics (i.e. trailing " (&X)") from the menu items, but due to
the use of wxStripMenuCodes() in wxControl::GetLabelText(), it also
applied to the control labels, resulting in wrongly measuring their size
(because the text used for measurement didn't include the "(&X)" part)
and truncating them in display.

Fix this by adding an explicit wxStrip_CJKMnemonics and using it only in
the code dealing with the menu item labels. This requires more changes
than just modifying GetLabelText() to use some wxStrip_NoCJKMnemonics
flag, but is more compatible as it's not impossible that some existing
code using wxStripMenuCodes() could be broken by this change too, while
now the existing behaviour is preserved.

Also improve wxStrip_XXX documentation.

Closes https://github.com/wxWidgets/wxWidgets/pull/1439

See #16736.

Closes #18452.
2019-07-26 17:59:47 +02:00
Vadim Zeitlin
8ea46e70c5 Merge branch 'clang-link-error-and-semicolon-warnings' of https://github.com/MaartenBent/wxWidgets
Fix clang warnings about extra semicolons and a link error.

See https://github.com/wxWidgets/wxWidgets/pull/1434
2019-07-26 17:58:27 +02:00
Vadim Zeitlin
d97c2ed9e3 Merge branch 'grid-frozen'
Add support for freezing wxGrid columns and/or rows.

Closes https://github.com/wxWidgets/wxWidgets/pull/1417

See https://github.com/wxWidgets/wxWidgets/pull/952
2019-07-26 17:57:23 +02:00
Vadim Zeitlin
aba9c119fa Don't crash in wx{File,Dir}PickerCtrl::GetTextCtrlValue()
If there is no text field, assert and return empty string instead of
just crashing.

Closes #14078.
2019-07-25 21:43:00 +02:00
Vadim Zeitlin
f9e80841dd Use safe wxStrlcpy() instead of strncpy()
This probably doesn't change much in practice, as it's unlikely that
SDL_GetCurrentAudioDriver() returns a 255 character long stting, but is
still safer and avoid gcc 8 warnings about passing exactly the buffer
size to strncpy().
2019-07-25 20:26:22 +02:00
Paul Cornett
b717d0c8d5 Add GTK-specific implementation of wxDisplay::GetFromWindow()
The generic implementation indirectly uses ClientToScreen(), which won't work
with Wayland, and causes debug warnings when used before window is realized.
2019-07-25 10:35:12 -07:00
Andreas Falkenhahn
79724b1710 Allow opening ToC and index in wxCHMHelpController
Use special values of DisplaySection() and KeywordSearch() parameters to
open the table of contents (if section is -1) or search page (if the
keyword to search for is empty) when using CHM help controller.

This is less discoverable than having separate Display{TOC,Search}()
methods, but avoids introducing special API that couldn't be implemented
in the other wxHelpController implementations.

Closes #18445.
2019-07-24 11:29:06 +02:00
Artur Wieczorek
9eb4c8ee2b Don't mention deprecated event type constants in the documentation
Several wxEVT_COMMAND_xxx constants were replaced with alternative (shorter) names in ce7fe42e84 and since 2.9.5 they are actually deprecated and shouldn't be mentioned in the documentation.
2019-07-22 21:11:45 +02:00
Artur Wieczorek
66b798692e Fix deleting "embedded" toolbar from its own event handler
When we create a toolbar from within the event handler of another toolbar several times (so we have a chain of embedded toolbars) and the last toolbar is destroyed, gs_liveToolbar variable is reset in its dtor what prevents from executing the part of code in MSWCommand() for other existing toolbars if they are still in their event handlers too (still executing OnLeftClick() function). This may happen when toolbars are created in the chain of modal dialog boxes.
To prevent this interference between the toolbars from occurring we have to keep track of all of active toolbars in the chain instead of keeping track of only the last one.

Closes #18309.
2019-07-22 18:57:49 +02:00
Vadim Zeitlin
acac868c60 Merge branch 'combo-event'
Fix bug with string field not being set in wxOwnerDrawnComboBox events.

See https://github.com/wxWidgets/wxWidgets/pull/1436
2019-07-22 18:48:20 +02:00
Maarten Bent
37f806f1d6 Release the HDC in wxGetSystemMetrics and wxSystemParametersInfo
Use WindowHDC instead of calling ::GetDC() manually and never calling
::ReleaseDC() on it.

Closes https://github.com/wxWidgets/wxWidgets/pull/1437
2019-07-22 18:47:53 +02:00
Vadim Zeitlin
366233e400 Add a TODO comment for wxVListBox refactoring
Just note that it would be better to avoid duplicating the code already
existing in another place in wxVListBoxComboPopup::SendComboBoxEvent().
2019-07-21 21:38:59 +02:00
Vadim Zeitlin
cd8dade23c Set event string field for wxOwnerDrawnComboBox events
Call wxCommandEvent::SetString() for consistency with the native
wxComboBox.
2019-07-21 21:37:05 +02:00
Vadim Zeitlin
6caba72637 Remove redundant wxCommandEvent::SetEventObject() call
No real changes, just don't call SetEventObject() already called from
InitCommandEventWithItems() (via InitCommandEvent()).
2019-07-21 21:32:16 +02:00
Vadim Zeitlin
e8a7bae0a7 Alternative clang on Windows link fix
Remove WXDLLIMPEXP_BASE from wxObjectEventFunctor declaration: this
class only has inline methods and so doesn't define any functions that
would need to be exported from the DLL.

This reverts commit c0f2f38011.
2019-07-21 21:22:55 +02:00
Maarten Bent
c0f2f38011 Fix linking to wxObjectEventFunctor with Clang on Windows
Linking specific applications (sockets/baseserver, base test) resulted in the
following error: undefined reference to `__imp__ZTV20wxObjectEventFunctor'
Fix this by implementing the destructor inside the base library.
2019-07-21 18:00:42 +02:00
Maarten Bent
2815870507 Resolve some extra semicolon warnings 2019-07-21 17:15:02 +02:00
Paul Cornett
211a42ef12 Fix NULL pointer dereference in wxTextCtrl::GetStyle() with GTK3
Pointers in rgba array can be NULL.
2019-07-20 22:16:17 -07:00
Vadim Zeitlin
e2332f2703 Add semi-private wxHtmlCell::Dump()
This is useful to see the results of wxHTML layout algorithm.

Closes https://github.com/wxWidgets/wxWidgets/pull/1429
2019-07-20 17:01:30 +02:00
PeterO
8f386265dc Use correct expander size in wxDataViewCtrl under MSW
Add wxRendererNative::GetExpanderSize(), implement it using the
appropriate theme element and use it instead of hardcoding the expander
size to 3 character widths.

Closes https://github.com/wxWidgets/wxWidgets/pull/1431

Closes #18449.
2019-07-20 17:00:32 +02:00
Vadim Zeitlin
3d970a9c08 Merge branch 'underline-improvements' of https://github.com/MaartenBent/wxWidgets
Add support for different underline types and colour to wxTextCtrl.

See https://github.com/wxWidgets/wxWidgets/pull/1406

Closes #17124.
2019-07-19 23:45:38 +02:00
Vadim Zeitlin
9be6a3ddea Merge branch 'cmake-fixes' of https://github.com/MaartenBent/wxWidgets
Miscellaneous fixes to CMake build system: fix some warnings, make it
more consistent with configure and more.

See https://github.com/wxWidgets/wxWidgets/pull/1430

See #18438.
2019-07-19 23:43:23 +02:00
Vadim Zeitlin
81db73cf9c Merge branch 'travis-gui-tests'
Enable running GUI tests for wxGTK under Travis CI.

See https://github.com/wxWidgets/wxWidgets/pull/1426
2019-07-19 23:42:04 +02:00
Maarten Bent
7f5ca2a4cb CMake: Fix detecting AppleClang
Policies are now correctly initialized (before creating the project).
Policy CMP0025 changes the compilerID of Clang on Apple, handle this correctly.
2019-07-19 21:13:04 +02:00
Maarten Bent
cd7e21ad2b Apply wxTextCtrl underline review suggestions 2019-07-19 21:06:10 +02:00
Maarten Bent
d2d11dc205 Use array to look-up wxMSW underline colours
Remove previously added colours from wxColourDatabase.
2019-07-19 21:06:07 +02:00