summaryrefslogtreecommitdiffstats
path: root/ui/views/examples/multiline_example.h
diff options
context:
space:
mode:
authorckocagil@chromium.org <ckocagil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-16 20:16:20 +0000
committerckocagil@chromium.org <ckocagil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-16 20:16:20 +0000
commiteced6cba57f61829cfa095499f9c6f0c94d6594b (patch)
treeaf6e23bff7d55d84625213a80fd7f88c902c51ba /ui/views/examples/multiline_example.h
parentbd7189299af5db10ef53bac5f6a13a0dfdce72b8 (diff)
downloadchromium_src-eced6cba57f61829cfa095499f9c6f0c94d6594b.zip
chromium_src-eced6cba57f61829cfa095499f9c6f0c94d6594b.tar.gz
chromium_src-eced6cba57f61829cfa095499f9c6f0c94d6594b.tar.bz2
Windows implementation of multiline RenderText
Multi-line text rendering in the Chromium UI is currently done by slicing the string into multiple lines by using text metrics from cross-platform libraries and rendering text by using different RenderText instances - one for each line. This approach has poor performance and is very bug-prone. This CL adds a cross-platform interface and data structures to RenderText to support multi-line text rendering. This CL also implements the required platform-specific bits for Windows. Support for other platforms will be implemented in subsequent CLs. Multi-line rendering as implemented in this CL is limited. Newline characters are ignored. RTL and complex scripts are supported, while there are be issues with selection highlights. Text-space <-> view-space mappings do not support RTL/complex scripts. BUG=248597 Review URL: https://chromiumcodereview.appspot.com/16867016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@223394 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views/examples/multiline_example.h')
-rw-r--r--ui/views/examples/multiline_example.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/ui/views/examples/multiline_example.h b/ui/views/examples/multiline_example.h
index bc5d8c8..2757c4a 100644
--- a/ui/views/examples/multiline_example.h
+++ b/ui/views/examples/multiline_example.h
@@ -7,6 +7,7 @@
#include "base/compiler_specific.h"
#include "base/strings/string16.h"
+#include "ui/views/controls/button/checkbox.h"
#include "ui/views/controls/textfield/textfield_controller.h"
#include "ui/views/examples/example_base.h"
@@ -16,9 +17,10 @@ class Label;
namespace examples {
-// An example that compares the multi-line rendering of different controls.
+// An example that compares the multiline rendering of different controls.
class MultilineExample : public ExampleBase,
- public TextfieldController {
+ public TextfieldController,
+ public ButtonListener {
public:
MultilineExample();
virtual ~MultilineExample();
@@ -26,6 +28,9 @@ class MultilineExample : public ExampleBase,
// ExampleBase:
virtual void CreateExampleView(View* container) OVERRIDE;
+ // ButtonListener:
+ virtual void ButtonPressed(Button* sender, const ui::Event& event) OVERRIDE;
+
private:
class RenderTextView;
@@ -39,6 +44,9 @@ class MultilineExample : public ExampleBase,
Label* label_;
Textfield* textfield_;
+ // Checkbox to enable and disable text rendering in |label_|.
+ Checkbox* label_checkbox_;
+
DISALLOW_COPY_AND_ASSIGN(MultilineExample);
};