3 # A base class which all APMS windows inherit from which handles
4 # stuff like saving it's last position on close, and adding itself
5 # to the system wide navigator menu and such.
8 # Perish the thought! Those are _features_!
11 # Andrew McMillan <andrew@mcmillan.net.nz>
14 # Copyright (c) Andrew McMillan, 2007
15 # GNU General Public License version 2
18 class ApmsButton < Gtk::Button
22 # Creates a button, based on the DB row passed in
28 attr_reader :linktype, :source, :target, :row
31 set_label(row["buttonlabel"])
33 @source = row["source"]
34 @target = row["target"]
35 @linktype = row["linktype"]
36 puts row["buttonlabel"] + " added: targetted at >>#{@target}<<, type >>#{@linktype}<<"
38 signal_connect("clicked") do |button|
39 puts button.label + " clicked"
40 if button.linktype == "MNU" then
41 puts "Clicked Menu button >>#{button.label}<< targetted at >>#{button.target}<<"
42 new_window = ApmsMenuWindow.new( button.label )
43 new_window.set_target(button.target)
44 elsif button.linktype == "DRL" then
45 puts "Clicked Drill button >>#{button.label}<< targetted at >>#{button.target}<<"
46 new_window = ApmsDrillWindow.new( button.label )
47 new_window.set_target(button.target)
48 new_window.set_source(button.source)
50 new_window = ApmsWindow.new( button.label )