Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # DY_propTestPlugin
- from win32com.client import constants as c
- import os
- import shutil
- xsi = Application
- pr = xsi.LogMessage
- def XSILoadPlugin( in_reg ):
- in_reg.Author = "Dan Yargici"
- in_reg.Name = "DY_propTestPlugin"
- in_reg.Major = 1
- in_reg.Minor = 0
- in_reg.RegisterProperty("DY_propTest")
- #RegistrationInsertionPoint - do not remove this line
- return True
- def XSIUnloadPlugin( in_reg ):
- strPluginName = in_reg.Name
- pr(str(strPluginName) + str(" has been unloaded."),c.siVerbose)
- return True
- def DY_propTest_Define( in_ctxt ):
- oCustomProperty = in_ctxt.Source
- oCustomProperty.AddParameter3("ComboMode", c.siInt2, 0, 0, 999, False)
- oCustomProperty.AddParameter3("ComboItems", c.siInt2, 0, 0, 999, False)
- return True
- # Tip: Use the "Refresh" option on the Property Page context menu to
- # reload your script changes and re-execute the DefineLayout callback.
- def DY_propTest_DefineLayout( in_ctxt ):
- buildPPGLayout(PPG)
- return True
- def DY_propTest_ComboMode_OnChanged():
- buildPPGLayout(PPG)
- return True
- def DY_propTest_OnInit( ):
- buildPPGLayout(PPG)
- pr("DY_propTest_OnInit called",c.siVerbose)
- def DY_propTest_OnClosed( ):
- pr("DY_propTest_OnClosed called",c.siVerbose)
- def buildPPGLayout(oPPG):
- oPPGLayout = oPPG.Layout
- oPPGLayout.Clear()
- # Create an array to populate the "Mode" dropdown menu
- modeComboArray = ["ModeA", 0, "ModeB", 1]
- # Create an array to populate the "Workgroups" dropdown menu and an array of paths to lookup
- itemsComboArray = ["ItemA", "ItemB", "ItemC"]
- oPlugin = Application.Plugins("DY_propTestPlugin")
- pluginPath = oPlugin.OriginPath
- oPPGLayout.AddGroup("Mode")
- oPPGLayout.AddEnumControl("ComboMode", modeComboArray, "Chose Mode", c.siControlCombo)
- oPPGLayout.EndGroup()
- if oPPG.ComboMode.value == 1:
- oPPGLayout.AddGroup("Items")
- oPPGLayout.AddEnumControl("ComboItems", itemsComboArray, "Select Item", c.siControlCombo)
- oPPGLayout.EndGroup()
- oPPG.Refresh()
Advertisement
Add Comment
Please, Sign In to add comment