Class: Tk::Tcllib::Plotchart::Ganttchart (Ruby 2.3.4)

In Files

  • tk/lib/tkextlib/tcllib/plotchart.rb

Class/Module Index [+]

Quicksearch

Tk::Tcllib::Plotchart::Ganttchart

Constants

TkCommandNames

Public Class Methods

new(*args)
 
               # File tk/lib/tkextlib/tcllib/plotchart.rb, line 1261
def initialize(*args)
  # args := ([parent,] time_begin, time_end, items [, text_width] [, keys])
  # time_begin := String of time format (e.g. "1 january 2004")
  # time_end   := String of time format (e.g. "1 january 2004")
  # args := Expected/maximum number of items
  #          ( This determines the vertical spacing. ),
  #         Expected/maximum width of items,
  #         Option Hash ( { key=>value, ... } )
  if args[0].kind_of?(String)
    @time_begin = args.shift
    @time_end   = args.shift
    @args  = args

    super(*args) # create canvas widget
  else
    parent = args.shift

    @time_begin = args.shift
    @time_end   = args.shift
    @args  = args

    if parent.kind_of?(Tk::Canvas)
      @path = parent.path
    else
      super(parent, *args) # create canvas widget
    end
  end

  @chart = _create_chart
end
            

Public Instance Methods

color_of_part(keyword, newcolor)
 
               # File tk/lib/tkextlib/tcllib/plotchart.rb, line 1330
def color_of_part(keyword, newcolor)
  tk_call(@chart, 'color', keyword, newcolor)
  self
end
            
connect(from_task, to_task)
 
               # File tk/lib/tkextlib/tcllib/plotchart.rb, line 1316
def connect(from_task, to_task)
  from_task = array2tk_list(from_task) if from_task.kind_of?(Array)
  to_task   = array2tk_list(to_task)   if to_task.kind_of?(Array)

  tk_call(@chart, 'connect', from_task, to_task)
  self
end
            
font_of_part(keyword, newfont)
 
               # File tk/lib/tkextlib/tcllib/plotchart.rb, line 1335
def font_of_part(keyword, newfont)
  tk_call(@chart, 'font', keyword, newfont)
  self
end
            
hscroll(scr)
 
               # File tk/lib/tkextlib/tcllib/plotchart.rb, line 1344
def hscroll(scr)
  tk_call_without_enc(@chart, 'hscroll', scr)
  self
end
            
hscroll=(scr)
 
               # File tk/lib/tkextlib/tcllib/plotchart.rb, line 1340
def hscroll=(scr)
  tk_call_without_enc(@chart, 'hscroll', scr)
  scr
end
            
milestone(txt, time, col=None)
 
               # File tk/lib/tkextlib/tcllib/plotchart.rb, line 1306
def milestone(txt, time, col=None)
  tk_call(@chart, 'milestone', txt, time, col)
  self
end
            
summary(txt, tasks)
 
               # File tk/lib/tkextlib/tcllib/plotchart.rb, line 1324
def summary(txt, tasks)
  tasks = array2tk_list(tasks) if tasks.kind_of?(Array)
  tk_call(@chart, 'summary', tasks)
  self
end
            
task(txt, time_begin, time_end, completed=0.0)
 
               # File tk/lib/tkextlib/tcllib/plotchart.rb, line 1299
def task(txt, time_begin, time_end, completed=0.0)
  list(tk_call(@chart, 'task', txt, time_begin, time_end,
               completed)).collect!{|id|
    TkcItem.id2obj(self, id)
  }
end
            
vertline(txt, time)
 
               # File tk/lib/tkextlib/tcllib/plotchart.rb, line 1311
def vertline(txt, time)
  tk_call(@chart, 'vertline', txt, time)
  self
end
            
vscroll(scr)
 
               # File tk/lib/tkextlib/tcllib/plotchart.rb, line 1353
def vscroll(scr)
  tk_call_without_enc(@chart, 'vscroll', scr)
  self
end
            
vscroll=(scr)
 
               # File tk/lib/tkextlib/tcllib/plotchart.rb, line 1349
def vscroll=(scr)
  tk_call_without_enc(@chart, 'vscroll', scr)
  scr
end