class Vizkit::LogAnnotationItem

Attributes

annotation[R]

Public Class Methods

new(annotation,options = Hash.new) click to toggle source
Calls superclass method Vizkit::VizkitItem.new
# File lib/vizkit/vizkit_items.rb, line 1002
def initialize(annotation,options = Hash.new)
    super()
    @options = Kernel.validate_options options,:item_type => :label
    @annotation = annotation
    if @options[:item_type] == :label
        setText annotation.stream.name
        appendRow [VizkitItem.new("Samples"),VizkitItem.new(annotation.samples.size.to_s)]
    else
        setText annotation.stream.type_name
    end
end

Public Instance Methods

context_menu(pos,parent_widget,items = []) click to toggle source
# File lib/vizkit/vizkit_items.rb, line 1014
def context_menu(pos,parent_widget,items = [])
    widget_name = Vizkit::ContextMenu.widget_for(Orocos::Log::Annotations,parent_widget,pos)
    if widget_name
        widget = Vizkit.default_loader.create_plugin(widget_name)
        fct = widget.plugin_spec.find_callback!(:argument => Orocos::Log::Annotations,:callback_type => :display)
        fct = fct.bind(widget)
        fct.call(annotation)
        widget.setAttribute(Qt::WA_QuitOnClose, false) if widget.is_a? Qt::Widget
        widget.show
    end
end