Page 1 of 1
Posted: Wed Aug 22, 2001 9:05 pm
by BackupUser
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
Posted: Sat Nov 02, 2002 12:55 am
by BackupUser
Restored from previous forum. Originally posted by Kale.
any ideas on this guys? i am trying to catch the event triggered by clicking on the column headings/(buttons) to enable sorting by column.
Posted: Sat Nov 02, 2002 9:45 am
by BackupUser
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
Posted: Sat Nov 02, 2002 11:19 am
by BackupUser
Restored from previous forum. Originally posted by Justin.
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
Posted: Wed May 21, 2003 2:12 pm
by Mike
Great !
Does anybody know, what code needs to be added to the callback
to get also the selected row information ?
(I want to determine which row, col in the Gadget was clicked by the User)
Thanks,
Mike
Posted: Wed May 21, 2003 2:16 pm
by freak
Look ad my example in the other thread
row=*pnmlistview\iItem
That's the row.
Timo