xtd - Reference Guide  0.2.0
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
text_format_flags.h
Go to the documentation of this file.
1 #pragma once
5 #include <xtd/ustring.h>
6 
8 namespace xtd {
10  namespace forms {
18  enum class text_format_flags {
20  default_format = 0b0,
24  left = 0b0,
26  top = 0b0,
28  horizontal_center = 0b1,
30  right = 0b10,
32  vertical_center = 0b100,
34  bottom = 0b1000,
36  word_break = 0b10000,
38  single_line = 0b100000,
40  expand_tabs = 0b1000000,
42  no_clipping = 0b100000000,
44  external_leading = 0b1000000000,
46  no_prefix = 0b10000000000,
48  internal = 0b1000000000000,
50  text_box_control = 0b10000000000000,
52  path_ellipsis = 0b100000000000000,
54  end_ellipse = 0b1000000000000000,
56  modify_string = 0b10000000000000000,
58  right_to_left = 0b100000000000000000,
60  word_ellipsis = 0b1000000000000000000,
62  no_full_width_characterB_break = 0b10000000000000000000,
64  hide_prefix = 0b100000000000000000000,
66  prefix_only = 0b1000000000000000000000,
68  preserve_graphics_clipping = 0b1000000000000000000000000,
70  preserve_graphics_translate_transform = 0b10000000000000000000000000,
72  no_padding = 0b10000000000000000000000000000,
74  left_and_right_padding = 0b100000000000000000000000000000,
75  };
76 
78  inline text_format_flags& operator +=(text_format_flags& lhs, text_format_flags rhs) {lhs = static_cast<text_format_flags>(static_cast<long long>(lhs) + static_cast<long long>(rhs)); return lhs;}
79  inline text_format_flags& operator -=(text_format_flags& lhs, text_format_flags rhs) {lhs = static_cast<text_format_flags>(static_cast<long long>(lhs) - static_cast<long long>(rhs)); return lhs;}
80  inline text_format_flags& operator &=(text_format_flags& lhs, text_format_flags rhs) {lhs = static_cast<text_format_flags>(static_cast<long long>(lhs) & static_cast<long long>(rhs)); return lhs;}
81  inline text_format_flags& operator |=(text_format_flags& lhs, text_format_flags rhs) {lhs = static_cast<text_format_flags>(static_cast<long long>(lhs) | static_cast<long long>(rhs)); return lhs;}
82  inline text_format_flags& operator ^=(text_format_flags& lhs, text_format_flags rhs) {lhs = static_cast<text_format_flags>(static_cast<long long>(lhs) ^ static_cast<long long>(rhs)); return lhs;}
83  inline text_format_flags operator +(text_format_flags lhs, text_format_flags rhs) {return static_cast<text_format_flags>(static_cast<long long>(lhs) + static_cast<long long>(rhs));}
84  inline text_format_flags operator -(text_format_flags lhs, text_format_flags rhs) {return static_cast<text_format_flags>(static_cast<long long>(lhs) - static_cast<long long>(rhs));}
85  inline text_format_flags operator ~(text_format_flags rhs) {return static_cast<text_format_flags>(~static_cast<long long>(rhs));}
86  inline text_format_flags operator &(text_format_flags lhs, text_format_flags rhs) {return static_cast<text_format_flags>(static_cast<long long>(lhs) & static_cast<long long>(rhs));}
87  inline text_format_flags operator |(text_format_flags lhs, text_format_flags rhs) {return static_cast<text_format_flags>(static_cast<long long>(lhs) | static_cast<long long>(rhs));}
88  inline text_format_flags operator ^(text_format_flags lhs, text_format_flags rhs) {return static_cast<text_format_flags>(static_cast<long long>(lhs) ^ static_cast<long long>(rhs));}
89  inline std::ostream& operator<<(std::ostream& os, text_format_flags value) {return os << to_string(value, {{text_format_flags::default_format, "default_format"}});}
90  inline std::wostream& operator<<(std::wostream& os, text_format_flags value) {return os << to_string(value, {{text_format_flags::default_format, L"default_format"}});}
92  }
93 }
Centers the text horizontally within the bounding rectangle.
Removes the center of trimmed lines and replaces it with an ellipsis. When used to draw text by text_...
Adds padding to the bounding rectangle to accommodate overhanging glyphs. This is the default...
A legacy value that has no effect. It prevents a line break at a double-wide character string...
Aligns the text on the bottom of the bounding rectangle. Applied only when the text is a single line...
Has no effect on the drawn text or text measurements. When used to draw text by TextRenderer, modifies the specified string parameter to match the displayed text if ellipsis are shown. This value has no effect unless end_ellipsis or path_ellipsis is specified.
Displays the text in a single line.
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
Ignores the ampersand (&) prefix character in the text, so that the letter that follows won&#39;t be underlin...
Aligns the text on the top of the bounding rectangle. This is the default.
Displays the text from right to left.
Applies the default formatting, which is left-aligned.
Removes the end of trimmed lines, and replaces them with an ellipsis. When used to draw text by text_...
Trims the line to the nearest word and an ellipsis is placed at the end of a trimmed line...
Preserves the transformation specified by a graphics. Applies only to methods receiving an ideviceCon...
Turns off processing of prefix characters. Typically, the ampersand (&) mnemonic-prefix character is ...
Allows the overhanging parts of glyphs and unwrapped text reaching outside the formatting rectangle t...
Aligns the text on the left side of the clipping area. This is the default.
Breaks the text at the end of a word.
Contains xtd::ustring class.
Aligns the text on the right side of the clipping area.
Adds padding to both sides of the bounding rectangle.
Expands tab characters. The default number of characters per tab is eight. The word_ellipsis, path_ellipsis, and end_ellipsis values cannot be used with expand_tabs.
Includes the font external leading in line height. Typically, external leading is not included in the...
Draws only an underline at the position of the character following the ampersand (&) prefix character and...
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition: about_box.h:13
text_format_flags
Specifies the display and layout information for text strings.
Definition: text_format_flags.h:18
Specifies the text should be formatted for display on a TextBox control.
Preserves the clipping specified by a graphics object. Applies only to methods receiving an idevice_c...
Centers the text vertically, within the bounding rectangle.
Does not add padding to the bounding rectangle.
std::string to_string(const value_t &value, const std::string &fmt, const std::locale &loc)
Convert a specified value into a string with specified format and locale.
Definition: to_string.h:37