class Tk::Tcllib::Plotchart::Timechart - tk-0.2.0 Documentation

# class Tk::Tcllib::Plotchart::Timechart

### Constants

TkCommandNames

### Public Class Methods

new(*args) click to toggle source
Calls superclass method

    # File lib/tkextlib/tcllib/plotchart.rb, line 1181
    def initialize(*args)
      # args := ([parent,] time_begin, time_end, items [, keys])
      # time_begin := String of time format (e.g. "1 january 2004")
      # time_end   := String of time format (e.g. "1 january 2004")
      # items := Expected/maximum number of items
      #          ( This determines the vertical spacing. )
      if args[0].kind_of?(String)
        @time_begin = args.shift
        @time_end   = args.shift
        @items      = args.shift

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

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

        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

hscroll(scr) click to toggle source

    # File lib/tkextlib/tcllib/plotchart.rb, line 1236
    def hscroll(scr)
      tk_call_without_enc(@chart, 'hscroll', scr)
      self
    end

hscroll=(scr) click to toggle source

    # File lib/tkextlib/tcllib/plotchart.rb, line 1232
    def hscroll=(scr)
      tk_call_without_enc(@chart, 'hscroll', scr)
      scr
    end

milestone(txt, time, col=None) click to toggle source

    # File lib/tkextlib/tcllib/plotchart.rb, line 1222
    def milestone(txt, time, col=None)
      tk_call(@chart, 'milestone', txt, time, col)
      self
    end

period(txt, time_begin, time_end, col=None) click to toggle source

    # File lib/tkextlib/tcllib/plotchart.rb, line 1217
    def period(txt, time_begin, time_end, col=None)
      tk_call(@chart, 'period', txt, time_begin, time_end, col)
      self
    end

vertline(txt, time) click to toggle source

    # File lib/tkextlib/tcllib/plotchart.rb, line 1227
    def vertline(txt, time)
      tk_call(@chart, 'vertline', txt, time)
      self
    end

vscroll(scr) click to toggle source

    # File lib/tkextlib/tcllib/plotchart.rb, line 1245
    def vscroll(scr)
      tk_call_without_enc(@chart, 'vscroll', scr)
      self
    end

vscroll=(scr) click to toggle source

    # File lib/tkextlib/tcllib/plotchart.rb, line 1241
    def vscroll=(scr)
      tk_call_without_enc(@chart, 'vscroll', scr)
      scr
    end

### Private Instance Methods

_create_chart() click to toggle source

    # File lib/tkextlib/tcllib/plotchart.rb, line 1210
    def _create_chart
      p self.class::TkCommandNames[1] if $DEBUG
      tk_call_without_enc(self.class::TkCommandNames[1], @path,
                          @time_begin, @time_end, @items)
    end