Mehmet Soyturk
3e6ae97e89
Optimize wrapping long lines in wxRichTextCtrl
...
When one inserts one big line to a wxRichTextCtrl that is too long (say 300k words of average size 9), then wxRichTextCtrl could freeze for a few seconds. It could also freeze again when the control is resized (such that word wrapping is triggered again).
Problem: `wxRichTextParagraph::AllocateLine(int pos)` can be called many times. Each call triggers `m_cachedLines.Item(pos)`, which traverses the linked list. As a result we get quadratic time complexity.
In this commit, we improve the function by also caching the lines in a vector, which supports random access in O(1) time.
2021-09-17 09:19:48 +03:00
Vadim Zeitlin
3d278ee75f
Avoid warnings about operations on different enums in C++20 mode
...
Arithmetic operations on the elements of different enums are deprecated
in C++20 and the latest compiler versions warn about them.
While individual warnings could be fixed in wxWidgets itself (although
it would be quite an effort to do it for all ~500 of them), it wouldn't
help with the same warnings in the applications using wx, so prefer to
do it by explicitly defining the operations on the enums that can be
combined with each other by using wxALLOW_COMBINING_ENUMS() macro,
except for a single warning in wxTar code where it's easier to just not
use an anum at all.
2021-04-25 18:59:20 +02:00
Teodor Petrov
c924ecb10a
Suppress -Wsuggest-override warnings in user code for gcc too
...
This was already done for clang -Winconsistent-missing-override, but
gcc has a similar warning since 5.1 and, moreover, latest versions of
clang support this gcc warning as well, so add a special macro which
handles both compilers and use it in all wx macros defining virtual
functions instead of just disabling one of the clang warnings.
Closes https://github.com/wxWidgets/wxWidgets/pull/2000
2020-08-14 19:15:03 +02:00
Arrigo Marchiori
c86bcf962d
Use wxASCII_STR() on string literals
...
Fix the build with wxNO_IMPLICIT_WXSTRING_ENCODING.
2020-07-17 17:52:16 +02:00
Paul Cornett
c5faf9cfac
Avoid passing float argument for "%f" printf specifier
...
"%f" takes a double. Eliminates some -Wdouble-promotion warnings.
2020-04-21 11:59:36 -07:00
Paul Cornett
a3598ba33f
Remove unnecessary copy ctors/copy assignment operators
...
C++11 deprecates having one without the other.
Eliminates many, many GCC -Wdeprecated-copy warnings.
2019-10-14 09:07:21 -07:00
Vadim Zeitlin
e081d2210f
Make wx/richtext/richtextstyledlg.h self-sufficient
...
Don't require including wx/dialog.h before including this one.
Closes #18420 .
2019-06-20 16:06:36 +02:00
Paul Cornett
365759753a
Pass parameters by const reference rather than by value
2019-04-05 09:18:07 -07:00
Vadim Zeitlin
8fbca5cb70
Remove all trailing spaces
...
No real changes, just clean up sources by removing trailing spaces from
all the non-generated files.
This should hopefully avoid future commits mixing significant changes
with insignificant whitespace ones.
2019-01-30 17:35:54 +01:00
Blake-Eryx
49e20a961d
Fix misspellings in comments and documentation
...
No real changes.
Closes https://github.com/wxWidgets/wxWidgets/pull/870
2018-07-31 13:20:17 +02:00
Maarten
977a826639
use more wxOVERRIDE ( #329 )
2016-09-25 13:21:28 -07:00
JulianSmart
a797c9d956
Make wxBitmap ctors consistent wrt passing scale for conversion from wxImage; HiDPI adaptation for propgrid buffer and wxRTC images
2015-11-15 12:49:25 +00:00
JulianSmart
1675e641e6
Implement freeze/thaw in Do/Undo to considerably speed up commands with a large number of actions
2015-11-14 18:44:45 +00:00
JulianSmart
f48374a949
Added line height to wxRTC to allow faster scrolling if needed
2015-11-14 18:31:39 +00:00
ARATA Mizuki
d399d544f1
Suppress clang warning [-Winconsistent-missing-override] in DECLARE_HELP_PROVISION().
2015-11-06 16:33:36 +09:00
Paul Cornett
27a8d28029
more use of wxOVERRIDE
2015-09-06 17:20:42 -07:00
JulianSmart
84b3644680
Corrected wxRTC font dialog spin button behaviour
2015-08-18 16:36:16 +01:00
Dimitri Schoolwerth
8f8d58d193
Use wx-prefixed macros throughout the repository.
...
Change {DECLARE,IMPLEMENT}_*CLASS and {DECLARE,BEGIN,END}_EVENT_TABLE
occurrences to use the wx-prefixed version of the macros.
2015-04-23 22:00:35 +04:00
Lauri Nurmi
8a2ccd9cf7
Fix spelling of occur* in random files.
2015-02-21 20:01:23 +02:00
Julian Smart
0df45db7f6
Now uses the correct font and text effect when drawing bullet text.
...
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78522 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-02-18 17:37:12 +00:00
Julian Smart
8cf3e90650
Now allows space for a bullet even if no left subindent was specified; added a MeasureBullet function to support this.
...
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78518 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2015-02-18 12:18:27 +00:00
Julian Smart
08f8f5311f
Added shadows to box attributes, and relevant controls in the Background page.
...
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78280 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-12-17 16:04:03 +00:00
Julian Smart
f65b2f589f
The wxRTC formatting dialog now retains custom colours set within the colour dialog, and they can be accessed by the application.
...
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77488 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-08-28 08:28:08 +00:00
Julian Smart
40c84134ae
Fix deletion of cells in defragment
...
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77066 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-08-12 08:52:41 +00:00
Julian Smart
5b8e5e81b6
Implemented keyboard selection and better cell navigation for tables
...
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76440 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-03 13:07:16 +00:00
Julian Smart
90143c254c
Added wxRichTextCtrl::DoLayoutBuffer so an application can perform custom tasks before or after layout.
...
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76390 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-04-22 16:27:29 +00:00
Paul Cornett
8b3e3e594b
avoid double-to-float conversion warnings in headers
...
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76288 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-04-05 17:13:46 +00:00
Julian Smart
9b09ca16a6
Allow derivation from wxRichTextBufferDataObject
...
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76204 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-27 12:46:37 +00:00
Julian Smart
cd3fc53163
Added on-demand image loading option to wxRTC.
...
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76110 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-10 11:08:42 +00:00
Julian Smart
9adba53251
Paragraph and image layout fixes
...
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76025 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-27 15:15:18 +00:00
Vadim Zeitlin
9d2b9feeb1
Add "const" to the recently added wxRTC XPM.
...
This fixes half a page of warnings about converting string constants to
non-const char* from g++.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75910 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-17 23:53:43 +00:00
Julian Smart
ba7e065a34
Removed rounding that didn't work for negative numbers; added ability to hide "move object" controls
...
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75893 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-16 20:05:19 +00:00
Julian Smart
2124c5688b
Optimized wxRTC insertion and deletion when floating objects are present.
...
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75884 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-15 16:19:43 +00:00
Julian Smart
f95ee1bade
Added ability to disable images in wxRTC for performance or image corruption reasons
...
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75881 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-13 12:32:46 +00:00
Julian Smart
179d117a35
Added the ability to restore the last selected page in a wxRTC formatting dialog.
...
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75791 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-04 18:57:20 +00:00
Vadim Zeitlin
d2f125aa35
Pass non-primitive types by const reference instead of value.
...
No real changes, just avoid the unnecessary copying and also make the
signatures more consistent by adding the apparently forgotten "&" in a couple
of places.
See #15893 .
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75657 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-01-20 14:45:08 +00:00
Julian Smart
87ba46f05e
Added scrollbar hysteresis detection to stop infinite looping when vertical scrollbar presence or absence affects the content height.
...
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75373 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-12-10 15:24:35 +00:00
Julian Smart
c6de30bf70
Removed GetId/GetId and changed span storage to be compatible with 3.0. Fixed border control style.
...
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75223 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-11-17 12:43:58 +00:00
Julian Smart
afff80287b
Corrected and tidied XML import/export of standard data members
...
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75161 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-11-10 15:56:37 +00:00
Julian Smart
22412b5e8f
Allow the style name to be edited in the style definition editor
...
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75133 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-11-06 15:08:37 +00:00
Julian Smart
254eb6841a
Made column and row spans members so they don't interfere with app-defined properties.
...
Added identifier to wxRichTextObject so objects can be addressed by name.
Generalised wxRICHTEXT_CHANGE_OBJECT command so it can now apply to a paragraph as well as an object within a paragraph.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75124 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-11-04 15:13:41 +00:00
Julian Smart
3ee8ea054e
Fixed some wxRTC dialog layout issues, and added a couple of extra text effects flags.
...
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75123 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-11-03 22:28:37 +00:00
Julian Smart
632b034940
Added corner radius to box attributes, and a control in the border properties page to edit it.
...
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75114 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-10-31 21:44:49 +00:00
Julian Smart
861c549906
Tidied up some file headers and fixed tooltip status accessors.
...
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75106 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-10-30 16:23:56 +00:00
Julian Smart
0937367a5d
wxRTC: added spacing attribute and no-wrap behaviour for table cells.
...
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75105 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-10-30 15:15:40 +00:00
Julian Smart
830a43c468
Implemented editing all 4 borders at once in wxRTC borders page
...
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75056 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-10-22 18:44:29 +00:00
Julian Smart
4068836657
Added wxEVT_RICHTEXT_CONSUMING_CHARACTER event to allow interception of character events
...
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75055 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-10-21 16:01:17 +00:00
Julian Smart
10824e3e26
Fix HasCharacter/PragraphAttributes to use the focus object
...
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75053 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-10-21 13:10:22 +00:00
Julian Smart
ab3c08cb53
Corrected wxRTC IsDefault() implementations
...
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75052 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-10-20 17:42:06 +00:00
Julian Smart
736a9ccdfa
Fixed some data transfer bugs
...
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75047 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-10-18 19:27:06 +00:00