Class: ItemTextAlignment

Inherits:
Gtk::HBox
  • Object
show all
Includes:
ManqodCommon
Defined in:
lib/PrintEditor/ItemInfo/ItemTextAlignment.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 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

#initializeItemTextAlignment

Returns a new instance of ItemTextAlignment.



7
8
9
10
11
12
13
14
15
# File 'lib/PrintEditor/ItemInfo/ItemTextAlignment.rb', line 7

def initialize
	super()
	pack_start(@left=Gtk::RadioButton.new("left").set_draw_indicator(false))
	pack_start(@center=Gtk::RadioButton.new(@left,"center").set_draw_indicator(false))
	pack_start(@right=Gtk::RadioButton.new(@left,"right").set_draw_indicator(false))
	@left.signal_connect("toggled"){|me| @item.set_text_alignment("left") if @left.active? }
	@center.signal_connect("toggled"){|me| @item.set_text_alignment("center") if me.active? }
	@right.signal_connect("toggled"){|me| @item.set_text_alignment("right") if me.active? }
end

Instance Attribute Details

#itemObject (readonly)

Returns the value of attribute item.



16
17
18
# File 'lib/PrintEditor/ItemInfo/ItemTextAlignment.rb', line 16

def item
  @item
end

#updatedObject (readonly)

Returns the value of attribute updated.



16
17
18
# File 'lib/PrintEditor/ItemInfo/ItemTextAlignment.rb', line 16

def updated
  @updated
end

Instance Method Details

#update(item) ⇒ Object



17
18
19
20
21
22
23
24
25
# File 'lib/PrintEditor/ItemInfo/ItemTextAlignment.rb', line 17

def update(item)
	@item=item
	case @item.text_alignment
		when "right" then @right.set_active(true)
		when "center" then @center.set_active(true)
		else @left.set_active(true)
	end
	self
end