123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- $PBExportHeader$uo_piclistview.sru
- forward
- global type uo_piclistview from listview
- end type
- end forward
- global type uo_piclistview from listview
- integer width = 1943
- integer height = 1288
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- borderstyle borderstyle = stylelowered!
- boolean autoarrange = true
- boolean extendedselect = true
- boolean fixedlocations = true
- boolean gridlines = true
- long largepicturemaskcolor = 536870912
- long smallpicturemaskcolor = 536870912
- long statepicturemaskcolor = 536870912
- end type
- global uo_piclistview uo_piclistview
- type variables
- private:
- string PictureName[]
- end variables
- forward prototypes
- public subroutine uf_clear ()
- public subroutine uf_setsize (long arg_width, long arg_height)
- public function integer uf_getitems (ref s_piclistview_parm arg_s_pics[], ref string arg_msg)
- public function integer uf_additem (s_piclistview_parm arg_parm, ref string arg_msg)
- end prototypes
- public subroutine uf_clear ();This.DeleteItems()
- This.DeleteLargePictures()
- end subroutine
- public subroutine uf_setsize (long arg_width, long arg_height);This.LargePictureWidth = arg_width
- This.LargePictureHeight = arg_height
- end subroutine
- public function integer uf_getitems (ref s_piclistview_parm arg_s_pics[], ref string arg_msg);Int rslt = 1
- Long cnt
- cnt = UpperBound(arg_s_pics)
- Long i
- listviewitem lvi
- String ls_path
- FOR i = 1 To This.TotalItems()
- IF This.GetItem(i, lvi) <> 1 THEN
- rslt = 0
- arg_msg = 'getitem失败'
- GOTO ext
- END IF
- ls_path = This.PictureName[lvi.PictureIndex]
- cnt++
- arg_s_pics[cnt].Label = lvi.Label
- arg_s_pics[cnt].tmppath = ls_path
- arg_s_pics[cnt].a_any = lvi.Data
- IF f_filetoblob(ls_path, arg_s_pics[cnt].Data, arg_msg) <> 1 THEN
- rslt = 0
- GOTO ext
- END IF
- NEXT
- ext:
- RETURN rslt
- end function
- public function integer uf_additem (s_piclistview_parm arg_parm, ref string arg_msg);Int rslt = 1
- ListViewItem lvi
- Boolean lb_FileExists = False
- IF FileExists(arg_parm.tmppath) THEN
- lb_FileExists = True
- IF Not IsNull(arg_parm.Data) And Len(arg_parm.Data) > 0 THEN
- IF FileDelete(arg_parm.tmppath) THEN
- lb_FileExists = False
- END IF
- END IF
- END IF
- IF Not lb_FileExists THEN
- IF f_blobtofile(arg_parm.tmppath, arg_parm.Data, arg_msg) <> 1 THEN
- rslt = 0
- GOTO ext
- END IF
- END IF
- Long i
- i = This.AddLargePicture(arg_parm.tmppath)
- IF i <= 0 THEN
- rslt = 0
- arg_msg = '控件添加图片失败'
- GOTO ext
- END IF
- PictureName[i] = arg_parm.tmppath
- lvi.PictureIndex = i
- lvi.Label = arg_parm.Label
- lvi.Data = arg_parm.a_any
- This.AddItem(lvi)
- GOTO ext
- ext:
- RETURN rslt
- end function
- on uo_piclistview.create
- end on
- on uo_piclistview.destroy
- end on
|