/***************************************************************/ /* */ /* helpViewerEdit.pkg */ /* */ /* module HelpViewer */ /* éditeur */ /* */ /* Loïc Berthelot juillet 2000 */ /* Chanduroi Modification 03/2004 */ /***************************************************************/ /**********************************/ /* */ /* General Configuration */ /* */ /* 21 fields */ /**********************************/ struct GHed = [ root_GHed : ObjNode, /* help window */ widthLbl_GHed : CompText, width_GHed : CompText, /* help icone */ checkLbl_GHed : CompText, miniCheckLbl_GHed : CompText, miniCheck_GHed : CompCheck, middleCheckLbl_GHed : CompText, middleCheck_GHed : CompCheck, maxiCheckLbl_GHed : CompText, maxiCheck_GHed : CompCheck, iconeFlnLbl_GHed : CompText, iconeFln_GHed : CompText, iconeFlnBtt_GHed : CompRollOver, textCheckLbl_GHed : CompText, textCheck_GHed : CompCheck, textLbl_GHed : CompText, text_GHed : CompText, /* parameters */ widthParam_GHed : S, iconeCheckParam_GHed : S, iconeFlnParam_GHed : S, textParam_GHed : S ] mkGHed;; /**********************************/ /* */ /* Titles Configuration */ /* */ /* 26 fields */ /**********************************/ struct THed = [ root_THed : ObjNode, /* texte */ textLbl_THed : CompText, fontLbl_THed : CompText, font_THed : CompText, fontBtt_THed : CompRollOver, sizeLbl_THed : CompText, size_THed : CompText, txtColorLbl_THed : CompText, txtColor_THed : [AlphaBitmap CompRollOver], minHeightLbl_THed : CompText, minHeight_THed : CompText, space_THed : [AlphaBitmap CompBitmap], /* background */ bkgLbl_THed : CompText, bkgColorCheckLbl_THed : CompText, bkgColorCheck_THed : CompCheck, bkgColor_THed : [AlphaBitmap CompRollOver], bkgBitmapCheckLbl_THed : CompText, bkgBitmapCheck_THed : CompCheck, bkgBitmapFln_THed : CompText, bkgBitmapButton_THed : CompRollOver, /* parameters */ fontParam_THed : S, sizeParam_THed : S, colorParam_THed : S, minHeightParam_THed : S, bkgCheckParam_THed : S, bkgColorParam_THed : S, bkgBitmapParam_THed : S ] mkTHed;; /**********************************/ /* */ /* Help Field Configuration */ /* */ /* 56 fields */ /**********************************/ struct FHed = [ root1_FHed : ObjNode, /* textes relatifs aux champs d'aides "questions" */ qtextLbl_FHed : CompText, qfontLbl_FHed : CompText, qfont_FHed : CompText, qfontBtt_FHed : CompRollOver, qsizeLbl_FHed : CompText, qsize_FHed : CompText, qtxtColorLbl_FHed : CompText, qtxtColor_FHed : [AlphaBitmap CompRollOver], qMinHeightLbl_FHed : CompText, qMinHeight_FHed : CompText, space1_FHed : [AlphaBitmap CompBitmap], /* textes relatifs aux champs d'aides "réponses" */ atextLbl_FHed : CompText, afontLbl_FHed : CompText, afont_FHed : CompText, afontBtt_FHed : CompRollOver, asizeLbl_FHed : CompText, asize_FHed : CompText, atxtColorLbl_FHed : CompText, atxtColor_FHed : [AlphaBitmap CompRollOver], aMinHeightLbl_FHed : CompText, aMinHeight_FHed : CompText, root2_FHed : ObjNode, /* backgrounds */ bkgLbl_FHed : CompText, bkgColorCheckLbl_FHed: CompText, bkgColorCheck_FHed : CompCheck, bkgColor_FHed : [AlphaBitmap CompRollOver], bkgBitmapCheckLbl_FHed : CompText, bkgBitmapCheck_FHed : CompCheck, bkgBitmapFln_FHed : CompText, bkgBitmapButton_FHed : CompRollOver, space2_FHed : [AlphaBitmap CompBitmap], /* buttons */ buttonsLbl_FHed : CompText, questionBitmapLbl_FHed : CompText, questionBitmap_FHed : CompText, questionBitmapButton_FHed : CompRollOver, answerBitmapLbl_FHed : CompText, answerBitmap_FHed : CompText, answerBitmapButton_FHed : CompRollOver, backBitmapLbl_FHed : CompText, backBitmap_FHed : CompText, backBitmapButton_FHed : CompRollOver, /* parameters */ qfontParam_FHed : S, qsizeParam_FHed : S, qcolorParam_FHed : S, qMinHeightParam_FHed : S, afontParam_FHed : S, asizeParam_FHed : S, acolorParam_FHed : S, aMinHeightParam_FHed : S, bkgCheckParam_FHed : S, bkgColorParam_FHed : S, bkgBitmapParam_FHed : S, questionBitmapParam_FHed : S, answerBitmapParam_FHed : S, backBitmapParam_FHed : S ] mkFHed;; /************************************/ /* */ /* Menu configuration */ /* (enpsulate 3 others) */ /* */ /* 11 fields */ /************************************/ struct Hed = [ cont_Hed : ObjContainer, frame_Hed : [AlphaBitmap CompBitmap], w_Hed : I, h_Hed : I, cx_Hed : I, cy_Hed : I, cw_Hed : I, ch_Hed : I, combo_Hed : CompCombo, upArrow_Hed : [AlphaBitmap CompRollOver], downArrow_Hed : [AlphaBitmap CompRollOver] ] mkHed;; typeof hed = Hed;; typeof gHed = GHed;; typeof tHed = THed;; typeof fHed = FHed;; /***********************************************************************************/ /***********************************************************************************/ /** **/ /** U T I L S **/ /** **/ /***********************************************************************************/ /***********************************************************************************/ var fontHelpFlag = 0;; fun Hed_closeFontHelp (obj, tuple, x, y, btn, msk) = let tuple -> [cont label] in ( set fontHelpFlag = 0; GRAPHICDRESSING_DScompText label; _DScontainer cont; ggd_setCont hed.cont_Hed; ); 1;; fun Hed_getFontHelp (obj, z, x, y, btn, msk) = if (fontHelpFlag) then nil else ( set fontHelpFlag = 1; let ggd_CRcont [100 100 250 170] [200 200 200 200] nil (_loc this "THED_FONT_HELP_TITLE" nil) -> [cont _ _ _ closeb [cx cy cw ch]] in ( let ggd_CRlabel cx (cy+20) cw ch nil (_loc this "THED_FONT_HELP" nil) -> label in _CBcompRollOverClick closeb @Hed_closeFontHelp [cont label]; _PAINTcontainer cont; _SHOWcontainer cont CONTAINER_UNHIDDEN; ); ); 1;; /***********************************************************************************/ /***********************************************************************************/ /** **/ /** G E N E R A L C O N F I G U R A T I O N **/ /** **/ /***********************************************************************************/ /***********************************************************************************/ /*******************************/ /* show graphic components */ /*******************************/ fun GHed_show () = _CHANGEobjNodeFlags gHed.root_GHed OBJ_ENABLE|OBJ_VISIBLE 1; _PAINTcontainer hed.cont_Hed; 1;; fun GHed_showCheckIcone () = GD_ShowGraphicObject (_CONVERTcompTextToObjNode gHed.iconeFlnLbl_GHed); _PAINTcontainer hed.cont_Hed; 1;; fun GHed_showCheckText () = GD_ShowGraphicObject (_CONVERTcompTextToObjNode gHed.textLbl_GHed); _PAINTcontainer hed.cont_Hed; 1;; /*******************************/ /* hide graphic components */ /*******************************/ fun GHed_hide () = _CHANGEobjNodeFlags gHed.root_GHed OBJ_ENABLE|OBJ_HIDE 1; _PAINTcontainer hed.cont_Hed; 1;; fun GHed_hideCheckIcone () = GD_HideGraphicObject (_CONVERTcompTextToObjNode gHed.iconeFlnLbl_GHed); _PAINTcontainer hed.cont_Hed; 1;; fun GHed_hideCheckText () = GD_HideGraphicObject (_CONVERTcompTextToObjNode gHed.textLbl_GHed); _PAINTcontainer hed.cont_Hed; 1;; /*******************************/ /* destroy graphic components */ /*******************************/ fun GHed_destroy () = GRAPHICDRESSING_DScompText gHed.text_GHed; GRAPHICDRESSING_DScompText gHed.textLbl_GHed; GRAPHICDRESSING_DScompRollOver gHed.iconeFlnBtt_GHed; GRAPHICDRESSING_DScompText gHed.iconeFln_GHed; GRAPHICDRESSING_DScompText gHed.iconeFlnLbl_GHed; GRAPHICDRESSING_DScompText gHed.textCheckLbl_GHed; GRAPHICDRESSING_DScompCheck gHed.textCheck_GHed; GRAPHICDRESSING_DScompText gHed.maxiCheckLbl_GHed; GRAPHICDRESSING_DScompCheck gHed.maxiCheck_GHed; GRAPHICDRESSING_DScompText gHed.middleCheckLbl_GHed; GRAPHICDRESSING_DScompCheck gHed.middleCheck_GHed; GRAPHICDRESSING_DScompText gHed.miniCheckLbl_GHed; GRAPHICDRESSING_DScompCheck gHed.miniCheck_GHed; GRAPHICDRESSING_DScompText gHed.checkLbl_GHed; GRAPHICDRESSING_DScompText gHed.width_GHed; GRAPHICDRESSING_DScompText gHed.widthLbl_GHed; 1;; /******************************************/ /* set parameters fields */ /******************************************/ fun GHed_setWidthParam (widthobj, z) = let _GETcompText widthobj -> text in set gHed.widthParam_GHed = text; 1;; fun GHed_setTextParam (textobj, z) = let _GETcompText textobj -> text in set gHed.textParam_GHed = text; 1;; fun GHed_setIconeFlnParam (iconeFlnobj, z) = let _GETcompText iconeFlnobj -> text in set gHed.iconeFlnParam_GHed = text; 1;; /* others params are set in graphic objects code */ /******************************************/ /* button type compChecks click callback */ /******************************************/ fun GHed_CBcheckClick (checkobj, others, x, y, btn, msk) = let _GETcompCheckState checkobj -> state in let others -> [type check2 check3 check4] in ( /* set icone check param */ set gHed.iconeCheckParam_GHed = type; if (state == CHK_CHECKED) then nil else _SETcompCheckState checkobj CHK_CHECKED; _SETcompCheckState check2 CHK_UNCHECKED; _SETcompCheckState check3 CHK_UNCHECKED; _SETcompCheckState check4 CHK_UNCHECKED; );; /*************************************************/ /* button type compChecks state changed callback */ /*************************************************/ fun GHed_CBcheckState (checkobj, param, state) = if ((!strcmp param "icone") && (state == CHK_CHECKED)) then ( GHed_showCheckIcone; GHed_hideCheckText; ) else if ((!strcmp param "text") && (state == CHK_CHECKED)) then ( GHed_hideCheckIcone; GHed_showCheckText; ) else nil; _PAINTcontainer hed.cont_Hed;; /**************************************************/ /* check the selected file by the file dialog box */ /**************************************************/ fun GHed_CBsetIconeFln (openbox, z ,file) = if (file == nil) then nil else let _PtoScol file -> path in if (path == nil) then ( _DLGMessageBox _channel nil "Error" (_loc this "HED_ERROR_SCOL_PATH" nil) 0; 0; ) else ( ggd_SETcompText gHed.iconeFln_GHed path; GHed_setIconeFlnParam gHed.iconeFln_GHed nil; _PAINTcontainer hed.cont_Hed; 1; );; /*************************************************/ /* call the file dialog box */ /*************************************************/ fun GHed_CBchooseIconeFln (rollobj, z, x, y, btn, msk) = _DLGrflopen _DLGOpenFile _channel nil nil nil "png(*.png)\0*.png\0\0" @GHed_CBsetIconeFln nil;; /*******************************/ /* create graphic components */ /*******************************/ fun GHed_create () = let hed.cx_Hed -> tcx in let hed.cy_Hed -> tcy in let hed.cw_Hed -> tcw in let hed.ch_Hed -> tch in ( set gHed.root_GHed = ggd_CRroot _channel hed.cont_Hed; set gHed.widthLbl_GHed = ggd_CRlabel (tcx+10) (tcy+22) 150 22 nil (_loc this "GHED_WIDTH_LBL" nil); set gHed.width_GHed = ggd_CRline (tcx+170) (tcy+20) 40 22 nil nil; _CBcompTextChange gHed.width_GHed @GHed_setWidthParam nil; set gHed.checkLbl_GHed = ggd_CRlabel (tcx+10) (tcy+102) 85 44 nil (_loc this "GHED_CHECK_LBL" nil); /* button type */ set gHed.miniCheckLbl_GHed = ggd_CRlabel (tcx+120) (tcy+72) 60 22 nil "mini :"; set gHed.miniCheck_GHed = ggd_CRcheckMini [(tcx+170) (tcy+70)] nil nil; set gHed.middleCheckLbl_GHed = ggd_CRlabel (tcx+120) (tcy+102) 60 22 nil (_loc this "MIDDLE" nil); set gHed.middleCheck_GHed = ggd_CRcheckMini [(tcx+170) (tcy+100)] nil nil; set gHed.maxiCheckLbl_GHed = ggd_CRlabel (tcx+120) (tcy+132) 60 22 nil "maxi :"; set gHed.maxiCheck_GHed = ggd_CRcheckMini [(tcx+170) (tcy+130)] nil nil; set gHed.textCheckLbl_GHed = ggd_CRlabel (tcx+120) (tcy+162) 60 22 nil (_loc this "TEXT" nil); set gHed.textCheck_GHed = ggd_CRcheckMini [(tcx+170) (tcy+160)] nil nil; /* icone parameter */ set gHed.iconeFlnLbl_GHed = ggd_CRlabel (tcx+230) (tcy+78) 250 22 nil (_loc this "GHED_ICONE_LBL" nil); ggd_setRoot (_CONVERTcompTextToObjNode gHed.iconeFlnLbl_GHed); set gHed.iconeFln_GHed = ggd_CRline 0 20 210 22 nil nil; set gHed.iconeFlnBtt_GHed = ggd_CRrollOverText [220 20] 30 22 nil "..."; _CBcompRollOverClick gHed.iconeFlnBtt_GHed @GHed_CBchooseIconeFln nil; _CBcompTextChange gHed.iconeFln_GHed @GHed_setIconeFlnParam nil; /* text parameter */ ggd_setRoot gHed.root_GHed; set gHed.textLbl_GHed = ggd_CRlabel (tcx+230) (tcy+140) 250 22 nil (_loc this "GHED_TEXT_LBL" nil); ggd_setRoot (_CONVERTcompTextToObjNode gHed.textLbl_GHed); set gHed.text_GHed = ggd_CRline 0 20 250 22 nil nil; ggd_setRoot gHed.root_GHed; _CBcompTextChange gHed.text_GHed @GHed_setTextParam nil; GHed_hideCheckIcone; GHed_hideCheckText; /* buttons callback */ _CBcompCheckClick gHed.miniCheck_GHed @GHed_CBcheckClick ["mini" gHed.middleCheck_GHed gHed.maxiCheck_GHed gHed.textCheck_GHed]; _CBcompCheckClick gHed.middleCheck_GHed @GHed_CBcheckClick ["middle" gHed.miniCheck_GHed gHed.maxiCheck_GHed gHed.textCheck_GHed]; _CBcompCheckClick gHed.maxiCheck_GHed @GHed_CBcheckClick ["maxi" gHed.miniCheck_GHed gHed.middleCheck_GHed gHed.textCheck_GHed]; _CBcompCheckClick gHed.textCheck_GHed @GHed_CBcheckClick ["text" gHed.miniCheck_GHed gHed.middleCheck_GHed gHed.maxiCheck_GHed]; _CBcompCheckStateChanged gHed.miniCheck_GHed @GHed_CBcheckState "icone"; _CBcompCheckStateChanged gHed.middleCheck_GHed @GHed_CBcheckState "icone"; _CBcompCheckStateChanged gHed.maxiCheck_GHed @GHed_CBcheckState "icone"; _CBcompCheckStateChanged gHed.textCheck_GHed @GHed_CBcheckState "text"; GHed_hide; ); 1;; /*******************************************/ /* load Parameters into graphic components */ /*******************************************/ fun GHed_loadParams () = ggd_SETcompText gHed.width_GHed gHed.widthParam_GHed; ggd_SETcompText gHed.iconeFln_GHed gHed.iconeFlnParam_GHed; ggd_SETcompText gHed.text_GHed gHed.textParam_GHed; let if (!strcmp gHed.iconeCheckParam_GHed "mini") then gHed.miniCheck_GHed else if (!strcmp gHed.iconeCheckParam_GHed "middle") then gHed.middleCheck_GHed else if (!strcmp gHed.iconeCheckParam_GHed "maxi") then gHed.maxiCheck_GHed else if (!strcmp gHed.iconeCheckParam_GHed "text") then gHed.textCheck_GHed else nil -> checkobj in _SETcompCheckState checkobj CHK_CHECKED; 1;; /*******************************/ /* return Parameters */ /*******************************/ fun GHed_getParams () = ("widthParam_GHed"::gHed.widthParam_GHed::nil):: ("iconeCheckParam_GHed"::gHed.iconeCheckParam_GHed::nil):: ("iconeFlnParam_GHed"::gHed.iconeFlnParam_GHed::nil):: ("textParam_GHed"::gHed.textParam_GHed::nil):: nil;; /*************************************************************************************/ /*************************************************************************************/ /** **/ /** T I T L E S C O N F I G U R A T I O N **/ /** **/ /*************************************************************************************/ /*************************************************************************************/ /*******************************/ /* show graphic components */ /*******************************/ fun THed_show () = _CHANGEobjNodeFlags tHed.root_THed OBJ_ENABLE|OBJ_VISIBLE 1; _PAINTcontainer hed.cont_Hed; 1;; fun THed_showCheckColor () = if (tHed.bkgColor_THed == nil) then nil else ( let tHed.bkgColor_THed -> [_ roll] in _CHANGEobjNodeFlags (_CONVERTcompRollOverToObjNode roll) OBJ_ENABLE|OBJ_VISIBLE 1; _PAINTcontainer hed.cont_Hed; ); 1;; fun THed_showCheckBitmap () = if (tHed.bkgBitmapFln_THed == nil) then nil else ( GD_ShowGraphicObject (_CONVERTcompTextToObjNode tHed.bkgBitmapFln_THed); GD_ShowGraphicObject (_CONVERTcompRollOverToObjNode tHed.bkgBitmapButton_THed); /*_CHANGEobjNodeFlags (_CONVERTcompTextToObjNode tHed.bkgBitmapFln_THed) OBJ_ENABLE|OBJ_VISIBLE 1; _CHANGEobjNodeFlags (_CONVERTcompRollOverToObjNode tHed.bkgBitmapButton_THed) OBJ_ENABLE|OBJ_VISIBLE 1;*/ _PAINTcontainer hed.cont_Hed; ); 1;; /*******************************/ /* hide graphic components */ /*******************************/ fun THed_hide () = _CHANGEobjNodeFlags tHed.root_THed OBJ_ENABLE|OBJ_HIDE 1; _PAINTcontainer hed.cont_Hed; 1;; fun THed_hideCheckColor () = if (tHed.bkgColor_THed == nil) then nil else ( let tHed.bkgColor_THed -> [_ roll] in _CHANGEobjNodeFlags (_CONVERTcompRollOverToObjNode roll) OBJ_ENABLE|OBJ_HIDE 1; _PAINTcontainer hed.cont_Hed; ); 1;; fun THed_hideCheckBitmap () = if (tHed.bkgBitmapFln_THed == nil) then nil else ( GD_HideGraphicObject (_CONVERTcompTextToObjNode tHed.bkgBitmapFln_THed); GD_HideGraphicObject (_CONVERTcompRollOverToObjNode tHed.bkgBitmapButton_THed); /*_CHANGEobjNodeFlags (_CONVERTcompTextToObjNode tHed.bkgBitmapFln_THed) OBJ_ENABLE|OBJ_HIDE 1; _CHANGEobjNodeFlags (_CONVERTcompRollOverToObjNode tHed.bkgBitmapButton_THed) OBJ_ENABLE|OBJ_HIDE 1;*/ _PAINTcontainer hed.cont_Hed; ); 1;; /*******************************/ /* destroy graphic components */ /*******************************/ fun THed_destroy () = GRAPHICDRESSING_DScompRollOver tHed.bkgBitmapButton_THed; GRAPHICDRESSING_DScompText tHed.bkgBitmapFln_THed; GRAPHICDRESSING_DScompCheck tHed.bkgBitmapCheck_THed; GRAPHICDRESSING_DScompText tHed.bkgBitmapCheckLbl_THed; let tHed.bkgColor_THed -> [alpha roll] in ( _DSalphaBitmap alpha; _DScompRollOver roll; ); GRAPHICDRESSING_DScompCheck tHed.bkgColorCheck_THed; GRAPHICDRESSING_DScompText tHed.bkgColorCheckLbl_THed; GRAPHICDRESSING_DScompText tHed.bkgLbl_THed; let tHed.space_THed -> [alpha cbmp] in ( _DSalphaBitmap alpha; _DScompBitmap cbmp; ); GRAPHICDRESSING_DScompText tHed.minHeightLbl_THed; GRAPHICDRESSING_DScompText tHed.minHeight_THed; let tHed.txtColor_THed -> [alpha roll] in ( _DSalphaBitmap alpha; _DScompRollOver roll; ); GRAPHICDRESSING_DScompText tHed.txtColorLbl_THed; GRAPHICDRESSING_DScompText tHed.size_THed; GRAPHICDRESSING_DScompText tHed.sizeLbl_THed; GRAPHICDRESSING_DScompRollOver tHed.fontBtt_THed; GRAPHICDRESSING_DScompText tHed.font_THed; GRAPHICDRESSING_DScompText tHed.fontLbl_THed; GRAPHICDRESSING_DScompText tHed.textLbl_THed; 1;; /******************************************/ /* set parameters fields */ /******************************************/ fun THed_setFontParam (obj, z, type, text) = set tHed.fontParam_THed = text; 1;; fun THed_setSizeParam (obj, z, type, text) = set tHed.sizeParam_THed = text; 1;; fun THed_setColorParam (color) = set tHed.colorParam_THed = color; 1;; fun THed_setBkgColorParam (color) = set tHed.bkgColorParam_THed = color; 1;; fun THed_setBkgBitmapParam (obj, z, type, text) = set tHed.bkgBitmapParam_THed = text; 1;; fun THed_setMinHeightParam (obj, z, type, text) = set tHed.minHeightParam_THed = text; 1;; /* others params are set in graphic objects code */ /******************************************/ /* button type compChecks click callback */ /******************************************/ fun THed_CBcheckClick (checkobj, others, x, y, btn, msk) = let _GETcompCheckState checkobj -> state in let others -> [type check2] in ( /* set bkg check param */ set tHed.bkgCheckParam_THed = type; if (state == CHK_CHECKED) then nil else _SETcompCheckState checkobj CHK_CHECKED; _SETcompCheckState check2 CHK_UNCHECKED; );; /*************************************************/ /* button type compChecks state changed callback */ /*************************************************/ fun THed_CBcheckState (checkobj, param, state) = if ((!strcmp param "color") && (state == CHK_CHECKED)) then ( THed_showCheckColor; THed_hideCheckBitmap; ) else if ((!strcmp param "bitmap") && (state == CHK_CHECKED)) then ( THed_hideCheckColor; THed_showCheckBitmap; ) else nil; _PAINTcontainer hed.cont_Hed;; /**************************************************/ /* check the selected file by the file dialog box */ /**************************************************/ fun THed_CBsetBkgFln (openbox, z ,file) = if (file == nil) then nil else let _PtoScol file -> path in if (path == nil) then ( _DLGMessageBox _channel nil "Error" (_loc this "HED_ERROR_SCOL_PATH" nil) 0; 0; ) else ( ggd_SETcompText tHed.bkgBitmapFln_THed path; THed_setBkgBitmapParam tHed.bkgBitmapFln_THed nil nil path; _PAINTcontainer hed.cont_Hed; 1; );; /*************************************************/ /* call the file dialog box */ /*************************************************/ fun THed_CBchooseBkgFln (rollobj, z, x, y, btn, msk) = _DLGrflopen _DLGOpenFile _channel nil nil nil "png(*.png)\0*.png\0\0" @THed_CBsetBkgFln nil;; /*******************************/ /* create graphic components */ /*******************************/ fun THed_create () = let hed.cx_Hed -> tcx in let hed.cy_Hed -> tcy in let hed.cw_Hed -> tcw in let hed.ch_Hed -> tch in let tcx+10 -> fx in ( set tHed.root_THed = ggd_CRroot _channel hed.cont_Hed; ggd_PUSHfont; ggd_CRfont nil 16 "Arial" FF_UNDERLINE 0x0000ff; set tHed.textLbl_THed = ggd_CRlabel fx (tcy+10) 200 22 nil (_loc this "THED_TEXT_LBL" nil); ggd_POPfont; /* title's texte configuration */ set tHed.fontLbl_THed = ggd_CRlabel fx (tcy + 52) 120 25 nil (_loc this "THED_FONT_LBL" nil); set tHed.font_THed = ggd_CRline (tcx+140) (tcy+50) 240 22 nil nil; _CBcompTextValidation tHed.font_THed @THed_setFontParam nil CT_VALIDENTER|CT_VALIDCLICK; set tHed.fontBtt_THed = ggd_CRrollOverText [(tcx+390) (tcy+50)] 22 22 nil "?"; _CBcompRollOverClick tHed.fontBtt_THed @Hed_getFontHelp nil; set tHed.sizeLbl_THed = ggd_CRlabel fx (tcy+97) 120 25 nil (_loc this "THED_SIZE_LBL" nil); set tHed.size_THed = ggd_CRline (tcx + 140) (tcy+95) 30 22 nil nil; _CBcompTextValidation tHed.size_THed @THed_setSizeParam nil CT_VALIDENTER|CT_VALIDCLICK; set tHed.txtColorLbl_THed = ggd_CRlabel (tcx+250) (tcy+97) 120 25 nil (_loc this "THED_COLOR_LBL" nil); set tHed.minHeightLbl_THed = ggd_CRlabel fx (tcy+142) 120 28 nil (_loc this "THED_MINHEIGHT_LBL" nil); set tHed.minHeight_THed = ggd_CRline (tcx+140) (tcy+140) 30 22 nil nil; _CBcompTextValidation tHed.minHeight_THed @THed_setMinHeightParam nil CT_VALIDENTER|CT_VALIDCLICK; /* color compRollOver is constructed in THed_loadParams () */ /* space line */ let _CRbitmap _channel (tcw-4) 2 -> newBmp in let _DRAWline newBmp 0 0 (tcw-5) 0 DRAW_SOLID 1 (make_rgb 127 127 127) -> newBmp in let _DRAWline newBmp 0 1 (tcw-5) 1 DRAW_SOLID 1 (make_rgb 255 255 255) -> newBmp in let _CRalphaBitmap _channel newBmp nil nil nil -> alpha in ( _DSbitmap newBmp; set tHed.space_THed = ggd_CRbitmap (tcx+2) (tcy+183) nil alpha; ); /* background */ ggd_PUSHfont; ggd_CRfont nil 16 "Arial" FF_UNDERLINE 0x0000ff; set tHed.bkgLbl_THed = ggd_CRlabel fx (tcy+193) 200 22 nil (_loc this "THED_BKG_LBL" nil); ggd_POPfont; set tHed.bkgColorCheckLbl_THed = ggd_CRlabel fx (tcy+235) 100 22 nil (_loc this "THED_BKG_COLOR_CHECK_LBL" nil); set tHed.bkgColorCheck_THed = ggd_CRcheckMini [(tcx+120) (tcy+230)] nil nil; /* const rollover for background color in THed_loadParams () */ set tHed.bkgBitmapCheckLbl_THed = ggd_CRlabel fx (tcy+280) 100 28 nil (_loc this "THED_BKG_BITMAP_CHECK_LBL" nil); set tHed.bkgBitmapCheck_THed = ggd_CRcheckMini [(tcx+120) (tcy+278)] nil nil; set tHed.bkgBitmapFln_THed = ggd_CRline (tcx+170) (tcy+278) 230 22 nil nil; _CBcompTextValidation tHed.bkgBitmapFln_THed @THed_setBkgBitmapParam nil CT_VALIDENTER|CT_VALIDCLICK; set tHed.bkgBitmapButton_THed = ggd_CRrollOverText [(tcx+410) (tcy+278)] 30 22 nil "..."; _CBcompRollOverClick tHed.bkgBitmapButton_THed @THed_CBchooseBkgFln nil; THed_hide; 1; );; proto THed_loadColorMap = fun [CompRollOver fun [I] I I I I I I] I;; proto THed_getTxtColor = fun [I] I;; proto THed_getBkgColor = fun [I] I;; /*******************************************/ /* get the color returned by the color map */ /*******************************************/ fun THed_getTxtColor (color) = let tHed.txtColor_THed -> [alpha roll] in ( THed_setColorParam (strcat "0x" (itoh color)); _DSalphaBitmap alpha; _DScompRollOver roll; ggd_setRoot tHed.root_THed; set tHed.txtColor_THed = ggd_CRrollOverCustom [(hed.cx_Hed+380) (hed.cy_Hed+95)] 30 80 nil color nil; let tHed.txtColor_THed -> [_ roll] in _CBcompRollOverClick roll (mkfun7 @THed_loadColorMap color) @THed_getTxtColor; _PAINTcontainer hed.cont_Hed; ); 1;; fun THed_getBkgColor (color) = let tHed.bkgColor_THed -> [alpha roll] in ( THed_setBkgColorParam (strcat "0x" (itoh color)); _DSalphaBitmap alpha; _DScompRollOver roll; ggd_setRoot tHed.root_THed; set tHed.bkgColor_THed = ggd_CRrollOverCustom [(hed.cx_Hed+170) (hed.cy_Hed+233)] 30 80 nil color nil; let tHed.bkgColor_THed -> [_ roll] in _CBcompRollOverClick roll (mkfun7 @THed_loadColorMap color) @THed_getBkgColor; _PAINTcontainer hed.cont_Hed; ); 1;; /*******************************************/ /* load colormap to choose a color */ /*******************************************/ fun THed_loadColorMap (objroll, callbck, x, y, btn, msk, initialColor) = _CRcolorMap _channel nil 50 50 "test" callbck initialColor; 1;; /*******************************************/ /* load Parameters into graphic components */ /*******************************************/ fun THed_loadParams () = let hed.cx_Hed -> tcx in let hed.cy_Hed -> tcy in ( ggd_SETcompText tHed.font_THed tHed.fontParam_THed; ggd_SETcompText tHed.size_THed tHed.sizeParam_THed; /* constr. alphabitmap for comprollover */ let htoi tHed.colorParam_THed -> color in ( set tHed.txtColor_THed = ggd_CRrollOverCustom [(tcx+380) (tcy+95)] 30 80 nil color nil; let tHed.txtColor_THed -> [_ roll] in _CBcompRollOverClick roll (mkfun7 @THed_loadColorMap color) @THed_getTxtColor; ); THed_hideCheckColor; ggd_SETcompText tHed.minHeight_THed tHed.minHeightParam_THed; /* constr. alphabitmap for comprollover */ let htoi tHed.bkgColorParam_THed -> color in ( set tHed.bkgColor_THed = ggd_CRrollOverCustom [(tcx+170) (tcy+233)] 30 80 nil color nil; let tHed.bkgColor_THed -> [_ roll] in _CBcompRollOverClick roll (mkfun7 @THed_loadColorMap color) @THed_getBkgColor; ); THed_hideCheckBitmap; /* buttons callback */ _CBcompCheckClick tHed.bkgColorCheck_THed @THed_CBcheckClick ["color" tHed.bkgBitmapCheck_THed]; _CBcompCheckClick tHed.bkgBitmapCheck_THed @THed_CBcheckClick ["bitmap" tHed.bkgColorCheck_THed]; _CBcompCheckStateChanged tHed.bkgColorCheck_THed @THed_CBcheckState "color"; _CBcompCheckStateChanged tHed.bkgBitmapCheck_THed @THed_CBcheckState "bitmap"; if (!strcmp tHed.bkgCheckParam_THed "color") then _SETcompCheckState tHed.bkgColorCheck_THed CHK_CHECKED else if (!strcmp tHed.bkgCheckParam_THed "bitmap") then _SETcompCheckState tHed.bkgBitmapCheck_THed CHK_CHECKED else nil; ggd_SETcompText tHed.bkgBitmapFln_THed tHed.bkgBitmapParam_THed; ); 1;; /*******************************/ /* return Parameters */ /*******************************/ fun THed_getParams () = ("fontParam_THed"::tHed.fontParam_THed::nil):: ("sizeParam_THed"::tHed.sizeParam_THed::nil):: ("colorParam_THed"::tHed.colorParam_THed::nil):: ("minHeightParam_THed"::tHed.minHeightParam_THed::nil):: ("bkgCheckParam_THed"::tHed.bkgCheckParam_THed::nil):: ("bkgColorParam_THed"::tHed.bkgColorParam_THed::nil):: ("bkgBitmapParam_THed"::tHed.bkgBitmapParam_THed::nil):: nil;; /**********************************************************************************/ /**********************************************************************************/ /** **/ /** H E L P F I E L D S C O N F I G U R A T I O N **/ /** **/ /**********************************************************************************/ /**********************************************************************************/ /*******************************/ /* show graphic components */ /*******************************/ proto Hed_enableUpArrow = fun [] I;; proto Hed_disableUpArrow = fun [] I;; proto Hed_enableDownArrow = fun [] I;; proto Hed_disableDownArrow = fun [] I;; fun FHed_hideRoot1 () = _CHANGEobjNodeFlags fHed.root1_FHed OBJ_ENABLE|OBJ_HIDE 1; _PAINTcontainer hed.cont_Hed; 1;; fun FHed_hideRoot2 () = _CHANGEobjNodeFlags fHed.root2_FHed OBJ_ENABLE|OBJ_HIDE 1; _PAINTcontainer hed.cont_Hed; 1;; fun FHed_showRoot1 (objroll, z, x, y ,btn, msk) = Hed_disableUpArrow; Hed_enableDownArrow; FHed_hideRoot2; _CHANGEobjNodeFlags fHed.root1_FHed OBJ_ENABLE|OBJ_VISIBLE 1; _PAINTcontainer hed.cont_Hed; 1;; fun FHed_showRoot2 (objroll, z, x, y, btn, msk) = FHed_hideRoot1; Hed_enableUpArrow; Hed_disableDownArrow; _CHANGEobjNodeFlags fHed.root2_FHed OBJ_ENABLE|OBJ_VISIBLE 1; _PAINTcontainer hed.cont_Hed; 1;; fun FHed_showCheckColor () = if (fHed.bkgColor_FHed == nil) then nil else ( let fHed.bkgColor_FHed -> [_ roll] in _CHANGEobjNodeFlags (_CONVERTcompRollOverToObjNode roll) OBJ_ENABLE|OBJ_VISIBLE 1; _PAINTcontainer hed.cont_Hed; ); 1;; fun FHed_showCheckBitmap () = if (fHed.bkgBitmapFln_FHed == nil) then nil else ( GD_ShowGraphicObject (_CONVERTcompTextToObjNode fHed.bkgBitmapFln_FHed); GD_ShowGraphicObject (_CONVERTcompRollOverToObjNode fHed.bkgBitmapButton_FHed); /*_CHANGEobjNodeFlags (_CONVERTcompTextToObjNode fHed.bkgBitmapFln_FHed) OBJ_ENABLE|OBJ_VISIBLE 1; _CHANGEobjNodeFlags (_CONVERTcompRollOverToObjNode fHed.bkgBitmapButton_FHed) OBJ_ENABLE|OBJ_VISIBLE 1;*/ _PAINTcontainer hed.cont_Hed; ); 1;; /*******************************/ /* hide graphic components */ /*******************************/ fun FHed_hideCheckColor () = if (fHed.bkgColor_FHed == nil) then nil else ( let fHed.bkgColor_FHed -> [_ roll] in _CHANGEobjNodeFlags (_CONVERTcompRollOverToObjNode roll) OBJ_ENABLE|OBJ_HIDE 1; _PAINTcontainer hed.cont_Hed; ); 1;; fun FHed_hideCheckBitmap () = if (fHed.bkgBitmapFln_FHed == nil) then nil else ( GD_HideGraphicObject (_CONVERTcompTextToObjNode fHed.bkgBitmapFln_FHed); GD_HideGraphicObject (_CONVERTcompRollOverToObjNode fHed.bkgBitmapButton_FHed); /*_CHANGEobjNodeFlags (_CONVERTcompTextToObjNode fHed.bkgBitmapFln_FHed) OBJ_ENABLE|OBJ_HIDE 1; _CHANGEobjNodeFlags (_CONVERTcompRollOverToObjNode fHed.bkgBitmapButton_FHed) OBJ_ENABLE|OBJ_HIDE 1;*/ _PAINTcontainer hed.cont_Hed; ); 1;; /*******************************/ /* destroy graphic components */ /*******************************/ fun FHed_destroy () = GRAPHICDRESSING_DScompRollOver fHed.backBitmapButton_FHed; GRAPHICDRESSING_DScompText fHed.backBitmap_FHed; GRAPHICDRESSING_DScompText fHed.backBitmapLbl_FHed; GRAPHICDRESSING_DScompRollOver fHed.answerBitmapButton_FHed; GRAPHICDRESSING_DScompText fHed.answerBitmap_FHed; GRAPHICDRESSING_DScompText fHed.answerBitmapLbl_FHed; GRAPHICDRESSING_DScompRollOver fHed.questionBitmapButton_FHed; GRAPHICDRESSING_DScompText fHed.questionBitmap_FHed; GRAPHICDRESSING_DScompText fHed.questionBitmapLbl_FHed; GRAPHICDRESSING_DScompText fHed.buttonsLbl_FHed; let fHed.space2_FHed -> [alpha cbmp] in ( _DSalphaBitmap alpha; _DScompBitmap cbmp; ); GRAPHICDRESSING_DScompRollOver fHed.bkgBitmapButton_FHed; GRAPHICDRESSING_DScompText fHed.bkgBitmapFln_FHed; GRAPHICDRESSING_DScompCheck fHed.bkgBitmapCheck_FHed; GRAPHICDRESSING_DScompText fHed.bkgBitmapCheckLbl_FHed; let fHed.bkgColor_FHed -> [alpha roll] in ( _DSalphaBitmap alpha; _DScompRollOver roll; ); GRAPHICDRESSING_DScompCheck fHed.bkgColorCheck_FHed; GRAPHICDRESSING_DScompText fHed.bkgColorCheckLbl_FHed; GRAPHICDRESSING_DScompText fHed.bkgLbl_FHed; let fHed.space1_FHed -> [alpha cbmp] in ( _DSalphaBitmap alpha; _DScompBitmap cbmp; ); GRAPHICDRESSING_DScompText fHed.aMinHeightLbl_FHed; GRAPHICDRESSING_DScompText fHed.aMinHeight_FHed; let fHed.atxtColor_FHed -> [alpha roll] in ( _DSalphaBitmap alpha; _DScompRollOver roll; ); GRAPHICDRESSING_DScompText fHed.atxtColorLbl_FHed; GRAPHICDRESSING_DScompText fHed.asize_FHed; GRAPHICDRESSING_DScompText fHed.asizeLbl_FHed; GRAPHICDRESSING_DScompRollOver fHed.afontBtt_FHed; GRAPHICDRESSING_DScompText fHed.afont_FHed; GRAPHICDRESSING_DScompText fHed.afontLbl_FHed; GRAPHICDRESSING_DScompText fHed.atextLbl_FHed; GRAPHICDRESSING_DScompText fHed.qMinHeightLbl_FHed; GRAPHICDRESSING_DScompText fHed.qMinHeight_FHed; let fHed.qtxtColor_FHed -> [alpha roll] in ( _DSalphaBitmap alpha; _DScompRollOver roll; ); GRAPHICDRESSING_DScompText fHed.qtxtColorLbl_FHed; GRAPHICDRESSING_DScompText fHed.qsize_FHed; GRAPHICDRESSING_DScompText fHed.qsizeLbl_FHed; GRAPHICDRESSING_DScompRollOver fHed.qfontBtt_FHed; GRAPHICDRESSING_DScompText fHed.qfont_FHed; GRAPHICDRESSING_DScompText fHed.qfontLbl_FHed; GRAPHICDRESSING_DScompText fHed.qtextLbl_FHed; 1;; /******************************************/ /* set parameters fields */ /******************************************/ fun FHed_setQFontParam (obj, z, type, text) = set fHed.qfontParam_FHed = text; 1;; fun FHed_setAFontParam (obj, z, type, text) = set fHed.afontParam_FHed = text; 1;; fun FHed_setQSizeParam (obj, z, type, text) = set fHed.qsizeParam_FHed = text; 1;; fun FHed_setASizeParam (obj, z, type, text) = set fHed.asizeParam_FHed = text; 1;; fun FHed_setQColorParam (color) = set fHed.qcolorParam_FHed = color; 1;; fun FHed_setAColorParam (color) = set fHed.acolorParam_FHed = color; 1;; fun FHed_setBkgColorParam (color) = set fHed.bkgColorParam_FHed = color; 1;; fun FHed_setBkgBitmapParam (obj, z, type, text) = set fHed.bkgBitmapParam_FHed = text; 1;; fun FHed_setQuestionBitmapParam (obj, z, type, text) = set fHed.questionBitmapParam_FHed = text; 1;; fun FHed_setAnswerBitmapParam (obj, z, type, text) = set fHed.answerBitmapParam_FHed = text; 1;; fun FHed_setBackBitmapParam (obj, z, type, text) = set fHed.backBitmapParam_FHed = text; 1;; fun FHed_setQMinHeightParam (obj, z, type, text) = set fHed.qMinHeightParam_FHed = text; 1;; fun FHed_setAMinHeightParam (obj, z, type, text) = set fHed.aMinHeightParam_FHed = text; 1;; /* others params are set in graphic objects code */ /******************************************/ /* button type compChecks click callback */ /******************************************/ fun FHed_CBcheckClick (checkobj, others, x, y, btn, msk) = let _GETcompCheckState checkobj -> state in let others -> [type check2] in ( /* set bkg check param */ set fHed.bkgCheckParam_FHed = type; if (state == CHK_CHECKED) then nil else _SETcompCheckState checkobj CHK_CHECKED; _SETcompCheckState check2 CHK_UNCHECKED; );; /*************************************************/ /* button type compChecks state changed callback */ /*************************************************/ fun FHed_CBcheckState (checkobj, param, state) = if ((!strcmp param "color") && (state == CHK_CHECKED)) then ( FHed_showCheckColor; FHed_hideCheckBitmap; ) else if ((!strcmp param "bitmap") && (state == CHK_CHECKED)) then ( FHed_hideCheckColor; FHed_showCheckBitmap; ) else nil; _PAINTcontainer hed.cont_Hed;; /**************************************************/ /* check the selected file by the file dialog box */ /**************************************************/ fun FHed_CBsetBkgFln (openbox, z ,file) = if (file == nil) then nil else let _PtoScol file -> path in if (path == nil) then ( _DLGMessageBox _channel nil "Error" (_loc this "HED_ERROR_SCOL_PATH" nil) 0; 0; ) else ( ggd_SETcompText fHed.bkgBitmapFln_FHed path; FHed_setBkgBitmapParam fHed.bkgBitmapFln_FHed nil nil path; _PAINTcontainer hed.cont_Hed; 1; );; /*************************************************/ /* call the file dialog box */ /*************************************************/ fun FHed_CBchooseBkgFln (rollobj, z, x, y, btn, msk) = _DLGrflopen _DLGOpenFile _channel nil nil nil "png(*.png)\0*.png\0\0" @FHed_CBsetBkgFln nil;; /**************************************************/ /* check the selected file by the file dialog box */ /**************************************************/ fun FHed_CBsetBttFln (openbox, tuple ,file) = if (file == nil) then nil else let _PtoScol file -> path in if (path == nil) then ( _DLGMessageBox _channel nil "Error" (_loc this "HED_ERROR_SCOL_PATH" nil) 0; 0; ) else let tuple -> [objtxt param] in ( ggd_SETcompText objtxt path; if (!strcmp param "questionBitmap") then FHed_setQuestionBitmapParam fHed.questionBitmap_FHed nil nil path else if (!strcmp param "answerBitmap") then FHed_setAnswerBitmapParam fHed.answerBitmap_FHed nil nil path else if (!strcmp param "backBitmap") then FHed_setBackBitmapParam fHed.backBitmap_FHed nil nil path else nil; _PAINTcontainer hed.cont_Hed; 1; );; /*************************************************/ /* call the file dialog box */ /*************************************************/ fun FHed_CBchooseBttFln (rollobj, tuple, x, y, btn, msk) = _DLGrflopen _DLGOpenFile _channel nil nil nil "png(*.png)\0*.png\0\0" @FHed_CBsetBttFln tuple;; /*******************************/ /* create graphic components */ /*******************************/ fun FHed_create () = let hed.cx_Hed -> tcx in let hed.cy_Hed -> tcy in let hed.cw_Hed -> tcw in let hed.ch_Hed -> tch in let tcx+10 -> fx in ( set fHed.root1_FHed = ggd_CRroot _channel hed.cont_Hed; ggd_PUSHfont; ggd_CRfont nil 16 "Arial" FF_UNDERLINE 0x0000ff; set fHed.qtextLbl_FHed = ggd_CRlabel fx (tcy+10) 250 22 nil (_loc this "FHED_QTEXT_LBL" nil); ggd_POPfont; /* question field's texte configuration */ set fHed.qfontLbl_FHed = ggd_CRlabel fx (tcy + 52) 120 25 nil (_loc this "THED_FONT_LBL" nil); set fHed.qfont_FHed = ggd_CRline (tcx+140) (tcy+50) 240 22 nil nil; _CBcompTextValidation fHed.qfont_FHed @FHed_setQFontParam nil CT_VALIDENTER|CT_VALIDCLICK; set fHed.qfontBtt_FHed = ggd_CRrollOverText [(tcx+390) (tcy+50)] 22 22 nil "?"; _CBcompRollOverClick fHed.qfontBtt_FHed @Hed_getFontHelp nil; set fHed.qsizeLbl_FHed = ggd_CRlabel fx (tcy+97) 120 25 nil (_loc this "THED_SIZE_LBL" nil); set fHed.qsize_FHed = ggd_CRline (tcx + 140) (tcy+95) 30 22 nil nil; _CBcompTextValidation fHed.qsize_FHed @FHed_setQSizeParam nil CT_VALIDENTER|CT_VALIDCLICK; set fHed.qtxtColorLbl_FHed = ggd_CRlabel (tcx+250) (tcy+97) 120 25 nil (_loc this "THED_COLOR_LBL" nil); /* color compRollOver is constructed in FHed_loadParams () */ set fHed.qMinHeightLbl_FHed = ggd_CRlabel fx (tcy+142) 120 29 nil (_loc this "FHED_QMINHEIGHT_LBL" nil); set fHed.qMinHeight_FHed = ggd_CRline (tcx+140) (tcy+140) 30 22 nil nil; _CBcompTextValidation fHed.qMinHeight_FHed @FHed_setQMinHeightParam nil CT_VALIDENTER|CT_VALIDCLICK; /* space lines */ let _CRbitmap _channel (tcw-4) 2 -> newBmp in let _DRAWline newBmp 0 0 (tcw-5) 0 DRAW_SOLID 1 (make_rgb 127 127 127) -> newBmp in let _DRAWline newBmp 0 1 (tcw-5) 1 DRAW_SOLID 1 (make_rgb 255 255 255) -> newBmp in let _CRalphaBitmap _channel newBmp nil nil nil -> alpha in ( _DSbitmap newBmp; set fHed.space1_FHed = ggd_CRbitmap (tcx+2) (tcy+183) nil alpha; ); /**********************************************************/ let tcy+183 -> tcy in ( ggd_PUSHfont; ggd_CRfont nil 16 "Arial" FF_UNDERLINE 0x0000ff; set fHed.atextLbl_FHed = ggd_CRlabel fx (tcy+10) 250 22 nil (_loc this "FHED_ATEXT_LBL" nil); ggd_POPfont; /* answer field's texte configuration */ set fHed.afontLbl_FHed = ggd_CRlabel fx (tcy + 52) 120 25 nil (_loc this "THED_FONT_LBL" nil); set fHed.afont_FHed = ggd_CRline (tcx+140) (tcy+50) 240 22 nil nil; _CBcompTextValidation fHed.afont_FHed @FHed_setAFontParam nil CT_VALIDENTER|CT_VALIDCLICK; set fHed.afontBtt_FHed = ggd_CRrollOverText [(tcx+390) (tcy+50)] 22 22 nil "?"; _CBcompRollOverClick fHed.afontBtt_FHed @Hed_getFontHelp nil; set fHed.asizeLbl_FHed = ggd_CRlabel fx (tcy+97) 120 25 nil (_loc this "THED_SIZE_LBL" nil); set fHed.asize_FHed = ggd_CRline (tcx + 140) (tcy+95) 30 22 nil nil; _CBcompTextValidation fHed.asize_FHed @FHed_setASizeParam nil CT_VALIDENTER|CT_VALIDCLICK; set fHed.atxtColorLbl_FHed = ggd_CRlabel (tcx+250) (tcy+97) 120 25 nil (_loc this "THED_COLOR_LBL" nil); set fHed.aMinHeightLbl_FHed = ggd_CRlabel fx (tcy + 142) 120 28 nil (_loc this "FHED_AMINHEIGHT_LBL" nil); set fHed.aMinHeight_FHed = ggd_CRline (tcx+140) (tcy+140) 30 22 nil nil; _CBcompTextValidation fHed.aMinHeight_FHed @FHed_setAMinHeightParam nil CT_VALIDENTER|CT_VALIDCLICK; ); /* color compRollOver is constructed in FHed_loadParams () */ /***********************************************************************/ set fHed.root2_FHed = ggd_CRroot _channel hed.cont_Hed; /* background */ ggd_PUSHfont; ggd_CRfont nil 16 "Arial" FF_UNDERLINE 0x0000ff; set fHed.bkgLbl_FHed = ggd_CRlabel fx (tcy+10) 300 22 nil (_loc this "FHED_BKG_LBL" nil); ggd_POPfont; set fHed.bkgColorCheckLbl_FHed = ggd_CRlabel fx (tcy+52) 100 22 nil (_loc this "THED_BKG_COLOR_CHECK_LBL" nil); set fHed.bkgColorCheck_FHed = ggd_CRcheckMini [(tcx+120) (tcy+50)] nil nil; /* const rollover for background color in FHed_loadParams () */ set fHed.bkgBitmapCheckLbl_FHed = ggd_CRlabel fx (tcy+97) 100 28 nil (_loc this "THED_BKG_BITMAP_CHECK_LBL" nil); set fHed.bkgBitmapCheck_FHed = ggd_CRcheckMini [(tcx+120) (tcy+95)] nil nil; set fHed.bkgBitmapFln_FHed = ggd_CRline (tcx+170) (tcy+95) 230 22 nil nil; _CBcompTextValidation fHed.bkgBitmapFln_FHed @FHed_setBkgBitmapParam nil CT_VALIDENTER|CT_VALIDCLICK; set fHed.bkgBitmapButton_FHed = ggd_CRrollOverText [(tcx+410) (tcy+95)] 30 22 nil "..."; _CBcompRollOverClick fHed.bkgBitmapButton_FHed @FHed_CBchooseBkgFln nil; /* space lines */ let _CRbitmap _channel (tcw-4) 2 -> newBmp in let _DRAWline newBmp 0 0 (tcw-5) 0 DRAW_SOLID 1 (make_rgb 127 127 127) -> newBmp in let _DRAWline newBmp 0 1 (tcw-5) 1 DRAW_SOLID 1 (make_rgb 255 255 255) -> newBmp in let _CRalphaBitmap _channel newBmp nil nil nil -> alpha in ( _DSbitmap newBmp; set fHed.space2_FHed = ggd_CRbitmap (tcx+2) (tcy+140) nil alpha; ); /*********************************************************************************/ /* buttons */ ggd_PUSHfont; ggd_CRfont nil 16 "Arial" FF_UNDERLINE 0x0000ff; set fHed.buttonsLbl_FHed = ggd_CRlabel fx (tcy+150) 200 22 nil (_loc this "FHED_BTT_LBL" nil); ggd_POPfont; set fHed.questionBitmapLbl_FHed = ggd_CRlabel fx (tcy+180) 100 45 nil (_loc this "FHED_BTT_QUESTION_LBL" nil); set fHed.questionBitmap_FHed = ggd_CRline (fx + 110) (tcy+180) 280 22 nil nil; _CBcompTextValidation fHed.questionBitmap_FHed @FHed_setQuestionBitmapParam nil CT_VALIDENTER|CT_VALIDCLICK; set fHed.questionBitmapButton_FHed = ggd_CRrollOverText [(fx+400) (tcy+180)] 30 22 nil "..."; _CBcompRollOverClick fHed.questionBitmapButton_FHed @FHed_CBchooseBttFln [fHed.questionBitmap_FHed "questionBitmap"]; set fHed.answerBitmapLbl_FHed = ggd_CRlabel fx (tcy+230) 100 45 nil (_loc this "FHED_BTT_ANSWER_LBL" nil); set fHed.answerBitmap_FHed = ggd_CRline (fx + 110) (tcy+235) 280 22 nil nil; _CBcompTextValidation fHed.answerBitmap_FHed @FHed_setAnswerBitmapParam nil CT_VALIDENTER|CT_VALIDCLICK; set fHed.answerBitmapButton_FHed = ggd_CRrollOverText [(fx+400) (tcy+235)] 30 22 nil "..."; _CBcompRollOverClick fHed.answerBitmapButton_FHed @FHed_CBchooseBttFln [fHed.answerBitmap_FHed "answerBitmap"]; set fHed.backBitmapLbl_FHed = ggd_CRlabel fx (tcy+280) 100 45 nil (_loc this "FHED_BTT_BACK_LBL" nil); set fHed.backBitmap_FHed = ggd_CRline (fx + 110) (tcy+287) 280 22 nil nil; _CBcompTextValidation fHed.backBitmap_FHed @FHed_setBackBitmapParam nil CT_VALIDENTER|CT_VALIDCLICK; set fHed.backBitmapButton_FHed = ggd_CRrollOverText [(fx+400) (tcy+287)] 30 22 nil "..."; _CBcompRollOverClick fHed.backBitmapButton_FHed @FHed_CBchooseBttFln [fHed.backBitmap_FHed "backBitmap"]; FHed_hideRoot1; FHed_hideRoot2; 1; );; proto FHed_loadColorMap = fun [CompRollOver fun [I] I I I I I] I;; proto FHed_getQTxtColor = fun [I] I;; proto FHed_getATxtColor = fun [I] I;; proto FHed_getBkgColor = fun [I] I;; /*******************************************/ /* get the color returned by the color map */ /*******************************************/ fun FHed_getQTxtColor (color) = let fHed.qtxtColor_FHed -> [alpha roll] in ( FHed_setQColorParam (strcat "0x" (itoh color)); _DSalphaBitmap alpha; _DScompRollOver roll; ggd_setRoot fHed.root1_FHed; set fHed.qtxtColor_FHed = ggd_CRrollOverCustom [(hed.cx_Hed+380) (hed.cy_Hed+95)] 30 80 nil color nil; let fHed.qtxtColor_FHed -> [_ roll] in _CBcompRollOverClick roll @FHed_loadColorMap @FHed_getQTxtColor; _PAINTcontainer hed.cont_Hed; ); 1;; fun FHed_getATxtColor (color) = let fHed.atxtColor_FHed -> [alpha roll] in ( FHed_setAColorParam (strcat "0x" (itoh color)); _DSalphaBitmap alpha; _DScompRollOver roll; ggd_setRoot fHed.root1_FHed; set fHed.atxtColor_FHed = ggd_CRrollOverCustom [(hed.cx_Hed+380) (hed.cy_Hed+183+95)] 30 80 nil color nil; let fHed.atxtColor_FHed -> [_ roll] in _CBcompRollOverClick roll @FHed_loadColorMap @FHed_getATxtColor; _PAINTcontainer hed.cont_Hed; ); 1;; fun FHed_getBkgColor (color) = let fHed.bkgColor_FHed -> [alpha roll] in ( FHed_setBkgColorParam (strcat "0x" (itoh color)); _DSalphaBitmap alpha; _DScompRollOver roll; ggd_setRoot fHed.root2_FHed; set fHed.bkgColor_FHed = ggd_CRrollOverCustom [(hed.cx_Hed+170) (hed.cy_Hed+50)] 30 80 nil color nil; let fHed.bkgColor_FHed -> [_ roll] in _CBcompRollOverClick roll @FHed_loadColorMap @FHed_getBkgColor; _PAINTcontainer hed.cont_Hed; ); 1;; /*******************************************/ /* load colormap to choose a color */ /*******************************************/ fun FHed_loadColorMap (objroll, callbck, x, y, btn, msk) = _CRcolorMap _channel nil 50 50 "test" callbck 0; 1;; /*******************************************/ /* load Parameters into graphic components */ /*******************************************/ fun FHed_loadParams () = let hed.cx_Hed -> tcx in let hed.cy_Hed -> tcy in ( ggd_SETcompText fHed.qfont_FHed fHed.qfontParam_FHed; ggd_SETcompText fHed.qsize_FHed fHed.qsizeParam_FHed; ggd_SETcompText fHed.qMinHeight_FHed fHed.qMinHeightParam_FHed; ggd_SETcompText fHed.afont_FHed fHed.afontParam_FHed; ggd_SETcompText fHed.asize_FHed fHed.asizeParam_FHed; ggd_SETcompText fHed.aMinHeight_FHed fHed.aMinHeightParam_FHed; /* constr. alphabitmap for comprollover */ ggd_setRoot fHed.root1_FHed; let htoi fHed.qcolorParam_FHed -> qcolor in set fHed.qtxtColor_FHed = ggd_CRrollOverCustom [(tcx+380) (tcy+95)] 30 80 nil qcolor nil; let fHed.qtxtColor_FHed -> [_ roll] in _CBcompRollOverClick roll @FHed_loadColorMap @FHed_getQTxtColor; /* constr. alphabitmap for comprollover */ let htoi fHed.acolorParam_FHed -> acolor in set fHed.atxtColor_FHed = ggd_CRrollOverCustom [(tcx+380) (tcy+183+95)] 30 80 nil acolor nil; let fHed.atxtColor_FHed -> [_ roll] in _CBcompRollOverClick roll @FHed_loadColorMap @FHed_getATxtColor; FHed_hideCheckColor; /* constr. alphabitmap for comprollover */ ggd_setRoot fHed.root2_FHed; let htoi fHed.bkgColorParam_FHed -> color in set fHed.bkgColor_FHed = ggd_CRrollOverCustom [(tcx+170) (tcy+50)] 30 80 nil color nil; let fHed.bkgColor_FHed -> [_ roll] in _CBcompRollOverClick roll @FHed_loadColorMap @FHed_getBkgColor; FHed_hideCheckBitmap; /* buttons callback */ _CBcompCheckClick fHed.bkgColorCheck_FHed @FHed_CBcheckClick ["color" fHed.bkgBitmapCheck_FHed]; _CBcompCheckClick fHed.bkgBitmapCheck_FHed @FHed_CBcheckClick ["bitmap" fHed.bkgColorCheck_FHed]; _CBcompCheckStateChanged fHed.bkgColorCheck_FHed @FHed_CBcheckState "color"; _CBcompCheckStateChanged fHed.bkgBitmapCheck_FHed @FHed_CBcheckState "bitmap"; if (!strcmp fHed.bkgCheckParam_FHed "color") then _SETcompCheckState fHed.bkgColorCheck_FHed CHK_CHECKED else if (!strcmp fHed.bkgCheckParam_FHed "bitmap") then _SETcompCheckState fHed.bkgBitmapCheck_FHed CHK_CHECKED else nil; ggd_SETcompText fHed.bkgBitmapFln_FHed fHed.bkgBitmapParam_FHed; ggd_SETcompText fHed.questionBitmap_FHed fHed.questionBitmapParam_FHed; ggd_SETcompText fHed.answerBitmap_FHed fHed.answerBitmapParam_FHed; ggd_SETcompText fHed.backBitmap_FHed fHed.backBitmapParam_FHed; ); 1;; /*******************************/ /* return Parameters */ /*******************************/ fun FHed_getParams () = ("qfontParam_FHed"::fHed.qfontParam_FHed::nil):: ("qsizeParam_FHed"::fHed.qsizeParam_FHed::nil):: ("qcolorParam_FHed"::fHed.qcolorParam_FHed::nil):: ("qMinHeightParam_FHed"::fHed.qMinHeightParam_FHed::nil):: ("afontParam_FHed"::fHed.afontParam_FHed::nil):: ("asizeParam_FHed"::fHed.asizeParam_FHed::nil):: ("acolorParam_FHed"::fHed.acolorParam_FHed::nil):: ("aMinHeightParam_FHed"::fHed.aMinHeightParam_FHed::nil):: ("bkgCheckParam_FHed"::fHed.bkgCheckParam_FHed::nil):: ("bkgColorParam_FHed"::fHed.bkgColorParam_FHed::nil):: ("bkgBitmapParam_FHed"::fHed.bkgBitmapParam_FHed::nil):: ("questionBitmapParam_FHed"::fHed.questionBitmapParam_FHed::nil):: ("answerBitmapParam_FHed"::fHed.answerBitmapParam_FHed::nil):: ("backBitmapParam_FHed"::fHed.backBitmapParam_FHed::nil):: nil;; /***********************************************************************************/ /***********************************************************************************/ /** **/ /** M E N U O F C O N F I G U R A T I O N S **/ /** **/ /***********************************************************************************/ /***********************************************************************************/ /*******************************/ /* resize graphic components */ /*******************************/ fun Hed_resize (cont, z, state, w, h) = set hed.cw_Hed = w; set hed.ch_Hed = h; 1;; fun Hed_enableUpArrow () = let hed.upArrow_Hed -> [_ roll] in _CHANGEobjNodeFlags (_CONVERTcompRollOverToObjNode roll) OBJ_ENABLE|OBJ_VISIBLE|ROL_MASK|ROL_DISABLE 0; _PAINTcontainer hed.cont_Hed; 1;; fun Hed_disableUpArrow () = let hed.upArrow_Hed -> [_ roll] in _CHANGEobjNodeFlags (_CONVERTcompRollOverToObjNode roll) OBJ_DISABLE|OBJ_VISIBLE|ROL_MASK|ROL_DISABLE 0; _PAINTcontainer hed.cont_Hed; 1;; fun Hed_enableDownArrow () = let hed.downArrow_Hed -> [_ roll] in _CHANGEobjNodeFlags (_CONVERTcompRollOverToObjNode roll) OBJ_ENABLE|OBJ_VISIBLE|ROL_MASK|ROL_DISABLE 0; _PAINTcontainer hed.cont_Hed; 1;; fun Hed_disableDownArrow () = let hed.downArrow_Hed -> [_ roll] in _CHANGEobjNodeFlags (_CONVERTcompRollOverToObjNode roll) OBJ_DISABLE|OBJ_VISIBLE|ROL_MASK|ROL_DISABLE 0; _PAINTcontainer hed.cont_Hed; 1;; /************************************/ /* select a configuration menu item */ /************************************/ fun Hed_select (combo, z, index) = if (index == 0) then ( Hed_disableUpArrow; Hed_disableDownArrow; GHed_show; THed_hide; FHed_hideRoot1; FHed_hideRoot2; ) else if (index == 1) then ( Hed_disableUpArrow; Hed_disableDownArrow; GHed_hide; THed_show; FHed_hideRoot1; FHed_hideRoot2; ) else if (index == 2) then ( Hed_enableUpArrow; Hed_disableDownArrow; GHed_hide; THed_hide; FHed_showRoot1 nil nil nil nil nil nil; ) else nil; 1;; /*******************************/ /* destroy graphic components */ /*******************************/ fun Hed_destroy (cont, z) = GHed_destroy; THed_destroy; FHed_destroy; let hed.frame_Hed -> [alpha cbmp] in ( _DSalphaBitmap alpha; _DScompBitmap cbmp; ); GRAPHICDRESSING_DScompCombo hed.combo_Hed; let hed.upArrow_Hed -> [alpha roll] in ( _DSalphaBitmap alpha; _DScompRollOver roll; ); let hed.downArrow_Hed -> [alpha roll] in ( _DSalphaBitmap alpha; _DScompRollOver roll; ); 1;; /*******************************/ /* create graphic components */ /*******************************/ fun Hed_create (cont, w, h) = set hed.cont_Hed = cont; _CBcontainerPreDestroy cont @Hed_destroy nil; ggd_setCont cont; _CBcontainerSize cont @Hed_resize nil; set hed.frame_Hed = ggd_CRframe hed.cx_Hed hed.cy_Hed hed.cw_Hed hed.ch_Hed nil ggd_bkgColor nil; let hed.frame_Hed -> [alpha _] in ggd_ADD3Dborder alpha 0 0 hed.cw_Hed hed.ch_Hed nil; 1;; /*******************************************/ /* create combo menu (over all containers) */ /*******************************************/ fun Hed_createMenu () = ggd_setRoot nil; ggd_PUSHfont; ggd_CRfont nil 18 "Arial" 0 0x000000; set hed.combo_Hed = ggd_CRcombo 25 10 260 80 (OBJ_ENABLE|OBJ_VISIBLE|OBJ_MW_FLEX); _ADDcompCombo hed.combo_Hed 0 [(_loc this "HED_GENERAL" nil) nil]; _ADDcompCombo hed.combo_Hed 1 [(_loc this "HED_TITLES" nil) nil]; _ADDcompCombo hed.combo_Hed 2 [(_loc this "HED_FIELDS" nil) nil]; _CBcompComboClick hed.combo_Hed @Hed_select nil; ggd_POPfont; set hed.upArrow_Hed = ggd_CRrollOverCustom [510 140] 0 0 OBJ_ENABLE|OBJ_VISIBLE|ROL_MASK|ROL_DISABLE nil "dms/tools/help/helpviewer/maps/high.png"; set hed.downArrow_Hed = ggd_CRrollOverCustom [510 210] 0 0 OBJ_ENABLE|OBJ_VISIBLE|ROL_MASK|ROL_DISABLE nil "dms/tools/help/helpviewer/maps/low.png"; let hed.upArrow_Hed -> [_ roll] in _CBcompRollOverClick roll @FHed_showRoot1 nil; let hed.downArrow_Hed -> [_ roll] in _CBcompRollOverClick roll @FHed_showRoot2 nil; Hed_disableUpArrow; Hed_disableDownArrow; 1;; /**********************************************************************************/ /**********************************************************************************/ /** **/ /** I N I T I A L I S A T I O N **/ /** **/ /**********************************************************************************/ /**********************************************************************************/ var edW = 540;; var edH = 400;; typeof ed = Editor;; typeof themeFln = S;; fun save (filename, n)= listcat listcat listcat ("action"::"start"::nil):: ("actionC"::"answer"::nil):: ("actionC"::"make it ask"::nil):: ("eventC"::"ask"::nil):: ("zoneC"::"HelpViewerIcon"::nil)::nil GHed_getParams THed_getParams FHed_getParams;; fun loadGHedParams (l) = let getInfo l "widthParam_GHed" -> wp_g in let if (wp_g == nil) then "305" else wp_g -> wp_g in let getInfo l "iconeCheckParam_GHed" -> icp_g in let if (icp_g == nil) then "middle" else icp_g -> icp_g in let getInfo l "iconeFlnParam_GHed" -> ifp_g in let if (ifp_g == nil) then let strextr _getpack _checkpack themeFln -> themeContent in let hd (tl (tl (hd themeContent))) -> themePath in strcat themePath (getInfo themeContent "HELP_ICONE") else ifp_g -> ifp_g in let getInfo l "textParam_GHed" -> tp_g in let if (tp_g == nil) then "HELP" else tp_g -> tp_g in ( set gHed.widthParam_GHed = wp_g; set gHed.iconeCheckParam_GHed = icp_g; set gHed.iconeFlnParam_GHed = ifp_g; set gHed.textParam_GHed = tp_g; );; fun loadTHedParams (l) = let getInfo l "fontParam_THed" -> fp_t in let if (fp_t == nil) then "Arial" else fp_t -> fp_t in let getInfo l "sizeParam_THed" -> sp_t in let if (sp_t == nil) then "14" else sp_t -> sp_t in let getInfo l "colorParam_THed" -> cp_t in let if (cp_t == nil) then "0xffffff" else cp_t -> cp_t in let getInfo l "minHeightParam_THed" -> mh_t in let if (mh_t == nil) then "18" else mh_t -> mh_t in let getInfo l "bkgCheckParam_THed" -> bf_t in let if (bf_t == nil) then "color" else bf_t -> bf_t in let getInfo l "bkgColorParam_THed" -> bcp_t in let if (bcp_t == nil) then "0x0078ff" else bcp_t -> bcp_t in let getInfo l "bkgBitmapParam_THed" -> bbp_t in let if (bbp_t == nil) then "" else bbp_t -> bbp_t in ( set tHed.fontParam_THed = fp_t; set tHed.sizeParam_THed = sp_t; set tHed.colorParam_THed = cp_t; set tHed.minHeightParam_THed = mh_t; set tHed.bkgCheckParam_THed = bf_t; set tHed.bkgColorParam_THed = bcp_t; set tHed.bkgBitmapParam_THed = bbp_t; );; fun loadFHedParams (l) = let getInfo l "qfontParam_FHed" -> qfp_f in let if (qfp_f == nil) then "Arial" else qfp_f -> qfp_f in let getInfo l "qsizeParam_FHed" -> qsp_f in let if (qsp_f == nil) then "14" else qsp_f -> qsp_f in let getInfo l "qcolorParam_FHed" -> qcp_f in let if (qcp_f == nil) then "0xffffff" else qcp_f -> qcp_f in let getInfo l "qMinHeightParam_FHed" -> qmh_f in let if (qmh_f == nil) then "18" else qmh_f -> qmh_f in let getInfo l "afontParam_FHed" -> afp_f in let if (afp_f == nil) then "Arial" else afp_f -> afp_f in let getInfo l "asizeParam_FHed" -> asp_f in let if (asp_f == nil) then "14" else asp_f -> asp_f in let getInfo l "acolorParam_FHed" -> acp_f in let if (acp_f == nil) then "0xffffff" else acp_f -> acp_f in let getInfo l "aMinHeightParam_FHed" -> amh_f in let if (amh_f == nil) then "18" else amh_f -> amh_f in let getInfo l "bkgCheckParam_FHed" -> bch_f in let if (bch_f == nil) then "color" else bch_f -> bch_f in let getInfo l "bkgColorParam_FHed" -> bc_f in let if (bc_f == nil) then "0xa3a3a3" else bc_f -> bc_f in let getInfo l "bkgBitmapParam_FHed" -> bb_f in let if (bb_f == nil) then "" else bb_f -> bb_f in let getInfo l "questionBitmapParam_FHed" -> qbmp_f in let if (qbmp_f == nil) then "dms/tools/help/helpviewer/maps/questionbutton.png" else qbmp_f -> qbmp_f in let getInfo l "answerBitmapParam_FHed" -> abmp_f in let if (abmp_f == nil) then "dms/tools/help/helpviewer/maps/answerbutton.png" else abmp_f -> abmp_f in let getInfo l "backBitmapParam_FHed" -> bbmp_f in let if (bbmp_f == nil) then "dms/tools/help/helpviewer/maps/backbutton.png" else bbmp_f -> bbmp_f in ( set fHed.qfontParam_FHed = qfp_f; set fHed.qsizeParam_FHed = qsp_f; set fHed.qcolorParam_FHed = qcp_f; set fHed.qMinHeightParam_FHed = qmh_f; set fHed.afontParam_FHed = afp_f; set fHed.asizeParam_FHed = asp_f; set fHed.acolorParam_FHed = acp_f; set fHed.aMinHeightParam_FHed = amh_f; set fHed.bkgCheckParam_FHed = bch_f; set fHed.bkgColorParam_FHed = bc_f; set fHed.bkgBitmapParam_FHed = bb_f; set fHed.questionBitmapParam_FHed = qbmp_f; set fHed.answerBitmapParam_FHed = abmp_f; set fHed.backBitmapParam_FHed = bbmp_f; );; fun load (l) = loadGHedParams l; loadTHedParams l; loadFHedParams l; 1;; fun IniEditor(filename)= set hed = mkHed [nil nil edW edH 0 45 (edW-40) (edH-45) nil nil nil]; set gHed = mkGHed [nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil]; set tHed = mkTHed [nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil]; set fHed = mkFHed [nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil]; ggd_init _channel; set themeFln = "dms/tools/help/helpviewer/helpviewer.thm"; set ed = startEditor _channel nil 0 0 edW edH WN_NORMAL-WN_SIZEBOX EDITOR_NORMAL filename "dms/Tools/Help/HelpViewer/HelpViewer.dmc" "dms/Tools/Help/HelpViewer/help/help.htm" "dms/Tools/Help/HelpViewer/HelpViewer.bmp" nil @save nil; load (strextr _getpack _checkpack filename); if filename==nil then nil else openDMI ed; Hed_create (getEditCont ed) edW edH; GHed_create; GHed_loadParams; THed_create; THed_loadParams; FHed_create; FHed_loadParams; Hed_createMenu; _SHOWcontainer hed.cont_Hed CONTAINER_UNHIDDEN; _PAINTcontainer hed.cont_Hed; 0;;