File "SearchDialogBase.cpython-34.pyc"

Full Path: /home/attunedd/public_html/byp/izo/con7ext_sym404/rintoar.txt/opt/alt/python34/lib64/python3.4/idlelib/__pycache__/SearchDialogBase.cpython-34.pyc
File size: 7.53 KB
MIME-type: text/x-bytecode.python
Charset: 8 bit


e fa@sdZddlmZmZmZmZmZmZmZGdddZ	e
dkr{ddlZejddd	ndS)
zBDefine SearchDialogBase used by Search, Replace, and Grep dialogs.)ToplevelFrameEntryLabelButtonCheckbuttonRadiobuttonc@seZdZdZdZdZdZddZddd	Zdd
dZ	dd
Z
ddZddZ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)selfrrr=/opt/alt/python34/lib64/python3.4/idlelib/SearchDialogBase.py__init__s		zSearchDialogBase.__init__NcCs||_|js|jn|jj|jj|rh|jjdd|jjd|n|jj|jj	dd|jj
d|jjdS)z6Make dialog visible on top of others and ready to use.rendN)textr
create_widgetsZ	deiconifyZtkraiseentZdeleteinsertZ	focus_setZselection_rangeZicursorZgrab_set)rrZsearchphraserrropen/s		



zSearchDialogBase.opencCs*|jr&|jj|jjndS)zPut dialog away for later use.N)r
Zgrab_releaseZwithdraw)rZeventrrrclose?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|jdS)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.
        z<Return>z<Escape>ZWM_DELETE_WINDOWrZpadZweightr
ZminsizedN)rrZbindZdefault_commandrZprotocolZwm_titletitleZwm_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.
        rrcolumnrstickynwZtextvariableZexportselectionr
nwe)rr
gridrr)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)rrrrriszSearchDialogBase.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.
        rrr"rr#r$r
Z
columnspanr%)rr
r&rr)rZ	labeltextr(framerrr
make_framems"%zSearchDialogBase.make_framec	Cs|jdd}|j}|jdf|jdf|jdfg}|jrh|j|jdfnxa|D]Y\}}t|ddd	|d
|}|j	ddd
d|j
ro|jqoqoW||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 wordzWrap aroundanchorwvariablersideleftfillboth)r-rZrevarZcasevarZwordvarneedwrapbuttonappendZwrapvarrpackgetselect)rr,rZoptionsr'r(btnrrrr}s		z&SearchDialogBase.create_option_buttonscCs|jdd}|jj}ddg}xm|D]e\}}t|ddd|d	|d
|}|jddd
d|j|kr2|jq2q2W||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
UpDownr.r/r0valuerr1r2r3r4)r
r;)rr<)r-rZbackvarrr7r8r9)rr,r'Zothersvalr(r:rrrr sz%SearchDialogBase.create_other_buttonsrc	Cst|jd|d|d|r$dp'd}|jj\}}|jddd|d	d
dd|jjd
|d|S)z/Return command button gridded in command frame.rcommanddefaultZactiveZnormalpadyr
rr"rr#ZewZrowspan)rbuttonframeZ	grid_sizer&)rr(r?ZisdefbZcolsZrowsrrrmake_buttons"zSearchDialogBase.make_buttonc
Csgt|j}|_|jdddddddddddd|jd	|j}|jd
S)z9Place buttons in vertical command frame gridded on right.rrr"rZpadxrAZipadxZipadyrN)rr
rBr&rDrlower)rfrCrrrr!s.z'SearchDialogBase.create_command_buttons)__name__
__module____qualname____doc__rrr5rrrrr*rr-rr rDr!rrrrr	s

r	__main__Nz'idlelib.idle_test.test_searchdialogbase	verbosityr)
rJZtkinterrrrrrrrr	rGZunittestmainrrrr<module>s4