Class: SKUI::Label

Inherits:
Control show all
Defined in:
src/SKUI/label.rb

Overview

Since:

  • 1.0.0

Instance Attribute Summary

Attributes inherited from Control

#rect

Attributes inherited from Base

#properties, #window

Instance Method Summary collapse

Methods inherited from Control

#enabled, #left, #name, #position, #release, #size, #stretch, #tab_index, #tooltip, #visible, #width, #z_index

Methods inherited from Base

#background_color, #font, #foreground_color, #inspect, #parent, #release, #to_js, #typename, #ui_id

Methods included from Events

#add_event_handler, included, #release_events, #trigger_event

Constructor Details

#initialize(caption, control = nil) ⇒ Label

Returns a new instance of Label.

Parameters:

  • caption (String)
  • control (Control) (defaults to: nil)

    Control which focus of forwarded to.

Since:

  • 1.0.0



32
33
34
35
36
37
38
39
40
41
42
# File 'src/SKUI/label.rb', line 32

def initialize( caption, control = nil )
  super()

  @properties[ :align ]   = :left
  @properties[ :caption ] = caption
  @properties[ :control ] = control

  add_event_handler( :open_url ) { |param|
    UI.openURL( param )
  }
end

Instance Method Details

#alignControl

Returns:

Since:

  • 1.0.0



11
# File 'src/SKUI/label.rb', line 11

prop( :align, &TypeCheck::TEXTALIGN )

#captionString

Returns:

  • (String)

Since:

  • 1.0.0



15
# File 'src/SKUI/label.rb', line 15

prop( :caption, &TypeCheck::STRING )

#controlControl

Returns:

Since:

  • 1.0.0



19
# File 'src/SKUI/label.rb', line 19

prop( :control, &TypeCheck::CONTROL )

#urlString

Returns:

  • (String)

Since:

  • 1.0.0



23
# File 'src/SKUI/label.rb', line 23

prop( :url, &TypeCheck::STRING )