解读以下PB9.0代码,并列出可视化流程,
//dw_1.of_setrfi(dw_1,0)
//dw_1.of_setrfi(dw_1,1)
//
//dw_1.of_setrfi(dw_1,0)
//dw_1.of_setrfi(dw_1,3)blue
//dw_1.of_setrfi(dw_1,0)
//dw_1.of_setrfi(dw_1,4)WHITE
//dw_1.of_setrfi(dw_1,0)
//dw_1.of_setrfi(dw_1,5)LIGHTER GRAY
//dw_1.of_setrfi(dw_1,0)
//dw_1.of_setrfi(dw_1,6)LIGHT GRAY
//dw_1.of_setrfi(dw_1,0)
//dw_1.of_setrfi(dw_1,7)LIGHT YELLOW
//dw_1.of_setrfi(dw_1,0)
//dw_1.of_setrfi(dw_1,8)LIGHT PINK
//dw_1.of_setrfi(dw_1,0)
//dw_1.of_setrfi(dw_1,9)LIGHT GREEN
//dw_1.of_setrfi(dw_1,0)
//dw_1.of_setrfi(dw_1,10)LIGHT ORANGE
//dw_1.of_setrfi(dw_1,0)
//dw_1.of_setrfi(dw_1,11)LIGHT BLUE
string ls_h, ls_err, ls_msg, ls_mod, ls_obj
string ls_bg_colour
long ll_width
ll_width = Long(adw.Object.DataWindow.HorizontalScrollMaximum)
//SetRowFocusIndicator的类型码
CHOOSE CASE ai_rfi_cd
CASE 0 //没有RowFocusIndicator
adw.SetRowFocusIndicator(Off!)
//关闭以前的RowFocusIndicator
//命名 “rf_rect”
ls_obj = adw.Object.DataWindow.Objects
if Pos(ls_obj, “rf_rect”) > 0 then
ls_mod = “destroy rf_rect”
ls_err = adw.Modify(ls_mod)
if ls_err <> “” then
ls_err = “Modify Error:” + ls_err
PopulateError(-1, ls_err)
goto lbl_err
end if
end if
CASE 1
adw.SetRowFocusIndicator(Hand!)
CASE 2
adw.SetRowFocusIndicator(FocusRect!)
CASE 3 to 11
CHOOSE CASE ai_rfi_cd
CASE 3
ls_bg_colour = string(RGB(0, 0,192)) //WHITE
CASE 4
ls_bg_colour = string(RGB(255, 255, 255)) //WHITE
CASE 5
ls_bg_colour = string(RGB(217, 217, 217)) //LIGHTER GRAY
CASE 6
ls_bg_colour = string(RGB(192, 192, 192)) //LIGHT GRAY
CASE 7
ls_bg_colour = string(RGB(255, 255, 200)) //LIGHT YELLOW
CASE 8
ls_bg_colour = string(RGB(255, 179, 217)) //LIGHT PINK
CASE 9
ls_bg_colour = string(RGB(140, 200, 200)) //LIGHT GREEN
CASE 10
ls_bg_colour = string(RGB(255, 211, 168)) //LIGHT ORANGE
CASE 11
ls_bg_colour = string(RGB(0, 192, 255)) //LIGHT BLUE
END CHOOSE
ll_width += adw.width
//创建Rectangle的语句
ls_mod = “Create Rectangle(band=detail” + &
" x=‘" + string(adw.X) + "’" +&
" y=‘0’" +&
" height=‘80~t if(1=1, RowHeight(), 80)’" +&
" width=‘" + string(ll_width) + "’" +&
" name=rf_rect " +&
" visible=‘1~t if(currentrow() = getrow(), 1, 0)’" +&
" brush.hatch=‘6’" + &
" brush.color=‘" + ls_bg_colour + "’" +&
" pen.style=‘0’" +&
" pen.width=‘5’" +&
" pen.color=‘" + string(RGB(0, 0, 0)) + "’" +&
" background.mode=‘2’" +&
" background.color=‘0’" +&
“)”
CASE 12
if adw.VscrollBar then
ll_width += adw.width - 130
else
ll_width += adw.width - 20
end if
//
ls_mod = “create text(band=Detail” +&
" color=‘0’" +&
" border=‘6’" +&
" x=‘" + string(adw.X + 10) + "’" +&
" y=‘0’" +&
" height=‘80~t if(1=1, RowHeight() - 5, 80)’" +&
" width=‘" + string(ll_width) + "’" +&
" text=‘’" +&
" name=rf_rect" +&
" visible=‘1~t if(currentrow() = getrow(), 1, 0)’" +&
" background.mode=‘2’" +&
" background.color=‘12632256’" +&
" )"
CASE ELSE
ls_err = “Illegal Option: " + String(ai_rfi_cd) + " !”
PopulateError(-1, ls_err)
goto lbl_err
END CHOOSE
CHOOSE CASE ai_rfi_cd
CASE 3 to 12
ls_err = adw.Modify(ls_mod)
if ls_err <> “” then
ls_err = “Modify Error:” + ls_err
PopulateError(-1, ls_err)
goto lbl_err
end if
if adw.SetPosition(“rf_rect”, “detail”, FALSE) <> 1 then
ls_err = “SetPosition Error.”
PopulateError(-1, ls_err)
goto lbl_err
end if
END CHOOSE
return true
//-------------------------------------------------------------------
lbl_err:
ls_msg = error.Text + ". " +&
“错误/信息 错误号.=” + String(error.Number) + “; ~r~n” +&
“窗体/菜单=” + error.WindowMenu + “; ~r~n” +&
“对象=” + error.Object + “; ~r~n” +&
“对象事件=” + error.Object + “; ~r~n” +&
“错误行号=” + String(error.Line) + “.”
MessageBox(“错误:”, ls_msg, Exclamation!)
return false