wxWidgets/samples/richtext
Vadim Zeitlin f69dbaa1ae Introduce MSW ARM64 support
This is a preliminary ARM64 platform support for wxWidgets at "it
compiles" stage. This will allow building and testing wxWidgets based
apps for oncoming Windows 10 ARM64.

Requirements:
- Visual Studio 2017 Update 4 or later with Visual C++ compilers and
  libraries for ARM64 component installed

Building:
1. Open command prompt.
2. Change directory to build\msw subfolder.
3. Run "C:\Program Files (x86)\Microsoft Visual
   Studio\2017\Community\VC\Auxiliary\Build\vcvarsamd64_arm64.bat" once.
4. Use `nmake TARGET_CPU=ARM64 ...` to build required flavor of wxWidget
   libraries.

Notes:
1. Building of *.sln/*.vcxproj files does not support ARM64 yet. This
   requires to hardcode Windows SDK to 10.0.15063.0 or later in
   *.vcxproj files, which would render them non-compilable in older
   Visual Studio versions. Microsoft is aware of this issue and is
   planning a fix in the next version of Visual Studio.
2. wxmsw31ud_gl.dll does not build yet. Awaiting Microsoft to deliver
   missing opengl32.lib for ARM64. Please, specify USE_OPENGL=0.

Closes https://github.com/wxWidgets/wxWidgets/pull/923
2018-09-17 22:34:32 +02:00
..
bitmaps Convert all XPM files to Unix EOLs. 2015-03-19 21:46:05 +01:00
descrip.mms set up for OpenVMS richtext & regex and add more samples in compile cascade 2009-10-05 09:13:42 +00:00
makefile.bcc Move wxAdv library contents into wxCore 2018-08-27 21:13:04 +02:00
makefile.gcc Move wxAdv library contents into wxCore 2018-08-27 21:13:04 +02:00
Makefile.in Move wxAdv library contents into wxCore 2018-08-27 21:13:04 +02:00
makefile.unx Move wxAdv library contents into wxCore 2018-08-27 21:13:04 +02:00
makefile.vc Introduce MSW ARM64 support 2018-09-17 22:34:32 +02:00
readme.txt Fix some typos in the comments and messages in the samples. 2014-12-24 13:57:19 +00:00
richtext_vc7.vcproj Move wxAdv library contents into wxCore 2018-08-27 21:13:04 +02:00
richtext_vc8.vcproj Move wxAdv library contents into wxCore 2018-08-27 21:13:04 +02:00
richtext_vc9.vcproj Move wxAdv library contents into wxCore 2018-08-27 21:13:04 +02:00
richtext.bkl Move wxAdv library contents into wxCore 2018-08-27 21:13:04 +02:00
richtext.cpp Remove obsolete symbols from the samples 2015-12-03 22:11:04 +01:00
todo.txt Reduced unnecessary painting; delete/recreate caret as WIN32 requires 2005-10-21 20:04:53 +00:00

wxRichTextCtrl README
=====================

Welcome to wxRichTextCtrl. It includes the following functionality:

* Text entry, paragraph wrapping

* Scrolling, keyboard navigation

* Application of character styles:

  bold, italic, underlined, font face, text colour

* Application of paragraph styles:

  left/right indentation, sub-indentation (first-line indent),
  paragraph spacing (before and after), line spacing,
  left/centre/right alignment, numbered bullets

* Insertion of images

* Copy/paste

* Undo/Redo with optional batching and undo history suppression

* Named paragraph and character styles management and application

* File handlers allow addition of file formats

* Text saving and loading, XML saving and loading, HTML saving (unfinished)

Sorry, this is a Windows-only demo for now but the code should
compile on other platforms.

Design
======

Data is represented by a hierarchy of objects, all derived from
wxRichTextObject.

The top of the hierarchy is the buffer, a kind of wxRichTextParagraphLayoutBox.
These boxes will allow flexible placement of text boxes on a page, but
for now there will be a single box representing the document,
and this box will a wxRichTextParagraphLayoutBox which contains further
wxRichTextParagraph objects, each of which can include text and images.

Each object maintains a range (start and end position) measured
from the start of the main parent box.
A paragraph object knows its range, and a text fragment knows its range
too. So, a character or image in a page has a position relative to the
start of the document, and a character in an embedded text box has
a position relative to that text box. For now, we will not be dealing with
embedded objects but it's something to bear in mind for later.

Before display, a changed buffer must have Layout() called on it,
to do wrapping, alignment etc. Ranges representing wrapped lines are stored
with each paragraph.

Since wxRichTextBuffer is separate from wxRichTextCtrl, the storage
and rendering facilities can be used by other controls.

API
===

It's basically the wxTextCtrl with some additions. There is a new
wxTextAttrEx class deriving from wxTextAttr, to accommodate new
style attributes. This could be merged with wxTextAttr. There
is also a wxRichTextAttr which is similar to wxTextAttrEx but
doesn't store the font as a wxFont: this allows much more
efficient operations, especially when querying styles in a
UI update handler. We would not want to create several new wxFonts
when querying for italics, bold, etc. every few milliseconds.

See "Functionality specific to wxRichTextCtrl" section in richtextctrl.h.

One addition is Set/GetBasicStyle, which is needed in addition to
Set/GetDefaultStyle to get the overall style for the buffer
from which content will inherit (after apply the default style).

wxRichTextRange is a new class representing start and end positions.
It's used in the implementation so that pieces of content
know their range, and also in the API in preference to using
two positions.

What next?
==========

- Decision about where to put it: wxCode, wxWidgets
- Makefiles/bakefiles
- Refining the API
- Documentation
- Bug fixing/improvements


See todo.txt for a list of bugs, improvements and features,
and also TODO throughout the source.

==
Julian Smart, October 18th 2005