# :stopdoc: # This file is automatically generated by the WXRuby3 documentation # generator. Do not alter this file. # :startdoc: module Wx # ST_NO_AUTORESIZE = 1 # ST_ELLIPSIZE_START = 4 # ST_ELLIPSIZE_MIDDLE = 8 # ST_ELLIPSIZE_END = 16 # A static text control displays one or more lines of read-only text. # {Wx::StaticText} supports the three classic text alignments, label ellipsization i.e. replacing parts of the text with the ellipsis ("...") if the label doesn't fit into the provided space and also formatting markup with {Wx::Control#set_label_markup}. # === Styles # # This class supports the following styles: # # - {Wx::Alignment::ALIGN_LEFT}: Align the text to the left. # - {Wx::Alignment::ALIGN_RIGHT}: Align the text to the right. # - {Wx::Alignment::ALIGN_CENTRE_HORIZONTAL}: Center the text (horizontally). # - {Wx::ST_NO_AUTORESIZE}: By default, the control will adjust its size to exactly fit to the size of the text when {Wx::StaticText#set_label} is called. If this style flag is given, the control will not change its size (this style is especially useful with controls which also have the {Wx::Alignment::ALIGN_RIGHT} or the {Wx::Alignment::ALIGN_CENTRE_HORIZONTAL} style because otherwise they won't make sense any longer after a call to {Wx::StaticText#set_label}). # - {Wx::ST_ELLIPSIZE_START}: If the labeltext width exceeds the control width, replace the beginning of the label with an ellipsis; uses {Wx::Control.ellipsize}. # - {Wx::ST_ELLIPSIZE_MIDDLE}: If the label text width exceeds the control width, replace the middle of the label with an ellipsis; uses {Wx::Control.ellipsize}. # - {Wx::ST_ELLIPSIZE_END}: If the label text width exceeds the control width, replace the end of the label with an ellipsis; uses {Wx::Control.ellipsize}. # # === # # Category: {Wx::Controls}
Appearance:
{Wx::MSW} Appearance # {Wx::GTK} Appearance # {Wx::OSX} Appearance #
# @see Wx::StaticBitmap # @see Wx::StaticBox # # class StaticText < Control # @overload initialize() # Default constructor. # @return [StaticText] # @overload initialize(parent, id, label, pos=Wx::DEFAULT_POSITION, size=Wx::DEFAULT_SIZE, style=0, name=Wx::STATIC_TEXT_NAME_STR) # Constructor, creating and showing a text control. # # @see Wx::StaticText#create # @param parent [Wx::Window] Parent window. Should not be NULL. # @param id [Integer] Control identifier. A value of -1 denotes a default value. # @param label [String] Text label. # @param pos [Array(Integer, Integer), Wx::Point] Window position. # @param size [Array(Integer, Integer), Wx::Size] Window size. # @param style [Integer] Window style. See {Wx::StaticText}. # @param name [String] Window name. # @return [StaticText] def initialize(*args) end # Creation function, for two-step construction. # For details see {Wx::StaticText#static_text}. # @param parent [Wx::Window] # @param id [Integer] # @param label [String] # @param pos [Array(Integer, Integer), Wx::Point] # @param size [Array(Integer, Integer), Wx::Size] # @param style [Integer] # @param name [String] # @return [true,false] def create(parent, id, label, pos=Wx::DEFAULT_POSITION, size=Wx::DEFAULT_SIZE, style=0, name=Wx::STATIC_TEXT_NAME_STR) end # Returns true if the window styles for this control contains one of the {Wx::ST_ELLIPSIZE_START}, {Wx::ST_ELLIPSIZE_MIDDLE} or {Wx::ST_ELLIPSIZE_END} styles. # @return [true,false] def is_ellipsized; end alias_method :ellipsized?, :is_ellipsized # Change the label shown in the control. # Notice that since wxWidgets 3.1.1 this function is guaranteed not to do anything if the label didn't really change, so there is no benefit to checking if the new label is different from the current one in the application code. # @see Wx::Control#set_label # @param label [String] # @return [void] def set_label(label) end alias_method :label=, :set_label # This functions wraps the controls label so that each of its lines becomes at most width pixels wide if possible (the lines are broken at words boundaries so it might not be the case if words are too long). # If width is negative, no wrapping is done. Note that this width is not necessarily the total width of the control, since a few pixels for the border (depending on the controls border style) may be added. # @param width [Integer] # @return [void] def wrap(width) end end # StaticText end