Class: BarMenuItem

Inherits:
Gtk::ImageMenuItem
  • Object
show all
Includes:
Conf, ManqodCommon
Defined in:
lib/BarMenu/BarMenuItem.rb

Overview

this file is part of manqod manqod is distributed under the CDDL licence the author of manqod is Dobai-Pataky Balint([email protected])

Constant Summary

Constants included from ManqodCommon

ManqodCommon::CRITICAL, ManqodCommon::DEBUG, ManqodCommon::ERROR, ManqodCommon::INFO, ManqodCommon::NORMAL, ManqodCommon::WARNING

Constants included from Eprint

Eprint::DOMAIN, Eprint::LEVEL

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Conf

#get_conf, #load_conf, #save_conf, #set_conf

Methods included from ManqodCommon

#add_where, #admin, #admin_cache, #admin_qrow, #admin_rows, #backtrace_to_debug, #cache, #changed_ids_of_base, #client, #client_fields, #client_image_of_id, #client_qrow, #client_query, #client_rows, #eeval, #escape_string, #getBinding, #guess_base, #guess_table, #image_of_id, #lzero, #manqod_db, #measure, #myexec, #nick, #nick_id, #number_format, #qrow, #query, #reconnect_manqod_db, #rows, #run_events, #send_message, #sendmail, #set_manqod_db_uri, #set_nick

Methods included from Eprint

#ecode, #edebug, #eerror, #einfo, #enormal, #eprint, #ewarn, #gtk_set_edebug, #set_edebug, #tell_exception

Constructor Details

#initialize(menubar, iid) ⇒ BarMenuItem

Returns a new instance of BarMenuItem.



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/BarMenu/BarMenuItem.rb', line 9

def initialize(menubar,iid)
  @menubar=menubar
  @id=iid
  if row=admin.qrow("select gtkmenu.*,
    modules.modname
    from gtkmenu 
    left join modules on gtkmenu.module = modules.id
    where gtkmenu.id='#{id}'")
    @modname=row["modname"]
    if row["module"].to_i == -1
      @target=nil
      else
      @target=row['target'] 
    end
  end
  @text=row['display']
  super(text)
  set_image(Gtk::Image.new(image_of_id(row['imageid'].to_i,"gtk-menu")))
  child.modify_font(Pango::FontDescription.new(get_conf(0,0,"bar-menu-font")))
  signal_connect("activate"){
    edebug("menuitem #{id} #{target} emiting signal","menu","debug")
    @menubar.update(self)
  }
  self
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



35
36
37
# File 'lib/BarMenu/BarMenuItem.rb', line 35

def id
  @id
end

#modnameObject

Returns the value of attribute modname.



36
37
38
# File 'lib/BarMenu/BarMenuItem.rb', line 36

def modname
  @modname
end

#targetObject

Returns the value of attribute target.



34
35
36
# File 'lib/BarMenu/BarMenuItem.rb', line 34

def target
  @target
end

#textObject

Returns the value of attribute text.



37
38
39
# File 'lib/BarMenu/BarMenuItem.rb', line 37

def text
  @text
end

Instance Method Details

#inspectObject



39
40
41
# File 'lib/BarMenu/BarMenuItem.rb', line 39

def inspect
  "SubMenuItem(#{id},#{text})"
end

#to_sObject



42
43
44
# File 'lib/BarMenu/BarMenuItem.rb', line 42

def to_s
  inspect
end