$PBExportHeader$u_others_imagelist.sru forward global type u_others_imagelist from u_explorer end type type cbx_1 from u_cbx within u_others_imagelist end type type cb_1 from u_cb within u_others_imagelist end type type rb_3 from u_rb within u_others_imagelist end type type rb_2 from u_rb within u_others_imagelist end type type rb_1 from u_rb within u_others_imagelist end type type lv_1 from u_lv within u_others_imagelist end type type gb_1 from u_gb within u_others_imagelist end type end forward global type u_others_imagelist from u_explorer cbx_1 cbx_1 cb_1 cb_1 rb_3 rb_3 rb_2 rb_2 rb_1 rb_1 lv_1 lv_1 gb_1 gb_1 end type global u_others_imagelist u_others_imagelist type variables CONSTANT string CUSTOM_24 = "custom_images24" CONSTANT string CUSTOM_16 = "custom_images16" ulong iul_standard24, iul_standard16 ulong iul_c_himl24, iul_c_himl16 ulong iul_cm_himl24, iul_cm_himl16 CONSTANT integer STANDARD = 1 CONSTANT integer CUSTOM = 2 CONSTANT integer MIXED = 3 CONSTANT string MIXED_IML24 = "MyMixedImages24" CONSTANT string MIXED_IML16 = "MyMixedImages16" end variables forward prototypes public subroutine of_populatelistview (readonly long al_count) public subroutine of_setimagelist (readonly integer ai_idx) end prototypes public subroutine of_populatelistview (readonly long al_count);long n listviewitem llvi lv_1.DeleteItems() FOR n = 1 to al_count llvi.Label = "Image " + STRING(n) llvi.PictureIndex = n lv_1.AddItem(llvi) NEXT end subroutine public subroutine of_setimagelist (readonly integer ai_idx);n_svc_mgr lnv_svc n_svc_lv lnv_lv n_svc_imagelist lnv_img long ll_count lnv_svc.of_LoadSvc(lnv_lv, CSvc.LV) lnv_svc.of_LoadSvc(lnv_img, CSvc.IMAGELIST) lv_1.SetRedraw(FALSE) CHOOSE CASE ai_idx CASE STANDARD ll_count = lnv_img.of_getimagecount(iul_standard24) lnv_lv.of_setlargeimagelist(lv_1, iul_standard24) lnv_lv.of_setsmallimagelist(lv_1, iul_standard16) CASE CUSTOM ll_count = lnv_img.of_getimagecount(iul_c_himl24) lnv_lv.of_setlargeimagelist(lv_1, iul_c_himl24) lnv_lv.of_setsmallimagelist(lv_1, iul_c_himl16) CASE MIXED ll_count = lnv_img.of_getimagecount(iul_standard24) lnv_lv.of_setlargeimagelist(lv_1, iul_cm_himl24) lnv_lv.of_setsmallimagelist(lv_1, iul_cm_himl16) END CHOOSE of_populatelistview(ll_count) lv_1.SetRedraw(TRUE) end subroutine on u_others_imagelist.create int iCurrent call super::create this.cbx_1=create cbx_1 this.cb_1=create cb_1 this.rb_3=create rb_3 this.rb_2=create rb_2 this.rb_1=create rb_1 this.lv_1=create lv_1 this.gb_1=create gb_1 iCurrent=UpperBound(this.Control) this.Control[iCurrent+1]=this.cbx_1 this.Control[iCurrent+2]=this.cb_1 this.Control[iCurrent+3]=this.rb_3 this.Control[iCurrent+4]=this.rb_2 this.Control[iCurrent+5]=this.rb_1 this.Control[iCurrent+6]=this.lv_1 this.Control[iCurrent+7]=this.gb_1 end on on u_others_imagelist.destroy call super::destroy destroy(this.cbx_1) destroy(this.cb_1) destroy(this.rb_3) destroy(this.rb_2) destroy(this.rb_1) destroy(this.lv_1) destroy(this.gb_1) end on event ke_postopen;call super::ke_postopen;lv_1.AddColumn("Image", Left!, lv_1.width - 48) end event type cbx_1 from u_cbx within u_others_imagelist integer x = 329 integer y = 624 integer width = 366 string text = "Large Images" boolean checked = true end type event clicked;call super::clicked;IF checked THEN lv_1.View = ListViewLargeIcon! ELSE lv_1.View = ListViewReport! END IF end event type cb_1 from u_cb within u_others_imagelist integer x = 329 integer y = 496 integer width = 430 integer taborder = 20 string text = "Create Imagelists" end type event clicked;call super::clicked;n_svc_mgr lnv_svc n_svc_resource lnv_r string ls[] lnv_svc.of_LoadSvc(lnv_r, CSvc.RESOURCE) //standard iul_standard24 = lnv_r.of_GetStandardImagelist24(lnv_svc) iul_standard16 = lnv_r.of_GetStandardImagelist16(lnv_svc) //custom, using dwimages (automatic caching after create) iul_c_himl24 = lnv_r.of_GetDWImagelist(lnv_svc, CUSTOM_24, 24, 24) iul_c_himl16 = lnv_r.of_GetDWImagelist(lnv_svc, CUSTOM_16, 16, 16) //test for cached mixed custom iul_cm_himl24 = lnv_r.of_GetImagelist(MIXED_IML24) IF iul_cm_himl24 <> CRet.FAILURE THEN iul_cm_himl16 = lnv_r.of_GetImagelist(MIXED_IML16) ELSE //create custom mixed n_svc_imagelist lnv_img long ll_count, n lnv_svc.of_LoadSvc(lnv_img, CSvc.IMAGELIST) iul_cm_himl24 = lnv_img.of_Create(24, 24, lnv_img.ILC_COLOR32 + lnv_img.ILC_MASK, 0, 1) iul_cm_himl16 = lnv_img.of_Create(16, 16, lnv_img.ILC_COLOR32 + lnv_img.ILC_MASK, 0, 1) //add custom first //NOTE: zero based index for WIN32 Imagelist, so -1 ll_count = lnv_img.of_GetImageCount(iul_c_himl24) FOR n = 1 to ll_count lnv_img.of_AddIcon(iul_cm_himl24, & lnv_img.of_GetIcon(iul_c_himl24, n - 1, 0) ) lnv_img.of_AddIcon(iul_cm_himl16, & lnv_img.of_GetIcon(iul_c_himl16, n - 1, 0) ) NEXT //add other ll_count = lnv_img.of_GetImageCount(iul_standard24) FOR n = 1 to ll_count lnv_img.of_AddIcon(iul_cm_himl24, & lnv_img.of_GetIcon(iul_standard24, n - 1, 0) ) lnv_img.of_AddIcon(iul_cm_himl16, & lnv_img.of_GetIcon(iul_standard16, n - 1, 0) ) NEXT //OPTION: //or just merge 2 imagelists //using n_svc_resource: //lnv_r.of_mergeimagelists( /*ref n_svc_mgr anv_svc*/, /*readonly long al_imagelists[]*/, /*readonly long al_size */) //register with n_svc_resource //so we can re-use it globally across windows/objects lnv_r.of_AddImageList(MIXED_IML24, iul_cm_himl24, ls) lnv_r.of_AddImageList(MIXED_IML16, iul_cm_himl16, ls) END IF of_SetImageList(STANDARD) this.Enabled = FALSE end event type rb_3 from u_rb within u_others_imagelist integer x = 110 integer y = 304 integer width = 594 string text = "Mixed Standard/Custom" end type event clicked;call super::clicked;of_SetImageList(MIXED) end event type rb_2 from u_rb within u_others_imagelist integer x = 110 integer y = 216 string text = "Custom" end type event clicked;call super::clicked;of_SetImageList(CUSTOM) end event type rb_1 from u_rb within u_others_imagelist integer x = 110 integer y = 128 string text = "Standard" boolean checked = true end type event clicked;call super::clicked;of_SetImageList(STANDARD) end event type lv_1 from u_lv within u_others_imagelist integer x = 805 integer y = 48 integer width = 841 integer height = 864 integer taborder = 10 listviewview view = listviewlargeicon! boolean #anchortop = true boolean #anchorleft = true boolean #anchorright = true boolean #anchorbottom = true end type type gb_1 from u_gb within u_others_imagelist integer x = 37 integer y = 32 integer width = 722 integer height = 420 integer taborder = 20 string text = "Imagelists" borderstyle borderstyle = stylebox! end type
- Sources
- Kodigo
- OpenExplorer
- u_others_imagelist.sru
File: u_others_imagelist.sru
Size: 6935
Date: Mon, 07 Apr 2008 21:33:15 +0200
Size: 6935
Date: Mon, 07 Apr 2008 21:33:15 +0200
- u_explorer u_others_imagelist(sru)