lib/ext/themes.rb in gglib-1.2.1 vs lib/ext/themes.rb in gglib-1.3.0

- old
+ new

@@ -227,11 +227,10 @@ end end end class ShadeLabelTheme < DrawnTheme - @@textbox = nil def initialize font = ThemeFontGroup.new( Gosu::Font.new($window, Gosu::default_font_name, 17), Gosu::Font.new($window, Gosu::default_font_name, 25), Gosu::Font.new($window, Gosu::default_font_name, 20), @@ -241,20 +240,19 @@ super("Shade.Label", font) end end class ShadeCheckGenTheme < DrawnTheme - @@textbox = nil def initialize font = ThemeFontGroup.new( Gosu::Font.new($window, Gosu::default_font_name, 17), Gosu::Font.new($window, Gosu::default_font_name, 25), Gosu::Font.new($window, Gosu::default_font_name, 20), 0xffe6e6e6, 0xff848484 ) - super("Shade.Label", font) + super("Shade.Checkable.Unchecked", font) end def draw(x1,y1, x2, y2, state) if state == 1 $window.draw_quad(x1, y1, 0xff2e2e2e, x2, y1, 0xff2e2e2e, x1, y2, 0xff2e2e2e, x2, y2, 0xff2e2e2e, ZOrder::Widget) $window.draw_quad(x1+2, y1+2, 0xffbdbdbd, x2-2, y1+2, 0xffbdbdbd, x1+2, y2-2, 0xffbdbdbd, x2-2, y2-2, 0xffbdbdbd, ZOrder::Widget) @@ -270,20 +268,19 @@ end end end class ShadeCheckGenCTheme < DrawnTheme - @@textbox = nil def initialize font = ThemeFontGroup.new( Gosu::Font.new($window, Gosu::default_font_name, 17), Gosu::Font.new($window, Gosu::default_font_name, 25), Gosu::Font.new($window, Gosu::default_font_name, 20), 0xffe6e6e6, 0xff848484 ) - super("Shade.Label", font) + super("Shade.Checkable.Checked", font) end def draw(x1,y1, x2, y2, state) if state == 1 $window.draw_quad(x1, y1, 0xff2e2e2e, x2, y1, 0xff2e2e2e, x1, y2, 0xff2e2e2e, x2, y2, 0xff2e2e2e, ZOrder::Widget) $window.draw_quad(x1+2, y1+2, 0xffbdbdbd, x2-2, y1+2, 0xffbdbdbd, x1+2, y2-2, 0xffbdbdbd, x2-2, y2-2, 0xffbdbdbd, ZOrder::Widget) @@ -392,9 +389,30 @@ elsif obj.kind_of?(RadioButton::CheckedHk) return @@radiobtnc end return self end +end + +#-- +######################################################################## +# SOLID THEME # +######################################################################## +#++ + +class SolidTheme < DrawnTheme + def initialize(color) + font = DefaultFontGroup + super("Solid.Generic", font) + @color = color + end + def draw + $window.draw_quad(x1, y1, @color, x2, y1, @color, x1, y2, @color, x2, y2, @color, ZOrder::Widget) + end +end + +def Solid(color) + return SolidTheme.new(color) end #-- ######################################################################## # END OF THEMES # \ No newline at end of file