本文整理汇总了Python中mforms.newTextEntry函数的典型用法代码示例。如果您正苦于以下问题:Python newTextEntry函数的具体用法?Python newTextEntry怎么用?Python newTextEntry使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了newTextEntry函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, conn):
mforms.Form.__init__(self, None)
self._conn = conn
self.set_title("Password Expired")
vbox = mforms.newBox(False)
vbox.set_padding(20)
vbox.set_spacing(18)
user = conn.parameterValues["userName"]
l = newLabel("Password for MySQL account '%s'@%s expired.\nPlease pick a new password:" % (user, conn.hostIdentifier.replace("[email protected]", "")))
l.set_style(mforms.BoldStyle)
vbox.add(l, False, True)
box = mforms.newTable()
box.set_padding(1)
box.set_row_count(3)
box.set_column_count(2)
box.set_column_spacing(7)
box.set_row_spacing(8)
hbox = mforms.newBox(True)
hbox.set_spacing(12)
icon = mforms.newImageBox()
icon.set_image(mforms.App.get().get_resource_path("wb_lock.png"))
hbox.add(icon, False, True)
hbox.add(box, True, True)
vbox.add(hbox, False, True)
self.old_password = mforms.newTextEntry(mforms.PasswordEntry)
box.add(newLabel("Old Password:", True), 0, 1, 0, 1, mforms.HFillFlag)
box.add(self.old_password, 1, 2, 0, 1, mforms.HFillFlag|mforms.HExpandFlag)
self.password = mforms.newTextEntry(mforms.PasswordEntry)
box.add(newLabel("New Password:", True), 0, 1, 1, 2, mforms.HFillFlag)
box.add(self.password, 1, 2, 1, 2, mforms.HFillFlag|mforms.HExpandFlag)
self.confirm = mforms.newTextEntry(mforms.PasswordEntry)
box.add(newLabel("Confirm:", True), 0, 1, 2, 3, mforms.HFillFlag)
box.add(self.confirm, 1, 2, 2, 3, mforms.HFillFlag|mforms.HExpandFlag)
bbox = newBox(True)
bbox.set_spacing(8)
self.ok = newButton()
self.ok.set_text("OK")
self.cancel = newButton()
self.cancel.set_text("Cancel")
mforms.Utilities.add_end_ok_cancel_buttons(bbox, self.ok, self.cancel)
vbox.add_end(bbox, False, True)
self.set_content(vbox)
self.set_size(500, 260)
self.center()
开发者ID:verflucht,项目名称:unlock_repo_feria,代码行数:56,代码来源:wb_admin_grt.py
示例2: create_ui
def create_ui(self):
self.suspend_layout()
self.set_spacing(16)
self.content.set_spacing(16)
colbox = mforms.newBox(False)
colbox.set_spacing(8)
colbox.add(mforms.newLabel("Select columns you'd like to export"), False, True)
self.column_list = newTreeNodeView(mforms.TreeFlatList)
self.column_list.add_column(mforms.CheckColumnType, "Export", 50, True)
self.column_list.add_column(mforms.StringColumnType, "Column name", self.owner.main.get_width(), False)
self.column_list.end_columns()
self.column_list.set_allow_sorting(True)
self.column_list.set_size(200, -1)
colbox.add(self.column_list, True, True)
limit_box = mforms.newBox(True)
limit_box.set_spacing(8)
limit_box.add(mforms.newLabel("Count: "), False, False)
self.limit_entry = mforms.newTextEntry()
self.limit_entry.set_size(50, -1)
self.limit_entry.add_changed_callback(lambda entry=self.limit_entry: self.entry_changed(entry))
limit_box.add(self.limit_entry, False, False)
offset_box = mforms.newBox(True)
offset_box.set_spacing(8)
offset_box.add(mforms.newLabel("Row Offset: "), False, False)
self.offset_entry = mforms.newTextEntry()
self.offset_entry.set_size(50, -1)
self.offset_entry.add_changed_callback(lambda entry=self.offset_entry: self.entry_changed(entry))
offset_box.add(self.offset_entry, False, False)
sellall_cb = mforms.newCheckBox()
sellall_cb.set_text("Select / Deselect all entries")
sellall_cb.set_active(True)
sellall_cb.add_clicked_callback(lambda cb = sellall_cb: self.sell_all(cb))
limit_offset = mforms.newBox(True)
limit_offset.set_spacing(8)
limit_offset.add(sellall_cb, False, True)
limit_offset.add_end(limit_box, False, True)
limit_offset.add_end(offset_box, False, True)
colbox.add(limit_offset, False, True)
self.content.add(colbox, True, True)
self.resume_layout()
开发者ID:Roguelazer,项目名称:mysql-workbench,代码行数:49,代码来源:sqlide_power_export_wizard.py
示例3: create_ui
def create_ui(self):
self.back_button.set_enabled(False)
# Main layout structure
self.server_instance_box = mforms.newBox(False)
self.server_instance_box.set_spacing(8)
instance_label = mforms.newLabel('Source RDBMS Connection Parameters')
instance_label.set_style(mforms.BoldStyle)
self.server_instance_box.add(instance_label, False, True)
# Add the view that corresponds to the selected RDBMS:
self.panel = grt.classes.ui_db_ConnectPanel()
self.panel.initializeWithRDBMSSelector(grt.root.wb.rdbmsMgmt, self.supported_sources_instances)
if not self.panel.view:
raise Exception("NO PANEL!!!")
view = mforms.fromgrt(self.panel.view)
self.server_instance_box.add(view, True, True)
box = mforms.newBox(True)
self._store_connection_check = mforms.newCheckBox()
self._store_connection_check.set_text("Store connection for future usage as ")
self._store_connection_check.add_clicked_callback(self._toggle_store_connection)
box.add(self._store_connection_check, False, False)
self._store_connection_entry = mforms.newTextEntry()
box.add(self._store_connection_entry, True, True)
self._store_connection_entry.set_enabled(False)
self.server_instance_box.add(box, False, False)
self.content.add(self.server_instance_box, True, True)
self.advanced_button.set_text("Test Connection")
开发者ID:verflucht,项目名称:unlock_repo_feria,代码行数:31,代码来源:migration_source_selection.py
示例4: create_options
def create_options(self, box, options):
optlist = []
for option in options:
cont = None
if option.paramType == "boolean":
opt = mforms.newCheckBox()
opt.set_active(self.defaultValue == "1")
box.add(opt, False, True)
getter = opt.get_string_value
elif option.paramType == "string":
hbox = mforms.newBox(True)
hbox.set_spacing(8)
hbox.add(mforms.newLabel(option.caption), False, True)
opt = mforms.newTextEntry()
opt.set_value(option.defaultValue)
hbox.add(opt, True, True)
l = mforms.newLabel(option.description)
l.set_style(mforms.SmallHelpTextStyle)
hbox.add(l, False, True)
box.add(hbox, False, True)
cont = hbox
getter = opt.get_string_value
else:
grt.send_error("MigrationWizard", "migrationOption() for source has an invalid parameter of type %s (%s)" % (option.paramType, option.name))
continue
optlist.append((cont or opt, option.name, getter))
return optlist
开发者ID:verflucht,项目名称:unlock_repo_feria,代码行数:27,代码来源:migration_object_migration.py
示例5: create_search_panel
def create_search_panel(self):
search_label = newLabel("Locate option:")
self.option_lookup_entry = newTextEntry()
self.option_lookup_entry.set_size(200,-1)
search_btn = newButton()
search_btn.set_text("Find")
search_btn.set_size(70, -1)
search_box = newBox(True)
search_box.set_padding(2)
search_box.set_spacing(4)
#search_box.set_size(300, -1)
search_box.add(search_label, False, False)
search_box.add(self.option_lookup_entry, False, True)
search_box.add(search_btn, False, False)
search_panel = newPanel(mforms.FilledPanel)
search_panel.add(search_box)
self.main_view.ui_profile.apply_style(search_panel, 'option-search-panel')
def lookup_option_wrapper():
self.locate_option(self.option_lookup_entry.get_string_value())
search_btn.add_clicked_callback(lookup_option_wrapper)
return search_panel
开发者ID:Arrjaan,项目名称:Cliff,代码行数:25,代码来源:wb_admin_config_file_ui.py
示例6: create_numeric
def create_numeric(self, name, ctrl_def):
#spin_box = newBox(True)
#spin_box.set_spacing(5)
te = newTextEntry()
#spin_box.add(te, True, True)
te.set_enabled(False)
te.set_tooltip("For numeric values, you may specify a K, M or G size suffix, if appropriate.")
te.add_changed_callback(lambda: self.control_action(name))
#unit = None
#if ctrl_def.has_key('unitcontrol'):
# unit = ctrl_def['unitcontrol']
#unitcontrol = None
#unit_items = None
#if unit is not None:
# unitcontrol = newSelector()
# unit_items = unit.split(";")
# for item in unit_items:
# unitcontrol.add_item(item)
#
# spin_box.add(unitcontrol, False, False)
# unitcontrol.set_enabled(False)
# unitcontrol.add_changed_callback(lambda: self.control_action(name))
#return (spin_box, te, unitcontrol, unit_items)
return te
开发者ID:Arrjaan,项目名称:Cliff,代码行数:29,代码来源:wb_admin_config_file_ui.py
示例7: _add_script_radiobutton_option
def _add_script_radiobutton_option(self, box, name, caption, path_caption, browser_caption, label_caption, rid):
holder = mforms.newBox(False)
holder.set_spacing(4)
radio = mforms.newRadioButton(rid)
radio.set_text(caption)
holder.add(radio, False, True)
vbox = mforms.newBox(False)
vbox.set_spacing(4)
file_box = mforms.newBox(True)
file_box.set_spacing(4)
file_box.add(mforms.newLabel(path_caption), False, True)
file_entry = mforms.newTextEntry()
file_entry.add_changed_callback(lambda self=self, option=name: setattr(self, name + "_check_duplicate", True))
file_box.add(file_entry, True, True)
radio.add_clicked_callback(self._script_radio_option_callback)
button = mforms.newButton()
button.set_text("Browse...")
button.add_clicked_callback(lambda option=name, title=browser_caption: self._browse_files(option, title))
file_box.add(button, False, True)
vbox.add(file_box, False, True)
label = mforms.newLabel(label_caption)
label.set_style(mforms.SmallHelpTextStyle)
vbox.add(label, False, True)
vbox.set_enabled(False)
holder.add(vbox, False, True)
box.add(holder, False, True)
setattr(self, name + "_check_duplicate", False)
setattr(self, name + "_radiobutton", radio)
setattr(self, name + "_entry", file_entry)
setattr(self, name + "_vbox", vbox)
开发者ID:eworm-de,项目名称:mysql-workbench,代码行数:31,代码来源:migration_data_transfer.py
示例8: _add_script_checkbox_option
def _add_script_checkbox_option(self, box, name, caption, path_caption, browser_caption):
check = mforms.newCheckBox()
check.set_text(caption)
box.add(check, False, True)
vbox = mforms.newBox(False)
vbox.set_spacing(4)
file_box = mforms.newBox(True)
file_box.set_spacing(4)
file_box.add(mforms.newLabel(path_caption), False, True)
file_entry = mforms.newTextEntry()
file_entry.add_changed_callback(lambda self=self, option=name: setattr(self, name+"_check_duplicate", True))
file_box.add(file_entry, True, True)
check.add_clicked_callback(lambda box=vbox, check=check: box.set_enabled(check.get_active()))
button = mforms.newButton()
button.set_text("Browse...")
button.add_clicked_callback(lambda option=name, title=browser_caption: self._browse_files(option, title))
file_box.add(button, False, True)
vbox.add(file_box, False, True)
label = mforms.newLabel("You should edit this file to add the source and target server passwords before running it.")
label.set_style(mforms.SmallHelpTextStyle)
vbox.add(label, False, True)
vbox.set_enabled(False)
box.add(vbox, False, True)
setattr(self, name+"_check_duplicate", False)
setattr(self, name+"_checkbox", check)
setattr(self, name+"_entry", file_entry)
开发者ID:verflucht,项目名称:unlock_repo_feria,代码行数:27,代码来源:migration_data_transfer.py
示例9: add_label_row
def add_label_row(self, row, label, help):
control = mforms.newTextEntry()
self.table.add(mforms.newLabel(label, True), 0, 1, row, row+1, mforms.HFillFlag)
self.table.add(control, 1, 2, row, row+1, mforms.HFillFlag|mforms.HExpandFlag)
l = mforms.newLabel(help)
l.set_style(mforms.SmallHelpTextStyle)
self.table.add(l, 2, 3, row, row+1, mforms.HFillFlag)
control.set_size(100, -1)
return row+1, control
开发者ID:alMysql,项目名称:mysql-workbench,代码行数:9,代码来源:wb_utils_grt.py
示例10: __init__
def __init__(self):
mforms.Form.__init__(self,None);
self.set_managed()
self.currentModel=None
#Lista de campos del modelo actual.
schema=grt.root.wb.doc.physicalModels[0].catalog.schemata[0]
self.schema=schema
self.set_size(800,400)
self.center()
self.set_title('Siviglia Editor')
f1=mforms.newBox(False)
bx = mforms.newBox(True)
bx.set_padding(12)
bx.set_spacing(12)
self.lbox=mforms.newListBox(False)
self.lbox.set_size(100,200);
list=[];
for curTable in schema.tables:
list.append(curTable.name);
list.sort();
for tName in list:
self.lbox.add_item(tName)
self.lbox.add_changed_callback(lambda:self.changedModel());
#self.lbox.add_changed_callback(lambda:self.changedField());
#for curField in curTable.columns:
# self.lbox.add_item(curField.name);
bx.add(self.lbox,False,False);
#sp=mforms.newScrollPanel();
#bx.add(sp,True,True);
self.fieldContainer=mforms.newBox(False);
#self.autoUI=AutoUI(fieldContainer)
#self.autoUI.reset('Testing',{'a':{'b':1,'c':2},'h':{'p':4,'m':'hola'}},{})
bx.add(self.fieldContainer,True,True)
f1.add(bx,True,True)
bx2=mforms.newBox(True)
bx2.set_padding(12);
bx2.set_size(500,20)
#bx2.set_preferred_height(40);
l=mforms.newLabel('Output Path')
bx2.add(l,False,True)
p=mforms.newTextEntry()
p.set_value("c:\\xampp\\htdocs");
p.set_size(300,20)
self.pathInput=p
bx2.add(p,False,True)
p=mforms.newButton()
p.set_text("Generar")
p.add_clicked_callback(self.onGenerate)
bx2.add(p,False,True)
f1.add(bx2,False,False)
self.tabView=None
self.set_content(f1)
开发者ID:dashiad,项目名称:Siviglia,代码行数:56,代码来源:test3.py
示例11: __init__
def __init__(self, title, description):
self._canceled = False
mforms.Form.__init__(self, None, mforms.FormDialogFrame|mforms.FormResizable|mforms.FormMinimizable)
self.set_title(title)
content = mforms.newBox(False)
self.set_content(content)
content.set_padding(12)
content.set_spacing(12)
v_box = mforms.newBox(False)
content.add(v_box, False, False)
v_box.set_spacing(12)
v_box.add(mforms.newLabel(description), False, False)
table = mforms.newTable()
table.set_padding(12)
v_box.add(table, False, False)
table.set_row_count(2)
table.set_column_count(2)
table.set_row_spacing(8)
table.set_column_spacing(4)
table.add(mforms.newLabel("Find:"), 0, 1, 0, 1)
table.add(mforms.newLabel("Replace with:"), 0, 1, 1, 2)
self.from_type_entry = mforms.newTextEntry()
table.add(self.from_type_entry, 1, 2, 0, 1)
self.to_type_entry = mforms.newTextEntry()
table.add(self.to_type_entry, 1, 2, 1, 2)
h_box = mforms.newBox(True)
content.add_end(h_box, False, False)
h_box.set_spacing(12)
self.cancel_btn = mforms.newButton()
self.cancel_btn.set_text("Cancel")
h_box.add_end(self.cancel_btn, False, True)
self.ok_btn = mforms.newButton()
self.ok_btn.set_text("OK")
h_box.add_end(self.ok_btn, False, True)
self.set_size(600, 180)
开发者ID:pk-codebox-evo,项目名称:mysql-workbench,代码行数:43,代码来源:migration_object_editing.py
示例12: __init__
def __init__(self, main):
WizardPage.__init__(self, main, "Target Creation Options")
self.main.add_wizard_page(self, "ObjectMigration", "Target Creation Options")
label = mforms.newLabel("Select options for the creation of the migrated schema in the target\nMySQL server and click [Next >] to execute.")
self.content.add(label, False, True)
panel = mforms.newPanel(mforms.TitledBoxPanel)
panel.set_title("Schema Creation")
self.content.add(panel, False, True)
box = mforms.newBox(False)
panel.add(box)
box.set_padding(12)
self._create_db = mforms.newCheckBox()
self._create_db.set_text("Create schema in target RDBMS")
box.add(self._create_db, False, True)
# spacer
box.add(mforms.newLabel(""), False, True)
self._create_script = mforms.newCheckBox()
self._create_script.set_text("Create a SQL script file")
self._create_script.add_clicked_callback(self._toggle_sql_script)
box.add(self._create_script, False, True)
self._file_hbox = mforms.newBox(True)
self._file_hbox.set_spacing(4)
self._file_hbox.add(mforms.newLabel("Script File:"), False, True)
self._create_script_file = mforms.newTextEntry()
self._create_script_file.set_value(os.path.join(os.path.expanduser('~'), 'migration_script.sql'))
self._file_hbox.add(self._create_script_file, True, True)
button = mforms.newButton()
button.set_text("Browse...")
button.add_clicked_callback(self._browse_files)
self._file_hbox.add(button, False, True)
box.add(self._file_hbox, False, True)
panel = mforms.newPanel(mforms.TitledBoxPanel)
panel.set_title("Options")
self.content.add(panel, False, True)
box = mforms.newBox(False)
panel.add(box)
box.set_padding(12)
box.set_spacing(8)
self._keep_schema = mforms.newCheckBox()
self._keep_schema.set_text("Keep schemas if they already exist. Objects that already exist will not be recreated or updated.")
box.add(self._keep_schema, False, True)
self._create_db.set_active(True)
self._toggle_sql_script()
self._check_file_duplicate = True
开发者ID:alMysql,项目名称:mysql-workbench,代码行数:55,代码来源:migration_schema_creation.py
示例13: addTextInput
def addTextInput(self,label,saveObject,objectKey,Help='None'):
curBox=self.createBaseInput(label)
input=mforms.newTextEntry()
input.set_size(200,20)
curBox.add(input,False,True)
input.add_changed_callback(lambda:self.changeTextValue(input,saveObject,objectKey))
if saveObject.has_key(objectKey):
input.set_value(saveObject[objectKey])
if Help!=None:
curBox.add(mforms.newLabel(Help),False,True)
开发者ID:dashiad,项目名称:Siviglia,代码行数:11,代码来源:test3.py
示例14: search
def search(self, grid_name):
tBox = PropelForm.spaced_box(True)
self.widgets[grid_name + '_search_label'] = mforms.newLabel("table pattern")
tBox.add(self.widgets[grid_name + '_search_label'], False, True)
self.widgets[grid_name + '_search_pattern'] = mforms.newTextEntry()
tBox.add(self.widgets[grid_name + '_search_pattern'], True, True)
self.widgets[grid_name + '_search_button'] = mforms.newButton()
self.widgets[grid_name + '_search_button'].set_text("matching tables")
self.widgets[grid_name + '_search_match_count'] = mforms.newLabel("")
self.widgets[grid_name + '_search_button'].add_clicked_callback(lambda: self.find_rows(0))
tBox.add(self.widgets[grid_name + '_search_button'], False, True)
tBox.add(self.widgets[grid_name + '_search_match_count'], False, True)
self.add(tBox, False, True)
开发者ID:mazenovi,项目名称:PropelUtilityDev,代码行数:13,代码来源:PropelTabGrid.py
示例15: create_ui
def create_ui(self):
self.set_spacing(16)
self.content.add(self.schema_label, False, True)
entry_box = mforms.newBox(True)
entry_box.set_spacing(5)
entry_box.add(mforms.newLabel("File Path:"), False, True)
self.shapefile_path = mforms.newTextEntry()
entry_box.add(self.shapefile_path, True, True)
self.shapefile_browse_btn = newButton()
self.shapefile_browse_btn.set_text("Browse...")
self.shapefile_browse_btn.add_clicked_callback(self.shapefile_browse)
entry_box.add(self.shapefile_browse_btn, False, False)
self.content.add(entry_box, False, True)
label = mforms.newLabel("""Select a shapefile containing spatial data to load into MySQL.
A new table with the imported fields will be created in the selected schema,
unless the append or update options are specified.""")
self.content.add(label, False, False)
self.dbf_box = mforms.newBox(True)
self.dbf_box.set_spacing(8)
self.dbf_icon = mforms.newImageBox()
self.dbf_icon.set_image("task_unchecked%s.png" % os_icon_suffix)
self.dbf_box.add(self.dbf_icon, False, True)
dbf_label = mforms.newLabel("Check if dbf file is present")
self.dbf_box.add(dbf_label, True, True)
self.dbf_box.show(True)
self.content.add(self.dbf_box, False, True)
self.proj_box = mforms.newBox(True)
self.proj_box.set_spacing(8)
self.proj_icon = mforms.newImageBox()
self.proj_icon.set_image("task_unchecked%s.png" % os_icon_suffix)
self.proj_box.add(self.proj_icon, False, True)
proj_label = mforms.newLabel("Check if prj file is present")
self.proj_box.add(proj_label, True, True)
self.proj_box.show(True)
self.content.add(self.proj_box, False, True)
self.warning_srs = mforms.newLabel("")
self.content.add(self.warning_srs, False, True)
开发者ID:alMysql,项目名称:mysql-workbench,代码行数:49,代码来源:sqlide_import_spatial.py
示例16: add_check_entry_row
def add_check_entry_row(table, row, label, name):
check = mforms.newCheckBox()
check.set_text(label)
table.add(check, 0, 1, row, row+1, mforms.HFillFlag)
entry = mforms.newTextEntry()
entry.add_changed_callback(self.save_changes)
table.add(entry, 1, 2, row, row+1, mforms.HFillFlag|mforms.HExpandFlag)
setattr(self, name+"_check", check)
setattr(self, name+"_entry", entry)
entry.set_enabled(False)
def callback(entry, check):
if not check.get_active():
entry.set_value("-2")
entry.set_enabled(check.get_active())
self.save_changes()
check.add_clicked_callback(lambda: callback(entry, check))
开发者ID:verflucht,项目名称:unlock_repo_feria,代码行数:16,代码来源:datatype_mapping_editor.py
示例17: create_dir_file_edit
def create_dir_file_edit(self, name, ctrl_def):
dir_box = newBox(True)
dir_box.set_spacing(4)
te = newTextEntry()
te.set_tooltip("To convert option to a multi-line one, use " + multi_separator + " to separate values. The symbol " + multi_separator + " should not be the first char")
btn = newButton()
btn.set_text("...")
btn.enable_internal_padding(False)
btn.add_clicked_callback(lambda: self.open_file_chooser(OpenDirectory, te, name))
dir_box.add(te, True, True)
dir_box.add(btn, False, False)
te.set_enabled(False)
btn.set_enabled(False)
return (dir_box, te, btn)
开发者ID:Arrjaan,项目名称:Cliff,代码行数:17,代码来源:wb_admin_config_file_ui.py
示例18: browse_extra_behaviors_box
def browse_extra_behaviors_box(self):
tBox = PropelForm.spaced_box(True)
label = mforms.newLabel("extra behaviors")
tBox.add(label, False, True)
self.widgets['extra_behaviors_path'] = mforms.newTextEntry()
self.widgets['extra_behaviors_path'].set_value(self.db.cache['extra_behaviors_path'])
tBox.add(self.widgets['extra_behaviors_path'], True, True)
self.widgets['extra_behaviors_file'] = mforms.newFileChooser(mforms.OpenFile)
self.widgets['extra_behaviors_file'].set_extensions('Python files (*.py)|*.py','py')
self.widgets['extra_behaviors_file'].set_title("extra behaviors file")
browse = mforms.newButton()
browse.set_text("Browse")
browse.add_clicked_callback(lambda: self.browse_schema())
tBox.add(browse, False, True)
label = mforms.newLabel("see http://m4z3.me/extrabehaviors for details")
tBox.add(label, False, True)
self.add_end(tBox, False, True)
开发者ID:mazenovi,项目名称:PropelUtilityDev,代码行数:17,代码来源:PropelTabBehaviors.py
示例19: load_module_options
def load_module_options(self):
self.suspend_layout()
self.optpanel.show(False)
if self.optbox:
self.optpanel.remove(self.optbox)
if self.active_module and len(self.active_module.options) != 0:
def set_text_entry(field, output):
txt = field.get_string_value().encode('utf-8').strip()
if len(txt) == 0:
operator.setitem(output, 'value', None)
elif len(txt) == 1:
operator.setitem(output, 'value', txt)
else:
field.set_value("")
mforms.Utilities.show_error(self.main.title, "Due to the nature of this wizard, you can't use unicode characters in this place, as also only one character is allowed.","Ok","","")
def set_selector_entry(selector, output):
operator.setitem(output, 'value', output['opts'][str(selector.get_string_value())])
self.optbox = mforms.newBox(False)
self.optbox.set_spacing(8)
self.optbox.set_padding(8)
for name, opts in self.active_module.options.iteritems():
label_box = mforms.newBox(True)
label_box.set_spacing(8)
label_box.add(mforms.newLabel(opts['description']), False, False)
if opts['type'] == 'text':
opt_val = mforms.newTextEntry()
opt_val.set_size(35, -1)
opt_val.set_value(opts['value'])
opt_val.add_changed_callback(lambda field = opt_val, output = opts: set_text_entry(field, output))
label_box.add_end(opt_val, False, False)
if opts['type'] == 'select':
opt_val = mforms.newSelector()
opt_val.set_size(75, -1)
opt_val.add_items([v for v in opts['opts']])
opt_val.set_selected(opts['opts'].values().index(opts['value']))
opt_val.add_changed_callback(lambda selector = opt_val, output = opts: set_selector_entry(selector, output))
label_box.add_end(opt_val, False, False)
self.optbox.add(label_box, False, False)
self.optpanel.add(self.optbox)
self.optpanel.show(True)
self.resume_layout()
开发者ID:Roguelazer,项目名称:mysql-workbench,代码行数:45,代码来源:sqlide_power_export_wizard.py
示例20: browse_schema_box
def browse_schema_box(self):
tBox = PropelForm.spaced_box(True)
label = mforms.newLabel("external propel schema")
tBox.add(label, False, True)
self.widgets['external_schema_path'] = mforms.newTextEntry()
tBox.add(self.widgets['external_schema_path'], True, True)
self.widgets['external_schema_file'] = mforms.newFileChooser(mforms.OpenFile)
self.widgets['external_schema_file'].set_extensions('XML files (*.xml)|*.xml','xml')
self.widgets['external_schema_file'].set_title("external schema file")
browse = mforms.newButton()
browse.set_text("Browse")
browse.add_clicked_callback(lambda: self.browse_schema())
tBox.add(browse, False, True)
add = mforms.newButton()
add.set_text("Add")
add.add_clicked_callback(lambda: self.add_schema())
tBox.add(add, False, True)
self.add(tBox, False, True)
开发者ID:mazenovi,项目名称:PropelUtilityDev,代码行数:18,代码来源:PropelTabExternalSchemas.py
注:本文中的mforms.newTextEntry函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论