Class: Wx::Enum
- Inherits:
-
Numeric
- Object
- Numeric
- Wx::Enum
- Defined in:
- lib/wx/doc/enum.rb
Overview
Base class for typed enums. Derives from Numeric and behaves as such in math operations but provides type safety for arguments requiring the specific enum class.
Direct Known Subclasses
AUI::AuiButtonId, AUI::AuiManagerDock, AUI::AuiManagerOption, AUI::AuiNotebookOption, AUI::AuiPaneButtonState, AUI::AuiPaneDockArtGradients, AUI::AuiPaneDockArtSetting, AUI::AuiToolBarArtSetting, AUI::AuiToolBarStyle, AUI::AuiToolBarToolTextOrientation, AcceleratorEntryFlags, ActivateEvent::Reason, Alignment, AnimationDisposal, AnimationType, AntialiasMode, BackgroundStyle, BitmapType, Bitness, Border, BrushStyle, CalendarDateBorder, CalendarHitTestResult, CheckBoxState, CompositionMode, ContentProtection, DataFormatId, DataObject::Direction, DialogLayoutAdaptationMode, Direction, DragResult, DuplexMode, EllipsizeFlags, EllipsizeMode, Endianness, EventCategory, EventPropagation, FileSystemOpenFlags, FindReplaceDialogStyles, FindReplaceFlags, FlexSizerGrowMode, FloodFillStyle, FontEncoding, FontFamily, FontFlag, FontStyle, FontSymbolicSize, FontWeight, GRID::Grid::CellSpan, GRID::Grid::GridSelectionModes, GRID::Grid::TabBehaviour, GRID::GridCellAttr::AttrKind, GRID::GridCellFloatFormat, GRID::GridRenderStyle, GRID::GridTableRequest, GeometryCentre, GradientType, HTML::HelpSearchMode, HTML::HtmlEasyPrinting::PromptMode, HTML::HtmlOpeningStatus, HTML::HtmlScriptMode, HTML::HtmlSelectionState, HTML::HtmlURLType, HelpEvent::Origin, HelpSearchMode, HitTest, IdleMode, ImageAlphaBlendMode, ImagePNGType, ImageResizeQuality, ImageResolution, InterpolationQuality, ItemKind, KeyCategoryFlags, KeyCode, KeyModifier, Language, LayoutAlignment, LayoutDirection, LayoutOrientation, ListColumnFormat, LocaleCategory, LocaleForm, LocaleInfo, LocaleInitFlags, LocaleName, LocaleTagType, LogLevelValues, MappingMode, MediaCtrlPlayerControls, MediaState, MouseButton, MouseWheelAxis, NavigationKeyEvent::NavigationKeyEventFlags, NumValidatorStyle, OperatingSystemId, Orientation, OutCode, OwnerDrawnComboBoxPaintingFlags, PG::ArrayStringProperty::ConversionFlags, PG::NumericPropertyValidator::NumericType, PG::PGNumericValidationConstants, PG::PGPropertyFlags, PG::PG_EX_WINDOW_STYLES, PG::PG_GETPROPERTYVALUES_FLAGS, PG::PG_ITERATOR_FLAGS, PG::PG_KEYBOARD_ACTIONS, PG::PG_MISC_ARG_FLAGS, PG::PG_SETVALUE_FLAGS, PG::PG_VALIDATION_FAILURE_BEHAVIOR_FLAGS, PG::PG_WINDOW_STYLES, PG::PropertyGridInterface::EditableStateFlags, PRT::PreviewFrameModalityKind, PRT::PrintBin, PRT::PrinterError, PaperSize, PenCap, PenJoin, PenQuality, PenStyle, PolygonFillMode, PortId, PrintMode, PrintOrientation, PropertySheetDialogFlags, RBN::RibbonArtSetting, RBN::RibbonBarOption, RBN::RibbonButtonBarButtonState, RBN::RibbonButtonKind, RBN::RibbonDisplayMode, RBN::RibbonGalleryButtonState, RBN::RibbonPanelOption, RBN::RibbonScrollButtonStyle, RTC::RichTextCommandId, RTC::RichTextCtrlSelectionState, RTC::RichTextFileType, RTC::RichTextHitTestFlags, RTC::RichTextOddEvenPage, RTC::RichTextPageLocation, RTC::RichTextStyleListBox::RichTextStyleType, RTC::TextAttrBorderFlags, RTC::TextAttrBorderStyle, RTC::TextAttrBorderWidth, RTC::TextAttrUnits, RTC::TextAttrValueFlags, RTC::TextBoxAttrClearStyle, RTC::TextBoxAttrCollapseMode, RTC::TextBoxAttrFlags, RTC::TextBoxAttrFloatStyle, RTC::TextBoxAttrPosition, RTC::TextBoxAttrVerticalAlignment, RTC::TextBoxAttrWhitespaceMode, RasterOperationMode, RegionContain, SVGShapeRenderingMode, SashDragStatus, SashEdgePosition, ScrollbarVisibility, SeekMode, ShowEffect, SizerFlagBits, SplitMode, StandardID, StandardPaths::ConfigFileConv, StandardPaths::Dir, StandardPaths::FileLayout, StandardPaths::ResourceCat, StaticBitmap::ScaleMode, StockCursor, StreamError, Stretch, SystemColour, SystemFeature, SystemFont, SystemMetric, SystemScreenType, TaskBarIconType, TextAttrAlignment, TextAttrBulletStyle, TextAttrEffects, TextAttrFlags, TextAttrLineSpacing, TextAttrUnderlineType, TextCtrlHitTestResult, TextValidatorStyle, ToolBarToolStyle, TreeItemIcon, UpdateUI, UpdateUIMode, WindowVariant, XmlDocumentLoadFlag, XmlNodeType, XmlResourceFlags
Class Method Summary collapse
-
.[](enum_name) ⇒ Wx::Enum?
Returns the enumerator for the given enumerator symbol or nil if no such enumerator exists.
-
.enumerators(excludes = nil) ⇒ Hash(Integer, Symbol)
Returns a hash table with enumerator value : enumerator id (symbol) pairs for the enum class.
-
.non_distinct ⇒ Array<Symbol>?
Returns the class specific list of enumerator ids (symbols) that should be considered non-distinctive enum values.
-
.set_non_distinct(lst) ⇒ Object
(also: non_distinct=)
Sets a class specific list of enumerator ids (symbols) that should be considered non-distinctive enum values (examples would be convenience constants combining multiple distinctive enumerators or enumerators denoting the first/lowest and/or last/highest distinctive enumerators).
Instance Method Summary collapse
-
#! ⇒ Boolean
Returns true if value is 0 otherwise false.
-
#&(other) ⇒ Wx::Enum, Integer
Returns bitwise and-ed value.
-
#<=>(o) ⇒ -1, ...
Compares integer values if possible.
-
#allbits?(mask) ⇒ Boolean
Returns true if all bits that are set (=1) in mask are also set in self; returns false otherwise.
-
#anybits?(mask) ⇒ Boolean
Returns true if any bit that is set (=1) in mask is also set in self; returns false otherwise.
-
#coerce(other) ⇒ Array<Integer, Integer>
Coerces enum value to be compatible with other if possible.
-
#eql?(o) ⇒ true, false
Checks type and value equality.
-
#initialize(val) ⇒ Enum
constructor
Initialize a new enum value.
-
#inspect ⇒ Object
Return string representation.
-
#integer? ⇒ Boolean
Returns true.
-
#method_missing(sym, *args) ⇒ Object
Redirects to the @value member attribute for any missing methods.
-
#nobits?(mask) ⇒ Boolean
Returns true if no bit that is set (=1) in mask is also set in self; returns false otherwise.
-
#real? ⇒ Boolean
Returns false.
-
#succ ⇒ Integer
Return next integer value from enum’s value.
-
#to_int ⇒ Object
(also: #to_i)
Return integer value of enum.
-
#to_s ⇒ Object
Return string representation of enum value (mask).
-
#|(other) ⇒ Wx::Enum, Integer
Returns bitwise or-ed value.
-
#~ ⇒ Wx::Enum
Returns an enum instance of the complement value (same class as self).
Constructor Details
#initialize(val) ⇒ Enum
Initialize a new enum value.
49 |
# File 'lib/wx/doc/enum.rb', line 49 def initialize(val)end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(sym, *args) ⇒ Object
Redirects to the @value member attribute for any missing methods.
63 |
# File 'lib/wx/doc/enum.rb', line 63 def method_missing(sym, *args) end |
Class Method Details
.[](enum_name) ⇒ Wx::Enum?
Returns the enumerator for the given enumerator symbol or nil if no such enumerator exists.
44 |
# File 'lib/wx/doc/enum.rb', line 44 def [](enum_name) end |
.enumerators(excludes = nil) ⇒ Hash(Integer, Symbol)
Returns a hash table with enumerator value : enumerator id (symbol) pairs for the enum class.
40 |
# File 'lib/wx/doc/enum.rb', line 40 def enumerators(excludes = nil) end |
.non_distinct ⇒ Array<Symbol>?
Returns the class specific list of enumerator ids (symbols) that should be considered non-distinctive enum values. Returns nil if not set.
35 |
# File 'lib/wx/doc/enum.rb', line 35 def non_distinct; end |
.set_non_distinct(lst) ⇒ Object Also known as: non_distinct=
Sets a class specific list of enumerator ids (symbols) that should be considered non-distinctive enum values (examples would be convenience constants combining multiple distinctive enumerators or enumerators denoting the first/lowest and/or last/highest distinctive enumerators). Mostly useful for bitmask enum classes.
28 |
# File 'lib/wx/doc/enum.rb', line 28 def set_non_distinct(lst) end |
Instance Method Details
#! ⇒ Boolean
Returns true if value is 0 otherwise false.
95 |
# File 'lib/wx/doc/enum.rb', line 95 def !; end |
#&(other) ⇒ Wx::Enum, Integer
Returns bitwise and-ed value. In case other is same class as self an enum instance of that class is returned otherwise an Integer value.
87 |
# File 'lib/wx/doc/enum.rb', line 87 def &(other) end |
#<=>(o) ⇒ -1, ...
Compares integer values if possible. Raises ArgumentError if not compatible
73 |
# File 'lib/wx/doc/enum.rb', line 73 def <=>(o) end |
#allbits?(mask) ⇒ Boolean
Returns true if all bits that are set (=1) in mask are also set in self; returns false otherwise.
100 |
# File 'lib/wx/doc/enum.rb', line 100 def allbits?(mask) end |
#anybits?(mask) ⇒ Boolean
Returns true if any bit that is set (=1) in mask is also set in self; returns false otherwise.
105 |
# File 'lib/wx/doc/enum.rb', line 105 def anybits?(mask) end |
#coerce(other) ⇒ Array<Integer, Integer>
Coerces enum value to be compatible with other if possible. Raises TypeError if not compatible.
54 |
# File 'lib/wx/doc/enum.rb', line 54 def coerce(other) end |
#eql?(o) ⇒ true, false
Checks type and value equality.
68 |
# File 'lib/wx/doc/enum.rb', line 68 def eql?(o) end |
#inspect ⇒ Object
Return string representation.
117 |
# File 'lib/wx/doc/enum.rb', line 117 def inspect; end |
#integer? ⇒ Boolean
Returns true.
57 |
# File 'lib/wx/doc/enum.rb', line 57 def integer?; end |
#nobits?(mask) ⇒ Boolean
Returns true if no bit that is set (=1) in mask is also set in self; returns false otherwise.
110 |
# File 'lib/wx/doc/enum.rb', line 110 def nobits?(mask) end |
#real? ⇒ Boolean
Returns false.
60 |
# File 'lib/wx/doc/enum.rb', line 60 def real?; end |
#succ ⇒ Integer
Return next integer value from enum’s value.
114 |
# File 'lib/wx/doc/enum.rb', line 114 def succ; end |
#to_int ⇒ Object Also known as: to_i
Return integer value of enum
120 |
# File 'lib/wx/doc/enum.rb', line 120 def to_int; end |
#to_s ⇒ Object
Return string representation of enum value (mask). In case the enum value matches a single enumerator value of the enum class the (scoped) name of that enumerator is returned otherwise the enum mask value is analyzed and a string representation of a bitwise or expression is returned matching the mask.
127 |
# File 'lib/wx/doc/enum.rb', line 127 def to_s; end |
#|(other) ⇒ Wx::Enum, Integer
Returns bitwise or-ed value. In case other is same class as self an enum instance of that class is returned otherwise an Integer value.
80 |
# File 'lib/wx/doc/enum.rb', line 80 def |(other) end |
#~ ⇒ Wx::Enum
Returns an enum instance of the complement value (same class as self).
91 |
# File 'lib/wx/doc/enum.rb', line 91 def ~; end |