Restored from previous forum. Originally posted by Cantor.
Hi!
Is it possible to get the Event-Number of the selected column of a ListIconGadget, if ChangeListIconGadgetDisplay is set to 3 (column mode)?
EventGadgetID() only returns the GadgetNumber.
What Function returns the selected column?
--
Best regards,
Martin
ListIconGadget - Get Event for Selected Column
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by fweil.
...,
About sorting items by clicking at column head you should start with this tip from El_Choni.
viewtopic.php?t=869
Let me know if any trouble with, I have working programs using it.
Francois Weil
14, rue Douer
F64100 Bayonne
...,
About sorting items by clicking at column head you should start with this tip from El_Choni.
viewtopic.php?t=869
Let me know if any trouble with, I have working programs using it.
Francois Weil
14, rue Douer
F64100 Bayonne
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Justin.
To get the column index you need to work with the windows api:
To get the column index you need to work with the windows api:
Code: Select all
Structure NMLISTVIEW
hdr.NMHDR
iItem.l
iSubItem.l
uNewState.l
uOldState.l
uChanged.l
ptAction.POINT
lParam.l
EndStructure
;window callback
procedure wndproc(hwnd,msg,wparam,lparam)
shared hlv
ret=#PB_ProcessPureBasicEvents
select msg
case #WM_NOTIFY
*pnmhdr.NMHDR=lparam
if *pnmhdr\code=#LVN_COLUMNCLICK ;column click
*pnmlistview.NMLISTVIEW=lparam
if *pnmlistview\hdr\hwndFrom=hlv ;comes from our listicon
column=*pnmlistview\iSubItem
messagerequester("",str(column),0)
endif
endif
endselect
procedurereturn ret
endprocedure
hwnd=openwindow(0,100,100,300,150,#PB_Window_SystemMenu,"Column Click")
creategadgetlist(hwnd)
hlv=ListIconGadget(1,10,10,250,100,"Column 0",80)
AddGadgetColumn(1,1,"Column 1",80)
AddGadgetColumn(1,2,"Column 2",80)
setwindowcallback(@wndproc())
repeat
until waitwindowevent()=#PB_EventCloseWindow