/************************************************** Module GraphicCheckBox Editor part Version: 1.0 Author: Julien Zorko Last update: 08/06/2001 Check Box with customisable bitmap **************************************************/ typeof Ed = Editor;; typeof BitmapPathLabel = ObjText;; typeof BitmapPathField = ObjText;; typeof btBitmap = ObjButton;; /* first state text parameters edition */ typeof TextLabel = ObjText;; typeof TextField = ObjText;; typeof TextSizeLabel = ObjText;; typeof TextSizeField = ObjText;; typeof TextColorField = ObjText;; typeof TextColorLabel = ObjText;; typeof btTextColor = ObjButton;; typeof TextTypeLabel = ObjText;; typeof TextTypeBox = ObjBox;; /* second state text parameters edition */ typeof Text2Label = ObjText;; typeof Text2Field = ObjText;; typeof TextSize2Label = ObjText;; typeof TextSize2Field = ObjText;; typeof TextColor2Field = ObjText;; typeof TextColor2Label = ObjText;; typeof btTextColor2 = ObjButton;; typeof TextType2Label = ObjText;; typeof TextType2Box = ObjBox;; /* bubble parameters edition */ typeof BubbleLabel = ObjText;; typeof BubbleField = ObjText;; typeof BubbleSizeLabel = ObjText;; typeof BubbleSizeField = ObjText;; typeof BubbleColorLabel = ObjText;; typeof BubbleColorField = ObjText;; typeof btBubbleColor = ObjButton;; typeof BubbleTypeLabel = ObjText;; typeof BubbleTypeBox = ObjBox;; typeof BubbleBackColorLabel = ObjText;; typeof BubbleBackColorField = ObjText;; typeof btBubbleBackColor = ObjButton;; typeof CheckDisable = ObjCheck;; typeof EditWin = ObjWin;; typeof myMsgTextColor=I;; /******************************************************************************* Functions *******************************************************************************/ fun cbEndColor(a, param)= if a!=nil then ( set myMsgTextColor=a; _SETtext param itoh a; 0 ) else nil ;; fun cbChooseColor(a, params)= let params -> [txtField title] in let if myMsgTextColor==nil then 0 else myMsgTextColor -> iValue in _CRcolorMap _channel EditWin 100 100 title mkfun2 @cbEndColor txtField iValue; 0 ;;/*for compatibility with previous version*/ /* place le fichier sélectionné dans la boite de dialogue */ fun cbOpenFile (d,b, pack)= if pack==nil then nil else let b -> [objTxt _] in let _PtoScol pack -> name in _SETtext objTxt name ;; /* Réflexe: ouvre une boite de dialogue pour sélectionnner un fichier texte */ fun rflBrowseFile (blurp, objtxt_f)= ( let objtxt_f -> [objtxt _] in let getPathFile _GETtext objtxt "" -> [dir _] in _DLGrflopen _DLGOpenFile _channel EditWin dir "" "All\0*.jpg;*.jpeg;*.png;*.bmp\0JPEG\0*.jpg;*.jpeg\0PNG\0*.png\0Bitmap\0*.bmp\0" @cbOpenFile objtxt_f );; /******************************************************************************* Reflexe: charge les données du fichier DMI dans l'interface de l'éditeur *******************************************************************************/ fun cbLoad(dmiBlock)= let getDef Ed "params" -> l in ( _SETtext BitmapPathField getInfo l "picture"; _SETtext TextField getInfo l "text"; _SETtext TextSizeField getInfo l "textSize"; _SETtext TextColorField getInfo l "textColor"; _SELcombo TextTypeBox atoi getInfo l "textType"; _SETtext Text2Field getInfo l "text2"; _SETtext TextSize2Field getInfo l "textSize2"; _SETtext TextColor2Field getInfo l "textColor2"; _SELcombo TextType2Box atoi getInfo l "textType2"; _SETtext BubbleField getInfo l "bubble"; _SETtext BubbleSizeField getInfo l "bubbleSize"; _SETtext BubbleColorField getInfo l "bubbleColor"; _SETtext BubbleBackColorField getInfo l "bubbleBackColor"; _SELcombo BubbleTypeBox atoi getInfo l "bubbleType"; _SETcheck CheckDisable atoi getInfo l "disable" ); 0 ;; /******************************************************************************* Reflexe: sauvegarde les données de l'interface de l'éditeur dans le fichier DMI *******************************************************************************/ fun GetComboValue(box) = let _GETcombo box -> [iValue sValue] in iValue ;; fun cbSave (filename, n)= let ("picture"::(_GETtext BitmapPathField)::nil):: ("text"::(_GETtext TextField)::nil):: ("textSize"::(_GETtext TextSizeField)::nil):: ("textColor"::(_GETtext TextColorField)::nil):: ("textType"::(itoa GetComboValue TextTypeBox)::nil):: ("text2"::(_GETtext Text2Field)::nil):: ("textSize2"::(_GETtext TextSize2Field)::nil):: ("textColor2"::(_GETtext TextColor2Field)::nil):: ("textType2"::(itoa GetComboValue TextType2Box)::nil):: ("bubble"::(_GETtext BubbleField)::nil):: ("bubbleSize"::(_GETtext BubbleSizeField)::nil):: ("bubbleColor"::(_GETtext BubbleColorField)::nil):: ("bubbleType"::(itoa GetComboValue BubbleTypeBox)::nil):: ("bubbleBackColor"::(_GETtext BubbleBackColorField)::nil):: ("disable"::(itoa _GETcheck CheckDisable)::nil)::nil -> paramsBloc in setDef Ed "params" paramsBloc; ("action"::"start"::nil):: ("action"::"destroy"::nil):: ("actionC"::"enable"::nil):: ("actionC"::"disable"::nil):: ("actionC"::"show"::nil):: ("actionC"::"hide"::nil):: ("actionC"::"check"::nil):: ("actionC"::"uncheck"::nil):: ("event"::"entering"::nil):: ("eventC"::"in"::nil):: ("event"::"out"::nil):: ("eventC"::"check"::nil):: ("eventC"::"uncheck"::nil):: ("eventC"::"enabled"::nil):: ("eventC"::"disabled"::nil):: ("eventC"::"shown"::nil):: ("eventC"::"hidden"::nil):: ("zoneC"::"button"::nil):: nil ;; /******************************************************************************* Editor resize callback *******************************************************************************/ fun cbResizeWin (win, param, w, h) = let (w-20)/3 -> ww in ( _SIZEtext BitmapPathLabel w-10 20 5 5; _SIZEtext BitmapPathField w-35 20 5 25; _SIZEbutton btBitmap 20 20 w-25 25; /* first state text parameters */ _SIZEtext TextLabel ww-10 20 10 55; _SIZEtext TextField ww-10 20 10 70; _SIZEtext TextSizeLabel ww-10 20 10 95; _SIZEtext TextSizeField ww-10 20 10 115; _SIZEtext TextColorLabel ww-10 20 10 140; _SIZEtext TextColorField ww-35 20 10 160; _SIZEbutton btTextColor 20 20 ww-20 160; _SIZEtext TextTypeLabel ww-10 20 10 185; _SIZEcombo TextTypeBox ww-10 120 10 205; /* second state text parameters */ _SIZEtext Text2Label ww-10 20 ww+15 55; _SIZEtext Text2Field ww-10 20 ww+15 70; _SIZEtext TextSize2Label ww-10 20 ww+15 95; _SIZEtext TextSize2Field ww-10 20 ww+15 115; _SIZEtext TextColor2Label ww-10 20 ww+15 140; _SIZEtext TextColor2Field ww-35 20 ww+15 160; _SIZEbutton btTextColor2 20 20 2*ww-15 160; _SIZEtext TextType2Label ww-10 20 ww+15 185; _SIZEcombo TextType2Box ww-10 120 ww+15 205; /* bubble parameters */ _SIZEtext BubbleLabel ww-10 20 2*ww+20 55; _SIZEtext BubbleField ww-10 20 2*ww+20 70; _SIZEtext BubbleSizeLabel ww-10 20 2*ww+20 95; _SIZEtext BubbleSizeField ww-10 20 2*ww+20 115; _SIZEtext BubbleColorLabel ww-10 20 2*ww+20 140; _SIZEtext BubbleColorField ww-35 20 2*ww+20 160; _SIZEbutton btBubbleColor 20 20 3*ww-10 160; _SIZEtext BubbleTypeLabel ww-10 20 2*ww+20 185; _SIZEcombo BubbleTypeBox ww-10 120 2*ww+20 205; _SIZEtext BubbleBackColorLabel ww-10 20 2*ww+20 230; _SIZEtext BubbleBackColorField ww-35 20 2*ww+20 250; _SIZEbutton btBubbleBackColor 20 20 3*ww-10 250; /* disabled state checkbox */ _SIZEcheck CheckDisable w-10 20 5 h-25; 0 ) ;; fun cbPaint (win, param) = let _GETwindowSizePosition win -> [w h _ _] in let (w-20)/3 -> ww in ( /* rectangles */ _PAINTrectangle win 5 50 ww h-75 DRAW_SOLID 2 0 DRAW_INVISIBLE 0; _PAINTrectangle win ww+10 50 ww h-75 DRAW_SOLID 2 0 DRAW_INVISIBLE 0; _PAINTrectangle win 2*ww+15 50 ww h-75 DRAW_SOLID 2 0 DRAW_INVISIBLE 0 ) ;; /******************************************************************************* Initialise l'éditeur du module Auctioneer *******************************************************************************/ fun IniEditor(s)= let [500 300] -> [w h] in let (w-20)/3 -> ww in let startEditor _channel nil 0 0 w h WN_MENU EDITOR_NORMAL s "dms/interf/rollover/rollover.dmc" nil nil @cbLoad @cbSave nil -> ed in ( set EditWin = getEditWin ed; set Ed = ed; _CBwinSize EditWin @cbResizeWin nil; _CBwinPaint EditWin @cbPaint nil; /* bitmap field */ set BitmapPathLabel = _CRtext _channel EditWin 5 5 w-10 20 ET_ALIGN_LEFT (_locEditor "BITMAP_PATH_LABEL" nil); set BitmapPathField = _CReditLine _channel EditWin 5 25 w-35 20 ET_DOWN|ET_AHSCROLL ""; set btBitmap = _CBbutton _CRbutton _channel EditWin w-25 25 20 20 0 "..." @rflBrowseFile [BitmapPathField nil]; /* rectangles */ _PAINTrectangle EditWin 5 50 ww h-75 DRAW_SOLID 2 0 DRAW_INVISIBLE 0; _PAINTrectangle EditWin ww+10 50 ww h-75 DRAW_SOLID 2 0 DRAW_INVISIBLE 0; _PAINTrectangle EditWin 2*ww+15 50 ww h-75 DRAW_SOLID 2 0 DRAW_INVISIBLE 0; /* first state text parameters */ set TextLabel = _CRtext _channel EditWin 10 55 ww-10 20 ET_ALIGN_LEFT (_locEditor "TEXT_LABEL" nil); set TextField = _CReditLine _channel EditWin 10 75 ww-10 20 ET_DOWN|ET_AHSCROLL (_locEditor "TEXT_FIELD" nil); set TextSizeLabel = _CRtext _channel EditWin 10 95 ww-10 20 ET_ALIGN_LEFT (_locEditor "TEXT_SIZE_LABEL" nil); set TextSizeField = _CReditLine _channel EditWin 10 115 ww-10 20 ET_DOWN|ET_AHSCROLL "14"; set TextColorLabel = _CRtext _channel EditWin 10 140 ww-10 20 ET_ALIGN_LEFT (_locEditor "TEXT_COLOR_LABEL" nil); set TextColorField = _CReditLine _channel EditWin 10 160 ww-35 20 ET_DOWN|ET_AHSCROLL "0"; set btTextColor = _CBbutton _CRbutton _channel EditWin ww-20 160 20 20 0 "..." @cbChooseColor [TextColorField (_locEditor "TEXT_COLOR_CHOOSE" nil)]; set TextTypeLabel = _CRtext _channel EditWin 10 185 ww-10 20 ET_ALIGN_LEFT (_locEditor "TEXT_TYPE_LABEL" nil); set TextTypeBox = _CRcombo _channel EditWin 10 205 ww-10 120 CB_NOEDIT ""; /* second state text parameters */ set Text2Label = _CRtext _channel EditWin ww+15 55 ww-10 20 ET_ALIGN_LEFT (_locEditor "TEXT2_LABEL" nil); set Text2Field = _CReditLine _channel EditWin ww+15 75 ww-10 20 ET_DOWN|ET_AHSCROLL (_locEditor "TEXT2_FIELD" nil); set TextSize2Label = _CRtext _channel EditWin ww+15 95 ww-10 20 ET_ALIGN_LEFT (_locEditor "TEXT_SIZE2_LABEL" nil); set TextSize2Field = _CReditLine _channel EditWin ww+15 115 ww-10 20 ET_DOWN|ET_AHSCROLL "14"; set TextColor2Label = _CRtext _channel EditWin ww+15 140 ww-10 20 ET_ALIGN_LEFT (_locEditor "TEXT_COLOR2_LABEL" nil); set TextColor2Field = _CReditLine _channel EditWin ww+15 160 ww-35 20 ET_DOWN|ET_AHSCROLL "0"; set btTextColor2 = _CBbutton _CRbutton _channel EditWin 2*ww-15 160 20 20 0 "..." @cbChooseColor [TextColor2Field (_locEditor "TEXT_COLOR2_CHOOSE" nil)]; set TextType2Label = _CRtext _channel EditWin ww+15 185 ww-10 20 ET_ALIGN_LEFT (_locEditor "TEXT_TYPE2_LABEL" nil); set TextType2Box = _CRcombo _channel EditWin ww+15 205 ww-10 120 CB_NOEDIT ""; /* bubble parameters */ set BubbleLabel = _CRtext _channel EditWin 2*ww+20 55 ww-10 20 ET_ALIGN_LEFT (_locEditor "BUBBLE_LABEL" nil); set BubbleField = _CReditLine _channel EditWin 2*ww+20 75 ww-10 20 ET_DOWN|ET_AHSCROLL (_locEditor "BUBBLE_FIELD" nil); set BubbleSizeLabel = _CRtext _channel EditWin 2*ww+20 95 ww-10 20 ET_ALIGN_LEFT (_locEditor "BUBBLE_SIZE_LABEL" nil); set BubbleSizeField = _CReditLine _channel EditWin 2*ww+20 115 ww-10 20 ET_DOWN|ET_AHSCROLL "12"; set BubbleColorLabel = _CRtext _channel EditWin 2*ww+20 140 ww-10 20 ET_ALIGN_LEFT (_locEditor "BUBBLE_COLOR_LABEL" nil); set BubbleColorField = _CReditLine _channel EditWin 2*ww+20 160 ww-35 20 ET_DOWN|ET_AHSCROLL "0"; set btBubbleColor = _CBbutton _CRbutton _channel EditWin 3*ww-10 160 20 20 0 "..." @cbChooseColor [BubbleColorField (_locEditor "BUBBLE_COLOR_CHOOSE" nil)]; set BubbleTypeLabel = _CRtext _channel EditWin 2*ww+20 185 ww-10 20 ET_ALIGN_LEFT (_locEditor "BUBBLE_TYPE_LABEL" nil); set BubbleTypeBox = _CRcombo _channel EditWin 2*ww+20 205 ww-10 120 CB_NOEDIT ""; set BubbleBackColorLabel = _CRtext _channel EditWin 2*ww+20 230 ww-10 20 ET_ALIGN_LEFT (_locEditor "BUBBLE_BACK_COLOR_LABEL" nil); set BubbleBackColorField = _CReditLine _channel EditWin 2*ww+20 250 ww-35 20 ET_DOWN|ET_AHSCROLL "ffffff"; set btBubbleBackColor = _CBbutton _CRbutton _channel EditWin 3*ww-10 250 20 20 0 "..." @cbChooseColor [BubbleBackColorField (_locEditor "BUBBLE_BACK_COLOR_CHOOSE" nil)]; _ADDcombo TextTypeBox 0 (_locEditor "STANDARD_FONT" nil); _ADDcombo TextTypeBox 1 (_locEditor "BOLD_FONT" nil); _ADDcombo TextTypeBox 2 (_locEditor "ITALIC_FONT" nil); _ADDcombo TextTypeBox 3 (_locEditor "UNDERLINED_FONT" nil); _ADDcombo TextTypeBox 4 (_locEditor "STRIKED_FONT" nil); _SELcombo TextTypeBox 0; _ADDcombo TextType2Box 0 (_locEditor "STANDARD_FONT" nil); _ADDcombo TextType2Box 1 (_locEditor "BOLD_FONT" nil); _ADDcombo TextType2Box 2 (_locEditor "ITALIC_FONT" nil); _ADDcombo TextType2Box 3 (_locEditor "UNDERLINED_FONT" nil); _ADDcombo TextType2Box 4 (_locEditor "STRIKED_FONT" nil); _SELcombo TextType2Box 0; _ADDcombo BubbleTypeBox 0 (_locEditor "STANDARD_FONT" nil); _ADDcombo BubbleTypeBox 1 (_locEditor "BOLD_FONT" nil); _ADDcombo BubbleTypeBox 2 (_locEditor "ITALIC_FONT" nil); _ADDcombo BubbleTypeBox 3 (_locEditor "UNDERLINED_FONT" nil); _ADDcombo BubbleTypeBox 4 (_locEditor "STRIKED_FONT" nil); _SELcombo BubbleTypeBox 0; set CheckDisable = _CRcheck _channel EditWin 5 h-25 w-10 20 0 (_locEditor "DISABLED_CHECK_LABEL" nil); if s==nil then nil else openDMI ed ); 0 ;;