subroutine edt_FadeSelection( edtID, bFade ) /* Author : Darth C, Sprezzatura Actual Date : Sep 09 Purpose : Function to adjust the row selection color of an edit table Parameters ========== edtID -> Fully qualified name of the edit table bFade -> If TRUE then fade the selection color, otherwise reset it to normal Requirements ============ */ declare function rgb $insert winAPI_EditTable_Equates $insert winAPI_SysColor_Equates $insert logical if assigned( edtID ) else edtID = "" if assigned( bFade ) else bFade = FALSE$ if len( edtID ) then if ( bFade ) then goSub fadeSelectionColor end else goSub resetSelectionColor end end return /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// fadeSelectionColor: origColor = winAPI_GetSysColor( SYSCOLOR_HIGHLIGHT$ ) origColor = fmt( oconv( origColor, "MB" ), "R(0)#32" ) bleach = 185 ; * // this is how much white we want to add...(0..255) selColor = iconv( origColor[25,8], "MB" ) selColor := @fm : iconv( origColor[17,8], "MB" ) selColor := @fm : iconv( origColor[9,8], "MB" ) * // Now add the bleach to each component for x = 1 to 3 pct = ( 1 - ( selColor/255 ) ) selColor = selColor + int( pct * bleach ) next selColor = rgb( selColor<1>, selColor<2>, selColor<3> ) txtColor = winAPI_GetSysColor( SYSCOLOR_WINDOWTEXT$ ) if txtColor else * // 0 (BLACK) means "default color" in COLOR_BY_POS processing!!! txtColor += 1 end dtcs = DT_DEFAULTCOLOR$ | : @fm : DT_DEFAULTCOLOR$ | : @fm : selColor | : @fm : txtColor call send_Message( edtID, "COLOR_BY_POS", 0, 0, dtcs ) return /////////////////////////////////////////////////////////////////////////////// resetSelectionColor: dtcs = DT_DEFAULTCOLOR$ | : @fm : DT_DEFAULTCOLOR$ | : @fm : DT_DEFAULTCOLOR$ | : @fm : DT_DEFAULTCOLOR$ call send_Message( edtID, "COLOR_BY_POS", 0, 0, dtcs ) return /////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////