summaryrefslogtreecommitdiff
path: root/jni/ruby/ext/tk/lib/tkextlib/vu/bargraph.rb
blob: b9fcf925f393a2176425767ea968567c17014f16 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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
#
#  ::vu::bargraph widget
#                               by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
#
require 'tk'

# create module/class
module Tk
  module Vu
    class Bargraph < TkWindow
    end
  end
end


# call setup script  --  <libdir>/tkextlib/vu.rb
require 'tkextlib/vu.rb'

class Tk::Vu::Bargraph < TkWindow
  TkCommandNames = ['::vu::bargraph'.freeze].freeze
  WidgetClassName = 'Bargraph'.freeze
  WidgetClassNames[WidgetClassName] ||= self

  ###############################

  def __boolval_optkeys
    ['showminmax', 'showvalue']
  end
  private :__boolval_optkeys

  def __strval_optkeys
    super() + [
      'title',
      'barbackground', 'barcolor', 'barcolour',
      'tickcolor', 'tickcolour',
      'textcolor', 'textcolour',
    ]
  end
  private :__strval_optkeys

  def __listval_optkeys
    ['alabels', 'blabels']
  end
  private :__listval_optkeys

  def __font_optkeys
    ['alabfont', 'blabfont']
  end
  private :__font_optkeys

  ###############################

  def set(val = None)
    tk_call_without_enc(@path, 'set', val)
    self
  end

  def get()
    num_or_str(tk_call_without_enc(@path, 'get'))
  end
end