class ListButtonHolder
this file is part of manqod manqod is distributed under the CDDL licence the author of manqod is Dobai-Pataky Balint(dpblnt@gmail.com)
Attributes
advanced_filter[R]
groups[R]
holder[R]
list_holder[R]
Public Class Methods
new(list_holder,orientation)
click to toggle source
# File lib/ListHolder/ListButtonHolder.rb, line 8 def initialize(list_holder,orientation) @list_holder=list_holder @list_id=nil @default=nil @groups=Hash.new set_orientation(orientation) # list_buttons.set_layout_style(Gtk::ButtonBox::SPREAD) list_holder.list.add_observer(self) end
Public Instance Methods
activate_default()
click to toggle source
# File lib/ListHolder/ListButtonHolder.rb, line 91 def activate_default @default.clicked if @default && !@list_holder.list.list_model.locked?(@list_holder.list.get_cursor_id) && @default.sensitive? end
set_orientation(new_orientation)
click to toggle source
# File lib/ListHolder/ListButtonHolder.rb, line 28 def set_orientation(new_orientation) unless new_orientation == @orientation @orientation = new_orientation @holder.remove(advanced_buttons).remove(list_buttons) unless @holder.nil? @holder.destroy unless @holder.nil? or @holder.destroyed? if advanced_buttons.nil? or advanced_buttons.destroyed? @advanced_buttons=Gtk::HBox.new.set_homogeneous(false) advanced_buttons.pack_start(@advanced_filter=AdvancedFilterButton.new(@list_holder)) advanced_buttons.pack_start(@sum_button=SumPanelButton.new(@list_holder)) advanced_buttons.pack_start(@legends_button=LegendsButton.new(@list_holder)) advanced_buttons.pack_start(@archive_button=ArchiveButton.new(@list_holder)) advanced_buttons.pack_start(@up_button=OrderingButton.new(@list_holder,Gtk::Stock::GO_UP)) advanced_buttons.pack_start(@down_button=OrderingButton.new(@list_holder,Gtk::Stock::GO_DOWN)) end case @orientation when Gtk::ORIENTATION_VERTICAL @holder=Gtk::VBox.new @list_buttons=Gtk::VBox.new#.set_homogeneous(false).set_layout_style(Gtk::ButtonBox::START) holder.pack_start(list_buttons,false,false,0) holder.pack_start(list_holder.info,true,true) holder.pack_start(advanced_buttons,false,false,0) else # when Gtk::ORIENTATION_HORIZONTAL @holder=Gtk::HBox.new @list_buttons=Gtk::HBox.new#.set_homogeneous(false).set_layout_style(Gtk::ButtonBox::END) holder.pack_start(advanced_buttons,false,false,0) holder.pack_start(list_holder.info,true,true) holder.pack_end(list_buttons,false,false,0) end load_buttons @holder.signal_connect('destroy'){|me| @holder.remove(list_holder.info) unless list_holder.info.destroyed? } end end
update(notifier,reload=false)
click to toggle source
# File lib/ListHolder/ListButtonHolder.rb, line 19 def update(notifier,reload=false) if notifier.list_id == @list_id && !reload list_buttons.each{|button| button.update(notifier)} else @list_id=notifier.list_id load_buttons end self end