Commit Graph

62858 Commits

Author SHA1 Message Date
Artur Wieczorek
ec55f11ff7 Add support for wxTE_CHARWRAP to wxTextCtrl
Apparently various text wrapping modes are not supported natively by
NSTextView (apart from word wrapping which is used by default) and
non-default wrapping has to be implemented in the custom code.
To wrap lines at any character, NSLineBreakByCharWrapping style should be
applied at any text change to the entire text stored in NSTextStorage
associated with NSTextView. This is done in DoUpdateTextStyle() method
which is called from controlTextDidChange() when text is modified by
the user, or SetStringValue() and WriteText() when text is set
programmatically.
2017-08-05 21:57:01 +02:00
Paul Cornett
7626292fa4 Don't reset scroll position to zero when window size changes
Aside from just being the proper thing to do, this fixes scrolling with
GTK3 when not using overlay scrollbars, where size events are somehow being
generated during scrolling.
See #17915
2017-08-04 07:56:23 -07:00
Artur Wieczorek
20b53502d9 Update documentation regarding styles of wxTextCtrl
Add notes that some styles are available also on wxOSX. Mention that
wrapping is available only for multi-line controls.
2017-08-03 21:30:40 +02:00
Artur Wieczorek
111ff4e618 Add presentation of text alignment in wxTextCtrl to widgets sample
Added an option to choose text alignment styles for wxTextCtrl presented
in the sample.
2017-08-03 21:09:40 +02:00
ROBERTO
9229777535 Update Italian translation
Update Italian translation (add new strings/revised previous strings)

Closes https://github.com/wxWidgets/wxWidgets/pull/531
2017-08-03 18:17:00 +02:00
Artur Wieczorek
723650d51d Honour text alignment while formatting window label
Take into account text alignment while formatting NSAttributedString containing the text of the label.

Closes #17933.
2017-08-03 11:57:47 +02:00
Artur Wieczorek
5aa66ffd93 Fix text alignment in wxRadioButton
Label should be always left-aligned to be positioned just next to the button image.

See #17933.
2017-08-03 11:56:30 +02:00
Artur Wieczorek
da0299f30e Fix text alignment in wxCheckBox
Align the text according to the style.

See #17933.
2017-08-03 11:55:36 +02:00
Artur Wieczorek
7c0d4f211d Make wxTextCtrl with no wxTE_MULTILINE style really single-line (wxOSX)
Under wxGTK wrapping for single-line controls is explictly disabled (see
wxTextCtrl::GTKSetWrapMode), under wxMSW wrapping is not supported, so for
the sake of consistency also under wxOSX single-line control shouldn't
support wrapping and vertical scrolling.

Closes #12693.
2017-08-03 00:11:26 +02:00
Artur Wieczorek
e426411e34 Allow setting wrap styles only for multi-line wxTextCtrl (widgets sample)
Wrap styles are not applicable to the single-line control and radio box
to select these styles should be disabled when single-line control is
active.
It looks that it was intended to implement this feature with
TextPage_WrapLines constant and OnUpdateUIWrapLinesCheckbox handler so we
can reuse these elements.
2017-08-02 23:41:40 +02:00
Artur Wieczorek
1731ad5e31 Add support for wxTE_NO_VSCROLL style to wxTextCtrl (wxOSX) 2017-08-02 23:24:02 +02:00
Artur Wieczorek
794e1b275b Add presentation of wxTextCtrl's wxTE_NO_VSCROLL style in widgets sample
Added an option to set/unset wxTE_NO_VSCROLL style for wxTextCtrl presented
in the sample.
2017-08-02 23:06:25 +02:00
Nusi
962327dec0 Fix checking key categories in wxKeyEvent::IsKeyInCategory()
WXK_END key belongs to WXK_CATEGORY_JUMP (not WXK_CATEGORY_PAGING)
and WXK_PAGEUP belongs to WXK_CATEGORY_PAGING (not WXK_CATEGORY_JUMP).
2017-08-02 23:05:24 +02:00
Artur Wieczorek
d3adf5e464 Don't do the run-time check for GTK+ 2 under GTK+ 3
...because it fails.
2017-08-01 22:36:33 +02:00
Nusi
446d707064 Get access to DrawThemeBackgroundEx API from wxUxThemeEngine (wxMSW) 2017-08-01 21:37:19 +02:00
Nusi
d1ea25be06 Fix signature of DrawThemeParentBackground API in wxUxThemeEngine (wxMSW)
According to the documentation, 3-rd parameter is a pointer
to the constant RECT structure.
2017-08-01 21:36:58 +02:00
Artur Wieczorek
8dd2ac3016 Implement DragAcceptFiles() only when wxUSE_DRAG_AND_DROP==1
This virtual method is implemented in wxWindowBase class only when
wxUSE_DRAG_AND_DROP==1, so it should be re-implemented in the derived class
wxWindowMac also only when wxUSE_DRAG_AND_DROP==1.
2017-08-01 21:36:26 +02:00
Artur Wieczorek
f81cc8e61e Fix compilation when wxUSE_SPINCTRL==0
In wxWindowMac code there is a reference to wxSpinButton (not wxSpinCtrl),
so we need to include wxSpinButton's header file.
2017-08-01 21:35:38 +02:00
Artur Wieczorek
729c3ec77b Fix compilation when wxUSE_DIRDLG==0
wxGenericDirCtrl has to be declared when wxUSE_DIRDLG==1
or wxUSE_FILEDLG==1 (see src/common/dirctrlcmn.cpp).
2017-08-01 21:35:06 +02:00
Paul Cornett
49605bc5a7 Use forward-declaration macro to avoid compiler warnings 2017-08-01 08:37:15 -07:00
Paul Cornett
3a9fc640e4 Don't crash on trailing '%' in wxDateTime::Format(). See #17931 2017-08-01 08:35:58 -07:00
Artur Wieczorek
1eef3fc5fc Add header file with missing wxScopedPtr declaration
wxScopedPtr is referred in wxSVGFileDCImpl declaration, but corresponding
header file is not explicitly included. This can break the compilation if
wxScopedPtr declaration is not included by chance by another module (e.g.
is taken from translation.h but it is not effective when wxUSE_INTL==0).
2017-07-31 23:50:06 +02:00
Artur Wieczorek
b12e6279d2 Implement missing virtual function in generic wxStandardPaths
MakeConfigFileName() is declared as a pure virtual function in the base
class wxStandardPathsBase and has to be implemented in the derived class
wxStandardPaths.
This fixes compilation when wxUSE_STDPATHS==0.
2017-07-31 23:24:17 +02:00
Artur Wieczorek
e2b937270a Check for wxUSE_DC_TRANSFORM_MATRIX dependency on wxUSE_GEOMETRY
Transform matrix functions depend on wxAffineMatrix2D which is implemented
if wxUSE_GEOMETRY==1.
2017-07-31 23:21:15 +02:00
Artur Wieczorek
8317bc2844 Fix determining the length of the text in wxTextEntry/wxTextCtrl (wxGTK)
Several functions of wxTextEntry and wxTextCtrl call to
gtk_entry_get_text_length() API to determine the length of the text in
GTKEntry. This API is available since GTK+ 2.14 so we have to implement
a fallback method for older GTK+ versions.
Dedicated function GTKGetEntryTextLength() is implemented in wxTextEntry
and exposed through its interface because it is also used in wxTextCtrl.
2017-07-31 21:39:48 +02:00
Paul Cornett
5b679bfbec Get rid of wxGTKDash, it's the same as wxDash 2017-07-31 10:19:44 -07:00
Paul Cornett
41311298eb Fix SetPen() with a re-used user dash array
wxPen::SetDashes() is poorly designed, making it possible for different
wxPenRefData objects to point to the same dash array. This allows two wxPen
objects to appear to be equal after modifying the array and setting it on
the second pen (the drawing sample does this). So testing for equality is
not enough to determine that SetPen() can return early.
2017-07-31 10:14:26 -07:00
Artur Wieczorek
d57672ee42 Fix compilation with wxUSE_ACCEL==0 2017-07-30 10:38:06 +02:00
Artur Wieczorek
2c2e0aaa01 Implement ShowPosition() for single-line wxTextCtrl (wxGTK) 2017-07-30 09:59:27 +02:00
Artur Wieczorek
f208cfc886 Implement XYToPosition() for single-line wxTextCtrl (wxGTK) 2017-07-30 09:58:53 +02:00
Artur Wieczorek
bb9c7680ab Fix wxTextCtrl::PositionToXY (wxMSW)
Check if character position is not past the line.
When calculating (x,y) for given character position there is necessary
to take into account that for multi-line control each line (but last one)
is ended by 2-character end of line mark. Each character of this
2-character mark has a different position in the text buffer but is mapped
to the same (x,y) coordinates.
2017-07-30 09:58:28 +02:00
Artur Wieczorek
a69ab2907c Fix wxTextCtrl::XYToPosition (wxMSW)
When calculating character position for given (x,y) there is necessary
to verify if passed coordinates are sane and return error status (-1) if
not. y-coordinate has to be in the range [0..numLines-1] and x-coordinate
cannot exceed the length of the text in the given line.
2017-07-30 09:57:54 +02:00
Artur Wieczorek
c4e1fb4ef9 Simplify wxTextCtrl::GetLastPosition
Last position is just the number of characters in the buffer.
2017-07-30 09:57:17 +02:00
Artur Wieczorek
8d94d4d9d3 Pass arguments of the same type to CPPUNIT_ASSERT_EQUAL
This is to avoid potential implicit conversions.
2017-07-30 09:56:43 +02:00
Artur Wieczorek
497f275e1b Add PositionToXY() and XYToPosition() to wxTextCtrl unit test
Added tests of PositionToXY() and XYToPosition() for multi- and single-line wxTextCtrl.
2017-07-30 09:56:27 +02:00
Vadim Zeitlin
24623c4c85 Correct wxDateTime::GetTicks() documentation
Assert only happens if the object is not initialized, not if contains a
moment outside of the standard time_t range.

Closes #17927.
2017-07-29 20:43:11 +02:00
Vadim Zeitlin
7df843f396 Don't document wxDataViewModel notification methods as virtual
This is just wrong, they're virtual in wxDataViewModelNotifier, but not
in wxDataViewModel itself.

Closes #17928.
2017-07-29 20:39:26 +02:00
scootergrisen
132ad714c5 Complee Danish translation 2017-07-27 13:39:03 +02:00
Troels Knakkergaard
d255dc6706 Do not set wxUnknownControlContainer background to a fixed color
Don't explicitly set the background colour if it's not specified.

Closes #17675.
2017-07-27 13:26:00 +02:00
Vadim Zeitlin
9592823cde Add missing wxOVERRIDE to wxNSText{Field,View}Control in wxOSX
No real changes, just avoid (tons of) -Winconsistent-missing-override
warnings when building wxOSX.
2017-07-25 16:23:02 +02:00
Vadim Zeitlin
df37c4f9e9 Add missing file required by Expat 2.2.2
Expat configure fails without this file.

See https://github.com/wxWidgets/wxWidgets/pull/524
2017-07-25 16:03:22 +02:00
Paul Cornett
a533fb141d Fix unresponsive frame after using wxHtmlHelpFrame from a dialog. See #17837 2017-07-24 08:56:59 -07:00
Artur Wieczorek
572ec50827 Implement wxTextCtrl::ShowPosition() (wxOSX)
Closes #17811.
2017-07-22 22:23:34 +02:00
Artur Wieczorek
d233b8939b Implement wxTextCtrl::PositionToXY() and XYToPosition() (wxOSX)
Apparently there is no native API to retrieve such information in a simple
way so all calculations have to be done with raw text stored in
the corresponding control(s).

Closes #4146.
See #17811.
2017-07-22 22:23:34 +02:00
Paul Cornett
c4acd5f9dd Fix drawing miniframe resize grip with GTK3, see #17918 2017-07-22 12:04:56 -07:00
Stefan Csomor
537cf17ca9 Supporting updated expat for Xcode builds 2017-07-21 16:52:39 +02:00
Paul Cornett
0c06fc6358 Avoid unused parameter warnings 2017-07-20 08:51:36 -07:00
Paul Cornett
f23d3e45b0 Use correct signature for C callbacks 2017-07-20 08:34:05 -07:00
Paul Cornett
ccb8da2054 Fix build error after dfd03f5 2017-07-20 08:10:33 -07:00
Cătălin Răceanu
305ff51314 Add check for wxUSE_EXTENDED_RTTI to the xti sample header
The sample requires wxUSE_EXTENDED_RTTI to be enabled, and that is correctly signalled
in the source files. Just avoid the header flooding the output with errors.

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

* Removed BOM.
2017-07-20 00:20:25 +02:00