Like the PURE_LVSORT user-library from Gnozal,
a SortGadgetItems() would be a nice feature and in the philosophy of purebasic.
Look at how i imagine such a command :
Code: Select all
Procedure.l SortGadgetItems(gID.l,column.l,type.l,option.l,mask.s)
; Description:
;
; SortGadgetItems() --> Sort elements in a ListViewGadget/ListIconGadget
;
; Input:
;
; gID.l --> GadgetID
; column.l --> Column Number (From O To n)
; type.l --> #PB_Sort_Integer, #PB_Sort_Float, #PB_Sort_String, #PB_Sort_Date
; option.l --> #PB_Sort_Asc, #PB_Sort_Desc, #PB_Sort_CaseSensitive
; mask.l --> In case of Date type : '%dd/%mm/%yyyy %hh:%ii'
;
; Output:
; Returns #True --> If Everything is OK.
; Returns #False --> If the specified gadget is not a list-type gadget.
; Returns #False --> If the specified column doesn't exists.
; Returns #False --> If the specified type isn't compatible with data presents in the column.
Result.l
; <code>
ProcedureReturn Result
EndProcedure