/* Devin Editor - DMS - November 00 - by François Chenebit */ /* With this editor you can modify the following parameters associated with the module : - The name of the ODBC alias to the base - Login and Password on that Base - name of the Login table. This table is NOT the main login table, with the password, but a secondary table just for this module, with a login field. Its default name is login prediction - name of the password table - a Boolen that indicate wheter the last prediction is returned or not when less than 24 hours passed since the last prédiction. */ /* globals variables */ /* graphical objects of the editor window */ typeof OTBaseName=ObjText;; typeof OTBaseLogin=ObjText;; typeof OTBasePassword=ObjText;; typeof OTLoginTableName=ObjText;; typeof OTPredictionTableName=ObjText;; typeof OCBehavior=ObjCheck;; /* save callback function : this function save the events, the actions and the zone of the module, and the parameters values parameters and return value : standard save callback value */ fun Save(Str,N)= ( ("action"::"askRandomPrediction"::"askRandomPrediction"::nil):: ("action"::"askPrecisePrediction"::"askPrecisePrediction"::nil):: ("action"::"editDatabase"::"editDatabase"::nil):: ("action"::"createPrediction"::"createPrediction"::nil):: ("action"::"updatePrediction"::"updatePrediction"::nil):: ("action"::"deletePrediction"::"deletePrediction"::nil):: ("event"::"sendRandomPrediction"::"sendRandomPrediction"::nil):: ("event"::"sendPrecisePrediction"::"sendPrecisePrediction"::nil):: ("event"::"sendModificationResult"::"sendModificationResult"::nil):: ("ZoneC"::"ListeDesPredictions"::nil):: ("ZoneC"::"DetailPrediction"::nil):: ("ZoneC"::"PaletteBoutonAction"::nil):: ("ZoneC"::"PaletteBoutonFenetre"::nil):: ("BaseName"::(_GETtext OTBaseName)::nil):: ("BaseLogin"::(_GETtext OTBaseLogin)::nil):: ("BasePassword"::(_GETtext OTBasePassword)::nil):: ("LoginTableName"::(_GETtext OTLoginTableName)::nil):: ("PredictionTableName"::(_GETtext OTPredictionTableName)::nil):: ("Behavior"::( itoa _GETcheck OCBehavior)::nil):: nil );; /* load callback function : this function set the differents controls of the windows to the parametes values parameters and return values : standards */ fun Load (L)= ( _SETtext OTBaseName getInfo L "BaseName"; _SETtext OTBaseLogin getInfo L "BaseLogin"; _SETtext OTBasePassword getInfo L "BasePassword"; _SETtext OTLoginTableName getInfo L "LoginTableName"; _SETtext OTPredictionTableName getInfo L "PredictionTableName"; _SETcheck OCBehavior atoi getInfo L "Behavior"; 0 );; /* editor opening function. It opens the editor, set the callbacks, and create the editor function parameters and return values : standard */ fun IniEditor (Str)= ( /* editor starting up, and callback setting */ let startEditor _channel nil nil nil 360 180 WN_NORMAL EDITOR_NORMAL Str nil nil nil @Load @Save nil -> ed in ( let getEditWin ed -> OWeditWin in ( /* window creation : label, edit zone and check box creation */ _CRtext _channel OWeditWin 0 10 188 20 ET_ALIGN_RIGHT strcat (_locEditor "NomBaseLabel" nil) " :"; _CRtext _channel OWeditWin 0 35 188 20 ET_ALIGN_RIGHT strcat (_locEditor "LoginBaseLabel" nil) " :"; _CRtext _channel OWeditWin 0 60 188 20 ET_ALIGN_RIGHT strcat (_locEditor "PasswordBaseLabel" nil) " :"; _CRtext _channel OWeditWin 0 85 188 20 ET_ALIGN_RIGHT strcat (_locEditor "NomTableLoginLabel" nil) " :"; _CRtext _channel OWeditWin 0 110 188 20 ET_ALIGN_RIGHT strcat (_locEditor "NomTablePredictionLabel" nil) " :"; _CRtext _channel OWeditWin 0 153 300 20 ET_ALIGN_RIGHT (_locEditor "ComportementCheckLabel" nil) ; /* default values are set, but they will be be replaced by the load value if any, because the load function is called after the IniEditor function */ set OTBaseName = _CReditLine _channel OWeditWin 190 5 150 20 ET_DOWN|ET_TABFOCUS "BASE_SCOL"; set OTBaseLogin = _CReditLine _channel OWeditWin 190 30 150 20 ET_DOWN|ET_TABFOCUS "admin"; set OTBasePassword = _CReditLine _channel OWeditWin 190 55 150 20 ET_DOWN|ET_TABFOCUS|ET_PASSWORD ""; set OTLoginTableName = _CReditLine _channel OWeditWin 190 80 150 20 ET_DOWN|ET_TABFOCUS "tableDevinUsers"; set OTPredictionTableName = _CReditLine _channel OWeditWin 190 105 150 20 ET_DOWN|ET_TABFOCUS "tablePrediction"; set OCBehavior = _CRcheck _channel OWeditWin 300 150 15 20 CH_LEFT|CH_TABFOCUS nil; /* IniEditor ending */ if Str==nil then ( nil ) else ( openDMI ed ) ) ); 0 );;