Class: GGLib::Themes::WindowsTheme

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

Overview

WINDOWS 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

#initializeWindowsTheme

Returns a new instance of WindowsTheme.



306
307
308
309
310
311
312
313
314
# File 'lib/ext/themes.rb', line 306

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

Instance Method Details

#request(obj) ⇒ Object



315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
# File 'lib/ext/themes.rb', line 315

def request(obj)
  if @@button == nil #Can't initialize atglobal scope because $window may not have been set
    @@button = ImageTheme.new(
                        "Windows.Button", 
                        DefaultFontGroup,
                        ThemeImageGroup.new( 
                          $gglroot+"/media/windows/button/button.png", 
                          $gglroot+"/media/windows/button/buttonup.png", 
                          $gglroot+"/media/windows/button/buttondown.png"
                        )
                      )
    @@textbox = ImageTheme.new(
                          "Windows.TextBox", 
                          DefaultFontGroup, 
                          ThemeImageGroup.new( 
                            $gglroot+"/media/windows/textbox/textbox.png", 
                            $gglroot+"/media/windows/textbox/textboxup.png", 
                            $gglroot+"/media/windows/textbox/textboxup.png"
                          )
                        )
    @@label = ImageTheme.new(
                      "Windows.Label", 
                      DefaultFontGroup, 
                      ThemeImageGroup.new( $gglroot+"/null.png", $gglroot+"/null.png", $gglroot+"/null.png" )
                    )
    @@checkbox = ImageTheme.new(
                            "Windows.CheckBox.Unchecked", 
                            DefaultFontGroup, 
                            ThemeImageGroup.new( 
                              $gglroot+"/media/windows/checkbox/checkbox.png", 
                              $gglroot+"/media/windows/checkbox/checkboxup.png",
                              $gglroot+"/media/windows/checkbox/checkboxdown.png"
                            )
                          )
    @@checkboxc = ImageTheme.new(
                              "Windows.CheckBox.Checked", 
                              DefaultFontGroup, 
                              ThemeImageGroup.new( 
                                $gglroot+"/media/windows/checkbox/checkboxc.png", 
                                $gglroot+"/media/windows/checkbox/checkboxcup.png",
                                $gglroot+"/media/windows/checkbox/checkboxcdown.png"
                              )
                            )
    @@radiobtn = ImageTheme.new(
                          "Windows.RadioButton.Unchecked", 
                          DefaultFontGroup, 
                          ThemeImageGroup.new( 
                            $gglroot+"/media/windows/radio/radiobtn.png", 
                            $gglroot+"/media/windows/radio/radiobtnup.png",
                            $gglroot+"/media/windows/radio/radiobtndown.png"
                          )
                        )
    @@radiobtnc = ImageTheme.new(
                            "Windows.RadioButton.Checked", 
                            DefaultFontGroup, 
                            ThemeImageGroup.new( 
                              $gglroot+"/media/windows/radio/radiobtnc.png", 
                              $gglroot+"/media/windows/radio/radiobtncup.png",
                              $gglroot+"/media/windows/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