Class: GGLib::Themes::BlueSteelTheme

Inherits:
ImageTheme show all
Defined in:
lib/ext/themes.rb

Overview

BLUE STEEL THEME                            #

++

Constant Summary collapse

@@button =
nil

Instance Attribute Summary

Attributes inherited from ImageTheme

#font, #height, #image, #width

Attributes inherited from GGLib::Theme

#name

Instance Method Summary collapse

Methods inherited from ImageTheme

#newInstance

Methods inherited from GGLib::Theme

#height, #setDefaultState, #setDownState, #setOverState, #width

Constructor Details

#initializeBlueSteelTheme

Returns a new instance of BlueSteelTheme.



15
16
17
18
19
20
21
22
23
# File 'lib/ext/themes.rb', line 15

def initialize
  image = ThemeImageGroup.new( 
                $gglroot+"/media/bluesteel/generic/menusmall.png", 
                $gglroot+"/media/bluesteel/generic/menusmall.png", 
                $gglroot+"/media/bluesteel/generic/menusmall.png"
              )
  font = DefaultFontGroup
  super("BlueSteel.Generic", font, image)
end

Instance Method Details

#request(obj) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/ext/themes.rb', line 24

def request(obj)
  if @@button == nil #Can't initialize at global scope because $window may not have been set
    @@button = ImageTheme.new(
                        "BlueSteel.Button", 
                        DefaultFontGroup, 
                        ThemeImageGroup.new( 
                          $gglroot+"/media/bluesteel/button/button.png", 
                          $gglroot+"/media/bluesteel/button/buttonup.png", 
                          $gglroot+"/media/bluesteel/button/buttondown.png" 
                        )
                      )
    @@textbox = ImageTheme.new(
                          "BlueSteel.TextBox", 
                          DefaultFontGroup, 
                          ThemeImageGroup.new( 
                            $gglroot+"/media/bluesteel/textbox/textbox.png", 
                            $gglroot+"/media/bluesteel/textbox/textboxactive.png" , 
                            $gglroot+"/media/bluesteel/textbox/textboxactive.png" 
                          )
                        )
    @@label = ImageTheme.new(
                      "BlueSteel.Label", 
                      DefaultFontGroup, 
                      ThemeImageGroup.new( $gglroot+"/null.png", $gglroot+"/null.png" , $gglroot+"/null.png" ) 
                    )
    @@checkbox = ImageTheme.new(
                            "BlueSteel.CheckBox.Unchecked", 
                            DefaultFontGroup, 
                            ThemeImageGroup.new( 
                              $gglroot+"/media/bluesteel/checkbox/checkbox.png", 
                              $gglroot+"/media/bluesteel/checkbox/checkboxup.png",
                              $gglroot+"/media/bluesteel/checkbox/checkboxdown.png"
                            )
                          )
    @@checkboxc = ImageTheme.new(
                              "BlueSteel.CheckBox.Checked", 
                              DefaultFontGroup, 
                              ThemeImageGroup.new( 
                                $gglroot+"/media/bluesteel/checkbox/checkboxc.png", 
                                $gglroot+"/media/bluesteel/checkbox/checkboxcup.png",
                                $gglroot+"/media/bluesteel/checkbox/checkboxcdown.png"
                              )
                            )
    @@radiobtn = ImageTheme.new(
                          "BlueSteel.RadioButton.Unchecked", 
                          DefaultFontGroup, 
                          ThemeImageGroup.new( 
                            $gglroot+"/media/bluesteel/radio/radiobtn.png", 
                            $gglroot+"/media/bluesteel/radio/radiobtnup.png",
                            $gglroot+"/media/bluesteel/radio/radiobtndown.png"
                          )
                        )
    @@radiobtnc = ImageTheme.new(
                            "BlueSteel.RadioButton.Checked", 
                            DefaultFontGroup, 
                            ThemeImageGroup.new( 
                              $gglroot+"/media/bluesteel/radio/radiobtnc.png", 
                              $gglroot+"/media/bluesteel/radio/radiobtncup.png",
                              $gglroot+"/media/bluesteel/radio/radiobtncdown.png"
                            )
                          )
  end
  if obj.kind_of?(Button)
    return @@button
  elsif obj.kind_of?(TextBox)
    return @@textbox
  elsif obj.kind_of?(Label)
    return @@label
  elsif obj.kind_of?(CheckBox)
    return @@checkbox
  elsif obj.kind_of?(CheckBox::CheckedHk)
    return @@checkboxc
  elsif obj.kind_of?(RadioButton)
    return @@radiobtn
  elsif obj.kind_of?(RadioButton::CheckedHk)
    return @@radiobtnc
  end
  return self
end