Commit Graph

62953 Commits

Author SHA1 Message Date
Adrien Tétar
2305604565 Introduce wxGraphicsPenInfo class 2017-09-10 01:02:20 +02:00
Adrien Tétar
bc562289c6 Introduce wxPenInfo class 2017-09-10 01:02:06 +02:00
Stefan Csomor
f045323934 Adding native macos Cocoa implementation for overlays into build files 2017-09-09 23:34:50 +02:00
Stefan Csomor
a0f924191e Fixing vertical mirrored drawing for overlay on macos 2017-09-09 19:32:18 +02:00
Artur Wieczorek
abfd27db91 Fix PCH-less build
Add missing includes for compiling without WX_PRECOMP after 4d8c1fc890.
2017-09-09 16:29:42 +02:00
Stefan Csomor
8ad0039b71 Further implementation of native overlay on Cocoa
Should work for Caret,  still has a problem with the transformation matrix otherwise, too many things have changed there for me to find a quick solutions.
2017-09-09 11:44:43 +02:00
Stefan Csomor
4d8c1fc890 Using another API for popup menus on modal dialogs
Using popupMenuPositioningItem leads to several problems on modal dialogs - the validation and action callbacks are not used, thefore we revert in this situation to using the older API, see #549 and https://trac.wxwidgets.org/ticket/17459
2017-09-08 14:35:49 +02:00
Stefan Csomor
102edb544d Fixing Popup Menu with Submenus
Submenus have to turn off autoenablind as well, see #549 and https://trac.wxwidgets.org/ticket/17459
2017-09-07 20:27:49 +02:00
Stefan Csomor
37191f6f16 Only set font color if explicitly set
Otherwise eg the default button doesn't get its white font color.
2017-09-07 19:00:43 +02:00
Stefan Csomor
41d042516d Exposing Colour Flags, adding Synonym UseBackgroundColour for UseBgCol
No abbreviations in method name, include new methods in docs
2017-09-07 11:30:10 +02:00
Artur Wieczorek
627870be90 Restore wxButton's feature to use focus bitmap for hover state (wxMSW)
Prior to 2.9.2, if the focus bitmap was specified but current one wasn't, the focus bitmap was used for hovering as well.
This feature was entirely discarded in b4354db179 (see wxBitmapButton::DoSetBitmap) but it is still described in the documentation of wxButton's states and images. It seems it was removed unintentionally, so let's restore it.
2017-09-06 14:10:46 +02:00
Artur Wieczorek
52d6b0ae85 Don't discard all current input processing flags in response to WM_GETDLGCODE
Some current input processing flags, like DLGC_HASSETSEL, should be retained because they are in use (in wxWindowMSW::SetFocusFromKbd() for instance).

Closes #17945.
2017-09-06 12:34:20 +02:00
Stefan Csomor
51e7994cff Adding Borders and Multi-Line calculations also when native best size is available
Otherwise wxTE_MULTILINE are getting a tiny one-line minimal size, and the border as to be added as well.
2017-09-06 09:54:35 +02:00
Gavin Kinsey
d24ffcf749 Fix wxHTML parse bug in non-unicode, ? characters are not displayed.
GetEntitiesParser()->GetCharForCode(NBSP_UNICODE_VALUE) in the non-unicode
build returns the value '?' as it doesn't find a match for that value.  The
parser then proceeds to replace all '?' characters in the HTML document with
NBSP.

Change the type of the #define to be unsigned int rather than wxChar for
non-unicode to fix this.

Closes #17692.
2017-09-05 21:57:52 +02:00
Roberto Perpuly
361d7b4938 Fix popup menu items being always disabled in Mac OS X (#549)
Menus on Mac use automatic menu enabling, meaning that the system will enable
menu items only if the app responds to the menu item action. If I understand
correctly, the responder chain for menus in popup dialogs stop at the dialog
window, so the system thinks that the app does not handle the menu items.

This fix should not affect existing code since the wxWidgets user-facing API
dictates that apps specifically disable menu items.

Fix #17459

See Apple docs on automatic menu enabling at

https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/MenuList/Articles/EnablingMenuItems.html#//apple_ref/doc/uid/20000261-BAJBFGED
2017-09-05 20:28:45 +02:00
Vadim Zeitlin
406608b31c Remove obsolete wxCHECK_W32API_VERSION() checks
The latest of those checks tested for w32 API 3.3, which is older than
MinGW 3.4 released which is more than 13 years old, so we can safely
drop them (let alone checks for prehistoric 0.5 w32 API).

This incidentally fixes compilation errors due to the use of
wxCHECK_W32API_VERSION() in wx/msw/winundef.h which was now (since
the changes of 8c572c0a77) included before
this macro was defined.
2017-09-04 22:38:23 +02:00
Tim Kosse
808c842edd Unbind events when destroying wxTextEntryHintData
Leaving these event handlers bound resulted in crashes due to
dereferencing the already destroyed wxTextEntryHintData object.

Closes #17944.
2017-09-04 22:28:32 +02:00
Robin Dunn
6527607af7 Merge pull request #548 from RobinD42/doc-updates
Doc updates
2017-09-01 12:10:31 -05:00
Artur Wieczorek
c51dd81db6 Optimize wxTextCtrl::GetLastPosition()
It's better to call one API instead of four.
2017-09-01 11:17:50 +02:00
Artur Wieczorek
4fc8753285 Test PositionToXY and XYToPostion also for multiline Rich Edit controls 2017-09-01 11:00:06 +02:00
Artur Wieczorek
691f530359 Swap arguments of CPPUNIT_ASSERT_EQUAL
Expected value should be passed as a first argument to CPPUNIT_ASSERT_EQUAL and actual value as a second one.
2017-09-01 08:26:15 +02:00
Artur Wieczorek
ed638371a7 Fix accounting for the last position in wxTextCtrl (wxOSX)
If the text in the control doesn't end with a new line,
last valid position is just past the last character in the
the last line.
But if it ends with new line, last valid position
is located at the beginning of the next virtual (empty) line.
So, this case has to be also taken into account in determining
whether position is valid or not.
2017-08-31 21:34:17 +02:00
Artur Wieczorek
4308386eff Extend XYToPostion unit test for multiline controls
Extend the ranges of tested X,Y coordinates
to cover also areas beyond the text.
2017-08-31 21:32:01 +02:00
Artur Wieczorek
4503c41bd8 Optimize wxTextCtrl::GetLastPosition() in wxOSX
To get the length of the text in the control there is no need to convert NSString to wxString (what is done now by calling to GetStringValue).
2017-08-31 16:28:42 +02:00
Artur Wieczorek
2d464ca576 Account for the last position in wxTextCtrl (wxOSX)
Take into account that last valid position is after the last character of the text.
This applies also to empty controls for which XYToPosition(0, 0) should return 0.
2017-08-31 16:28:14 +02:00
Andreas Falkenhahn
bcfad5b5d0 Show help even for toolbars which aren't direct wxFrame children
Display "long help" text associated with the toolbar items in the status
bar of the parent frame even if the toolbar is not a direct child of the
frame.

Closes #17897.
2017-08-31 00:26:57 +02:00
Robin Dunn
ce8d795013 Add missing DeleteAllColumns 2017-08-29 18:15:17 -07:00
Robin Dunn
85ed13be75 Add missing FindCellByPos 2017-08-29 18:11:56 -07:00
Robin Dunn
5df63f100c Add missing event type constants for propgrid 2017-08-29 18:09:41 -07:00
Robin Dunn
eeac334e11 Add propgriddefs.h to the interface, containing macros, enums and such referenced elsewhere in the API. 2017-08-29 18:06:13 -07:00
Paul Cornett
4a71ba820f Avoid delayed destruction if TLW was never created. See #17942 2017-08-28 20:31:47 -07:00
Vadim Zeitlin
2a06ef9bf3 Merge branch 'textctrl-fixes'
Closes https://github.com/wxWidgets/wxWidgets/pull/546
2017-08-28 21:50:35 +02:00
VZ
4cf4e48cd5 Merge pull request #544 from pbfordev/sizer-overview
Update Sizers Overview in the manual.
2017-08-28 19:49:37 +02:00
VZ
a582d6162d Merge pull request #542 from vadz/unhandled-except
Improve user-visible message about unhandled exception.
2017-08-28 19:48:02 +02:00
VZ
c4260d7098 Merge pull request #543 from pbfordev/AutomationObject-docs
Improve wxAutomationObject-related documentation
2017-08-28 19:46:29 +02:00
Vadim Zeitlin
9d02d6af2a Merge branch 'gtk-text-simplify'
Closes https://github.com/wxWidgets/wxWidgets/pull/545
2017-08-28 19:44:05 +02:00
Artur Wieczorek
70fe9f3291 Remove inappropriate assertion
New line is not always marked by 2-character (\r\n) sequence. It can be
also 1-character (\r) for RichText controls or even no mark at all (for
wrapped line).
2017-08-28 18:49:50 +02:00
Vadim Zeitlin
5d79ab82ce Split building and running tests in 2 steps on Travis CI
This might prevent us from running into Travis timeouts in OS X builds
so often.
2017-08-25 14:22:43 +02:00
Vadim Zeitlin
4ddc7a7f4a Fix wxIMPLEMENT_CLASS documentation
It is a synonym for wxIMPLEMENT_ABSTRACT_CLASS and not
wxIMPLEMENT_DYNAMIC_CLASS as it was wrongly stated.

Also avoid duplicating the documentation of the other macro and just
refer to it instead.
2017-08-25 13:17:12 +02:00
Vadim Zeitlin
af0a938a65 Enable InsertionPoint unit test for multiline text controls too
There doesn't seem to be any reason to not run it.
2017-08-25 01:45:41 +02:00
Vadim Zeitlin
49ebac7102 Revert "Simplify wxTextCtrl::GetLastPosition"
This reverts commit c4e1fb4ef9.

Last position is not necessarily the number of characters in the buffer,
rich edit controls still store the text using CR LF between lines, but
GetLastPosition() should return the position as if they used only LF to
be consistent with all the other positions in these controls and
changing this broke existing code passing GetLastPosition() to other
functions taking position.
2017-08-25 01:45:39 +02:00
Vadim Zeitlin
e74fb5effe Account for the last position in wxMSW wxTextCtrl
There is a valid position after the last character of the text in
wxTextCtrl, e.g. position 0 in the empty control, so account for it and,
notably, don't return -1 from XYToPosition(0, 0) when the control is
empty.

This fixes a regression in a69ab2907c.
2017-08-25 01:45:37 +02:00
Vadim Zeitlin
de9b6fdc9e Show the exact wxTextCtrlHitTestResult in the text sample too
In addition to showing the position returned by HitTest(), also show its
return value which is not necessarily wxTE_HT_ON_TEXT if it is not
wxTE_HT_UNKNOWN under MSW.
2017-08-25 01:03:36 +02:00
Vadim Zeitlin
dd63efe986 Fix wxTextCtrl::HitTest() overload returning position docs
Don't mention row/column in this overload documentation.
2017-08-25 01:01:24 +02:00
Vadim Zeitlin
42e9f0cf58 Make wxGTK wxTextCtrl::WriteText() less inefficient
Use wxScopedCharBuffer as we only need the buffer in the current scope.
This avoids a buffer copy done by wxCharBuffer which could be a
significant pessimization for large buffers.

Also don't call strlen() unnecessarily, we already know the buffer
length, so just use it.
2017-08-24 22:31:16 +02:00
Vadim Zeitlin
1c946a469a Get rid of overridden wxTextCtrl::DoSetValue() in wxGTK
This method seems completely unnecessary, the base
wxTextEntry::DoSetValue(), which delegates to Remove() and WriteText(),
seems to work just as well and avoids code duplication between this
method and wxTextCtrl::WriteText().

Notice that gtk_text_buffer_set_text() is just a trivial wrapper around
gtk_text_buffer_delete() and gtk_text_buffer_insert() anyhow, so there
is no efficiency loss in not using it neither.
2017-08-24 22:30:33 +02:00
Vadim Zeitlin
0873abb836 Replace wxEVT_SIZE handler with sizers in the listctrl sample
Just simplify the code, no real changes.
2017-08-24 22:11:53 +02:00
Vadim Zeitlin
1a55f4cfa2 Don't send wxEVT_CHAR events from wxTextCtrl::SetValue() in wxGTK
This could happen if the code calling SetValue() was in a handler
invoked in response to a keyboard action as our insert-text signal
handler believed that it was called in response to this key in this
case, even when it wasn't the case.

This extends the changes of def8247c61
to WriteText() to DoSetValue(), thus fixing the same problem in
SetValue() and ChangeValue() too.

But the question of why do we have two so similar, yet different,
functions, resulting in having to fix the same bugs twice still remains
unanswered...
2017-08-24 17:04:04 +02:00
PB
32cde66d9c Replace invalid character in Sizers Overview 2017-08-24 16:49:55 +02:00
PB
134279e8a8 Remove duplicity in Sizer Overview
Remove the already described sizers from section Other Types of Sizers. Remove "See ..." sentences which are unnecessary when the class documentation is already linked right above. Also fix a typo in a sizer name that prevented doxygen linking to the class.
2017-08-24 16:33:01 +02:00