Class: Wx::Enum

Inherits:
Numeric
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initialize(val) ⇒ Enum

Initialize a new enum value.

Parameters:

  • val (Integer)

    enum integer 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.

Returns:



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.

Parameters:

  • excludes (Array<Symbol>, nil) (defaults to: nil)

    list of enumerator ids (symbols) to exclude (by default the non_distinct list is used if defined)

Returns:

  • (Hash(Integer, Symbol))


40
# File 'lib/wx/doc/enum.rb', line 40

def enumerators(excludes = nil) end

.non_distinctArray<Symbol>?

Returns the class specific list of enumerator ids (symbols) that should be considered non-distinctive enum values. Returns nil if not set.

Returns:

  • (Array<Symbol>, nil)

See Also:



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.

Parameters:

  • lst (Array<Symbol>)


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.

Returns:

  • (Boolean)


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.

Parameters:

Returns:



87
# File 'lib/wx/doc/enum.rb', line 87

def &(other) end

#<=>(o) ⇒ -1, ...

Compares integer values if possible. Raises ArgumentError if not compatible

Parameters:

  • o (Enum, Numeric)

    enum or numeric object to compare.

Returns:

  • (-1, 0, 1)


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.

Parameters:

  • mask (Integer)

Returns:

  • (Boolean)


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.

Parameters:

  • mask (Integer)

Returns:

  • (Boolean)


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.

Parameters:

  • other (Numeric)

    numeric value

Returns:

  • (Array<Integer, Integer>)

    the integer equivalences of other and enum value



54
# File 'lib/wx/doc/enum.rb', line 54

def coerce(other) end

#eql?(o) ⇒ true, false

Checks type and value equality.

Parameters:

  • o (::Object)

    the object to compare

Returns:

  • (true, false)

    true if o is instance of same enum class as self and integer values are equal; false otherwise



68
# File 'lib/wx/doc/enum.rb', line 68

def eql?(o) end

#inspectObject

Return string representation.



117
# File 'lib/wx/doc/enum.rb', line 117

def inspect; end

#integer?Boolean

Returns true.

Returns:

  • (Boolean)


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.

Parameters:

  • mask (Integer)

Returns:

  • (Boolean)


110
# File 'lib/wx/doc/enum.rb', line 110

def nobits?(mask) end

#real?Boolean

Returns false.

Returns:

  • (Boolean)


60
# File 'lib/wx/doc/enum.rb', line 60

def real?; end

#succInteger

Return next integer value from enum’s value.

Returns:

  • (Integer)

    next integer value



114
# File 'lib/wx/doc/enum.rb', line 114

def succ; end

#to_intObject Also known as: to_i

Return integer value of enum



120
# File 'lib/wx/doc/enum.rb', line 120

def to_int; end

#to_sObject

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.

Parameters:

Returns:



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).

Returns:



91
# File 'lib/wx/doc/enum.rb', line 91

def ~; end