• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python mforms.newBox函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中mforms.newBox函数的典型用法代码示例。如果您正苦于以下问题:Python newBox函数的具体用法?Python newBox怎么用?Python newBox使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了newBox函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: __init__

 def __init__(self,container,modelName,modelData):
   self.manager=ModelManager(modelName,modelData)    
   
   self.panel=mforms.newPanel(mforms.TitledGroupPanel);    
   container.add(self.panel,True,True);
   self.origContainer=container    
   self.panel.set_title("Edicion de Modelo "+modelName);
   subcontainer=mforms.newBox(False)
   self.panel.add(subcontainer);
   UIHelper.__init__(self,subcontainer)
       
   self.modelName=modelName
   self.modelData=modelData
   self.addTextInput('Label',modelData.customData,'LABEL');
   self.addTextInput('Label corta',modelData.customData,'SHORTLABEL');
   self.addMultipleColumnSelector('Campo Indice',modelData,modelData.customData,'INDEXFIELDS')
   self.addTableSelector('Extiende',modelData.customData,'EXTENDS',None);
   self.addTableSelector('Modulo',modelData.customData,'MODULE',self.onChangeModule)        
   self.addTextInput('Tabla',modelData.customData,'TABLE');
   self.addTextInput('Cardinalidad',modelData.customData,'CARDINALITY');
   self.addSelectInput("Tipo de Cardinalidad",["","FIXED","VARIABLE"],modelData.customData,'CARDINALITY_TYPE',None)
   self.addColumnSelector('Campo Tipo',modelData,modelData.customData,'TYPEFIELD')
   self.addColumnSelector('Propietario',modelData,modelData.customData,'OWNERSHIP')    
   self.multBox=mforms.newBox(False)
   self.multBox.set_padding(3)
   self.multBox.set_spacing(3)
   self.container.add(self.multBox,False,True)
   self.multiplicityOptions=MultiplicityOptions(self.multBox,modelName,modelData,self.container)        
开发者ID:dashiad,项目名称:Siviglia,代码行数:28,代码来源:test3.py


示例2: _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


示例3: _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


示例4: run_version_select_form

def run_version_select_form(version):
    form = Form(Form.main_form())
    top_vbox = newBox(False)
    top_vbox.set_padding(16)
    top_vbox.set_spacing(16)

    info_hbox = newBox(True)
    info_hbox.set_spacing(16)

    img_box = newImageBox()
    img_box.set_image("warning_icon.png")

    right_vbox = newBox(False)
    right_vbox.set_spacing(12)

    warn_label = newLabel("Server version %s is not supported by Workbench\nconfiguration file management tool." % ".".join(map(lambda x: str(x), version)))
    right_vbox.add(warn_label, False, False)

    warn_label = newLabel("Although, you can select different server version\nfor the tool to use. Suggested version "
                          "is given\nbelow. You can either pick version or type one."
                         )
    right_vbox.add(warn_label, False, False)

    warn_label = newLabel("Valid version formats are X.Y.ZZ or X.Y.\nAll other variants will resort to default - 5.1.")
    right_vbox.add(warn_label, False, False)

    if (type(version) is not tuple):
      version = (5,1)
      dprint_ex(1, "Given version is not a valid tuple object")

    try:
      version_maj = int(version[0]) + int(version[1]) / 10.0
    except (ValueError, IndexError), e:
      version_maj = 5.1
开发者ID:aoyanglee,项目名称:Travel-Inc,代码行数:34,代码来源:wb_admin_config_file_ui.py


示例5: review_sql_code

def review_sql_code(code):
    form = mforms.Form(mforms.Form.main_form(), mforms.FormNormal)
    form.set_title("Review SQL Code to Execute")
    box = mforms.newBox(False)
    box.set_padding(12)
    form.set_content(box)

    box.set_spacing(8)
    box.add(mforms.newLabel("Review the SQL code to be executed."), False, True)

    editor = mforms.CodeEditor()
    box.add(editor, True, True)
    editor.set_language(mforms.LanguageMySQL)
    editor.set_text(code)
    editor.set_features(mforms.FeatureReadOnly, True)

    ok = mforms.newButton()
    ok.set_text("Execute")
    cancel = mforms.newButton()
    cancel.set_text("Cancel")

    bbox = mforms.newBox(True)
    bbox.set_spacing(8)
    bbox.add_end(ok, False, True)
    bbox.add_end(cancel, False, True)
    box.add_end(bbox, False, True)

    form.set_size(500, 360)
    return form.run_modal(ok, cancel)
开发者ID:verflucht,项目名称:unlock_repo_feria,代码行数:29,代码来源:sqlide_schematree_ext.py


示例6: create_ui

    def create_ui(self):
        box = mforms.newBox(False)
        box.set_spacing(12)
        box.set_padding(12)

        message = "These options allow you to configure the process. You can use default parameters\n"
        message += "instead of providing your own, allow the generation of the certificates and determine\n"
        message += "whether to update the connection settings or not."

        label = mforms.newLabel(message)

        box.add(label, False, True)
        box.add(self.use_default_parameters, False, True)
        box.add(self.generate_files, False, True)
        box.add(self.update_connection, False, True)
        
        button_box = mforms.newBox(True)
        button_box.set_spacing(12)
        button_box.set_padding(12)
        
        button_box.add(self.clear_button, False, True)
        
        self.content.add(box, False, True)
        self.content.add(button_box, False, True)
        box.show(True)
开发者ID:pk-codebox-evo,项目名称:mysql-workbench,代码行数:25,代码来源:wb_utils_grt.py


示例7: create_ui

    def create_ui(self):
        # Main layout structure
        self.server_instance_box = mforms.newBox(False)
        self.server_instance_box.set_spacing(8)
        instance_label = mforms.newLabel('Target RDBMS Connection Parameters')
        instance_label.set_style(mforms.BoldStyle)
        self.server_instance_box.add(instance_label, False, True)

        # TODO: Enable the export to script option in future versions:
#        self.just_script_choice = mforms.newCheckBox()
#        self.just_script_choice.set_text('Do not use a live instance (SQL script output)')
#        self.just_script_choice.set_tooltip('Check this if you just want an output script to execute it later')
#        self.just_script_choice.add_clicked_callback(self.just_script_toggled)
#        self.server_instance_box.add(self.just_script_choice, False)

        # Add the view that corresponds to the selected RDBMS:
        self.panel = grt.classes.ui_db_ConnectPanel()
        self.panel.initialize(grt.root.wb.rdbmsMgmt)
        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,代码行数:34,代码来源:migration_source_selection.py


示例8: create_ui

    def create_ui(self):
        self.suspend_layout()
        self.set_spacing(16)
        
        label = mforms.newLabel("Table Data Export allows you to easily export data into csv, json datafiles.\n")
        label.set_style(mforms.BoldInfoCaptionStyle)

        self.content.add(label, False, False)

        entry_box = mforms.newBox(True)
        entry_box.set_spacing(5)

        entry_box.add(mforms.newLabel("File Path:"), False, True)

        self.exportfile_path = mforms.newTextEntry()
        self.exportfile_path.add_changed_callback(lambda entry=self.exportfile_path: self.entry_changed(entry))
        entry_box.add(self.exportfile_path, True, True)
        if last_location != None:
            self.exportfile_path.set_value(last_location)
            self.confirm_file_overwrite = True
            self.get_module(True)

        browse_btn = mforms.newButton()
        browse_btn.set_text("Browse...")
        browse_btn.add_clicked_callback(self.browse)
        entry_box.add(browse_btn, False, False)
        self.content.add(entry_box, False, True)
        
        radio_box = mforms.newBox(True)
        radio_box.set_spacing(8)
        for format in self.main.formats:
            fradio = mforms.newRadioButton(1)
            fradio.set_text(format.title)
            fradio.set_active(bool(self.active_module and self.active_module.name == format.name))
            fradio.add_clicked_callback(lambda f = format: self.output_type_changed(f))
            radio_box.add(fradio, False, False)
            self.radio_opts.append({'radio':fradio, 'name': format.name})
        self.content.add(radio_box, False, False)

        self.optpanel = mforms.newPanel(mforms.TitledBoxPanel)
        self.optpanel.set_title("Options:")

        self.content.add(self.optpanel, False, True)
        self.optpanel.show(False)
        
        self.export_local_box = mforms.newBox(False)
        self.export_local_cb = mforms.newCheckBox()
        self.export_local_cb.set_text("Export to local machine")
        self.export_local_cb.set_active(True)
        self.export_local_box.add(self.export_local_cb, False, True)
        l = mforms.newLabel("""If checked rows will be exported on the location that started Workbench.\nIf not checked, rows will be exported on the server.\nIf server and computer that started Workbench are different machines, import of that file can be done manual way only.""")
        l.set_style(mforms.SmallHelpTextStyle)
        self.export_local_box.add(l, False, True)
        
        self.content.add(self.export_local_box, False, True)
        self.resume_layout()
        
        self.load_module_options()
开发者ID:Roguelazer,项目名称:mysql-workbench,代码行数:58,代码来源:sqlide_power_export_wizard.py


示例9: create_ui

    def create_ui(self):
        self.content.set_padding(20)

        self.content.add(mforms.newLabel('''Select the connection for the source MySQL server where databases will be copied from
and the destination server where they should be copied to.'''), False, True)

        source_panel = mforms.newPanel(mforms.TitledBoxPanel)
        source_panel.set_title('Source MySQL Server')

        box = mforms.newBox(False)
        box.set_spacing(12)
        box.set_padding(8)
        box.add(mforms.newLabel('Select the connection for the source MySQL server instance'), False, True)
        
        source_hbox = mforms.newBox(True)
        source_hbox.set_spacing(8)
        source_hbox.add(mforms.newLabel('Source Connection:'), False, True)
        self.source_selector = mforms.newSelector()
        source_hbox.add(self.source_selector, True, True)
        box.add(source_hbox, False, True)

        self.source_connection_status = mforms.newLabel('')
        self.source_connection_status.set_color('#aa3333')
        box.add(self.source_connection_status, True, True)
        self.source_selector.add_changed_callback(functools.partial(self.selector_changed, label=self.source_connection_status, selector=self.source_selector))

        source_panel.add(box)
        self.content.add(source_panel, False, True)

        target_panel = mforms.newPanel(mforms.TitledBoxPanel)
        target_panel.set_title('Destination MySQL Server')

        tbox = mforms.newBox(False)
        tbox.set_spacing(12)
        tbox.set_padding(8)
        tbox.add(mforms.newLabel('Select the connection object for the destination MySQL server instance'), False, True)
        
        target_hbox = mforms.newBox(True)
        target_hbox.set_spacing(8)
        target_hbox.add(mforms.newLabel('Target Connection:'), False, True)
        self.target_selector = mforms.newSelector()
        target_hbox.add(self.target_selector, True, True)
        tbox.add(target_hbox, False, True)

        self.target_connection_status = mforms.newLabel('')
        self.target_connection_status.set_color('#aa3333')
        tbox.add(self.target_connection_status, True, True)
        self.target_selector.add_changed_callback(functools.partial(self.selector_changed, label=self.target_connection_status, selector=self.target_selector))
        
        target_panel.add(tbox)
        self.content.add(target_panel, False, True)

        self.advanced_button.set_text('Test Connections')

        self.back_button.set_enabled(False)

        self.load_connections()
开发者ID:verflucht,项目名称:unlock_repo_feria,代码行数:57,代码来源:db_copy_source_target.py


示例10: __init__

    def __init__(self, results, checksum=False):
        mforms.Form.__init__(self, mforms.Form.main_form(), mforms.FormNormal)

        self.box = mforms.newBox(False)
        self.box.set_padding(12)
        self.box.set_spacing(8)
        self.set_content(self.box)

        self.tree = mforms.newTreeView(mforms.TreeFlatList|mforms.TreeAltRowColors|mforms.TreeShowColumnLines)
        self.tree.set_selection_mode(mforms.TreeSelectMultiple)
        self.box.add(self.tree, True, True)
        self.tree.add_column(mforms.StringColumnType, "Table", 200, False)
        if checksum:
            self.tree.add_column(mforms.StringColumnType, "Checksum", 100, False)
        else:
            self.tree.add_column(mforms.StringColumnType, "Operation", 80, False)
            self.tree.add_column(mforms.IconStringColumnType, "Message", 400, False)
        self.tree.end_columns()

        self._checksum = checksum

        app = mforms.App.get()
        icon_path = {
            'status': app.get_resource_path('mini_ok.png'),
            'error': app.get_resource_path('mini_error.png'),
            'info': '',
            'note': app.get_resource_path('mini_notice.png'),
            'warning': app.get_resource_path('mini_warning.png'),
        }

        ok = results.goToFirstRow()
        while ok:
            node = self.tree.add_node()
            node.set_string(0, results.stringFieldValue(0))
            if not checksum:
                node.set_string(1, results.stringFieldValue(1))
                node.set_icon_path(2, icon_path.get(results.stringFieldValue(2), ''))
                node.set_string(2, results.stringFieldValue(3))
                node.set_tag(results.stringFieldValue(2))
            else:
                node.set_string(1, results.stringFieldValue(1))
            ok = results.nextRow()

        bbox = mforms.newBox(True)
        self.box.add(bbox, False, True)

        copy = mforms.newButton()
        copy.add_clicked_callback(self.copy_to_clipboard)
        copy.set_text("Copy to Clipboard")
        bbox.add(copy, False, True)

        self.ok = mforms.newButton()
        self.ok.set_text("OK")
        self.ok.add_clicked_callback(self.close)
        bbox.add_end(self.ok, False, True)

        self.set_size(500, 400)
开发者ID:pk-codebox-evo,项目名称:mysql-workbench,代码行数:57,代码来源:sqlide_catalogman_ext.py


示例11: __init__

    def __init__(self, main, header_label, wide=False, no_buttons= False):
        mforms.Box.__init__(self, False)
        self.set_managed()
        self.set_release_on_add()

        self.skip_this_page = False
        self.ui_created = False
        self.main = main

        self._identifier = "    "+header_label

        self.set_back_color("") # Make the page transparent.
        self.container = mforms.newBox(True)

        # Main content
        self.content = mforms.newBox(False)
        self.content.set_spacing(12)
        self.content.set_padding(24)
        if not wide:
            self.content.set_size(800, -1)
            self.container.add(self.content, False, True)
        else:
            self.container.add(self.content, True, True)
        
        self.add(self.container, True, True)

        if not no_buttons:
            # Buttons at the bottom of the page:
            self.button_box = mforms.newBox(True)
            self.button_box.set_spacing(8)
            self.button_box.set_padding(16)

            if hasattr(self, "go_advanced"):
                self.advanced_button = mforms.newButton()
                self.advanced_button.set_text('Advanced >>')
                self.advanced_button.add_clicked_callback(self.go_advanced)
                self.button_box.add(self.advanced_button, False, True)

            self.cancel_button = mforms.newButton()
            self.cancel_button.set_text('Cancel')
            self.button_box.add_end(self.cancel_button, False, True)
            if hasattr(self, "go_cancel"):
                self.cancel_button.add_clicked_callback(self.go_cancel)
            else:
                self.cancel_button.set_enabled(False)

            self.next_button = mforms.newButton()
            self.next_button.set_text('Next >')
            self.next_button.add_clicked_callback(self.go_next)
            self.button_box.add_end(self.next_button, False, True)

            self.back_button = mforms.newButton()
            self.back_button.set_text('< Back')
            self.back_button.add_clicked_callback(self.go_back)
            self.button_box.add_end(self.back_button, False, True)

            self.add_end(self.button_box, False, True)
开发者ID:Roguelazer,项目名称:mysql-workbench,代码行数:57,代码来源:wizard_page_widget.py


示例12: __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


示例13: __init__

    def __init__(self, ctrl_be, thread_id):
        mforms.Form.__init__(self, mforms.Form.main_form())
        self.set_title("Thread Stack for %d" % thread_id)
        self.ctrl_be = ctrl_be

        vbox = mforms.newBox(False)
        vbox.set_padding(20)
        vbox.set_spacing(18)

        self.thread_id = thread_id

        splitter = mforms.newSplitter(True, False)

        self.tree = mforms.newTreeNodeView(mforms.TreeDefault)
        self.tree.add_column(mforms.IntegerColumnType, "Event Id", 50, False)
        self.tree.add_column(mforms.StringColumnType, "Event info", 200, False)
        self.tree.add_column(mforms.StringColumnType, "Type", 100, False)
        self.tree.add_column(mforms.StringColumnType, "Timer wait [\xC2\xB5s]", 80, False)
        if self.enable_debug_info:
            self.tree.add_column(mforms.StringColumnType, "Source", 200, False)
        self.tree.end_columns()
        self.tree.set_size(400, -1)
        self.tree.add_changed_callback(self.event_selected)
        splitter.add(self.tree, 500);

        l = mforms.newLabel("Wait info")
        l.set_style(mforms.BoldStyle)
        tbox = newBox(False)
        lbox = newBox(False)
        lbox.set_spacing(5)
        lbox.set_padding(5)
        lbox.add(l, False, False)
        tbox.add(lbox, False, False)

        self.text = mforms.newTextBox(mforms.VerticalScrollBar)
        self.text.set_read_only(True)
        self.text.set_size(150, -1)

        tbox.add(self.text, True, True)
        splitter.add(tbox, 150)

        vbox.add(splitter, True, True)

        self.set_content(vbox)

        bbox = newBox(True)
        bbox.set_spacing(8)
        self.ok = newButton()
        self.ok.set_text("Close")
        self.ok.add_clicked_callback(self.close_form)
        bbox.add_end(self.ok, False, False)
        vbox.add_end(bbox, False, True)

        self.set_size(800, 600)
        self.center()
开发者ID:Roguelazer,项目名称:mysql-workbench,代码行数:55,代码来源:wb_admin_connections.py


示例14: __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


示例15: __init__

    def __init__(self, ctrl_be, title, descr, stop_callback = None, close_callback=None, progress_parser_callback=None):
        mforms.Form.__init__(self, mforms.Form.main_form(), mforms.FormDialogFrame)
        self.ctrl_be = ctrl_be

        self._done = False
        self._update_tm = None

        self.finished_callback = None
        self.stop_callback = stop_callback
        self.close_callback = close_callback
        self.progress_parser_callback = progress_parser_callback

        self.show(False)

        self.box = mforms.newBox(False)
        self.set_content(self.box)
        self.box.set_padding(12)
        self.box.set_spacing(20)

        self.set_title(title)
        self.label = mforms.newLabel(descr)
        self.box.add(self.label, False, True)

        hb = mforms.newBox(True)
        self.progress = mforms.newProgressBar()
        self.progress_label = mforms.newLabel("")
        self.progress_label.set_size(100, -1)
        hb.add(self.progress_label, False, True)
        hb.add(self.progress, True, True)
        self.box.add(hb, False, True)

        self.logbox = mforms.newTextBox(mforms.VerticalScrollBar)
        self.logbox.set_read_only(True)
        panel = mforms.newPanel(mforms.TitledBoxPanel)
        panel.set_title("Command Output")

        self.logbox.set_padding(8)
        panel.add(self.logbox)
        self.box.add(panel, True, True)


        bbox = mforms.newBox(True)
        self.box.add_end(bbox, False, True)

        self.stop = mforms.newButton()
        if stop_callback:
            self.stop.set_text("Stop")
        else:
            self.stop.set_text("Close")
        self.stop.add_clicked_callback(self.do_stop)
        bbox.add_end(self.stop, False, True)

        self.set_size(700, 500)
        self.center()
开发者ID:Roguelazer,项目名称:mysql-workbench,代码行数:54,代码来源:wb_execute_window.py


示例16: __init__

    def __init__(self, ctrl_be, server_profile, main_view):
        mforms.Box.__init__(self, True)
        self.set_managed()
        self.set_release_on_add()

        self.ui_created = False

        self.set_spacing(24)

        self.ctrl_be = ctrl_be
        self.server_profile = server_profile
        self.main_view = main_view

        lbox = mforms.newBox(False)
        self.add(lbox, True, True)

        self.connection_info = ConnectionInfo()
        self.connection_info.set_padding(24)
        lbox.add(self.connection_info, False, True)

        self.scrollbox = mforms.newScrollPanel(mforms.ScrollPanelDrawBackground)
        self.scrollbox.set_padding(24)
        self.content = mforms.newBox(False)
        self.content.set_padding(20)
        self.content.set_spacing(4)
        self.scrollbox.add(self.content)
        lbox.add(self.scrollbox, True, True)

        image = mforms.newImageBox()
        if self.server_profile.host_os == "linux":
            image.set_image(mforms.App.get().get_resource_path("mysql-status-separator-linux.png"))
        else:
          image.set_image(mforms.App.get().get_resource_path("mysql-status-separator.png"))
        image.set_image_align(mforms.MiddleCenter)
        self.add(image, False, True)

        self.on_icon = mforms.App.get().get_resource_path("mysql-status-on.png")
        self.off_icon = mforms.App.get().get_resource_path("mysql-status-off.png")

        self.status = wb_admin_monitor.WbAdminMonitor(server_profile, self.ctrl_be)
        self.status.set_size(360, -1)
        self.status.set_padding(0, 24, 24, 24)
        self.add(self.status, False, False)

        self.controls = {}

        self.currently_started = None
        self.ctrl_be.add_me_for_event("server_started", self)
        self.ctrl_be.add_me_for_event("server_stopped", self)

        self.connection_info.update(self.ctrl_be)
开发者ID:verflucht,项目名称:unlock_repo_feria,代码行数:51,代码来源:wb_admin_server_status.py


示例17: 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


示例18: __init__

    def __init__(self):
        mforms.AppView.__init__(self, False, 'db_copy', True)

        self.background = None
        self.content = mforms.newBox(False)

        if platform.system() == 'Windows':
            self.set_back_color(mforms.App.get().get_system_color(mforms.SystemColorContainer).to_html())
            content_panel = mforms.newPanel(mforms.FilledPanel)
            self.content.set_back_image("migration_background.png", mforms.TopRight)
        else:
            content_panel = mforms.newPanel(mforms.StyledHeaderPanel)
            content_panel.set_back_image("migration_background.png", mforms.TopRight)

        content_panel.set_back_color("#FFFFFF")
        content_panel.set_padding(8)
        self.header = mforms.newLabel("")
        self.header.set_style(mforms.WizardHeadingStyle)
        self.content.add(self.header, False)
        self.tabview = mforms.newTabView(mforms.TabViewTabless)
        self.content.add(self.tabview, True, True)
        content_panel.add(self.content)
        self.add(content_panel, True, True)

        self._ui_created = False
        
        self._page_list = []
        self._page_trail = []
        self._current_page = 0

        # Load current user numeric locale:
        locale.setlocale(locale.LC_NUMERIC, '')

        self.plan = migration.MigrationPlan()
        self.create_ui()
开发者ID:verflucht,项目名称:unlock_repo_feria,代码行数:35,代码来源:db_copy_main.py


示例19: __init__

    def __init__(self, main):
        WizardPage.__init__(self, main, 'Schemata Selection')

        self._ui_created = False
        self.main.add_wizard_page(self,  'SourceTarget', 'Schemata Selection')

        optionspanel = mforms.newPanel(mforms.TitledBoxPanel)
        optionspanel.set_title('Schema Name Mapping Method')
        optionsbox = mforms.newBox(False)
        optionsbox.set_padding(8)
        optionsbox.set_spacing(8)
        
        optionsbox.add(mforms.newLabel('Choose how the reverse engineered schemata and objects should be mapped.\n'), False)

        options = [ 'Keep schemata as they are: Catalog.Schema.Table -> Schema.Table',
                    'Only one schema: Catalog.Schema.Table -> Catalog.Table',
                    'Only one schema, keep current schema names as a prefix: Catalog.Schema.Table -> Catalog.Schema_Table',
                  ]
        rid = mforms.RadioButton.new_id()
        self.options = []
        for opt in options:
            radio_button = mforms.newRadioButton(rid)
            radio_button.set_text(opt)
            optionsbox.add(radio_button, False)
            self.options.append(radio_button)
        self.options[1].set_active(True)

        optionspanel.add(optionsbox)
        self._optionspanel = optionspanel
        #self._advanced_shown = False
        #self._optionspanel.show(False)
        self.content.add_end(optionspanel, False)
开发者ID:verflucht,项目名称:unlock_repo_feria,代码行数:32,代码来源:migration_schema_selection.py


示例20: header_box

 def header_box(self):
   headBox = mforms.newBox(True)
   img = mforms.newImageBox()
   img.set_image(str(os.path.dirname(os.path.realpath(__file__))) + '/PropelUtility/propel-logo.png')
   img.set_size(self.defaults['width']/2-PropelForm.defaults['space']*2, 100)
   headBox.add(img, False, False)
   return headBox
开发者ID:themouette,项目名称:PropelUtility,代码行数:7,代码来源:propel_utility_grt.py



注:本文中的mforms.newBox函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python mforms.newButton函数代码示例发布时间:2022-05-27
下一篇:
Python views.set_cookie函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap