abstract class GPhoto2::CameraWidget::Base
- GPhoto2::CameraWidget::Base
- Reference
- Object
Overview
Represents a widget.
Included Modules
Direct Known Subclasses
- GPhoto2::CameraWidget::Button
- GPhoto2::CameraWidget::Date
- GPhoto2::CameraWidget::Range
- GPhoto2::CameraWidget::Section
- GPhoto2::CameraWidget::Text
- GPhoto2::CameraWidget::Toggle
- GPhoto2::CameraWidget::Window
Defined in:
gphoto2/camera_widgets/base.crgphoto2/camera_widgets/button.cr
gphoto2/camera_widgets/date.cr
gphoto2/camera_widgets/menu.cr
gphoto2/camera_widgets/radio.cr
gphoto2/camera_widgets/range.cr
gphoto2/camera_widgets/section.cr
gphoto2/camera_widgets/text.cr
gphoto2/camera_widgets/toggle.cr
gphoto2/camera_widgets/window.cr
Constructors
Instance Method Summary
- #==(other : self)
-
#==(other : Symbol)
Compares
#value
with givenSymbol
. - #==(other)
-
#as_button : GPhoto2::CameraWidget::Button
Returns widget as
Button
, raises otherwise. -
#as_button? : GPhoto2::CameraWidget::Button | Nil
Returns widget as
Button
,nil
otherwise. -
#as_date : GPhoto2::CameraWidget::Date
Returns widget as
Date
, raises otherwise. -
#as_date? : GPhoto2::CameraWidget::Date | Nil
Returns widget as
Date
,nil
otherwise. -
#as_menu : GPhoto2::CameraWidget::Menu
Returns widget as
Menu
, raises otherwise. -
#as_menu? : GPhoto2::CameraWidget::Menu | Nil
Returns widget as
Menu
,nil
otherwise. -
#as_radio : GPhoto2::CameraWidget::Radio
Returns widget as
Radio
, raises otherwise. -
#as_radio? : GPhoto2::CameraWidget::Radio | Nil
Returns widget as
Radio
,nil
otherwise. -
#as_range : GPhoto2::CameraWidget::Range
Returns widget as
Range
, raises otherwise. -
#as_range? : GPhoto2::CameraWidget::Range | Nil
Returns widget as
Range
,nil
otherwise. -
#as_section : GPhoto2::CameraWidget::Section
Returns widget as
Section
, raises otherwise. -
#as_section? : GPhoto2::CameraWidget::Section | Nil
Returns widget as
Section
,nil
otherwise. -
#as_text : GPhoto2::CameraWidget::Text
Returns widget as
Text
, raises otherwise. -
#as_text? : GPhoto2::CameraWidget::Text | Nil
Returns widget as
Text
,nil
otherwise. -
#as_toggle : GPhoto2::CameraWidget::Toggle
Returns widget as
Toggle
, raises otherwise. -
#as_toggle? : GPhoto2::CameraWidget::Toggle | Nil
Returns widget as
Toggle
,nil
otherwise. -
#as_window : GPhoto2::CameraWidget::Window
Returns widget as
Window
, raises otherwise. -
#as_window? : GPhoto2::CameraWidget::Window | Nil
Returns widget as
Window
,nil
otherwise. -
#children : Array(Base)
Returns widget children.
-
#close : Nil
Finalizes object by freeing allocated memory.
-
#flatten(map = {} of String => Base) : Hash(String, Base)
Returns flat structure of widget
#children
. -
#id : Int32
Returns widget numerical id.
-
#in?(other : ::Range)
Returns
true
if#value
is included in the other::Range
. -
#in?(other : Enumerable)
Returns
true
if#value
matches at least one element of the collection. -
#info : String
Returns widget info if set.
-
#label : String
Returns widget label.
-
#name : String
Returns widget name.
-
#parent : Base | Nil
Returns parent widget,
nil
otherwise. -
#readonly? : Bool
Returns
true
if the widget has readonly flag set. -
#to_s(io : IO)
Returns string representation of the widget
#value
. -
#type : Type
Returns type of the widget.
-
#value
Returns widget value.
-
#value=(value)
Sets widget value.
-
#value?
Returns widget
#value
unless it's empty or is known to be an empty string, likenone
or raisesNotImplementedError
.
Instance methods inherited from module GPhoto2::Struct(LibGPhoto2::CameraWidget)
ptr : Pointer(T)
ptr,
ptr? : Pointer(T) | Nil
ptr?,
to_unsafe : Pointer(T)
to_unsafe,
wrapped : T
wrapped
Constructor methods inherited from module GPhoto2::Struct(LibGPhoto2::CameraWidget)
new(ptr : Pointer(T) | Nil = nil)
new
Constructor Detail
Instance Method Detail
Compares #value
with given other using #to_s
.
camera[:whitebalance] == "Automatic"
camera[:shutterspeed] == 0.5
camera[:iso] == 400
Returns flat structure of widget #children
.
Returns true
if #value
is included in the other ::Range
.
camera[:exposurecompensation].in? -1.6..0.6
camera[:aperture].in? 4..7.1
camera[:iso].in? 100..400
Returns true
if #value
matches at least one element of the collection.
camera[:autoexposuremode].in? %w(Manual Bulb)
Returns string representation of the widget #value
.
puts camera[:whitebalance].to_s # => "Automatic"
Returns widget #value
unless it's empty or is known to be
an empty string, like none
or raises NotImplementedError
.