本文整理汇总了Python中tkinter.ttk.Frame.focus_set方法的典型用法代码示例。如果您正苦于以下问题:Python Frame.focus_set方法的具体用法?Python Frame.focus_set怎么用?Python Frame.focus_set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tkinter.ttk.Frame
的用法示例。
在下文中一共展示了Frame.focus_set方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from tkinter.ttk import Frame [as 别名]
# 或者: from tkinter.ttk.Frame import focus_set [as 别名]
def __init__(self, mainWin, options):
self.mainWin = mainWin
parent = mainWin.parent
super(DialogNewFactItemOptions, self).__init__(parent)
self.parent = parent
self.options = options
parentGeometry = re.match("(\d+)x(\d+)[+]?([-]?\d+)[+]?([-]?\d+)", parent.geometry())
dialogX = int(parentGeometry.group(3))
dialogY = int(parentGeometry.group(4))
self.accepted = False
self.transient(self.parent)
self.title(_("New Fact Item Options"))
frame = Frame(self)
frame.focus_set()
label(frame, 1, 1, "Entity scheme:")
self.cellEntityIdentScheme = gridCell(frame, 2, 1, getattr(options,"entityIdentScheme",""), width=50)
ToolTip(self.cellEntityIdentScheme, text=_("Enter the scheme for the context entity identifier"), wraplength=240)
label(frame, 1, 2, "Entity identifier:")
self.cellEntityIdentValue = gridCell(frame, 2, 2, getattr(options,"entityIdentValue",""))
ToolTip(self.cellEntityIdentValue, text=_("Enter the entity identifier value (e.g., stock ticker)"), wraplength=240)
label(frame, 1, 3, "Start date:")
self.cellStartDate = gridCell(frame, 2, 3, getattr(options,"startDate",""))
ToolTip(self.cellStartDate, text=_("Enter the start date for the report period (e.g., 2010-01-01)"), wraplength=240)
label(frame, 1, 4, "End date:")
self.cellEndDate = gridCell(frame, 2, 4, getattr(options,"endDate",""))
ToolTip(self.cellEndDate, text=_("Enter the end date for the report period (e.g., 2010-12-31)"), wraplength=240)
label(frame, 1, 5, "Monetary unit:")
self.cellMonetaryUnit = gridCombobox(frame, 2, 5, getattr(options,"monetaryUnit",""), values=monetaryUnits)
ToolTip(self.cellMonetaryUnit, text=_("Select a monetary unit (e.g., EUR)"), wraplength=240)
label(frame, 1, 6, "Monetary decimals:")
self.cellMonetaryDecimals = gridCell(frame, 2, 6, getattr(options,"monetaryDecimals","2"))
ToolTip(self.cellMonetaryDecimals, text=_("Enter decimals for monetary items"), wraplength=240)
label(frame, 1, 7, "Non-monetary decimals:")
self.cellNonMonetaryDecimals = gridCell(frame, 2, 7, getattr(options,"nonMonetaryDecimals","0"))
ToolTip(self.cellNonMonetaryDecimals, text=_("Enter decimals for non-monetary items (e.g., stock shares)"), wraplength=240)
cancelButton = Button(frame, text=_("Cancel"), width=8, command=self.close)
ToolTip(cancelButton, text=_("Cancel operation, discarding changes and entries"))
okButton = Button(frame, text=_("OK"), width=8, command=self.ok)
ToolTip(okButton, text=_("Accept the options as entered above"))
cancelButton.grid(row=8, column=1, columnspan=3, sticky=E, pady=3, padx=3)
okButton.grid(row=8, column=1, columnspan=3, sticky=E, pady=3, padx=86)
frame.grid(row=0, column=0, sticky=(N,S,E,W))
frame.columnconfigure(2, weight=1)
window = self.winfo_toplevel()
window.columnconfigure(0, weight=1)
self.geometry("+{0}+{1}".format(dialogX+50,dialogY+100))
#self.bind("<Return>", self.ok)
#self.bind("<Escape>", self.close)
self.protocol("WM_DELETE_WINDOW", self.close)
self.grab_set()
self.wait_window(self)
示例2: __init__
# 需要导入模块: from tkinter.ttk import Frame [as 别名]
# 或者: from tkinter.ttk.Frame import focus_set [as 别名]
def __init__(self, mainWin):
self.mainWin = mainWin
parent = mainWin
super(DialogNewFileOptions, self).__init__(parent)
self.parent = parent
parentGeometry = re.match("(\d+)x(\d+)[+]?([-]?\d+)[+]?([-]?\d+)", parent.geometry())
dialogX = int(parentGeometry.group(3))
dialogY = int(parentGeometry.group(4))
self.accepted = False
self.ebaTaxonomyVersion = EBA_TAXONOMY_DEFAULT_VERSION
self.ebaReportingType = EBA_REPORTING_TYPE_DEFAULT
self.setEntryPoints()
self.ebaEntryPointKey = self.ebaEntryPointValues[0]
self.options = EbaNewFileOptions(self.ebaTaxonomyVersion, self.ebaReportingType,
self.ebaEntryPointValues[0])
options = self.options
self.transient(self.parent)
self.title(_("New EBA File"))
frame = Frame(self)
frame.focus_set()
label(frame, 1, 1, _("Taxonomy version:"))
self.cellTaxonomyVersion = gridCombobox(frame, 2, 1, getattr(options,"ebaTaxonomyVersion", ""),
values=EBA_TAXONOMY_VERSIONS_VALUES,
comboboxselected = self.onTaxonomyVersionChanged,
width=40)
ToolTip(self.cellTaxonomyVersion, text=_("Select a taxonomy version"), wraplength=240)
label(frame, 1, 2, _("EBA reporting type:"))
self.cellReportType = gridCombobox(frame, 2, 2, getattr(options,"ebaReportingType", ""),
values=EBA_REPORTING_TYPES_VALUES,
comboboxselected = self.onReportTypeChanged,
width=40)
ToolTip(self.cellReportType, text=_("Select a report type"), wraplength=240)
label(frame, 1, 3, _("Entry point:"))
self.cellEntryPoint = gridCombobox(frame, 2, 3, getattr(options,"ebaEntryPointKey", ""),
values=self.ebaEntryPointValues,
comboboxselected = self.onEntryPointChanged,
width=40)
ToolTip(self.cellEntryPoint, text=_("Select an EBA entry point"), wraplength=240)
currentRow = 4
self.setEntryPointsCombo()
cancelButton = Button(frame, text=_("Cancel"), width=8, command=self.close)
ToolTip(cancelButton, text=_("Cancel operation"))
okButton = Button(frame, text=_("New"), width=8, command=self.ok)
ToolTip(okButton, text=_("Create a new file"))
cancelButton.grid(row=currentRow, column=1, columnspan=3, sticky=E, pady=3, padx=3)
okButton.grid(row=currentRow, column=1, columnspan=3, sticky=E, pady=3, padx=86)
frame.grid(row=0, column=0, sticky=(N,S,E,W))
frame.columnconfigure(2, weight=1)
window = self.winfo_toplevel()
window.columnconfigure(0, weight=1)
self.geometry("+{0}+{1}".format(dialogX+50,dialogY+100))
self.protocol("WM_DELETE_WINDOW", self.close)
self.grab_set()
self.wait_window(self)