łň iëEc@s0dZddklZdefd„ƒYZdS(s This module documents a class that creates the margin spin button for the text editor's preference dialog. @author: Lateef Alabi-Oki @organization: The Scribes Project @copyright: Copyright Š 2005 Lateef Alabi-Oki @license: GNU GPLv2 or Later @contact: mystilleef@gmail.com i˙˙˙˙(t SpinButtontMarginSpinButtoncBsMeZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z RS(sŁ This class creates a spin button for the text editor's preference dialog. The spin button allows users to set the position of the right margin in the buffer. cCsŠti|ƒ|i||ƒ|iƒ|iid|iƒ|iid|iƒ|id|i ƒ|_ |i id|i ƒ|_ dS(sŘ Initialize the spin button. @param self: Reference to the MarginSpinButton instance. @type self: A MarginSpinButton object. @param editor: Reference to the text editor. @type editor: An Editor object. s/apps/scribes/margin_positions/apps/scribes/margins value-changedtdestroyN(Rt__init__t"_MarginSpinButton__init_attributest!_MarginSpinButton__set_propertiest_MarginSpinButton__clientt notify_addt$_MarginSpinButton__margin_changed_cbt_MarginSpinButton__margin_cbtconnectt#_MarginSpinButton__value_changed_cbt_MarginSpinButton__signal_id_1t_MarginSpinButton__managert_MarginSpinButton__destroy_cbt_MarginSpinButton__signal_id_2(tselftmanagerteditor((s'plugins/Preferences/MarginSpinButton.pyR)s  cCs2||_||_|i|_d|_|_dS(sĺ Initialize the button's data attributes. @param self: Reference to the MarginSpinButton instance. @type self: A MarginSpinButton object. @param editor: Reference to the text editor. @type editor: An Editor object. N(t_MarginSpinButton__editorR t gconf_clientRtNoneR R(RRR((s'plugins/Preferences/MarginSpinButton.pyt__init_attributes;s   cCs[d}|iidƒ}ddkl}||ƒo|iidƒ}nt}|iidƒ}ddkl}||ƒo|iidƒ}n|id|ƒ|idƒ|i dƒ|i dƒ|i d d ƒ|i d d ƒdd k l}|i|ƒ|itƒ|itƒ|i|ƒdd kl}|iii||ƒdS(s• Define the default behavior of the button. @param self: Reference to the MarginSpinButton instance. @type self: A MarginSpinButton object. iHs/apps/scribes/margin_positioni˙˙˙˙(ttruths/apps/scribes/margint sensitiveiiiiiČ(t UPDATE_ALWAYS(tmargin_spin_button_tipN(RtgettoperatorRtget_inttFalsetget_boolt set_propertytset_max_lengthtset_width_charst set_digitstset_incrementst set_rangetgtkRtset_update_policyt set_numerictTruetset_snap_to_tickst set_valuetSCRIBES.tooltipsRRttiptset_tip(Rtmargin_positiontvalueRt show_marginRR((s'plugins/Preferences/MarginSpinButton.pyt__set_propertiesKs0         cCs…d}|iidƒ}ddkl}||ƒo|iidƒ}nt|ƒt|iƒƒjo|it|ƒƒndS(s’ Handles callback when tab size changes. @param self: Reference to the MarginSpinButton instance. @type self: A MarginSpinButton object. iHs/apps/scribes/margin_positioni˙˙˙˙(RN(RRRRRtintt get_valueR+(Rtclienttcnxn_idtentrytdataR/R0R((s'plugins/Preferences/MarginSpinButton.pyt__margin_changed_cbks cCs€t}|iidƒ}ddkl}||ƒo|iidƒ}n|tjo|idtƒn|idtƒdS(s’ Handles callback when tab size changes. @param self: Reference to the MarginSpinButton instance. @type self: A MarginSpinButton object. s/apps/scribes/margini˙˙˙˙(RRN(RRRRRRR R)(RR5R6R7R8R1R0R((s'plugins/Preferences/MarginSpinButton.pyt __margin_cb{s  cCs‰t|iƒƒ}|iidƒ|jo'|iid|ƒ|iidƒnddkl}||}|ii i |ddƒt S(s[ Handles callback when the "value-changed" signal is emitted. @param self: Reference to the MarginSpinButton instance. @type self: A MarginSpinButton object. @param button: Reference to the MarginSpinButton. @type button: A MarginSpinButton object. @return: True to propagate signals to parent widgets. @type: A Boolean Object. s/apps/scribes/margin_positioni˙˙˙˙(tmsg0025tsucceedi( R3R4RRtset_inttnotifyti18nR;Rtfeedbacktupdate_status_messageR)(RtbuttonR/R;tmessage((s'plugins/Preferences/MarginSpinButton.pyt__value_changed_cbs  cCsZddkl}l}||i|ƒ||i|iƒ|iƒ||ƒ~d}dS(s Handles callback when the "destroy" signal is emitted. @param self: Reference to the MarginSpinButton instance. @type self: A MarginSpinButton object. @param manager: Reference to the PreferencesManager instance. @type manager: A PreferencesManager object. i˙˙˙˙(tdisconnect_signaltdelete_attributesN(t SCRIBES.utilsRERFR RR RR(RRRERF((s'plugins/Preferences/MarginSpinButton.pyt __destroy_cbŁs   ( t__name__t __module__t__doc__RRRRR R R(((s'plugins/Preferences/MarginSpinButton.pyR"s     N(RKR&RR(((s'plugins/Preferences/MarginSpinButton.pyss