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.
Public Member Functions | Static Public Member Functions | List of all members
xtd::drawing::string_format Class Referencefinal

#include <string_format.h>

Definition

Encapsulates text layout information (such as alignment, orientation and tab stops) display manipulations (such as ellipsis insertion and national digit substitution) and OpenType features. This class cannot be inherited.

Namespace
xtd::drawing
Library
xtd.drawing
Remarks
Many common formats are provided through the string_format_flags enumeration. string_format objects can be changed.
Examples:
user_control.cpp.

Public Member Functions

 string_format ()=default
 Initializes a new string_format object. More...
 
 string_format (const xtd::drawing::string_format &format)=default
 Initializes a new string_format object from the specified existing string_format object. More...
 
 string_format (xtd::drawing::string_format_flags options)
 Initializes a new string_format object with the specified string_format_flags enumeration. More...
 
xtd::drawing::string_alignment alignment () const
 Gets horizontal alignment of the string. More...
 
xtd::drawing::string_formatalignment (xtd::drawing::string_alignment alignment)
 Sets horizontal alignment of the string. More...
 
xtd::drawing::string_format_flags format_flags () const
 Gets a string_formatFlags enumeration that contains formatting information. More...
 
xtd::drawing::string_formatformat_flags (xtd::drawing::string_format_flags format_flag)
 Sets a string_formatFlags enumeration that contains formatting information. More...
 
xtd::drawing::hotkey_prefix hotkey_prefix () const
 Gets the HotkeyPrefix object for this string_format object. More...
 
xtd::drawing::string_formathotkey_prefix (xtd::drawing::hotkey_prefix hotkey_prefix)
 Sets the HotkeyPrefix object for this string_format object. More...
 
xtd::drawing::string_alignment line_alignment () const
 Gets vertical alignment of the string. More...
 
xtd::drawing::string_formatline_alignment (xtd::drawing::string_alignment line_alignment)
 Sets vertical alignment of the string. More...
 
xtd::drawing::string_trimming trimming () const
 Gets the string_trimming enumeration for this string_format object. More...
 
xtd::drawing::string_formattrimming (xtd::drawing::string_trimming trimming)
 Sets the string_trimming enumeration for this string_format object. More...
 
- Public Member Functions inherited from xtd::object
 object ()=default
 Create a new instance of the ultimate base class object. More...
 
virtual bool equals (const object &obj) const noexcept
 Determines whether the specified object is equal to the current object. More...
 
virtual size_t get_hash_code () const noexcept
 Serves as a hash function for a particular type. More...
 
template<typename object_t >
std::unique_ptr< object_t > memberwise_clone () const
 Gets the type of the current instance. More...
 
virtual xtd::ustring to_string () const noexcept
 Returns a std::string that represents the current object. More...
 

Static Public Member Functions

static xtd::drawing::string_format generic_default ()
 Gets a generic default string_format object. More...
 
static xtd::drawing::string_format generic_typographic ()
 Gets a generic typographic string_format object. More...
 
- Static Public Member Functions inherited from xtd::object
static bool equals (const object &object_a, const object &object_b) noexcept
 Determines whether the specified object instances are considered equal. More...
 
static bool reference_equals (const object &object_a, const object &object_b) noexcept
 Determines whether the specified object instances are the same instance. More...
 

Constructor & Destructor Documentation

◆ string_format() [1/3]

xtd::drawing::string_format::string_format ( )
default

Initializes a new string_format object.

Remarks
The following table shows initial property values for an instance of string_format class.
property initial value
format_flag 0
hotkey_prefix none

◆ string_format() [2/3]

xtd::drawing::string_format::string_format ( const xtd::drawing::string_format format)
default

Initializes a new string_format object from the specified existing string_format object.

Parameters
formatThe string_format object from which to initialize the new string_format object.

◆ string_format() [3/3]

xtd::drawing::string_format::string_format ( xtd::drawing::string_format_flags  options)
inlineexplicit

Initializes a new string_format object with the specified string_format_flags enumeration.

Parameters
optionsThe StringFormatFlags enumeration for the new StringFormat object.

Member Function Documentation

◆ alignment() [1/2]

xtd::drawing::string_alignment xtd::drawing::string_format::alignment ( ) const
inline

Gets horizontal alignment of the string.

Returns
A string_alignment enumeration that specifies the horizontal alignment of the string.
Remarks
Use line_alignment to specify the vertical alignment of the string.

◆ alignment() [2/2]

xtd::drawing::string_format& xtd::drawing::string_format::alignment ( xtd::drawing::string_alignment  alignment)
inline

Sets horizontal alignment of the string.

Parameters
alignmentA string_alignment enumeration that specifies the horizontal alignment of the string.
Remarks
Use line_alignment to specify the vertical alignment of the string.

◆ format_flags() [1/2]

xtd::drawing::string_format_flags xtd::drawing::string_format::format_flags ( ) const
inline

Gets a string_formatFlags enumeration that contains formatting information.

Returns
A string_formatFlags enumeration that contains formatting information.

◆ format_flags() [2/2]

xtd::drawing::string_format& xtd::drawing::string_format::format_flags ( xtd::drawing::string_format_flags  format_flag)
inline

Sets a string_formatFlags enumeration that contains formatting information.

Parameters
format_flagA string_formatFlags enumeration that contains formatting information.

◆ generic_default()

static xtd::drawing::string_format xtd::drawing::string_format::generic_default ( )
inlinestatic

Gets a generic default string_format object.

Returns
The generic default string_format object.
Remarks
The following table shows initial property values for a generic default instance of the string_format class.
property initial value
format_flag 0
alignment near
line_alignment near
hotkey_prefix none
trimming character

◆ generic_typographic()

static xtd::drawing::string_format xtd::drawing::string_format::generic_typographic ( )
inlinestatic

Gets a generic typographic string_format object.

Returns
A generic typographic string_format object.
Remarks
The following table shows initial property values for a generic default instance of the string_format class. | property | initial value | |-------------—|---------------------------------------------------—| | format_flag | 0b110000000000100 (no_clip|fit_black_box|line_limit) | | alignment | near | | line_alignment | near | | hotkey_prefix | none | | trimming | none |

◆ hotkey_prefix() [1/2]

xtd::drawing::hotkey_prefix xtd::drawing::string_format::hotkey_prefix ( ) const
inline

Gets the HotkeyPrefix object for this string_format object.

Returns
The hotkey_prefix object for this string_format object, the default is hotkey_prefix::none.
Remarks
In a graphical user interface, a hot key is the underlined letter in a word (usually combined with another key, such as the Alt key) that you can press on the keyboard to activate the functionality that the word represents.

◆ hotkey_prefix() [2/2]

xtd::drawing::string_format& xtd::drawing::string_format::hotkey_prefix ( xtd::drawing::hotkey_prefix  hotkey_prefix)
inline

Sets the HotkeyPrefix object for this string_format object.

Parameters
hotkey_prefixThe hotkey_prefix object for this string_format object, the default is hotkey_prefix::none.
Remarks
In a graphical user interface, a hot key is the underlined letter in a word (usually combined with another key, such as the Alt key) that you can press on the keyboard to activate the functionality that the word represents.

◆ line_alignment() [1/2]

xtd::drawing::string_alignment xtd::drawing::string_format::line_alignment ( ) const
inline

Gets vertical alignment of the string.

Returns
A string_alignment enumeration that specifies the vertical alignment of the string.
Remarks
Use alignment to specify the horizontal alignment of the string.

◆ line_alignment() [2/2]

xtd::drawing::string_format& xtd::drawing::string_format::line_alignment ( xtd::drawing::string_alignment  line_alignment)
inline

Sets vertical alignment of the string.

Parameters
alignmentA string_alignment enumeration that specifies the vertical alignment of the string.
Remarks
Use alignment to specify the horizontal alignment of the string.

◆ trimming() [1/2]

xtd::drawing::string_trimming xtd::drawing::string_format::trimming ( ) const
inline

Gets the string_trimming enumeration for this string_format object.

Returns
A string_trimming enumeration that indicates how text drawn with this string_format object is trimmed when it exceeds the edges of the layout rectangle.

◆ trimming() [2/2]

xtd::drawing::string_format& xtd::drawing::string_format::trimming ( xtd::drawing::string_trimming  trimming)
inline

Sets the string_trimming enumeration for this string_format object.

Parameters
trimmingA string_trimming enumeration that indicates how text drawn with this string_format object is trimmed when it exceeds the edges of the layout rectangle.

The documentation for this class was generated from the following file: