$PBExportHeader$u_lv.sru $PBExportComments$Base Listview Object forward global type u_lv from listview end type end forward global type u_lv from listview integer width = 411 integer height = 324 integer textsize = -8 integer weight = 400 fontcharset fontcharset = ansi! fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "Tahoma" long textcolor = 33554432 borderstyle borderstyle = stylelowered! boolean autoarrange = true boolean extendedselect = true boolean fixedlocations = true boolean hideselection = false boolean fullrowselect = true listviewview view = listviewreport! long largepicturemaskcolor = 536870912 long smallpicturemaskcolor = 536870912 long statepicturemaskcolor = 536870912 event ke_constructor ( ) end type global u_lv u_lv type variables Public: Boolean #StandardImages Boolean #SortIcons = TRUE //Size Order Long #SizeOrder //Anchoring Boolean #AnchorTop Boolean #AnchorLeft Boolean #AnchorRight Boolean #AnchorBottom //Docking Boolean #Dock //Dock Padding Long #DockType, #DockPadTop, #DockPadLeft, #DockPadRight, #DockPadBottom //Dock control reference String #Dock_Control_Top, #Dock_Control_Left, #Dock_Control_Right, #Dock_Control_Bottom Private: str_resize istr_resize integer ii_lastcolumn boolean ib_ascending, ib_imagelistassigned //used for user defined sorts integer ii_sortcolumns[] string is_sortcolumndatatypes[] long il_usersort end variables forward prototypes public function str_resize of_getresizeattrib () protected function integer of_getsortcolumn (readonly integer ai_col) public subroutine of_adduserdefinedsort (readonly integer ai_column, readonly string as_type) public subroutine of_imagelistassigned () protected subroutine of_swapdummyimagelist () public subroutine of_loadstandardimages () end prototypes event ke_constructor();of_LoadStandardImages() end event public function str_resize of_getresizeattrib ();istr_resize.Control = this istr_resize.ControlName = ClassName(this) istr_resize.SizeOrder = #SizeOrder istr_resize.SizeOrder = #SizeOrder istr_resize.Dock = #Dock istr_resize.DockType = #DockType istr_resize.DockPadTop = #DockPadTop istr_resize.DockPadLeft = #DockPadLeft istr_resize.DockPadRight = #DockPadRight istr_resize.DockPadBottom = #DockPadBottom istr_resize.AnchorTop = #AnchorTop istr_resize.AnchorLeft = #AnchorLeft istr_resize.AnchorRight = #Anchorright istr_resize.AnchorBottom = #Anchorbottom istr_resize.reftop = #Dock_Control_top istr_resize.refleft = #Dock_Control_left istr_resize.refright = #Dock_Control_right istr_resize.refbottom = #Dock_Control_bottom istr_resize.bounds.left = X istr_resize.bounds.top = Y istr_resize.bounds.right = width istr_resize.bounds.bottom = height RETURN istr_resize end function protected function integer of_getsortcolumn (readonly integer ai_col);long ll_count, n ll_count = UPPERBOUND(ii_sortcolumns) FOR n = 1 to ll_count IF ii_sortcolumns[n] = ai_col THEN RETURN n NEXT RETURN CRet.FAILURE end function public subroutine of_adduserdefinedsort (readonly integer ai_column, readonly string as_type);long ll_upper ll_upper = of_GetSortColumn(ai_column) IF ll_upper = CRet.FAILURE THEN ll_upper = UPPERBOUND(ii_sortcolumns) ll_upper ++ END IF ii_sortcolumns[ll_upper] = ai_column is_sortcolumndatatypes[ll_upper] = as_type end subroutine public subroutine of_imagelistassigned ();ib_imagelistassigned = TRUE end subroutine protected subroutine of_swapdummyimagelist ();n_svc_mgr lnv_svc n_svc_lv lnv_lv n_svc_resource lnv_res long ll lnv_svc.of_LoadSvc(lnv_res, CSvc.RESOURCE) lnv_svc.of_LoadSvc(lnv_lv, CSvc.LV) ll = lnv_res.of_GetDummyimagelist(lnv_svc) lnv_lv.of_SetLargeimagelist(this, ll) lnv_lv.of_SetSmallimagelist(this, ll) end subroutine public subroutine of_loadstandardimages ();IF #StandardImages THEN n_svc_mgr lnv_svc n_svc_lv lnv_lv lnv_svc.of_LoadSvc(lnv_lv, CSvc.LV) lnv_lv.of_LoadStandardImages(lnv_svc, this) END IF end subroutine on u_lv.create end on on u_lv.destroy end on event columnclick;n_svc_mgr lnv_svc n_svc_lv lnv_lv IF #SortIcons THEN lnv_svc.of_LoadSvc(lnv_lv, CSvc.LV) SetPointer(Hourglass!) il_usersort = of_GetSortColumn(column) IF il_usersort = CRet.FAILURE THEN IF column <> ii_lastcolumn THEN ii_lastcolumn = column ib_ascending = TRUE this.Sort(Ascending!, column) ELSE IF ib_ascending THEN this.Sort(Descending!, column) ELSE this.Sort(Ascending!, column) END IF ib_ascending = NOT ib_ascending END IF ELSE //user defined sort IF column <> ii_lastcolumn THEN ii_lastcolumn = column ib_ascending = TRUE this.Sort(UserDefinedSort!, column) ELSE ib_ascending = NOT ib_ascending this.Sort(UserDefinedSort!, column) END IF END IF lnv_lv.of_SortColumn(lnv_svc, this, column, ib_ascending) SetPointer(Arrow!) END IF end event event sort;IF il_usersort = CRet.FAILURE THEN RETURN CRet.NO_ACTION n_svc_mgr lnv_mgr n_svc_lv lnv_lv lnv_mgr.of_LoadSvc(lnv_lv, CSvc.LV) RETURN lnv_lv.of_UserDefinedSort(this, column, is_sortcolumndatatypes[il_usersort], ib_ascending, index1, index2) end event event destructor;IF ib_imagelistassigned THEN //swap a dummy imagelist of_swapdummyimagelist() END IF end event event key;IF key = KeyEnter! THEN long ll n_svc_mgr lnv_svc n_svc_lv lnv_lv lnv_svc.of_LoadSvc(lnv_lv, CSvc.LV) ll = lnv_lv.of_GetSelectedItem(this) IF ll > 0 THEN this.event itemactivate(ll) END IF end event
- Sources
- Kodigo
- OpenExplorer
- u_lv.sru
File: u_lv.sru
Size: 5639
Date: Mon, 07 Apr 2008 21:30:46 +0200
Size: 5639
Date: Mon, 07 Apr 2008 21:30:46 +0200
- listview u_lv(sru)