# # mform_bug_minimal_grt.py # MySQLWorkbench # # Created by Damian Marcinczyk on 9/Dec/09. # Copyright (c) 2009 DJM ERT Ltd. All rights reserved. # # import the wb module from wb import * # import the grt module import grt # import the mforms module for GUI stuff import mforms # define this Python module as a GRT module ModuleInfo = DefineModule(name= "PyWbExtraUtils", author= "DJM ERT Ltd", version="1.0") # @wbexport exports the function from the module and also describes the return and # argument types of the function # @wbplugin defines the name of the plugin to "wb.catalog.util.dumpColumns", sets the caption to be # shown in places like the menu, where to take input arguments from and also that it should be included # in the Catalog submenu in Plugins. @ModuleInfo.plugin("wb.catalog.util.mformBugMinimal", caption= "mform Bug Minimal Test Case", input= [wbinputs.currentCatalog()], pluginMenu= "Catalog") @ModuleInfo.export(grt.INT, grt.classes.db_Catalog) def mformBugMinimalTestCase(catalog): form = mforms.Form(None, mforms.FormSingleFrame) label = mforms.newLabel('testLabel') label.set_wrap_text(True) ok = mforms.newButton() ok.set_text('OK') cancel = mforms.newButton() cancel.set_text('Cancel') button_box = mforms.newBox(True) button_box.set_spacing(8) mforms.Utilities.add_end_ok_cancel_buttons(button_box, ok, cancel) top_box = mforms.newBox(False) top_box.set_padding(12) top_box.set_spacing(8) panel_box = mforms.newBox(False) panel_box.set_spacing(12) panel_box.set_padding(8) panel_box.add(label, False, True) top_box.add(panel_box, True, True) top_box.add(button_box, True, True) form.set_content(top_box) form.center() runModalOutput = form.run_modal(ok, cancel) form.close() # doesn't actually close the form!! print 'runModalOutput:' print runModalOutput print 'returning...' return 0