Thanx Eric for taking the time to help me out, I appreciate it a lot. I'm enclosing the script so that you could have a clearer idea. onInit function seemed the most ideal place to make the declaration, yet I couldn't get the defined objects to be recognized in the following parts like function Aa() that executes a snippet when the assigned button is pressed through the function AJ_ARAYUZ_DENE_IconSel_OnChanged(). Is there any way to point to this ppg through its code so that its variable is recognized in every function that follows?
Code: Select all
function XSILoadPlugin( in_reg )
in_reg.Author = "AJ"
in_reg.Name = "AJ_ARAYUZ_DENEPlugin"
in_reg.Major = 1
in_reg.Minor = 1
in_reg.RegisterProperty "AJ_ARAYUZ_DENE"
in_reg.RegisterCommand "AJ_ARAYUZ_DENE", "StartAJ_ARAYUZ_DENE"
XSILoadPlugin = true
end function
function AJ_ARAYUZ_DENE_Define( ctxt )
dim oCustomProperty
set oCustomProperty = ctxt.Source
oCustomProperty.AddParameter2 "IconSel", siInt4, -1,-1, 9 ,-1, 9,0
oCustomProperty.AddParameter2 "SyNop",siString,"",,,,,0,siPersistable
oCustomProperty.AddParameter2 "StaticBitmapControl",siString
oCustomProperty.SyNop.value = "G:\AJ_XSI_WGROUP\Application\synoptic\embeddedsynoptic.htm"
AJ_ARAYUZ_DENE_Define = true
end function
function AJ_ARAYUZ_DENE_DefineLayout( ctxt )
dim oLayout,iList,oItem
set oLayout = ctxt.Source
oLayout.Clear
iconpath = "C:\Users\JACOBO\Desktop\EYE"
aBitmaplist=array( _
iconpath + "\RIGHT_EYE_NORMAL.bmp" , 0 , _
iconpath + "\RIGHT_EYE_SHOCKED.bmp" , 1)
oLayout.AddTab "EXAMPLE"
oLayout.AddGroup "BITMAP"
Set oItem = oLayout.AddItem( "StaticBitmapControl", "Static Bitmap", siControlBitmap )
oItem.SetAttribute siUIFilePath, ActiveProject2.Path + "\Pictures\INTERFACE\MAKEITS.bmp"
oItem.setattribute siUINoLabel,true
oLayout.EndGroup
oLayout.AddGroup "Tools"
oLayout.AddRow
set iList=oLayout.AddEnumControl ("IconSel", aBitmaplist, , siControlIconList)
iList.SetAttribute "Nolabel", true
iList.SetAttribute "UseSelIcon", 1
oLayout.EndRow
oLayout.EndGroup
oLayout.AddGroup "SYNOPTIC"
set oItem = oLayout.AddItem("SyNop", "", siControlSynoptic)
oItem.setattribute siUINoLabel,true
oLayout.EndGroup
oLayout.AddTab "EXAMPLE"
oLayout.AddGroup "BITMAP"
Set oItem = oLayout.AddItem( "StaticBitmapControl", "Static Bitmap", siControlBitmap )
oItem.SetAttribute siUIFilePath, ActiveProject2.Path + "\Pictures\INTERFACE\MAKEITS.bmp"
oItem.setattribute siUINoLabel,true
oLayout.EndGroup
AJ_ARAYUZ_DENE_DefineLayout = true
end function
function AJ_ARAYUZ_DENE_OnInit( )
Application.LogMessage "OnInit called"
end function
function AJ_ARAYUZ_DENE_IconSel_OnChanged()
pIconSel=PPG.IconSel.Value
select case pIconSel
case 0
Aa()
case 1
Ba()
case else
fToolbar(pIconSel)
end select
end function
function Aa()
end function
function Ba()
end function