/******************************************************************************* Module Pager3 Editor part Version: 1.0 Authors: Bob Le Gob Code based on Pager2 v3.0 - Authors: Laurent PLUMAT, Marc BARILLEY, Christophe LOREK Last update: 02/02/2003 Pager Module *******************************************************************************/ typeof editWin = ObjWin;; typeof LBNoMsgBMP = ObjText;; typeof PBNoMsgBMP = ObjButton;; typeof BMPNoMsgBMP = ObjBitmap;; typeof LBIncomingMsgBMP = ObjText;; typeof PBIncomingMsgBMP = ObjButton;; typeof BMPIncomingMsgBMP = ObjBitmap;; typeof LBIncomingMsgGoneBMP = ObjText;; typeof PBIncomingMsgGoneBMP = ObjButton;; typeof BMPIncomingMsgGoneBMP = ObjBitmap;; typeof LBBlinkUpBMP = ObjText;; typeof PBBlinkUpBMP = ObjButton;; typeof BMPBlinkUpBMP = ObjBitmap;; typeof LBBlinkDownBMP = ObjText;; typeof PBBlinkDownBMP = ObjButton;; typeof BMPBlinkDownBMP = ObjBitmap;; typeof CKhistory = ObjCheck;; typeof NoMsgBMP = S;; typeof IncomingMsgBMP = S;; typeof IncomingMsgGoneBMP = S;; typeof IgnoreBMP = S;; typeof BlinkUpBMP = S;; typeof BlinkDownBMP = S;; /******************************************************************************* load the parameters for a module instance l -> [[S r1] r1] : the dmi contents editor -> Editor : editor <- I : nothing special *******************************************************************************/ fun cbload (l) = let (getInfo l "NoMsgBMP")-> txt in if txt == nil then set NoMsgBMP = "Dms/CommTools/Pager3/images/tree.nomsg.png" else set NoMsgBMP = txt; let (getInfo l "IncomingMsgBMP")-> txt in if txt == nil then set IncomingMsgBMP = "Dms/CommTools/Pager3/images/tree.incomingmsg.png" else set IncomingMsgBMP = txt; let (getInfo l "IncomingMsgGoneBMP")-> txt in if txt == nil then set IncomingMsgGoneBMP = "Dms/CommTools/Pager3/images/tree.incomingmsg.gone.png" else set IncomingMsgGoneBMP = txt; let (getInfo l "BlinkUpBMP")-> txt in if txt == nil then set BlinkUpBMP = "Dms/CommTools/Pager3/images/blinkup.bmp" else set BlinkUpBMP = txt; let (getInfo l "BlinkDownBMP")-> txt in if txt == nil then set BlinkDownBMP = "Dms/CommTools/Pager3/images/blinkdown.bmp" else set BlinkDownBMP = txt; _SETcheck CKhistory if !strcmp (getInfo l "KeepHistory") "yes" then 1 else 0; let _LDalphaBitmap _channel (_checkpack NoMsgBMP) -> tmpbmp in ( if tmpbmp==nil then set tmpbmp = _CRalphaBitmap _channel _LDjpeg _channel (_checkpack NoMsgBMP) nil nil nil else nil; let _GETalphaBitmapSize tmpbmp -> [bmpw bmph] in ( _SCPalphaBitmap BMPNoMsgBMP 0 0 15 15 tmpbmp 0 0 bmpw-1 bmph-1; _SETbuttonBitmap PBNoMsgBMP BMPNoMsgBMP; _DSalphaBitmap tmpbmp ) ); let _LDalphaBitmap _channel (_checkpack IncomingMsgBMP) -> tmpbmp in ( if tmpbmp==nil then set tmpbmp = _CRalphaBitmap _channel _LDjpeg _channel (_checkpack IncomingMsgBMP) nil nil nil else nil; let _GETalphaBitmapSize tmpbmp -> [bmpw bmph] in ( _SCPalphaBitmap BMPIncomingMsgBMP 0 0 15 15 tmpbmp 0 0 bmpw-1 bmph-1; _SETbuttonBitmap PBIncomingMsgBMP BMPIncomingMsgBMP; _DSalphaBitmap tmpbmp ) ); let _LDalphaBitmap _channel (_checkpack IncomingMsgGoneBMP) -> tmpbmp in ( if tmpbmp==nil then set tmpbmp = _CRalphaBitmap _channel _LDjpeg _channel (_checkpack IncomingMsgGoneBMP) nil nil nil else nil; let _GETalphaBitmapSize tmpbmp -> [bmpw bmph] in ( _SCPalphaBitmap BMPIncomingMsgGoneBMP 0 0 15 15 tmpbmp 0 0 bmpw-1 bmph-1; _SETbuttonBitmap PBIncomingMsgGoneBMP BMPIncomingMsgGoneBMP; _DSalphaBitmap tmpbmp ) ); let _LDbitmap _channel (_checkpack BlinkUpBMP) -> tmpbmp in ( if tmpbmp==nil then set tmpbmp = _LDjpeg _channel (_checkpack BlinkUpBMP) else nil; if tmpbmp==nil then nil else let _GETbitmapSize tmpbmp -> [bmpw bmph] in ( _SCPbitmap BMPBlinkUpBMP 0 0 95 15 tmpbmp 0 0 bmpw-1 bmph-1 nil; _SETbuttonBitmap PBBlinkUpBMP BMPBlinkUpBMP; _DSbitmap tmpbmp ) ); let _LDbitmap _channel (_checkpack BlinkDownBMP) -> tmpbmp in ( if tmpbmp==nil then set tmpbmp = _LDjpeg _channel (_checkpack BlinkDownBMP) else nil; if tmpbmp==nil then nil else let _GETbitmapSize tmpbmp -> [bmpw bmph] in ( _SCPbitmap BMPBlinkDownBMP 0 0 95 15 tmpbmp 0 0 bmpw-1 bmph-1 nil; _SETbuttonBitmap PBBlinkDownBMP BMPBlinkDownBMP; _DSbitmap tmpbmp ) ); 0;; /******************************************************************************* save modifications filename -> S : not used n -> S : not used editor -> Editor : editor <- [[S r1] r1] : the dmi contents *******************************************************************************/ fun cbsave (filename, n)= ("NoMsgBMP"::NoMsgBMP::nil):: ("IncomingMsgBMP"::IncomingMsgBMP::nil):: ("IncomingMsgGoneBMP"::IncomingMsgGoneBMP::nil):: ("BlinkUpBMP"::BlinkUpBMP::nil):: ("BlinkDownBMP"::BlinkDownBMP::nil):: ("KeepHistory"::(if _GETcheck CKhistory then "yes" else "no")::nil):: ("registerF"::NoMsgBMP::IncomingMsgBMP::IncomingMsgGoneBMP::BlinkUpBMP::BlinkDownBMP::nil):: ("clientNeeded"::NoMsgBMP::IncomingMsgBMP::IncomingMsgGoneBMP::BlinkUpBMP::BlinkDownBMP::nil):: ("action"::"start"::nil):: ("action"::"destroy"::nil):: ("actionC"::"show.history"::nil):: ("actionC"::"show"::nil):: ("actionC"::"hide"::nil):: ("actionC"::"IgnoreFlag"::nil):: ("action"::"!changeLogin"::nil):: ("action"::"page"::nil):: ("eventC"::"select"::nil):: ("event"::"entering"::nil):: ("event"::"out"::nil):: ("eventC"::"incomingMsg"::nil):: ("eventC"::"shown"::nil):: ("eventC"::"hidden"::nil):: ("eventC"::"in"::nil):: ("eventC"::"boxClick"::nil):: ("zoneC"::"pager"::nil):: ("zoneC"::"box"::nil):: nil ;; /************************************************************************************ affichage de la texture choisi sur le bouton de non message ob -> OpenBox : fenetre de choix blurp -> parametre : not used pack -> P : texture choisis *************************************************************************************/ fun cbOpenBrowseNoMsgBMP (ob, win, pack)= if pack==nil then nil else let _LDalphaBitmap _channel pack -> bmp in ( if bmp==nil then set bmp = _CRalphaBitmap _channel _LDjpeg _channel pack nil nil nil else nil; let _GETalphaBitmapSize bmp -> [bmpw bmph] in ( set NoMsgBMP = _PtoScol pack; _SCPalphaBitmap BMPNoMsgBMP 0 0 15 15 bmp 0 0 bmpw-1 bmph-1; _SETbuttonBitmap PBNoMsgBMP BMPNoMsgBMP; _DSalphaBitmap bmp ) ) ;; /******************************************************************************* ouverture de la fenetre de choix de la texture non message a -> b -> *********************************************************************************/ fun cbBrowseNoMsgBMP(a,b)= _DLGrflopen _DLGOpenFile _channel editWin nil "" "(*.png,*.jpg)\0*.png;*.jpg\0\0" @cbOpenBrowseNoMsgBMP editWin ;; /************************************************************************************ affichage de la texture choisi sur le bouton message ob -> OpenBox : fenetre de choix blurp -> parametre : not used pack -> P : texture choisis *************************************************************************************/ fun cbOpenBrowseIncomingMsgBMP (ob,blurp, pack)= if pack==nil then nil else let _LDalphaBitmap _channel pack -> bmp in ( if bmp==nil then set bmp = _CRalphaBitmap _channel _LDjpeg _channel pack nil nil nil else nil; let _GETalphaBitmapSize bmp -> [bmpw bmph] in ( set IncomingMsgBMP = _PtoScol pack; _SCPalphaBitmap BMPIncomingMsgBMP 0 0 15 15 bmp 0 0 bmpw-1 bmph-1; _SETbuttonBitmap PBIncomingMsgBMP BMPIncomingMsgBMP; _DSalphaBitmap bmp ) ) ;; /******************************************************************************* ouverture de la fenetre de choix de la texture message a -> b -> *********************************************************************************/ fun cbBrowseIncomingMsgBMP(a,b)= _DLGrflopen _DLGOpenFile _channel editWin nil/*dir*/ "" "(*.png,*.jpg)\0*.png;*jpg\0\0" @cbOpenBrowseIncomingMsgBMP nil ;; /************************************************************************************ affichage de la texture choisi sur le bouton message deconnecté ob -> OpenBox : fenetre de choix blurp -> parametre : not used pack -> P : texture choisis *************************************************************************************/ fun cbOpenBrowseIncomingMsgGoneBMP (ob,blurp, pack)= if pack==nil then nil else let _LDalphaBitmap _channel pack -> bmp in ( if bmp==nil then set bmp = _CRalphaBitmap _channel _LDjpeg _channel pack nil nil nil else nil; let _GETalphaBitmapSize bmp -> [bmpw bmph] in ( set IncomingMsgGoneBMP = _PtoScol pack; _SCPalphaBitmap BMPIncomingMsgGoneBMP 0 0 15 15 bmp 0 0 bmpw-1 bmph-1; _SETbuttonBitmap PBIncomingMsgGoneBMP BMPIncomingMsgGoneBMP; _DSalphaBitmap bmp ) ) ;; /******************************************************************************* ouverture de la fenetre de choix de la texture message deconnecté a -> b -> *********************************************************************************/ fun cbBrowseIncomingMsgGoneBMP(a,b)= _DLGrflopen _DLGOpenFile _channel editWin nil/*dir*/ "" "(*.png,*.jpg)\0*.png;*.jpg\0\0" @cbOpenBrowseIncomingMsgGoneBMP nil ;; /************************************************************************************ affichage de la texture choisi sur le bouton blink up ob -> OpenBox : fenetre de choix blurp -> parametre : not used pack -> P : texture choisis *************************************************************************************/ fun cbOpenBrowseBlinkUpBMP (ob, blurp, pack)= if pack==nil then nil else let _LDbitmap _channel pack -> bmp in ( if bmp==nil then set bmp = _LDjpeg _channel pack else nil; if bmp==nil then nil else let _GETbitmapSize bmp -> [bmpw bmph] in ( set BlinkUpBMP = _PtoScol pack; _SCPbitmap BMPBlinkUpBMP 0 0 95 15 bmp 0 0 bmpw-1 bmph-1 nil; _SETbuttonBitmap PBBlinkUpBMP BMPBlinkUpBMP; _DSbitmap bmp ) ) ;; /******************************************************************************* ouverture de la fenetre de choix de la texture blink up a -> b -> *********************************************************************************/ fun cbBrowseBlinkUpBMP(a,b)= _DLGrflopen _DLGOpenFile _channel editWin nil/*dir*/ "" "bitmaps (*.bmp,*.jpg)\0*.bmp;*.jpg\0all (*.*)\0*.*\0\0" @cbOpenBrowseBlinkUpBMP nil ;; /************************************************************************************ affichage de la texture choisi sur le bouton blink down ob -> OpenBox : fenetre de choix blurp -> parametre : not used pack -> P : texture choisis *************************************************************************************/ fun cbOpenBrowseBlinkDownBMP (ob, blurp, pack)= if pack==nil then nil else let _LDbitmap _channel pack -> bmp in ( if bmp==nil then set bmp = _LDjpeg _channel pack else nil; if bmp==nil then nil else let _GETbitmapSize bmp -> [bmpw bmph] in ( set BlinkDownBMP = _PtoScol pack; _SCPbitmap BMPBlinkDownBMP 0 0 95 15 bmp 0 0 bmpw-1 bmph-1 nil; _SETbuttonBitmap PBBlinkDownBMP BMPBlinkDownBMP; _DSbitmap bmp ) ) ;; /******************************************************************************* ouverture de la fenetre de choix de la texture blink up a -> b -> *********************************************************************************/ fun cbBrowseBlinkDownBMP(a,b)= _DLGrflopen _DLGOpenFile _channel editWin nil/*dir*/ "" "bitmaps (*.bmp,*.jpg)\0*.bmp;*.jpg\0all (*.*)\0*.*\0\0" @cbOpenBrowseBlinkDownBMP nil ;; /******************************************************************************* main function called when the editor is starting. The openDMI function must be called at the end in order to load the data if the module has already been edited. s -> S : obsolete (unused) <- I : nothing special *******************************************************************************/ fun IniEditor (s)= let [350 130] -> [w h] in let startEditor _channel nil nil nil w h WN_NORMAL EDITOR_NORMAL s "Dms/CommTools/Pager3/pager.dmc" nil nil @cbload @cbsave nil -> ed in ( set editWin = getEditWin ed; /*image de non message*/ set LBNoMsgBMP = _CRtext _channel editWin 5 5 240 20 ET_ALIGN_LEFT (_locEditor "3330-PAGERE-nomessages" nil); set BMPNoMsgBMP = _CRbitmap _channel 16 16; _FILLbitmap BMPNoMsgBMP (make_rgb 0 0 0); set PBNoMsgBMP = _CRbuttonBitmap _channel editWin BMPNoMsgBMP 245 5 20 20 0; _CBbutton PBNoMsgBMP @cbBrowseNoMsgBMP 0; /*image de message */ set LBIncomingMsgBMP = _CRtext _channel editWin 5 25 240 20 ET_ALIGN_LEFT (_locEditor "3390-PAGERE-incomingme" nil); set BMPIncomingMsgBMP = _CRbitmap _channel 16 16; _FILLbitmap BMPIncomingMsgBMP (make_rgb 0 0 0); set PBIncomingMsgBMP = _CRbuttonBitmap _channel editWin BMPIncomingMsgBMP 245 25 20 20 0; _CBbutton PBIncomingMsgBMP @cbBrowseIncomingMsgBMP 0; /*image de message avec utilisateur déconnecté*/ set LBIncomingMsgGoneBMP = _CRtext _channel editWin 5 45 240 20 ET_ALIGN_LEFT (_locEditor "3380-PAGERE-incomingmegone" nil); set BMPIncomingMsgGoneBMP = _CRbitmap _channel 16 16; _FILLbitmap BMPIncomingMsgGoneBMP (make_rgb 0 0 0); set PBIncomingMsgGoneBMP = _CRbuttonBitmap _channel editWin BMPIncomingMsgGoneBMP 245 45 20 20 0; _CBbutton PBIncomingMsgGoneBMP @cbBrowseIncomingMsgGoneBMP 0; /*lumière etat 1*/ set LBBlinkUpBMP = _CRtext _channel editWin 5 65 240 20 ET_ALIGN_LEFT (_locEditor "3510-PAGERE-boxblinkup" nil); set BMPBlinkUpBMP = _CRbitmap _channel 96 16; _FILLbitmap BMPBlinkUpBMP (make_rgb 0 0 0); set PBBlinkUpBMP = _CRbuttonBitmap _channel editWin BMPBlinkUpBMP 245 65 100 20 0; _CBbutton PBBlinkUpBMP @cbBrowseBlinkUpBMP 0; /*lumière etat 2*/ set LBBlinkDownBMP = _CRtext _channel editWin 5 85 240 20 ET_ALIGN_LEFT (_locEditor "3570-PAGERE-boxblinkdo" nil); set BMPBlinkDownBMP = _CRbitmap _channel 96 16; _FILLbitmap BMPBlinkDownBMP (make_rgb 0 0 0); set PBBlinkDownBMP = _CRbuttonBitmap _channel editWin BMPBlinkDownBMP 245 85 100 20 0; _CBbutton PBBlinkDownBMP @cbBrowseBlinkDownBMP 0; /*conservation de l'historique*/ set CKhistory = _CRcheck _channel editWin 50 105 240 20 0 (_locEditor "3370-PAGERE-keephistory" nil); cbload nil; /* loading default bitmaps */ if s==nil then nil else openDMI ed ); 0 ;;