// LinksetSelect.dxl v1.1s (LinkMod, NoChange, All Users) - Display LinkModule LinkSets const string c_Version = "LinksetSelect.dxl v1.1s" /* LinksetSelect.dxl provides a wide dialog box of all linksets in the link module, allowing the user to select on and load the linkset. This is needed because the normal linkset interface offers only a very narrow window displaying the link sets, and its impossible to distinguish them when the modul names and paths are long. */ /* Copyright (c) 2000 Quality Systems & Software, Inc. linkset_select.dxl This utility will allow users to load linksets into a DOORS Link module. This software is provided "as-is" and QSS, QSS' suppliers, licensors and affiliates (collectively "QSS") make no warranties, express or implied including merchantability, fitness for a particular use or purpose, title, non-infringement or any other warranty, condition, guaranty, or representation whether oral, in writing or in electronic form, including but not limited to, the integrity of the software, the existence of bugs, viruses or other disabling devices, or the accuracy or completeness of any information contained therein. your use of the software is entirely at your own risk. QSS will not be responsible to you or any third parties for any direct or indirect, consequential, special or punitive damages or losses you may incur in connection with the software. Your use of the software or any data or other materials generated from use of the software, regardless of the type of claim or the nature of the cause of action, even if QSS has been advised of the possibility of such damage or loss. Because this software is provided "as is", QSS will not provide support of any kind, including, but not limited to, help desk, upgrades, updates, bug fixes or enhancements. */ /* Revision History v 1.0 02-Apr-03 Modified by Landale from old QSS script. v 1.1 02-Jun-26 Tweaked width of display. Renamed to LinksetSelect.dxl from linkset_select.dxl 1.1a 03-Mar-6 Comment Improvements. 1.1s 04-Mar-31 fDoScriptStartup; Standardized */ #include pragma runLim, 0 fDoScriptStartup(c_Version) Module g_modCurrent = current // constants const string SARR_EMPTY[] = {} // constants const string S_ATTR_SOURCE = "source" const string S_ATTR_TARGET = "target" // dxl dialog DB dlg = null // dxl elements DBE dbeList, btnLoad, btnClose // triggers Trigger g_trgModule = null // globals /* +-----------------------------------------------------------------------------+ | | | Function : fnPrepareList | | | | Description: Cycles through each object (i.e. linkset) and adds an entry | | to the 'dbeList' DBE showing both source and target modules. | | | | Returns : - | | | +-----------------------------------------------------------------------------+ */ void fnPrepareList() { Object o // process module for o in g_modCurrent do { // obtain source and target modules string sSource = probeAttr_(o, S_ATTR_SOURCE) string sTarget = probeAttr_(o, S_ATTR_TARGET) // add to list insert(dbeList, noElems(dbeList), (sSource " -> " sTarget), iconNone) } } /* +-----------------------------------------------------------------------------+ | | | Function : fnLoad | | | | Description: Callback function used in association with 'btnLoad' DBE. | | | | Returns : - | | | +-----------------------------------------------------------------------------+ */ void fnLoad(DBE xx) { string sLinkset = get dbeList // only relevant if linkset was selected if (sLinkset != null) { Regexp r = regexp ">.*" // search string if (r sLinkset) { Object o // obtain source and target modules string sSource = sLinkset[0:start 0-10] string sTarget = sLinkset[start 0+2:] // process module for o in g_modCurrent do { // match source and target if (probeAttr_(o, S_ATTR_SOURCE) == sSource && probeAttr_(o, S_ATTR_TARGET) == sTarget) { // attempt load string sError // unloading simply allows new linkset name to be // displayed in the LinkModule linkset drop down list unload(g_modCurrent) sError = load(linkset o) refresh (g_modCurrent) // check status if (sError == null) { // you might want to adjust the z-order of the module here... } else { // warn user errorBox(dlg, "Error loading linkset: '" sError "'") } } } } } else { // warn user warningBox(dlg, "You have not selected a linkset to load.") } } /* +-----------------------------------------------------------------------------+ | | | Function : fnClose | | | | Description: Callback function used in association with 'btnClose' DBE. | | | | Returns : - | | | +-----------------------------------------------------------------------------+ */ void fnClose(DBE xx) { // tidy up { // delete trigger if (g_trgModule != null) delete(g_trgModule) } release dlg hide dlg destroy dlg flushDeletions() } /* +-----------------------------------------------------------------------------+ | | | Function : fnClose | | | | Description: Callback function used in association with window close. | | | | Returns : - | | | +-----------------------------------------------------------------------------+ */ void fnClose(DB xx) { fnClose(btnClose) } /* +-----------------------------------------------------------------------------+ | | | Function : fnListActivate | | | | Description: Callback function used in association with 'dbeList' DBE. | | | | Returns : - | | | +-----------------------------------------------------------------------------+ */ void fnListActivate(DBE xx, int iSelected) { fnLoad(xx) } /* +-----------------------------------------------------------------------------+ | | | Function : fnDummy | | | | Description: Callback function used in association with 'dbeList' DBE. | | | | Returns : - | | | +-----------------------------------------------------------------------------+ */ void fnDummy(DBE xx, int iSelected) { } /* +-----------------------------------------------------------------------------+ | | | Function : fnTrigger | | | | Description: Callback function used in association with module trigger. | | | | Returns : - | | | +-----------------------------------------------------------------------------+ */ bool fnTrigger(Trigger xx) { fnClose(dlg) return true } // ********* MAIN ********* const int c_Width = 850 string NameMod // only relevant for link modules if (g_modCurrent != null && type(g_modCurrent) == "Link") { NameMod = fullName(g_modCurrent) // dialog dlg = create(g_modCurrent, c_Version " '" name(g_modCurrent) "'", styleCentred) // trigger g_trgModule = trigger(module, close, 10, fnTrigger) // list view dbeList = listView(dlg, 0, c_Width, 10, SARR_EMPTY) dbeList->"top"->"form" dbeList->"left"->"form" dbeList->"bottom"->"unattached" dbeList->"right"->"form" // button btnClose = button(dlg, "Close", fnClose, styleStandardSize | styleIsCloseBtn) btnClose->"top"->"spaced"->dbeList btnClose->"left"->"unattached" btnClose->"bottom"->"form" btnClose->"right"->"form" // button btnLoad = button(dlg, "Load", fnLoad, styleStandardSize) btnLoad->"top"->"spaced"->dbeList btnLoad->"left"->"unattached" btnLoad->"bottom"->"form" btnLoad->"right"->"spaced"->btnClose close(dlg, false, fnClose) realize dlg { // callback set(dbeList, fnDummy, fnDummy, fnListActivate) // info is displayed over a single column insertColumn(dbeList, 0, "Linksets in '" NameMod "':", c_Width-25, iconNone) // insert linkset summaries into list fnPrepareList() } show dlg } else { // warn user errorBox(dbExplorer, "You must run this utility from a DOORS Link Module.") } // ---- end file LinksetSelect.dxl ---- -- end file LinksetSelect.dxl -