Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes | Static Public Attributes
idlelib.SearchDialog.SearchDialog Class Reference
Inheritance diagram for idlelib.SearchDialog.SearchDialog:
Inheritance graph
[legend]
Collaboration diagram for idlelib.SearchDialog.SearchDialog:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def create_widgets
def default_command
def find_again
def find_selection
def open
def close
def make_entry
def make_frame
def make_button
def create_entries
def create_option_buttons
def create_other_buttons
def create_command_buttons

Public Attributes

 root
 engine
 top
 text
 row
 ent
 buttonframe

Static Public Attributes

string title = "Search Dialog"
string icon = "Search"
int needwrapbutton = 1

Detailed Description

Definition at line 23 of file SearchDialog.py.


Member Function Documentation

def idlelib.SearchDialogBase.SearchDialogBase.close (   self,
  event = None 
) [inherited]

Reimplemented in idlelib.ReplaceDialog.ReplaceDialog, and idlelib.GrepDialog.GrepDialog.

Definition at line 29 of file SearchDialogBase.py.

00029 
00030     def close(self, event=None):
00031         if self.top:
00032             self.top.grab_release()
00033             self.top.withdraw()

Here is the caller graph for this function:

Reimplemented in idlelib.GrepDialog.GrepDialog, and idlelib.ReplaceDialog.ReplaceDialog.

Definition at line 133 of file SearchDialogBase.py.

00133 
00134     def create_command_buttons(self):
00135         #
00136         # place button frame on the right
00137         f = self.buttonframe = Frame(self.top)
00138         f.grid(row=0,column=2,padx=2,pady=2,ipadx=2,ipady=2)
00139 
00140         b = self.make_button("close", self.close)
00141         b.lower()

Reimplemented in idlelib.GrepDialog.GrepDialog, and idlelib.ReplaceDialog.ReplaceDialog.

Definition at line 78 of file SearchDialogBase.py.

00078 
00079     def create_entries(self):
00080         self.ent = self.make_entry("Find:", self.engine.patvar)

Definition at line 81 of file SearchDialogBase.py.

00081 
00082     def create_option_buttons(self):
00083         f = self.make_frame("Options")
00084 
00085         btn = Checkbutton(f, anchor="w",
00086                 variable=self.engine.revar,
00087                 text="Regular expression")
00088         btn.pack(side="left", fill="both")
00089         if self.engine.isre():
00090             btn.select()
00091 
00092         btn = Checkbutton(f, anchor="w",
00093                 variable=self.engine.casevar,
00094                 text="Match case")
00095         btn.pack(side="left", fill="both")
00096         if self.engine.iscase():
00097             btn.select()
00098 
00099         btn = Checkbutton(f, anchor="w",
00100                 variable=self.engine.wordvar,
00101                 text="Whole word")
00102         btn.pack(side="left", fill="both")
00103         if self.engine.isword():
00104             btn.select()
00105 
00106         if self.needwrapbutton:
00107             btn = Checkbutton(f, anchor="w",
00108                     variable=self.engine.wrapvar,
00109                     text="Wrap around")
00110             btn.pack(side="left", fill="both")
00111             if self.engine.iswrap():
00112                 btn.select()

Here is the call graph for this function:

Reimplemented in idlelib.GrepDialog.GrepDialog.

Definition at line 113 of file SearchDialogBase.py.

00113 
00114     def create_other_buttons(self):
00115         f = self.make_frame("Direction")
00116 
00117         #lbl = Label(f, text="Direction: ")
00118         #lbl.pack(side="left")
00119 
00120         btn = Radiobutton(f, anchor="w",
00121                 variable=self.engine.backvar, value=1,
00122                 text="Up")
00123         btn.pack(side="left", fill="both")
00124         if self.engine.isback():
00125             btn.select()
00126 
00127         btn = Radiobutton(f, anchor="w",
00128                 variable=self.engine.backvar, value=0,
00129                 text="Down")
00130         btn.pack(side="left", fill="both")
00131         if not self.engine.isback():
00132             btn.select()

Here is the call graph for this function:

Reimplemented from idlelib.SearchDialogBase.SearchDialogBase.

Definition at line 25 of file SearchDialog.py.

00025 
00026     def create_widgets(self):
00027         f = SearchDialogBase.create_widgets(self)
00028         self.make_button("Find", self.default_command, 1)

Here is the call graph for this function:

def idlelib.SearchDialog.SearchDialog.default_command (   self,
  event = None 
)

Definition at line 29 of file SearchDialog.py.

00029 
00030     def default_command(self, event=None):
00031         if not self.engine.getprog():
00032             return
00033         if self.find_again(self.text):
00034             self.close()

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 35 of file SearchDialog.py.

00035 
00036     def find_again(self, text):
00037         if not self.engine.getpat():
00038             self.open(text)
00039             return False
00040         if not self.engine.getprog():
00041             return False
00042         res = self.engine.search_text(text)
00043         if res:
00044             line, m = res
00045             i, j = m.span()
00046             first = "%d.%d" % (line, i)
00047             last = "%d.%d" % (line, j)
00048             try:
00049                 selfirst = text.index("sel.first")
00050                 sellast = text.index("sel.last")
00051                 if selfirst == first and sellast == last:
00052                     text.bell()
00053                     return False
00054             except TclError:
00055                 pass
00056             text.tag_remove("sel", "1.0", "end")
00057             text.tag_add("sel", first, last)
00058             text.mark_set("insert", self.engine.isback() and first or last)
00059             text.see("insert")
00060             return True
00061         else:
00062             text.bell()
00063             return False

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 64 of file SearchDialog.py.

00064 
00065     def find_selection(self, text):
00066         pat = text.get("sel.first", "sel.last")
00067         if pat:
00068             self.engine.setcookedpat(pat)
00069         return self.find_again(text)

Here is the call graph for this function:

def idlelib.SearchDialogBase.SearchDialogBase.make_button (   self,
  label,
  command,
  isdef = 0 
) [inherited]

Definition at line 69 of file SearchDialogBase.py.

00069 
00070     def make_button(self, label, command, isdef=0):
00071         b = Button(self.buttonframe,
00072                    text=label, command=command,
00073                    default=isdef and "active" or "normal")
00074         cols,rows=self.buttonframe.grid_size()
00075         b.grid(pady=1,row=rows,column=0,sticky="ew")
00076         self.buttonframe.grid(rowspan=rows+1)
00077         return b

Here is the caller graph for this function:

def idlelib.SearchDialogBase.SearchDialogBase.make_entry (   self,
  label,
  var 
) [inherited]

Definition at line 52 of file SearchDialogBase.py.

00052 
00053     def make_entry(self, label, var):
00054         l = Label(self.top, text=label)
00055         l.grid(row=self.row, column=0, sticky="nw")
00056         e = Entry(self.top, textvariable=var, exportselection=0)
00057         e.grid(row=self.row, column=1, sticky="nwe")
00058         self.row = self.row + 1
00059         return e

def idlelib.SearchDialogBase.SearchDialogBase.make_frame (   self,
  labeltext = None 
) [inherited]

Definition at line 60 of file SearchDialogBase.py.

00060 
00061     def make_frame(self,labeltext=None):
00062         if labeltext:
00063             l = Label(self.top, text=labeltext)
00064             l.grid(row=self.row, column=0, sticky="nw")
00065         f = Frame(self.top)
00066         f.grid(row=self.row, column=1, columnspan=1, sticky="nwe")
00067         self.row = self.row + 1
00068         return f

Here is the caller graph for this function:

def idlelib.SearchDialogBase.SearchDialogBase.open (   self,
  text,
  searchphrase = None 
) [inherited]

Definition at line 14 of file SearchDialogBase.py.

00014 
00015     def open(self, text, searchphrase=None):
00016         self.text = text
00017         if not self.top:
00018             self.create_widgets()
00019         else:
00020             self.top.deiconify()
00021             self.top.tkraise()
00022         if searchphrase:
00023             self.ent.delete(0,"end")
00024             self.ent.insert("end",searchphrase)
00025         self.ent.focus_set()
00026         self.ent.selection_range(0, "end")
00027         self.ent.icursor(0)
00028         self.top.grab_set()


Member Data Documentation

Definition at line 136 of file SearchDialogBase.py.

Definition at line 11 of file SearchDialogBase.py.

Definition at line 79 of file SearchDialogBase.py.

Reimplemented in idlelib.GrepDialog.GrepDialog, and idlelib.ReplaceDialog.ReplaceDialog.

Definition at line 6 of file SearchDialogBase.py.

Reimplemented in idlelib.GrepDialog.GrepDialog.

Definition at line 7 of file SearchDialogBase.py.

Definition at line 10 of file SearchDialogBase.py.

Definition at line 43 of file SearchDialogBase.py.

Definition at line 15 of file SearchDialogBase.py.

string idlelib.SearchDialogBase.SearchDialogBase.title = "Search Dialog" [static, inherited]

Reimplemented in idlelib.GrepDialog.GrepDialog, and idlelib.ReplaceDialog.ReplaceDialog.

Definition at line 5 of file SearchDialogBase.py.

Definition at line 12 of file SearchDialogBase.py.


The documentation for this class was generated from the following file: