Back to index

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

List of all members.

Public Member Functions

def __init__
def open
def close
def create_widgets
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 3 of file SearchDialogBase.py.


Constructor & Destructor Documentation

def idlelib.SearchDialogBase.SearchDialogBase.__init__ (   self,
  root,
  engine 
)

Reimplemented in idlelib.ReplaceDialog.ReplaceDialog.

Definition at line 9 of file SearchDialogBase.py.

00009 
00010     def __init__(self, root, engine):
00011         self.root = root
00012         self.engine = engine
00013         self.top = None

Here is the caller graph for this function:


Member Function Documentation

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

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 in idlelib.SearchDialog.SearchDialog.

Definition at line 34 of file SearchDialogBase.py.

00034 
00035     def create_widgets(self):
00036         top = Toplevel(self.root)
00037         top.bind("<Return>", self.default_command)
00038         top.bind("<Escape>", self.close)
00039         top.protocol("WM_DELETE_WINDOW", self.close)
00040         top.wm_title(self.title)
00041         top.wm_iconname(self.icon)
00042         self.top = top
00043 
00044         self.row = 0
00045         self.top.grid_columnconfigure(0, pad=2, weight=0)
00046         self.top.grid_columnconfigure(1, pad=2, minsize=100, weight=100)
00047 
00048         self.create_entries()
00049         self.create_option_buttons()
00050         self.create_other_buttons()
00051         return self.create_command_buttons()

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

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 
)

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 
)

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 
)

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.

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: