Source code for SaveProfile

"""
:filename:     SaveProfile.py
:author:       thor@tordivel.no
:requirements: Scorpion 9.0.0.493 or higher

Scorpion button panel plugin for saving of profile

::

  1.0.0.2, 11nov2015, RL: modified for autodoc
"""

__version__ = '1.0.0.2'

from Scorpion import PluginNotify,GetControlByHandle,ExecuteCmd,GetTool,SelectTagname,InputStr

[docs]class Save(object): def __init__(self,cntr,name): self.name=name cntr.deleteControls() #delete previous added controls if any self.button=cntr.addControl('Button',0,0) self.button.left=10 self.button.top=10 self.button.align = 5 self.button.anchors = 2 self.button.caption='Save' self.button.font.bold=1 self.button.onClick=self.buttonClick def __del__(self): #print self,'__del__' pass
[docs] def __str__(self): ''' return a unique persistance name for host application storage ''' return '%s_%s'%(self.__class__.__name__,self.name)
[docs] def buttonClick(self,sender,args): ''' button click handler ''' if sender==self.button: ExecuteCmd('Profile','Cmd=Save')
[docs]def CreatePlugin(hWnd, name=''): ''' Scorpion Plugin Stub - Required ''' cntr=GetControlByHandle(hWnd) return Save(cntr,name)