eSrSSKJr SSKJrJrJrJrJrJ r SSK J r "SS5r "SS\ 5r \S :XaSS KJr \"S S S S9 SSKJr \"\ 5 gg)zBDefine SearchDialogBase used by Search, Replace, and Grep dialogs.)Toplevel)FrameEntryLabelButton Checkbutton Radiobutton) _setup_dialogcv\rSrSrSrSrSrSrSrSSjr SS jr S r S r S r SS jrSrSrSSjrSrSrg)SearchDialogBasea=Create 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 DialogSearchcLXlURUlX lSUlg)aInitialize root, engine, and top attributes. top (level widget): set in create_widgets() called from open(). frame: container for all widgets in dialog. 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_widgets(). title (of dialog): class attribute, override in subclasses. icon (of dialog): ditto, use unclear if cannot minimize dialog. N)rootbellenginetop)selfrrs 8/opt/imh/python3.13/lib/python3.13/idlelib/searchbase.py__init__SearchDialogBase.__init__!s  II  NcbXlUR(dUR5 O4URR5 URR 5 URR UR 55 U(a8URRSS5 URRSU5 URR5 URRSS5 URRS5 URR5 g)z6Make dialog visible on top of others and ready to use.rendN)textrcreate_widgets deiconifytkraise transientwinfo_toplevelentdeleteinsert focus_setselection_rangeicursorgrab_set)rr searchphrases ropenSearchDialogBase.open3s xx    ! HH   HH    4..01  HHOOAe $ HHOOE, /    E*  rcUR(aPURR5 URRS5 URR5 gg)zPut dialog away for later use.N)r grab_releaser withdraw)revents rcloseSearchDialogBase.closeDs@ 88 HH ! ! # HH  r " HH    rc[UR5nURSUR5 URSUR5 UR SUR5 UR UR5 URUR5 [U5 Xl [USS9Ul URRSS9 URSS S 9 UR!SS S 9 SUlURRSS SS 9 URRS S S S S9 UR%5 UR'5 UR)5 UR+5 g)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. zzWM_DELETE_WINDOW)paddingnwes)stickyrd)weight)padr:r)r<minsizer:N)rrbinddefault_commandr1protocolwm_titletitle wm_iconnameiconr rrframegridgrid_columnconfiguregrid_rowconfigurerowcreate_entriescreate_option_buttonscreate_other_buttonscreate_command_buttons)rrs rrSearchDialogBase.create_widgetsKs) tyy! T112 TZZ( '4 TZZ   "c3*  v&   3 / a, ''q'; ''q#c'J  ""$ !!# ##%rc[URUS9nURURSSS9 [ URUSS9nURURSSS9 URS-UlXC4$)ztReturn (entry, label), . entry - gridded labeled Entry for text entry. label - Label widget, returned for testing. rrnwrIcolumnr8) textvariableexportselectionrnwe)rrErFrIr)r label_textvarlabelentrys r make_entrySearchDialogBase.make_entrygsi djjz2 txx$ 7djjsAF txx% 888a<|rc`URSURR5SUlg)z/Create one or more entry lines with make_entry.zFind:rN)r[rpatvarr")rs rrJSearchDialogBase.create_entriests#??7DKK,>,>?BrcU(a0[URUS9nURURSSS9 OSn[ UR5nURURSSSS9 URS-UlX24$) zReturn (frame, label). frame - gridded labeled Frame for option or other buttons. label - Label widget, returned for testing. rPrrQrRr-rrV)rIrS columnspanr8)rrErFrIr)r labeltextrYrEs r make_frameSearchDialogBase.make_framexso $**95E JJ488AdJ ;Edjj! txxa F88a<|rc@URS5SnURnURS4URS4URS4/nUR (aUR URS45 UHupE[XUS9nURSS S 9 M! X4$) zReturn (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. OptionsrzRegular expressionz Match casez Whole wordz Wrap around)variablerleftbothsidefill) rcrrevarcasevarwordvarneedwrapbuttonappendwrapvarrpack)rrEroptionsrXrYbtns rrK&SearchDialogBase.create_option_buttonss *1-LL"67NNL1NNL13    NNFNNM: ;!JCe>C HH&vH ."~rcURS5SnURRnSS/nUHupE[XXES9nUR SSS9 M! X4$) zReturn (frame, others) for testing. Others is a list of value, label pairs. A gridded frame from make_frame is filled with radio buttons. Directionr)rUp)rDown)rgvaluerrhrirj)rcrbackvarr rs)rrErXothersvalrYrus rrL%SearchDialogBase.create_other_buttonssb  ,Q/kk!![) JCeIC HH&vH .!}rc[URXU=(a S=(d SS9nURR5upVURSUSSS9 URRUS-S9 U$) z/Return command button gridded in command frame.activenormal)rcommanddefaultrrew)padyrIrSr8)rowspan)r buttonframe grid_sizerF)rrYrisdefbcolsrowss r make_buttonSearchDialogBase.make_buttonsp 4## -X9 ;"",,.  A$at4 d1f-rc [UR5=olURSSSSSSS9 UR SUR 5nUR 5 g)z9Place buttons in vertical command frame gridded on right.rr;)rIrSpadxripadxipadyCloseN)rrErrFrr1lower)rfrs rrM'SearchDialogBase.create_command_buttonssM$TZZ00  1A1!!!<   Wdjj 1  r) rrrr"rErrIrrN)r)__name__ __module__ __qualname____firstlineno____doc__rBrDrprr*r1rr[rJrcrKrLrrM__static_attributes__rrr r sP( E DN$" &8 C & rr c$\rSrSrSrSrSrSrg) _searchbasez3Create auto-opening dialog with no text connection.c bSSKnSSKJn XlUR U5UlUR 5 [UR55 [[[URSUR5555upEpgURRSUS-US-4-5 g)Nr) searchenginez[x+]z+%d+%d()reidlelibrrgetrrprintgeometrylistmapintsplitr)rparentrrwidthheightxys rr_searchbase.__init__s( "&&v.   foo  S"((66??;L*M!NOa (a"fa#g%667rcgrr)rdummys rr?_searchbase.default_commandsdr)rrN)rrrrrrr?rrrrrrs9 8+rr__main__)mainz!idlelib.idle_test.test_searchbaser;F) verbosityexit)runN)rtkinterr tkinter.ttkrrrrrr tkinter.simpledialogr r rrunittestridlelib.idle_test.htestrrrrrsXHMM.qqh+"+" z ,F+  r