ribbonabc | index c:\simcadev\simca\dev\sln\output\simcax64\debugexe\ribbonabc.py

Classes
`` |  | builtins.object RibbonAddInABC
class RibbonAddInABC(builtins.object)
`` | `Abstract base class for making add-ins in SIMCA. To add a command button to the ribbon in simca, make a class that inherits RibbonAddInABC and overload get_button_name() and on_command(). Optionally overload enable_command if the button needs to be disabled. Optionally, in the derived class __init__() method set: tooltip to the tooltip text used for the button. icon_file_name to the name of the file that contains the button icon. The resulting buttons will be placed in the same ribbon group when several classes in the same module inherits RibbonAddInABC. Use variables group_name and group_order to control the name of the group and the order of the buttons within the group (see example). Attributes: icon_file_name The name of a file that contains an icon for the button. Note that this is only the name of the file ('myicon.png'), not the full path to the file (r'c:\icons\myicon.png'). The icon file must be located in the same directory as the module that contains the class that defines the command button. Supported file formats are bmp, png, jpeg, wmf, ico and gif. Size for full height buttons are 32*32 pixels and 16*16 pixels for half height buttons. If the string is empty (the default) a default icon will be used. tooltip Set this to the tooltip string that will be displayed when the user hoovers over the button. Example: from ribbonabc import RibbonAddInABC from tkinter import messagebox, Tk from umetrics import SimcaApp def show_message(message): # Show a tkinter messagebox with the message. tk_main=Tk() tk_main.withdraw() messagebox.showinfo(title='Ribbon add in', message=message) tk_main.destroy() class CompleteCommand(RibbonAddInABC): def __init__(Self): Self.icon_file_name = 'ribbon_example.png' Self.tooltip = 'This example has an enabler, a small button, an icon and a tooltip' def enable_command(Self): # Disable button if SIMCA has no active project with SimcaApp.get_active_project() as project: if not project: return False return True def on_command(Self): show_message('Complete example clicked') def get_button_name(Self): return 'Complete' class MinimalCommand(RibbonAddInABC): def on_command(Self): show_message('Minimal example clicked') def get_button_name(Self): return 'Minimal' group_name = 'Ribbon example' group_order = [MinimalCommand, CompleteCommand]`
| Methods defined here: enable_command(Self) `Overload enable_command if the button should be disabled sometimes. Return True to enable the button and False to disable it. The method will be called whenever SIMCA is idle so it is important that it is fast. The default is to always enable the button.` get_button_name(Self) `get_button_name must be overloaded and return a string that contains the name of the command button.` on_command(Self) `on_command must be overloaded. It will be called when the user presses the button.` Data descriptors defined here: __dict__ `dictionary for instance variables (if defined)` __weakref__ `list of weak references to the object (if defined)` Data and other attributes defined here: __abstractmethods__ = frozenset({'get_button_name', 'on_command'}) icon_file_name = '' tooltip = ''