Commit Graph

62967 Commits

Author SHA1 Message Date
Vadim Zeitlin
40f8403f5d Merge branch 'peninfo'
Add wxPenInfo and wxGraphicsPenInfo which allows to specify fractional
pen widths when using wxGraphicsContext.

Closes #17087.

Closes https://github.com/wxWidgets/wxWidgets/pull/472
2017-09-10 21:45:47 +02:00
Vadim Zeitlin
f19012c62c Merge branch 'firstweekday' of https://github.com/lanurmi/wxWidgets
Add API for determining the first day of the week and use it in
wxCalendarCtrl.

Closes https://github.com/wxWidgets/wxWidgets/pull/522
2017-09-10 21:41:36 +02:00
Vadim Zeitlin
2bb6ac7051 Refactor all wxPen ctors to use wxPenRefData(wxPenInfo) ctor
Centralize all pen creation logic in a single place (in each port) in
the new wxPenRefData ctor taking wxPenInfo.
2017-09-10 15:48:31 +02:00
Vadim Zeitlin
8bad0e494f Get rid of wxGraphicsPenInfo::CreateFromPen()
This is a helper method used only in wxWidgets itself and only once, so
just inline it at the point of use to avoid exporting an unnecessary
function in the public API.
2017-09-10 01:53:02 +02:00
Vadim Zeitlin
76fd05b147 Leave only wxGraphicsRenderer::CreatePen(wxGraphicsPenInfo) overload
It doesn't make much sense to require all the graphics backends to
create wxGraphicsPen from either wxPen or wxGraphicsPenInfo when the
former can be handled just once in the common code.

So do just this, leaving CreatePen() overload taking wxGraphicsPenInfo
where the real pen construction takes place and implementing
wxGraphicsPen creation from wxPen in the common wxGraphicsContext code.

This is not 100% backwards-compatible as any code inheriting from
wxGraphicsRenderer and overriding its CreatePen() will now be broken,
however this should be extremely rare (there is no good reason to
inherit from this class in the user code) and result in compile errors
if it does happen.
2017-09-10 01:48:30 +02:00
Vadim Zeitlin
af3581758b Don't mention wxPenInfoBase in the documentation
This is an implementation detail, don't confuse the user with this
template class which isn't supposed to be used in the user code.

Also improve the example in the documentation, the old one (using pen of
width 0 but with a colour) didn't make much sense.
2017-09-10 01:29:39 +02:00
Vadim Zeitlin
a156d5fa40 Extract wxPenInfoBase in a separate header
This allows to avoid dependency of wx/graphics.h on wx/pen.h.
2017-09-10 01:24:16 +02:00
Vadim Zeitlin
cc14a80501 Make wxPenInfoBase constructor protected
This class is never supposed to be created directly.
2017-09-10 01:11:25 +02:00
Vadim Zeitlin
cc91a7d6d4 Minor formatting and style changes in wxPenInfo code
Use more standard formatting, wrap some overlong lines.
2017-09-10 01:11:06 +02:00
Adrien Tétar
999c750ca7 Review feedback 2017-09-10 01:02:21 +02:00
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
Lauri Nurmi
e6a7a09d9d Use automatically selected first weekday by default in calendar sample
Also create a wxLocale object with wxLANGUAGE_DEFAULT so that automatic
selection has a better chance of doing the right thing across different
platforms.
2017-09-02 17:24:10 +03:00
Lauri Nurmi
2f2700b2dd Automatically determine the first weekday for a calendar control
If neither wxCAL_SUNDAY_FIRST or wxCAL_MONDAY_FIRST was given, use
wxDateTime::GetFirstWeekDay() to automatically determine the preferred
day.

This changes the earlier default behaviour, which was to use Sunday
if not otherwise specified. However, the wxGTK native calendar control
ignored this behaviour anyway.
2017-09-02 17:02:35 +03:00
Lauri Nurmi
378851a283 Refactor WeekFlags processing into UseEffectiveWeekDayFlags()
Use the new GetFirstWeekDay() function rather than GetCountry() == USA
to determine the first weekday.
2017-09-02 17:02:35 +03:00
Lauri Nurmi
94c35b2cdd Implement new static function wxDateTime::GetFirstWeekDay()
This function tries to determine the preferred first day of week to use in
calendars. The procedure for obtaining this information is highly
platform-dependent, and is not possible on all platforms; in that case
Sunday is used as the fallback value.

Implementations are included for MSW, OSX, and Linux.
2017-09-02 17:02:35 +03: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