Hi,
I am trying to find a way of retrieving/setting the order of the columns in a ListIcon Gaget, but I need some help.
Can someone tell me how I use these commands:
LVM_GETCOLUMNORDERARRAY
LVM_SETCOLUMNORDERARRAY
I can't figure out how to send/retrieve the required information.
Thanks for any help.
ListIconGadget Column Order
Hi,
I appear to me making progress with this, the following unfinished code seams to work:
I'll post the complete procedures here when I'm done 
I appear to me making progress with this, the following unfinished code seams to work:
Code: Select all
#LVM_SETCOLUMNORDERARRAY=4154
#LVM_GETCOLUMNORDERARRAY=4155
Procedure ListIcon_GetColumnOrderArray(Gadget,columns)
Dim num_columns(columns)
SendMessage_(GadgetID(Gadget),#LVM_GETCOLUMNORDERARRAY,columns,@num_columns(0))
EndProcedure

Here is the finished Procedures, any improvements or additions would be appreciated.
Code: Select all
; ListIcon Procedures
Dim ColumnOrder.l(20) ; Holds Number Of Columns In ListIcon Gadget
#LVM_SETCOLUMNORDERARRAY=4154
#LVM_GETCOLUMNORDERARRAY=4155
Procedure SetListIconColumnWidth(Gadget,ColumnIndex,ColumnWidth)
SendMessage_(GadgetID(Gadget),#LVM_SETCOLUMNWIDTH,ColumnIndex,ColumnWidth)
EndProcedure
Procedure.l GetListIconColumnWidth(Gadget,ColumnIndex)
ProcedureReturn SendMessage_(GadgetID(Gadget),#LVM_GETCOLUMNWIDTH,ColumnIndex,#Null)
EndProcedure
Procedure.l CountListIconColumns(Gadget)
lvc.LV_COLUMN\mask = #LVCF_WIDTH
Repeat
TotalColumns+1
Flag=SendMessage_(GadgetID(Gadget),#LVM_GETCOLUMN,TotalColumns,@lvc)
Until Flag=0
ProcedureReturn TotalColumns
EndProcedure
Procedure GetListIconColumnOrder(Gadget,TotalColumns)
; ColumnOrder() - Should Already Be Dimensioned Before Calling This Procedure
SendMessage_(GadgetID(Gadget),#LVM_GETCOLUMNORDERARRAY,TotalColumns,@ColumnOrder(0))
EndProcedure
Procedure SetListIconColumnOrder(Gadget,TotalColumns)
; ColumnOrder() - Should Already Be Dimensioned Before Calling This Procedure
SendMessage_(GadgetID(Gadget),#LVM_SETCOLUMNORDERARRAY,TotalColumns,@ColumnOrder(0))
EndProcedure
;Structure LV_COLUMN
; mask.l
; fmt.l
; cx.l
; pszText.l
; cchTextMax.l
; iSubItem.l
;EndStructure