Rev 8 | Rev 5299 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
<!-- #INCLUDE FILE="..\common\adovbs.inc" --><%'============================================================='//'// Action Button Control'//'// version: 1.0'// last modified: 06-Aug-2004 13:38 by Sasha Vukovic'=============================================================%><%'--------------- Global Constants ----------------Const enumABTNCTRL_ON_READONLY_HIDE = 1Const enumABTNCTRL_ON_READONLY_DISABLE = 2'-------------------------------------------------Class ActionButtonControlPrivate mArrAbtnDef()Private mobjNameDefMap ' Item can be accesed by name. Must be unique within one pagePrivate mobjIdDefMap ' Item can be accesed by id. Must be unique within one page. If NULL, ubound is assigned to itPrivate mobjSeparator ' Has a name of item after separator is appliedPrivate mnButtonSpacerPrivate mnButtonTextSpacePrivate mNumOfPropertiesPrivate mLastPropertyInxPrivate mbDisableAllPrivate mbIsReadonlyPrivate mReadonlyActionBehaviourPrivate InxIDPrivate InxNamePrivate InxTxtPrivate InxLinkPrivate InxEventHandlerPrivate InxImgPrivate InxImgOffPrivate InxHintPrivate InxActivePrivate InxIsReadonlyActionPublic Property Let AllActive ( cActive )If cActive = enumDB_NO ThenmbDisableAll = TRUEElsembDisableAll = FALSEEnd IfEnd PropertyPublic Property Let ButtonSpacer ( nWidth )mnButtonSpacer = nWidthEnd PropertyPublic Property Let ButtonTextSpacer ( nWidth )mnButtonTextSpace = nWidthEnd PropertyPublic Property Let IsReadonlyAction ( IsReadonly )If IsReadonly = enumDB_YES ThenmbIsReadonly = TRUEElseIf IsReadonly = enumDB_NO ThenmbIsReadonly = FALSEElsembIsReadonly = IsReadonlyEnd IfEnd PropertyPublic Property Let ReadonlyActionBehaviour ( nEnum )mReadonlyActionBehaviour = nEnumEnd Property'-----------------------------------------------------------------------------------------------------------------Private Sub SetItemPropertyByIndex ( nInx, nProperty, Value )If nInx = "" OR nProperty = "" OR Value = "" Then Err.Raise 8, "Method SetItemPropertyByIndex", "Empty parameters found. nInx="& nInx &", nProperty="& nProperty &", Value="& ValuemArrAbtnDef ( nProperty, nInx ) = Value'Response.write "mArrAbtnDef ( "& nProperty &", "& nInx &" ) = "& Value &"<br>"End Sub'-----------------------------------------------------------------------------------------------------------------Private Function LastItemInx ()LastItemInx = UBound ( mArrAbtnDef, 2 )End Function'-----------------------------------------------------------------------------------------------------------------Public Sub AddActionButton ( sItemName, nItemID )Dim newArrayDimIf InStr( sItemName, " " ) > 0 Then Err.Raise 8, "Method AddActionButton", "Item Name '"& sItemName &"' cannot have spaces."If NOT mobjNameDefMap.Exists (CStr( sItemName )) ThennewArrayDim = LastItemInx() + 1ReDim Preserve mArrAbtnDef( mNumOfProperties, newArrayDim )' Store nameCall SetItemPropertyByIndex ( newArrayDim, InxName, sItemName )mobjNameDefMap.Add Cstr( sItemName ), CStr( newArrayDim )If Not IsNull(nItemID) Then' Store IDCall SetItemPropertyByIndex ( newArrayDim, InxdbID, nItemID )mobjIdDefMap.Add Cstr( nItemID ), CStr( newArrayDim )End If' Set DefaultsCall SetItemDefaults ( sItemName )ElseErr.Raise 8, "Method AddActionButton", "Item Name '"& sItemName &"' has been already defined."End IfEnd Sub'-----------------------------------------------------------------------------------------------------------------Public Sub Render ( aAbtnList )Dim itemInx, itemName, nLastItemInx, btnImage, ButtonStr, ButtonStrDisabledResponse.write "<table cellpadding='0' cellspacing='0' width='1'><tr>"For Each itemName in aAbtnListitemInx = mobjNameDefMap.Item (Cstr(itemName))'If itemInx = "" Then Err.Raise 8, "Method Render", "Definition for item name '"& itemName &"' not found."'-- Define ImagebtnImage = "<img src='images/spacer.gif' width='"& mnButtonSpacer &"' height='1' align='absmiddle' border='0'>"If (mArrAbtnDef( InxImg, itemInx ) <> "") ThenbtnImage = "<img src='"& mArrAbtnDef( InxImg, itemInx ) &"' hspace='"& mnButtonTextSpace &"' border='0' align='absmiddle'>"End If'-- Define ButtonButtonStr = _"<td nowrap>"&_"<a id='"& mArrAbtnDef( InxName, itemInx ) &"' "&_" name='"& mArrAbtnDef( InxName, itemInx ) &"' href='"& Eval( mArrAbtnDef( InxLink, itemInx ) ) &"' "&_" "& Eval( mArrAbtnDef( InxEventHandler, itemInx ) ) &" class='menu_link' title='"& mArrAbtnDef( InxHint, itemInx ) &"'>"&_btnImage & mArrAbtnDef( InxTxt, itemInx ) &"</a>"&_"</td>"'-- Define Disabled ButtonButtonStrDisabled = _"<td nowrap>"&_"<img src='"& mArrAbtnDef( InxImgOff, itemInx ) &"' hspace='2' border='0' align='absmiddle'>"&_"<label class='menu_txt'>"& mArrAbtnDef( InxTxt, itemInx ) &"</label>"&_"</td>"If mbDisableAll OR ( mArrAbtnDef( InxActive, itemInx ) = enumDB_NO ) Then' --- Display DISABLED Button Item ---Response.write ButtonStrDisabledElse' --- Display Action Button Item ---If ( NOT mbIsReadonly ) OR _( mbIsReadonly AND mArrAbtnDef( InxIsReadonlyAction, itemInx ) = enumDB_YES ) ThenIf InStr( itemName, "width=" ) > 0 ThenResponse.write "<td><img src='images/spacer.gif' "& itemName &" height='1' align='absmiddle'></td>"ElseIf InStr( itemName, "height=" ) > 0 ThenResponse.write "<td><img src='images/bg_bage_2.gif' width='1' "& itemName &" align='absmiddle' hspace='4'></td>"Else'/* It is a button, i.e. Display Button */Response.write ButtonStrIf mnButtonSpacer > 0 ThenResponse.write "<td><img src='images/spacer.gif' width='"& mnButtonSpacer &"' height='1' align='absmiddle'></td>"End IfEnd IfElseIf ( mbIsReadonly AND mArrAbtnDef( InxIsReadonlyAction, itemInx ) = enumDB_NO ) ThenIf mReadonlyActionBehaviour = enumABTNCTRL_ON_READONLY_DISABLE ThenResponse.write ButtonStrDisabledEnd IfEnd IfEnd If' --- Separators added manually using method AddSeparator or AddSeparatorAfter ---If mobjSeparator.Exists ( Cstr(mArrAbtnDef( InxName, itemInx )) ) ThenResponse.write "<td><img src='images/spacer.gif' width='"& mobjSeparator.Item ( Cstr(mArrAbtnDef( InxName, itemInx )) ) &"' height='1'></td>"End IfNextResponse.write "</tr></table>"End Sub'-----------------------------------------------------------------------------------------------------------------' Return true if required_abtnName is one of the strings in the aAbtnList string array, else return falsePrivate Function isAbtnRequired (aAbtnList, required_abtnName)Dim this_abtnNameisAbtnRequired = FALSEFor Each this_abtnName in aAbtnListIf 0 = StrComp(this_abtnName, required_abtnName) ThenisAbtnRequired = TRUEExit FunctionEnd IfNextEnd Function'-----------------------------------------------------------------------------------------------------------------Public Sub LoadActionButtons ( aAbtnList, ByRef objOraDatabase )' The following code is now used in place of the earlier code to acquire action button records.'' This code exploits the fact that in ADO 2.8 onwards, you can create ADO DB record sets' without a connection to an actual database. So, to rid ourselves of the need for a DEF_ACTION_BUTTONS' table in the database, we can simply take all of the table's rows and reproduce them here in row' creation and field assignment statements. The rest of the website code will be ignorant of the fact' that the data has not come from the actual database.'' Complicating factors:' 1) Some action button fields (action_link and event_handler) are to be EVAL'ed later on when used' to render the HTML page. This can lead to some very complex looking strings that are difficult to' understand. EVAL allows things like parRtag_id used in a string to be converted to an actual' number (in string form) at time of HTML rendering. We have to use EVAL. There is no other option.'' 2) The strings from the database must also be represented as VBScript strings in the assignments' below. This means that where a string needs to have an embedded " char, two such chars must be' used, and remember about EVAL mentioned above, meaning that sometimes """" has to be used to' give a single " to the resulting string that pops out from EVAL.' Remember also that whilst HTML doesn't care whether you use single or double quotes, javascript' does (it must use single quotes) and VBScript does (it must use double quotes)'' Possible Future Roadmap' 1) Rid the code of ABTN_ID - I dont think we need this field now that we are free of the database'Dim rsQryDim varFieldsDim varValues' Create the object and configure some of its propertiesSet rsQry = Server.CreateObject("ADODB.Recordset")rsQry.CursorLocation = adUseClientrsQry.CursorType = adOpenKeysetrsQry.LockType = adLockOptimistic' Based upon the original DEF_ACTION_BUTTONS table DDL, define the fields (ie. table columns) being simulatedrsQry.Fields.Append "ABTN_ID", adIntegerrsQry.Fields.Append "ABTN_NAME", adVarChar, 64rsQry.Fields.Append "TEXT", adVarChar, 128, adFldIsNullablersQry.Fields.Append "ACTION_LINK", adVarChar, 512, adFldIsNullablersQry.Fields.Append "EVENT_HANDLER", adVarChar, 512, adFldIsNullablersQry.Fields.Append "IMG_ENABLED", adVarChar, 128, adFldIsNullablersQry.Fields.Append "IMG_DISABLED", adVarChar, 128, adFldIsNullablersQry.Fields.Append "HINT", adVarChar, 256, adFldIsNullablersQry.Fields.Append "VISIBLE", adChar, 1rsQry.Fields.Append "ACTIVE", adChar, 1rsQry.Fields.Append "IS_READONLY_ACTION", adChar, 1' open the record set for updatingrsQry.Open' Specify the field order that we are going to use in our row creation statementsvarFields = Array("ABTN_ID", "ABTN_NAME", "TEXT",_"ACTION_LINK",_"EVENT_HANDLER",_"IMG_ENABLED",_"IMG_DISABLED",_"HINT",_"VISIBLE",_"ACTIVE",_"IS_READONLY_ACTION")' Add the rows to the record set, but only for buttons specifed in the list supplied by the caller' Remember, Field Ordering is... ID, name, text, link, event handler, en-img, dis-img, hint, visible, active, is readonly actionIf isAbtnRequired(aAbtnList, "btnNewRole") ThenvarValues = Array(1,"btnNewRole","New Role",_"""javascript:;""",_"""onClick=""""MM_openBrWindow('wAddRole.asp?rfile=RoleList.asp&""& objPMod.ComposeURL() &""','AddRole','scrollbars=yes,resizable=yes,width=600,height=350');""""""",_"images/btn_new_role.gif",_null,_null,_"Y",_"Y",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnRemoveRole") ThenvarValues = Array(2,"btnRemoveRole","Remove Role",_"""javascript:go_submit( document.FormName, """"btnRemoveRole"""" );ShowProgress();""",_"""onClick=""""return confirmAction('Are you sure you want to Remove Role(s) ?');""""""",_"images/btn_remove.gif",_null,_null,_"Y",_"Y",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnNewApplication") ThenvarValues = Array(3,"btnNewApplication","New Application",_"""javascript:;""",_"""onClick=""""MM_openBrWindow('wAddApplication.asp?rfile=ApplicationList.asp&""& objPMod.ComposeURL() &""','AddApplication','scrollbars=yes,resizable=yes,width=600,height=350');""""""",_"images/btn_new_application.gif",_null,_null,_"Y",_"Y",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnRemoveApplication") ThenvarValues = Array(4,"btnRemoveApplication","Remove Application",_"""javascript:go_submit( document.FormName, """"btnRemoveApplication"""" );ShowProgress();""",_"""onClick=""""return confirmAction('Are you sure you want to Remove Application(s) ?');""""""",_"images/btn_remove.gif",_null,_null,_"Y",_"Y",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnNewAccount") ThenvarValues = Array(5,"btnNewAccount","New Account",_"""javascript:;""",_"""onClick=""""MM_openBrWindow('wNewAccount.asp?rfile=UserAccounts.asp&""& objPMod.ComposeURL() &""','NewAccount','scrollbars=yes,resizable=yes,width=600,height=350');""""""",_"images/btn_new_user.gif",_null,_null,_"Y",_"Y",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnRemoveAccount") ThenvarValues = Array(6,"btnRemoveAccount","Remove Account",_"""javascript:go_submit( document.FormName, """"btnRemoveAccount"""" );ShowProgress();""",_"""onClick=""""return confirmAction('Are you sure you want to Remove selected User Account(s)?');""""""",_"images/btn_remove.gif",_null,_null,_"Y",_"Y",_"N")rsQry.AddNew varFields, varValuesEnd If' NOTE: This one doesn't seem to do anything useful - perhaps its implementation was never completed?If isAbtnRequired(aAbtnList, "btnDisableAccount") ThenvarValues = Array(7,"btnDisableAccount","Disable Account",_"""#""",_null,_null,_null,_null,_"Y",_"Y",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnAddUser") ThenvarValues = Array(8,"btnAddUser","Add User",_"""javascript:;""",_"""onClick=""""MM_openBrWindow('wAddApplicationUser.asp?rfile=UserList.asp&""& objPMod.ComposeURL() &""','AddApplicationUser','scrollbars=yes,resizable=yes,width=650,height=800');""""""",_"images/btn_add_user.gif",_null,_null,_"Y",_"Y",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnSubUser") ThenvarValues = Array(9,"btnSubUser","Remove User",_"""javascript:go_submit( document.FormName, """"btnSubUser"""" );ShowProgress();""",_"""onClick=""""return confirmAction('Are you sure you want to Remove User(s) ?');""""""",_"images/btn_sub_user.gif",_null,_null,_"Y",_"Y",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnNewControl") ThenvarValues = Array(10,"btnNewControl","New Control",_"""javascript:;""",_"""onClick=""""MM_openBrWindow('wAddControl.asp?rfile=ControlList.asp&""& objPMod.ComposeURL() &""','AddControl','scrollbars=yes,resizable=yes,width=650,height=400');""""""",_"images/btn_new_control.gif",_null,_null,_"Y",_"Y",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnRemoveControl") ThenvarValues = Array(11,"btnRemoveControl","Remove Control",_"""javascript:go_submit( document.FormName, """"btnRemoveControl"""" );ShowProgress();""",_"""onClick=""""return confirmAction('Are you sure you want to Remove Control(s) ?');""""""",_"images/btn_remove.gif",_null,_null,_"Y",_"Y",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnGrantRole") ThenvarValues = Array(14,"btnGrantRole","Grant Role",_"""javascript:;""",_"""onClick=""""MM_openBrWindow('wGrantRole.asp?rfile=User_Roles.asp&""& objPMod.ComposeURL() &""','GrantRole','scrollbars=yes,resizable=yes,width=650,height=700');""""""",_"images/btn_add_role.gif",_"images/btn_add_role_disabled.gif",_"Grant Role to this User",_"Y",_"Y",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnRevokeRole") ThenvarValues = Array(15,"btnRevokeRole","Revoke Role",_"""javascript:go_submit( document.FormName, """"btnRevokeRole"""" );ShowProgress();""",_"""onClick=""""return confirmAction('Are you sure you want to Revoke Role(s) ?');""""""",_"images/btn_sub_role.gif",_"images/btn_sub_role_disabled.gif",_"Revoke Role from this User",_"Y",_"Y",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnAddMember") ThenvarValues = Array(16,"btnAddMember","Add Member",_"""javascript:;""",_"""onClick=""""MM_openBrWindow('wAddRoleMember.asp?rfile=Role_Members.asp&""& objPMod.ComposeURL() &""','AddRoleMember','scrollbars=yes,resizable=yes,width=650,height=800');""""""",_"images/btn_add_user.gif",_null,_"Add Memeber to this Role",_"Y",_"Y",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnSubMember") ThenvarValues = Array(17,"btnSubMember","Remove Member",_"""javascript:go_submit( document.FormName, """"btnSubMember"""" );ShowProgress();""",_"""onClick=""""return confirmAction('Are you sure you want to Remove Member(s) ?');""""""",_"images/btn_sub_user.gif",_null,_"Remove Member from this Role",_"Y",_"Y",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnNewDataTable") ThenvarValues = Array(18,"btnNewDataTable","New Data Table",_"""javascript:;""",_"""onClick=""""MM_openBrWindow('wAddDataTable.asp?rfile=Role_DataFiltering.asp&""& objPMod.ComposeURL() &""','AddDataTable','scrollbars=yes,resizable=yes,width=650,height=400');""""""",_"images/btn_new_datatable.gif",_null,_"Add New Data Table",_"Y",_"Y",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnRemoveDataTable") ThenvarValues = Array(19,"btnRemoveDataTable",null,_"""_RemoveDataTable.asp?rfile=""& SCRIPT_NAME &""&dt_id=""& DtId &""&""& objPMod.ComposeURL()",_"""onClick=""""return confirmAction('Remove \'""& DataTableName &""\' from this list?');""""""",_"images/i_remove.gif",_null,_"Remove this Data Table",_"Y",_"Y",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnRoleMembers") ThenvarValues = Array(20,"btnRoleMembers","Show Members",_"""javascript:go_submit( document.FormName, """"btnRoleMembers"""" );ShowProgress();""",_null,_"images/i_user_lrg.gif",_null,_null,_"Y",_"Y",_"Y")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnAddApplicationUser") ThenvarValues = Array(21,"btnAddApplicationUser","Add To Application",_"""javascript:;""",_"""onClick=""""MM_openBrWindow('wAddToApplication.asp?rfile=User_Applications.asp&""& objPMod.ComposeURL() &""','AddToApplication','scrollbars=yes,resizable=yes,width=450,height=350');""""""",_"images/btn_add_application.gif",_null,_null,_"Y",_"Y",_"N")rsQry.AddNew varFields, varValuesEnd IfIf isAbtnRequired(aAbtnList, "btnSubApplicationUser") ThenvarValues = Array(22,"btnSubApplicationUser","Remove From Application",_"""javascript:;""",_"""onClick=""""MM_openBrWindow('wRemoveFromApplication.asp?rfile=User_Applications.asp&""& objPMod.ComposeURLWith(""user_id,tree"") &""','RemoveFromApplication','scrollbars=yes,resizable=yes,width=450,height=350');""""""",_"images/btn_sub_application.gif",_null,_null,_"Y",_"Y",_"N")rsQry.AddNew varFields, varValuesEnd If' NOTE: Jeremy may have intended to add another to allow access to the wEditAccount.asp' file (on manager_suite_development_dump branch). It seemed like he never got around to it though.' Move cursor to the first recordIf rsQry.RecordCount > 0 ThenrsQry.MoveFirstIf ((NOT rsQry.BOF) AND (NOT rsQry.EOF)) ThenCall LoadButtons ( rsQry.GetRows() )End IfEnd IfrsQry.CloseSet rsQry = NothingEnd Sub'-----------------------------------------------------------------------------------------------------------------Public Sub LoadButtons ( aRows )Dim nProperty, newArrayDim, LastRow, rowNumLastRow = UBound( aRows, 2 )For rowNum = 0 To LastRow' Increase array by 1newArrayDim = LastRowInx() + 1ReDim Preserve mArrAbtnDef( mNumOfProperties, newArrayDim )mobjNameDefMap.Item ( Cstr( aRows ( InxName, rowNum ) ) ) = newArrayDimFor nProperty = 0 To mLastPropertyInxmArrAbtnDef ( nProperty, newArrayDim ) = aRows ( nProperty, rowNum )NextNextEnd Sub'-----------------------------------------------------------------------------------------------------------------Private Function LastRowInx ()LastRowInx = UBound ( mArrAbtnDef, 2 )End Function'-----------------------------------------------------------------------------------------------------------------Public Sub AddSeparatorAfter ( sItemName, sSeparatorWidth )If InStr( sItemName, " " ) > 0 Then Err.Raise 8, "Method AddSeparatorAfter", "Item Name '"& sItemName &"' cannot have spaces."mobjSeparator.Add (Cstr(sItemName)), CStr(sSeparatorWidth)End Sub'-----------------------------------------------------------------------------------------------------------------Public Sub AddSeparator ( sSeparatorWidth )mobjSeparator.Add ( Cstr(mArrAbtnDef(InxName, LastItemInx())) ), CStr(sSeparatorWidth)End Sub'-----------------------------------------------------------------------------------------------------------------Private Sub SetItemDefaults ( sItemName )' Additional default setupCall SetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxActive, enumDB_YES ) ' Default Active = enumDB_YESEnd Sub'-----------------------------------------------------------------------------------------------------------------Public Sub Text ( sItemName, Value )Call SetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxTxt, Value )End Sub'-----------------------------------------------------------------------------------------------------------------Public Sub ItemID ( sItemName, Value )Call SetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxID, Value )End Sub'-----------------------------------------------------------------------------------------------------------------Public Sub Image ( sItemName, Value )Call SetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxImg, Value )Call SetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxImgOff, Value ) ' Default image disable to be the same as imageEnd Sub'-----------------------------------------------------------------------------------------------------------------Public Sub ImageOff ( sItemName, Value )Call SetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxImgOff, Value )End Sub'-----------------------------------------------------------------------------------------------------------------Public Sub Link ( sItemName, Value )Call SetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxLink, Value )End Sub'-----------------------------------------------------------------------------------------------------------------Public Sub EventHandler ( sItemName, Value )Call SetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxEventHandler, Value )End Sub'-----------------------------------------------------------------------------------------------------------------Public Sub Hint ( sItemName, Value )Call SetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxHint, Value )End Sub'-----------------------------------------------------------------------------------------------------------------Public Sub Active ( sItemName, Value )'Response.write sItemName &"here"& mobjNameDefMap.Item (Cstr(sItemName))Call SetItemPropertyByIndex ( mobjNameDefMap.Item (Cstr(sItemName)), InxActive, Value )End Sub'-----------------------------------------------------------------------------------------------------------------Private Sub Class_Initialize()'// Perform action on creation of object. e.g. Set myObj = New ThisClassNameSet mobjNameDefMap = CreateObject("Scripting.Dictionary")Set mobjIdDefMap = CreateObject("Scripting.Dictionary")Set mobjSeparator = CreateObject("Scripting.Dictionary")'mbIsReadonly = FALSE ' Tell control that it should use only readonly action buttons (i.e. actions which will not alter database )mReadonlyActionBehaviour = enumABTNCTRL_ON_READONLY_HIDE ' Tell control what to do by default if mbIsReadonly = TRUEmnButtonSpacer = 0mnButtonTextSpace = 4mNumOfProperties = 10 ' Number of properties in array which define one menu item.mLastPropertyInx = mNumOfProperties - 1mbDisableAll = FALSEReDim mArrAbtnDef ( mNumOfProperties, -1 )InxID = 0InxName = 1InxTxt = 2InxLink = 3InxEventHandler = 4InxImg = 5InxImgOff = 6InxHint = 7InxActive = 8InxIsReadonlyAction = 9End Sub'-----------------------------------------------------------------------------------------------------------------Private Sub Class_Terminate()'// Perform action on object disposal. e.g. Set myObj = NothingSet mobjNameDefMap = NothingSet mobjIdDefMap = NothingSet mobjSeparator = NothingEnd Sub'-----------------------------------------------------------------------------------------------------------------End Class%>