PNG  IHDR;IDATxܻn0K )(pA 7LeG{ §㻢|ذaÆ 6lذaÆ 6lذaÆ 6lom$^yذag5bÆ 6lذaÆ 6lذa{ 6lذaÆ `}HFkm,mӪôô! x|'ܢ˟;E:9&ᶒ}{v]n&6 h_tڠ͵-ҫZ;Z$.Pkž)!o>}leQfJTu іچ\X=8Rن4`Vwl>nG^is"ms$ui?wbs[m6K4O.4%/bC%t Mז -lG6mrz2s%9s@-k9=)kB5\+͂Zsٲ Rn~GRC wIcIn7jJhۛNCS|j08yiHKֶۛkɈ+;SzL/F*\Ԕ#"5m2[S=gnaPeғL lذaÆ 6l^ḵaÆ 6lذaÆ 6lذa; _ذaÆ 6lذaÆ 6lذaÆ RIENDB`  pYa@s|dZddlmZmZmZmZmZmZmZGdddZ e dkrxddl Z e j ddd dS) zBDefine SearchDialogBase used by Search, Replace, and Grep dialogs.)ToplevelFrameEntryLabelButton Checkbutton Radiobuttonc@seZdZdZdZdZdZddZddd Zdd d Z d d Z ddZ ddZ dddZ ddZddZdddZddZdS)SearchDialogBaseayCreate most of a 3 or 4 row, 3 column search dialog. The left and wide middle column contain: 1 or 2 labeled text entry lines (make_entry, create_entries); a row of standard Checkbuttons (make_frame, create_option_buttons), each of which corresponds to a search engine Variable; a row of dialog-specific Check/Radiobuttons (create_other_buttons). The narrow right column contains command buttons (make_button, create_command_buttons). These are bound to functions that execute the command. Except for command buttons, this base class is not limited to items common to all three subclasses. Rather, it is the Find dialog minus the "Find Next" command, its execution function, and the default_command attribute needed in create_widgets. The other dialogs override attributes and methods, the latter to replace and add widgets. z Search DialogZSearchcCs||_||_d|_dS)a'Initialize root, engine, and top attributes. top (level widget): set in create_widgets() called from open(). text (Text searched): set in open(), only used in subclasses(). ent (ry): created in make_entry() called from create_entry(). row (of grid): 0 in create_widgets(), +1 in make_entry/frame(). default_command: set in subclasses, used in create_widgers(). title (of dialog): class attribute, override in subclasses. icon (of dialog): ditto, use unclear if cannot minimize dialog. N)rootenginetop)selfr r r//opt/python35/lib/python3.5/SearchDialogBase.py__init__s  zSearchDialogBase.__init__NcCs||_|js|jn|jj|jj|re|jjdd|jjd||jj|jj dd|jj d|jj dS)z6Make dialog visible on top of others and ready to use.rendN) textr create_widgetsZ deiconifyZtkraiseentdeleteinsertZ focus_setZselection_rangeZicursorZgrab_set)rrZ searchphraserrropen/s      zSearchDialogBase.opencCs'|jr#|jj|jjdS)zPut dialog away for later use.N)r Z grab_releaseZwithdraw)reventrrrclose?s  zSearchDialogBase.closecCst|j}|jd|j|jd|j|jd|j|j|j|j|j ||_ d|_ |j j ddddd|j j dddd d dd |j |j|j|jd S) zCreate basic 3 row x 3 col search (find) dialog. Other dialogs override subsidiary create_x methods as needed. Replace and Find-in-Files add another entry row. zzZWM_DELETE_WINDOWrZpadZweightr ZminsizedN)rr bindZdefault_commandrprotocolZwm_titletitleZ wm_iconnameiconr rowZgrid_columnconfigurecreate_entriescreate_option_buttonscreate_other_buttonscreate_command_buttons)rr rrrrEs  "   zSearchDialogBase.create_widgetscCst|jd|}|jd|jddddt|jd|dd}|jd|jdd dd |jd |_||fS) zReturn (entry, label), . entry - gridded labeled Entry for text entry. label - Label widget, returned for testing. rr!columnrstickynwZ textvariableZexportselectionr nwe)rr gridr!r)rZ label_textvarlabelentryrrr make_entry\s zSearchDialogBase.make_entrycCs#|jd|jjd|_dS)z/Create one or more entry lines with make_entry.zFind:rN)r.r Zpatvarr)rrrrr"iszSearchDialogBase.create_entriesc Cs|r=t|jd|}|jd|jddddnd}t|j}|jd|jddd ddd |jd|_||fS) zReturn (frame, label). frame - gridded labeled Frame for option or other buttons. label - Label widget, returned for testing. rr!r&rr'r(r Z columnspanr))rr r*r!r)rZ labeltextr,framerrr make_framems"%zSearchDialogBase.make_framec Cs|jdd}|j}|jdf|jdf|jdfg}|jre|j|jdfx^|D]V\}}t|ddd |d |}|j d d d d|j rl|j qlW||fS)aReturn (filled frame, options) for testing. Options is a list of SearchEngine booleanvar, label pairs. A gridded frame from make_frame is filled with a Checkbutton for each pair, bound to the var, with the corresponding label. ZOptionsrzRegular expressionz Match casez Whole wordz Wrap aroundanchorwvariablersideleftfillboth) r1r ZrevarZcasevarZwordvarneedwrapbuttonappendZwrapvarrpackgetselect)rr0r optionsr+r,btnrrrr#}s     z&SearchDialogBase.create_option_buttonsc Cs|jdd}|jj}ddg}xj|D]b\}}t|ddd|d |d |}|jd d d d|j|kr2|jq2W||fS)zReturn (frame, others) for testing. Others is a list of value, label pairs. A gridded frame from make_frame is filled with radio buttons. Z Directionrr UpDownr2r3r4valuerr5r6r7r8)r r@)rrA)r1r Zbackvarrr;r<r=)rr0r+Zothersvalr,r?rrrr$s  z%SearchDialogBase.create_other_buttonsrc Cst|jd|d|d|r$dp'd}|jj\}}|jddd|d d d d |jjd |d|S)z/Return command button gridded in command frame.rcommanddefaultZactiveZnormalpadyr r!r&rr'ZewZrowspan)r buttonframeZ grid_sizer*)rr,rDZisdefbZcolsZrowsrrr make_buttons  "zSearchDialogBase.make_buttonc Csgt|j}|_|jdddddddddddd|jd |j}|jd S) z9Place buttons in vertical command frame gridded on right.r!rr&rZpadxrFZipadxZipadyrN)rr rGr*rIrlower)rfrHrrrr%s.z'SearchDialogBase.create_command_buttons)__name__ __module__ __qualname____doc__rr r9rrrrr.r"r1r#r$rIr%rrrrr s       r __main__Nz'idlelib.idle_test.test_searchdialogbase verbosityr) rOtkinterrrrrrrrr rLZunittestmainrrrrs 4