////////////////////////////////////////////////////////////////// // GML CONTORLS RULES #ALIAS[g=core.svg:GmlDrawing] #INCLUDE[gml:defs.inc] Configure RULES var category = 'Controls'; ////////////////////////////////////////////////////////////////// // defineDanglingMenu rule $ENV.defineRule({ id:'getDefaultControls', category:category, parameters:'gml:Unit unit!,gml:Interactor interactor!', restrictive:true }); $ENV.extendRule('getDefaultControls', { constraint:'interactor isa gml:Interactor', behavior:function() { var map = {} ; return map; }, comments:'⇒ Interactor' }); ///////////////////////////////////////////////////////////// // RULE: get control columns $ENV.defineRule({ id:'getControlColumns', category:category, description:'Gets the controls columns that will be displayed in the Detailed Pane', parameters:'gml:Unit unit!,gml:Interactor interactor!, env:GRID_DEF[] columns', restrictive:true }); $ENV.extendRule('getControlColumns', { constraint:'interactor isa gml:Interactor', behavior:function() { columns.push({id: 'mandatory', 'type': 'expr', exprType: #[BOOLEAN], caption: '#TEXT[XCOL_MANDATORY]'}); columns.push({id: 'readOnly', 'type': 'expr', exprType: #[BOOLEAN], caption: '#TEXT[XCOL_READ_ONLY]'}); columns.push({id: 'disable', 'type': 'expr', exprType: #[BOOLEAN], caption: '#TEXT[XCOL_DISABLE]'}); columns.push({id: 'tooltip' , 'type': 'expr', caption: '#TEXT[XCOL_TOOL_TIP]'}); return true; }, comments:'⇒ Interactor' }); ////////////////////////////////////////////////////////////////// // getAllowedControlsMenu rule $ENV.defineRule({ id:'getAllowedControlsMenu', category:category, description: 'This Rule is used for defining the menu items that are available per Unit and/or Interactor.'+ ' The menu parameter is used for collecting the menu items.', parameters:'gml:Unit unit!,gml:Interactor interactor!, env:MENU_BAR menu , gml:Control control!, gml:Element parent!', additive:true }); $ENV.extendRule('getAllowedControlsMenu', { constraint:'interactor isa gml:Interactor', behavior:function() { var classObj = CLASS('gml:InputField'); var createControl= function (signal) { interactor.createControl(signal, null, {label:'New Control',index:9999}); //SIGNAL('DETAILS->refresh'); return true; } menu.append({signal:classObj.fullname , callback: createControl, text:classObj.metadata.title , icon:classObj.metadata.icon16}); }, comments:'⇒ Interactor' }); ////////////////////////////////////////////////////////////////// // copyControlValues rule $ENV.defineRule({ id:'copyControlValues', category:category, description:'Copies the values of the given source control to the given target control', parameters:'gml:Unit unit!, gml:Interactor interactor!, gml:Control srcControl!, gml:Control trgControl!', restrictive:true });